@basis-theory/basis-theory-js 1.65.1 → 1.66.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
CHANGED
|
@@ -36,7 +36,7 @@ class BasisTheoryProxy extends _service.BasisTheoryService {
|
|
|
36
36
|
if (method === 'post' || method === 'put' || method === 'patch') {
|
|
37
37
|
var _options$path, _options$body;
|
|
38
38
|
|
|
39
|
-
return this.client[method]((_options$path = options === null || options === void 0 ? void 0 : options.path) !== null && _options$path !== void 0 ? _options$path : '
|
|
39
|
+
return this.client[method]((_options$path = options === null || options === void 0 ? void 0 : options.path) !== null && _options$path !== void 0 ? _options$path : '', (_options$body = options === null || options === void 0 ? void 0 : options.body) !== null && _options$body !== void 0 ? _options$body : undefined, (0, _common.createRequestConfig)(options, {
|
|
40
40
|
transformRequest: _common.proxyRaw,
|
|
41
41
|
transformResponse: _common.proxyRaw
|
|
42
42
|
})).then(_common.dataExtractor);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ElementEventListener, EventType, Subscription, TextElementEvents, CardElementEvents, CardNumberElementEvents, CardExpirationDateElementEvents, CardVerificationCodeElementEvents } from './events';
|
|
2
2
|
import type { CreateCardElementOptions, CreateCardExpirationDateElementOptions, CreateCardVerificationCodeElementOptions, CreateTextElementOptions, UpdateCardElementOptions, CreateCardNumberElementOptions, UpdateCardNumberElementOptions, UpdateCardExpirationDateElementOptions, UpdateCardVerificationCodeElementOptions, UpdateTextElementOptions, CardElementValue, CardExpirationDateValue } from './options';
|
|
3
3
|
import type { Tokenize, Tokens, Proxy } from './services';
|
|
4
|
-
import { DataElementReference } from './shared';
|
|
4
|
+
import type { CardMetadata, DataElementReference, ElementMetadata } from './shared';
|
|
5
5
|
interface BaseElement<UpdateOptions, ElementEvents> {
|
|
6
6
|
readonly mounted: boolean;
|
|
7
|
+
readonly metadata: ElementMetadata;
|
|
7
8
|
mount(selector: string): Promise<void>;
|
|
8
9
|
update(options: UpdateOptions): Promise<void>;
|
|
9
10
|
clear(): void;
|
|
@@ -13,12 +14,14 @@ interface BaseElement<UpdateOptions, ElementEvents> {
|
|
|
13
14
|
on<T extends EventType>(eventType: T, listener: ElementEventListener<ElementEvents, T>): Subscription;
|
|
14
15
|
}
|
|
15
16
|
declare type CardElement = BaseElement<UpdateCardElementOptions, CardElementEvents> & {
|
|
17
|
+
readonly cardMetadata: CardMetadata;
|
|
16
18
|
setValue(value: CardElementValue<'reference'>): void;
|
|
17
19
|
};
|
|
18
20
|
declare type TextElement = BaseElement<UpdateTextElementOptions, TextElementEvents> & {
|
|
19
21
|
setValue(value: DataElementReference): void;
|
|
20
22
|
};
|
|
21
23
|
declare type CardNumberElement = BaseElement<UpdateCardNumberElementOptions, CardNumberElementEvents> & {
|
|
24
|
+
readonly cardMetadata: CardMetadata;
|
|
22
25
|
setValue(value: DataElementReference): void;
|
|
23
26
|
};
|
|
24
27
|
declare type CardExpirationDateElement = BaseElement<UpdateCardExpirationDateElementOptions, CardExpirationDateElementEvents> & {
|
|
@@ -16,6 +16,17 @@ interface FieldError {
|
|
|
16
16
|
interface PropertyError {
|
|
17
17
|
type: FieldErrorType;
|
|
18
18
|
}
|
|
19
|
+
interface ElementMetadata {
|
|
20
|
+
complete: boolean;
|
|
21
|
+
valid: boolean;
|
|
22
|
+
maskSatisfied: boolean;
|
|
23
|
+
empty: boolean;
|
|
24
|
+
}
|
|
25
|
+
interface CardMetadata {
|
|
26
|
+
cardBrand: Brand;
|
|
27
|
+
cardLast4?: string;
|
|
28
|
+
cardBin?: string;
|
|
29
|
+
}
|
|
19
30
|
/**
|
|
20
31
|
* Card brands type
|
|
21
32
|
*/
|
|
@@ -36,4 +47,4 @@ declare type DataElementReference = {
|
|
|
36
47
|
elementId: string;
|
|
37
48
|
path: string;
|
|
38
49
|
};
|
|
39
|
-
export type { FieldErrorType, ConfigErrorType, ConfigError, Targeted, ListenableKey, FieldError, PropertyError, Brand, CardIconPosition, AutoCompleteValue, DataElementReference, };
|
|
50
|
+
export type { FieldErrorType, ConfigErrorType, ConfigError, Targeted, ListenableKey, FieldError, PropertyError, Brand, CardIconPosition, AutoCompleteValue, DataElementReference, ElementMetadata, CardMetadata, };
|