@kard-financial/sdk 5.0.0 → 5.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.
Files changed (44) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/BaseClient.d.ts +4 -0
  3. package/dist/cjs/BaseClient.js +3 -2
  4. package/dist/cjs/api/resources/auth/client/Client.js +8 -6
  5. package/dist/cjs/api/resources/files/client/Client.js +8 -6
  6. package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +24 -18
  7. package/dist/cjs/api/resources/ping/client/Client.js +8 -6
  8. package/dist/cjs/api/resources/transactions/client/Client.js +40 -30
  9. package/dist/cjs/api/resources/users/client/Client.js +32 -24
  10. package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +24 -18
  11. package/dist/cjs/api/resources/users/resources/auth/client/Client.js +8 -6
  12. package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +16 -12
  13. package/dist/cjs/api/resources/users/resources/rewards/types/ComponentType.d.ts +1 -0
  14. package/dist/cjs/api/resources/users/resources/rewards/types/ComponentType.js +1 -0
  15. package/dist/cjs/api/resources/users/resources/rewards/types/OfferComponents.d.ts +2 -0
  16. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBar.d.ts +13 -0
  17. package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBar.js +3 -0
  18. package/dist/cjs/api/resources/users/resources/rewards/types/index.d.ts +1 -0
  19. package/dist/cjs/api/resources/users/resources/rewards/types/index.js +1 -0
  20. package/dist/cjs/api/resources/users/resources/uploads/client/Client.js +24 -18
  21. package/dist/cjs/version.d.ts +1 -1
  22. package/dist/cjs/version.js +1 -1
  23. package/dist/esm/BaseClient.d.mts +4 -0
  24. package/dist/esm/BaseClient.mjs +3 -2
  25. package/dist/esm/api/resources/auth/client/Client.mjs +9 -7
  26. package/dist/esm/api/resources/files/client/Client.mjs +9 -7
  27. package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +25 -19
  28. package/dist/esm/api/resources/ping/client/Client.mjs +9 -7
  29. package/dist/esm/api/resources/transactions/client/Client.mjs +41 -31
  30. package/dist/esm/api/resources/users/client/Client.mjs +33 -25
  31. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +25 -19
  32. package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +9 -7
  33. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +17 -13
  34. package/dist/esm/api/resources/users/resources/rewards/types/ComponentType.d.mts +1 -0
  35. package/dist/esm/api/resources/users/resources/rewards/types/ComponentType.mjs +1 -0
  36. package/dist/esm/api/resources/users/resources/rewards/types/OfferComponents.d.mts +2 -0
  37. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBar.d.mts +13 -0
  38. package/dist/esm/api/resources/users/resources/rewards/types/ProgressBar.mjs +2 -0
  39. package/dist/esm/api/resources/users/resources/rewards/types/index.d.mts +1 -0
  40. package/dist/esm/api/resources/users/resources/rewards/types/index.mjs +1 -0
  41. package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +25 -19
  42. package/dist/esm/version.d.mts +1 -1
  43. package/dist/esm/version.mjs +1 -1
  44. package/package.json +1 -1
@@ -102,21 +102,23 @@ class AttributionsClient {
102
102
  }
