Skip to content

Commit

Permalink
Merge pull request #615 from pusher/unremove-previously-exported-types
Browse files Browse the repository at this point in the history
Fix: Restore previously exported types
  • Loading branch information
MeenaAlfons authored Jul 22, 2022
2 parents 0585534 + 88503a1 commit 7024cc8
Show file tree
Hide file tree
Showing 34 changed files with 154 additions and 81 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 7.3.0

* [FIXED] Restore previously exported types

## 7.2.0

* [ADDED] Add support for subscription_count event
Expand Down
4 changes: 2 additions & 2 deletions dist/node/pusher.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/node/pusher.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/react-native/pusher.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/react-native/pusher.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web/pusher-with-encryption.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web/pusher-with-encryption.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web/pusher-with-encryption.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/web/pusher-with-encryption.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web/pusher.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/web/pusher.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/web/pusher.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/web/pusher.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/worker/pusher-with-encryption.worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/worker/pusher-with-encryption.worker.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/worker/pusher-with-encryption.worker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/worker/pusher-with-encryption.worker.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/worker/pusher.worker.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/worker/pusher.worker.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/worker/pusher.worker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/worker/pusher.worker.min.js.map

Large diffs are not rendered by default.

29 changes: 19 additions & 10 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
export {
DeprecatedAuthOptions,
ChannelAuthorizerGenerator,
ChannelAuthorizerGenerator
} from './types/src/core/auth/deprecated_channel_authorizer';
export {
AuthOptions,
UserAuthenticationOptions,
ChannelAuthorizationOptions,
ChannelAuthorizationHandler,
UserAuthenticationHandler,
ChannelAuthorizationCallback,
UserAuthenticationCallback,
UserAuthenticationCallback
} from './types/src/core/auth/options';
export { Options } from './types/src/core/options'
export { Options } from './types/src/core/options';

export {default as Channel} from './types/src/core/channels/channel';
export {default as PresenceChannel} from './types/src/core/channels/presence_channel';
export {default as Members} from './types/src/core/channels/members';
export {default as Runtime} from './types/src/runtimes/interface'
export {default as ConnectionManager} from './types/src/core/connection/connection_manager'
export { default as Channel } from './types/src/core/channels/channel';
export { default as PresenceChannel } from './types/src/core/channels/presence_channel';
export { default as Members } from './types/src/core/channels/members';
export { default as Runtime } from './types/src/runtimes/interface';
export { default as ConnectionManager } from './types/src/core/connection/connection_manager';

export {default} from './types/src/core/pusher'
export { default } from './types/src/core/pusher';

// The following types are provided for backward compatability
export {
DeprecatedAuthOptions as AuthOptions,
DeprecatedChannelAuthorizer as Authorizer,
ChannelAuthorizerGenerator as AuthorizerGenerator
} from './types/src/core/auth/deprecated_channel_authorizer';
export { ChannelAuthorizationCallback as AuthorizerCallback } from './types/src/core/auth/options';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pusher-js",
"version": "7.2.0",
"version": "7.3.0",
"description": "Pusher Channels JavaScript library for browsers, React Native, NodeJS and web workers",
"main": "dist/node/pusher.js",
"browser": "dist/web/pusher.js",
Expand Down
22 changes: 18 additions & 4 deletions react-native/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
export {
Authorizer,
AuthOptions,
AuthorizerGenerator,
AuthorizerCallback,
DeprecatedAuthOptions,
ChannelAuthorizerGenerator
} from '../types/src/core/auth/deprecated_channel_authorizer';
export {
UserAuthenticationOptions,
ChannelAuthorizationOptions,
ChannelAuthorizationHandler,
UserAuthenticationHandler,
ChannelAuthorizationCallback,
UserAuthenticationCallback
} from '../types/src/core/auth/options';
export { Options } from '../types/src/core/options';

Expand All @@ -13,3 +19,11 @@ export { default as Runtime } from '../types/src/runtimes/interface';
export { default as ConnectionManager } from '../types/src/core/connection/connection_manager';

export { default } from '../types/src/core/pusher';

// The following types are provided for backward compatability
export {
DeprecatedAuthOptions as AuthOptions,
DeprecatedChannelAuthorizer as Authorizer,
ChannelAuthorizerGenerator as AuthorizerGenerator
} from '../types/src/core/auth/deprecated_channel_authorizer';
export { ChannelAuthorizationCallback as AuthorizerCallback } from '../types/src/core/auth/options';
9 changes: 8 additions & 1 deletion src/core/auth/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,21 @@ export type AuthTransportCallback =
| ChannelAuthorizationCallback
| UserAuthenticationCallback;

