@basis-theory/react-elements 1.18.0 → 1.20.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/types/index.d.ts +13 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@basis-theory/react-elements",
3
- "version": "1.18.0",
3
+ "version": "1.20.0",
4
4
  "repository": "https://github.com/basis-theory/react-elements",
5
5
  "license": "Apache-2.0",
6
6
  "author": {
@@ -30,7 +30,7 @@
30
30
  "tag": "latest"
31
31
  },
32
32
  "dependencies": {
33
- "@basis-theory/web-elements": "1.18.0"
33
+ "@basis-theory/web-elements": "1.20.0"
34
34
  },
35
35
  "peerDependencies": {
36
36
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
package/types/index.d.ts CHANGED
@@ -155,8 +155,11 @@ export interface ElementInternalOptions {
155
155
  apiKey: string | undefined;
156
156
  baseUrl: string;
157
157
  type: ElementType;
158
+ debug: boolean | undefined;
159
+ disableTelemetry: boolean | undefined;
158
160
  useNgApi: boolean | undefined;
159
161
  useSameOriginApi: boolean | undefined;
162
+ useUat: boolean | undefined;
160
163
  }
161
164
  export enum InputMode {
162
165
  DECIMAL = "decimal",
@@ -201,7 +204,11 @@ interface TransformOption {
201
204
  interface AutoCompleteOption {
202
205
  autoComplete?: AutoCompleteValue;
203
206
  }
207
+ interface CardAutoCompleteOption {
208
+ autoComplete?: CardElementAutoComplete;
209
+ }
204
210
  export type CustomizableElementOptions = Pick<ElementOptions, 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & AutoCompleteOption;
211
+ export type CardCustomizableElementOptions = Pick<ElementOptions, 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & CardAutoCompleteOption;
205
212
  type ElementValueType = 'static' | 'reference';
206
213
  export interface CardElementValue<T extends ElementValueType> {
207
214
  cvc?: T extends 'reference' ? DataElementReference : string;
@@ -223,8 +230,7 @@ export interface CardElementAutoComplete {
223
230
  expirationDate: AutoCompleteValue;
224
231
  csc: AutoCompleteValue;
225
232
  }
226
- export type CreateCardElementOptions = Omit<CustomizableElementOptions, 'autoComplete'> & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation' | 'title'> & {
227
- autoComplete?: CardElementAutoComplete;
233
+ export type CreateCardElementOptions = CardCustomizableElementOptions & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation' | 'title'> & {
228
234
  placeholder?: CardElementPlaceholder;
229
235
  value?: CardElementValue<'static'>;
230
236
  };
@@ -371,10 +377,12 @@ export type EncryptTokenModel<DataType = Primitive> = {
371
377
  public_key: string;
372
378
  key_id: string;
373
379
  };
374
- export type EncryptedToken = {
380
+ type EncryptedSingleToken = {
375
381
  encrypted: string;
376
382
  type: TokenBase['type'];
377
383
  };
384
+ type EncryptedMultipleTokens = Record<string, EncryptedSingleToken>;
385
+ export type EncryptedToken = EncryptedSingleToken | EncryptedMultipleTokens;
378
386
  export type TokenizeObject<DataType = Primitive> = {
379
387
  [key: string]: Primitive | TokenizeObject<DataType> | TokenizeArray<DataType> | DataType;
380
388
  };
@@ -558,7 +566,7 @@ export interface BasisTheoryElements {
558
566
  createElement(type: 'cardVerificationCode', options: CreateCardVerificationCodeElementOptions): ICardVerificationCodeElement;
559
567
  }
560
568
  export interface BasisTheoryElementsInternal extends BasisTheoryElements {
561
- init: (apiKey: string | undefined, elementsBaseUrl: string, elementsUseNgApi: boolean | undefined, elementsUseSameOriginApi: boolean | undefined, disableTelemetry: boolean | undefined, debug: boolean | undefined) => Promise<BasisTheoryElements>;
569
+ init: (apiKey: string | undefined, elementsBaseUrl: string, elementsUseNgApi: boolean | undefined, elementsUseSameOriginApi: boolean | undefined, disableTelemetry: boolean | undefined, debug: boolean | undefined, useUat: boolean | undefined) => Promise<BasisTheoryElements>;
562
570
  hasElement: (payload: unknown) => boolean;
563
571
  }
564
572
  declare global {
@@ -570,6 +578,7 @@ export interface BasisTheoryInitOptions {
570
578
  _devMode?: boolean;
571
579
  disableTelemetry?: boolean;
572
580
  useSameOriginApi?: boolean;
581
+ useUat?: boolean;
573
582
  debug?: boolean;
574
583
  }
575
584
  export const basistheory: (apiKey: string, options?: BasisTheoryInitOptions) => Promise<BasisTheoryElements | undefined>;