This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

View File

@ -0,0 +1,2 @@
declare const _default: import("@unimodules/core").ProxyNativeModule;
export default _default;

View File

@ -0,0 +1,3 @@
import { NativeModulesProxy } from '@unimodules/core';
export default NativeModulesProxy.ExpoSecureStore || {};
//# sourceMappingURL=ExpoSecureStore.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ExpoSecureStore.js","sourceRoot":"","sources":["../src/ExpoSecureStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,eAAe,kBAAkB,CAAC,eAAe,IAAI,EAAE,CAAC","sourcesContent":["import { NativeModulesProxy } from '@unimodules/core';\nexport default NativeModulesProxy.ExpoSecureStore || {};\n"]}

View File

@ -0,0 +1,4 @@
declare const _default: {
readonly name: string;
};
export default _default;

View File

@ -0,0 +1,6 @@
export default {
get name() {
return 'ExpoSecureStore';
},
};
//# sourceMappingURL=ExpoSecureStore.web.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"ExpoSecureStore.web.js","sourceRoot":"","sources":["../src/ExpoSecureStore.web.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,IAAI;QACN,OAAO,iBAAiB,CAAC;IAC3B,CAAC;CACF,CAAC","sourcesContent":["export default {\n get name(): string {\n return 'ExpoSecureStore';\n },\n};\n"]}

21
node_modules/expo-secure-store/build/SecureStore.d.ts generated vendored Normal file
View File

@ -0,0 +1,21 @@
export declare type KeychainAccessibilityConstant = number;
export declare const AFTER_FIRST_UNLOCK: KeychainAccessibilityConstant;
export declare const AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY: KeychainAccessibilityConstant;
export declare const ALWAYS: KeychainAccessibilityConstant;
export declare const WHEN_PASSCODE_SET_THIS_DEVICE_ONLY: KeychainAccessibilityConstant;
export declare const ALWAYS_THIS_DEVICE_ONLY: KeychainAccessibilityConstant;
export declare const WHEN_UNLOCKED: KeychainAccessibilityConstant;
export declare const WHEN_UNLOCKED_THIS_DEVICE_ONLY: KeychainAccessibilityConstant;
export declare type SecureStoreOptions = {
keychainService?: string;
keychainAccessible?: KeychainAccessibilityConstant;
};
/**
* Returns whether the SecureStore API is enabled on the current device. This does not check the app permissions.
*
* @returns Async `boolean`, indicating whether the SecureStore API is available on the current device. Currently this resolves `true` on iOS and Android only.
*/
export declare function isAvailableAsync(): Promise<boolean>;
export declare function deleteItemAsync(key: string, options?: SecureStoreOptions): Promise<void>;
export declare function getItemAsync(key: string, options?: SecureStoreOptions): Promise<string | null>;
export declare function setItemAsync(key: string, value: string, options?: SecureStoreOptions): Promise<void>;

77
node_modules/expo-secure-store/build/SecureStore.js generated vendored Normal file
View File

@ -0,0 +1,77 @@
import { UnavailabilityError } from '@unimodules/core';
import ExpoSecureStore from './ExpoSecureStore';
export const AFTER_FIRST_UNLOCK = ExpoSecureStore.AFTER_FIRST_UNLOCK;
export const AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY = ExpoSecureStore.AFTER_FIRST_UNLOCK_THIS_DEVICE_ONLY;
export const ALWAYS = ExpoSecureStore.ALWAYS;
export const WHEN_PASSCODE_SET_THIS_DEVICE_ONLY = ExpoSecureStore.WHEN_PASSCODE_SET_THIS_DEVICE_ONLY;
export const ALWAYS_THIS_DEVICE_ONLY = ExpoSecureStore.ALWAYS_THIS_DEVICE_ONLY;
export const WHEN_UNLOCKED = ExpoSecureStore.WHEN_UNLOCKED;
export const WHEN_UNLOCKED_THIS_DEVICE_ONLY = ExpoSecureStore.WHEN_UNLOCKED_THIS_DEVICE_ONLY;
const VALUE_BYTES_LIMIT = 2048;
/**
* Returns whether the SecureStore API is enabled on the current device. This does not check the app permissions.
*
* @returns Async `boolean`, indicating whether the SecureStore API is available on the current device. Currently this resolves `true` on iOS and Android only.
*/
export async function isAvailableAsync() {
return !!ExpoSecureStore.getValueWithKeyAsync;
}
export async function deleteItemAsync(key, options = {}) {
_ensureValidKey(key);
if (!ExpoSecureStore.deleteValueWithKeyAsync) {
throw new UnavailabilityError('SecureStore', 'deleteItemAsync');
}
await ExpoSecureStore.deleteValueWithKeyAsync(key, options);
}
export async function getItemAsync(key, options = {}) {
_ensureValidKey(key);
return await ExpoSecureStore.getValueWithKeyAsync(key, options);
}
export async function setItemAsync(key, value, options = {}) {
_ensureValidKey(key);
if (!_isValidValue(value)) {
throw new Error(`Invalid value provided to SecureStore. Values must be strings; consider JSON-encoding your values if they are serializable.`);
}
if (!ExpoSecureStore.setValueWithKeyAsync) {
throw new UnavailabilityError('SecureStore', 'setItemAsync');
}
await ExpoSecureStore.setValueWithKeyAsync(value, key, options);
}
function _ensureValidKey(key) {
if (!_isValidKey(key)) {
throw new Error(`Invalid key provided to SecureStore. Keys must not be empty and contain only alphanumeric characters, ".", "-", and "_".`);
}
}
function _isValidKey(key) {
return typeof key === 'string' && /^[\w.-]+$/.test(key);
}
function _isValidValue(value) {
if (typeof value !== 'string') {
return false;
}
if (_byteCount(value) > VALUE_BYTES_LIMIT) {
console.warn('Provided value to SecureStore is larger than 2048 bytes. An attempt to store such a value will throw an error in SDK 35.');
}
return true;
}
// copy-pasted from https://stackoverflow.com/a/39488643
function _byteCount(value) {
let bytes = 0;
for (let i = 0; i < value.length; i++) {
const codePoint = value.charCodeAt(i);
// Lone surrogates cannot be passed to encodeURI
if (codePoint >= 0xd800 && codePoint < 0xe000) {
if (codePoint < 0xdc00 && i + 1 < value.length) {
const next = value.charCodeAt(i + 1);
if (next >= 0xdc00 && next < 0xe000) {
bytes += 4;
i++;
continue;
}
}
}
bytes += codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : 3;
}
return bytes;
}
//# sourceMappingURL=SecureStore.js.map

File diff suppressed because one or more lines are too long