diff --git a/packages/celest/CHANGELOG.md b/packages/celest/CHANGELOG.md index 1cfc66f5..420b519d 100644 --- a/packages/celest/CHANGELOG.md +++ b/packages/celest/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.0-dev.1 + +- chore: Bump dependencies + ## 0.5.0-dev.0 - feat: Add social sign-in support diff --git a/packages/celest/pubspec.yaml b/packages/celest/pubspec.yaml index 1fa01cd5..0d1c2534 100644 --- a/packages/celest/pubspec.yaml +++ b/packages/celest/pubspec.yaml @@ -1,6 +1,6 @@ name: celest description: The Flutter cloud platform. Celest enables you to build your entire backend in Dart. -version: 0.5.0-dev.0 +version: 0.5.0-dev.1 homepage: https://celest.dev repository: https://github.com/celest-dev/celest/tree/main/packages/celest @@ -10,9 +10,9 @@ environment: dependencies: async: ^2.11.0 - celest_auth: ^0.5.0-dev.0 - celest_cloud: ^0.1.0 - celest_core: ^0.5.0-dev.0 + celest_auth: ^0.5.0-dev.1 + celest_cloud: ^0.1.1 + celest_core: ^0.5.0-dev.1 chunked_stream: ^1.4.2 collection: ^1.18.0 http: ^1.0.0 diff --git a/packages/celest_auth/CHANGELOG.md b/packages/celest_auth/CHANGELOG.md index d38baa8a..ce1fb4c6 100644 --- a/packages/celest_auth/CHANGELOG.md +++ b/packages/celest_auth/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.5.0-dev.1 + +- chore: Bump dependencies +- fix: Catch errors on init + ## 0.5.0-dev.0 - feat: Add social sign-in support diff --git a/packages/celest_auth/lib/src/auth_impl.dart b/packages/celest_auth/lib/src/auth_impl.dart index c8e24318..2183506c 100644 --- a/packages/celest_auth/lib/src/auth_impl.dart +++ b/packages/celest_auth/lib/src/auth_impl.dart @@ -56,7 +56,9 @@ final class AuthImpl implements Auth { return _init ??= Future.sync(() async { _authStateSubscription = _authStateController.stream.listen((state) => _authState = state); - final initialState = await _initialState; + final initialState = await _initialState.onError((e, st) { + return const Unauthenticated(); + }); _authStateController.add(initialState); return initialState; }); @@ -149,6 +151,8 @@ final class AuthImpl implements Auth { Future signOut() async { try { await cloud.authentication.endSession(null); + } on Object { + // TODO(dnys1): Log error } finally { _reset(); if (!_authStateController.isClosed) { diff --git a/packages/celest_auth/pubspec.yaml b/packages/celest_auth/pubspec.yaml index ad91a49f..0013bfa7 100644 --- a/packages/celest_auth/pubspec.yaml +++ b/packages/celest_auth/pubspec.yaml @@ -1,6 +1,6 @@ name: celest_auth description: The Auth runtime and client library for Celest, the Flutter cloud platform. -version: 0.5.0-dev.0 +version: 0.5.0-dev.1 homepage: https://celest.dev repository: https://github.com/celest-dev/celest/tree/main/packages/celest_auth @@ -14,20 +14,20 @@ dependencies: built_value: ^8.9.1 cedar: ^0.2.2 celest_cloud: ^0.1.0 - celest_core: ^0.5.0-dev.0 + celest_core: ^0.5.0-dev.1 chunked_stream: ^1.4.2 corks_cedar: ^0.2.1 ffi: ^2.1.2 http: ^1.2.1 logging: ^1.2.0 meta: ^1.9.0 - native_authentication: ^0.1.0 + native_authentication: ^0.1.0+2 os_detect: ^2.0.1 path: ^1.9.0 shelf: ^1.4.1 shelf_router: ^1.1.4 stream_transform: ^2.1.0 - web: '>=0.5.0 <2.0.0' + web: ^1.0.0 dev_dependencies: build_runner: ^2.4.12 diff --git a/packages/celest_cloud/CHANGELOG.md b/packages/celest_cloud/CHANGELOG.md index 3fafbcd3..3d71c3c7 100644 --- a/packages/celest_cloud/CHANGELOG.md +++ b/packages/celest_cloud/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.1.1 + +- feat: Add subscriptions and project environments +- chore: Update operation methods + # 0.1.0 - Initial release diff --git a/packages/celest_cloud/lib/src/cloud/cloud.dart b/packages/celest_cloud/lib/src/cloud/cloud.dart index 54308692..493e4b32 100644 --- a/packages/celest_cloud/lib/src/cloud/cloud.dart +++ b/packages/celest_cloud/lib/src/cloud/cloud.dart @@ -2,6 +2,7 @@ import 'package:celest_cloud/src/cloud/authentication/authentication.dart'; import 'package:celest_cloud/src/cloud/cloud_protocol.dart'; import 'package:celest_cloud/src/cloud/cloud_protocol.grpc.dart'; import 'package:celest_cloud/src/cloud/cloud_protocol.http.dart'; +import 'package:celest_cloud/src/cloud/operations/operations.dart'; import 'package:celest_cloud/src/cloud/organizations/organizations.dart'; import 'package:celest_cloud/src/cloud/projects/projects.dart'; import 'package:celest_cloud/src/cloud/subscriptions/subscriptions.dart'; @@ -90,4 +91,9 @@ class CelestCloud { protocol: _protocol.subscriptions, logger: _logger, ); + + late final Operations operations = Operations( + protocol: _protocol.operations, + logger: _logger, + ); } diff --git a/packages/celest_cloud/lib/src/cloud/operations/operations.dart b/packages/celest_cloud/lib/src/cloud/operations/operations.dart new file mode 100644 index 00000000..adfc8e51 --- /dev/null +++ b/packages/celest_cloud/lib/src/cloud/operations/operations.dart @@ -0,0 +1,40 @@ +import 'package:celest_cloud/src/cloud/base/base_service.dart'; +import 'package:celest_cloud/src/cloud/operations/operations_protocol.dart'; +import 'package:celest_cloud/src/grpc.dart'; +import 'package:logging/logging.dart'; + +final class Operations with BaseService { + Operations({ + required OperationsProtocol protocol, + this.logger, + }) : _protocol = protocol; + + @override + final Logger? logger; + final OperationsProtocol _protocol; + + Future get(String name) async { + final request = GetOperationRequest(name: name); + return run('Operations.Get', request: request, action: _protocol.get); + } + + Future list({ + String? parent, + int? pageSize, + String? pageToken, + String? filter, + }) async { + final request = ListOperationsRequest( + name: parent, + pageSize: pageSize, + pageToken: pageToken, + filter: filter, + ); + return run('Operations.List', request: request, action: _protocol.list); + } + + Future cancel(String name) async { + final request = CancelOperationRequest(name: name); + return run('Operations.Cancel', request: request, action: _protocol.cancel); + } +} diff --git a/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pb.dart b/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pb.dart index 57d4e31d..0f63779b 100644 --- a/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pb.dart +++ b/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pb.dart @@ -309,7 +309,7 @@ class SessionClient extends $pb.GeneratedMessage { @$pb.TagNumber(2) void clearClientType() => clearField(2); - /// Optional. If the client is able to receive callbacks. + /// Required. If the client is able to receive callbacks. @$pb.TagNumber(3) SessionCallbacks get callbacks => $_getN(2); @$pb.TagNumber(3) diff --git a/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pbjson.dart b/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pbjson.dart index 1e99850e..9451fe2c 100644 --- a/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pbjson.dart +++ b/packages/celest_cloud/lib/src/proto/celest/cloud/auth/v1alpha1/authentication.pbjson.dart @@ -132,7 +132,7 @@ final $typed_data.Uint8List sessionClientDescriptor = $convert.base64Decode( 'Cg1TZXNzaW9uQ2xpZW50EiAKCWNsaWVudF9pZBgBIAEoCUID4EECUghjbGllbnRJZBJMCgtjbG' 'llbnRfdHlwZRgCIAEoDjImLmNlbGVzdC5jbG91ZC5hdXRoLnYxYWxwaGExLkNsaWVudFR5cGVC' 'A+BBAlIKY2xpZW50VHlwZRJPCgljYWxsYmFja3MYAyABKAsyLC5jZWxlc3QuY2xvdWQuYXV0aC' - '52MWFscGhhMS5TZXNzaW9uQ2FsbGJhY2tzQgPgQQFSCWNhbGxiYWNrcw=='); + '52MWFscGhhMS5TZXNzaW9uQ2FsbGJhY2tzQgPgQQJSCWNhbGxiYWNrcw=='); @$core.Deprecated('Use sessionCallbacksDescriptor instead') const SessionCallbacks$json = { diff --git a/packages/celest_cloud/pubspec.yaml b/packages/celest_cloud/pubspec.yaml index d5c20907..c45bffd7 100644 --- a/packages/celest_cloud/pubspec.yaml +++ b/packages/celest_cloud/pubspec.yaml @@ -1,6 +1,6 @@ name: celest_cloud description: API contracts and Dart clients for the Celest Cloud platform. -version: 0.1.0 +version: 0.1.1 repository: https://github.com/celest-dev/celest environment: @@ -8,7 +8,7 @@ environment: dependencies: async: ^2.11.0 - celest_core: ^0.5.0-dev.0 + celest_core: ^0.5.0-dev.1 code_builder: ^4.10.0 collection: ^1.18.0 fixnum: ^1.1.0 diff --git a/packages/celest_core/CHANGELOG.md b/packages/celest_core/CHANGELOG.md index c6d225e1..2eb13291 100644 --- a/packages/celest_core/CHANGELOG.md +++ b/packages/celest_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.5.0-dev.1 + +- chore: Update dependencies + ## 0.5.0-dev.0 - chore: Update dependencies diff --git a/packages/celest_core/pubspec.yaml b/packages/celest_core/pubspec.yaml index 87636f2c..deada377 100644 --- a/packages/celest_core/pubspec.yaml +++ b/packages/celest_core/pubspec.yaml @@ -1,6 +1,6 @@ name: celest_core description: Celest types and utilities shared between the client and the cloud. -version: 0.5.0-dev.0 +version: 0.5.0-dev.1 homepage: https://celest.dev repository: https://github.com/celest-dev/celest/tree/main/packages/celest_core @@ -16,12 +16,12 @@ dependencies: http_parser: ^4.0.0 logging: ^1.2.0 meta: ^1.10.0 - native_storage: ">=0.1.7 <0.3.0" + native_storage: ^0.2.2 os_detect: ^2.0.1 path: ^1.9.0 protobuf: ^3.0.0 stream_channel: ^2.1.2 - web: '>=0.5.0 <2.0.0' + web: ^1.0.0 web_socket: ^0.1.0 web_socket_channel: ^3.0.0