Skip to content

Commit 09dcca8

Browse files
committed
chore: remove old sdk dependency add device info header
1 parent 887c3b1 commit 09dcca8

47 files changed

Lines changed: 1668 additions & 189 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

demo/Collect.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,13 @@ import {
1010
TextInput,
1111
View,
1212
} from 'react-native';
13-
import type { BTRef, BTDateRef, ElementEvent } from '../src';
13+
import type { BTRef, BTDateRef, ElementEvent, Token, TokenizeData } from '../src';
1414
import {
1515
CardExpirationDateElement,
1616
CardNumberElement,
1717
CardVerificationCodeElement,
1818
useBasisTheory,
1919
} from '../src';
20-
import type {
21-
Token,
22-
TokenizeData,
23-
} from '@basis-theory/basis-theory-js/types/models';
2420
import { styles } from './styles';
2521
import type { ElementEvents } from '../App';
2622
import { EncryptedToken, EncryptToken } from '../src/model/EncryptTokenData';
@@ -308,3 +304,4 @@ export const Collect = () => {
308304
</View>
309305
);
310306
};
307+

ios/Podfile.lock

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ PODS:
88
- hermes-engine (0.79.5):
99
- hermes-engine/Pre-built (= 0.79.5)
1010
- hermes-engine/Pre-built (0.79.5)
11-
- OpenSSL-Universal (3.3.3001)
1211
- RCT-Folly (2024.11.18.00):
1312
- boost
1413
- DoubleConversion
@@ -1335,32 +1334,6 @@ PODS:
13351334
- ReactCommon/turbomodule/core
13361335
- react-native-get-random-values (1.11.0):
13371336
- React-Core
1338-
- react-native-quick-crypto (0.7.14):
1339-
- DoubleConversion
1340-
- glog
1341-
- hermes-engine
1342-
- OpenSSL-Universal
1343-
- RCT-Folly (= 2024.11.18.00)
1344-
- RCTRequired
1345-
- RCTTypeSafety
1346-
- React
1347-
- React-Core
1348-
- React-debug
1349-
- React-Fabric
1350-
- React-featureflags
1351-
- React-graphics
1352-
- React-hermes
1353-
- React-ImageManager
1354-
- React-jsi
1355-
- React-NativeModulesApple
1356-
- React-RCTFabric
1357-
- React-renderercss
1358-
- React-rendererdebug
1359-
- React-utils
1360-
- ReactCodegen
1361-
- ReactCommon/turbomodule/bridging
1362-
- ReactCommon/turbomodule/core
1363-
- Yoga
13641337
- react-native-safe-area-context (5.5.1):
13651338
- DoubleConversion
13661339
- glog
@@ -1854,7 +1827,6 @@ DEPENDENCIES:
18541827
- React-Mapbuffer (from `../node_modules/react-native/ReactCommon`)
18551828
- React-microtasksnativemodule (from `../node_modules/react-native/ReactCommon/react/nativemodule/microtasks`)
18561829
- react-native-get-random-values (from `../node_modules/react-native-get-random-values`)
1857-
- react-native-quick-crypto (from `../node_modules/react-native-quick-crypto`)
18581830
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
18591831
- React-NativeModulesApple (from `../node_modules/react-native/ReactCommon/react/nativemodule/core/platform/ios`)
18601832
- React-oscompat (from `../node_modules/react-native/ReactCommon/oscompat`)
@@ -1892,7 +1864,6 @@ DEPENDENCIES:
18921864

18931865
SPEC REPOS:
18941866
trunk:
1895-
- OpenSSL-Universal
18961867
- SocketRocket
18971868

18981869
EXTERNAL SOURCES:
@@ -1975,8 +1946,6 @@ EXTERNAL SOURCES:
19751946
:path: "../node_modules/react-native/ReactCommon/react/nativemodule/microtasks"
19761947
react-native-get-random-values:
19771948
:path: "../node_modules/react-native-get-random-values"
1978-
react-native-quick-crypto:
1979-
:path: "../node_modules/react-native-quick-crypto"
19801949
react-native-safe-area-context:
19811950
:path: "../node_modules/react-native-safe-area-context"
19821951
React-NativeModulesApple:
@@ -2054,7 +2023,6 @@ SPEC CHECKSUMS:
20542023
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
20552024
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
20562025
hermes-engine: f03b0e06d3882d71e67e45b073bb827da1a21aae
2057-
OpenSSL-Universal: 6082b0bf950e5636fe0d78def171184e2b3899c2
20582026
RCT-Folly: e78785aa9ba2ed998ea4151e314036f6c49e6d82
20592027
RCTDeprecation: 5f638f65935e273753b1f31a365db6a8d6dc53b5
20602028
RCTRequired: 8b46a520ea9071e2bc47d474aa9ca31b4a935bd8
@@ -2087,7 +2055,6 @@ SPEC CHECKSUMS:
20872055
React-Mapbuffer: 96a2f2a176268581733be182fa6eebab1c0193be
20882056
React-microtasksnativemodule: bda561d2648e1e52bd9e5a87f8889836bdbde2e2
20892057
react-native-get-random-values: d16467cf726c618e9c7a8c3c39c31faa2244bbba
2090-
react-native-quick-crypto: dcf29d2a08af7b16fb0ee9ef2327585743300ed5
20912058
react-native-safe-area-context: 091add53da15b67c76b176724725581b29a1cde3
20922059
React-NativeModulesApple: 1ecb83880dd11baf2228f8dd89d8419c387e03ad
20932060
React-oscompat: 0592889a9fcf0eacb205532028e4a364e22907dd

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"test": "jest"
1818
},
1919
"dependencies": {
20-
"@basis-theory/basis-theory-js": "^4.28.2",
2120
"@noble/ciphers": "^1.3.0",
2221
"@noble/curves": "^1.9.2",
2322
"@noble/hashes": "^1.8.0",

src/components/CardNumberElement.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CreditCardType } from '@basis-theory/basis-theory-js/types/elements';
1+
import type { CreditCardType } from '../types';
22
import type { ForwardedRef } from 'react';
33
import { useId, useRef, useState } from 'react';
44
import type { TextInput } from 'react-native';

