@aws-amplify/react-native 0.0.0-changesets-preid-f620002-20260129130740
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AmplifyRTNCore.podspec +41 -0
- package/README.md +3 -0
- package/android/build.gradle +103 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +5 -0
- package/android/gradlew +234 -0
- package/android/gradlew.bat +89 -0
- package/android/src/hasPackageName/AndroidManifest.xml +4 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/AmplifyRTNCoreModule.kt +43 -0
- package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/AmplifyRTNCorePackage.kt +17 -0
- package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/BigInteger.kt +65 -0
- package/dist/cjs/apis/computeModPow.js +10 -0
- package/dist/cjs/apis/computeModPow.js.map +1 -0
- package/dist/cjs/apis/computeS.js +10 -0
- package/dist/cjs/apis/computeS.js.map +1 -0
- package/dist/cjs/apis/getDeviceName.js +10 -0
- package/dist/cjs/apis/getDeviceName.js.map +1 -0
- package/dist/cjs/apis/getIsNativeError.js +13 -0
- package/dist/cjs/apis/getIsNativeError.js.map +1 -0
- package/dist/cjs/apis/getOperatingSystem.js +10 -0
- package/dist/cjs/apis/getOperatingSystem.js.map +1 -0
- package/dist/cjs/apis/index.js +17 -0
- package/dist/cjs/apis/index.js.map +1 -0
- package/dist/cjs/index.js +24 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/moduleLoaders/index.js +27 -0
- package/dist/cjs/moduleLoaders/index.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadAmplifyPushNotification.js +26 -0
- package/dist/cjs/moduleLoaders/loadAmplifyPushNotification.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadAmplifyRtnPasskeys.js +26 -0
- package/dist/cjs/moduleLoaders/loadAmplifyRtnPasskeys.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadAmplifyWebBrowser.js +26 -0
- package/dist/cjs/moduleLoaders/loadAmplifyWebBrowser.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadAppState.js +10 -0
- package/dist/cjs/moduleLoaders/loadAppState.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadAsyncStorage.js +27 -0
- package/dist/cjs/moduleLoaders/loadAsyncStorage.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadBase64.js +10 -0
- package/dist/cjs/moduleLoaders/loadBase64.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadBuffer.js +10 -0
- package/dist/cjs/moduleLoaders/loadBuffer.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadGetRandomValues.js +22 -0
- package/dist/cjs/moduleLoaders/loadGetRandomValues.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadNetInfo.js +27 -0
- package/dist/cjs/moduleLoaders/loadNetInfo.js.map +1 -0
- package/dist/cjs/moduleLoaders/loadUrlPolyfill.js +22 -0
- package/dist/cjs/moduleLoaders/loadUrlPolyfill.js.map +1 -0
- package/dist/cjs/nativeModule.js +19 -0
- package/dist/cjs/nativeModule.js.map +1 -0
- package/dist/cjs/types.js +6 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/esm/apis/computeModPow.d.ts +2 -0
- package/dist/esm/apis/computeModPow.mjs +8 -0
- package/dist/esm/apis/computeModPow.mjs.map +1 -0
- package/dist/esm/apis/computeS.d.ts +2 -0
- package/dist/esm/apis/computeS.mjs +8 -0
- package/dist/esm/apis/computeS.mjs.map +1 -0
- package/dist/esm/apis/getDeviceName.d.ts +2 -0
- package/dist/esm/apis/getDeviceName.mjs +8 -0
- package/dist/esm/apis/getDeviceName.mjs.map +1 -0
- package/dist/esm/apis/getIsNativeError.d.ts +9 -0
- package/dist/esm/apis/getIsNativeError.mjs +10 -0
- package/dist/esm/apis/getIsNativeError.mjs.map +1 -0
- package/dist/esm/apis/getOperatingSystem.d.ts +1 -0
- package/dist/esm/apis/getOperatingSystem.mjs +8 -0
- package/dist/esm/apis/getOperatingSystem.mjs.map +1 -0
- package/dist/esm/apis/index.d.ts +5 -0
- package/dist/esm/apis/index.mjs +6 -0
- package/dist/esm/apis/index.mjs.map +1 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.mjs +16 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/moduleLoaders/index.d.ts +10 -0
- package/dist/esm/moduleLoaders/index.mjs +11 -0
- package/dist/esm/moduleLoaders/index.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadAmplifyPushNotification.d.ts +21 -0
- package/dist/esm/moduleLoaders/loadAmplifyPushNotification.mjs +23 -0
- package/dist/esm/moduleLoaders/loadAmplifyPushNotification.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadAmplifyRtnPasskeys.d.ts +1 -0
- package/dist/esm/moduleLoaders/loadAmplifyRtnPasskeys.mjs +23 -0
- package/dist/esm/moduleLoaders/loadAmplifyRtnPasskeys.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadAmplifyWebBrowser.d.ts +3 -0
- package/dist/esm/moduleLoaders/loadAmplifyWebBrowser.mjs +23 -0
- package/dist/esm/moduleLoaders/loadAmplifyWebBrowser.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadAppState.d.ts +1 -0
- package/dist/esm/moduleLoaders/loadAppState.mjs +8 -0
- package/dist/esm/moduleLoaders/loadAppState.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadAsyncStorage.d.ts +2 -0
- package/dist/esm/moduleLoaders/loadAsyncStorage.mjs +24 -0
- package/dist/esm/moduleLoaders/loadAsyncStorage.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadBase64.d.ts +5 -0
- package/dist/esm/moduleLoaders/loadBase64.mjs +8 -0
- package/dist/esm/moduleLoaders/loadBase64.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadBuffer.d.ts +21 -0
- package/dist/esm/moduleLoaders/loadBuffer.mjs +8 -0
- package/dist/esm/moduleLoaders/loadBuffer.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadGetRandomValues.d.ts +1 -0
- package/dist/esm/moduleLoaders/loadGetRandomValues.mjs +19 -0
- package/dist/esm/moduleLoaders/loadGetRandomValues.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadNetInfo.d.ts +4 -0
- package/dist/esm/moduleLoaders/loadNetInfo.mjs +24 -0
- package/dist/esm/moduleLoaders/loadNetInfo.mjs.map +1 -0
- package/dist/esm/moduleLoaders/loadUrlPolyfill.d.ts +1 -0
- package/dist/esm/moduleLoaders/loadUrlPolyfill.mjs +19 -0
- package/dist/esm/moduleLoaders/loadUrlPolyfill.mjs.map +1 -0
- package/dist/esm/nativeModule.d.ts +2 -0
- package/dist/esm/nativeModule.mjs +18 -0
- package/dist/esm/nativeModule.mjs.map +1 -0
- package/dist/esm/types.d.ts +16 -0
- package/dist/esm/types.mjs +2 -0
- package/dist/esm/types.mjs.map +1 -0
- package/ios/AmplifyRTNCore-Bridging-Header.h +5 -0
- package/ios/AmplifyRTNCore.mm +24 -0
- package/ios/AmplifyRTNCore.swift +45 -0
- package/ios/AmplifyRTNCore.xcodeproj/project.pbxproj +283 -0
- package/ios/AmplifyRTNCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/BigInteger.swift +78 -0
- package/ios/JKBigInteger/JKBigDecimal.h +40 -0
- package/ios/JKBigInteger/JKBigDecimal.m +224 -0
- package/ios/JKBigInteger/JKBigInteger.h +58 -0
- package/ios/JKBigInteger/JKBigInteger.m +419 -0
- package/ios/JKBigInteger/LICENSE.txt +18 -0
- package/ios/JKBigInteger/LibTomMath/tommath.c +6925 -0
- package/ios/JKBigInteger/LibTomMath/tommath.h +584 -0
- package/ios/JKBigInteger/LibTomMath/tommath_class.h +999 -0
- package/ios/JKBigInteger/LibTomMath/tommath_superclass.h +76 -0
- package/package.json +73 -0
- package/src/apis/computeModPow.ts +8 -0
- package/src/apis/computeS.ts +8 -0
- package/src/apis/getDeviceName.ts +8 -0
- package/src/apis/getIsNativeError.ts +18 -0
- package/src/apis/getOperatingSystem.ts +6 -0
- package/src/apis/index.ts +8 -0
- package/src/index.ts +22 -0
- package/src/moduleLoaders/index.ts +13 -0
- package/src/moduleLoaders/loadAmplifyPushNotification.ts +28 -0
- package/src/moduleLoaders/loadAmplifyRtnPasskeys.ts +28 -0
- package/src/moduleLoaders/loadAmplifyWebBrowser.ts +28 -0
- package/src/moduleLoaders/loadAppState.ts +6 -0
- package/src/moduleLoaders/loadAsyncStorage.ts +29 -0
- package/src/moduleLoaders/loadBase64.ts +6 -0
- package/src/moduleLoaders/loadBuffer.ts +6 -0
- package/src/moduleLoaders/loadGetRandomValues.ts +19 -0
- package/src/moduleLoaders/loadNetInfo.ts +31 -0
- package/src/moduleLoaders/loadUrlPolyfill.ts +19 -0
- package/src/nativeModule.ts +23 -0
- package/src/types.ts +21 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { computeModPow } from './apis/computeModPow.mjs';
|
|
2
|
+
export { computeS } from './apis/computeS.mjs';
|
|
3
|
+
export { getOperatingSystem } from './apis/getOperatingSystem.mjs';
|
|
4
|
+
export { getDeviceName } from './apis/getDeviceName.mjs';
|
|
5
|
+
export { getIsNativeError } from './apis/getIsNativeError.mjs';
|
|
6
|
+
export { loadAmplifyRtnPasskeys } from './moduleLoaders/loadAmplifyRtnPasskeys.mjs';
|
|
7
|
+
export { loadAmplifyPushNotification } from './moduleLoaders/loadAmplifyPushNotification.mjs';
|
|
8
|
+
export { loadAmplifyWebBrowser } from './moduleLoaders/loadAmplifyWebBrowser.mjs';
|
|
9
|
+
export { loadAsyncStorage } from './moduleLoaders/loadAsyncStorage.mjs';
|
|
10
|
+
export { loadNetInfo } from './moduleLoaders/loadNetInfo.mjs';
|
|
11
|
+
export { loadBuffer } from './moduleLoaders/loadBuffer.mjs';
|
|
12
|
+
export { loadUrlPolyfill } from './moduleLoaders/loadUrlPolyfill.mjs';
|
|
13
|
+
export { loadGetRandomValues } from './moduleLoaders/loadGetRandomValues.mjs';
|
|
14
|
+
export { loadBase64 } from './moduleLoaders/loadBase64.mjs';
|
|
15
|
+
export { loadAppState } from './moduleLoaders/loadAppState.mjs';
|
|
16
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { loadAmplifyRtnPasskeys } from './loadAmplifyRtnPasskeys';
|
|
2
|
+
export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
|
|
3
|
+
export { loadAmplifyWebBrowser } from './loadAmplifyWebBrowser';
|
|
4
|
+
export { loadAsyncStorage } from './loadAsyncStorage';
|
|
5
|
+
export { loadNetInfo } from './loadNetInfo';
|
|
6
|
+
export { loadBuffer } from './loadBuffer';
|
|
7
|
+
export { loadUrlPolyfill } from './loadUrlPolyfill';
|
|
8
|
+
export { loadGetRandomValues } from './loadGetRandomValues';
|
|
9
|
+
export { loadBase64 } from './loadBase64';
|
|
10
|
+
export { loadAppState } from './loadAppState';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { loadAmplifyRtnPasskeys } from './loadAmplifyRtnPasskeys.mjs';
|
|
2
|
+
export { loadAmplifyPushNotification } from './loadAmplifyPushNotification.mjs';
|
|
3
|
+
export { loadAmplifyWebBrowser } from './loadAmplifyWebBrowser.mjs';
|
|
4
|
+
export { loadAsyncStorage } from './loadAsyncStorage.mjs';
|
|
5
|
+
export { loadNetInfo } from './loadNetInfo.mjs';
|
|
6
|
+
export { loadBuffer } from './loadBuffer.mjs';
|
|
7
|
+
export { loadUrlPolyfill } from './loadUrlPolyfill.mjs';
|
|
8
|
+
export { loadGetRandomValues } from './loadGetRandomValues.mjs';
|
|
9
|
+
export { loadBase64 } from './loadBase64.mjs';
|
|
10
|
+
export { loadAppState } from './loadAppState.mjs';
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const loadAmplifyPushNotification: () => {
|
|
2
|
+
addMessageEventListener: (event: string, listener: (message: import("@aws-amplify/rtn-push-notification").PushNotificationMessage | null, completionHandlerId?: string) => void) => import("react-native").EmitterSubscription;
|
|
3
|
+
addTokenEventListener: (event: string, listener: (token: string) => void) => import("react-native").EmitterSubscription;
|
|
4
|
+
completeNotification: (completionHandlerId: string) => void;
|
|
5
|
+
getBadgeCount: () => void | Promise<number | null>;
|
|
6
|
+
getConstants: () => {
|
|
7
|
+
NativeEvent: {
|
|
8
|
+
BACKGROUND_MESSAGE_RECEIVED?: string;
|
|
9
|
+
FOREGROUND_MESSAGE_RECEIVED: string;
|
|
10
|
+
LAUNCH_NOTIFICATION_OPENED: string;
|
|
11
|
+
NOTIFICATION_OPENED: string;
|
|
12
|
+
TOKEN_RECEIVED: string;
|
|
13
|
+
};
|
|
14
|
+
NativeHeadlessTaskKey?: string;
|
|
15
|
+
};
|
|
16
|
+
getLaunchNotification: () => Promise<import("@aws-amplify/rtn-push-notification").PushNotificationMessage | null>;
|
|
17
|
+
getPermissionStatus: () => Promise<import("@aws-amplify/rtn-push-notification").PushNotificationPermissionStatus>;
|
|
18
|
+
registerHeadlessTask: (task: (message: import("@aws-amplify/rtn-push-notification").PushNotificationMessage | null) => Promise<void>) => void;
|
|
19
|
+
requestPermissions: ({ alert, badge, sound }?: import("@aws-amplify/rtn-push-notification").PushNotificationPermissions) => Promise<boolean>;
|
|
20
|
+
setBadgeCount: (count: number) => void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadAmplifyPushNotification = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
const module = require('@aws-amplify/rtn-push-notification')?.module;
|
|
8
|
+
if (module) {
|
|
9
|
+
return module;
|
|
10
|
+
}
|
|
11
|
+
throw new Error('Ensure `@aws-amplify/rtn-push-notification` is installed and linked.');
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// The error parsing logic cannot be extracted with metro as the `require`
|
|
15
|
+
// would be confused when there is a `import` in the same file importing
|
|
16
|
+
// another module and that causes an error
|
|
17
|
+
const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-push-notification');
|
|
18
|
+
throw new Error(message);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { loadAmplifyPushNotification };
|
|
23
|
+
//# sourceMappingURL=loadAmplifyPushNotification.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadAmplifyPushNotification.mjs","sources":["../../../src/moduleLoaders/loadAmplifyPushNotification.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadAmplifyPushNotification = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n const module = require('@aws-amplify/rtn-push-notification')?.module;\n if (module) {\n return module;\n }\n throw new Error('Ensure `@aws-amplify/rtn-push-notification` is installed and linked.');\n }\n catch (e) {\n // The error parsing logic cannot be extracted with metro as the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes an error\n const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-push-notification');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,2BAA2B,GAAG,MAAM;AACjD,IAAI,IAAI;AACR;AACA;AACA,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,oCAAoC,CAAC,EAAE,MAAM;AAC5E,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,MAAM;AACzB,QAAQ;AACR,QAAQ,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC;AAC/F,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,oCAAoC,CAAC;AAC7F,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadAmplifyRtnPasskeys: () => import("@aws-amplify/rtn-passkeys/dist/esm/NativeAmplifyRtnPasskeys").Spec;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadAmplifyRtnPasskeys = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
const module = require('@aws-amplify/rtn-passkeys')?.module;
|
|
8
|
+
if (module) {
|
|
9
|
+
return module;
|
|
10
|
+
}
|
|
11
|
+
throw new Error('Ensure `@aws-amplify/rtn-passkeys` is installed and linked.');
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// The error parsing logic cannot be extracted with metro as the `require`
|
|
15
|
+
// would be confused when there is a `import` in the same file importing
|
|
16
|
+
// another module and that causes an error
|
|
17
|
+
const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-passkeys');
|
|
18
|
+
throw new Error(message);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { loadAmplifyRtnPasskeys };
|
|
23
|
+
//# sourceMappingURL=loadAmplifyRtnPasskeys.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadAmplifyRtnPasskeys.mjs","sources":["../../../src/moduleLoaders/loadAmplifyRtnPasskeys.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadAmplifyRtnPasskeys = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n const module = require('@aws-amplify/rtn-passkeys')?.module;\n if (module) {\n return module;\n }\n throw new Error('Ensure `@aws-amplify/rtn-passkeys` is installed and linked.');\n }\n catch (e) {\n // The error parsing logic cannot be extracted with metro as the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes an error\n const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-passkeys');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,sBAAsB,GAAG,MAAM;AAC5C,IAAI,IAAI;AACR;AACA;AACA,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,EAAE,MAAM;AACnE,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,MAAM;AACzB,QAAQ;AACR,QAAQ,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC;AACtF,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,2BAA2B,CAAC;AACpF,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadAmplifyWebBrowser = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
const module = require('@aws-amplify/rtn-web-browser')?.module;
|
|
8
|
+
if (module) {
|
|
9
|
+
return module;
|
|
10
|
+
}
|
|
11
|
+
throw new Error('Ensure `@aws-amplify/rtn-web-browser` is installed and linked.');
|
|
12
|
+
}
|
|
13
|
+
catch (e) {
|
|
14
|
+
// The error parsing logic cannot be extracted with metro as the `require`
|
|
15
|
+
// would be confused when there is a `import` in the same file importing
|
|
16
|
+
// another module and that causes an error
|
|
17
|
+
const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-web-browser');
|
|
18
|
+
throw new Error(message);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { loadAmplifyWebBrowser };
|
|
23
|
+
//# sourceMappingURL=loadAmplifyWebBrowser.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadAmplifyWebBrowser.mjs","sources":["../../../src/moduleLoaders/loadAmplifyWebBrowser.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadAmplifyWebBrowser = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n const module = require('@aws-amplify/rtn-web-browser')?.module;\n if (module) {\n return module;\n }\n throw new Error('Ensure `@aws-amplify/rtn-web-browser` is installed and linked.');\n }\n catch (e) {\n // The error parsing logic cannot be extracted with metro as the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes an error\n const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-web-browser');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,qBAAqB,GAAG,MAAM;AAC3C,IAAI,IAAI;AACR;AACA;AACA,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,8BAA8B,CAAC,EAAE,MAAM;AACtE,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,MAAM;AACzB,QAAQ;AACR,QAAQ,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC;AACzF,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,8BAA8B,CAAC;AACvF,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadAppState: () => import("react-native").AppStateStatic;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AppState } from 'react-native';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const loadAppState = () => AppState;
|
|
6
|
+
|
|
7
|
+
export { loadAppState };
|
|
8
|
+
//# sourceMappingURL=loadAppState.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadAppState.mjs","sources":["../../../src/moduleLoaders/loadAppState.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AppState } from 'react-native';\nexport const loadAppState = () => AppState;\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,YAAY,GAAG,MAAM;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadAsyncStorage = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
const module = require('@react-native-async-storage/async-storage')
|
|
8
|
+
?.default;
|
|
9
|
+
if (module) {
|
|
10
|
+
return module;
|
|
11
|
+
}
|
|
12
|
+
throw new Error('Ensure `@react-native-async-storage/async-storage` is installed and linked.');
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
// The error parsing logic cannot be extracted with metro as the `require`
|
|
16
|
+
// would be confused when there is a `import` in the same file importing
|
|
17
|
+
// another module and that causes an error
|
|
18
|
+
const message = e.message.replace(/undefined/g, '@react-native-async-storage/async-storage');
|
|
19
|
+
throw new Error(message);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { loadAsyncStorage };
|
|
24
|
+
//# sourceMappingURL=loadAsyncStorage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadAsyncStorage.mjs","sources":["../../../src/moduleLoaders/loadAsyncStorage.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadAsyncStorage = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n const module = require('@react-native-async-storage/async-storage')\n ?.default;\n if (module) {\n return module;\n }\n throw new Error('Ensure `@react-native-async-storage/async-storage` is installed and linked.');\n }\n catch (e) {\n // The error parsing logic cannot be extracted with metro as the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes an error\n const message = e.message.replace(/undefined/g, '@react-native-async-storage/async-storage');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,gBAAgB,GAAG,MAAM;AACtC,IAAI,IAAI;AACR;AACA;AACA,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,2CAA2C;AAC1E,cAAc,OAAO;AACrB,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,MAAM;AACzB,QAAQ;AACR,QAAQ,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC;AACtG,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,2CAA2C,CAAC;AACpG,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { encode, decode } from 'base-64';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const loadBase64 = () => ({ decode, encode });
|
|
6
|
+
|
|
7
|
+
export { loadBase64 };
|
|
8
|
+
//# sourceMappingURL=loadBase64.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadBase64.mjs","sources":["../../../src/moduleLoaders/loadBase64.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { decode, encode } from 'base-64';\nexport const loadBase64 = () => ({ decode, encode });\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,UAAU,GAAG,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const loadBuffer: () => {
|
|
2
|
+
new (str: string, encoding?: string): Buffer;
|
|
3
|
+
new (size: number): Buffer;
|
|
4
|
+
new (array: Uint8Array): Buffer;
|
|
5
|
+
new (arrayBuffer: ArrayBuffer): Buffer;
|
|
6
|
+
new (array: ReadonlyArray<any>): Buffer;
|
|
7
|
+
new (buffer: Buffer): Buffer;
|
|
8
|
+
prototype: Buffer;
|
|
9
|
+
from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
|
10
|
+
from(data: ReadonlyArray<any> | string | Buffer | ArrayBuffer): Buffer;
|
|
11
|
+
from(str: string, encoding?: string): Buffer;
|
|
12
|
+
isBuffer(obj: any): obj is Buffer;
|
|
13
|
+
isEncoding(encoding: string): boolean;
|
|
14
|
+
byteLength(string: string | Buffer | DataView | ArrayBuffer, encoding?: string): number;
|
|
15
|
+
concat(list: ReadonlyArray<Buffer>, totalLength?: number): Buffer;
|
|
16
|
+
compare(buf1: Buffer, buf2: Buffer): number;
|
|
17
|
+
alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
|
|
18
|
+
allocUnsafe(size: number): Buffer;
|
|
19
|
+
allocUnsafeSlow(size: number): Buffer;
|
|
20
|
+
poolSize: number;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadBuffer.mjs","sources":["../../../src/moduleLoaders/loadBuffer.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { Buffer } from 'buffer';\nexport const loadBuffer = () => Buffer;\n"],"names":[],"mappings":";;AAAA;AACA;AAEY,MAAC,UAAU,GAAG,MAAM;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadGetRandomValues: () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadGetRandomValues = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
require('react-native-get-random-values');
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
// The error parsing logic cannot be extract as with metro the `require`
|
|
11
|
+
// would be confused when there is a `import` in the same file importing
|
|
12
|
+
// another module and that causes error
|
|
13
|
+
const message = e.message.replace(/undefined/g, 'react-native-get-random-values');
|
|
14
|
+
throw new Error(message);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { loadGetRandomValues };
|
|
19
|
+
//# sourceMappingURL=loadGetRandomValues.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadGetRandomValues.mjs","sources":["../../../src/moduleLoaders/loadGetRandomValues.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadGetRandomValues = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n require('react-native-get-random-values');\n }\n catch (e) {\n // The error parsing logic cannot be extract as with metro the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes error\n const message = e.message.replace(/undefined/g, 'react-native-get-random-values');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,mBAAmB,GAAG,MAAM;AACzC,IAAI,IAAI;AACR;AACA;AACA,QAAQ,OAAO,CAAC,gCAAgC,CAAC;AACjD,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,gCAAgC,CAAC;AACzF,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadNetInfo = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
const module = require('@react-native-community/netinfo')
|
|
8
|
+
?.default;
|
|
9
|
+
if (module) {
|
|
10
|
+
return module;
|
|
11
|
+
}
|
|
12
|
+
throw new Error('Ensure `@react-native-community/netinfo` is installed and linked.');
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
// The error parsing logic cannot be extract as with metro the `require`
|
|
16
|
+
// would be confused when there is a `import` in the same file importing
|
|
17
|
+
// another module and that causes error
|
|
18
|
+
const message = e.message.replace(/undefined/g, '@react-native-community/netinfo');
|
|
19
|
+
throw new Error(message);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { loadNetInfo };
|
|
24
|
+
//# sourceMappingURL=loadNetInfo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadNetInfo.mjs","sources":["../../../src/moduleLoaders/loadNetInfo.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadNetInfo = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n const module = require('@react-native-community/netinfo')\n ?.default;\n if (module) {\n return module;\n }\n throw new Error('Ensure `@react-native-community/netinfo` is installed and linked.');\n }\n catch (e) {\n // The error parsing logic cannot be extract as with metro the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes error\n const message = e.message.replace(/undefined/g, '@react-native-community/netinfo');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,WAAW,GAAG,MAAM;AACjC,IAAI,IAAI;AACR;AACA;AACA,QAAQ,MAAM,MAAM,GAAG,OAAO,CAAC,iCAAiC;AAChE,cAAc,OAAO;AACrB,QAAQ,IAAI,MAAM,EAAE;AACpB,YAAY,OAAO,MAAM;AACzB,QAAQ;AACR,QAAQ,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC;AAC5F,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,iCAAiC,CAAC;AAC1F,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const loadUrlPolyfill: () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
const loadUrlPolyfill = () => {
|
|
4
|
+
try {
|
|
5
|
+
// metro bundler requires static string for loading module.
|
|
6
|
+
// See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
|
|
7
|
+
require('react-native-url-polyfill/auto');
|
|
8
|
+
}
|
|
9
|
+
catch (e) {
|
|
10
|
+
// The error parsing logic cannot be extract as with metro the `require`
|
|
11
|
+
// would be confused when there is a `import` in the same file importing
|
|
12
|
+
// another module and that causes error
|
|
13
|
+
const message = e.message.replace(/undefined/g, 'react-native-url-polyfill');
|
|
14
|
+
throw new Error(message);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { loadUrlPolyfill };
|
|
19
|
+
//# sourceMappingURL=loadUrlPolyfill.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadUrlPolyfill.mjs","sources":["../../../src/moduleLoaders/loadUrlPolyfill.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport const loadUrlPolyfill = () => {\n try {\n // metro bundler requires static string for loading module.\n // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages\n require('react-native-url-polyfill/auto');\n }\n catch (e) {\n // The error parsing logic cannot be extract as with metro the `require`\n // would be confused when there is a `import` in the same file importing\n // another module and that causes error\n const message = e.message.replace(/undefined/g, 'react-native-url-polyfill');\n throw new Error(message);\n }\n};\n"],"names":[],"mappings":"AAAA;AACA;AACY,MAAC,eAAe,GAAG,MAAM;AACrC,IAAI,IAAI;AACR;AACA;AACA,QAAQ,OAAO,CAAC,gCAAgC,CAAC;AACjD,IAAI;AACJ,IAAI,OAAO,CAAC,EAAE;AACd;AACA;AACA;AACA,QAAQ,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,EAAE,2BAA2B,CAAC;AACpF,QAAQ,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC;AAChC,IAAI;AACJ;;;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Platform, NativeModules } from 'react-native';
|
|
2
|
+
|
|
3
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
const LINKING_ERROR = `The package '@aws-amplify/react-native' doesn't seem to be linked. Make sure: \n\n` +
|
|
6
|
+
Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
|
|
7
|
+
'- You rebuilt the app after installing the package\n' +
|
|
8
|
+
'- You are not using Expo Go\n';
|
|
9
|
+
const nativeModule = NativeModules.AmplifyRTNCore
|
|
10
|
+
? NativeModules.AmplifyRTNCore
|
|
11
|
+
: new Proxy({}, {
|
|
12
|
+
get() {
|
|
13
|
+
throw new Error(LINKING_ERROR);
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { nativeModule };
|
|
18
|
+
//# sourceMappingURL=nativeModule.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeModule.mjs","sources":["../../src/nativeModule.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NativeModules, Platform } from 'react-native';\nconst LINKING_ERROR = `The package '@aws-amplify/react-native' doesn't seem to be linked. Make sure: \\n\\n` +\n Platform.select({ ios: \"- You have run 'pod install'\\n\", default: '' }) +\n '- You rebuilt the app after installing the package\\n' +\n '- You are not using Expo Go\\n';\nexport const nativeModule = NativeModules.AmplifyRTNCore\n ? NativeModules.AmplifyRTNCore\n : new Proxy({}, {\n get() {\n throw new Error(LINKING_ERROR);\n },\n });\n"],"names":[],"mappings":";;AAAA;AACA;AAEA,MAAM,aAAa,GAAG,CAAC,kFAAkF,CAAC;AAC1G,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;AAC3E,IAAI,sDAAsD;AAC1D,IAAI,+BAA+B;AACvB,MAAC,YAAY,GAAG,aAAa,CAAC;AAC1C,MAAM,aAAa,CAAC;AACpB,MAAM,IAAI,KAAK,CAAC,EAAE,EAAE;AACpB,QAAQ,GAAG,GAAG;AACd,YAAY,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC;AAC1C,QAAQ,CAAC;AACT,KAAK;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface RTNCore {
|
|
2
|
+
computeModPow(payload: {
|
|
3
|
+
base: string;
|
|
4
|
+
exponent: string;
|
|
5
|
+
divisor: string;
|
|
6
|
+
}): Promise<string>;
|
|
7
|
+
computeS(payload: {
|
|
8
|
+
g: string;
|
|
9
|
+
x: string;
|
|
10
|
+
k: string;
|
|
11
|
+
a: string;
|
|
12
|
+
b: string;
|
|
13
|
+
u: string;
|
|
14
|
+
}): Promise<string>;
|
|
15
|
+
getDeviceName(): Promise<string>;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
#import <React/RCTBridgeModule.h>
|
|
5
|
+
|
|
6
|
+
@interface RCT_EXTERN_MODULE(AmplifyRTNCore, NSObject)
|
|
7
|
+
|
|
8
|
+
RCT_EXTERN_METHOD(computeModPow:(NSDictionary*)payload
|
|
9
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
10
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
11
|
+
|
|
12
|
+
RCT_EXTERN_METHOD(computeS:(NSDictionary*)payload
|
|
13
|
+
withResolver:(RCTPromiseResolveBlock)resolve
|
|
14
|
+
withRejecter:(RCTPromiseRejectBlock)reject)
|
|
15
|
+
|
|
16
|
+
RCT_EXTERN_METHOD(getDeviceName:(RCTPromiseResolveBlock)resolve
|
|
17
|
+
withResolver:(RCTPromiseRejectBlock)reject)
|
|
18
|
+
|
|
19
|
+
+ (BOOL)requiresMainQueueSetup
|
|
20
|
+
{
|
|
21
|
+
return NO;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
#if canImport(UIKit)
|
|
5
|
+
import UIKit
|
|
6
|
+
#else
|
|
7
|
+
import Foundation
|
|
8
|
+
#endif
|
|
9
|
+
|
|
10
|
+
@objc(AmplifyRTNCore)
|
|
11
|
+
class AmplifyRTNCore: NSObject {
|
|
12
|
+
@objc(multiply:withB:withResolver:withRejecter:)
|
|
13
|
+
func multiply(a: Float, b: Float, resolve: RCTPromiseResolveBlock, reject _: RCTPromiseRejectBlock) {
|
|
14
|
+
resolve(a * b)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@objc(computeModPow:withResolver:withRejecter:)
|
|
18
|
+
func computeModPow(
|
|
19
|
+
payload: [String: String],
|
|
20
|
+
resolve: RCTPromiseResolveBlock,
|
|
21
|
+
reject: RCTPromiseRejectBlock
|
|
22
|
+
) {
|
|
23
|
+
BigInteger.computeModPow(payload, resolve: resolve, reject: reject)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@objc(computeS:withResolver:withRejecter:)
|
|
27
|
+
func computeS(
|
|
28
|
+
_ payload: [String: String],
|
|
29
|
+
resolve: RCTPromiseResolveBlock,
|
|
30
|
+
reject: RCTPromiseRejectBlock
|
|
31
|
+
) {
|
|
32
|
+
BigInteger.computeS(payload, resolve: resolve, reject: reject)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@objc(getDeviceName:withResolver:)
|
|
36
|
+
func getDeviceName(resolve: @escaping RCTPromiseResolveBlock, reject _: @escaping RCTPromiseRejectBlock) {
|
|
37
|
+
var deviceName: String
|
|
38
|
+
#if canImport(UIKit)
|
|
39
|
+
deviceName = UIDevice.current.name
|
|
40
|
+
#else
|
|
41
|
+
deviceName = ProcessInfo.processInfo.hostName
|
|
42
|
+
#endif
|
|
43
|
+
resolve(deviceName)
|
|
44
|
+
}
|
|
45
|
+
}
|