pusher-js 7.2.0 → 7.3.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 (35) hide show
  1. package/.github/dependabot.yml +14 -0
  2. package/CHANGELOG.md +4 -0
  3. package/dist/node/pusher.js +2 -2
  4. package/dist/node/pusher.js.map +1 -1
  5. package/dist/react-native/pusher.js +2 -2
  6. package/dist/react-native/pusher.js.map +1 -1
  7. package/dist/web/pusher-with-encryption.js +2 -2
  8. package/dist/web/pusher-with-encryption.js.map +1 -1
  9. package/dist/web/pusher-with-encryption.min.js +2 -2
  10. package/dist/web/pusher-with-encryption.min.js.map +1 -1
  11. package/dist/web/pusher.js +2 -2
  12. package/dist/web/pusher.js.map +1 -1
  13. package/dist/web/pusher.min.js +2 -2
  14. package/dist/web/pusher.min.js.map +1 -1
  15. package/dist/worker/pusher-with-encryption.worker.js +2 -2
  16. package/dist/worker/pusher-with-encryption.worker.js.map +1 -1
  17. package/dist/worker/pusher-with-encryption.worker.min.js +2 -2
  18. package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -1
  19. package/dist/worker/pusher.worker.js +2 -2
  20. package/dist/worker/pusher.worker.js.map +1 -1
  21. package/dist/worker/pusher.worker.min.js +2 -2
  22. package/dist/worker/pusher.worker.min.js.map +1 -1
  23. package/index.d.ts +19 -10
  24. package/package.json +2 -2
  25. package/react-native/index.d.ts +18 -4
  26. package/src/core/auth/options.ts +8 -1
  27. package/src/core/config.ts +3 -6
  28. package/src/core/defaults.ts +4 -5
  29. package/src/core/options.ts +4 -5
  30. package/types/src/core/auth/options.d.ts +3 -1
  31. package/types/src/core/defaults.d.ts +3 -3
  32. package/types/src/core/options.d.ts +3 -3
  33. package/with-encryption/index.d.ts +18 -4
  34. package/worker/index.d.ts +18 -4
  35. package/worker/with-encryption/index.d.ts +18 -4
package/index.d.ts CHANGED
@@ -1,20 +1,29 @@
1
1
  export {
2
2
  DeprecatedAuthOptions,
3
- ChannelAuthorizerGenerator,
3
+ ChannelAuthorizerGenerator
4
4
  } from './types/src/core/auth/deprecated_channel_authorizer';
5
5
  export {
6
- AuthOptions,
6
+ UserAuthenticationOptions,
7
+ ChannelAuthorizationOptions,
7
8
  ChannelAuthorizationHandler,
8
9
  UserAuthenticationHandler,
9
10
  ChannelAuthorizationCallback,
10
- UserAuthenticationCallback,
11
+ UserAuthenticationCallback
11
12
  } from './types/src/core/auth/options';
12
- export { Options } from './types/src/core/options'
13
+ export { Options } from './types/src/core/options';
13
14
 
14
- export {default as Channel} from './types/src/core/channels/channel';
15
- export {default as PresenceChannel} from './types/src/core/channels/presence_channel';
16
- export {default as Members} from './types/src/core/channels/members';
17
- export {default as Runtime} from './types/src/runtimes/interface'
18
- export {default as ConnectionManager} from './types/src/core/connection/connection_manager'
15
+ export { default as Channel } from './types/src/core/channels/channel';
16
+ export { default as PresenceChannel } from './types/src/core/channels/presence_channel';
17
+ export { default as Members } from './types/src/core/channels/members';
18
+ export { default as Runtime } from './types/src/runtimes/interface';
19
+ export { default as ConnectionManager } from './types/src/core/connection/connection_manager';
19
20
 
20
- export {default} from './types/src/core/pusher'
21
+ export { default } from './types/src/core/pusher';
22
+
23
+ // The following types are provided for backward compatability
24
+ export {
25
+ DeprecatedAuthOptions as AuthOptions,
26
+ DeprecatedChannelAuthorizer as Authorizer,
27
+ ChannelAuthorizerGenerator as AuthorizerGenerator
28
+ } from './types/src/core/auth/deprecated_channel_authorizer';
29
+ export { ChannelAuthorizationCallback as AuthorizerCallback } from './types/src/core/auth/options';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pusher-js",
3
- "version": "7.2.0",
3
+ "version": "7.3.0",
4
4
  "description": "Pusher Channels JavaScript library for browsers, React Native, NodeJS and web workers",
5
5
  "main": "dist/node/pusher.js",
6
6
  "browser": "dist/web/pusher.js",
