@aws-amplify/react-native 1.0.1-api-v6-models.8035dfc.0 → 1.0.1-api-v6-models.3eb7748.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 (58) hide show
  1. package/lib/apis/getOperatingSystem.d.ts +1 -0
  2. package/lib/apis/getOperatingSystem.js +9 -0
  3. package/lib/apis/getOperatingSystem.js.map +1 -0
  4. package/lib/apis/index.d.ts +1 -0
  5. package/lib/apis/index.js +3 -1
  6. package/lib/apis/index.js.map +1 -1
  7. package/lib/index.d.ts +3 -2
  8. package/lib/index.js +4 -1
  9. package/lib/index.js.map +1 -1
  10. package/lib/moduleLoaders/index.d.ts +2 -0
  11. package/lib/moduleLoaders/index.js +5 -1
  12. package/lib/moduleLoaders/index.js.map +1 -1
  13. package/lib/moduleLoaders/loadAmplifyPushNotification.d.ts +21 -0
  14. package/lib/moduleLoaders/loadAmplifyPushNotification.js +26 -0
  15. package/lib/moduleLoaders/loadAmplifyPushNotification.js.map +1 -0
  16. package/lib/moduleLoaders/loadAppState.d.ts +1 -0
  17. package/lib/moduleLoaders/loadAppState.js +9 -0
  18. package/lib/moduleLoaders/loadAppState.js.map +1 -0
  19. package/lib/moduleLoaders/loadAsyncStorage.js +2 -2
  20. package/lib/moduleLoaders/loadAsyncStorage.js.map +1 -1
  21. package/lib/moduleLoaders/loadGetRandomValues.js +1 -1
  22. package/lib/moduleLoaders/loadGetRandomValues.js.map +1 -1
  23. package/lib/moduleLoaders/loadUrlPolyfill.js +1 -1
  24. package/lib/moduleLoaders/loadUrlPolyfill.js.map +1 -1
  25. package/lib-esm/apis/getOperatingSystem.d.ts +1 -0
  26. package/lib-esm/apis/getOperatingSystem.js +5 -0
  27. package/lib-esm/apis/getOperatingSystem.js.map +1 -0
  28. package/lib-esm/apis/index.d.ts +1 -0
  29. package/lib-esm/apis/index.js +1 -0
  30. package/lib-esm/apis/index.js.map +1 -1
  31. package/lib-esm/index.d.ts +3 -2
  32. package/lib-esm/index.js +2 -2
  33. package/lib-esm/index.js.map +1 -1
  34. package/lib-esm/moduleLoaders/index.d.ts +2 -0
  35. package/lib-esm/moduleLoaders/index.js +2 -0
  36. package/lib-esm/moduleLoaders/index.js.map +1 -1
  37. package/lib-esm/moduleLoaders/loadAmplifyPushNotification.d.ts +21 -0
  38. package/lib-esm/moduleLoaders/loadAmplifyPushNotification.js +22 -0
  39. package/lib-esm/moduleLoaders/loadAmplifyPushNotification.js.map +1 -0
  40. package/lib-esm/moduleLoaders/loadAppState.d.ts +1 -0
  41. package/lib-esm/moduleLoaders/loadAppState.js +5 -0
  42. package/lib-esm/moduleLoaders/loadAppState.js.map +1 -0
  43. package/lib-esm/moduleLoaders/loadAsyncStorage.js +2 -2
  44. package/lib-esm/moduleLoaders/loadAsyncStorage.js.map +1 -1
  45. package/lib-esm/moduleLoaders/loadGetRandomValues.js +1 -1
  46. package/lib-esm/moduleLoaders/loadGetRandomValues.js.map +1 -1
  47. package/lib-esm/moduleLoaders/loadUrlPolyfill.js +1 -1
  48. package/lib-esm/moduleLoaders/loadUrlPolyfill.js.map +1 -1
  49. package/package.json +4 -2
  50. package/src/apis/getOperatingSystem.ts +6 -0
  51. package/src/apis/index.ts +1 -0
  52. package/src/index.ts +8 -1
  53. package/src/moduleLoaders/index.ts +2 -0
  54. package/src/moduleLoaders/loadAmplifyPushNotification.ts +29 -0
  55. package/src/moduleLoaders/loadAppState.ts +6 -0
  56. package/src/moduleLoaders/loadAsyncStorage.ts +2 -2
  57. package/src/moduleLoaders/loadGetRandomValues.ts +1 -1
  58. package/src/moduleLoaders/loadUrlPolyfill.ts +1 -1
