@basis-theory/basis-theory-js 1.24.0 → 1.26.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/BasisTheory.d.ts +6 -0
- package/BasisTheory.js +8 -0
- package/atomic/banks/BasisTheoryAtomicBanks.d.ts +0 -1
- package/atomic/banks/BasisTheoryAtomicBanks.js +0 -4
- package/atomic/cards/BasisTheoryAtomicCards.d.ts +0 -1
- package/atomic/cards/BasisTheoryAtomicCards.js +0 -4
- package/common/index.d.ts +2 -1
- package/common/index.js +20 -11
- package/common/utils.d.ts +1 -1
- package/common/utils.js +3 -3
- package/package.json +2 -2
- package/tokens/BasisTheoryTokens.d.ts +1 -3
- package/tokens/BasisTheoryTokens.js +0 -10
- package/common/BasisTheoryApiError.d.ts +0 -5
- package/common/BasisTheoryApiError.js +0 -20
package/BasisTheory.d.ts
CHANGED
|
@@ -28,7 +28,13 @@ export declare class BasisTheory implements BasisTheoryInit, IBasisTheory, Basis
|
|
|
28
28
|
get logs(): Logs;
|
|
29
29
|
get reactorFormulas(): ReactorFormulas;
|
|
30
30
|
get reactors(): Reactors;
|
|
31
|
+
/**
|
|
32
|
+
* @deprecated use {@link tokens} or {@link tokenize}
|
|
33
|
+
*/
|
|
31
34
|
get atomicBanks(): AtomicBanks & ElementsAtomicBanks;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use {@link tokens} or {@link tokenize}
|
|
37
|
+
*/
|
|
32
38
|
get atomicCards(): AtomicCards & ElementsAtomicCards;
|
|
33
39
|
get permissions(): Permissions;
|
|
34
40
|
/**
|
package/BasisTheory.js
CHANGED
|
@@ -187,10 +187,18 @@ class BasisTheory {
|
|
|
187
187
|
get reactors() {
|
|
188
188
|
return (0, _common.assertInit)(this._reactors);
|
|
189
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* @deprecated use {@link tokens} or {@link tokenize}
|
|
192
|
+
*/
|
|
193
|
+
|
|
190
194
|
|
|
191
195
|
get atomicBanks() {
|
|
192
196
|
return (0, _common.assertInit)(this._atomicBanks);
|
|
193
197
|
}
|
|
198
|
+
/**
|
|
199
|
+
* @deprecated use {@link tokens} or {@link tokenize}
|
|
200
|
+
*/
|
|
201
|
+
|
|
194
202
|
|
|
195
203
|
get atomicCards() {
|
|
196
204
|
return (0, _common.assertInit)(this._atomicCards);
|
|
@@ -4,7 +4,6 @@ import type { BasisTheoryServiceOptions } from '../../service';
|
|
|
4
4
|
export declare const BasisTheoryAtomicBanks: {
|
|
5
5
|
new (options: BasisTheoryServiceOptions): {
|
|
6
6
|
update(id: string, request: UpdateAtomicBank, options?: RequestOptions | undefined): Promise<AtomicBank>;
|
|
7
|
-
retrieveDecrypted(id: string, options?: RequestOptions | undefined): Promise<AtomicBank>;
|
|
8
7
|
react(tokenId: string, request: AtomicReactRequest, options?: RequestOptions | undefined): Promise<ReactResponse>;
|
|
9
8
|
readonly client: import("axios").AxiosInstance;
|
|
10
9
|
};
|
|
@@ -26,10 +26,6 @@ const BasisTheoryAtomicBanks = new _CrudBuilder.CrudBuilder(class BasisTheoryAto
|
|
|
26
26
|
return this.client.patch(`/${id}`, request, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
retrieveDecrypted(id, options) {
|
|
30
|
-
return this.client.get(`/${id}/decrypt`, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
29
|
react(tokenId, request, options) {
|
|
34
30
|
return this.client.post(`/${tokenId}/react`, request, (0, _common.createRequestConfig)(options, {
|
|
35
31
|
transformRequest: _common.transformAtomicReactionRequestSnakeCase,
|
|
@@ -4,7 +4,6 @@ import type { BasisTheoryServiceOptions } from '../../service';
|
|
|
4
4
|
export declare const BasisTheoryAtomicCards: {
|
|
5
5
|
new (options: BasisTheoryServiceOptions): {
|
|
6
6
|
update(id: string, request: UpdateAtomicCard, options?: RequestOptions | undefined): Promise<AtomicCard>;
|
|
7
|
-
retrieveDecrypted(id: string, options?: RequestOptions | undefined): Promise<AtomicCard>;
|
|
8
7
|
react(tokenId: string, request: AtomicReactRequest, options?: RequestOptions | undefined): Promise<ReactResponse>;
|
|
9
8
|
readonly client: import("axios").AxiosInstance;
|
|
10
9
|
};
|
|
@@ -28,10 +28,6 @@ const BasisTheoryAtomicCards = new _CrudBuilder.CrudBuilder(class BasisTheoryAto
|
|
|
28
28
|
return this.client.patch(`/${id}`, request, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
retrieveDecrypted(id, options) {
|
|
32
|
-
return this.client.get(`/${id}/decrypt`, (0, _common.createRequestConfig)(options)).then(_common.dataExtractor);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
31
|
react(tokenId, request, options) {
|
|
36
32
|
return this.client.post(`/${tokenId}/react`, request, (0, _common.createRequestConfig)(options, {
|
|
37
33
|
transformRequest: _common.transformAtomicReactionRequestSnakeCase,
|
package/common/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './constants';
|
|
2
2
|
export * from './utils';
|
|
3
|
-
export
|
|
3
|
+
export { BasisTheoryApiError } from '@basis-theory/basis-theory-elements-interfaces/sdk';
|
|
4
|
+
export { BasisTheoryValidationError } from '@basis-theory/basis-theory-elements-interfaces/elements';
|
package/common/index.js
CHANGED
|
@@ -3,11 +3,28 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
BasisTheoryApiError: true,
|
|
8
|
+
BasisTheoryValidationError: true
|
|
9
|
+
};
|
|
10
|
+
Object.defineProperty(exports, "BasisTheoryApiError", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _sdk.BasisTheoryApiError;
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "BasisTheoryValidationError", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () {
|
|
19
|
+
return _elements.BasisTheoryValidationError;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
6
22
|
|
|
7
23
|
var _constants = require("./constants");
|
|
8
24
|
|
|
9
25
|
Object.keys(_constants).forEach(function (key) {
|
|
10
26
|
if (key === "default" || key === "__esModule") return;
|
|
27
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
11
28
|
if (key in exports && exports[key] === _constants[key]) return;
|
|
12
29
|
Object.defineProperty(exports, key, {
|
|
13
30
|
enumerable: true,
|
|
@@ -21,6 +38,7 @@ var _utils = require("./utils");
|
|
|
21
38
|
|
|
22
39
|
Object.keys(_utils).forEach(function (key) {
|
|
23
40
|
if (key === "default" || key === "__esModule") return;
|
|
41
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
24
42
|
if (key in exports && exports[key] === _utils[key]) return;
|
|
25
43
|
Object.defineProperty(exports, key, {
|
|
26
44
|
enumerable: true,
|
|
@@ -30,15 +48,6 @@ Object.keys(_utils).forEach(function (key) {
|
|
|
30
48
|
});
|
|
31
49
|
});
|
|
32
50
|
|
|
33
|
-
var
|
|
51
|
+
var _sdk = require("@basis-theory/basis-theory-elements-interfaces/sdk");
|
|
34
52
|
|
|
35
|
-
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (key in exports && exports[key] === _BasisTheoryApiError[key]) return;
|
|
38
|
-
Object.defineProperty(exports, key, {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _BasisTheoryApiError[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
53
|
+
var _elements = require("@basis-theory/basis-theory-elements-interfaces/elements");
|
package/common/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RequestOptions } from '@basis-theory/basis-theory-elements-interfaces/sdk';
|
|
2
2
|
import type { AxiosRequestConfig, AxiosResponse, AxiosTransformer } from 'axios';
|
|
3
3
|
import type { ApplicationInfo } from '../types';
|
|
4
4
|
declare const assertInit: <T>(prop: T) => NonNullable<T>;
|
package/common/utils.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.transformTokenResponseCamelCase = exports.transformTokenRequestSnakeCase = exports.transformResponseCamelCase = exports.transformRequestSnakeCase = exports.transformReactorResponseCamelCase = exports.transformReactorRequestSnakeCase = exports.transformAtomicResponseCamelCase = exports.transformAtomicRequestSnakeCase = exports.transformAtomicReactionRequestSnakeCase = exports.proxyRaw = exports.getRuntime = exports.getQueryParams = exports.getOSVersion = exports.getBrowser = exports.errorInterceptor = exports.dataExtractor = exports.createRequestConfig = exports.concatResponseTransformermWithDefault = exports.concatRequestTransformerWithDefault = exports.buildUserAgentString = exports.buildClientUserAgentString = exports.assertInit = void 0;
|
|
7
7
|
|
|
8
|
+
var _sdk = require("@basis-theory/basis-theory-elements-interfaces/sdk");
|
|
9
|
+
|
|
8
10
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
11
|
|
|
10
12
|
var _camelcaseKeys = _interopRequireDefault(require("camelcase-keys"));
|
|
@@ -15,8 +17,6 @@ var _snakeCase = require("snake-case");
|
|
|
15
17
|
|
|
16
18
|
var _snakecaseKeys = _interopRequireDefault(require("snakecase-keys"));
|
|
17
19
|
|
|
18
|
-
var _BasisTheoryApiError = require("./BasisTheoryApiError");
|
|
19
|
-
|
|
20
20
|
var _constants = require("./constants");
|
|
21
21
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -237,7 +237,7 @@ const errorInterceptor = error => {
|
|
|
237
237
|
|
|
238
238
|
const status = ((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) || -1;
|
|
239
239
|
const data = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data;
|
|
240
|
-
throw new
|
|
240
|
+
throw new _sdk.BasisTheoryApiError(error.message, status, data);
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
exports.errorInterceptor = errorInterceptor;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@basis-theory/basis-theory-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.26.0",
|
|
4
4
|
"repository": "https://github.com/Basis-Theory/basis-theory-js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"!*.bundle.js"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@basis-theory/basis-theory-elements-interfaces": "^
|
|
18
|
+
"@basis-theory/basis-theory-elements-interfaces": "^4.0.0",
|
|
19
19
|
"axios": "^0.21.2",
|
|
20
20
|
"camelcase-keys": "^6.2.2",
|
|
21
21
|
"os": "^0.1.2",
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { Token, CreateToken } from '@basis-theory/basis-theory-elements-interfaces/models';
|
|
2
|
-
import type { PaginatedList, RequestOptions,
|
|
2
|
+
import type { PaginatedList, RequestOptions, ListTokensQuery, SearchTokensRequest } from '@basis-theory/basis-theory-elements-interfaces/sdk';
|
|
3
3
|
import { BasisTheoryServiceOptions } from '../service';
|
|
4
4
|
export declare const BasisTheoryTokens: {
|
|
5
5
|
new (options: BasisTheoryServiceOptions): {
|
|
6
6
|
retrieve(id: string, options?: RequestOptions): Promise<Token>;
|
|
7
|
-
retrieveDecrypted(id: string, options?: RequestOptions): Promise<Token>;
|
|
8
|
-
listDecrypted(query?: ListDecryptedTokensQuery, options?: RequestOptions): Promise<PaginatedList<Token>>;
|
|
9
7
|
createAssociation(parentId: string, childId: string, options?: RequestOptions | undefined): Promise<void>;
|
|
10
8
|
deleteAssociation(parentId: string, childId: string, options?: RequestOptions | undefined): Promise<void>;
|
|
11
9
|
createChild(parentId: string, token: CreateToken, options?: RequestOptions | undefined): Promise<Token>;
|
|
@@ -28,16 +28,6 @@ const BasisTheoryTokens = new _CrudBuilder.CrudBuilder(class BasisTheoryTokens e
|
|
|
28
28
|
return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
retrieveDecrypted(id, options = {}) {
|
|
32
|
-
const url = `/${id}/decrypt`;
|
|
33
|
-
return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
listDecrypted(query = {}, options = {}) {
|
|
37
|
-
const url = `/decrypt${(0, _common.getQueryParams)(query)}`;
|
|
38
|
-
return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
31
|
async createAssociation(parentId, childId, options) {
|
|
42
32
|
const url = `/${parentId}/children/${childId}`;
|
|
43
33
|
await this.client.post(url, {}, (0, _common.createRequestConfig)(options));
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.BasisTheoryApiError = void 0;
|
|
7
|
-
|
|
8
|
-
class BasisTheoryApiError extends Error {
|
|
9
|
-
constructor(message, status, data) {
|
|
10
|
-
super(message);
|
|
11
|
-
this.status = status;
|
|
12
|
-
this.data = data;
|
|
13
|
-
this.name = 'BasisTheoryApiError';
|
|
14
|
-
this.status = status;
|
|
15
|
-
this.data = data;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
exports.BasisTheoryApiError = BasisTheoryApiError;
|