From b7409c51c5a21cee351df5d769c26302236b02bb Mon Sep 17 00:00:00 2001 From: Harpreet Sangar Date: Mon, 1 Apr 2024 11:20:12 +0530 Subject: [PATCH] `0.5.0` release. --- CHANGELOG.md | 5 +++++ README.md | 3 ++- analysis_options.yaml | 2 +- example/console-simple/pubspec.lock | 16 ++++++++++++---- lib/src/exceptions/import_error.dart | 2 +- lib/src/exceptions/missing_configuration.dart | 2 +- .../request_exceptions/http_error.dart | 2 +- .../object_already_exists.dart | 2 +- .../request_exceptions/object_not_found.dart | 2 +- .../request_exceptions/object_unprocessable.dart | 2 +- .../request_exceptions/request_exception.dart | 2 +- .../request_exceptions/request_malformed.dart | 2 +- .../request_exceptions/request_unauthorized.dart | 2 +- .../request_exceptions/server_error.dart | 2 +- lib/src/exceptions/typesense_exception.dart | 2 +- lib/src/models/field.dart | 2 +- lib/src/models/node.dart | 2 +- lib/src/models/schema.dart | 2 +- lib/src/services/node_pool.dart | 8 ++++---- pubspec.yaml | 15 +++++++-------- 20 files changed, 45 insertions(+), 32 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b47b93..3f6e8b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.5.0 + +* Added support for nested object fields. +* Updated dependencies.cd + # 0.4.0 * Requires Dart 3.0 or later. diff --git a/README.md b/README.md index 2f234aa..4b87ab0 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Add `typesense` as a [dependency in your pubspec.yaml file](https://flutter.dev/ ```@yaml dependencies: - typesense: ^0.4.0 + typesense: ^0.5.0 ``` ## Usage @@ -84,6 +84,7 @@ Make sure to [README](example/console-simple/README.md) beforehand. | Typesense Server | typesense-dart | |------------------|----------------| +| \>= v0.24.0 | \>= v0.5.0 | | \>= v0.22.0 | \>= v0.3.0 | | \>= v0.21.0 | \>= v0.1.1 | diff --git a/analysis_options.yaml b/analysis_options.yaml index 572dd23..c36c2c5 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -1 +1 @@ -include: package:lints/recommended.yaml +include: package:lints/core.yaml diff --git a/example/console-simple/pubspec.lock b/example/console-simple/pubspec.lock index 7f0c152..1aab4b7 100644 --- a/example/console-simple/pubspec.lock +++ b/example/console-simple/pubspec.lock @@ -45,10 +45,10 @@ packages: dependency: transitive description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" http_parser: dependency: transitive description: @@ -127,6 +127,14 @@ packages: path: "../.." relative: true source: path - version: "0.3.2" + version: "0.5.0" + web: + dependency: transitive + description: + name: web + sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + url: "https://pub.dev" + source: hosted + version: "0.5.1" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.3.2 <4.0.0" diff --git a/lib/src/exceptions/import_error.dart b/lib/src/exceptions/import_error.dart index c8f5515..515996e 100644 --- a/lib/src/exceptions/import_error.dart +++ b/lib/src/exceptions/import_error.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of 'exceptions.dart'; class ImportError implements TypesenseException { final String message; diff --git a/lib/src/exceptions/missing_configuration.dart b/lib/src/exceptions/missing_configuration.dart index 52451a6..262125f 100644 --- a/lib/src/exceptions/missing_configuration.dart +++ b/lib/src/exceptions/missing_configuration.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of 'exceptions.dart'; class MissingConfiguration implements TypesenseException { final String message; diff --git a/lib/src/exceptions/request_exceptions/http_error.dart b/lib/src/exceptions/request_exceptions/http_error.dart index 0bd9ed3..4b77752 100644 --- a/lib/src/exceptions/request_exceptions/http_error.dart +++ b/lib/src/exceptions/request_exceptions/http_error.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// The request has failed because of some network layer issues like /// connection timeouts, etc. diff --git a/lib/src/exceptions/request_exceptions/object_already_exists.dart b/lib/src/exceptions/request_exceptions/object_already_exists.dart index bc66682..c75972c 100644 --- a/lib/src/exceptions/request_exceptions/object_already_exists.dart +++ b/lib/src/exceptions/request_exceptions/object_already_exists.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// 409 Conflict class ObjectAlreadyExists extends RequestException { diff --git a/lib/src/exceptions/request_exceptions/object_not_found.dart b/lib/src/exceptions/request_exceptions/object_not_found.dart index 46f25e4..0780bea 100644 --- a/lib/src/exceptions/request_exceptions/object_not_found.dart +++ b/lib/src/exceptions/request_exceptions/object_not_found.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// 404 Not Found class ObjectNotFound extends RequestException { diff --git a/lib/src/exceptions/request_exceptions/object_unprocessable.dart b/lib/src/exceptions/request_exceptions/object_unprocessable.dart index e3a1137..55cef9c 100644 --- a/lib/src/exceptions/request_exceptions/object_unprocessable.dart +++ b/lib/src/exceptions/request_exceptions/object_unprocessable.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// 422 Unprocessable Entity class ObjectUnprocessable extends RequestException { diff --git a/lib/src/exceptions/request_exceptions/request_exception.dart b/lib/src/exceptions/request_exceptions/request_exception.dart index 315f8f4..9dfc042 100644 --- a/lib/src/exceptions/request_exceptions/request_exception.dart +++ b/lib/src/exceptions/request_exceptions/request_exception.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; abstract class RequestException implements TypesenseException { final String message; diff --git a/lib/src/exceptions/request_exceptions/request_malformed.dart b/lib/src/exceptions/request_exceptions/request_malformed.dart index 1eaeb81..08a607b 100644 --- a/lib/src/exceptions/request_exceptions/request_malformed.dart +++ b/lib/src/exceptions/request_exceptions/request_malformed.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// 400 Bad Request class RequestMalformed extends RequestException { diff --git a/lib/src/exceptions/request_exceptions/request_unauthorized.dart b/lib/src/exceptions/request_exceptions/request_unauthorized.dart index 5505a8d..76a059d 100644 --- a/lib/src/exceptions/request_exceptions/request_unauthorized.dart +++ b/lib/src/exceptions/request_exceptions/request_unauthorized.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// 401 Unauthorized class RequestUnauthorized extends RequestException { diff --git a/lib/src/exceptions/request_exceptions/server_error.dart b/lib/src/exceptions/request_exceptions/server_error.dart index 1649cf1..34e9d5d 100644 --- a/lib/src/exceptions/request_exceptions/server_error.dart +++ b/lib/src/exceptions/request_exceptions/server_error.dart @@ -1,4 +1,4 @@ -part of exceptions; +part of '../exceptions.dart'; /// 5xx server errors class ServerError extends RequestException { diff --git a/lib/src/exceptions/typesense_exception.dart b/lib/src/exceptions/typesense_exception.dart index 5c7fbe6..d04c0da 100644 --- a/lib/src/exceptions/typesense_exception.dart +++ b/lib/src/exceptions/typesense_exception.dart @@ -1,3 +1,3 @@ -part of exceptions; +part of 'exceptions.dart'; abstract class TypesenseException implements Exception {} diff --git a/lib/src/models/field.dart b/lib/src/models/field.dart index b8f82e3..6e8d5ba 100644 --- a/lib/src/models/field.dart +++ b/lib/src/models/field.dart @@ -1,4 +1,4 @@ -part of models; +part of 'models.dart'; class Field { /// [name] of the field. diff --git a/lib/src/models/node.dart b/lib/src/models/node.dart index 15d15cf..e88ca72 100644 --- a/lib/src/models/node.dart +++ b/lib/src/models/node.dart @@ -1,4 +1,4 @@ -part of models; +part of 'models.dart'; class Node { late final Uri uri; diff --git a/lib/src/models/schema.dart b/lib/src/models/schema.dart index bffe598..04723b4 100644 --- a/lib/src/models/schema.dart +++ b/lib/src/models/schema.dart @@ -1,4 +1,4 @@ -part of models; +part of 'models.dart'; abstract class BaseSchema { /// [fields] used for querying, filtering and faceting. diff --git a/lib/src/services/node_pool.dart b/lib/src/services/node_pool.dart index 90afb61..b5e1b09 100644 --- a/lib/src/services/node_pool.dart +++ b/lib/src/services/node_pool.dart @@ -33,8 +33,8 @@ class NodePool { } else if (_nodes != null) { _incrementNodeIndex(); // Keep rotating the nodes for each request. - for (var i = 0; i < _nodes!.length; i++, _incrementNodeIndex()) { - final candidateNode = _nodes![_index]..client ??= http.Client(); + for (var i = 0; i < _nodes.length; i++, _incrementNodeIndex()) { + final candidateNode = _nodes[_index]..client ??= http.Client(); if (_canUse(candidateNode)) { return candidateNode; @@ -42,9 +42,9 @@ class NodePool { } // None of the nodes can be used, returning the next node. - return _nodes![_index]; + return _nodes[_index]; } else if (_nearestNode != null) { - return _nearestNode!; + return _nearestNode; } throw MissingConfiguration( diff --git a/pubspec.yaml b/pubspec.yaml index 00d3196..53c2b33 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,18 +1,17 @@ name: typesense description: Dart client library for accessing the HTTP API of Typesense search engine. -version: 0.4.0 -homepage: https://typesense.org/ +version: 0.5.0 repository: https://github.com/typesense/typesense-dart environment: - sdk: ^3.0.0 + sdk: ^3.3.2 dependencies: - http: ^1.1.0 + http: ^1.2.1 crypto: ^3.0.3 dev_dependencies: - test: ^1.21.4 - mockito: ^5.2.0 - lints: ^2.0.0 - build_runner: ^2.1.11 + test: ^1.25.2 + mockito: ^5.4.4 + lints: ^3.0.0 + build_runner: ^2.4.8