diff --git a/.ci/doc/config.yml b/.ci/doc/config.yml index 5349df3c..7cbcf604 100644 --- a/.ci/doc/config.yml +++ b/.ci/doc/config.yml @@ -1,22 +1,20 @@ --- +snippets: + mount: /mnt + path: "doc/**/snippets/*.test.yml" + templates: /mnt/.ci/doc/templates + protocols: + - http + - websocket - snippets: - mount: /mnt - path: 'doc/**/snippets/*.test.yml' - templates: /mnt/.ci/doc/templates - protocols: - - http - - websocket - - runners: - default: dart - - dart: - service: doc-runner-dart - path: /var/snippets/dart - build: - cmd: cd /mnt - run: - before: timeout 600 bash -c 'until stat /tmp/runner_is_ready && curl -f -s -o /dev/null http://kuzzle:7512/_now; do sleep 1; done && cp *.dart /mnt/.ci/doc/project/ && cd /mnt/.ci/doc/project/ && pub get' - cmd: cd /mnt/.ci/doc/project/ && SNIPPET_PROTOCOL="{{ snippet.protocol }}" dart {{ snippet.source }} - \ No newline at end of file +runners: + default: dart + + dart: + service: doc-runner-dart + path: /var/snippets/dart + build: + cmd: cd /mnt + run: + before: timeout 600 bash -c 'until stat /tmp/runner_is_ready && curl -f -s -o /dev/null http://kuzzle:7512/_now; do sleep 1; done && cp *.dart /mnt/.ci/doc/project/ && cd /mnt/.ci/doc/project/ && dart pub get' + cmd: cd /mnt/.ci/doc/project/ && SNIPPET_PROTOCOL="{{ snippet.protocol }}" dart {{ snippet.source }} diff --git a/.ci/doc/docker-compose.yml b/.ci/doc/docker-compose.yml index 811301a7..1099eaa4 100644 --- a/.ci/doc/docker-compose.yml +++ b/.ci/doc/docker-compose.yml @@ -41,7 +41,7 @@ services: - CONFIG_FILE=/mnt/.ci/doc/config.yml doc-runner-dart: - image: google/dart + image: dart:3 command: > bash -c ' mkdir -p /var/snippets/dart; diff --git a/.ci/doc/project/pubspec.yaml b/.ci/doc/project/pubspec.yaml index ba64719a..5b4e7915 100755 --- a/.ci/doc/project/pubspec.yaml +++ b/.ci/doc/project/pubspec.yaml @@ -3,7 +3,7 @@ version: 1.0.0 description: Dart SDK doc snippet test project environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: kuzzle: diff --git a/.ci/doc/templates/catch.tpl.dart b/.ci/doc/templates/catch.tpl.dart index 135870e1..fa0a840e 100644 --- a/.ci/doc/templates/catch.tpl.dart +++ b/.ci/doc/templates/catch.tpl.dart @@ -31,7 +31,7 @@ void main() async { await kuzzle.connect(); [snippet-code] } catch(e, s) { - print(e.message); + print(e); } finally { kuzzle.disconnect(); } diff --git a/doc/3/core-classes/profile/next/snippets/fromsize.dart b/doc/3/core-classes/profile/next/snippets/fromsize.dart index 50c7cc3c..ae904709 100644 --- a/doc/3/core-classes/profile/next/snippets/fromsize.dart +++ b/doc/3/core-classes/profile/next/snippets/fromsize.dart @@ -9,7 +9,7 @@ for (var i = 1; i <= 5; i++) { ); } -var res = await kuzzle.security.searchProfiles( +SearchResult? res = await kuzzle.security.searchProfiles( query:{ 'roles': [ 'default' ] }, from: 1, size: 1); @@ -17,6 +17,6 @@ var res = await kuzzle.security.searchProfiles( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } diff --git a/doc/3/core-classes/profile/next/snippets/scroll.dart b/doc/3/core-classes/profile/next/snippets/scroll.dart index 9527fe18..199d267b 100644 --- a/doc/3/core-classes/profile/next/snippets/scroll.dart +++ b/doc/3/core-classes/profile/next/snippets/scroll.dart @@ -9,7 +9,7 @@ for (var i = 1; i <= 5; i++) { ); } -var res = await kuzzle.security.searchProfiles( +SearchResult? res = await kuzzle.security.searchProfiles( query:{ 'roles': [ 'default' ] }, scroll: '10s', size: 1); @@ -17,6 +17,6 @@ var res = await kuzzle.security.searchProfiles( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } diff --git a/doc/3/core-classes/role/next/snippets/fromsize.dart b/doc/3/core-classes/role/next/snippets/fromsize.dart index 2a1c9729..8b071f83 100644 --- a/doc/3/core-classes/role/next/snippets/fromsize.dart +++ b/doc/3/core-classes/role/next/snippets/fromsize.dart @@ -14,7 +14,7 @@ for (var i = 1; i <= 5; i++) { ); } -var res = await kuzzle.security.searchRoles( +SearchResult? res = await kuzzle.security.searchRoles( query:{ 'controllers': [ 'auth' ] }, from: 1, size: 1); @@ -22,6 +22,6 @@ var res = await kuzzle.security.searchRoles( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } diff --git a/doc/3/core-classes/search-result/next/snippets/fromsize-es.dart b/doc/3/core-classes/search-result/next/snippets/fromsize-es.dart index 51f3db7b..1e1dcc2a 100644 --- a/doc/3/core-classes/search-result/next/snippets/fromsize-es.dart +++ b/doc/3/core-classes/search-result/next/snippets/fromsize-es.dart @@ -8,7 +8,7 @@ await kuzzle.document.mCreate('nyc-open-data', 'yellow-taxi', documents, waitForRefresh: true ); -var res = await kuzzle.document.search( +SearchResult? res = await kuzzle.document.search( 'nyc-open-data', 'yellow-taxi', query: { 'query': { 'match': { 'category': 'suv' } } }, @@ -18,6 +18,6 @@ var res = await kuzzle.document.search( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } \ No newline at end of file diff --git a/doc/3/core-classes/search-result/next/snippets/fromsize-koncorde.dart b/doc/3/core-classes/search-result/next/snippets/fromsize-koncorde.dart index 9ee375dc..79e5ecc9 100644 --- a/doc/3/core-classes/search-result/next/snippets/fromsize-koncorde.dart +++ b/doc/3/core-classes/search-result/next/snippets/fromsize-koncorde.dart @@ -8,7 +8,7 @@ await kuzzle.document.mCreate('nyc-open-data', 'yellow-taxi', documents, waitForRefresh: true ); -var res = await kuzzle.document.search( +SearchResult? res = await kuzzle.document.search( 'nyc-open-data', 'yellow-taxi', query: { 'query': { 'equals': { 'category': 'suv' } } }, @@ -18,6 +18,6 @@ var res = await kuzzle.document.search( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } \ No newline at end of file diff --git a/doc/3/core-classes/search-result/next/snippets/scroll-es.dart b/doc/3/core-classes/search-result/next/snippets/scroll-es.dart index 26503292..3082033b 100644 --- a/doc/3/core-classes/search-result/next/snippets/scroll-es.dart +++ b/doc/3/core-classes/search-result/next/snippets/scroll-es.dart @@ -8,7 +8,7 @@ await kuzzle.document.mCreate('nyc-open-data', 'yellow-taxi', documents, waitForRefresh: true ); -var res = await kuzzle.document.search( +SearchResult? res = await kuzzle.document.search( 'nyc-open-data', 'yellow-taxi', query: { 'query': { 'match': { 'category': 'suv' } } }, @@ -18,6 +18,6 @@ var res = await kuzzle.document.search( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } \ No newline at end of file diff --git a/doc/3/core-classes/search-result/next/snippets/scroll-koncorde.dart b/doc/3/core-classes/search-result/next/snippets/scroll-koncorde.dart index b848376c..3e074c0d 100644 --- a/doc/3/core-classes/search-result/next/snippets/scroll-koncorde.dart +++ b/doc/3/core-classes/search-result/next/snippets/scroll-koncorde.dart @@ -8,7 +8,7 @@ await kuzzle.document.mCreate('nyc-open-data', 'yellow-taxi', documents, waitForRefresh: true ); -var res = await kuzzle.document.search( +SearchResult? res = await kuzzle.document.search( 'nyc-open-data', 'yellow-taxi', query: { 'query': { 'equals': { 'category': 'suv' } } }, @@ -18,6 +18,6 @@ var res = await kuzzle.document.search( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } \ No newline at end of file diff --git a/doc/3/core-classes/user/next/snippets/fromsize.dart b/doc/3/core-classes/user/next/snippets/fromsize.dart index 66e0b440..3b614d19 100644 --- a/doc/3/core-classes/user/next/snippets/fromsize.dart +++ b/doc/3/core-classes/user/next/snippets/fromsize.dart @@ -13,7 +13,7 @@ for (var i = 1; i <= 5; i++) { }); } -var res = await kuzzle.security.searchUsers( +SearchResult? res = await kuzzle.security.searchUsers( query: { 'query': { 'term': { @@ -27,6 +27,6 @@ var res = await kuzzle.security.searchUsers( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } diff --git a/doc/3/core-classes/user/next/snippets/scroll.dart b/doc/3/core-classes/user/next/snippets/scroll.dart index 4449095b..ccba8a17 100644 --- a/doc/3/core-classes/user/next/snippets/scroll.dart +++ b/doc/3/core-classes/user/next/snippets/scroll.dart @@ -13,7 +13,7 @@ for (var i = 1; i <= 5; i++) { }); } -var res = await kuzzle.security.searchUsers( +SearchResult? res = await kuzzle.security.searchUsers( query: { 'query': { 'term': { @@ -27,6 +27,6 @@ var res = await kuzzle.security.searchUsers( final result = []; while (res != null) { - result.addAll(res.hits); + result.addAll(res.hits as Iterable); res = await res.next(); } diff --git a/doc/3/getting-started/.flutter/pubspec.yaml b/doc/3/getting-started/.flutter/pubspec.yaml index 56115952..925327b4 100644 --- a/doc/3/getting-started/.flutter/pubspec.yaml +++ b/doc/3/getting-started/.flutter/pubspec.yaml @@ -3,7 +3,7 @@ description: A new Flutter project. # The following line prevents the package from being accidentally published to # pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev +publish_to: "none" # Remove this line if you wish to publish to pub.dev # The following defines the version and build number for your application. # A version number is three numbers separated by dots, like 1.2.43 @@ -18,13 +18,12 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev version: 1.0.0+1 environment: - sdk: ">=2.7.0 <3.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: flutter: sdk: flutter - kuzzle: ^2.0.1 - + kuzzle: ^3.0.3 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. @@ -39,7 +38,6 @@ dev_dependencies: # The following section is specific to Flutter. flutter: - # The following line ensures that the Material Icons font is # included with your application, so that you can use the icons in # the material Icons class. diff --git a/pubspec.yaml b/pubspec.yaml index a7d04ae7..ba065c8b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -8,8 +8,8 @@ environment: dependencies: pedantic: ^1.11.1 meta: ^1.4.0 - uuid: ^3.0.4 - http: ^0.13.3 + uuid: ^4.3.3 + http: ^1.2.1 mockito: ^5.0.10 dev_dependencies: test: ^1.17.8