@kard-financial/sdk 2.3.0 → 3.1.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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/transactions/client/Client.d.ts +1 -7
- package/dist/cjs/api/resources/transactions/client/Client.js +1 -7
- package/dist/cjs/api/resources/transactions/types/CoreTransactionAttributes.d.ts +2 -4
- package/dist/cjs/api/resources/transactions/types/TransactionsRequestBody.d.ts +1 -7
- package/dist/cjs/api/resources/transactions/types/index.d.ts +0 -2
- package/dist/cjs/api/resources/transactions/types/index.js +0 -2
- package/dist/cjs/hem.d.ts +15 -0
- package/dist/cjs/hem.js +36 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/transactions/client/Client.d.mts +1 -7
- package/dist/esm/api/resources/transactions/client/Client.mjs +1 -7
- package/dist/esm/api/resources/transactions/types/CoreTransactionAttributes.d.mts +2 -4
- package/dist/esm/api/resources/transactions/types/TransactionsRequestBody.d.mts +1 -7
- package/dist/esm/api/resources/transactions/types/index.d.mts +0 -2
- package/dist/esm/api/resources/transactions/types/index.mjs +0 -2
- package/dist/esm/hem.d.mts +15 -0
- package/dist/esm/hem.mjs +32 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/resources/transactions/types/CoreMerchant.d.ts +0 -4
- package/dist/cjs/api/resources/transactions/types/CoreMerchant.js +0 -3
- package/dist/cjs/api/resources/transactions/types/FinancialInstitution.d.ts +0 -6
- package/dist/cjs/api/resources/transactions/types/FinancialInstitution.js +0 -3
- package/dist/esm/api/resources/transactions/types/CoreMerchant.d.mts +0 -4
- package/dist/esm/api/resources/transactions/types/CoreMerchant.mjs +0 -2
- package/dist/esm/api/resources/transactions/types/FinancialInstitution.d.mts +0 -6
- package/dist/esm/api/resources/transactions/types/FinancialInstitution.mjs +0 -2
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ 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": "3.0.0",
|
|
47
|
+
"User-Agent": "@kard-financial/sdk/3.0.0",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -167,13 +167,7 @@ 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
|
-
*
|
|
171
|
-
* rssdId: "852218",
|
|
172
|
-
* name: "First National Bank"
|
|
173
|
-
* },
|
|
174
|
-
* merchant: {
|
|
175
|
-
* addrZipcode: "75001"
|
|
176
|
-
* }
|
|
170
|
+
* financialInstitutionName: "First National Bank"
|
|
177
171
|
* }
|
|
178
172
|
* }]
|
|
179
173
|
* })
|
|
@@ -210,13 +210,7 @@ class TransactionsClient {
|
|
|
210
210
|
* status: "SETTLED",
|
|
211
211
|
* settledDate: "2024-10-15T14:30:00Z",
|
|
212
212
|
* authorizationDate: "2024-10-15T14:25:00Z",
|
|
213
|
-
*
|
|
214
|
-
* rssdId: "852218",
|
|
215
|
-
* name: "First National Bank"
|
|
216
|
-
* },
|
|
217
|
-
* merchant: {
|
|
218
|
-
* addrZipcode: "75001"
|
|
219
|
-
* }
|
|
213
|
+
* financialInstitutionName: "First National Bank"
|
|
220
214
|
* }
|
|
221
215
|
* }]
|
|
222
216
|
* })
|
|
@@ -18,8 +18,6 @@ export interface CoreTransactionAttributes {
|
|
|
18
18
|
settledDate: string;
|
|
19
19
|
/** Timestamp for transaction authorization. Date string should be in ISO 8601 format i.e.'YYYY-MM-DDThh:mm:ss.sTZD' where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. 1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z */
|
|
20
20
|
authorizationDate: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/** Merchant details */
|
|
24
|
-
merchant: KardApi.CoreMerchant;
|
|
21
|
+
/** Name of the financial institution */
|
|
22
|
+
financialInstitutionName: string;
|
|
25
23
|
}
|
|
@@ -136,13 +136,7 @@ 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
|
-
*
|
|
140
|
-
* rssdId: "852218",
|
|
141
|
-
* name: "First National Bank"
|
|
142
|
-
* },
|
|
143
|
-
* merchant: {
|
|
144
|
-
* addrZipcode: "75001"
|
|
145
|
-
* }
|
|
139
|
+
* financialInstitutionName: "First National Bank"
|
|
146
140
|
* }
|
|
147
141
|
* }]
|
|
148
142
|
* }
|
|
@@ -5,7 +5,6 @@ export * from "./AuditResponseData.js";
|
|
|
5
5
|
export * from "./AuditStatus.js";
|
|
6
6
|
export * from "./CardNetwork.js";
|
|
7
7
|
export * from "./CommissionEarnedDetails.js";
|
|
8
|
-
export * from "./CoreMerchant.js";
|
|
9
8
|
export * from "./CoreTransactionAttributes.js";
|
|
10
9
|
export * from "./CoreTransactionRequest.js";
|
|
11
10
|
export * from "./CreateAuditMultiStatusResponse.js";
|
|
@@ -14,7 +13,6 @@ export * from "./CreateAuditRequestDataUnion.js";
|
|
|
14
13
|
export * from "./CreateAuditResponseBody.js";
|
|
15
14
|
export * from "./CreateAuditResponseDataUnion.js";
|
|
16
15
|
export * from "./DirectionType.js";
|
|
17
|
-
export * from "./FinancialInstitution.js";
|
|
18
16
|
export * from "./FraudulentTransactionAttributes.js";
|
|
19
17
|
export * from "./FraudulentTransactionData.js";
|
|
20
18
|
export * from "./FraudulentTransactionObject.js";
|
|
@@ -21,7 +21,6 @@ __exportStar(require("./AuditResponseData.js"), exports);
|
|
|
21
21
|
__exportStar(require("./AuditStatus.js"), exports);
|
|
22
22
|
__exportStar(require("./CardNetwork.js"), exports);
|
|
23
23
|
__exportStar(require("./CommissionEarnedDetails.js"), exports);
|
|
24
|
-
__exportStar(require("./CoreMerchant.js"), exports);
|
|
25
24
|
__exportStar(require("./CoreTransactionAttributes.js"), exports);
|
|
26
25
|
__exportStar(require("./CoreTransactionRequest.js"), exports);
|
|
27
26
|
__exportStar(require("./CreateAuditMultiStatusResponse.js"), exports);
|
|
@@ -30,7 +29,6 @@ __exportStar(require("./CreateAuditRequestDataUnion.js"), exports);
|
|
|
30
29
|
__exportStar(require("./CreateAuditResponseBody.js"), exports);
|
|
31
30
|
__exportStar(require("./CreateAuditResponseDataUnion.js"), exports);
|
|
32
31
|
__exportStar(require("./DirectionType.js"), exports);
|
|
33
|
-
__exportStar(require("./FinancialInstitution.js"), exports);
|
|
34
32
|
__exportStar(require("./FraudulentTransactionAttributes.js"), exports);
|
|
35
33
|
__exportStar(require("./FraudulentTransactionData.js"), exports);
|
|
36
34
|
__exportStar(require("./FraudulentTransactionObject.js"), exports);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize an email address for Hashed Email (HEM) generation.
|
|
3
|
+
*
|
|
4
|
+
* Follows UID2/LiveRamp industry standards:
|
|
5
|
+
* - Remove all whitespace
|
|
6
|
+
* - Lowercase
|
|
7
|
+
* - Gmail/Googlemail only: remove dots from local-part, strip '+' suffix
|
|
8
|
+
* - Canonicalize googlemail.com → gmail.com
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeEmail(raw: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Generate a Hashed Email (HEM) from a raw email address.
|
|
13
|
+
* Returns the lowercase hex SHA-256 digest of the normalized, UTF-8-encoded email.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateHEM(raw: string): string;
|
package/dist/cjs/hem.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeEmail = normalizeEmail;
|
|
4
|
+
exports.generateHEM = generateHEM;
|
|
5
|
+
const crypto_1 = require("crypto");
|
|
6
|
+
const GMAIL_DOMAINS = new Set(["gmail.com", "googlemail.com"]);
|
|
7
|
+
/**
|
|
8
|
+
* Normalize an email address for Hashed Email (HEM) generation.
|
|
9
|
+
*
|
|
10
|
+
* Follows UID2/LiveRamp industry standards:
|
|
11
|
+
* - Remove all whitespace
|
|
12
|
+
* - Lowercase
|
|
13
|
+
* - Gmail/Googlemail only: remove dots from local-part, strip '+' suffix
|
|
14
|
+
* - Canonicalize googlemail.com → gmail.com
|
|
15
|
+
*/
|
|
16
|
+
function normalizeEmail(raw) {
|
|
17
|
+
const email = raw.replace(/\s/g, "").toLowerCase();
|
|
18
|
+
const atIndex = email.indexOf("@");
|
|
19
|
+
if (atIndex < 1 || atIndex !== email.lastIndexOf("@") || atIndex === email.length - 1) {
|
|
20
|
+
throw new TypeError(`Invalid email address: ${JSON.stringify(raw)}`);
|
|
21
|
+
}
|
|
22
|
+
const localPart = email.slice(0, atIndex);
|
|
23
|
+
const domain = email.slice(atIndex + 1);
|
|
24
|
+
if (GMAIL_DOMAINS.has(domain)) {
|
|
25
|
+
const base = localPart.split("+")[0].replace(/\./g, "");
|
|
26
|
+
return `${base}@gmail.com`;
|
|
27
|
+
}
|
|
28
|
+
return `${localPart}@${domain}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate a Hashed Email (HEM) from a raw email address.
|
|
32
|
+
* Returns the lowercase hex SHA-256 digest of the normalized, UTF-8-encoded email.
|
|
33
|
+
*/
|
|
34
|
+
function generateHEM(raw) {
|
|
35
|
+
return (0, crypto_1.createHash)("sha256").update(normalizeEmail(raw), "utf8").digest("hex");
|
|
36
|
+
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "3.0.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@kard-financial/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "
|
|
10
|
-
"User-Agent": "@kard-financial/sdk/
|
|
9
|
+
"X-Fern-SDK-Version": "3.0.0",
|
|
10
|
+
"User-Agent": "@kard-financial/sdk/3.0.0",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -167,13 +167,7 @@ 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
|
-
*
|
|
171
|
-
* rssdId: "852218",
|
|
172
|
-
* name: "First National Bank"
|
|
173
|
-
* },
|
|
174
|
-
* merchant: {
|
|
175
|
-
* addrZipcode: "75001"
|
|
176
|
-
* }
|
|
170
|
+
* financialInstitutionName: "First National Bank"
|
|
177
171
|
* }
|
|
178
172
|
* }]
|
|
179
173
|
* })
|
|
@@ -174,13 +174,7 @@ export class TransactionsClient {
|
|
|
174
174
|
* status: "SETTLED",
|
|
175
175
|
* settledDate: "2024-10-15T14:30:00Z",
|
|
176
176
|
* authorizationDate: "2024-10-15T14:25:00Z",
|
|
177
|
-
*
|
|
178
|
-
* rssdId: "852218",
|
|
179
|
-
* name: "First National Bank"
|
|
180
|
-
* },
|
|
181
|
-
* merchant: {
|
|
182
|
-
* addrZipcode: "75001"
|
|
183
|
-
* }
|
|
177
|
+
* financialInstitutionName: "First National Bank"
|
|
184
178
|
* }
|
|
185
179
|
* }]
|
|
186
180
|
* })
|
|
@@ -18,8 +18,6 @@ export interface CoreTransactionAttributes {
|
|
|
18
18
|
settledDate: string;
|
|
19
19
|
/** Timestamp for transaction authorization. Date string should be in ISO 8601 format i.e.'YYYY-MM-DDThh:mm:ss.sTZD' where TZD = time zone designator (Z or +hh:mm or -hh:mm) i.e. 1994-11-05T08:15:30-05:00 OR 1994-11-05T08:15:30Z */
|
|
20
20
|
authorizationDate: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/** Merchant details */
|
|
24
|
-
merchant: KardApi.CoreMerchant;
|
|
21
|
+
/** Name of the financial institution */
|
|
22
|
+
financialInstitutionName: string;
|
|
25
23
|
}
|
|
@@ -136,13 +136,7 @@ import type * as KardApi from "../../../index.mjs";
|
|
|
136
136
|
* status: "SETTLED",
|
|
137
137
|
* settledDate: "2024-10-15T14:30:00Z",
|
|
138
138
|
* authorizationDate: "2024-10-15T14:25:00Z",
|
|
139
|
-
*
|
|
140
|
-
* rssdId: "852218",
|
|
141
|
-
* name: "First National Bank"
|
|
142
|
-
* },
|
|
143
|
-
* merchant: {
|
|
144
|
-
* addrZipcode: "75001"
|
|
145
|
-
* }
|
|
139
|
+
* financialInstitutionName: "First National Bank"
|
|
146
140
|
* }
|
|
147
141
|
* }]
|
|
148
142
|
* }
|
|
@@ -5,7 +5,6 @@ export * from "./AuditResponseData.mjs";
|
|
|
5
5
|
export * from "./AuditStatus.mjs";
|
|
6
6
|
export * from "./CardNetwork.mjs";
|
|
7
7
|
export * from "./CommissionEarnedDetails.mjs";
|
|
8
|
-
export * from "./CoreMerchant.mjs";
|
|
9
8
|
export * from "./CoreTransactionAttributes.mjs";
|
|
10
9
|
export * from "./CoreTransactionRequest.mjs";
|
|
11
10
|
export * from "./CreateAuditMultiStatusResponse.mjs";
|
|
@@ -14,7 +13,6 @@ export * from "./CreateAuditRequestDataUnion.mjs";
|
|
|
14
13
|
export * from "./CreateAuditResponseBody.mjs";
|
|
15
14
|
export * from "./CreateAuditResponseDataUnion.mjs";
|
|
16
15
|
export * from "./DirectionType.mjs";
|
|
17
|
-
export * from "./FinancialInstitution.mjs";
|
|
18
16
|
export * from "./FraudulentTransactionAttributes.mjs";
|
|
19
17
|
export * from "./FraudulentTransactionData.mjs";
|
|
20
18
|
export * from "./FraudulentTransactionObject.mjs";
|
|
@@ -5,7 +5,6 @@ export * from "./AuditResponseData.mjs";
|
|
|
5
5
|
export * from "./AuditStatus.mjs";
|
|
6
6
|
export * from "./CardNetwork.mjs";
|
|
7
7
|
export * from "./CommissionEarnedDetails.mjs";
|
|
8
|
-
export * from "./CoreMerchant.mjs";
|
|
9
8
|
export * from "./CoreTransactionAttributes.mjs";
|
|
10
9
|
export * from "./CoreTransactionRequest.mjs";
|
|
11
10
|
export * from "./CreateAuditMultiStatusResponse.mjs";
|
|
@@ -14,7 +13,6 @@ export * from "./CreateAuditRequestDataUnion.mjs";
|
|
|
14
13
|
export * from "./CreateAuditResponseBody.mjs";
|
|
15
14
|
export * from "./CreateAuditResponseDataUnion.mjs";
|
|
16
15
|
export * from "./DirectionType.mjs";
|
|
17
|
-
export * from "./FinancialInstitution.mjs";
|
|
18
16
|
export * from "./FraudulentTransactionAttributes.mjs";
|
|
19
17
|
export * from "./FraudulentTransactionData.mjs";
|
|
20
18
|
export * from "./FraudulentTransactionObject.mjs";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalize an email address for Hashed Email (HEM) generation.
|
|
3
|
+
*
|
|
4
|
+
* Follows UID2/LiveRamp industry standards:
|
|
5
|
+
* - Remove all whitespace
|
|
6
|
+
* - Lowercase
|
|
7
|
+
* - Gmail/Googlemail only: remove dots from local-part, strip '+' suffix
|
|
8
|
+
* - Canonicalize googlemail.com → gmail.com
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeEmail(raw: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Generate a Hashed Email (HEM) from a raw email address.
|
|
13
|
+
* Returns the lowercase hex SHA-256 digest of the normalized, UTF-8-encoded email.
|
|
14
|
+
*/
|
|
15
|
+
export declare function generateHEM(raw: string): string;
|
package/dist/esm/hem.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createHash } from "crypto";
|
|
2
|
+
const GMAIL_DOMAINS = new Set(["gmail.com", "googlemail.com"]);
|
|
3
|
+
/**
|
|
4
|
+
* Normalize an email address for Hashed Email (HEM) generation.
|
|
5
|
+
*
|
|
6
|
+
* Follows UID2/LiveRamp industry standards:
|
|
7
|
+
* - Remove all whitespace
|
|
8
|
+
* - Lowercase
|
|
9
|
+
* - Gmail/Googlemail only: remove dots from local-part, strip '+' suffix
|
|
10
|
+
* - Canonicalize googlemail.com → gmail.com
|
|
11
|
+
*/
|
|
12
|
+
export function normalizeEmail(raw) {
|
|
13
|
+
const email = raw.replace(/\s/g, "").toLowerCase();
|
|
14
|
+
const atIndex = email.indexOf("@");
|
|
15
|
+
if (atIndex < 1 || atIndex !== email.lastIndexOf("@") || atIndex === email.length - 1) {
|
|
16
|
+
throw new TypeError(`Invalid email address: ${JSON.stringify(raw)}`);
|
|
17
|
+
}
|
|
18
|
+
const localPart = email.slice(0, atIndex);
|
|
19
|
+
const domain = email.slice(atIndex + 1);
|
|
20
|
+
if (GMAIL_DOMAINS.has(domain)) {
|
|
21
|
+
const base = localPart.split("+")[0].replace(/\./g, "");
|
|
22
|
+
return `${base}@gmail.com`;
|
|
23
|
+
}
|
|
24
|
+
return `${localPart}@${domain}`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Generate a Hashed Email (HEM) from a raw email address.
|
|
28
|
+
* Returns the lowercase hex SHA-256 digest of the normalized, UTF-8-encoded email.
|
|
29
|
+
*/
|
|
30
|
+
export function generateHEM(raw) {
|
|
31
|
+
return createHash("sha256").update(normalizeEmail(raw), "utf8").digest("hex");
|
|
32
|
+
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "
|
|
1
|
+
export declare const SDK_VERSION = "3.0.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "
|
|
1
|
+
export const SDK_VERSION = "3.0.0";
|
package/package.json
CHANGED