@kard-financial/sdk 5.1.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 (30) 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/uploads/client/Client.js +24 -18
  14. package/dist/cjs/version.d.ts +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/esm/BaseClient.d.mts +4 -0
  17. package/dist/esm/BaseClient.mjs +3 -2
  18. package/dist/esm/api/resources/auth/client/Client.mjs +9 -7
  19. package/dist/esm/api/resources/files/client/Client.mjs +9 -7
  20. package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +25 -19
  21. package/dist/esm/api/resources/ping/client/Client.mjs +9 -7
  22. package/dist/esm/api/resources/transactions/client/Client.mjs +41 -31
  23. package/dist/esm/api/resources/users/client/Client.mjs +33 -25
  24. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +25 -19
  25. package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +9 -7
  26. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +17 -13
  27. package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +25 -19
  28. package/dist/esm/version.d.mts +1 -1
  29. package/dist/esm/version.mjs +1 -1
  30. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ Instantiate and use the client with the following:
22
22
  ```typescript
23
23
  import { KardApiClient } from "@kard-financial/sdk";
24
24
 
25
- const client = new KardApiClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" });
25
+ const client = new KardApiClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET", xKardTargetIssuer: "YOUR_X_KARD_TARGET_ISSUER" });
26
26
  await client.users.create("organization-123", {
27
27
  data: [{
28
28
  type: "user",
@@ -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. */
@@ -43,10 +43,11 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@kard-financial/sdk",
46
- "X-Fern-SDK-Version": "5.1.0",
47
- "User-Agent": "@kard-financial/sdk/5.1.0",
46
+ "X-Fern-SDK-Version": "5.2.0",
47
+ "User-Agent": "@kard-financial/sdk/5.2.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
+ "X-Kard-Target-Issuer": options === null || options === void 0 ? void 0 : options.xKardTargetIssuer,
50
51
  }, options === null || options === void 0 ? void 0 : options.headers);
51
52
  return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
52
53
  }
@@ -68,20 +68,22 @@ class AuthClient {
68
68
  }
69
69
  __getToken(request, requestOptions) {
70
70
  return __awaiter(this, void 0, void 0, function* () {
71
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
72
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
71
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
72
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
73
+ "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,
74
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
73
75
  const _response = yield core.fetcher({
74
- 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"),
76
+ 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"),
75
77
  method: "POST",
76
78
  headers: _headers,
77
79
  contentType: "application/json",
78
80
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
79
81
  requestType: "json",
80
82
  body: request,
81
- 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,
82
- 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,
83
+ 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,
84
+ 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,
83
85
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
84
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
86
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
85
87
  logging: this._options.logging,
86
88
  });
87
89
  if (_response.ok) {
@@ -83,7 +83,7 @@ class FilesClient {
83
83
  }
84
84
  __getMetadata(organizationId_1) {
85
85
  return __awaiter(this, arguments, void 0, function* (organizationId, 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 { "filter[dateFrom]": filterDateFrom, "filter[dateTo]": filterDateTo, "filter[fileType]": filterFileType, "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, sort, } = request;
88
88
  const _queryParams = {};
89
89
  if (filterDateFrom != null) {
@@ -113,16 +113,18 @@ class FilesClient {
113
113
  }
114
114
  }
115
115
  const _authRequest = yield this._options.authProvider.getAuthRequest();
116
- 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);
116
+ 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)({
117
+ "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,
118
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
117
119
  const _response = yield core.fetcher({
118
- 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`),
120
+ 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`),
119
121
  method: "GET",
120
122
  headers: _headers,
121
123
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
122
- 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,
123
- 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,
124
+ 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,
125
+ 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,
124
126
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
125
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
127
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
126
128
  logging: this._options.logging,
127
129
  });
128
130
  if (_response.ok) {
@@ -74,23 +74,25 @@ class SubscriptionsClient {
74
74
  }
75
75
  __get(organizationId_1) {
76
76
  return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
77
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
77
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
78
78
  const { "filter[eventName]": filterEventName } = request;
79
79
  const _queryParams = {};
80
80
  if (filterEventName != null) {
81
81
  _queryParams["filter[eventName]"] = filterEventName;
82
82
  }
83
83
  const _authRequest = yield this._options.authProvider.getAuthRequest();
84
- 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);
84
+ 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)({
85
+ "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,
86
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
85
87
  const _response = yield core.fetcher({
86
- 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)}/subscriptions`),
88
+ 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)}/subscriptions`),
87
89
  method: "GET",
88
90
  headers: _headers,
89
91
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
90
- 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,
91
- 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,
92
+ 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,
93
+ 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,
92
94
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
93
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
95
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
94
96
  logging: this._options.logging,
95
97
  });
96
98
  if (_response.ok) {
@@ -167,21 +169,23 @@ class SubscriptionsClient {
167
169
  }
168
170
  __create(organizationId, request, requestOptions) {
169
171
  return __awaiter(this, void 0, void 0, function* () {
170
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
172
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
171
173
  const _authRequest = yield this._options.authProvider.getAuthRequest();
172
- 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);
174
+ 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)({
175
+ "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,
176
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
173
177
  const _response = yield core.fetcher({
174
- 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)}/subscriptions`),
178
+ 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)}/subscriptions`),
175
179
  method: "POST",
176
180
  headers: _headers,
177
181
  contentType: "application/json",
178
182
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
179
183
  requestType: "json",
180
184
  body: request,
181
- 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,
182
- 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,
185
+ 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,
186
+ 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,
183
187
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
184
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
188
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
185
189
  logging: this._options.logging,
186
190
  });
187
191
  if (_response.ok) {
@@ -261,21 +265,23 @@ class SubscriptionsClient {
261
265
  }
262
266
  __update(organizationId, subscriptionId, request, requestOptions) {
263
267
  return __awaiter(this, void 0, void 0, function* () {
264
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
268
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
265
269
  const _authRequest = yield this._options.authProvider.getAuthRequest();
266
- 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);
270
+ 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)({
271
+ "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,
272
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
267
273
  const _response = yield core.fetcher({
268
- 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)}/subscriptions/${core.url.encodePathParam(subscriptionId)}`),
274
+ 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)}/subscriptions/${core.url.encodePathParam(subscriptionId)}`),
269
275
  method: "PATCH",
270
276
  headers: _headers,
271
277
  contentType: "application/json",
272
278
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
273
279
  requestType: "json",
274
280
  body: request,
275
- 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,
276
- 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,
281
+ 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,
282
+ 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,
277
283
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
284
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
279
285
  logging: this._options.logging,
280
286
  });
281
287
  if (_response.ok) {
@@ -69,17 +69,19 @@ class PingClient {
69
69
  }
70
70
  __ping(requestOptions) {
71
71
  return __awaiter(this, void 0, void 0, function* () {
72
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
73
- const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
72
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
73
+ const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
74
+ "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,
75
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
74
76
  const _response = yield core.fetcher({
75
- 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/ping"),
77
+ 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/ping"),
76
78
  method: "GET",
77
79
  headers: _headers,
78
80
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
79
- 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,
80
- 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,
81
+ 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,
82
+ 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,
81
83
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
82
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
84
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
83
85
  logging: this._options.logging,
84
86
  });
85
87
  if (_response.ok) {
@@ -220,21 +220,23 @@ class TransactionsClient {
220
220
  }
221
221
  __create(organizationId, request, requestOptions) {
222
222
  return __awaiter(this, void 0, void 0, function* () {
223
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
223
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
224
224
  const _authRequest = yield this._options.authProvider.getAuthRequest();
225
- 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);
225
+ 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)({
226
+ "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,
227
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
226
228
  const _response = yield core.fetcher({
227
- 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)}/transactions`),
229
+ 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)}/transactions`),
228
230
  method: "POST",
229
231
  headers: _headers,
230
232
  contentType: "application/json",
231
233
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
232
234
  requestType: "json",
233
235
  body: request,
234
- 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,
235
- 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,
236
+ 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,
237
+ 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,
236
238
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
237
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
239
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
238
240
  logging: this._options.logging,
239
241
  });
240
242
  if (_response.ok) {
@@ -313,21 +315,23 @@ class TransactionsClient {
313
315
  }
314
316
  __createFraudMarkers(organizationId, request, requestOptions) {
315
317
  return __awaiter(this, void 0, void 0, function* () {
316
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
318
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
317
319
  const _authRequest = yield this._options.authProvider.getAuthRequest();
318
- 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);
320
+ 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)({
321
+ "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,
322
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
319
323
  const _response = yield core.fetcher({
320
- 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)}/fraud`),
324
+ 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)}/fraud`),
321
325
  method: "POST",
322
326
  headers: _headers,
323
327
  contentType: "application/json",
324
328
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
325
329
  requestType: "json",
326
330
  body: request,
327
- 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,
328
- 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,
331
+ 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,
332
+ 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,
329
333
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
330
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
334
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
331
335
  logging: this._options.logging,
332
336
  });
333
337
  if (_response.ok) {
@@ -407,21 +411,23 @@ class TransactionsClient {
407
411
  }
408
412
  __createAudits(organizationId, userId, request, requestOptions) {
409
413
  return __awaiter(this, void 0, void 0, function* () {
410
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
414
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
411
415
  const _authRequest = yield this._options.authProvider.getAuthRequest();
412
- 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);
416
+ 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)({
417
+ "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,
418
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
413
419
  const _response = yield core.fetcher({
414
- 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)}/audits`),
420
+ 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)}/audits`),
415
421
  method: "POST",
416
422
  headers: _headers,
417
423
  contentType: "application/json",
418
424
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
419
425
  requestType: "json",
420
426
  body: request,
421
- 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,
422
- 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,
427
+ 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,
428
+ 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,
423
429
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
424
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
430
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
425
431
  logging: this._options.logging,
426
432
  });
427
433
  if (_response.ok) {
@@ -508,21 +514,23 @@ class TransactionsClient {
508
514
  }
509
515
  __createBulkTransactionsUploadUrl(organizationId, request, requestOptions) {
510
516
  return __awaiter(this, void 0, void 0, function* () {
511
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
517
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
512
518
  const _authRequest = yield this._options.authProvider.getAuthRequest();
513
- 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);
519
+ 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)({
520
+ "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,
521
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
514
522
  const _response = yield core.fetcher({
515
- 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)}/transactions/uploads`),
523
+ 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)}/transactions/uploads`),
516
524
  method: "POST",
517
525
  headers: _headers,
518
526
  contentType: "application/json",
519
527
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
520
528
  requestType: "json",
521
529
  body: request,
522
- 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,
523
- 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,
530
+ 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,
531
+ 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,
524
532
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
525
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
533
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
526
534
  logging: this._options.logging,
527
535
  });
528
536
  if (_response.ok) {
@@ -595,7 +603,7 @@ class TransactionsClient {
595
603
  }
596
604
  __getEarnedRewards(organizationId_1, userId_1) {
597
605
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
598
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
606
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
599
607
  const { "page[after]": pageAfter, "page[before]": pageBefore, "page[size]": pageSize } = request;
600
608
  const _queryParams = {};
601
609
  if (pageAfter != null) {
@@ -608,16 +616,18 @@ class TransactionsClient {
608
616
  _queryParams["page[size]"] = pageSize.toString();
609
617
  }
610
618
  const _authRequest = yield this._options.authProvider.getAuthRequest();
611
- 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);
619
+ 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)({
620
+ "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,
621
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
612
622
  const _response = yield core.fetcher({
613
- 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)}/earned-rewards`),
623
+ 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)}/earned-rewards`),
614
624
  method: "GET",
615
625
  headers: _headers,
616
626
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
617
- 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,
618
- 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,
627
+ 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,
628
+ 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,
619
629
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
620
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
630
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
621
631
  logging: this._options.logging,
622
632
  });
623
633
  if (_response.ok) {
@@ -107,21 +107,23 @@ class UsersClient {
107
107
  }
108
108
  __create(organizationId, request, requestOptions) {
109
109
  return __awaiter(this, void 0, void 0, function* () {
110
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
110
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
111
111
  const _authRequest = yield this._options.authProvider.getAuthRequest();
112
- 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);
112
+ 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)({
113
+ "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,
114
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
113
115
  const _response = yield core.fetcher({
114
- 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`),
116
+ 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`),
115
117
  method: "POST",
116
118
  headers: _headers,
117
119
  contentType: "application/json",
118
120
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
119
121
  requestType: "json",
120
122
  body: request,
121
- 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,
122
- 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,
123
+ 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,
124
+ 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,
123
125
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
124
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
126
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
125
127
  logging: this._options.logging,
126
128
  });
127
129
  if (_response.ok) {
@@ -201,21 +203,23 @@ class UsersClient {
201
203
  }
202
204
  __update(organizationId, userId, request, requestOptions) {
203
205
  return __awaiter(this, void 0, void 0, function* () {
204
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
206
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
205
207
  const _authRequest = yield this._options.authProvider.getAuthRequest();
206
- 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);
208
+ 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)({
209
+ "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,
210
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
207
211
  const _response = yield core.fetcher({
208
- 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)}`),
212
+ 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)}`),
209
213
  method: "PUT",
210
214
  headers: _headers,
211
215
  contentType: "application/json",
212
216
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
213
217
  requestType: "json",
214
218
  body: request,
215
- 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,
216
- 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,
219
+ 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,
220
+ 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,
217
221
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
218
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
222
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
219
223
  logging: this._options.logging,
220
224
  });
221
225
  if (_response.ok) {
@@ -283,18 +287,20 @@ class UsersClient {
283
287
  }
284
288
  __delete(organizationId, userId, requestOptions) {
285
289
  return __awaiter(this, void 0, void 0, function* () {
286
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
290
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
287
291
  const _authRequest = yield this._options.authProvider.getAuthRequest();
288
- 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);
292
+ 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)({
293
+ "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,
294
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
289
295
  const _response = yield core.fetcher({
290
- 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)}`),
296
+ 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)}`),
291
297
  method: "DELETE",
292
298
  headers: _headers,
293
299
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
294
- 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,
295
- 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,
300
+ 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,
301
+ 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,
296
302
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
297
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
303
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
298
304
  logging: this._options.logging,
299
305
  });
300
306
  if (_response.ok) {
@@ -361,18 +367,20 @@ class UsersClient {
361
367
  }
362
368
  __get(organizationId, userId, requestOptions) {
363
369
  return __awaiter(this, void 0, void 0, function* () {
364
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
370
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
365
371
  const _authRequest = yield this._options.authProvider.getAuthRequest();
366
- 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);
372
+ 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)({
373
+ "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,
374
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
367
375
  const _response = yield core.fetcher({
368
- 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)}`),
376
+ 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)}`),
369
377
  method: "GET",
370
378
  headers: _headers,
371
379
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
372
- 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,
373
- 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,
380
+ 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,
381
+ 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,
374
382
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
375
- fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
383
+ fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
376
384
  logging: this._options.logging,
377
385
  });
378
386
  if (_response.ok) {