src/components/useCustomBin.hook.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { CreditCardType } from '@basis-theory/basis-theory-js/types/elements';
1+
import type { CreditCardType } from '../types';
22
import { creditCardType } from 'card-validator';
33
import { always, compose, groupBy, ifElse, isEmpty } from 'ramda';
44
import { useEffect, useState } from 'react';

src/index.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,28 @@ export { TextElement } from './components/TextElement';
77
export { BasisTheoryProvider } from './BasisTheoryProvider';
88
export { useBasisTheory } from './useBasisTheory';
99
export type { BTRef, BTDateRef, ElementEvent } from './BaseElementTypes';
10-
export type { Token } from '@basis-theory/basis-theory-js/types/models';
10+
export type {
11+
Token,
12+
CreateToken,
13+
UpdateToken,
14+
TokenizeData,
15+
CreateSessionResponse,
16+
CreateTokenIntent,
17+
TokenIntent,
18+
RequestOptions,
19+
DeviceInfo,
20+
BasisTheoryInstance,
21+
CreditCardType,
22+
VISA,
23+
MASTERCARD,
24+
AMERICAN_EXPRESS,
25+
DINERS_CLUB,
26+
DISCOVER,
27+
JCB,
28+
UNIONPAY,
29+
MAESTRO,
30+
ELO,
31+
MIR,
32+
HIPER,
33+
HIPERCARD,
34+
} from './types';

src/model/EncryptTokenData.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
// TODO: Migrate to web-elements when we completely drop basis-theory-js
2-
import {
3-
CreateToken,
4-
Primitive,
5-
TokenBase,
6-
} from '@basis-theory/basis-theory-js/types/models';
1+
import type { CreateToken } from '../types';
72
import { BTRef, InputBTRefWithDatepart } from '../BaseElementTypes';
83

94
/**
105
* Represents token data with element references for secure input handling.
116
* Used when creating tokens that contain form element references instead of raw values.
127
*/
8+
// Primitive types
9+
type Primitive = string | number | boolean | null | undefined;
10+
1311
type TokenDataWithRef = {
1412
/** Key-value pairs where values are element references or date part references */
1513
data: Record<string, BTRef | InputBTRefWithDatepart | null | undefined | Primitive>;
16-
type: TokenBase['type'];
14+
type: string;
1715
};
1816

1917
type TokenData = Pick<CreateToken, 'type' | 'data'>;
@@ -44,7 +42,7 @@ type EncryptedSingleToken = {
4442
encrypted: string;
4543

4644
/** Original token type before encryption */
47-
type: TokenBase['type'];
45+
type: string;
4846
};
4947

5048
type EncryptedToken = EncryptedSingleToken | Record<string, EncryptedSingleToken>;

src/modules/proxy.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import type { BasisTheory } from '@basis-theory/basis-theory-js';
2-
import type {
3-
ProxyRequestOptions,
4-
BasisTheory as BasisTheoryType,
5-
} from '@basis-theory/basis-theory-js/types/sdk';
1+
import type { ProxyRequestOptions, BasisTheoryInstance } from '../types';
62

73
import { replaceSensitiveData } from '../utils/dataManipulationUtils';
84

9-
export const Proxy = (bt: BasisTheoryType) => {
5+
export const Proxy = (bt: BasisTheoryInstance) => {
106
const proxy = async (
117
{
128
method,
139
...proxyRequest
1410
}: Omit<ProxyRequestOptions, 'includeResponseHeaders'> & {
15-
method: keyof BasisTheory['proxy'];
11+
method: keyof BasisTheoryInstance['proxy'];
1612
},
1713
apiKey?: string
1814
): Promise<unknown> => {

src/modules/sessions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { BasisTheory as BasisTheoryType } from '@basis-theory/basis-theory-js/types/sdk';
1+
import type { BasisTheoryInstance } from '../types';
22

3-
export const Sessions = (bt: BasisTheoryType) => {
3+
export const Sessions = (bt: BasisTheoryInstance) => {
44
const create = async () => {
55
try {
66
const session = await bt.sessions.create();

src/modules/tokenIntents.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import type {
22
CreateTokenIntent,
33
TokenIntent,
4-
} from '@basis-theory/basis-theory-js/types/models';
5-
import type {
6-
BasisTheory as BasisTheoryType,
74
RequestOptions,
8-
} from '@basis-theory/basis-theory-js/types/sdk';
5+
BasisTheoryInstance,
6+
} from '../types';
97
import type {
108
BTRef,
119
InputBTRefWithDatepart,
@@ -23,7 +21,7 @@ export type TokenIntentData = TokenIntent<
2321
BTRef | InputBTRefWithDatepart | PrimitiveType
2422
>;
2523

26-
export const TokenIntents = (bt: BasisTheoryType) => {
24+
export const TokenIntents = (bt: BasisTheoryInstance) => {
2725
const create = async (
2826
tokenIntentWithRef: CreateTokenIntentWithBtRef,
2927
requestOptions?: RequestOptions

0 commit comments

Comments
 (0)