@basis-theory/basis-theory-js 1.50.0 → 1.52.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.
@@ -10,5 +10,5 @@ export declare const BasisTheoryApplications: {
10
10
  regenerateKey(id: string, options?: RequestOptions | undefined): Promise<Application>;
11
11
  readonly client: import("axios").AxiosInstance;
12
12
  };
13
- } & (new (...args: any[]) => import("../types/sdk/services/shared").Create<Application, CreateApplication>) & (new (...args: any[]) => import("../types/sdk/services/shared").Retrieve<Application>) & (new (...args: any[]) => import("../types/sdk/services/shared").Update<Application, Partial<Pick<Application, "name" | "permissions">>>) & (new (...args: any[]) => import("../types/sdk/services/shared").Delete) & (new (...args: any[]) => import("../types/sdk/services/shared").List<Application, ListApplicationsQuery>);
13
+ } & (new (...args: any[]) => import("../types/sdk/services/shared").Create<Application, CreateApplication>) & (new (...args: any[]) => import("../types/sdk/services/shared").Retrieve<Application>) & (new (...args: any[]) => import("../types/sdk/services/shared").Update<Application, Partial<Pick<Application, "name" | "permissions" | "rules">>>) & (new (...args: any[]) => import("../types/sdk/services/shared").Delete) & (new (...args: any[]) => import("../types/sdk/services/shared").List<Application, ListApplicationsQuery>);
14
14
  export declare type BasisTheoryApplications = InstanceType<typeof BasisTheoryApplications>;
@@ -24,6 +24,14 @@ const delegateTokens = elements => class BasisTheoryTokensElementsDelegate exten
24
24
  return super.update(id, payload, requestOptions);
25
25
  }
26
26
 
27
+ retrieve(id, requestOptions) {
28
+ if (elements !== undefined) {
29
+ return elements.tokens.retrieve(id, requestOptions);
30
+ }
31
+
32
+ return super.retrieve(id, requestOptions);
33
+ }
34
+
27
35
  };
28
36
 
29
37
  exports.delegateTokens = delegateTokens;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/basis-theory-js",
3
- "version": "1.50.0",
3
+ "version": "1.52.0",
4
4
  "repository": "https://github.com/Basis-Theory/basis-theory-js",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -1,6 +1,6 @@
1
- import { AutoCompleteValue } from './shared';
1
+ import { AutoCompleteValue, DataElementReference } from './shared';
2
2
  import type { ElementStyle } from './styles';
3
- declare const ELEMENTS_TYPES: readonly ["card", "text", "cardNumber", "cardExpirationDate", "cardVerificationCode"];
3
+ declare const ELEMENTS_TYPES: readonly ["card", "text", "cardNumber", "cardExpirationDate", "cardVerificationCode", "data"];
4
4
  declare type ElementType = typeof ELEMENTS_TYPES[number];