export interface AuthOptions<AuthHandler> {
export interface AuthOptionsT<AuthHandler> {
transport: 'ajax' | 'jsonp';
endpoint: string;
params?: any;
headers?: any;
customHandler?: AuthHandler;
}

export declare type UserAuthenticationOptions = AuthOptionsT<
UserAuthenticationHandler
>;
export declare type ChannelAuthorizationOptions = AuthOptionsT<
ChannelAuthorizationHandler
>;

export interface InternalAuthOptions {
transport: 'ajax' | 'jsonp';
endpoint: string;
Expand Down
9 changes: 3 additions & 6 deletions src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Defaults from './defaults';
import {
ChannelAuthorizationHandler,
UserAuthenticationHandler,
AuthOptions
ChannelAuthorizationOptions
} from './auth/options';
import UserAuthenticator from './auth/user_authenticator';
import ChannelAuthorizer from './auth/channel_authorizer';
Expand Down Expand Up @@ -150,11 +150,8 @@ function buildUserAuthenticator(opts: Options): UserAuthenticationHandler {
return UserAuthenticator(userAuthentication);
}

function buildChannelAuth(
opts: Options,
pusher
): AuthOptions<ChannelAuthorizationHandler> {
let channelAuthorization: AuthOptions<ChannelAuthorizationHandler>;
function buildChannelAuth(opts: Options, pusher): ChannelAuthorizationOptions {
let channelAuthorization: ChannelAuthorizationOptions;
if ('channelAuthorization' in opts) {
channelAuthorization = {
...Defaults.channelAuthorization,
Expand Down
9 changes: 4 additions & 5 deletions src/core/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
AuthOptions,
ChannelAuthorizationHandler,
UserAuthenticationHandler
ChannelAuthorizationOptions,
UserAuthenticationOptions
} from './auth/options';
import { AuthTransport } from './config';

Expand All @@ -22,8 +21,8 @@ export interface DefaultConfig {
pongTimeout: number;
unavailableTimeout: number;
cluster: string;
userAuthentication: AuthOptions<UserAuthenticationHandler>;
channelAuthorization: AuthOptions<ChannelAuthorizationHandler>;
userAuthentication: UserAuthenticationOptions;
channelAuthorization: ChannelAuthorizationOptions;

cdn_http?: string;
cdn_https?: string;
Expand Down
9 changes: 4 additions & 5 deletions src/core/options.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import ConnectionManager from './connection/connection_manager';
import {
AuthOptions,
ChannelAuthorizationHandler,
UserAuthenticationHandler
ChannelAuthorizationOptions,
UserAuthenticationOptions
} from './auth/options';
import {
ChannelAuthorizerGenerator,
Expand All @@ -19,8 +18,8 @@ export interface Options {
authTransport?: AuthTransport; // DEPRECATED use channelAuthorization instead
authorizer?: ChannelAuthorizerGenerator; // DEPRECATED use channelAuthorization instead

channelAuthorization?: AuthOptions<ChannelAuthorizationHandler>;
userAuthentication?: AuthOptions<UserAuthenticationHandler>;
channelAuthorization?: ChannelAuthorizationOptions;
userAuthentication?: UserAuthenticationOptions;

cluster?: string;
enableStats?: boolean;
Expand Down
4 changes: 3 additions & 1 deletion types/src/core/auth/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export interface UserAuthenticationHandler {
(params: UserAuthenticationRequestParams, callback: UserAuthenticationCallback): void;
}
export declare type AuthTransportCallback = ChannelAuthorizationCallback | UserAuthenticationCallback;
export interface AuthOptions<AuthHandler> {
export interface AuthOptionsT<AuthHandler> {
transport: 'ajax' | 'jsonp';
endpoint: string;
params?: any;
headers?: any;
customHandler?: AuthHandler;
}
export declare type UserAuthenticationOptions = AuthOptionsT<UserAuthenticationHandler>;
export declare type ChannelAuthorizationOptions = AuthOptionsT<ChannelAuthorizationHandler>;
export interface InternalAuthOptions {
transport: 'ajax' | 'jsonp';
endpoint: string;
Expand Down
6 changes: 3 additions & 3 deletions types/src/core/defaults.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthOptions, ChannelAuthorizationHandler, UserAuthenticationHandler } from './auth/options';
import { ChannelAuthorizationOptions, UserAuthenticationOptions } from './auth/options';
import { AuthTransport } from './config';
export interface DefaultConfig {
VERSION: string;
Expand All @@ -17,8 +17,8 @@ export interface DefaultConfig {
pongTimeout: number;
unavailableTimeout: number;
cluster: string;
userAuthentication: AuthOptions<UserAuthenticationHandler>;
channelAuthorization: AuthOptions<ChannelAuthorizationHandler>;
userAuthentication: UserAuthenticationOptions;
channelAuthorization: ChannelAuthorizationOptions;
cdn_http?: string;
cdn_https?: string;
dependency_suffix?: string;
Expand Down
6 changes: 3 additions & 3 deletions types/src/core/options.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthOptions, ChannelAuthorizationHandler, UserAuthenticationHandler } from './auth/options';
import { ChannelAuthorizationOptions, UserAuthenticationOptions } from './auth/options';
import { ChannelAuthorizerGenerator, DeprecatedAuthOptions } from './auth/deprecated_channel_authorizer';
import { AuthTransport, Transport } from './config';
import * as nacl from 'tweetnacl';
Expand All @@ -8,8 +8,8 @@ export interface Options {
authEndpoint?: string;
authTransport?: AuthTransport;
authorizer?: ChannelAuthorizerGenerator;
channelAuthorization?: AuthOptions<ChannelAuthorizationHandler>;
userAuthentication?: AuthOptions<UserAuthenticationHandler>;
channelAuthorization?: ChannelAuthorizationOptions;
userAuthentication?: UserAuthenticationOptions;
cluster?: string;
enableStats?: boolean;
disableStats?: boolean;
Expand Down
22 changes: 18 additions & 4 deletions with-encryption/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
export {
Authorizer,
AuthOptions,
AuthorizerGenerator,
AuthorizerCallback
DeprecatedAuthOptions,
ChannelAuthorizerGenerator
} from '../types/src/core/auth/deprecated_channel_authorizer';
export {
ChannelAuthorizationOptions,
UserAuthenticationOptions,
ChannelAuthorizationHandler,
UserAuthenticationHandler,
ChannelAuthorizationCallback,
UserAuthenticationCallback
} from '../types/src/core/auth/options';
export { Options } from '../types/src/core/options';

Expand All @@ -13,3 +19,11 @@ export { default as Runtime } from '../types/src/runtimes/interface';
export { default as ConnectionManager } from '../types/src/core/connection/connection_manager';

export { default } from '../types/src/core/pusher';

// The following types are provided for backward compatability
export {
DeprecatedAuthOptions as AuthOptions,
DeprecatedChannelAuthorizer as Authorizer,
ChannelAuthorizerGenerator as AuthorizerGenerator
} from '../types/src/core/auth/deprecated_channel_authorizer';
export { ChannelAuthorizationCallback as AuthorizerCallback } from '../types/src/core/auth/options';
22 changes: 18 additions & 4 deletions worker/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
export {
Authorizer,
AuthOptions,
AuthorizerGenerator,
AuthorizerCallback,
DeprecatedAuthOptions,
ChannelAuthorizerGenerator
} from '../types/src/core/auth/deprecated_channel_authorizer';
export {
ChannelAuthorizationOptions,
UserAuthenticationOptions,
ChannelAuthorizationHandler,
UserAuthenticationHandler,
ChannelAuthorizationCallback,
UserAuthenticationCallback
} from '../types/src/core/auth/options';
export { Options } from '../types/src/core/options';

Expand All @@ -13,3 +19,11 @@ export { default as Runtime } from '../types/src/runtimes/interface';
export { default as ConnectionManager } from '../types/src/core/connection/connection_manager';

export { default } from '../types/src/core/pusher';

// The following types are provided for backward compatability
export {
DeprecatedAuthOptions as AuthOptions,
DeprecatedChannelAuthorizer as Authorizer,
ChannelAuthorizerGenerator as AuthorizerGenerator
} from '../types/src/core/auth/deprecated_channel_authorizer';
export { ChannelAuthorizationCallback as AuthorizerCallback } from '../types/src/core/auth/options';
Loading

0 comments on commit 7024cc8

Please sign in to comment.