@kard-financial/sdk 8.1.0 → 10.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.d.ts +2 -1
- package/dist/cjs/api/resources/transactions/client/Client.js +32 -41
- package/dist/cjs/api/resources/transactions/types/CoreTransactionAttributes.d.ts +2 -2
- package/dist/cjs/api/resources/transactions/types/TransactionsRequestBody.d.ts +2 -1
- 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.d.mts +2 -1
- package/dist/esm/api/resources/transactions/client/Client.mjs +33 -42
- package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.d.mts +2 -2
- package/dist/esm/api/resources/transactions/types/TransactionsRequestBody.d.mts +2 -1
- 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 { 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) {
|
|
@@ -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";
|
|
@@ -45,23 +45,21 @@ export class UploadsClient {
|
|
|
45
45
|
}
|
|
46
46
|
__create(organizationId, userId, request, requestOptions) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
49
49
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
50
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
51
|
-
"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,
|
|
52
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
50
|
+
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);
|
|
53
51
|
const _response = yield core.fetcher({
|
|
54
|
-
url: core.url.join((
|
|
52
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads`),
|
|
55
53
|
method: "POST",
|
|
56
54
|
headers: _headers,
|
|
57
55
|
contentType: "application/json",
|
|
58
56
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
59
57
|
requestType: "json",
|
|
60
58
|
body: request,
|
|
61
|
-
timeoutMs: ((
|
|
62
|
-
maxRetries: (
|
|
59
|
+
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,
|
|
60
|
+
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,
|
|
63
61
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
64
|
-
fetchFn: (
|
|
62
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
65
63
|
logging: this._options.logging,
|
|
66
64
|
});
|
|
67
65
|
if (_response.ok) {
|
|
@@ -169,23 +167,21 @@ export class UploadsClient {
|
|
|
169
167
|
}
|
|
170
168
|
__createPart(organizationId, userId, uploadId, request, requestOptions) {
|
|
171
169
|
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
170
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
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)}/uploads/${core.url.encodePathParam(uploadId)}/parts`),
|
|
179
175
|
method: "PUT",
|
|
180
176
|
headers: _headers,
|
|
181
177
|
contentType: "application/json",
|
|
182
178
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
183
179
|
requestType: "json",
|
|
184
180
|
body: request,
|
|
185
|
-
timeoutMs: ((
|
|
186
|
-
maxRetries: (
|
|
181
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
182
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
187
183
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
188
|
-
fetchFn: (
|
|
184
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
189
185
|
logging: this._options.logging,
|
|
190
186
|
});
|
|
191
187
|
if (_response.ok) {
|
|
@@ -263,23 +259,21 @@ export class UploadsClient {
|
|
|
263
259
|
}
|
|
264
260
|
__update(organizationId, userId, uploadId, request, requestOptions) {
|
|
265
261
|
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
262
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
267
263
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
268
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
269
|
-
"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,
|
|
270
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
264
|
+
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);
|
|
271
265
|
const _response = yield core.fetcher({
|
|
272
|
-
url: core.url.join((
|
|
266
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads/${core.url.encodePathParam(uploadId)}`),
|
|
273
267
|
method: "PUT",
|
|
274
268
|
headers: _headers,
|
|
275
269
|
contentType: "application/json",
|
|
276
270
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
277
271
|
requestType: "json",
|
|
278
272
|
body: request,
|
|
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) {
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "10.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "10.0.0";
|