@kard-financial/sdk 8.1.0 → 9.0.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 (32) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/BaseClient.d.ts +0 -4
  3. package/dist/cjs/BaseClient.js +2 -3
  4. package/dist/cjs/api/resources/auth/client/Client.js +19 -7
  5. package/dist/cjs/api/resources/auth/client/requests/GetTokenRequest.d.ts +2 -0
  6. package/dist/cjs/api/resources/files/client/Client.js +6 -8
  7. package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +18 -24
  8. package/dist/cjs/api/resources/ping/client/Client.js +6 -8
  9. package/dist/cjs/api/resources/transactions/client/Client.js +30 -40
  10. package/dist/cjs/api/resources/users/client/Client.js +24 -32
  11. package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +18 -24
  12. package/dist/cjs/api/resources/users/resources/auth/client/Client.js +6 -8
  13. package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +12 -16
  14. package/dist/cjs/api/resources/users/resources/uploads/client/Client.js +18 -24
  15. package/dist/cjs/version.d.ts +1 -1
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/esm/BaseClient.d.mts +0 -4
  18. package/dist/esm/BaseClient.mjs +2 -3
  19. package/dist/esm/api/resources/auth/client/Client.mjs +19 -7
  20. package/dist/esm/api/resources/auth/client/requests/GetTokenRequest.d.mts +2 -0
  21. package/dist/esm/api/resources/files/client/Client.mjs +7 -9
  22. package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +19 -25
  23. package/dist/esm/api/resources/ping/client/Client.mjs +7 -9
  24. package/dist/esm/api/resources/transactions/client/Client.mjs +31 -41
  25. package/dist/esm/api/resources/users/client/Client.mjs +25 -33
  26. package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +19 -25
  27. package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +7 -9
  28. package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +13 -17
  29. package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +19 -25
  30. package/dist/esm/version.d.mts +1 -1
  31. package/dist/esm/version.mjs +1 -1
  32. package/package.json +1 -1
@@ -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, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders } 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";
@@ -33,19 +33,17 @@ export class PingClient {
33
33
  }
34
34
  __ping(requestOptions) {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
37
- const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
38
- "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,
39
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
36
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
37
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
40
38
  const _response = yield core.fetcher({
41
- 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"),
39
+ 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"),
42
40
  method: "GET",
43
41
  headers: _headers,
44
42
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
- 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,
46
- 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,
43
+ 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,
44
+ 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
45
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
46
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
49
47
  logging: this._options.logging,
50
48
  });
51
49
  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, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders } 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";
@@ -184,23 +184,21 @@ export class TransactionsClient {
184
184
  }
