@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.
- package/README.md +1 -1
- package/dist/cjs/BaseClient.d.ts +0 -4
- package/dist/cjs/BaseClient.js +2 -3
- package/dist/cjs/api/resources/auth/client/Client.js +19 -7
- package/dist/cjs/api/resources/auth/client/requests/GetTokenRequest.d.ts +2 -0
- package/dist/cjs/api/resources/files/client/Client.js +6 -8
- package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +18 -24
- package/dist/cjs/api/resources/ping/client/Client.js +6 -8
- package/dist/cjs/api/resources/transactions/client/Client.js +30 -40
- package/dist/cjs/api/resources/users/client/Client.js +24 -32
- package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +18 -24
- package/dist/cjs/api/resources/users/resources/auth/client/Client.js +6 -8
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +12 -16
- package/dist/cjs/api/resources/users/resources/uploads/client/Client.js +18 -24
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +0 -4
- package/dist/esm/BaseClient.mjs +2 -3
- package/dist/esm/api/resources/auth/client/Client.mjs +19 -7
- package/dist/esm/api/resources/auth/client/requests/GetTokenRequest.d.mts +2 -0
- package/dist/esm/api/resources/files/client/Client.mjs +7 -9
- package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +19 -25
- package/dist/esm/api/resources/ping/client/Client.mjs +7 -9
- package/dist/esm/api/resources/transactions/client/Client.mjs +31 -41
- package/dist/esm/api/resources/users/client/Client.mjs +25 -33
- package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +19 -25
- package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +7 -9
- package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +13 -17
- package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +19 -25
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- 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
|
|
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
|
|
37
|
-
const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
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((
|
|
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: ((
|
|
46
|
-
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: (
|
|
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
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
201
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
296
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
392
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
495
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
592
|
-
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: (
|
|
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
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
93
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
193
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
274
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
354
|
-
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: (
|
|
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
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
83
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
183
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
280
|
-
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: (
|
|
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
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
50
|
-
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: (
|
|
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
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
108
|
-
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: (
|
|
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
|
|
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,
|
|
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((
|
|
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: ((
|
|
258
|
-
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: (
|
|
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) {
|