@@ -0,0 +1 @@
1
+ export declare const getOperatingSystem: () => "ios" | "android" | "macos" | "windows" | "web";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.getOperatingSystem = void 0;
6
+ const react_native_1 = require("react-native");
7
+ const getOperatingSystem = () => react_native_1.Platform.OS;
8
+ exports.getOperatingSystem = getOperatingSystem;
9
+ //# sourceMappingURL=getOperatingSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOperatingSystem.js","sourceRoot":"","sources":["../../src/apis/getOperatingSystem.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,+CAAwC;AAEjC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,uBAAQ,CAAC,EAAE,CAAC;AAAvC,QAAA,kBAAkB,sBAAqB"}
@@ -1,2 +1,3 @@
1
1
  export { computeModPow } from './computeModPow';
2
2
  export { computeS } from './computeS';
3
+ export { getOperatingSystem } from './getOperatingSystem';
package/lib/apis/index.js CHANGED
@@ -2,9 +2,11 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.computeS = exports.computeModPow = void 0;
5
+ exports.getOperatingSystem = exports.computeS = exports.computeModPow = void 0;
6
6
  var computeModPow_1 = require("./computeModPow");
7
7
  Object.defineProperty(exports, "computeModPow", { enumerable: true, get: function () { return computeModPow_1.computeModPow; } });
8
8
  var computeS_1 = require("./computeS");
9
9
  Object.defineProperty(exports, "computeS", { enumerable: true, get: function () { return computeS_1.computeS; } });
10
+ var getOperatingSystem_1 = require("./getOperatingSystem");
11
+ Object.defineProperty(exports, "getOperatingSystem", { enumerable: true, get: function () { return getOperatingSystem_1.getOperatingSystem; } });
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,iDAAgD;AAAvC,8GAAA,aAAa,OAAA;AACtB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA"}
package/lib/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export { computeModPow, computeS } from './apis';
2
- export { loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, } from './moduleLoaders';
1
+ export type { PushNotificationMessage, PushNotificationPermissions, PushNotificationPermissionStatus, } from '@aws-amplify/rtn-push-notification';
2
+ export { computeModPow, computeS, getOperatingSystem } from './apis';
3
+ export { loadAmplifyPushNotification, loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, loadAppState, } from './moduleLoaders';
package/lib/index.js CHANGED
@@ -2,15 +2,18 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.loadBase64 = exports.loadGetRandomValues = exports.loadUrlPolyfill = exports.loadBuffer = exports.loadNetInfo = exports.loadAsyncStorage = exports.computeS = exports.computeModPow = void 0;
5
+ exports.loadAppState = exports.loadBase64 = exports.loadGetRandomValues = exports.loadUrlPolyfill = exports.loadBuffer = exports.loadNetInfo = exports.loadAsyncStorage = exports.loadAmplifyPushNotification = exports.getOperatingSystem = exports.computeS = exports.computeModPow = void 0;
6
6
  var apis_1 = require("./apis");
7
7
  Object.defineProperty(exports, "computeModPow", { enumerable: true, get: function () { return apis_1.computeModPow; } });
8
8
  Object.defineProperty(exports, "computeS", { enumerable: true, get: function () { return apis_1.computeS; } });
9
+ Object.defineProperty(exports, "getOperatingSystem", { enumerable: true, get: function () { return apis_1.getOperatingSystem; } });
9
10
  var moduleLoaders_1 = require("./moduleLoaders");
11
+ Object.defineProperty(exports, "loadAmplifyPushNotification", { enumerable: true, get: function () { return moduleLoaders_1.loadAmplifyPushNotification; } });
10
12
  Object.defineProperty(exports, "loadAsyncStorage", { enumerable: true, get: function () { return moduleLoaders_1.loadAsyncStorage; } });
11
13
  Object.defineProperty(exports, "loadNetInfo", { enumerable: true, get: function () { return moduleLoaders_1.loadNetInfo; } });
12
14
  Object.defineProperty(exports, "loadBuffer", { enumerable: true, get: function () { return moduleLoaders_1.loadBuffer; } });
13
15
  Object.defineProperty(exports, "loadUrlPolyfill", { enumerable: true, get: function () { return moduleLoaders_1.loadUrlPolyfill; } });
