Skip to content

Commit

Permalink
Upgrading async storage to new version
Browse files Browse the repository at this point in the history
  • Loading branch information
mvehar committed Sep 26, 2021
1 parent b78a2a0 commit a335e30
Show file tree
Hide file tree
Showing 19 changed files with 86 additions and 46 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ yarn add @haskkor/react-native-pincode
Async storage uses the [react-native-async-storage](https://github.com/react-native-community/react-native-async-storage) library which has to be linked

```
react-native link @react-native-community/async-storage
react-native link @react-native-async-storage/async-storage
```

If you wish to use the `TouchID/FaceID` authentication you will have to link the [library](https://github.com/naoufal/react-native-touch-id):
Expand Down
11 changes: 6 additions & 5 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="react" />
import { PinResultStatus } from "./src/utils";
import * as React from "react";
import { StyleProp, ViewStyle, TextStyle } from "react-native";
Expand Down Expand Up @@ -117,10 +118,10 @@ declare class PINCode extends React.PureComponent<IProps, IState> {
static defaultProps: Partial<IProps>;
constructor(props: IProps);
changeInternalStatus: (status: PinResultStatus) => void;
renderLockedPage: () => any;
render(): any;
renderLockedPage: () => JSX.Element;
render(): JSX.Element;
}
export declare function hasUserSetPinCode(serviceName?: string): Promise<any>;
export declare function deleteUserPinCode(serviceName?: string): Promise<any>;
export declare function resetPinCodeInternalStates(pinAttempsStorageName?: string, timePinLockedStorageName?: string): Promise<any>;
export declare function hasUserSetPinCode(serviceName?: string): Promise<boolean>;
export declare function deleteUserPinCode(serviceName?: string): Promise<void>;
export declare function resetPinCodeInternalStates(pinAttempsStorageName?: string, timePinLockedStorageName?: string): Promise<void>;
export default PINCode;
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions dist/src/ApplicationLocked.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="react" />
import { PinResultStatus } from "./utils";
import * as React from "react";
export declare type IProps = {
Expand Down Expand Up @@ -40,11 +41,11 @@ declare class ApplicationLocked extends React.PureComponent<IProps, IState> {
componentDidMount(): void;
timer(): Promise<void>;
componentWillUnmount(): void;
renderButton: () => any;
renderTimer: (minutes: number, seconds: number) => any;
renderTitle: () => any;
renderIcon: () => any;
renderErrorLocked: () => any;
render(): any;
renderButton: () => JSX.Element;
renderTimer: (minutes: number, seconds: number) => JSX.Element;
renderTitle: () => JSX.Element;
renderIcon: () => JSX.Element;
renderErrorLocked: () => JSX.Element;
render(): JSX.Element;
}
export default ApplicationLocked;
2 changes: 1 addition & 1 deletion dist/src/ApplicationLocked.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const colors_1 = require("./design/colors");
const grid_1 = require("./design/grid");
const delay_1 = require("./delay");
const utils_1 = require("./utils");
const async_storage_1 = require("@react-native-community/async-storage");
const async_storage_1 = require("@react-native-async-storage/async-storage");
const d3_ease_1 = require("d3-ease");
const React = require("react");
const Animate_1 = require("react-move/Animate");
Expand Down
15 changes: 8 additions & 7 deletions dist/src/PinCode.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="react" />
import * as React from "react";
import { StyleProp, TextStyle, ViewStyle } from "react-native";
/**
Expand Down Expand Up @@ -81,7 +82,7 @@ export interface IState {
export declare enum PinStatus {
choose = "choose",
confirm = "confirm",
enter = "enter"
enter = "enter",
}
declare class PinCode extends React.PureComponent<IProps, IState> {
static defaultProps: Partial<IProps>;
Expand All @@ -93,14 +94,14 @@ declare class PinCode extends React.PureComponent<IProps, IState> {
failedAttempt: () => Promise<void>;
newAttempt: () => Promise<void>;
onPressButtonNumber: (text: string) => Promise<void>;
renderButtonNumber: (text: string) => any;
renderButtonNumber: (text: string) => JSX.Element;
endProcess: (pwd: string) => void;
doShake(): Promise<void>;
showError(isErrorValidation?: boolean): Promise<void>;
renderCirclePassword: () => any;
renderButtonDelete: (opacity: number) => any;
renderTitle: (colorTitle: string, opacityTitle: number, attemptFailed?: boolean, showError?: boolean) => any;
renderSubtitle: (colorTitle: string, opacityTitle: number, attemptFailed?: boolean, showError?: boolean) => any;
render(): any;
renderCirclePassword: () => JSX.Element;
renderButtonDelete: (opacity: number) => JSX.Element;
renderTitle: (colorTitle: string, opacityTitle: number, attemptFailed?: boolean, showError?: boolean) => JSX.Element;
renderSubtitle: (colorTitle: string, opacityTitle: number, attemptFailed?: boolean, showError?: boolean) => JSX.Element;
render(): JSX.Element;
}
export default PinCode;
3 changes: 2 additions & 1 deletion dist/src/PinCodeChoose.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="react" />
import { PinStatus } from './PinCode';
import * as React from 'react';
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
Expand Down Expand Up @@ -77,6 +78,6 @@ declare class PinCodeChoose extends React.PureComponent<IProps, IState> {
endProcessCreation: (pinCode: string, isErrorValidation?: boolean) => void;
endProcessConfirm: (pinCode: string) => Promise<void>;
cancelConfirm: () => void;
render(): any;
render(): JSX.Element;
}
export default PinCodeChoose;
3 changes: 2 additions & 1 deletion dist/src/PinCodeEnter.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="react" />
import { PinStatus } from './PinCode';
import { PinResultStatus } from './utils';
import * as React from 'react';
Expand Down Expand Up @@ -96,6 +97,6 @@ declare class PinCodeEnter extends React.PureComponent<IProps, IState> {
triggerTouchID(): void;
endProcess: (pinCode?: string) => Promise<void>;
launchTouchID(): Promise<void>;
render(): any;
render(): JSX.Element;
}
export default PinCodeEnter;
2 changes: 1 addition & 1 deletion dist/src/PinCodeEnter.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
const delay_1 = require("./delay");
const PinCode_1 = require("./PinCode");
const utils_1 = require("./utils");
const async_storage_1 = require("@react-native-community/async-storage");
const async_storage_1 = require("@react-native-async-storage/async-storage");
const React = require("react");
const react_native_1 = require("react-native");
const Keychain = require("react-native-keychain");
Expand Down
2 changes: 1 addition & 1 deletion dist/src/delay.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
declare const delay: (ms: number) => Promise<unknown>;
declare const delay: (ms: number) => Promise<{}>;
export default delay;
15 changes: 10 additions & 5 deletions dist/src/utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import * as Keychain from 'react-native-keychain';
export declare enum PinResultStatus {
initial = "initial",
success = "success",
failure = "failure",
locked = "locked"
locked = "locked",
}
export declare const hasPinCode: (serviceName: string) => Promise<any>;
export declare const deletePinCode: (serviceName: string) => Promise<any>;
export declare const resetInternalStates: (asyncStorageKeys: string[]) => Promise<any>;
export declare const noBiometricsConfig: any;
export declare const hasPinCode: (serviceName: string) => Promise<boolean>;
export declare const deletePinCode: (serviceName: string) => Promise<void>;
export declare const resetInternalStates: (asyncStorageKeys: string[]) => Promise<void>;
export declare const noBiometricsConfig: {
accessControl: Keychain.ACCESS_CONTROL;
} | {
accessControl?: undefined;
};
2 changes: 1 addition & 1 deletion dist/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const react_native_1 = require("react-native");
const async_storage_1 = require("@react-native-community/async-storage");
const async_storage_1 = require("@react-native-async-storage/async-storage");
const Keychain = require("react-native-keychain");
var PinResultStatus;
(function (PinResultStatus) {
Expand Down
2 changes: 1 addition & 1 deletion index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import PinCodeChoose from "./src/PinCodeChoose";
import PinCodeEnter from "./src/PinCodeEnter";
import { hasPinCode, deletePinCode, resetInternalStates, PinResultStatus } from "./src/utils";

import AsyncStorage from '@react-native-community/async-storage'
import AsyncStorage from '@react-native-async-storage/async-storage'
import * as React from "react";
import { View, StyleSheet, StyleProp, ViewStyle, TextStyle } from "react-native";

Expand Down
26 changes: 21 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@haskkor/react-native-pincode",
"version": "1.22.6",
"version": "1.23.0",
"description": "React native PIN code component",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -45,7 +45,7 @@
"typescript": "^2.7.2"
},
"dependencies": {
"@react-native-community/async-storage": "^1.7.1",
"@react-native-async-storage/async-storage": "^1.15.8",
"d3-ease": "^1.0.3",
"lodash": "^4.17.5",
"react-move": "^2.7.0",
Expand Down
2 changes: 1 addition & 1 deletion src/ApplicationLocked.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { grid } from "./design/grid";
import delay from "./delay";
import { PinResultStatus } from "./utils";

import AsyncStorage from "@react-native-community/async-storage";
import AsyncStorage from "@react-native-async-storage/async-storage";
import { easeLinear } from "d3-ease";
import * as React from "react";
import Animate from "react-move/Animate";
Expand Down
2 changes: 1 addition & 1 deletion src/PinCodeEnter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import delay from './delay'
import PinCode, { PinStatus } from './PinCode'
import { PinResultStatus, noBiometricsConfig } from './utils'

import AsyncStorage from '@react-native-community/async-storage'
import AsyncStorage from '@react-native-async-storage/async-storage'
import * as React from 'react'
import {
StyleProp,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Platform } from 'react-native'
import AsyncStorage from '@react-native-community/async-storage'
import AsyncStorage from '@react-native-async-storage/async-storage'
import * as Keychain from 'react-native-keychain'

export enum PinResultStatus {
Expand Down
22 changes: 18 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,12 @@
lodash "^4.17.5"
to-fast-properties "^2.0.0"

"@react-native-community/async-storage@^1.7.1":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@react-native-community/async-storage/-/async-storage-1.7.1.tgz#ef2104d865de61ad91bba66613e57e689ff4e6a1"
integrity sha512-/oX/x+EU4xNaqIaC/epVKzO8XghzImPA7l8cLz3USEFmtFiXFjBbTeeIFjjEm/u4/cv38Wi1xMEa10PHIWygRg==
"@react-native-async-storage/async-storage@^1.15.8":
version "1.15.8"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.15.8.tgz#c2263646b7261803125b555cf1bbd48b72dedafc"
integrity sha512-SIpsnmUt2Af8f/In7wu/HMeIiWBx9+T14GL4VrwtZv8+RceMejPtOwRMP8kc6xifkgg0gxwwHJ5+pEG/cEt1Mw==
dependencies:
merge-options "^3.0.4"

"@types/d3-ease@^1.0.7":
version "1.0.7"
Expand Down Expand Up @@ -3071,6 +3073,11 @@ is-odd@^2.0.0:
dependencies:
is-number "^4.0.0"

is-plain-obj@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==

is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
Expand Down Expand Up @@ -3989,6 +3996,13 @@ mem@^1.1.0:
dependencies:
mimic-fn "^1.0.0"

merge-options@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/merge-options/-/merge-options-3.0.4.tgz#84709c2aa2a4b24c1981f66c179fe5565cc6dbb7"
integrity sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==
dependencies:
is-plain-obj "^2.1.0"

merge-stream@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-1.0.1.tgz#4041202d508a342ba00174008df0c251b8c135e1"
Expand Down

0 comments on commit a335e30

Please sign in to comment.