@@ -40,7 +40,7 @@
40
40
  "isomorphic-fetch": "^3.0.0",
41
41
  "jasmine": "^3.8.0",
42
42
  "jasmine-spec-reporter": "^7.0.0",
43
- "karma": "^6.3.4",
43
+ "karma": "^6.4.0",
44
44
  "karma-browserstack-launcher": "^1.6.0",
45
45
  "karma-chrome-launcher": "^3.1.0",
46
46
  "karma-firefox-launcher": "^2.1.1",
@@ -1,8 +1,14 @@
1
1
  export {
2
- Authorizer,
3
- AuthOptions,
4
- AuthorizerGenerator,
5
- AuthorizerCallback,
2
+ DeprecatedAuthOptions,
3
+ ChannelAuthorizerGenerator
4
+ } from '../types/src/core/auth/deprecated_channel_authorizer';
5
+ export {
6
+ UserAuthenticationOptions,
7
+ ChannelAuthorizationOptions,
8
+ ChannelAuthorizationHandler,
9
+ UserAuthenticationHandler,
10
+ ChannelAuthorizationCallback,
11
+ UserAuthenticationCallback
6
12
  } from '../types/src/core/auth/options';
7
13
  export { Options } from '../types/src/core/options';
8
14
 
@@ -13,3 +19,11 @@ export { default as Runtime } from '../types/src/runtimes/interface';
13
19
  export { default as ConnectionManager } from '../types/src/core/connection/connection_manager';
14
20
 
15
21
  export { default } from '../types/src/core/pusher';
22
+
23
+ // The following types are provided for backward compatability
24
+ export {
25
+ DeprecatedAuthOptions as AuthOptions,
26
+ DeprecatedChannelAuthorizer as Authorizer,
27
+ ChannelAuthorizerGenerator as AuthorizerGenerator
28
+ } from '../types/src/core/auth/deprecated_channel_authorizer';
29
+ export { ChannelAuthorizationCallback as AuthorizerCallback } from '../types/src/core/auth/options';
@@ -51,7 +51,7 @@ export type AuthTransportCallback =
51
51
  | ChannelAuthorizationCallback
52
52
  | UserAuthenticationCallback;
53
53
 