14
16
  Object.defineProperty(exports, "loadGetRandomValues", { enumerable: true, get: function () { return moduleLoaders_1.loadGetRandomValues; } });
15
17
  Object.defineProperty(exports, "loadBase64", { enumerable: true, get: function () { return moduleLoaders_1.loadBase64; } });
18
+ Object.defineProperty(exports, "loadAppState", { enumerable: true, get: function () { return moduleLoaders_1.loadAppState; } });
16
19
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,+BAAiD;AAAxC,qGAAA,aAAa,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAChC,iDAOyB;AANxB,iHAAA,gBAAgB,OAAA;AAChB,4GAAA,WAAW,OAAA;AACX,2GAAA,UAAU,OAAA;AACV,gHAAA,eAAe,OAAA;AACf,oHAAA,mBAAmB,OAAA;AACnB,2GAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAOtC,+BAAqE;AAA5D,qGAAA,aAAa,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AACpD,iDASyB;AARxB,4HAAA,2BAA2B,OAAA;AAC3B,iHAAA,gBAAgB,OAAA;AAChB,4GAAA,WAAW,OAAA;AACX,2GAAA,UAAU,OAAA;AACV,gHAAA,eAAe,OAAA;AACf,oHAAA,mBAAmB,OAAA;AACnB,2GAAA,UAAU,OAAA;AACV,6GAAA,YAAY,OAAA"}
@@ -1,6 +1,8 @@
1
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
1
2
  export { loadAsyncStorage } from './loadAsyncStorage';
2
3
  export { loadNetInfo } from './loadNetInfo';
3
4
  export { loadBuffer } from './loadBuffer';
4
5
  export { loadUrlPolyfill } from './loadUrlPolyfill';
5
6
  export { loadGetRandomValues } from './loadGetRandomValues';
6
7
  export { loadBase64 } from './loadBase64';
8
+ export { loadAppState } from './loadAppState';
@@ -2,7 +2,9 @@
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.loadBase64 = exports.loadGetRandomValues = exports.loadUrlPolyfill = exports.loadBuffer = exports.loadNetInfo = exports.loadAsyncStorage = void 0;
5
+ exports.loadAppState = exports.loadBase64 = exports.loadGetRandomValues = exports.loadUrlPolyfill = exports.loadBuffer = exports.loadNetInfo = exports.loadAsyncStorage = exports.loadAmplifyPushNotification = void 0;
6
+ var loadAmplifyPushNotification_1 = require("./loadAmplifyPushNotification");
7
+ Object.defineProperty(exports, "loadAmplifyPushNotification", { enumerable: true, get: function () { return loadAmplifyPushNotification_1.loadAmplifyPushNotification; } });
6
8
  var loadAsyncStorage_1 = require("./loadAsyncStorage");
7
9
  Object.defineProperty(exports, "loadAsyncStorage", { enumerable: true, get: function () { return loadAsyncStorage_1.loadAsyncStorage; } });
8
10
  var loadNetInfo_1 = require("./loadNetInfo");
@@ -15,4 +17,6 @@ var loadGetRandomValues_1 = require("./loadGetRandomValues");
15
17
  Object.defineProperty(exports, "loadGetRandomValues", { enumerable: true, get: function () { return loadGetRandomValues_1.loadGetRandomValues; } });
16
18
  var loadBase64_1 = require("./loadBase64");
17
19
  Object.defineProperty(exports, "loadBase64", { enumerable: true, get: function () { return loadBase64_1.loadBase64; } });
