Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into integration/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrence-forooghian committed May 10, 2023
2 parents da530f8 + cd18a40 commit a4d8c5f
Show file tree
Hide file tree
Showing 12 changed files with 5 additions and 97 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ When a 128 bit or 256 bit key is provided to the library, the `data` attributes
```javascript
// Generate a random 256-bit key for demonstration purposes (in
// practice you need to create one and distribute it to clients yourselves)
Ably.Realtime.Platform.Crypto.generateRandomKey(function (err, key) {
Ably.Realtime.Crypto.generateRandomKey(function (err, key) {
var channel = client.channels.get('channelName', { cipher: { key: key } });

channel.subscribe(function (message) {
Expand Down
4 changes: 2 additions & 2 deletions src/common/lib/client/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ class Rest {
static Callbacks = Rest;
static Platform = Platform;
static Crypto?: typeof Platform.Crypto;
static Message?: typeof Message;
static PresenceMessage?: typeof PresenceMessage;
static Message = Message;
static PresenceMessage = PresenceMessage;
}

class Channels {
Expand Down
16 changes: 0 additions & 16 deletions src/common/types/platform-bufferutils.d.ts

This file was deleted.

3 changes: 0 additions & 3 deletions src/common/types/platform-crypto.d.ts

This file was deleted.

4 changes: 0 additions & 4 deletions src/common/types/platform-http.d.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/common/types/platform-transports.d.ts

This file was deleted.

8 changes: 0 additions & 8 deletions src/common/types/platform-webstorage.d.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/platform/nativescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ import Config from './config';
import Transports from '../web/lib/transport';
import Logger from '../../common/lib/util/logger';
import { getDefaults } from '../../common/lib/util/defaults';
import ConnectionManager from '../../common/lib/transport/connectionmanager';
// @ts-ignore
import WebStorage from './lib/util/webstorage';
import PlatformDefaults from '../web/lib/util/defaults';
import msgpack from '../web/lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -32,14 +29,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;
Realtime.Message = Message;

Rest.PresenceMessage = PresenceMessage;
Realtime.PresenceMessage = PresenceMessage;

Realtime.ConnectionManager = ConnectionManager;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
11 changes: 0 additions & 11 deletions src/platform/nodejs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import Config from './config';
import Transports from './lib/transport';
import Logger from '../../common/lib/util/logger';
import { getDefaults } from '../../common/lib/util/defaults';
import ConnectionManager from '../../common/lib/transport/connectionmanager';
import PlatformDefaults from './lib/util/defaults';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -28,14 +25,6 @@ Platform.WebStorage = null;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;
Realtime.Message = Message;

Rest.PresenceMessage = PresenceMessage;
Realtime.PresenceMessage = PresenceMessage;

Realtime.ConnectionManager = ConnectionManager;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
11 changes: 0 additions & 11 deletions src/platform/react-native/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ import Config from './config';
import Transports from '../web/lib/transport';
import Logger from '../../common/lib/util/logger';
import { getDefaults } from '../../common/lib/util/defaults';
import ConnectionManager from '../../common/lib/transport/connectionmanager';
import WebStorage from '../web/lib/util/webstorage';
import PlatformDefaults from '../web/lib/util/defaults';
import msgpack from '../web/lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -30,14 +27,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;
Realtime.Message = Message;

Rest.PresenceMessage = PresenceMessage;
Realtime.PresenceMessage = PresenceMessage;

Realtime.ConnectionManager = ConnectionManager;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down
15 changes: 2 additions & 13 deletions src/platform/web-noencryption/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ import Config from '../web/config';
import Transports from '../web/lib/transport';
import Logger from '../../common/lib/util/logger';
import { getDefaults } from '../../common/lib/util/defaults';
import ConnectionManager from '../../common/lib/transport/connectionmanager';
import WebStorage from '../web/lib/util/webstorage';
import PlatformDefaults from '../web/lib/util/defaults';
import msgpack from '../web/lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = null;
Platform.BufferUtils = BufferUtils;
Expand All @@ -26,16 +23,8 @@ Platform.Config = Config;
Platform.Transports = Transports;
Platform.WebStorage = WebStorage;

Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;
Realtime.Message = Message;

Rest.PresenceMessage = PresenceMessage;
Realtime.PresenceMessage = PresenceMessage;

Realtime.ConnectionManager = ConnectionManager;
Rest.Crypto = null;
Realtime.Crypto = null;

Logger.initLogHandlers();

Expand Down
11 changes: 0 additions & 11 deletions src/platform/web/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ import Config from './config';
import Transports from './lib/transport';
import Logger from '../../common/lib/util/logger';
import { getDefaults } from '../../common/lib/util/defaults';
import ConnectionManager from '../../common/lib/transport/connectionmanager';
import WebStorage from './lib/util/webstorage';
import PlatformDefaults from './lib/util/defaults';
import msgpack from './lib/util/msgpack';
import Message from 'common/lib/types/message';
import PresenceMessage from 'common/lib/types/presencemessage';

Platform.Crypto = Crypto;
Platform.BufferUtils = BufferUtils;
Expand All @@ -30,14 +27,6 @@ Platform.WebStorage = WebStorage;
Rest.Crypto = Crypto;
Realtime.Crypto = Crypto;

Rest.Message = Message;
Realtime.Message = Message;

Rest.PresenceMessage = PresenceMessage;
Realtime.PresenceMessage = PresenceMessage;

Realtime.ConnectionManager = ConnectionManager;

Logger.initLogHandlers();

Platform.Defaults = getDefaults(PlatformDefaults);
Expand Down

0 comments on commit a4d8c5f

Please sign in to comment.