From 9024bdc899a5565cc974759a7d8658c5dbec7aa2 Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 10:14:20 +0100 Subject: [PATCH 1/8] upgrade http and uuid lib version --- pubspec.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From 8be47b9c320c1644c0ba6966c78f611ec2eeb519 Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 10:22:55 +0100 Subject: [PATCH 2/8] update the doc-snippet runner dart image version --- .ci/doc/docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; From 69abc1bc85998b8c2d9bf2ac60feef406cedfcf6 Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 10:27:40 +0100 Subject: [PATCH 3/8] fix the package installation command --- .ci/doc/config.yml | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) 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 }} From 1b19ec8ea3ca80c6d6752828b9cd9e0b3fc4cde5 Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 10:37:42 +0100 Subject: [PATCH 4/8] update minimum version of dart sdk --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index ba065c8b..61d999b4 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: A library to interact with kuzzle API. A backend software, self-hostable and ready to use to power modern cross-platform apps. homepage: https://github.com/kuzzleio/sdk-dart environment: - sdk: ">=2.12.0 <4.0.0" + sdk: ">=3.3.0 <4.0.0" dependencies: pedantic: ^1.11.1 meta: ^1.4.0 From f9aec0d622ce270b4dad5d275e8fc822457c856a Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 10:41:46 +0100 Subject: [PATCH 5/8] update minimum bound version for the dart sdk in doc snippet config --- .ci/doc/project/pubspec.yaml | 2 +- doc/3/getting-started/.flutter/pubspec.yaml | 6 ++---- pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) 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/doc/3/getting-started/.flutter/pubspec.yaml b/doc/3/getting-started/.flutter/pubspec.yaml index 56115952..e4149854 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,14 +18,13 @@ 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 - # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.3 @@ -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 61d999b4..ba065c8b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ description: A library to interact with kuzzle API. A backend software, self-hostable and ready to use to power modern cross-platform apps. homepage: https://github.com/kuzzleio/sdk-dart environment: - sdk: ">=3.3.0 <4.0.0" + sdk: ">=2.12.0 <4.0.0" dependencies: pedantic: ^1.11.1 meta: ^1.4.0 From 04852a1570cfd31092a5f547256ab1b5605642ac Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 10:45:21 +0100 Subject: [PATCH 6/8] fix snippet test error catching template --- .ci/doc/templates/catch.tpl.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } From 46cd184f22282d9fbfb1cc63feccc9a1e29082a4 Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 14:01:23 +0100 Subject: [PATCH 7/8] fix typing in snippet examples according to null safety requirements --- doc/3/core-classes/profile/next/snippets/fromsize.dart | 4 ++-- doc/3/core-classes/profile/next/snippets/scroll.dart | 4 ++-- doc/3/core-classes/role/next/snippets/fromsize.dart | 4 ++-- .../core-classes/search-result/next/snippets/fromsize-es.dart | 4 ++-- .../search-result/next/snippets/fromsize-koncorde.dart | 4 ++-- doc/3/core-classes/search-result/next/snippets/scroll-es.dart | 4 ++-- .../search-result/next/snippets/scroll-koncorde.dart | 4 ++-- doc/3/core-classes/user/next/snippets/fromsize.dart | 4 ++-- doc/3/core-classes/user/next/snippets/scroll.dart | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) 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(); } From d94e5889115ec4a3847f827cff55430e9a6e0d4e Mon Sep 17 00:00:00 2001 From: Alexandre Bouthinon Date: Fri, 22 Mar 2024 14:14:31 +0100 Subject: [PATCH 8/8] update getting started pubspec file to match null safety Dart usage --- doc/3/getting-started/.flutter/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/3/getting-started/.flutter/pubspec.yaml b/doc/3/getting-started/.flutter/pubspec.yaml index e4149854..925327b4 100644 --- a/doc/3/getting-started/.flutter/pubspec.yaml +++ b/doc/3/getting-started/.flutter/pubspec.yaml @@ -23,7 +23,7 @@ environment: 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.