Skip to content

Commit

Permalink
PubNub SDK v3.0.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
client-engineering-bot committed Oct 8, 2020
1 parent 5608ad2 commit 772be30
Show file tree
Hide file tree
Showing 138 changed files with 1,752 additions and 1,472 deletions.
21 changes: 20 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
---
changelog:
-
changes:
-
text: "Subscribe loop is now written using async generator and should be easier to debug."
type: improvement
-
text: "Exports now are more comprehensive and clear, documentation clarity has been improved."
type: improvement
-
text: "Removes additional query params from AWS calls."
type: bug
-
text: "Fixes a bunch of issues with incorrect arguments passed in."
type: bug
-
text: "Adds additional diagnostics to the networking module."
type: bug
date: Oct 8, 20
version: v3.0.0
-
changes:
-
Expand Down Expand Up @@ -310,4 +329,4 @@ supported-platforms:
platforms:
- "Dart SDK >=2.6.0 <3.0.0"
version: "PubNub Dart SDK"
version: "2.0.1"
version: "3.0.0"
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## [v3.0.0](https://github.com/pubnub/dart/releases/tag/v3.0.0)
October 8 2020

[Full Changelog](https://github.com/pubnub/dart/compare/v2.0.1...v3.0.0)

- ⭐️️ Subscribe loop is now written using async generator and should be easier to debug.
- ⭐️️ Exports now are more comprehensive and clear, documentation clarity has been improved.
- 🐛 Removes additional query params from AWS calls.
- 🐛 Fixes a bunch of issues with incorrect arguments passed in.
- 🐛 Adds additional diagnostics to the networking module.

## [v2.0.1](https://github.com/pubnub/dart/releases/tag/v2.0.1)
September 7 2020

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can import it in one of two ways:

```dart
// Import all PubNub objects into your namespace
import 'package:pubnub/pubnub.dart';
import 'package:pubnub/core.dart';
// Or import PubNub into a named namespace
import 'package:pubnub/pubnub.dart' as pn;
Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ include: package:pedantic/analysis_options.yaml

analyzer:
errors:
# todo: ignore
todo: ignore
29 changes: 29 additions & 0 deletions dartdoc_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dartdoc:
exclude: ["core"]
categories:
"Basic Features":
markdown: "doc/Basic.md"
name: "Basic Features"
"Objects":
markdown: "doc/Objects.md"
name: "Objects"
"Files":
markdown: "doc/Files.md"
name: "Files"
"Push":
markdown: "doc/Push.md"
name: "Push"
"Access Manager":
markdown: "doc/AccessManager.md"
name: "Access Manager"
"Exceptions":
markdown: "doc/Exceptions.md"
name: "Exceptions"
"Results":
markdown: "doc/Results.md"
name: "Results"
"Modules":
name: "Modules"
categoryOrder: ["Basic Features", "Objects", "Files", "Push", "Access Manager", "Exceptions", "Results"]
examplePathPrefix: "./examples"
showUndocumentedCategories: true
Empty file added doc/AccessManager.md
Empty file.
Empty file added doc/Basic.md
Empty file.
Empty file added doc/Exceptions.md
Empty file.
Empty file added doc/Files.md
Empty file.
Empty file added doc/Objects.md
Empty file.
Empty file added doc/Push.md
Empty file.
Empty file added doc/Results.md
Empty file.
6 changes: 4 additions & 2 deletions example/logging.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:pubnub/pubnub.dart';
import 'package:pubnub/logging.dart';

// This is the same example as the `example.dart` file, but shows how to enable extra logging
void main() async {
// Create a root logger
var logger = StreamLogger.root('root', logLevel: Level.all);
var logger = StreamLogger.root('root', logLevel: Level.info);

// Subscribe to messages with a default printer
var sub = logger.stream.listen(
Expand All @@ -17,6 +18,8 @@ void main() async {
var _ = await provideLogger(logger, () async {
var subscription = await pubnub.subscribe(channels: {'test'});

await Future.delayed(Duration(seconds: 1));

await pubnub.publish('test', {'message': 'My message'});

print(await subscription.messages.first);
Expand All @@ -43,5 +46,4 @@ void main() async {

await sub.cancel();
await logger.dispose();
print('disposed!');
}
33 changes: 15 additions & 18 deletions example/supervisor.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import 'dart:io';

import 'package:pubnub/pubnub.dart';
import 'package:pubnub/logging.dart';
import 'package:pubnub/networking.dart';

void main() async {
Expand All @@ -10,26 +9,26 @@ void main() async {
logger.stream.listen(
LogRecord.createPrinter(r'[$time] (${level.name}) $scope $message'));

await provideLogger(logger, () async {
// Create PubNub instance with default keyset.
var pubnub = PubNub(
networking: NetworkingModule(
retryPolicy: RetryPolicy.exponential(maxRetries: 10)),
defaultKeyset:
Keyset(subscribeKey: 'demo', publishKey: 'demo', uuid: UUID('demo')),
);
// Create PubNub instance with default keyset.
var pubnub = PubNub(
networking:
NetworkingModule(retryPolicy: RetryPolicy.exponential(maxRetries: 10)),
defaultKeyset:
Keyset(subscribeKey: 'demo', publishKey: 'demo', uuid: UUID('demo')),
);

print(
'Network reconnection test. Please wait few seconds for further instructions...');
print(
'Network reconnection test. Please wait few seconds for further instructions...');

var sub = await pubnub.subscribe(channels: {'test2'});
var sub = await pubnub.subscribe(channels: {'test2'});

await Future.delayed(Duration(seconds: 5));
await Future.delayed(Duration(seconds: 5));

print('Subscribed. Disconnect your network for few seconds.');
print('Subscribed. Disconnect your network for few seconds.');

await Future.delayed(Duration(seconds: 5));
await Future.delayed(Duration(seconds: 5));

await provideLogger(logger, () async {
var f = pubnub.publish('test2', {'myMessage': 'it works!'});

print(
Expand All @@ -44,7 +43,5 @@ void main() async {
await sub.dispose();

print('Done!');

exit(0);
});
}
14 changes: 14 additions & 0 deletions lib/core.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export 'src/core/core.dart';

export 'src/core/keyset.dart';
export 'src/core/endpoint.dart';
export 'src/core/message_type.dart';
export 'src/core/exceptions.dart';
export 'src/core/timetoken.dart';
export 'src/core/uuid.dart';

export 'src/core/crypto/crypto.dart';
export 'src/core/logging/logging.dart';
export 'src/core/net/net.dart';
export 'src/core/supervisor/supervisor.dart';
export 'src/core/parser.dart';
10 changes: 10 additions & 0 deletions lib/crypto.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// Default cryptography module used by PubNub SDK.
///
/// Uses `package:crypto` and `package:encrypt` under the hood.
///
/// {@category Modules}
library pubnub.crypto;

export 'src/crypto/crypto.dart' show CryptoConfiguration, CryptoModule;
export 'src/crypto/encryption_mode.dart'
show EncryptionMode, EncryptionModeExtension;
7 changes: 7 additions & 0 deletions lib/logging.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/// Default logging module used by PubNub SDK.
///
/// {@category Modules}
library pubnub.logging;

export 'src/logging/logging.dart' show LogRecord, StreamLogger;
export 'src/core/logging/logging.dart' show Level, provideLogger, injectLogger;
12 changes: 10 additions & 2 deletions lib/networking.dart
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
export 'src/net/net.dart';
export 'src/net/meta/meta.dart';
/// Default networking module used by PubNub SDK.
///
/// Uses `package:dio` under the hood.
///
/// {@category Modules}
library pubnub.networking;

export 'src/net/net.dart' show NetworkingModule;
export 'src/net/meta/meta.dart'
show ExponentialRetryPolicy, LinearRetryPolicy, RetryPolicy;
154 changes: 97 additions & 57 deletions lib/pubnub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,101 @@
/// The best starting point to take a look around is the [PubNub] class that combines all available features.
library pubnub;

export './src/core/core.dart';
export './src/dx/_utils/ensure.dart' show InvariantException;
export './src/crypto/crypto.dart' show CryptoModule, CryptoConfiguration;
// PubNub
export 'src/default.dart';

export './src/crypto/encryption_mode.dart'
show EncryptionMode, EncryptionModeExtension;

export './src/dx/files/files.dart' show FileDx;
export './src/dx/batch/batch.dart' show BatchDx;
export './src/dx/objects/objects.dart' show ObjectsDx;
export './src/dx/channel/channel_group.dart' show ChannelGroup, ChannelGroupDx;
// Core
export 'src/core/timetoken.dart' show Timetoken, TimetokenDateTimeExtentions;
export 'src/core/uuid.dart' show UUID;
export 'src/core/keyset.dart' show Keyset, KeysetStore, KeysetException;
export 'src/core/message_type.dart' show MessageType;
export 'src/core/exceptions.dart'
show
InvalidArgumentsException,
MaximumRetriesException,
MalformedResponseException,
MethodDisabledException,
NotImplementedException,
PubNubException,
PublishException,
UnknownException;

export './src/dx/channel/channel.dart' show Channel;
export './src/dx/push/push.dart' show Device;
export './src/dx/_endpoints/publish.dart' show PublishResult;
export 'src/dx/_endpoints/files.dart'
// DX
export 'src/dx/_utils/utils.dart' show InvariantException;
export 'src/dx/batch/batch.dart'
show
BatchDx,
BatchHistoryResult,
BatchHistoryResultEntry,
CountMessagesResult;
export 'src/dx/channel/channel.dart'
show
Channel,
ChannelHistory,
ChannelHistoryOrder,
Message,
PaginatedChannelHistory;
export 'src/dx/channel/channel_group.dart'
show
ChannelGroupDx,
ChannelGroupChangeChannelsResult,
ChannelGroupDeleteResult,
ChannelGroupListChannelsResult;
export 'src/dx/files/files.dart'
show
FileDx,
FileInfo,
FileMessage,
FileKeysetExtension,
PublishFileMessageResult,
ListFilesResult,
DeleteFileResult,
FileDetail,
DownloadFileResult;
export './src/dx/_endpoints/presence.dart'
show HeartbeatResult, LeaveResult, HereNowResult, StateInfo;
export './src/dx/_endpoints/channel_group.dart'
DownloadFileResult,
ListFilesResult,
FileDetail;
export 'src/dx/message_action/message_action.dart'
show
ChannelGroupChangeChannelsResult,
ChannelGroupListChannelsResult,
ChannelGroupDeleteResult;
export './src/dx/_endpoints/history.dart'
FetchMessageActionsResult,
AddMessageActionResult,
DeleteMessageActionResult,
MessageAction;
export 'src/dx/objects/objects.dart'
show
FetchHistoryResult,
BatchHistoryResult,
BatchHistoryResultEntry,
CountMessagesResult,
DeleteMessagesResult;
export './src/dx/_endpoints/signal.dart' show SignalResult;
export './src/dx/_endpoints/push.dart'
ObjectsDx,
ChannelIdInfo,
ChannelMemberMetadata,
ChannelMemberMetadataInput,
ChannelMembersResult,
ChannelMetadataDetails,
ChannelMetadataInput,
GetAllChannelMetadataResult,
GetAllUuidMetadataResult,
GetChannelMetadataResult,
GetUuidMetadataResult,
MembershipMetadata,
MembershipMetadataInput,
MembershipsResult,
RemoveChannelMetadataResult,
RemoveUuidMetadataResult,
SetChannelMetadataResult,
SetUuidMetadataResult,
UuIdInfo,
UuidMetadataDetails,
UuidMetadataInput;
export 'src/dx/pam/pam.dart'
show Resource, ResourceType, ResourceTypeExtension, Token, TokenRequest;
export 'src/dx/presence/presence.dart'
show
GetUserStateResult,
HeartbeatResult,
HereNowResult,
LeaveResult,
SetUserStateResult,
WhereNowResult,
ChannelOccupancy,
StateInfo,
PresenceKeysetExtension;
export 'src/dx/publish/publish.dart' show PublishResult;
export 'src/dx/push/push.dart'
show
PushGateway,
PushGatewayExtension,
Expand All @@ -50,31 +107,14 @@ export './src/dx/_endpoints/push.dart'
AddPushChannelsResult,
ListPushChannelsResult,
RemoveDeviceResult,
RemovePushChannelsResult;
export './src/dx/_endpoints/message_action.dart'
show
MessageAction,
FetchMessageActionsResult,
AddMessageActionResult,
DeleteMessageActionResult;

export './src/dx/subscribe/subscription.dart' show Subscription;
export './src/dx/subscribe/extensions/keyset.dart'
show SubscribeKeysetExtension, PresenceKeysetExtension;
export './src/dx/subscribe/envelope.dart'
show Envelope, PresenceAction, PresenceEvent, MessageType;
export './src/dx/channel/channel_history.dart'
show PaginatedChannelHistory, ChannelHistory;
export 'src/dx/files/files.dart' show FileInfo, FileMessage;
export './src/dx/channel/message.dart' show Message;

export './src/dx/_endpoints/objects/objects_types.dart';

export './src/dx/pam/pam.dart'
show Resource, ResourceType, ResourceTypeExtension, TokenRequest, Token;

export './src/dx/objects/objects_types.dart';
RemovePushChannelsResult,
Device;
export 'src/dx/signal/signal.dart' show SignalResult;
export 'src/dx/supervisor/supervisor.dart' show Signals;

export './src/logging/logging.dart' show StreamLogger, LogRecord;
// Subscribe

export './src/default.dart';
export 'src/subscribe/subscription.dart' show Subscription;
export 'src/subscribe/extensions/keyset.dart' show SubscribeKeysetExtension;
export 'src/subscribe/envelope.dart'
show Envelope, PresenceEvent, PresenceAction;
Loading

0 comments on commit 772be30

Please sign in to comment.