@aws-amplify/notifications 2.0.1-ssr-api.df60e41.0 → 2.0.1-unstable.20e9a79.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.
@@ -1,3 +1,3 @@
1
- export { getBadgeCount, getLaunchNotification, GetLaunchNotificationOutput, getPermissionStatus, GetPermissionStatusOutput, identifyUser, IdentifyUserInput, initializePushNotifications, onNotificationOpened, OnNotificationOpenedInput, OnNotificationOpenedOutput, onNotificationReceivedInBackground, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInBackgroundOutput, onNotificationReceivedInForeground, OnNotificationReceivedInForegroundInput, OnNotificationReceivedInForegroundOutput, onTokenReceived, OnTokenReceivedInput, OnTokenReceivedOutput, requestPermissions, RequestPermissionsInput, setBadgeCount, SetBadgeCountInput, } from './providers/pinpoint';
1
+ export { getBadgeCount, GetBadgeCountOutput, getLaunchNotification, GetLaunchNotificationOutput, getPermissionStatus, GetPermissionStatusOutput, identifyUser, IdentifyUserInput, initializePushNotifications, onNotificationOpened, OnNotificationOpenedInput, OnNotificationOpenedOutput, onNotificationReceivedInBackground, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInBackgroundOutput, onNotificationReceivedInForeground, OnNotificationReceivedInForegroundInput, OnNotificationReceivedInForegroundOutput, onTokenReceived, OnTokenReceivedInput, OnTokenReceivedOutput, requestPermissions, RequestPermissionsInput, setBadgeCount, SetBadgeCountInput, } from './providers/pinpoint';
2
2
  export { PushNotificationMessage } from './types';
3
3
  export { PushNotificationError } from './errors';
@@ -1,3 +1,3 @@
1
1
  export { getBadgeCount, getLaunchNotification, getPermissionStatus, identifyUser, initializePushNotifications, onNotificationOpened, onNotificationReceivedInBackground, onNotificationReceivedInForeground, onTokenReceived, requestPermissions, setBadgeCount, } from './apis';
2
2
  export { IdentifyUserInput, OnNotificationOpenedInput, OnNotificationReceivedInBackgroundInput, OnNotificationReceivedInForegroundInput, OnTokenReceivedInput, RequestPermissionsInput, SetBadgeCountInput, } from './types/inputs';
3
- export { GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './types/outputs';
3
+ export { GetBadgeCountOutput, GetLaunchNotificationOutput, GetPermissionStatusOutput, OnNotificationOpenedOutput, OnNotificationReceivedInBackgroundOutput, OnNotificationReceivedInForegroundOutput, OnTokenReceivedOutput, } from './types/outputs';
@@ -1,5 +1,6 @@
1
1
  export * from './errors';
2
2
  export * from './inputs';
3
+ export * from './module';
3
4
  export * from './options';
4
5
  export * from './outputs';
5
6
  export * from './pushNotifications';
@@ -18,6 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./errors"), exports);
20
20
  __exportStar(require("./inputs"), exports);
21
+ __exportStar(require("./module"), exports);
21
22
  __exportStar(require("./options"), exports);
22
23
  __exportStar(require("./outputs"), exports);
23
24
  __exportStar(require("./pushNotifications"), exports);
@@ -1,6 +1,7 @@
1
1
  import { UserProfile } from '@aws-amplify/core';
2
2
  import { PushNotificationServiceOptions } from './options';
3
- import { OnPushNotificationMessageHandler, OnTokenReceivedHandler, PushNotificationPermissions } from './pushNotifications';
3
+ import { PushNotificationPermissions } from './module';
4
+ import { OnPushNotificationMessageHandler, OnTokenReceivedHandler } from './pushNotifications';
4
5
  export type PushNotificationIdentifyUserInput<ServiceOptions extends PushNotificationServiceOptions = PushNotificationServiceOptions> = {
5
6
  /**
6
7
  * A User ID associated to the current device.
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Types here are duplicated from `rtn-push-notifications` as it is not possible to share a source of truth
3
+ * with a package that may conditionally not exist for developers not using push notifications. Modifications
4
+ * made to these types should be reflected in the native module package and vice-versa!
5
+ */
6
+ interface ApnsPlatformOptions {
7
+ subtitle?: string;
8
+ }
9
+ interface FcmPlatformOptions {
10
+ channelId: string;
11
+ messageId: string;
12
+ senderId: string;
13
+ sendTime: Date;
14
+ }
15
+ export interface PushNotificationMessage {
16
+ title?: string;
17
+ body?: string;
18
+ imageUrl?: string;
19
+ deeplinkUrl?: string;
20
+ goToUrl?: string;
21
+ fcmOptions?: FcmPlatformOptions;
22
+ apnsOptions?: ApnsPlatformOptions;
23
+ data?: Record<string, unknown>;
24
+ }
25
+ export type PushNotificationPermissionStatus = 'denied' | 'granted' | 'shouldRequest' | 'shouldExplainThenRequest';
26
+ export interface PushNotificationPermissions extends Partial<Record<string, boolean>> {
27
+ alert?: boolean;
28
+ badge?: boolean;
29
+ sound?: boolean;
30
+ }
31
+ export {};
@@ -0,0 +1,4 @@
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 });
@@ -1,5 +1,4 @@
1
- import type { PushNotificationMessage } from '@aws-amplify/react-native';
2
- export type { PushNotificationMessage, PushNotificationPermissionStatus, PushNotificationPermissions, } from '@aws-amplify/react-native';
1
+ import { PushNotificationMessage } from './module';
3
2
  export type OnTokenReceivedHandler = (token: string) => void;
4
3
  export type OnPushNotificationMessageHandler = (message: PushNotificationMessage) => void;
5
4
  export type PushNotificationEvent = 'backgroundMessageReceived' | 'foregroundMessageReceived' | 'launchNotificationOpened' | 'notificationOpened' | 'tokenReceived';