185
185
  __create(organizationId, request, requestOptions) {
186
186
  return __awaiter(this, void 0, void 0, function* () {
187
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
187
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
188
188
  const _authRequest = yield this._options.authProvider.getAuthRequest();
189
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
190
- "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,
191
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
189
+ 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);
192
190
  const _response = yield core.fetcher({
193
- 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`),
191
+ 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`),
194
192
  method: "POST",
195
193
  headers: _headers,
196
194
  contentType: "application/json",
197
195
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
198
196
  requestType: "json",
199
197
  body: request,
200
- 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,
201
- 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,
198
+ 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,
199
+ 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,
202
200
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
203
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
201
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
204
202
  logging: this._options.logging,
205
203
  });
206
204
  if (_response.ok) {
@@ -279,23 +277,21 @@ export class TransactionsClient {
279
277
  }
280
278
  __createFraudMarkers(organizationId, request, requestOptions) {
281
279
  return __awaiter(this, void 0, void 0, function* () {
282
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
280
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
283
281
  const _authRequest = yield this._options.authProvider.getAuthRequest();
284
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
285
- "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,
286
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
282
+ 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);
287
283
  const _response = yield core.fetcher({
288
- 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`),
284
+ 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`),
289
285
  method: "POST",
290
286
  headers: _headers,
291
287
  contentType: "application/json",
292
288
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
293
289
  requestType: "json",
294
290
  body: request,
295
- 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,
296
- 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
+ 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,
292
+ 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,
297
293
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
298
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
294
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
299
295
  logging: this._options.logging,
300
296
  });
301
297
  if (_response.ok) {
@@ -375,23 +371,21 @@ export class TransactionsClient {
375
371
  }
376
372
  __createAudits(organizationId, userId, request, requestOptions) {
377
373
  return __awaiter(this, void 0, void 0, function* () {
378
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
374
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
379
375
  const _authRequest = yield this._options.authProvider.getAuthRequest();
380
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
381
- "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,
382
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
376
+ 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);
383
377
  const _response = yield core.fetcher({
384
- 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`),
378
+ 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`),
385
379
  method: "POST",
386
380
  headers: _headers,
387
381
  contentType: "application/json",
388
382
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
389
383
  requestType: "json",
390
384
  body: request,
391
- 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,
392
- 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,
385
+ 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,
386
+ 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,
393
387
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
394
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
388
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
395
389
  logging: this._options.logging,
396
390
  });
397
391
  if (_response.ok) {
@@ -478,23 +472,21 @@ export class TransactionsClient {
478
472
  }
479
473
  __createBulkTransactionsUploadUrl(organizationId, request, requestOptions) {
480
474
  return __awaiter(this, void 0, void 0, function* () {
481
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
475
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
482
476
  const _authRequest = yield this._options.authProvider.getAuthRequest();
483
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
484
- "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,
485
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
477
+ 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);
486
478
  const _response = yield core.fetcher({
487
- 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`),
479
+ 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`),
488
480
  method: "POST",
489
481
  headers: _headers,
490
482
  contentType: "application/json",
491
483
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
492
484
  requestType: "json",
493
485
  body: request,
494
- 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,
495
- 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,
486
+ 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,
487
+ 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,
496
488
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
497
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
489
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
498
490
  logging: this._options.logging,
499
491
  });
500
492
  if (_response.ok) {
@@ -567,7 +559,7 @@ export class TransactionsClient {
567
559
  }
568
560
  __getEarnedRewards(organizationId_1, userId_1) {
569
561
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
570
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
562
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
571
563
  const { "page[after]": pageAfter, "page[before]": pageBefore, "page[size]": pageSize } = request;
572
564
  const _queryParams = {};
573
565
  if (pageAfter != null) {
@@ -580,18 +572,16 @@ export class TransactionsClient {
580
572
  _queryParams["page[size]"] = pageSize.toString();
581
573
  }
582
574
  const _authRequest = yield this._options.authProvider.getAuthRequest();
583
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
584
- "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,
585
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
575
+ 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);
586
576
  const _response = yield core.fetcher({
587
- 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`),
577
+ 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`),
588
578
  method: "GET",
589
579
  headers: _headers,
590
580
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
591
- 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,
592
- 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,
581
+ 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,
582
+ 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,
593
583
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
594
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
584
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
595
585
  logging: this._options.logging,
596
586
  });
597
587
  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, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
+ import { mergeHeaders } 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";
@@ -76,23 +76,21 @@ export class UsersClient {
76
76
  }
77
77
  __create(organizationId, request, requestOptions) {
78
78
  return __awaiter(this, void 0, void 0, function* () {
79
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
79
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
80
80
  const _authRequest = yield this._options.authProvider.getAuthRequest();
81
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
82
- "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,
83
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
81
+ 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);
84
82
  const _response = yield core.fetcher({
85
- 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`),
83
+ 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`),
86
84
  method: "POST",
87
85
  headers: _headers,
88
86
  contentType: "application/json",
89
87
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
90
88
  requestType: "json",
91
89
  body: request,
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,
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,
94
92
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
95
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
93
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
96
94
  logging: this._options.logging,
97
95
  });
98
96
  if (_response.ok) {
@@ -176,23 +174,21 @@ export class UsersClient {
176
174
  }
177
175
  __update(organizationId, userId, request, requestOptions) {
178
176
  return __awaiter(this, void 0, void 0, function* () {
179
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
177
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
180
178
  const _authRequest = yield this._options.authProvider.getAuthRequest();
181
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
182
- "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,
183
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
179
+ 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);
184
180
  const _response = yield core.fetcher({
185
- 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)}`),
181
+ 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)}`),
186
182
  method: "PUT",
187
183
  headers: _headers,
188
184
  contentType: "application/json",
189
185
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
190
186
  requestType: "json",
191
187
  body: request,
192
- 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,
193
- 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,
188
+ 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,
189
+ 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,
194
190
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
195
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
191
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
196
192
  logging: this._options.logging,
197
193
  });
198
194
  if (_response.ok) {
@@ -260,20 +256,18 @@ export class UsersClient {
260
256
  }
261
257
  __delete(organizationId, userId, requestOptions) {
262
258
  return __awaiter(this, void 0, void 0, function* () {
263
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
259
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
264
260
  const _authRequest = yield this._options.authProvider.getAuthRequest();
265
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
266
- "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,
267
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
261
+ 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);
268
262
  const _response = yield core.fetcher({
269
- 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)}`),
263
+ 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)}`),
270
264
  method: "DELETE",
271
265
  headers: _headers,
272
266
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
273
- 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,
274
- 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,
267
+ 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,
268
+ 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,
275
269
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
276
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
270
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
277
271
  logging: this._options.logging,
278
272
  });
279
273
  if (_response.ok) {
@@ -340,20 +334,18 @@ export class UsersClient {
340
334
  }
341
335
  __get(organizationId, userId, requestOptions) {
342
336
  return __awaiter(this, void 0, void 0, function* () {
343
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
337
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
344
338
  const _authRequest = yield this._options.authProvider.getAuthRequest();
345
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
346
- "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,
347
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
339
+ 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);
348
340
  const _response = yield core.fetcher({
349
- 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)}`),
341
+ 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)}`),
350
342
  method: "GET",
351
343
  headers: _headers,
352
344
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
353
- 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,
354
- 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,
345
+ 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,
346
+ 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,
355
347
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
356
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
348
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
357
349
  logging: this._options.logging,
358
350
  });
359
351
  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, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
12
+ import { mergeHeaders } 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";
@@ -66,23 +66,21 @@ export class AttributionsClient {
66
66
  }
67
67
  __create(organizationId, userId, request, requestOptions) {
68
68
  return __awaiter(this, void 0, void 0, function* () {
69
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
70
70
  const _authRequest = yield this._options.authProvider.getAuthRequest();
71
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
72
- "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,
73
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
71
+ 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);
74
72
  const _response = yield core.fetcher({
75
- 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`),
73
+ 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`),
76
74
  method: "POST",
77
75
  headers: _headers,
78
76
  contentType: "application/json",
79
77
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
80
78
  requestType: "json",
81
79
  body: request,
82
- 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,
83
- 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,
80
+ 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,
81
+ 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,
84
82
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
85
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
83
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
86
84
  logging: this._options.logging,
87
85
  });
88
86
  if (_response.ok) {
@@ -151,7 +149,7 @@ export class AttributionsClient {
151
149
  }
152
150
  __activate(organizationId_1, userId_1, offerId_1) {
153
151
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
154
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
152
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
155
153
  const { supportedComponents, include } = request;
156
154
  const _queryParams = {};
157
155
  if (supportedComponents != null) {
@@ -171,18 +169,16 @@ export class AttributionsClient {
171
169
  }
172
170
  }
173
171
  const _authRequest = yield this._options.authProvider.getAuthRequest();
174
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, 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);
172
+ 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);
177
173
  const _response = yield core.fetcher({
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)}/users/${core.url.encodePathParam(userId)}/offers/${core.url.encodePathParam(offerId)}/activate`),
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)}/users/${core.url.encodePathParam(userId)}/offers/${core.url.encodePathParam(offerId)}/activate`),
179
175
  method: "POST",
180
176
  headers: _headers,
181
177
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
182
- 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,
183
- 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,
178
+ 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,
179
+ 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,
184
180
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
185
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
181
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
186
182
  logging: this._options.logging,
187
183
  });
188
184
  if (_response.ok) {
@@ -248,7 +244,7 @@ export class AttributionsClient {
248
244
  }
249
245
  __boost(organizationId_1, userId_1, offerId_1) {
250
246
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, offerId, request = {}, requestOptions) {
251
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
247
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
252
248
  const { supportedComponents, include } = request;
253
249
  const _queryParams = {};
254
250
  if (supportedComponents != null) {
@@ -268,18 +264,16 @@ export class AttributionsClient {
268
264
  }
269
265
  }
270
266
  const _authRequest = yield this._options.authProvider.getAuthRequest();
271
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
272
- "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,
273
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
267
+ 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);
274
268
  const _response = yield core.fetcher({
275
- 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`),
269
+ 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`),
276
270
  method: "POST",
277
271
  headers: _headers,
278
272
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
279
- 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,
280
- 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,
273
+ 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,
274
+ 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
275
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
282
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
276
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
283
277
  logging: this._options.logging,
284
278
  });
285
279
  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, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
12
+ import { mergeHeaders } 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";
@@ -36,20 +36,18 @@ export class AuthClient {
36
36
  }
37
37
  __getWebViewToken(organizationId, userId, requestOptions) {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
39
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
40
40
  const _authRequest = yield this._options.authProvider.getAuthRequest();
41
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
42
- "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,
43
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
41
+ 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);
44
42
  const _response = yield core.fetcher({
45
- 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`),
43
+ 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`),
46
44
  method: "POST",
47
45
  headers: _headers,
48
46
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
49
- 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,
50
- 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
+ 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,
48
+ 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,
51
49
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
52
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
50
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
53
51
  logging: this._options.logging,
54
52
  });
55
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, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
12
+ import { mergeHeaders } from "../../../../../../core/headers.mjs";
13
13
  import * as core from "../../../../../../core/index.mjs";
14
14
  import { toJson } from "../../../../../../core/json.mjs";
15
15
  import * as environments from "../../../../../../environments.mjs";
@@ -47,7 +47,7 @@ export class RewardsClient {
47
47
  }
48
48
  __offers(organizationId_1, userId_1) {
49
49
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
50
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
50
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
51
51
  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;
52
52
  const _queryParams = {};
53
53
  if (pageSize != null) {
@@ -96,18 +96,16 @@ export class RewardsClient {
96
96
  }
97
97
  }
98
98
  const _authRequest = yield this._options.authProvider.getAuthRequest();
99
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
100
- "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,
101
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
99
+ 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);
102
100
  const _response = yield core.fetcher({
103
- 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`),
101
+ 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`),
104
102
  method: "GET",
105
103
  headers: _headers,
106
104
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
107
- 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,
108
- 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,
105
+ 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,
106
+ 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,
109
107
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
110
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
108
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
111
109
  logging: this._options.logging,
112
110
  });
113
111
  if (_response.ok) {
@@ -185,7 +183,7 @@ export class RewardsClient {
185
183
  }
186
184
  __locations(organizationId_1, userId_1) {
187
185
  return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
188
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
186
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
189
187
  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;
190
188
  const _queryParams = {};
191
189
  if (pageSize != null) {
@@ -246,18 +244,16 @@ export class RewardsClient {
246
244
  }
247
245
  }
248
246
  const _authRequest = yield this._options.authProvider.getAuthRequest();
249
- const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
250
- "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,
251
- }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
247
+ 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);
252
248
  const _response = yield core.fetcher({
253
- 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`),
249
+ 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`),
254
250
  method: "GET",
255
251
  headers: _headers,
256
252
  queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
257
- 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,
258
- 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,
253
+ 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,
254
+ 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,
259
255
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
260
- fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
256
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
261
257
  logging: this._options.logging,
262
258
  });
263
259
  if (_response.ok) {