@kard-financial/sdk 5.1.0 → 5.3.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 +4 -0
- package/dist/cjs/BaseClient.js +3 -2
- package/dist/cjs/api/resources/auth/client/Client.js +8 -6
- package/dist/cjs/api/resources/files/client/Client.js +8 -6
- package/dist/cjs/api/resources/notifications/resources/subscriptions/client/Client.js +24 -18
- package/dist/cjs/api/resources/ping/client/Client.js +8 -6
- package/dist/cjs/api/resources/transactions/client/Client.js +40 -30
- package/dist/cjs/api/resources/users/client/Client.js +32 -24
- package/dist/cjs/api/resources/users/resources/attributions/client/Client.js +24 -18
- package/dist/cjs/api/resources/users/resources/auth/client/Client.js +8 -6
- package/dist/cjs/api/resources/users/resources/rewards/client/Client.js +16 -12
- package/dist/cjs/api/resources/users/resources/rewards/types/ProgressBar.d.ts +2 -0
- package/dist/cjs/api/resources/users/resources/uploads/client/Client.js +24 -18
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +4 -0
- package/dist/esm/BaseClient.mjs +3 -2
- package/dist/esm/api/resources/auth/client/Client.mjs +9 -7
- package/dist/esm/api/resources/files/client/Client.mjs +9 -7
- package/dist/esm/api/resources/notifications/resources/subscriptions/client/Client.mjs +25 -19
- package/dist/esm/api/resources/ping/client/Client.mjs +9 -7
- package/dist/esm/api/resources/transactions/client/Client.mjs +41 -31
- package/dist/esm/api/resources/users/client/Client.mjs +33 -25
- package/dist/esm/api/resources/users/resources/attributions/client/Client.mjs +25 -19
- package/dist/esm/api/resources/users/resources/auth/client/Client.mjs +9 -7
- package/dist/esm/api/resources/users/resources/rewards/client/Client.mjs +17 -13
- package/dist/esm/api/resources/users/resources/rewards/types/ProgressBar.d.mts +2 -0
- package/dist/esm/api/resources/users/resources/uploads/client/Client.mjs +25 -19
- 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 } from "../../../../../../core/headers.mjs";
|
|
12
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../../../core/index.mjs";
|
|
14
14
|
import * as environments from "../../../../../../environments.mjs";
|
|
15
15
|
import * as errors from "../../../../../../errors/index.mjs";
|
|
@@ -45,21 +45,23 @@ 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, _k, _l;
|
|
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,
|
|
50
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
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);
|
|
51
53
|
const _response = yield core.fetcher({
|
|
52
|
-
url: core.url.join((
|
|
54
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads`),
|
|
53
55
|
method: "POST",
|
|
54
56
|
headers: _headers,
|
|
55
57
|
contentType: "application/json",
|
|
56
58
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
57
59
|
requestType: "json",
|
|
58
60
|
body: request,
|
|
59
|
-
timeoutMs: ((
|
|
60
|
-
maxRetries: (
|
|
61
|
+
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,
|
|
62
|
+
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,
|
|
61
63
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
62
|
-
fetchFn: (
|
|
64
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
63
65
|
logging: this._options.logging,
|
|
64
66
|
});
|
|
65
67
|
if (_response.ok) {
|
|
@@ -167,21 +169,23 @@ export class UploadsClient {
|
|
|
167
169
|
}
|
|
168
170
|
__createPart(organizationId, userId, uploadId, request, requestOptions) {
|
|
169
171
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
172
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
171
173
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
172
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
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);
|
|
173
177
|
const _response = yield core.fetcher({
|
|
174
|
-
url: core.url.join((
|
|
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)}/uploads/${core.url.encodePathParam(uploadId)}/parts`),
|
|
175
179
|
method: "PUT",
|
|
176
180
|
headers: _headers,
|
|
177
181
|
contentType: "application/json",
|
|
178
182
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
179
183
|
requestType: "json",
|
|
180
184
|
body: request,
|
|
181
|
-
timeoutMs: ((
|
|
182
|
-
maxRetries: (
|
|
185
|
+
timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
|
|
186
|
+
maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
|
|
183
187
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
184
|
-
fetchFn: (
|
|
188
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
185
189
|
logging: this._options.logging,
|
|
186
190
|
});
|
|
187
191
|
if (_response.ok) {
|
|
@@ -259,21 +263,23 @@ export class UploadsClient {
|
|
|
259
263
|
}
|
|
260
264
|
__update(organizationId, userId, uploadId, request, requestOptions) {
|
|
261
265
|
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
266
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
263
267
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
264
|
-
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
268
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
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);
|
|
265
271
|
const _response = yield core.fetcher({
|
|
266
|
-
url: core.url.join((
|
|
272
|
+
url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/users/${core.url.encodePathParam(userId)}/uploads/${core.url.encodePathParam(uploadId)}`),
|
|
267
273
|
method: "PUT",
|
|
268
274
|
headers: _headers,
|
|
269
275
|
contentType: "application/json",
|
|
270
276
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
271
277
|
requestType: "json",
|
|
272
278
|
body: request,
|
|
273
|
-
timeoutMs: ((
|
|
274
|
-
maxRetries: (
|
|
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,
|
|
275
281
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
276
|
-
fetchFn: (
|
|
282
|
+
fetchFn: (_l = this._options) === null || _l === void 0 ? void 0 : _l.fetch,
|
|
277
283
|
logging: this._options.logging,
|
|
278
284
|
});
|
|
279
285
|
if (_response.ok) {
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.3.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "5.
|
|
1
|
+
export const SDK_VERSION = "5.3.0";
|