54
- export interface AuthOptions<AuthHandler> {
54
+ export interface AuthOptionsT<AuthHandler> {
55
55
  transport: 'ajax' | 'jsonp';
56
56
  endpoint: string;
57
57
  params?: any;
@@ -59,6 +59,13 @@ export interface AuthOptions<AuthHandler> {
59
59
  customHandler?: AuthHandler;
60
60
  }
61
61
 
62
+ export declare type UserAuthenticationOptions = AuthOptionsT<
63
+ UserAuthenticationHandler
64
+ >;
65
+ export declare type ChannelAuthorizationOptions = AuthOptionsT<
66
+ ChannelAuthorizationHandler
67
+ >;
68
+
62
69
  export interface InternalAuthOptions {
63
70
  transport: 'ajax' | 'jsonp';
64
71
  endpoint: string;
@@ -3,7 +3,7 @@ import Defaults from './defaults';
3
3
  import {
4
4
  ChannelAuthorizationHandler,
5
5
  UserAuthenticationHandler,
6
- AuthOptions
6
+ ChannelAuthorizationOptions
7
7
  } from './auth/options';
8
8
  import UserAuthenticator from './auth/user_authenticator';
9
9
  import ChannelAuthorizer from './auth/channel_authorizer';
@@ -150,11 +150,8 @@ function buildUserAuthenticator(opts: Options): UserAuthenticationHandler {
150
150
  return UserAuthenticator(userAuthentication);
151
151
  }
152
152
 
153
- function buildChannelAuth(
154
- opts: Options,
155
- pusher
156
- ): AuthOptions<ChannelAuthorizationHandler> {
157
- let channelAuthorization: AuthOptions<ChannelAuthorizationHandler>;
153
+ function buildChannelAuth(opts: Options, pusher): ChannelAuthorizationOptions {
154
+ let channelAuthorization: ChannelAuthorizationOptions;
158
155
  if ('channelAuthorization' in opts) {
159
156
  channelAuthorization = {
160
157
  ...Defaults.channelAuthorization,
@@ -1,7 +1,6 @@
1
1
  import {
2
- AuthOptions,
3
- ChannelAuthorizationHandler,
4
- UserAuthenticationHandler
2
+ ChannelAuthorizationOptions,
3
+ UserAuthenticationOptions
5
4
  } from './auth/options';
6
5
  import { AuthTransport } from './config';
7
6
 
@@ -22,8 +21,8 @@ export interface DefaultConfig {
22
21
  pongTimeout: number;
23
22
  unavailableTimeout: number;
24
23
  cluster: string;
25
- userAuthentication: AuthOptions<UserAuthenticationHandler>;
26
- channelAuthorization: AuthOptions<ChannelAuthorizationHandler>;
24
+ userAuthentication: UserAuthenticationOptions;
25
+ channelAuthorization: ChannelAuthorizationOptions;
27
26
 
28
27
  cdn_http?: string;
29
28
  cdn_https?: string;
@@ -1,8 +1,7 @@
1
1
  import ConnectionManager from './connection/connection_manager';
2
2
  import {
3
- AuthOptions,
4
- ChannelAuthorizationHandler,
5
- UserAuthenticationHandler
3
+ ChannelAuthorizationOptions,
4
+ UserAuthenticationOptions
6
5
  } from './auth/options';
7
6
  import {
8
7
  ChannelAuthorizerGenerator,
@@ -19,8 +18,8 @@ export interface Options {
19
18
  authTransport?: AuthTransport; // DEPRECATED use channelAuthorization instead
20
19
  authorizer?: ChannelAuthorizerGenerator; // DEPRECATED use channelAuthorization instead
21
20
 
22
- channelAuthorization?: AuthOptions<ChannelAuthorizationHandler>;
23
- userAuthentication?: AuthOptions<UserAuthenticationHandler>;
21
+ channelAuthorization?: ChannelAuthorizationOptions;
22
+ userAuthentication?: UserAuthenticationOptions;
24
23
 
25
24
  cluster?: string;
26
25
  enableStats?: boolean;
@@ -27,13 +27,15 @@ export interface UserAuthenticationHandler {
27
27
  (params: UserAuthenticationRequestParams, callback: UserAuthenticationCallback): void;
28
28
  }
29
29
  export declare type AuthTransportCallback = ChannelAuthorizationCallback | UserAuthenticationCallback;
30
- export interface AuthOptions<AuthHandler> {
30
+ export interface AuthOptionsT<AuthHandler> {
31
31
  transport: 'ajax' | 'jsonp';
32
32
  endpoint: string;
33
33
  params?: any;
34
34
  headers?: any;
35
35
  customHandler?: AuthHandler;
36
36
  }
37
+ export declare type UserAuthenticationOptions = AuthOptionsT<UserAuthenticationHandler>;
38
+ export declare type ChannelAuthorizationOptions = AuthOptionsT<ChannelAuthorizationHandler>;
37
39
  export interface InternalAuthOptions {
38
40
  transport: 'ajax' | 'jsonp';
39
41
  endpoint: string;
@@ -1,4 +1,4 @@
1
- import { AuthOptions, ChannelAuthorizationHandler, UserAuthenticationHandler } from './auth/options';
1
+ import { ChannelAuthorizationOptions, UserAuthenticationOptions } from './auth/options';
2
2
  import { AuthTransport } from './config';
3
3
  export interface DefaultConfig {
4
4
  VERSION: string;
@@ -17,8 +17,8 @@ export interface DefaultConfig {
17
17
  pongTimeout: number;
18
18
  unavailableTimeout: number;
19
19
  cluster: string;
20
- userAuthentication: AuthOptions<UserAuthenticationHandler>;
21
- channelAuthorization: AuthOptions<ChannelAuthorizationHandler>;
20
+ userAuthentication: UserAuthenticationOptions;
21
+ channelAuthorization: ChannelAuthorizationOptions;
22
22
  cdn_http?: string;
23
23
  cdn_https?: string;
24
24
  dependency_suffix?: string;
@@ -1,4 +1,4 @@
1
- import { AuthOptions, ChannelAuthorizationHandler, UserAuthenticationHandler } from './auth/options';
1
+ import { ChannelAuthorizationOptions, UserAuthenticationOptions } from './auth/options';
2
2
  import { ChannelAuthorizerGenerator, DeprecatedAuthOptions } from './auth/deprecated_channel_authorizer';
3
3
  import { AuthTransport, Transport } from './config';
4
4
  import * as nacl from 'tweetnacl';
@@ -8,8 +8,8 @@ export interface Options {
8
8
  authEndpoint?: string;
9
9
  authTransport?: AuthTransport;
10
10
  authorizer?: ChannelAuthorizerGenerator;
11
- channelAuthorization?: AuthOptions<ChannelAuthorizationHandler>;
12
- userAuthentication?: AuthOptions<UserAuthenticationHandler>;
11
+ channelAuthorization?: ChannelAuthorizationOptions;
12
+ userAuthentication?: UserAuthenticationOptions;
13
13
  cluster?: string;
14
14
  enableStats?: boolean;
15
15
  disableStats?: boolean;
@@ -1,8 +1,14 @@
1
1
  export {
2
- Authorizer,
3
- AuthOptions,
4
- AuthorizerGenerator,
5
- AuthorizerCallback
2
+ DeprecatedAuthOptions,
3
+ ChannelAuthorizerGenerator
4
+ } from '../types/src/core/auth/deprecated_channel_authorizer';
5
+ export {
6
+ ChannelAuthorizationOptions,
7
+ UserAuthenticationOptions,
8
+ ChannelAuthorizationHandler,
9
+ UserAuthenticationHandler,
10
+ ChannelAuthorizationCallback,
11
+ UserAuthenticationCallback
6
12
  } from '../types/src/core/auth/options';
7
13
  export { Options } from '../types/src/core/options';
8
14
 
@@ -13,3 +19,11 @@ export { default as Runtime } from '../types/src/runtimes/interface';
13
19
  export { default as ConnectionManager } from '../types/src/core/connection/connection_manager';
14
20
 
15
21
  export { default } from '../types/src/core/pusher';
22
+
23
+ // The following types are provided for backward compatability
24
+ export {
25
+ DeprecatedAuthOptions as AuthOptions,
26
+ DeprecatedChannelAuthorizer as Authorizer,
27
+ ChannelAuthorizerGenerator as AuthorizerGenerator
28
+ } from '../types/src/core/auth/deprecated_channel_authorizer';
29
+ export { ChannelAuthorizationCallback as AuthorizerCallback } from '../types/src/core/auth/options';
package/worker/index.d.ts CHANGED
@@ -1,8 +1,14 @@
1
1
  export {
2
- Authorizer,
3
- AuthOptions,
4
- AuthorizerGenerator,
5
- AuthorizerCallback,
2
+ DeprecatedAuthOptions,
3
+ ChannelAuthorizerGenerator
4
+ } from '../types/src/core/auth/deprecated_channel_authorizer';
5
+ export {
6
+ ChannelAuthorizationOptions,
7
+ UserAuthenticationOptions,
8
+ ChannelAuthorizationHandler,
9
+ UserAuthenticationHandler,
10
+ ChannelAuthorizationCallback,
11
+ UserAuthenticationCallback
6
12
  } from '../types/src/core/auth/options';
7
13
  export { Options } from '../types/src/core/options';
8
14
 
@@ -13,3 +19,11 @@ export { default as Runtime } from '../types/src/runtimes/interface';
13
19
  export { default as ConnectionManager } from '../types/src/core/connection/connection_manager';
14
20
 
15
21
  export { default } from '../types/src/core/pusher';
22
+
23
+ // The following types are provided for backward compatability
24
+ export {
25
+ DeprecatedAuthOptions as AuthOptions,
26
+ DeprecatedChannelAuthorizer as Authorizer,
27
+ ChannelAuthorizerGenerator as AuthorizerGenerator
28
+ } from '../types/src/core/auth/deprecated_channel_authorizer';
29
+ export { ChannelAuthorizationCallback as AuthorizerCallback } from '../types/src/core/auth/options';
@@ -1,8 +1,14 @@
1
1
  export {
2
- Authorizer,
3
- AuthOptions,
4
- AuthorizerGenerator,
5
- AuthorizerCallback,
2
+ DeprecatedAuthOptions,
3
+ ChannelAuthorizerGenerator
4
+ } from '../../types/src/core/auth/deprecated_channel_authorizer';
5
+ export {
6
+ ChannelAuthorizationOptions,
7
+ UserAuthenticationOptions,
8
+ ChannelAuthorizationHandler,
9
+ UserAuthenticationHandler,
10
+ ChannelAuthorizationCallback,
11
+ UserAuthenticationCallback
6
12
  } from '../../types/src/core/auth/options';
7
13
  export { Options } from '../../types/src/core/options';
8
14
 
@@ -13,3 +19,11 @@ export { default as Runtime } from '../../types/src/runtimes/interface';
13
19
  export { default as ConnectionManager } from '../../types/src/core/connection/connection_manager';
14
20
 
15
21
  export { default } from '../../types/src/core/pusher';
22
+
23
+ // The following types are provided for backward compatability
24
+ export {
25
+ DeprecatedAuthOptions as AuthOptions,
26
+ DeprecatedChannelAuthorizer as Authorizer,
27
+ ChannelAuthorizerGenerator as AuthorizerGenerator
28
+ } from '../../types/src/core/auth/deprecated_channel_authorizer';
29
+ export { ChannelAuthorizationCallback as AuthorizerCallback } from '../../types/src/core/auth/options';