-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(shared-worker): migrate to shared worker
Use `SharedWorker` instead of `Service Worker` for better PubNub client instances feedback. feat(shared-worker): add worker log verbosity flag Add configuration option to enable debug log output from the subscription `SharedWorker`. refactor: add declarations generation Create types declaration files.
- Loading branch information
Showing
243 changed files
with
5,035 additions
and
1,168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"parser" : "typescript", | ||
"semi": true, | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export declare class AbortError extends Error { | ||
name: string; | ||
constructor(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export namespace mode { | ||
let ECB: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { CryptorConfiguration } from '../../interfaces/crypto-module'; | ||
import { Payload } from '../../types/api'; | ||
type CryptoConfiguration = { | ||
encryptKey?: boolean; | ||
keyEncoding?: 'hex' | 'utf8' | 'base64' | 'binary'; | ||
keyLength?: 128 | 256; | ||
mode?: 'ecb' | 'cbc'; | ||
}; | ||
export default class { | ||
private readonly configuration; | ||
private iv; | ||
private allowedKeyEncodings; | ||
private allowedKeyLengths; | ||
private allowedModes; | ||
private readonly defaultOptions; | ||
constructor(configuration: CryptorConfiguration); | ||
HMACSHA256(data: string): string; | ||
SHA256(data: string): string; | ||
encrypt(data: string | Payload, customCipherKey?: string, options?: CryptoConfiguration): string; | ||
decrypt(data: string, customCipherKey?: string, options?: CryptoConfiguration): Payload | null; | ||
private pnEncrypt; | ||
private pnDecrypt; | ||
private parseOptions; | ||
private decodeKey; | ||
private getPaddedKey; | ||
private getMode; | ||
private getIV; | ||
private getRandomIV; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default class _default { | ||
constructor({ config }: { | ||
config: any; | ||
}); | ||
_config: any; | ||
hashHistory: any[]; | ||
getKey(message: any): string; | ||
isDuplicate(message: any): boolean; | ||
addEntry(message: any): void; | ||
clearHistory(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import * as Subscription from '../types/api/subscription'; | ||
import { Status, StatusEvent } from '../types/api'; | ||
export type Listener = { | ||
message?: (message: Subscription.Message) => void; | ||
signal?: (signal: Subscription.Signal) => void; | ||
presence?: (presence: Subscription.Presence) => void; | ||
objects?: (object: Subscription.AppContextObject) => void; | ||
messageAction?: (action: Subscription.MessageAction) => void; | ||
file?: (file: Subscription.File) => void; | ||
status?: (status: Status | StatusEvent) => void; | ||
user?: (user: Subscription.UserAppContextObject) => void; | ||
space?: (space: Subscription.SpaceAppContextObject) => void; | ||
membership?: (membership: Subscription.VSPMembershipAppContextObject) => void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
type APNSPayload = { | ||
aps: { | ||
alert?: { | ||
title?: string; | ||
subtitle?: string; | ||
body?: string; | ||
}; | ||
badge?: number | null; | ||
sound?: string; | ||
'content-available'?: 1; | ||
}; | ||
pn_push: PubNubAPNS2Configuration[]; | ||
}; | ||
type APNS2Configuration = { | ||
collapseId?: string; | ||
expirationDate?: Date; | ||
targets: APNS2Target[]; | ||
}; | ||
type PubNubAPNS2Configuration = { | ||
auth_method: 'token'; | ||
targets: PubNubAPNS2Target[]; | ||
collapse_id?: string; | ||
expiration?: string; | ||
version: 'v2'; | ||
}; | ||
type APNS2Target = { | ||
topic: string; | ||
environment?: 'development' | 'production'; | ||
excludedDevices?: string[]; | ||
}; | ||
type PubNubAPNS2Target = Omit<APNS2Target, 'excludedDevices'> & { | ||
excluded_devices?: string[]; | ||
}; | ||
type FCMPayload = { | ||
notification?: { | ||
title?: string; | ||
body?: string; | ||
icon?: string; | ||
sound?: string; | ||
tag?: string; | ||
}; | ||
data?: { | ||
notification?: FCMPayload['notification']; | ||
}; | ||
}; | ||
declare class BaseNotificationPayload { | ||
protected _title?: string; | ||
protected _subtitle?: string; | ||
protected _sound?: string; | ||
protected _badge?: number | null; | ||
protected _body?: string; | ||
protected _payload: unknown; | ||
constructor(payload: unknown, title?: string, body?: string); | ||
get payload(): unknown; | ||
set title(value: string | undefined); | ||
set subtitle(value: string | undefined); | ||
set body(value: string | undefined); | ||
set badge(value: number | null | undefined); | ||
set sound(value: string | undefined); | ||
protected setDefaultPayloadStructure(): void; | ||
toObject(): unknown; | ||
} | ||
export declare class APNSNotificationPayload extends BaseNotificationPayload { | ||
private _configurations?; | ||
private _apnsPushType; | ||
private _isSilent; | ||
get payload(): APNSPayload; | ||
set configurations(value: APNS2Configuration[]); | ||
get notification(): { | ||
alert?: { | ||
title?: string | undefined; | ||
subtitle?: string | undefined; | ||
body?: string | undefined; | ||
} | undefined; | ||
badge?: number | null | undefined; | ||
sound?: string | undefined; | ||
'content-available'?: 1 | undefined; | ||
}; | ||
get title(): string | undefined; | ||
set title(value: string | undefined); | ||
get subtitle(): string | undefined; | ||
set subtitle(value: string | undefined); | ||
get body(): string | undefined; | ||
set body(value: string | undefined); | ||
get badge(): number | null | undefined; | ||
set badge(value: number | null | undefined); | ||
get sound(): string | undefined; | ||
set sound(value: string | undefined); | ||
set silent(value: boolean); | ||
protected setDefaultPayloadStructure(): void; | ||
toObject(): APNSPayload | null; | ||
private objectFromAPNS2Configuration; | ||
private objectFromAPNSTarget; | ||
} | ||
export declare class FCMNotificationPayload extends BaseNotificationPayload { | ||
private _isSilent?; | ||
private _icon?; | ||
private _tag?; | ||
get payload(): FCMPayload; | ||
get notification(): { | ||
title?: string | undefined; | ||
body?: string | undefined; | ||
icon?: string | undefined; | ||
sound?: string | undefined; | ||
tag?: string | undefined; | ||
} | undefined; | ||
get data(): { | ||
notification?: { | ||
title?: string | undefined; | ||
body?: string | undefined; | ||
icon?: string | undefined; | ||
sound?: string | undefined; | ||
tag?: string | undefined; | ||
} | undefined; | ||
} | undefined; | ||
get title(): string | undefined; | ||
set title(value: string | undefined); | ||
get body(): string | undefined; | ||
set body(value: string | undefined); | ||
get sound(): string | undefined; | ||
set sound(value: string | undefined); | ||
get icon(): string | undefined; | ||
set icon(value: string | undefined); | ||
get tag(): string | undefined; | ||
set tag(value: string | undefined); | ||
set silent(value: boolean); | ||
protected setDefaultPayloadStructure(): void; | ||
toObject(): FCMPayload | null; | ||
} | ||
declare class NotificationsPayload { | ||
private readonly _payload; | ||
private _debugging?; | ||
private readonly _title; | ||
private _subtitle?; | ||
private readonly _body; | ||
private _badge?; | ||
private _sound?; | ||
apns: APNSNotificationPayload; | ||
fcm: FCMNotificationPayload; | ||
constructor(title: string, body: string); | ||
set debugging(value: boolean); | ||
get title(): string; | ||
get subtitle(): string | undefined; | ||
set subtitle(value: string | undefined); | ||
get body(): string; | ||
get badge(): number | undefined; | ||
set badge(value: number | undefined); | ||
get sound(): string | undefined; | ||
set sound(value: string | undefined); | ||
buildPayload(platforms: string[]): { | ||
pn_apns?: APNSPayload | undefined; | ||
pn_gcm?: FCMPayload | undefined; | ||
pn_debug?: boolean | undefined; | ||
}; | ||
} | ||
export default NotificationsPayload; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
declare const _default: { | ||
createUUID(): any; | ||
}; | ||
export default _default; |
Oops, something went wrong.