@basis-theory/web-elements 1.11.3 → 1.11.5
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/CHANGELOG.md +21 -0
- package/dist/bundle/index.js +1 -1
- package/dist/main/index.js +4 -4
- package/dist/module/module.js +4 -4
- package/dist/package.json +3 -4
- package/dist/types/index.d.ts +541 -3
- package/package.json +7 -9
- package/dist/types/BasisTheory.d.ts +0 -9
- package/dist/types/common/BasisTheoryApiError.d.ts +0 -5
- package/dist/types/common/BasisTheoryValidationError.d.ts +0 -13
- package/dist/types/common/HttpClientError.d.ts +0 -6
- package/dist/types/common/index.d.ts +0 -3
- package/dist/types/common/logging.d.ts +0 -8
- package/dist/types/elements/constants.d.ts +0 -9
- package/dist/types/elements/getOrCreateScriptElement.d.ts +0 -1
- package/dist/types/elements/index.d.ts +0 -2
- package/dist/types/elements/loadElements.d.ts +0 -3
- package/dist/types/types/elements/cardTypes.d.ts +0 -29
- package/dist/types/types/elements/elements.d.ts +0 -74
- package/dist/types/types/elements/events.d.ts +0 -40
- package/dist/types/types/elements/index.d.ts +0 -7
- package/dist/types/types/elements/options.d.ts +0 -98
- package/dist/types/types/elements/services/index.d.ts +0 -4
- package/dist/types/types/elements/services/proxy.d.ts +0 -27
- package/dist/types/types/elements/services/sessions.d.ts +0 -11
- package/dist/types/types/elements/services/shared.d.ts +0 -21
- package/dist/types/types/elements/services/token-intents.d.ts +0 -6
- package/dist/types/types/elements/services/tokenize.d.ts +0 -8
- package/dist/types/types/elements/services/tokens.d.ts +0 -7
- package/dist/types/types/elements/shared.d.ts +0 -51
- package/dist/types/types/elements/styles.d.ts +0 -25
- package/dist/types/types/index.d.ts +0 -4
- package/dist/types/types/models/bin-details.d.ts +0 -38
- package/dist/types/types/models/cards.d.ts +0 -12
- package/dist/types/types/models/index.d.ts +0 -7
- package/dist/types/types/models/shared.d.ts +0 -22
- package/dist/types/types/models/token-intents.d.ts +0 -29
- package/dist/types/types/models/tokenize.d.ts +0 -7
- package/dist/types/types/models/tokens.d.ts +0 -53
- package/dist/types/types/models/util.d.ts +0 -11
- package/dist/types/types/sdk/index.d.ts +0 -1
- package/dist/types/types/sdk/services/http.d.ts +0 -11
- package/dist/types/types/sdk/services/index.d.ts +0 -1
- package/dist/types/version.d.ts +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
type CardBrandId = 'american-express' | 'diners-club' | 'discover' | 'elo' | 'hiper' | 'hipercard' | 'jcb' | 'maestro' | 'mastercard' | 'mir' | 'unionpay' | 'visa';
|
|
2
|
-
type CardBrandNiceType = 'American Express' | 'Diners Club' | 'Discover' | 'Elo' | 'Hiper' | 'Hipercard' | 'JCB' | 'Maestro' | 'Mastercard' | 'Mir' | 'UnionPay' | 'Visa';
|
|
3
|
-
type SecurityCodeLabel = 'CVV' | 'CVC' | 'CID' | 'CVN' | 'CVE' | 'CVP2';
|
|
4
|
-
type CreditCardType = {
|
|
5
|
-
code: {
|
|
6
|
-
size: number;
|
|
7
|
-
name: SecurityCodeLabel | string;
|
|
8
|
-
};
|
|
9
|
-
gaps: number[];
|
|
10
|
-
lengths: number[];
|
|
11
|
-
niceType: CardBrandNiceType | string;
|
|
12
|
-
patterns: (number | [number, number])[];
|
|
13
|
-
type: CardBrandId | string;
|
|
14
|
-
};
|
|
15
|
-
declare const VISA: CreditCardType;
|
|
16
|
-
declare const MASTERCARD: CreditCardType;
|
|
17
|
-
declare const AMERICAN_EXPRESS: CreditCardType;
|
|
18
|
-
declare const DINERS_CLUB: CreditCardType;
|
|
19
|
-
declare const DISCOVER: CreditCardType;
|
|
20
|
-
declare const JCB: CreditCardType;
|
|
21
|
-
declare const UNION_PAY: CreditCardType;
|
|
22
|
-
declare const MAESTRO: CreditCardType;
|
|
23
|
-
declare const ELO: CreditCardType;
|
|
24
|
-
declare const MIR: CreditCardType;
|
|
25
|
-
declare const HIPER: CreditCardType;
|
|
26
|
-
declare const HIPERCARD: CreditCardType;
|
|
27
|
-
declare const DEFAULT_CARD_TYPES: CreditCardType[];
|
|
28
|
-
export { AMERICAN_EXPRESS, DEFAULT_CARD_TYPES, DINERS_CLUB, DISCOVER, ELO, HIPER, HIPERCARD, JCB, MAESTRO, MASTERCARD, MIR, UNION_PAY, VISA, };
|
|
29
|
-
export type { CreditCardType };
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import type { HttpClient } from '../../types/sdk';
|
|
2
|
-
import type { CardElementEvents, CardExpirationDateElementEvents, CardNumberElementEvents, CardVerificationCodeElementEvents, ElementEventListener, EventType, Subscription, TextElementEvents } from './events';
|
|
3
|
-
import type { CardElementValue, CardExpirationDateValue, CreateCardElementOptions, CreateCardExpirationDateElementOptions, CreateCardNumberElementOptions, CreateCardVerificationCodeElementOptions, CreateTextElementOptions, UpdateCardElementOptions, UpdateCardExpirationDateElementOptions, UpdateCardNumberElementOptions, UpdateCardVerificationCodeElementOptions, UpdateTextElementOptions } from './options';
|
|
4
|
-
import type { Proxy, Tokenize, Tokens, TokenIntents } from './services';
|
|
5
|
-
import type { CardMetadata, DataElementReference, ElementMetadata } from './shared';
|
|
6
|
-
import { Sessions } from './services/sessions';
|
|
7
|
-
interface BaseElement<UpdateOptions, ElementEvents> {
|
|
8
|
-
readonly mounted: boolean;
|
|
9
|
-
readonly metadata: ElementMetadata;
|
|
10
|
-
mount(selector: string): Promise<void>;
|
|
11
|
-
mount(element: Element): Promise<void>;
|
|
12
|
-
update(options: UpdateOptions): Promise<void>;
|
|
13
|
-
clear(): void;
|
|
14
|
-
focus(): void;
|
|
15
|
-
blur(): void;
|
|
16
|
-
unmount(): void;
|
|
17
|
-
on<T extends EventType>(eventType: T, listener: ElementEventListener<ElementEvents, T>): Subscription;
|
|
18
|
-
}
|
|
19
|
-
type CardElement = BaseElement<UpdateCardElementOptions, CardElementEvents> & {
|
|
20
|
-
readonly cardMetadata?: CardMetadata;
|
|
21
|
-
setValue(value: CardElementValue<'reference'>): void;
|
|
22
|
-
validate(): void;
|
|
23
|
-
};
|
|
24
|
-
type TextElement = BaseElement<UpdateTextElementOptions, TextElementEvents> & {
|
|
25
|
-
setValueRef(value: TextElement): void;
|
|
26
|
-
setValue(value: DataElementReference): void;
|
|
27
|
-
};
|
|
28
|
-
type CardNumberElement = BaseElement<UpdateCardNumberElementOptions, CardNumberElementEvents> & {
|
|
29
|
-
readonly cardMetadata?: CardMetadata;
|
|
30
|
-
setValueRef(value: CardNumberElement): void;
|
|
31
|
-
setValue(value: DataElementReference): void;
|
|
32
|
-
};
|
|
33
|
-
type CardExpirationDateElement = BaseElement<UpdateCardExpirationDateElementOptions, CardExpirationDateElementEvents> & {
|
|
34
|
-
setValueRef(value: CardExpirationDateElement): void;
|
|
35
|
-
setValue(value: CardExpirationDateValue<'reference'>): void;
|
|
36
|
-
month(): ElementWrapper<CardExpirationDateElement>;
|
|
37
|
-
year(): ElementWrapper<CardExpirationDateElement>;
|
|
38
|
-
format(dateFormat: string): ElementWrapper<CardExpirationDateElement>;
|
|
39
|
-
};
|
|
40
|
-
type CardVerificationCodeElement = BaseElement<UpdateCardVerificationCodeElementOptions, CardVerificationCodeElementEvents> & {
|
|
41
|
-
setValueRef(value: CardVerificationCodeElement): void;
|
|
42
|
-
setValue(value: DataElementReference): void;
|
|
43
|
-
};
|
|
44
|
-
type ElementWrapper<T extends BaseElement<any, any> = BaseElement<any, any>> = {
|
|
45
|
-
element: T;
|
|
46
|
-
method?: string;
|
|
47
|
-
formattingOptions?: {
|
|
48
|
-
format: string;
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
type ElementValue = TextElement | CardElement | CardNumberElement | CardExpirationDateElement | CardVerificationCodeElement | ElementWrapper;
|
|
52
|
-
interface BasisTheoryElements {
|
|
53
|
-
tokens: Tokens;
|
|
54
|
-
proxy: Proxy;
|
|
55
|
-
sessions: Sessions;
|
|
56
|
-
tokenIntents: TokenIntents;
|
|
57
|
-
tokenize: Tokenize['tokenize'];
|
|
58
|
-
client: HttpClient;
|
|
59
|
-
createElement(type: 'card', options?: CreateCardElementOptions): CardElement;
|
|
60
|
-
createElement(type: 'text', options: CreateTextElementOptions): TextElement;
|
|
61
|
-
createElement(type: 'cardNumber', options: CreateCardNumberElementOptions): CardNumberElement;
|
|
62
|
-
createElement(type: 'cardExpirationDate', options: CreateCardExpirationDateElementOptions): CardExpirationDateElement;
|
|
63
|
-
createElement(type: 'cardVerificationCode', options: CreateCardVerificationCodeElementOptions): CardVerificationCodeElement;
|
|
64
|
-
}
|
|
65
|
-
interface BasisTheoryElementsInternal extends BasisTheoryElements {
|
|
66
|
-
init: (apiKey: string | undefined, elementsBaseUrl: string, elementsUseNgApi: boolean | undefined, elementsUseSameOriginApi: boolean | undefined, disableTelemetry: boolean | undefined, debug: boolean | undefined) => Promise<BasisTheoryElements>;
|
|
67
|
-
hasElement: (payload: unknown) => boolean;
|
|
68
|
-
}
|
|
69
|
-
declare global {
|
|
70
|
-
interface Window {
|
|
71
|
-
BasisTheoryElements?: BasisTheoryElementsInternal;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
export type { BaseElement, CardElement, TextElement, CardNumberElement, CardExpirationDateElement, CardVerificationCodeElement, ElementWrapper, ElementValue, BasisTheoryElements, BasisTheoryElementsInternal, };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import type { Brand, FieldError, ListenableKey, Targeted } from './shared';
|
|
2
|
-
type EventType = 'ready' | 'change' | 'focus' | 'blur' | 'keydown';
|
|
3
|
-
interface BaseEvent<T extends EventType> {
|
|
4
|
-
type: T;
|
|
5
|
-
}
|
|
6
|
-
type ReadyEvent = BaseEvent<'ready'>;
|
|
7
|
-
type ChangeEvent = BaseEvent<'change'> & {
|
|
8
|
-
empty: boolean;
|
|
9
|
-
complete: boolean;
|
|
10
|
-
valid?: boolean;
|
|
11
|
-
maskSatisfied?: boolean;
|
|
12
|
-
errors?: FieldError[];
|
|
13
|
-
};
|
|
14
|
-
type CardChangeEvent = ChangeEvent & {
|
|
15
|
-
cardBrand: Brand;
|
|
16
|
-
cardLast4?: string;
|
|
17
|
-
cardBin?: string;
|
|
18
|
-
};
|
|
19
|
-
type InputFocusEvent = BaseEvent<'focus'> & Targeted;
|
|
20
|
-
type InputBlurEvent = BaseEvent<'blur'> & Targeted;
|
|
21
|
-
type InputKeydownEvent = BaseEvent<'keydown'> & Targeted & {
|
|
22
|
-
key: ListenableKey;
|
|
23
|
-
} & Pick<KeyboardEvent, 'altKey' | 'ctrlKey' | 'shiftKey' | 'metaKey'>;
|
|
24
|
-
type BaseElementEvents = ReadyEvent | InputFocusEvent | InputBlurEvent | InputKeydownEvent;
|
|
25
|
-
type TextElementEvents = BaseElementEvents | ChangeEvent;
|
|
26
|
-
type CardElementEvents = BaseElementEvents | CardChangeEvent;
|
|
27
|
-
type CardNumberElementEvents = BaseElementEvents | CardChangeEvent;
|
|
28
|
-
type CardExpirationDateElementEvents = BaseElementEvents | ChangeEvent;
|
|
29
|
-
type CardVerificationCodeElementEvents = BaseElementEvents | ChangeEvent;
|
|
30
|
-
/**
|
|
31
|
-
* Utility type that helps find a Union type based on a `type` property
|
|
32
|
-
*/
|
|
33
|
-
type FindByType<Union, Type> = Union extends {
|
|
34
|
-
type: Type;
|
|
35
|
-
} ? Union : never;
|
|
36
|
-
type ElementEventListener<Events, Type> = (event: FindByType<Events, Type>) => void;
|
|
37
|
-
interface Subscription {
|
|
38
|
-
unsubscribe(): void;
|
|
39
|
-
}
|
|
40
|
-
export type { EventType, BaseEvent, ReadyEvent, ChangeEvent, CardChangeEvent, InputFocusEvent, InputBlurEvent, InputKeydownEvent, BaseElementEvents, TextElementEvents, CardElementEvents, CardNumberElementEvents, CardExpirationDateElementEvents, CardVerificationCodeElementEvents, ElementEventListener, Subscription, };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { CreditCardType } from './cardTypes';
|
|
2
|
-
import { AutoCompleteValue, DataElementReference } from './shared';
|
|
3
|
-
import type { CopyIconStyles, ElementStyle } from './styles';
|
|
4
|
-
declare const ELEMENTS_TYPES: readonly ["card", "cardExpirationDate", "cardNumber", "cardVerificationCode", "data", "text"];
|
|
5
|
-
type ElementType = typeof ELEMENTS_TYPES[number];
|
|
6
|
-
interface ElementInternalOptions {
|
|
7
|
-
apiKey: string | undefined;
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
type: ElementType;
|
|
10
|
-
useNgApi: boolean | undefined;
|
|
11
|
-
useSameOriginApi: boolean | undefined;
|
|
12
|
-
}
|
|
13
|
-
declare enum InputMode {
|
|
14
|
-
DECIMAL = "decimal",
|
|
15
|
-
EMAIL = "email",
|
|
16
|
-
NONE = "none",
|
|
17
|
-
NUMERIC = "numeric",
|
|
18
|
-
SEARCH = "search",
|
|
19
|
-
TEL = "tel",
|
|
20
|
-
TEXT = "text",
|
|
21
|
-
URL = "url"
|
|
22
|
-
}
|
|
23
|
-
interface SanitizedElementOptions {
|
|
24
|
-
ariaDescription?: string;
|
|
25
|
-
ariaLabel?: string;
|
|
26
|
-
autoComplete?: AutoCompleteValue;
|
|
27
|
-
cardBrand?: string;
|
|
28
|
-
cardTypes?: CreditCardType[];
|
|
29
|
-
copyIconStyles?: CopyIconStyles;
|
|
30
|
-
disabled?: boolean;
|
|
31
|
-
enableCopy?: boolean;
|
|
32
|
-
iconPosition?: string;
|
|
33
|
-
inputMode?: `${InputMode}`;
|
|
34
|
-
mask?: (RegExp | string)[];
|
|
35
|
-
maxLength?: HTMLInputElement['maxLength'];
|
|
36
|
-
password?: boolean;
|
|
37
|
-
placeholder?: string;
|
|
38
|
-
readOnly?: boolean;
|
|
39
|
-
skipLuhnValidation?: boolean;
|
|
40
|
-
style?: ElementStyle;
|
|
41
|
-
targetId?: string;
|
|
42
|
-
transform?: [RegExp, string] | null;
|
|
43
|
-
validateOnChange?: boolean;
|
|
44
|
-
validation?: RegExp;
|
|
45
|
-
value?: CardElementValue<'static'> | CardExpirationDateValue<'static'> | string;
|
|
46
|
-
}
|
|
47
|
-
type ElementOptions = ElementInternalOptions & SanitizedElementOptions;
|
|
48
|
-
type Transform = RegExp | [RegExp, string?] | null;
|
|
49
|
-
interface TransformOption {
|
|
50
|
-
transform?: Transform;
|
|
51
|
-
}
|
|
52
|
-
interface AutoCompleteOption {
|
|
53
|
-
autoComplete?: AutoCompleteValue;
|
|
54
|
-
}
|
|
55
|
-
type CustomizableElementOptions = Pick<ElementOptions, 'cardTypes' | 'copyIconStyles' | 'disabled' | 'enableCopy' | 'inputMode' | 'readOnly' | 'skipLuhnValidation' | 'style' | 'validateOnChange'> & AutoCompleteOption;
|
|
56
|
-
type ElementValueType = 'static' | 'reference';
|
|
57
|
-
interface CardElementValue<T extends ElementValueType> {
|
|
58
|
-
cvc?: T extends 'reference' ? DataElementReference : string;
|
|
59
|
-
expiration_month?: T extends 'reference' ? DataElementReference : number;
|
|
60
|
-
expiration_year?: T extends 'reference' ? DataElementReference : number;
|
|
61
|
-
number?: T extends 'reference' ? DataElementReference : string;
|
|
62
|
-
}
|
|
63
|
-
interface CardElementPlaceholder {
|
|
64
|
-
cardNumber?: string;
|
|
65
|
-
cardExpirationDate?: string;
|
|
66
|
-
cardSecurityCode?: string;
|
|
67
|
-
}
|
|
68
|
-
interface CardExpirationDateValue<T extends ElementValueType> {
|
|
69
|
-
month: T extends 'reference' ? DataElementReference : number;
|
|
70
|
-
year: T extends 'reference' ? DataElementReference : number;
|
|
71
|
-
}
|
|
72
|
-
type CreateCardElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'cardTypes' | 'skipLuhnValidation'> & {
|
|
73
|
-
placeholder?: CardElementPlaceholder;
|
|
74
|
-
value?: CardElementValue<'static'>;
|
|
75
|
-
};
|
|
76
|
-
type UpdateCardElementOptions = Omit<CreateCardElementOptions, 'validateOnChange' | 'enableCopy'>;
|
|
77
|
-
type CreateTextElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'mask' | 'maxLength' | 'password' | 'validation'> & TransformOption & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
78
|
-
'aria-label'?: string;
|
|
79
|
-
value?: string;
|
|
80
|
-
};
|
|
81
|
-
type UpdateTextElementOptions = Omit<CreateTextElementOptions, 'targetId' | 'mask' | 'validateOnChange'>;
|
|
82
|
-
type CreateCardNumberElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'iconPosition' | 'cardTypes' | 'skipLuhnValidation'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
83
|
-
'aria-label'?: string;
|
|
84
|
-
value?: string;
|
|
85
|
-
};
|
|
86
|
-
type UpdateCardNumberElementOptions = Omit<CreateCardNumberElementOptions, 'targetId' | 'validateOnChange' | 'enableCopy'>;
|
|
87
|
-
type CreateCardExpirationDateElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
88
|
-
'aria-label'?: string;
|
|
89
|
-
value?: CardExpirationDateValue<'static'> | string;
|
|
90
|
-
};
|
|
91
|
-
type UpdateCardExpirationDateElementOptions = Omit<CreateCardExpirationDateElementOptions, 'targetId' | 'validateOnChange' | 'enableCopy'>;
|
|
92
|
-
type CreateCardVerificationCodeElementOptions = CustomizableElementOptions & Pick<ElementOptions, 'placeholder' | 'cardBrand'> & Required<Pick<ElementOptions, 'targetId'>> & {
|
|
93
|
-
'aria-label'?: string;
|
|
94
|
-
value?: string;
|
|
95
|
-
};
|
|
96
|
-
type UpdateCardVerificationCodeElementOptions = Omit<CreateCardVerificationCodeElementOptions, 'targetId' | 'validateOnChange' | 'enableCopy'>;
|
|
97
|
-
export type { CardElementPlaceholder, CardElementValue, CardExpirationDateValue, CreateCardElementOptions, CreateCardExpirationDateElementOptions, CreateCardNumberElementOptions, CreateCardVerificationCodeElementOptions, CreateTextElementOptions, CustomizableElementOptions, ElementInternalOptions, ElementOptions, ElementType, InputMode, SanitizedElementOptions, Transform, UpdateCardElementOptions, UpdateCardExpirationDateElementOptions, UpdateCardNumberElementOptions, UpdateCardVerificationCodeElementOptions, UpdateTextElementOptions, };
|
|
98
|
-
export { ELEMENTS_TYPES };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { RequestOptions } from './shared';
|
|
2
|
-
type BasisTheoryProxyHeaders = {
|
|
3
|
-
[key: string]: string;
|
|
4
|
-
'BT-PROXY-URL': string;
|
|
5
|
-
'BT-PROXY-KEY': string;
|
|
6
|
-
};
|
|
7
|
-
type ProxyHeaders = Partial<BasisTheoryProxyHeaders>;
|
|
8
|
-
type BasisTheoryQueryParams = {
|
|
9
|
-
[key: string]: string;
|
|
10
|
-
'bt-proxy-key': string;
|
|
11
|
-
};
|
|
12
|
-
type ProxyQuery = Partial<BasisTheoryQueryParams>;
|
|
13
|
-
interface ProxyRequestOptions extends RequestOptions {
|
|
14
|
-
includeResponseHeaders?: boolean;
|
|
15
|
-
path?: string;
|
|
16
|
-
query?: ProxyQuery;
|
|
17
|
-
headers?: ProxyHeaders;
|
|
18
|
-
body?: unknown;
|
|
19
|
-
}
|
|
20
|
-
interface Proxy {
|
|
21
|
-
get(options?: ProxyRequestOptions): Promise<unknown>;
|
|
22
|
-
post(options?: ProxyRequestOptions): Promise<unknown>;
|
|
23
|
-
patch(options?: ProxyRequestOptions): Promise<unknown>;
|
|
24
|
-
put(options?: ProxyRequestOptions): Promise<unknown>;
|
|
25
|
-
delete(options?: ProxyRequestOptions): Promise<unknown>;
|
|
26
|
-
}
|
|
27
|
-
export type { Proxy, ProxyRequestOptions };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RequestOptions } from './shared';
|
|
2
|
-
type CreateSessionResponse = {
|
|
3
|
-
sessionKey: string;
|
|
4
|
-
nonce: string;
|
|
5
|
-
expiresAt: string;
|
|
6
|
-
_debug?: Record<string, unknown>;
|
|
7
|
-
};
|
|
8
|
-
interface Sessions {
|
|
9
|
-
create(options?: RequestOptions): Promise<CreateSessionResponse>;
|
|
10
|
-
}
|
|
11
|
-
export { CreateSessionResponse, Sessions };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
interface RequestOptions {
|
|
2
|
-
apiKey?: string;
|
|
3
|
-
correlationId?: string;
|
|
4
|
-
idempotencyKey?: string;
|
|
5
|
-
}
|
|
6
|
-
type Create<T, C> = {
|
|
7
|
-
create(model: C, options?: RequestOptions): Promise<T>;
|
|
8
|
-
};
|
|
9
|
-
type Retrieve<T> = {
|
|
10
|
-
retrieve(id: string, options?: RequestOptions): Promise<T>;
|
|
11
|
-
};
|
|
12
|
-
type Update<T, U> = {
|
|
13
|
-
update(id: string, model: U, options?: RequestOptions): Promise<T>;
|
|
14
|
-
};
|
|
15
|
-
type Patch<P> = {
|
|
16
|
-
patch(id: string, model: P, options?: RequestOptions): Promise<void>;
|
|
17
|
-
};
|
|
18
|
-
type Delete = {
|
|
19
|
-
delete(id: string, options?: RequestOptions): Promise<void>;
|
|
20
|
-
};
|
|
21
|
-
export { RequestOptions, Create, Retrieve, Update, Delete, Patch };
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ElementValue } from '../../elements';
|
|
2
|
-
import type { CreateTokenIntentModel, TokenIntent } from '../../models';
|
|
3
|
-
import { Create } from './shared';
|
|
4
|
-
type CreateTokenIntent = CreateTokenIntentModel<ElementValue>;
|
|
5
|
-
type TokenIntents = Create<TokenIntent, CreateTokenIntent>;
|
|
6
|
-
export type { TokenIntents, CreateTokenIntent };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ElementValue } from '../';
|
|
2
|
-
import type { TokenizeDataModel } from '../../models';
|
|
3
|
-
import { RequestOptions } from './shared';
|
|
4
|
-
type TokenizeData = TokenizeDataModel<ElementValue>;
|
|
5
|
-
interface Tokenize {
|
|
6
|
-
tokenize(tokens: TokenizeData, options?: RequestOptions): Promise<TokenizeDataModel>;
|
|
7
|
-
}
|
|
8
|
-
export type { Tokenize, TokenizeData };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ElementValue } from '../../elements';
|
|
2
|
-
import type { CreateTokenModel, UpdateTokenModel, Token } from '../../models';
|
|
3
|
-
import { Create, Retrieve, Update } from './shared';
|
|
4
|
-
type CreateToken = CreateTokenModel<ElementValue>;
|
|
5
|
-
type UpdateToken = UpdateTokenModel<ElementValue>;
|
|
6
|
-
type Tokens = Create<Token, CreateToken> & Retrieve<Token<unknown>> & Update<Token, UpdateToken>;
|
|
7
|
-
export type { Tokens, CreateToken, UpdateToken };
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { AUTOCOMPLETE_VALUES, CARD_BRANDS, CARD_ICON_POSITIONS } from '../../elements/constants';
|
|
2
|
-
type FieldErrorType = 'incomplete' | 'invalid';
|
|
3
|
-
type ConfigErrorType = 'missing-configuration' | 'missing-permission' | 'invalid-configuration';
|
|
4
|
-
interface ConfigError {
|
|
5
|
-
type: ConfigErrorType;
|
|
6
|
-
message: string;
|
|
7
|
-
}
|
|
8
|
-
interface Targeted {
|
|
9
|
-
targetId: string;
|
|
10
|
-
}
|
|
11
|
-
type ListenableKey = 'Escape' | 'Enter';
|
|
12
|
-
interface FieldError {
|
|
13
|
-
targetId: string;
|
|
14
|
-
type: FieldErrorType;
|
|
15
|
-
}
|
|
16
|
-
interface PropertyError {
|
|
17
|
-
type: FieldErrorType;
|
|
18
|
-
}
|
|
19
|
-
interface ElementMetadata {
|
|
20
|
-
complete: boolean;
|
|
21
|
-
valid: boolean;
|
|
22
|
-
maskSatisfied?: boolean;
|
|
23
|
-
empty: boolean;
|
|
24
|
-
errors?: FieldError[] | Omit<FieldError, 'targetId'>[];
|
|
25
|
-
}
|
|
26
|
-
interface CardMetadata {
|
|
27
|
-
cardBrand: Brand;
|
|
28
|
-
cardLast4?: string;
|
|
29
|
-
cardBin?: string;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Card brands type
|
|
33
|
-
*/
|
|
34
|
-
type Brand = typeof CARD_BRANDS[number];
|
|
35
|
-
/**
|
|
36
|
-
* Icon position for card number element
|
|
37
|
-
*/
|
|
38
|
-
type CardIconPosition = typeof CARD_ICON_POSITIONS[number];
|
|
39
|
-
/**
|
|
40
|
-
* Values for the element input autocomplete attribute
|
|
41
|
-
*/
|
|
42
|
-
type AutoCompleteValue = typeof AUTOCOMPLETE_VALUES[number];
|
|
43
|
-
/**
|
|
44
|
-
* Type used for detokenization responses stored on Data Elements
|
|
45
|
-
*/
|
|
46
|
-
type DataElementReference = {
|
|
47
|
-
correlationId: string;
|
|
48
|
-
elementId: string;
|
|
49
|
-
path: string;
|
|
50
|
-
};
|
|
51
|
-
export type { AutoCompleteValue, Brand, CardIconPosition, CardMetadata, ConfigError, ConfigErrorType, DataElementReference, ElementMetadata, FieldError, FieldErrorType, ListenableKey, PropertyError, Targeted, };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { Properties as CSSProperties } from 'csstype';
|
|
2
|
-
declare const SAFE_CSS_PROPERTIES: readonly ["backgroundColor", "color", "fontFamily", "fontSize", "fontSmooth", "fontStyle", "fontVariant", "fontWeight", "lineHeight", "letterSpacing", "textAlign", "padding", "textDecoration", "textShadow", "textTransform"];
|
|
3
|
-
type SafeCSSProperty = typeof SAFE_CSS_PROPERTIES[number];
|
|
4
|
-
declare const SAFE_CSS_PROPERTIES_ALTERNATES: Partial<Record<SafeCSSProperty, string[]>>;
|
|
5
|
-
declare const SAFE_CSS_PROPERTIES_WITH_ALTERNATES: string[];
|
|
6
|
-
type SafeStyle = Pick<CSSProperties, SafeCSSProperty>;
|
|
7
|
-
declare const CARD_ELEMENT_STYLE_VARIANT_SELECTORS: readonly [":hover", ":focus", ":read-only", "::placeholder", "::selection", ":disabled"];
|
|
8
|
-
type CardElementStyleVariantSelector = typeof CARD_ELEMENT_STYLE_VARIANT_SELECTORS[number];
|
|
9
|
-
type CardElementStyleVariantStyle = SafeStyle & Partial<Record<CardElementStyleVariantSelector, SafeStyle>>;
|
|
10
|
-
declare const CARD_ELEMENT_STYLE_VARIANTS: readonly ["base", "complete", "invalid", "empty"];
|
|
11
|
-
declare const CARD_ELEMENT_STYLE_FONTS_ATTR: "fonts";
|
|
12
|
-
type CardElementStyleVariant = typeof CARD_ELEMENT_STYLE_VARIANTS[number];
|
|
13
|
-
type CardElementStyleFontAttr = typeof CARD_ELEMENT_STYLE_FONTS_ATTR;
|
|
14
|
-
type FontSource = string;
|
|
15
|
-
type FontSources = FontSource[];
|
|
16
|
-
type Fonts = Record<CardElementStyleFontAttr, FontSources>;
|
|
17
|
-
type CardElementStyle = Partial<Record<CardElementStyleVariant, CardElementStyleVariantStyle> & Fonts>;
|
|
18
|
-
type ElementStyle = CardElementStyle;
|
|
19
|
-
type CopyIconStyles = {
|
|
20
|
-
size?: string;
|
|
21
|
-
color?: string;
|
|
22
|
-
successColor?: string;
|
|
23
|
-
};
|
|
24
|
-
export { SAFE_CSS_PROPERTIES, SAFE_CSS_PROPERTIES_ALTERNATES, SAFE_CSS_PROPERTIES_WITH_ALTERNATES, CARD_ELEMENT_STYLE_VARIANT_SELECTORS, CARD_ELEMENT_STYLE_VARIANTS, CARD_ELEMENT_STYLE_FONTS_ATTR, };
|
|
25
|
-
export type { CardElementStyle, CardElementStyleVariant, CardElementStyleVariantSelector, CardElementStyleVariantStyle, CopyIconStyles, ElementStyle, Fonts, FontSources, SafeCSSProperty, SafeStyle, };
|
|
@@ -1,38 +0,0 @@
|
|
|
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?: unknown;
|
|
18
|
-
cost?: unknown;
|
|
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, };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
type Primitive = string | number | boolean | null;
|
|
2
|
-
type TokenType = 'token' | 'card' | 'bank' | 'card_number' | 'us_bank_routing_number' | 'us_bank_account_number' | 'social_security_number';
|
|
3
|
-
interface Auditable {
|
|
4
|
-
createdBy?: string;
|
|
5
|
-
createdAt?: string;
|
|
6
|
-
modifiedBy?: string;
|
|
7
|
-
modifiedAt?: string;
|
|
8
|
-
}
|
|
9
|
-
type DataObject<DataType = Primitive> = {
|
|
10
|
-
[member: string]: TokenData<DataType>;
|
|
11
|
-
};
|
|
12
|
-
type DataArray<DataType> = Array<TokenData<DataType>>;
|
|
13
|
-
type TokenData<DataType = Primitive> = Primitive | DataObject<DataType> | DataArray<DataType> | DataType;
|
|
14
|
-
interface TokenBase<DataType = Primitive> extends Auditable {
|
|
15
|
-
data: TokenData<DataType>;
|
|
16
|
-
type: TokenType;
|
|
17
|
-
}
|
|
18
|
-
interface ReactResponse {
|
|
19
|
-
tokens: DataObject;
|
|
20
|
-
raw: DataObject;
|
|
21
|
-
}
|
|
22
|
-
export type { Primitive, Auditable, TokenType, TokenBase, ReactResponse, DataObject, };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { TokenBase, DataObject, Auditable, TokenType, IssuerCountry } from '../../types/models';
|
|
2
|
-
interface TokenIntentCardDetails {
|
|
3
|
-
type: 'card';
|
|
4
|
-
card: {
|
|
5
|
-
bin: string;
|
|
6
|
-
last4: string;
|
|
7
|
-
brand: string;
|
|
8
|
-
funding: string;
|
|
9
|
-
expirationMonth: number;
|
|
10
|
-
expirationYear: number;
|
|
11
|
-
issuerCountry?: IssuerCountry;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
type TokenTypesForTokenIntents = Exclude<TokenType, 'token' | 'card'>;
|
|
15
|
-
type TokenTypeMap = {
|
|
16
|
-
[K in TokenTypesForTokenIntents]: {
|
|
17
|
-
type: K;
|
|
18
|
-
} & Record<K, Record<string, unknown>>;
|
|
19
|
-
};
|
|
20
|
-
type TokenIntent<DataType = DataObject> = (TokenBase<DataType> & Omit<Auditable, 'modifiedAt' | 'modifiedBy'> & {
|
|
21
|
-
id: string;
|
|
22
|
-
tenantId: string;
|
|
23
|
-
expiresAt: string;
|
|
24
|
-
fingerprint?: string;
|
|
25
|
-
}) & (TokenTypeMap[TokenTypesForTokenIntents] | TokenIntentCardDetails | {
|
|
26
|
-
type: 'token';
|
|
27
|
-
});
|
|
28
|
-
type CreateTokenIntent<DataType = DataObject> = Pick<TokenIntent<DataType>, 'type' | 'data'>;
|
|
29
|
-
export type { TokenIntent, CreateTokenIntent as CreateTokenIntentModel, TokenIntentCardDetails, };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Primitive } from './shared';
|
|
2
|
-
type TokenizeObject<DataType = Primitive> = {
|
|
3
|
-
[key: string]: Primitive | TokenizeObject<DataType> | TokenizeArray<DataType> | DataType;
|
|
4
|
-
};
|
|
5
|
-
type TokenizeArray<DataType = Primitive> = Array<Primitive | TokenizeObject<DataType> | TokenizeArray<DataType> | DataType>;
|
|
6
|
-
type TokenizeData<DataType = Primitive> = TokenizeArray<DataType> | TokenizeObject<DataType>;
|
|
7
|
-
export type { TokenizeObject, TokenizeArray, TokenizeData as TokenizeDataModel, };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { BinDetails } from './bin-details';
|
|
2
|
-
import type { Primitive, TokenBase } from './shared';
|
|
3
|
-
declare const DATA_CLASSIFICATIONS: readonly ["general", "bank", "pci", "pii"];
|
|
4
|
-
type DataClassification = typeof DATA_CLASSIFICATIONS[number];
|
|
5
|
-
declare const DATA_IMPACT_LEVELS: readonly ["low", "moderate", "high"];
|
|
6
|
-
type DataImpactLevel = typeof DATA_IMPACT_LEVELS[number];
|
|
7
|
-
declare const DATA_RESTRICTION_POLICIES: readonly ["mask", "redact"];
|
|
8
|
-
type DataRestrictionPolicy = typeof DATA_RESTRICTION_POLICIES[number];
|
|
9
|
-
type MaskObject = {
|
|
10
|
-
[member: string]: TokenMask;
|
|
11
|
-
};
|
|
12
|
-
type MaskArray = Array<TokenMask>;
|
|
13
|
-
type TokenMask = string | null | MaskObject | MaskArray;
|
|
14
|
-
interface TokenEncryptionKey {
|
|
15
|
-
key: string;
|
|
16
|
-
alg: string;
|
|
17
|
-
}
|
|
18
|
-
interface TokenEncryption {
|
|
19
|
-
cek: TokenEncryptionKey;
|
|
20
|
-
kek: TokenEncryptionKey;
|
|
21
|
-
}
|
|
22
|
-
interface TokenPrivacy {
|
|
23
|
-
classification?: DataClassification;
|
|
24
|
-
impactLevel?: DataImpactLevel;
|
|
25
|
-
restrictionPolicy?: DataRestrictionPolicy;
|
|
26
|
-
}
|
|
27
|
-
interface TokenEnrichments {
|
|
28
|
-
binDetails?: BinDetails;
|
|
29
|
-
}
|
|
30
|
-
type Token<DataType = Primitive> = TokenBase<DataType> & {
|
|
31
|
-
id: string;
|
|
32
|
-
privacy?: TokenPrivacy;
|
|
33
|
-
containers?: string[];
|
|
34
|
-
encryption?: TokenEncryption;
|
|
35
|
-
searchIndexes?: string[];
|
|
36
|
-
fingerprintExpression?: string;
|
|
37
|
-
mask?: TokenMask;
|
|
38
|
-
expiresAt?: string;
|
|
39
|
-
enrichments?: TokenEnrichments;
|
|
40
|
-
tenantId: string;
|
|
41
|
-
fingerprint?: string;
|
|
42
|
-
metadata?: Record<string, string>;
|
|
43
|
-
};
|
|
44
|
-
type CreateToken<DataType = Primitive> = Pick<Token<DataType>, 'type' | 'data' | 'privacy' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
|
|
45
|
-
deduplicateToken?: boolean;
|
|
46
|
-
id?: string;
|
|
47
|
-
};
|
|
48
|
-
type UpdateToken<DataType = Primitive> = Partial<Pick<Token<DataType>, 'data' | 'containers' | 'metadata' | 'encryption' | 'searchIndexes' | 'fingerprintExpression' | 'mask' | 'expiresAt'> & {
|
|
49
|
-
privacy: Omit<TokenPrivacy, 'classification'>;
|
|
50
|
-
deduplicateToken: boolean;
|
|
51
|
-
}>;
|
|
52
|
-
export type { Token, TokenEnrichments, CreateToken as CreateTokenModel, UpdateToken as UpdateTokenModel, DataClassification, DataImpactLevel, DataRestrictionPolicy, };
|
|
53
|
-
export { DATA_CLASSIFICATIONS, DATA_IMPACT_LEVELS, DATA_RESTRICTION_POLICIES };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Make all properties in T nullable
|
|
3
|
-
*/
|
|
4
|
-
type Nullable<T> = {
|
|
5
|
-
[P in keyof T]: T[P] | null;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Make selected properties in T nullable
|
|
9
|
-
*/
|
|
10
|
-
type NullableProps<T, K extends keyof T> = T | Nullable<Pick<T, K>>;
|
|
11
|
-
export type { Nullable, NullableProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './services';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface RequestConfig {
|
|
2
|
-
headers?: Record<string, string>;
|
|
3
|
-
}
|
|
4
|
-
interface HttpClient {
|
|
5
|
-
post(url: string, payload: unknown, config?: RequestConfig): Promise<unknown>;
|
|
6
|
-
put(url: string, payload: unknown, config?: RequestConfig): Promise<unknown>;
|
|
7
|
-
patch(url: string, payload: unknown, config?: RequestConfig): Promise<unknown>;
|
|
8
|
-
get(url: string, config?: RequestConfig): Promise<unknown>;
|
|
9
|
-
delete(url: string, config?: RequestConfig): Promise<unknown>;
|
|
10
|
-
}
|
|
11
|
-
export type { HttpClient, RequestConfig };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './http';
|
package/dist/types/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const version: "1.11.3";
|