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

0.5.0 release. #141

Merged
merged 1 commit into from
Apr 1, 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 |

Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include: package:lints/recommended.yaml
include: package:lints/core.yaml
16 changes: 12 additions & 4 deletions example/console-simple/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
2 changes: 1 addition & 1 deletion lib/src/exceptions/import_error.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of 'exceptions.dart';

class ImportError implements TypesenseException {
final String message;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/missing_configuration.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of 'exceptions.dart';

class MissingConfiguration implements TypesenseException {
final String message;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/request_exceptions/http_error.dart
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

/// 409 Conflict
class ObjectAlreadyExists extends RequestException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

/// 404 Not Found
class ObjectNotFound extends RequestException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

/// 422 Unprocessable Entity
class ObjectUnprocessable extends RequestException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

abstract class RequestException implements TypesenseException {
final String message;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

/// 400 Bad Request
class RequestMalformed extends RequestException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

/// 401 Unauthorized
class RequestUnauthorized extends RequestException {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/request_exceptions/server_error.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of exceptions;
part of '../exceptions.dart';

/// 5xx server errors
class ServerError extends RequestException {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/exceptions/typesense_exception.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
part of exceptions;
part of 'exceptions.dart';

abstract class TypesenseException implements Exception {}
2 changes: 1 addition & 1 deletion lib/src/models/field.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of models;
part of 'models.dart';

class Field {
/// [name] of the field.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/node.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of models;
part of 'models.dart';

class Node {
late final Uri uri;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models/schema.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
part of models;
part of 'models.dart';

abstract class BaseSchema {
/// [fields] used for querying, filtering and faceting.
Expand Down
8 changes: 4 additions & 4 deletions lib/src/services/node_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ 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;
}
}

// 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(
Expand Down
15 changes: 7 additions & 8 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Loading