Skip to content

Commit

Permalink
Operation status and definitions fixes (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
kober32 authored Aug 22, 2024
1 parent 7ef9e71 commit 8a84330
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 67 deletions.
4 changes: 2 additions & 2 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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 } from 'react-native-mtoken-sdk';
import { MobileToken, type MobileTokenUserOperation } from 'react-native-mtoken-sdk';
import { PowerAuth, PowerAuthActivation, PowerAuthAuthentication, type PowerAuthActivationStatus } from 'react-native-powerauth-mobile-sdk';

export default function App() {
Expand Down Expand Up @@ -88,7 +88,7 @@ export default function App() {
if (result.responseObject) {
if (result.responseObject[0]) {
let detail = await mtoken.operationDetail(result.responseObject[0].id);
Alert.alert("OperatioDetailMessage", `${detail.responseObject?.operationCreated.toLocaleString()}\n${detail.responseObject?.formData.title}`)
Alert.alert("OperatioDetailMessage", `${detail.responseObject?.operationCreated.toLocaleString()}\n${detail.responseObject?.formData.title}\n${detail.responseObject?.status}`)
} else {
Alert.alert("No operation in the list")
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react-native-mtoken-sdk",
"version": "0.1.0",
"description": "PowerAuth based Mobile Token SDK for React Native",
"source": "./src/index.tsx",
"source": "./src/index.ts",
"main": "./lib/commonjs/index.js",
"module": "./lib/module/index.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx → src/MobileToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export interface MobileTokenResponseError {
}

/** Known PowerAuth server error codes. */
enum KnownRestApiError {
export enum KnownRestApiError {

// COMMON ERRORS

Expand Down
20 changes: 20 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// Copyright 2024 Wultra s.r.o.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions
// and limitations under the License.
//

export * from './MobileToken';
export * from './operations/MobileTokenOperation';
export * from './operations/MobileTokenOperationAttribute';
export * from './operations/MobileTokenUserOperation';
4 changes: 4 additions & 0 deletions src/operations/MobileTokenUserOperation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ import type { MobileTokenOperationAttribute } from "./MobileTokenOperationAttrib
* the real-world operation (for example login or payment).
*/
export interface MobileTokenUserOperation extends MobileTokenOperation {

/** Processing status of the operation */
status: "APPROVED" | "REJECTED" | "PENDING" | "CANCELED" | "EXPIRED" | "FAILED";

/**
* System name of the operation (for example login).
*
Expand Down
13 changes: 1 addition & 12 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,13 @@
"compilerOptions": {
"rootDir": ".",
"paths": {
"react-native-mtoken-sdk": ["./src/index", "./src/operations/*"]
"react-native-mtoken-sdk": [ "./src/index", "./src/MobileToken", "./src/operations/*" ]
},
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react-jsx",
"lib": ["ESNext", "DOM"],
"module": "ESNext",
"moduleResolution": "Bundler",
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"noImplicitReturns": true,
"noImplicitUseStrict": false,
"noStrictGenericChecks": false,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": true,
Expand Down
104 changes: 53 additions & 51 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1997,11 +1997,11 @@ __metadata:
linkType: hard

"@evilmartians/lefthook@npm:^1.5.0":
version: 1.7.12
resolution: "@evilmartians/lefthook@npm:1.7.12"
version: 1.7.14
resolution: "@evilmartians/lefthook@npm:1.7.14"
bin:
lefthook: bin/index.js
checksum: 10/b955537e2d333d9a8f7cc9f8e417ea6db17337e543556ed38fe4afefb15ee301d268df0c25e0ebb3ad31e31c1f31a55e91e8fc75d61198104beb285ed737ce03
checksum: 10/3cfb10411bb8efd4a957aead1db0e365e223f045b4b213fa0ed425f2b9336a83d6c6eefd45516888543b81c196170ad8b6cdf8ba00885fae1706f0a9d90c02d0
conditions: (os=darwin | os=linux | os=win32) & (cpu=x64 | cpu=arm64 | cpu=ia32)
languageName: node
linkType: hard
Expand All @@ -2015,9 +2015,9 @@ __metadata:
languageName: node
linkType: hard

"@expo/cli@npm:0.18.28":
version: 0.18.28
resolution: "@expo/cli@npm:0.18.28"
"@expo/cli@npm:0.18.29":
version: 0.18.29
resolution: "@expo/cli@npm:0.18.29"
dependencies:
"@babel/runtime": "npm:^7.20.0"
"@expo/code-signing-certificates": "npm:0.0.5"
Expand Down Expand Up @@ -2098,7 +2098,7 @@ __metadata:
ws: "npm:^8.12.1"
bin:
expo-internal: build/bin/cli
checksum: 10/d9bb44f75d093c2d0fadb09794f49a146e6e75ccb951a5d2a009d8d0dfaac21b20741feabb1bd48b0b7bf7c6c035162fffd0bd25a37a717dfb911dfaabb1c11d
checksum: 10/8decd9212820a0996489c685d1999fa46ed534bdfdc01f12e27bcb9738525709831e4507ae104e5ab0a91bb36c55abef03d06e236a3a5af2b16e7d04126d77c7
languageName: node
linkType: hard

Expand Down Expand Up @@ -2250,11 +2250,11 @@ __metadata:
linkType: hard

"@expo/metro-runtime@npm:~3.2.1":
version: 3.2.1
resolution: "@expo/metro-runtime@npm:3.2.1"
version: 3.2.3
resolution: "@expo/metro-runtime@npm:3.2.3"
peerDependencies:
react-native: "*"
checksum: 10/faaaa79831f75528ead4e3a2747b1157c56d48c5d968467941aa5770eb0d4380d760faefb9725c2c1dda011e98ad724e9643c67038c73329056ff3b88bc29288
checksum: 10/c798321e05943d3962e9d3b0693af14934e284c8de2de5534989d414c5a1889c96f26f229cd2cd4598d988c9e146c56fb19d9ca5b074518dbdf8110bd45f942a
languageName: node
linkType: hard

Expand Down Expand Up @@ -3723,11 +3723,11 @@ __metadata:
linkType: hard

"@types/node@npm:*":
version: 22.3.0
resolution: "@types/node@npm:22.3.0"
version: 22.4.2
resolution: "@types/node@npm:22.4.2"
dependencies:
undici-types: "npm:~6.18.2"
checksum: 10/c31a798ed722a7417727f018ea6d621db038a613c626da643174cc6f3dcf4ce2fc9933a010aec289103d9564da2c2f9b054c9aa398828f00e17269a78c64d4ec
undici-types: "npm:~6.19.2"
checksum: 10/b166dbf77da448c61e800d5adb3e6b1f6df0677edc5d0f686f7a17cf6a2500eb4966a23112cb37378be3344ce3156aec8cf4918fc49dc8cd401724aaeec74cc0
languageName: node
linkType: hard

Expand All @@ -3739,11 +3739,11 @@ __metadata:
linkType: hard

"@types/node@npm:^18.0.0":
version: 18.19.44
resolution: "@types/node@npm:18.19.44"
version: 18.19.45
resolution: "@types/node@npm:18.19.45"
dependencies:
undici-types: "npm:~5.26.4"
checksum: 10/d64649e6d2fe68600c99fa3a9ca02099c2ce83680acb5303fdff4fab5fd86ecdd366658facdd447ccd6418af600785089336b5a38caa8b8ee3997926ed3c58a1
checksum: 10/978fdd68af65c8f8659037ef09456d41ef46a5f688c3b9550cd59266db2c4ac94e65ed7f08d1871ba909e5b7bdf4e8066c5269715a7dd83333aca34dfa6366db
languageName: node
linkType: hard

Expand All @@ -3762,12 +3762,12 @@ __metadata:
linkType: hard

"@types/react@npm:^18.2.44":
version: 18.3.3
resolution: "@types/react@npm:18.3.3"
version: 18.3.4
resolution: "@types/react@npm:18.3.4"
dependencies:
"@types/prop-types": "npm:*"
csstype: "npm:^3.0.2"
checksum: 10/68e203b7f1f91d6cf21f33fc7af9d6d228035a26c83f514981e54aa3da695d0ec6af10c277c6336de1dd76c4adbe9563f3a21f80c4462000f41e5f370b46e96c
checksum: 10/359973924be42cf9e7366e1d885b28e0b3bd56d31f24458c5351af7a3f2fc070511e90d517b2195fb229146cdcb70342db6318e279c31dd5057beec1105b704e
languageName: node
linkType: hard

Expand Down Expand Up @@ -5713,11 +5713,11 @@ __metadata:
linkType: hard

"core-js-compat@npm:^3.37.1, core-js-compat@npm:^3.38.0":
version: 3.38.0
resolution: "core-js-compat@npm:3.38.0"
version: 3.38.1
resolution: "core-js-compat@npm:3.38.1"
dependencies:
browserslist: "npm:^4.23.3"
checksum: 10/7ebdca6b305c9c470980e1f7e7a3d759add7cb754bff62926242907ee4d1d4e8bb13f70eb9a7d7769e0f63aec3f4cca83abf60f502286853b45d4b63a01c25ed
checksum: 10/4e2f219354fd268895f79486461a12df96f24ed307321482fe2a43529c5a64e7c16bcba654980ba217d603444f5141d43a79058aeac77511085f065c5da72207
languageName: node
linkType: hard

Expand Down Expand Up @@ -5970,9 +5970,9 @@ __metadata:
linkType: hard

"dayjs@npm:^1.8.15":
version: 1.11.12
resolution: "dayjs@npm:1.11.12"
checksum: 10/8ee7c1e14961fd08d40b788d0c0e930dc6288b3d32911bb911b2fb31bb703c262788164fbe678ee9e50e2a35268d667b8c8ba43fd1806771c1f404c300a2b428
version: 1.11.13
resolution: "dayjs@npm:1.11.13"
checksum: 10/7374d63ab179b8d909a95e74790def25c8986e329ae989840bacb8b1888be116d20e1c4eee75a69ea0dfbae13172efc50ef85619d304ee7ca3c01d5878b704f5
languageName: node
linkType: hard

Expand Down Expand Up @@ -6361,9 +6361,9 @@ __metadata:
linkType: hard

"electron-to-chromium@npm:^1.5.4":
version: 1.5.7
resolution: "electron-to-chromium@npm:1.5.7"
checksum: 10/987d3e56c3edcfa0b85e0b38590c777cce4f69436845f4eec88c6d58640143b43a0a0a27dd3923122c56ab9e527b9c3a0a9337312c6365522106353c3ac98fa7
version: 1.5.13
resolution: "electron-to-chromium@npm:1.5.13"
checksum: 10/b3de6dbca66e399eacd4f7e2b7603394c8949c9e724d838a45e092725005ff435aabfbf00f738e45451eb23147684f7f9251a5ed75619a539642b2bccea20b45
languageName: node
linkType: hard

Expand Down Expand Up @@ -7185,18 +7185,20 @@ __metadata:
languageName: node
linkType: hard

"expo-modules-autolinking@npm:1.11.1":
version: 1.11.1
resolution: "expo-modules-autolinking@npm:1.11.1"
"expo-modules-autolinking@npm:1.11.2":
version: 1.11.2
resolution: "expo-modules-autolinking@npm:1.11.2"
dependencies:
chalk: "npm:^4.1.0"
commander: "npm:^7.2.0"
fast-glob: "npm:^3.2.5"
find-up: "npm:^5.0.0"
fs-extra: "npm:^9.1.0"
require-from-string: "npm:^2.0.2"
resolve-from: "npm:^5.0.0"
bin:
expo-modules-autolinking: bin/expo-modules-autolinking.js
checksum: 10/4261b57f79964bc9ed5521dac67cf94e0248d40c3cd9501d0e0b84bd04f949e5bf30e08f1849a873bfa052aed10dd08dac9c6c48130a7e0eceac646c6de84fbc
checksum: 10/7b61bc08e794b2677f9f38bff950abd7133136fe5967900b2373b5f4434c71514029ec80839455f6c4abda3ceab7ecd2d234bb8bfe86c50a5262bca91c7c04b1
languageName: node
linkType: hard

Expand All @@ -7210,8 +7212,8 @@ __metadata:
linkType: hard

"expo-notifications@npm:^0.28.15":
version: 0.28.15
resolution: "expo-notifications@npm:0.28.15"
version: 0.28.16
resolution: "expo-notifications@npm:0.28.16"
dependencies:
"@expo/image-utils": "npm:^0.5.0"
"@ide/backoff": "npm:^1.0.0"
Expand All @@ -7223,7 +7225,7 @@ __metadata:
fs-extra: "npm:^9.1.0"
peerDependencies:
expo: "*"
checksum: 10/a794027c97c32dc6d5587da011f6787f27b87bf67684706f0a629632a9cb08cce17142526acd08b07d170e5e02bca54934440804544eb5afdb0868ae3030c2a4
checksum: 10/3dc7853b0b79fb817ad863a2f31cd69a7c512101201d21672e6a16f0c7a70d181e09e986fa8ba364ff99dfb8f9951ce84b0d9def88e4ec53f4120c17f2cee7bc
languageName: node
linkType: hard

Expand All @@ -7235,11 +7237,11 @@ __metadata:
linkType: hard

"expo@npm:~51.0.26":
version: 51.0.27
resolution: "expo@npm:51.0.27"
version: 51.0.29
resolution: "expo@npm:51.0.29"
dependencies:
"@babel/runtime": "npm:^7.20.0"
"@expo/cli": "npm:0.18.28"
"@expo/cli": "npm:0.18.29"
"@expo/config": "npm:9.0.3"
"@expo/config-plugins": "npm:8.0.8"
"@expo/metro-config": "npm:0.18.11"
Expand All @@ -7249,13 +7251,13 @@ __metadata:
expo-file-system: "npm:~17.0.1"
expo-font: "npm:~12.0.9"
expo-keep-awake: "npm:~13.0.2"
expo-modules-autolinking: "npm:1.11.1"
expo-modules-autolinking: "npm:1.11.2"
expo-modules-core: "npm:1.12.21"
fbemitter: "npm:^3.0.0"
whatwg-url-without-unicode: "npm:8.0.0-3"
bin:
expo: bin/cli
checksum: 10/50763c49af95e1e0b8e61e9c3b42fc1a09a52c89bc53e62af7b8d717b9114fbab24a417bccd5a029a30e8e84edcc0499c4453b2171cc1f33f5bdaa297ebf2ca0
checksum: 10/45d34dbe57a36aa2b424b33d4834d7c4e83264a47f74c9f9f84f1b0ed4fd85815925b78f7576fc01f44b1b0aa0f9e20bcfe86e3ad1814a44ca346a8471ca5355
languageName: node
linkType: hard

Expand Down Expand Up @@ -7546,9 +7548,9 @@ __metadata:
linkType: hard

"flow-parser@npm:0.*":
version: 0.243.0
resolution: "flow-parser@npm:0.243.0"
checksum: 10/234feab9b77ad6d6f1962100e85276448592b70df623ab6f21cb3f0630fd3a0ca52918da31e241e2295e11f5c2e7fa25a0ec9b1b8f263e4e19f6e8529ef59e8e
version: 0.244.0
resolution: "flow-parser@npm:0.244.0"
checksum: 10/77b4b38f461c561c43cee2c7c81b6adc5a21c42a6da6e071ab566d8b68d8ff8f2e958217e73e005aa30ae28bffa9c268e386f6c7a7a568b6ff0f6e06f416e6d9
languageName: node
linkType: hard

Expand Down Expand Up @@ -13818,9 +13820,9 @@ __metadata:
linkType: hard

"spdx-license-ids@npm:^3.0.0":
version: 3.0.18
resolution: "spdx-license-ids@npm:3.0.18"
checksum: 10/45fdbb50c4bbe364720ef0acd19f4fc1914d73ba1e2b1ce9db21ee12d7f9e8bf14336289f6ad3d5acac3dc5b91aafe61e9c652d5806b31cbb8518a14979a16ff
version: 3.0.20
resolution: "spdx-license-ids@npm:3.0.20"
checksum: 10/30e566ea74b04232c64819d1f5313c00d92e9c73d054541650331fc794499b3bcc4991bcd90fa3c2fc4d040006f58f63104706255266e87a9d452e6574afc60c
languageName: node
linkType: hard

Expand Down Expand Up @@ -14806,10 +14808,10 @@ __metadata:
languageName: node
linkType: hard

"undici-types@npm:~6.18.2":
version: 6.18.2
resolution: "undici-types@npm:6.18.2"
checksum: 10/5c863f3cc65d012498cf0f8562b9d81e785c2b8b8a8d66343b9f4351ff40a3a29b500fbaea10667626fd91a32433d4c876810aafa5ab561369de702b62d4b323
"undici-types@npm:~6.19.2":
version: 6.19.8
resolution: "undici-types@npm:6.19.8"
checksum: 10/cf0b48ed4fc99baf56584afa91aaffa5010c268b8842f62e02f752df209e3dea138b372a60a963b3b2576ed932f32329ce7ddb9cb5f27a6c83040d8cd74b7a70
languageName: node
linkType: hard

Expand Down

0 comments on commit 8a84330

Please sign in to comment.