103
103
  __create(organizationId, userId, request, requestOptions) {
104
104
  return __awaiter(this, void 0, void 0, function* () {
105
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
105
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
106
106
  const _authRequest = yield this._options.authProvider.getAuthRequest();
107
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
107
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
108
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
109
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
108
110
  const _response = yield core.fetcher({
109
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/attributions`),
111
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/attributions`),
110
112
  method: "POST",
111
113
  headers: _headers,
112
114
  contentType: "application/json",
113
115
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
114
116
  requestType: "json",
115
117
  body: request,
116
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
117
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
118
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
119
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
118
120
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
119
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
121
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
120
122
  logging: this._options.logging,
121
123
  });
122
124
  if (_response.ok) {
@@ -185,7 +187,7 @@ class AttributionsClient {
185
187
  }
186
188
  __activate(organizationId_1, userId_1, offerId_1) {
187
189
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
188
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
190
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
189
191
  const { supportedComponents, include } = request;
190
192
  const _queryParams = {};
191
193
  if (supportedComponents != null) {
@@ -205,16 +207,18 @@ class AttributionsClient {
205
207
  }
206
208
  }
207
209
  const _authRequest = yield this._options.authProvider.getAuthRequest();
208
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
210
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
211
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
212
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
209
213
  const _response = yield core.fetcher({
210
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/offers/${core.url.encodePathParam(offerId)}/activate`),
214
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/offers/${core.url.encodePathParam(offerId)}/activate`),
211
215
  method: "POST",
212
216
  headers: _headers,
213
217
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
214
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
215
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
218
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
219
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
216
220
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
217
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
221
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
218
222
  logging: this._options.logging,
219
223
  });
220
224
  if (_response.ok) {
@@ -280,7 +284,7 @@ class AttributionsClient {
280
284
  }
281
285
  __boost(organizationId_1, userId_1, offerId_1) {
282
286
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
283
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
287
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
284
288
  const { supportedComponents, include } = request;
285
289
  const _queryParams = {};
286
290
  if (supportedComponents != null) {
@@ -300,16 +304,18 @@ class AttributionsClient {
300
304
  }
301
305
  }
302
306
  const _authRequest = yield this._options.authProvider.getAuthRequest();
303
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
307
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
308
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
309
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
304
310
  const _response = yield core.fetcher({
305
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/offers/${core.url.encodePathParam(offerId)}/boost`),
311
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/offers/${core.url.encodePathParam(offerId)}/boost`),
306
312
  method: "POST",
307
313
  headers: _headers,
308
314
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
309
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
310
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
315
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
316
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
311
317
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
312
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
318
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
313
319
  logging: this._options.logging,
314
320
  });
315
321
  if (_response.ok) {
@@ -72,18 +72,20 @@ class AuthClient {
72
72
  }
73
73
  __getWebViewToken(organizationId, userId, requestOptions) {
74
74
  return __awaiter(this, void 0, void 0, function* () {
75
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
75
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
76
76
  const _authRequest = yield this._options.authProvider.getAuthRequest();
77
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
77
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
78
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
79
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
78
80
  const _response = yield core.fetcher({
79
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/auth/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/token`),
81
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/auth/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/token`),
80
82
  method: "POST",
81
83
  headers: _headers,
82
84
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
83
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
84
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
85
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
86
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
85
87
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
86
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
88
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
87
89
  logging: this._options.logging,
88
90
  });
89
91
  if (_response.ok) {
@@ -83,7 +83,7 @@ class RewardsClient {
83
83
  }
84
84
  __offers(organizationId_1, userId_1) {
85
85
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
86
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
86
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
87
87
  const { "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, "filter[search]": filterSearch, "filter[purchaseChannel]": filterPurchaseChannel, "filter[category]": filterCategory, "filter[isTargeted]": filterIsTargeted, sort, include, supportedComponents, } = request;
88
88
  const _queryParams = {};
89
89
  if (pageSize != null) {
@@ -132,16 +132,18 @@ class RewardsClient {
132
132
  }
133
133
  }
134
134
  const _authRequest = yield this._options.authProvider.getAuthRequest();
135
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
135
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
136
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
137
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
136
138
  const _response = yield core.fetcher({
137
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/offers`),
139
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/offers`),
138
140
  method: "GET",
139
141
  headers: _headers,
140
142
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
141
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
142
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
143
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
144
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
143
145
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
144
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
146
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
145
147
  logging: this._options.logging,
146
148
  });
147
149
  if (_response.ok) {
@@ -219,7 +221,7 @@ class RewardsClient {
219
221
  }
220
222
  __locations(organizationId_1, userId_1) {
221
223
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
222
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
224
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
223
225
  const { "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, "filter[name]": filterName, "filter[city]": filterCity, "filter[zipCode]": filterZipCode, "filter[state]": filterState, "filter[category]": filterCategory, "filter[longitude]": filterLongitude, "filter[latitude]": filterLatitude, "filter[radius]": filterRadius, sort, include, supportedComponents, } = request;
224
226
  const _queryParams = {};
225
227
  if (pageSize != null) {
@@ -280,16 +282,18 @@ class RewardsClient {
280
282
  }
281
283
  }
282
284
  const _authRequest = yield this._options.authProvider.getAuthRequest();
283
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
285
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
286
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
287
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
284
288
  const _response = yield core.fetcher({
285
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/locations`),
289
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/locations`),
286
290
  method: "GET",
287
291
  headers: _headers,
288
292
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
289
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
290
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
293
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
294
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
291
295
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
292
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
296
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
293
297
  logging: this._options.logging,
294
298
  });
295
299
  if (_response.ok) {
@@ -8,5 +8,6 @@ export declare const ComponentType: {
8
8
  readonly Tags: "tags";
9
9
  readonly DetailTags: "detailTags";
10
10
  readonly LogoFlare: "logoFlare";
11
+ readonly ProgressBar: "progressBar";
11
12
  };
12
13
  export type ComponentType = (typeof ComponentType)[keyof typeof ComponentType];
@@ -12,4 +12,5 @@ exports.ComponentType = {
12
12
  Tags: "tags",
13
13
  DetailTags: "detailTags",
14
14
  LogoFlare: "logoFlare",
15
+ ProgressBar: "progressBar",
15
16
  };
@@ -19,4 +19,6 @@ export interface OfferComponents {
19
19
  detailTags?: string[];
20
20
  /** Logo flare configuration for the offer */
21
21
  logoFlare?: KardApi.users.LogoFlare;
22
+ /** Progress bar component for tracking offer redemptions */
23
+ progressBar?: KardApi.users.ProgressBar;
22
24
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Progress bar component for tracking offer redemption progress
3
+ */
4
+ export interface ProgressBar {
5
+ /** Total number of redemptions allowed */
6
+ total: number;
7
+ /** Number of redemptions the user has completed */
8
+ currentProgress: number;
9
+ /** Formatted label for the progress bar */
10
+ label: string;
11
+ /** Whether the progress bar should be displayed as segmented */
12
+ segmented: boolean;
13
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -36,6 +36,7 @@ export * from "./OffersResponseObject.js";
36
36
  export * from "./OperationHours.js";
37
37
  export * from "./OperationPeriod.js";
38
38
  export * from "./OperationTime.js";
39
+ export * from "./ProgressBar.js";
39
40
  export * from "./StandardOffer.js";
40
41
  export * from "./StandardOfferCore.js";
41
42
  export * from "./StandardOfferFields.js";
@@ -52,6 +52,7 @@ __exportStar(require("./OffersResponseObject.js"), exports);
52
52
  __exportStar(require("./OperationHours.js"), exports);
53
53
  __exportStar(require("./OperationPeriod.js"), exports);
54
54
  __exportStar(require("./OperationTime.js"), exports);
55
+ __exportStar(require("./ProgressBar.js"), exports);
55
56
  __exportStar(require("./StandardOffer.js"), exports);
56
57
  __exportStar(require("./StandardOfferCore.js"), exports);
57
58
  __exportStar(require("./StandardOfferFields.js"), exports);
@@ -81,21 +81,23 @@ class UploadsClient {
81
81
  }
82
82
  __create(organizationId, userId, request, requestOptions) {
83
83
  return __awaiter(this, void 0, void 0, function* () {
84
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
84
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
85
85
  const _authRequest = yield this._options.authProvider.getAuthRequest();
86
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
86
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
87
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
88
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
87
89
  const _response = yield core.fetcher({
88
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads`),
90
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads`),
89
91
  method: "POST",
90
92
  headers: _headers,
91
93
  contentType: "application/json",
92
94
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
93
95
  requestType: "json",
94
96
  body: request,
95
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
96
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
97
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
98
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
97
99
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
98
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
100
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
99
101
  logging: this._options.logging,
100
102
  });
101
103
  if (_response.ok) {
@@ -203,21 +205,23 @@ class UploadsClient {
203
205
  }
204
206
  __createPart(organizationId, userId, uploadId, request, requestOptions) {
205
207
  return __awaiter(this, void 0, void 0, function* () {
206
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
208
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
207
209
  const _authRequest = yield this._options.authProvider.getAuthRequest();
208
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
210
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
211
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
212
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
209
213
  const _response = yield core.fetcher({
210
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads/${core.url.encodePathParam(uploadId)}/parts`),
214
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads/${core.url.encodePathParam(uploadId)}/parts`),
211
215
  method: "PUT",
212
216
  headers: _headers,
213
217
  contentType: "application/json",
214
218
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
215
219
  requestType: "json",
216
220
  body: request,
217
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
218
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
221
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
222
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
219
223
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
220
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
224
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
221
225
  logging: this._options.logging,
222
226
  });
223
227
  if (_response.ok) {
@@ -295,21 +299,23 @@ class UploadsClient {
295
299
  }
296
300
  __update(organizationId, userId, uploadId, request, requestOptions) {
297
301
  return __awaiter(this, void 0, void 0, function* () {
298
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
302
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
299
303
  const _authRequest = yield this._options.authProvider.getAuthRequest();
300
- const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
304
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
305
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
306
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
301
307
  const _response = yield core.fetcher({
302
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads/${core.url.encodePathParam(uploadId)}`),
308
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads/${core.url.encodePathParam(uploadId)}`),
303
309
  method: "PUT",
304
310
  headers: _headers,
305
311
  contentType: "application/json",
306
312
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
307
313
  requestType: "json",
308
314
  body: request,
309
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
310
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
315
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
316
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
311
317
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
312
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
318
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
313
319
  logging: this._options.logging,
314
320
  });
315
321
  if (_response.ok) {
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "5.0.0";
1
+ export declare const SDK_VERSION = "5.2.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "5.0.0";
4
+ exports.SDK_VERSION = "5.2.0";
@@ -6,6 +6,8 @@ export interface BaseClientOptions {
6
6
  baseUrl?: core.Supplier<string>;
7
7
  clientId?: core.Supplier<string>;
8
8
  clientSecret?: core.Supplier<string>;
9
+ /** Override the X-Kard-Target-Issuer header */
10
+ xKardTargetIssuer?: core.Supplier<string | undefined>;
9
11
  /** Additional headers to include in requests. */
10
12
  headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
11
13
  /** The default maximum time to wait for a response in seconds. */
@@ -24,6 +26,8 @@ export interface BaseRequestOptions {
24
26
  maxRetries?: number;
25
27
  /** A hook to abort the request. */
26
28
  abortSignal?: AbortSignal;
29
+ /** Override the X-Kard-Target-Issuer header */
30
+ xKardTargetIssuer?: string | undefined;
27
31
  /** Additional query string parameters to include in the request. */
28
32
  queryParams?: Record<string, unknown>;
29
33
  /** Additional headers to include in the request. */
@@ -6,10 +6,11 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@kard-financial/sdk",
9
- "X-Fern-SDK-Version": "5.0.0",
10
- "User-Agent": "@kard-financial/sdk/5.0.0",
9
+ "X-Fern-SDK-Version": "5.2.0",
10
+ "User-Agent": "@kard-financial/sdk/5.2.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
+ "X-Kard-Target-Issuer": options === null || options === void 0 ? void 0 : options.xKardTargetIssuer,
13
14
  }, options === null || options === void 0 ? void 0 : options.headers);
14
15
  return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
15
16
  }
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  import { normalizeClientOptions } from "../../../../BaseClient.mjs";
12
- import { mergeHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
13
13
  import * as core from "../../../../core/index.mjs";
14
14
  import * as environments from "../../../../environments.mjs";
15
15
  import * as errors from "../../../../errors/index.mjs";
@@ -32,20 +32,22 @@ export class AuthClient {
32
32
  }
33
33
  __getToken(request, requestOptions) {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
36
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
35
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
36
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
37
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
38
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
37
39
  const _response = yield core.fetcher({
38
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, "/v2/auth/token"),
40
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, "/v2/auth/token"),
39
41
  method: "POST",
40
42
  headers: _headers,
41
43
  contentType: "application/json",
42
44
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
43
45
  requestType: "json",
44
46
  body: request,
45
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
46
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
47
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
48
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
47
49
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
50
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
49
51
  logging: this._options.logging,
50
52
  });
51
53
  if (_response.ok) {
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
12
- import { mergeHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
13
13
  import * as core from "../../../../core/index.mjs";
14
14
  import * as environments from "../../../../environments.mjs";
15
15
  import * as errors from "../../../../errors/index.mjs";
@@ -47,7 +47,7 @@ export class FilesClient {
47
47
  }
48
48
  __getMetadata(organizationId_1) {
49
49
  return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
50
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
51
51
  const { "filter[dateFrom]": filterDateFrom, "filter[dateTo]": filterDateTo, "filter[fileType]": filterFileType, "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, sort, } = request;
52
52
  const _queryParams = {};
53
53
  if (filterDateFrom != null) {
@@ -77,16 +77,18 @@ export class FilesClient {
77
77
  }
78
78
  }
79
79
  const _authRequest = yield this._options.authProvider.getAuthRequest();
80
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
80
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
81
+ "X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
82
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
83
  const _response = yield core.fetcher({
82
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/files/metadata`),
84
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/files/metadata`),
83
85
  method: "GET",
84
86
  headers: _headers,
85
87
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
86
- timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
87
- maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
88
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
89
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
88
90
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
89
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
91
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
90
92
  logging: this._options.logging,
91
93
  });
92
94
  if (_response.ok) {