From 498a1c4a7ebfb9bc86483a3c610f8fad695f4f6d Mon Sep 17 00:00:00 2001 From: Jan Kobersky <5406945+kober32@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:06:44 +0200 Subject: [PATCH] Added missing features (#10) --- example/ios/Podfile.lock | 32 +- example/ios/example.xcodeproj/project.pbxproj | 15 +- example/src/App.tsx | 124 +- package-lock.json | 26751 ++++++++++++++++ src/MobileToken.ts | 360 +- src/MobileTokenException.ts | 29 + src/inbox/Inbox.ts | 115 + src/inbox/InboxCount.ts | 21 + src/inbox/InboxMessage.ts | 34 + src/inbox/InboxMessageDetail.ts | 36 + src/index.ts | 29 +- src/networking/KnownRestApiError.ts | 0 src/networking/Networking.ts | 131 + ...leTokenOperation.ts => OnlineOperation.ts} | 2 +- src/operations/Operations.ts | 157 + src/operations/PACUtils.ts | 96 + src/operations/QROperation.ts | 255 + src/operations/QROperationParser.ts | 355 + ...TokenUserOperation.ts => UserOperation.ts} | 44 +- ...Attribute.ts => UserOperationAttribute.ts} | 27 +- src/operations/UserOperationProximityCheck.ts | 26 + src/operations/UserOperationUIData.ts | 129 + src/push/Push.ts | 48 + yarn.lock | 2401 +- 24 files changed, 29644 insertions(+), 1573 deletions(-) create mode 100644 package-lock.json create mode 100644 src/MobileTokenException.ts create mode 100644 src/inbox/Inbox.ts create mode 100644 src/inbox/InboxCount.ts create mode 100644 src/inbox/InboxMessage.ts create mode 100644 src/inbox/InboxMessageDetail.ts create mode 100644 src/networking/KnownRestApiError.ts create mode 100644 src/networking/Networking.ts rename src/operations/{MobileTokenOperation.ts => OnlineOperation.ts} (95%) create mode 100644 src/operations/Operations.ts create mode 100644 src/operations/PACUtils.ts create mode 100644 src/operations/QROperation.ts create mode 100644 src/operations/QROperationParser.ts rename src/operations/{MobileTokenUserOperation.ts => UserOperation.ts} (75%) rename src/operations/{MobileTokenOperationAttribute.ts => UserOperationAttribute.ts} (88%) create mode 100644 src/operations/UserOperationProximityCheck.ts create mode 100644 src/operations/UserOperationUIData.ts create mode 100644 src/push/Push.ts diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 76a98f5..39119d1 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -5,19 +5,19 @@ PODS: - ExpoModulesCore - EXConstants (16.0.2): - ExpoModulesCore - - EXNotifications (0.28.15): + - EXNotifications (0.28.18): - ExpoModulesCore - - Expo (51.0.27): + - Expo (51.0.37): - ExpoModulesCore - ExpoAsset (10.0.10): - ExpoModulesCore - ExpoFileSystem (17.0.1): - ExpoModulesCore - - ExpoFont (12.0.9): + - ExpoFont (12.0.10): - ExpoModulesCore - ExpoKeepAwake (13.0.2): - ExpoModulesCore - - ExpoModulesCore (1.12.21): + - ExpoModulesCore (1.12.25): - DoubleConversion - glog - hermes-engine @@ -46,9 +46,9 @@ PODS: - hermes-engine (0.74.5): - hermes-engine/Pre-built (= 0.74.5) - hermes-engine/Pre-built (0.74.5) - - PowerAuth2 (1.7.9): - - PowerAuthCore (~> 1.7.9) - - PowerAuthCore (1.7.9) + - PowerAuth2 (1.7.10): + - PowerAuthCore (~> 1.7.10) + - PowerAuthCore (1.7.10) - RCT-Folly (2024.01.01.00): - boost - DoubleConversion @@ -977,8 +977,8 @@ PODS: - React-Mapbuffer (0.74.5): - glog - React-debug - - react-native-powerauth-mobile-sdk (2.5.1): - - PowerAuth2 (~> 1.7.8) + - react-native-powerauth-mobile-sdk (2.5.3): + - PowerAuth2 (~> 1.7.9) - React-Core - React-nativeconfig (0.74.5) - React-NativeModulesApple (0.74.5): @@ -1422,19 +1422,19 @@ SPEC CHECKSUMS: DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5 EXApplication: c08200c34daca7af7fd76ac4b9d606077410e8ad EXConstants: 409690fbfd5afea964e5e9d6c4eb2c2b59222c59 - EXNotifications: 7d691d3688bd055afd9de36fdf2cffc4d8be3b24 - Expo: b3d76e6e707a0760cd70e7465fff521bbe9e11f6 + EXNotifications: dd289340c26bc5388e440fc90d0b2c661cbd0285 + Expo: 67b60b3b80a3c8e9f3bcaaa84d06d140229a246d ExpoAsset: 323700f291684f110fb55f0d4022a3362ea9f875 ExpoFileSystem: 80bfe850b1f9922c16905822ecbf97acd711dc51 - ExpoFont: e7f2275c10ca8573c991e007329ad6bf98086485 + ExpoFont: 00756e6c796d8f7ee8d211e29c8b619e75cbf238 ExpoKeepAwake: 3b8815d9dd1d419ee474df004021c69fdd316d08 - ExpoModulesCore: ae1a4244021797374769ef44499fc4313d2ac676 + ExpoModulesCore: 0e7d4d5c13169bbbd53496721d811adbcc5d600a FBLazyVector: ac12dc084d1c8ec4cc4d7b3cf1b0ebda6dab85af fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120 glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f hermes-engine: 8c1577f3fdb849cbe7729c2e7b5abc4b845e88f8 - PowerAuth2: 4672bfcab640cec9dd1fa53a9729fcc23867e992 - PowerAuthCore: f228a87fb30f240f49c353fb403010d1d4ff7407 + PowerAuth2: 05cf7055c96681545bc1fd7d73c8b4fc6870188f + PowerAuthCore: f415c1e1cf79d3ec2ed463dd2703ed5fd5cd9c73 RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47 RCTDeprecation: 3afceddffa65aee666dafd6f0116f1d975db1584 RCTRequired: ec1239bc9d8bf63e10fb92bd8b26171a9258e0c1 @@ -1459,7 +1459,7 @@ SPEC CHECKSUMS: React-jsitracing: 3b6060bbf5317663667e1dd93560c7943ab86ccc React-logger: 257858bd55f3a4e1bc0cf07ddc8fb9faba6f8c7c React-Mapbuffer: 6c1cacdbf40b531f549eba249e531a7d0bfd8e7f - react-native-powerauth-mobile-sdk: ff2a4bb2a3baf3e6fd6deaefd36429746043e7b0 + react-native-powerauth-mobile-sdk: f6a8e1a7d26d7833aceaf02aaf26039cf5a8a452 React-nativeconfig: ba9a2e54e2f0882cf7882698825052793ed4c851 React-NativeModulesApple: 8d11ff8955181540585c944cf48e9e7236952697 React-perflogger: ed4e0c65781521e0424f2e5e40b40cc7879d737e diff --git a/example/ios/example.xcodeproj/project.pbxproj b/example/ios/example.xcodeproj/project.pbxproj index ae2c007..5d7c78e 100644 --- a/example/ios/example.xcodeproj/project.pbxproj +++ b/example/ios/example.xcodeproj/project.pbxproj @@ -377,7 +377,10 @@ CURRENT_PROJECT_VERSION = 1; INFOPLIST_FILE = example/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.4; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MARKETING_VERSION = 1.0; OTHER_LDFLAGS = ( "$(inherited)", @@ -453,7 +456,10 @@ LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; @@ -511,7 +517,10 @@ ); LIBRARY_SEARCH_PATHS = "$(SDKROOT)/usr/lib/swift\"$(inherited)\""; MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = "$(inherited) "; + OTHER_LDFLAGS = ( + "$(inherited)", + " ", + ); REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; SDKROOT = iphoneos; USE_HERMES = true; diff --git a/example/src/App.tsx b/example/src/App.tsx index 88669cd..7b1ca57 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -1,7 +1,7 @@ import { useState, useEffect } from 'react'; import * as Notifications from 'expo-notifications'; import { StyleSheet, View, Text, Alert, Button } from 'react-native'; -import { MobileToken, type MobileTokenUserOperation } from 'react-native-mtoken-sdk'; +import { MobileToken, type UserOperation, QROperationParser } from 'react-native-mtoken-sdk'; import { PowerAuth, PowerAuthActivation, PowerAuthAuthentication, type PowerAuthActivationStatus } from 'react-native-powerauth-mobile-sdk'; export default function App() { @@ -39,7 +39,7 @@ export default function App() { await updateStatus() } - mtoken.acceptLanguage = "cs"; + mtoken.setAcceptLanguage("cs"); } const updateStatus = async () => { @@ -69,7 +69,7 @@ export default function App() { }} />