Skip to content

Commit

Permalink
Better namespaces: RC.* instead of RC.*.*
Browse files Browse the repository at this point in the history
  • Loading branch information
kirill-konshin committed Feb 26, 2019
1 parent f929a46 commit 6f7f817
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 19 deletions.
2 changes: 1 addition & 1 deletion demo/src/apiKey.html
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ <h1>

appKeyField.value = platform._appKey;
appSecretField.value = platform._appSecret;
serverField.value = platform._server || RingCentral.sdk.SDK.server.sandbox;
serverField.value = platform._server || RingCentral.SDK.server.sandbox;

}

Expand Down
2 changes: 1 addition & 1 deletion demo/src/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ <h1>
(function() {

var sdk = getSDK();
var subscriptions = new RingCentral.subscriptions.Subscriptions({sdk: sdk});
var subscriptions = new RingCentral.Subscriptions({sdk: sdk});
var platform = sdk.platform();

function showExtension() {
Expand Down
2 changes: 1 addition & 1 deletion demo/src/facebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h1>
function createSDK() {
// https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/
// https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/#exchangecode
sdk = new RingCentral.sdk.SDK({
sdk = new RingCentral.SDK({
server: 'https://graph.facebook.com',
authorizeEndpoint: 'https://facebook.com/v3.2/dialog/oauth',
tokenEndpoint: '/v3.2/oauth/access_token',
Expand Down
2 changes: 1 addition & 1 deletion demo/src/oauth/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<script src="../../node_modules/@ringcentral/sdk/dist/ringcentral.js" type="text/javascript"></script>
<script type="text/javascript">

RingCentral.sdk.SDK.handleLoginRedirect();
RingCentral.SDK.handleLoginRedirect();

</script>
</body>
Expand Down
4 changes: 2 additions & 2 deletions demo/src/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
}
}

var sdk = new RingCentral.sdk.SDK({
var sdk = new RingCentral.SDK({
server: server,
appKey: appKey,
appSecret: appSecret,
appName: 'Demo',
appVersion: RingCentral.sdk.SDK.version,
appVersion: RingCentral.SDK.version,
redirectUri: decodeURIComponent(window.location.href.split('login', 1) + 'oauth/redirect.html')
});

Expand Down
10 changes: 5 additions & 5 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ Add the following to your HTML:
<script type="text/javascript" src="path-to-scripts/ringcentral.js"></script><!-- or ringcentral.min.js -->
<script type="text/javascript">
var rcsdk = new RingCentral.sdk.SDK({
server: RingCentral.sdk.SDK.server.sandbox,
var rcsdk = new RingCentral.SDK({
server: RingCentral.SDK.server.sandbox,
appKey: 'yourAppKey',
appSecret: 'yourAppSecret',
redirectUri: '' // optional, but is required for Implicit Grant and Authorization Code OAuth Flows (see below)
Expand Down Expand Up @@ -184,7 +184,7 @@ rcsdk
In this case your landing page (the one to which Redirect URI points) need to call the following code:

```js
RingCentral.sdk.SDK.handleLoginRedirect();
RingCentral.SDK.handleLoginRedirect();
```

#### Difference between Authorization Code and Implicit Grant flows
Expand Down Expand Up @@ -803,10 +803,10 @@ var FormData = require('form-data'),
formData = new FormData();

// This is the mandatory part, the name and type should always be as follows
formData.append('json', new Buffer(JSON.stringify(body)), {filename: 'request.json', contentType: 'application/json'});
formData.append('json', Buffer(JSON.stringify(body)), {filename: 'request.json', contentType: 'application/json'});

// To send a plain text
formData.append('attachment', new Buffer('some plain text'), {filename: 'text.txt', contentType: 'text/plain'});
formData.append('attachment', Buffer('some plain text'), {filename: 'text.txt', contentType: 'text/plain'});

// To send a file from file system
formData.append('attachment', require('fs').createReadStream('/foo/bar.jpg'));
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/SDK-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {expect, SDK, spy} from './test/test';

describe('RingCentral.sdk.SDK', () => {
describe('RingCentral.SDK', () => {
const test = async (suite, server) => {
suite.timeout(10000); // Per SLA should be 3 seconds

Expand Down
2 changes: 1 addition & 1 deletion sdk/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ module.exports = createConfig({
filename: 'ringcentral',
entry: './src/SDK.ts',
outputPath: path.resolve(__dirname, 'dist'),
libraryName: 'sdk',
libraryName: 'SDK',
});
6 changes: 3 additions & 3 deletions subscriptions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ Add the following to your HTML:
<script type="text/javascript" src="path-to-scripts/ringcentral-subscriptions.js"></script>
<script type="text/javascript">
var sdk = new RingCentral.sdk.SDK({
server: RingCentral.sdk.SDK.server.sandbox,
var sdk = new RingCentral.SDK({
server: RingCentral.SDK.server.sandbox,
appKey: 'yourAppKey',
appSecret: 'yourAppSecret',
redirectUri: '' // optional, but is required for Implicit Grant and Authorization Code OAuth Flows (see below)
});
var subscriptions = new RingCentral.subscriptions.Subscriptions({
var subscriptions = new RingCentral.Subscriptions({
sdk: sdk
});
Expand Down
2 changes: 1 addition & 1 deletion subscriptions/src/subscription/CachedSubscription-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {asyncTest, expect} from '@ringcentral/sdk/lib/test/test';
import {createSubscriptions} from '../test/test';

describe('RingCentral.subscription.CachedSubscription', () => {
describe('CachedSubscription', () => {
describe('create', () => {
it(
'supports legacy definition',
Expand Down
2 changes: 1 addition & 1 deletion subscriptions/src/subscription/Subscription-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const createSubscription = sdk =>
renewHandicapMs,
});

describe('RingCentral.subscription.Subscription', () => {
describe('Subscription', () => {
describe('register', () => {
it(
'automatically renews subscription',
Expand Down
2 changes: 1 addition & 1 deletion subscriptions/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module.exports = createConfig({
filename: 'ringcentral-subscriptions',
entry: './src/Subscriptions.ts',
outputPath: path.resolve(__dirname, 'dist'),
libraryName: 'subscriptions',
libraryName: 'Subscriptions',
externals: {
'@ringcentral/sdk': {
commonjs: '@ringcentral/sdk',
Expand Down
1 change: 1 addition & 0 deletions utils/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ function createConfig({entry, filename, outputPath, libraryName, externals}) {
path: outputPath,
library: ['RingCentral', libraryName],
libraryTarget: 'umd',
libraryExport: 'default',
},
externals,
};
Expand Down

0 comments on commit 6f7f817

Please sign in to comment.