diff --git a/machines/request.ts b/machines/request.ts index 195c609f..4eff9d2c 100644 --- a/machines/request.ts +++ b/machines/request.ts @@ -1,4 +1,4 @@ -import SmartShare from 'react-native-idpass-smartshare'; +import SmartShare from '@idpass/smartshare-react-native'; import BluetoothStateManager from 'react-native-bluetooth-state-manager'; import { EmitterSubscription } from 'react-native'; import { EventFrom, send, sendParent, StateFrom } from 'xstate'; diff --git a/machines/scan.ts b/machines/scan.ts index 1ac7bcd4..8dbea282 100644 --- a/machines/scan.ts +++ b/machines/scan.ts @@ -1,4 +1,4 @@ -import SmartShare, { ConnectionParams } from 'react-native-idpass-smartshare'; +import SmartShare from '@idpass/smartshare-react-native'; import LocationEnabler from 'react-native-location-enabler'; import { EventFrom, send, sendParent, StateFrom } from 'xstate'; import { createModel } from 'xstate/lib/model'; @@ -386,7 +386,7 @@ export const scanMachine = model.createMachine( guards: { isQrValid: (_, event: ScanEvent) => { - const param: ConnectionParams = Object.create(null); + const param: SmartShare.ConnectionParams = Object.create(null); try { Object.assign(param, JSON.parse(event.params)); return 'cid' in param && 'pk' in param; diff --git a/machines/smartshare.ts b/machines/smartshare.ts index 6e43309b..3457ba1b 100644 --- a/machines/smartshare.ts +++ b/machines/smartshare.ts @@ -1,4 +1,4 @@ -import SmartShare, { ConnectionParams } from 'react-native-idpass-smartshare'; +import SmartShare from '@idpass/smartshare-react-native'; import { EmitterSubscription } from 'react-native'; import { createModel } from 'xstate/lib/model'; import { Message } from '../shared/Message'; @@ -128,7 +128,7 @@ export const smartShareMachine = model.createMachine( guards: { isQrValid: (context, event: DeviceFoundEvent) => { - const params: ConnectionParams = Object.create(null); + const params: SmartShare.ConnectionParams = Object.create(null); try { Object.assign(params, JSON.parse(event.qrCode)); return 'cid' in params && 'pk' in params; diff --git a/package-lock.json b/package-lock.json index 7e672feb..0dfd1d53 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "dependencies": { "@expo-google-fonts/poppins": "^0.2.0", + "@idpass/smartshare-react-native": "^0.2.0", "@react-native-async-storage/async-storage": "~1.15.0", "@react-native-community/netinfo": "6.0.2", "@react-navigation/bottom-tabs": "^6.0.7", @@ -34,7 +35,6 @@ "react-native-device-info": "^8.4.8", "react-native-elements": "^3.4.2", "react-native-gesture-handler": "~1.10.2", - "react-native-idpass-smartshare": "^0.1.0", "react-native-keychain": "^8.0.0", "react-native-location-enabler": "^4.1.0", "react-native-qrcode-svg": "^6.1.1", @@ -3953,6 +3953,15 @@ "resolved": "https://registry.npmjs.org/@ide/backoff/-/backoff-1.0.0.tgz", "integrity": "sha512-F0YfUDjvT+Mtt/R4xdl2X0EYCHMMiJqNLdxHD++jDT5ydEFIyqbCHh51Qx2E211dgZprPKhV7sHmnXKpLuvc5g==" }, + "node_modules/@idpass/smartshare-react-native": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@idpass/smartshare-react-native/-/smartshare-react-native-0.2.0.tgz", + "integrity": "sha512-/bjkg1u3msFLGqxl3hVTCjDm6hJRi0yuk+rEzQLjkn249VioLHJ7SBbvPzH5jUC2pW6JIK7UtAaevS5VoMgicw==", + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, "node_modules/@jest/create-cache-key-function": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-26.6.2.tgz", @@ -21188,15 +21197,6 @@ "ua-parser-js": "^0.7.30" } }, - "node_modules/react-native-idpass-smartshare": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/react-native-idpass-smartshare/-/react-native-idpass-smartshare-0.1.0.tgz", - "integrity": "sha512-oYgvNHZK0wJl8ITzYttnhKfLfGlZq3jjFVSLtd+lOduGA6GvLxjU/BR43CVZuPZ2nGSm4+4NeTtKQzpAzrtyGw==", - "peerDependencies": { - "react": "*", - "react-native": "*" - } - }, "node_modules/react-native-keychain": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/react-native-keychain/-/react-native-keychain-8.0.0.tgz", @@ -30760,6 +30760,12 @@ "resolved": "https://registry.npmjs.org/@ide/backoff/-/backoff-1.0.0.tgz", "integrity": "sha512-F0YfUDjvT+Mtt/R4xdl2X0EYCHMMiJqNLdxHD++jDT5ydEFIyqbCHh51Qx2E211dgZprPKhV7sHmnXKpLuvc5g==" }, + "@idpass/smartshare-react-native": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@idpass/smartshare-react-native/-/smartshare-react-native-0.2.0.tgz", + "integrity": "sha512-/bjkg1u3msFLGqxl3hVTCjDm6hJRi0yuk+rEzQLjkn249VioLHJ7SBbvPzH5jUC2pW6JIK7UtAaevS5VoMgicw==", + "requires": {} + }, "@jest/create-cache-key-function": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/@jest/create-cache-key-function/-/create-cache-key-function-26.6.2.tgz", @@ -44866,12 +44872,6 @@ } } }, - "react-native-idpass-smartshare": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/react-native-idpass-smartshare/-/react-native-idpass-smartshare-0.1.0.tgz", - "integrity": "sha512-oYgvNHZK0wJl8ITzYttnhKfLfGlZq3jjFVSLtd+lOduGA6GvLxjU/BR43CVZuPZ2nGSm4+4NeTtKQzpAzrtyGw==", - "requires": {} - }, "react-native-keychain": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/react-native-keychain/-/react-native-keychain-8.0.0.tgz", diff --git a/package.json b/package.json index 16cfd205..407bacbe 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@expo-google-fonts/poppins": "^0.2.0", + "@idpass/smartshare-react-native": "^0.2.0", "@react-native-async-storage/async-storage": "~1.15.0", "@react-native-community/netinfo": "6.0.2", "@react-navigation/bottom-tabs": "^6.0.7", diff --git a/types/react-native-bluetooth-secure/index.d.ts b/types/idpass__smartshare-react-native/index.d.ts similarity index 96% rename from types/react-native-bluetooth-secure/index.d.ts rename to types/idpass__smartshare-react-native/index.d.ts index d0b6130c..12ea6b9b 100644 --- a/types/react-native-bluetooth-secure/index.d.ts +++ b/types/idpass__smartshare-react-native/index.d.ts @@ -1,7 +1,7 @@ import { EmitterSubscription } from 'react-native'; import { BluetoothState } from 'react-native-bluetooth-state-manager'; -declare module 'react-native-idpass-smartshare' { +declare module '@idpass/smartshare-react-native' { class BluetoothApi { getConnectionParameters: () => string;