@basis-theory/basis-theory-js
Advanced tools
Comparing version 3.0.0 to 4.0.0
import type { BasisTheoryElements, CardElement, CardExpirationDateElement, CardNumberElement, CardVerificationCodeElement, CreateCardElementOptions, CreateCardExpirationDateElementOptions, CreateCardNumberElementOptions, CreateCardVerificationCodeElementOptions, CreateTextElementOptions, TextElement, TokenizeData as ElementsTokenizeData, Tokens as ElementsTokens } from './types/elements'; | ||
import type { TokenizeData } from './types/models'; | ||
import type { Applications, ApplicationTemplates, BasisTheory as IBasisTheory, BasisTheoryInit, BasisTheoryInitOptions, BasisTheoryInitOptionsWithElements, BasisTheoryInitOptionsWithoutElements, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, RequestOptions, Sessions, Tenants, Tokens } from './types/sdk'; | ||
import { Transactions } from './types/sdk/services/transactions'; | ||
export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, BasisTheoryElements { | ||
@@ -21,3 +20,2 @@ private _initStatus; | ||
private _sessions?; | ||
private _transactions?; | ||
init(apiKey: string | undefined, options?: BasisTheoryInitOptionsWithoutElements): Promise<IBasisTheory>; | ||
@@ -49,3 +47,2 @@ init(apiKey: string | undefined, options: BasisTheoryInitOptionsWithElements): Promise<IBasisTheory & BasisTheoryElements>; | ||
get sessions(): Sessions; | ||
get transactions(): Transactions; | ||
/** | ||
@@ -52,0 +49,0 @@ * @deprecated |
@@ -8,4 +8,2 @@ "use strict"; | ||
var _transactions = require("./transactions"); | ||
var _applicationTemplates = require("./application-templates"); | ||
@@ -141,7 +139,2 @@ | ||
}); | ||
this._transactions = new _transactions.BasisTheoryTransactions({ | ||
apiKey, | ||
baseURL: new URL(_common.CLIENT_BASE_PATHS.transactions, baseUrl).toString(), | ||
appInfo | ||
}); | ||
this._initStatus = 'done'; | ||
@@ -250,6 +243,2 @@ } catch (error) { | ||
} | ||
get transactions() { | ||
return (0, _common.assertInit)(this._transactions); | ||
} | ||
/* eslint-enable accessor-pairs */ | ||
@@ -256,0 +245,0 @@ |
@@ -6,3 +6,2 @@ import type { BasisTheoryServicesBasePathMap } from '../types/sdk'; | ||
declare const BT_EXPOSE_PROXY_RESPONSE_HEADER = "BT-EXPOSE-RAW-PROXY-RESPONSE"; | ||
declare const BT_TRANSACTION_ID_HEADER = "BT-TRANSACTION-ID"; | ||
declare const CONTENT_TYPE_HEADER = "Content-Type"; | ||
@@ -20,2 +19,2 @@ declare const MERGE_CONTENT_TYPE = "application/merge-patch+json"; | ||
}[]; | ||
export { API_KEY_HEADER, BT_TRACE_ID_HEADER, BT_IDEMPOTENCY_KEY_HEADER, CONTENT_TYPE_HEADER, MERGE_CONTENT_TYPE, USER_AGENT_HEADER, CLIENT_USER_AGENT_HEADER, USER_AGENT_CLIENT, BT_EXPOSE_PROXY_RESPONSE_HEADER, DEFAULT_BASE_URL, DEFAULT_ELEMENTS_BASE_URL, CLIENT_BASE_PATHS, BROWSER_LIST, BT_TRANSACTION_ID_HEADER, }; | ||
export { API_KEY_HEADER, BT_TRACE_ID_HEADER, BT_IDEMPOTENCY_KEY_HEADER, CONTENT_TYPE_HEADER, MERGE_CONTENT_TYPE, USER_AGENT_HEADER, CLIENT_USER_AGENT_HEADER, USER_AGENT_CLIENT, BT_EXPOSE_PROXY_RESPONSE_HEADER, DEFAULT_BASE_URL, DEFAULT_ELEMENTS_BASE_URL, CLIENT_BASE_PATHS, BROWSER_LIST, }; |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.USER_AGENT_HEADER = exports.USER_AGENT_CLIENT = exports.MERGE_CONTENT_TYPE = exports.DEFAULT_ELEMENTS_BASE_URL = exports.DEFAULT_BASE_URL = exports.CONTENT_TYPE_HEADER = exports.CLIENT_USER_AGENT_HEADER = exports.CLIENT_BASE_PATHS = exports.BT_TRANSACTION_ID_HEADER = exports.BT_TRACE_ID_HEADER = exports.BT_IDEMPOTENCY_KEY_HEADER = exports.BT_EXPOSE_PROXY_RESPONSE_HEADER = exports.BROWSER_LIST = exports.API_KEY_HEADER = void 0; | ||
exports.USER_AGENT_HEADER = exports.USER_AGENT_CLIENT = exports.MERGE_CONTENT_TYPE = exports.DEFAULT_ELEMENTS_BASE_URL = exports.DEFAULT_BASE_URL = exports.CONTENT_TYPE_HEADER = exports.CLIENT_USER_AGENT_HEADER = exports.CLIENT_BASE_PATHS = exports.BT_TRACE_ID_HEADER = exports.BT_IDEMPOTENCY_KEY_HEADER = exports.BT_EXPOSE_PROXY_RESPONSE_HEADER = exports.BROWSER_LIST = exports.API_KEY_HEADER = void 0; | ||
const API_KEY_HEADER = 'BT-API-KEY'; | ||
@@ -16,4 +16,2 @@ exports.API_KEY_HEADER = API_KEY_HEADER; | ||
exports.BT_EXPOSE_PROXY_RESPONSE_HEADER = BT_EXPOSE_PROXY_RESPONSE_HEADER; | ||
const BT_TRANSACTION_ID_HEADER = 'BT-TRANSACTION-ID'; | ||
exports.BT_TRANSACTION_ID_HEADER = BT_TRANSACTION_ID_HEADER; | ||
const CONTENT_TYPE_HEADER = 'Content-Type'; | ||
@@ -45,4 +43,3 @@ exports.CONTENT_TYPE_HEADER = CONTENT_TYPE_HEADER; | ||
proxy: 'proxy', | ||
sessions: 'sessions', | ||
transactions: 'transactions' | ||
sessions: 'sessions' | ||
}; | ||
@@ -49,0 +46,0 @@ exports.CLIENT_BASE_PATHS = CLIENT_BASE_PATHS; |
@@ -258,3 +258,2 @@ "use strict"; | ||
idempotencyKey, | ||
transactionId, | ||
query, | ||
@@ -272,5 +271,2 @@ headers | ||
} : {}; | ||
const transactionIdHeader = transactionId ? { | ||
[_constants.BT_TRANSACTION_ID_HEADER]: transactionId | ||
} : {}; | ||
return { | ||
@@ -280,3 +276,2 @@ headers: { ...apiKeyHeader, | ||
...idempotencyKeyHeader, | ||
...transactionIdHeader, | ||
...(typeof headers !== 'undefined' && { ...headers | ||
@@ -283,0 +278,0 @@ }) |
{ | ||
"name": "@basis-theory/basis-theory-js", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"repository": "https://github.com/Basis-Theory/basis-theory-js", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -39,4 +39,3 @@ # Basis Theory JS SDK (aka BasisTheory.js) | ||
All of the service methods accept an optional `RequestOptions` object. This is used if you want to set a per-request `BT-TRACE-ID`, `BT-API-KEY`, `BT-IDEMPOTENCY-KEY` | ||
and/or `BT-TRANSACTION-ID`. | ||
All of the service methods accept an optional `RequestOptions` object. This is used if you want to set a per-request `BT-TRACE-ID`, `BT-API-KEY` and/or `BT-IDEMPOTENCY-KEY`. | ||
@@ -64,3 +63,2 @@ ```javascript | ||
idempotencyKey: 'bb5d3379-6385-4ef4-9fdb-ca1341572154', | ||
transactionId: 'cc5d3379-3921-4ef4-9fdb-ca1341572169', | ||
} | ||
@@ -67,0 +65,0 @@ ); |
import type { BasisTheoryElements } from '../../types/elements'; | ||
import { Transactions } from '../../types/sdk/services/transactions'; | ||
import type { Applications, ApplicationTemplates, HttpClient, Logs, Permissions, Proxies, Proxy, ReactorFormulas, Reactors, Sessions, Tenants, Tokenize, Tokens } from './services'; | ||
@@ -44,3 +43,2 @@ interface ApplicationInfo { | ||
tokens: Tokens; | ||
transactions: Transactions; | ||
} | ||
@@ -47,0 +45,0 @@ interface ClientUserAgent { |
@@ -13,4 +13,3 @@ export * from './shared'; | ||
export * from './sessions'; | ||
export * from './transactions'; | ||
export * from './http'; | ||
export * from './application-templates'; |
@@ -163,15 +163,2 @@ "use strict"; | ||
var _transactions = require("./transactions"); | ||
Object.keys(_transactions).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _transactions[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _transactions[key]; | ||
} | ||
}); | ||
}); | ||
var _http = require("./http"); | ||
@@ -178,0 +165,0 @@ |
@@ -5,3 +5,2 @@ interface RequestOptions { | ||
idempotencyKey?: string; | ||
transactionId?: string; | ||
} | ||
@@ -8,0 +7,0 @@ type QueryValue = boolean | number | string | null | undefined | Record<string, string> | (number | string)[]; |
161814
179
3594
100