@basis-theory/basis-theory-js 4.23.1 → 4.24.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.js +11 -5
- package/common/BasisTheoryApiError.d.ts +2 -1
- package/common/BasisTheoryApiError.js +2 -1
- package/common/constants.d.ts +2 -1
- package/common/constants.js +4 -2
- package/common/utils.d.ts +3 -1
- package/common/utils.js +44 -11
- package/package.json +1 -1
- package/service/BasisTheoryService.js +4 -3
- package/service/types.d.ts +1 -0
- package/types/models/token-intents.d.ts +1 -0
- package/types/models/tokenize.d.ts +3 -1
- package/types/models/tokens.d.ts +3 -0
- package/types/sdk/sdk.d.ts +1 -0
- package/types/sdk/services/sessions.d.ts +1 -0
package/BasisTheory.js
CHANGED
|
@@ -41,6 +41,7 @@ const defaultInitOptions = {
|
|
|
41
41
|
apiBaseUrl: _common.DEFAULT_BASE_URL,
|
|
42
42
|
elements: false,
|
|
43
43
|
disableTelemetry: false,
|
|
44
|
+
debug: false,
|
|
44
45
|
appInfo: {}
|
|
45
46
|
};
|
|
46
47
|
|
|
@@ -85,12 +86,14 @@ class BasisTheory {
|
|
|
85
86
|
this._tokens = new ((0, _elements.delegateTokens)(this._elements))({
|
|
86
87
|
apiKey,
|
|
87
88
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.tokens, baseUrl).toString(),
|
|
88
|
-
appInfo
|
|
89
|
+
appInfo,
|
|
90
|
+
debug: this._initOptions.debug
|
|
89
91
|
});
|
|
90
92
|
this._tokenize = new ((0, _elements.delegateTokenize)(this._elements))({
|
|
91
93
|
apiKey,
|
|
92
94
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.tokenize, baseUrl).toString(),
|
|
93
|
-
appInfo
|
|
95
|
+
appInfo,
|
|
96
|
+
debug: this._initOptions.debug
|
|
94
97
|
});
|
|
95
98
|
this._applications = new _applications.BasisTheoryApplications({
|
|
96
99
|
apiKey,
|
|
@@ -140,12 +143,14 @@ class BasisTheory {
|
|
|
140
143
|
this._proxy = new ((0, _elements.delegateProxy)(this._elements))({
|
|
141
144
|
apiKey,
|
|
142
145
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.proxy, baseUrl).toString(),
|
|
143
|
-
appInfo
|
|
146
|
+
appInfo,
|
|
147
|
+
debug: this._initOptions.debug
|
|
144
148
|
});
|
|
145
149
|
this._sessions = new _sessions.BasisTheorySessions({
|
|
146
150
|
apiKey,
|
|
147
151
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.sessions, baseUrl).toString(),
|
|
148
|
-
appInfo
|
|
152
|
+
appInfo,
|
|
153
|
+
debug: this._initOptions.debug
|
|
149
154
|
});
|
|
150
155
|
this._threeds = new _threeds.BasisTheoryThreeDS({
|
|
151
156
|
apiKey,
|
|
@@ -155,7 +160,8 @@ class BasisTheory {
|
|
|
155
160
|
this._tokenIntents = new ((0, _elements.delegateTokenIntents)(this._elements))({
|
|
156
161
|
apiKey,
|
|
157
162
|
baseURL: new URL(_common.CLIENT_BASE_PATHS.tokenIntents, baseUrl).toString(),
|
|
158
|
-
appInfo
|
|
163
|
+
appInfo,
|
|
164
|
+
debug: this._initOptions.debug
|
|
159
165
|
});
|
|
160
166
|
|
|
161
167
|
if (options.disableTelemetry) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare class BasisTheoryApiError extends Error {
|
|
2
2
|
readonly status: number;
|
|
3
3
|
readonly data?: unknown;
|
|
4
|
-
|
|
4
|
+
readonly _debug?: Record<string, unknown> | undefined;
|
|
5
|
+
constructor(message: string, status: number, data?: unknown, _debug?: Record<string, unknown> | undefined);
|
|
5
6
|
}
|
|
@@ -31,10 +31,11 @@ function _extendableBuiltin(cls) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
class BasisTheoryApiError extends _extendableBuiltin(Error) {
|
|
34
|
-
constructor(message, status, data) {
|
|
34
|
+
constructor(message, status, data, _debug) {
|
|
35
35
|
super(message);
|
|
36
36
|
this.status = status;
|
|
37
37
|
this.data = data;
|
|
38
|
+
this._debug = _debug;
|
|
38
39
|
this.name = 'BasisTheoryApiError';
|
|
39
40
|
Object.setPrototypeOf(this, BasisTheoryApiError.prototype);
|
|
40
41
|
}
|
package/common/constants.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BasisTheoryServicesBasePathMap } from '../types/sdk';
|
|
2
2
|
declare const API_KEY_HEADER = "BT-API-KEY";
|
|
3
3
|
declare const BT_TRACE_ID_HEADER = "bt-trace-id";
|
|
4
|
+
declare const CF_RAY_HEADER = "cf-ray";
|
|
4
5
|
declare const BT_IDEMPOTENCY_KEY_HEADER = "bt-idempotency-key";
|
|
5
6
|
declare const BT_EXPOSE_PROXY_RESPONSE_HEADER = "BT-EXPOSE-RAW-PROXY-RESPONSE";
|
|
6
7
|
declare const CONTENT_TYPE_HEADER = "Content-Type";
|
|
@@ -17,4 +18,4 @@ declare const BROWSER_LIST: {
|
|
|
17
18
|
browserName: string;
|
|
18
19
|
browserUA: string;
|
|
19
20
|
}[];
|
|
20
|
-
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, DD_TOKEN, DD_GIT_SHA, };
|
|
21
|
+
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, DD_TOKEN, DD_GIT_SHA, CF_RAY_HEADER, };
|
package/common/constants.js
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.USER_AGENT_HEADER = exports.USER_AGENT_CLIENT = exports.MERGE_CONTENT_TYPE = exports.DEFAULT_ELEMENTS_BASE_URL = exports.DEFAULT_BASE_URL = exports.DD_TOKEN = exports.DD_GIT_SHA = 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;
|
|
6
|
+
exports.USER_AGENT_HEADER = exports.USER_AGENT_CLIENT = exports.MERGE_CONTENT_TYPE = exports.DEFAULT_ELEMENTS_BASE_URL = exports.DEFAULT_BASE_URL = exports.DD_TOKEN = exports.DD_GIT_SHA = exports.CONTENT_TYPE_HEADER = exports.CLIENT_USER_AGENT_HEADER = exports.CLIENT_BASE_PATHS = exports.CF_RAY_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;
|
|
7
7
|
const API_KEY_HEADER = 'BT-API-KEY';
|
|
8
8
|
exports.API_KEY_HEADER = API_KEY_HEADER;
|
|
9
9
|
const BT_TRACE_ID_HEADER = 'bt-trace-id';
|
|
10
10
|
exports.BT_TRACE_ID_HEADER = BT_TRACE_ID_HEADER;
|
|
11
|
+
const CF_RAY_HEADER = 'cf-ray';
|
|
12
|
+
exports.CF_RAY_HEADER = CF_RAY_HEADER;
|
|
11
13
|
const BT_IDEMPOTENCY_KEY_HEADER = 'bt-idempotency-key';
|
|
12
14
|
exports.BT_IDEMPOTENCY_KEY_HEADER = BT_IDEMPOTENCY_KEY_HEADER;
|
|
13
15
|
const BT_EXPOSE_PROXY_RESPONSE_HEADER = 'BT-EXPOSE-RAW-PROXY-RESPONSE';
|
|
@@ -28,7 +30,7 @@ const DEFAULT_ELEMENTS_BASE_URL = `https://${"js.basistheory.com/hosted-elements
|
|
|
28
30
|
exports.DEFAULT_ELEMENTS_BASE_URL = DEFAULT_ELEMENTS_BASE_URL;
|
|
29
31
|
const DD_TOKEN = "pub5f53501515584007899577554c4aeda6";
|
|
30
32
|
exports.DD_TOKEN = DD_TOKEN;
|
|
31
|
-
const DD_GIT_SHA = "
|
|
33
|
+
const DD_GIT_SHA = "14843864d437c11f7676a56886d65e3359da17c1";
|
|
32
34
|
exports.DD_GIT_SHA = DD_GIT_SHA;
|
|
33
35
|
const CLIENT_BASE_PATHS = {
|
|
34
36
|
tokens: 'tokens',
|
package/common/utils.d.ts
CHANGED
|
@@ -19,10 +19,12 @@ declare const concatRequestTransformerWithDefault: (requestTransformer: AxiosReq
|
|
|
19
19
|
declare const concatResponseTransformerWithDefault: (responseTransformer: AxiosResponseTransformer | AxiosResponseTransformer[]) => AxiosResponseTransformer | AxiosResponseTransformer[] | undefined;
|
|
20
20
|
declare const createRequestConfig: (options?: ProxyRequestOptions | RequestOptions, transformers?: RequestTransformers) => AxiosRequestConfig | undefined;
|
|
21
21
|
declare const errorInterceptor: (error: AxiosError) => void;
|
|
22
|
+
declare const errorInterceptorDebug: (error: AxiosError) => void;
|
|
22
23
|
declare const getQueryParams: <Q>(query?: Q) => string;
|
|
23
24
|
declare const buildUserAgentString: (appInfo?: ApplicationInfo) => string;
|
|
24
25
|
declare const getBrowser: () => string;
|
|
25
26
|
declare const getOSVersion: () => string;
|
|
26
27
|
declare const getRuntime: () => string;
|
|
27
28
|
declare const buildClientUserAgentString: (appInfo?: ApplicationInfo) => string;
|
|
28
|
-
|
|
29
|
+
declare const debugTransform: AxiosResponseTransformer;
|
|
30
|
+
export { assertInit, transformRequestSnakeCase, proxyRaw, dataAndHeadersExtractor, transformReactorRequestSnakeCase, transformProxyRequestSnakeCase, transformTokenRequestSnakeCase, transformTokenResponseCamelCase, transformReactorResponseCamelCase, transformProxyResponseCamelCase, transformResponseCamelCase, dataExtractor, createRequestConfig, concatRequestTransformerWithDefault, concatResponseTransformerWithDefault, errorInterceptor, getQueryParams, buildUserAgentString, buildClientUserAgentString, getOSVersion, getRuntime, getBrowser, debugTransform, errorInterceptorDebug, };
|
package/common/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.transformTokenResponseCamelCase = exports.transformTokenRequestSnakeCase = exports.transformResponseCamelCase = exports.transformRequestSnakeCase = exports.transformReactorResponseCamelCase = exports.transformReactorRequestSnakeCase = exports.transformProxyResponseCamelCase = exports.transformProxyRequestSnakeCase = exports.proxyRaw = exports.getRuntime = exports.getQueryParams = exports.getOSVersion = exports.getBrowser = exports.errorInterceptor = exports.dataExtractor = exports.dataAndHeadersExtractor = exports.createRequestConfig = exports.concatResponseTransformerWithDefault = exports.concatRequestTransformerWithDefault = exports.buildUserAgentString = exports.buildClientUserAgentString = exports.assertInit = void 0;
|
|
6
|
+
exports.transformTokenResponseCamelCase = exports.transformTokenRequestSnakeCase = exports.transformResponseCamelCase = exports.transformRequestSnakeCase = exports.transformReactorResponseCamelCase = exports.transformReactorRequestSnakeCase = exports.transformProxyResponseCamelCase = exports.transformProxyRequestSnakeCase = exports.proxyRaw = exports.getRuntime = exports.getQueryParams = exports.getOSVersion = exports.getBrowser = exports.errorInterceptorDebug = exports.errorInterceptor = exports.debugTransform = exports.dataExtractor = exports.dataAndHeadersExtractor = exports.createRequestConfig = exports.concatResponseTransformerWithDefault = exports.concatRequestTransformerWithDefault = exports.buildUserAgentString = exports.buildClientUserAgentString = exports.assertInit = void 0;
|
|
7
7
|
|
|
8
8
|
var _axios = _interopRequireDefault(require("axios"));
|
|
9
9
|
|
|
@@ -290,11 +290,23 @@ const createRequestConfig = (options, transformers) => {
|
|
|
290
290
|
|
|
291
291
|
exports.createRequestConfig = createRequestConfig;
|
|
292
292
|
|
|
293
|
-
const
|
|
294
|
-
var _error$response$statu, _error$response, _error$response2, _error$config, _error$config$method, _error$config2, _error$config3, _error$config4, _error$config4$method, _error$config5, _error$config5$header, _error$
|
|
293
|
+
const handleAxiosError = (error, debug) => {
|
|
294
|
+
var _error$response$statu, _error$response, _error$response2, _error$config, _error$config$method, _error$config2, _error$config3, _error$config4, _error$config4$method, _error$config5, _error$config5$header, _error$response5, _error$response6, _error$response7, _error$response8;
|
|
295
|
+
|
|
296
|
+
const status = (_error$response$statu = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== null && _error$response$statu !== void 0 ? _error$response$statu : -1;
|
|
297
|
+
const data = error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data;
|
|
298
|
+
|
|
299
|
+
let _debug;
|
|
300
|
+
|
|
301
|
+
if (debug) {
|
|
302
|
+
var _error$response3, _error$response3$head, _error$response4, _error$response4$head;
|
|
303
|
+
|
|
304
|
+
_debug = {
|
|
305
|
+
cfRay: error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$head = _error$response3.headers) === null || _error$response3$head === void 0 ? void 0 : _error$response3$head[_constants.CF_RAY_HEADER],
|
|
306
|
+
btTraceId: error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$head = _error$response4.headers) === null || _error$response4$head === void 0 ? void 0 : _error$response4$head[_constants.BT_TRACE_ID_HEADER]
|
|
307
|
+
};
|
|
308
|
+
}
|
|
295
309
|
|
|
296
|
-
const status = (_error$response$statu = (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) !== null && _error$response$statu !== void 0 ? _error$response$statu : -1;
|
|
297
|
-
const data = (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data;
|
|
298
310
|
const logSeverity = status > -1 && status < 499 ? 'warn' : 'error';
|
|
299
311
|
|
|
300
312
|
_logging.logger.log[logSeverity](`Error when making ${error === null || error === void 0 ? void 0 : (_error$config = error.config) === null || _error$config === void 0 ? void 0 : (_error$config$method = _error$config.method) === null || _error$config$method === void 0 ? void 0 : _error$config$method.toUpperCase()} request to ${error === null || error === void 0 ? void 0 : (_error$config2 = error.config) === null || _error$config2 === void 0 ? void 0 : _error$config2.baseURL} from the JS SDK`, {
|
|
@@ -310,19 +322,25 @@ const errorInterceptor = error => {
|
|
|
310
322
|
code: error === null || error === void 0 ? void 0 : error.code,
|
|
311
323
|
name: error === null || error === void 0 ? void 0 : error.name,
|
|
312
324
|
stack: error === null || error === void 0 ? void 0 : error.stack,
|
|
313
|
-
headers: error === null || error === void 0 ? void 0 : (_error$
|
|
325
|
+
headers: error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : _error$response5.headers,
|
|
314
326
|
message: error === null || error === void 0 ? void 0 : error.message,
|
|
315
|
-
status: error === null || error === void 0 ? void 0 : (_error$
|
|
316
|
-
statusText: error === null || error === void 0 ? void 0 : (_error$
|
|
317
|
-
data: error === null || error === void 0 ? void 0 : (_error$
|
|
327
|
+
status: error === null || error === void 0 ? void 0 : (_error$response6 = error.response) === null || _error$response6 === void 0 ? void 0 : _error$response6.status,
|
|
328
|
+
statusText: error === null || error === void 0 ? void 0 : (_error$response7 = error.response) === null || _error$response7 === void 0 ? void 0 : _error$response7.statusText,
|
|
329
|
+
data: error === null || error === void 0 ? void 0 : (_error$response8 = error.response) === null || _error$response8 === void 0 ? void 0 : _error$response8.data
|
|
318
330
|
}
|
|
319
331
|
});
|
|
320
332
|
|
|
321
|
-
throw new _BasisTheoryApiError.BasisTheoryApiError(error.message, status, data);
|
|
333
|
+
throw new _BasisTheoryApiError.BasisTheoryApiError(error.message, status, data, _debug);
|
|
322
334
|
};
|
|
323
335
|
|
|
336
|
+
const errorInterceptor = error => handleAxiosError(error, false);
|
|
337
|
+
|
|
324
338
|
exports.errorInterceptor = errorInterceptor;
|
|
325
339
|
|
|
340
|
+
const errorInterceptorDebug = error => handleAxiosError(error, true);
|
|
341
|
+
|
|
342
|
+
exports.errorInterceptorDebug = errorInterceptorDebug;
|
|
343
|
+
|
|
326
344
|
const getQueryParams = (query = {}) => {
|
|
327
345
|
const keys = Object.keys(query);
|
|
328
346
|
|
|
@@ -466,4 +484,19 @@ const buildClientUserAgentString = appInfo => {
|
|
|
466
484
|
return JSON.stringify((0, _snakecaseKeys.default)(clientUserAgent));
|
|
467
485
|
};
|
|
468
486
|
|
|
469
|
-
exports.buildClientUserAgentString = buildClientUserAgentString;
|
|
487
|
+
exports.buildClientUserAgentString = buildClientUserAgentString;
|
|
488
|
+
|
|
489
|
+
const debugTransform = (data, headers) => {
|
|
490
|
+
if (headers && typeof data === 'object' && data !== undefined) {
|
|
491
|
+
// we are deliberately mutating the data object here to include the debug headers
|
|
492
|
+
// eslint-disable-next-line no-param-reassign
|
|
493
|
+
data._debug = { ...data._debug,
|
|
494
|
+
cfRay: headers[_constants.CF_RAY_HEADER],
|
|
495
|
+
btTraceId: headers[_constants.BT_TRACE_ID_HEADER]
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
return data;
|
|
500
|
+
};
|
|
501
|
+
|
|
502
|
+
exports.debugTransform = debugTransform;
|
package/package.json
CHANGED
|
@@ -18,7 +18,8 @@ class BasisTheoryService {
|
|
|
18
18
|
baseURL,
|
|
19
19
|
transformRequest,
|
|
20
20
|
transformResponse,
|
|
21
|
-
appInfo
|
|
21
|
+
appInfo,
|
|
22
|
+
debug
|
|
22
23
|
} = options;
|
|
23
24
|
|
|
24
25
|
if (typeof _axios.default === 'string') {
|
|
@@ -38,11 +39,11 @@ class BasisTheoryService {
|
|
|
38
39
|
|
|
39
40
|
/* eslint-disable unicorn/prefer-spread */
|
|
40
41
|
transformRequest: [].concat(transformRequest || _common.transformRequestSnakeCase, _axios.default.defaults.transformRequest),
|
|
41
|
-
transformResponse: _axios.default.defaults.transformResponse.concat(transformResponse || _common.transformResponseCamelCase)
|
|
42
|
+
transformResponse: _axios.default.defaults.transformResponse.concat(transformResponse || _common.transformResponseCamelCase, debug ? _common.debugTransform : [])
|
|
42
43
|
/* eslint-enable unicorn/prefer-spread */
|
|
43
44
|
|
|
44
45
|
});
|
|
45
|
-
this.client.interceptors.response.use(undefined, _common.errorInterceptor);
|
|
46
|
+
this.client.interceptors.response.use(undefined, debug ? _common.errorInterceptorDebug : _common.errorInterceptor);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
package/service/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ApplicationInfo } from '../types/sdk';
|
|
|
3
3
|
interface BasisTheoryServiceOptions extends Pick<AxiosRequestConfig, 'transformRequest' | 'transformResponse'> {
|
|
4
4
|
apiKey: string;
|
|
5
5
|
baseURL: string;
|
|
6
|
+
debug?: boolean;
|
|
6
7
|
appInfo?: ApplicationInfo;
|
|
7
8
|
}
|
|
8
9
|
type RequestTransformers = Pick<AxiosRequestConfig, 'transformRequest' | 'transformResponse'>;
|
|
@@ -22,6 +22,7 @@ type TokenIntent<DataType = DataObject> = (TokenBase<DataType> & Omit<Auditable,
|
|
|
22
22
|
tenantId: string;
|
|
23
23
|
expiresAt: string;
|
|
24
24
|
fingerprint?: string;
|
|
25
|
+
_debug?: Record<string, unknown>;
|
|
25
26
|
}) & (TokenTypeMap[TokenTypesForTokenIntents] | TokenIntentCardDetails | {
|
|
26
27
|
type: 'token';
|
|
27
28
|
});
|
|
@@ -3,5 +3,7 @@ type TokenizeObject<DataType = Primitive> = {
|
|
|
3
3
|
[key: string]: Primitive | TokenizeObject<DataType> | TokenizeArray<DataType> | DataType;
|
|
4
4
|
};
|
|
5
5
|
type TokenizeArray<DataType = Primitive> = Array<Primitive | TokenizeObject<DataType> | TokenizeArray<DataType> | DataType>;
|
|
6
|
-
type TokenizeData<DataType = Primitive> = TokenizeArray<DataType> | TokenizeObject<DataType
|
|
6
|
+
type TokenizeData<DataType = Primitive> = TokenizeArray<DataType> | (TokenizeObject<DataType> & {
|
|
7
|
+
_debug?: Record<string, unknown>;
|
|
8
|
+
});
|
|
7
9
|
export type { TokenizeObject, TokenizeArray, TokenizeData };
|
package/types/models/tokens.d.ts
CHANGED
|
@@ -42,14 +42,17 @@ type Token<DataType = Primitive> = TokenBase<DataType> & {
|
|
|
42
42
|
tenantId: string;
|
|
43
43
|
fingerprint?: string;
|
|
44
44
|
metadata?: Record<string, string>;
|
|
45
|
+
_debug?: Record<string, unknown>;
|
|
45
46
|
};
|
|
46
47
|
type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
|
|
47
48
|
deduplicateToken?: boolean;
|
|
48
49
|
id?: string;
|
|
50
|
+
_debug?: Record<string, unknown>;
|
|
49
51
|
};
|
|
50
52
|
type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
|
|
51
53
|
privacy: Omit<TokenPrivacy, 'classification'>;
|
|
52
54
|
deduplicateToken: boolean;
|
|
55
|
+
_debug?: Record<string, unknown>;
|
|
53
56
|
}>;
|
|
54
57
|
export type { Token, TokenEnrichments, CreateToken, UpdateToken, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
|
|
55
58
|
export { DATA_CLASSIFICATIONS, DATA_IMPACT_LEVELS, DATA_RESTRICTION_POLICIES };
|
package/types/sdk/sdk.d.ts
CHANGED