5
5
  interface ElementInternalOptions {
6
6
  apiKey: string;
@@ -32,14 +32,14 @@ interface AutoCompleteOption {
32
32
  }
33
33
  declare type CustomizableElementOptions = Pick<ElementOptions, 'style' | 'disabled'> & AutoCompleteOption;
34
34
  interface CardElementValue {
35
- number?: string;
36
- expiration_month?: number;
37
- expiration_year?: number;
38
- cvc?: string;
35
+ number?: DataElementReference;
36
+ expiration_month?: DataElementReference;
37
+ expiration_year?: DataElementReference;
38
+ cvc?: DataElementReference;
39
39
  }
40
40
  interface CardExpirationDateValue {
41
- month: number;
42
- year: number;
41
+ month: DataElementReference;
42
+ year: DataElementReference;
43
43
  }
44
44
  declare type CreateCardElementOptions = CustomizableElementOptions & {
45
45
  value?: CardElementValue;
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ELEMENTS_TYPES = void 0;
7
- const ELEMENTS_TYPES = ['card', 'text', 'cardNumber', 'cardExpirationDate', 'cardVerificationCode'];
7
+ const ELEMENTS_TYPES = ['card', 'text', 'cardNumber', 'cardExpirationDate', 'cardVerificationCode', 'data'];
8
8
  exports.ELEMENTS_TYPES = ELEMENTS_TYPES;
@@ -1,7 +1,7 @@
1
1
  import type { ElementValue } from '../../../types/elements';
2
2
  import type { CreateToken as CreateTokenModel, UpdateToken as UpdateTokenModel, Token } from '../../../types/models';
3
- import type { Create, Update } from '../../../types/sdk';
3
+ import type { Create, Retrieve, Update } from '../../../types/sdk';
4
4
  declare type CreateToken = CreateTokenModel<ElementValue>;
5
5
  declare type UpdateToken = UpdateTokenModel<ElementValue>;
6
- declare type Tokens = Create<Token, CreateToken> & Update<Token, UpdateToken>;
6
+ declare type Tokens = Create<Token, CreateToken> & Retrieve<Token> & Update<Token, UpdateToken>;
7
7
  export type { Tokens, CreateToken, UpdateToken };
@@ -28,4 +28,12 @@ declare type CardIconPosition = typeof CARD_ICON_POSITIONS[number];
28
28
  * Values for the element input autocomplete attribute
29
29
  */
30
30
  declare type AutoCompleteValue = typeof AUTOCOMPLETE_VALUES[number];
31
- export type { FieldErrorType, ConfigErrorType, ConfigError, Targeted, ListenableKey, FieldError, PropertyError, Brand, CardIconPosition, AutoCompleteValue, };
31
+ /**
32
+ * Type used for detokenization responses stored on Data Elements
33
+ */
34
+ declare type DataElementReference = {
35
+ correlationId: string;
36
+ elementId: string;
37
+ path: string;
38
+ };
39
+ export type { FieldErrorType, ConfigErrorType, ConfigError, Targeted, ListenableKey, FieldError, PropertyError, Brand, CardIconPosition, AutoCompleteValue, DataElementReference, };
@@ -1,15 +1,25 @@
1
1
  import type { Auditable } from './shared';
2
2
  declare const APPLICATION_TYPES: readonly ["private", "public", "management"];
3
+ declare const TRANSFORM_TYPES: readonly ["mask", "redact", "reveal"];
3
4
  declare type ApplicationType = typeof APPLICATION_TYPES[number];
5
+ declare type TransformType = typeof TRANSFORM_TYPES[number];
4
6
  interface Application extends Auditable {
5
7
  id: string;
6
8
  tenantId: string;
7
9
  name: string;
8
10
  key?: string;
9
11
  type: ApplicationType;
12
+ permissions?: string[];
13
+ rules?: AccessRule[];
14
+ }
15
+ interface AccessRule {
16
+ description: string;
17
+ priority: number;
18
+ container: string;
19
+ transform: TransformType;
10
20
  permissions: string[];
11
21
  }
12
- declare type CreateApplication = Pick<Application, 'name' | 'type'> & Partial<Pick<Application, 'permissions'>>;
13
- declare type UpdateApplication = Partial<Pick<Application, 'name' | 'permissions'>>;
14
- export type { ApplicationType, Application, CreateApplication, UpdateApplication, };
15
- export { APPLICATION_TYPES };
22
+ declare type CreateApplication = Pick<Application, 'name' | 'type'> & Partial<Pick<Application, 'permissions' | 'rules'>>;
23
+ declare type UpdateApplication = Partial<Pick<Application, 'name' | 'permissions' | 'rules'>>;
24
+ export type { ApplicationType, Application, CreateApplication, TransformType, UpdateApplication, };
25
+ export { APPLICATION_TYPES, TRANSFORM_TYPES };
@@ -3,6 +3,8 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.APPLICATION_TYPES = void 0;
6
+ exports.TRANSFORM_TYPES = exports.APPLICATION_TYPES = void 0;
7
7
  const APPLICATION_TYPES = ['private', 'public', 'management'];
8
- exports.APPLICATION_TYPES = APPLICATION_TYPES;
8
+ exports.APPLICATION_TYPES = APPLICATION_TYPES;
9
+ const TRANSFORM_TYPES = ['mask', 'redact', 'reveal'];
10
+ exports.TRANSFORM_TYPES = TRANSFORM_TYPES;
@@ -31,18 +31,18 @@ interface TokenPrivacy {
31
31
  interface Token<DataType = Primitive> extends TokenBase {
32
32
  data: TokenData<DataType>;
33
33
  privacy?: TokenPrivacy;
34
- container?: string;
34
+ containers?: string[];
35
35
  encryption?: TokenEncryption;
36
36
  searchIndexes?: string[];
37
37
  fingerprintExpression?: string;
38
38
  mask?: TokenMask;
39
39
  expiresAt?: string;
40
40
  }
41
- declare type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'container' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
41
+ declare type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
42
42
  deduplicateToken?: boolean;
43
43
  id?: string;
44
44
  };
45
- declare type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' | 'container' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask'> & {
45
+ declare type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask'> & {
46
46
  privacy: Omit<TokenPrivacy, 'classification'>;
47
47
  deduplicateToken: boolean;
48
48
  }>;