Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support for status and type fields in AppContext APIs #130

Merged
merged 4 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
---
changelog:
- date: 2024-12-18
version: v5.1.0
changes:
- type: feature
text: "Added support for `status` and `type` fields in AppContext APIs."
- date: 2024-12-10
version: v5.0.0
changes:
Expand Down Expand Up @@ -461,7 +466,7 @@ supported-platforms:
platforms:
- "Dart SDK >=2.6.0 <3.0.0"
version: "PubNub Dart SDK"
version: "5.0.0"
version: "5.1.0"
sdks:
-
full-name: PubNub Dart SDK
Expand Down
6 changes: 6 additions & 0 deletions pubnub/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v5.1.0
December 18 2024

#### Added
- Added support for `status` and `type` fields in AppContext APIs.

## v5.0.0
December 10 2024

Expand Down
2 changes: 1 addition & 1 deletion pubnub/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ To add the package to your Dart or Flutter project, add `pubnub` as a dependency

```yaml
dependencies:
pubnub: ^5.0.0
pubnub: ^5.1.0
```

After adding the dependency to `pubspec.yaml`, run the `dart pub get` command in the root directory of your project (the same that the `pubspec.yaml` is in).
Expand Down
2 changes: 1 addition & 1 deletion pubnub/lib/src/core/core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Core {
/// Internal module responsible for supervising.
SupervisorModule supervisor = SupervisorModule();

static String version = '5.0.0';
static String version = '5.1.0';

Core(
{Keyset? defaultKeyset,
Expand Down
2 changes: 0 additions & 2 deletions pubnub/lib/src/crypto/encryption_mode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ extension EncryptionModeExtension on EncryptionMode {
return AESMode.cbc;
case EncryptionMode.ECB:
return AESMode.ecb;
default:
throw Exception('Unreachable state');
}
}
}
4 changes: 0 additions & 4 deletions pubnub/lib/src/dx/_endpoints/push.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ extension EnvironmentExtension on Environment {
return 'development';
case Environment.production:
return 'production';
default:
throw Exception('Invalid Gateway Type');
}
}
}
Expand All @@ -43,8 +41,6 @@ extension PushGatewayExtension on PushGateway {
return 'apns';
case PushGateway.apns2:
return 'apns2';
default:
throw Exception('Invalid Gateway Type');
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions pubnub/lib/src/dx/channel/channel_history.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ extension ChannelHistoryOrderExtension on ChannelHistoryOrder {
return descending;
case ChannelHistoryOrder.ascending:
return ascending;
default:
throw Exception('Unreachable state');
}
}
}
Expand Down
40 changes: 40 additions & 0 deletions pubnub/lib/src/dx/objects/channel_metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ class ChannelMetadata {
/// To include `uuid` metadata fields of channel's memebrs in response, set [includeUUIDFields] to `true`
/// To include `custom` fields of channel member's uuidMetadata, set [includeUUIDCustomFields] to `true`
///
/// To omit `status` field from member metadata, set [includeStatus] to `false`
/// Default is `true`.
///
/// To omit `type` field from member metadata, set [includeType] to `false`
/// Default is `true`.
///
/// To get `status` field of UUID metadata, set [includeUUIDStatus] to `true`
/// Default is `false`.
///
/// To omit `type` field of UUID metadata, set [includeUUIDType] to `true`
/// Default is `false`.
///
/// Use [limit] to specify Number of objects to return in response.
/// Default is 100, which is also the maximum value.
///
Expand All @@ -41,6 +53,10 @@ class ChannelMetadata {
bool? includeUUIDFields,
bool? includeUUIDCustomFields,
bool? includeCount,
bool includeUUIDStatus = false,
bool includeUUIDType = false,
bool includeStatus = true,
bool includeType = true,
String? filter,
Set<String>? sort}) =>
_objects.setChannelMembers(_id, channelMembersMetadata,
Expand All @@ -50,6 +66,10 @@ class ChannelMetadata {
includeCustomFields: includeCustomFields,
includeUUIDFields: includeUUIDFields,
includeUUIDCustomFields: includeUUIDCustomFields,
includeUUIDStatus: includeUUIDStatus,
includeUUIDType: includeUUIDType,
includeStatus: includeStatus,
includeType: includeType,
includeCount: includeCount,
filter: filter,
sort: sort);
Expand All @@ -61,6 +81,18 @@ class ChannelMetadata {
/// To include `uuid` metadata fields of channel's memebrs in response, set [includeUUIDFields] to `true`
/// To include `custom` fields of channel member's uuidMetadata, set [includeUUIDCustomFields] to `true`
///
/// To omit `status` field from member metadata, set [includeStatus] to `false`
/// Default is `true`.
///
/// To omit `type` field from member metadata, set [includeType] to `false`
/// Default is `true`.
///
/// To get `status` field of UUID metadata, set [includeUUIDStatus] to `true`
/// Default is `false`.
///
/// To omit `type` field of UUID metadata, set [includeUUIDType] to `true`
/// Default is `false`.
///
/// Use [limit] to specify Number of objects to return in response.
/// Default is 100, which is also the maximum value.
///
Expand All @@ -84,6 +116,10 @@ class ChannelMetadata {
bool? includeUUIDFields,
bool? includeUUIDCustomFields,
bool? includeCount,
bool includeUUIDStatus = false,
bool includeUUIDType = false,
bool includeStatus = true,
bool includeType = true,
String? filter,
Set<String>? sort}) =>
_objects.removeChannelMembers(_id, uuids,
Expand All @@ -94,6 +130,10 @@ class ChannelMetadata {
includeCustomFields: includeCustomFields,
includeUUIDFields: includeUUIDFields,
includeUUIDCustomFields: includeUUIDCustomFields,
includeUUIDStatus: includeUUIDStatus,
includeUUIDType: includeUUIDType,
includeStatus: includeStatus,
includeType: includeType,
includeCount: includeCount,
filter: filter,
sort: sort);
Expand Down
Loading
Loading