From 977c894cef34f99c1c68d3624bb734792bee89ff Mon Sep 17 00:00:00 2001 From: YujithIsura Date: Tue, 20 Aug 2024 11:27:15 +0530 Subject: [PATCH] build errors fixed after version update --- api/Dependencies.toml | 72 ++++++++++++++++++++++++++++-------------- api/main.bal | 18 +++++------ api/tests/geo_data.bal | 18 +++++------ 3 files changed, 67 insertions(+), 41 deletions(-) diff --git a/api/Dependencies.toml b/api/Dependencies.toml index 2baa3f2..6723246 100644 --- a/api/Dependencies.toml +++ b/api/Dependencies.toml @@ -5,7 +5,7 @@ [ballerina] dependencies-toml-version = "2" -distribution-version = "2201.5.0" +distribution-version = "2201.8.7" [[package]] org = "avinyafoundation" @@ -29,7 +29,7 @@ modules = [ [[package]] org = "ballerina" name = "auth" -version = "2.8.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "jballerina.java"}, @@ -41,7 +41,7 @@ dependencies = [ [[package]] org = "ballerina" name = "cache" -version = "3.5.0" +version = "3.8.0" dependencies = [ {org = "ballerina", name = "constraint"}, {org = "ballerina", name = "jballerina.java"}, @@ -52,7 +52,7 @@ dependencies = [ [[package]] org = "ballerina" name = "constraint" -version = "1.2.0" +version = "1.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -60,7 +60,7 @@ dependencies = [ [[package]] org = "ballerina" name = "crypto" -version = "2.3.2" +version = "2.6.3" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -69,7 +69,7 @@ dependencies = [ [[package]] org = "ballerina" name = "file" -version = "1.7.1" +version = "1.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -80,25 +80,30 @@ dependencies = [ [[package]] org = "ballerina" name = "graphql" -version = "1.8.1" +version = "1.11.2" dependencies = [ {org = "ballerina", name = "auth"}, + {org = "ballerina", name = "cache"}, + {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "file"}, {org = "ballerina", name = "http"}, {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "jwt"}, {org = "ballerina", name = "lang.array"}, + {org = "ballerina", name = "lang.regexp"}, {org = "ballerina", name = "lang.value"}, {org = "ballerina", name = "log"}, {org = "ballerina", name = "mime"}, {org = "ballerina", name = "oauth2"}, {org = "ballerina", name = "task"}, {org = "ballerina", name = "time"}, + {org = "ballerina", name = "uuid"}, {org = "ballerina", name = "websocket"} ] modules = [ {org = "ballerina", packageName = "graphql", moduleName = "graphql"}, + {org = "ballerina", packageName = "graphql", moduleName = "graphql.dataloader"}, {org = "ballerina", packageName = "graphql", moduleName = "graphql.parser"}, {org = "ballerina", packageName = "graphql", moduleName = "graphql.subgraph"} ] @@ -106,7 +111,7 @@ modules = [ [[package]] org = "ballerina" name = "http" -version = "2.8.7" +version = "2.10.15" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "cache"}, @@ -134,7 +139,7 @@ dependencies = [ [[package]] org = "ballerina" name = "io" -version = "1.4.1" +version = "1.6.1" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "lang.value"} @@ -151,7 +156,7 @@ version = "0.0.0" [[package]] org = "ballerina" name = "jwt" -version = "2.8.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -188,6 +193,15 @@ dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "lang.error" +version = "0.0.0" +scope = "testOnly" +dependencies = [ + {org = "ballerina", name = "jballerina.java"} +] + [[package]] org = "ballerina" name = "lang.int" @@ -239,7 +253,7 @@ dependencies = [ [[package]] org = "ballerina" name = "log" -version = "2.7.1" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -253,7 +267,7 @@ modules = [ [[package]] org = "ballerina" name = "mime" -version = "2.7.1" +version = "2.9.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -263,7 +277,7 @@ dependencies = [ [[package]] org = "ballerina" name = "oauth2" -version = "2.8.0" +version = "2.10.0" dependencies = [ {org = "ballerina", name = "cache"}, {org = "ballerina", name = "crypto"}, @@ -276,7 +290,7 @@ dependencies = [ [[package]] org = "ballerina" name = "observe" -version = "1.0.7" +version = "1.2.3" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -284,7 +298,7 @@ dependencies = [ [[package]] org = "ballerina" name = "os" -version = "1.6.0" +version = "1.8.0" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"} @@ -293,7 +307,7 @@ dependencies = [ [[package]] org = "ballerina" name = "sql" -version = "1.9.1" +version = "1.12.2" dependencies = [ {org = "ballerina", name = "io"}, {org = "ballerina", name = "jballerina.java"}, @@ -307,7 +321,7 @@ modules = [ [[package]] org = "ballerina" name = "task" -version = "2.3.2" +version = "2.5.0" dependencies = [ {org = "ballerina", name = "jballerina.java"}, {org = "ballerina", name = "time"} @@ -319,7 +333,8 @@ name = "test" version = "0.0.0" scope = "testOnly" dependencies = [ - {org = "ballerina", name = "jballerina.java"} + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.error"} ] modules = [ {org = "ballerina", packageName = "test", moduleName = "test"} @@ -328,7 +343,7 @@ modules = [ [[package]] org = "ballerina" name = "time" -version = "2.2.5" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] @@ -339,15 +354,26 @@ modules = [ [[package]] org = "ballerina" name = "url" -version = "2.2.4" +version = "2.4.0" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] +[[package]] +org = "ballerina" +name = "uuid" +version = "1.7.0" +dependencies = [ + {org = "ballerina", name = "crypto"}, + {org = "ballerina", name = "jballerina.java"}, + {org = "ballerina", name = "lang.int"}, + {org = "ballerina", name = "time"} +] + [[package]] org = "ballerina" name = "websocket" -version = "2.8.2" +version = "2.10.2" dependencies = [ {org = "ballerina", name = "auth"}, {org = "ballerina", name = "constraint"}, @@ -379,7 +405,7 @@ modules = [ [[package]] org = "ballerinax" name = "mysql" -version = "1.9.0" +version = "1.11.0" dependencies = [ {org = "ballerina", name = "crypto"}, {org = "ballerina", name = "io"}, @@ -394,7 +420,7 @@ modules = [ [[package]] org = "ballerinax" name = "mysql.driver" -version = "1.4.1" +version = "1.6.0" modules = [ {org = "ballerinax", packageName = "mysql.driver", moduleName = "mysql.driver"} ] diff --git a/api/main.bal b/api/main.bal index 09169e7..d5faf5e 100644 --- a/api/main.bal +++ b/api/main.bal @@ -8,7 +8,7 @@ import ballerina/time; // label: "Global Data API", // id: "global-data" // } -service graphql:Service /graphql on new graphql:Listener(4000) { +service /graphql on new graphql:Listener(4000) { resource function get geo() returns GeoData { return new (); } @@ -1574,7 +1574,7 @@ service graphql:Service /graphql on new graphql:Listener(4000) { return attendnaceDatas; } - isolated resource function get person_attendance_report(int? person_id, int? activity_id, int? result_limit = -1) returns ActivityParticipantAttendanceData[]|error? { + isolated resource function get person_attendance_report(int? person_id, int? activity_id, int? result_limit = 0) returns ActivityParticipantAttendanceData[]|error? { stream attendance_records; if (result_limit > 0) { @@ -1613,7 +1613,7 @@ service graphql:Service /graphql on new graphql:Listener(4000) { return attendnaceDatas; } - isolated resource function get class_attendance_report(int? organization_id, int? parent_organization_id, int? activity_id, int? result_limit = -1, string? from_date = null, string? to_date = null) returns ActivityParticipantAttendanceData[]|error? { + isolated resource function get class_attendance_report(int? organization_id, int? parent_organization_id, int? activity_id, int? result_limit = 0, string? from_date = "", string? to_date = "") returns ActivityParticipantAttendanceData[]|error? { stream attendance_records; time:Utc startTime = time:utcNow(); @@ -1715,7 +1715,7 @@ service graphql:Service /graphql on new graphql:Listener(4000) { return attendnaceDatas; } - isolated resource function get late_attendance_report(int? organization_id, int? parent_organization_id, int? activity_id, int? result_limit = -1, string? from_date = null, string? to_date = null) returns ActivityParticipantAttendanceDataForLateAttendance[]|error? { + isolated resource function get late_attendance_report(int? organization_id, int? parent_organization_id, int? activity_id, int? result_limit = 0, string? from_date = "", string? to_date = "") returns ActivityParticipantAttendanceDataForLateAttendance[]|error? { stream attendance_records; time:Utc startTime = time:utcNow(); @@ -3701,7 +3701,7 @@ WHERE name = "Admission Cycle" AND NOW() BETWEEN start_time AND end_time;` return new (insert_id); } - isolated resource function get attendance_dashboard_data_by_date(int? organization_id, int? parent_organization_id, int? activity_id, string? from_date = null, string? to_date = null) returns AttendanceDashboardDataMain[]|error? { + isolated resource function get attendance_dashboard_data_by_date(int? organization_id, int? parent_organization_id, int? activity_id, string? from_date = "", string? to_date = "") returns AttendanceDashboardDataMain[]|error? { stream present_count; stream absent_count; stream late_attendance; @@ -4241,7 +4241,7 @@ AND p.organization_id IN ( return dashboardDatas; } - isolated resource function get attendance_missed_by_security(int? organization_id, int? parent_organization_id, string? from_date = null, string? to_date = null) returns ActivityParticipantAttendanceMissedBySecurityData[]|error? { + isolated resource function get attendance_missed_by_security(int? organization_id, int? parent_organization_id, string? from_date = "", string? to_date = "") returns ActivityParticipantAttendanceMissedBySecurityData[]|error? { stream attendance_missed_by_security_records; @@ -4461,7 +4461,7 @@ AND p.organization_id IN ( } } - isolated resource function get total_attendance_count_by_date(int? organization_id, int? parent_organization_id, string? from_date = null, string? to_date = null) returns TotalActivityParticipantAttendanceCountByDateData[]|error? { + isolated resource function get total_attendance_count_by_date(int? organization_id, int? parent_organization_id, string? from_date = "", string? to_date = "") returns TotalActivityParticipantAttendanceCountByDateData[]|error? { stream total_attendance_count_by_date_records; @@ -4581,7 +4581,7 @@ AND p.organization_id IN ( } } - isolated resource function get daily_attendance_summary_report(int? organization_id, int? avinya_type_id, string? from_date = null, string? to_date = null) returns DailyActivityParticipantAttendanceSummaryReportData[]|error? { + isolated resource function get daily_attendance_summary_report(int? organization_id, int? avinya_type_id, string? from_date = "", string? to_date = "") returns DailyActivityParticipantAttendanceSummaryReportData[]|error? { stream daily_attendance_summary_report_records; @@ -4695,7 +4695,7 @@ AND p.organization_id IN ( } } - isolated resource function get inventory_data_by_organization(int? organization_id, string? date = null) returns InventoryData[]|error? { + isolated resource function get inventory_data_by_organization(int? organization_id, string? date = "") returns InventoryData[]|error? { stream inventory_data; diff --git a/api/tests/geo_data.bal b/api/tests/geo_data.bal index 0e2d498..aa15fcb 100644 --- a/api/tests/geo_data.bal +++ b/api/tests/geo_data.bal @@ -6,7 +6,7 @@ graphql:Client test_client = check new ("http://localhost:4000/graphql"); @test:Config {} public function testGetProvince() { // Attempt to get geo information for Dehiwala - json|error? a = test_client->executeWithType(string ` + json|error? a = test_client->execute(string ` query test($name:String!) { geo { city(name: $name) { @@ -25,17 +25,17 @@ public function testGetProvince() { // Verify output test:assertEquals(a, { - "data": { - "geo": { - "city": { - "name": {"name_en": "Dehiwala"}, - "district": { - "name": {"name_en": "Colombo"}, - "province": {"name": {"name_en": "Western"}} - } + "data": { + "geo": { + "city": { + "name": {"name_en": "Dehiwala"}, + "district": { + "name": {"name_en": "Colombo"}, + "province": {"name": {"name_en": "Western"}} } } } } + } ); }