@basis-theory/basis-theory-js 1.50.0 → 1.51.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.
|
@@ -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
|
-
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?:
|
|
36
|
-
expiration_month?:
|
|
37
|
-
expiration_year?:
|
|
38
|
-
cvc?:
|
|
35
|
+
number?: DataElementReference;
|
|
36
|
+
expiration_month?: DataElementReference;
|
|
37
|
+
expiration_year?: DataElementReference;
|
|
38
|
+
cvc?: DataElementReference;
|
|
39
39
|
}
|
|
40
40
|
interface CardExpirationDateValue {
|
|
41
|
-
month:
|
|
42
|
-
year:
|
|
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
|
-
|
|
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, };
|