20
+ var loadAppState_1 = require("./loadAppState");
21
+ Object.defineProperty(exports, "loadAppState", { enumerable: true, get: function () { return loadAppState_1.loadAppState; } });
18
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/moduleLoaders/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2CAA0C;AAAjC,wGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/moduleLoaders/index.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAEtC,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA;AACzB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AACxB,6DAA4D;AAAnD,0HAAA,mBAAmB,OAAA;AAC5B,2CAA0C;AAAjC,wGAAA,UAAU,OAAA;AACnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
@@ -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: (permissions?: import("@aws-amplify/rtn-push-notification").PushNotificationPermissions | undefined) => Promise<boolean>;
20
+ setBadgeCount: (count: number) => void;
21
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.loadAmplifyPushNotification = void 0;
6
+ 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;
12
+ if (module) {
13
+ return module;
14
+ }
15
+ throw new Error('Ensure `@aws-amplify/rtn-push-notification` is installed and linked.');
16
+ }
17
+ catch (e) {
18
+ // The error parsing logic cannot be extracted with metro as the `require`
19
+ // would be confused when there is a `import` in the same file importing
20
+ // another module and that causes an error
21
+ const message = e.message.replace(/undefined/g, '@aws-amplify/rtn-push-notification');
22
+ throw new Error(message);
23
+ }
24
+ };
25
+ exports.loadAmplifyPushNotification = loadAmplifyPushNotification;
26
+ //# 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;;;AAI/B,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;AAvBW,QAAA,2BAA2B,+BAuBtC"}
@@ -0,0 +1 @@
1
+ export declare const loadAppState: () => import("react-native").AppStateStatic;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.loadAppState = void 0;
6
+ const react_native_1 = require("react-native");
7
+ const loadAppState = () => react_native_1.AppState;
8
+ exports.loadAppState = loadAppState;
9
+ //# 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,+CAAwC;AAEjC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,uBAAQ,CAAC;AAA9B,QAAA,YAAY,gBAAkB"}
@@ -15,9 +15,9 @@ const loadAsyncStorage = () => {
15
15
  throw new Error('Ensure `@react-native-async-storage/async-storage` is installed and linked.');
16
16
  }
17
17
  catch (e) {
18
- // The error parsing logic cannot be extract as with metro the `require`
18
+ // The error parsing logic cannot be extracted with metro as the `require`
19
19
  // would be confused when there is a `import` in the same file importing
20
- // another module and that causes error
20
+ // another module and that causes an error
21
21
  const message = e.message.replace(/undefined/g, '@react-native-async-storage/async-storage');
22
22
  throw new Error(message);
23
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"loadAsyncStorage.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadAsyncStorage.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAI/B,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,wEAAwE;QACxE,wEAAwE;QACxE,uCAAuC;QACvC,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;AAvBW,QAAA,gBAAgB,oBAuB3B"}
1
+ {"version":3,"file":"loadAsyncStorage.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadAsyncStorage.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAI/B,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;AAvBW,QAAA,gBAAgB,oBAuB3B"}
@@ -13,7 +13,7 @@ const loadGetRandomValues = () => {
13
13
  // The error parsing logic cannot be extract as with metro the `require`
14
14
  // would be confused when there is a `import` in the same file importing
15
15
  // another module and that causes error
16
- const message = e.message.replace(/undefined/g, '@react-native-community/netinfo');
16
+ const message = e.message.replace(/undefined/g, 'react-native-get-random-values');
17
17
  throw new Error(message);
18
18
  }
19
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"loadGetRandomValues.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadGetRandomValues.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAE/B,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,iCAAiC,CACjC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC;AAfW,QAAA,mBAAmB,uBAe9B"}
1
+ {"version":3,"file":"loadGetRandomValues.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadGetRandomValues.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAE/B,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;AAfW,QAAA,mBAAmB,uBAe9B"}
@@ -13,7 +13,7 @@ const loadUrlPolyfill = () => {
13
13
  // The error parsing logic cannot be extract as with metro the `require`
14
14
  // would be confused when there is a `import` in the same file importing
15
15
  // another module and that causes error
16
- const message = e.message.replace(/undefined/g, '@react-native-community/netinfo');
16
+ const message = e.message.replace(/undefined/g, 'react-native-url-polyfill');
17
17
  throw new Error(message);
18
18
  }
