@aws-amplify/react-native 1.0.0

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.
Files changed (141) hide show
  1. package/AmplifyRTNCore.podspec +35 -0
  2. package/LICENSE +201 -0
  3. package/android/build.gradle +103 -0
  4. package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  5. package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/gradlew +234 -0
  8. package/android/gradlew.bat +89 -0
  9. package/android/src/hasPackageName/AndroidManifest.xml +4 -0
  10. package/android/src/main/AndroidManifest.xml +3 -0
  11. package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/AmplifyRTNCoreModule.kt +29 -0
  12. package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/AmplifyRTNCorePackage.kt +17 -0
  13. package/android/src/main/kotlin/com/amazonaws/amplify/rtncore/BigInteger.kt +65 -0
  14. package/ios/AmplifyRTNCore-Bridging-Header.h +5 -0
  15. package/ios/AmplifyRTNCore.mm +21 -0
  16. package/ios/AmplifyRTNCore.swift +29 -0
  17. package/ios/AmplifyRTNCore.xcodeproj/project.pbxproj +283 -0
  18. package/ios/AmplifyRTNCore.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
  19. package/ios/BigInteger.swift +78 -0
  20. package/ios/JKBigInteger/JKBigDecimal.h +40 -0
  21. package/ios/JKBigInteger/JKBigDecimal.m +224 -0
  22. package/ios/JKBigInteger/JKBigInteger.h +58 -0
  23. package/ios/JKBigInteger/JKBigInteger.m +419 -0
  24. package/ios/JKBigInteger/LICENSE.txt +18 -0
  25. package/ios/JKBigInteger/LibTomMath/tommath.c +6925 -0
  26. package/ios/JKBigInteger/LibTomMath/tommath.h +584 -0
  27. package/ios/JKBigInteger/LibTomMath/tommath_class.h +999 -0
  28. package/ios/JKBigInteger/LibTomMath/tommath_superclass.h +76 -0
  29. package/lib/apis/computeModPow.d.ts +2 -0
  30. package/lib/apis/computeModPow.js +9 -0
  31. package/lib/apis/computeModPow.js.map +1 -0
  32. package/lib/apis/computeS.d.ts +2 -0
  33. package/lib/apis/computeS.js +9 -0
  34. package/lib/apis/computeS.js.map +1 -0
  35. package/lib/apis/getOperatingSystem.d.ts +1 -0
  36. package/lib/apis/getOperatingSystem.js +9 -0
  37. package/lib/apis/getOperatingSystem.js.map +1 -0
  38. package/lib/apis/index.d.ts +3 -0
  39. package/lib/apis/index.js +12 -0
  40. package/lib/apis/index.js.map +1 -0
  41. package/lib/index.d.ts +2 -0
  42. package/lib/index.js +19 -0
  43. package/lib/index.js.map +1 -0
  44. package/lib/moduleLoaders/index.d.ts +8 -0
  45. package/lib/moduleLoaders/index.js +22 -0
  46. package/lib/moduleLoaders/index.js.map +1 -0
  47. package/lib/moduleLoaders/loadAmplifyPushNotification.d.ts +21 -0
  48. package/lib/moduleLoaders/loadAmplifyPushNotification.js +26 -0
  49. package/lib/moduleLoaders/loadAmplifyPushNotification.js.map +1 -0
  50. package/lib/moduleLoaders/loadAppState.d.ts +1 -0
  51. package/lib/moduleLoaders/loadAppState.js +9 -0
  52. package/lib/moduleLoaders/loadAppState.js.map +1 -0
  53. package/lib/moduleLoaders/loadAsyncStorage.d.ts +2 -0
  54. package/lib/moduleLoaders/loadAsyncStorage.js +26 -0
  55. package/lib/moduleLoaders/loadAsyncStorage.js.map +1 -0
  56. package/lib/moduleLoaders/loadBase64.d.ts +5 -0
  57. package/lib/moduleLoaders/loadBase64.js +9 -0
  58. package/lib/moduleLoaders/loadBase64.js.map +1 -0
  59. package/lib/moduleLoaders/loadBuffer.d.ts +22 -0
  60. package/lib/moduleLoaders/loadBuffer.js +9 -0
  61. package/lib/moduleLoaders/loadBuffer.js.map +1 -0
  62. package/lib/moduleLoaders/loadGetRandomValues.d.ts +1 -0
  63. package/lib/moduleLoaders/loadGetRandomValues.js +21 -0
  64. package/lib/moduleLoaders/loadGetRandomValues.js.map +1 -0
  65. package/lib/moduleLoaders/loadNetInfo.d.ts +4 -0
  66. package/lib/moduleLoaders/loadNetInfo.js +26 -0
  67. package/lib/moduleLoaders/loadNetInfo.js.map +1 -0
  68. package/lib/moduleLoaders/loadUrlPolyfill.d.ts +1 -0
  69. package/lib/moduleLoaders/loadUrlPolyfill.js +21 -0
  70. package/lib/moduleLoaders/loadUrlPolyfill.js.map +1 -0
  71. package/lib/nativeModule.d.ts +2 -0
  72. package/lib/nativeModule.js +18 -0
  73. package/lib/nativeModule.js.map +1 -0
  74. package/lib/types.d.ts +15 -0
  75. package/lib/types.js +5 -0
  76. package/lib/types.js.map +1 -0
  77. package/lib-esm/apis/computeModPow.d.ts +2 -0
  78. package/lib-esm/apis/computeModPow.js +5 -0
  79. package/lib-esm/apis/computeModPow.js.map +1 -0
  80. package/lib-esm/apis/computeS.d.ts +2 -0
  81. package/lib-esm/apis/computeS.js +5 -0
  82. package/lib-esm/apis/computeS.js.map +1 -0
  83. package/lib-esm/apis/getOperatingSystem.d.ts +1 -0
  84. package/lib-esm/apis/getOperatingSystem.js +5 -0
  85. package/lib-esm/apis/getOperatingSystem.js.map +1 -0
  86. package/lib-esm/apis/index.d.ts +3 -0
  87. package/lib-esm/apis/index.js +6 -0
  88. package/lib-esm/apis/index.js.map +1 -0
  89. package/lib-esm/index.d.ts +2 -0
  90. package/lib-esm/index.js +5 -0
  91. package/lib-esm/index.js.map +1 -0
  92. package/lib-esm/moduleLoaders/index.d.ts +8 -0
  93. package/lib-esm/moduleLoaders/index.js +11 -0
  94. package/lib-esm/moduleLoaders/index.js.map +1 -0
  95. package/lib-esm/moduleLoaders/loadAmplifyPushNotification.d.ts +21 -0
  96. package/lib-esm/moduleLoaders/loadAmplifyPushNotification.js +22 -0
  97. package/lib-esm/moduleLoaders/loadAmplifyPushNotification.js.map +1 -0
  98. package/lib-esm/moduleLoaders/loadAppState.d.ts +1 -0
  99. package/lib-esm/moduleLoaders/loadAppState.js +5 -0
  100. package/lib-esm/moduleLoaders/loadAppState.js.map +1 -0
  101. package/lib-esm/moduleLoaders/loadAsyncStorage.d.ts +2 -0
  102. package/lib-esm/moduleLoaders/loadAsyncStorage.js +22 -0
  103. package/lib-esm/moduleLoaders/loadAsyncStorage.js.map +1 -0
  104. package/lib-esm/moduleLoaders/loadBase64.d.ts +5 -0
  105. package/lib-esm/moduleLoaders/loadBase64.js +5 -0
  106. package/lib-esm/moduleLoaders/loadBase64.js.map +1 -0
  107. package/lib-esm/moduleLoaders/loadBuffer.d.ts +22 -0
  108. package/lib-esm/moduleLoaders/loadBuffer.js +5 -0
  109. package/lib-esm/moduleLoaders/loadBuffer.js.map +1 -0
  110. package/lib-esm/moduleLoaders/loadGetRandomValues.d.ts +1 -0
  111. package/lib-esm/moduleLoaders/loadGetRandomValues.js +17 -0
  112. package/lib-esm/moduleLoaders/loadGetRandomValues.js.map +1 -0
  113. package/lib-esm/moduleLoaders/loadNetInfo.d.ts +4 -0
  114. package/lib-esm/moduleLoaders/loadNetInfo.js +22 -0
  115. package/lib-esm/moduleLoaders/loadNetInfo.js.map +1 -0
  116. package/lib-esm/moduleLoaders/loadUrlPolyfill.d.ts +1 -0
  117. package/lib-esm/moduleLoaders/loadUrlPolyfill.js +17 -0
  118. package/lib-esm/moduleLoaders/loadUrlPolyfill.js.map +1 -0
  119. package/lib-esm/nativeModule.d.ts +2 -0
  120. package/lib-esm/nativeModule.js +15 -0
  121. package/lib-esm/nativeModule.js.map +1 -0
  122. package/lib-esm/types.d.ts +15 -0
  123. package/lib-esm/types.js +4 -0
  124. package/lib-esm/types.js.map +1 -0
  125. package/package.json +69 -0
  126. package/src/apis/computeModPow.ts +8 -0
  127. package/src/apis/computeS.ts +8 -0
  128. package/src/apis/getOperatingSystem.ts +6 -0
  129. package/src/apis/index.ts +6 -0
  130. package/src/index.ts +14 -0
  131. package/src/moduleLoaders/index.ts +11 -0
  132. package/src/moduleLoaders/loadAmplifyPushNotification.ts +29 -0
  133. package/src/moduleLoaders/loadAppState.ts +6 -0
  134. package/src/moduleLoaders/loadAsyncStorage.ts +29 -0
  135. package/src/moduleLoaders/loadBase64.ts +6 -0
  136. package/src/moduleLoaders/loadBuffer.ts +6 -0
  137. package/src/moduleLoaders/loadGetRandomValues.ts +19 -0
  138. package/src/moduleLoaders/loadNetInfo.ts +31 -0
  139. package/src/moduleLoaders/loadUrlPolyfill.ts +19 -0
  140. package/src/nativeModule.ts +22 -0
  141. package/src/types.ts +19 -0
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { computeModPow, computeS, getOperatingSystem } from './apis';
4
+ export { loadAmplifyPushNotification, loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, loadAppState, } from './moduleLoaders';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EACN,2BAA2B,EAC3B,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,YAAY,GACZ,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
2
+ export { loadAsyncStorage } from './loadAsyncStorage';
3
+ export { loadNetInfo } from './loadNetInfo';
4
+ export { loadBuffer } from './loadBuffer';
5
+ export { loadUrlPolyfill } from './loadUrlPolyfill';
6
+ export { loadGetRandomValues } from './loadGetRandomValues';
7
+ export { loadBase64 } from './loadBase64';
8
+ export { loadAppState } from './loadAppState';
@@ -0,0 +1,11 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
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';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/moduleLoaders/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -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 | undefined) => 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 | undefined;
9
+ FOREGROUND_MESSAGE_RECEIVED: string;
10
+ LAUNCH_NOTIFICATION_OPENED: string;
11
+ NOTIFICATION_OPENED: string;
12
+ TOKEN_RECEIVED: string;
13
+ };
14
+ NativeHeadlessTaskKey?: string | undefined;
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 | undefined) => Promise<boolean>;
20
+ setBadgeCount: (count: number) => void;
21
+ };
@@ -0,0 +1,22 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export 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')
8
+ ?.module;
9
+ if (module) {
10
+ return module;
11
+ }
12
+ throw new Error('Ensure `@aws-amplify/rtn-push-notification` 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, '@aws-amplify/rtn-push-notification');
19
+ throw new Error(message);
20
+ }
21
+ };
22
+ //# sourceMappingURL=loadAmplifyPushNotification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAmplifyPushNotification.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadAmplifyPushNotification.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC/C,IAAI;QACH,2DAA2D;QAC3D,kFAAkF;QAClF,MAAM,MAAM,GAAG,OAAO,CAAC,oCAAoC,CAAC;YAC3D,EAAE,MAAgC,CAAC;QACpC,IAAI,MAAM,EAAE;YACX,OAAO,MAAM,CAAC;SACd;QAED,MAAM,IAAI,KAAK,CACd,sEAAsE,CACtE,CAAC;KACF;IAAC,OAAO,CAAC,EAAE;QACX,0EAA0E;QAC1E,wEAAwE;QACxE,0CAA0C;QAC1C,MAAM,OAAO,GAAI,CAAW,CAAC,OAAO,CAAC,OAAO,CAC3C,YAAY,EACZ,oCAAoC,CACpC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const loadAppState: () => import("react-native").AppStateStatic;
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { AppState } from 'react-native';
4
+ export const loadAppState = () => AppState;
5
+ //# sourceMappingURL=loadAppState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAppState.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadAppState.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { AsyncStorageStatic } from '@react-native-async-storage/async-storage';
2
+ export declare const loadAsyncStorage: () => AsyncStorageStatic;
@@ -0,0 +1,22 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export 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
+ //# sourceMappingURL=loadAsyncStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadAsyncStorage.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadAsyncStorage.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAItC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAuB,EAAE;IACxD,IAAI;QACH,2DAA2D;QAC3D,kFAAkF;QAClF,MAAM,MAAM,GAAG,OAAO,CAAC,2CAA2C,CAAC;YAClE,EAAE,OAA6B,CAAC;QACjC,IAAI,MAAM,EAAE;YACX,OAAO,MAAM,CAAC;SACd;QAED,MAAM,IAAI,KAAK,CACd,6EAA6E,CAC7E,CAAC;KACF;IAAC,OAAO,CAAC,EAAE;QACX,0EAA0E;QAC1E,wEAAwE;QACxE,0CAA0C;QAC1C,MAAM,OAAO,GAAI,CAAW,CAAC,OAAO,CAAC,OAAO,CAC3C,YAAY,EACZ,2CAA2C,CAC3C,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { decode, encode } from 'base-64';
2
+ export declare const loadBase64: () => {
3
+ decode: typeof decode;
4
+ encode: typeof encode;
5
+ };
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { decode, encode } from 'base-64';
4
+ export const loadBase64 = () => ({ decode, encode });
5
+ //# sourceMappingURL=loadBase64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadBase64.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadBase64.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /// <reference types="node" />
2
+ export declare const loadBuffer: () => {
3
+ new (str: string, encoding?: string | undefined): Buffer;
4
+ new (size: number): Buffer;
5
+ new (array: Uint8Array): Buffer;
6
+ new (arrayBuffer: ArrayBuffer): Buffer;
7
+ new (array: readonly any[]): Buffer;
8
+ new (buffer: Buffer): Buffer;
9
+ prototype: Buffer;
10
+ from(arrayBuffer: ArrayBuffer, byteOffset?: number | undefined, length?: number | undefined): Buffer;
11
+ from(data: string | readonly any[] | Buffer | ArrayBuffer): Buffer;
12
+ from(str: string, encoding?: string | undefined): Buffer;
13
+ isBuffer(obj: any): obj is Buffer;
14
+ isEncoding(encoding: string): boolean;
15
+ byteLength(string: string | Buffer | ArrayBuffer | DataView, encoding?: string | undefined): number;
16
+ concat(list: readonly Buffer[], totalLength?: number | undefined): Buffer;
17
+ compare(buf1: Buffer, buf2: Buffer): number;
18
+ alloc(size: number, fill?: string | number | Buffer | undefined, encoding?: string | undefined): Buffer;
19
+ allocUnsafe(size: number): Buffer;
20
+ allocUnsafeSlow(size: number): Buffer;
21
+ poolSize: number;
22
+ };
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { Buffer } from 'buffer';
4
+ export const loadBuffer = () => Buffer;
5
+ //# sourceMappingURL=loadBuffer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadBuffer.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadBuffer.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const loadGetRandomValues: () => void;
@@ -0,0 +1,17 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export 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
+ //# sourceMappingURL=loadGetRandomValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadGetRandomValues.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadGetRandomValues.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACvC,IAAI;QACH,2DAA2D;QAC3D,kFAAkF;QAClF,OAAO,CAAC,gCAAgC,CAAC,CAAC;KAC1C;IAAC,OAAO,CAAC,EAAE;QACX,wEAAwE;QACxE,wEAAwE;QACxE,uCAAuC;QACvC,MAAM,OAAO,GAAI,CAAW,CAAC,OAAO,CAAC,OAAO,CAC3C,YAAY,EACZ,gCAAgC,CAChC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type NetInfo from '@react-native-community/netinfo';
2
+ type NetInfoModule = typeof NetInfo;
3
+ export declare const loadNetInfo: () => NetInfoModule;
4
+ export {};
@@ -0,0 +1,22 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export 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
+ //# sourceMappingURL=loadNetInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadNetInfo.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadNetInfo.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAMtC,MAAM,CAAC,MAAM,WAAW,GAAG,GAAkB,EAAE;IAC9C,IAAI;QACH,2DAA2D;QAC3D,kFAAkF;QAClF,MAAM,MAAM,GAAG,OAAO,CAAC,iCAAiC,CAAC;YACxD,EAAE,OAAwB,CAAC;QAC5B,IAAI,MAAM,EAAE;YACX,OAAO,MAAM,CAAC;SACd;QAED,MAAM,IAAI,KAAK,CACd,mEAAmE,CACnE,CAAC;KACF;IAAC,OAAO,CAAC,EAAE;QACX,wEAAwE;QACxE,wEAAwE;QACxE,uCAAuC;QACvC,MAAM,OAAO,GAAI,CAAW,CAAC,OAAO,CAAC,OAAO,CAC3C,YAAY,EACZ,iCAAiC,CACjC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare const loadUrlPolyfill: () => void;
@@ -0,0 +1,17 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export 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
+ //# sourceMappingURL=loadUrlPolyfill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loadUrlPolyfill.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadUrlPolyfill.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IACnC,IAAI;QACH,2DAA2D;QAC3D,kFAAkF;QAClF,OAAO,CAAC,gCAAgC,CAAC,CAAC;KAC1C;IAAC,OAAO,CAAC,EAAE;QACX,wEAAwE;QACxE,wEAAwE;QACxE,uCAAuC;QACvC,MAAM,OAAO,GAAI,CAAW,CAAC,OAAO,CAAC,OAAO,CAC3C,YAAY,EACZ,2BAA2B,CAC3B,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { RTNCore } from './types';
2
+ export declare const nativeModule: RTNCore;
@@ -0,0 +1,15 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { NativeModules, Platform } from 'react-native';
4
+ const LINKING_ERROR = `The package '@aws-amplify/react-native' doesn't seem to be linked. Make sure: \n\n` +
5
+ Platform.select({ ios: "- You have run 'pod install'\n", default: '' }) +
6
+ '- You rebuilt the app after installing the package\n' +
7
+ '- You are not using Expo Go\n';
8
+ export const nativeModule = NativeModules.AmplifyRTNCore
9
+ ? NativeModules.AmplifyRTNCore
10
+ : new Proxy({}, {
11
+ get() {
12
+ throw new Error(LINKING_ERROR);
13
+ },
14
+ });
15
+ //# sourceMappingURL=nativeModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nativeModule.js","sourceRoot":"","sources":["../src/nativeModule.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,aAAa,GAClB,oFAAoF;IACpF,QAAQ,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,gCAAgC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACvE,sDAAsD;IACtD,+BAA+B,CAAC;AAEjC,MAAM,CAAC,MAAM,YAAY,GAAY,aAAa,CAAC,cAAc;IAChE,CAAC,CAAC,aAAa,CAAC,cAAc;IAC9B,CAAC,CAAC,IAAI,KAAK,CACT,EAAE,EACF;QACC,GAAG;YACF,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;QAChC,CAAC;KACD,CACA,CAAC"}
@@ -0,0 +1,15 @@
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
+ }
@@ -0,0 +1,4 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ export {};
4
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC"}
package/package.json ADDED
@@ -0,0 +1,69 @@
1
+ {
2
+ "name": "@aws-amplify/react-native",
3
+ "version": "1.0.0",
4
+ "description": "React Native core module for aws-amplify",
5
+ "main": "./lib/index.js",
6
+ "module": "./lib-esm/index.js",
7
+ "typings": "./lib-esm/index.d.ts",
8
+ "sideEffects": false,
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "scripts": {
13
+ "test": "tslint 'src/**/*.ts'",
14
+ "test:android": "./android/gradlew test -p ./android",
15
+ "build-with-test": "npm run clean && npm test && tsc",
16
+ "build:cjs": "rimraf lib && tsc -p ./tsconfig.build.json -m commonjs --outDir lib",
17
+ "build:esm": "rimraf lib-esm && tsc -p ./tsconfig.build.json -m esnext --outDir lib-esm",
18
+ "build:cjs:watch": "rimraf lib && tsc -p ./tsconfig.build.json -m commonjs --outDir lib --watch",
19
+ "build:esm:watch": "rimraf lib-esm && tsc -p ./tsconfig.build.json -m esnext --outDir lib-esm --watch",
20
+ "build": "npm run clean && npm run build:esm && npm run build:cjs",
21
+ "clean": "rimraf lib-esm lib dist",
22
+ "format": "echo \"Not implemented\"",
23
+ "lint": "tslint 'src/**/*.ts' && npm run ts-coverage",
24
+ "ts-coverage": "typescript-coverage-report -p ./tsconfig.build.json -t 88.21"
25
+ },
26
+ "dependencies": {
27
+ "base-64": "^1.0.0",
28
+ "buffer": "^6.0.3",
29
+ "react-native-url-polyfill": "^2.0.0"
30
+ },
31
+ "peerDependencies": {
32
+ "react-native": ">=0.70",
33
+ "react-native-get-random-values": ">=1.9.0"
34
+ },
35
+ "devDependencies": {
36
+ "@aws-amplify/rtn-push-notification": "^1.2.0",
37
+ "@aws-amplify/rtn-web-browser": "^1.0.0",
38
+ "@react-native-async-storage/async-storage": "^1.17.12",
39
+ "@react-native-community/netinfo": "4.7.0",
40
+ "@types/base-64": "1.0.0",
41
+ "@types/react-native": "0.70.0",
42
+ "react-native": "0.70.0",
43
+ "react-native-get-random-values": "1.9.0",
44
+ "typescript": "5.1.6"
45
+ },
46
+ "react-native": {
47
+ "./lib/index": "./lib-esm/index.js"
48
+ },
49
+ "repository": {
50
+ "type": "git",
51
+ "url": "https://github.com/aws-amplify/amplify-js.git"
52
+ },
53
+ "author": "Amazon Web Services",
54
+ "license": "Apache-2.0",
55
+ "bugs": {
56
+ "url": "https://github.com/aws-amplify/amplify-js/issues"
57
+ },
58
+ "homepage": "https://docs.amplify.aws/",
59
+ "files": [
60
+ "Amplify*.podspec",
61
+ "android",
62
+ "ios",
63
+ "lib",
64
+ "lib-esm",
65
+ "src"
66
+ ],
67
+ "source": "src/index",
68
+ "gitHead": "d505105326d7f6214f6bd1e06eb20be3a3651377"
69
+ }
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { nativeModule } from '../nativeModule';
5
+ import { RTNCore } from '../types';
6
+
7
+ export const computeModPow: RTNCore['computeModPow'] = payload =>
8
+ nativeModule.computeModPow(payload);
@@ -0,0 +1,8 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { nativeModule } from '../nativeModule';
5
+ import { RTNCore } from '../types';
6
+
7
+ export const computeS: RTNCore['computeS'] = payload =>
8
+ nativeModule.computeS(payload);
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { Platform } from 'react-native';
5
+
6
+ export const getOperatingSystem = () => Platform.OS;
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export { computeModPow } from './computeModPow';
5
+ export { computeS } from './computeS';
6
+ export { getOperatingSystem } from './getOperatingSystem';
package/src/index.ts ADDED
@@ -0,0 +1,14 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export { computeModPow, computeS, getOperatingSystem } from './apis';
5
+ export {
6
+ loadAmplifyPushNotification,
7
+ loadAsyncStorage,
8
+ loadNetInfo,
9
+ loadBuffer,
10
+ loadUrlPolyfill,
11
+ loadGetRandomValues,
12
+ loadBase64,
13
+ loadAppState,
14
+ } from './moduleLoaders';
@@ -0,0 +1,11 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
5
+ export { loadAsyncStorage } from './loadAsyncStorage';
6
+ export { loadNetInfo } from './loadNetInfo';
7
+ export { loadBuffer } from './loadBuffer';
8
+ export { loadUrlPolyfill } from './loadUrlPolyfill';
9
+ export { loadGetRandomValues } from './loadGetRandomValues';
10
+ export { loadBase64 } from './loadBase64';
11
+ export { loadAppState } from './loadAppState';
@@ -0,0 +1,29 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { PushNotificationModule } from '@aws-amplify/rtn-push-notification';
5
+
6
+ export const loadAmplifyPushNotification = () => {
7
+ try {
8
+ // metro bundler requires static string for loading module.
9
+ // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
10
+ const module = require('@aws-amplify/rtn-push-notification')
11
+ ?.module as PushNotificationModule;
12
+ if (module) {
13
+ return module;
14
+ }
15
+
16
+ throw new Error(
17
+ 'Ensure `@aws-amplify/rtn-push-notification` is installed and linked.'
18
+ );
19
+ } catch (e) {
20
+ // The error parsing logic cannot be extracted with metro as the `require`
21
+ // would be confused when there is a `import` in the same file importing
22
+ // another module and that causes an error
23
+ const message = (e as Error).message.replace(
24
+ /undefined/g,
25
+ '@aws-amplify/rtn-push-notification'
26
+ );
27
+ throw new Error(message);
28
+ }
29
+ };
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { AppState } from 'react-native';
5
+
6
+ export const loadAppState = () => AppState;
@@ -0,0 +1,29 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type { AsyncStorageStatic } from '@react-native-async-storage/async-storage';
5
+
6
+ export const loadAsyncStorage = (): AsyncStorageStatic => {
7
+ try {
8
+ // metro bundler requires static string for loading module.
9
+ // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
10
+ const module = require('@react-native-async-storage/async-storage')
11
+ ?.default as AsyncStorageStatic;
12
+ if (module) {
13
+ return module;
14
+ }
15
+
16
+ throw new Error(
17
+ 'Ensure `@react-native-async-storage/async-storage` is installed and linked.'
18
+ );
19
+ } catch (e) {
20
+ // The error parsing logic cannot be extracted with metro as the `require`
21
+ // would be confused when there is a `import` in the same file importing
22
+ // another module and that causes an error
23
+ const message = (e as Error).message.replace(
24
+ /undefined/g,
25
+ '@react-native-async-storage/async-storage'
26
+ );
27
+ throw new Error(message);
28
+ }
29
+ };
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { decode, encode } from 'base-64';
5
+
6
+ export const loadBase64 = () => ({ decode, encode });
@@ -0,0 +1,6 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { Buffer } from 'buffer';
5
+
6
+ export const loadBuffer = () => Buffer;
@@ -0,0 +1,19 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export const loadGetRandomValues = () => {
5
+ try {
6
+ // metro bundler requires static string for loading module.
7
+ // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
8
+ require('react-native-get-random-values');
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 as Error).message.replace(
14
+ /undefined/g,
15
+ 'react-native-get-random-values'
16
+ );
17
+ throw new Error(message);
18
+ }
19
+ };
@@ -0,0 +1,31 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import type NetInfo from '@react-native-community/netinfo';
5
+
6
+ type NetInfoModule = typeof NetInfo;
7
+
8
+ export const loadNetInfo = (): NetInfoModule => {
9
+ try {
10
+ // metro bundler requires static string for loading module.
11
+ // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
12
+ const module = require('@react-native-community/netinfo')
13
+ ?.default as NetInfoModule;
14
+ if (module) {
15
+ return module;
16
+ }
17
+
18
+ throw new Error(
19
+ 'Ensure `@react-native-community/netinfo` is installed and linked.'
20
+ );
21
+ } catch (e) {
22
+ // The error parsing logic cannot be extract as with metro the `require`
23
+ // would be confused when there is a `import` in the same file importing
24
+ // another module and that causes error
25
+ const message = (e as Error).message.replace(
26
+ /undefined/g,
27
+ '@react-native-community/netinfo'
28
+ );
29
+ throw new Error(message);
30
+ }
31
+ };
@@ -0,0 +1,19 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export const loadUrlPolyfill = () => {
5
+ try {
6
+ // metro bundler requires static string for loading module.
7
+ // See: https://facebook.github.io/metro/docs/configuration/#dynamicdepsinpackages
8
+ require('react-native-url-polyfill/auto');
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 as Error).message.replace(
14
+ /undefined/g,
15
+ 'react-native-url-polyfill'
16
+ );
17
+ throw new Error(message);
18
+ }
19
+ };