@basis-theory/basis-theory-js 2.1.0 → 2.2.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/package.json +1 -1
- package/tokens/BasisTheoryTokens.d.ts +0 -4
- package/tokens/BasisTheoryTokens.js +0 -20
- package/types/models/bin-details.d.ts +38 -0
- package/types/models/bin-details.js +1 -0
- package/types/models/index.d.ts +1 -0
- package/types/models/index.js +13 -0
- package/types/models/tokens.d.ts +6 -1
- package/types/sdk/services/tokens.d.ts +0 -4
package/package.json
CHANGED
|
@@ -5,10 +5,6 @@ export declare const BasisTheoryTokens: {
|
|
|
5
5
|
new (options: BasisTheoryServiceOptions): {
|
|
6
6
|
retrieve(id: string, options?: RequestOptions): Promise<Token<any>>;
|
|
7
7
|
update(id: string, model: UpdateToken, options?: RequestOptions): Promise<Token>;
|
|
8
|
-
createAssociation(parentId: string, childId: string, options?: RequestOptions): Promise<void>;
|
|
9
|
-
deleteAssociation(parentId: string, childId: string, options?: RequestOptions): Promise<void>;
|
|
10
|
-
createChild(parentId: string, token: CreateToken, options?: RequestOptions): Promise<Token>;
|
|
11
|
-
listChildren(parentId: string, query?: ListTokensQuery, options?: RequestOptions): Promise<PaginatedList<Token>>;
|
|
12
8
|
search(searchRequest: SearchTokensRequest, options?: RequestOptions): Promise<PaginatedList<Token>>;
|
|
13
9
|
readonly client: import("axios").AxiosInstance;
|
|
14
10
|
};
|
|
@@ -40,26 +40,6 @@ const BasisTheoryTokens = new _CrudBuilder.CrudBuilder(class BasisTheoryTokens e
|
|
|
40
40
|
}).then(_utils.dataExtractor);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
async createAssociation(parentId, childId, options) {
|
|
44
|
-
const url = `/${parentId}/children/${childId}`;
|
|
45
|
-
await this.client.post(url, {}, (0, _common.createRequestConfig)(options));
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async deleteAssociation(parentId, childId, options) {
|
|
49
|
-
const url = `/${parentId}/children/${childId}`;
|
|
50
|
-
await this.client.delete(url, (0, _common.createRequestConfig)(options));
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
createChild(parentId, token, options) {
|
|
54
|
-
const url = `/${parentId}/children`;
|
|
55
|
-
return this.client.post(url, token, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
listChildren(parentId, query = {}, options = {}) {
|
|
59
|
-
const url = `/${parentId}/children${(0, _common.getQueryParams)(query)}`;
|
|
60
|
-
return this.client.get(url, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
43
|
search(searchRequest, options) {
|
|
64
44
|
return this.client.post('/search', searchRequest, (0, _common.createRequestConfig)(options)).then(_utils.dataExtractor);
|
|
65
45
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
interface BinDetails {
|
|
2
|
+
cardBrand?: string;
|
|
3
|
+
type?: string;
|
|
4
|
+
prepaid?: boolean;
|
|
5
|
+
cardSegmentType?: string;
|
|
6
|
+
reloadable?: boolean;
|
|
7
|
+
panOrToken?: string;
|
|
8
|
+
accountUpdater?: boolean;
|
|
9
|
+
alm?: boolean;
|
|
10
|
+
domesticOnly?: boolean;
|
|
11
|
+
gamblingBlocked?: boolean;
|
|
12
|
+
level2?: boolean;
|
|
13
|
+
level3?: boolean;
|
|
14
|
+
issuerCurrency?: string;
|
|
15
|
+
comboCard?: string;
|
|
16
|
+
binLength?: number;
|
|
17
|
+
authentication?: any;
|
|
18
|
+
cost?: any;
|
|
19
|
+
bank?: BinDetailsBank;
|
|
20
|
+
country?: BinDetailsCountry;
|
|
21
|
+
product?: BinDetailsProduct;
|
|
22
|
+
}
|
|
23
|
+
interface BinDetailsBank {
|
|
24
|
+
name?: string;
|
|
25
|
+
phone?: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
cleanName?: string;
|
|
28
|
+
}
|
|
29
|
+
interface BinDetailsCountry {
|
|
30
|
+
alpha2?: string;
|
|
31
|
+
name?: string;
|
|
32
|
+
numeric?: string;
|
|
33
|
+
}
|
|
34
|
+
interface BinDetailsProduct {
|
|
35
|
+
code?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
}
|
|
38
|
+
export type { BinDetails, BinDetailsBank, BinDetailsCountry, BinDetailsProduct, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/types/models/index.d.ts
CHANGED
package/types/models/index.js
CHANGED
|
@@ -160,6 +160,19 @@ Object.keys(_cards).forEach(function (key) {
|
|
|
160
160
|
});
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
+
var _binDetails = require("./bin-details");
|
|
164
|
+
|
|
165
|
+
Object.keys(_binDetails).forEach(function (key) {
|
|
166
|
+
if (key === "default" || key === "__esModule") return;
|
|
167
|
+
if (key in exports && exports[key] === _binDetails[key]) return;
|
|
168
|
+
Object.defineProperty(exports, key, {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _binDetails[key];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
|
|
163
176
|
var _util = require("./util");
|
|
164
177
|
|
|
165
178
|
Object.keys(_util).forEach(function (key) {
|
package/types/models/tokens.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BinDetails } from './bin-details';
|
|
1
2
|
import type { Primitive, TokenBase } from './shared';
|
|
2
3
|
declare const DATA_CLASSIFICATIONS: readonly ["general", "bank", "pci", "pii"];
|
|
3
4
|
type DataClassification = typeof DATA_CLASSIFICATIONS[number];
|
|
@@ -28,6 +29,9 @@ interface TokenPrivacy {
|
|
|
28
29
|
impactLevel?: DataImpactLevel;
|
|
29
30
|
restrictionPolicy?: DataRestrictionPolicy;
|
|
30
31
|
}
|
|
32
|
+
interface TokenEnrichments {
|
|
33
|
+
binDetails?: BinDetails;
|
|
34
|
+
}
|
|
31
35
|
interface Token<DataType = Primitive> extends TokenBase {
|
|
32
36
|
data: TokenData<DataType>;
|
|
33
37
|
privacy?: TokenPrivacy;
|
|
@@ -37,6 +41,7 @@ interface Token<DataType = Primitive> extends TokenBase {
|
|
|
37
41
|
fingerprintExpression?: string;
|
|
38
42
|
mask?: TokenMask;
|
|
39
43
|
expiresAt?: string;
|
|
44
|
+
enrichments?: TokenEnrichments;
|
|
40
45
|
}
|
|
41
46
|
type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
|
|
42
47
|
deduplicateToken?: boolean;
|
|
@@ -46,5 +51,5 @@ type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' |
|
|
|
46
51
|
privacy: Omit<TokenPrivacy, 'classification'>;
|
|
47
52
|
deduplicateToken: boolean;
|
|
48
53
|
}>;
|
|
49
|
-
export type { Token, CreateToken, UpdateToken, DataArray, DataObject, TokenData, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
|
|
54
|
+
export type { Token, TokenEnrichments, CreateToken, UpdateToken, DataArray, DataObject, TokenData, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
|
|
50
55
|
export { DATA_CLASSIFICATIONS, DATA_IMPACT_LEVELS, DATA_RESTRICTION_POLICIES };
|
|
@@ -11,10 +11,6 @@ interface SearchTokensRequest {
|
|
|
11
11
|
size?: number;
|
|
12
12
|
}
|
|
13
13
|
interface Tokens extends Create<Token, CreateToken>, Update<Token, UpdateToken>, Retrieve<Token<any>>, Delete, List<Token, ListTokensQuery> {
|
|
14
|
-
createAssociation(parentId: string, childId: string, options?: RequestOptions): Promise<void>;
|
|
15
|
-
deleteAssociation(parentId: string, childId: string, options?: RequestOptions): Promise<void>;
|
|
16
|
-
createChild(parentId: string, token: CreateToken, options?: RequestOptions): Promise<Token>;
|
|
17
|
-
listChildren(parentId: string, query?: ListTokensQuery, options?: RequestOptions): Promise<PaginatedList<Token>>;
|
|
18
14
|
search(searchRequest: SearchTokensRequest, options?: RequestOptions): Promise<PaginatedList<Token>>;
|
|
19
15
|
}
|
|
20
16
|
export type { Tokens, ListTokensQuery, SearchTokensRequest };
|