19
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"loadUrlPolyfill.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadUrlPolyfill.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAE/B,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,iCAAiC,CACjC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC;AAfW,QAAA,eAAe,mBAe1B"}
1
+ {"version":3,"file":"loadUrlPolyfill.js","sourceRoot":"","sources":["../../src/moduleLoaders/loadUrlPolyfill.ts"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;;;AAE/B,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;AAfW,QAAA,eAAe,mBAe1B"}
@@ -0,0 +1 @@
1
+ export declare const getOperatingSystem: () => "ios" | "android" | "macos" | "windows" | "web";
@@ -0,0 +1,5 @@
1
+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+ import { Platform } from 'react-native';
4
+ export const getOperatingSystem = () => Platform.OS;
5
+ //# sourceMappingURL=getOperatingSystem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getOperatingSystem.js","sourceRoot":"","sources":["../../src/apis/getOperatingSystem.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export { computeModPow } from './computeModPow';
2
2
  export { computeS } from './computeS';
3
+ export { getOperatingSystem } from './getOperatingSystem';
@@ -2,4 +2,5 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  export { computeModPow } from './computeModPow';
4
4
  export { computeS } from './computeS';
5
+ export { getOperatingSystem } from './getOperatingSystem';
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apis/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,2 +1,3 @@
1
- export { computeModPow, computeS } from './apis';
2
- export { loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, } from './moduleLoaders';
1
+ export type { PushNotificationMessage, PushNotificationPermissions, PushNotificationPermissionStatus, } from '@aws-amplify/rtn-push-notification';
2
+ export { computeModPow, computeS, getOperatingSystem } from './apis';
3
+ export { loadAmplifyPushNotification, loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, loadAppState, } from './moduleLoaders';
package/lib-esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
- export { computeModPow, computeS } from './apis';
4
- export { loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, } from './moduleLoaders';
3
+ export { computeModPow, computeS, getOperatingSystem } from './apis';
4
+ export { loadAmplifyPushNotification, loadAsyncStorage, loadNetInfo, loadBuffer, loadUrlPolyfill, loadGetRandomValues, loadBase64, loadAppState, } from './moduleLoaders';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +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,MAAM,QAAQ,CAAC;AACjD,OAAO,EACN,gBAAgB,EAChB,WAAW,EACX,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,UAAU,GACV,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAOtC,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"}
@@ -1,6 +1,8 @@
1
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
1
2
  export { loadAsyncStorage } from './loadAsyncStorage';
2
3
  export { loadNetInfo } from './loadNetInfo';
3
4
  export { loadBuffer } from './loadBuffer';
4
5
  export { loadUrlPolyfill } from './loadUrlPolyfill';
5
6
  export { loadGetRandomValues } from './loadGetRandomValues';
6
7
  export { loadBase64 } from './loadBase64';
8
+ export { loadAppState } from './loadAppState';
@@ -1,9 +1,11 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
3
4
  export { loadAsyncStorage } from './loadAsyncStorage';
4
5
  export { loadNetInfo } from './loadNetInfo';
5
6
  export { loadBuffer } from './loadBuffer';
6
7
  export { loadUrlPolyfill } from './loadUrlPolyfill';
7
8
  export { loadGetRandomValues } from './loadGetRandomValues';
8
9
  export { loadBase64 } from './loadBase64';
10
+ export { loadAppState } from './loadAppState';
9
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/moduleLoaders/index.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,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"}
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: (permissions?: 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"}
@@ -12,9 +12,9 @@ export const loadAsyncStorage = () => {
12
12
  throw new Error('Ensure `@react-native-async-storage/async-storage` is installed and linked.');
13
13
  }
14
14
  catch (e) {
15
- // The error parsing logic cannot be extract as with metro the `require`
15
+ // The error parsing logic cannot be extracted with metro as the `require`
16
16
  // would be confused when there is a `import` in the same file importing
17
- // another module and that causes error
17
+ // another module and that causes an error
18
18
  const message = e.message.replace(/undefined/g, '@react-native-async-storage/async-storage');
19
19
  throw new Error(message);
20
20
  }
@@ -1 +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,wEAAwE;QACxE,wEAAwE;QACxE,uCAAuC;QACvC,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"}
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"}
@@ -10,7 +10,7 @@ export const loadGetRandomValues = () => {
10
10
  // The error parsing logic cannot be extract as with metro the `require`
11
11
  // would be confused when there is a `import` in the same file importing
12
12
  // another module and that causes error
13
- const message = e.message.replace(/undefined/g, '@react-native-community/netinfo');
13
+ const message = e.message.replace(/undefined/g, 'react-native-get-random-values');
14
14
  throw new Error(message);
15
15
  }
16
16
  };
@@ -1 +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,iCAAiC,CACjC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
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"}
@@ -10,7 +10,7 @@ export const loadUrlPolyfill = () => {
10
10
  // The error parsing logic cannot be extract as with metro the `require`
11
11
  // would be confused when there is a `import` in the same file importing
12
12
  // another module and that causes error
13
- const message = e.message.replace(/undefined/g, '@react-native-community/netinfo');
13
+ const message = e.message.replace(/undefined/g, 'react-native-url-polyfill');
14
14
  throw new Error(message);
15
15
  }
16
16
  };
@@ -1 +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,iCAAiC,CACjC,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KACzB;AACF,CAAC,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/react-native",
3
- "version": "1.0.1-api-v6-models.8035dfc.0+8035dfc",
3
+ "version": "1.0.1-api-v6-models.3eb7748.0+3eb7748",
4
4
  "description": "React Native core module for aws-amplify",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib-esm/index.js",
@@ -33,6 +33,8 @@
33
33
  "react-native-get-random-values": ">=1.9.0"
34
34
  },
