@onesignal/onesignal-vue3
Advanced tools
Comparing version 2.0.0-beta.1 to 2.0.0-beta.2
@@ -10,2 +10,3 @@ import { App } from 'vue'; | ||
OneSignalDeferred?: OneSignalDeferredLoadedCallback[]; | ||
OneSignal?: IOneSignalOneSignal; | ||
safari?: { | ||
@@ -76,2 +77,7 @@ pushNotification: any; | ||
interface IOneSignalOneSignal { | ||
Slidedown: IOneSignalSlidedown; | ||
Notifications: IOneSignalNotifications; | ||
Session: IOneSignalSession; | ||
User: IOneSignalUser; | ||
Debug: IOneSignalDebug; | ||
login(externalId: string, jwtToken?: string): Promise<void>; | ||
@@ -82,8 +88,2 @@ logout(): Promise<void>; | ||
setConsentRequired(requiresConsent: boolean): Promise<void>; | ||
Slidedown: IOneSignalSlidedown; | ||
Notifications: IOneSignalNotifications; | ||
Session: IOneSignalSession; | ||
User: IOneSignalUser; | ||
Debug: IOneSignalDebug; | ||
[index: string]: any; | ||
} | ||
@@ -98,3 +98,2 @@ interface IOneSignalNotifications { | ||
removeEventListener(event: NotificationEventName, listener: (obj: any) => void): void; | ||
[index: string]: any; | ||
} | ||
@@ -109,7 +108,5 @@ interface IOneSignalSlidedown { | ||
removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void; | ||
[index: string]: any; | ||
} | ||
interface IOneSignalDebug { | ||
setLogLevel(logLevel: string): void; | ||
[index: string]: any; | ||
} | ||
@@ -119,5 +116,5 @@ interface IOneSignalSession { | ||
sendUniqueOutcome(outcomeName: string): Promise<void>; | ||
[index: string]: any; | ||
} | ||
interface IOneSignalUser { | ||
PushSubscription: IOneSignalPushSubscription; | ||
addAlias(label: string, id: string): void; | ||
@@ -133,6 +130,7 @@ addAliases(aliases: { | ||
removeSms(smsNumber: string): void; | ||
PushSubscription: IOneSignalPushSubscription; | ||
[index: string]: any; | ||
} | ||
interface IOneSignalPushSubscription { | ||
id: string | null | undefined; | ||
token: string | null | undefined; | ||
optedIn: boolean | undefined; | ||
optIn(): Promise<void>; | ||
@@ -142,3 +140,2 @@ optOut(): Promise<void>; | ||
removeEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void; | ||
[index: string]: any; | ||
} | ||
@@ -145,0 +142,0 @@ export declare const useOneSignal: () => IOneSignalOneSignal; |
@@ -479,2 +479,5 @@ const ONESIGNAL_SDK_ID = 'onesignal-sdk'; | ||
const PushSubscriptionNamespace = { | ||
get id() { var _a, _b, _c; return (_c = (_b = (_a = window.OneSignal) === null || _a === void 0 ? void 0 : _a.User) === null || _b === void 0 ? void 0 : _b.PushSubscription) === null || _c === void 0 ? void 0 : _c.id; }, | ||
get token() { var _a, _b, _c; return (_c = (_b = (_a = window.OneSignal) === null || _a === void 0 ? void 0 : _a.User) === null || _b === void 0 ? void 0 : _b.PushSubscription) === null || _c === void 0 ? void 0 : _c.token; }, | ||
get optedIn() { var _a, _b, _c; return (_c = (_b = (_a = window.OneSignal) === null || _a === void 0 ? void 0 : _a.User) === null || _b === void 0 ? void 0 : _b.PushSubscription) === null || _c === void 0 ? void 0 : _c.optedIn; }, | ||
optIn: pushSubscriptionOptIn, | ||
@@ -481,0 +484,0 @@ optOut: pushSubscriptionOptOut, |
82
index.ts
@@ -48,2 +48,3 @@ import { App } from 'vue'; | ||
OneSignalDeferred?: OneSignalDeferredLoadedCallback[]; | ||
OneSignal?: IOneSignalOneSignal; | ||
safari?: { | ||
@@ -157,7 +158,2 @@ pushNotification: any; | ||
interface IOneSignalOneSignal { | ||
login(externalId: string, jwtToken?: string): Promise<void> | ||
logout(): Promise<void> | ||
init(options: IInitObject): Promise<void> | ||
setConsentGiven(consent: boolean): Promise<void> | ||
setConsentRequired(requiresConsent: boolean): Promise<void> | ||
Slidedown: IOneSignalSlidedown; | ||
@@ -168,51 +164,52 @@ Notifications: IOneSignalNotifications; | ||
Debug: IOneSignalDebug; | ||
[index: string]: any; | ||
login(externalId: string, jwtToken?: string): Promise<void>; | ||
logout(): Promise<void>; | ||
init(options: IInitObject): Promise<void>; | ||
setConsentGiven(consent: boolean): Promise<void>; | ||
setConsentRequired(requiresConsent: boolean): Promise<void>; | ||
} | ||
interface IOneSignalNotifications { | ||
setDefaultUrl(url: string): Promise<void> | ||
setDefaultTitle(title: string): Promise<void> | ||
isPushSupported(): boolean | ||
getPermissionStatus(onComplete: Action<NotificationPermission>): Promise<NotificationPermission> | ||
requestPermission(): Promise<void> | ||
addEventListener(event: NotificationEventName, listener: (obj: any) => void): void | ||
removeEventListener(event: NotificationEventName, listener: (obj: any) => void): void | ||
[index: string]: any; | ||
setDefaultUrl(url: string): Promise<void>; | ||
setDefaultTitle(title: string): Promise<void>; | ||
isPushSupported(): boolean; | ||
getPermissionStatus(onComplete: Action<NotificationPermission>): Promise<NotificationPermission>; | ||
requestPermission(): Promise<void>; | ||
addEventListener(event: NotificationEventName, listener: (obj: any) => void): void; | ||
removeEventListener(event: NotificationEventName, listener: (obj: any) => void): void; | ||
} | ||
interface IOneSignalSlidedown { | ||
promptPush(options?: AutoPromptOptions): Promise<void> | ||
promptPushCategories(options?: AutoPromptOptions): Promise<void> | ||
promptSms(options?: AutoPromptOptions): Promise<void> | ||
promptEmail(options?: AutoPromptOptions): Promise<void> | ||
promptSmsAndEmail(options?: AutoPromptOptions): Promise<void> | ||
addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void | ||
removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void | ||
[index: string]: any; | ||
promptPush(options?: AutoPromptOptions): Promise<void>; | ||
promptPushCategories(options?: AutoPromptOptions): Promise<void>; | ||
promptSms(options?: AutoPromptOptions): Promise<void>; | ||
promptEmail(options?: AutoPromptOptions): Promise<void>; | ||
promptSmsAndEmail(options?: AutoPromptOptions): Promise<void>; | ||
addEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void; | ||
removeEventListener(event: SlidedownEventName, listener: (wasShown: boolean) => void): void; | ||
} | ||
interface IOneSignalDebug { | ||
setLogLevel(logLevel: string): void | ||
[index: string]: any; | ||
setLogLevel(logLevel: string): void; | ||
} | ||
interface IOneSignalSession { | ||
sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void> | ||
sendUniqueOutcome(outcomeName: string): Promise<void> | ||
[index: string]: any; | ||
sendOutcome(outcomeName: string, outcomeWeight?: number): Promise<void>; | ||
sendUniqueOutcome(outcomeName: string): Promise<void>; | ||
} | ||
interface IOneSignalUser { | ||
addAlias(label: string, id: string): void | ||
addAliases(aliases: { [key: string]: string }): void | ||
removeAlias(label: string): void | ||
removeAliases(labels: string[]): void | ||
addEmail(email: string): void | ||
removeEmail(email: string): void | ||
addSms(smsNumber: string): void | ||
removeSms(smsNumber: string): void | ||
PushSubscription: IOneSignalPushSubscription; | ||
[index: string]: any; | ||
addAlias(label: string, id: string): void; | ||
addAliases(aliases: { [key: string]: string }): void; | ||
removeAlias(label: string): void; | ||
removeAliases(labels: string[]): void; | ||
addEmail(email: string): void; | ||
removeEmail(email: string): void; | ||
addSms(smsNumber: string): void; | ||
removeSms(smsNumber: string): void; | ||
} | ||
interface IOneSignalPushSubscription { | ||
optIn(): Promise<void> | ||
optOut(): Promise<void> | ||
addEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void | ||
removeEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void | ||
[index: string]: any; | ||
id: string | null | undefined; | ||
token: string | null | undefined; | ||
optedIn: boolean | undefined; | ||
optIn(): Promise<void>; | ||
optOut(): Promise<void>; | ||
addEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void; | ||
removeEventListener(event: 'subscriptionChange', listener: (change: SubscriptionChangeEvent) => void): void; | ||
} | ||
@@ -624,2 +621,5 @@ | ||
const PushSubscriptionNamespace: IOneSignalPushSubscription = { | ||
get id(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.id }, | ||
get token(): string | null | undefined { return window.OneSignal?.User?.PushSubscription?.token }, | ||
get optedIn(): boolean | undefined { return window.OneSignal?.User?.PushSubscription?.optedIn }, | ||
optIn: pushSubscriptionOptIn, | ||
@@ -626,0 +626,0 @@ optOut: pushSubscriptionOptOut, |
{ | ||
"name": "@onesignal/onesignal-vue3", | ||
"version": "2.0.0-beta.1", | ||
"version": "2.0.0-beta.2", | ||
"description": "Vue 3 OneSignal Plugin: Make it easy to integrate OneSignal with your Vue App!", | ||
@@ -5,0 +5,0 @@ "author": "rgomezp", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
95834
0