Skip to content

Commit

Permalink
Export all on entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
zengfenfei committed Jun 1, 2017
1 parent 96ababa commit c451b5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 34 deletions.
10 changes: 4 additions & 6 deletions src/Client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RestClient, { SERVER_PRODUCTION, SERVER_SANDBOX, API_VERSION, ClientOptions } from './RestClient';
import RestClient, { ClientOptions } from './RestClient';
import Account from './paths/Account';
import ClientInfo from './paths/ClientInfo';
import Dictionary from './paths/Dictionary';
Expand Down Expand Up @@ -44,9 +44,7 @@ export default class RingCentral extends RestClient {
}

export {
RingCentral, // For commonjs
RingCentral // For commonjs
};

SERVER_PRODUCTION,
SERVER_SANDBOX,
API_VERSION
};
export * from './RestClient';
40 changes: 12 additions & 28 deletions src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import Token, { TokenStore, MemoryTokenStore } from './Token';
import isKnownReqBodyType from 'known-fetch-body';
import RCAccount from './RCAccount';

const SERVER_PRODUCTION = 'https://platform.ringcentral.com';
const SERVER_SANDBOX = 'https://platform.devtest.ringcentral.com';
export const SERVER_PRODUCTION = 'https://platform.ringcentral.com';
export const SERVER_SANDBOX = 'https://platform.devtest.ringcentral.com';

export const API_VERSION = 'v1.0';
export const BASE_URL = '/restapi/';
Expand All @@ -18,15 +18,15 @@ const REVOKE_URL = BASE_URL + 'oauth/revoke';
const AUTHORIZE_URL = BASE_URL + 'oauth/authorize';

// Auth events
const EventLoginStart = 'LoginStart';
const EventLoginSuccess = 'LoginSuccess';
const EventLoginError = 'LoginError';
const EventRefreshStart = 'RefreshStart';
const EventRefreshSuccess = 'RefreshSuccess';
const EventRefreshError = 'RefreshError';
const EventLogoutStart = 'LogoutStart';
const EventLogoutSuccess = 'LogoutSuccess';
const EventLogoutError = 'LogoutError';
export const EventLoginStart = 'LoginStart';
export const EventLoginSuccess = 'LoginSuccess';
export const EventLoginError = 'LoginError';
export const EventRefreshStart = 'RefreshStart';
export const EventRefreshSuccess = 'RefreshSuccess';
export const EventRefreshError = 'RefreshError';
export const EventLogoutStart = 'LogoutStart';
export const EventLogoutSuccess = 'LogoutSuccess';
export const EventLogoutError = 'LogoutError';


/**
Expand Down Expand Up @@ -398,20 +398,4 @@ export interface ClientOptions {
/** Default TokenStore is MemoryTokenStore */
tokenStore?: TokenStore;
handleRateLimit?: boolean;
}


export {
SERVER_PRODUCTION,
SERVER_SANDBOX,

EventLoginStart,
EventLoginSuccess,
EventLoginError,
EventRefreshStart,
EventRefreshSuccess,
EventRefreshError,
EventLogoutStart,
EventLogoutSuccess,
EventLogoutError
};
}

0 comments on commit c451b5b

Please sign in to comment.