35
35
  "devDependencies": {
36
+ "@aws-amplify/rtn-push-notification": "1.2.1-api-v6-models.3eb7748.0+3eb7748",
37
+ "@aws-amplify/rtn-web-browser": "1.0.1-api-v6-models.3eb7748.0+3eb7748",
36
38
  "@react-native-async-storage/async-storage": "^1.17.12",
37
39
  "@react-native-community/netinfo": "4.7.0",
38
40
  "@types/base-64": "1.0.0",
@@ -63,5 +65,5 @@
63
65
  "src"
64
66
  ],
65
67
  "source": "src/index",
66
- "gitHead": "8035dfc20dda8f7b4d116616e89e72d889ceb5f1"
68
+ "gitHead": "3eb7748aee2fcdea705c93904d1f30ff596649fa"
67
69
  }
@@ -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;
package/src/apis/index.ts CHANGED
@@ -3,3 +3,4 @@
3
3
 
4
4
  export { computeModPow } from './computeModPow';
5
5
  export { computeS } from './computeS';
6
+ export { getOperatingSystem } from './getOperatingSystem';
package/src/index.ts CHANGED
@@ -1,12 +1,19 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
- export { computeModPow, computeS } from './apis';
4
+ export type {
5
+ PushNotificationMessage,
6
+ PushNotificationPermissions,
7
+ PushNotificationPermissionStatus,
8
+ } from '@aws-amplify/rtn-push-notification';
9
+ export { computeModPow, computeS, getOperatingSystem } from './apis';
5
10
  export {
11
+ loadAmplifyPushNotification,
6
12
  loadAsyncStorage,
7
13
  loadNetInfo,
8
14
  loadBuffer,
9
15
  loadUrlPolyfill,
10
16
  loadGetRandomValues,
11
17
  loadBase64,
18
+ loadAppState,
12
19
  } from './moduleLoaders';
@@ -1,9 +1,11 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
+ export { loadAmplifyPushNotification } from './loadAmplifyPushNotification';
4
5
  export { loadAsyncStorage } from './loadAsyncStorage';
5
6
  export { loadNetInfo } from './loadNetInfo';
6
7
  export { loadBuffer } from './loadBuffer';
7
8
  export { loadUrlPolyfill } from './loadUrlPolyfill';
8
9
  export { loadGetRandomValues } from './loadGetRandomValues';
9
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;
@@ -17,9 +17,9 @@ export const loadAsyncStorage = (): AsyncStorageStatic => {
17
17
  'Ensure `@react-native-async-storage/async-storage` is installed and linked.'
18
18
  );
19
19
  } catch (e) {
20
- // The error parsing logic cannot be extract as with metro the `require`
20
+ // The error parsing logic cannot be extracted with metro as the `require`
21
21
  // would be confused when there is a `import` in the same file importing
22
- // another module and that causes error
22
+ // another module and that causes an error
23
23
  const message = (e as Error).message.replace(
24
24
  /undefined/g,
25
25
  '@react-native-async-storage/async-storage'
@@ -12,7 +12,7 @@ export const loadGetRandomValues = () => {
12
12
  // another module and that causes error
13
13
  const message = (e as Error).message.replace(
14
14
  /undefined/g,
15
- '@react-native-community/netinfo'
15
+ 'react-native-get-random-values'
16
16
  );
17
17
  throw new Error(message);
18
18
  }
@@ -12,7 +12,7 @@ export const loadUrlPolyfill = () => {
12
12
  // another module and that causes error
13
13
  const message = (e as Error).message.replace(
14
14
  /undefined/g,
15
- '@react-native-community/netinfo'
15
+ 'react-native-url-polyfill'
16
16
  );
17
17
  throw new Error(message);
18
18
  }