@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
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Instantiate and use the client with the following:
|
|
|
22
22
|
```typescript
|
|
23
23
|
import { KardApiClient } from "@kard-financial/sdk";
|
|
24
24
|
|
|
25
|
-
const client = new KardApiClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET"
|
|
25
|
+
const client = new KardApiClient({ clientId: "YOUR_CLIENT_ID", clientSecret: "YOUR_CLIENT_SECRET" });
|
|
26
26
|
await client.users.create("organization-123", {
|
|
27
27
|
data: [{
|
|
28
28
|
type: "user",
|
package/dist/cjs/BaseClient.d.ts
CHANGED
|
@@ -6,8 +6,6 @@ export interface BaseClientOptions {
|
|
|
6
6
|
baseUrl?: core.Supplier<string>;
|
|
7
7
|
clientId?: core.Supplier<string>;
|
|
8
8
|
clientSecret?: core.Supplier<string>;
|
|
9
|
-
/** Override the X-Kard-Target-Issuer header */
|
|
10
|
-
xKardTargetIssuer?: core.Supplier<string | undefined>;
|
|
11
9
|
/** Additional headers to include in requests. */
|
|
12
10
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
13
11
|
/** The default maximum time to wait for a response in seconds. */
|
|
@@ -26,8 +24,6 @@ export interface BaseRequestOptions {
|
|
|
26
24
|
maxRetries?: number;
|
|
27
25
|
/** A hook to abort the request. */
|
|
28
26
|
abortSignal?: AbortSignal;
|
|
29
|
-
/** Override the X-Kard-Target-Issuer header */
|
|
30
|
-
xKardTargetIssuer?: string | undefined;
|
|
31
27
|
/** Additional query string parameters to include in the request. */
|
|
32
28
|
queryParams?: Record<string, unknown>;
|
|
33
29
|
/** Additional headers to include in the request. */
|
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,11 +43,10 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@kard-financial/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "
|
|
47
|
-
"User-Agent": "@kard-financial/sdk/
|
|
46
|
+
"X-Fern-SDK-Version": "10.0.0",
|
|
47
|
+
"User-Agent": "@kard-financial/sdk/10.0.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
|
-
"X-Kard-Target-Issuer": options === null || options === void 0 ? void 0 : options.xKardTargetIssuer,
|
|
51
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
52
51
|
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
53
52
|
}
|
|
@@ -42,6 +42,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
42
42
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
46
|
+
var t = {};
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
48
|
+
t[p] = s[p];
|
|
49
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
50
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
51
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
52
|
+
t[p[i]] = s[p[i]];
|
|
53
|
+
}
|
|
54
|
+
return t;
|
|
55
|
+
};
|
|
45
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
57
|
exports.AuthClient = void 0;
|
|
47
58
|
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
@@ -68,22 +79,23 @@ class AuthClient {
|
|
|
68
79
|
}
|
|
69
80
|
__getToken(request, requestOptions) {
|
|
70
81
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
82
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
83
|
+
const { "X-Kard-Target-Issuer": xKardTargetIssuer } = request, _body = __rest(request, ["X-Kard-Target-Issuer"]);
|
|
72
84
|
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
73
|
-
"X-Kard-Target-Issuer":
|
|
85
|
+
"X-Kard-Target-Issuer": xKardTargetIssuer != null ? xKardTargetIssuer : undefined,
|
|
74
86
|
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
75
87
|
const _response = yield core.fetcher({
|
|
76
|
-
url: core.url.join((
|
|
88
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, "/v2/auth/token"),
|
|
77
89
|
method: "POST",
|
|
78
90
|
headers: _headers,
|
|
79
91
|
contentType: "application/json",
|
|
80
92
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
81
93
|
requestType: "json",
|
|
82
|
-
body:
|
|
83
|
-
timeoutMs: ((
|
|
84
|
-
maxRetries: (
|
|
94
|
+
body: _body,
|
|
95
|
+
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,
|
|
96
|
+
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,
|
|
85
97
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
|
-
fetchFn: (
|
|
98
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
87
99
|
logging: this._options.logging,
|
|
88
100
|
});
|
|
89
101
|
if (_response.ok) {
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* }
|
|
7
7
|
*/
|
|
8
8
|
export interface GetTokenRequest {
|
|
9
|
+
/** (Beta) Target issuer ID for partners managing multiple issuers on the Kard platform. When set, the auth token will be scoped to this specific issuer. Required if you manage more than one issuer; omit if you operate a single issuer integration. */
|
|
10
|
+
"X-Kard-Target-Issuer"?: string;
|
|
9
11
|
client_id: string;
|
|
10
12
|
client_secret: string;
|
|
11
13
|
}
|
|
@@ -83,7 +83,7 @@ class FilesClient {
|
|
|
83
83
|
}
|
|
84
84
|
__getMetadata(organizationId_1) {
|
|
85
85
|
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
87
|
const { "filter[dateFrom]": filterDateFrom, "filter[dateTo]": filterDateTo, "filter[fileType]": filterFileType, "page[size]": pageSize, "page[after]": pageAfter, "page[before]": pageBefore, sort, } = request;
|
|
88
88
|
const _queryParams = {};
|
|
89
89
|
if (filterDateFrom != null) {
|
|
@@ -113,18 +113,16 @@ class FilesClient {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
116
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
117
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
118
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
116
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
119
117
|
const _response = yield core.fetcher({
|
|
120
|
-
url: core.url.join((
|
|
118
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `v2/issuers/${core.url.encodePathParam(organizationId)}/files/metadata`),
|
|
121
119
|
method: "GET",
|
|
122
120
|
headers: _headers,
|
|
123
121
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
124
|
-
timeoutMs: ((
|
|
125
|
-
maxRetries: (
|
|
122
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
123
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
126
124
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
127
|
-
fetchFn: (
|
|
125
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
128
126
|
logging: this._options.logging,
|
|
129
127
|
});
|
|
130
128
|
if (_response.ok) {
|
|
@@ -74,25 +74,23 @@ class SubscriptionsClient {
|
|
|
74
74
|
}
|
|
75
75
|
__get(organizationId_1) {
|
|
76
76
|
return __awaiter(this, arguments, void 0, function* (organizationId, request = {}, requestOptions) {
|
|
77
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
77
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
78
78
|
const { "filter[eventName]": filterEventName } = request;
|
|
79
79
|
const _queryParams = {};
|
|
80
80
|
if (filterEventName != null) {
|
|
81
81
|
_queryParams["filter[eventName]"] = filterEventName;
|
|
82
82
|
}
|
|
83
83
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
84
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
85
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
86
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
84
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
87
85
|
const _response = yield core.fetcher({
|
|
88
|
-
url: core.url.join((
|
|
86
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/subscriptions`),
|
|
89
87
|
method: "GET",
|
|
90
88
|
headers: _headers,
|
|
91
89
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
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) {
|
|
@@ -169,23 +167,21 @@ class SubscriptionsClient {
|
|
|
169
167
|
}
|
|
170
168
|
__create(organizationId, 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 = (0, headers_js_1.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 = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
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)}/subscriptions`),
|
|
179
175
|
method: "POST",
|
|
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) {
|
|
@@ -265,23 +261,21 @@ class SubscriptionsClient {
|
|
|
265
261
|
}
|
|
266
262
|
__update(organizationId, subscriptionId, request, requestOptions) {
|
|
267
263
|
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
264
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
269
265
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
270
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
271
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
272
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
266
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
273
267
|
const _response = yield core.fetcher({
|
|
274
|
-
url: core.url.join((
|
|
268
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, `/v2/issuers/${core.url.encodePathParam(organizationId)}/subscriptions/${core.url.encodePathParam(subscriptionId)}`),
|
|
275
269
|
method: "PATCH",
|
|
276
270
|
headers: _headers,
|
|
277
271
|
contentType: "application/json",
|
|
278
272
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
279
273
|
requestType: "json",
|
|
280
274
|
body: request,
|
|
281
|
-
timeoutMs: ((
|
|
282
|
-
maxRetries: (
|
|
275
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
276
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
283
277
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
284
|
-
fetchFn: (
|
|
278
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
285
279
|
logging: this._options.logging,
|
|
286
280
|
});
|
|
287
281
|
if (_response.ok) {
|
|
@@ -69,19 +69,17 @@ class PingClient {
|
|
|
69
69
|
}
|
|
70
70
|
__ping(requestOptions) {
|
|
71
71
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
73
|
-
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
74
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
75
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
72
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
73
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
76
74
|
const _response = yield core.fetcher({
|
|
77
|
-
url: core.url.join((
|
|
75
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.KardApiEnvironment.Production, "v2/ping"),
|
|
78
76
|
method: "GET",
|
|
79
77
|
headers: _headers,
|
|
80
78
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
81
|
-
timeoutMs: ((
|
|
82
|
-
maxRetries: (
|
|
79
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
80
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
83
81
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
84
|
-
fetchFn: (
|
|
82
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
85
83
|
logging: this._options.logging,
|
|
86
84
|
});
|
|
87
85
|
if (_response.ok) {
|
|
@@ -167,7 +167,8 @@ export declare class TransactionsClient {
|
|
|
167
167
|
* status: "SETTLED",
|
|
168
168
|
* settledDate: "2024-10-15T14:30:00Z",
|
|
169
169
|
* authorizationDate: "2024-10-15T14:25:00Z",
|
|
170
|
-
* financialInstitutionName: "west union bank"
|
|
170
|
+
* financialInstitutionName: "west union bank",
|
|
171
|
+
* cardLastFours: ["4321"]
|
|
171
172
|
* }
|
|
172
173
|
* }]
|
|
173
174
|
* })
|
|
@@ -210,7 +210,8 @@ class TransactionsClient {
|
|
|
210
210
|
* status: "SETTLED",
|
|
211
211
|
* settledDate: "2024-10-15T14:30:00Z",
|
|
212
212
|
* authorizationDate: "2024-10-15T14:25:00Z",
|
|
213
|
-
* financialInstitutionName: "west union bank"
|
|
213
|
+
* financialInstitutionName: "west union bank",
|
|
214
|
+
* cardLastFours: ["4321"]
|
|
214
215
|
* }
|
|
215
216
|
* }]
|
|
216
217
|
* })
|
|
@@ -220,23 +221,21 @@ class TransactionsClient {
|
|
|
220
221
|
}
|
|
221
222
|
__create(organizationId, request, requestOptions) {
|
|
222
223
|
return __awaiter(this, void 0, void 0, function* () {
|
|
223
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
224
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
224
225
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
225
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
226
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
227
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
226
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
228
227
|
const _response = yield core.fetcher({
|
|
229
|
-
url: core.url.join((
|
|
228
|
+
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`),
|
|
230
229
|
method: "POST",
|
|
231
230
|
headers: _headers,
|
|
232
231
|
contentType: "application/json",
|
|
233
232
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
234
233
|
requestType: "json",
|
|
235
234
|
body: request,
|
|
236
|
-
timeoutMs: ((
|
|
237
|
-
maxRetries: (
|
|
235
|
+
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,
|
|
236
|
+
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,
|
|
238
237
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
239
|
-
fetchFn: (
|
|
238
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
240
239
|
logging: this._options.logging,
|
|
241
240
|
});
|
|
242
241
|
if (_response.ok) {
|
|
@@ -315,23 +314,21 @@ class TransactionsClient {
|
|
|
315
314
|
}
|
|
316
315
|
__createFraudMarkers(organizationId, request, requestOptions) {
|
|
317
316
|
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
317
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
319
318
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
320
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
321
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
322
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
319
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
323
320
|
const _response = yield core.fetcher({
|
|
324
|
-
url: core.url.join((
|
|
321
|
+
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`),
|
|
325
322
|
method: "POST",
|
|
326
323
|
headers: _headers,
|
|
327
324
|
contentType: "application/json",
|
|
328
325
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
329
326
|
requestType: "json",
|
|
330
327
|
body: request,
|
|
331
|
-
timeoutMs: ((
|
|
332
|
-
maxRetries: (
|
|
328
|
+
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,
|
|
329
|
+
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,
|
|
333
330
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
334
|
-
fetchFn: (
|
|
331
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
335
332
|
logging: this._options.logging,
|
|
336
333
|
});
|
|
337
334
|
if (_response.ok) {
|
|
@@ -411,23 +408,21 @@ class TransactionsClient {
|
|
|
411
408
|
}
|
|
412
409
|
__createAudits(organizationId, userId, request, requestOptions) {
|
|
413
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
411
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
415
412
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
416
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
417
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
418
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
413
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
419
414
|
const _response = yield core.fetcher({
|
|
420
|
-
url: core.url.join((
|
|
415
|
+
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`),
|
|
421
416
|
method: "POST",
|
|
422
417
|
headers: _headers,
|
|
423
418
|
contentType: "application/json",
|
|
424
419
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
425
420
|
requestType: "json",
|
|
426
421
|
body: request,
|
|
427
|
-
timeoutMs: ((
|
|
428
|
-
maxRetries: (
|
|
422
|
+
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,
|
|
423
|
+
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,
|
|
429
424
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
430
|
-
fetchFn: (
|
|
425
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
431
426
|
logging: this._options.logging,
|
|
432
427
|
});
|
|
433
428
|
if (_response.ok) {
|
|
@@ -514,23 +509,21 @@ class TransactionsClient {
|
|
|
514
509
|
}
|
|
515
510
|
__createBulkTransactionsUploadUrl(organizationId, request, requestOptions) {
|
|
516
511
|
return __awaiter(this, void 0, void 0, function* () {
|
|
517
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
512
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
518
513
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
519
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
520
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
521
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
514
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
522
515
|
const _response = yield core.fetcher({
|
|
523
|
-
url: core.url.join((
|
|
516
|
+
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`),
|
|
524
517
|
method: "POST",
|
|
525
518
|
headers: _headers,
|
|
526
519
|
contentType: "application/json",
|
|
527
520
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
528
521
|
requestType: "json",
|
|
529
522
|
body: request,
|
|
530
|
-
timeoutMs: ((
|
|
531
|
-
maxRetries: (
|
|
523
|
+
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,
|
|
524
|
+
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,
|
|
532
525
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
533
|
-
fetchFn: (
|
|
526
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
534
527
|
logging: this._options.logging,
|
|
535
528
|
});
|
|
536
529
|
if (_response.ok) {
|
|
@@ -603,7 +596,7 @@ class TransactionsClient {
|
|
|
603
596
|
}
|
|
604
597
|
__getEarnedRewards(organizationId_1, userId_1) {
|
|
605
598
|
return __awaiter(this, arguments, void 0, function* (organizationId, userId, request = {}, requestOptions) {
|
|
606
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
599
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
607
600
|
const { "page[after]": pageAfter, "page[before]": pageBefore, "page[size]": pageSize } = request;
|
|
608
601
|
const _queryParams = {};
|
|
609
602
|
if (pageAfter != null) {
|
|
@@ -616,18 +609,16 @@ class TransactionsClient {
|
|
|
616
609
|
_queryParams["page[size]"] = pageSize.toString();
|
|
617
610
|
}
|
|
618
611
|
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
619
|
-
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers,
|
|
620
|
-
"X-Kard-Target-Issuer": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.xKardTargetIssuer) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.xKardTargetIssuer,
|
|
621
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
612
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
622
613
|
const _response = yield core.fetcher({
|
|
623
|
-
url: core.url.join((
|
|
614
|
+
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`),
|
|
624
615
|
method: "GET",
|
|
625
616
|
headers: _headers,
|
|
626
617
|
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
627
|
-
timeoutMs: ((
|
|
628
|
-
maxRetries: (
|
|
618
|
+
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,
|
|
619
|
+
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,
|
|
629
620
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
630
|
-
fetchFn: (
|
|
621
|
+
fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
|
|
631
622
|
logging: this._options.logging,
|
|
632
623
|
});
|
|
633
624
|
if (_response.ok) {
|
|
@@ -20,6 +20,6 @@ export interface CoreTransactionAttributes {
|
|
|
20
20
|
authorizationDate: string;
|
|
21
21
|
/** Name of the financial institution */
|
|
22
22
|
financialInstitutionName: string;
|
|
23
|
-
/** Last four digits of the card used for the transaction. */
|
|
24
|
-
|
|
23
|
+
/** Last four digits of the card(s) that may have been used for the transaction. When the issuer cannot determine which specific card was used, multiple values are provided as candidates. */
|
|
24
|
+
cardLastFours?: string[];
|
|
25
25
|
}
|
|
@@ -136,7 +136,8 @@ import type * as KardApi from "../../../index.js";
|
|
|
136
136
|
* status: "SETTLED",
|
|
137
137
|
* settledDate: "2024-10-15T14:30:00Z",
|
|
138
138
|
* authorizationDate: "2024-10-15T14:25:00Z",
|
|
139
|
-
* financialInstitutionName: "west union bank"
|
|
139
|
+
* financialInstitutionName: "west union bank",
|
|
140
|
+
* cardLastFours: ["4321"]
|
|
140
141
|
* }
|
|
141
142
|
* }]
|
|
142
143
|
* }
|