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

chore(version): 0.3.0 #79

Merged
merged 7 commits into from
Mar 11, 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
10 changes: 8 additions & 2 deletions examples/gemini/celest/lib/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ library; // ignore_for_file: no_leading_underscores_for_library_prefixes

import 'dart:io' as _$io;

import 'package:celest_core/_internal.dart';
import 'package:celest_core/src/util/globals.dart';
import 'package:http/http.dart' as _$http;

Expand All @@ -24,12 +25,16 @@ enum CelestEnvironment {
};
}

class Celest {
class Celest with CelestBase {
var _initialized = false;

late CelestEnvironment _currentEnvironment;

late _$http.Client httpClient = _$http.Client();
late final SecureStorage _secureStorage = SecureStorage();

@override
late _$http.Client httpClient =
CelestHttpClient(secureStorage: _secureStorage);

late Uri _baseUri;

Expand All @@ -46,6 +51,7 @@ class Celest {
CelestEnvironment get currentEnvironment =>
_checkInitialized(() => _currentEnvironment);

@override
Uri get baseUri => _checkInitialized(() => _baseUri);

CelestFunctions get functions => _checkInitialized(() => _functions);
Expand Down
2 changes: 2 additions & 0 deletions examples/gemini/celest/lib/src/client/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class CelestFunctionsGemini {
switch ($code) {
case r'BadRequestException':
throw Serializers.instance.deserialize<BadRequestException>($details);
case r'UnauthorizedException':
throw Serializers.instance.deserialize<UnauthorizedException>($details);
case r'InternalServerException':
throw Serializers.instance
.deserialize<InternalServerException>($details);
Expand Down
8 changes: 8 additions & 0 deletions examples/gemini/celest/lib/src/client/serializers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ void initSerializers() {
return InternalServerException(($serialized[r'message'] as String));
},
));
Serializers.instance
.put(Serializer.define<UnauthorizedException, Map<String, Object?>?>(
serialize: ($value) => {r'message': $value.message},
deserialize: ($serialized) {
return UnauthorizedException(
(($serialized?[r'message'] as String?)) ?? 'Unauthorized');
},
));
Serializers.instance
.put(Serializer.define<SerializationException, Map<String, Object?>>(
serialize: ($value) => {
Expand Down
125 changes: 119 additions & 6 deletions examples/gemini/celest/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,54 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.1"
built_collection:
dependency: transitive
description:
name: built_collection
sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
built_value:
dependency: transitive
description:
name: built_value
sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e
url: "https://pub.dev"
source: hosted
version: "8.9.1"
cedar:
dependency: transitive
description:
name: cedar
sha256: "08694362fce1f942d0f868ff8460931e2d32d9e568a1672ca98aa387cab248aa"
url: "https://pub.dev"
source: hosted
version: "0.1.0"
celest:
dependency: "direct main"
description:
name: celest
sha256: aa0d6bd43ed45f52d2f1a88b5dc00bf88439ab21f1d727c68938f54ccf3ba445
sha256: bd1691ce2d75e394e2d2a7b41d8699ccc4e219d51846287cfe9ba7b6cd9a3989
url: "https://pub.dev"
source: hosted
version: "0.3.1"
celest_auth:
dependency: transitive
description:
name: celest_auth
sha256: "63ad911778086b508c702a2ece3a56d7fea42a1e87c92c0031f213ccfabb25d6"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.3.0"
celest_core:
dependency: "direct main"
description:
name: celest_core
sha256: c9ae3214327494291c2bbbc5ac7b5b63be03484e9d63fd06d8fe9ad938256963
sha256: f4ce36b2f80a2717dd83302a735e1be16ca7ebcc5f145582b59e66176503f455
url: "https://pub.dev"
source: hosted
version: "0.2.1"
version: "0.3.1"
chunked_stream:
dependency: transitive
description:
Expand All @@ -81,6 +113,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.1"
corks_cedar:
dependency: transitive
description:
name: corks_cedar
sha256: "85296f9500ff5cf8ec135520fc28caaf2858af8a6da129d7caedaed869cb8a44"
url: "https://pub.dev"
source: hosted
version: "0.1.0"
coverage:
dependency: transitive
description:
Expand All @@ -97,6 +137,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.0.3"
ffi:
dependency: transitive
description:
name: ffi
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
file:
dependency: transitive
description:
Expand All @@ -105,6 +153,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "7.0.0"
fixnum:
dependency: transitive
description:
name: fixnum
sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
frontend_server_client:
dependency: transitive
description:
Expand Down Expand Up @@ -169,6 +225,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.0.4"
jni:
dependency: transitive
description:
name: jni
sha256: "0d88790bdf7e298aa65a9094c62b58ea231169a2deb84f23defc7d7955885b43"
url: "https://pub.dev"
source: hosted
version: "0.7.2"
js:
dependency: transitive
description:
Expand All @@ -177,6 +241,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_annotation:
dependency: transitive
description:
name: json_annotation
sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467
url: "https://pub.dev"
source: hosted
version: "4.8.1"
lints:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -225,6 +297,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.2"
os_detect:
dependency: transitive
description:
name: os_detect
sha256: faf3bcf39515e64da8ff76b2f2805b20a6ff47ae515393e535f8579ff91d6b7f
url: "https://pub.dev"
source: hosted
version: "2.0.1"
package_config:
dependency: transitive
description:
Expand All @@ -241,6 +321,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.9.0"
plugin_platform_interface:
dependency: transitive
description:
name: plugin_platform_interface
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
url: "https://pub.dev"
source: hosted
version: "2.1.8"
pool:
dependency: transitive
description:
Expand All @@ -249,6 +337,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.5.1"
protobuf:
dependency: transitive
description:
name: protobuf
sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d"
url: "https://pub.dev"
source: hosted
version: "3.1.0"
pub_semver:
dependency: transitive
description:
Expand Down Expand Up @@ -337,6 +433,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.1.2"
stream_transform:
dependency: transitive
description:
name: stream_transform
sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -405,10 +509,10 @@ packages:
dependency: transitive
description:
name: web
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.5.1"
web_socket_channel:
dependency: transitive
description:
Expand All @@ -425,6 +529,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.2.1"
win32:
dependency: transitive
description:
name: win32
sha256: "8cb58b45c47dcb42ab3651533626161d6b67a2921917d8d429791f76972b3480"
url: "https://pub.dev"
source: hosted
version: "5.3.0"
yaml:
dependency: transitive
description:
Expand All @@ -435,3 +547,4 @@ packages:
version: "3.1.2"
sdks:
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"
4 changes: 2 additions & 2 deletions examples/gemini/celest/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ environment:
sdk: ^3.3.0

dependencies:
celest: ^0.2.0
celest_core: ^0.2.0
celest: ^0.3.0
celest_core: ^0.3.0
google_generative_ai: ^0.2.0
http: ">=0.13.0 <2.0.0"

Expand Down
22 changes: 0 additions & 22 deletions examples/gemini/celest/resources.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,6 @@ library;

import 'package:celest/celest.dart';

@Deprecated('Use `Apis` instead.')
typedef apis = Apis;

abstract final class Apis {
static const gemini = CloudApi(name: r'gemini');
}

@Deprecated('Use `Functions` instead.')
typedef functions = Functions;

abstract final class Functions {
static const geminiAvailableModels = CloudFunction(
api: r'gemini',
functionName: r'availableModels',
);

static const geminiGenerateContent = CloudFunction(
api: r'gemini',
functionName: r'generateContent',
);
}

@Deprecated('Use `Env` instead.')
typedef env = Env;

Expand Down
Loading