From d611ec2381a4fcc8233864cdf7cd7b63e6a578cc Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Wed, 24 Jul 2024 15:08:28 +0530 Subject: [PATCH 01/42] Load central package from pre generated JSON --- .../langserver/LSPackageLoader.java | 37 +- .../src/main/resources/moduleInfo.json | 16274 ++++++++++++++++ 2 files changed, 16283 insertions(+), 28 deletions(-) create mode 100644 language-server/modules/langserver-core/src/main/resources/moduleInfo.json diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java index 68daa2c7a317..6b1cc15c3d32 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java @@ -15,6 +15,8 @@ */ package org.ballerinalang.langserver; +import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; import io.ballerina.compiler.api.ModuleID; import io.ballerina.compiler.api.SemanticModel; import io.ballerina.projects.Module; @@ -34,6 +36,7 @@ import io.ballerina.projects.environment.ResolutionRequest; import io.ballerina.projects.internal.environment.BallerinaDistribution; import io.ballerina.projects.internal.environment.BallerinaUserHome; +import io.ballerina.projects.util.FileUtils; import org.ballerinalang.langserver.codeaction.CodeActionModuleId; import org.ballerinalang.langserver.common.utils.ModuleUtil; import org.ballerinalang.langserver.commons.DocumentServiceContext; @@ -48,19 +51,18 @@ import org.eclipse.lsp4j.jsonrpc.messages.Either; import org.wso2.ballerinalang.compiler.util.Names; +import java.io.IOException; import java.nio.file.Path; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; /** @@ -139,33 +141,11 @@ public void loadModules(LanguageServerContext context) { lsClientLogger.logTrace("Loading packages from Ballerina distribution"); this.distRepoPackages.addAll(checkAndResolvePackagesFromRepository(packageRepository, skippedLangLibs, Collections.emptySet())); - Set distRepoModuleIdentifiers = distRepoPackages.stream().map(ModuleInfo::packageIdentifier) - .collect(Collectors.toSet()); lsClientLogger.logTrace("Successfully loaded packages from Ballerina distribution"); - lsClientLogger.logTrace("Loading packages from Ballerina User Home"); - BallerinaUserHome ballerinaUserHome = BallerinaUserHome.from(environment); - //Load modules from local repo - PackageRepository localRepository = ballerinaUserHome.localPackageRepository(); - this.localRepoPackages.addAll(checkAndResolvePackagesFromRepository(localRepository, - Collections.emptyList(), distRepoModuleIdentifiers)); - - //Load modules from remote repo - PackageRepository remoteRepository = ballerinaUserHome.remotePackageRepository(); - Set loadedModules = new HashSet<>(); - loadedModules.addAll(distRepoModuleIdentifiers); - loadedModules.addAll(localRepoPackages.stream().map(ModuleInfo::packageIdentifier) - .collect(Collectors.toSet())); - this.remoteRepoPackages.addAll(checkAndResolvePackagesFromRepository(remoteRepository, - Collections.emptyList(), - loadedModules)); - lsClientLogger.logTrace("Successfully loaded packages from Ballerina User Home"); - this.getDistributionRepoModules().forEach(packageInfo -> packagesList.put(packageInfo.packageIdentifier(), packageInfo)); - List repoPackages = new ArrayList<>(); - repoPackages.addAll(this.getRemoteRepoModules()); - repoPackages.addAll(this.getLocalRepoModules()); + List repoPackages = new ArrayList<>(this.getLocalRepoModules()); repoPackages.stream().filter(packageInfo -> !packagesList.containsKey(packageInfo.packageIdentifier())) .forEach(packageInfo -> packagesList.put(packageInfo.packageIdentifier(), packageInfo)); }).thenRunAsync(() -> { @@ -179,10 +159,11 @@ public void loadModules(LanguageServerContext context) { progressNotification.setCancellable(false); languageClient.notifyProgress(new ProgressParams(Either.forLeft(taskId), Either.forLeft(progressNotification))); - }).thenRunAsync(() -> { try { - this.centralPackages.addAll(this.centralPackageDescriptorLoader.getCentralPackages().get()); - } catch (InterruptedException | ExecutionException e) { + String moduleInfo = FileUtils.readFileAsString("moduleInfo.json"); + this.centralPackages.addAll(new Gson().fromJson(moduleInfo, new TypeToken>() { + }.getType())); + } catch (IOException e) { throw new RuntimeException(e); } }).thenRunAsync(() -> { diff --git a/language-server/modules/langserver-core/src/main/resources/moduleInfo.json b/language-server/modules/langserver-core/src/main/resources/moduleInfo.json new file mode 100644 index 000000000000..e9da8371a3b1 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/resources/moduleInfo.json @@ -0,0 +1,16274 @@ +[ + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "twilio" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/twilio", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "choreo" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 4, + "patch": 12 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/choreo", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.sheets" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 5, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.sheets", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "client.config" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/client.config", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "salesforce" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 8, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/salesforce", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.salesforce" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 10, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.salesforce", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "twitter" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/twitter", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "java.jdbc" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 11, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/java.jdbc", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "covid19" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/covid19", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mysql" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 12, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mysql", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "worldbank" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/worldbank", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mysql.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mysql.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "asyncapi.native.handler" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/asyncapi.native.handler", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "kafka" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/kafka", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "postgresql" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 12, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/postgresql", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "github" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 5, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/github", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "redis" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/redis", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mssql.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mssql.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "persist.sql" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/persist.sql", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.github" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.github", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.slack" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 8, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.slack", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.gmail" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.gmail", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "jaeger" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 5, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/jaeger", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure_storage_service" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure_storage_service", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.calendar" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.calendar", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.s3" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.s3", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.base" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.base", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.drive" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.drive", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "slack" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/slack", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mssql" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 12, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mssql", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 5, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mongodb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 5, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mongodb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "stripe" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/stripe", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openweathermap" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openweathermap", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "netsuite" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/netsuite", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.chat" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.chat", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "asb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 8, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/asb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.text" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 5 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.text", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.google.sheets" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.google.sheets", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "rabbitmq" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/rabbitmq", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.openai.text" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.openai.text", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "postgresql.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/postgresql.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.openai.chat" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.openai.chat", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.google.drive" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 10, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.google.drive", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.international401" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.international401", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure_cosmosdb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure_cosmosdb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.contact" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.contact", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.asgardeo" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 7, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.asgardeo", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.google.mail" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 10, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.google.mail", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.google.calendar" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 11, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.google.calendar", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.parser" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 5, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.parser", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.asb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.asb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mailchimp" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mailchimp", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shopify.admin" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 5, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shopify.admin", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zoom" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 7, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zoom", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.sqs" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.sqs", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "servicenow" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/servicenow", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "prometheus" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/prometheus", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.onedrive" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.onedrive", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.ses" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.ses", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "capsulecrm" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/capsulecrm", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.dynamodb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.dynamodb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.people" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.people", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trello" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trello", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "themoviedb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/themoviedb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "newsapi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/newsapi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "spotify" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/spotify", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.excel" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.excel", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v2" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v2", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.teams" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.teams", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "quickbooks.online" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/quickbooks.online", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhirr4" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhirr4", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.convertcurrency" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.convertcurrency", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "eventbrite" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/eventbrite", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ronin" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ronin", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "asana" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/asana", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.outlook.mail" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.outlook.mail", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.weatherzip" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.weatherzip", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pipedrive" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pipedrive", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.accounts" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.accounts", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "scim" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/scim", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.twilio" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.twilio", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aayu.mftg.as2" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aayu.mftg.as2", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "snowflake.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 7, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/snowflake.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zoho.people" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zoho.people", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "paypal.orders" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/paypal.orders", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "activecampaign" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/activecampaign", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.aayu.mftg.as2" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.aayu.mftg.as2", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure_eventhub" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure_eventhub", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.uscore501" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 4 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.uscore501", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "confluent.cregistry" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/confluent.cregistry", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v23" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v23", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "oracledb.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/oracledb.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "livestorm" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 6, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/livestorm", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v25" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v25", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.clients.fhir" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.clients.fhir", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v251" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v251", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v26" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v26", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v28" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v28", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v231" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v231", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v27" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v27", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v24" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v24", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cdata.connect.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 1, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cdata.connect.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v2commons" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 1, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v2commons", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "h2.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/h2.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4utils.fhirpath" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4utils.fhirpath", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "persist.inmemory" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/persist.inmemory", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "oracledb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 11, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/oracledb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v2.utils.v2tofhirr4" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v2.utils.v2tofhirr4", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.redshift" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.redshift", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.redshift.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.redshift.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nats" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nats", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.validator" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 2, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.validator", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "exchangerates" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/exchangerates", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4utils" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4utils", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "peoplehr" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 2, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/peoplehr", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "vonage.sms" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/vonage.sms", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "snowflake" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/snowflake", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.sns" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.sns", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.keyvault" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.keyvault", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sendgrid" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sendgrid", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zipkin" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 8, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zipkin", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.aubase410" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.aubase410", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4utils.ccdatofhir" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 4 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4utils.ccdatofhir", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.shopify" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.shopify", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.hubspot" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.hubspot", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.terminology" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 1, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.terminology", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.embeddings" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 5 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.embeddings", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "amadeus.flightofferssearch" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/amadeus.flightofferssearch", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "amadeus.flightoffersprice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/amadeus.flightoffersprice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.lkcore010" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.lkcore010", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "medium" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/medium", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "trigger.quickbooks" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/trigger.quickbooks", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "amadeus.flightcreateorders" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/amadeus.flightcreateorders", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "leanix.integrationapi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/leanix.integrationapi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "java.jms" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/java.jms", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "candid" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/candid", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.images" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 5 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.images", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.textanalytics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.textanalytics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "impala" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/impala", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.docs" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.docs", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ibm.ibmmq" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ibm.ibmmq", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cdata.connect" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cdata.connect", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "copybook" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/copybook", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.aubase421" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.aubase421", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.audio" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 5 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.audio", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudfunctions" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudfunctions", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "confluent.cavroserdes" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/confluent.cavroserdes", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.supplychain" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.supplychain", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "dayforce" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/dayforce", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.functions" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.functions", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "persist.googlesheets" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/persist.googlesheets", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.lambda" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.lambda", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zendesk.support" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zendesk.support", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.retail" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.retail", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pinecone.vector" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pinecone.vector", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "activemq.driver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/activemq.driver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.ad" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 5, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.ad", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ellucian.studentcharges" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ellucian.studentcharges", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "jira" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/jira", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.jco" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 4 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.jco", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.finetunes" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 5 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.finetunes", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.r4.aucore040" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.r4.aucore040", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.smartconfiguration" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.smartconfiguration", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "whatsapp.business" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/whatsapp.business", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.patient" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 4 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.patient", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cloudmersive.currency" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cloudmersive.currency", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "wso2.controlplane" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/wso2.controlplane", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.openai.embeddings" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.openai.embeddings", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.sqldb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.sqldb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "newrelic" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 7, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/newrelic", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openai.moderations" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 5 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openai.moderations", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.metadata" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.metadata", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "fraudlabspro.frauddetection" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/fraudlabspro.frauddetection", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "worldtimeapi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/worldtimeapi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bitbucket" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bitbucket", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.bigquery" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.bigquery", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.oauth2" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.oauth2", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "file360" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/file360", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.dynamics365businesscentral" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.dynamics365businesscentral", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.gcalendar" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 4, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.gcalendar", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.patient" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.patient", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.encounter" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.encounter", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "weaviate" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/weaviate", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.datalake" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.datalake", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.finance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.finance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.athenaconnect" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.athenaconnect", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "stabilityai" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/stabilityai", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.books" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.books", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mathtools.numbers" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mathtools.numbers", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.rooms" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.rooms", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.vision" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.vision", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.epicconnect" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.epicconnect", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.cernerconnect" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.cernerconnect", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.practitioner" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.practitioner", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.observation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.observation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.outlook.calendar" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.outlook.calendar", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.user" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.user", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.customeraccounts" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.customeraccounts", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.admin" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.admin", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.appsscript" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.appsscript", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.connect" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.connect", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "facebook.ads" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/facebook.ads", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.classroom" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.classroom", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "dataflowkit" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/dataflowkit", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "paylocity" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/paylocity", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pandadoc" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pandadoc", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "optirtc.public" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/optirtc.public", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "webscraping.ai" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/webscraping.ai", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zoho.crm.rest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zoho.crm.rest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.common" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.common", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "transformer" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/transformer", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.practitioner" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.practitioner", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.organization" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.organization", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.wls.screeninghits" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.wls.screeninghits", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "notion" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/notion", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.currencyrate" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.currencyrate", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openair" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openair", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "alfresco" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/alfresco", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ably" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ably", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.customizebehavior" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.customizebehavior", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "elmah" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/elmah", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "salesforce.einstein" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/salesforce.einstein", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.youtube.data" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.youtube.data", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.clouddatastore" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.clouddatastore", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ip2whois" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ip2whois", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "freshbooks" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/freshbooks", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "wordpress" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/wordpress", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "paypal.payments" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/paypal.payments", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "elasticsearch" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/elasticsearch", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.marketing" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.marketing", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edocs" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edocs", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "reckon.one" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/reckon.one", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "readme" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/readme", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "power.bi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/power.bi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_sales_order_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_sales_order_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "persist.redis" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/persist.redis", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zendesk" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zendesk", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.hl7v271" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 3, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.hl7v271", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.simpledb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 2, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.simpledb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.uscore501.patient" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.uscore501.patient", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.manufacturercenter" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.manufacturercenter", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.absencemanagement" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.absencemanagement", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.bankfeeds" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.bankfeeds", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "gitlab" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/gitlab", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sinch.sms" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sinch.sms", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.youtube.analytics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.youtube.analytics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mitto.sms" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mitto.sms", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "visiblethread" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/visiblethread", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.timeseries" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.timeseries", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "fraudlabspro.smsverification" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/fraudlabspro.smsverification", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "brex.team" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/brex.team", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.vault" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.vault", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "orbitcrm" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/orbitcrm", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "dracoon.public" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/dracoon.public", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "adp.paystatements" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/adp.paystatements", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ynab" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ynab", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.assets" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.assets", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "botify" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/botify", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.customer" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.customer", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "wordnik" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/wordnik", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "journey.io" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/journey.io", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.successfactors.litmos" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.successfactors.litmos", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "recurly" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/recurly", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "owler" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/owler", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zoho.books" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zoho.books", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.files" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.files", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "salesforce.pardot" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/salesforce.pardot", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.click" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.click", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "api2pdf" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/api2pdf", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bulksms" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bulksms", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "odweather" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/odweather", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.slides" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.slides", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.product" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.product", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.agreement" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.agreement", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bintable" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bintable", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pdfbroker" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pdfbroker", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "automata" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/automata", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.deal" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.deal", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.helpdesk" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.helpdesk", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "spotto" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/spotto", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudtalentsolution" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudtalentsolution", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.bigquery.datatransfer" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.bigquery.datatransfer", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.company" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.company", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shorten.rest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shorten.rest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudfilestore" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudfilestore", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.abuse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.abuse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.lead" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.lead", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "adobe.analytics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/adobe.analytics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.auditlog" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.auditlog", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sugarcrm" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sugarcrm", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.orders" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.orders", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.coreaccounting" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.coreaccounting", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pagerduty" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pagerduty", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "dropbox" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/dropbox", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pocketsmith" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pocketsmith", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.product" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.product", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "jira.servicemanagement" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/jira.servicemanagement", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.analytics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.analytics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ellucian.student" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ellucian.student", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_salesorganization_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_salesorganization_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_sales_order_simulation_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_sales_order_simulation_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.ce_salesorder_0001" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.ce_salesorder_0001", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_sales_inquiry_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_sales_inquiry_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_sales_quotation_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_sales_quotation_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_sd_incoterms_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_sd_incoterms_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.salesarea_0001" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.salesarea_0001", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_sd_sa_soldtopartydetn" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_sd_sa_soldtopartydetn", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.s4hana.api_salesdistrict_srv" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.s4hana.api_salesdistrict_srv", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "aws.dynamodbstreams" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/aws.dynamodbstreams", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "guidewire.insnow" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/guidewire.insnow", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.dsesign" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.dsesign", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.dsadmin" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.dsadmin", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.dsclick" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.dsclick", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.servicerequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.servicerequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.messageheader" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.messageheader", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.visionprescription" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.visionprescription", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.terminologycapabilities" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.terminologycapabilities", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.specimen" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.specimen", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.supplyrequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.supplyrequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.observation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.observation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.researchelementdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.researchelementdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.schedule" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.schedule", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.riskevidencesynthesis" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.riskevidencesynthesis", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.organizationaffiliation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.organizationaffiliation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.person" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.person", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.testreport" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.testreport", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.researchsubject" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.researchsubject", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.riskassessment" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.riskassessment", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.supplydelivery" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.supplydelivery", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.plandefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.plandefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.specimendefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.specimendefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.task" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.task", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.paymentnotice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.paymentnotice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.relatedperson" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.relatedperson", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.structuredefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.structuredefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.researchdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.researchdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.searchparameter" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.searchparameter", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substanceprotein" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substanceprotein", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substancespecification" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substancespecification", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.testscript" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.testscript", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substancenucleicacid" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substancenucleicacid", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.questionnaire" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.questionnaire", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.organization" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.organization", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substancepolymer" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substancepolymer", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.observationdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.observationdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substancereferenceinformation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substancereferenceinformation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.researchstudy" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.researchstudy", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.namingsystem" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.namingsystem", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.substancesourcematerial" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.substancesourcematerial", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.practitionerrole" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.practitionerrole", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.verificationresult" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.verificationresult", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.structuremap" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.structuremap", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.provenance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.provenance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.slot" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.slot", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.subscription" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.subscription", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.paymentreconciliation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.paymentreconciliation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.requestgroup" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.requestgroup", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.procedure" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.procedure", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.questionnaireresponse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.questionnaireresponse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.nutritionorder" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.nutritionorder", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.molecularsequence" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.molecularsequence", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.parameters" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.parameters", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.operationdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.operationdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.messagedefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.messagedefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproduct" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproduct", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductindication" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductindication", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductcontraindication" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductcontraindication", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductinteraction" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductinteraction", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductpackaged" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductpackaged", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductundesirableeffect" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductundesirableeffect", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductmanufactured" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductmanufactured", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductpharmaceutical" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductpharmaceutical", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductingredient" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductingredient", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicinalproductauthorization" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicinalproductauthorization", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicationadministration" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicationadministration", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicationstatement" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicationstatement", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicationknowledge" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicationknowledge", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicationrequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicationrequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medicationdispense" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medicationdispense", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.medication" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.medication", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.media" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.media", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.location" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.location", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.measure" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.measure", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.measurereport" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.measurereport", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.implementationguide" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.implementationguide", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.list" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.list", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.linkage" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.linkage", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.invoice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.invoice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.insuranceplan" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.insuranceplan", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.library" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.library", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.imagingstudy" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.imagingstudy", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.immunization" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.immunization", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.immunizationevaluation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.immunizationevaluation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.immunizationrecommendation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.immunizationrecommendation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.careplan" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.careplan", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.activitydefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.activitydefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.enrollmentrequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.enrollmentrequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.healthcareservice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.healthcareservice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.devicedefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.devicedefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.contract" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.contract", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.deviceusestatement" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.deviceusestatement", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.biologicallyderivedproduct" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.biologicallyderivedproduct", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.guidanceresponse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.guidanceresponse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.auditevent" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.auditevent", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.effectevidencesynthesis" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.effectevidencesynthesis", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.explanationofbenefit" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.explanationofbenefit", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.evidencevariable" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.evidencevariable", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.compartmentdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.compartmentdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.encounter" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.encounter", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.devicerequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.devicerequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.eventdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.eventdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.careteam" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.careteam", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.goal" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.goal", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.endpoint" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.endpoint", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.documentreference" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.documentreference", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.evidence" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.evidence", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.diagnosticreport" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.diagnosticreport", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.group" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.group", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.clinicalimpression" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.clinicalimpression", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.communicationrequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.communicationrequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.appointmentresponse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.appointmentresponse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.chargeitem" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.chargeitem", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.claim" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.claim", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.device" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.device", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.coverage" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.coverage", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.episodeofcare" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.episodeofcare", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.flag" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.flag", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.examplescenario" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.examplescenario", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.devicemetric" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.devicemetric", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.allergyintolerance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.allergyintolerance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.documentmanifest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.documentmanifest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.graphdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.graphdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.basic" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.basic", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.claimresponse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.claimresponse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.consent" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.consent", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.familymemberhistory" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.familymemberhistory", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.enrollmentresponse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.enrollmentresponse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.composition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.composition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.chargeitemdefinition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.chargeitemdefinition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.catalogentry" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.catalogentry", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.bodystructure" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.bodystructure", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.coverageeligibilityrequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.coverageeligibilityrequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.communication" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.communication", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.detectedissue" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.detectedissue", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.conceptmap" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.conceptmap", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.appointment" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.appointment", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.coverageeligibilityresponse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.coverageeligibilityresponse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.adverseevent" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.adverseevent", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.condition" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.condition", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.international401.account" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 0, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.international401.account", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "beezup.merchant" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 6, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/beezup.merchant", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.shipping" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.shipping", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.services" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.services", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.logistics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.logistics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "edifact.d03a.manufacturing" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 9, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/edifact.d03a.manufacturing", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.uscore501.encounter" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.uscore501.encounter", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.servicerequest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.servicerequest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.diagnosticreport" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 3 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.diagnosticreport", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "health.fhir.templates.r4.repositorysync" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/health.fhir.templates.r4.repositorysync", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "microsoft.onenote" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 4, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/microsoft.onenote", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.quote" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.quote", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.datetime" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.datetime", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.qnamaker" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.qnamaker", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.aftermarket" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.aftermarket", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cloudmersive.barcode" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cloudmersive.barcode", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.pipeline" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.pipeline", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "insightly.custom" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/insightly.custom", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "brex.onboarding" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/brex.onboarding", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "docusign.monitor" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/docusign.monitor", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.subscriptions" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.subscriptions", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "onepassword" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/onepassword", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.text" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.text", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "isbndb" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/isbndb", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cloudmersive.security" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cloudmersive.security", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bitly" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bitly", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudbillingaccount" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudbillingaccount", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "gototraining" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/gototraining", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "apideck.proxy" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/apideck.proxy", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "magento.address" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/magento.address", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.inventory" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.inventory", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "vonage.numberinsight" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/vonage.numberinsight", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "vonage.verify" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/vonage.verify", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sinch.verification" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sinch.verification", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "techport" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/techport", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "opendesign" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/opendesign", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.openai.deployment" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.openai.deployment", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.books" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.books", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.appstore" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.appstore", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nowpayments" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nowpayments", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "clever.data" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/clever.data", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "earthref.fiesta" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/earthref.fiesta", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.certificates" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.certificates", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.timestags" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.timestags", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.promotion" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.promotion", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pushcut" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pushcut", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.residuals" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.residuals", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iptwist" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iptwist", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.cartsordershoppinglists" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.cartsordershoppinglists", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "thinkific" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/thinkific", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shipwire.carrier" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shipwire.carrier", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "siemens.iotandstorage.iotfileservice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/siemens.iotandstorage.iotfileservice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.events" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.events", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "giphy" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/giphy", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.lineitem" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.lineitem", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.negotiation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.negotiation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "prodpad" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/prodpad", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "optitune" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/optitune", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.domains" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.domains", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shipwire.containers" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shipwire.containers", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "uber" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/uber", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.accountspayable" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.accountspayable", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shippit" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shippit", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "supportbee" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/supportbee", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.emailinfo" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.emailinfo", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.weather" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.weather", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "siemens.analytics.anomalydetection" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/siemens.analytics.anomalydetection", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.mostpopular" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.mostpopular", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sakari" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sakari", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "openfigi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/openfigi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.schema" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.schema", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "isendpro" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/isendpro", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "neutrino" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/neutrino", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ritekit" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ritekit", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "tableau" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/tableau", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.customerhierarchy" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.customerhierarchy", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.globalnumberinfo" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.globalnumberinfo", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.producthierarchy" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.producthierarchy", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "box" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/box", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.uom" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.uom", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudscheduler" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudscheduler", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "keap" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/keap", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.recommendation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.recommendation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudtranslation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudtranslation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.newswire" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.newswire", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "optimizely" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/optimizely", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.account" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.account", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "magento.async.customer" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/magento.async.customer", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.configuration" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.configuration", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "extpose" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/extpose", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "rumble.run" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/rumble.run", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.retail" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.retail", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "vonage.numbers" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/vonage.numbers", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.subscriptions" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.subscriptions", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "listen.notes" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/listen.notes", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudpubsub" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudpubsub", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.archive" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.archive", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.customizedata" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.customizedata", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.browse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.browse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shortcut" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shortcut", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "apideck.lead" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/apideck.lead", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.iothub" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.iothub", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zuora.revenue" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zuora.revenue", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.pp.idm" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.pp.idm", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "flatapi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/flatapi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "fungenerators.barcode" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/fungenerators.barcode", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "adp.workerpayrollinstructions" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/adp.workerpayrollinstructions", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shipstation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shipstation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.esignature" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.esignature", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bisstats" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bisstats", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.semantic" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.semantic", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "instagram" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/instagram", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "constantcontact" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/constantcontact", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "disqus" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/disqus", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "eloqua" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/eloqua", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.data" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.data", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.discovery" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.discovery", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "storecove" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/storecove", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "logoraisr" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/logoraisr", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.abusiveexperiencereport" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.abusiveexperiencereport", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "freshdesk" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/freshdesk", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.mybusiness" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.mybusiness", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.businessprocess" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.businessprocess", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "soundcloud" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/soundcloud", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "launchdarkly" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/launchdarkly", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cloudmersive.validate" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cloudmersive.validate", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "figshare" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/figshare", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "avatax" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/avatax", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "graphhopper.directions" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/graphhopper.directions", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "fungenerators.uuid" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/fungenerators.uuid", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.accountreceivable" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.accountreceivable", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "atspoke" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/atspoke", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.feedback" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.feedback", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.shopper" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.shopper", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "samcart" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/samcart", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sinch.conversation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sinch.conversation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bmc.truesightpresentationserver" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bmc.truesightpresentationserver", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.finance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.finance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "vimeo" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/vimeo", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.collections" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.collections", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zuora.collection" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zuora.collection", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.blogger" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.blogger", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "kinto" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/kinto", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.youtube.reporting" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.youtube.reporting", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "files.com" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/files.com", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.property" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.property", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.finances" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.finances", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "pinecone.index" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 2 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/pinecone.index", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.productcatalog" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.productcatalog", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.compliance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.compliance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.currency" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.currency", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "bing.autosuggest" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/bing.autosuggest", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.itcm.organizationaldata" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.itcm.organizationaldata", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "gotowebinar" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/gotowebinar", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.payroll" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.payroll", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.listing" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.listing", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.zipinfo" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.zipinfo", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ocpi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ocpi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.disputeresponder" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.disputeresponder", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "yodlee" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/yodlee", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.globalpageload" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.globalpageload", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.finance" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.finance", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "geonames" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/geonames", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "avaza" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/avaza", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "gotomeeting" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/gotomeeting", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.anomalydetector" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.anomalydetector", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "selz" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/selz", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "text2data" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/text2data", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudnaturallanguage" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudnaturallanguage", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "icons8" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/icons8", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "chaingateway" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/chaingateway", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.articlesearch" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.articlesearch", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.expense" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.expense", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.files" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.files", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "dev.to" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/dev.to", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.iotcentral" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.iotcentral", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "cloudmersive.virusscan" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/cloudmersive.virusscan", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "vonage.voice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/vonage.voice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "quickbase" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/quickbase", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.customer" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.customer", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.topstories" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.topstories", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.cloudbuild" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.cloudbuild", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.analytics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.analytics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "instagram.bussiness" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/instagram.bussiness", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.agreements" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.agreements", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "nytimes.moviereviews" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/nytimes.moviereviews", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "siemens.platformcore.identitymanagement" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/siemens.platformcore.identitymanagement", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "karbon" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/karbon", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "iris.merchants" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/iris.merchants", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shipwire.warehouse" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shipwire.warehouse", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "zendesk.voice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/zendesk.voice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "mailscript" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/mailscript", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sinch.voice" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sinch.voice", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "apple.appstore" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/apple.appstore", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "whohoststhis" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/whohoststhis", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.import" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.import", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.crm.ticket" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.crm.ticket", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "formstack" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/formstack", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "commercetools.pricingdiscount" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 4, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/commercetools.pricingdiscount", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "godaddy.countries" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/godaddy.countries", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "namsor" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/namsor", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "squareup" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/squareup", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.statedata" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.statedata", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.logistics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.logistics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "browshot" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/browshot", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ebay.metadata" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ebay.metadata", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.globaltime" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.globaltime", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "ipgeolocation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/ipgeolocation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "powertoolsdeveloper.math" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/powertoolsdeveloper.math", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.analysisservices" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.analysisservices", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "symantotextanalytics" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/symantotextanalytics", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "hubspot.files" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 2, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/hubspot.files", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "shipwire.receivings" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/shipwire.receivings", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "magento.cart" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/magento.cart", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "sap.fieldglass.approval" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/sap.fieldglass.approval", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "saps4hana.externaltaxcalculation.taxquote" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 3, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/saps4hana.externaltaxcalculation.taxquote", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "azure.openai.finetunes" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 0, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/azure.openai.finetunes", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "workday.compensation" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/workday.compensation", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "apideck.accounting" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/apideck.accounting", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "xero.projects" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/xero.projects", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "googleapis.tasks" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/googleapis.tasks", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "plaid" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 1, + "minor": 5, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/plaid", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "interzoid.currencyexchange" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/interzoid.currencyexchange", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "boxapi" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 1 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/boxapi", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + }, + { + "packageOrg": { + "packageOrgStr": "ballerinax" + }, + "packageName": { + "packageNameStr": "Apache" + }, + "packageVersion": { + "version": { + "version": { + "normal": { + "major": 0, + "minor": 1, + "patch": 0 + }, + "preRelease": {}, + "build": {} + } + } + }, + "moduleIdentifier": "ballerinax/Apache", + "isModuleFromCurrentPackage": false, + "listenerMetaData": [] + } +] \ No newline at end of file From 3d2704e555f45017c6e5da2102f195858397b15a Mon Sep 17 00:00:00 2001 From: mindula Date: Sat, 24 Aug 2024 12:51:58 +0530 Subject: [PATCH 02/42] Export ballerina packages in module info --- .../modules/langserver-core/src/main/java/module-info.java | 1 + .../extensions/ballerina/packages/BallerinaPackageService.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/language-server/modules/langserver-core/src/main/java/module-info.java b/language-server/modules/langserver-core/src/main/java/module-info.java index deac82e07835..bf2f6c7f19fb 100644 --- a/language-server/modules/langserver-core/src/main/java/module-info.java +++ b/language-server/modules/langserver-core/src/main/java/module-info.java @@ -18,6 +18,7 @@ exports org.ballerinalang.langserver.codeaction.providers; exports org.ballerinalang.langserver.exception; exports org.ballerinalang.langserver.extensions; + exports org.ballerinalang.langserver.extensions.ballerina.packages; exports org.ballerinalang.langserver.config; exports org.ballerinalang.langserver.telemetry; exports org.ballerinalang.langserver.util to io.ballerina.language.server.simulator; diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/BallerinaPackageService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/BallerinaPackageService.java index 633d4b8e99a7..ecb7b04546da 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/BallerinaPackageService.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/BallerinaPackageService.java @@ -156,7 +156,7 @@ public Class getRemoteInterface() { * @param project {@link Project} * @return {@link JsonObject} with package components */ - private JsonObject getPackageComponents(Project project) { + public JsonObject getPackageComponents(Project project) { Package currentPackage = project.currentPackage(); PackageObject packageObject = new PackageObject(currentPackage.packageName().value(), project.sourceRoot().toUri().toString()); From ec6b230ae481c3b7c7d9261f10cdf929284a0995 Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Sun, 8 Sep 2024 10:49:08 +0530 Subject: [PATCH 03/42] Initial working commit for CommentNode --- .../compiler/parser/BLangNodeBuilder.java | 247 +----------------- .../compiler/syntax/tree/CommentNode.java | 128 +++++++++ .../syntax/tree/FunctionBodyBlockNode.java | 4 + .../syntax/tree/NodeAndCommentList.java | 189 ++++++++++++++ .../compiler/syntax/tree/NodeTransformer.java | 4 + .../compiler/syntax/tree/NodeVisitor.java | 3 + 6 files changed, 335 insertions(+), 240 deletions(-) create mode 100644 compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java create mode 100644 compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java index 58d576a52fb0..6ebaddfad392 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java @@ -17,246 +17,7 @@ */ package org.wso2.ballerinalang.compiler.parser; -import io.ballerina.compiler.syntax.tree.AlternateReceiveNode; -import io.ballerina.compiler.syntax.tree.AnnotAccessExpressionNode; -import io.ballerina.compiler.syntax.tree.AnnotationAttachPointNode; -import io.ballerina.compiler.syntax.tree.AnnotationDeclarationNode; -import io.ballerina.compiler.syntax.tree.AnnotationNode; -import io.ballerina.compiler.syntax.tree.ArrayDimensionNode; -import io.ballerina.compiler.syntax.tree.ArrayTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.AssignmentStatementNode; -import io.ballerina.compiler.syntax.tree.AsyncSendActionNode; -import io.ballerina.compiler.syntax.tree.BallerinaNameReferenceNode; -import io.ballerina.compiler.syntax.tree.BasicLiteralNode; -import io.ballerina.compiler.syntax.tree.BinaryExpressionNode; -import io.ballerina.compiler.syntax.tree.BindingPatternNode; -import io.ballerina.compiler.syntax.tree.BlockStatementNode; -import io.ballerina.compiler.syntax.tree.BracedExpressionNode; -import io.ballerina.compiler.syntax.tree.BreakStatementNode; -import io.ballerina.compiler.syntax.tree.BuiltinSimpleNameReferenceNode; -import io.ballerina.compiler.syntax.tree.ByteArrayLiteralNode; -import io.ballerina.compiler.syntax.tree.CaptureBindingPatternNode; -import io.ballerina.compiler.syntax.tree.CheckExpressionNode; -import io.ballerina.compiler.syntax.tree.ChildNodeList; -import io.ballerina.compiler.syntax.tree.ClassDefinitionNode; -import io.ballerina.compiler.syntax.tree.ClientResourceAccessActionNode; -import io.ballerina.compiler.syntax.tree.CollectClauseNode; -import io.ballerina.compiler.syntax.tree.CommitActionNode; -import io.ballerina.compiler.syntax.tree.CompoundAssignmentStatementNode; -import io.ballerina.compiler.syntax.tree.ComputedNameFieldNode; -import io.ballerina.compiler.syntax.tree.ComputedResourceAccessSegmentNode; -import io.ballerina.compiler.syntax.tree.ConditionalExpressionNode; -import io.ballerina.compiler.syntax.tree.ConstantDeclarationNode; -import io.ballerina.compiler.syntax.tree.ContinueStatementNode; -import io.ballerina.compiler.syntax.tree.DefaultableParameterNode; -import io.ballerina.compiler.syntax.tree.DistinctTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.DoStatementNode; -import io.ballerina.compiler.syntax.tree.ElseBlockNode; -import io.ballerina.compiler.syntax.tree.EnumDeclarationNode; -import io.ballerina.compiler.syntax.tree.EnumMemberNode; -import io.ballerina.compiler.syntax.tree.ErrorBindingPatternNode; -import io.ballerina.compiler.syntax.tree.ErrorConstructorExpressionNode; -import io.ballerina.compiler.syntax.tree.ErrorMatchPatternNode; -import io.ballerina.compiler.syntax.tree.ExplicitAnonymousFunctionExpressionNode; -import io.ballerina.compiler.syntax.tree.ExplicitNewExpressionNode; -import io.ballerina.compiler.syntax.tree.ExpressionFunctionBodyNode; -import io.ballerina.compiler.syntax.tree.ExpressionStatementNode; -import io.ballerina.compiler.syntax.tree.ExternalFunctionBodyNode; -import io.ballerina.compiler.syntax.tree.FailStatementNode; -import io.ballerina.compiler.syntax.tree.FieldAccessExpressionNode; -import io.ballerina.compiler.syntax.tree.FieldBindingPatternFullNode; -import io.ballerina.compiler.syntax.tree.FieldBindingPatternVarnameNode; -import io.ballerina.compiler.syntax.tree.FieldMatchPatternNode; -import io.ballerina.compiler.syntax.tree.FlushActionNode; -import io.ballerina.compiler.syntax.tree.ForEachStatementNode; -import io.ballerina.compiler.syntax.tree.ForkStatementNode; -import io.ballerina.compiler.syntax.tree.FromClauseNode; -import io.ballerina.compiler.syntax.tree.FunctionArgumentNode; -import io.ballerina.compiler.syntax.tree.FunctionBodyBlockNode; -import io.ballerina.compiler.syntax.tree.FunctionBodyNode; -import io.ballerina.compiler.syntax.tree.FunctionCallExpressionNode; -import io.ballerina.compiler.syntax.tree.FunctionDefinitionNode; -import io.ballerina.compiler.syntax.tree.FunctionSignatureNode; -import io.ballerina.compiler.syntax.tree.FunctionTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.GroupByClauseNode; -import io.ballerina.compiler.syntax.tree.GroupingKeyVarDeclarationNode; -import io.ballerina.compiler.syntax.tree.IdentifierToken; -import io.ballerina.compiler.syntax.tree.IfElseStatementNode; -import io.ballerina.compiler.syntax.tree.ImplicitAnonymousFunctionExpressionNode; -import io.ballerina.compiler.syntax.tree.ImplicitAnonymousFunctionParameters; -import io.ballerina.compiler.syntax.tree.ImplicitNewExpressionNode; -import io.ballerina.compiler.syntax.tree.ImportDeclarationNode; -import io.ballerina.compiler.syntax.tree.ImportOrgNameNode; -import io.ballerina.compiler.syntax.tree.ImportPrefixNode; -import io.ballerina.compiler.syntax.tree.IncludedRecordParameterNode; -import io.ballerina.compiler.syntax.tree.IndexedExpressionNode; -import io.ballerina.compiler.syntax.tree.InferredTypedescDefaultNode; -import io.ballerina.compiler.syntax.tree.InlineCodeReferenceNode; -import io.ballerina.compiler.syntax.tree.InterpolationNode; -import io.ballerina.compiler.syntax.tree.IntersectionTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.JoinClauseNode; -import io.ballerina.compiler.syntax.tree.KeySpecifierNode; -import io.ballerina.compiler.syntax.tree.KeyTypeConstraintNode; -import io.ballerina.compiler.syntax.tree.LetClauseNode; -import io.ballerina.compiler.syntax.tree.LetExpressionNode; -import io.ballerina.compiler.syntax.tree.LetVariableDeclarationNode; -import io.ballerina.compiler.syntax.tree.LimitClauseNode; -import io.ballerina.compiler.syntax.tree.ListBindingPatternNode; -import io.ballerina.compiler.syntax.tree.ListConstructorExpressionNode; -import io.ballerina.compiler.syntax.tree.ListMatchPatternNode; -import io.ballerina.compiler.syntax.tree.ListenerDeclarationNode; -import io.ballerina.compiler.syntax.tree.LockStatementNode; -import io.ballerina.compiler.syntax.tree.MapTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.MappingBindingPatternNode; -import io.ballerina.compiler.syntax.tree.MappingConstructorExpressionNode; -import io.ballerina.compiler.syntax.tree.MappingFieldNode; -import io.ballerina.compiler.syntax.tree.MappingMatchPatternNode; -import io.ballerina.compiler.syntax.tree.MarkdownCodeBlockNode; -import io.ballerina.compiler.syntax.tree.MarkdownDocumentationLineNode; -import io.ballerina.compiler.syntax.tree.MarkdownDocumentationNode; -import io.ballerina.compiler.syntax.tree.MarkdownParameterDocumentationLineNode; -import io.ballerina.compiler.syntax.tree.MatchClauseNode; -import io.ballerina.compiler.syntax.tree.MatchStatementNode; -import io.ballerina.compiler.syntax.tree.MemberTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.MetadataNode; -import io.ballerina.compiler.syntax.tree.MethodCallExpressionNode; -import io.ballerina.compiler.syntax.tree.MethodDeclarationNode; -import io.ballerina.compiler.syntax.tree.ModuleMemberDeclarationNode; -import io.ballerina.compiler.syntax.tree.ModulePartNode; -import io.ballerina.compiler.syntax.tree.ModuleVariableDeclarationNode; -import io.ballerina.compiler.syntax.tree.ModuleXMLNamespaceDeclarationNode; -import io.ballerina.compiler.syntax.tree.NameReferenceNode; -import io.ballerina.compiler.syntax.tree.NamedArgBindingPatternNode; -import io.ballerina.compiler.syntax.tree.NamedArgMatchPatternNode; -import io.ballerina.compiler.syntax.tree.NamedArgumentNode; -import io.ballerina.compiler.syntax.tree.NamedWorkerDeclarationNode; -import io.ballerina.compiler.syntax.tree.NamedWorkerDeclarator; -import io.ballerina.compiler.syntax.tree.NewExpressionNode; -import io.ballerina.compiler.syntax.tree.Node; -import io.ballerina.compiler.syntax.tree.NodeFactory; -import io.ballerina.compiler.syntax.tree.NodeList; -import io.ballerina.compiler.syntax.tree.NodeTransformer; -import io.ballerina.compiler.syntax.tree.NonTerminalNode; -import io.ballerina.compiler.syntax.tree.ObjectConstructorExpressionNode; -import io.ballerina.compiler.syntax.tree.ObjectFieldNode; -import io.ballerina.compiler.syntax.tree.ObjectTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.OnClauseNode; -import io.ballerina.compiler.syntax.tree.OnConflictClauseNode; -import io.ballerina.compiler.syntax.tree.OnFailClauseNode; -import io.ballerina.compiler.syntax.tree.OptionalFieldAccessExpressionNode; -import io.ballerina.compiler.syntax.tree.OptionalTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.OrderByClauseNode; -import io.ballerina.compiler.syntax.tree.OrderKeyNode; -import io.ballerina.compiler.syntax.tree.PanicStatementNode; -import io.ballerina.compiler.syntax.tree.ParameterNode; -import io.ballerina.compiler.syntax.tree.ParameterizedTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.ParenthesisedTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.ParenthesizedArgList; -import io.ballerina.compiler.syntax.tree.PositionalArgumentNode; -import io.ballerina.compiler.syntax.tree.QualifiedNameReferenceNode; -import io.ballerina.compiler.syntax.tree.QueryActionNode; -import io.ballerina.compiler.syntax.tree.QueryConstructTypeNode; -import io.ballerina.compiler.syntax.tree.QueryExpressionNode; -import io.ballerina.compiler.syntax.tree.ReAssertionNode; -import io.ballerina.compiler.syntax.tree.ReAtomCharOrEscapeNode; -import io.ballerina.compiler.syntax.tree.ReAtomQuantifierNode; -import io.ballerina.compiler.syntax.tree.ReBracedQuantifierNode; -import io.ballerina.compiler.syntax.tree.ReCapturingGroupsNode; -import io.ballerina.compiler.syntax.tree.ReCharSetAtomNoDashWithReCharSetNoDashNode; -import io.ballerina.compiler.syntax.tree.ReCharSetAtomWithReCharSetNoDashNode; -import io.ballerina.compiler.syntax.tree.ReCharSetRangeNoDashNode; -import io.ballerina.compiler.syntax.tree.ReCharSetRangeNoDashWithReCharSetNode; -import io.ballerina.compiler.syntax.tree.ReCharSetRangeNode; -import io.ballerina.compiler.syntax.tree.ReCharSetRangeWithReCharSetNode; -import io.ballerina.compiler.syntax.tree.ReCharacterClassNode; -import io.ballerina.compiler.syntax.tree.ReFlagExpressionNode; -import io.ballerina.compiler.syntax.tree.ReFlagsNode; -import io.ballerina.compiler.syntax.tree.ReFlagsOnOffNode; -import io.ballerina.compiler.syntax.tree.ReQuantifierNode; -import io.ballerina.compiler.syntax.tree.ReQuoteEscapeNode; -import io.ballerina.compiler.syntax.tree.ReSequenceNode; -import io.ballerina.compiler.syntax.tree.ReSimpleCharClassEscapeNode; -import io.ballerina.compiler.syntax.tree.ReUnicodeGeneralCategoryNode; -import io.ballerina.compiler.syntax.tree.ReUnicodePropertyEscapeNode; -import io.ballerina.compiler.syntax.tree.ReUnicodeScriptNode; -import io.ballerina.compiler.syntax.tree.ReceiveActionNode; -import io.ballerina.compiler.syntax.tree.ReceiveFieldNode; -import io.ballerina.compiler.syntax.tree.ReceiveFieldsNode; -import io.ballerina.compiler.syntax.tree.RecordFieldNode; -import io.ballerina.compiler.syntax.tree.RecordFieldWithDefaultValueNode; -import io.ballerina.compiler.syntax.tree.RecordRestDescriptorNode; -import io.ballerina.compiler.syntax.tree.RecordTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.RemoteMethodCallActionNode; -import io.ballerina.compiler.syntax.tree.RequiredParameterNode; -import io.ballerina.compiler.syntax.tree.ResourceAccessRestSegmentNode; -import io.ballerina.compiler.syntax.tree.ResourcePathParameterNode; -import io.ballerina.compiler.syntax.tree.RestArgumentNode; -import io.ballerina.compiler.syntax.tree.RestBindingPatternNode; -import io.ballerina.compiler.syntax.tree.RestDescriptorNode; -import io.ballerina.compiler.syntax.tree.RestMatchPatternNode; -import io.ballerina.compiler.syntax.tree.RestParameterNode; -import io.ballerina.compiler.syntax.tree.RetryStatementNode; -import io.ballerina.compiler.syntax.tree.ReturnStatementNode; -import io.ballerina.compiler.syntax.tree.ReturnTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.RollbackStatementNode; -import io.ballerina.compiler.syntax.tree.SelectClauseNode; -import io.ballerina.compiler.syntax.tree.SeparatedNodeList; -import io.ballerina.compiler.syntax.tree.ServiceDeclarationNode; -import io.ballerina.compiler.syntax.tree.SimpleNameReferenceNode; -import io.ballerina.compiler.syntax.tree.SingletonTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.SpecificFieldNode; -import io.ballerina.compiler.syntax.tree.SpreadFieldNode; -import io.ballerina.compiler.syntax.tree.SpreadMemberNode; -import io.ballerina.compiler.syntax.tree.StartActionNode; -import io.ballerina.compiler.syntax.tree.StatementNode; -import io.ballerina.compiler.syntax.tree.StreamTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.StreamTypeParamsNode; -import io.ballerina.compiler.syntax.tree.SyncSendActionNode; -import io.ballerina.compiler.syntax.tree.SyntaxKind; -import io.ballerina.compiler.syntax.tree.TableConstructorExpressionNode; -import io.ballerina.compiler.syntax.tree.TableTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.TemplateExpressionNode; -import io.ballerina.compiler.syntax.tree.Token; -import io.ballerina.compiler.syntax.tree.TransactionStatementNode; -import io.ballerina.compiler.syntax.tree.TransactionalExpressionNode; -import io.ballerina.compiler.syntax.tree.TrapExpressionNode; -import io.ballerina.compiler.syntax.tree.TupleTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.TypeCastExpressionNode; -import io.ballerina.compiler.syntax.tree.TypeCastParamNode; -import io.ballerina.compiler.syntax.tree.TypeDefinitionNode; -import io.ballerina.compiler.syntax.tree.TypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.TypeParameterNode; -import io.ballerina.compiler.syntax.tree.TypeReferenceNode; -import io.ballerina.compiler.syntax.tree.TypeTestExpressionNode; -import io.ballerina.compiler.syntax.tree.TypedBindingPatternNode; -import io.ballerina.compiler.syntax.tree.TypeofExpressionNode; -import io.ballerina.compiler.syntax.tree.UnaryExpressionNode; -import io.ballerina.compiler.syntax.tree.UnionTypeDescriptorNode; -import io.ballerina.compiler.syntax.tree.VariableDeclarationNode; -import io.ballerina.compiler.syntax.tree.WaitActionNode; -import io.ballerina.compiler.syntax.tree.WaitFieldNode; -import io.ballerina.compiler.syntax.tree.WaitFieldsListNode; -import io.ballerina.compiler.syntax.tree.WhereClauseNode; -import io.ballerina.compiler.syntax.tree.WhileStatementNode; -import io.ballerina.compiler.syntax.tree.WildcardBindingPatternNode; -import io.ballerina.compiler.syntax.tree.XMLAtomicNamePatternNode; -import io.ballerina.compiler.syntax.tree.XMLAttributeNode; -import io.ballerina.compiler.syntax.tree.XMLAttributeValue; -import io.ballerina.compiler.syntax.tree.XMLCDATANode; -import io.ballerina.compiler.syntax.tree.XMLComment; -import io.ballerina.compiler.syntax.tree.XMLElementNode; -import io.ballerina.compiler.syntax.tree.XMLEmptyElementNode; -import io.ballerina.compiler.syntax.tree.XMLEndTagNode; -import io.ballerina.compiler.syntax.tree.XMLFilterExpressionNode; -import io.ballerina.compiler.syntax.tree.XMLNameNode; -import io.ballerina.compiler.syntax.tree.XMLNamePatternChainingNode; -import io.ballerina.compiler.syntax.tree.XMLNamespaceDeclarationNode; -import io.ballerina.compiler.syntax.tree.XMLProcessingInstruction; -import io.ballerina.compiler.syntax.tree.XMLQualifiedNameNode; -import io.ballerina.compiler.syntax.tree.XMLSimpleNameNode; -import io.ballerina.compiler.syntax.tree.XMLStartTagNode; -import io.ballerina.compiler.syntax.tree.XMLStepExpressionNode; -import io.ballerina.compiler.syntax.tree.XMLTextNode; +import io.ballerina.compiler.syntax.tree.*; import io.ballerina.identifier.Utils; import io.ballerina.runtime.internal.XmlFactory; import io.ballerina.tools.diagnostics.DiagnosticCode; @@ -1687,6 +1448,12 @@ public BLangNode transform(FunctionBodyBlockNode functionBodyBlockNode) { } } +// for (NonTerminalNode stmt : functionBodyBlockNode.statementsWithComments()) { +// NonTerminalNode s = stmt; +// if (stmt instanceof CommentNode) { +// +// } +// } generateAndAddBLangStatements(functionBodyBlockNode.statements(), stmtList, 0, functionBodyBlockNode); bLFuncBody.stmts = statements; diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java new file mode 100644 index 000000000000..df13c2369349 --- /dev/null +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package io.ballerina.compiler.syntax.tree; + +import io.ballerina.compiler.internal.parser.tree.STNode; +import io.ballerina.compiler.internal.parser.tree.STNodeDiagnostic; +import io.ballerina.compiler.internal.parser.tree.STToken; +import io.ballerina.tools.diagnostics.Diagnostic; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Represents a comment. This is not a part of the Ballerina syntax tree. + * + * @since 2201.10.0 + */ +public class CommentNode extends NonTerminalNode { + protected MinutiaeList leadingMinutiaeList; + protected MinutiaeList trailingMinutiaeList; + private final NonTerminalNode commentAttachedNode; + + public CommentNode(STNode commentAttachedSTNode, int position, NonTerminalNode commentAttachedNode) { + super(commentAttachedSTNode, position, commentAttachedNode); + this.commentAttachedNode = commentAttachedNode; + } + + public NonTerminalNode getParentNode() { + return this.commentAttachedNode; + } + + public String text() { + return ((STToken) this.internalNode).text(); + } + + public boolean containsLeadingMinutiae() { + return internalNode.leadingMinutiae().bucketCount() > 0; + } + + @Override + public MinutiaeList leadingMinutiae() { + if (leadingMinutiaeList != null) { + return leadingMinutiaeList; + } + // TODO: add proper node + leadingMinutiaeList = new MinutiaeList(null, internalNode.leadingMinutiae(), this.position()); + return leadingMinutiaeList; + } + + public boolean containsTrailingMinutiae() { + return internalNode.trailingMinutiae().bucketCount() > 0; + } + + @Override + public MinutiaeList trailingMinutiae() { + if (trailingMinutiaeList != null) { + return trailingMinutiaeList; + } + int trailingMinutiaeStartPos = this.position() + internalNode.widthWithLeadingMinutiae(); + trailingMinutiaeList = new MinutiaeList(null, internalNode.trailingMinutiae(), trailingMinutiaeStartPos); + return trailingMinutiaeList; + } + +// public CommentNode modify(MinutiaeList leadingMinutiae, MinutiaeList trailingMinutiae) { +// if (internalNode.leadingMinutiae() == leadingMinutiae.internalNode() && +// internalNode.trailingMinutiae() == trailingMinutiae.internalNode()) { +// return this; +// } else { +// return NodeFactory.createToken(this.kind(), leadingMinutiae, trailingMinutiae); +// } +// } + + @Override + public Iterable diagnostics() { + if (!internalNode.hasDiagnostics()) { + return Collections::emptyIterator; + } + + return () -> collectDiagnostics().iterator(); + } + + @Override + protected String[] childNames() { + return new String[0]; + } + + private List collectDiagnostics() { + List diagnosticList = new ArrayList<>(); + + // Collect diagnostics inside invalid token minutiae + leadingInvalidTokens().forEach(token -> token.diagnostics().forEach(diagnosticList::add)); + trailingInvalidTokens().forEach(token -> token.diagnostics().forEach(diagnosticList::add)); + + // Collect token diagnostics + for (STNodeDiagnostic stNodeDiagnostic : internalNode.diagnostics()) { + Diagnostic syntaxDiagnostic = createSyntaxDiagnostic(stNodeDiagnostic); + diagnosticList.add(syntaxDiagnostic); + } + + return diagnosticList; + } + + @Override + public void accept(NodeVisitor visitor) { + visitor.visit(this); + } + + @Override + public T apply(NodeTransformer visitor) { + return visitor.transform(this); + } +} diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java index fd9f281c50ee..7413ab212c7e 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java @@ -45,6 +45,10 @@ public NodeList statements() { return new NodeList<>(childInBucket(2)); } + public NodeAndCommentList statementsWithComments() { + return new NodeAndCommentList<>(childInBucket(2), childInBucket(3)); + } + public Token closeBraceToken() { return childInBucket(3); } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java new file mode 100644 index 000000000000..a33e802490f5 --- /dev/null +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package io.ballerina.compiler.syntax.tree; + +import io.ballerina.compiler.internal.parser.tree.STNode; +import io.ballerina.compiler.internal.parser.tree.STNodeList; +import io.ballerina.compiler.internal.syntax.NodeListUtils; + +import java.util.*; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; + +import static io.ballerina.compiler.internal.syntax.NodeListUtils.rangeCheck; +import static io.ballerina.compiler.internal.syntax.NodeListUtils.rangeCheckForAdd; + +/** + * Represents a list of {@code Node}s. + * + * @param the type of the constituent node instance + * + * @since 2201.10.0 + */ +public class NodeAndCommentList implements Iterable { + protected final STNodeList internalListNode; + protected final NonTerminalNode nonTerminalNode; + protected final Token semicolon; + protected final int size; + + NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon) { + this(nonTerminalNode, semicolon, nonTerminalNode.bucketCount() + 1); + } + + protected NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon, int size) { + if (!NodeListUtils.isSTNodeList(nonTerminalNode.internalNode())) { + throw new IllegalArgumentException("An STNodeList instance is expected"); + } + + this.internalListNode = (STNodeList) nonTerminalNode.internalNode(); + this.nonTerminalNode = nonTerminalNode; + this.semicolon = semicolon; + this.size = size; + } + + // Positional access methods + + public T get(int index) { + rangeCheck(index, size); + return this.nonTerminalNode.childInBucket(index); + } + + // Modification methods + + public NodeAndCommentList add(T node) { + Objects.requireNonNull(node, "node should not be null"); + return new NodeAndCommentList<>(internalListNode.add(node.internalNode()).createUnlinkedFacade(), null); + } + + public NodeAndCommentList add(int index, T node) { + Objects.requireNonNull(node, "node should not be null"); + rangeCheckForAdd(index, size); + return new NodeAndCommentList<>(internalListNode.add(index, node.internalNode()).createUnlinkedFacade(), null); + } + + public NodeAndCommentList addAll(Collection c) { + if (c.isEmpty()) { + return this; + } + + List stNodesToBeAdded = c.stream() + .map(node -> Objects.requireNonNull(node, "node should not be null")) + .map(Node::internalNode) + .collect(Collectors.toList()); + return new NodeAndCommentList<>(internalListNode.addAll(stNodesToBeAdded).createUnlinkedFacade(), null); + } + + public NodeAndCommentList set(int index, T node) { + Objects.requireNonNull(node, "node should not be null"); + rangeCheck(index, size); + if (nonTerminalNode.checkForReferenceEquality(index, node)) { + return this; + } + + return new NodeAndCommentList<>(internalListNode.set(index, node.internalNode()).createUnlinkedFacade(), null); + } + + public NodeAndCommentList remove(int index) { + rangeCheck(index, size); + return new NodeAndCommentList<>(internalListNode.remove(index).createUnlinkedFacade(), null); + } + + public NodeAndCommentList remove(T node) { + Objects.requireNonNull(node, "node should not be null"); + for (int bucket = 0; bucket < nonTerminalNode.bucketCount(); bucket++) { + if (nonTerminalNode.checkForReferenceEquality(bucket, node)) { + return remove(bucket); + } + } + return this; + } + + @SuppressWarnings("SuspiciousMethodCalls") + public NodeAndCommentList removeAll(Collection c) { + if (c.isEmpty()) { + return this; + } + c.forEach(node -> Objects.requireNonNull(node, "node should not be null")); + + List toBeDeletedList = new ArrayList<>(); + for (int bucket = 0; bucket < nonTerminalNode.bucketCount(); bucket++) { + Node childNode = nonTerminalNode.childBuckets[bucket]; + if (c.contains(childNode)) { + toBeDeletedList.add(childNode.internalNode()); + } + } + + return new NodeAndCommentList<>(internalListNode.removeAll(toBeDeletedList).createUnlinkedFacade(), null); + } + + //query methods + + public int size() { + return this.size; + } + + public boolean isEmpty() { + return this.size == 0; + } + + @Override + public Iterator iterator() { + return new NodeAndCommentListIterator(); + } + + public Stream stream() { + return StreamSupport.stream(spliterator(), false); + } + + NonTerminalNode underlyingListNode() { + return this.nonTerminalNode; + } + + /** + * An iterator for this list of nodes. + * + * @since 2201.10.0 + */ + protected class NodeAndCommentListIterator implements Iterator { + private int currentIndex = 0; + private T currentNode = null; + + @Override + public boolean hasNext() { + return this.currentIndex < size; + } + + @Override + public T next() { + if (currentNode != null) { + currentIndex++; + T temp = currentNode; + currentNode = null; + return temp; + } + if (currentIndex == size - 1) { + currentIndex++; + return (T) new CommentNode(semicolon.internalNode(), 0, null); + } + currentNode = get(currentIndex); + return (T) new CommentNode(currentNode.internalNode(), 0, currentNode); + } + } + +} diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeTransformer.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeTransformer.java index 6a07516d87e8..293814ff66a9 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeTransformer.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeTransformer.java @@ -956,6 +956,10 @@ public T transform(ReceiveFieldNode receiveFieldNode) { return transformSyntaxNode(receiveFieldNode); } + public T transform(CommentNode commentNode) { + return transformSyntaxNode(commentNode); + } + // Tokens public T transform(Token token) { diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeVisitor.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeVisitor.java index 1fe6ddfa596e..6cbd1b01a35e 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeVisitor.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeVisitor.java @@ -954,6 +954,9 @@ public void visit(MemberTypeDescriptorNode memberTypeDescriptorNode) { public void visit(ReceiveFieldNode receiveFieldNode) { visitSyntaxNode(receiveFieldNode); } + public void visit(CommentNode commentNode) { + visitSyntaxNode(commentNode); + } // Tokens From e161ddbabd2ef4ac3d6934458d20edffe59e0147 Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Tue, 10 Sep 2024 11:14:02 +0530 Subject: [PATCH 04/42] Add simplified changes for comment node --- .../compiler/parser/BLangNodeBuilder.java | 19 ++- .../syntax/tree/BlockStatementNode.java | 4 + .../compiler/syntax/tree/CommentNode.java | 27 +++- .../syntax/tree/FunctionBodyBlockNode.java | 2 +- .../syntax/tree/NodeAndCommentList.java | 142 ++++++++++++++---- 5 files changed, 154 insertions(+), 40 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java index 6ebaddfad392..6e427b82ed59 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java @@ -1448,12 +1448,12 @@ public BLangNode transform(FunctionBodyBlockNode functionBodyBlockNode) { } } -// for (NonTerminalNode stmt : functionBodyBlockNode.statementsWithComments()) { -// NonTerminalNode s = stmt; -// if (stmt instanceof CommentNode) { -// -// } -// } + for (Node stmt : functionBodyBlockNode.statementsWithComments()) { + Node s = stmt; + if (stmt instanceof CommentNode commentNode) { + Node commentAttachedNode = commentNode.getCommentAttachedNode(); + } + } generateAndAddBLangStatements(functionBodyBlockNode.statements(), stmtList, 0, functionBodyBlockNode); bLFuncBody.stmts = statements; @@ -2759,6 +2759,13 @@ public BLangNode transform(IfElseStatementNode ifElseStmtNode) { public BLangNode transform(BlockStatementNode blockStatement) { BLangBlockStmt bLBlockStmt = (BLangBlockStmt) TreeBuilder.createBlockNode(); this.isInLocalContext = true; + for (Node stmt : blockStatement.statementsWithComments()) { + Node s = stmt; + if (stmt instanceof CommentNode commentNode) { + Node commentAttachedNode = commentNode.getCommentAttachedNode(); + } + } + bLBlockStmt.stmts = generateBLangStatements(blockStatement.statements(), blockStatement); this.isInLocalContext = false; bLBlockStmt.pos = getPosition(blockStatement); diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java index 16c5271dd1c4..97d6874bc688 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java @@ -40,6 +40,10 @@ public NodeList statements() { return new NodeList<>(childInBucket(1)); } + public NodeAndCommentList statementsWithComments() { + return new NodeAndCommentList<>(childInBucket(1), childInBucket(2)); + } + public Token closeBraceToken() { return childInBucket(2); } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java index df13c2369349..c3ca15a7f7c8 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java @@ -34,21 +34,42 @@ public class CommentNode extends NonTerminalNode { protected MinutiaeList leadingMinutiaeList; protected MinutiaeList trailingMinutiaeList; - private final NonTerminalNode commentAttachedNode; + private Node commentAttachedNode; + private Minutiae lastMinutiae; + private List commentLines; public CommentNode(STNode commentAttachedSTNode, int position, NonTerminalNode commentAttachedNode) { super(commentAttachedSTNode, position, commentAttachedNode); - this.commentAttachedNode = commentAttachedNode; } - public NonTerminalNode getParentNode() { + public Node getCommentAttachedNode() { return this.commentAttachedNode; } + public void setCommentAttachedNode(Node commentAttachedNode) { + this.commentAttachedNode = commentAttachedNode; + } + + public Minutiae getLastMinutiae() { + return this.lastMinutiae; + } + + public void setLastMinutiae(Minutiae lastMinutiae) { + this.lastMinutiae = lastMinutiae; + } + public String text() { return ((STToken) this.internalNode).text(); } + public List getCommentLines() { + return this.commentLines; + } + + public void setCommentLines(List commentLines) { + this.commentLines = commentLines; + } + public boolean containsLeadingMinutiae() { return internalNode.leadingMinutiae().bucketCount() > 0; } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java index 7413ab212c7e..24267139d340 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java @@ -45,7 +45,7 @@ public NodeList statements() { return new NodeList<>(childInBucket(2)); } - public NodeAndCommentList statementsWithComments() { + public NodeAndCommentList statementsWithComments() { return new NodeAndCommentList<>(childInBucket(2), childInBucket(3)); } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java index a33e802490f5..5b164e23fe48 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java @@ -36,14 +36,15 @@ * * @since 2201.10.0 */ -public class NodeAndCommentList implements Iterable { +public class NodeAndCommentList implements Iterable { protected final STNodeList internalListNode; protected final NonTerminalNode nonTerminalNode; protected final Token semicolon; protected final int size; + protected final Node[] nodes; NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon) { - this(nonTerminalNode, semicolon, nonTerminalNode.bucketCount() + 1); + this(nonTerminalNode, semicolon, nonTerminalNode.bucketCount() * 2 + 1); } protected NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon, int size) { @@ -54,30 +55,81 @@ protected NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon, i this.internalListNode = (STNodeList) nonTerminalNode.internalNode(); this.nonTerminalNode = nonTerminalNode; this.semicolon = semicolon; - this.size = size; +// this.size = size; + this.nodes = new Node[size]; // TODO: Init with max size + int x = 0; + for (int i = 0; i < nonTerminalNode.bucketCount(); i++) { + List commentLines = new ArrayList<>(); + Minutiae lastMinutiae = null; + for (Minutiae minutiae : nonTerminalNode.childInBucket(i).leadingMinutiae()) { + String[] splits = minutiae.text().split("// "); + if (splits.length >= 2) { + commentLines.add(splits[1]); + lastMinutiae = minutiae; + } else if (splits.length == 1 && splits[0].contains("//")) { + commentLines.add(""); + lastMinutiae = minutiae; + } + } + if (!commentLines.isEmpty()) { + CommentNode commentNode = new CommentNode(nonTerminalNode.childInBucket(i).internalNode(), 0, null); + commentNode.setCommentAttachedNode(nonTerminalNode.childInBucket(i)); + commentNode.setLastMinutiae(lastMinutiae); + commentNode.setCommentLines(commentLines); + this.nodes[i] = commentNode; + x++; + } + this.nodes[x] = nonTerminalNode.childInBucket(i); + x++; + } + + List commentLines = new ArrayList<>(); + Minutiae lastMinutiae = null; + for (Minutiae minutiae : this.semicolon.leadingMinutiae()) { + String[] splits = minutiae.text().split("// "); + if (splits.length >= 2) { + commentLines.add(splits[1]); + lastMinutiae = minutiae; + } else if (splits.length == 1 && splits[0].contains("//")) { + commentLines.add(""); + lastMinutiae = minutiae; + } + } + if (!commentLines.isEmpty()) { + CommentNode commentNode = new CommentNode(semicolon.internalNode(), 0, null); + commentNode.setCommentAttachedNode(semicolon); + commentNode.setLastMinutiae(lastMinutiae); + commentNode.setCommentLines(commentLines); + this.nodes[x++] = commentNode; + } + this.size = x; } // Positional access methods - public T get(int index) { + public K get(int index) { // 3 + semi rangeCheck(index, size); - return this.nonTerminalNode.childInBucket(index); +// if (index == size - 1) { +// return (K) this.semicolon; +// } +// return this.nonTerminalNode.childInBucket(index / 2); + return (K) this.nodes[index]; } // Modification methods - public NodeAndCommentList add(T node) { + public NodeAndCommentList add(T node) { Objects.requireNonNull(node, "node should not be null"); return new NodeAndCommentList<>(internalListNode.add(node.internalNode()).createUnlinkedFacade(), null); } - public NodeAndCommentList add(int index, T node) { + public NodeAndCommentList add(int index, T node) { Objects.requireNonNull(node, "node should not be null"); rangeCheckForAdd(index, size); return new NodeAndCommentList<>(internalListNode.add(index, node.internalNode()).createUnlinkedFacade(), null); } - public NodeAndCommentList addAll(Collection c) { + public NodeAndCommentList addAll(Collection c) { if (c.isEmpty()) { return this; } @@ -89,7 +141,7 @@ public NodeAndCommentList addAll(Collection c) { return new NodeAndCommentList<>(internalListNode.addAll(stNodesToBeAdded).createUnlinkedFacade(), null); } - public NodeAndCommentList set(int index, T node) { + public NodeAndCommentList set(int index, T node) { Objects.requireNonNull(node, "node should not be null"); rangeCheck(index, size); if (nonTerminalNode.checkForReferenceEquality(index, node)) { @@ -99,12 +151,12 @@ public NodeAndCommentList set(int index, T node) { return new NodeAndCommentList<>(internalListNode.set(index, node.internalNode()).createUnlinkedFacade(), null); } - public NodeAndCommentList remove(int index) { + public NodeAndCommentList remove(int index) { rangeCheck(index, size); return new NodeAndCommentList<>(internalListNode.remove(index).createUnlinkedFacade(), null); } - public NodeAndCommentList remove(T node) { + public NodeAndCommentList remove(T node) { Objects.requireNonNull(node, "node should not be null"); for (int bucket = 0; bucket < nonTerminalNode.bucketCount(); bucket++) { if (nonTerminalNode.checkForReferenceEquality(bucket, node)) { @@ -115,7 +167,7 @@ public NodeAndCommentList remove(T node) { } @SuppressWarnings("SuspiciousMethodCalls") - public NodeAndCommentList removeAll(Collection c) { + public NodeAndCommentList removeAll(Collection c) { if (c.isEmpty()) { return this; } @@ -143,11 +195,11 @@ public boolean isEmpty() { } @Override - public Iterator iterator() { + public Iterator iterator() { return new NodeAndCommentListIterator(); } - public Stream stream() { + public Stream stream() { return StreamSupport.stream(spliterator(), false); } @@ -160,9 +212,9 @@ NonTerminalNode underlyingListNode() { * * @since 2201.10.0 */ - protected class NodeAndCommentListIterator implements Iterator { + protected class NodeAndCommentListIterator implements Iterator { private int currentIndex = 0; - private T currentNode = null; + private K currentNode = null; @Override public boolean hasNext() { @@ -170,20 +222,50 @@ public boolean hasNext() { } @Override - public T next() { - if (currentNode != null) { - currentIndex++; - T temp = currentNode; - currentNode = null; - return temp; - } - if (currentIndex == size - 1) { - currentIndex++; - return (T) new CommentNode(semicolon.internalNode(), 0, null); - } - currentNode = get(currentIndex); - return (T) new CommentNode(currentNode.internalNode(), 0, currentNode); + public K next() { +// if (currentNode != null) { +// currentIndex++; +// K temp = currentNode; +// currentNode = null; +// return temp; +// } +// currentNode = get(currentIndex); +// CommentNode commentNode = new CommentNode(currentNode.internalNode(), 0, null); +// commentNode.setCommentAttachedNode(currentNode); +// return (K) commentNode; +// } +// +// public K next2() { + //// +// K node; +// if (currentIndex % 2 == 0) { // gen comment +// currentNode = get(currentIndex); +// List commentLines = new ArrayList<>(); +// Minutiae lastMinutiae = null; +// for (Minutiae minutiae : currentNode.leadingMinutiae()) { +// String[] splits = minutiae.text().split("// "); +// if (splits.length >= 2) { +// commentLines.add(splits[1]); +// lastMinutiae = minutiae; +// } else if (splits.length == 1 && splits[0].contains("//")) { +// commentLines.add(""); +// lastMinutiae = minutiae; +// } +// } +// if (!commentLines.isEmpty()) { +//// return Optional.empty(); // set comment +// } +// CommentNode commentNode = new CommentNode(currentNode.internalNode(), 0, null); +// commentNode.setCommentAttachedNode(currentNode); +// node = (K) commentNode; +// } else { +// node = currentNode; +// } +// currentIndex++; +// return node; + /// + + return get(currentIndex++); } } - } From 4df0e3a281ed3bbb0b1394475366d74daaa7c8d1 Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Tue, 10 Sep 2024 15:10:34 +0530 Subject: [PATCH 05/42] Clean the code --- .../compiler/syntax/tree/CommentNode.java | 68 ----------- .../syntax/tree/NodeAndCommentList.java | 111 ++++-------------- 2 files changed, 26 insertions(+), 153 deletions(-) diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java index c3ca15a7f7c8..4ca58126567e 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java @@ -32,8 +32,6 @@ * @since 2201.10.0 */ public class CommentNode extends NonTerminalNode { - protected MinutiaeList leadingMinutiaeList; - protected MinutiaeList trailingMinutiaeList; private Node commentAttachedNode; private Minutiae lastMinutiae; private List commentLines; @@ -58,10 +56,6 @@ public void setLastMinutiae(Minutiae lastMinutiae) { this.lastMinutiae = lastMinutiae; } - public String text() { - return ((STToken) this.internalNode).text(); - } - public List getCommentLines() { return this.commentLines; } @@ -70,73 +64,11 @@ public void setCommentLines(List commentLines) { this.commentLines = commentLines; } - public boolean containsLeadingMinutiae() { - return internalNode.leadingMinutiae().bucketCount() > 0; - } - - @Override - public MinutiaeList leadingMinutiae() { - if (leadingMinutiaeList != null) { - return leadingMinutiaeList; - } - // TODO: add proper node - leadingMinutiaeList = new MinutiaeList(null, internalNode.leadingMinutiae(), this.position()); - return leadingMinutiaeList; - } - - public boolean containsTrailingMinutiae() { - return internalNode.trailingMinutiae().bucketCount() > 0; - } - - @Override - public MinutiaeList trailingMinutiae() { - if (trailingMinutiaeList != null) { - return trailingMinutiaeList; - } - int trailingMinutiaeStartPos = this.position() + internalNode.widthWithLeadingMinutiae(); - trailingMinutiaeList = new MinutiaeList(null, internalNode.trailingMinutiae(), trailingMinutiaeStartPos); - return trailingMinutiaeList; - } - -// public CommentNode modify(MinutiaeList leadingMinutiae, MinutiaeList trailingMinutiae) { -// if (internalNode.leadingMinutiae() == leadingMinutiae.internalNode() && -// internalNode.trailingMinutiae() == trailingMinutiae.internalNode()) { -// return this; -// } else { -// return NodeFactory.createToken(this.kind(), leadingMinutiae, trailingMinutiae); -// } -// } - - @Override - public Iterable diagnostics() { - if (!internalNode.hasDiagnostics()) { - return Collections::emptyIterator; - } - - return () -> collectDiagnostics().iterator(); - } - @Override protected String[] childNames() { return new String[0]; } - private List collectDiagnostics() { - List diagnosticList = new ArrayList<>(); - - // Collect diagnostics inside invalid token minutiae - leadingInvalidTokens().forEach(token -> token.diagnostics().forEach(diagnosticList::add)); - trailingInvalidTokens().forEach(token -> token.diagnostics().forEach(diagnosticList::add)); - - // Collect token diagnostics - for (STNodeDiagnostic stNodeDiagnostic : internalNode.diagnostics()) { - Diagnostic syntaxDiagnostic = createSyntaxDiagnostic(stNodeDiagnostic); - diagnosticList.add(syntaxDiagnostic); - } - - return diagnosticList; - } - @Override public void accept(NodeVisitor visitor) { visitor.visit(this); diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java index 5b164e23fe48..23b96141b55e 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java @@ -30,16 +30,14 @@ import static io.ballerina.compiler.internal.syntax.NodeListUtils.rangeCheckForAdd; /** - * Represents a list of {@code Node}s. + * Represent both nodes and attached comments to each node. * - * @param the type of the constituent node instance - * - * @since 2201.10.0 + * @param The type of NonTerminalNode + * @param The type of Node */ public class NodeAndCommentList implements Iterable { protected final STNodeList internalListNode; protected final NonTerminalNode nonTerminalNode; - protected final Token semicolon; protected final int size; protected final Node[] nodes; @@ -54,38 +52,28 @@ protected NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon, i this.internalListNode = (STNodeList) nonTerminalNode.internalNode(); this.nonTerminalNode = nonTerminalNode; - this.semicolon = semicolon; -// this.size = size; this.nodes = new Node[size]; // TODO: Init with max size - int x = 0; + int nodeIndex = 0; for (int i = 0; i < nonTerminalNode.bucketCount(); i++) { - List commentLines = new ArrayList<>(); - Minutiae lastMinutiae = null; - for (Minutiae minutiae : nonTerminalNode.childInBucket(i).leadingMinutiae()) { - String[] splits = minutiae.text().split("// "); - if (splits.length >= 2) { - commentLines.add(splits[1]); - lastMinutiae = minutiae; - } else if (splits.length == 1 && splits[0].contains("//")) { - commentLines.add(""); - lastMinutiae = minutiae; - } - } - if (!commentLines.isEmpty()) { - CommentNode commentNode = new CommentNode(nonTerminalNode.childInBucket(i).internalNode(), 0, null); - commentNode.setCommentAttachedNode(nonTerminalNode.childInBucket(i)); - commentNode.setLastMinutiae(lastMinutiae); - commentNode.setCommentLines(commentLines); - this.nodes[i] = commentNode; - x++; + Node node = nonTerminalNode.childInBucket(i); + CommentNode commentNode = getCommentNode(node); + if (commentNode != null) { + this.nodes[nodeIndex++] = commentNode; } - this.nodes[x] = nonTerminalNode.childInBucket(i); - x++; + this.nodes[nodeIndex++] = node; + } + + CommentNode commentNodeBeforeEnd = getCommentNode(semicolon); + if (commentNodeBeforeEnd != null) { + this.nodes[nodeIndex++] = commentNodeBeforeEnd; } + this.size = nodeIndex; + } + private CommentNode getCommentNode(Node node) { List commentLines = new ArrayList<>(); Minutiae lastMinutiae = null; - for (Minutiae minutiae : this.semicolon.leadingMinutiae()) { + for (Minutiae minutiae : node.leadingMinutiae()) { String[] splits = minutiae.text().split("// "); if (splits.length >= 2) { commentLines.add(splits[1]); @@ -95,24 +83,20 @@ protected NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon, i lastMinutiae = minutiae; } } - if (!commentLines.isEmpty()) { - CommentNode commentNode = new CommentNode(semicolon.internalNode(), 0, null); - commentNode.setCommentAttachedNode(semicolon); - commentNode.setLastMinutiae(lastMinutiae); - commentNode.setCommentLines(commentLines); - this.nodes[x++] = commentNode; + if (commentLines.isEmpty()) { + return null; } - this.size = x; + CommentNode commentNode = new CommentNode(node.internalNode(), 0, null); + commentNode.setCommentAttachedNode(node); + commentNode.setLastMinutiae(lastMinutiae); + commentNode.setCommentLines(commentLines); + return commentNode; } // Positional access methods - public K get(int index) { // 3 + semi + public K get(int index) { rangeCheck(index, size); -// if (index == size - 1) { -// return (K) this.semicolon; -// } -// return this.nonTerminalNode.childInBucket(index / 2); return (K) this.nodes[index]; } @@ -214,7 +198,6 @@ NonTerminalNode underlyingListNode() { */ protected class NodeAndCommentListIterator implements Iterator { private int currentIndex = 0; - private K currentNode = null; @Override public boolean hasNext() { @@ -223,48 +206,6 @@ public boolean hasNext() { @Override public K next() { -// if (currentNode != null) { -// currentIndex++; -// K temp = currentNode; -// currentNode = null; -// return temp; -// } -// currentNode = get(currentIndex); -// CommentNode commentNode = new CommentNode(currentNode.internalNode(), 0, null); -// commentNode.setCommentAttachedNode(currentNode); -// return (K) commentNode; -// } -// -// public K next2() { - //// -// K node; -// if (currentIndex % 2 == 0) { // gen comment -// currentNode = get(currentIndex); -// List commentLines = new ArrayList<>(); -// Minutiae lastMinutiae = null; -// for (Minutiae minutiae : currentNode.leadingMinutiae()) { -// String[] splits = minutiae.text().split("// "); -// if (splits.length >= 2) { -// commentLines.add(splits[1]); -// lastMinutiae = minutiae; -// } else if (splits.length == 1 && splits[0].contains("//")) { -// commentLines.add(""); -// lastMinutiae = minutiae; -// } -// } -// if (!commentLines.isEmpty()) { -//// return Optional.empty(); // set comment -// } -// CommentNode commentNode = new CommentNode(currentNode.internalNode(), 0, null); -// commentNode.setCommentAttachedNode(currentNode); -// node = (K) commentNode; -// } else { -// node = currentNode; -// } -// currentIndex++; -// return node; - /// - return get(currentIndex++); } } From 410ecfaa39905067f345527e193e8d9a1681853d Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Tue, 10 Sep 2024 23:06:01 +0530 Subject: [PATCH 06/42] Change NodeList type --- .../compiler/parser/BLangNodeBuilder.java | 254 +++++++++++++++++- .../syntax/tree/BlockStatementNode.java | 2 +- .../compiler/syntax/tree/CommentNode.java | 23 +- .../syntax/tree/FunctionBodyBlockNode.java | 2 +- .../syntax/tree/NodeAndCommentList.java | 56 ++-- 5 files changed, 280 insertions(+), 57 deletions(-) diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java index 6e427b82ed59..58d576a52fb0 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/parser/BLangNodeBuilder.java @@ -17,7 +17,246 @@ */ package org.wso2.ballerinalang.compiler.parser; -import io.ballerina.compiler.syntax.tree.*; +import io.ballerina.compiler.syntax.tree.AlternateReceiveNode; +import io.ballerina.compiler.syntax.tree.AnnotAccessExpressionNode; +import io.ballerina.compiler.syntax.tree.AnnotationAttachPointNode; +import io.ballerina.compiler.syntax.tree.AnnotationDeclarationNode; +import io.ballerina.compiler.syntax.tree.AnnotationNode; +import io.ballerina.compiler.syntax.tree.ArrayDimensionNode; +import io.ballerina.compiler.syntax.tree.ArrayTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.AssignmentStatementNode; +import io.ballerina.compiler.syntax.tree.AsyncSendActionNode; +import io.ballerina.compiler.syntax.tree.BallerinaNameReferenceNode; +import io.ballerina.compiler.syntax.tree.BasicLiteralNode; +import io.ballerina.compiler.syntax.tree.BinaryExpressionNode; +import io.ballerina.compiler.syntax.tree.BindingPatternNode; +import io.ballerina.compiler.syntax.tree.BlockStatementNode; +import io.ballerina.compiler.syntax.tree.BracedExpressionNode; +import io.ballerina.compiler.syntax.tree.BreakStatementNode; +import io.ballerina.compiler.syntax.tree.BuiltinSimpleNameReferenceNode; +import io.ballerina.compiler.syntax.tree.ByteArrayLiteralNode; +import io.ballerina.compiler.syntax.tree.CaptureBindingPatternNode; +import io.ballerina.compiler.syntax.tree.CheckExpressionNode; +import io.ballerina.compiler.syntax.tree.ChildNodeList; +import io.ballerina.compiler.syntax.tree.ClassDefinitionNode; +import io.ballerina.compiler.syntax.tree.ClientResourceAccessActionNode; +import io.ballerina.compiler.syntax.tree.CollectClauseNode; +import io.ballerina.compiler.syntax.tree.CommitActionNode; +import io.ballerina.compiler.syntax.tree.CompoundAssignmentStatementNode; +import io.ballerina.compiler.syntax.tree.ComputedNameFieldNode; +import io.ballerina.compiler.syntax.tree.ComputedResourceAccessSegmentNode; +import io.ballerina.compiler.syntax.tree.ConditionalExpressionNode; +import io.ballerina.compiler.syntax.tree.ConstantDeclarationNode; +import io.ballerina.compiler.syntax.tree.ContinueStatementNode; +import io.ballerina.compiler.syntax.tree.DefaultableParameterNode; +import io.ballerina.compiler.syntax.tree.DistinctTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.DoStatementNode; +import io.ballerina.compiler.syntax.tree.ElseBlockNode; +import io.ballerina.compiler.syntax.tree.EnumDeclarationNode; +import io.ballerina.compiler.syntax.tree.EnumMemberNode; +import io.ballerina.compiler.syntax.tree.ErrorBindingPatternNode; +import io.ballerina.compiler.syntax.tree.ErrorConstructorExpressionNode; +import io.ballerina.compiler.syntax.tree.ErrorMatchPatternNode; +import io.ballerina.compiler.syntax.tree.ExplicitAnonymousFunctionExpressionNode; +import io.ballerina.compiler.syntax.tree.ExplicitNewExpressionNode; +import io.ballerina.compiler.syntax.tree.ExpressionFunctionBodyNode; +import io.ballerina.compiler.syntax.tree.ExpressionStatementNode; +import io.ballerina.compiler.syntax.tree.ExternalFunctionBodyNode; +import io.ballerina.compiler.syntax.tree.FailStatementNode; +import io.ballerina.compiler.syntax.tree.FieldAccessExpressionNode; +import io.ballerina.compiler.syntax.tree.FieldBindingPatternFullNode; +import io.ballerina.compiler.syntax.tree.FieldBindingPatternVarnameNode; +import io.ballerina.compiler.syntax.tree.FieldMatchPatternNode; +import io.ballerina.compiler.syntax.tree.FlushActionNode; +import io.ballerina.compiler.syntax.tree.ForEachStatementNode; +import io.ballerina.compiler.syntax.tree.ForkStatementNode; +import io.ballerina.compiler.syntax.tree.FromClauseNode; +import io.ballerina.compiler.syntax.tree.FunctionArgumentNode; +import io.ballerina.compiler.syntax.tree.FunctionBodyBlockNode; +import io.ballerina.compiler.syntax.tree.FunctionBodyNode; +import io.ballerina.compiler.syntax.tree.FunctionCallExpressionNode; +import io.ballerina.compiler.syntax.tree.FunctionDefinitionNode; +import io.ballerina.compiler.syntax.tree.FunctionSignatureNode; +import io.ballerina.compiler.syntax.tree.FunctionTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.GroupByClauseNode; +import io.ballerina.compiler.syntax.tree.GroupingKeyVarDeclarationNode; +import io.ballerina.compiler.syntax.tree.IdentifierToken; +import io.ballerina.compiler.syntax.tree.IfElseStatementNode; +import io.ballerina.compiler.syntax.tree.ImplicitAnonymousFunctionExpressionNode; +import io.ballerina.compiler.syntax.tree.ImplicitAnonymousFunctionParameters; +import io.ballerina.compiler.syntax.tree.ImplicitNewExpressionNode; +import io.ballerina.compiler.syntax.tree.ImportDeclarationNode; +import io.ballerina.compiler.syntax.tree.ImportOrgNameNode; +import io.ballerina.compiler.syntax.tree.ImportPrefixNode; +import io.ballerina.compiler.syntax.tree.IncludedRecordParameterNode; +import io.ballerina.compiler.syntax.tree.IndexedExpressionNode; +import io.ballerina.compiler.syntax.tree.InferredTypedescDefaultNode; +import io.ballerina.compiler.syntax.tree.InlineCodeReferenceNode; +import io.ballerina.compiler.syntax.tree.InterpolationNode; +import io.ballerina.compiler.syntax.tree.IntersectionTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.JoinClauseNode; +import io.ballerina.compiler.syntax.tree.KeySpecifierNode; +import io.ballerina.compiler.syntax.tree.KeyTypeConstraintNode; +import io.ballerina.compiler.syntax.tree.LetClauseNode; +import io.ballerina.compiler.syntax.tree.LetExpressionNode; +import io.ballerina.compiler.syntax.tree.LetVariableDeclarationNode; +import io.ballerina.compiler.syntax.tree.LimitClauseNode; +import io.ballerina.compiler.syntax.tree.ListBindingPatternNode; +import io.ballerina.compiler.syntax.tree.ListConstructorExpressionNode; +import io.ballerina.compiler.syntax.tree.ListMatchPatternNode; +import io.ballerina.compiler.syntax.tree.ListenerDeclarationNode; +import io.ballerina.compiler.syntax.tree.LockStatementNode; +import io.ballerina.compiler.syntax.tree.MapTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.MappingBindingPatternNode; +import io.ballerina.compiler.syntax.tree.MappingConstructorExpressionNode; +import io.ballerina.compiler.syntax.tree.MappingFieldNode; +import io.ballerina.compiler.syntax.tree.MappingMatchPatternNode; +import io.ballerina.compiler.syntax.tree.MarkdownCodeBlockNode; +import io.ballerina.compiler.syntax.tree.MarkdownDocumentationLineNode; +import io.ballerina.compiler.syntax.tree.MarkdownDocumentationNode; +import io.ballerina.compiler.syntax.tree.MarkdownParameterDocumentationLineNode; +import io.ballerina.compiler.syntax.tree.MatchClauseNode; +import io.ballerina.compiler.syntax.tree.MatchStatementNode; +import io.ballerina.compiler.syntax.tree.MemberTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.MetadataNode; +import io.ballerina.compiler.syntax.tree.MethodCallExpressionNode; +import io.ballerina.compiler.syntax.tree.MethodDeclarationNode; +import io.ballerina.compiler.syntax.tree.ModuleMemberDeclarationNode; +import io.ballerina.compiler.syntax.tree.ModulePartNode; +import io.ballerina.compiler.syntax.tree.ModuleVariableDeclarationNode; +import io.ballerina.compiler.syntax.tree.ModuleXMLNamespaceDeclarationNode; +import io.ballerina.compiler.syntax.tree.NameReferenceNode; +import io.ballerina.compiler.syntax.tree.NamedArgBindingPatternNode; +import io.ballerina.compiler.syntax.tree.NamedArgMatchPatternNode; +import io.ballerina.compiler.syntax.tree.NamedArgumentNode; +import io.ballerina.compiler.syntax.tree.NamedWorkerDeclarationNode; +import io.ballerina.compiler.syntax.tree.NamedWorkerDeclarator; +import io.ballerina.compiler.syntax.tree.NewExpressionNode; +import io.ballerina.compiler.syntax.tree.Node; +import io.ballerina.compiler.syntax.tree.NodeFactory; +import io.ballerina.compiler.syntax.tree.NodeList; +import io.ballerina.compiler.syntax.tree.NodeTransformer; +import io.ballerina.compiler.syntax.tree.NonTerminalNode; +import io.ballerina.compiler.syntax.tree.ObjectConstructorExpressionNode; +import io.ballerina.compiler.syntax.tree.ObjectFieldNode; +import io.ballerina.compiler.syntax.tree.ObjectTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.OnClauseNode; +import io.ballerina.compiler.syntax.tree.OnConflictClauseNode; +import io.ballerina.compiler.syntax.tree.OnFailClauseNode; +import io.ballerina.compiler.syntax.tree.OptionalFieldAccessExpressionNode; +import io.ballerina.compiler.syntax.tree.OptionalTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.OrderByClauseNode; +import io.ballerina.compiler.syntax.tree.OrderKeyNode; +import io.ballerina.compiler.syntax.tree.PanicStatementNode; +import io.ballerina.compiler.syntax.tree.ParameterNode; +import io.ballerina.compiler.syntax.tree.ParameterizedTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.ParenthesisedTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.ParenthesizedArgList; +import io.ballerina.compiler.syntax.tree.PositionalArgumentNode; +import io.ballerina.compiler.syntax.tree.QualifiedNameReferenceNode; +import io.ballerina.compiler.syntax.tree.QueryActionNode; +import io.ballerina.compiler.syntax.tree.QueryConstructTypeNode; +import io.ballerina.compiler.syntax.tree.QueryExpressionNode; +import io.ballerina.compiler.syntax.tree.ReAssertionNode; +import io.ballerina.compiler.syntax.tree.ReAtomCharOrEscapeNode; +import io.ballerina.compiler.syntax.tree.ReAtomQuantifierNode; +import io.ballerina.compiler.syntax.tree.ReBracedQuantifierNode; +import io.ballerina.compiler.syntax.tree.ReCapturingGroupsNode; +import io.ballerina.compiler.syntax.tree.ReCharSetAtomNoDashWithReCharSetNoDashNode; +import io.ballerina.compiler.syntax.tree.ReCharSetAtomWithReCharSetNoDashNode; +import io.ballerina.compiler.syntax.tree.ReCharSetRangeNoDashNode; +import io.ballerina.compiler.syntax.tree.ReCharSetRangeNoDashWithReCharSetNode; +import io.ballerina.compiler.syntax.tree.ReCharSetRangeNode; +import io.ballerina.compiler.syntax.tree.ReCharSetRangeWithReCharSetNode; +import io.ballerina.compiler.syntax.tree.ReCharacterClassNode; +import io.ballerina.compiler.syntax.tree.ReFlagExpressionNode; +import io.ballerina.compiler.syntax.tree.ReFlagsNode; +import io.ballerina.compiler.syntax.tree.ReFlagsOnOffNode; +import io.ballerina.compiler.syntax.tree.ReQuantifierNode; +import io.ballerina.compiler.syntax.tree.ReQuoteEscapeNode; +import io.ballerina.compiler.syntax.tree.ReSequenceNode; +import io.ballerina.compiler.syntax.tree.ReSimpleCharClassEscapeNode; +import io.ballerina.compiler.syntax.tree.ReUnicodeGeneralCategoryNode; +import io.ballerina.compiler.syntax.tree.ReUnicodePropertyEscapeNode; +import io.ballerina.compiler.syntax.tree.ReUnicodeScriptNode; +import io.ballerina.compiler.syntax.tree.ReceiveActionNode; +import io.ballerina.compiler.syntax.tree.ReceiveFieldNode; +import io.ballerina.compiler.syntax.tree.ReceiveFieldsNode; +import io.ballerina.compiler.syntax.tree.RecordFieldNode; +import io.ballerina.compiler.syntax.tree.RecordFieldWithDefaultValueNode; +import io.ballerina.compiler.syntax.tree.RecordRestDescriptorNode; +import io.ballerina.compiler.syntax.tree.RecordTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.RemoteMethodCallActionNode; +import io.ballerina.compiler.syntax.tree.RequiredParameterNode; +import io.ballerina.compiler.syntax.tree.ResourceAccessRestSegmentNode; +import io.ballerina.compiler.syntax.tree.ResourcePathParameterNode; +import io.ballerina.compiler.syntax.tree.RestArgumentNode; +import io.ballerina.compiler.syntax.tree.RestBindingPatternNode; +import io.ballerina.compiler.syntax.tree.RestDescriptorNode; +import io.ballerina.compiler.syntax.tree.RestMatchPatternNode; +import io.ballerina.compiler.syntax.tree.RestParameterNode; +import io.ballerina.compiler.syntax.tree.RetryStatementNode; +import io.ballerina.compiler.syntax.tree.ReturnStatementNode; +import io.ballerina.compiler.syntax.tree.ReturnTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.RollbackStatementNode; +import io.ballerina.compiler.syntax.tree.SelectClauseNode; +import io.ballerina.compiler.syntax.tree.SeparatedNodeList; +import io.ballerina.compiler.syntax.tree.ServiceDeclarationNode; +import io.ballerina.compiler.syntax.tree.SimpleNameReferenceNode; +import io.ballerina.compiler.syntax.tree.SingletonTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.SpecificFieldNode; +import io.ballerina.compiler.syntax.tree.SpreadFieldNode; +import io.ballerina.compiler.syntax.tree.SpreadMemberNode; +import io.ballerina.compiler.syntax.tree.StartActionNode; +import io.ballerina.compiler.syntax.tree.StatementNode; +import io.ballerina.compiler.syntax.tree.StreamTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.StreamTypeParamsNode; +import io.ballerina.compiler.syntax.tree.SyncSendActionNode; +import io.ballerina.compiler.syntax.tree.SyntaxKind; +import io.ballerina.compiler.syntax.tree.TableConstructorExpressionNode; +import io.ballerina.compiler.syntax.tree.TableTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.TemplateExpressionNode; +import io.ballerina.compiler.syntax.tree.Token; +import io.ballerina.compiler.syntax.tree.TransactionStatementNode; +import io.ballerina.compiler.syntax.tree.TransactionalExpressionNode; +import io.ballerina.compiler.syntax.tree.TrapExpressionNode; +import io.ballerina.compiler.syntax.tree.TupleTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.TypeCastExpressionNode; +import io.ballerina.compiler.syntax.tree.TypeCastParamNode; +import io.ballerina.compiler.syntax.tree.TypeDefinitionNode; +import io.ballerina.compiler.syntax.tree.TypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.TypeParameterNode; +import io.ballerina.compiler.syntax.tree.TypeReferenceNode; +import io.ballerina.compiler.syntax.tree.TypeTestExpressionNode; +import io.ballerina.compiler.syntax.tree.TypedBindingPatternNode; +import io.ballerina.compiler.syntax.tree.TypeofExpressionNode; +import io.ballerina.compiler.syntax.tree.UnaryExpressionNode; +import io.ballerina.compiler.syntax.tree.UnionTypeDescriptorNode; +import io.ballerina.compiler.syntax.tree.VariableDeclarationNode; +import io.ballerina.compiler.syntax.tree.WaitActionNode; +import io.ballerina.compiler.syntax.tree.WaitFieldNode; +import io.ballerina.compiler.syntax.tree.WaitFieldsListNode; +import io.ballerina.compiler.syntax.tree.WhereClauseNode; +import io.ballerina.compiler.syntax.tree.WhileStatementNode; +import io.ballerina.compiler.syntax.tree.WildcardBindingPatternNode; +import io.ballerina.compiler.syntax.tree.XMLAtomicNamePatternNode; +import io.ballerina.compiler.syntax.tree.XMLAttributeNode; +import io.ballerina.compiler.syntax.tree.XMLAttributeValue; +import io.ballerina.compiler.syntax.tree.XMLCDATANode; +import io.ballerina.compiler.syntax.tree.XMLComment; +import io.ballerina.compiler.syntax.tree.XMLElementNode; +import io.ballerina.compiler.syntax.tree.XMLEmptyElementNode; +import io.ballerina.compiler.syntax.tree.XMLEndTagNode; +import io.ballerina.compiler.syntax.tree.XMLFilterExpressionNode; +import io.ballerina.compiler.syntax.tree.XMLNameNode; +import io.ballerina.compiler.syntax.tree.XMLNamePatternChainingNode; +import io.ballerina.compiler.syntax.tree.XMLNamespaceDeclarationNode; +import io.ballerina.compiler.syntax.tree.XMLProcessingInstruction; +import io.ballerina.compiler.syntax.tree.XMLQualifiedNameNode; +import io.ballerina.compiler.syntax.tree.XMLSimpleNameNode; +import io.ballerina.compiler.syntax.tree.XMLStartTagNode; +import io.ballerina.compiler.syntax.tree.XMLStepExpressionNode; +import io.ballerina.compiler.syntax.tree.XMLTextNode; import io.ballerina.identifier.Utils; import io.ballerina.runtime.internal.XmlFactory; import io.ballerina.tools.diagnostics.DiagnosticCode; @@ -1448,12 +1687,6 @@ public BLangNode transform(FunctionBodyBlockNode functionBodyBlockNode) { } } - for (Node stmt : functionBodyBlockNode.statementsWithComments()) { - Node s = stmt; - if (stmt instanceof CommentNode commentNode) { - Node commentAttachedNode = commentNode.getCommentAttachedNode(); - } - } generateAndAddBLangStatements(functionBodyBlockNode.statements(), stmtList, 0, functionBodyBlockNode); bLFuncBody.stmts = statements; @@ -2759,13 +2992,6 @@ public BLangNode transform(IfElseStatementNode ifElseStmtNode) { public BLangNode transform(BlockStatementNode blockStatement) { BLangBlockStmt bLBlockStmt = (BLangBlockStmt) TreeBuilder.createBlockNode(); this.isInLocalContext = true; - for (Node stmt : blockStatement.statementsWithComments()) { - Node s = stmt; - if (stmt instanceof CommentNode commentNode) { - Node commentAttachedNode = commentNode.getCommentAttachedNode(); - } - } - bLBlockStmt.stmts = generateBLangStatements(blockStatement.statements(), blockStatement); this.isInLocalContext = false; bLBlockStmt.pos = getPosition(blockStatement); diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java index 97d6874bc688..61253a9cf1e2 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/BlockStatementNode.java @@ -40,7 +40,7 @@ public NodeList statements() { return new NodeList<>(childInBucket(1)); } - public NodeAndCommentList statementsWithComments() { + public NodeAndCommentList statementsWithComments() { return new NodeAndCommentList<>(childInBucket(1), childInBucket(2)); } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java index 4ca58126567e..08cfba08faeb 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java @@ -1,20 +1,19 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2024, WSO2 LLC. (http://wso2.com) * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package io.ballerina.compiler.syntax.tree; import io.ballerina.compiler.internal.parser.tree.STNode; diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java index 24267139d340..7aeaef153cd1 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/FunctionBodyBlockNode.java @@ -45,7 +45,7 @@ public NodeList statements() { return new NodeList<>(childInBucket(2)); } - public NodeAndCommentList statementsWithComments() { + public NodeAndCommentList statementsWithComments() { return new NodeAndCommentList<>(childInBucket(2), childInBucket(3)); } diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java index 23b96141b55e..36e0283dc54c 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java @@ -1,20 +1,19 @@ /* - * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * Copyright (c) 2024, WSO2 LLC. (http://wso2.com) * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ + package io.ballerina.compiler.syntax.tree; import io.ballerina.compiler.internal.parser.tree.STNode; @@ -32,10 +31,9 @@ /** * Represent both nodes and attached comments to each node. * - * @param The type of NonTerminalNode - * @param The type of Node + * @param The type of Node */ -public class NodeAndCommentList implements Iterable { +public class NodeAndCommentList implements Iterable { protected final STNodeList internalListNode; protected final NonTerminalNode nonTerminalNode; protected final int size; @@ -52,7 +50,7 @@ protected NodeAndCommentList(NonTerminalNode nonTerminalNode, Token semicolon, i this.internalListNode = (STNodeList) nonTerminalNode.internalNode(); this.nonTerminalNode = nonTerminalNode; - this.nodes = new Node[size]; // TODO: Init with max size + this.nodes = new Node[size]; int nodeIndex = 0; for (int i = 0; i < nonTerminalNode.bucketCount(); i++) { Node node = nonTerminalNode.childInBucket(i); @@ -95,25 +93,25 @@ private CommentNode getCommentNode(Node node) { // Positional access methods - public K get(int index) { + public T get(int index) { rangeCheck(index, size); - return (K) this.nodes[index]; + return (T) this.nodes[index]; } // Modification methods - public NodeAndCommentList add(T node) { + public NodeAndCommentList add(T node) { Objects.requireNonNull(node, "node should not be null"); return new NodeAndCommentList<>(internalListNode.add(node.internalNode()).createUnlinkedFacade(), null); } - public NodeAndCommentList add(int index, T node) { + public NodeAndCommentList add(int index, T node) { Objects.requireNonNull(node, "node should not be null"); rangeCheckForAdd(index, size); return new NodeAndCommentList<>(internalListNode.add(index, node.internalNode()).createUnlinkedFacade(), null); } - public NodeAndCommentList addAll(Collection c) { + public NodeAndCommentList addAll(Collection c) { if (c.isEmpty()) { return this; } @@ -125,7 +123,7 @@ public NodeAndCommentList addAll(Collection c) { return new NodeAndCommentList<>(internalListNode.addAll(stNodesToBeAdded).createUnlinkedFacade(), null); } - public NodeAndCommentList set(int index, T node) { + public NodeAndCommentList set(int index, T node) { Objects.requireNonNull(node, "node should not be null"); rangeCheck(index, size); if (nonTerminalNode.checkForReferenceEquality(index, node)) { @@ -135,12 +133,12 @@ public NodeAndCommentList set(int index, T node) { return new NodeAndCommentList<>(internalListNode.set(index, node.internalNode()).createUnlinkedFacade(), null); } - public NodeAndCommentList remove(int index) { + public NodeAndCommentList remove(int index) { rangeCheck(index, size); return new NodeAndCommentList<>(internalListNode.remove(index).createUnlinkedFacade(), null); } - public NodeAndCommentList remove(T node) { + public NodeAndCommentList remove(T node) { Objects.requireNonNull(node, "node should not be null"); for (int bucket = 0; bucket < nonTerminalNode.bucketCount(); bucket++) { if (nonTerminalNode.checkForReferenceEquality(bucket, node)) { @@ -151,7 +149,7 @@ public NodeAndCommentList remove(T node) { } @SuppressWarnings("SuspiciousMethodCalls") - public NodeAndCommentList removeAll(Collection c) { + public NodeAndCommentList removeAll(Collection c) { if (c.isEmpty()) { return this; } @@ -179,11 +177,11 @@ public boolean isEmpty() { } @Override - public Iterator iterator() { + public Iterator iterator() { return new NodeAndCommentListIterator(); } - public Stream stream() { + public Stream stream() { return StreamSupport.stream(spliterator(), false); } @@ -196,7 +194,7 @@ NonTerminalNode underlyingListNode() { * * @since 2201.10.0 */ - protected class NodeAndCommentListIterator implements Iterator { + protected class NodeAndCommentListIterator implements Iterator { private int currentIndex = 0; @Override @@ -205,7 +203,7 @@ public boolean hasNext() { } @Override - public K next() { + public T next() { return get(currentIndex++); } } From 81860e07d925f7efe6f202d3140fd9bd7dd61922 Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Wed, 11 Sep 2024 13:13:41 +0530 Subject: [PATCH 07/42] Add more tests --- .../compiler/parser/test/ParserTestUtils.java | 12 ++++++++ .../nodeparser/ParseBlockStatementTest.java | 30 +++++++++++++++++++ .../nodeparser/ParseFunctionBodyBlock.java | 28 +++++++++++++++++ 3 files changed, 70 insertions(+) diff --git a/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/ParserTestUtils.java b/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/ParserTestUtils.java index 6dc3df46bfd5..b9cfe29df20c 100644 --- a/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/ParserTestUtils.java +++ b/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/ParserTestUtils.java @@ -32,6 +32,7 @@ import io.ballerina.compiler.internal.parser.tree.STNodeList; import io.ballerina.compiler.internal.parser.tree.STToken; import io.ballerina.compiler.internal.syntax.SyntaxUtils; +import io.ballerina.compiler.syntax.tree.CommentNode; import io.ballerina.compiler.syntax.tree.Node; import io.ballerina.compiler.syntax.tree.SyntaxKind; import io.ballerina.compiler.syntax.tree.SyntaxTree; @@ -47,6 +48,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Collection; +import java.util.List; import static io.ballerina.compiler.internal.syntax.SyntaxUtils.isSTNodePresent; import static io.ballerinalang.compiler.parser.test.ParserTestConstants.CHILDREN_FIELD; @@ -1476,4 +1478,14 @@ private static SyntaxKind getDocumentationKind(String kind) { throw new UnsupportedOperationException("cannot find syntax kind: " + kind); } } + + public static void assertCommentNode(Node node, List comments) { + Assert.assertTrue(node instanceof CommentNode); + CommentNode commentNode = (CommentNode) node; + List commentLines = commentNode.getCommentLines(); + Assert.assertEquals(commentLines.size(), comments.size()); + for (int i = 0; i < comments.size(); i++) { + Assert.assertEquals(commentLines.get(i), comments.get(i)); + } + } } diff --git a/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseBlockStatementTest.java b/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseBlockStatementTest.java index f665793167a0..d246eff02732 100644 --- a/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseBlockStatementTest.java +++ b/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseBlockStatementTest.java @@ -18,6 +18,8 @@ package io.ballerinalang.compiler.parser.test.tree.nodeparser; import io.ballerina.compiler.syntax.tree.BlockStatementNode; +import io.ballerina.compiler.syntax.tree.Node; +import io.ballerina.compiler.syntax.tree.NodeAndCommentList; import io.ballerina.compiler.syntax.tree.NodeList; import io.ballerina.compiler.syntax.tree.NodeParser; import io.ballerina.compiler.syntax.tree.StatementNode; @@ -28,6 +30,8 @@ import java.util.List; +import static io.ballerinalang.compiler.parser.test.ParserTestUtils.assertCommentNode; + /** * Test {@code parseBlockStatement} method. * @@ -177,4 +181,30 @@ public void testBlockStmtRecovery() { Assert.assertEquals(blockStmtNode.toString(), " INVALID[%]{ int a; INVALID[;] } INVALID[;] INVALID[;]"); } + + @Test + public void testCommentInBlockStatementBody() { + String blockStatement = """ + { + // Initialize x + int x = 1; + // Initialize y + int y = 1; + + // new comment + // another new comment + }"""; + BlockStatementNode blockStmtNode = NodeParser.parseBlockStatement(blockStatement); + Assert.assertEquals(blockStmtNode.kind(), SyntaxKind.BLOCK_STATEMENT); + Assert.assertFalse(blockStmtNode.hasDiagnostics()); + + NodeAndCommentList nodes = blockStmtNode.statementsWithComments(); + Assert.assertEquals(nodes.size(), 5); + + assertCommentNode(nodes.get(0), List.of("Initialize x")); + assertCommentNode(nodes.get(2), List.of("Initialize y")); + assertCommentNode(nodes.get(4), List.of("new comment", "another new comment")); + } + + } diff --git a/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseFunctionBodyBlock.java b/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseFunctionBodyBlock.java index 926702dab247..6d5ea710a004 100644 --- a/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseFunctionBodyBlock.java +++ b/compiler/ballerina-parser/src/test/java/io/ballerinalang/compiler/parser/test/tree/nodeparser/ParseFunctionBodyBlock.java @@ -20,6 +20,8 @@ import io.ballerina.compiler.syntax.tree.FunctionBodyBlockNode; import io.ballerina.compiler.syntax.tree.NamedWorkerDeclarationNode; import io.ballerina.compiler.syntax.tree.NamedWorkerDeclarator; +import io.ballerina.compiler.syntax.tree.Node; +import io.ballerina.compiler.syntax.tree.NodeAndCommentList; import io.ballerina.compiler.syntax.tree.NodeList; import io.ballerina.compiler.syntax.tree.NodeParser; import io.ballerina.compiler.syntax.tree.StatementNode; @@ -31,6 +33,8 @@ import java.util.List; import java.util.Optional; +import static io.ballerinalang.compiler.parser.test.ParserTestUtils.assertCommentNode; + /** * Test {@code parseFunctionBodyBlock} method. * @@ -255,4 +259,28 @@ public void testFuncBodyBlockRecovery() { Assert.assertEquals(funcBodyBlockNode.toString(), " INVALID[%]{ int a; INVALID[;] }; INVALID[;]"); } + + @Test + public void testCommentInFunctionBody() { + String funcBodyBlock = """ + { + // Initialize x + int x = 1; + // Initialize y + int y = 1; + + // new comment + // another new comment + }"""; + FunctionBodyBlockNode funcBodyBlockNode = NodeParser.parseFunctionBodyBlock(funcBodyBlock); + Assert.assertEquals(funcBodyBlockNode.kind(), SyntaxKind.FUNCTION_BODY_BLOCK); + Assert.assertFalse(funcBodyBlockNode.hasDiagnostics()); + + NodeAndCommentList nodes = funcBodyBlockNode.statementsWithComments(); + Assert.assertEquals(nodes.size(), 5); + + assertCommentNode(nodes.get(0), List.of("Initialize x")); + assertCommentNode(nodes.get(2), List.of("Initialize y")); + assertCommentNode(nodes.get(4), List.of("new comment", "another new comment")); + } } From 6117ddde9fcbb64490a9956dd05025131f622415 Mon Sep 17 00:00:00 2001 From: Nipuna Fernando Date: Wed, 9 Oct 2024 19:58:31 +0530 Subject: [PATCH 08/42] Add configurable and automations to the components --- .../DocumentComponentTransformer.java | 24 ++++++++++++++++--- .../ballerina/packages/ModuleObject.java | 8 +++++++ .../packages/PackageServiceConstants.java | 3 +++ 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java index 51dcefa19899..22c075f78205 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java @@ -26,6 +26,7 @@ import io.ballerina.compiler.syntax.tree.NonTerminalNode; import io.ballerina.compiler.syntax.tree.ServiceDeclarationNode; import io.ballerina.compiler.syntax.tree.SyntaxKind; +import io.ballerina.compiler.syntax.tree.Token; import io.ballerina.compiler.syntax.tree.TypeDefinitionNode; import io.ballerina.tools.text.LineRange; @@ -63,6 +64,11 @@ public Optional transformSyntaxNode(Node node) { @Override public Optional transform(FunctionDefinitionNode functionDefinitionNode) { + if (functionDefinitionNode.functionName().text().equals(PackageServiceConstants.MAIN_FUNCTION)) { + return Optional.of(new MapperObject(PackageServiceConstants.AUTOMATIONS, + createDataObject(PackageServiceConstants.MAIN_FUNCTION, functionDefinitionNode))); + } + return Optional.of(new MapperObject(PackageServiceConstants.FUNCTIONS, createDataObject(functionDefinitionNode.functionName().text(), functionDefinitionNode))); } @@ -80,8 +86,12 @@ public Optional transform(ServiceDeclarationNode serviceDeclaratio DataObject dataObject = createDataObject(name, serviceDeclarationNode); serviceDeclarationNode.members().forEach(member -> { if (member.kind() == SyntaxKind.RESOURCE_ACCESSOR_DEFINITION) { - dataObject.addResource(createDataObject(((FunctionDefinitionNode) member).functionName().text(), - member)); + FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; + String resourceName = functionDefinitionNode.functionName().text() + "-" + + functionDefinitionNode.relativeResourcePath().stream() + .map(Node::toSourceCode) + .collect(Collectors.joining("")); + dataObject.addResource(createDataObject(resourceName, member)); } }); return Optional.of(new MapperObject(PackageServiceConstants.SERVICES, dataObject)); @@ -115,9 +125,17 @@ public Optional transform(TypeDefinitionNode typeDefinitionNode) { @Override public Optional transform(ModuleVariableDeclarationNode moduleVariableDeclarationNode) { + Optional isConfigurable = moduleVariableDeclarationNode.qualifiers().stream() + .filter(qualifier -> qualifier.kind() == SyntaxKind.CONFIGURABLE_KEYWORD) + .findFirst(); + if (isConfigurable.isPresent()) { + return Optional.of(new MapperObject(PackageServiceConstants.CONFIGURABLE_VARIABLES, + createDataObject(moduleVariableDeclarationNode.typedBindingPattern().bindingPattern().toString(), + moduleVariableDeclarationNode))); + } return Optional.of(new MapperObject(PackageServiceConstants.MODULE_LEVEL_VARIABLE, createDataObject(moduleVariableDeclarationNode.typedBindingPattern().bindingPattern().toString(), - moduleVariableDeclarationNode))); + moduleVariableDeclarationNode))); } @Override diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java index 4b7fedfdd0c1..faaf15a9e1e7 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java @@ -32,6 +32,8 @@ public class ModuleObject { private final List enums = new ArrayList<>(); private final List listeners = new ArrayList<>(); private final List moduleVariables = new ArrayList<>(); + private final List configurableVariables = new ArrayList<>(); + private final List automations = new ArrayList<>(); private String name; @@ -103,6 +105,12 @@ protected void addDataObject(MapperObject mapperObject) { case PackageServiceConstants.MODULE_LEVEL_VARIABLE: this.moduleVariables.add(mapperObject.getDataObject()); break; + case PackageServiceConstants.CONFIGURABLE_VARIABLES: + this.configurableVariables.add(mapperObject.getDataObject()); + break; + case PackageServiceConstants.AUTOMATIONS: + this.automations.add(mapperObject.getDataObject()); + break; default: break; } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/PackageServiceConstants.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/PackageServiceConstants.java index 292b7d7fb505..780c62f8100a 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/PackageServiceConstants.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/PackageServiceConstants.java @@ -23,6 +23,7 @@ public class PackageServiceConstants { protected static final String CAPABILITY_NAME = "ballerinaPackage"; + protected static final String MAIN_FUNCTION = "main"; protected static final String NAME = "name"; protected static final String FILE_PATH = "filePath"; protected static final String START_LINE = "startLine"; @@ -41,4 +42,6 @@ public class PackageServiceConstants { protected static final String CLASSES = "classes"; protected static final String LISTENERS = "listeners"; protected static final String MODULE_LEVEL_VARIABLE = "moduleVariables"; + protected static final String CONFIGURABLE_VARIABLES = "configurableVariables"; + protected static final String AUTOMATIONS = "automations"; } From 87b0fa3b63ead4b86d1b82ac81286f547e769f46 Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Wed, 16 Oct 2024 11:45:22 +0530 Subject: [PATCH 09/42] Generate Type model for referenced type symbol --- .../diagramutil/connector/models/connector/Type.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Type.java b/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Type.java index 793ef033ddc9..110e630fa6cd 100644 --- a/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Type.java +++ b/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/connector/models/connector/Type.java @@ -33,6 +33,7 @@ import io.ballerina.compiler.api.symbols.Symbol; import io.ballerina.compiler.api.symbols.SymbolKind; import io.ballerina.compiler.api.symbols.TableTypeSymbol; +import io.ballerina.compiler.api.symbols.TypeDefinitionSymbol; import io.ballerina.compiler.api.symbols.TypeReferenceTypeSymbol; import io.ballerina.compiler.api.symbols.TypeSymbol; import io.ballerina.compiler.api.symbols.UnionTypeSymbol; @@ -374,6 +375,8 @@ public static Type fromSemanticSymbol(Symbol symbol) { typeName = typeName.substring(1, typeName.length() - 1); } type = new PrimitiveType(typeName); + } else if (symbol instanceof TypeDefinitionSymbol) { + type = fromSemanticSymbol(((TypeDefinitionSymbol) symbol).typeDescriptor()); } return type; } From 3765a01f14e3fd5723ac1f69941f6ef07e57efa7 Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Wed, 16 Oct 2024 13:41:10 +0530 Subject: [PATCH 10/42] LS apis to get diagnostics and main function args --- .../runner/BallerinaRunnerService.java | 145 ++++++++++++++++++ .../runner/MainFunctionParamsRequest.java | 39 +++++ .../runner/ProjectDiagnosticsRequest.java | 39 +++++ .../runner/ProjectDiagnosticsResponse.java | 41 +++++ 4 files changed, 264 insertions(+) create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/MainFunctionParamsRequest.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsRequest.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java new file mode 100644 index 000000000000..11931479586e --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import io.ballerina.compiler.syntax.tree.FunctionDefinitionNode; +import io.ballerina.compiler.syntax.tree.ModuleMemberDeclarationNode; +import io.ballerina.compiler.syntax.tree.ModulePartNode; +import io.ballerina.compiler.syntax.tree.Node; +import io.ballerina.compiler.syntax.tree.SyntaxKind; +import io.ballerina.projects.Document; +import io.ballerina.projects.DocumentId; +import io.ballerina.projects.Package; +import io.ballerina.projects.Project; +import org.ballerinalang.annotation.JavaSPIService; +import org.ballerinalang.langserver.LSContextOperation; +import org.ballerinalang.langserver.common.utils.PathUtil; +import org.ballerinalang.langserver.commons.DocumentServiceContext; +import org.ballerinalang.langserver.commons.LanguageServerContext; +import org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService; +import org.ballerinalang.langserver.commons.workspace.WorkspaceManager; +import org.ballerinalang.langserver.contexts.ContextBuilder; +import org.ballerinalang.langserver.diagnostic.DiagnosticsHelper; +import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; +import org.eclipse.lsp4j.jsonrpc.services.JsonSegment; +import org.eclipse.lsp4j.services.LanguageServer; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; + +/** + * Implementation of Ballerina runner extension for Language Server. + * + * @since 2201.11.0 + */ +@JavaSPIService("org.ballerinalang.langserver.commons.service.spi.BallerinaRunnerService") +@JsonSegment("ballerinaRunner") +public class BallerinaRunnerService implements ExtendedLanguageServerService { + + private WorkspaceManager workspaceManager; + private LanguageServerContext serverContext; + + @Override + public void init(LanguageServer langServer, WorkspaceManager workspaceManager, + LanguageServerContext serverContext) { + this.workspaceManager = workspaceManager; + this.serverContext = serverContext; + } + + /** + * Get all the diagnostics of the project. + * + * @param request {@link ProjectDiagnosticsRequest} + * @return {@link ProjectDiagnosticsResponse} + */ + @JsonRequest + public CompletableFuture diagnostics(ProjectDiagnosticsRequest request) { + return CompletableFuture.supplyAsync(() -> { + ProjectDiagnosticsResponse projectDiagnosticsResponse = new ProjectDiagnosticsResponse(); + Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); + if (filePath.isEmpty()) { + return projectDiagnosticsResponse; + } + Optional project = this.workspaceManager.project(filePath.get()); + if (project.isEmpty()) { + return projectDiagnosticsResponse; + } + DocumentServiceContext context = ContextBuilder.buildDocumentServiceContext(filePath.get().toString(), + this.workspaceManager, + LSContextOperation.DOC_DIAGNOSTICS, + this.serverContext); + Map> latestDiagnostics = DiagnosticsHelper.getInstance(this.serverContext) + .getLatestDiagnostics(context); + projectDiagnosticsResponse.setDiagnostics(latestDiagnostics); + return projectDiagnosticsResponse; + }); + } + + /** + * Get the main function parameters. + * + * @param request {@link MainFunctionParamsRequest} + * @return {@link MainFunctionParamsResponse} + */ + @JsonRequest + public CompletableFuture mainFunctionParams(MainFunctionParamsRequest request) { + return CompletableFuture.supplyAsync(() -> { + Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); + if (filePath.isEmpty()) { + return new MainFunctionParamsResponse(false, null); + } + Optional project = this.workspaceManager.project(filePath.get()); + if (project.isEmpty()) { + return new MainFunctionParamsResponse(false, null); + } + Package currentPackage = project.get().currentPackage(); + for (DocumentId documentId : currentPackage.getDefaultModule().documentIds()) { + Document document = currentPackage.getDefaultModule().document(documentId); + Node node = document.syntaxTree().rootNode(); + if (node instanceof ModulePartNode modulePartNode) { + for (ModuleMemberDeclarationNode member : modulePartNode.members()) { + if (member.kind() == SyntaxKind.FUNCTION_DEFINITION) { + FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; + if (functionDefinitionNode.functionName().text().equals("main")) { + List params = new ArrayList<>(); + functionDefinitionNode.functionSignature().parameters().forEach(param -> { + params.add(param.toString()); + }); + return new MainFunctionParamsResponse(true, params); + } + } + } + } + } + return new MainFunctionParamsResponse(false, null); + }); + } + + @Override + public Class getRemoteInterface() { + return getClass(); + } + + public record MainFunctionParamsResponse(boolean hasMain, List params) { + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/MainFunctionParamsRequest.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/MainFunctionParamsRequest.java new file mode 100644 index 000000000000..509479502fcd --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/MainFunctionParamsRequest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.eclipse.lsp4j.TextDocumentIdentifier; + +/** + * {@link BallerinaRunnerService} mainFunctionParams api request. + * + * @since 2201.11.0 + */ +public class MainFunctionParamsRequest { + + private TextDocumentIdentifier projectRootIdentifier; + + protected TextDocumentIdentifier getProjectRootIdentifier() { + return projectRootIdentifier; + } + + public void setDocumentIdentifier(TextDocumentIdentifier projectRootIdentifier) { + this.projectRootIdentifier = projectRootIdentifier == null ? null : + new TextDocumentIdentifier(projectRootIdentifier.getUri()); + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsRequest.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsRequest.java new file mode 100644 index 000000000000..ca9e2851ca71 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsRequest.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.eclipse.lsp4j.TextDocumentIdentifier; + +/** + * {@link BallerinaRunnerService} diagnostics api request. + * + * @since 2201.11.0 + */ +public class ProjectDiagnosticsRequest { + + private TextDocumentIdentifier projectRootIdentifier; + + protected TextDocumentIdentifier getProjectRootIdentifier() { + return projectRootIdentifier; + } + + public void setDocumentIdentifier(TextDocumentIdentifier projectRootIdentifier) { + this.projectRootIdentifier = projectRootIdentifier == null ? null : + new TextDocumentIdentifier(projectRootIdentifier.getUri()); + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java new file mode 100644 index 000000000000..f82075538407 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.eclipse.lsp4j.Diagnostic; + +import java.util.List; +import java.util.Map; + +/** + * {@link BallerinaRunnerService} diagnostics api response. + * + * @since 2201.11.0 + */ +public class ProjectDiagnosticsResponse { + + private Map> diagnostics; + + public Map> getDiagnostics() { + return diagnostics; + } + + public void setDiagnostics(Map> diagnostics) { + this.diagnostics = diagnostics; + } +} From 0956ccd8d5ea5ad02261e02ab9bb87cbec4c1c0a Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Wed, 16 Oct 2024 13:59:09 +0530 Subject: [PATCH 11/42] Support passing main function args for fast run --- .../commons/workspace/WorkspaceManager.java | 4 ++-- .../command/executors/RunExecutor.java | 17 ++++++++++++++++- .../workspace/BallerinaWorkspaceManager.java | 3 ++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/workspace/WorkspaceManager.java b/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/workspace/WorkspaceManager.java index 021a0f497562..f8995b6251d3 100644 --- a/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/workspace/WorkspaceManager.java +++ b/language-server/modules/langserver-commons/src/main/java/org/ballerinalang/langserver/commons/workspace/WorkspaceManager.java @@ -245,10 +245,10 @@ public interface WorkspaceManager { * @throws IOException If failed to start the process. * @since 2201.6.0 */ - Optional run(Path filePath) throws IOException; + Optional run(Path filePath, List mainFuncArgs) throws IOException; /** - * Stop a running process started with {@link #run(Path)}. + * Stop a running process started with {@link #run}. * @param filePath Path that belongs to the project to be stopped. * @return {@code true} if the process was stopped successfully (or already dead), {@code false} otherwise. * @since 2201.6.0 diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/command/executors/RunExecutor.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/command/executors/RunExecutor.java index a7108393d11a..bab19416b9af 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/command/executors/RunExecutor.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/command/executors/RunExecutor.java @@ -15,6 +15,7 @@ */ package org.ballerinalang.langserver.command.executors; +import com.google.gson.JsonArray; import com.google.gson.JsonPrimitive; import org.ballerinalang.annotation.JavaSPIService; import org.ballerinalang.langserver.commons.ExecuteCommandContext; @@ -27,6 +28,8 @@ import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; import java.util.function.Supplier; @@ -42,7 +45,8 @@ public class RunExecutor implements LSCommandExecutor { @Override public Boolean execute(ExecuteCommandContext context) throws LSCommandExecutorException { try { - Optional processOpt = context.workspace().run(extractPath(context)); + Optional processOpt = context.workspace().run(extractPath(context), + extractMainFunctionArgs(context)); if (processOpt.isEmpty()) { return false; } @@ -59,6 +63,17 @@ private static Path extractPath(ExecuteCommandContext context) { return Path.of(context.getArguments().get(0).value().getAsString()); } + private static List extractMainFunctionArgs(ExecuteCommandContext context) { + List args = new ArrayList<>(); + if (context.getArguments().size() == 1) { + return args; + } + context.getArguments().get(1).value().getAsJsonArray().iterator().forEachRemaining(arg -> { + args.add(arg.getAsString()); + }); + return args; + } + public void listenOutputAsync(ExtendedLanguageClient client, Supplier getInputStream, String channel) { Thread thread = new Thread(() -> listenOutput(client, getInputStream, channel)); thread.setDaemon(true); diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/workspace/BallerinaWorkspaceManager.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/workspace/BallerinaWorkspaceManager.java index 2592c9e0827b..d594b84fab40 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/workspace/BallerinaWorkspaceManager.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/workspace/BallerinaWorkspaceManager.java @@ -588,7 +588,7 @@ public String uriScheme() { } @Override - public Optional run(Path filePath) throws IOException { + public Optional run(Path filePath, List mainFuncArgs) throws IOException { Optional projectPairOpt = projectContext(projectRoot(filePath)); if (projectPairOpt.isEmpty()) { String msg = "Run command execution aborted because project is not loaded"; @@ -632,6 +632,7 @@ public Optional run(Path filePath) throws IOException { commands.add("-cp"); commands.add(getAllClassPaths(jarResolver)); commands.add(initClassName); + commands.addAll(mainFuncArgs); ProcessBuilder pb = new ProcessBuilder(commands); Lock lock = projectContext.lockAndGet(); From 19f3c2b0a626587d5ab639d4b9007f72dc2729a0 Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Wed, 16 Oct 2024 14:34:43 +0530 Subject: [PATCH 12/42] Add capablity classes to new ls apis --- .../runner/BallerinaRunnerService.java | 3 +- ...lerinaRunnerServiceClientCapabilities.java | 51 +++++++++++++++++++ ...naRunnerServiceClientCapabilitySetter.java | 41 +++++++++++++++ .../BallerinaRunnerServiceConstants.java | 32 ++++++++++++ ...lerinaRunnerServiceServerCapabilities.java | 51 +++++++++++++++++++ ...naRunnerServiceServerCapabilitySetter.java | 51 +++++++++++++++++++ 6 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilities.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceConstants.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilities.java create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java index 11931479586e..726a65070e4f 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java @@ -120,7 +120,8 @@ public CompletableFuture mainFunctionParams(MainFunc for (ModuleMemberDeclarationNode member : modulePartNode.members()) { if (member.kind() == SyntaxKind.FUNCTION_DEFINITION) { FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; - if (functionDefinitionNode.functionName().text().equals("main")) { + if (functionDefinitionNode.functionName().text() + .equals(BallerinaRunnerServiceConstants.MAIN_FUNCTION)) { List params = new ArrayList<>(); functionDefinitionNode.functionSignature().parameters().forEach(param -> { params.add(param.toString()); diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilities.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilities.java new file mode 100644 index 000000000000..f14f63740cc3 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilities.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.ballerinalang.langserver.commons.registration.BallerinaClientCapability; + +/** + * Client capabilities for the ballerina runner service. + * + * @since 2201.11.0 + */ +public class BallerinaRunnerServiceClientCapabilities extends BallerinaClientCapability { + + private boolean diagnostics; + private boolean mainFunctionParams; + + public BallerinaRunnerServiceClientCapabilities() { + super(BallerinaRunnerServiceConstants.CAPABILITY_NAME); + } + + public boolean isDiagnostics() { + return diagnostics; + } + + public void setDiagnostics(boolean diagnostics) { + this.diagnostics = diagnostics; + } + + public boolean isMainFunctionParams() { + return mainFunctionParams; + } + + public void setMainFunctionParams(boolean mainFunctionParams) { + this.mainFunctionParams = mainFunctionParams; + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java new file mode 100644 index 000000000000..45bfc8f46aa4 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.ballerinalang.annotation.JavaSPIService; +import org.ballerinalang.langserver.commons.registration.BallerinaClientCapabilitySetter; + +/** + * Client capability setter for the {@link BallerinaRunnerService}. + * + * @since 2201.11.0 + */ +@JavaSPIService("org.ballerinalang.langserver.commons.registration.BallerinaRunnerServiceClientCapabilitySetter") +public class BallerinaRunnerServiceClientCapabilitySetter extends + BallerinaClientCapabilitySetter { + + @Override + public String getCapabilityName() { + return BallerinaRunnerServiceConstants.CAPABILITY_NAME; + } + + @Override + public Class getCapability() { + return BallerinaRunnerServiceClientCapabilities.class; + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceConstants.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceConstants.java new file mode 100644 index 000000000000..92cbf4742076 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceConstants.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +/** + * Ballerina runner service constants. + * + * @since 2201.11.0 + */ +public class BallerinaRunnerServiceConstants { + + private BallerinaRunnerServiceConstants() { + } + + protected static final String CAPABILITY_NAME = "ballerinaRunner"; + protected static final String MAIN_FUNCTION = "main"; +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilities.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilities.java new file mode 100644 index 000000000000..47e53a0904c8 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilities.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.ballerinalang.langserver.commons.registration.BallerinaServerCapability; + +/** + * Server capabilities for the ballerina runner service. + * + * @since 2201.11.0 + */ +public class BallerinaRunnerServiceServerCapabilities extends BallerinaServerCapability { + + private boolean diagnostics; + private boolean mainFunctionParams; + + public BallerinaRunnerServiceServerCapabilities() { + super(BallerinaRunnerServiceConstants.CAPABILITY_NAME); + } + + public boolean isDiagnostics() { + return diagnostics; + } + + public void setDiagnostics(boolean diagnostics) { + this.diagnostics = diagnostics; + } + + public boolean isMainFunctionParams() { + return mainFunctionParams; + } + + public void setMainFunctionParams(boolean mainFunctionParams) { + this.mainFunctionParams = mainFunctionParams; + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java new file mode 100644 index 000000000000..46aa63f67fd0 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import org.ballerinalang.annotation.JavaSPIService; +import org.ballerinalang.langserver.commons.registration.BallerinaServerCapabilitySetter; + +import java.util.Optional; + +/** + * Server capability setter for the {@link BallerinaRunnerService}. + * + * @since 2201.11.0 + */ +@JavaSPIService("org.ballerinalang.langserver.commons.registration.BallerinaRunnerServiceServerCapabilitySetter") +public class BallerinaRunnerServiceServerCapabilitySetter extends + BallerinaServerCapabilitySetter { + + @Override + public Optional build() { + BallerinaRunnerServiceServerCapabilities capabilities = new BallerinaRunnerServiceServerCapabilities(); + capabilities.setDiagnostics(true); + capabilities.setMainFunctionParams(true); + return Optional.of(capabilities); + } + + @Override + public String getCapabilityName() { + return BallerinaRunnerServiceConstants.CAPABILITY_NAME; + } + + @Override + public Class getCapability() { + return BallerinaRunnerServiceServerCapabilities.class; + } +} From 54d630161f073b6b851e389ceb58c63c88b9e21c Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Fri, 18 Oct 2024 13:25:38 +0530 Subject: [PATCH 13/42] Add tests for diagnostics ls extension ep --- .../diagnostic/DiagnosticsHelper.java | 61 +++++---- .../runner/BallerinaRunnerService.java | 44 +++--- ...naRunnerServiceClientCapabilitySetter.java | 2 +- ...naRunnerServiceServerCapabilitySetter.java | 2 +- .../ballerina/runner/BallerinaRunnerUtil.java | 56 ++++++++ .../runner/ProjectDiagnosticsResponse.java | 10 +- .../langserver/util/TestUtil.java | 16 +++ .../langserver/runner/DiagnosticsTest.java | 129 ++++++++++++++++++ .../runner/diagnostics/config/project1.json | 45 ++++++ .../source/project1/Ballerina.toml | 4 + .../diagnostics/source/project1/another.bal | 7 + .../diagnostics/source/project1/sample.bal | 5 + .../resources/runner/diagnostics/source/so | 0 .../src/test/resources/testng.xml | 1 + 14 files changed, 331 insertions(+), 51 deletions(-) create mode 100644 language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java create mode 100644 language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/DiagnosticsTest.java create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/diagnostics/config/project1.json create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/Ballerina.toml create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/another.bal create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/sample.bal create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/so diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/diagnostic/DiagnosticsHelper.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/diagnostic/DiagnosticsHelper.java index 50e7f50e07fe..5b00e236def0 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/diagnostic/DiagnosticsHelper.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/diagnostic/DiagnosticsHelper.java @@ -205,34 +205,7 @@ private Map> toDiagnosticsMap(Collection compileAndSendDiagnostics(client, projectRoot, pkgCompilation, workspaceManager))); } + + public static Diagnostic getLSDiagnosticsFromCompilationDiagnostics( + LineRange lineRange, io.ballerina.tools.diagnostics.Diagnostic diag) { + int startLine = lineRange.startLine().line(); + int startChar = lineRange.startLine().offset(); + int endLine = lineRange.endLine().line(); + int endChar = lineRange.endLine().offset(); + + endLine = (endLine <= 0) ? startLine : endLine; + endChar = (endChar <= 0) ? startChar + 1 : endChar; + + Range range = new Range(new Position(startLine, startChar), new Position(endLine, endChar)); + Diagnostic diagnostic = new Diagnostic(range, diag.message(), null, null, diag.diagnosticInfo().code()); + + switch (diag.diagnosticInfo().severity()) { + case ERROR: + diagnostic.setSeverity(DiagnosticSeverity.Error); + break; + case WARNING: + diagnostic.setSeverity(DiagnosticSeverity.Warning); + break; + case HINT: + diagnostic.setSeverity(DiagnosticSeverity.Hint); + break; + case INFO: + diagnostic.setSeverity(DiagnosticSeverity.Information); + break; + default: + break; + } + return diagnostic; + } } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java index 726a65070e4f..bff22c35b6de 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java @@ -27,6 +27,7 @@ import io.ballerina.projects.Package; import io.ballerina.projects.Project; import org.ballerinalang.annotation.JavaSPIService; +import org.ballerinalang.langserver.LSClientLogger; import org.ballerinalang.langserver.LSContextOperation; import org.ballerinalang.langserver.common.utils.PathUtil; import org.ballerinalang.langserver.commons.DocumentServiceContext; @@ -35,13 +36,16 @@ import org.ballerinalang.langserver.commons.workspace.WorkspaceManager; import org.ballerinalang.langserver.contexts.ContextBuilder; import org.ballerinalang.langserver.diagnostic.DiagnosticsHelper; +import org.ballerinalang.langserver.extensions.ballerina.packages.PackageContext; import org.eclipse.lsp4j.Diagnostic; +import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; import org.eclipse.lsp4j.jsonrpc.services.JsonSegment; import org.eclipse.lsp4j.services.LanguageServer; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; @@ -52,18 +56,20 @@ * * @since 2201.11.0 */ -@JavaSPIService("org.ballerinalang.langserver.commons.service.spi.BallerinaRunnerService") +@JavaSPIService("org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService") @JsonSegment("ballerinaRunner") public class BallerinaRunnerService implements ExtendedLanguageServerService { private WorkspaceManager workspaceManager; private LanguageServerContext serverContext; + private LSClientLogger clientLogger; @Override public void init(LanguageServer langServer, WorkspaceManager workspaceManager, LanguageServerContext serverContext) { this.workspaceManager = workspaceManager; this.serverContext = serverContext; + this.clientLogger = LSClientLogger.getInstance(serverContext); } /** @@ -75,23 +81,29 @@ public void init(LanguageServer langServer, WorkspaceManager workspaceManager, @JsonRequest public CompletableFuture diagnostics(ProjectDiagnosticsRequest request) { return CompletableFuture.supplyAsync(() -> { - ProjectDiagnosticsResponse projectDiagnosticsResponse = new ProjectDiagnosticsResponse(); - Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); - if (filePath.isEmpty()) { - return projectDiagnosticsResponse; - } - Optional project = this.workspaceManager.project(filePath.get()); - if (project.isEmpty()) { + try { + ProjectDiagnosticsResponse projectDiagnosticsResponse = new ProjectDiagnosticsResponse(); + Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); + if (filePath.isEmpty()) { + return projectDiagnosticsResponse; + } + Optional projectOptional = this.workspaceManager.project(filePath.get()); + Project project; + if (projectOptional.isEmpty()) { + project = this.workspaceManager.loadProject(filePath.get()); + } else { + project = projectOptional.get(); + } + Map> errorDiagnosticMap = + BallerinaRunnerUtil.getErrorDiagnosticMap(this.workspaceManager, project, filePath.get()); + projectDiagnosticsResponse.setErrorDiagnosticMap(errorDiagnosticMap); return projectDiagnosticsResponse; + } catch (Throwable e) { + String msg = "Operation 'ballerinaRunner/diagnostics' failed!"; + this.clientLogger.logError(PackageContext.PACKAGE_METADATA, msg, e, request.getProjectRootIdentifier(), + (Position) null); } - DocumentServiceContext context = ContextBuilder.buildDocumentServiceContext(filePath.get().toString(), - this.workspaceManager, - LSContextOperation.DOC_DIAGNOSTICS, - this.serverContext); - Map> latestDiagnostics = DiagnosticsHelper.getInstance(this.serverContext) - .getLatestDiagnostics(context); - projectDiagnosticsResponse.setDiagnostics(latestDiagnostics); - return projectDiagnosticsResponse; + return new ProjectDiagnosticsResponse(); }); } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java index 45bfc8f46aa4..cd672780c44b 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceClientCapabilitySetter.java @@ -25,7 +25,7 @@ * * @since 2201.11.0 */ -@JavaSPIService("org.ballerinalang.langserver.commons.registration.BallerinaRunnerServiceClientCapabilitySetter") +@JavaSPIService("org.ballerinalang.langserver.commons.registration.BallerinaClientCapabilitySetter") public class BallerinaRunnerServiceClientCapabilitySetter extends BallerinaClientCapabilitySetter { diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java index 46aa63f67fd0..8b1ec2784766 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerServiceServerCapabilitySetter.java @@ -27,7 +27,7 @@ * * @since 2201.11.0 */ -@JavaSPIService("org.ballerinalang.langserver.commons.registration.BallerinaRunnerServiceServerCapabilitySetter") +@JavaSPIService("org.ballerinalang.langserver.commons.registration.BallerinaServerCapabilitySetter") public class BallerinaRunnerServiceServerCapabilitySetter extends BallerinaServerCapabilitySetter { diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java new file mode 100644 index 000000000000..7c72ebdf5d57 --- /dev/null +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.extensions.ballerina.runner; + +import io.ballerina.projects.Project; +import io.ballerina.tools.text.LineRange; +import org.ballerinalang.langserver.common.utils.PathUtil; +import org.ballerinalang.langserver.commons.workspace.WorkspaceManager; +import org.ballerinalang.langserver.diagnostic.DiagnosticsHelper; +import org.eclipse.lsp4j.Diagnostic; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Ballerina Runner Util. + * + * @since 2201.11.0 + */ +public class BallerinaRunnerUtil { + + public static Map> getErrorDiagnosticMap(WorkspaceManager workspaceManager, + Project project, Path projectRoot) { + Collection diagnostics = project.currentPackage() + .getCompilation().diagnosticResult().errors(); + Map> diagnosticsMap = new HashMap<>(); + for (io.ballerina.tools.diagnostics.Diagnostic diag :diagnostics) { + LineRange lineRange = diag.location().lineRange(); + Diagnostic result = DiagnosticsHelper.getLSDiagnosticsFromCompilationDiagnostics(lineRange, diag); + String resolvedUri = projectRoot.resolve(lineRange.fileName()).toUri().toString(); + String fileURI = PathUtil.getModifiedUri(workspaceManager, resolvedUri); + List clientDiagnostics = diagnosticsMap.computeIfAbsent(fileURI, s -> new ArrayList<>()); + clientDiagnostics.add(result); + } + return diagnosticsMap; + } +} diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java index f82075538407..99a600256440 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/ProjectDiagnosticsResponse.java @@ -29,13 +29,13 @@ */ public class ProjectDiagnosticsResponse { - private Map> diagnostics; + private Map> errorDiagnosticMap; - public Map> getDiagnostics() { - return diagnostics; + public Map> getErrorDiagnosticMap() { + return errorDiagnosticMap; } - public void setDiagnostics(Map> diagnostics) { - this.diagnostics = diagnostics; + public void setErrorDiagnosticMap(Map> errorDiagnosticMap) { + this.errorDiagnosticMap = errorDiagnosticMap; } } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java index d868abc6820b..5c6de72034fe 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java @@ -38,6 +38,7 @@ import org.ballerinalang.langserver.extensions.ballerina.packages.PackageComponentsRequest; import org.ballerinalang.langserver.extensions.ballerina.packages.PackageConfigSchemaRequest; import org.ballerinalang.langserver.extensions.ballerina.packages.PackageMetadataRequest; +import org.ballerinalang.langserver.extensions.ballerina.runner.ProjectDiagnosticsRequest; import org.eclipse.lsp4j.ClientCapabilities; import org.eclipse.lsp4j.CodeActionCapabilities; import org.eclipse.lsp4j.CodeActionContext; @@ -165,6 +166,8 @@ public class TestUtil { private static final String SEMANTIC_TOKENS_FULL = "textDocument/semanticTokens/full"; + private static final String RUNNER_DIAGNOSTICS = "ballerinaRunner/diagnostics"; + private static final Gson GSON = new Gson(); private TestUtil() { @@ -462,6 +465,19 @@ public static String getPackageComponentsResponse(Endpoint serviceEndpoint, Iter return getResponseString(serviceEndpoint.request(PACKAGE_COMPONENTS, packageComponentsRequest)); } + /** + * Get runner service's diagnostics response. + * + * @param serviceEndpoint Language Server Service endpoint + * @param projectDir root directory of the project + * @return {@link String} Runner diagnostics response + */ + public static String getRunnerDiagnosticsResponse(Endpoint serviceEndpoint, String projectDir) { + ProjectDiagnosticsRequest projectDiagnosticsRequest = new ProjectDiagnosticsRequest(); + projectDiagnosticsRequest.setDocumentIdentifier(getTextDocumentIdentifier(projectDir)); + return getResponseString(serviceEndpoint.request(RUNNER_DIAGNOSTICS, projectDiagnosticsRequest)); + } + /** * Get package service's config schema response. * diff --git a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/DiagnosticsTest.java b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/DiagnosticsTest.java new file mode 100644 index 000000000000..ad2fc690d803 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/DiagnosticsTest.java @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.runner; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.ballerinalang.langserver.util.FileUtils; +import org.ballerinalang.langserver.util.TestUtil; +import org.eclipse.lsp4j.jsonrpc.Endpoint; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Map; + +/** + * Tests {@link org.ballerinalang.langserver.extensions.ballerina.runner.BallerinaRunnerService} diagnostics api. + * + * @since 2201.11.0 + */ +public class DiagnosticsTest { + + private Path resourceRoot; + private Endpoint serviceEndpoint; + + @BeforeClass + public void init() { + this.resourceRoot = FileUtils.RES_DIR.resolve("runner").resolve("diagnostics"); + this.serviceEndpoint = TestUtil.initializeLanguageSever(); + } + + @Test(description = "Test getting all diagnostics in a package", dataProvider = "data-provider") + public void testDiagnosticsInPackage(String projectDir, String expected) throws IOException { + Path sourceRoot = this.resourceRoot.resolve("source"); + JsonObject expectedObj = FileUtils.fileContentAsObject(this.resourceRoot.resolve("config") + .resolve(expected).toString()); + + Path projectPath = this.resourceRoot.resolve("source").resolve(projectDir); + String response = TestUtil.getRunnerDiagnosticsResponse(this.serviceEndpoint, projectPath.toString()); + JsonObject actualJson = getResponseJson(response); + + JsonObject actualErrorDiagnosticMap = alterActualErrorMapPaths(actualJson.get("result") + .getAsJsonObject().get("errorDiagnosticMap").getAsJsonObject()); + JsonObject expectedErrorDiagnosticMap = alterErrorMapPaths(expectedObj.getAsJsonObject("result") + .getAsJsonObject("errorDiagnosticMap"), sourceRoot); + + compareResponse(actualErrorDiagnosticMap, expectedErrorDiagnosticMap); + } + + private void compareResponse(JsonObject actualMap, JsonObject expectedMap) { + for (Map.Entry entry : expectedMap.entrySet()) { + String key = entry.getKey(); + JsonArray expectedDiagnostics = entry.getValue().getAsJsonArray(); + if (!actualMap.has(key)) { + Assert.fail("Expected errors not found in file: " + key); + } + JsonArray actualDiagnostics = actualMap.getAsJsonArray(key); + Assert.assertEquals(actualDiagnostics, expectedDiagnostics); + } + } + + protected JsonObject alterErrorMapPaths(JsonObject errMap, Path root) throws IOException { + JsonObject newErrMap = new JsonObject(); + for (Map.Entry entry : errMap.entrySet()) { + String key = entry.getKey(); + JsonArray diagnostics = entry.getValue().getAsJsonArray(); + String[] uriComponents = key.replace("\"", "").split("/"); + Path expectedPath = Paths.get(root.toUri()); + for (String uriComponent : uriComponents) { + expectedPath = expectedPath.resolve(uriComponent); + } + newErrMap.add(expectedPath.toFile().getCanonicalPath(), diagnostics); + } + return newErrMap; + } + + protected JsonObject alterActualErrorMapPaths(JsonObject errMap) throws IOException { + JsonObject newErrMap = new JsonObject(); + for (Map.Entry entry : errMap.entrySet()) { + String key = entry.getKey(); + JsonArray diagnostics = entry.getValue().getAsJsonArray(); + String uri = key.replace("\"", ""); + newErrMap.add(new File(URI.create(uri)).getCanonicalPath(), diagnostics); + } + return newErrMap; + } + + @DataProvider(name = "data-provider") + public Object[][] getDataProvider() { + return new Object[][]{ + {"project1", "project1.json"} + }; + } + + @AfterClass + public void cleanupLanguageServer() { + TestUtil.shutdownLanguageServer(this.serviceEndpoint); + } + + private JsonObject getResponseJson(String response) { + JsonObject responseJson = JsonParser.parseString(response).getAsJsonObject(); + responseJson.remove("id"); + return responseJson; + } +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/config/project1.json b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/config/project1.json new file mode 100644 index 000000000000..26c6b146e595 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/config/project1.json @@ -0,0 +1,45 @@ +{ + "sourceRoot": "project1", + "result": { + "errorDiagnosticMap": { + "project1/sample.bal": [ + { + "range": { + "start": { + "line": 0, + "character": 8 + }, + "end": { + "line": 0, + "character": 17 + } + }, + "severity": "Error", + "code": { + "left": "BCE2066" + }, + "message": "incompatible types: expected 'int', found 'string'" + } + ], + "project1/another.bal": [ + { + "range": { + "start": { + "line": 5, + "character": 9 + }, + "end": { + "line": 5, + "character": 10 + } + }, + "severity": "Error", + "code": { + "left": "BCE2066" + }, + "message": "incompatible types: expected 'string', found 'int'" + } + ] + } + } +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/Ballerina.toml b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/Ballerina.toml new file mode 100644 index 000000000000..8f1512a11c65 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/Ballerina.toml @@ -0,0 +1,4 @@ +[package] +org = "wso2" +name = "project" +version = "0.1.0" \ No newline at end of file diff --git a/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/another.bal b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/another.bal new file mode 100644 index 000000000000..30380533be38 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/another.bal @@ -0,0 +1,7 @@ +function foo() returns string { + return "foo"; +} + +function bar() returns string { + return 1; +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/sample.bal b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/sample.bal new file mode 100644 index 000000000000..d41ea690964f --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/project1/sample.bal @@ -0,0 +1,5 @@ +int a = "invalid"; + +public function main() { + int unused = 0; +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/so b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/so new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/language-server/modules/langserver-core/src/test/resources/testng.xml b/language-server/modules/langserver-core/src/test/resources/testng.xml index 91e31f1637cd..b0f6d2ee1bf3 100644 --- a/language-server/modules/langserver-core/src/test/resources/testng.xml +++ b/language-server/modules/langserver-core/src/test/resources/testng.xml @@ -44,6 +44,7 @@ under the License. + From 108135fbb97269f5506b5c1511a5ed01c317b1ad Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Fri, 18 Oct 2024 14:07:54 +0530 Subject: [PATCH 14/42] Add tests for mainFuncParams ls extension ep --- .../runner/BallerinaRunnerService.java | 75 +++++++++++------ .../ballerina/runner/BallerinaRunnerUtil.java | 19 +++++ .../langserver/util/TestUtil.java | 15 ++++ .../runner/MainFunctionParamsTest.java | 82 +++++++++++++++++++ .../resources/runner/diagnostics/source/so | 0 .../runner/mainFuncArgs/config/project1.json | 11 +++ .../source/project1/Ballerina.toml | 4 + .../mainFuncArgs/source/project1/sample.bal | 3 + 8 files changed, 185 insertions(+), 24 deletions(-) create mode 100644 language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java delete mode 100644 language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/so create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/Ballerina.toml create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/sample.bal diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java index bff22c35b6de..cf08a7762652 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java @@ -31,6 +31,7 @@ import org.ballerinalang.langserver.LSContextOperation; import org.ballerinalang.langserver.common.utils.PathUtil; import org.ballerinalang.langserver.commons.DocumentServiceContext; +import org.ballerinalang.langserver.commons.LSOperation; import org.ballerinalang.langserver.commons.LanguageServerContext; import org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService; import org.ballerinalang.langserver.commons.workspace.WorkspaceManager; @@ -100,7 +101,7 @@ public CompletableFuture diagnostics(ProjectDiagnost return projectDiagnosticsResponse; } catch (Throwable e) { String msg = "Operation 'ballerinaRunner/diagnostics' failed!"; - this.clientLogger.logError(PackageContext.PACKAGE_METADATA, msg, e, request.getProjectRootIdentifier(), + this.clientLogger.logError(RunnerContext.RUNNER_DIAGNOSTICS, msg, e, request.getProjectRootIdentifier(), (Position) null); } return new ProjectDiagnosticsResponse(); @@ -116,33 +117,42 @@ public CompletableFuture diagnostics(ProjectDiagnost @JsonRequest public CompletableFuture mainFunctionParams(MainFunctionParamsRequest request) { return CompletableFuture.supplyAsync(() -> { - Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); - if (filePath.isEmpty()) { - return new MainFunctionParamsResponse(false, null); - } - Optional project = this.workspaceManager.project(filePath.get()); - if (project.isEmpty()) { - return new MainFunctionParamsResponse(false, null); - } - Package currentPackage = project.get().currentPackage(); - for (DocumentId documentId : currentPackage.getDefaultModule().documentIds()) { - Document document = currentPackage.getDefaultModule().document(documentId); - Node node = document.syntaxTree().rootNode(); - if (node instanceof ModulePartNode modulePartNode) { - for (ModuleMemberDeclarationNode member : modulePartNode.members()) { - if (member.kind() == SyntaxKind.FUNCTION_DEFINITION) { - FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; - if (functionDefinitionNode.functionName().text() - .equals(BallerinaRunnerServiceConstants.MAIN_FUNCTION)) { - List params = new ArrayList<>(); - functionDefinitionNode.functionSignature().parameters().forEach(param -> { - params.add(param.toString()); - }); - return new MainFunctionParamsResponse(true, params); + try { + Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); + if (filePath.isEmpty()) { + return new MainFunctionParamsResponse(false, null); + } + Optional projectOptional = this.workspaceManager.project(filePath.get()); + Project project; + if (projectOptional.isEmpty()) { + project = this.workspaceManager.loadProject(filePath.get()); + } else { + project = projectOptional.get(); + } + Package currentPackage = project.currentPackage(); + for (DocumentId documentId : currentPackage.getDefaultModule().documentIds()) { + Document document = currentPackage.getDefaultModule().document(documentId); + Node node = document.syntaxTree().rootNode(); + if (node instanceof ModulePartNode modulePartNode) { + for (ModuleMemberDeclarationNode member : modulePartNode.members()) { + if (member.kind() == SyntaxKind.FUNCTION_DEFINITION) { + FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; + if (functionDefinitionNode.functionName().text() + .equals(BallerinaRunnerServiceConstants.MAIN_FUNCTION)) { + List params = new ArrayList<>(); + functionDefinitionNode.functionSignature().parameters().forEach(param -> { + params.add(BallerinaRunnerUtil.extractParamName(param)); + }); + return new MainFunctionParamsResponse(true, params); + } } } } } + } catch (Throwable e) { + String msg = "Operation 'ballerinaRunner/mainFunctionParams' failed!"; + this.clientLogger.logError(RunnerContext.RUNNER_MAIN_FUNCTION_PARAMS, msg, e, + request.getProjectRootIdentifier(), (Position) null); } return new MainFunctionParamsResponse(false, null); }); @@ -155,4 +165,21 @@ public Class getRemoteInterface() { public record MainFunctionParamsResponse(boolean hasMain, List params) { } + + private enum RunnerContext implements LSOperation { + RUNNER_DIAGNOSTICS("ballerinaRunner/diagnostics"), + RUNNER_MAIN_FUNCTION_PARAMS("ballerinaRunner/mainFunctionParams"); + + private final String name; + + RunnerContext(String name) { + this.name = name; + } + + @Override + public String getName() { + return this.name; + } + } + } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java index 7c72ebdf5d57..49f124b42f4f 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java @@ -17,6 +17,11 @@ */ package org.ballerinalang.langserver.extensions.ballerina.runner; +import io.ballerina.compiler.syntax.tree.DefaultableParameterNode; +import io.ballerina.compiler.syntax.tree.IncludedRecordParameterNode; +import io.ballerina.compiler.syntax.tree.ParameterNode; +import io.ballerina.compiler.syntax.tree.RequiredParameterNode; +import io.ballerina.compiler.syntax.tree.RestParameterNode; import io.ballerina.projects.Project; import io.ballerina.tools.text.LineRange; import org.ballerinalang.langserver.common.utils.PathUtil; @@ -30,6 +35,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; /** * Ballerina Runner Util. @@ -53,4 +59,17 @@ public static Map> getErrorDiagnosticMap(WorkspaceManag } return diagnosticsMap; } + + public static String extractParamName(ParameterNode param) { + return switch (param.kind()) { + case DEFAULTABLE_PARAM -> Objects.requireNonNull((( + DefaultableParameterNode) param).paramName().orElse(null)).text(); + case REST_PARAM -> Objects.requireNonNull( + ((RestParameterNode) param).paramName().orElse(null)).text(); + case INCLUDED_RECORD_PARAM -> Objects.requireNonNull( + ((IncludedRecordParameterNode) param).paramName().orElse(null)).text(); + default -> Objects.requireNonNull( + ((RequiredParameterNode) param).paramName().orElse(null)).text(); + }; + } } diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java index 5c6de72034fe..86a869c3065a 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/util/TestUtil.java @@ -38,6 +38,7 @@ import org.ballerinalang.langserver.extensions.ballerina.packages.PackageComponentsRequest; import org.ballerinalang.langserver.extensions.ballerina.packages.PackageConfigSchemaRequest; import org.ballerinalang.langserver.extensions.ballerina.packages.PackageMetadataRequest; +import org.ballerinalang.langserver.extensions.ballerina.runner.MainFunctionParamsRequest; import org.ballerinalang.langserver.extensions.ballerina.runner.ProjectDiagnosticsRequest; import org.eclipse.lsp4j.ClientCapabilities; import org.eclipse.lsp4j.CodeActionCapabilities; @@ -167,6 +168,7 @@ public class TestUtil { private static final String SEMANTIC_TOKENS_FULL = "textDocument/semanticTokens/full"; private static final String RUNNER_DIAGNOSTICS = "ballerinaRunner/diagnostics"; + private static final String RUNNER_MAIN_FUNC_PARAMS = "ballerinaRunner/mainFunctionParams"; private static final Gson GSON = new Gson(); @@ -478,6 +480,19 @@ public static String getRunnerDiagnosticsResponse(Endpoint serviceEndpoint, Stri return getResponseString(serviceEndpoint.request(RUNNER_DIAGNOSTICS, projectDiagnosticsRequest)); } + /** + * Get runner service's main function params response. + * + * @param serviceEndpoint Language Server Service endpoint + * @param projectDir root directory of the project + * @return {@link String} Runner diagnostics response + */ + public static String getRunnerMainFuncParamsResponse(Endpoint serviceEndpoint, String projectDir) { + MainFunctionParamsRequest mainFunctionParamsRequest = new MainFunctionParamsRequest(); + mainFunctionParamsRequest.setDocumentIdentifier(getTextDocumentIdentifier(projectDir)); + return getResponseString(serviceEndpoint.request(RUNNER_MAIN_FUNC_PARAMS, mainFunctionParamsRequest)); + } + /** * Get package service's config schema response. * diff --git a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java new file mode 100644 index 000000000000..1a0279169695 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com). + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ballerinalang.langserver.runner; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import org.ballerinalang.langserver.util.FileUtils; +import org.ballerinalang.langserver.util.TestUtil; +import org.eclipse.lsp4j.jsonrpc.Endpoint; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.Map; + +/** + * Tests {@link org.ballerinalang.langserver.extensions.ballerina.runner.BallerinaRunnerService} mainFunctionParams api. + * + * @since 2201.11.0 + */ +public class MainFunctionParamsTest { + + private Path resourceRoot; + private Endpoint serviceEndpoint; + + @BeforeClass + public void init() { + this.resourceRoot = FileUtils.RES_DIR.resolve("runner").resolve("mainFuncArgs"); + this.serviceEndpoint = TestUtil.initializeLanguageSever(); + } + + @Test(description = "Test main function params in a project", dataProvider = "data-provider") + public void testDiagnosticsInPackage(String projectDir, String expected) { + JsonObject expectedObj = FileUtils.fileContentAsObject(this.resourceRoot.resolve("config") + .resolve(expected).toString()); + + Path projectPath = this.resourceRoot.resolve("source").resolve(projectDir); + String response = TestUtil.getRunnerMainFuncParamsResponse(this.serviceEndpoint, projectPath.toString()); + JsonObject actualJson = getResponseJson(response); + Assert.assertEquals(actualJson.get("result").getAsJsonObject(), + expectedObj.getAsJsonObject("result").getAsJsonObject()); + } + + @DataProvider(name = "data-provider") + public Object[][] getDataProvider() { + return new Object[][]{ + {"project1", "project1.json"} + }; + } + + @AfterClass + public void cleanupLanguageServer() { + TestUtil.shutdownLanguageServer(this.serviceEndpoint); + } + + private JsonObject getResponseJson(String response) { + JsonObject responseJson = JsonParser.parseString(response).getAsJsonObject(); + responseJson.remove("id"); + return responseJson; + } +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/so b/language-server/modules/langserver-core/src/test/resources/runner/diagnostics/source/so deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json new file mode 100644 index 000000000000..8d4ffef78e97 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json @@ -0,0 +1,11 @@ +{ + "sourceRoot": "project1", + "result": { + "hasMain": true, + "params": [ + "host", + "port", + "rest" + ] + } +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/Ballerina.toml b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/Ballerina.toml new file mode 100644 index 000000000000..4106b646d782 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/Ballerina.toml @@ -0,0 +1,4 @@ +[package] +org = "wso2" +name = "project1" +version = "0.1.0" diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/sample.bal b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/sample.bal new file mode 100644 index 000000000000..de1128b3a19a --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project1/sample.bal @@ -0,0 +1,3 @@ +public function main(string host, int port, string... rest) { + +} From 04a1bea8d5d026a43e7d3c08461d81279ed3a45f Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Fri, 18 Oct 2024 16:47:58 +0530 Subject: [PATCH 15/42] Support mainFuncParams api for rest params --- .../runner/BallerinaRunnerService.java | 34 ++++++++------- .../ballerina/runner/BallerinaRunnerUtil.java | 42 ++++++++++++++----- .../runner/MainFunctionParamsTest.java | 4 -- 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java index cf08a7762652..d848e54e9e12 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java @@ -21,6 +21,7 @@ import io.ballerina.compiler.syntax.tree.ModuleMemberDeclarationNode; import io.ballerina.compiler.syntax.tree.ModulePartNode; import io.ballerina.compiler.syntax.tree.Node; +import io.ballerina.compiler.syntax.tree.ParameterNode; import io.ballerina.compiler.syntax.tree.SyntaxKind; import io.ballerina.projects.Document; import io.ballerina.projects.DocumentId; @@ -28,16 +29,11 @@ import io.ballerina.projects.Project; import org.ballerinalang.annotation.JavaSPIService; import org.ballerinalang.langserver.LSClientLogger; -import org.ballerinalang.langserver.LSContextOperation; import org.ballerinalang.langserver.common.utils.PathUtil; -import org.ballerinalang.langserver.commons.DocumentServiceContext; import org.ballerinalang.langserver.commons.LSOperation; import org.ballerinalang.langserver.commons.LanguageServerContext; import org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService; import org.ballerinalang.langserver.commons.workspace.WorkspaceManager; -import org.ballerinalang.langserver.contexts.ContextBuilder; -import org.ballerinalang.langserver.diagnostic.DiagnosticsHelper; -import org.ballerinalang.langserver.extensions.ballerina.packages.PackageContext; import org.eclipse.lsp4j.Diagnostic; import org.eclipse.lsp4j.Position; import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; @@ -46,7 +42,6 @@ import java.nio.file.Path; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Optional; @@ -62,14 +57,12 @@ public class BallerinaRunnerService implements ExtendedLanguageServerService { private WorkspaceManager workspaceManager; - private LanguageServerContext serverContext; private LSClientLogger clientLogger; @Override public void init(LanguageServer langServer, WorkspaceManager workspaceManager, LanguageServerContext serverContext) { this.workspaceManager = workspaceManager; - this.serverContext = serverContext; this.clientLogger = LSClientLogger.getInstance(serverContext); } @@ -120,7 +113,7 @@ public CompletableFuture mainFunctionParams(MainFunc try { Optional filePath = PathUtil.getPathFromURI(request.getProjectRootIdentifier().getUri()); if (filePath.isEmpty()) { - return new MainFunctionParamsResponse(false, null); + return new MainFunctionParamsResponse(false, null, null); } Optional projectOptional = this.workspaceManager.project(filePath.get()); Project project; @@ -139,11 +132,16 @@ public CompletableFuture mainFunctionParams(MainFunc FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; if (functionDefinitionNode.functionName().text() .equals(BallerinaRunnerServiceConstants.MAIN_FUNCTION)) { - List params = new ArrayList<>(); - functionDefinitionNode.functionSignature().parameters().forEach(param -> { - params.add(BallerinaRunnerUtil.extractParamName(param)); - }); - return new MainFunctionParamsResponse(true, params); + List params = new ArrayList<>(); + for (ParameterNode param:functionDefinitionNode.functionSignature().parameters()) { + if (param.kind() == SyntaxKind.REST_PARAM) { + return new MainFunctionParamsResponse(true, params, + BallerinaRunnerUtil.extractParamDetails(param)); + } else { + params.add(BallerinaRunnerUtil.extractParamDetails(param)); + } + } + return new MainFunctionParamsResponse(true, params, null); } } } @@ -154,7 +152,7 @@ public CompletableFuture mainFunctionParams(MainFunc this.clientLogger.logError(RunnerContext.RUNNER_MAIN_FUNCTION_PARAMS, msg, e, request.getProjectRootIdentifier(), (Position) null); } - return new MainFunctionParamsResponse(false, null); + return new MainFunctionParamsResponse(false, null, null); }); } @@ -163,7 +161,11 @@ public Class getRemoteInterface() { return getClass(); } - public record MainFunctionParamsResponse(boolean hasMain, List params) { + public record MainFunctionParamsResponse(boolean hasMain, List params, + TypeBindingPair restParams) { + } + + public record TypeBindingPair(String type, String paramName, String defaultValue) { } private enum RunnerContext implements LSOperation { diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java index 49f124b42f4f..d1d834e6e14e 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java @@ -60,16 +60,36 @@ public static Map> getErrorDiagnosticMap(WorkspaceManag return diagnosticsMap; } - public static String extractParamName(ParameterNode param) { - return switch (param.kind()) { - case DEFAULTABLE_PARAM -> Objects.requireNonNull((( - DefaultableParameterNode) param).paramName().orElse(null)).text(); - case REST_PARAM -> Objects.requireNonNull( - ((RestParameterNode) param).paramName().orElse(null)).text(); - case INCLUDED_RECORD_PARAM -> Objects.requireNonNull( - ((IncludedRecordParameterNode) param).paramName().orElse(null)).text(); - default -> Objects.requireNonNull( - ((RequiredParameterNode) param).paramName().orElse(null)).text(); - }; + public static BallerinaRunnerService.TypeBindingPair extractParamDetails(ParameterNode param) { + switch (param.kind()) { + case DEFAULTABLE_PARAM -> { + DefaultableParameterNode defaultableParam = (DefaultableParameterNode) param; + return new BallerinaRunnerService.TypeBindingPair( + defaultableParam.typeName().toString(), + Objects.requireNonNull(defaultableParam.paramName().orElse(null)).text(), + defaultableParam.expression().toString()); + } + case REST_PARAM -> { + RestParameterNode restParam = (RestParameterNode) param; + return new BallerinaRunnerService.TypeBindingPair( + restParam.typeName().toString(), + Objects.requireNonNull(restParam.paramName().orElse(null)).text(), + null); + } + case INCLUDED_RECORD_PARAM -> { + IncludedRecordParameterNode includedRecordParam = (IncludedRecordParameterNode) param; + return new BallerinaRunnerService.TypeBindingPair( + includedRecordParam.typeName().toString(), + Objects.requireNonNull(includedRecordParam.paramName().orElse(null)).text(), + null); + } + default -> { + RequiredParameterNode requiredParam = (RequiredParameterNode) param; + return new BallerinaRunnerService.TypeBindingPair( + requiredParam.typeName().toString(), + Objects.requireNonNull(requiredParam.paramName().orElse(null)).text(), + null); + } + } } } diff --git a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java index 1a0279169695..3c9286668b72 100644 --- a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java +++ b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java @@ -17,8 +17,6 @@ */ package org.ballerinalang.langserver.runner; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import org.ballerinalang.langserver.util.FileUtils; @@ -30,9 +28,7 @@ import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import java.io.IOException; import java.nio.file.Path; -import java.util.Map; /** * Tests {@link org.ballerinalang.langserver.extensions.ballerina.runner.BallerinaRunnerService} mainFunctionParams api. From 42769af86ab0fed2fbdf08b4079a15e97ff658ab Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Fri, 18 Oct 2024 16:56:52 +0530 Subject: [PATCH 16/42] Add tests --- .../ballerina/runner/BallerinaRunnerUtil.java | 10 +++++----- .../runner/MainFunctionParamsTest.java | 3 ++- .../runner/mainFuncArgs/config/project1.json | 17 +++++++++++++---- .../runner/mainFuncArgs/config/project2.json | 17 +++++++++++++++++ .../mainFuncArgs/source/project2/Ballerina.toml | 4 ++++ .../mainFuncArgs/source/project2/sample.bal | 3 +++ 6 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project2.json create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/Ballerina.toml create mode 100644 language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/sample.bal diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java index d1d834e6e14e..f1288001a1a6 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerUtil.java @@ -49,7 +49,7 @@ public static Map> getErrorDiagnosticMap(WorkspaceManag Collection diagnostics = project.currentPackage() .getCompilation().diagnosticResult().errors(); Map> diagnosticsMap = new HashMap<>(); - for (io.ballerina.tools.diagnostics.Diagnostic diag :diagnostics) { + for (io.ballerina.tools.diagnostics.Diagnostic diag : diagnostics) { LineRange lineRange = diag.location().lineRange(); Diagnostic result = DiagnosticsHelper.getLSDiagnosticsFromCompilationDiagnostics(lineRange, diag); String resolvedUri = projectRoot.resolve(lineRange.fileName()).toUri().toString(); @@ -65,28 +65,28 @@ public static BallerinaRunnerService.TypeBindingPair extractParamDetails(Paramet case DEFAULTABLE_PARAM -> { DefaultableParameterNode defaultableParam = (DefaultableParameterNode) param; return new BallerinaRunnerService.TypeBindingPair( - defaultableParam.typeName().toString(), + defaultableParam.typeName().toString().strip(), Objects.requireNonNull(defaultableParam.paramName().orElse(null)).text(), defaultableParam.expression().toString()); } case REST_PARAM -> { RestParameterNode restParam = (RestParameterNode) param; return new BallerinaRunnerService.TypeBindingPair( - restParam.typeName().toString(), + restParam.typeName().toString().strip(), Objects.requireNonNull(restParam.paramName().orElse(null)).text(), null); } case INCLUDED_RECORD_PARAM -> { IncludedRecordParameterNode includedRecordParam = (IncludedRecordParameterNode) param; return new BallerinaRunnerService.TypeBindingPair( - includedRecordParam.typeName().toString(), + includedRecordParam.typeName().toString().strip(), Objects.requireNonNull(includedRecordParam.paramName().orElse(null)).text(), null); } default -> { RequiredParameterNode requiredParam = (RequiredParameterNode) param; return new BallerinaRunnerService.TypeBindingPair( - requiredParam.typeName().toString(), + requiredParam.typeName().toString().strip(), Objects.requireNonNull(requiredParam.paramName().orElse(null)).text(), null); } diff --git a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java index 3c9286668b72..2363d2e0d524 100644 --- a/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java +++ b/language-server/modules/langserver-core/src/test/java/org/ballerinalang/langserver/runner/MainFunctionParamsTest.java @@ -61,7 +61,8 @@ public void testDiagnosticsInPackage(String projectDir, String expected) { @DataProvider(name = "data-provider") public Object[][] getDataProvider() { return new Object[][]{ - {"project1", "project1.json"} + {"project1", "project1.json"}, + {"project2", "project2.json"} }; } diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json index 8d4ffef78e97..efa69c7c0f77 100644 --- a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project1.json @@ -3,9 +3,18 @@ "result": { "hasMain": true, "params": [ - "host", - "port", - "rest" - ] + { + "type": "string", + "paramName": "host" + }, + { + "type": "int", + "paramName": "port" + } + ], + "restParams": { + "type": "string", + "paramName": "rest" + } } } diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project2.json b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project2.json new file mode 100644 index 000000000000..f519f13ec65f --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/config/project2.json @@ -0,0 +1,17 @@ +{ + "sourceRoot": "project1", + "result": { + "hasMain": true, + "params": [ + { + "type": "string", + "paramName": "host" + }, + { + "type": "int", + "paramName": "port", + "defaultValue": "9000" + } + ] + } +} diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/Ballerina.toml b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/Ballerina.toml new file mode 100644 index 000000000000..4106b646d782 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/Ballerina.toml @@ -0,0 +1,4 @@ +[package] +org = "wso2" +name = "project1" +version = "0.1.0" diff --git a/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/sample.bal b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/sample.bal new file mode 100644 index 000000000000..9b3384a8c910 --- /dev/null +++ b/language-server/modules/langserver-core/src/test/resources/runner/mainFuncArgs/source/project2/sample.bal @@ -0,0 +1,3 @@ +public function main(string host, int port = 9000) { + +} From f9eec79cda830e4a9b60af641515f59b6c7cf139 Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Fri, 18 Oct 2024 19:45:10 +0530 Subject: [PATCH 17/42] Address review suggestions --- .../ballerina/runner/BallerinaRunnerService.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java index d848e54e9e12..a477df09b61a 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/runner/BallerinaRunnerService.java @@ -81,13 +81,7 @@ public CompletableFuture diagnostics(ProjectDiagnost if (filePath.isEmpty()) { return projectDiagnosticsResponse; } - Optional projectOptional = this.workspaceManager.project(filePath.get()); - Project project; - if (projectOptional.isEmpty()) { - project = this.workspaceManager.loadProject(filePath.get()); - } else { - project = projectOptional.get(); - } + Project project = this.workspaceManager.loadProject(filePath.get()); Map> errorDiagnosticMap = BallerinaRunnerUtil.getErrorDiagnosticMap(this.workspaceManager, project, filePath.get()); projectDiagnosticsResponse.setErrorDiagnosticMap(errorDiagnosticMap); @@ -115,13 +109,7 @@ public CompletableFuture mainFunctionParams(MainFunc if (filePath.isEmpty()) { return new MainFunctionParamsResponse(false, null, null); } - Optional projectOptional = this.workspaceManager.project(filePath.get()); - Project project; - if (projectOptional.isEmpty()) { - project = this.workspaceManager.loadProject(filePath.get()); - } else { - project = projectOptional.get(); - } + Project project = this.workspaceManager.loadProject(filePath.get()); Package currentPackage = project.currentPackage(); for (DocumentId documentId : currentPackage.getDefaultModule().documentIds()) { Document document = currentPackage.getDefaultModule().document(documentId); From 1b269a9afc5865b56fcf879e63a8e89c04c5a51d Mon Sep 17 00:00:00 2001 From: KavinduZoysa Date: Mon, 21 Oct 2024 13:34:12 +0530 Subject: [PATCH 18/42] Change the resource function signature --- .../semantics/analyzer/SymbolEnter.java | 2 +- .../api/test/ResourceSignatureTest.java | 57 +++++++++++++++++++ .../test-src/resource_signature_test.bal | 21 +++++++ .../src/test/resources/testng.xml | 1 + 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tests/ballerina-compiler-api-test/src/test/java/io/ballerina/semantic/api/test/ResourceSignatureTest.java create mode 100644 tests/ballerina-compiler-api-test/src/test/resources/test-src/resource_signature_test.bal diff --git a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java index e4f2301ddb7a..63e33bc80d68 100644 --- a/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java +++ b/compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/semantics/analyzer/SymbolEnter.java @@ -4884,7 +4884,7 @@ private BAttachedFunction createResourceFunction(BLangFunction funcNode, BInvoka BResourcePathSegmentSymbol parentResource = null; for (int i = 0; i < resourcePathCount; i++) { BLangResourcePathSegment pathSegment = pathSegments.get(i); - Name resourcePathSymbolName = Names.fromString(pathSegment.name.value); + Name resourcePathSymbolName = Names.fromString(pathSegment.name.originalValue); BType resourcePathSegmentType = pathSegment.typeNode == null ? symTable.noType : symResolver.resolveTypeNode(pathSegment.typeNode, env); pathSegment.setBType(resourcePathSegmentType); diff --git a/tests/ballerina-compiler-api-test/src/test/java/io/ballerina/semantic/api/test/ResourceSignatureTest.java b/tests/ballerina-compiler-api-test/src/test/java/io/ballerina/semantic/api/test/ResourceSignatureTest.java new file mode 100644 index 000000000000..6d48c821f508 --- /dev/null +++ b/tests/ballerina-compiler-api-test/src/test/java/io/ballerina/semantic/api/test/ResourceSignatureTest.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024, WSO2 LLC. (http://wso2.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.ballerina.semantic.api.test; + +import io.ballerina.compiler.api.SemanticModel; +import io.ballerina.compiler.api.symbols.ResourceMethodSymbol; +import io.ballerina.compiler.api.symbols.resourcepath.ResourcePath; +import io.ballerina.projects.Document; +import io.ballerina.projects.Project; +import org.ballerinalang.test.BCompileUtil; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import static io.ballerina.semantic.api.test.util.SemanticAPITestUtils.getDefaultModulesSemanticModel; +import static io.ballerina.semantic.api.test.util.SemanticAPITestUtils.getDocumentForSingleSource; +import static io.ballerina.tools.text.LinePosition.from; +import static org.testng.Assert.assertEquals; + +/** + * Test cases for class symbols. + * + * @since 2.0.0 + */ +public class ResourceSignatureTest { + + private SemanticModel model; + private Document srcFile; + + @BeforeClass + public void setup() { + Project project = BCompileUtil.loadProject("test-src/resource_signature_test.bal"); + model = getDefaultModulesSemanticModel(project); + srcFile = getDocumentForSingleSource(project); + } + + @Test + public void testResourceSignature() { + ResourceMethodSymbol method = (ResourceMethodSymbol) model.symbol(srcFile, from(17, 22)).get(); + assertEquals(method.resourcePath().kind(), ResourcePath.Kind.PATH_SEGMENT_LIST); + assertEquals(method.resourcePath().signature(), "store/'order"); + assertEquals(method.signature(), "resource function get store/'order () returns string"); + } +} diff --git a/tests/ballerina-compiler-api-test/src/test/resources/test-src/resource_signature_test.bal b/tests/ballerina-compiler-api-test/src/test/resources/test-src/resource_signature_test.bal new file mode 100644 index 000000000000..a376cfe6cdf1 --- /dev/null +++ b/tests/ballerina-compiler-api-test/src/test/resources/test-src/resource_signature_test.bal @@ -0,0 +1,21 @@ +// Copyright (c) 2024 WSO2 LLC. (http://www.wso2.com). +// +// WSO2 LLC. licenses this file to you under the Apache License, +// Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +service class ServiceClass { + resource function get store/'order() returns string { + return self.message + "dot"; + } +} diff --git a/tests/ballerina-compiler-api-test/src/test/resources/testng.xml b/tests/ballerina-compiler-api-test/src/test/resources/testng.xml index ccc371762d38..5da3658012f2 100644 --- a/tests/ballerina-compiler-api-test/src/test/resources/testng.xml +++ b/tests/ballerina-compiler-api-test/src/test/resources/testng.xml @@ -44,6 +44,7 @@ + From a316a14784ab73d73acf5e3cf0840ef819a9b831 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 23 Oct 2024 18:00:07 +0530 Subject: [PATCH 19/42] Add new trigger service with inbuilt triggers --- .../trigger/BallerinaTriggerService.java | 102 +++++++ .../entity/BallerinaTriggerListResponse.java | 12 + .../resources/inbuilt-triggers/kafka.json | 176 +++++++++++ .../resources/inbuilt-triggers/rabbitmq.json | 288 ++++++++++++++++++ 4 files changed, 578 insertions(+) create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 19e51e0b22a8..2800f5d4fcfc 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -27,6 +27,7 @@ import io.ballerina.trigger.entity.BallerinaTriggerRequest; import io.ballerina.trigger.entity.CentralTriggerListResult; import io.ballerina.trigger.entity.Constants; +import io.ballerina.trigger.entity.Trigger; import org.ballerinalang.annotation.JavaSPIService; import org.ballerinalang.central.client.CentralAPIClient; import org.ballerinalang.central.client.exceptions.CentralClientException; @@ -43,6 +44,12 @@ import org.eclipse.lsp4j.services.LanguageServer; import org.wso2.ballerinalang.util.RepoUtils; +import java.io.IOException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -59,7 +66,13 @@ @JavaSPIService("org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService") @JsonSegment("ballerinaTrigger") public class BallerinaTriggerService implements ExtendedLanguageServerService { + public static final String BALLERINA = "ballerina"; + public static final String BALLERINAX = "ballerinax"; private LanguageClient languageClient; + private static final Map IN_BUILT_TRIGGERS = Map.of( + "10001", "kafka", + "10002", "rabbitmq" + ); @Override public void init(LanguageServer langServer, WorkspaceManager workspaceManager, @@ -93,6 +106,33 @@ public CompletableFuture triggers(BallerinaTrigger }); } + @JsonRequest + public CompletableFuture triggersNew(BallerinaTriggerListRequest request) { + return CompletableFuture.supplyAsync(() -> { + BallerinaTriggerListResponse triggersList = new BallerinaTriggerListResponse(); + try { + triggersList.addInBuiltTriggers(getInBuiltTriggers()); + Settings settings = RepoUtils.readSettings(); + CentralAPIClient client = new CentralAPIClient(RepoUtils.getRemoteRepoURL(), + initializeProxy(settings.getProxy()), settings.getProxy().username(), + settings.getProxy().password(), getAccessTokenOfCLI(settings), + settings.getCentral().getConnectTimeout(), + settings.getCentral().getReadTimeout(), settings.getCentral().getWriteTimeout(), + settings.getCentral().getCallTimeout(), settings.getCentral().getMaxRetries()); + JsonElement triggerSearchResult = client.getTriggers(request.getQueryMap(), + "any", RepoUtils.getBallerinaVersion()); + CentralTriggerListResult centralTriggerListResult = new Gson().fromJson( + triggerSearchResult.getAsString(), CentralTriggerListResult.class); + triggersList.addCentralTriggers(centralTriggerListResult.getTriggers()); + return triggersList; + } catch (CentralClientException | SettingsTomlException e) { + String msg = "Operation 'ballerinaTrigger/triggers' failed!"; + this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); + return triggersList; + } + }); + } + @JsonRequest public CompletableFuture trigger(BallerinaTriggerRequest request) { return CompletableFuture.supplyAsync(() -> { @@ -101,6 +141,29 @@ public CompletableFuture trigger(BallerinaTriggerRequest request) { }); } + @JsonRequest + public CompletableFuture triggerNew(BallerinaTriggerRequest request) { + return CompletableFuture.supplyAsync(() -> { + if (expectsTriggerByName(request)) { + return getInBuiltTrigger(request.getPackageName()).orElseGet(JsonObject::new); + } + if (request.getTriggerId() != null) { + Optional trigger = getInBuiltTriggerById(request.getTriggerId()); + if (trigger.isPresent()) { + return trigger.get(); + } + } + + Optional trigger = getTriggerFromCentral(request); + return trigger.orElseGet(JsonObject::new); + }); + } + + private static boolean expectsTriggerByName(BallerinaTriggerRequest request) { + return request.getTriggerId() == null && request.getOrgName() != null && request.getPackageName() != null + && (request.getOrgName().trim().equals(BALLERINA) || request.getOrgName().equals(BALLERINAX)); + } + private Optional getTriggerFromCentral(BallerinaTriggerRequest request) { JsonObject trigger; try { @@ -132,4 +195,43 @@ public Class getRemoteInterface() { public String getName() { return Constants.CAPABILITY_NAME; } + + private List getInBuiltTriggers() { + return IN_BUILT_TRIGGERS.values().stream() + .map(this::getInBuiltTriggerInfo) + .flatMap(Optional::stream) + .map(s -> new Gson().fromJson(s, Trigger.class)) + .toList(); + } + + private Optional getInBuiltTriggerById(String triggerId) { + if (!IN_BUILT_TRIGGERS.containsKey(triggerId)) { + return Optional.empty(); + } + return getInBuiltTrigger(IN_BUILT_TRIGGERS.get(triggerId)); + } + + private Optional getInBuiltTrigger(String triggerName) { + return getInBuiltTriggerInfo(triggerName) + .map(s -> new Gson().fromJson(s, JsonObject.class)); + } + + private Optional getInBuiltTriggerInfo(String triggerName) { + URL triggerURL = BallerinaTriggerService.class.getClassLoader() + .getResource("inbuilt-triggers/" + triggerName + ".json"); + if (triggerURL == null) { + String msg = String.format("Trigger info file not found for the trigger: %s", triggerName); + this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); + return Optional.empty(); + } + + try { + return Optional.of(Files.readString(Path.of(triggerURL.getPath()))); + } catch (IOException e) { + String msg = String.format("Error occurred while reading the trigger info file for the trigger: %s", + triggerName); + this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); + return Optional.empty(); + } + } } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/entity/BallerinaTriggerListResponse.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/entity/BallerinaTriggerListResponse.java index 4207542c2809..0d0fa6e6a084 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/entity/BallerinaTriggerListResponse.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/entity/BallerinaTriggerListResponse.java @@ -50,6 +50,18 @@ public void setCentralTriggers(List central) { } } + public void addCentralTriggers(List central) { + if (central != null && !central.isEmpty()) { + this.central.addAll(central); + } + } + + public void addInBuiltTriggers(List inBuiltTriggers) { + if (inBuiltTriggers != null && !inBuiltTriggers.isEmpty()) { + this.central.addAll(inBuiltTriggers); + } + } + public List getLocalTriggers() { return local; } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json new file mode 100644 index 000000000000..012fd69839e9 --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json @@ -0,0 +1,176 @@ +{ + "id": 10001, + "name": "Kafka Event Listener", + "type": "inbuilt", + "displayName": "Kafka", + "documentation": "This Listener can be used to listen to Kafka events.", + "moduleName": "kafka", + "listenerProtocol": "kafka", + "displayAnnotation": { + "label": "Kafka", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 15511, + "organization": "ballerinax", + "name": "kafka", + "version": "4.2.0", + "platform": "java17", + "languageSpecificationVersion": "2024R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/kafka/4.2.0", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/kafka/4.2.0/ballerinax-kafka-java17-4.2.0.bala?Expires=1729564876&Signature=yyLs~P-0T666fFFKjpIqPJWc5LA9uuzqNaIz5yFGAh0FLgFJjAhA~kxi9~z5O1dIzsdN-si2srv7z0KmYrok5KRzczVdfMJmfab5Q7D0ZInrMguEAR9GZB6TYbrv6OMaTDOH6jXGaz0Dr0HLWZZj63IuDEpf4JLfy8cvfclcf2jKmYGFmcfii-tCQ-PfgBC6QBqQQmBX0xaHjutgNA0lLG9OVLaAT51qwOQsmmceYKD6wnK-DtWsPLshyHAKbORy2hZkTvahq-yz4kQf4PYDId51egzijhCO48hOUo1n8IAMnBfrMqB8dBy6s8KZNnbmljN5PXcJRzrj1hiIA8EQJA__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=07b3e7b48e21aadb0c7bcfb3c221b2648c75f95b31b82de41f2b36119b70a53d", + "summary": "This package provides an implementation to interact with Kafka Brokers via Kafka Consumer and Kafka Producer clients.", + "readme": "## Overview\nThis package provides an implementation to interact with Kafka Brokers via Kafka Consumer and Kafka Producer clients.\n\nApache Kafka is an open-source distributed event streaming platform used for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.\n\nThis package supports Kafka 1.x.x, 2.x.x and 3.x.x versions.\n\n### Consumer and producer\n#### Kafka producer\nA Kafka producer is a Kafka client that publishes records to the Kafka cluster. The producer is thread-safe and sharing a single producer instance across threads will generally be faster than having multiple instances. When working with a Kafka producer, the first thing to do is to initialize the producer.\nFor the producer to execute successfully, an active Kafka broker should be available.\n\nThe code snippet given below initializes a producer with the basic configuration.\n```ballerina\nimport ballerinax\/kafka;\n\nkafka:ProducerConfiguration producerConfiguration = {\n clientId: \"basic-producer\",\n acks: \"all\",\n retryCount: 3\n};\n\nkafka:Producer kafkaProducer = check new (kafka:DEFAULT_URL, producerConfiguration);\n```\n#### Kafka consumer\nA Kafka consumer is a subscriber responsible for reading records from one or more topics and one or more partitions of a topic. When working with a Kafka consumer, the first thing to do is initialize the consumer.\nFor the consumer to execute successfully, an active Kafka broker should be available.\n\nThe code snippet given below initializes a consumer with the basic configuration.\n```ballerina\nkafka:ConsumerConfiguration consumerConfiguration = {\n groupId: \"group-id\", \/\/ Unique string that identifies the consumer\n offsetReset: \"earliest\", \/\/ Offset reset strategy if no initial offset\n topics: [\"kafka-topic\"]\n};\n\nkafka:Consumer kafkaConsumer = check new (kafka:DEFAULT_URL, consumerConfiguration);\n```\n### Listener\nThe Kafka consumer can be used as a listener to a set of topics without the need to manually `poll` the messages.\n\nYou can use the `Caller` to manually commit the offsets of the messages that are read by the service. The following code snippet shows how to initialize and define the listener and how to commit the offsets manually.\n```ballerina\nkafka:ConsumerConfiguration consumerConfiguration = {\n groupId: \"group-id\",\n topics: [\"kafka-topic-1\"],\n pollingInterval: 1,\n autoCommit: false\n};\n\nlistener kafka:Listener kafkaListener = new (kafka:DEFAULT_URL, consumerConfiguration);\n\nservice on kafkaListener {\n remote function onConsumerRecord(kafka:Caller caller, kafka:BytesConsumerRecord[] records) {\n \/\/ processes the records\n ...\n \/\/ commits the offsets manually\n kafka:Error? commitResult = caller->commit();\n\n if commitResult is kafka:Error {\n log:printError(\"Error occurred while committing the offsets for the consumer \", 'error = commitResult);\n }\n }\n}\n```\n### Data serialization\nSerialization is the process of converting data into a stream of bytes that is used for transmission. Kafka\nstores and transmits these bytes of arrays in its queue. Deserialization does the opposite of serialization\nin which bytes of arrays are converted into the desired data type.\n\nCurrently, this package only supports the `byte array` data type for both the keys and values. The following code snippets\nshow how to produce and read a message from Kafka.\n```ballerina\nstring message = \"Hello World, Ballerina\";\nstring key = \"my-key\";\n\/\/ converts the message and key to a byte array\ncheck kafkaProducer->send({ topic: \"test-kafka-topic\", key: key.toBytes(), value: message.toBytes() });\n```\n```ballerina\nkafka:BytesConsumerRecord[] records = check kafkaConsumer->poll(1);\n\nforeach var kafkaRecord in records {\n byte[] messageContent = kafkaRecord.value;\n \/\/ tries to generate the string value from the byte array\n string result = check string:fromBytes(messageContent);\n io:println(\"The result is : \", result);\n}\n```\n### Concurrency\nIn Kafka, records are grouped into smaller units called partitions. These can be processed independently without\ncompromising the correctness of the results and lays the foundation for parallel processing. This can be achieved by\nusing multiple consumers within the same group each reading and processing data from a subset of topic partitions and\nrunning in a single thread.\n\nTopic partitions are assigned to consumers automatically or you can manually assign topic partitions.\n\nThe following code snippet joins a consumer to the `consumer-group` and assigns it to a topic partition manually.\n```ballerina\nkafka:ConsumerConfiguration consumerConfiguration = {\n \/\/ `groupId` determines the consumer group\n groupId: \"consumer-group\",\n pollingInterval: 1,\n autoCommit: false\n};\n\nkafka:Consumer kafkaConsumer = check new (kafka:DEFAULT_URL, consumerConfiguration);\n\/\/ creates a topic partition\nkafka:TopicPartition topicPartition = {\n topic: \"kafka-topic-1\",\n partition: 1\n};\n\/\/ passes the topic partitions to the assign function as an array\ncheck kafkaConsumer->assign([topicPartition]);\n```\n\n### Report issues\n\nTo report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina standard library parent repository](https:\/\/github.com\/ballerina-platform\/ballerina-standard-library).\n\n### Useful links\n\n- Chat live with us via our [Discord server](https:\/\/discord.gg\/ballerinalang).\n- Post all technical questions on Stack Overflow with the [#ballerina](https:\/\/stackoverflow.com\/questions\/tagged\/ballerina) tag.", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerinax-kafka", + "keywords": [ + "kafka", + "event streaming", + "network", + "messaging" + ], + "ballerinaVersion": "2201.10.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_kafka_4.2.0.png", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1724147879000, + "pullCount": 1270, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/kafka/4.2.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/kafka/4.2.0", + "name": "kafka", + "summary": "This module provides an implementation to interact with Kafka Brokers via Kafka Consumer and Kafka Producer clients.", + "readme": "## Overview\n\nThis module provides an implementation to interact with Kafka Brokers via Kafka Consumer and Kafka Producer clients.\n\nApache Kafka is an open-source distributed event streaming platform used for high-performance data pipelines, streaming analytics, data integration, and mission-critical applications.\n\nThis module supports Kafka 1.x.x, 2.x.x and 3.x.x versions.\n\n### Consumer and producer\n#### Kafka producer\nA Kafka producer is a Kafka client that publishes records to the Kafka cluster. The producer is thread-safe and sharing a single producer instance across threads will generally be faster than having multiple instances. When working with a Kafka producer, the first thing to do is to initialize the producer.\nFor the producer to execute successfully, an active Kafka broker should be available.\n\nThe code snippet given below initializes a producer with the basic configuration.\n```ballerina\nimport ballerinax\/kafka;\n\nkafka:ProducerConfiguration producerConfiguration = {\n clientId: \"basic-producer\",\n acks: \"all\",\n retryCount: 3\n};\n\nkafka:Producer kafkaProducer = check new (kafka:DEFAULT_URL, producerConfiguration);\n```\n#### Kafka consumer\nA Kafka consumer is a subscriber responsible for reading records from one or more topics and one or more partitions of a topic. When working with a Kafka consumer, the first thing to do is initialize the consumer.\nFor the consumer to execute successfully, an active Kafka broker should be available.\n\nThe code snippet given below initializes a consumer with the basic configuration.\n```ballerina\nkafka:ConsumerConfiguration consumerConfiguration = {\n groupId: \"group-id\", \/\/ Unique string that identifies the consumer\n offsetReset: \"earliest\", \/\/ Offset reset strategy if no initial offset\n topics: [\"kafka-topic\"]\n};\n\nkafka:Consumer kafkaConsumer = check new (kafka:DEFAULT_URL, consumerConfiguration);\n```\n### Listener\nThe Kafka consumer can be used as a listener to a set of topics without the need to manually `poll` the messages.\n\nYou can use the `Caller` to manually commit the offsets of the messages that are read by the service. The following code snippet shows how to initialize and define the listener and how to commit the offsets manually.\n```ballerina\nkafka:ConsumerConfiguration consumerConfiguration = {\n groupId: \"group-id\",\n topics: [\"kafka-topic-1\"],\n pollingInterval: 1,\n autoCommit: false\n};\n\nlistener kafka:Listener kafkaListener = new (kafka:DEFAULT_URL, consumerConfiguration);\n\nservice on kafkaListener {\n remote function onConsumerRecord(kafka:Caller caller, kafka:BytesConsumerRecord[] records) {\n \/\/ processes the records\n ...\n \/\/ commits the offsets manually\n kafka:Error? commitResult = caller->commit();\n\n if commitResult is kafka:Error {\n log:printError(\"Error occurred while committing the offsets for the consumer \", 'error = commitResult);\n }\n }\n}\n```\n### Data serialization\nSerialization is the process of converting data into a stream of bytes that is used for transmission. Kafka\nstores and transmits these bytes of arrays in its queue. Deserialization does the opposite of serialization\nin which bytes of arrays are converted into the desired data type.\n\nCurrently, this module only supports the `byte array` data type for both the keys and values. The following code snippets\nshow how to produce and read a message from Kafka.\n```ballerina\nstring message = \"Hello World, Ballerina\";\nstring key = \"my-key\";\n\/\/ converts the message and key to a byte array\ncheck kafkaProducer->send({ topic: \"test-kafka-topic\", key: key.toBytes(), value: message.toBytes() });\n```\n```ballerina\nkafka:BytesConsumerRecord[] records = check kafkaConsumer->poll(1);\n\nforeach var kafkaRecord in records {\n byte[] messageContent = kafkaRecord.value;\n \/\/ tries to generate the string value from the byte array\n string result = check string:fromBytes(messageContent);\n io:println(\"The result is : \", result);\n}\n```\n### Concurrency\nIn Kafka, records are grouped into smaller units called partitions. These can be processed independently without\ncompromising the correctness of the results and lays the foundation for parallel processing. This can be achieved by\nusing multiple consumers within the same group each reading and processing data from a subset of topic partitions and \nrunning in a single thread.\n\nTopic partitions are assigned to consumers automatically or you can manually assign topic partitions.\n\nThe following code snippet joins a consumer to the `consumer-group` and assigns it to a topic partition manually.\n```ballerina\nkafka:ConsumerConfiguration consumerConfiguration = {\n \/\/ `groupId` determines the consumer group\n groupId: \"consumer-group\",\n pollingInterval: 1,\n autoCommit: false\n};\n\nkafka:Consumer kafkaConsumer = check new (kafka:DEFAULT_URL, consumerConfiguration);\n\/\/ creates a topic partition\nkafka:TopicPartition topicPartition = {\n topic: \"kafka-topic-1\",\n partition: 1\n};\n\/\/ passes the topic partitions to the assign function as an array\ncheck kafkaConsumer->assign([topicPartition]);\n```" + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Service", + "description": "Kafka Service", + "functions": [ + { + "name": "OnConsumerRecord", + "documentation": "The function which will be triggered when a message is received from the Kafka topic", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "records", + "typeName": "kafka:ConsumerAnydataRecord[]|anydata[]", + "optional": false, + "arrayType": true, + "defaultTypeName": "kafka:ConsumerAnydataRecord[]", + "type": [ + "kafka:ConsumerAnydataRecord[]", + "anydata[]" + ] + }, + { + "name": "caller", + "typeName": "kafka:Caller", + "type": [ + "kafka:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerinax", + "moduleName": "kafka", + "version": "4.2.0" + }, + "optional": true, + "documentation": "Caller object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + }, + { + "name": "OnError", + "documentation": "The function which will be triggered when an error occurs", + "optional": true, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "err", + "typeName": "kafka:error", + "type": [ + "kafka:error" + ], + "optional": false, + "typeInfo": { + "name": "Error", + "orgName": "ballerinax", + "moduleName": "kafka", + "version": "4.2.0" + }, + "documentation": "Error object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + } + ] + } + ], + "listenerParams": [ + { + "name": "bootstrapServers", + "typeName": "string|string[]", + "type": [ + "string", + "string[]" + ], + "optional": false, + "defaultable": false, + "documentation": "List of remote server endpoints of Kafka brokers" + }, + { + "name": "config", + "typeName": "kafka:ConsumerConfiguration", + "type": [ + "kafka:ConsumerConfiguration" + ], + "optional": true, + "typeInfo": { + "name": "ConsumerConfiguration", + "orgName": "ballerinax", + "moduleName": "kafka", + "version": "4.2.0" + }, + "defaultable": false, + "documentation": "Configuration for the Kafka Consumer" + } + ] +} \ No newline at end of file diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json new file mode 100644 index 000000000000..b55b948a7b25 --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json @@ -0,0 +1,288 @@ +{ + "id": 10002, + "name": "RabbitMQ Event Listener", + "type": "inbuilt", + "displayName": "RabbitMQ", + "documentation": "This Listener can be used to listen to messages from a RabbitMQ server.", + "moduleName": "rabbitmq", + "listenerProtocol": "rabbitmq", + "displayAnnotation": { + "label": "RabbitMQ", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 15584, + "organization": "ballerinax", + "name": "rabbitmq", + "version": "3.1.0", + "platform": "java17", + "languageSpecificationVersion": "2024R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/rabbitmq/3.1.0", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/rabbitmq/3.1.0/ballerinax-rabbitmq-java17-3.1.0.bala?Expires=1729566129&Signature=G2~Nt3a2HtLalmYyl~v~PnM6F7owpZC6u8KOOyKDERjMmHoWsAbY3w3Nhj4aKUINjkHrKX-Gy3KTNtbvrw6MwaDmYN~wz7zCP09kkKb-LQMRgxrmRU9gUhSSoToQELQBGmYs5UzYsUnNPtEU1tdpc8fDFmKHmUSyFPt8nsAZ5f7981KA22bdFNxYV-FT-squ06I0cq9D8Q-E4Tt4g9k~d~bD5TLc536Rxz-BJaJ5p7IG9Bi8mzU-FHr12jPW4nAJ5LEqxq71dV8L0FGMmeFGNHiHNvp8l~AgWw4UMBu8BiV6MuUoA-0T0LVU91EFmgeKnusZt7BFSg5P-M0MQDTqLA__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=3b44e994547d8a28034078e0695c1ceaceab4524647ccdd4430fd9800e7daaa3", + "summary": "This package provides the capability to send and receive messages by connecting to the RabbitMQ server.", + "readme": "## Package Overview\n\nThis package provides the capability to send and receive messages by connecting to the RabbitMQ server.\n\nRabbitMQ gives your applications a common platform to send and receive messages and a safe place for your messages to live until received. RabbitMQ is one of the most popular open-source message brokers. It is lightweight and easy to deploy on-premise and in the cloud.\n\n### Basic usage\n\n#### Set up the connection\n\nFirst, you need to set up the connection with the RabbitMQ server. The following ways can be used to connect to a\nRabbitMQ server.\n\n1. Connect to a RabbitMQ node with the default host and port:\n```ballerina\n rabbitmq:Client rabbitmqClient = check new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n```\n\n2. Connect to a RabbitMQ node with a custom host and port:\n```ballerina\n rabbitmq:Client rabbitmqClient = check new(\"localhost\", 5672);\n```\n\n3. Connect to a RabbitMQ node with host, port, and additional configurations:\n```ballerina\n rabbitmq:ConnectionConfiguration config = {\n username: \"ballerina\",\n password: \"password\"\n };\n rabbitmq:Client rabbitmqClient = check new(\"localhost\", 5672, configs);\n```\n\nThe `rabbitmq:Client` can now be used to send and receive messages as described in the subsequent sections.\n\n#### Exchanges and queues\n\nClient applications work with exchanges and queues, which are the high-level building blocks of the AMQP protocol. These must be declared before they can be used. The following code declares an exchange and a server-named queue and then binds them together.\n\n```ballerina\n check rabbitmqClient->exchangeDeclare(\"MyExchange\", rabbitmq:DIRECT_EXCHANGE);\n check rabbitmqClient->queueDeclare(\"MyQueue\");\n check rabbitmqClient->queueBind(\"MyQueue\", \"MyExchange\", \"routing-key\");\n```\n\nThis sample code will declare,\n- a durable auto-delete exchange of the type `rabbitmq:DIRECT_EXCHANGE`\n- a non-durable, exclusive auto-delete queue with an auto-generated name\n\nNext, the `queueBind` function is called to bind the queue to the exchange with the given routing key.\n\n```ballerina\n check rabbitmqClient->exchangeDeclare(\"MyExchange\", rabbitmq:DIRECT_EXCHANGE);\n check rabbitmqClient->queueDeclare(\"MyQueue\", { durable: true,\n exclusive: false,\n autoDelete: false });\n check rabbitmqClient->queueBind(\"MyQueue\", \"MyExchange\", \"routing-key\");\n```\n\nThis sample code will declare,\n- a durable auto-delete exchange of the type `rabbitmq:DIRECT_EXCHANGE`\n- a durable, non-exclusive, non-auto-delete queue with a well-known name\n\n#### Delete entities and purge queues\n\n- Delete a queue:\n```ballerina\n check rabbitmqClient->queueDelete(\"MyQueue\");\n```\n- Delete a queue only if it is empty:\n```ballerina\n check rabbitmqClient->queueDelete(\"MyQueue\", false, true);\n```\n- Delete a queue only if it is unused (does not have any consumers):\n```ballerina\n check rabbitmqClient->queueDelete(\"MyQueue\", true, false);\n```\n- Delete an exchange:\n```ballerina\n check rabbitmqClient->exchangeDelete(\"MyExchange\");\n```\n- Purge a queue (delete all of its messages):\n```ballerina\n check rabbitmqClient->queuePurge(\"MyQueue\");\n```\n\n#### Publish messages\n\nTo publish a message to an exchange, use the `publishMessage()` function as follows:\n\n```ballerina\n string message = \"Hello from Ballerina\";\n check rabbitmqClient->publishMessage({ content: message.toBytes(), routingKey: queueName });\n``` \nSetting other properties of the message such as routing headers can be done by using the `BasicProperties` record with the appropriate values.\n\n```ballerina\n rabbitmq:BasicProperties props = {\n replyTo: \"reply-queue\" \n };\n string message = \"Hello from Ballerina\";\n check rabbitmqClient->publishMessage({ content: message.toBytes(), routingKey: queueName, properties: props });\n```\n\n#### Consume messages using consumer services\n\nThe most efficient way to receive messages is to set up a subscription using a Ballerina RabbitMQ `rabbitmq:Listener` and any number of consumer services. The messages will then be delivered automatically as they arrive rather than having to be explicitly requested. Multiple consumer services can be bound to one Ballerina RabbitMQ `rabbitmq:Listener`. The queue to which the service is listening is configured in the `rabbitmq:ServiceConfig` annotation of the service or else as the name of the service.\n\n1. Listen to incoming messages with the `onMessage` remote method:\n\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\"\n }\n service rabbitmq:Service on channelListener {\n remote function onMessage(rabbitmq:BytesMessage message) {\n }\n }\n```\n\n2. Listen to incoming messages and reply directly with the `onRequest` remote method:\n\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\"\n }\n service rabbitmq:Service on channelListener {\n remote function onRequest(rabbitmq:BytesMessage message) returns string {\n return \"Hello Back!\";\n }\n }\n```\n\nThe `rabbitmq:BytesMessage` record received can be used to retrieve its contents.\n\n### Advanced usage\n\n#### Client acknowledgements\n\nThe message consuming is supported by mainly two types of acknowledgement modes, which are auto acknowledgements and client acknowledgements.\nClient acknowledgements can further be divided into two different types as positive and negative acknowledgements.\nThe default acknowledgement mode is auto-ack (messages are acknowledged immediately after consuming). The following examples show the usage of positive and negative acknowledgements.\n> WARNING: To ensure the reliability of receiving messages, use the client-ack mode.\n\n1. Positive client acknowledgement:\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\",\n autoAck: false\n }\n service rabbitmq:Service on channelListener {\n remote function onMessage(rabbitmq:BytesMessage message, rabbitmq:Caller caller) {\n rabbitmq:Error? result = caller->basicAck();\n }\n }\n```\n\n2. Negative client acknowledgement:\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\",\n autoAck: false\n }\n service rabbitmq:Service on channelListener {\n remote function onMessage(rabbitmq:BytesMessage message) {\n rabbitmq:Error? result = caller->basicNack(true, requeue = false);\n }\n }\n```\n\nThe negatively-acknowledged (rejected) messages can be re-queued by setting the `requeue` to `true`.\n\n### Report issues\n\nTo report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina standard library parent repository](https:\/\/github.com\/ballerina-platform\/ballerina-standard-library).\n\n### Useful links\n\n- Chat live with us via our [Discord server](https:\/\/discord.gg\/ballerinalang).\n- Post all technical questions on Stack Overflow with the [#ballerina](https:\/\/stackoverflow.com\/questions\/tagged\/ballerina) tag.", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerinax-rabbitmq", + "keywords": [ + "service", + "client", + "messaging", + "network", + "pubsub" + ], + "ballerinaVersion": "2201.10.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_rabbitmq_3.1.0.png", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1724153093000, + "pullCount": 24, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/rabbitmq/3.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/rabbitmq/3.1.0", + "name": "rabbitmq", + "summary": "This module provides the capability to send and receive messages by connecting to the RabbitMQ server.", + "readme": "## Overview\n\nThis module provides the capability to send and receive messages by connecting to the RabbitMQ server.\n\nRabbitMQ gives your applications a common platform to send and receive messages and a safe place for your messages to live until received. RabbitMQ is one of the most popular open-source message brokers. It is lightweight and easy to deploy on-premise and in the cloud.\n\n### Basic usage\n\n#### Set up the connection\n\nFirst, you need to set up the connection with the RabbitMQ server. The following ways can be used to connect to a\nRabbitMQ server.\n\n1. Connect to a RabbitMQ node with the default host and port:\n```ballerina\n rabbitmq:Client rabbitmqClient = check new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n```\n\n2. Connect to a RabbitMQ node with a custom host and port:\n```ballerina\n rabbitmq:Client rabbitmqClient = check new(\"localhost\", 5672);\n```\n\n3. Connect to a RabbitMQ node with host, port, and additional configurations:\n```ballerina\n rabbitmq:ConnectionConfiguration config = {\n username: \"ballerina\",\n password: \"password\"\n };\n rabbitmq:Client rabbitmqClient = check new(\"localhost\", 5672, configs);\n```\n\nThe `rabbitmq:Client` can now be used to send and receive messages as described in the subsequent sections.\n\n#### Exchanges and queues\n\nClient applications work with exchanges and queues, which are the high-level building blocks of the AMQP protocol. These must be declared before they can be used. The following code declares an exchange and a server-named queue and then binds them together.\n\n```ballerina\n check rabbitmqClient->exchangeDeclare(\"MyExchange\", rabbitmq:DIRECT_EXCHANGE);\n check rabbitmqClient->queueDeclare(\"MyQueue\");\n check rabbitmqClient->queueBind(\"MyQueue\", \"MyExchange\", \"routing-key\");\n```\n\nThis sample code will declare,\n- a durable auto-delete exchange of the type `rabbitmq:DIRECT_EXCHANGE`\n- a non-durable, exclusive auto-delete queue with an auto-generated name\n\nNext, the `queueBind` function is called to bind the queue to the exchange with the given routing key.\n\n```ballerina\n check rabbitmqClient->exchangeDeclare(\"MyExchange\", rabbitmq:DIRECT_EXCHANGE);\n check rabbitmqClient->queueDeclare(\"MyQueue\", { durable: true,\n exclusive: false,\n autoDelete: false });\n check rabbitmqClient->queueBind(\"MyQueue\", \"MyExchange\", \"routing-key\");\n```\n\nThis sample code will declare,\n- a durable auto-delete exchange of the type `rabbitmq:DIRECT_EXCHANGE`\n- a durable, non-exclusive, non-auto-delete queue with a well-known name\n\n#### Delete entities and purge queues\n\n- Delete a queue:\n```ballerina\n check rabbitmqClient->queueDelete(\"MyQueue\");\n```\n- Delete a queue only if it is empty:\n```ballerina\n check rabbitmqClient->queueDelete(\"MyQueue\", false, true);\n```\n- Delete a queue only if it is unused (does not have any consumers):\n```ballerina\n check rabbitmqClient->queueDelete(\"MyQueue\", true, false);\n```\n- Delete an exchange:\n```ballerina\n check rabbitmqClient->exchangeDelete(\"MyExchange\");\n```\n- Purge a queue (delete all of its messages):\n```ballerina\n check rabbitmqClient->queuePurge(\"MyQueue\");\n```\n\n#### Publish messages\n\nTo publish a message to an exchange, use the `publishMessage()` function as follows:\n\n```ballerina\n string message = \"Hello from Ballerina\";\n check rabbitmqClient->publishMessage({ content: message.toBytes(), routingKey: queueName });\n``` \nSetting other properties of the message such as routing headers can be done by using the `BasicProperties` record with the appropriate values.\n\n```ballerina\n rabbitmq:BasicProperties props = {\n replyTo: \"reply-queue\" \n };\n string message = \"Hello from Ballerina\";\n check rabbitmqClient->publishMessage({ content: message.toBytes(), routingKey: queueName, properties: props });\n```\n\n#### Consume messages using consumer services\n\nThe most efficient way to receive messages is to set up a subscription using a Ballerina RabbitMQ `rabbitmq:Listener` and any number of consumer services. The messages will then be delivered automatically as they arrive rather than having to be explicitly requested. Multiple consumer services can be bound to one Ballerina RabbitMQ `rabbitmq:Listener`. The queue to which the service is listening is configured in the `rabbitmq:ServiceConfig` annotation of the service or else as the name of the service.\n\n1. Listen to incoming messages with the `onMessage` remote method:\n\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\"\n }\n service rabbitmq:Service on channelListener {\n remote function onMessage(rabbitmq:AnydataMessage message) {\n }\n }\n```\n\n2. Listen to incoming messages and reply directly with the `onRequest` remote method:\n\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\"\n }\n service rabbitmq:Service on channelListener {\n remote function onRequest(rabbitmq:AnydataMessage message) returns string {\n return \"Hello Back!\";\n }\n }\n```\n\nThe `rabbitmq:AnydataMessage` record received can be used to retrieve its contents.\n\n### Advanced usage\n\n#### Client acknowledgements\n\nThe message consuming is supported by mainly two types of acknowledgement modes, which are auto acknowledgements and client acknowledgements.\nClient acknowledgements can further be divided into two different types as positive and negative acknowledgements.\nThe default acknowledgement mode is auto-ack (messages are acknowledged immediately after consuming). The following examples show the usage of positive and negative acknowledgements.\n> WARNING: To ensure the reliability of receiving messages, use the client-ack mode.\n\n1. Positive client acknowledgement:\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\",\n autoAck: false\n }\n service rabbitmq:Service on channelListener {\n remote function onMessage(rabbitmq:BytesMessage message, rabbitmq:Caller caller) {\n rabbitmq:Error? result = caller->basicAck();\n }\n }\n```\n\n2. Negative client acknowledgement:\n```ballerina\n listener rabbitmq:Listener channelListener= new(rabbitmq:DEFAULT_HOST, rabbitmq:DEFAULT_PORT);\n \n @rabbitmq:ServiceConfig {\n queueName: \"MyQueue\",\n autoAck: false\n }\n service rabbitmq:Service on channelListener {\n remote function onMessage(rabbitmq:BytesMessage message) {\n rabbitmq:Error? result = caller->basicNack(true, requeue = false);\n }\n }\n```\n\nThe negatively-acknowledged (rejected) messages can be re-queued by setting the `requeue` to `true`." + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Service", + "description": "RabbitMQ Service", + "basePath": { + "optional": false, + "typeName": "string", + "type": [ + "string" + ], + "defaultable": false, + "documentation": "The RabbitMQ queue name" + }, + "functions": [ + { + "name": "OnMessage", + "documentation": "The function which will be triggered when a message is received from the RabbitMQ server", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "rabbitmq:AnydataMessage", + "type": [ + "rabbitmq:AnydataMessage" + ], + "optional": false, + "typeInfo": { + "name": "AnydataMessage", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + } + }, + { + "name": "caller", + "typeName": "rabbitmq:Caller", + "type": [ + "rabbitmq:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + }, + "optional": true, + "documentation": "Caller object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + }, + "group": { + "id": 1, + "name": "group-1", + "type": "exclusive", + "documentation": "RabbitMQ message type" + } + }, + { + "name": "OnRequest", + "documentation": "The function which will be triggered when a message is received from the RabbitMQ server and a response is expected", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "rabbitmq:AnydataMessage", + "type": [ + "rabbitmq:AnydataMessage" + ], + "optional": false, + "typeInfo": { + "name": "AnydataMessage", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + } + }, + { + "name": "caller", + "typeName": "rabbitmq:Caller", + "type": [ + "rabbitmq:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + }, + "optional": true, + "documentation": "Caller object" + } + ], + "returnType": { + "typeName": "anydata", + "type": [ + "anydata" + ], + "optional": false, + "documentation": "Anydata response", + "editable": false + }, + "group": { + "id": 1, + "name": "group-1", + "type": "exclusive", + "documentation": "RabbitMQ message type" + } + }, + { + "name": "OnError", + "optional": true, + "documentation": "The function which will be triggered when an error occurs", + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "rabbitmq:AnydataMessage", + "type": [ + "rabbitmq:AnydataMessage" + ], + "optional": false, + "typeInfo": { + "name": "AnydataMessage", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + } + }, + { + "name": "error", + "typeName": "rabbitmq:Error", + "type": [ + "rabbitmq:Error" + ], + "typeInfo": { + "name": "Error", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + }, + "optional": false, + "documentation": "Error object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + } + ] + } + ], + "listenerParams": [ + { + "name": "host", + "typeName": "string", + "type": [ + "string" + ], + "optional": false, + "defaultable": false, + "documentation": "The host used for establishing the connection" + }, + { + "name": "port", + "typeName": "int", + "type": [ + "int" + ], + "optional": false, + "defaultable": false, + "documentation": "The port used for establishing the connection" + }, + { + "name": "qosSettings", + "typeName": "rabbitmq:QosSettings", + "type": [ + "rabbitmq:QosSettings" + ], + "optional": true, + "defaultable": false, + "documentation": "The consumer prefetch settings", + "typeInfo": { + "name": "QosSettings", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + } + }, + { + "name": "connectionData", + "typeName": "rabbitmq:ConnectionData", + "type": [ + "rabbitmq:ConnectionData" + ], + "optional": true, + "defaultable": false, + "documentation": "The connection data", + "typeInfo": { + "name": "ConnectionData", + "orgName": "ballerinax", + "moduleName": "rabbitmq", + "version": "3.1.0" + } + } + ] +} \ No newline at end of file From 07a4f682ca02fa65bcea6d6c8b042b87959ec4b2 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Wed, 23 Oct 2024 18:00:15 +0530 Subject: [PATCH 20/42] Add tests --- .../ballerina/trigger/TriggerServiceTest.java | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java index f861a6333221..cf85b9b837c9 100644 --- a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java +++ b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java @@ -37,6 +37,8 @@ public class TriggerServiceTest { private static final String BALLERINA_TRIGGERS = "ballerinaTrigger/triggers"; private static final String BALLERINA_TRIGGER = "ballerinaTrigger/trigger"; + private static final String BALLERINA_TRIGGERS_NEW = "ballerinaTrigger/triggersNew"; + private static final String BALLERINA_TRIGGER_NEW = "ballerinaTrigger/triggerNew"; @Test(description = "Test triggers endpoint of trigger service") public void testTriggersService() throws ExecutionException, InterruptedException { @@ -49,6 +51,17 @@ public void testTriggersService() throws ExecutionException, InterruptedExceptio Assert.assertTrue(!response.getCentralTriggers().isEmpty()); } + @Test(description = "Test new triggers endpoint of trigger service") + public void testTriggersNewService() throws ExecutionException, InterruptedException { + Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); + + BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); + CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); + BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + + Assert.assertTrue(!response.getCentralTriggers().isEmpty()); + } + @Test(description = "Test trigger endpoint of trigger service") public void testTriggerService() throws ExecutionException, InterruptedException { Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); @@ -59,4 +72,29 @@ public void testTriggerService() throws ExecutionException, InterruptedException Assert.assertEquals(response.get("id").getAsString(), "2"); } + + @Test(description = "Test new trigger endpoint of trigger service") + public void testTriggerNewService() throws ExecutionException, InterruptedException { + Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); + + BallerinaTriggerRequest request = new BallerinaTriggerRequest("10002"); + CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); + JsonObject response = (JsonObject) result.get(); + + Assert.assertEquals(response.get("id").getAsString(), "10002"); + Assert.assertEquals(response.get("moduleName").getAsString(), "rabbitmq"); + } + + @Test(description = "Test new trigger endpoint of trigger service") + public void testTriggerNewServiceWithoutId() throws ExecutionException, InterruptedException { + Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); + + BallerinaTriggerRequest request = new BallerinaTriggerRequest("ballerina", "kafka", "kafka", + "*", "Kafka Event Listener"); + CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); + JsonObject response = (JsonObject) result.get(); + + Assert.assertEquals(response.get("id").getAsString(), "10001"); + Assert.assertEquals(response.get("moduleName").getAsString(), "kafka"); + } } From 293df8e29a072277c6efcc9e351e01bf57ffebe7 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Thu, 24 Oct 2024 08:20:06 +0530 Subject: [PATCH 21/42] Add more inbuilt triggers --- .../trigger/BallerinaTriggerService.java | 9 +- .../main/resources/inbuilt-triggers/ftp.json | 138 +++++++++++ .../main/resources/inbuilt-triggers/jms.json | 165 +++++++++++++ .../resources/inbuilt-triggers/kafka.json | 2 +- .../main/resources/inbuilt-triggers/mqtt.json | 201 +++++++++++++++ .../main/resources/inbuilt-triggers/nats.json | 233 ++++++++++++++++++ .../resources/inbuilt-triggers/rabbitmq.json | 10 +- .../ballerina/trigger/TriggerServiceTest.java | 12 +- 8 files changed, 760 insertions(+), 10 deletions(-) create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 2800f5d4fcfc..76b526531b58 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -52,6 +52,7 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; +import java.util.stream.Collectors; import static io.ballerina.projects.util.ProjectUtils.getAccessTokenOfCLI; import static io.ballerina.projects.util.ProjectUtils.initializeProxy; @@ -70,8 +71,12 @@ public class BallerinaTriggerService implements ExtendedLanguageServerService { public static final String BALLERINAX = "ballerinax"; private LanguageClient languageClient; private static final Map IN_BUILT_TRIGGERS = Map.of( - "10001", "kafka", - "10002", "rabbitmq" + "10006", "ftp", + "10005", "jms", + "10004", "mqtt", + "10003", "nats", + "10002", "rabbitmq", + "10001", "kafka" ); @Override diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json new file mode 100644 index 000000000000..510e49743725 --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json @@ -0,0 +1,138 @@ +{ + "id": 10006, + "name": "FTP Listener", + "type": "inbuilt", + "displayName": "FTP", + "documentation": "This Listener can be used to listen to file changes in a FTP server.", + "moduleName": "ftp", + "listenerProtocol": "ftp", + "displayAnnotation": { + "label": "FTP", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 15465, + "organization": "ballerina", + "name": "ftp", + "version": "2.11.0", + "platform": "java17", + "languageSpecificationVersion": "2024R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerina/ftp/2.11.0", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerina/ftp/2.11.0/ballerina-ftp-java17-2.11.0.bala?Expires=1729737633&Signature=Vt6WENHWLGFqM-qeVxaq1WFXKm42DI5EmrbMPXRjF1eK-8cRUgYOLP4K-sJMmw2l0RN8lXk-TMdygUPTp-PBnI57ATHA1C7lrO3BI68HSlcL5c6F-~S6bvEC~Vo66lLKlOwCj9ieXiWVP9zAr-ocDiLMiWXbhST5TS4fQ-Qzqda7-tdvCcfYZcf34CpBg5JH3Y5-VtqjPF54xKxPaYNx22XdwAzQlNEcWL~mGRTR~cnb2iL9FLUi0UWplOfIeuCbYPEUb4N78LqOgAacq5Et03SqJvx7zYGb~hueWa7Y9rY-KRliFLLJ~lgwAD7BOa7kweSKaJpQ8obqZZ3GWPckkw__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=ae9400754d769c92b58a0bb94ac468761701a68d5f5589e15de55551984efd22", + "summary": "This package provides an FTP/SFTP client, and an FTP/SFTP server listener implementation to facilitate an FTP/SFTP connection connected to a remote location.", + "readme": "## Package overview\n\nThis package provides an FTP\/SFTP client, and an FTP\/SFTP server listener implementation to facilitate an FTP\/SFTP connection connected to a remote location.\n\n### FTP client\n\nThe `ftp:Client` connects to an FTP server and performs various operations on the files. Currently, it supports the\ngeneric FTP operations; `get`, `delete`, `put`, `append`, `mkdir`, `rmdir`, `isDirectory`, `rename`, `size`, and\n`list`.\n\nAn FTP client is defined using the `protocol` and `host` parameters and optionally, the `port` and\n`auth`. Authentication configuration can be configured using the `auth` parameter for Basic Auth and\nprivate key.\n\nAn authentication-related configuration can be given to the FTP client with the `auth` configuration.\n\n##### Create a client\n\nThe following code creates an FTP client and performs the I\/O operations, which connect to the FTP server with Basic Auth.\n```ballerina\n\/\/ Define the FTP client configuration.\nftp:ClientConfiguration ftpConfig = {\n protocol: ftp:FTP,\n host: \"\",\n port: ,\n auth: {\n credentials: {\n username: \"\",\n password: \"\"\n }\n }\n};\n\n\/\/ Create the FTP client.\nftp:Client|ftp:Error ftpClient = new(ftpConfig);\n```\n\n##### Create a directory\n\nThe following code creates a directory in the remote FTP server.\n\n```ballerina\nftp:Error? mkdirResponse = ftpClient->mkdir(\"\");\n```\n\n##### Upload a file to a remote server\n\nThe following code uploads a file to a remote FTP server.\n\n```ballerina\nstream fileByteStream\n = check io:fileReadBlocksAsStream(putFilePath, );\nftp:Error? putResponse = ftpClient->put(\"\", fileByteStream);\n```\n\n##### Compress and upload a file to a remote server\n\nThe following code compresses and uploads a file to a remote FTP server.\n\n```ballerina\n\/\/ Set the optional boolean flag as 'true' to compress before uploading\nstream fileByteStream\n = check io:fileReadBlocksAsStream(putFilePath, );\nftp:Error? compressedPutResponse = ftpClient->put(\"\",\n fileByteStream, compressionType=ZIP);\n```\n\n##### Get the size of a remote file\n\nThe following code gets the size of a file in a remote FTP server.\n\n```ballerina\nint|ftp:Error sizeResponse = ftpClient->size(\"\");\n```\n\n##### Read the content of a remote file\n\nThe following code reads the content of a file in a remote FTP server.\n\n```ballerina\nstream|Error str = clientEP -> get(\"\");\nif (str is stream) {\n record {|byte[] value;|}|io:Error? arr1 = str.next();\n if (arr1 is record {|byte[] value;|}) {\n string fileContent = check strings:fromBytes(arr1.value);\n \/\/ `fileContent` is the `string` value of first byte array\n record {|byte[] value;|}|io:Error? arr2 = str.next();\n \/\/ Similarly following content chunks can be iteratively read with `next` method.\n \/\/ Final chunk will contain the terminal value which is `()`.\n }\n io:Error? closeResult = str.close();\n}\n```\n\n##### Rename\/move a remote file\n\nThe following code renames or moves a file to another location in the same remote FTP server.\n\n```ballerina\nftp:Error? renameResponse = ftpClient->rename(\"\",\n \"\");\n```\n\n##### Delete a remote file\n\nThe following code deletes a remote file in a remote FTP server.\n\n```ballerina\nftp:Error? deleteResponse = ftpClient->delete(\"\");\n```\n\n##### Remove a directory from a remote server\n\nThe following code removes a directory in a remote FTP server.\n\n```ballerina\nftp:Error? rmdirResponse = ftpClient->rmdir(\"\");\n```\n\n### FTP listener\n\nThe `ftp:Listener` is used to listen to a remote FTP location and trigger a `WatchEvent` type of event when new\nfiles are added to or deleted from the directory. The `fileResource` function is invoked when a new file is added\nand\/or deleted.\n\nAn FTP listener is defined using the mandatory `protocol`, `host`, and `path` parameters. The authentication\nconfiguration can be done using the `auth` parameter and the polling interval can be configured using the `pollingInterval` parameter.\nThe default polling interval is 60 seconds.\n\nThe `fileNamePattern` parameter can be used to define the type of files the FTP listener will listen to.\nFor instance, if the listener gets invoked for text files, the value `(.*).txt` can be given for the config.\n\nAn authentication-related configuration can be given to the FTP listener with the `auth` configuration.\n\n##### Create a listener\n\nThe FTP Listener can be used to listen to a remote directory. It will keep listening to the specified directory and\nnotify on file addition and deletion periodically.\n\n```ballerina\nlistener ftp:Listener remoteServer = check new({\n protocol: ftp:FTP,\n host: \"\",\n auth: {\n credentials: {\n username: \"\",\n password: \"\"\n }\n },\n port: ,\n path: \"\",\n pollingInterval: ,\n fileNamePattern: \"\"\n});\n\nservice on remoteServer {\n remote function onFileChange(ftp:WatchEvent fileEvent) {\n\n foreach ftp:FileInfo addedFile in fileEvent.addedFiles {\n log:print(\"Added file path: \" + addedFile.path);\n }\n foreach string deletedFile in fileEvent.deletedFiles {\n log:print(\"Deleted file path: \" + deletedFile);\n }\n }\n}\n```\n\n### Secure access with SFTP\n\nSFTP is a secure protocol alternative to the FTP, which runs on top of the SSH protocol.\nThere are several ways to authenticate an SFTP server. One is using the username and the password.\nAnother way is using the client's private key. The Ballerina SFTP client and the listener support only those authentication standards.\nAn authentication-related configuration can be given to the SFTP client\/listener with the `auth` configuration.\nPassword-based authentication is defined with the `credentials` configuration while the private key based authentication is defined with the `privateKey` configuration.\n\n#### SFTP client configuration\n\n```ballerina\nftp:ClientConfiguration sftpConfig = {\n protocol: ftp:SFTP,\n host: \"\",\n port: ,\n auth: {\n credentials: {username: \"\", password: \"\"},\n privateKey: {\n path: \"\",\n password: \"\"\n }\n }\n};\n```\n\n#### SFTP listener configuration\n\n```ballerina\nlistener ftp:Listener remoteServer = check new({\n protocol: ftp:SFTP,\n host: \"\",\n port: ,\n path: \"\",\n pollingInterval: ,\n fileNamePattern: \"\",\n auth: {\n credentials: {username: \"\", password: \"\"},\n privateKey: {\n path: \"\",\n password: \"\"\n }\n }\n});\n```\n\n## Report issues\n\nTo report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina standard library parent repository](https:\/\/github.com\/ballerina-platform\/ballerina-standard-library).\n\n## Useful links\n\n- Chat live with us via our [Discord server](https:\/\/discord.gg\/ballerinalang).\n- Post all technical questions on Stack Overflow with the [#ballerina](https:\/\/stackoverflow.com\/questions\/tagged\/ballerina) tag.", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerina-ftp", + "keywords": [ + "FTP", + "SFTP", + "remote file", + "file transfer", + "client", + "service" + ], + "ballerinaVersion": "2201.10.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerina_ftp_2.11.0.png", + "ownerUUID": "ecc9b221-6e0c-4c60-93fe-40e1b877a313", + "createdDate": 1724139776000, + "pullCount": 44, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerina/ftp/2.11.0", + "apiDocURL": "https://lib.ballerina.io/ballerina/ftp/2.11.0", + "name": "ftp", + "summary": "This module provides an FTP/SFTP client and an FTP/SFTP server listener implementation to facilitate an FTP/SFTP connection connected to a remote location.", + "readme": "## Overview\n\nThis module provides an FTP\/SFTP client and an FTP\/SFTP server listener implementation to facilitate an FTP\/SFTP connection connected to a remote location.\n\n### FTP client\n\nThe `ftp:Client` connects to an FTP server and performs various operations on the files. Currently, it supports the\ngeneric FTP operations; `get`, `delete`, `put`, `append`, `mkdir`, `rmdir`, `isDirectory`, `rename`, `size`, and\n `list`.\n\nAn FTP client is defined using the `protocol` and `host` parameters and optionally, the `port` and\n`auth`. Authentication configuration can be configured using the `auth` parameter for Basic Auth and\nprivate key.\n\nAn authentication-related configuration can be given to the FTP client with the `auth` configuration.\n\n##### Create a client\n\nThe following code creates an FTP client and performs the I\/O operations, which connect to the FTP server with Basic Auth.\n```ballerina\n\/\/ Define the FTP client configuration.\nftp:ClientConfiguration ftpConfig = {\n protocol: ftp:FTP,\n host: \"\",\n port: ,\n auth: {\n credentials: {\n username: \"\",\n password: \"\"\n }\n }\n};\n\n\/\/ Create the FTP client.\nftp:Client|ftp:Error ftpClient = new(ftpConfig);\n```\n\n##### Create a directory\n\nThe following code creates a directory in the remote FTP server.\n\n```ballerina\nftp:Error? mkdirResponse = ftpClient->mkdir(\"\");\n```\n\n##### Upload a file to a remote server\n\nThe following code uploads a file to a remote FTP server.\n\n```ballerina\nstream fileByteStream\n = check io:fileReadBlocksAsStream(putFilePath, );\nftp:Error? putResponse = ftpClient->put(\"\", fileByteStream);\n```\n\n##### Compress and upload a file to a remote server\n\nThe following code compresses and uploads a file to a remote FTP server.\n\n```ballerina\n\/\/ Set the optional boolean flag as 'true' to compress before uploading\nstream fileByteStream\n = check io:fileReadBlocksAsStream(putFilePath, );\nftp:Error? compressedPutResponse = ftpClient->put(\"\",\n fileByteStream, compressionType=ZIP);\n```\n\n##### Get the size of a remote file\n\nThe following code gets the size of a file in a remote FTP server.\n\n```ballerina\nint|ftp:Error sizeResponse = ftpClient->size(\"\");\n```\n\n##### Read the content of a remote file\n\nThe following code reads the content of a file in a remote FTP server.\n\n```ballerina\nstream|Error str = clientEP -> get(\"\");\nif (str is stream) {\n record {|byte[] value;|}|io:Error? arr1 = str.next();\n if (arr1 is record {|byte[] value;|}) {\n string fileContent = check strings:fromBytes(arr1.value);\n \/\/ `fileContent` is the `string` value of first byte array\n record {|byte[] value;|}|io:Error? arr2 = str.next();\n \/\/ Similarly following content chunks can be iteratively read with `next` method.\n \/\/ Final chunk will contain the terminal value which is `()`.\n }\n io:Error? closeResult = str.close();\n}\n```\n\n##### Rename\/move a remote file\n\nThe following code renames or moves a file to another location in the same remote FTP server.\n\n```ballerina\nftp:Error? renameResponse = ftpClient->rename(\"\",\n \"\");\n```\n\n##### Delete a remote file\n\nThe following code deletes a remote file in a remote FTP server.\n\n```ballerina\nftp:Error? deleteResponse = ftpClient->delete(\"\");\n```\n\n##### Remove a directory from a remote server\n\nThe following code removes a directory in a remote FTP server.\n\n```ballerina\nftp:Error? rmdirResponse = ftpClient->rmdir(\"\");\n```\n\n### FTP listener\n\nThe `ftp:Listener` is used to listen to a remote FTP location and trigger a `WatchEvent` type of event when new\nfiles are added to or deleted from the directory. The `fileResource` function is invoked when a new file is added\nand\/or deleted.\n\nAn FTP listener is defined using the mandatory `protocol`, `host`, and `path` parameters. The authentication\nconfiguration can be done using the `auth` parameter and the polling interval can be configured using the `pollingInterval` parameter.\nThe default polling interval is 60 seconds.\n\nThe `fileNamePattern` parameter can be used to define the type of files the FTP listener will listen to.\nFor instance, if the listener gets invoked for text files, the value `(.*).txt` can be given for the config.\n\nAn authentication-related configuration can be given to the FTP listener with the `auth` configuration.\n\n##### Create a listener\n\nThe FTP Listener can be used to listen to a remote directory. It will keep listening to the specified directory and\nnotify on file addition and deletion periodically.\n\n```ballerina\nlistener ftp:Listener remoteServer = check new({\n protocol: ftp:FTP,\n host: \"\",\n auth: {\n credentials: {\n username: \"\",\n password: \"\"\n }\n },\n port: ,\n path: \"\",\n pollingInterval: ,\n fileNamePattern: \"\"\n});\n\nservice on remoteServer {\n remote function onFileChange(ftp:WatchEvent fileEvent) {\n\n foreach ftp:FileInfo addedFile in fileEvent.addedFiles {\n log:print(\"Added file path: \" + addedFile.path);\n }\n foreach string deletedFile in fileEvent.deletedFiles {\n log:print(\"Deleted file path: \" + deletedFile);\n }\n }\n}\n```\n\n### Secure access with SFTP\n\nSFTP is a secure protocol alternative to the FTP, which runs on top of the SSH protocol.\nThere are several ways to authenticate an SFTP server. One is using the username and the password.\nAnother way is using the client's private key. The Ballerina SFTP client and the listener support only those authentication standards.\nAn authentication-related configuration can be given to the SFTP client\/listener with the `auth` configuration.\nPassword-based authentication is defined with the `credentials` configuration while the private key based authentication is defined with the `privateKey` configuration.\n\n#### SFTP client configuration\n\n```ballerina\nftp:ClientConfiguration sftpConfig = {\n protocol: ftp:SFTP,\n host: \"\",\n port: ,\n auth: {\n credentials: {username: \"\", password: \"\"},\n privateKey: {\n path: \"\",\n password: \"\"\n }\n }\n};\n```\n\n#### SFTP listener configuration\n\n```ballerina\nlistener ftp:Listener remoteServer = check new({\n protocol: ftp:SFTP,\n host: \"\",\n port: ,\n path: \"\",\n pollingInterval: ,\n fileNamePattern: \"\",\n auth: {\n credentials: {username: \"\", password: \"\"},\n privateKey: {\n path: \"\",\n password: \"\"\n }\n }\n});\n```" + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Service", + "description": "FTP Service", + "functions": [ + { + "name": "OnFileChange", + "documentation": "The function which will be triggered when a file change event occurs.", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "event", + "typeName": "ftp:WatchEvent & readonly|ftp:WatchEvent", + "optional": false, + "type": [ + "ftp:WatchEvent & readonly", + "ftp:WatchEvent" + ], + "typeInfo": { + "name": "WatchEvent", + "orgName": "ballerina", + "moduleName": "ftp", + "version": "2.11.0" + }, + "defaultTypeName": "ftp:WatchEvent & readonly" + }, + { + "name": "caller", + "typeName": "ftp:Caller", + "type": [ + "ftp:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerina", + "moduleName": "ftp", + "version": "2.11.0" + }, + "optional": true, + "documentation": "Caller object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + } + ] + } + ], + "listenerParams": [ + { + "name": "listenerConfig", + "typeName": "ftp:ListenerConfiguration", + "type": [ + "ftp:ListenerConfiguration" + ], + "optional": false, + "defaultable": false, + "typeInfo": { + "name": "ListenerConfiguration", + "orgName": "ballerina", + "moduleName": "ftp", + "version": "2.11.0" + }, + "documentation": "Configuration for FTP listener" + } + ] +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json new file mode 100644 index 000000000000..5ea4c513b0c1 --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json @@ -0,0 +1,165 @@ +{ + "id": 10005, + "name": "JMS Event Listener", + "type": "inbuilt", + "displayName": "JMS", + "documentation": "This Listener can be used to listen to JMS messages from a JMS broker.", + "moduleName": "java.jms", + "listenerProtocol": "jms", + "displayAnnotation": { + "label": "jms", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 14134, + "organization": "ballerinax", + "name": "java.jms", + "version": "1.0.1", + "platform": "java17", + "languageSpecificationVersion": "2023R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/java.jms/1.0.1", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/java.jms/1.0.1/ballerinax-java.jms-java17-1.0.1.bala?Expires=1729736702&Signature=iGZK64YQyN7Ebpk8hVOtguqSkJitQbQPp7nJyT1DA50dHOWsbbYzO~39iXFbKCyyzsrf3CUWOj1fAK~TYwO-oZ0nGOH9t5ZOnlxRkh39r~76TpojOpGWkhydKJRfy5yEVdC5DV6WkbO2j13ruXELJnxDjsjAAN7QeAXR0xPwUw1785FqhrHNC0odeDEF7rtWmTZ~KoulrCXmsTO4o8p9Z9ig7IsXai7Ev~UHqIfamaoeiPVrfoAo9uM9lCZejn0uoi7Dw6-OkyrT65OmODqsDXudXiEAUD5WsL5r4edXBxoPbYSIzq0UhEMd2393MMuf3~K8YSGONWZlPSO4k--FmQ__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=532c8a3f906efa50d5c91cc163ed794665b5d19ce9a77e9a75fc2f33b45405bf", + "summary": "The `ballerinax/java.jms` package provides an API to connect to an external JMS provider like ActiveMQ from Ballerina.", + "readme": "## Package overview\n\nThe `ballerinax\/java.jms` package provides an API to connect to an external JMS provider like ActiveMQ from Ballerina.\n\nThis package is created with minimal deviation from the JMS API to make it easy for the developers who are used to working with the JMS API. This package is written to support both JMS 2.0 and JMS 1.0 API. \n \nCurrently, the following JMS API Classes are supported through this package.\n \n - Connection\n - Session\n - Destination (Queue, Topic, TemporaryQueue, TemporaryTopic)\n - Message (TextMessage, MapMessage, BytesMessage)\n - MessageConsumer\n - MessageProducer\n \n The following sections provide details on how to use the JMS connector.\n \n - [Samples](#samples)\n\n## Samples\n\n### JMS message Producer\n\nThe following Ballerina program sends messages to a queue named *MyQueue*.\n\n```ballerina\nimport ballerinax\/activemq.driver as _;\nimport ballerinax\/java.jms;\n\npublic function main() returns error? {\n jms:Connection connection = check new (\n initialContextFactory = \"org.apache.activemq.jndi.ActiveMQInitialContextFactory\",\n providerUrl = \"tcp:\/\/localhost:61616\"\n );\n jms:Session session = check connection->createSession();\n jms:MessageProducer producer = check session.createProducer({\n 'type: jms:QUEUE,\n name: \"MyQueue\"\n });\n jms:TextMessage msg = {\n content: \"Hello Ballerina!\"\n };\n check producer->send(msg);\n}\n```\n\n## JMS message consumer\nThe following Ballerina program receives messages from a queue named *MyQueue*.\n```ballerina\nimport ballerinax\/activemq.driver as _;\nimport ballerinax\/java.jms;\nimport ballerina\/log;\n\npublic function main() returns error? {\n jms:Connection connection = check new (\n initialContextFactory = \"org.apache.activemq.jndi.ActiveMQInitialContextFactory\",\n providerUrl = \"tcp:\/\/localhost:61616\"\n );\n jms:Session session = check connection->createSession();\n jms:MessageConsumer consumer = check session.createConsumer(\n destination = {\n 'type: jms:QUEUE,\n name: \"MyQueue\"\n });\n while true {\n jms:Message? response = check consumer->receive(3000);\n if response is jms:TextMessage {\n log:printInfo(\"Message received: \", content = response.toString());\n }\n }\n}\n```\n\n### Asynchronous message consumer\n\nOne of the key deviations from the JMS API was the asynchronous message consumption using message listeners. In \nBallerina transport listener concept is covered with **service** type, hence we have used the Ballerina service to \nimplement the message listener. Following is a message listener example listening on a queue named *MyQueue*.\n\n```ballerina\nimport ballerinax\/activemq.driver as _;\nimport ballerina\/log;\nimport ballerinax\/java.jms;\n\nservice \"consumer-service\" on new jms:Listener(\n connectionConfig = {\n initialContextFactory: \"org.apache.activemq.jndi.ActiveMQInitialContextFactory\",\n providerUrl: \"tcp:\/\/localhost:61616\"\n },\n consumerOptions = {\n destination: {\n 'type: jms:QUEUE,\n name: \"MyQueue\"\n }\n }\n) {\n remote function onMessage(jms:Message message) returns error? {\n if message is jms:TextMessage {\n log:printInfo(\"Text message received\", content = message.content);\n }\n }\n}\n```", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerina-java.jms", + "keywords": [ + "jms" + ], + "ballerinaVersion": "2201.8.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_java.jms_1.0.1.png", + "ownerUUID": "02ea02ee-e509-41d5-bb61-60467748ddc5", + "createdDate": 1710919297000, + "pullCount": 36, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/java.jms/1.0.1", + "apiDocURL": "https://lib.ballerina.io/ballerinax/java.jms/1.0.1", + "name": "java.jms", + "summary": "The `ballerinax/java.jms` module provides an API to connect to an external JMS provider like ActiveMQ from Ballerina.", + "readme": "## Overview\n\nThe `ballerinax\/java.jms` module provides an API to connect to an external JMS provider like ActiveMQ from Ballerina.\n\nThis module is created with minimal deviation from the JMS API to make it easy for the developers who are used to working \n with the JMS API. This module is written to support both JMS 2.0 and JMS 1.0 API. \n \nCurrently, the following JMS API Classes are supported through this module.\n \n - Connection\n - Session\n - Destination (Queue, Topic, TemporaryQueue, TemporaryTopic)\n - Message (TextMessage, MapMessage, BytesMessage)\n - MessageConsumer\n - MessageProducer\n \n The following sections provide details on how to use the JMS connector.\n \n - [Samples](#samples)\n\n## Samples\n\n### JMS message Producer\n\nThe following Ballerina program sends messages to a queue named *MyQueue*.\n\n```ballerina\nimport ballerinax\/activemq.driver as _;\nimport ballerinax\/java.jms;\n\npublic function main() returns error? {\n jms:Connection connection = check new (\n initialContextFactory = \"org.apache.activemq.jndi.ActiveMQInitialContextFactory\",\n providerUrl = \"tcp:\/\/localhost:61616\"\n );\n jms:Session session = check connection->createSession();\n jms:MessageProducer producer = check session.createProducer({\n 'type: jms:QUEUE,\n name: \"MyQueue\"\n });\n jms:TextMessage msg = {\n content: \"Hello Ballerina!\"\n };\n check producer->send(msg);\n}\n```\n\n## JMS message consumer\nThe following Ballerina program receives messages from a queue named *MyQueue*.\n```ballerina\nimport ballerinax\/activemq.driver as _;\nimport ballerinax\/java.jms;\nimport ballerina\/log;\n\npublic function main() returns error? {\n jms:Connection connection = check new (\n initialContextFactory = \"org.apache.activemq.jndi.ActiveMQInitialContextFactory\",\n providerUrl = \"tcp:\/\/localhost:61616\"\n );\n jms:Session session = check connection->createSession();\n jms:MessageConsumer consumer = check session.createConsumer(\n destination = {\n 'type: jms:QUEUE,\n name: \"MyQueue\"\n });\n while true {\n jms:Message? response = check consumer->receive(3000);\n if response is jms:TextMessage {\n log:printInfo(\"Message received: \", content = response.toString());\n }\n }\n}\n```\n\n### Asynchronous message consumer\n\nOne of the key deviations from the JMS API was the asynchronous message consumption using message listeners. In \nBallerina transport listener concept is covered with **service** type, hence we have used the Ballerina service to \nimplement the message listener. Following is a message listener example listening on a queue named *MyQueue*.\n\n```ballerina\nimport ballerinax\/activemq.driver as _;\nimport ballerina\/log;\nimport ballerinax\/java.jms;\n\nservice \"consumer-service\" on new jms:Listener(\n connectionConfig = {\n initialContextFactory: \"org.apache.activemq.jndi.ActiveMQInitialContextFactory\",\n providerUrl: \"tcp:\/\/localhost:61616\"\n },\n consumerOptions = {\n destination: {\n 'type: jms:QUEUE,\n name: \"MyQueue\"\n }\n }\n) {\n remote function onMessage(jms:Message message) returns error? {\n if message is jms:TextMessage {\n log:printInfo(\"Text message received\", content = message.content);\n }\n }\n}\n```" + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Service", + "description": "JMS Service", + "functions": [ + { + "name": "OnMessage", + "documentation": "The function which will be triggered when a message is received from the JMS broker", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "jms:Message", + "optional": false, + "type": [ + "jms:Message" + ], + "typeInfo": { + "name": "Message", + "orgName": "ballerinax", + "moduleName": "java.jms", + "version": "1.0.1" + } + }, + { + "name": "caller", + "typeName": "jms:Caller", + "type": [ + "jms:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerinax", + "moduleName": "java.jms", + "version": "1.0.1" + }, + "optional": true, + "documentation": "Caller object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + }, + { + "name": "OnError", + "documentation": "The function which will be triggered when an error occurs", + "optional": true, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "err", + "typeName": "jms:error", + "type": [ + "jms:error" + ], + "optional": false, + "typeInfo": { + "name": "Error", + "orgName": "ballerinax", + "moduleName": "java.jms", + "version": "1.0.1" + }, + "documentation": "Error object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + } + ] + } + ], + "listenerParams": [ + { + "name": "listenerConfig", + "typeName": "jms:ListenerConfiguration", + "type": [ + "jms:ListenerConfiguration" + ], + "optional": false, + "defaultable": false, + "typeInfo": { + "name": "ListenerConfiguration", + "orgName": "ballerinax", + "moduleName": "java.jms", + "version": "1.0.1" + }, + "documentation": "Message listener configurations" + } + ] +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json index 012fd69839e9..0e7b251d4fce 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json @@ -173,4 +173,4 @@ "documentation": "Configuration for the Kafka Consumer" } ] -} \ No newline at end of file +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json new file mode 100644 index 000000000000..fac3512a42fe --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json @@ -0,0 +1,201 @@ +{ + "id": 10004, + "name": "MQTT Event Listener", + "type": "inbuilt", + "displayName": "MQTT", + "documentation": "This Listener can be used to listen to messages from an MQTT broker.", + "moduleName": "mqtt", + "listenerProtocol": "mqtt", + "displayAnnotation": { + "label": "MQTT", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 15474, + "organization": "ballerina", + "name": "mqtt", + "version": "1.2.0", + "platform": "java17", + "languageSpecificationVersion": "2024R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerina/mqtt/1.2.0", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerina/mqtt/1.2.0/ballerina-mqtt-java17-1.2.0.bala?Expires=1729736003&Signature=u0gRsw-prRH8Cp4RpeXli0h46~80JeTWeloZI2i7BeM9VANXNDRaHVvK496K-mYjnitBCzM-jUX2UuhYNPTPWLywk0qFJAWYK1-ZpZ89Hoe6Nfm34CQQjmm55esvZOB1MjtJKxTeE-4FenhtcLPMO839IDQbrT3RywG-2zdo8UfAC1Xhm2WUNHSSsA53Pt6SbAi1RV7~wwM6hVjfgLrDIdBJpKa5uFPlIP-9kGSWm761LLRrfWd1ITf-CFmuET-FWAngAdOd1aOo1SD06m53nv4uo1ilQ-bPHRUUUNuNHZe5RUrElZLyQrm61Si048TE88POz5QIk9vt7-B7gE6eEA__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=fd072ae39af5a1928aab6b10ce920efd483024d2fa032f129e8d409fbfc50a0f", + "summary": "This package provides an implementation to interact with MQTT servers via MQTT client and listener.", + "readme": "## Overview\nThis package provides an implementation to interact with MQTT servers via MQTT client and listener.\n\nMQTT is a lightweight, publish-subscribe, machine to machine network protocol for message queue\/message queuing service.\n\n### Publisher and subscriber\n#### MQTT publisher\nA MQTT publisher is a MQTT client that publishes messages to the MQTT server. When working with a MQTT client, the first thing to do is to initialize the client.\nFor the publisher to work successfully, an active MQTT server should be available.\n\nThe code snippet given below initializes a publisher client with the basic configuration.\n```ballerina\nimport ballerina\/mqtt;\nimport ballerina\/uuid;\n \nmqtt:ClientConfiguration clientConfiguration = {\n connectionConfig: {\n username: \"ballerina\",\n password: \"ballerinamqtt\"\n }\n};\n\nmqtt:Client mqttClient = check new (mqtt:DEFAULT_URL, uuid:createType1AsString(), clientConfiguration); \/\/ A unique id needs to be provided as the client id\n```\nUsing the `publish` api of this client, messages can be sent to the MQTT server.\n```ballerina\ncheck mqttClient->publish(\"mqtt\/test\", {payload: \"This is Ballerina MQTT client!!!\".toBytes()});\n```\n#### MQTT subscriber\nA MQTT subscriber is a client responsible for reading messages from one or more topics in the server. When working with a MQTT subscriber, the first thing to do is initialize the subscriber.\nFor the subscriber to work successfully, an active MQTT server should be available.\n\nThe code snippet given below initializes a subscriber with the basic configuration.\n```ballerina\nmqtt:ListenerConfiguration listenerConfiguration = {\n connectionConfig: {\n username: \"ballerina\",\n password: \"ballerinamqtt\"\n },\n manualAcks: false \/\/ When set to false, the MQTT acknowledgements are not sent automatically by the subscriber\n};\n\nmqtt:Listener mqttSubscriber = check new (mqtt:DEFAULT_URL, uuid:createType1AsString(), \"mqtt\/test\", listenerConfiguration);\n```\nThis subscriber can be used in the `mqtt:Service` to listen to messages in `mqtt\/test` topic.\n```ballerina\nservice on mqttSubscriber {\n remote function onMessage(mqtt:Message message, mqtt:Caller caller) returns error? {\n log:printInfo(check string:fromBytes(message.payload));\n check caller->complete();\n }\n\n remote function onError(mqtt:Error err) returns error? {\n log:printError(\"Error occured \", err);\n }\n}\n```\nThe `mqtt:Caller` can be used to indicate that the application has completed processing the message by using `complete()` api.", + "template": false, + "licenses": [], + "authors": [ + "ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerina-mqtt", + "keywords": [ + "mqtt", + "client", + "messaging", + "network", + "pubsub", + "iot" + ], + "ballerinaVersion": "2201.10.0", + "icon": "", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1724140280000, + "pullCount": 44, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerina/mqtt/1.2.0", + "apiDocURL": "https://lib.ballerina.io/ballerina/mqtt/1.2.0", + "name": "mqtt", + "summary": "This module provides an implementation to interact with MQTT servers via MQTT client and listener.", + "readme": "## Overview\nThis module provides an implementation to interact with MQTT servers via MQTT client and listener.\n\nMQTT is a lightweight, publish-subscribe, machine to machine network protocol for message queue\/message queuing service.\n\n### Publisher and subscriber\n#### MQTT publisher\nA MQTT publisher is a MQTT client that publishes messages to the MQTT server. When working with a MQTT client, the first thing to do is to initialize the client.\nFor the publisher to work successfully, an active MQTT server should be available.\n\nThe code snippet given below initializes a publisher client with the basic configuration.\n```ballerina\nimport ballerina\/mqtt;\nimport ballerina\/uuid;\n \nmqtt:ClientConfiguration clientConfiguration = {\n connectionConfig: {\n username: \"ballerina\",\n password: \"ballerinamqtt\"\n }\n};\n\nmqtt:Client mqttClient = check new (mqtt:DEFAULT_URL, uuid:createType1AsString(), clientConfiguration); \/\/ A unique id needs to be provided as the client id\n```\nUsing the `publish` api of this client, messages can be sent to the MQTT server.\n```ballerina\ncheck mqttClient->publish(\"mqtt\/test\", {payload: \"This is Ballerina MQTT client!!!\".toBytes()});\n```\n#### MQTT subscriber\nA MQTT subscriber is a client responsible for reading messages from one or more topics in the server. When working with a MQTT subscriber, the first thing to do is initialize the subscriber.\nFor the subscriber to work successfully, an active MQTT server should be available.\n\nThe code snippet given below initializes a subscriber with the basic configuration.\n```ballerina\nmqtt:ListenerConfiguration listenerConfiguration = {\n connectionConfig: {\n username: \"ballerina\",\n password: \"ballerinamqtt\"\n },\n manualAcks: false \/\/ When set to false, the MQTT acknowledgements are not sent automatically by the subscriber\n};\n\nmqtt:Listener mqttSubscriber = check new (mqtt:DEFAULT_URL, uuid:createType1AsString(), \"mqtt\/test\", listenerConfiguration);\n```\nThis subscriber can be used in the `mqtt:Service` to listen to messages in `mqtt\/test` topic.\n```ballerina\nservice on mqttSubscriber {\n remote function onMessage(mqtt:Message message, mqtt:Caller caller) returns error? {\n log:printInfo(check string:fromBytes(message.payload));\n check caller->complete();\n }\n\n remote function onError(mqtt:Error err) returns error? {\n log:printError(\"Error occured \", err);\n }\n}\n```\nThe `mqtt:Caller` can be used to indicate that the application has completed processing the message by using `complete()` api." + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Service", + "description": "MQTT Service", + "functions": [ + { + "name": "OnMessage", + "documentation": "The function which will be triggered when a message is received from the MQTT server", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "mqtt:Message", + "optional": false, + "type": [ + "mqtt:Message" + ], + "typeInfo": { + "name": "Message", + "orgName": "ballerina", + "moduleName": "mqtt", + "version": "1.2.0" + } + }, + { + "name": "caller", + "typeName": "mqtt:Caller", + "type": [ + "mqtt:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerina", + "moduleName": "mqtt", + "version": "1.2.0" + }, + "optional": true, + "documentation": "Caller object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + }, + { + "name": "OnError", + "documentation": "The function which will be triggered when an error occurs", + "optional": true, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "err", + "typeName": "mqtt:error", + "type": [ + "mqtt:error" + ], + "optional": false, + "typeInfo": { + "name": "Error", + "orgName": "ballerina", + "moduleName": "mqtt", + "version": "1.2.0" + }, + "documentation": "Error object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + } + ] + } + ], + "listenerParams": [ + { + "name": "serviceUri", + "typeName": "string", + "type": [ + "string" + ], + "optional": false, + "defaultable": false, + "documentation": "The URI of the remote MQTT server" + }, + { + "name": "clientId", + "typeName": "string", + "type": [ + "string" + ], + "optional": false, + "defaultable": false, + "documentation": "The unique client ID to identify the listener" + }, + { + "name": "subscriptions", + "typeName": "string|string[]|mqtt:Subscription|mqtt:Subscription[]", + "type": [ + "string", + "string[]", + "mqtt:Subscription", + "mqtt:Subscription[]" + ], + "optional": false, + "defaultable": false, + "documentation": "The topics to be subscribed to" + }, + { + "name": "config", + "typeName": "mqtt:ListenerConfiguration", + "type": [ + "mqtt:ListenerConfiguration" + ], + "optional": true, + "typeInfo": { + "name": "ListenerConfiguration", + "orgName": "ballerina", + "moduleName": "mqtt", + "version": "1.2.0" + }, + "defaultable": false, + "documentation": "The listener configurations" + } + ] +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json new file mode 100644 index 000000000000..47636052a48f --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json @@ -0,0 +1,233 @@ +{ + "id": 10003, + "name": "NATS Event Listener", + "type": "inbuilt", + "displayName": "NATS", + "documentation": "This Listener can be used to listen to messages from a NATS server.", + "moduleName": "nats", + "listenerProtocol": "nats", + "displayAnnotation": { + "label": "NATS", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 15727, + "organization": "ballerinax", + "name": "nats", + "version": "3.1.0", + "platform": "java17", + "languageSpecificationVersion": "2024R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/nats/3.1.0", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/nats/3.1.0/ballerinax-nats-java17-3.1.0.bala?Expires=1729734714&Signature=zi0ymoW3~H-QcrUyFYSIKuHH3S2SDQC6hvvFrOo9Ev1HzSNIbtpmDsMUpRT6tm5lHVooNTqvInoP-rFG4tFuQ0~vzjcMxk7pjEeCR6PFfH~pN0qEoXe1q7~Y6agp9omjpp61CJ8i~9O1mFl-D3z~5qx4VhzSzi741Kr~fjBI9qWWVM1mrK8IyIWUbN7G3TsTF7QwTDLBemdl3XI21NHpabv71CfNp26LfhST-DQEC0yZmIdIsYq8JARe~JPCfUnaFSHVCcNZjmN5QygXQnI8FngSkb8N8uoKfgSkRJ2GUVfUjYnq4bVOvRWRNIzdQSaveu5O7jQkPuO-L7zckgtoQQ__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=835e5b66b017233318eef15766f44d075b9181ab5a23d69d03d55afb4e9b1e9b", + "summary": "This package provides the capability to send and receive messages by connecting to the NATS server.", + "readme": "## Package Overview\n\nThis package provides the capability to send and receive messages by connecting to the NATS server.\n\nNATS messaging enables the communication of data that is segmented into messages among computer applications and services. Data is encoded and framed as a message and sent by a publisher. The message is received, decoded, and processed by one or more subscribers. NATS makes it easy for programs to communicate across different environments, languages, cloud providers, and on-premise systems. Clients connect to the NATS system usually via a single URL and then subscribe or publish messages to a subject.\n\n### Basic usage\n\n#### Set up the connection\n\nFirst, you need to set up the connection with the NATS Basic server. The following ways can be used to connect to a\nNATS Basic server.\n\n1. Connect to a server using the default URL:\n```ballerina\nnats:Client natsClient = check new(nats:DEFAULT_URL);\n```\n\n2. Connect to a server using the URL:\n```ballerina\nnats:Client natsClient = check new(\"nats:\/\/serverone:4222\");\n```\n\n3. Connect to one or more servers with custom configurations:\n```ballerina\nnats:ConnectionConfiguration config = {\n connectionName: \"my-nats\",\n noEcho: true\n};\nnats:Client natsClient = check new([\"nats:\/\/serverone:4222\", \"nats:\/\/servertwo:4222\"], config);\n```\n\n#### Publish messages\n\n##### Publish messages to the NATS basic server\n\nOnce connected, publishing is accomplished via one of the three methods below.\n\n1. Publish with the subject and the message content:\n```ballerina\nstring message = \"hello world\";\nnats:Error? result = \n natsClient->publishMessage({ content: message.toBytes(), subject: \"demo.nats.basic\"});\n```\n\n2. Publish as a request that expects a reply:\n```ballerina\nstring message = \"hello world\";\nnats:AnydataMessage|nats:Error reqReply = \n natsClient->requestMessage({ content: message.toBytes(), subject: \"demo.nats.basic\"}, 5);\n```\n\n3. Publish messages with a `replyTo` subject:\n```ballerina\nstring message = \"hello world\";\nnats:Error? result = natsClient->publish({ content: message.toBytes(), subject: \"demo.nats.basic\",\n replyTo: \"demo.reply\" });\n```\n\n#### Listen to incoming messages\n\n##### Listen to messages from a NATS server\n\n1. Listen to incoming messages with the `onMessage` remote method:\n```ballerina\n\/\/ Binds the consumer to listen to the messages published to the 'demo.example.*' subject\n@nats:ServiceConfig {\n subject: \"demo.example.*\"\n}\nservice nats:Service on new nats:Listener(nats:DEFAULT_URL) {\n\n remote function onMessage(nats:AnydataMessage message) {\n }\n}\n```\n\n2. Listen to incoming messages and reply directly with the `onRequest` remote method:\n```ballerina\n\/\/ Binds the consumer to listen to the messages published to the 'demo.example.*' subject\n@nats:ServiceConfig {\n subject: \"demo.example.*\"\n}\nservice nats:Service on new nats:Listener(nats:DEFAULT_URL) {\n\n \/\/ The returned message will be published to the replyTo subject of the consumed message\n remote function onRequest(nats:AnydataMessage message) returns string? {\n return \"Reply Message\";\n }\n}\n```\n\n### Advanced usage\n\n#### Set up TLS\n\nThe Ballerina NATS package allows the use of TLS in communication. This setting expects a secure socket to be\nset in the connection configuration as shown below.\n\n##### Configure TLS in the `nats:Listener`\n```ballerina\nnats:SecureSocket secured = {\n cert: {\n path: \"\/truststore.p12\",\n password: \"password\"\n },\n key: {\n path: \"\/keystore.p12\",\n password: \"password\"\n }\n};\nnats:Listener natsListener = check new(\"nats:\/\/serverone:4222\", secureSocket = secured);\n```\n\n##### Configure TLS in the `nats:Client`\n```ballerina\nnats:SecureSocket secured = {\n cert: {\n path: \"\/truststore.p12\",\n password: \"password\"\n },\n key: {\n path: \"\/keystore.p12\",\n password: \"password\"\n }\n};\nnats:Client natsClient = check new(\"nats:\/\/serverone:4222\", secureSocket = secured);\n```\n\n### Report issues\n\nTo report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina standard library parent repository](https:\/\/github.com\/ballerina-platform\/ballerina-standard-library).\n\n### Useful links\n\n- Chat live with us via our [Discord server](https:\/\/discord.gg\/ballerinalang).\n- Post all technical questions on Stack Overflow with the [#ballerina](https:\/\/stackoverflow.com\/questions\/tagged\/ballerina) tag.", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerinax-nats", + "keywords": [ + "service", + "client", + "messaging", + "network", + "pubsub" + ], + "ballerinaVersion": "2201.10.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_nats_3.1.0.png", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1724302519000, + "pullCount": 32, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/nats/3.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/nats/3.1.0", + "name": "nats", + "summary": "This module provides the capability to send and receive messages by connecting to the NATS server.", + "readme": "## Overview\n\nThis module provides the capability to send and receive messages by connecting to the NATS server.\n\nNATS messaging enables the communication of data that is segmented into messages among computer applications and services. Data is encoded and framed as a message and sent by a publisher. The message is received, decoded, and processed by one or more subscribers. NATS makes it easy for programs to communicate across different environments, languages, cloud providers, and on-premise systems. Clients connect to the NATS system usually via a single URL and then subscribe or publish messages to a subject.\n\n### Basic usage\n\n#### Set up the connection\n\nFirst, you need to set up the connection with the NATS Basic server. The following ways can be used to connect to a\nNATS Basic server.\n\n1. Connect to a server using the default URL:\n```ballerina\nnats:Client natsClient = check new(nats:DEFAULT_URL);\n```\n\n2. Connect to a server using the URL:\n```ballerina\nnats:Client natsClient = check new(\"nats:\/\/serverone:4222\");\n```\n\n3. Connect to one or more servers with custom configurations:\n```ballerina\nnats:ConnectionConfiguration config = {\n connectionName: \"my-nats\",\n noEcho: true\n};\nnats:Client natsClient = check new([\"nats:\/\/serverone:4222\", \"nats:\/\/servertwo:4222\"], config);\n```\n\n#### Publish messages\n\n##### Publish messages to the NATS basic server\n\nOnce connected, publishing is accomplished via one of the three methods below.\n\n1. Publish with the subject and the message content:\n```ballerina\nstring message = \"hello world\";\nnats:Error? result = \n natsClient->publishMessage({ content: message.toBytes(), subject: \"demo.nats.basic\"});\n```\n\n2. Publish as a request that expects a reply:\n```ballerina\nstring message = \"hello world\";\nnats:AnydataMessage|nats:Error reqReply = \n natsClient->requestMessage({ content: message.toBytes(), subject: \"demo.nats.basic\"}, 5);\n```\n\n3. Publish messages with a `replyTo` subject:\n```ballerina\nstring message = \"hello world\";\nnats:Error? result = natsClient->publish({ content: message.toBytes(), subject: \"demo.nats.basic\",\n replyTo: \"demo.reply\" });\n```\n\n#### Listen to incoming messages\n\n##### Listen to messages from a NATS server\n\n1. Listen to incoming messages with the `onMessage` remote method:\n```ballerina\n\/\/ Binds the consumer to listen to the messages published to the 'demo.example.*' subject\n@nats:ServiceConfig {\n subject: \"demo.example.*\"\n}\nservice nats:Service on new nats:Listener(nats:DEFAULT_URL) {\n\n remote function onMessage(nats:AnydataMessage message) {\n }\n}\n```\n\n2. Listen to incoming messages and reply directly with the `onRequest` remote method:\n```ballerina\n\/\/ Binds the consumer to listen to the messages published to the 'demo.example.*' subject\n@nats:ServiceConfig {\n subject: \"demo.example.*\"\n}\nservice nats:Service on new nats:Listener(nats:DEFAULT_URL) {\n\n \/\/ The returned message will be published to the replyTo subject of the consumed message\n remote function onRequest(nats:AnydataMessage message) returns string? {\n return \"Reply Message\";\n }\n}\n```\n\n### Advanced usage\n\n#### Set up TLS\n\nThe Ballerina NATS module allows the use of TLS in communication. This setting expects a secure socket to be\nset in the connection configuration as shown below.\n\n##### Configure TLS in the `nats:Listener`\n```ballerina\nnats:SecureSocket secured = {\n cert: {\n path: \"\/truststore.p12\",\n password: \"password\"\n },\n key: {\n path: \"\/keystore.p12\",\n password: \"password\"\n }\n};\nnats:Listener natsListener = check new(\"nats:\/\/serverone:4222\", secureSocket = secured);\n```\n\n##### Configure TLS in the `nats:Client`\n```ballerina\nnats:SecureSocket secured = {\n cert: {\n path: \"\/truststore.p12\",\n password: \"password\"\n },\n key: {\n path: \"\/keystore.p12\",\n password: \"password\"\n }\n};\nnats:Client natsClient = check new(\"nats:\/\/serverone:4222\", secureSocket = secured);\n```" + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Service", + "description": "NATS Service", + "basePath": { + "optional": false, + "typeName": "string", + "type": [ + "string" + ], + "defaultable": false, + "documentation": "The NATS subject name" + }, + "functions": [ + { + "name": "OnMessage", + "documentation": "The function which will be triggered when a message is received from the NATS server", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "nats:AnydataMessage", + "type": [ + "nats:AnydataMessage" + ], + "optional": false, + "typeInfo": { + "name": "AnydataMessage", + "orgName": "ballerinax", + "moduleName": "nats", + "version": "3.1.0" + } + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + }, + "group": { + "id": 1, + "name": "group-1", + "type": "exclusive", + "documentation": "NATS message trigger" + } + }, + { + "name": "OnRequest", + "documentation": "The function which will be triggered when a message is received from the NATS server and a response is expected", + "optional": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "nats:AnydataMessage", + "type": [ + "nats:AnydataMessage" + ], + "optional": false, + "typeInfo": { + "name": "AnydataMessage", + "orgName": "ballerinax", + "moduleName": "nats", + "version": "3.1.0" + } + } + ], + "returnType": { + "typeName": "anydata|error", + "type": [ + "anydata|error" + ], + "optional": false, + "documentation": "Anydata response", + "editable": false + }, + "group": { + "id": 1, + "name": "group-1", + "type": "exclusive", + "documentation": "NATS message trigger" + } + }, + { + "name": "OnError", + "optional": true, + "documentation": "The function which will be triggered when an error occurs", + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "message", + "typeName": "nats:AnydataMessage", + "type": [ + "nats:AnydataMessage" + ], + "optional": false, + "typeInfo": { + "name": "AnydataMessage", + "orgName": "ballerinax", + "moduleName": "nats", + "version": "3.1.0" + } + }, + { + "name": "error", + "typeName": "nats:Error", + "type": [ + "nats:Error" + ], + "typeInfo": { + "name": "Error", + "orgName": "ballerinax", + "moduleName": "nats", + "version": "3.1.0" + }, + "optional": false, + "documentation": "Error object" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object", + "defaultTypeName": "error?" + } + } + ] + } + ], + "listenerParams": [ + { + "name": "url", + "typeName": "string|string[]", + "type": [ + "string", + "string[]" + ], + "optional": false, + "defaultable": false, + "documentation": "The NATS broker URL. For a clustered use case, provide the URLs as a string array" + }, + { + "name": "config", + "typeName": "nats:ConnectionConfiguration", + "type": [ + "nats:ConnectionConfiguration" + ], + "optional": true, + "defaultable": false, + "documentation": "The connection configurations", + "typeInfo": { + "name": "ConnectionConfiguration", + "orgName": "ballerinax", + "moduleName": "nats", + "version": "3.1.0" + } + } + ] +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json index b55b948a7b25..3d14ae5a8f4a 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json @@ -123,7 +123,7 @@ "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "RabbitMQ message type" + "documentation": "RabbitMQ message trigger" } }, { @@ -165,9 +165,9 @@ } ], "returnType": { - "typeName": "anydata", + "typeName": "anydata|error", "type": [ - "anydata" + "anydata|error" ], "optional": false, "documentation": "Anydata response", @@ -177,7 +177,7 @@ "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "RabbitMQ message type" + "documentation": "RabbitMQ message trigger" } }, { @@ -285,4 +285,4 @@ } } ] -} \ No newline at end of file +} diff --git a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java index cf85b9b837c9..c148b95fa33d 100644 --- a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java +++ b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java @@ -85,16 +85,24 @@ public void testTriggerNewService() throws ExecutionException, InterruptedExcept Assert.assertEquals(response.get("moduleName").getAsString(), "rabbitmq"); } - @Test(description = "Test new trigger endpoint of trigger service") + @Test(description = "Test new trigger endpoint of trigger service without id") public void testTriggerNewServiceWithoutId() throws ExecutionException, InterruptedException { Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); - BallerinaTriggerRequest request = new BallerinaTriggerRequest("ballerina", "kafka", "kafka", + BallerinaTriggerRequest request = new BallerinaTriggerRequest("ballerinax", "kafka", "kafka", "*", "Kafka Event Listener"); CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); JsonObject response = (JsonObject) result.get(); Assert.assertEquals(response.get("id").getAsString(), "10001"); Assert.assertEquals(response.get("moduleName").getAsString(), "kafka"); + + request = new BallerinaTriggerRequest("ballerina", "mqtt", "1.2.0", + "*", "MQTT Event Listener"); + result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); + response = (JsonObject) result.get(); + + Assert.assertEquals(response.get("id").getAsString(), "10004"); + Assert.assertEquals(response.get("moduleName").getAsString(), "mqtt"); } } From 641fc1fb57bea6ec3d2b932d11b2d23b5d0c8be9 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 25 Oct 2024 09:06:14 +0530 Subject: [PATCH 22/42] Fix filter and limit functionalities --- .../trigger/BallerinaTriggerService.java | 105 ++++++++++++------ .../src/main/java/module-info.java | 1 + .../inbuilt-triggers/properties.json | 67 +++++++++++ 3 files changed, 142 insertions(+), 31 deletions(-) create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 76b526531b58..9f9b1e18465a 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -18,9 +18,11 @@ package io.ballerina.trigger; +import com.google.common.reflect.TypeToken; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import com.google.gson.stream.JsonReader; import io.ballerina.projects.Settings; import io.ballerina.trigger.entity.BallerinaTriggerListRequest; import io.ballerina.trigger.entity.BallerinaTriggerListResponse; @@ -45,14 +47,14 @@ import org.wso2.ballerinalang.util.RepoUtils; import java.io.IOException; -import java.net.URL; -import java.nio.file.Files; -import java.nio.file.Path; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; -import java.util.stream.Collectors; import static io.ballerina.projects.util.ProjectUtils.getAccessTokenOfCLI; import static io.ballerina.projects.util.ProjectUtils.initializeProxy; @@ -70,14 +72,26 @@ public class BallerinaTriggerService implements ExtendedLanguageServerService { public static final String BALLERINA = "ballerina"; public static final String BALLERINAX = "ballerinax"; private LanguageClient languageClient; - private static final Map IN_BUILT_TRIGGERS = Map.of( - "10006", "ftp", - "10005", "jms", - "10004", "mqtt", - "10003", "nats", - "10002", "rabbitmq", - "10001", "kafka" - ); + private final Map inBuiltTriggers; + + // Represents the in-built trigger basic information + public record InBuiltTrigger(String name, String orgName, String packageName, List keywords) { + } + + public BallerinaTriggerService() { + InputStream propertiesStream = getClass().getClassLoader() + .getResourceAsStream("inbuilt-triggers/properties.json"); + Type mapType = new TypeToken>() {}.getType(); + Map triggers = Map.of(); + if (propertiesStream != null) { + try (JsonReader reader = new JsonReader(new InputStreamReader(propertiesStream, StandardCharsets.UTF_8))) { + triggers = new Gson().fromJson(reader, mapType); + } catch (IOException e) { + triggers = Map.of(); + } + } + this.inBuiltTriggers = triggers; + } @Override public void init(LanguageServer langServer, WorkspaceManager workspaceManager, @@ -116,7 +130,14 @@ public CompletableFuture triggersNew(BallerinaTrig return CompletableFuture.supplyAsync(() -> { BallerinaTriggerListResponse triggersList = new BallerinaTriggerListResponse(); try { - triggersList.addInBuiltTriggers(getInBuiltTriggers()); + List inBuiltTriggers = getInBuiltTriggers(request); + triggersList.addInBuiltTriggers(inBuiltTriggers); + if (request.getLimit() > 0) { + if (inBuiltTriggers.size() == request.getLimit()) { + return triggersList; + } + request.setLimit(request.getLimit() - inBuiltTriggers.size()); + } Settings settings = RepoUtils.readSettings(); CentralAPIClient client = new CentralAPIClient(RepoUtils.getRemoteRepoURL(), initializeProxy(settings.getProxy()), settings.getProxy().username(), @@ -150,10 +171,10 @@ public CompletableFuture trigger(BallerinaTriggerRequest request) { public CompletableFuture triggerNew(BallerinaTriggerRequest request) { return CompletableFuture.supplyAsync(() -> { if (expectsTriggerByName(request)) { - return getInBuiltTrigger(request.getPackageName()).orElseGet(JsonObject::new); + return getInBuiltTriggerJson(request.getPackageName()).orElseGet(JsonObject::new); } if (request.getTriggerId() != null) { - Optional trigger = getInBuiltTriggerById(request.getTriggerId()); + Optional trigger = getInBuiltTriggerJsonById(request.getTriggerId()); if (trigger.isPresent()) { return trigger.get(); } @@ -201,37 +222,59 @@ public String getName() { return Constants.CAPABILITY_NAME; } - private List getInBuiltTriggers() { - return IN_BUILT_TRIGGERS.values().stream() - .map(this::getInBuiltTriggerInfo) + private List getInBuiltTriggers(BallerinaTriggerListRequest request) { + return inBuiltTriggers.values().stream() + .filter(inBuiltTrigger -> filterInBuiltTriggers(inBuiltTrigger, request)) + .map(inBuiltTrigger -> getInBuiltTrigger(inBuiltTrigger.name())) .flatMap(Optional::stream) - .map(s -> new Gson().fromJson(s, Trigger.class)) + .limit(request.getLimit() > 0 ? request.getLimit() : Long.MAX_VALUE) .toList(); } - private Optional getInBuiltTriggerById(String triggerId) { - if (!IN_BUILT_TRIGGERS.containsKey(triggerId)) { + private boolean filterInBuiltTriggers(InBuiltTrigger inBuiltTrigger, BallerinaTriggerListRequest request) { + return (request.getOrganization() == null || request.getOrganization().equals(inBuiltTrigger.orgName())) && + (request.getPackageName() == null || request.getPackageName().equals(inBuiltTrigger.packageName())) && + (request.getKeyword() == null || inBuiltTrigger.keywords().stream() + .anyMatch(keyword -> keyword.equalsIgnoreCase(request.getKeyword()))) && + (request.getQuery() == null || inBuiltTrigger.keywords().stream() + .anyMatch(keyword -> keyword.contains(request.getQuery()))); + } + + private Optional getInBuiltTrigger(String triggerName) { + InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(String.format("inbuilt-triggers/%s.json", triggerName)); + if (resourceStream == null) { + String msg = String.format("Trigger info file not found for the trigger: %s", triggerName); + this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); + return Optional.empty(); + } + + try (JsonReader reader = new JsonReader(new InputStreamReader(resourceStream, StandardCharsets.UTF_8))) { + return Optional.of(new Gson().fromJson(reader, Trigger.class)); + } catch (IOException e) { + String msg = String.format("Error occurred while reading the trigger info file for the trigger: %s", + triggerName); + this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); return Optional.empty(); } - return getInBuiltTrigger(IN_BUILT_TRIGGERS.get(triggerId)); } - private Optional getInBuiltTrigger(String triggerName) { - return getInBuiltTriggerInfo(triggerName) - .map(s -> new Gson().fromJson(s, JsonObject.class)); + private Optional getInBuiltTriggerJsonById(String triggerId) { + if (!inBuiltTriggers.containsKey(triggerId)) { + return Optional.empty(); + } + return getInBuiltTriggerJson(inBuiltTriggers.get(triggerId).name()); } - private Optional getInBuiltTriggerInfo(String triggerName) { - URL triggerURL = BallerinaTriggerService.class.getClassLoader() - .getResource("inbuilt-triggers/" + triggerName + ".json"); - if (triggerURL == null) { + private Optional getInBuiltTriggerJson(String triggerName) { + InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(String.format("inbuilt-triggers/%s.json", triggerName)); + if (resourceStream == null) { String msg = String.format("Trigger info file not found for the trigger: %s", triggerName); this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); return Optional.empty(); } - try { - return Optional.of(Files.readString(Path.of(triggerURL.getPath()))); + try (JsonReader reader = new JsonReader(new InputStreamReader(resourceStream, StandardCharsets.UTF_8))) { + return Optional.of(new Gson().fromJson(reader, JsonObject.class)); } catch (IOException e) { String msg = String.format("Error occurred while reading the trigger info file for the trigger: %s", triggerName); diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/module-info.java b/misc/ls-extensions/modules/trigger-service/src/main/java/module-info.java index 1eacddb74a37..62dc0be6b2d8 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/module-info.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/module-info.java @@ -10,4 +10,5 @@ requires io.ballerina.language.server.commons; requires org.eclipse.lsp4j; requires org.eclipse.lsp4j.jsonrpc; + requires com.google.common; } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json new file mode 100644 index 000000000000..ce13fdbf2dea --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json @@ -0,0 +1,67 @@ +{ + "10001": { + "name": "kafka", + "orgName": "ballerinax", + "packageName": "kafka", + "keywords": [ + "kafka", + "event streaming", + "network", + "messaging" + ] + }, + "10002": { + "name": "rabbitmq", + "orgName": "ballerinax", + "packageName": "rabbitmq", + "keywords": [ + "service", + "messaging", + "network" + ] + }, + "10003": { + "name": "nats", + "orgName": "ballerinax", + "packageName": "nats", + "keywords": [ + "service", + "messaging", + "network" + ] + }, + "10004": { + "name": "mqtt", + "orgName": "ballerina", + "packageName": "mqtt", + "keywords": [ + "mqtt", + "messaging", + "network", + "iot" + ] + }, + "10005": { + "name": "jms", + "orgName": "ballerinax", + "packageName": "java.jms", + "keywords": [ + "jms", + "java", + "messaging", + "network" + ] + }, + "10006": { + "name": "ftp", + "orgName": "ballerina", + "packageName": "ftp", + "keywords": [ + "FTP", + "SFTP", + "remote file", + "file", + "service" + ] + } +} \ No newline at end of file From 1121d5599984e4fc59bbaf460f83aa672b5ebf82 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 25 Oct 2024 09:06:22 +0530 Subject: [PATCH 23/42] Add test cases --- .../ballerina/trigger/TriggerServiceTest.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java index c148b95fa33d..af9b531dcd11 100644 --- a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java +++ b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java @@ -60,6 +60,10 @@ public void testTriggersNewService() throws ExecutionException, InterruptedExcep BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); Assert.assertTrue(!response.getCentralTriggers().isEmpty()); + Assert.assertTrue(response.getCentralTriggers().stream() + .anyMatch(trigger -> trigger.moduleName.contains("kafka"))); + Assert.assertTrue(response.getCentralTriggers().stream() + .anyMatch(trigger -> trigger.moduleName.contains("ftp"))); } @Test(description = "Test trigger endpoint of trigger service") @@ -105,4 +109,58 @@ public void testTriggerNewServiceWithoutId() throws ExecutionException, Interrup Assert.assertEquals(response.get("id").getAsString(), "10004"); Assert.assertEquals(response.get("moduleName").getAsString(), "mqtt"); } + + @Test(description = "Test new triggers endpoint of trigger service with query") + public void testTriggersNewServiceWithQuery() throws ExecutionException, InterruptedException { + Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); + + BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); + request.setQuery("kafka"); + CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); + BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + + Assert.assertTrue(!response.getCentralTriggers().isEmpty()); + Assert.assertTrue(response.getCentralTriggers().stream() + .anyMatch(trigger -> trigger.moduleName.equals("kafka"))); + Assert.assertTrue(response.getCentralTriggers().stream() + .noneMatch(trigger -> trigger.moduleName.equals("ftp"))); + } + + @Test(description = "Test new triggers endpoint of trigger service with organization") + public void testTriggersNewServiceWithOrg() throws ExecutionException, InterruptedException { + Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); + + BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); + request.setOrganization("ballerina"); + CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); + BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + + Assert.assertTrue(!response.getCentralTriggers().isEmpty()); + Assert.assertTrue(response.getCentralTriggers().stream() + .anyMatch(trigger -> trigger.moduleName.equals("mqtt"))); + Assert.assertTrue(response.getCentralTriggers().stream() + .anyMatch(trigger -> trigger.moduleName.equals("ftp"))); + Assert.assertTrue(response.getCentralTriggers().stream() + .noneMatch(trigger -> trigger.moduleName.equals("kafka"))); + } + + @Test(description = "Test new triggers endpoint of trigger service with limit") + public void testTriggersNewServiceWithLimit() throws ExecutionException, InterruptedException { + Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); + + BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); + request.setLimit(10); + CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); + BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + + Assert.assertTrue(!response.getCentralTriggers().isEmpty()); + Assert.assertEquals(response.getCentralTriggers().size(), 10); + + request.setLimit(2); + result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); + response = (BallerinaTriggerListResponse) result.get(); + + Assert.assertTrue(!response.getCentralTriggers().isEmpty()); + Assert.assertEquals(response.getCentralTriggers().size(), 2); + } } From f43f835c6ec1070723193e75a6d265474fb23828 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 25 Oct 2024 09:28:59 +0530 Subject: [PATCH 24/42] Update descriptions --- .../main/resources/inbuilt-triggers/ftp.json | 15 ++++--- .../main/resources/inbuilt-triggers/jms.json | 21 ++++----- .../resources/inbuilt-triggers/kafka.json | 23 +++++----- .../main/resources/inbuilt-triggers/mqtt.json | 27 +++++------ .../main/resources/inbuilt-triggers/nats.json | 31 +++++++------ .../resources/inbuilt-triggers/rabbitmq.json | 45 ++++++++++--------- 6 files changed, 86 insertions(+), 76 deletions(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json index 510e49743725..ce12e155d579 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json @@ -1,9 +1,9 @@ { "id": 10006, - "name": "FTP Listener", + "name": "FTP Service", "type": "inbuilt", "displayName": "FTP", - "documentation": "This Listener can be used to listen to file changes in a FTP server.", + "documentation": "The FTP service can be attached to a FTP listener which listens to file changes and trigger the service when a file change event occurs. The FTP service should implement the `onFileChange` function which will be triggered when a file change event occurs.", "moduleName": "ftp", "listenerProtocol": "ftp", "displayAnnotation": { @@ -66,7 +66,7 @@ "functions": [ { "name": "OnFileChange", - "documentation": "The function which will be triggered when a file change event occurs.", + "documentation": "The `OnFileChange` remote method will be triggered when a file change event occurs.", "optional": false, "qualifiers": [ "remote" @@ -86,7 +86,8 @@ "moduleName": "ftp", "version": "2.11.0" }, - "defaultTypeName": "ftp:WatchEvent & readonly" + "defaultTypeName": "ftp:WatchEvent & readonly", + "documentation": "File watch event." }, { "name": "caller", @@ -101,7 +102,7 @@ "version": "2.11.0" }, "optional": true, - "documentation": "Caller object" + "documentation": "The FTP caller object to execte file operations." } ], "returnType": { @@ -110,7 +111,7 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } } @@ -132,7 +133,7 @@ "moduleName": "ftp", "version": "2.11.0" }, - "documentation": "Configuration for FTP listener" + "documentation": "The FTP listener configuration." } ] } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json index 5ea4c513b0c1..d638aaae9dde 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json @@ -1,9 +1,9 @@ { "id": 10005, - "name": "JMS Event Listener", + "name": "JMS Service", "type": "inbuilt", "displayName": "JMS", - "documentation": "This Listener can be used to listen to JMS messages from a JMS broker.", + "documentation": "The JMS service can be attached to a JMS listener which listens to messages from a JMS broker. The service should implement the `OnMessage` remote method to process the received messages. Additionally, the service can implement the `OnError` remote method to handle errors that occur during message processing.", "moduleName": "java.jms", "listenerProtocol": "jms", "displayAnnotation": { @@ -61,7 +61,7 @@ "functions": [ { "name": "OnMessage", - "documentation": "The function which will be triggered when a message is received from the JMS broker", + "documentation": "The `OnMessage` remote method will be triggered when a message is received from the JMS broker.", "optional": false, "qualifiers": [ "remote" @@ -79,7 +79,8 @@ "orgName": "ballerinax", "moduleName": "java.jms", "version": "1.0.1" - } + }, + "documentation": "The message received from the JMS broker" }, { "name": "caller", @@ -94,7 +95,7 @@ "version": "1.0.1" }, "optional": true, - "documentation": "Caller object" + "documentation": "The JMS caller object to acknowledge the message" } ], "returnType": { @@ -103,13 +104,13 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } }, { "name": "OnError", - "documentation": "The function which will be triggered when an error occurs", + "documentation": "The `OnError` remote method will be triggered when an error occurs during message processing.", "optional": true, "qualifiers": [ "remote" @@ -128,7 +129,7 @@ "moduleName": "java.jms", "version": "1.0.1" }, - "documentation": "Error object" + "documentation": "The error occurred during message processing" } ], "returnType": { @@ -137,7 +138,7 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } } @@ -159,7 +160,7 @@ "moduleName": "java.jms", "version": "1.0.1" }, - "documentation": "Message listener configurations" + "documentation": "JMS listener configurations" } ] } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json index 0e7b251d4fce..18d0f7a0305f 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json @@ -1,9 +1,9 @@ { "id": 10001, - "name": "Kafka Event Listener", + "name": "Kafka Service", "type": "inbuilt", "displayName": "Kafka", - "documentation": "This Listener can be used to listen to Kafka events.", + "documentation": "The Kafka service can be attached to a Kafka listener which listens to Kafka topic(s) and triggers the service when a message is received for Kafka topic(s). The service should implement the `onConsumerRecord` remote method to process the received message(s). Additionally, the service can implement the `onError` remote method to handle errors that occur during the message processing.", "moduleName": "kafka", "listenerProtocol": "kafka", "displayAnnotation": { @@ -64,7 +64,7 @@ "functions": [ { "name": "OnConsumerRecord", - "documentation": "The function which will be triggered when a message is received from the Kafka topic", + "documentation": "The `onConsumerRecord` remote method will be triggered when a message is received from Kafka topic(s).", "optional": false, "qualifiers": [ "remote" @@ -79,7 +79,8 @@ "type": [ "kafka:ConsumerAnydataRecord[]", "anydata[]" - ] + ], + "documentation": "The records received for Kafka topic(s)." }, { "name": "caller", @@ -94,7 +95,7 @@ "version": "4.2.0" }, "optional": true, - "documentation": "Caller object" + "documentation": "The Kafka caller object to commit the offsets." } ], "returnType": { @@ -103,13 +104,13 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } }, { "name": "OnError", - "documentation": "The function which will be triggered when an error occurs", + "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "optional": true, "qualifiers": [ "remote" @@ -128,7 +129,7 @@ "moduleName": "kafka", "version": "4.2.0" }, - "documentation": "Error object" + "documentation": "The error occurred during the message processing." } ], "returnType": { @@ -137,7 +138,7 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } } @@ -154,7 +155,7 @@ ], "optional": false, "defaultable": false, - "documentation": "List of remote server endpoints of Kafka brokers" + "documentation": "The Kafka bootstrap server URL. For a clustered use case, provide a comma-separated list of URLs." }, { "name": "config", @@ -170,7 +171,7 @@ "version": "4.2.0" }, "defaultable": false, - "documentation": "Configuration for the Kafka Consumer" + "documentation": "The Kafka listener configurations." } ] } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json index fac3512a42fe..8e0fa6fd6cd7 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json @@ -1,9 +1,9 @@ { "id": 10004, - "name": "MQTT Event Listener", + "name": "MQTT Service", "type": "inbuilt", "displayName": "MQTT", - "documentation": "This Listener can be used to listen to messages from an MQTT broker.", + "documentation": "This MQTT service can be attached to a MQTT listener which subscribes to MQTT topic(s) and triggers the service when a message is received for MQTT topic(s). The service should have the `onMessage` remote method to process the received message(s). Additionally, the service can have the `onError` remote method to handle errors that occur during the message processing.", "moduleName": "mqtt", "listenerProtocol": "mqtt", "displayAnnotation": { @@ -64,7 +64,7 @@ "functions": [ { "name": "OnMessage", - "documentation": "The function which will be triggered when a message is received from the MQTT server", + "documentation": "The `onMessage` remote method will be triggered when a message is received for MQTT topic(s).", "optional": false, "qualifiers": [ "remote" @@ -82,7 +82,8 @@ "orgName": "ballerina", "moduleName": "mqtt", "version": "1.2.0" - } + }, + "documentation": "The message received for MQTT topic(s)." }, { "name": "caller", @@ -97,7 +98,7 @@ "version": "1.2.0" }, "optional": true, - "documentation": "Caller object" + "documentation": "The MQTT caller object to indicate the completion of the message processing or to send a response." } ], "returnType": { @@ -106,13 +107,13 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } }, { "name": "OnError", - "documentation": "The function which will be triggered when an error occurs", + "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "optional": true, "qualifiers": [ "remote" @@ -131,7 +132,7 @@ "moduleName": "mqtt", "version": "1.2.0" }, - "documentation": "Error object" + "documentation": "The error occurred during the message processing." } ], "returnType": { @@ -140,7 +141,7 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } } @@ -156,7 +157,7 @@ ], "optional": false, "defaultable": false, - "documentation": "The URI of the remote MQTT server" + "documentation": "The URI of the remote MQTT server." }, { "name": "clientId", @@ -166,7 +167,7 @@ ], "optional": false, "defaultable": false, - "documentation": "The unique client ID to identify the listener" + "documentation": "The unique client ID to identify the listener." }, { "name": "subscriptions", @@ -179,7 +180,7 @@ ], "optional": false, "defaultable": false, - "documentation": "The topics to be subscribed to" + "documentation": "The MQTT topics to be subscribed to." }, { "name": "config", @@ -195,7 +196,7 @@ "version": "1.2.0" }, "defaultable": false, - "documentation": "The listener configurations" + "documentation": "The listener configurations." } ] } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json index 47636052a48f..f9f9144d5508 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json @@ -1,9 +1,9 @@ { "id": 10003, - "name": "NATS Event Listener", + "name": "NATS Service", "type": "inbuilt", "displayName": "NATS", - "documentation": "This Listener can be used to listen to messages from a NATS server.", + "documentation": "The NATS service can be attached to a NATS listener to listen to messages from the NATS server. The service should define the subject name as the base path and should implement wither the `onMessage` or `onRequest` remote method to handle incoming messages. Additionally, the service can implement the `onError` remote method to handle errors.", "moduleName": "nats", "listenerProtocol": "nats", "displayAnnotation": { @@ -69,12 +69,12 @@ "string" ], "defaultable": false, - "documentation": "The NATS subject name" + "documentation": "The NATS subject name." }, "functions": [ { "name": "OnMessage", - "documentation": "The function which will be triggered when a message is received from the NATS server", + "documentation": "The `onMessage` remote method will be triggered when a message is received for the specified subject", "optional": false, "qualifiers": [ "remote" @@ -92,7 +92,8 @@ "orgName": "ballerinax", "moduleName": "nats", "version": "3.1.0" - } + }, + "documentation": "The message received for the NATS subject." } ], "returnType": { @@ -101,19 +102,19 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "NATS message trigger" + "documentation": "NATS message trigger method." } }, { "name": "OnRequest", - "documentation": "The function which will be triggered when a message is received from the NATS server and a response is expected", + "documentation": "The `onRequest` remote method will be triggered when a request is received for the specified subject and a response is expected.", "optional": false, "qualifiers": [ "remote" @@ -131,7 +132,8 @@ "orgName": "ballerinax", "moduleName": "nats", "version": "3.1.0" - } + }, + "documentation": "The message received for the NATS subject." } ], "returnType": { @@ -140,20 +142,20 @@ "anydata|error" ], "optional": false, - "documentation": "Anydata response", + "documentation": "The response message.", "editable": false }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "NATS message trigger" + "documentation": "NATS message trigger method." } }, { "name": "OnError", "optional": true, - "documentation": "The function which will be triggered when an error occurs", + "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "qualifiers": [ "remote" ], @@ -170,7 +172,8 @@ "orgName": "ballerinax", "moduleName": "nats", "version": "3.1.0" - } + }, + "documentation": "The message received for the NATS subject." }, { "name": "error", @@ -185,7 +188,7 @@ "version": "3.1.0" }, "optional": false, - "documentation": "Error object" + "documentation": "The error occurred during the message processing." } ], "returnType": { diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json index 3d14ae5a8f4a..33a446fbb9f9 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json @@ -1,9 +1,9 @@ { "id": 10002, - "name": "RabbitMQ Event Listener", + "name": "RabbitMQ Service", "type": "inbuilt", "displayName": "RabbitMQ", - "documentation": "This Listener can be used to listen to messages from a RabbitMQ server.", + "documentation": "The RabbitMQ service can be attached to a RabbitMQ listener which listens to messages from a RabbitMQ server. The service should define the queue name as the base path and should implement either the `onMessage` or `onRequest` remote method to handle the incoming messages. Additionally, the service can implement the `onError` remote method to handle errors.", "moduleName": "rabbitmq", "listenerProtocol": "rabbitmq", "displayAnnotation": { @@ -69,12 +69,12 @@ "string" ], "defaultable": false, - "documentation": "The RabbitMQ queue name" + "documentation": "The RabbitMQ queue name." }, "functions": [ { "name": "OnMessage", - "documentation": "The function which will be triggered when a message is received from the RabbitMQ server", + "documentation": "The `onMessage` remote method will be triggered when a message is received in the specified queue.", "optional": false, "qualifiers": [ "remote" @@ -92,7 +92,8 @@ "orgName": "ballerinax", "moduleName": "rabbitmq", "version": "3.1.0" - } + }, + "documentation": "The message received from the RabbitMQ queue." }, { "name": "caller", @@ -107,7 +108,7 @@ "version": "3.1.0" }, "optional": true, - "documentation": "Caller object" + "documentation": "The RabbitMQ caller object to acknowledge the message." } ], "returnType": { @@ -116,19 +117,19 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "RabbitMQ message trigger" + "documentation": "RabbitMQ message trigger method." } }, { "name": "OnRequest", - "documentation": "The function which will be triggered when a message is received from the RabbitMQ server and a response is expected", + "documentation": "The `onRequest` remote method will be triggered when a message is received in the specified queue and a response is expected.", "optional": false, "qualifiers": [ "remote" @@ -146,7 +147,8 @@ "orgName": "ballerinax", "moduleName": "rabbitmq", "version": "3.1.0" - } + }, + "documentation": "The message received from the RabbitMQ queue." }, { "name": "caller", @@ -161,7 +163,7 @@ "version": "3.1.0" }, "optional": true, - "documentation": "Caller object" + "documentation": "The RabbitMQ caller object to acknowledge the message." } ], "returnType": { @@ -170,20 +172,20 @@ "anydata|error" ], "optional": false, - "documentation": "Anydata response", + "documentation": "The response message.", "editable": false }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "RabbitMQ message trigger" + "documentation": "RabbitMQ message trigger method." } }, { "name": "OnError", "optional": true, - "documentation": "The function which will be triggered when an error occurs", + "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "qualifiers": [ "remote" ], @@ -200,7 +202,8 @@ "orgName": "ballerinax", "moduleName": "rabbitmq", "version": "3.1.0" - } + }, + "documentation": "The message received from the RabbitMQ queue." }, { "name": "error", @@ -215,7 +218,7 @@ "version": "3.1.0" }, "optional": false, - "documentation": "Error object" + "documentation": "The error occurred during the message processing." } ], "returnType": { @@ -224,7 +227,7 @@ "error?" ], "optional": true, - "documentation": "Error object", + "documentation": "Error object.", "defaultTypeName": "error?" } } @@ -240,7 +243,7 @@ ], "optional": false, "defaultable": false, - "documentation": "The host used for establishing the connection" + "documentation": "The RabbitMQ server host name used for establishing the connection." }, { "name": "port", @@ -250,7 +253,7 @@ ], "optional": false, "defaultable": false, - "documentation": "The port used for establishing the connection" + "documentation": "The RabbitMQ server port used for establishing the connection." }, { "name": "qosSettings", @@ -260,7 +263,7 @@ ], "optional": true, "defaultable": false, - "documentation": "The consumer prefetch settings", + "documentation": "The consumer prefetch settings.", "typeInfo": { "name": "QosSettings", "orgName": "ballerinax", @@ -276,7 +279,7 @@ ], "optional": true, "defaultable": false, - "documentation": "The connection data", + "documentation": "The connection data used for establishing the connection.", "typeInfo": { "name": "ConnectionData", "orgName": "ballerinax", From 066b91ae371ea1e25ef13ff31dd6f9b425d20834 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 25 Oct 2024 09:33:59 +0530 Subject: [PATCH 25/42] Ignore properties read failure --- .../main/java/io/ballerina/trigger/BallerinaTriggerService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 9f9b1e18465a..8a57eb95f9e5 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -87,7 +87,7 @@ public BallerinaTriggerService() { try (JsonReader reader = new JsonReader(new InputStreamReader(propertiesStream, StandardCharsets.UTF_8))) { triggers = new Gson().fromJson(reader, mapType); } catch (IOException e) { - triggers = Map.of(); + // Ignore } } this.inBuiltTriggers = triggers; From 826371688a5a4c5a1812e68229e4023038de0f1a Mon Sep 17 00:00:00 2001 From: Nipuna Fernando Date: Mon, 28 Oct 2024 16:38:40 +0530 Subject: [PATCH 26/42] Add remote functions to components --- .../packages/DocumentComponentTransformer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java index 22c075f78205..32aaae3e692a 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/DocumentComponentTransformer.java @@ -37,6 +37,7 @@ * The node transformer class to get the list of module level components. */ public class DocumentComponentTransformer extends NodeTransformer> { + private final ModuleObject module; DocumentComponentTransformer(ModuleObject moduleObject) { @@ -83,6 +84,11 @@ public Optional transform(ListenerDeclarationNode listenerDeclarat public Optional transform(ServiceDeclarationNode serviceDeclarationNode) { String name = serviceDeclarationNode.absoluteResourcePath().stream().map(node -> String.join("_", node.toString())).collect(Collectors.joining()); + if (name.isEmpty()) { + name = serviceDeclarationNode.typeDescriptor().map(typeDescriptorNode -> + typeDescriptorNode.toSourceCode().strip()).orElse(""); + } + DataObject dataObject = createDataObject(name, serviceDeclarationNode); serviceDeclarationNode.members().forEach(member -> { if (member.kind() == SyntaxKind.RESOURCE_ACCESSOR_DEFINITION) { @@ -92,6 +98,10 @@ public Optional transform(ServiceDeclarationNode serviceDeclaratio .map(Node::toSourceCode) .collect(Collectors.joining("")); dataObject.addResource(createDataObject(resourceName, member)); + } else if (member.kind() == SyntaxKind.OBJECT_METHOD_DEFINITION) { + FunctionDefinitionNode functionDefinitionNode = (FunctionDefinitionNode) member; + String functionName = functionDefinitionNode.functionName().text(); + dataObject.addFunction(this.createDataObject(functionName, member)); } }); return Optional.of(new MapperObject(PackageServiceConstants.SERVICES, dataObject)); From 4c9afeef5655425a0bb1b386b6167365a80b9df8 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Tue, 29 Oct 2024 08:47:54 +0530 Subject: [PATCH 27/42] Add search by name support in the new trigger service --- .../trigger/BallerinaTriggerService.java | 74 ++++++++++++------- 1 file changed, 49 insertions(+), 25 deletions(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 8a57eb95f9e5..45bdadb4fcda 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -104,17 +104,7 @@ public CompletableFuture triggers(BallerinaTrigger return CompletableFuture.supplyAsync(() -> { BallerinaTriggerListResponse triggersList = new BallerinaTriggerListResponse(); try { - Settings settings = RepoUtils.readSettings(); - CentralAPIClient client = new CentralAPIClient(RepoUtils.getRemoteRepoURL(), - initializeProxy(settings.getProxy()), settings.getProxy().username(), - settings.getProxy().password(), getAccessTokenOfCLI(settings), - settings.getCentral().getConnectTimeout(), - settings.getCentral().getReadTimeout(), settings.getCentral().getWriteTimeout(), - settings.getCentral().getCallTimeout(), settings.getCentral().getMaxRetries()); - JsonElement triggerSearchResult = client.getTriggers(request.getQueryMap(), - "any", RepoUtils.getBallerinaVersion()); - CentralTriggerListResult centralTriggerListResult = new Gson().fromJson( - triggerSearchResult.getAsString(), CentralTriggerListResult.class); + CentralTriggerListResult centralTriggerListResult = getCentralTriggerListResult(request); triggersList.setCentralTriggers(centralTriggerListResult.getTriggers()); return triggersList; } catch (CentralClientException | SettingsTomlException e) { @@ -138,17 +128,7 @@ public CompletableFuture triggersNew(BallerinaTrig } request.setLimit(request.getLimit() - inBuiltTriggers.size()); } - Settings settings = RepoUtils.readSettings(); - CentralAPIClient client = new CentralAPIClient(RepoUtils.getRemoteRepoURL(), - initializeProxy(settings.getProxy()), settings.getProxy().username(), - settings.getProxy().password(), getAccessTokenOfCLI(settings), - settings.getCentral().getConnectTimeout(), - settings.getCentral().getReadTimeout(), settings.getCentral().getWriteTimeout(), - settings.getCentral().getCallTimeout(), settings.getCentral().getMaxRetries()); - JsonElement triggerSearchResult = client.getTriggers(request.getQueryMap(), - "any", RepoUtils.getBallerinaVersion()); - CentralTriggerListResult centralTriggerListResult = new Gson().fromJson( - triggerSearchResult.getAsString(), CentralTriggerListResult.class); + CentralTriggerListResult centralTriggerListResult = getCentralTriggerListResult(request); triggersList.addCentralTriggers(centralTriggerListResult.getTriggers()); return triggersList; } catch (CentralClientException | SettingsTomlException e) { @@ -171,7 +151,7 @@ public CompletableFuture trigger(BallerinaTriggerRequest request) { public CompletableFuture triggerNew(BallerinaTriggerRequest request) { return CompletableFuture.supplyAsync(() -> { if (expectsTriggerByName(request)) { - return getInBuiltTriggerJson(request.getPackageName()).orElseGet(JsonObject::new); + return getTriggerByName(request).orElseGet(JsonObject::new); } if (request.getTriggerId() != null) { Optional trigger = getInBuiltTriggerJsonById(request.getTriggerId()); @@ -186,8 +166,48 @@ public CompletableFuture triggerNew(BallerinaTriggerRequest request) } private static boolean expectsTriggerByName(BallerinaTriggerRequest request) { - return request.getTriggerId() == null && request.getOrgName() != null && request.getPackageName() != null - && (request.getOrgName().trim().equals(BALLERINA) || request.getOrgName().equals(BALLERINAX)); + return request.getTriggerId() == null && request.getOrgName() != null && request.getPackageName() != null; + } + + private Optional getTriggerByName(BallerinaTriggerRequest request) { + Optional inBuiltTrigger = getInBuiltTriggerJson(request.getPackageName()); + if (inBuiltTrigger.isPresent()) { + return inBuiltTrigger; + } + + BallerinaTriggerListRequest triggerListRequest = new BallerinaTriggerListRequest(); + triggerListRequest.setPackageName(request.getPackageName()); + triggerListRequest.setOrganization(request.getOrgName()); + BallerinaTriggerListResponse triggersList = new BallerinaTriggerListResponse(); + try { + CentralTriggerListResult centralTriggerListResult = getCentralTriggerListResult(triggerListRequest); + triggersList.addCentralTriggers(centralTriggerListResult.getTriggers()); + if (triggersList.getCentralTriggers().isEmpty()) { + return Optional.empty(); + } + request.setId(triggersList.getCentralTriggers().get(0).id); + return getTriggerFromCentral(request); + } catch (CentralClientException | SettingsTomlException e) { + String msg = "Operation 'ballerinaTrigger/triggers' failed!"; + this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); + return Optional.empty(); + } + } + + private static CentralTriggerListResult getCentralTriggerListResult(BallerinaTriggerListRequest triggerListRequest) + throws SettingsTomlException, CentralClientException { + Settings settings = RepoUtils.readSettings(); + CentralAPIClient client = new CentralAPIClient(RepoUtils.getRemoteRepoURL(), + initializeProxy(settings.getProxy()), settings.getProxy().username(), + settings.getProxy().password(), getAccessTokenOfCLI(settings), + settings.getCentral().getConnectTimeout(), + settings.getCentral().getReadTimeout(), settings.getCentral().getWriteTimeout(), + settings.getCentral().getCallTimeout(), settings.getCentral().getMaxRetries()); + JsonElement triggerSearchResult = client.getTriggers(triggerListRequest.getQueryMap(), + "any", RepoUtils.getBallerinaVersion()); + CentralTriggerListResult centralTriggerListResult = new Gson().fromJson( + triggerSearchResult.getAsString(), CentralTriggerListResult.class); + return centralTriggerListResult; } private Optional getTriggerFromCentral(BallerinaTriggerRequest request) { @@ -266,6 +286,10 @@ private Optional getInBuiltTriggerJsonById(String triggerId) { } private Optional getInBuiltTriggerJson(String triggerName) { + if (inBuiltTriggers.values().stream() + .noneMatch(inBuiltTrigger -> inBuiltTrigger.packageName().equals(triggerName))) { + return Optional.empty(); + } InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(String.format("inbuilt-triggers/%s.json", triggerName)); if (resourceStream == null) { String msg = String.format("Trigger info file not found for the trigger: %s", triggerName); From 9c330793f83aacbefdac81e8b60a83ea5fd84b53 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Tue, 29 Oct 2024 08:48:03 +0530 Subject: [PATCH 28/42] Add test --- .../java/io/ballerina/trigger/TriggerServiceTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java index af9b531dcd11..7573b0c15c5b 100644 --- a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java +++ b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java @@ -101,13 +101,20 @@ public void testTriggerNewServiceWithoutId() throws ExecutionException, Interrup Assert.assertEquals(response.get("id").getAsString(), "10001"); Assert.assertEquals(response.get("moduleName").getAsString(), "kafka"); - request = new BallerinaTriggerRequest("ballerina", "mqtt", "1.2.0", + request = new BallerinaTriggerRequest("ballerina", "mqtt", "mqtt", "*", "MQTT Event Listener"); result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); response = (JsonObject) result.get(); Assert.assertEquals(response.get("id").getAsString(), "10004"); Assert.assertEquals(response.get("moduleName").getAsString(), "mqtt"); + + request = new BallerinaTriggerRequest("ballerinax", "trigger.slack", "trigger.slack", + "*", "Slack Event Listener"); + result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); + response = (JsonObject) result.get(); + + Assert.assertEquals(response.get("moduleName").getAsString(), "trigger.slack"); } @Test(description = "Test new triggers endpoint of trigger service with query") From 5b1904cdd104a2b6c1160845e214cd4a89d7cbbd Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Fri, 1 Nov 2024 13:14:08 +0530 Subject: [PATCH 29/42] Fix incorrect name fields --- .../src/main/resources/inbuilt-triggers/ftp.json | 6 +++--- .../src/main/resources/inbuilt-triggers/jms.json | 16 ++++++++-------- .../main/resources/inbuilt-triggers/kafka.json | 16 ++++++++-------- .../main/resources/inbuilt-triggers/mqtt.json | 10 +++++----- .../main/resources/inbuilt-triggers/nats.json | 8 ++++---- .../resources/inbuilt-triggers/rabbitmq.json | 8 ++++---- 6 files changed, 32 insertions(+), 32 deletions(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json index ce12e155d579..9002ee3db922 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json @@ -61,12 +61,12 @@ }, "serviceTypes": [ { - "name": "Service", + "name": "FTP", "description": "FTP Service", "functions": [ { - "name": "OnFileChange", - "documentation": "The `OnFileChange` remote method will be triggered when a file change event occurs.", + "name": "onFileChange", + "documentation": "The `onFileChange` remote method will be triggered when a file change event occurs.", "optional": false, "qualifiers": [ "remote" diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json index d638aaae9dde..4e1f39696cb1 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json @@ -3,7 +3,7 @@ "name": "JMS Service", "type": "inbuilt", "displayName": "JMS", - "documentation": "The JMS service can be attached to a JMS listener which listens to messages from a JMS broker. The service should implement the `OnMessage` remote method to process the received messages. Additionally, the service can implement the `OnError` remote method to handle errors that occur during message processing.", + "documentation": "The JMS service can be attached to a JMS listener which listens to messages from a JMS broker. The service should implement the `onMessage` remote method to process the received messages. Additionally, the service can implement the `onError` remote method to handle errors that occur during message processing.", "moduleName": "java.jms", "listenerProtocol": "jms", "displayAnnotation": { @@ -56,12 +56,12 @@ }, "serviceTypes": [ { - "name": "Service", + "name": "JMS", "description": "JMS Service", "functions": [ { - "name": "OnMessage", - "documentation": "The `OnMessage` remote method will be triggered when a message is received from the JMS broker.", + "name": "onMessage", + "documentation": "The `onMessage` remote method will be triggered when a message is received from the JMS broker.", "optional": false, "qualifiers": [ "remote" @@ -109,8 +109,8 @@ } }, { - "name": "OnError", - "documentation": "The `OnError` remote method will be triggered when an error occurs during message processing.", + "name": "onError", + "documentation": "The `onError` remote method will be triggered when an error occurs during message processing.", "optional": true, "qualifiers": [ "remote" @@ -118,9 +118,9 @@ "parameters": [ { "name": "err", - "typeName": "jms:error", + "typeName": "jms:Error", "type": [ - "jms:error" + "jms:Error" ], "optional": false, "typeInfo": { diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json index 18d0f7a0305f..ee4e90e2390e 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json @@ -59,11 +59,11 @@ }, "serviceTypes": [ { - "name": "Service", + "name": "Kafka", "description": "Kafka Service", "functions": [ { - "name": "OnConsumerRecord", + "name": "onConsumerRecord", "documentation": "The `onConsumerRecord` remote method will be triggered when a message is received from Kafka topic(s).", "optional": false, "qualifiers": [ @@ -72,12 +72,12 @@ "parameters": [ { "name": "records", - "typeName": "kafka:ConsumerAnydataRecord[]|anydata[]", + "typeName": "kafka:AnydataConsumerRecord[]|anydata[]", "optional": false, "arrayType": true, - "defaultTypeName": "kafka:ConsumerAnydataRecord[]", + "defaultTypeName": "kafka:AnydataConsumerRecord[]", "type": [ - "kafka:ConsumerAnydataRecord[]", + "kafka:AnydataConsumerRecord[]", "anydata[]" ], "documentation": "The records received for Kafka topic(s)." @@ -109,7 +109,7 @@ } }, { - "name": "OnError", + "name": "onError", "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "optional": true, "qualifiers": [ @@ -118,9 +118,9 @@ "parameters": [ { "name": "err", - "typeName": "kafka:error", + "typeName": "kafka:Error", "type": [ - "kafka:error" + "kafka:Error" ], "optional": false, "typeInfo": { diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json index 8e0fa6fd6cd7..8e04e44e32ea 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json @@ -59,11 +59,11 @@ }, "serviceTypes": [ { - "name": "Service", + "name": "MQTT", "description": "MQTT Service", "functions": [ { - "name": "OnMessage", + "name": "onMessage", "documentation": "The `onMessage` remote method will be triggered when a message is received for MQTT topic(s).", "optional": false, "qualifiers": [ @@ -112,7 +112,7 @@ } }, { - "name": "OnError", + "name": "onError", "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "optional": true, "qualifiers": [ @@ -121,9 +121,9 @@ "parameters": [ { "name": "err", - "typeName": "mqtt:error", + "typeName": "mqtt:Error", "type": [ - "mqtt:error" + "mqtt:Error" ], "optional": false, "typeInfo": { diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json index f9f9144d5508..724b67930962 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json @@ -60,7 +60,7 @@ }, "serviceTypes": [ { - "name": "Service", + "name": "NATS", "description": "NATS Service", "basePath": { "optional": false, @@ -73,7 +73,7 @@ }, "functions": [ { - "name": "OnMessage", + "name": "onMessage", "documentation": "The `onMessage` remote method will be triggered when a message is received for the specified subject", "optional": false, "qualifiers": [ @@ -153,7 +153,7 @@ } }, { - "name": "OnError", + "name": "onError", "optional": true, "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "qualifiers": [ @@ -176,7 +176,7 @@ "documentation": "The message received for the NATS subject." }, { - "name": "error", + "name": "err", "typeName": "nats:Error", "type": [ "nats:Error" diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json index 33a446fbb9f9..2c493cfbb9f3 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json @@ -60,7 +60,7 @@ }, "serviceTypes": [ { - "name": "Service", + "name": "RabbitMQ", "description": "RabbitMQ Service", "basePath": { "optional": false, @@ -73,7 +73,7 @@ }, "functions": [ { - "name": "OnMessage", + "name": "onMessage", "documentation": "The `onMessage` remote method will be triggered when a message is received in the specified queue.", "optional": false, "qualifiers": [ @@ -183,7 +183,7 @@ } }, { - "name": "OnError", + "name": "onError", "optional": true, "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "qualifiers": [ @@ -206,7 +206,7 @@ "documentation": "The message received from the RabbitMQ queue." }, { - "name": "error", + "name": "err", "typeName": "rabbitmq:Error", "type": [ "rabbitmq:Error" From 70af8c8ee677ea24abe781ec32139e2974459d40 Mon Sep 17 00:00:00 2001 From: LakshanWeerasinghe Date: Mon, 4 Nov 2024 16:19:58 +0530 Subject: [PATCH 30/42] Add resource calls to visible endpoints --- .../diagramutil/SyntaxTreeMapGenerator.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/SyntaxTreeMapGenerator.java b/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/SyntaxTreeMapGenerator.java index 072e1627a826..e2151f30a22e 100644 --- a/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/SyntaxTreeMapGenerator.java +++ b/misc/diagram-util/src/main/java/org/ballerinalang/diagramutil/SyntaxTreeMapGenerator.java @@ -37,6 +37,7 @@ import io.ballerina.compiler.syntax.tree.ChildNodeEntry; import io.ballerina.compiler.syntax.tree.ChildNodeList; import io.ballerina.compiler.syntax.tree.ClassDefinitionNode; +import io.ballerina.compiler.syntax.tree.ClientResourceAccessActionNode; import io.ballerina.compiler.syntax.tree.Minutiae; import io.ballerina.compiler.syntax.tree.MinutiaeList; import io.ballerina.compiler.syntax.tree.ModulePartNode; @@ -302,6 +303,16 @@ protected JsonElement transformSyntaxNode(Node node) { markVisibleEp(variableSymbol, symbolJson, remoteMethodCallActionNode.expression(), true); } } + } else if (node.kind() == SyntaxKind.CLIENT_RESOURCE_ACCESS_ACTION) { + ClientResourceAccessActionNode resourceCallActionNode = (ClientResourceAccessActionNode) node; + if (semanticModel != null) { + Optional expressionSymbol = this.semanticModel.symbol( + resourceCallActionNode.expression()); + if (expressionSymbol.isPresent() && + expressionSymbol.get() instanceof VariableSymbol variableSymbol) { + markVisibleEp(variableSymbol, symbolJson, resourceCallActionNode.expression(), true); + } + } } nodeJson.add("typeData", symbolJson); From 408cccce8b488a80e7f33715c514874db220e370 Mon Sep 17 00:00:00 2001 From: Nipuna Fernando Date: Wed, 6 Nov 2024 13:16:31 +0530 Subject: [PATCH 31/42] Add generate variable name method --- .../langserver/common/utils/NameUtil.java | 57 ++++++++++++++----- 1 file changed, 43 insertions(+), 14 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java index cb6f8f49ad51..093f0fd7f07a 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java @@ -87,18 +87,7 @@ public static String generateVariableName(Symbol symbol, TypeSymbol typeSymbol, name = typeSymbol.getName().get(); } else { TypeSymbol rawType = CommonUtil.getRawType(typeSymbol); - switch (rawType.typeKind()) { - case RECORD: - name = "mappingResult"; - break; - case TUPLE: - case ARRAY: - name = "listResult"; - break; - default: - name = rawType.typeKind().getName() + "Result"; - break; - } + name = generateNameForRawType(rawType.typeKind()); } return generateVariableName(1, name, names); } else { @@ -106,6 +95,23 @@ public static String generateVariableName(Symbol symbol, TypeSymbol typeSymbol, } } + /** + * Generates a variable name based on the provided signature. + * + * @param signature The type or name signature. + * @param names The set of existing names to avoid duplicates. + * @return The generated variable name. + */ + public static String generateVariableName(String signature, Set names) { + try { + TypeDescKind typeDescKind = TypeDescKind.valueOf(signature); + return generateVariableName(1, generateNameForRawType(typeDescKind), names); + } catch (IllegalArgumentException ignored) { + String camelCase = toCamelCase(signature); + return generateVariableName(1, camelCase, names); + } + } + /** * Given a prefix and visible symbols, this method will return a type name by appending a number to the end. * @@ -211,7 +217,7 @@ public static String getValidatedSymbolName(PositionedOperationContext context, * @return Signature */ public static String getModifiedTypeName(DocumentServiceContext context, TypeSymbol typeSymbol) { - String typeSignature = typeSymbol.typeKind() == + String typeSignature = typeSymbol.typeKind() == TypeDescKind.COMPILATION_ERROR ? "" : typeSymbol.signature(); return CommonUtil.getModifiedSignature(context, typeSignature); } @@ -264,7 +270,30 @@ public static List getDefinedArgumentNames(BallerinaCompletionContext co } return existingArgNames; } - + + /** + * Generates a name for a raw type. + * + * @param rawType The raw type descriptor kind. + * @return The generated name for the raw type. + */ + private static String generateNameForRawType(TypeDescKind rawType) { + String name; + switch (rawType) { + case RECORD: + name = "mappingResult"; + break; + case TUPLE: + case ARRAY: + name = "listResult"; + break; + default: + name = rawType.getName() + "Result"; + break; + } + return name; + } + /** * Coverts a given text to camel case. * From 2674619c62ee79eef7b5a8670ef71aab21ddaf54 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Thu, 7 Nov 2024 08:40:13 +0530 Subject: [PATCH 32/42] Update new trigger service to return only the stable triggers --- .../trigger/BallerinaTriggerService.java | 82 +++---------------- 1 file changed, 11 insertions(+), 71 deletions(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 45bdadb4fcda..2e13de88581d 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -29,7 +29,6 @@ import io.ballerina.trigger.entity.BallerinaTriggerRequest; import io.ballerina.trigger.entity.CentralTriggerListResult; import io.ballerina.trigger.entity.Constants; -import io.ballerina.trigger.entity.Trigger; import org.ballerinalang.annotation.JavaSPIService; import org.ballerinalang.central.client.CentralAPIClient; import org.ballerinalang.central.client.exceptions.CentralClientException; @@ -69,8 +68,6 @@ @JavaSPIService("org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService") @JsonSegment("ballerinaTrigger") public class BallerinaTriggerService implements ExtendedLanguageServerService { - public static final String BALLERINA = "ballerina"; - public static final String BALLERINAX = "ballerinax"; private LanguageClient languageClient; private final Map inBuiltTriggers; @@ -116,26 +113,12 @@ public CompletableFuture triggers(BallerinaTrigger } @JsonRequest - public CompletableFuture triggersNew(BallerinaTriggerListRequest request) { + public CompletableFuture triggersNew(BallerinaTriggerListRequest request) { return CompletableFuture.supplyAsync(() -> { - BallerinaTriggerListResponse triggersList = new BallerinaTriggerListResponse(); - try { - List inBuiltTriggers = getInBuiltTriggers(request); - triggersList.addInBuiltTriggers(inBuiltTriggers); - if (request.getLimit() > 0) { - if (inBuiltTriggers.size() == request.getLimit()) { - return triggersList; - } - request.setLimit(request.getLimit() - inBuiltTriggers.size()); - } - CentralTriggerListResult centralTriggerListResult = getCentralTriggerListResult(request); - triggersList.addCentralTriggers(centralTriggerListResult.getTriggers()); - return triggersList; - } catch (CentralClientException | SettingsTomlException e) { - String msg = "Operation 'ballerinaTrigger/triggers' failed!"; - this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); - return triggersList; - } + JsonObject triggersList = new JsonObject(); + List inBuiltTriggers = getInBuiltTriggers(request); + triggersList.add("central", new Gson().toJsonTree(inBuiltTriggers)); + return triggersList; }); } @@ -159,9 +142,7 @@ public CompletableFuture triggerNew(BallerinaTriggerRequest request) return trigger.get(); } } - - Optional trigger = getTriggerFromCentral(request); - return trigger.orElseGet(JsonObject::new); + return new JsonObject(); }); } @@ -170,28 +151,7 @@ private static boolean expectsTriggerByName(BallerinaTriggerRequest request) { } private Optional getTriggerByName(BallerinaTriggerRequest request) { - Optional inBuiltTrigger = getInBuiltTriggerJson(request.getPackageName()); - if (inBuiltTrigger.isPresent()) { - return inBuiltTrigger; - } - - BallerinaTriggerListRequest triggerListRequest = new BallerinaTriggerListRequest(); - triggerListRequest.setPackageName(request.getPackageName()); - triggerListRequest.setOrganization(request.getOrgName()); - BallerinaTriggerListResponse triggersList = new BallerinaTriggerListResponse(); - try { - CentralTriggerListResult centralTriggerListResult = getCentralTriggerListResult(triggerListRequest); - triggersList.addCentralTriggers(centralTriggerListResult.getTriggers()); - if (triggersList.getCentralTriggers().isEmpty()) { - return Optional.empty(); - } - request.setId(triggersList.getCentralTriggers().get(0).id); - return getTriggerFromCentral(request); - } catch (CentralClientException | SettingsTomlException e) { - String msg = "Operation 'ballerinaTrigger/triggers' failed!"; - this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); - return Optional.empty(); - } + return getInBuiltTriggerJson(request.getPackageName()); } private static CentralTriggerListResult getCentralTriggerListResult(BallerinaTriggerListRequest triggerListRequest) @@ -205,9 +165,7 @@ private static CentralTriggerListResult getCentralTriggerListResult(BallerinaTri settings.getCentral().getCallTimeout(), settings.getCentral().getMaxRetries()); JsonElement triggerSearchResult = client.getTriggers(triggerListRequest.getQueryMap(), "any", RepoUtils.getBallerinaVersion()); - CentralTriggerListResult centralTriggerListResult = new Gson().fromJson( - triggerSearchResult.getAsString(), CentralTriggerListResult.class); - return centralTriggerListResult; + return new Gson().fromJson(triggerSearchResult.getAsString(), CentralTriggerListResult.class); } private Optional getTriggerFromCentral(BallerinaTriggerRequest request) { @@ -242,10 +200,10 @@ public String getName() { return Constants.CAPABILITY_NAME; } - private List getInBuiltTriggers(BallerinaTriggerListRequest request) { + private List getInBuiltTriggers(BallerinaTriggerListRequest request) { return inBuiltTriggers.values().stream() .filter(inBuiltTrigger -> filterInBuiltTriggers(inBuiltTrigger, request)) - .map(inBuiltTrigger -> getInBuiltTrigger(inBuiltTrigger.name())) + .map(inBuiltTrigger -> getInBuiltTriggerJson(inBuiltTrigger.name())) .flatMap(Optional::stream) .limit(request.getLimit() > 0 ? request.getLimit() : Long.MAX_VALUE) .toList(); @@ -260,24 +218,6 @@ private boolean filterInBuiltTriggers(InBuiltTrigger inBuiltTrigger, BallerinaTr .anyMatch(keyword -> keyword.contains(request.getQuery()))); } - private Optional getInBuiltTrigger(String triggerName) { - InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(String.format("inbuilt-triggers/%s.json", triggerName)); - if (resourceStream == null) { - String msg = String.format("Trigger info file not found for the trigger: %s", triggerName); - this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); - return Optional.empty(); - } - - try (JsonReader reader = new JsonReader(new InputStreamReader(resourceStream, StandardCharsets.UTF_8))) { - return Optional.of(new Gson().fromJson(reader, Trigger.class)); - } catch (IOException e) { - String msg = String.format("Error occurred while reading the trigger info file for the trigger: %s", - triggerName); - this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); - return Optional.empty(); - } - } - private Optional getInBuiltTriggerJsonById(String triggerId) { if (!inBuiltTriggers.containsKey(triggerId)) { return Optional.empty(); @@ -287,7 +227,7 @@ private Optional getInBuiltTriggerJsonById(String triggerId) { private Optional getInBuiltTriggerJson(String triggerName) { if (inBuiltTriggers.values().stream() - .noneMatch(inBuiltTrigger -> inBuiltTrigger.packageName().equals(triggerName))) { + .noneMatch(inBuiltTrigger -> inBuiltTrigger.name().equals(triggerName))) { return Optional.empty(); } InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(String.format("inbuilt-triggers/%s.json", triggerName)); From f425228d27dea1b08ca757805466d8d02bb4c92e Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Thu, 7 Nov 2024 08:40:53 +0530 Subject: [PATCH 33/42] Update trigger models to support listener creation --- .../main/resources/inbuilt-triggers/ftp.json | 261 +++++- .../main/resources/inbuilt-triggers/jms.json | 301 ++++++- .../resources/inbuilt-triggers/kafka.json | 812 +++++++++++++++++- .../main/resources/inbuilt-triggers/mqtt.json | 352 ++++++-- .../main/resources/inbuilt-triggers/nats.json | 395 ++++++++- .../resources/inbuilt-triggers/rabbitmq.json | 483 +++++++++-- 6 files changed, 2371 insertions(+), 233 deletions(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json index 9002ee3db922..e270ee683a2a 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/ftp.json @@ -1,5 +1,5 @@ { - "id": 10006, + "id": 6, "name": "FTP Service", "type": "inbuilt", "displayName": "FTP", @@ -63,6 +63,7 @@ { "name": "FTP", "description": "FTP Service", + "enabled": true, "functions": [ { "name": "onFileChange", @@ -71,6 +72,7 @@ "qualifiers": [ "remote" ], + "enabled": true, "parameters": [ { "name": "event", @@ -87,7 +89,9 @@ "version": "2.11.0" }, "defaultTypeName": "ftp:WatchEvent & readonly", - "documentation": "File watch event." + "documentation": "File watch event.", + "enabled": true, + "value": "ftp:WatchEvent & readonly" }, { "name": "caller", @@ -102,7 +106,9 @@ "version": "2.11.0" }, "optional": true, - "documentation": "The FTP caller object to execte file operations." + "documentation": "The FTP caller object to execte file operations.", + "enabled": false, + "value": "ftp:Caller" } ], "returnType": { @@ -112,28 +118,241 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" } } ] } ], - "listenerParams": [ - { - "name": "listenerConfig", - "typeName": "ftp:ListenerConfiguration", - "type": [ - "ftp:ListenerConfiguration" - ], - "optional": false, - "defaultable": false, - "typeInfo": { - "name": "ListenerConfiguration", - "orgName": "ballerina", - "moduleName": "ftp", - "version": "2.11.0" - }, - "documentation": "The FTP listener configuration." + "listener": { + "metadata": { + "label": "FTP Listener", + "description": "The FTP listener listens to file changes and triggers the service when a file change event occurs." + }, + "valueType": "ftp:Listener", + "valueTypeConstraint": "ftp:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "listenerConfig": { + "metadata": { + "label": "Listener Configuration", + "description": "The FTP listener configuration." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "ftp:ListenerConfiguration", + "value": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "protocol": { + "metadata": { + "label": "protocol", + "description": "Supported FTP protocols" + }, + "valueType": "string", + "valueTypeConstraint": "Protocol", + "value": "", + "placeholder": "ftp:FTP", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "ftp:FTP", + "ftp:SFTP" + ] + }, + "host": { + "metadata": { + "label": "host", + "description": "Target service url" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "127.0.0.1", + "optional": true, + "editable": true, + "advanced": false + }, + "port": { + "metadata": { + "label": "port", + "description": "Port number of the remote service" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": 21, + "placeholder": "21", + "optional": true, + "editable": true, + "advanced": false + }, + "auth": { + "metadata": { + "label": "auth", + "description": "Authentication options" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "AuthConfiguration", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "credentials": { + "metadata": { + "label": "credentials", + "description": "Username and password to be used" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "Credentials", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "username": { + "metadata": { + "label": "username", + "description": "Username of the user" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "Password of the user" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "privateKey": { + "metadata": { + "label": "privateKey", + "description": "Private key to be used" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "ftp:PrivateKey", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "path": { + "metadata": { + "label": "path", + "description": "Path to the private key file" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "Private key password" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "preferredMethods": { + "metadata": { + "label": "preferredMethods", + "description": "Preferred authentication methods" + }, + "valueType": "array", + "valueTypeConstraint": "ftp:PreferredMethod[]", + "value": [ + "ftp:PUBLICKEY", + "ftp:PASSWORD" + ], + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "ftp:KEYBOARD_INTERACTIVE", + "ftp:GSSAPI_WITH_MIC", + "ftp:PASSWORD", + "ftp:PUBLICKEY" + ] + } + } + }, + "path": { + "metadata": { + "label": "path", + "description": "Remote FTP directory location" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "/", + "optional": true, + "editable": true, + "advanced": false + }, + "fileNamePattern": { + "metadata": { + "label": "fileNamePattern", + "description": "File name pattern that event need to trigger" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "pollingInterval": { + "metadata": { + "label": "pollingInterval", + "description": "Periodic time interval to check new update" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": 60, + "placeholder": "60", + "optional": true, + "editable": true, + "advanced": false + } + } + } } - ] + } } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json index 4e1f39696cb1..14624fc9edcd 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/jms.json @@ -1,5 +1,5 @@ { - "id": 10005, + "id": 5, "name": "JMS Service", "type": "inbuilt", "displayName": "JMS", @@ -58,6 +58,7 @@ { "name": "JMS", "description": "JMS Service", + "enabled": true, "functions": [ { "name": "onMessage", @@ -66,6 +67,7 @@ "qualifiers": [ "remote" ], + "enabled": true, "parameters": [ { "name": "message", @@ -80,7 +82,9 @@ "moduleName": "java.jms", "version": "1.0.1" }, - "documentation": "The message received from the JMS broker" + "documentation": "The message received from the JMS broker", + "enabled": true, + "value": "jms:Message" }, { "name": "caller", @@ -95,7 +99,9 @@ "version": "1.0.1" }, "optional": true, - "documentation": "The JMS caller object to acknowledge the message" + "documentation": "The JMS caller object to acknowledge the message", + "enabled": false, + "value": "jms:Caller" } ], "returnType": { @@ -105,7 +111,9 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" } }, { @@ -115,6 +123,7 @@ "qualifiers": [ "remote" ], + "enabled": false, "parameters": [ { "name": "err", @@ -129,7 +138,9 @@ "moduleName": "java.jms", "version": "1.0.1" }, - "documentation": "The error occurred during message processing" + "documentation": "The error occurred during message processing", + "enabled": true, + "value": "jms:Error" } ], "returnType": { @@ -139,28 +150,272 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" } } ] } ], - "listenerParams": [ - { - "name": "listenerConfig", - "typeName": "jms:ListenerConfiguration", - "type": [ - "jms:ListenerConfiguration" - ], - "optional": false, - "defaultable": false, - "typeInfo": { - "name": "ListenerConfiguration", - "orgName": "ballerinax", - "moduleName": "java.jms", - "version": "1.0.1" - }, - "documentation": "JMS listener configurations" + "listener": { + "metadata": { + "label": "JMS Listener", + "description": "The JMS listener listens to messages from a JMS broker." + }, + "valueType": "jms:Listener", + "valueTypeConstraint": "jms:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "listenerConfig": { + "metadata": { + "label": "listenerConfig", + "description": "The JMS listener configuration" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "jms:MessageListenerConfigurations", + "value": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "connectionConfig": { + "metadata": { + "label": "connectionConfig", + "description": "Configurations related to the broker connection" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "jms:ConnectionConfiguration", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": true, + "fields": { + "initialContextFactory": { + "metadata": { + "label": "initialContextFactory", + "description": "JMS provider specific initial context factory" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "providerUrl": { + "metadata": { + "label": "providerUrl", + "description": "JMS provider specific provider URL used to configure a connection" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "connectionFactoryName": { + "metadata": { + "label": "connectionFactoryName", + "description": "JMS connection factory to be used in creating JMS connections" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "ConnectionFactory", + "optional": true, + "editable": true, + "advanced": false + }, + "username": { + "metadata": { + "label": "username", + "description": "Username for the JMS connection" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "Password for the JMS connection" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "properties": { + "metadata": { + "label": "properties", + "description": "Additional properties used in initializing the initial context" + }, + "valueType": "map", + "valueTypeConstraint": "map", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "acknowledgementMode": { + "metadata": { + "label": "acknowledgementMode", + "description": "Configuration indicating how messages received by the session will be acknowledged" + }, + "valueType": "enum", + "valueTypeConstraint": "jms:AcknowledgementMode", + "value": "", + "placeholder": "jms:AUTO_ACKNOWLEDGE", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "jms:SESSION_TRANSACTED", + "jms:AUTO_ACKNOWLEDGE", + "jms:CLIENT_ACKNOWLEDGE", + "jms:DUPS_OK_ACKNOWLEDGE" + ] + }, + "consumerOptions": { + "metadata": { + "label": "consumerOptions", + "description": "Underlying JMS message consumer configurations" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "jms:ConsumerOptions", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": true, + "fields": { + "type": { + "metadata": { + "label": "type", + "description": "Message consumer type" + }, + "valueType": "enum", + "valueTypeConstraint": "ConsumerType", + "value": "jms:DEFAULT", + "placeholder": "jms:DEFAULT", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "jms:DURABLE", + "jms:SHARED", + "jms:SHARED_DURABLE", + "jms:DEFAULT" + ] + }, + "destination": { + "metadata": { + "label": "destination", + "description": "Name of the JMS destination" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "jms:Destination", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": true, + "fields": { + "type": { + "metadata": { + "label": "type", + "description": "JMS destination types" + }, + "valueType": "enum", + "valueTypeConstraint": "jms:DestinationType", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false, + "enum": [ + "jms:QUEUE", + "jms:TEMPORARY_QUEUE", + "jms:TOPIC", + "jms:TEMPORARY_TOPIC" + ] + }, + "name": { + "metadata": { + "label": "name", + "description": "Name of the destination" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "messageSelector": { + "metadata": { + "label": "messageSelector", + "description": "Only messages with properties matching the message selector expression are added to the durable subscription. An empty string indicates that there is no message selector for the durable subscription." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "noLocal": { + "metadata": { + "label": "noLocal", + "description": "If true then any messages published to the topic using this session's connection, or any other connection with the same client identifier, will not be added to the durable subscription." + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": false, + "placeholder": "false", + "optional": true, + "editable": true, + "advanced": false + }, + "subscriberName": { + "metadata": { + "label": "subscriberName", + "description": "The name used to identify the subscription" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + } + } + } } - ] + } } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json index ee4e90e2390e..c3dbcd952d99 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/kafka.json @@ -1,5 +1,5 @@ { - "id": 10001, + "id": 1, "name": "Kafka Service", "type": "inbuilt", "displayName": "Kafka", @@ -64,23 +64,27 @@ "functions": [ { "name": "onConsumerRecord", + "enabled": true, "documentation": "The `onConsumerRecord` remote method will be triggered when a message is received from Kafka topic(s).", "optional": false, + "editable": true, "qualifiers": [ "remote" ], "parameters": [ { "name": "records", - "typeName": "kafka:AnydataConsumerRecord[]|anydata[]", + "typeName": "kafka:ConsumerAnydataRecord[]|anydata[]", "optional": false, "arrayType": true, - "defaultTypeName": "kafka:AnydataConsumerRecord[]", + "defaultTypeName": "kafka:ConsumerAnydataRecord[]", "type": [ - "kafka:AnydataConsumerRecord[]", + "kafka:ConsumerAnydataRecord[]", "anydata[]" ], - "documentation": "The records received for Kafka topic(s)." + "documentation": "The records received for Kafka topic(s).", + "enabled": true, + "value": "kafka:ConsumerAnydataRecord[]" }, { "name": "caller", @@ -94,6 +98,7 @@ "moduleName": "kafka", "version": "4.2.0" }, + "enabled": false, "optional": true, "documentation": "The Kafka caller object to commit the offsets." } @@ -105,11 +110,14 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": "true", + "value": "error?" } }, { "name": "onError", + "enabled": false, "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "optional": true, "qualifiers": [ @@ -129,7 +137,9 @@ "moduleName": "kafka", "version": "4.2.0" }, - "documentation": "The error occurred during the message processing." + "documentation": "The error occurred during the message processing.", + "enabled": "true", + "value": "kafka:Error" } ], "returnType": { @@ -139,39 +149,773 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": "true", + "value": "error?" } } ] } ], - "listenerParams": [ - { - "name": "bootstrapServers", - "typeName": "string|string[]", - "type": [ - "string", - "string[]" - ], - "optional": false, - "defaultable": false, - "documentation": "The Kafka bootstrap server URL. For a clustered use case, provide a comma-separated list of URLs." + "listener": { + "metadata": { + "label": "Kafka Listener", + "description": "The Kafka listener listens to Kafka topic(s) and triggers the service when a message is received for Kafka topic(s)." }, - { - "name": "config", - "typeName": "kafka:ConsumerConfiguration", - "type": [ - "kafka:ConsumerConfiguration" - ], - "optional": true, - "typeInfo": { - "name": "ConsumerConfiguration", - "orgName": "ballerinax", - "moduleName": "kafka", - "version": "4.2.0" + "valueType": "kafka:Listener", + "valueTypeConstraint": "kafka:Listener", + "value": "", + "optional": false, + "editable": true, + "properties": { + "bootstrapServers": { + "metadata": { + "label": "bootstrapServers", + "description": "The Kafka bootstrap server URL. For a clustered use case, provide a comma-separated list of URLs." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "string|string[]", + "value": "", + "placeholder": "kafka:DEFAULT_URL", + "optional": false, + "editable": true, + "advanced": false }, - "defaultable": false, - "documentation": "The Kafka listener configurations." + "config": { + "metadata": { + "label": "config", + "description": "The Kafka listener configurations." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "kafka:ConsumerConfiguration", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "groupId": { + "metadata": { + "label": "groupId", + "description": "Unique string that identifies the consumer" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "topics": { + "metadata": { + "label": "topics", + "description": "Topics to be subscribed by the consumer" + }, + "valueType": "string[]", + "valueTypeConstraint": "string[]", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "offsetReset": { + "metadata": { + "label": "offsetReset", + "description": "Offset reset strategy if no initial offset" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "kafka:OFFSET_RESET_EARLIEST", + "kafka:OFFSET_RESET_LATEST", + "kafka:OFFSET_RESET_NONE" + ] + }, + "partitionAssignmentStrategy": { + "metadata": { + "label": "partitionAssignmentStrategy", + "description": "Strategy class for handling the partition assignment among consumers" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "metricsRecordingLevel": { + "metadata": { + "label": "metricsRecordingLevel", + "description": "Metrics recording level" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "metricsReporterClasses": { + "metadata": { + "label": "metricsReporterClasses", + "description": "Metrics reporter classes" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "clientId": { + "metadata": { + "label": "clientId", + "description": "Identifier to be used for server side logging" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "interceptorClasses": { + "metadata": { + "label": "interceptorClasses", + "description": "Interceptor classes to be used before sending the records" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "isolationLevel": { + "metadata": { + "label": "isolationLevel", + "description": "Transactional message reading method" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "kafka:ISOLATION_COMMITTED", + "kafka:ISOLATION_UNCOMMITTED" + ] + }, + "schemaRegistryUrl": { + "metadata": { + "label": "schemaRegistryUrl", + "description": "Avro schema registry URL. Use this field to specify the schema registry URL, if the Avro serializer is used" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "additionalProperties": { + "metadata": { + "label": "additionalProperties", + "description": "Additional properties for the property fields not provided by the Ballerina `kafka` module. Use this with caution since this can override any of the fields. It is not recommended to use this field except in an extreme situation" + }, + "valueType": "map", + "valueTypeConstraint": "map", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "sessionTimeout": { + "metadata": { + "label": "sessionTimeout", + "description": "Timeout (in seconds) used to detect consumer failures when the heartbeat threshold is reached" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "heartBeatInterval": { + "metadata": { + "label": "heartBeatInterval", + "description": "Expected time (in seconds) between the heartbeats" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "metadataMaxAge": { + "metadata": { + "label": "metadataMaxAge", + "description": "Maximum time (in seconds) to force a refresh of metadata" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "autoCommitInterval": { + "metadata": { + "label": "autoCommitInterval", + "description": "Auto committing interval (in seconds) for commit offset when auto-committing is enabled" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "maxPartitionFetchBytes": { + "metadata": { + "label": "maxPartitionFetchBytes", + "description": "The maximum amount of data the server returns per partition" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "sendBuffer": { + "metadata": { + "label": "sendBuffer", + "description": "Size of the TCP send buffer (SO_SNDBUF)" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "receiveBuffer": { + "metadata": { + "label": "receiveBuffer", + "description": "Size of the TCP receive buffer (SO_RCVBUF)" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "fetchMinBytes": { + "metadata": { + "label": "fetchMinBytes", + "description": "Minimum amount of data the server should return for a fetch request" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "fetchMaxBytes": { + "metadata": { + "label": "fetchMaxBytes", + "description": "Maximum amount of data the server should return for a fetch request" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "fetchMaxWaitTime": { + "metadata": { + "label": "fetchMaxWaitTime", + "description": "Maximum amount of time (in seconds) the server will block before answering the fetch request" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "reconnectBackoffTimeMax": { + "metadata": { + "label": "reconnectBackoffTimeMax", + "description": "Maximum amount of time in seconds to wait when reconnecting" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "retryBackoff": { + "metadata": { + "label": "retryBackoff", + "description": "Time (in seconds) to wait before attempting to retry a failed request" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "metricsSampleWindow": { + "metadata": { + "label": "metricsSampleWindow", + "description": "Window of time (in seconds) a metrics sample is computed over" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "metricsNumSamples": { + "metadata": { + "label": "metricsNumSamples", + "description": "Number of samples maintained to compute metrics" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "requestTimeout": { + "metadata": { + "label": "requestTimeout", + "description": "Wait time (in seconds) for response of a request" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "connectionMaxIdleTime": { + "metadata": { + "label": "connectionMaxIdleTime", + "description": "Close idle connections after the number of seconds" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "maxPollRecords": { + "metadata": { + "label": "maxPollRecords", + "description": "Maximum number of records returned in a single call to poll" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "maxPollInterval": { + "metadata": { + "label": "maxPollInterval", + "description": "Maximum delay between invocations of poll" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "reconnectBackoffTime": { + "metadata": { + "label": "reconnectBackoffTime", + "description": "Time (in seconds) to wait before attempting to reconnect" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "pollingTimeout": { + "metadata": { + "label": "pollingTimeout", + "description": "Timeout interval for polling in seconds" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "pollingInterval": { + "metadata": { + "label": "pollingInterval", + "description": "Polling interval for the consumer in seconds" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "concurrentConsumers": { + "metadata": { + "label": "concurrentConsumers", + "description": "Number of concurrent consumers" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "defaultApiTimeout": { + "metadata": { + "label": "defaultApiTimeout", + "description": "Default API timeout value (in seconds) for APIs with duration" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "autoCommit": { + "metadata": { + "label": "autoCommit", + "description": "Enables auto committing offsets" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + }, + "checkCRCS": { + "metadata": { + "label": "checkCRCS", + "description": "Checks the CRC32 of the records consumed. This ensures that no on-the-wire or on-disk corruption occurred to the messages. This may add some overhead and might need to be set to `false` if extreme performance is required" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + }, + "excludeInternalTopics": { + "metadata": { + "label": "excludeInternalTopics", + "description": "Whether records from internal topics should be exposed to the consumer" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + }, + "decoupleProcessing": { + "metadata": { + "label": "decoupleProcessing", + "description": "Decouples processing" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + }, + "validation": { + "metadata": { + "label": "validation", + "description": "Configuration related to constraint validation check" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + }, + "autoSeekOnValidationFailure": { + "metadata": { + "label": "autoSeekOnValidationFailure", + "description": "Automatically seeks past the errornous records in the event of an data-binding or validating constraints failure" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + }, + "secureSocket": { + "metadata": { + "label": "secureSocket", + "description": "Configurations related to SSL/TLS encryption" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "kafka:SecureSocket", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "cert": { + "metadata": { + "label": "cert", + "description": "Configurations associated with crypto:TrustStore or single certificate file that the client trusts" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "key": { + "metadata": { + "label": "key", + "description": "Configurations associated with crypto:KeyStore or combination of certificate and private key of the client" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "protocol": { + "metadata": { + "label": "protocol", + "description": "SSL/TLS protocol related options" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "record", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "name": { + "metadata": { + "label": "name", + "description": "The name of the protocol" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "kafka:SSL", + "kafka:TLS", + "kafka:DTLS" + ] + }, + "versions": { + "metadata": { + "label": "versions", + "description": "The versions of the protocol" + }, + "valueType": "string[]", + "valueTypeConstraint": "string[]", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "ciphers": { + "metadata": { + "label": "ciphers", + "description": "List of ciphers to be used. By default, all the available cipher suites are supported" + }, + "valueType": "string[]", + "valueTypeConstraint": "string[]", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "provider": { + "metadata": { + "label": "provider", + "description": "Name of the security provider used for SSL connections. The default value is the default security provider of the JVM" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "auth": { + "metadata": { + "label": "auth", + "description": "Authentication-related configurations for the `kafka:Consumer`" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "kafka:AuthenticationConfiguration", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "mechanism": { + "metadata": { + "label": "mechanism", + "description": "Type of the authentication mechanism. Currently `SASL_PLAIN`, `SASL_SCRAM_256` & `SASL_SCRAM_512` is supported" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "kafka:AUTH_SASL_PLAIN", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "kafka:AUTH_SASL_PLAIN", + "kafka:AUTH_SASL_SCRAM_SHA_256", + "kafka:AUTH_SASL_SCRAM_SHA_512" + ] + }, + "username": { + "metadata": { + "label": "username", + "description": "The username to authenticate the Kafka producer/consumer" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "The password to authenticate the Kafka producer/consumer" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "securityProtocol": { + "metadata": { + "label": "securityProtocol", + "description": "Type of the security protocol to use in the broker connection" + }, + "valueType": "string", + "valueTypeConstraint": "kafka:SecurityProtocol", + "value": "", + "placeholder": "kafka:PROTOCOL_PLAINTEXT", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "kafka:PROTOCOL_PLAINTEXT", + "kafka:PROTOCOL_SASL_PLAINTEXT", + "kafka:PROTOCOL_SASL_SSL", + "kafka:PROTOCOL_SSL" + ] + } + } + } } - ] + } } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json index 8e04e44e32ea..35a3451520c0 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/mqtt.json @@ -1,5 +1,5 @@ { - "id": 10004, + "id": 4, "name": "MQTT Service", "type": "inbuilt", "displayName": "MQTT", @@ -61,6 +61,7 @@ { "name": "MQTT", "description": "MQTT Service", + "enabled": true, "functions": [ { "name": "onMessage", @@ -69,6 +70,7 @@ "qualifiers": [ "remote" ], + "enabled": true, "parameters": [ { "name": "message", @@ -83,7 +85,9 @@ "moduleName": "mqtt", "version": "1.2.0" }, - "documentation": "The message received for MQTT topic(s)." + "documentation": "The message received for MQTT topic(s).", + "enabled": true, + "value": "mqtt:Message" }, { "name": "caller", @@ -98,7 +102,9 @@ "version": "1.2.0" }, "optional": true, - "documentation": "The MQTT caller object to indicate the completion of the message processing or to send a response." + "documentation": "The MQTT caller object to indicate the completion of the message processing or to send a response.", + "enabled": false, + "value": "mqtt:Caller" } ], "returnType": { @@ -108,13 +114,16 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" } }, { "name": "onError", "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "optional": true, + "enabled": false, "qualifiers": [ "remote" ], @@ -132,7 +141,9 @@ "moduleName": "mqtt", "version": "1.2.0" }, - "documentation": "The error occurred during the message processing." + "documentation": "The error occurred during the message processing.", + "enabled": true, + "value": "mqtt:Error" } ], "returnType": { @@ -142,61 +153,294 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" } } ] } ], - "listenerParams": [ - { - "name": "serviceUri", - "typeName": "string", - "type": [ - "string" - ], - "optional": false, - "defaultable": false, - "documentation": "The URI of the remote MQTT server." - }, - { - "name": "clientId", - "typeName": "string", - "type": [ - "string" - ], - "optional": false, - "defaultable": false, - "documentation": "The unique client ID to identify the listener." + "listener": { + "metadata": { + "label": "MQTT Listener", + "description": "The MQTT listener to which the MQTT service should be attached." }, - { - "name": "subscriptions", - "typeName": "string|string[]|mqtt:Subscription|mqtt:Subscription[]", - "type": [ - "string", - "string[]", - "mqtt:Subscription", - "mqtt:Subscription[]" - ], - "optional": false, - "defaultable": false, - "documentation": "The MQTT topics to be subscribed to." - }, - { - "name": "config", - "typeName": "mqtt:ListenerConfiguration", - "type": [ - "mqtt:ListenerConfiguration" - ], - "optional": true, - "typeInfo": { - "name": "ListenerConfiguration", - "orgName": "ballerina", - "moduleName": "mqtt", - "version": "1.2.0" + "valueType": "mqtt:Listener", + "valueTypeConstraint": "mqtt:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "serviceUri": { + "metadata": { + "label": "url", + "description": "The URI of the remote MQTT server." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "placeholder": "", + "editable": true, + "optional": false, + "advanced": false }, - "defaultable": false, - "documentation": "The listener configurations." + "clientId": { + "metadata": { + "label": "client ID", + "description": "The unique client ID to identify the listener." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "placeholder": "", + "editable": true, + "optional": false, + "advanced": false + }, + "subscriptions": { + "metadata": { + "label": "subscriptions", + "description": "The MQTT topics to be subscribed to." + }, + "valueType": "string", + "valueTypeConstraint": "string|string[]", + "placeholder": "", + "editable": true, + "optional": false, + "advanced": false + }, + "config": { + "metadata": { + "label": "config", + "description": "The listener configurations." + }, + "valueType": "mqtt:ListenerConfiguration", + "valueTypeConstraint": "mqtt:ListenerConfiguration", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "connectionConfig": { + "metadata": { + "label": "connectionConfig", + "description": "The related connection configuration" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "ConnectionConfiguration", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "username": { + "metadata": { + "label": "username", + "description": "The username to use for the connection" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "The password to use for the connection" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "secureSocket": { + "metadata": { + "label": "secureSocket", + "description": "The configurations related to secure communication with the MQTT server" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "SecureSocket", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "cert": { + "metadata": { + "label": "cert", + "description": "Certificate file that the client trusts or a `crypto:TrustStore`" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "key": { + "metadata": { + "label": "key", + "description": "Combination of certificate and private key of the client or a `crypto:KeyStore`" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "protocol": { + "metadata": { + "label": "protocol", + "description": "Related protocol" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "record", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "name": { + "metadata": { + "label": "name", + "description": "The name of the protocol" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "mqtt:SSL", + "mqtt:TLS" + ] + }, + "version": { + "metadata": { + "label": "version", + "description": "The version of the protocol" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + } + } + }, + "maxReconnectDelay": { + "metadata": { + "label": "maxReconnectDelay", + "description": "The maximum delay between reconnects in milliseconds" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "keepAliveInterval": { + "metadata": { + "label": "keepAliveInterval", + "description": "The maximum time interval between messages sent or received in seconds" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "connectionTimeout": { + "metadata": { + "label": "connectionTimeout", + "description": "Maximum time interval in seconds the client will wait for the network connection to the MQTT server to be established" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "cleanStart": { + "metadata": { + "label": "cleanStart", + "description": "Whether the client and server should remember state for the client across reconnects" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "serverUris": { + "metadata": { + "label": "serverUris", + "description": "List of serverURIs the client may connect to" + }, + "valueType": "string[]", + "valueTypeConstraint": "string[]", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "automaticReconnect": { + "metadata": { + "label": "automaticReconnect", + "description": "Whether the client will automatically attempt to reconnect to the server if the connection is lost" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "manualAcks": { + "metadata": { + "label": "manualAcks", + "description": "Indicates whether or not the client should automatically ack messages" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "false", + "optional": true, + "editable": true, + "advanced": false + } + } + } } - ] + } } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json index 724b67930962..3b74e99f87e8 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/nats.json @@ -1,5 +1,5 @@ { - "id": 10003, + "id": 3, "name": "NATS Service", "type": "inbuilt", "displayName": "NATS", @@ -62,6 +62,7 @@ { "name": "NATS", "description": "NATS Service", + "enabled": true, "basePath": { "optional": false, "typeName": "string", @@ -69,7 +70,10 @@ "string" ], "defaultable": false, - "documentation": "The NATS subject name." + "documentation": "The NATS subject name.", + "enabled": true, + "value": "", + "placeholder": "nats.subject" }, "functions": [ { @@ -79,6 +83,7 @@ "qualifiers": [ "remote" ], + "enabled": true, "parameters": [ { "name": "message", @@ -93,7 +98,9 @@ "moduleName": "nats", "version": "3.1.0" }, - "documentation": "The message received for the NATS subject." + "documentation": "The message received for the NATS subject.", + "enabled": true, + "value": "nats:AnydataMessage" } ], "returnType": { @@ -109,16 +116,18 @@ "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "NATS message trigger method." + "documentation": "NATS message trigger method.", + "default": "onMessage" } }, { - "name": "OnRequest", + "name": "onRequest", "documentation": "The `onRequest` remote method will be triggered when a request is received for the specified subject and a response is expected.", "optional": false, "qualifiers": [ "remote" ], + "enabled": false, "parameters": [ { "name": "message", @@ -127,6 +136,8 @@ "nats:AnydataMessage" ], "optional": false, + "enabled": true, + "value": "nats:AnydataMessage", "typeInfo": { "name": "AnydataMessage", "orgName": "ballerinax", @@ -143,18 +154,22 @@ ], "optional": false, "documentation": "The response message.", - "editable": false + "editable": false, + "enabled": true, + "value": "anydata|error" }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "NATS message trigger method." + "documentation": "NATS message trigger method.", + "default": "onMessage" } }, { "name": "onError", "optional": true, + "enabled": false, "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", "qualifiers": [ "remote" @@ -173,7 +188,9 @@ "moduleName": "nats", "version": "3.1.0" }, - "documentation": "The message received for the NATS subject." + "documentation": "The message received for the NATS subject.", + "enabled": true, + "value": "nats:AnydataMessage" }, { "name": "err", @@ -188,7 +205,9 @@ "version": "3.1.0" }, "optional": false, - "documentation": "The error occurred during the message processing." + "documentation": "The error occurred during the message processing.", + "enabled": true, + "value": "nats:Error" } ], "returnType": { @@ -198,39 +217,343 @@ ], "optional": true, "documentation": "Error object", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" } } ] } ], - "listenerParams": [ - { - "name": "url", - "typeName": "string|string[]", - "type": [ - "string", - "string[]" - ], - "optional": false, - "defaultable": false, - "documentation": "The NATS broker URL. For a clustered use case, provide the URLs as a string array" + "listener": { + "metadata": { + "label": "NATS Listener", + "description": "The NATS listener listens to messages from the NATS server" }, - { - "name": "config", - "typeName": "nats:ConnectionConfiguration", - "type": [ - "nats:ConnectionConfiguration" - ], - "optional": true, - "defaultable": false, - "documentation": "The connection configurations", - "typeInfo": { - "name": "ConnectionConfiguration", - "orgName": "ballerinax", - "moduleName": "nats", - "version": "3.1.0" + "valueType": "nats:Listener", + "valueTypeConstraint": "nats:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "url": { + "metadata": { + "label": "url", + "description": "The NATS broker URL. For a clustered use case, provide the URLs as a string array" + }, + "valueType": "string", + "valueTypeConstraint": "string|string[]", + "value": "", + "placeholder": "nats:DEFAULT_URL", + "editable": true, + "optional": false, + "advanced": false + }, + "config": { + "metadata": { + "label": "config", + "description": "The NATS connection configurations" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "nats:ConnectionConfiguration", + "value": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "connectionName": { + "metadata": { + "label": "connectionName", + "description": "The name of the connection" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "ballerina-nats", + "optional": true, + "editable": true, + "advanced": false + }, + "retryConfig": { + "metadata": { + "label": "retryConfig", + "description": "The configurations related to connection reconnect attempts" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "nats:RetryConfig", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "maxReconnect": { + "metadata": { + "label": "maxReconnect", + "description": "Maximum number of reconnect attempts. The reconnect state is triggered when an already established connection is lost. During the initial connection attempt, the client will cycle over its server list one time regardless of the `maxReconnects` value that is set. Use 0 to turn off auto reconnecting. Use -1 to turn on infinite reconnects." + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "60", + "optional": true, + "editable": true, + "advanced": false + }, + "reconnectWait": { + "metadata": { + "label": "reconnectWait", + "description": "The time(in seconds) to wait between the reconnect attempts to reconnect to the same server" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "2", + "optional": true, + "editable": true, + "advanced": false + }, + "connectionTimeout": { + "metadata": { + "label": "connectionTimeout", + "description": "The timeout (in seconds) for the connection attempts" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "2", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "ping": { + "metadata": { + "label": "ping", + "description": "The configurations related to pinging the server" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "nats:Ping", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "pingInterval": { + "metadata": { + "label": "pingInterval", + "description": "The interval (in seconds) between the attempts of pinging the server" + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "120", + "optional": true, + "editable": true, + "advanced": false + }, + "maxPingsOut": { + "metadata": { + "label": "maxPingsOut", + "description": "The maximum number of pings the client can have in flight" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "2", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "auth": { + "metadata": { + "label": "auth", + "description": "The configurations related to authentication" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "nats:Tokens", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "token": { + "metadata": { + "label": "token", + "description": "The token for token-based authentication" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + } + } + }, + "inboxPrefix": { + "metadata": { + "label": "inboxPrefix", + "description": "The connection's inbox prefix, which all inboxes will start with" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "_INBOX.", + "optional": true, + "editable": true, + "advanced": false + }, + "noEcho": { + "metadata": { + "label": "noEcho", + "description": "Turns off echoing. This prevents the server from echoing messages back to the connection if it has subscriptions on the subject being published to" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "false", + "optional": true, + "editable": true, + "advanced": false + }, + "secureSocket": { + "metadata": { + "label": "secureSocket", + "description": "The configurations related to SSL/TLS" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "SecureSocket", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "cert": { + "metadata": { + "label": "cert", + "description": "Configurations associated with `crypto:TrustStore` or single certificate file that the client trusts" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "key": { + "metadata": { + "label": "key", + "description": "Configurations associated with `crypto:KeyStore` or combination of certificate and private key of the client" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "CertKey", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "certFile": { + "metadata": { + "label": "certFile", + "description": "A file containing the certificate" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "keyFile": { + "metadata": { + "label": "keyFile", + "description": "A file containing the private key in PKCS8 format" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false + }, + "keyPassword": { + "metadata": { + "label": "keyPassword", + "description": "Password of the private key if it is encrypted" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "protocol": { + "metadata": { + "label": "protocol", + "description": "SSL/TLS protocol related options" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "record", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "name": { + "metadata": { + "label": "name", + "description": "The name of the protocol" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": false, + "editable": true, + "advanced": false, + "enum": [ + "nats:SSL", + "nats:TLS", + "nats:DTLS" + ] + } + } + } + } + }, + "validation": { + "metadata": { + "label": "validation", + "description": "Configuration related to constraint validation check" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + } + } } } - ] + } } diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json index 2c493cfbb9f3..2e344c771ef8 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/rabbitmq.json @@ -1,5 +1,5 @@ { - "id": 10002, + "id": 2, "name": "RabbitMQ Service", "type": "inbuilt", "displayName": "RabbitMQ", @@ -62,6 +62,7 @@ { "name": "RabbitMQ", "description": "RabbitMQ Service", + "enabled": true, "basePath": { "optional": false, "typeName": "string", @@ -69,7 +70,10 @@ "string" ], "defaultable": false, - "documentation": "The RabbitMQ queue name." + "documentation": "The RabbitMQ queue name.", + "enabled": true, + "value": "", + "placeholder": "queue-name" }, "functions": [ { @@ -79,6 +83,7 @@ "qualifiers": [ "remote" ], + "enabled": true, "parameters": [ { "name": "message", @@ -93,7 +98,9 @@ "moduleName": "rabbitmq", "version": "3.1.0" }, - "documentation": "The message received from the RabbitMQ queue." + "documentation": "The message received from the RabbitMQ queue.", + "enabled": true, + "value": "rabbitmq:AnydataMessage" }, { "name": "caller", @@ -108,7 +115,8 @@ "version": "3.1.0" }, "optional": true, - "documentation": "The RabbitMQ caller object to acknowledge the message." + "documentation": "The RabbitMQ caller object to acknowledge the message.", + "enabled": false } ], "returnType": { @@ -118,22 +126,26 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "RabbitMQ message trigger method." + "documentation": "RabbitMQ message trigger method.", + "default": "onMessage" } }, { - "name": "OnRequest", + "name": "onRequest", "documentation": "The `onRequest` remote method will be triggered when a message is received in the specified queue and a response is expected.", "optional": false, "qualifiers": [ "remote" ], + "enabled": false, "parameters": [ { "name": "message", @@ -148,7 +160,9 @@ "moduleName": "rabbitmq", "version": "3.1.0" }, - "documentation": "The message received from the RabbitMQ queue." + "documentation": "The message received from the RabbitMQ queue.", + "enabled": true, + "value": "rabbitmq:AnydataMessage" }, { "name": "caller", @@ -163,7 +177,8 @@ "version": "3.1.0" }, "optional": true, - "documentation": "The RabbitMQ caller object to acknowledge the message." + "documentation": "The RabbitMQ caller object to acknowledge the message.", + "enabled": "false" } ], "returnType": { @@ -173,13 +188,16 @@ ], "optional": false, "documentation": "The response message.", - "editable": false + "editable": false, + "enabled": true, + "value": "anydata|error" }, "group": { "id": 1, "name": "group-1", "type": "exclusive", - "documentation": "RabbitMQ message trigger method." + "documentation": "RabbitMQ message trigger method.", + "default": "onMessage" } }, { @@ -189,6 +207,7 @@ "qualifiers": [ "remote" ], + "enabled": false, "parameters": [ { "name": "message", @@ -203,7 +222,9 @@ "moduleName": "rabbitmq", "version": "3.1.0" }, - "documentation": "The message received from the RabbitMQ queue." + "documentation": "The message received from the RabbitMQ queue.", + "enabled": "true", + "value": "rabbitmq:AnydataMessage" }, { "name": "err", @@ -218,7 +239,9 @@ "version": "3.1.0" }, "optional": false, - "documentation": "The error occurred during the message processing." + "documentation": "The error occurred during the message processing.", + "enabled": "true", + "value": "rabbitmq:Error" } ], "returnType": { @@ -228,64 +251,394 @@ ], "optional": true, "documentation": "Error object.", - "defaultTypeName": "error?" + "defaultTypeName": "error?", + "enabled": "true", + "value": "error?" } } ] } ], - "listenerParams": [ - { - "name": "host", - "typeName": "string", - "type": [ - "string" - ], - "optional": false, - "defaultable": false, - "documentation": "The RabbitMQ server host name used for establishing the connection." - }, - { - "name": "port", - "typeName": "int", - "type": [ - "int" - ], - "optional": false, - "defaultable": false, - "documentation": "The RabbitMQ server port used for establishing the connection." - }, - { - "name": "qosSettings", - "typeName": "rabbitmq:QosSettings", - "type": [ - "rabbitmq:QosSettings" - ], - "optional": true, - "defaultable": false, - "documentation": "The consumer prefetch settings.", - "typeInfo": { - "name": "QosSettings", - "orgName": "ballerinax", - "moduleName": "rabbitmq", - "version": "3.1.0" - } + "listener": { + "metadata": { + "label": "RabbitMQ Listener", + "description": "The RabbitMQ listener listens to messages from a RabbitMQ server." }, - { - "name": "connectionData", - "typeName": "rabbitmq:ConnectionData", - "type": [ - "rabbitmq:ConnectionData" - ], - "optional": true, - "defaultable": false, - "documentation": "The connection data used for establishing the connection.", - "typeInfo": { - "name": "ConnectionData", - "orgName": "ballerinax", - "moduleName": "rabbitmq", - "version": "3.1.0" + "valueType": "rabbitmq:Listener", + "valueTypeConstraint": "rabbitmq:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "host": { + "metadata": { + "label": "host", + "description": "The RabbitMQ server host name used for establishing the connection." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "rabbitmq:DEFAULT_HOST", + "editable": true, + "optional": false, + "advanced": false + }, + "port": { + "metadata": { + "label": "port", + "description": "The RabbitMQ server port used for establishing the connection." + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "rabbitmq:DEFAULT_PORT", + "editable": true, + "optional": false, + "advanced": false + }, + "qosSettings": { + "metadata": { + "label": "qosSettings", + "description": "The consumer prefetch settings." + }, + "valueType": "rabbitmq:QosSettings", + "valueTypeConstraint": "rabbitmq:QosSettings", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "prefetchCount": { + "metadata": { + "label": "prefetchCount", + "description": "The maximum number of messages that the server will deliver. Give the value as 0 if unlimited" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "editable": true, + "optional": false, + "advanced": false + }, + "prefetchSize": { + "metadata": { + "label": "prefetchSize", + "description": "The maximum amount of content (measured in octets) that the server will deliver and 0 if unlimited" + }, + "valueType": "int", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "global": { + "metadata": { + "label": "global", + "description": "Indicates whether the settings should be shared among all the consumers." + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "false", + "editable": true, + "optional": true, + "advanced": false + } + } + }, + "connectionData": { + "metadata": { + "label": "connectionData", + "description": "The connection data used for establishing the connection." + }, + "valueType": "rabbitmq:ConnectionData", + "valueTypeConstraint": "rabbitmq:ConnectionData", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "username": { + "metadata": { + "label": "username", + "description": "The username used for establishing the connection." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "The password used for establishing the connection." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "virtualHost": { + "metadata": { + "label": "virtualHost", + "description": "The virtual host to use when connecting to the broker." + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "connectionTimeout": { + "metadata": { + "label": "connectionTimeout", + "description": "Connection TCP establishment timeout in seconds and zero for infinite." + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "handshakeTimeout": { + "metadata": { + "label": "handshakeTimeout", + "description": "The AMQP 0-9-1 protocol handshake timeout in seconds." + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "shutdownTimeout": { + "metadata": { + "label": "shutdownTimeout", + "description": "Shutdown timeout in seconds, zero for infinite, and the default value is 10. If the consumers exceed this timeout, then any remaining queued deliveries (and other Consumer callbacks) will be lost." + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "heartbeat": { + "metadata": { + "label": "heartbeat", + "description": "The initially-requested heartbeat timeout in seconds and zero for none." + }, + "valueType": "decimal", + "valueTypeConstraint": "decimal", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "validation": { + "metadata": { + "label": "validation", + "description": "Configuration related to constraint validation check." + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "editable": true, + "optional": true, + "advanced": false + }, + "secureSocket": { + "metadata": { + "label": "secureSocket", + "description": "Configurations for facilitating secure connections." + }, + "valueType": "rabbitmq:SecureSocket", + "valueTypeConstraint": "rabbitmq:SecureSocket", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "cert": { + "metadata": { + "label": "cert", + "description": "Configurations associated with `crypto:TrustStore` or single certificate file that the client trusts" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "key": { + "metadata": { + "label": "key", + "description": "Configurations associated with `crypto:KeyStore` or combination of certificate and private key of the client" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "rabbitmq:CertKey", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "certFile": { + "metadata": { + "label": "certFile", + "description": "A file containing the certificate" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "keyFile": { + "metadata": { + "label": "keyFile", + "description": "A file containing the private key in PKCS8 format" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + }, + "keyPassword": { + "metadata": { + "label": "keyPassword", + "description": "Password of the private key if it is encrypted" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false + } + }, + "protocol": { + "metadata": { + "label": "protocol", + "description": "SSL/TLS protocol related options" + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "record", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": true, + "fields": { + "name": { + "metadata": { + "label": "name", + "description": "The name of the protocol" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "optional": true, + "editable": true, + "advanced": false, + "enum": [ + "rabbitmq:SSL", + "rabbitmq:TLS", + "rabbitmq:DTLS" + ] + } + } + }, + "verifyHostName": { + "metadata": { + "label": "verifyHostName", + "description": "Enable/disable host name verification" + }, + "valueType": "boolean", + "valueTypeConstraint": "boolean", + "value": "", + "placeholder": "true", + "optional": true, + "editable": true, + "advanced": false + } + } + }, + "auth": { + "metadata": { + "label": "auth", + "description": "Configurations related to authentication." + }, + "valueType": "rabbitmq:Credentials", + "valueTypeConstraint": "rabbitmq:Credentials", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": true, + "fields": { + "username": { + "metadata": { + "label": "username", + "description": "Username to use for authentication" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + }, + "password": { + "metadata": { + "label": "password", + "description": "Password/secret/token to use for authentication" + }, + "valueType": "string", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "", + "editable": true, + "optional": true, + "advanced": false + } + } + } + } + } } } - ] + } } From 3a895c29db980fbefe0ae5aea415f08991aaf62f Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Thu, 7 Nov 2024 08:41:06 +0530 Subject: [PATCH 34/42] Add new stable triggers --- .../main/resources/inbuilt-triggers/asb.json | 402 ++++ .../resources/inbuilt-triggers/github.json | 1821 +++++++++++++++++ .../inbuilt-triggers/properties.json | 67 +- .../inbuilt-triggers/salesforce.json | 393 ++++ 4 files changed, 2668 insertions(+), 15 deletions(-) create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/asb.json create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/github.json create mode 100644 misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/salesforce.json diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/asb.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/asb.json new file mode 100644 index 000000000000..a3b83d964495 --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/asb.json @@ -0,0 +1,402 @@ +{ + "id": 7, + "name": "ASB Service", + "type": "inbuilt", + "displayName": "ASB", + "documentation": "This ASB service can be attached to a ASB listener which listens to a given ASB topic/queue and triggers the service when a message is received. The service should have the `onMessage` remote function to handle the received message. Additionally, the service can have the `onError` remote method to handle errors that occur during the message processing.", + "listenerProtocol": "asb", + "displayAnnotation": { + "label": "ASB", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 19946, + "organization": "ballerinax", + "name": "asb", + "version": "3.8.2", + "platform": "java17", + "languageSpecificationVersion": "2023R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/asb/3.8.2", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/asb/3.8.2/ballerinax-asb-java17-3.8.2.bala?Expires=1730862517&Signature=N~sZ4dOOu9vC74hlcpKXySnm1U~flnHxRvW4O~XBQxpea0fbQCrRZvUHqMcxG218O2FM6yZzu9dm2-NaV8y6rQz~grHh88yRdnJcnf0RVloWakL8MtCkmz88AxgSihK3uJLloJBrV7hsHLsIm7K~QyARVyS9KXs5hGneCGz5FM7WrVsi9C3gk2gAYIk2PBnYk~hk2dshHgciZAwlJKf95i66hpN9RjY1ZQa49zsrxT-8y-HtghMdQZgYNaSwPZktVv9VCGrVKbLJUxC0R883PVXyBXq6MDut17TlNWORVqyGPkwZnDJMeUmjeIS-tOXNuXVZpUsEt87ZDJWCwEjUvg__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=847f1c1ec1de7ce81891be8845772ae0e64e8cc7d5b4b0d302a4565b54cda4b0", + "summary": "The [Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/) is a fully managed enterprise message broker with message queues and publish-subscribe topics. It", + "readme": "## Overview\n\nThe [Azure Service Bus](https:\/\/docs.microsoft.com\/en-us\/azure\/service-bus-messaging\/) is a fully managed enterprise message broker with message queues and publish-subscribe topics. It\nprovides the capability to send and receive messages from Service Bus queues, topics, and subscriptions. The Azure\nService Bus handles messages that include data representing any kind of information, including structured data encoded\nwith common formats such as the following ones: JSON, XML, and Plain Text.\n\nThe [Ballerina](https:\/\/ballerina.io\/) connector for Azure Service Bus allows you to connect to\nan [Azure Service Bus](https:\/\/docs.microsoft.com\/en-us\/azure\/service-bus-messaging\/) via the Ballerina language.\n\nThis connector supports the following operations:\n- Manage (Get\/Create\/Update\/Delete\/list) a queue, topic, subscription or rule.\n- Send messages to a queue, topic, or subscription.\n- Receive messages from a queue, topic, or subscription.\n\nThe Ballerina Azure Service Bus module utilizes Microsoft's [Azure Service Bus JAVA SDK 7.13.1](https:\/\/learn.microsoft.com\/en-us\/java\/api\/overview\/azure\/service-bus?view=azure-java-stable#libraries-for-data-access). \n\n## Setup guide\n\nBefore using this connector in your Ballerina application, complete the following:\n\n### Create a namespace in the Azure portal\n\nTo begin using Service Bus messaging in Azure, you must first create a namespace with a name that is unique across Azure. A namespace provides a scoping container for Service Bus resources within your application.\n\nTo create a namespace:\n\n#### Step 1: Sign in to the [Azure portal](https:\/\/portal.azure.com\/)\nIf you don't have an Azure subscription, [sign up for a free Azure account](https:\/\/azure.microsoft.com\/free\/).\n\n#### Step 2: Go to the Create Resource Service Bus menu\n\nIn the left navigation pane of the portal, select **All services**, select **Integration** from the list of categories, hover the mouse over **Service Bus**, and then select **Create** on the Service Bus tile.\n\n![Create Resource Service Bus Menu](https:\/\/raw.githubusercontent.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/main\/ballerina\/resources\/create-resource-service-bus-menu.png)\n\n#### Step 3: In the Basics tag of the Create namespace page, follow these steps:\n\n1. For **Subscription**, choose an Azure subscription in which to create the namespace.\n\n2. For **Resource group**, choose an existing resource group in which the namespace will live, or create a new one.\n\n3. Enter a **name for the namespace**. The namespace name should adhere to the following naming conventions:\n\n* The name must be unique across Azure. The system immediately checks to see if the name is available.\n* The name length is at least 6 and at most 50 characters.\n* The name can contain only letters, numbers, and hyphens ?-?.\n* The name must start with a letter and end with a letter or number.\n* The name doesn't end with ?-sb? or ?-mgmt?.\n\n4. For **Location**, choose the region in which your namespace should be hosted.\n\n5. For **Pricing tier**, select the pricing tier (Basic, Standard, or Premium) for the namespace. For this quickstart, select Standard.\n\n> **Notice:** If you want to use topics and subscriptions, choose either Standard or Premium. Topics\/subscriptions aren't supported in the Basic pricing tier. If you selected the Premium pricing tier, specify the number of messaging units. The premium tier provides resource isolation at the CPU and memory level so that each workload runs in isolation. This resource container is called a messaging unit. A premium namespace has at least one messaging unit. You can select 1, 2, 4, 8, or 16 messaging units for each Service Bus Premium namespace. For more information, see [Service Bus Premium Messaging](https:\/\/learn.microsoft.com\/en-us\/azure\/service-bus-messaging\/service-bus-premium-messaging).`\n\n6. Select **Review + create** at the bottom of the page.\n\n![Create Namespace](https:\/\/raw.githubusercontent.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/main\/ballerina\/resources\/create-namespace.png)\n\n7. On the **Review + create** page, review settings, and select **Create**.\n\n\n### Obtain tokens for authentication\n\nTo send and receive messages from a Service Bus queue or topic, clients must use a token that is signed by a shared access key, which is part of a shared access policy. A shared access policy defines a set of permissions that can be assigned to one or more Service Bus entities (queues, topics, event hubs, or relays). A shared access policy can be assigned to more than one entity, and a single entity can have more than one shared access policy assigned to it.\n\nTo obtain a token following steps should be followed:\n\n1. In the left navigation pane of the portal, select *All services*, select *Integration* from the list of categories, hover the mouse over *Service Bus*, and then select your namespace.\n\n2. In the left navigation pane of the namespace page, select *Shared access policies*.\n\n3. Click on the *RootManageSharedAccessKey* policy.\n\n4. Copy the *Primary Connection String* value and save it in a secure location. This is the connection string that you use to authenticate with the Service Bus service.\n\n![Connection String](https:\/\/raw.githubusercontent.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/main\/ballerina\/resources\/connection-string.png)\n\n\n## Quickstart\nTo use the ASB connector in your Ballerina application, modify the .bal file as follows:\n\n### Step 1: Import connector\n\nImport the `ballerinax\/asb` module into the Ballerina project.\n\n```ballerina\nimport ballerinax\/asb;\n```\n\n### Step 2: Create a new connector instance\n\n#### Initialize an Admin Client\n\nThis can be done by providing a connection string.\n\n````ballerina\n configurable string connectionString = ?;\n asb:AdminClient admin = check new (connectionString);\n````\n\n#### Initialize a Message Sender client\n\nThis can be done by providing a connection string with a queue or topic name.\n\n```ballerina\n configurable string connectionString = ?;\n\n ASBServiceSenderConfig senderConfig = {\n connectionString: connectionString,\n entityType: QUEUE,\n topicOrQueueName: \"myQueue\"\n };\n asb:MessageSender sender = check new (senderConfig);\n```\n\n#### Initialize a Message Receiver client\n\nThis can be done by providing a connection string with a queue name, topic name, or subscription path. \n\n> Here, the Receive mode is optional. (Default: PEEKLOCK)\n\n```ballerina\n configurable string connectionString = ?;\n\n ASBServiceReceiverConfig receiverConfig = {\n connectionString: connectionString,\n entityConfig: {\n queueName: \"myQueue\"\n },\n receiveMode: PEEK_LOCK\n };\n asb:MessageReceiver receiver = check new (receiverConfig);\n```\n\n#### Initialize a message listener\n\nThis can be done by providing a connection string with a queue name, topic name, or subscription path.\n\n> Here, the Receive mode is optional. (Default: PEEKLOCK)\n\n```ballerina\n configurable string connectionString = ?;\n\n listener asb:Listener asbListener = check new (\n connectionString = connectionString,\n entityConfig = {\n queueName: \"myQueue\"\n }\n );\n```\n\n### Step 3: Invoke connector operation\n\nNow you can use the remote operations available within the connector,\n\n**Create a queue in the Azure Service Bus**\n\n ```ballerina\npublic function main() returns error? {\n asb:AdminClient admin = check new (adminConfig);\n\n check admin->createQueue(\"myQueue\");\n\n check admin->close();\n}\n ```\n\n**Send a message to the Azure Service Bus**\n\n```ballerina\npublic function main() returns error? {\n asb:MessageSender queueSender = check new (senderConfig);\n\n string stringContent = \"This is My Message Body\"; \n byte[] byteContent = stringContent.toBytes();\n int timeToLive = 60; \/\/ In seconds\n\n asb:ApplicationProperties applicationProperties = {\n properties: {a: \"propertyValue1\", b: \"propertyValue2\"}\n };\n\n asb:Message message = {\n body: byteContent,\n contentType: asb:TEXT,\n timeToLive: timeToLive,\n applicationProperties: applicationProperties\n };\n\n check queueSender->send(message);\n\n check queueSender->close();\n}\n```\n\n**Receive a message from the Azure Service Bus**\n\n```ballerina\npublic function main() returns error? {\n asb:MessageReceiver queueReceiver = check new (receiverConfig);\n\n int serverWaitTime = 60; \/\/ In seconds\n\n asb:Message|asb:Error? messageReceived = queueReceiver->receive(serverWaitTime);\n\n if (messageReceived is asb:Message) {\n log:printInfo(\"Reading Received Message : \" + messageReceived.toString());\n } else if (messageReceived is ()) {\n log:printError(\"No message in the queue.\");\n } else {\n log:printError(\"Receiving message via Asb receiver connection failed.\");\n }\n\n check queueReceiver->close();\n}\n```\n\n**Receive messages from Azure service bus using `asb:Service`**\n\n```ballerina\nservice asb:Service on asbListener {\n\n isolated remote function onMessage(asb:Message message) returns error? {\n log:printInfo(\"Reading Received Message : \" + message.toString());\n }\n\n isolated remote function onError(asb:MessageRetrievalError 'error) returns error? {\n log:printError(\"Error occurred while receiving messages from ASB\", 'error);\n }\n}\n```\n\n### Step 4: Run the Ballerina application\n\n```bash\nbal run\n```\n\n## Examples\n\nThere are two sets of examples demonstrating the use of the Ballerina Azure Service Bus (ASB) Connector.\n\n- **[Management Related Examples](https:\/\/github.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/tree\/main\/examples\/admin)**: These examples cover operations related to managing the Service Bus, such as managing queues, topics, subscriptions, and rules. \n\n- **[Message Sending and Receiving Related Examples](https:\/\/github.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/tree\/main\/examples\/sender_reciever)**: This set includes examples for sending to and receiving messages from queues, topics, and subscriptions in the Service Bus.", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerinax-azure-service-bus", + "keywords": [ + "IT Operations/Message Brokers", + "Cost/Paid", + "Vendor/Microsoft" + ], + "ballerinaVersion": "2201.8.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_asb_3.8.2.png", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1727786875000, + "pullCount": 6, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/asb/3.8.2", + "apiDocURL": "https://lib.ballerina.io/ballerinax/asb/3.8.2", + "name": "asb", + "summary": "The [Azure Service Bus](https://docs.microsoft.com/en-us/azure/service-bus-messaging/) is a fully managed enterprise message broker with message queues and publish-subscribe topics. It", + "readme": "## Overview\n\nThe [Azure Service Bus](https:\/\/docs.microsoft.com\/en-us\/azure\/service-bus-messaging\/) is a fully managed enterprise message broker with message queues and publish-subscribe topics. It\nprovides the capability to send and receive messages from Service Bus queues, topics, and subscriptions. The Azure\nService Bus handles messages that include data representing any kind of information, including structured data encoded\nwith common formats such as the following ones: JSON, XML, and Plain Text.\n\nThe [Ballerina](https:\/\/ballerina.io\/) connector for Azure Service Bus allows you to connect to\nan [Azure Service Bus](https:\/\/docs.microsoft.com\/en-us\/azure\/service-bus-messaging\/) via the Ballerina language.\n\nThis connector supports the following operations:\n- Manage (Get\/Create\/Update\/Delete\/list) a queue, topic, subscription or rule.\n- Send messages to a queue, topic, or subscription.\n- Receive messages from a queue, topic, or subscription.\n\nThe Ballerina Azure Service Bus module utilizes Microsoft's [Azure Service Bus JAVA SDK 7.13.1](https:\/\/learn.microsoft.com\/en-us\/java\/api\/overview\/azure\/service-bus?view=azure-java-stable#libraries-for-data-access). \n\n## Setup guide\n\nBefore using this connector in your Ballerina application, complete the following:\n\n### Create a namespace in the Azure portal\n\nTo begin using Service Bus messaging in Azure, you must first create a namespace with a name that is unique across Azure. A namespace provides a scoping container for Service Bus resources within your application.\n\nTo create a namespace:\n\n#### Step 1: Sign in to the [Azure portal](https:\/\/portal.azure.com\/)\nIf you don't have an Azure subscription, [sign up for a free Azure account](https:\/\/azure.microsoft.com\/free\/).\n\n#### Step 2: Go to the Create Resource Service Bus menu\n\nIn the left navigation pane of the portal, select **All services**, select **Integration** from the list of categories, hover the mouse over **Service Bus**, and then select **Create** on the Service Bus tile.\n\n![Create Resource Service Bus Menu](https:\/\/raw.githubusercontent.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/main\/ballerina\/resources\/create-resource-service-bus-menu.png)\n\n#### Step 3: In the Basics tag of the Create namespace page, follow these steps:\n\n1. For **Subscription**, choose an Azure subscription in which to create the namespace.\n\n2. For **Resource group**, choose an existing resource group in which the namespace will live, or create a new one.\n\n3. Enter a **name for the namespace**. The namespace name should adhere to the following naming conventions:\n\n* The name must be unique across Azure. The system immediately checks to see if the name is available.\n* The name length is at least 6 and at most 50 characters.\n* The name can contain only letters, numbers, and hyphens ?-?.\n* The name must start with a letter and end with a letter or number.\n* The name doesn't end with ?-sb? or ?-mgmt?.\n\n4. For **Location**, choose the region in which your namespace should be hosted.\n\n5. For **Pricing tier**, select the pricing tier (Basic, Standard, or Premium) for the namespace. For this quickstart, select Standard.\n\n> **Notice:** If you want to use topics and subscriptions, choose either Standard or Premium. Topics\/subscriptions aren't supported in the Basic pricing tier. If you selected the Premium pricing tier, specify the number of messaging units. The premium tier provides resource isolation at the CPU and memory level so that each workload runs in isolation. This resource container is called a messaging unit. A premium namespace has at least one messaging unit. You can select 1, 2, 4, 8, or 16 messaging units for each Service Bus Premium namespace. For more information, see [Service Bus Premium Messaging](https:\/\/learn.microsoft.com\/en-us\/azure\/service-bus-messaging\/service-bus-premium-messaging).`\n\n6. Select **Review + create** at the bottom of the page.\n\n![Create Namespace](https:\/\/raw.githubusercontent.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/main\/ballerina\/resources\/create-namespace.png)\n\n7. On the **Review + create** page, review settings, and select **Create**.\n\n\n### Obtain tokens for authentication\n\nTo send and receive messages from a Service Bus queue or topic, clients must use a token that is signed by a shared access key, which is part of a shared access policy. A shared access policy defines a set of permissions that can be assigned to one or more Service Bus entities (queues, topics, event hubs, or relays). A shared access policy can be assigned to more than one entity, and a single entity can have more than one shared access policy assigned to it.\n\nTo obtain a token following steps should be followed:\n\n1. In the left navigation pane of the portal, select *All services*, select *Integration* from the list of categories, hover the mouse over *Service Bus*, and then select your namespace.\n\n2. In the left navigation pane of the namespace page, select *Shared access policies*.\n\n3. Click on the *RootManageSharedAccessKey* policy.\n\n4. Copy the *Primary Connection String* value and save it in a secure location. This is the connection string that you use to authenticate with the Service Bus service.\n\n![Connection String](https:\/\/raw.githubusercontent.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/main\/ballerina\/resources\/connection-string.png)\n\n\n## Quickstart\nTo use the ASB connector in your Ballerina application, modify the .bal file as follows:\n\n### Step 1: Import connector\n\nImport the `ballerinax\/asb` module into the Ballerina project.\n\n```ballerina\nimport ballerinax\/asb;\n```\n\n### Step 2: Create a new connector instance\n\n#### Initialize an Admin Client\n\nThis can be done by providing a connection string.\n\n````ballerina\n configurable string connectionString = ?;\n asb:AdminClient admin = check new (connectionString);\n````\n\n#### Initialize a Message Sender client\n\nThis can be done by providing a connection string with a queue or topic name.\n\n```ballerina\n configurable string connectionString = ?;\n\n ASBServiceSenderConfig senderConfig = {\n connectionString: connectionString,\n entityType: QUEUE,\n topicOrQueueName: \"myQueue\"\n };\n asb:MessageSender sender = check new (senderConfig);\n```\n\n#### Initialize a Message Receiver client\n\nThis can be done by providing a connection string with a queue name, topic name, or subscription path. \n\n> Here, the Receive mode is optional. (Default: PEEKLOCK)\n\n```ballerina\n configurable string connectionString = ?;\n\n ASBServiceReceiverConfig receiverConfig = {\n connectionString: connectionString,\n entityConfig: {\n queueName: \"myQueue\"\n },\n receiveMode: PEEK_LOCK\n };\n asb:MessageReceiver receiver = check new (receiverConfig);\n```\n\n#### Initialize a message listener\n\nThis can be done by providing a connection string with a queue name, topic name, or subscription path.\n\n> Here, the Receive mode is optional. (Default: PEEKLOCK)\n\n```ballerina\n configurable string connectionString = ?;\n\n listener asb:Listener asbListener = check new (\n connectionString = connectionString,\n entityConfig = {\n queueName: \"myQueue\"\n }\n );\n```\n\n### Step 3: Invoke connector operation\n\nNow you can use the remote operations available within the connector,\n\n**Create a queue in the Azure Service Bus**\n\n ```ballerina\npublic function main() returns error? {\n asb:AdminClient admin = check new (adminConfig);\n\n check admin->createQueue(\"myQueue\");\n\n check admin->close();\n}\n ```\n\n**Send a message to the Azure Service Bus**\n\n```ballerina\npublic function main() returns error? {\n asb:MessageSender queueSender = check new (senderConfig);\n\n string stringContent = \"This is My Message Body\"; \n byte[] byteContent = stringContent.toBytes();\n int timeToLive = 60; \/\/ In seconds\n\n asb:ApplicationProperties applicationProperties = {\n properties: {a: \"propertyValue1\", b: \"propertyValue2\"}\n };\n\n asb:Message message = {\n body: byteContent,\n contentType: asb:TEXT,\n timeToLive: timeToLive,\n applicationProperties: applicationProperties\n };\n\n check queueSender->send(message);\n\n check queueSender->close();\n}\n```\n\n**Receive a message from the Azure Service Bus**\n\n```ballerina\npublic function main() returns error? {\n asb:MessageReceiver queueReceiver = check new (receiverConfig);\n\n int serverWaitTime = 60; \/\/ In seconds\n\n asb:Message|asb:Error? messageReceived = queueReceiver->receive(serverWaitTime);\n\n if (messageReceived is asb:Message) {\n log:printInfo(\"Reading Received Message : \" + messageReceived.toString());\n } else if (messageReceived is ()) {\n log:printError(\"No message in the queue.\");\n } else {\n log:printError(\"Receiving message via Asb receiver connection failed.\");\n }\n\n check queueReceiver->close();\n}\n```\n\n**Receive messages from Azure service bus using `asb:Service`**\n\n```ballerina\nservice asb:Service on asbListener {\n\n isolated remote function onMessage(asb:Message message) returns error? {\n log:printInfo(\"Reading Received Message : \" + message.toString());\n }\n\n isolated remote function onError(asb:MessageRetrievalError 'error) returns error? {\n log:printError(\"Error occurred while receiving messages from ASB\", 'error);\n }\n}\n```\n\n### Step 4: Run the Ballerina application\n\n```bash\nbal run\n```\n\n## Examples\n\nThere are two sets of examples demonstrating the use of the Ballerina Azure Service Bus (ASB) Connector.\n\n- **[Management Related Examples](https:\/\/github.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/tree\/main\/examples\/admin)**: These examples cover operations related to managing the Service Bus, such as managing queues, topics, subscriptions, and rules. \n\n- **[Message Sending and Receiving Related Examples](https:\/\/github.com\/ballerina-platform\/module-ballerinax-azure-service-bus\/tree\/main\/examples\/sender_reciever)**: This set includes examples for sending to and receiving messages from queues, topics, and subscriptions in the Service Bus." + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "ASB", + "description": "ASB Service", + "enabled": true, + "functions": [ + { + "name": "onMessage", + "documentation": "The `onMessage` remote method will be triggered when a message is received for the ASB topic/queue.", + "optional": false, + "qualifiers": [ + "remote" + ], + "enabled": true, + "parameters": [ + { + "name": "message", + "typeName": "asb:Message", + "optional": false, + "type": [ + "asb:Message" + ], + "typeInfo": { + "name": "Message", + "orgName": "ballerinax", + "moduleName": "asb", + "version": "3.8.2" + }, + "documentation": "The message received for ASB topic/queue.", + "enabled": true, + "value": "asb:Message" + }, + { + "name": "caller", + "typeName": "asb:Caller", + "type": [ + "asb:Caller" + ], + "typeInfo": { + "name": "Caller", + "orgName": "ballerinax", + "moduleName": "asb", + "version": "3.8.2" + }, + "optional": true, + "documentation": "The ASB caller object which can be used to mark messages as complete, abandon, deadLetter, or defer.", + "enabled": false, + "value": "asb:Caller" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "name": "onError", + "documentation": "The `onError` remote method will be triggered when an error occurs during the message processing.", + "optional": true, + "enabled": false, + "qualifiers": [ + "remote" + ], + "parameters": [ + { + "name": "err", + "typeName": "asb:MessageRetrievalError", + "type": [ + "asb:MessageRetrievalError" + ], + "optional": false, + "typeInfo": { + "name": "MessageRetrievalError", + "orgName": "ballerinax", + "moduleName": "asb", + "version": "3.8.2" + }, + "documentation": "The error occurred during the message processing.", + "enabled": true, + "value": "asb:MessageRetrievalError" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + } + ], + "listener": { + "metadata": { + "label": "ASB Listener", + "description": "The ASB listener to which the ASB service should be attached." + }, + "valueType": "OBJECT", + "valueTypeConstraint": "asb:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "config": { + "metadata": { + "label": "ASB Listener Configuration", + "description": "The configuration of the ASB listener." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "asb:ListenerConfiguration", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "fields": { + "connectionString": { + "metadata": { + "label": "Connection String", + "description": "Service bus connection string with Shared Access Signatures." + }, + "valueType": "STRING", + "valueTypeConstraint": "string", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + }, + "entityConfig": { + "metadata": { + "label": "Entity Configuration", + "description": "This field holds the configuration details of either a topic or a queue. The type of the entity is determined by the entityType field. The actual configuration details are stored in either a TopicSubsConfig or a QueueConfig record" + }, + "valueType": "UNION", + "valueTypeConstraint": "asb:TopicSubsConfig|asb:QueueConfig", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "unionTypes": [ + { + "metadata": { + "label": "Topic Configuration", + "description": "The configuration details of a topic." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "asb:TopicSubsConfig", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "fields": { + "topicName": { + "metadata": { + "label": "Topic Name", + "description": "The name of the topic." + }, + "valueType": "STRING", + "valueTypeConstraint": "string", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + }, + "subscriptionName": { + "metadata": { + "label": "Subscription Name", + "description": "A string field that holds the name of the topic." + }, + "valueType": "STRING", + "valueTypeConstraint": "string", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + } + } + }, + { + "metadata": { + "label": "Queue Configuration", + "description": "The configuration details of a queue." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "asb:QueueConfig", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "fields": { + "queueName": { + "metadata": { + "label": "Queue Name", + "description": "A string field that holds the name of the queue." + }, + "valueType": "STRING", + "valueTypeConstraint": "string", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + } + } + } + ] + }, + "receiveMode": { + "metadata": { + "label": "Receive Mode", + "description": "This field holds the receive modes(RECEIVE_AND_DELETE/PEEK_LOCK) for the connection. The receive mode determines how messages are retrieved from the entity" + }, + "valueType": "ENUM", + "valueTypeConstraint": "asb:ReceiveMode", + "placeholder": "asb:PEEK_LOCK", + "editable": true, + "enabled": true, + "optional": true, + "advanced": true, + "enum": [ + "asb:PEEK_LOCK", + "asb:RECEIVE_AND_DELETE" + ] + }, + "maxAutoLockRenewDuration": { + "metadata": { + "label": "Max Auto Lock Renew Duration", + "description": "Max lock renewal duration under PEEK_LOCK mode in seconds. Setting to 0 disables auto-renewal. For RECEIVE_AND_DELETE mode, auto-renewal is disabled." + }, + "valueType": "INT", + "valueTypeConstraint": "", + "placeholder": 300, + "editable": true, + "enabled": true, + "optional": true, + "advanced": false + }, + "amqpRetryOptions": { + "metadata": { + "label": "AMQP Retry Options", + "description": "The AMQP retry options." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "asb:AmqpRetryOptions", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": true, + "advanced": true, + "fields": { + "maxRetries": { + "metadata": { + "label": "Max Retries", + "description": "Maximum number of retry attempts." + }, + "valueType": "INT", + "valueTypeConstraint": "int", + "placeholder": 3, + "editable": true, + "enabled": true, + "optional": true, + "advanced": false + }, + "delay": { + "metadata": { + "label": "Delay", + "description": "Delay between retry attempts in seconds." + }, + "valueType": "DECIMAL", + "valueTypeConstraint": "decimal", + "placeholder": 10, + "editable": true, + "enabled": true, + "optional": true, + "advanced": false + }, + "maxDelay": { + "metadata": { + "label": "Max Delay", + "description": "Maximum permissible delay between retry attempts in seconds." + }, + "valueType": "DECIMAL", + "valueTypeConstraint": "decimal", + "placeholder": 60, + "editable": true, + "enabled": true, + "optional": true, + "advanced": false + }, + "tryTimeout": { + "metadata": { + "label": "Try Timeout", + "description": "Maximum duration to wait for completion of a single attempt in seconds." + }, + "valueType": "DECIMAL", + "valueTypeConstraint": "decimal", + "placeholder": 60, + "editable": true, + "enabled": true, + "optional": true, + "advanced": false + }, + "retryMode": { + "metadata": { + "label": "Retry Mode", + "description": "The retry mode." + }, + "valueType": "ENUM", + "valueTypeConstraint": "asb:AmqpRetryMode", + "placeholder": "asb:FIXED", + "editable": true, + "enabled": true, + "optional": true, + "advanced": false, + "enum": [ + "asb:EXPONENTIAL", + "asb:FIXED" + ] + } + } + } + } + } + } + } +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/github.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/github.json new file mode 100644 index 000000000000..98cf7041759e --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/github.json @@ -0,0 +1,1821 @@ +{ + "id": 9, + "name": "Trigger", + "displayName": "GitHub", + "documentation": "", + "moduleName": "trigger.github", + "serviceTypes": [ + { + "name": "IssuesService", + "enabled": false, + "description": "Triggers when a new event related to a GitHub issue is received. \nAvailable actions: onOpened, onClosed, onReopened, onAssigned, onUnassigned, onLabeled, and onUnlabeled\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onOpened", + "enabled": true, + "parameters": [ + { + "name": "payload", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "documentation": "The information about the triggered event.", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onClosed", + "enabled": true, + "parameters": [ + { + "name": "payload", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "documentation": "The information about the triggered event.", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onReopened", + "enabled": true, + "parameters": [ + { + "name": "payload", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "documentation": "The information about the triggered event.", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onAssigned", + "enabled": true, + "parameters": [ + { + "name": "payload", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "documentation": "The information about the triggered event.", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onLabeled", + "enabled": true, + "parameters": [ + { + "name": "payload", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "documentation": "The information about the triggered event.", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onAssigned", + "enabled": true, + "parameters": [ + { + "name": "payload", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "documentation": "The information about the triggered event.", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onUnlabeled", + "enabled": true, + "parameters": [ + { + "name": "payload", + "documentation": "The information about the triggered event.", + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "IssueCommentService", + "description": "Triggers when a new event is fired upon receiving a comment on a pull request or a GitHub issue.\nAvailable actions: onCreated, onEdited, and onDeleted\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onCreated", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "typeInfo": { + "name": "IssueCommentEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "optional": false, + "type": "github:IssuesEvent", + "value": "github:IssuesEvent", + "valueTypeConstraint": "github:IssuesEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "IssueCommentEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:IssueCommentEvent", + "valueTypeConstraint": "github:IssueCommentEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDeleted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "IssueCommentEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:IssueCommentEvent", + "valueTypeConstraint": "github:IssueCommentEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "PullRequestService", + "description": "Triggers when a new event related to a GitHub pull request is received.\nAvailable actions: onOpened, onClosed, onReopened, onAssigned, onUnassigned, \nonReviewRequested, onReviewRequestRemoved, onLabeled, onUnlabeled, and onEdited\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onOpened", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onClosed", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onReopened", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onAssigned", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onUnassigned", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onReviewRequested", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onReviewRequestRemoved", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onLabeled", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onUnlabeled", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestEvent", + "valueTypeConstraint": "github:PullRequestEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "PullRequestReviewService", + "description": "Triggers when Choreo recieved a new event from GitHub related to a pull request review.\nAvailable actions: onSubmitted, onEdited, and onDismissed\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onSubmitted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestReviewEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestReviewEvent", + "valueTypeConstraint": "github:PullRequestReviewEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestReviewEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestReviewEvent", + "valueTypeConstraint": "github:PullRequestReviewEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDismissed", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestReviewEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestReviewEvent", + "valueTypeConstraint": "github:PullRequestReviewEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "PullRequestReviewCommentService", + "description": "Triggers when a new event is received from GitHub when a comment is added to a pull request review's unified diff view.\nAvailable actions: onCreated, onEdited, and onDeleted\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onCreated", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestReviewCommentEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestReviewCommentEvent", + "valueTypeConstraint": "github:PullRequestReviewCommentEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestReviewCommentEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestReviewCommentEvent", + "valueTypeConstraint": "github:PullRequestReviewCommentEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDeleted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PullRequestReviewCommentEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PullRequestReviewCommentEvent", + "valueTypeConstraint": "github:PullRequestReviewCommentEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "ReleaseService", + "description": "Triggers when a new event related to a GitHub release is received.\nAvailable actions: onPublished, onUnpublished, onCreated, onEdited, onDeleted, onPreReleased, and onReleased\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onPublished", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onUnpublished", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onCreated", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDeleted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onPreReleased", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onReleased", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ReleaseEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ReleaseEvent", + "valueTypeConstraint": "github:ReleaseEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "LabelService", + "description": "Triggers when a new event related to labels is received.\nAvailable actions: onCreated, onEdited, and onDeleted\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onCreated", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "LabelEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:LabelEvent", + "valueTypeConstraint": "github:LabelEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "LabelEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:LabelEvent", + "valueTypeConstraint": "github:LabelEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDeleted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "LabelEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:LabelEvent", + "valueTypeConstraint": "github:LabelEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "MilestoneService", + "description": "Triggers when a new event related to GitHub milestones is received.\nAvailable actions: onCreated, onEdited, onDeleted, onClosed, and onOpened\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onCreated", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "MilestoneEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:MilestoneEvent", + "valueTypeConstraint": "github:MilestoneEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "MilestoneEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:MilestoneEvent", + "valueTypeConstraint": "github:MilestoneEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDeleted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "MilestoneEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:MilestoneEvent", + "valueTypeConstraint": "github:MilestoneEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onClosed", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "MilestoneEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:MilestoneEvent", + "valueTypeConstraint": "github:MilestoneEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onOpened", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "MilestoneEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "displayAnnotation": {}, + "hasRestType": false, + "defaultable": false, + "enabled": true, + "value": "github:MilestoneEvent", + "valueTypeConstraint": "github:MilestoneEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "PushService", + "description": "Triggers when a push event is received.\nAvailable action: onPush\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onPush", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "PushEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:PushEvent", + "valueTypeConstraint": "github:PushEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + }, + { + "name": "ProjectCardService", + "description": "Triggers when a new event related to project cards is received.\nAvailable actions: onCreated, onEdited, onMoved, onConverted, and onDeleted\n", + "functions": [ + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onCreated", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ProjectCardEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ProjectCardEvent", + "valueTypeConstraint": "github:ProjectCardEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onEdited", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ProjectCardEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ProjectCardEvent", + "valueTypeConstraint": "github:ProjectCardEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onMoved", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ProjectCardEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ProjectCardEvent", + "valueTypeConstraint": "github:ProjectCardEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onConverted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ProjectCardEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ProjectCardEvent", + "valueTypeConstraint": "github:ProjectCardEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "qualifiers": [ + "remote" + ], + "documentation": "", + "name": "onDeleted", + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "record", + "optional": false, + "typeInfo": { + "name": "ProjectCardEvent", + "orgName": "ballerinax", + "moduleName": "trigger.github", + "version": "0.9.2" + }, + "enabled": true, + "value": "github:ProjectCardEvent", + "valueTypeConstraint": "github:ProjectCardEvent" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + } + ], + "listener": { + "metadata": { + "label": "GitHub Listener", + "description": "The GitHub webhook listener." + }, + "valueType": "OBJECT", + "valueTypeConstraint": "github:Listener", + "value": "", + "enabled": true, + "editable": true, + "properties": { + "listenerConfig": { + "metadata": { + "label": "GitHub Listener Configuration", + "description": "The configuration of GitHub listener." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "github:ListenerConfig", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "fields": { + "webhookSecret": { + "metadata": { + "label": "Webhook Secret", + "description": "Secret specified when adding the github webhook" + }, + "valueType": "STRING", + "valueTypeConstraint": "string", + "value": "", + "placeholder": "github:DEFAULT_SECRET", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + }, + "listenOn": { + "metadata": { + "label": "Listen On", + "description": "The port to listen on or the HTTP listener" + }, + "valueType": "UNION", + "valueTypeConstraint": "int|http:Listener", + "value": "", + "placeholder": "8090", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false, + "unionTypes": [ + { + "metadata": { + "label": "Port", + "description": "The port to listen on" + }, + "valueType": "INT", + "valueTypeConstraint": "int", + "value": "", + "placeholder": "8090", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + }, + { + "metadata": { + "label": "The HTTP Listener", + "description": "The HTTP listener to listen on" + }, + "valueType": "OBJECT", + "valueTypeConstraint": "http:Listener", + "value": "", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + } + ] + } + } + } + } + }, + "listenerProtocol": "github", + "displayAnnotation": { + "label": "GitHub", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 13850, + "organization": "ballerinax", + "name": "trigger.github", + "version": "0.9.2", + "platform": "any", + "languageSpecificationVersion": "2023R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/trigger.github/0.9.2", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/trigger.github/0.9.2/ballerinax-trigger.github-any-0.9.2.bala?Expires=1730896710&Signature=H1DqnC32I2GT6gQVq8-j0HnR7A71HO0BMoHk6K8OGfWNQKarnDMLnnOMQauXsK3jpivAf9oAA7HIFxnqLahBMKHGWparjm7~Msqd3Qi9tEKRwFcavKJ4hpZT7mWbKekMlTvO0add1WbilyEs3w0OMQ1i0SAehPapLuu~ivWMBsoXgcl7bP2Q~cWXIz~vlu6SDq7U5nwk7EVNp08ReM~jNDfhfnMyFoipNaXjzjRtMETwFIl8key4dNvJQ79NGwdJ5j5XKlsu8E41HFINaK8hhAK2aSZQhVFaOc4tjuUqDLZKxfiqiQWAr0iLB~f5gIqzgR~3xvL-AsBLySQCQYnavA__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=bfb65ff1ede0382897890facecc98681a1095062c9ffeb52864db1bf9955055e", + "summary": "Listen to [Github Events API](https://docs.github.com/en/developers/webhooks-and-events/webhooks) from Ballerina", + "readme": "Listen to [Github Events API](https://docs.github.com/en/developers/webhooks-and-events/webhooks) from Ballerina\n\n## Package overview\nThe `ballerinax/trigger.github` is a [Ballerina](https://ballerina.io/) trigger for Github events api.\nThis package provides the capability to access Github Webhook API.\n\n### Compatibility\n| | Version |\n|-------------------------------|--------------------------------|\n| Ballerina Language | Ballerina Swan Lake 2201.4.1 |\n\n## Report issues\nTo report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Extended Library repository](https://github.com/ballerina-platform/ballerina-extended-library)\n\n## Useful links\n- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com).\n- Chat live with us via our [Discord server](https://discord.gg/ballerinalang).\n- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/asyncapi-triggers", + "keywords": [ + "Communication/Team Chat", + "Cost/Freemium", + "Trigger" + ], + "ballerinaVersion": "2201.7.1", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_trigger.github_0.9.2.png", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1706864765000, + "pullCount": 75, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/trigger.github/0.9.2", + "apiDocURL": "https://lib.ballerina.io/ballerinax/trigger.github/0.9.2", + "name": "trigger.github", + "summary": "The GitHub Trigger module allows you to listen to following events occur in GitHub. ", + "readme": "## Overview\nThe GitHub Trigger module allows you to listen to following events occur in GitHub. \n- `Ping`, `Fork`, `Push`, `Create`, `Watch`\n- `Release`, `Issue`, `Label`, `Milestone`\n- `Pull Request`, `Pull Request Review`, `Pull Request Review Comment`\n\nThis module supports [GitHub API](https://docs.github.com/en/graphql) v4 version and only allows to perform functions behalf of the currently logged in user.\n\n\n## Prerequisites\nBefore using this trigger in your Ballerina application, complete the following:\n\n* Create github account\n\n## Quickstart\nTo use the GitHub Trigger in your Ballerina application, update the .bal file as follows:\n\n### Step 1: Import the GitHub Webhook Ballerina library\nFirst, import the ballerinax/github.webhook and ballerina/websub modules into the Ballerina project as follows.\n\n```ballerina\n import ballerinax/trigger.github;\n```\n\n### Step 2: Initialize the GitHub Webhook Listener\nInitialize the Trigger by providing the listener config & port number/httpListener object.\n\n```ballerina\n configurable github:ListenerConfig userInput = {\n secret: \"xxxxxx\"\n };\n listener github:Listener webhookListener = new (userInput, 8090);\n```\n\nListener config is not mandatory If you haven't setup secret in webhook page we can omit it and initialize as follows.\n\n```ballerina\n listener github:Listener webhookListener = new (listenOn = 8090);\n```\n\nIf you don't provide a port it will use the default port which is 8090.\n\n```ballerina\n listener github:Listener webhookListener = new ();\n```\n\n### Step 3: Use the correct service type to implement the service\nUse the correct service type for the corresponding channel when implementing the service.\nEx :- If you need to listen to Issue events you may use IssuesService service type as follows.\n\n```ballerina\nservice github:IssuesService on githubListener {\n \n remote function onAssigned(github:IssuesEvent payload) returns error? {\n return;\n }\n\n remote function onClosed(github:IssuesEvent payload) returns error? {\n return;\n } \n\n remote function onLabeled(github:IssuesEvent payload) returns error? {\n return;\n }\n\n remote function onOpened(github:IssuesEvent payload) returns error? {\n return;\n }\n\n remote function onReopened(github:IssuesEvent payload) returns error? {\n return;\n }\n\n remote function onUnassigned(github:IssuesEvent payload) returns error? {\n return;\n }\n\n remote function onUnlabeled(github:IssuesEvent payload) returns error? {\n return;\n }\n}\n```\n\n### Step 4: Provide remote functions corresponding to the events which you are interested on\nThe remote functions can be provided as follows.\n\n```ballerina\n remote function onPush(github:PushEvent payload) returns error? {\n log:printInfo(\"Received push-event-message \", eventPayload = payload);\n }\n```\n### Step 5: Run the service \nUse `bal run` command to compile and run the Ballerina program. \n\n### Step 5: Configure Github webhook with the URL of the service\n- Create a webhook in github following [github documentation](https://docs.github.com/en/developers/webhooks-and-events/webhooks/creating-webhooks)\n- Provide the public URL of the started service as the Payload URL (Add a trailing / to the URL if its not present). \n- Provide application/json for the content type. \n- Support for secret field will be available in the next github trigger releases. \n- Select the list of events you need to subscribe to and click on Add webhook.\n\nThis will add a subscription to github event api and the ballerina service functions will be triggerred once an event is fired." + } + ], + "balToolId": "", + "graalvmCompatible": "Unknown" + } +} diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json index ce13fdbf2dea..2918c842283b 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/properties.json @@ -1,36 +1,36 @@ { - "10001": { + "1": { "name": "kafka", "orgName": "ballerinax", "packageName": "kafka", "keywords": [ "kafka", - "event streaming", "network", - "messaging" + "messaging", + "event" ] }, - "10002": { + "2": { "name": "rabbitmq", "orgName": "ballerinax", "packageName": "rabbitmq", "keywords": [ - "service", "messaging", - "network" + "network", + "event" ] }, - "10003": { + "3": { "name": "nats", "orgName": "ballerinax", "packageName": "nats", "keywords": [ - "service", "messaging", - "network" + "network", + "event" ] }, - "10004": { + "4": { "name": "mqtt", "orgName": "ballerina", "packageName": "mqtt", @@ -38,10 +38,11 @@ "mqtt", "messaging", "network", - "iot" + "iot", + "event" ] }, - "10005": { + "5": { "name": "jms", "orgName": "ballerinax", "packageName": "java.jms", @@ -49,10 +50,11 @@ "jms", "java", "messaging", - "network" + "network", + "event" ] }, - "10006": { + "6": { "name": "ftp", "orgName": "ballerina", "packageName": "ftp", @@ -61,7 +63,42 @@ "SFTP", "remote file", "file", - "service" + "event" + ] + }, + "7": { + "name": "asb", + "orgName": "ballerinax", + "packageName": "asb", + "keywords": [ + "asb", + "azure", + "service", + "messaging", + "network", + "event" + ] + }, + "8": { + "name": "salesforce", + "orgName": "ballerinax", + "packageName": "salesforce", + "keywords": [ + "salesforce", + "service", + "messaging", + "network", + "event" + ] + }, + "9": { + "name": "github", + "orgName": "ballerinax", + "packageName": "trigger.github", + "keywords": [ + "github", + "trigger", + "event" ] } } \ No newline at end of file diff --git a/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/salesforce.json b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/salesforce.json new file mode 100644 index 000000000000..28f8e6c61cf0 --- /dev/null +++ b/misc/ls-extensions/modules/trigger-service/src/main/resources/inbuilt-triggers/salesforce.json @@ -0,0 +1,393 @@ +{ + "id": 8, + "name": "Salesforce Service", + "type": "inbuilt", + "displayName": "Salesforce", + "documentation": "This Salesforce service can be attached to a Salesforce listener which listens to Salesforce events and triggers the service when an event occurs.", + "listenerProtocol": "salesforce", + "displayAnnotation": { + "label": "Salesforce", + "iconPath": "docs/icon.png" + }, + "package": { + "id": 15892, + "organization": "ballerinax", + "name": "salesforce", + "version": "8.1.0", + "platform": "java17", + "languageSpecificationVersion": "2024R1", + "isDeprecated": false, + "deprecateMessage": "", + "URL": "/ballerinax/salesforce/8.1.0", + "balaVersion": "2.0.0", + "balaURL": "https://fileserver.central.ballerina.io/2.0/ballerinax/salesforce/8.1.0/ballerinax-salesforce-java17-8.1.0.bala?Expires=1730886498&Signature=SNtxnwUSeYzR6odZVf-z~jtLoIEC27UQXvC9FX65P58jJdte0vMkPHp7GMRCrJCvvZXbid4bXtFhNiEtd~j5mBq-8qSaNeY2KnqH~rrIBG4gEf2IYzcndXWx3aJJi4G6rUQBzvph8XA-4Q1HTi6r8XaK-kY3ngT0msa9LOExdCfrYqMFerTJlYyRvRltGziVTH9yG8gI6Ukfh2OCmmVE9q-5lIf48yKqQuTQiWUpWhfBcyecPSxQ0XvTGtcxbGpsIpBj2346jTrvIVkc7G3q-nOubYJiUd4CwqcHZrfbJNWsNYnWU3UEhCjWrfvnUtbznETnP1ziWoE2ezkPIEmXqQ__&Key-Pair-Id=K27IQ7NPTKLKDU", + "digest": "sha-256=48743d8381d2edee978813d70d0dc603709916d6c718e4519f26feb7789f0065", + "summary": "Salesforce Sales Cloud is one of the leading Customer Relationship Management(CRM) software, provided by Salesforce.Inc. Salesforce enable users to efficiently manage sales and customer relationships through its APIs, robust and secure databases, and analytics services. Sales cloud provides serveral API packages to make operations on sObjects and metadata, execute queries and searches, and listen to change events through API calls using REST, SOAP, and CometD protocols. ", + "readme": "## Overview\n\nSalesforce Sales Cloud is one of the leading Customer Relationship Management(CRM) software, provided by Salesforce.Inc. Salesforce enable users to efficiently manage sales and customer relationships through its APIs, robust and secure databases, and analytics services. Sales cloud provides serveral API packages to make operations on sObjects and metadata, execute queries and searches, and listen to change events through API calls using REST, SOAP, and CometD protocols. \n\nBallerina Salesforce connector supports [Salesforce v59.0 REST API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.224.0.api_rest.meta\/api_rest\/intro_what_is_rest_api.htm), [Salesforce v59.0 SOAP API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api.meta\/api\/sforce_api_quickstart_intro.htm), [Salesforce v59.0 APEX REST API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.apexcode.meta\/apexcode\/apex_rest_intro.htm), [Salesforce v59.0 BULK API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_asynch.meta\/api_asynch\/api_asynch_introduction_bulk_api.htm), and [Salesforce v59.0 BULK V2 API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_asynch.meta\/api_asynch\/bulk_api_2_0.htm).\n\n## Setup guide\n\n1. Create a Salesforce account with the REST capability.\n\n2. Go to Setup --> Apps --> App Manager \n\n \"Setup\n\n3. Create a New Connected App.\n\n \"Create\n\n - Here we will be using https:\/\/test.salesforce.com as we are using sandbox environment. Users can use https:\/\/login.salesforce.com for normal usage.\n\n \"Create\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n \"Consumer\n\n5. Next step would be to get the token.\n - Log in to salesforce in your preferred browser and enter the following url.\n ```https:\/\/.salesforce.com\/services\/oauth2\/authorize?response_type=code&client_id=&redirect_uri=```\n - Allow access if an alert pops up and the browser will be redirected to a Url like follows.\n \n `https:\/\/login.salesforce.com\/?code=`\n \n - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n - Following request can be sent to obtain the tokens.\n \n ```curl -X POST https:\/\/.salesforce.com\/services\/oauth2\/token?code=&grant_type=authorization_code&client_id=&client_secret=&redirect_uri=https:\/\/test.salesforce.com\/``` \n - Tokens can be obtained from the response.\n\n## Quickstart\n\nTo use the Salesforce connector in your Ballerina application, modify the .bal file as follows:\n\n#### Step 1: Import connector\n\nImport the `ballerinax\/salesforce` package into the Ballerina project.\n\n```ballerina\nimport ballerinax\/salesforce;\n```\n\n#### Step 2: Create a new connector instance\n\nCreate a `salesforce:ConnectionConfig` with the obtained OAuth2 tokens and initialize the connector with it.\n```ballerina\nsalesforce:ConnectionConfig config = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\nsalesforce:Client salesforce = check new (config);\n```\n\n#### Step 3: Invoke connector operation\n\n1. Now you can utilize the available operations. Note that they are in the form of remote operations. \n\nFollowing is an example on how to create a record using the connector.\n\n ```ballerina\n salesforce:CreationResponse response = check \n baseClient->create(\"Account\", {\n \"Name\": \"IT World\",\n \"BillingCity\": \"New York\"\n });\n\n ```\n\n2. To integrate the Salesforce listener into your Ballerina application, update the .bal file as follows:\n\nCreate an instance of `salesforce:Listener` using your Salesforce username, password, security token, and subscribe channel name.\n\n```ballerina\nimport ballerinax\/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n auth: {\n username: \"username\",\n password: \"password\" + \"security token\"\n }\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n```\n\nImplement the listener?s remote functions and specify the channel name to be subscribed to as the service name.\n\n```ballerina\nimport ballerina\/io;\nimport ballerinax\/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n auth: {\n username: \"username\",\n password: \"password\" + \"security token\"\n }\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n\nservice \"\/data\/ChangeEvents\" on eventListener {\n remote function onCreate(salesforce:EventData payload) {\n io:println(\"Created \" + payload.toString());\n }\n\n remote isolated function onUpdate(salesforce:EventData payload) {\n io:println(\"Updated \" + payload.toString());\n }\n\n remote function onDelete(salesforce:EventData payload) {\n io:println(\"Deleted \" + payload.toString());\n }\n\n remote function onRestore(salesforce:EventData payload) {\n io:println(\"Restored \" + payload.toString());\n }\n}\n```\n\n3. Integrate custom SObject types\n\nTo seamlessly integrate custom SObject types into your Ballerina project, you have the option to either generate a package using the Ballerina Open API tool or utilize the `ballerinax\/salesforce.types` module. Follow the steps given [here](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/blob\/master\/ballerina\/modules\/types\/Module.md) based on your preferred approach.\n\n```ballerina\nimport ballerinax\/salesforce.types;\n\npublic function main() returns error? {\n types:AccountSObject accountRecord = {\n Name: \"IT World\",\n BillingCity: \"New York\"\n };\n\n salesforce:CreationResponse res = check salesforce->create(\"Account\", accountRecord);\n}\n```\n\n4. Use following command to compile and run the Ballerina program.\n\n```\nbal run\n````\n\n## Examples\n\nThe `salesforce` integration samples illustrate its usage in various integration scenarios. Explore these examples below, covering the use of salesforce APIs in integrations.\n\n## Examples\n\nThe `salesforce` connector provides practical examples illustrating usage in various scenarios. Explore these examples below, covering use cases like creating sObjects, retrieving records, and executing bulk operations.\n\n1. [Salesforce REST API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/rest_api_usecases) - How to employ REST API of Salesforce to carryout various tasks.\n\n2. [Salesforce Bulk API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/bulk_api_usecases) - How to employ Bulk API of Salesforce to execute Bulk jobs.\n\n3. [Salesforce Bulk v2 API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/bulkv2_api_usecases) - How to employ Bulk v2 API to execute an ingest job.\n\n4. [Salesforce APEX REST API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/apex_rest_api_usecases) - How to employ APEX REST API to create a case in Salesforce.", + "template": false, + "licenses": [ + "Apache-2.0" + ], + "authors": [ + "Ballerina" + ], + "sourceCodeLocation": "https://github.com/ballerina-platform/module-ballerinax-salesforce", + "keywords": [ + "Sales & CRM/Customer Relationship Management", + "Cost/Freemium" + ], + "ballerinaVersion": "2201.10.0", + "icon": "https://bcentral-packageicons.azureedge.net/images/ballerinax_salesforce_8.1.0.png", + "ownerUUID": "b5a9e54d-8ade-47a1-8abc-6bc46e89069d", + "createdDate": 1724472595000, + "pullCount": 166, + "visibility": "public", + "modules": [ + { + "packageURL": "/ballerinax/salesforce/8.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/salesforce/8.1.0", + "name": "salesforce", + "summary": "Salesforce Sales Cloud is one of the leading Customer Relationship Management(CRM) software, provided by Salesforce.Inc. Salesforce enable users to efficiently manage sales and customer relationships through its APIs, robust and secure databases, and analytics services. Sales cloud provides serveral API packages to make operations on sObjects and metadata, execute queries and searches, and listen to change events through API calls using REST, SOAP, and CometD protocols. ", + "readme": "## Overview\n\nSalesforce Sales Cloud is one of the leading Customer Relationship Management(CRM) software, provided by Salesforce.Inc. Salesforce enable users to efficiently manage sales and customer relationships through its APIs, robust and secure databases, and analytics services. Sales cloud provides serveral API packages to make operations on sObjects and metadata, execute queries and searches, and listen to change events through API calls using REST, SOAP, and CometD protocols. \n\nBallerina Salesforce connector supports [Salesforce v59.0 REST API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.224.0.api_rest.meta\/api_rest\/intro_what_is_rest_api.htm), [Salesforce v59.0 SOAP API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api.meta\/api\/sforce_api_quickstart_intro.htm), [Salesforce v59.0 APEX REST API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.apexcode.meta\/apexcode\/apex_rest_intro.htm), [Salesforce v59.0 BULK API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_asynch.meta\/api_asynch\/api_asynch_introduction_bulk_api.htm), and [Salesforce v59.0 BULK V2 API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.api_asynch.meta\/api_asynch\/bulk_api_2_0.htm).\n\n## Setup guide\n\n1. Create a Salesforce account with the REST capability.\n\n2. Go to Setup --> Apps --> App Manager \n\n \"Setup\n\n3. Create a New Connected App.\n\n \"Create\n\n - Here we will be using https:\/\/test.salesforce.com as we are using sandbox environment. Users can use https:\/\/login.salesforce.com for normal usage.\n\n \"Create\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n \"Consumer\n\n5. Next step would be to get the token.\n - Log in to salesforce in your preferred browser and enter the following url.\n ```\n https:\/\/.salesforce.com\/services\/oauth2\/authorize?response_type=code&client_id=&redirect_uri=\n ```\n - Allow access if an alert pops up and the browser will be redirected to a Url like follows.\n \n ```\n https:\/\/login.salesforce.com\/?code=\n ```\n \n - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n - Following request can be sent to obtain the tokens.\n \n ```\n curl -X POST https:\/\/.salesforce.com\/services\/oauth2\/token?code=&grant_type=authorization_code&client_id=&client_secret=&redirect_uri=https:\/\/test.salesforce.com\/\n ``` \n - Tokens can be obtained from the response.\n\n## Quickstart\n\nTo use the Salesforce connector in your Ballerina application, modify the .bal file as follows:\n\n#### Step 1: Import connector\n\nImport the `ballerinax\/salesforce` package into the Ballerina project.\n\n```ballerina\nimport ballerinax\/salesforce;\n```\n\n#### Step 2: Create a new connector instance\n\nCreate a `salesforce:ConnectionConfig` with the obtained OAuth2 tokens and initialize the connector with it.\n```ballerina\nsalesforce:ConnectionConfig config = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\nsalesforce:Client salesforce = check new (config);\n```\n\n#### Step 3: Invoke connector operation\n\n1. Now you can utilize the available operations. Note that they are in the form of remote operations. \n\nFollowing is an example on how to create a record using the connector.\n\n ```ballerina\n salesforce:CreationResponse response = check \n salesforce->create(\"Account\", {\n \"Name\": \"IT World\",\n \"BillingCity\": \"New York\"\n });\n\n ```\n\n2. To integrate the Salesforce listener into your Ballerina application, update the .bal file as follows:\n\nCreate an instance of `salesforce:Listener` using your Salesforce username, password, security token, and subscribe channel name.\n\n```ballerina\nimport ballerinax\/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n auth: {\n username: \"username\",\n password: \"password\" + \"security token\"\n }\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n```\n\nImplement the listener?s remote functions and specify the channel name to be subscribed to as the service name.\n\n```ballerina\nimport ballerina\/io;\nimport ballerinax\/salesforce;\n\nsalesforce:ListenerConfig listenerConfig = {\n auth: {\n username: \"username\",\n password: \"password\" + \"security token\"\n }\n};\nlistener salesforce:Listener eventListener = new (listenerConfig);\n\nservice \"\/data\/ChangeEvents\" on eventListener {\n remote function onCreate(salesforce:EventData payload) {\n io:println(\"Created \" + payload.toString());\n }\n\n remote isolated function onUpdate(salesforce:EventData payload) {\n io:println(\"Updated \" + payload.toString());\n }\n\n remote function onDelete(salesforce:EventData payload) {\n io:println(\"Deleted \" + payload.toString());\n }\n\n remote function onRestore(salesforce:EventData payload) {\n io:println(\"Restored \" + payload.toString());\n }\n}\n```\n\n3. Integrate custom SObject types\n\nTo seamlessly integrate custom SObject types into your Ballerina project, you have the option to either generate a package using the Ballerina Open API tool or utilize the `ballerinax\/salesforce.types` module. Follow the steps given [here](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/blob\/master\/ballerina\/modules\/types\/Module.md) based on your preferred approach.\n\n```ballerina\nimport ballerinax\/salesforce.types;\n\npublic function main() returns error? {\n types:AccountSObject accountRecord = {\n Name: \"IT World\",\n BillingCity: \"New York\"\n };\n\n salesforce:CreationResponse res = check salesforce->create(\"Account\", accountRecord);\n}\n```\n\n4. Use following command to compile and run the Ballerina program.\n\n```\nbal run\n````\n\n## Examples\n\nThe `salesforce` connector provides practical examples illustrating usage in various scenarios. Explore these examples below, covering use cases like creating sObjects, retrieving records, and executing bulk operations.\n\n1. [Salesforce REST API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/rest_api_usecases) - How to employ REST API of Salesforce to carryout various tasks.\n\n2. [Salesforce Bulk API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/bulk_api_usecases) - How to employ Bulk API of Salesforce to execute Bulk jobs.\n\n3. [Salesforce Bulk v2 API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/bulkv2_api_usecases) - How to employ Bulk v2 API to execute an ingest job.\n\n4. [Salesforce APEX REST API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/apex_rest_api_usecases) - How to employ APEX REST API to create a case in Salesforce." + }, + { + "packageURL": "/ballerinax/salesforce/8.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/salesforce.apex/8.1.0", + "name": "salesforce.apex", + "summary": "Salesforce Apex REST API enables you to expose your Apex classes and methods as RESTful web services. This module provides operations for executing custom Apex REST endpoints, allowing you to perform various HTTP operations on these endpoints and handle responses accordingly.", + "readme": "## Overview\n\nSalesforce Apex REST API enables you to expose your Apex classes and methods as RESTful web services. This module provides operations for executing custom Apex REST endpoints, allowing you to perform various HTTP operations on these endpoints and handle responses accordingly.\n\nBallerina Salesforce Apex REST API client supports the [Salesforce v59.0 APEX REST API](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.apexcode.meta\/apexcode\/apex_rest_intro.htm).\n\n## Setup guide\n\n1. Create a Salesforce account with the REST capability.\n\n2. Go to Setup --> Apps --> App Manager \n\n \"Setup\n\n3. Create a New Connected App.\n\n \"Create\n\n - Here we will be using https:\/\/test.salesforce.com as we are using sandbox environment. Users can use https:\/\/login.salesforce.com for normal usage.\n\n \"Create\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n \"Consumer\n\n5. The next step is to get the token.\n\n - Log in to Salesforce in your preferred browser and enter the following URL:\n `https:\/\/.salesforce.com\/services\/oauth2\/authorize?response_type=code&client_id=&redirect_uri=`\n - Allow access if an alert pops up, and the browser will be redirected to a URL like the following:\n `https:\/\/login.salesforce.com\/?code=`\n \n - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n\n - The following request can be sent to obtain the tokens.\n ```curl -X POST https:\/\/.salesforce.com\/services\/oauth2\/token?code=&grant_type=authorization_code&client_id=&client_secret=&redirect_uri=https:\/\/test.salesforce.com\/``` \n - Tokens can be obtained from the response.\n\n## Quickstart\n\nTo use the Salesforce Apex client in your Ballerina application, update the .bal file as follows:\n\n### Step 1: Import connector\n\nImport the `ballerinax\/salesforce.apex` module into the Ballerina project.\n\n```ballerina\nimport ballerinax\/salesforce.apex;\n```\n\n### Step 2: Create a new connector instance\n\nCreate a `ConnectionConfig` with the OAuth2 tokens obtained, and initialize the connector with it.\n```ballerina\napex:ConnectionConfig sfConfig = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\napex:Client apexClient = check new (sfConfig);\n```\n\n### Step 3: Invoke connector operation\n\n1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.\nFollowing is an example of how to execute a custom Apex REST endpoint using the connector.\n\n```ballerina\npublic function main() returns error? {\n string caseId = check apexClient->apexRestExecute(\"Cases\", \"POST\",\n {\n \"subject\": \"Item Fault!\",\n \"status\": \"New\",\n \"priority\": \"High\"\n });\n return;\n}\n```\n\n2. Use `bal run` command to compile and run the Ballerina program. \n\n## Examples\n\n1. [Salesforce APEX REST API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/apex_rest_api_usecases) - How to employ APEX REST API to create a case in Salesforce." + }, + { + "packageURL": "/ballerinax/salesforce/8.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/salesforce.bulk/8.1.0", + "name": "salesforce.bulk", + "summary": "Salesforce Bulk API is a specialized asynchronous RESTful API for loading and querying bulk of data at once. This module provides bulk data operations for CSV, JSON, and XML data types.", + "readme": "## Overview\nSalesforce Bulk API is a specialized asynchronous RESTful API for loading and querying bulk of data at once. This module provides bulk data operations for CSV, JSON, and XML data types.\n\nThis module supports [Salesforce Bulk API v1](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.224.0.api_asynch.meta\/api_asynch\/asynch_api_reference.htm).\n \n## Setup guide\n\n1. Create a Salesforce account with the REST capability.\n\n2. Go to Setup --> Apps --> App Manager \n\n \"Setup\n\n3. Create a New Connected App.\n\n \"Create\n\n - Here we will be using https:\/\/test.salesforce.com as we are using sandbox environment. Users can use https:\/\/login.salesforce.com for normal usage.\n\n \"Create\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n \"Consumer\n\n5. Next step would be to get the token.\n - Log in to salesforce in your preferred browser and enter the following url.\n `https:\/\/.salesforce.com\/services\/oauth2\/authorize?response_type=code&client_id=&redirect_uri=`\n - Allow access if an alert pops up and the browser will be redirected to a Url like follows.\n `https:\/\/login.salesforce.com\/?code=`\n \n - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n - Following request can be sent to obtain the tokens\n ```curl -X POST https:\/\/.salesforce.com\/services\/oauth2\/token?code=&grant_type=authorization_code&client_id=&client_secret=&redirect_uri=https:\/\/test.salesforce.com\/``` \n - Tokens can be obtained from the response.\n\n## Quickstart\nTo use the Salesforce connector in your Ballerina application, update the .bal file as follows:\n### Step 1: Import connector\nImport the `ballerinax\/salesforce.bulk` module into the Ballerina project.\n\n```ballerina\nimport ballerinax\/salesforce.bulk;\n```\n\n### Step 2: Create a new connector instance\nCreate a `ConnectionConfig` with the OAuth2 tokens obtained, and initialize the connector with it.\n```ballerina\nconfigurable string clientId = ?;\nconfigurable string clientSecret = ?;\nconfigurable string refreshToken = ?;\nconfigurable string refreshUrl = ?;\nconfigurable string baseUrl = ?;\n\nbulk:ConnectionConfig sfConfig = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\nbulk:Client bulkClient = check new (sfConfig);\n```\n\n### Step 3: Invoke connector operation\n\n1. Now you can use the operations available within the connector. Note that they are in the form of remote operations. \nFollowing is an example on how to insert bulk contacts using the connector.\n\n```ballerina\njson contacts = [\n {\n description: \"Created_from_Ballerina_Sf_Bulk_API\",\n FirstName: \"Morne\",\n LastName: \"Morkel\",\n Title: \"Professor Grade 03\",\n Phone: \"0442226670\",\n Email: \"morne89@gmail.com\"\n }\n];\n\npublic function main() returns error? {\n bulk:BulkJob insertJob = check bulkClient->createJob(\"insert\", \"Contact\", \"JSON\");\n\n bulk:BatchInfo batch = check bulkClient->addBatch(insertJob, contacts);\n}\n```\n\n2. Use `bal run` command to compile and run the Ballerina program. \n\n**[You can find a list of samples here](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/bulk_api_usecases)**" + }, + { + "packageURL": "/ballerinax/salesforce/8.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/salesforce.bulkv2/8.1.0", + "name": "salesforce.bulkv2", + "summary": "Salesforce Bulk API 2.0 enables you to handle large data sets asynchronously, optimizing performance for high-volume data operations. This module provides operations for executing bulk jobs and batches, allowing you to perform various data operations efficiently.", + "readme": "## Overview\n\nSalesforce Bulk API 2.0 enables you to handle large data sets asynchronously, optimizing performance for high-volume data operations. This module provides operations for executing bulk jobs and batches, allowing you to perform various data operations efficiently.\n\n## Setup guide\n\n1. Create a Salesforce Account with the Bulk API 2.0 Capability.\n\n2. Go to Setup --> Apps --> App Manager\n\n \"Setup\n\n3. Create a New Connected App.\n\n \"Create\n\n - Here we will be using https:\/\/test.salesforce.com as we are using sandbox environment. Users can use https:\/\/login.salesforce.com for normal usage.\n\n \"Create\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n \"Consumer\n\n5. The next step is to get the token.\n\n - Log in to Salesforce in your preferred browser and enter the following URL:\n `https:\/\/.salesforce.com\/services\/oauth2\/authorize?response_type=code&client_id=&redirect_uri=`\n - Allow access if an alert pops up, and the browser will be redirected to a URL like the following:\n `https:\/\/login.salesforce.com\/?code=`\n\n - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n\n - The following request can be sent to obtain the tokens.\n ```curl -X POST https:\/\/.salesforce.com\/services\/oauth2\/token?code=&grant_type=authorization_code&client_id=&client_secret=&redirect_uri=https:\/\/test.salesforce.com\/```\n - Tokens can be obtained from the response.\n\n## Quickstart\n\nTo use the Salesforce Bulk API client in your Ballerina application, update the .bal file as follows:\n\n#### Step 1: Import connector\n\nImport the `ballerinax\/salesforce.bulkv2` package into the Ballerina project.\n\n```ballerina\nimport ballerinax\/salesforce.bulkv2;\n```\n\n#### Step 2: Create a new connector instance\n\nCreate a `salesforce:ConnectionConfig` with the obtained OAuth2 tokens and initialize the connector with it.\n```ballerina\nbulkv2:ConnectionConfig config = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\nbulkv2:Client bulkv2Client = check new (config);\n```\n\n#### Step 3: Invoke connector operation\n\n1. Now you can use the operations available within the connector. Note that they are in the form of remote operations.\n\nFollowing is an example of how to create a bulk job using the connector.\n\n```ballerina\nbulkv2:BulkCreatePayload payload = {\n 'object: \"Contact\",\n contentType: \"CSV\",\n operation: \"insert\",\n lineEnding: \"LF\"\n};\nbulkv2:BulkJob insertJob = check baseClient->createIngestJob(payload);\n```\n\n2. Use following command to compile and run the Ballerina program.\n\n```\nbal run\n````\n\n## Examples\n\n1. [Salesforce Bulk v2 API use cases](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/bulkv2_api_usecases) - How to employ Bulk v2 API to execute an ingest job." + }, + { + "packageURL": "/ballerinax/salesforce/8.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/salesforce.soap/8.1.0", + "name": "salesforce.soap", + "summary": "Salesforce SOAP API provides CRUD operations for SObjects and allows you to maintain passwords, perform searches, and much more.", + "readme": "## Overview\nSalesforce SOAP API provides CRUD operations for SObjects and allows you to maintain passwords, perform searches, and much more.\n\nThis module supports [Salesforce v48.0 SOAP API Enterprise WDSL](https:\/\/developer.salesforce.com\/docs\/atlas.en-us.224.0.api.meta\/api\/sforce_api_quickstart_intro.htm).\n \n## Setup guide\n\n1. Create a Salesforce account with the REST capability.\n\n2. Go to Setup --> Apps --> App Manager \n\n \"Setup\n\n3. Create a New Connected App.\n\n \"Create\n\n - Here we will be using https:\/\/test.salesforce.com as we are using sandbox environment. Users can use https:\/\/login.salesforce.com for normal usage.\n\n \"Create\n\n4. After the creation user can get consumer key and secret through clicking on the `Manage Consumer Details` button.\n\n \"Consumer\n\n5. Next step would be to get the token.\n - Log in to salesforce in your preferred browser and enter the following url.\n `https:\/\/.salesforce.com\/services\/oauth2\/authorize?response_type=code&client_id=&redirect_uri=`\n - Allow access if an alert pops up and the browser will be redirected to a Url like follows.\n `https:\/\/login.salesforce.com\/?code=`\n \n - The code can be obtained after decoding the encoded code\n\n6. Get Access and Refresh tokens\n - Following request can be sent to obtain the tokens\n ```curl -X POST https:\/\/.salesforce.com\/services\/oauth2\/token?code=&grant_type=authorization_code&client_id=&client_secret=&redirect_uri=https:\/\/test.salesforce.com\/``` \n - Tokens can be obtained from the response.\n\n## Quickstart\nTo use the Salesforce connector in your Ballerina application, update the .bal file as follows:\n\n### Step 1: Import connector\nImport the `ballerinax\/salesforce.soap` module into the Ballerina project.\n\n```ballerina\nimport ballerinax\/salesforce.soap;\n```\n\n### Step 2: Create a new connector instance\nCreate a `soap:ConnectionConfig` with the OAuth2 tokens obtained, and initialize the connector with it.\n\n```ballerina\n\nsoap:ConnectionConfig config = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\nsoap:Client salesforce = check new (config);\n```\n\n### Step 3: Invoke connector operation\n1. Now you can use the operations available within the connector. Note that they are in the form of remote operations. \nFollowing is an example on how to convert lead using the connector.\n ```ballerina\n public function main() returns error? {\n soap:ConvertedLead response = check soapClient->convertLead({leadId = \"xxx\", convertedStatus: \"Closed - Converted\"});\n }\n ```\n2. Use `bal run` command to compile and run the Ballerina program. \n\n**[You can find a sample here](https:\/\/github.com\/ballerina-platform\/module-ballerinax-salesforce\/tree\/master\/examples\/soap_api_usecases)**" + }, + { + "packageURL": "/ballerinax/salesforce/8.1.0", + "apiDocURL": "https://lib.ballerina.io/ballerinax/salesforce.types/8.1.0", + "name": "salesforce.types", + "summary": "", + "readme": "## Overview\n\nSalesforce is a leading customer relationship management (CRM) platform that helps businesses manage and streamline their sales, service, and marketing operations. The [Ballerina Salesforce Connector](https:\/\/central.ballerina.io\/ballerinax\/salesforce\/latest) is a project designed to enhance integration capabilities with Salesforce by providing a seamless connection for Ballerina. Notably, this Ballerina project incorporates record type definitions for the base types of Salesforce objects, offering a comprehensive and adaptable solution for developers working on Salesforce integration projects.\n\n## Setup Guide\n\nTo customize this project for your Salesforce account and include your custom SObjects, follow the steps below:\n\n### Step 1: Login to Your Salesforce Developer Account\n\nBegin by logging into your [Salesforce Developer Account](https:\/\/developer.salesforce.com\/).\n\n### Step 2: Generate Open API Specification for Your SObjects\n\n#### Step 2.1: Initiate OpenAPI Document Generation\n\nUse the following command to send a POST request to start the OpenAPI document generation process.\n\n```bash\ncurl -X POST -H \"Content-Type: application\/json\" -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\" \\\nhttps:\/\/MyDomainName.my.salesforce.com\/services\/data\/vXX.X\/async\/specifications\/oas3 \\\n-d '{\"resources\": [\"*\"]}'\n```\nReplace YOUR_ACCESS_TOKEN and MyDomainName with your actual access token and Salesforce domain. If successful, you'll receive a response with a URI. Extract the locator ID from the URI.\n\n#### Step 2.2: Retrieve the OpenAPI Document\n\nSend a GET request to fetch the generated OpenAPI document using the following command.\n\n```bash\ncurl -X GET -H \"Content-Type: application\/json\" -H \"Authorization: Bearer YOUR_ACCESS_TOKEN\" \\\nhttps:\/\/MyDomainName.my.salesforce.com\/services\/data\/vXX.X\/async\/specifications\/oas3\/LOCATOR_ID -o oas.json\n```\nReplace YOUR_ACCESS_TOKEN, MyDomainName, and LOCATOR_ID with your actual values.\n\n### Step 3: Configure Cluster Settings\n\nTo prevent Out-of-Memory (OOM) issues, execute the following command:\n\n```bash\nexport JAVA_OPTS=\"$JAVA_OPTS -DmaxYamlCodePoints=99999999\"\n```\n\nGenerate the Ballerina project for the OpenAPI spec using the Ballerina Open API tool with the following commands.\n\n1. Create a new Ballerina project, naming the project as desired (e.g., custom_types, salesforce_types, etc.).\n\n```bash\nbal new custom_types\n```\n\n2. Customize the package details by editing the `Ballerina.toml` file. For instance, you can modify the [package] section as follows:\n\n```toml\n[package]\norg = \"example\"\nname = \"salesforce.types\"\nversion = \"0.1.0\"\n```\n\nFeel free to replace \"salesforce.types\" with one of the suitable desired names like \"custom.types\" or \"integration.types,\" or come up with your own unique package name.\n\n4. Move the OpenAPI spec into the newly created project directory and execute the following command:\n\n```bash\nbal openapi -i oas.json --mode client --client-methods resource\n```\n\nThis will generate the Ballerina project structure, record types that correspond to the SObject definitions, and client methods based on the provided OpenAPI specification.\n\n### Step 4: Edit the Generated Client and Push it to Local Repository\n\n#### Step 4.1 Delete the utils.bal and clients.bal files.\n\n#### Step 4.2 Use the following commands to build, pack, and push the package:\n\n````bash\nbal pack\n\nbal push --repository=local\n````\n\nBy following these steps, you can set up and customize the Ballerina Salesforce Connector for your Salesforce account with ease.\n\n## Quickstart\n\nTo use the `salesforce.types` module in your Ballerina application, modify the `.bal` file as follows:\n\n### Step 1: Import the package\n\nImport `ballerinax\/salesforce.types` module.\n\n```ballerina\nimport ballerinax\/salesforce;\nimport ballerinax\/salesforce.types;\n```\n\n### Step 2: Instantiate a new client\n\nObtain the tokens using the following the [`ballerinax\/salesforce` connector set up guide](https:\/\/central.ballerina.io\/ballerinax\/salesforce\/latest). Create a salesforce:ConnectionConfig with the obtained OAuth2 tokens and initialize the connector with it.\n\n```ballerina\nsalesforce:ConnectionConfig config = {\n baseUrl: baseUrl,\n auth: {\n clientId: clientId,\n clientSecret: clientSecret,\n refreshToken: refreshToken,\n refreshUrl: refreshUrl\n }\n};\n\nsalesforce:Client salesforce = new(config);\n```\n\n### Step 3: Invoke the connector operation\n\nNow you can utilize the available operations. Note that they are in the form of remote operations. Following is an example on how to create a record using the connector.\n\n```ballerina\nsalesforce:Client salesforce = check new (config);\nstypes:AccountSObject response = {\n Name: \"IT World\",\n BillingCity: \"New York\"\n};\n\nsalesforce:CreationResponse response = check salesforce->create(\"Account\", response);\n```\n\nUse following command to compile and run the Ballerina program.\n\n```bash\nbal run\n```" + } + ], + "balToolId": "", + "graalvmCompatible": "Yes" + }, + "serviceTypes": [ + { + "name": "Salesforce", + "description": "Salesforce Service", + "enabled": true, + "basePath": { + "optional": false, + "typeName": "string", + "type": [ + "string" + ], + "defaultable": false, + "documentation": "The Salesforce channel name.", + "enabled": true, + "value": "", + "placeholder": "/events" + }, + "functions": [ + { + "name": "onCreate", + "documentation": "The `onCreate` method is triggered when a new record create event is received from Salesforce.", + "optional": false, + "qualifiers": [ + "remote" + ], + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "salesforce:EventData", + "optional": false, + "type": [ + "salesforce:EventData" + ], + "typeInfo": { + "name": "EventData", + "orgName": "ballerinax", + "moduleName": "salesforce", + "version": "8.1.0" + }, + "documentation": "The information about the triggered event.", + "enabled": true, + "value": "saleforce:EventData" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "name": "onUpdate", + "documentation": "The `onUpdate` method is triggered when a new record update event is received from Salesforce.", + "optional": false, + "qualifiers": [ + "remote" + ], + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "salesforce:EventData", + "optional": false, + "type": [ + "salesforce:EventData" + ], + "typeInfo": { + "name": "EventData", + "orgName": "ballerinax", + "moduleName": "salesforce", + "version": "8.1.0" + }, + "documentation": "The information about the triggered event.", + "enabled": true, + "value": "saleforce:EventData" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "name": "onDelete", + "documentation": "The `onDelete` method is triggered when a new record delete event is received from Salesforce.", + "optional": false, + "qualifiers": [ + "remote" + ], + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "salesforce:EventData", + "optional": false, + "type": [ + "salesforce:EventData" + ], + "typeInfo": { + "name": "EventData", + "orgName": "ballerinax", + "moduleName": "salesforce", + "version": "8.1.0" + }, + "documentation": "The information about the triggered event.", + "enabled": true, + "value": "saleforce:EventData" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + }, + { + "name": "onRestore", + "documentation": "The `onRestore` method is triggered when a new record restore event is received from Salesforce.", + "optional": false, + "qualifiers": [ + "remote" + ], + "enabled": true, + "parameters": [ + { + "name": "payload", + "typeName": "salesforce:EventData", + "optional": false, + "type": [ + "salesforce:EventData" + ], + "typeInfo": { + "name": "EventData", + "orgName": "ballerinax", + "moduleName": "salesforce", + "version": "8.1.0" + }, + "documentation": "The information about the triggered event.", + "enabled": true, + "value": "saleforce:EventData" + } + ], + "returnType": { + "typeName": "error?", + "type": [ + "error?" + ], + "optional": true, + "documentation": "Error object.", + "defaultTypeName": "error?", + "enabled": true, + "value": "error?" + } + } + ] + } + ], + "listener": { + "metadata": { + "label": "Salesforce Listener", + "description": "The Salesforce listener to which the Salesforce service should be attached." + }, + "valueType": "OBJECT", + "valueTypeConstraint": "salesforce:Listener", + "value": "", + "enabled": true, + "optional": false, + "editable": true, + "properties": { + "listenerConfig": { + "metadata": { + "label": "Salesforce Listener Configuration", + "description": "The configuration of Salesforce ASB listener." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "salesforce:ListenerConfig", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "fields": { + "auth": { + "metadata": { + "label": "Authentication Configuration", + "description": "Configurations related to username/password authentication." + }, + "valueType": "EXPRESSION", + "valueTypeConstraint": "salesforce:CredentialsConfig", + "value": "", + "placeholder": "", + "editable": true, + "enabled": true, + "optional": false, + "advanced": true, + "fields": { + "username": { + "metadata": { + "label": "Username", + "description": "Salesforce login username." + }, + "valueType": "STRING", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + }, + "password": { + "metadata": { + "label": "Password", + "description": "Salesforce login password appended with the security token ()." + }, + "valueType": "STRING", + "editable": true, + "enabled": true, + "optional": false, + "advanced": false + } + } + }, + "replayFrom": { + "metadata": { + "label": "Replay From", + "description": "The replay ID to change the point in time when events are read." + }, + "valueType": "UNION", + "value": "", + "placeholder": "salesforce:REPLAY_FROM_TIP", + "editable": true, + "enabled": true, + "optional": true, + "advanced": false, + "unionTypes": [ + { + "metadata": { + "label": "Replay ID", + "description": "The integer value of the replay ID." + }, + "valueType": "INT", + "editable": true, + "enabled": true, + "optional": false, + "value": "", + "advanced": false, + "placeholder": "" + }, + { + "metadata": { + "label": "Replay Options", + "description": "The options to specify the replay ID." + }, + "valueType": "ENUM", + "editable": true, + "enabled": true, + "optional": false, + "value": "", + "advanced": false, + "placeholder": "", + "enum": [ + "salesforce:REPLAY_FROM_TIP", + "salesforce:REPLAY_FROM_EARLIEST" + ] + } + ] + }, + "isSandBox": { + "metadata": { + "label": "Is Sandbox", + "description": "The type of salesforce environment, if sandbox environment or not." + }, + "valueType": "BOOLEAN", + "value": "false", + "editable": true, + "enabled": true, + "optional": true, + "advanced": false + } + } + } + } + } +} From 6ae755289f5ae675fbb8ae6a94307c793306ba50 Mon Sep 17 00:00:00 2001 From: TharmiganK Date: Thu, 7 Nov 2024 08:41:13 +0530 Subject: [PATCH 35/42] Fix test cases --- .../ballerina/trigger/TriggerServiceTest.java | 72 +++++++++---------- 1 file changed, 35 insertions(+), 37 deletions(-) diff --git a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java index 7573b0c15c5b..f9dd387077c7 100644 --- a/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java +++ b/misc/ls-extensions/modules/trigger-service/src/test/java/io/ballerina/trigger/TriggerServiceTest.java @@ -57,13 +57,14 @@ public void testTriggersNewService() throws ExecutionException, InterruptedExcep BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); - BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + JsonObject response = (JsonObject) result.get(); - Assert.assertTrue(!response.getCentralTriggers().isEmpty()); - Assert.assertTrue(response.getCentralTriggers().stream() - .anyMatch(trigger -> trigger.moduleName.contains("kafka"))); - Assert.assertTrue(response.getCentralTriggers().stream() - .anyMatch(trigger -> trigger.moduleName.contains("ftp"))); + Assert.assertTrue(response.has("central")); + Assert.assertFalse(response.getAsJsonArray("central").isEmpty()); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .anyMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("kafka"))); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .anyMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("ftp"))); } @Test(description = "Test trigger endpoint of trigger service") @@ -81,11 +82,11 @@ public void testTriggerService() throws ExecutionException, InterruptedException public void testTriggerNewService() throws ExecutionException, InterruptedException { Endpoint serviceEndpoint = TestUtil.initializeLanguageSever(); - BallerinaTriggerRequest request = new BallerinaTriggerRequest("10002"); + BallerinaTriggerRequest request = new BallerinaTriggerRequest("2"); CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); JsonObject response = (JsonObject) result.get(); - Assert.assertEquals(response.get("id").getAsString(), "10002"); + Assert.assertEquals(response.get("id").getAsString(), "2"); Assert.assertEquals(response.get("moduleName").getAsString(), "rabbitmq"); } @@ -98,7 +99,7 @@ public void testTriggerNewServiceWithoutId() throws ExecutionException, Interrup CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); JsonObject response = (JsonObject) result.get(); - Assert.assertEquals(response.get("id").getAsString(), "10001"); + Assert.assertEquals(response.get("id").getAsString(), "1"); Assert.assertEquals(response.get("moduleName").getAsString(), "kafka"); request = new BallerinaTriggerRequest("ballerina", "mqtt", "mqtt", @@ -106,15 +107,8 @@ public void testTriggerNewServiceWithoutId() throws ExecutionException, Interrup result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); response = (JsonObject) result.get(); - Assert.assertEquals(response.get("id").getAsString(), "10004"); + Assert.assertEquals(response.get("id").getAsString(), "4"); Assert.assertEquals(response.get("moduleName").getAsString(), "mqtt"); - - request = new BallerinaTriggerRequest("ballerinax", "trigger.slack", "trigger.slack", - "*", "Slack Event Listener"); - result = serviceEndpoint.request(BALLERINA_TRIGGER_NEW, request); - response = (JsonObject) result.get(); - - Assert.assertEquals(response.get("moduleName").getAsString(), "trigger.slack"); } @Test(description = "Test new triggers endpoint of trigger service with query") @@ -124,13 +118,14 @@ public void testTriggersNewServiceWithQuery() throws ExecutionException, Interru BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); request.setQuery("kafka"); CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); - BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + JsonObject response = (JsonObject) result.get(); - Assert.assertTrue(!response.getCentralTriggers().isEmpty()); - Assert.assertTrue(response.getCentralTriggers().stream() - .anyMatch(trigger -> trigger.moduleName.equals("kafka"))); - Assert.assertTrue(response.getCentralTriggers().stream() - .noneMatch(trigger -> trigger.moduleName.equals("ftp"))); + Assert.assertTrue(response.has("central")); + Assert.assertFalse(response.getAsJsonArray("central").isEmpty()); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .anyMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("kafka"))); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .noneMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("ftp"))); } @Test(description = "Test new triggers endpoint of trigger service with organization") @@ -140,15 +135,16 @@ public void testTriggersNewServiceWithOrg() throws ExecutionException, Interrupt BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); request.setOrganization("ballerina"); CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); - BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + JsonObject response = (JsonObject) result.get(); - Assert.assertTrue(!response.getCentralTriggers().isEmpty()); - Assert.assertTrue(response.getCentralTriggers().stream() - .anyMatch(trigger -> trigger.moduleName.equals("mqtt"))); - Assert.assertTrue(response.getCentralTriggers().stream() - .anyMatch(trigger -> trigger.moduleName.equals("ftp"))); - Assert.assertTrue(response.getCentralTriggers().stream() - .noneMatch(trigger -> trigger.moduleName.equals("kafka"))); + Assert.assertTrue(response.has("central")); + Assert.assertFalse(response.getAsJsonArray("central").isEmpty()); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .anyMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("mqtt"))); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .anyMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("ftp"))); + Assert.assertTrue(response.getAsJsonArray("central").asList().stream() + .noneMatch(trigger -> trigger.getAsJsonObject().get("moduleName").getAsString().contains("kafka"))); } @Test(description = "Test new triggers endpoint of trigger service with limit") @@ -158,16 +154,18 @@ public void testTriggersNewServiceWithLimit() throws ExecutionException, Interru BallerinaTriggerListRequest request = new BallerinaTriggerListRequest(); request.setLimit(10); CompletableFuture result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); - BallerinaTriggerListResponse response = (BallerinaTriggerListResponse) result.get(); + JsonObject response = (JsonObject) result.get(); - Assert.assertTrue(!response.getCentralTriggers().isEmpty()); - Assert.assertEquals(response.getCentralTriggers().size(), 10); + Assert.assertTrue(response.has("central")); + Assert.assertFalse(response.getAsJsonArray("central").isEmpty()); + Assert.assertTrue(response.getAsJsonArray("central").size() == 9); request.setLimit(2); result = serviceEndpoint.request(BALLERINA_TRIGGERS_NEW, request); - response = (BallerinaTriggerListResponse) result.get(); + response = (JsonObject) result.get(); - Assert.assertTrue(!response.getCentralTriggers().isEmpty()); - Assert.assertEquals(response.getCentralTriggers().size(), 2); + Assert.assertTrue(response.has("central")); + Assert.assertFalse(response.getAsJsonArray("central").isEmpty()); + Assert.assertTrue(response.getAsJsonArray("central").size() == 2); } } From 4ea33657e4c49379bd9fcd5ffc74ed37cdfab3df Mon Sep 17 00:00:00 2001 From: dulaj Date: Mon, 18 Nov 2024 14:55:08 +0530 Subject: [PATCH 36/42] Fix tests --- .../langserver/common/utils/NameUtil.java | 19 +++++-------------- .../trigger/BallerinaTriggerService.java | 3 ++- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java index 74341e56d945..320a294871db 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/common/utils/NameUtil.java @@ -281,20 +281,11 @@ public static List getDefinedArgumentNames(BallerinaCompletionContext co * @return The generated name for the raw type. */ private static String generateNameForRawType(TypeDescKind rawType) { - String name; - switch (rawType) { - case RECORD: - name = "mappingResult"; - break; - case TUPLE: - case ARRAY: - name = "listResult"; - break; - default: - name = rawType.getName() + "Result"; - break; - } - return name; + return switch (rawType) { + case RECORD -> "mappingResult"; + case TUPLE, ARRAY -> "listResult"; + default -> rawType.getName() + "Result"; + }; } /** diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 5b53f398b67b..2b4876d70c8f 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -36,6 +36,7 @@ import org.ballerinalang.langserver.commons.client.ExtendedLanguageClient; import org.ballerinalang.langserver.commons.service.spi.ExtendedLanguageServerService; import org.ballerinalang.langserver.commons.workspace.WorkspaceManager; +import org.ballerinalang.toml.exceptions.SettingsTomlException; import org.eclipse.lsp4j.MessageParams; import org.eclipse.lsp4j.MessageType; import org.eclipse.lsp4j.jsonrpc.services.JsonRequest; @@ -103,7 +104,7 @@ public CompletableFuture triggers(BallerinaTrigger CentralTriggerListResult centralTriggerListResult = getCentralTriggerListResult(request); triggersList.setCentralTriggers(centralTriggerListResult.getTriggers()); return triggersList; - } catch (CentralClientException e) { + } catch (CentralClientException | SettingsTomlException e) { String msg = "Operation 'ballerinaTrigger/triggers' failed!"; this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); return triggersList; From 2bd7df0ac3f15e5bb1fc4b077c98c05a44769d87 Mon Sep 17 00:00:00 2001 From: dulaj Date: Mon, 18 Nov 2024 16:41:17 +0530 Subject: [PATCH 37/42] Fix tests conflicts --- ...lientResourceAccessActionNegativeTest.java | 226 +++++++++--------- 1 file changed, 113 insertions(+), 113 deletions(-) diff --git a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/action/ClientResourceAccessActionNegativeTest.java b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/action/ClientResourceAccessActionNegativeTest.java index 7ddf03eb3a50..776589197342 100644 --- a/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/action/ClientResourceAccessActionNegativeTest.java +++ b/tests/jballerina-unit-test/src/test/java/org/ballerinalang/test/action/ClientResourceAccessActionNegativeTest.java @@ -159,14 +159,14 @@ public void testClientResourcePathNegative() { " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 111, 28); validateError(clientResourcePathNegative, index++, "undefined resource method 'put' on target resource in object 'isolated object" + @@ -174,13 +174,13 @@ public void testClientResourcePathNegative() { "returns (int); resource function get path/[int]/foo(string) returns (int); resource" + " function get path/[int]/foo2(string,string) returns (int); resource function get" + " path/foo/bar() returns (); resource function get stringPath/[string]() returns (int);" + - " resource function get intQuotedPath/5() returns (int); resource function get " + + " resource function get intQuotedPath/'5() returns (int); resource function get " + "intPath/[int]() returns (int); resource function get booleanPath/[boolean]() " + "returns (int); resource function get stringRestPath/[string...]() returns (int);" + " resource function get intRestPath/[int...]() returns (int); resource function get " + "booleanRestPath/[boolean...]() returns (int); resource function get x(int) " + "returns (string); resource function get y(int?) returns (string?); resource " + - "function get 5(string) returns (string); resource function get 6(string?) " + + "function get '5(string) returns (string); resource function get '6(string?) " + "returns (string?); }'", 112, 34); validateError(clientResourcePathNegative, index++, @@ -188,28 +188,28 @@ public void testClientResourcePathNegative() { " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 113, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 114, 28); validateError(clientResourcePathNegative, index++, "resource access path segment is not allowed after resource access rest segment", @@ -223,364 +223,364 @@ public void testClientResourcePathNegative() { " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 116, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 117, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 118, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 119, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 120, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 121, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 122, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 123, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 124, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 125, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 126, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 127, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 128, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 129, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 130, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 131, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 132, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 133, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 134, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 135, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 136, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 137, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 138, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 139, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 140, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 141, 28); validateError(clientResourcePathNegative, index++, "unsupported computed resource access path segment type: expected 'int', 'string'," + @@ -599,84 +599,84 @@ public void testClientResourcePathNegative() { " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 145, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 146, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 147, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 148, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 149, 28); validateError(clientResourcePathNegative, index++, "undefined resource path in object 'isolated object { resource function get path()" + " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 150, 28); validateError(clientResourcePathNegative, index++, @@ -684,14 +684,14 @@ public void testClientResourcePathNegative() { " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 151, 28); validateError(clientResourcePathNegative, index++, @@ -699,14 +699,14 @@ public void testClientResourcePathNegative() { " returns (int); resource function get path/[int]() returns (int); resource function get" + " path/[int]/foo(string) returns (int); resource function get path/[int]/foo2(string,string)" + " returns (int); resource function get path/foo/bar() returns (); resource function get" + - " stringPath/[string]() returns (int); resource function get intQuotedPath/5()" + + " stringPath/[string]() returns (int); resource function get intQuotedPath/'5()" + " returns (int); resource function get intPath/[int]() returns (int); resource function" + " get booleanPath/[boolean]() returns (int); resource function get " + "stringRestPath/[string...]() returns (int); resource function get intRestPath/[int...]()" + " returns (int); resource function get booleanRestPath/[boolean...]() returns (int);" + " resource function get x(int) returns (string); resource function get y(int?) " + - "returns (string?); resource function get 5(string) returns (string); resource" + - " function get 6(string?) returns (string?); }'", + "returns (string?); resource function get '5(string) returns (string); resource" + + " function get '6(string?) returns (string?); }'", 152, 28); validateError(clientResourcePathNegative, index++, "unsupported resource access rest segment type: expected array of 'int', 'string', " + From 57fd2cf81dad58d3fcfd4374a261c03cad4e2c87 Mon Sep 17 00:00:00 2001 From: dulaj Date: Tue, 19 Nov 2024 10:43:32 +0530 Subject: [PATCH 38/42] Fix spotbugs warnings and errors --- .../compiler/syntax/tree/CommentNode.java | 5 ---- .../syntax/tree/NodeAndCommentList.java | 6 ++++- .../langserver-core/spotbugs-exclude.xml | 6 +++++ .../trigger/BallerinaTriggerService.java | 27 ++++++++++++++++--- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java index 08cfba08faeb..e09d25f846e1 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/CommentNode.java @@ -17,12 +17,7 @@ package io.ballerina.compiler.syntax.tree; import io.ballerina.compiler.internal.parser.tree.STNode; -import io.ballerina.compiler.internal.parser.tree.STNodeDiagnostic; -import io.ballerina.compiler.internal.parser.tree.STToken; -import io.ballerina.tools.diagnostics.Diagnostic; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; /** diff --git a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java index 36e0283dc54c..dfa391c06841 100644 --- a/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java +++ b/compiler/ballerina-parser/src/main/java/io/ballerina/compiler/syntax/tree/NodeAndCommentList.java @@ -20,7 +20,11 @@ import io.ballerina.compiler.internal.parser.tree.STNodeList; import io.ballerina.compiler.internal.syntax.NodeListUtils; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.stream.StreamSupport; diff --git a/language-server/modules/langserver-core/spotbugs-exclude.xml b/language-server/modules/langserver-core/spotbugs-exclude.xml index 7eda93fe6fbb..d335ac2bb0f2 100644 --- a/language-server/modules/langserver-core/spotbugs-exclude.xml +++ b/language-server/modules/langserver-core/spotbugs-exclude.xml @@ -112,6 +112,12 @@ + + + + + + diff --git a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java index 2b4876d70c8f..bbd6b2a8f2a2 100644 --- a/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java +++ b/misc/ls-extensions/modules/trigger-service/src/main/java/io/ballerina/trigger/BallerinaTriggerService.java @@ -50,6 +50,7 @@ import java.io.InputStreamReader; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -70,19 +71,33 @@ public class BallerinaTriggerService implements ExtendedLanguageServerService { private LanguageClient languageClient; private final Map inBuiltTriggers; + private static final Type MAP_TYPE = MapTypeToken.TYPE; + // Represents the in-built trigger basic information public record InBuiltTrigger(String name, String orgName, String packageName, List keywords) { + public InBuiltTrigger(String name, String orgName, String packageName, List keywords) { + this.name = name; + this.orgName = orgName; + this.packageName = packageName; + // Make a defensive copy of the list to ensure immutability + this.keywords = keywords == null ? List.of() : new ArrayList<>(keywords); + } + + @Override + public List keywords() { + // Return an unmodifiable or defensive copy, as needed + return List.copyOf(keywords); + } } public BallerinaTriggerService() { InputStream propertiesStream = getClass().getClassLoader() .getResourceAsStream("inbuilt-triggers/properties.json"); - Type mapType = new TypeToken>() {}.getType(); Map triggers = Map.of(); if (propertiesStream != null) { try (JsonReader reader = new JsonReader(new InputStreamReader(propertiesStream, StandardCharsets.UTF_8))) { - triggers = new Gson().fromJson(reader, mapType); + triggers = new Gson().fromJson(reader, MAP_TYPE); } catch (IOException e) { // Ignore } @@ -90,6 +105,11 @@ public BallerinaTriggerService() { this.inBuiltTriggers = triggers; } + // Static inner class to hold the type token + private static class MapTypeToken { + private static final Type TYPE = new TypeToken>() { }.getType(); + } + @Override public void init(LanguageServer langServer, WorkspaceManager workspaceManager, LanguageServerContext serverContext) { @@ -230,7 +250,8 @@ private Optional getInBuiltTriggerJson(String triggerName) { .noneMatch(inBuiltTrigger -> inBuiltTrigger.name().equals(triggerName))) { return Optional.empty(); } - InputStream resourceStream = getClass().getClassLoader().getResourceAsStream(String.format("inbuilt-triggers/%s.json", triggerName)); + InputStream resourceStream = getClass().getClassLoader().getResourceAsStream( + String.format("inbuilt-triggers/%s.json", triggerName)); if (resourceStream == null) { String msg = String.format("Trigger info file not found for the trigger: %s", triggerName); this.languageClient.logMessage(new MessageParams(MessageType.Error, msg)); From 914203e7caf01308f2a6b4be468bc32f65468dba Mon Sep 17 00:00:00 2001 From: dulaj Date: Wed, 20 Nov 2024 16:45:45 +0530 Subject: [PATCH 39/42] Update component tests --- .../multiple-packages_expected.json | 704 ++++++++---------- .../components/project-other_expected.json | 361 +++++---- .../single-file-package_expected.json | 242 +++--- .../components/single-package_expected.json | 109 ++- 4 files changed, 654 insertions(+), 762 deletions(-) diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json index 6f3785771ba7..1c30aa4057d5 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json @@ -1,379 +1,329 @@ { - "result": [ - { - "filePath": "file:///", - "name": "project", - "modules": [ - { - "functions": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [] - }, - { - "functions": [], - "services": [ - { - "name": "/hello ", - "resources": [ - { - "name": "get", - "filePath": "hello.bal", - "startLine": 8, - "startColumn": 4, - "endLine": 10, - "endColumn": 5 - } - ], - "filePath": "hello.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 11, - "endColumn": 1 - } - ], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "name": "services" - } - ] - }, - { - "filePath": "file:///", - "name": "project_functions", - "modules": [ - { - "functions": [ - { - "name": "initDatabase", - "filePath": "db.bal", - "startLine": 0, - "startColumn": 0, - "endLine": 2, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "name": "storage" - }, - { - "functions": [ - { - "name": "runServices", - "filePath": "svc.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "name": "services" - }, - { - "functions": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [] - } - ] - }, - { - "filePath": "file:///", - "name": "project_services", - "modules": [ - { - "functions": [], - "services": [ - { - "name": "/ ", - "resources": [ - { - "name": "get", - "filePath": "main.bal", - "startLine": 8, - "startColumn": 4, - "endLine": 10, - "endColumn": 5 - } - ], - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 11, - "endColumn": 1 - } - ], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [] - }, - { - "functions": [], - "services": [ - { - "name": "\"process\" ", - "resources": [ - { - "name": "post", - "filePath": "db.bal", - "startLine": 5, - "startColumn": 4, - "endLine": 7, - "endColumn": 5 - } - ], - "filePath": "db.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 8, - "endColumn": 1 - } - ], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "name": "db_service" - }, - { - "functions": [], - "services": [ - { - "name": "/hello ", - "resources": [ - { - "name": "get", - "filePath": "hello.bal", - "startLine": 10, - "startColumn": 4, - "endLine": 12, - "endColumn": 5 - } - ], - "filePath": "hello.bal", - "startLine": 5, - "startColumn": 0, - "endLine": 13, - "endColumn": 1 - } - ], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [ - { - "name": "helloEp", - "filePath": "hello.bal", - "startLine": 2, - "startColumn": 0, - "endLine": 2, - "endColumn": 44 - } - ], - "moduleVariables": [], - "name": "hello_service" - } - ] - }, - { - "filePath": "file:///", - "name": ".", - "modules": [ - { - "functions": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 44, - "startColumn": 0, - "endLine": 46, - "endColumn": 1 - } - ], - "services": [ - { - "name": "/hey ", - "resources": [ - { - "name": "get", - "filePath": "main.bal", - "startLine": 50, - "startColumn": 4, - "endLine": 52, - "endColumn": 5 - } - ], - "filePath": "main.bal", - "startLine": 48, - "startColumn": 0, - "endLine": 53, - "endColumn": 1 - } - ], - "records": [ - { - "name": "Coordinates", - "filePath": "main.bal", - "startLine": 12, - "startColumn": 0, - "endLine": 15, - "endColumn": 3 - } - ], - "objects": [ - { - "name": "Address", - "filePath": "main.bal", - "startLine": 33, - "startColumn": 0, - "endLine": 38, - "endColumn": 2 - } - ], - "classes": [ - { - "name": "Person", - "functions": [ - { - "name": "init", - "filePath": "main.bal", - "startLine": 28, - "startColumn": 4, - "endLine": 30, - "endColumn": 5 - } - ], - "filePath": "main.bal", - "startLine": 25, - "startColumn": 0, - "endLine": 31, - "endColumn": 1 - } - ], - "types": [ - { - "name": "SampleError", - "filePath": "main.bal", - "startLine": 40, - "startColumn": 0, - "endLine": 40, - "endColumn": 40 - }, - { - "name": "CountryCode", - "filePath": "main.bal", - "startLine": 42, - "startColumn": 0, - "endLine": 42, - "endColumn": 35 - } - ], - "constants": [ - { - "name": "BALLERINA", - "filePath": "main.bal", - "startLine": 10, - "startColumn": 0, - "endLine": 10, - "endColumn": 30 - } - ], - "enums": [ - { - "name": "Color", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 8, - "endColumn": 1 - } - ], - "listeners": [], - "moduleVariables": [ - { - "name": "modLevelVariable ", - "filePath": "main.bal", - "startLine": 17, - "startColumn": 0, - "endLine": 21, - "endColumn": 23 - }, - { - "name": "enableRemote ", - "filePath": "main.bal", - "startLine": 23, - "startColumn": 0, - "endLine": 23, - "endColumn": 41 - } - ] - } - ] - } - ] + "result": [ { + "name" : "project", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ { + "name" : "main", + "filePath" : "main.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 6, + "endColumn" : 1 + } ] + }, { + "functions" : [ ], + "services" : [ { + "name" : "/hello ", + "filePath" : "hello.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 11, + "endColumn" : 1, + "resources" : [ { + "name" : "get-satyHello", + "filePath" : "hello.bal", + "startLine" : 8, + "startColumn" : 4, + "endLine" : 10, + "endColumn" : 5 + } ] + } ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "services" + } ] + }, { + "name" : "project_functions", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ { + "name" : "main", + "filePath" : "main.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 6, + "endColumn" : 1 + } ] + }, { + "functions" : [ { + "name" : "initDatabase", + "filePath" : "db.bal", + "startLine" : 0, + "startColumn" : 0, + "endLine" : 2, + "endColumn" : 1 + } ], + "services" : [ ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "storage" + }, { + "functions" : [ { + "name" : "runServices", + "filePath" : "svc.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 6, + "endColumn" : 1 + } ], + "services" : [ ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "services" + } ] + }, { + "name" : "project_services", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ { + "name" : "/ ", + "filePath" : "main.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 11, + "endColumn" : 1, + "resources" : [ { + "name" : "get-welcome", + "filePath" : "main.bal", + "startLine" : 8, + "startColumn" : 4, + "endLine" : 10, + "endColumn" : 5 + } ] + } ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ] + }, { + "functions" : [ ], + "services" : [ { + "name" : "\"process\" ", + "filePath" : "db.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 8, + "endColumn" : 1, + "resources" : [ { + "name" : "post-connect", + "filePath" : "db.bal", + "startLine" : 5, + "startColumn" : 4, + "endLine" : 7, + "endColumn" : 5 + } ] + } ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "db_service" + }, { + "functions" : [ ], + "services" : [ { + "name" : "/hello ", + "filePath" : "hello.bal", + "startLine" : 5, + "startColumn" : 0, + "endLine" : 13, + "endColumn" : 1, + "resources" : [ { + "name" : "get-satyHello", + "filePath" : "hello.bal", + "startLine" : 10, + "startColumn" : 4, + "endLine" : 12, + "endColumn" : 5 + } ] + } ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ { + "name" : "helloEp", + "filePath" : "hello.bal", + "startLine" : 2, + "startColumn" : 0, + "endLine" : 2, + "endColumn" : 44 + } ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "hello_service" + } ] + }, { + "name" : ".", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ { + "name" : "/hey ", + "filePath" : "main.bal", + "startLine" : 48, + "startColumn" : 0, + "endLine" : 53, + "endColumn" : 1, + "resources" : [ { + "name" : "get-satyHello", + "filePath" : "main.bal", + "startLine" : 50, + "startColumn" : 4, + "endLine" : 52, + "endColumn" : 5 + } ] + } ], + "records" : [ { + "name" : "Coordinates", + "filePath" : "main.bal", + "startLine" : 12, + "startColumn" : 0, + "endLine" : 15, + "endColumn" : 3 + } ], + "objects" : [ { + "name" : "Address", + "filePath" : "main.bal", + "startLine" : 33, + "startColumn" : 0, + "endLine" : 38, + "endColumn" : 2 + } ], + "classes" : [ { + "name" : "Person", + "filePath" : "main.bal", + "startLine" : 25, + "startColumn" : 0, + "endLine" : 31, + "endColumn" : 1, + "functions" : [ { + "name" : "init", + "filePath" : "main.bal", + "startLine" : 28, + "startColumn" : 4, + "endLine" : 30, + "endColumn" : 5 + } ] + } ], + "types" : [ { + "name" : "SampleError", + "filePath" : "main.bal", + "startLine" : 40, + "startColumn" : 0, + "endLine" : 40, + "endColumn" : 40 + }, { + "name" : "CountryCode", + "filePath" : "main.bal", + "startLine" : 42, + "startColumn" : 0, + "endLine" : 42, + "endColumn" : 35 + } ], + "constants" : [ { + "name" : "BALLERINA", + "filePath" : "main.bal", + "startLine" : 10, + "startColumn" : 0, + "endLine" : 10, + "endColumn" : 30 + } ], + "enums" : [ { + "name" : "Color", + "filePath" : "main.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 8, + "endColumn" : 1 + } ], + "listeners" : [ ], + "moduleVariables" : [ { + "name" : "modLevelVariable ", + "filePath" : "main.bal", + "startLine" : 17, + "startColumn" : 0, + "endLine" : 21, + "endColumn" : 23 + } ], + "configurableVariables" : [ { + "name" : "enableRemote ", + "filePath" : "main.bal", + "startLine" : 23, + "startColumn" : 0, + "endLine" : 23, + "endColumn" : 41 + } ], + "automations" : [ { + "name" : "main", + "filePath" : "main.bal", + "startLine" : 44, + "startColumn" : 0, + "endLine" : 46, + "endColumn" : 1 + } ] + } ] + } ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json index 84c2aca172b7..330adf3df64f 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json @@ -1,197 +1,168 @@ { - "result": [ - { - "filePath": "file:///", - "name": "project_other", - "modules": [ - { - "functions": [ - { - "name": "multiply", - "filePath": "main.bal", - "startLine": 0, - "startColumn": 0, - "endLine": 2, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [] - }, - { - "functions": [], - "services": [], - "records": [ - { - "name": "ParseErrorDetail", - "filePath": "model.bal", - "startLine": 29, - "startColumn": 0, - "endLine": 31, - "endColumn": 2 - } - ], - "objects": [ - { - "name": "StringIterator", - "filePath": "model.bal", - "startLine": 8, - "startColumn": 0, - "endLine": 12, - "endColumn": 2 - } - ], - "classes": [ - { - "name": "Tokenizer", - "functions": [ - { - "name": "init", - "filePath": "model.bal", - "startLine": 51, - "startColumn": 4, - "endLine": 54, - "endColumn": 5 - }, - { - "name": "advance", - "filePath": "model.bal", - "startLine": 58, - "startColumn": 4, - "endLine": 60, - "endColumn": 5 - }, - { - "name": "current", - "filePath": "model.bal", - "startLine": 62, - "startColumn": 4, - "endLine": 64, - "endColumn": 5 - }, - { - "name": "currentPos", - "filePath": "model.bal", - "startLine": 66, - "startColumn": 4, - "endLine": 71, - "endColumn": 5 - } - ], - "filePath": "model.bal", - "startLine": 35, - "startColumn": 0, - "endLine": 72, - "endColumn": 1 - } - ], - "types": [ - { - "name": "Char", - "filePath": "model.bal", - "startLine": 6, - "startColumn": 0, - "endLine": 6, - "endColumn": 17 - }, - { - "name": "Position", - "filePath": "model.bal", - "startLine": 22, - "startColumn": 0, - "endLine": 27, - "endColumn": 3 - }, - { - "name": "ParseError", - "filePath": "model.bal", - "startLine": 33, - "startColumn": 0, - "endLine": 33, - "endColumn": 56 - } - ], - "constants": [ - { - "name": "LOWER", - "filePath": "model.bal", - "startLine": 0, - "startColumn": 0, - "endLine": 0, - "endColumn": 43 - }, - { - "name": "UPPER", - "filePath": "model.bal", - "startLine": 1, - "startColumn": 0, - "endLine": 1, - "endColumn": 43 - }, - { - "name": "DIGIT", - "filePath": "model.bal", - "startLine": 2, - "startColumn": 0, - "endLine": 2, - "endColumn": 27 - }, - { - "name": "ALPHA", - "filePath": "model.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 3, - "endColumn": 35 - }, - { - "name": "IDENT", - "filePath": "model.bal", - "startLine": 4, - "startColumn": 0, - "endLine": 4, - "endColumn": 41 - } - ], - "enums": [ - { - "name": "Language", - "filePath": "model.bal", - "startLine": 74, - "startColumn": 0, - "endLine": 77, - "endColumn": 1 - } - ], - "listeners": [], - "moduleVariables": [ - { - "name": "ESCAPES ", - "filePath": "model.bal", - "startLine": 14, - "startColumn": 0, - "endLine": 20, - "endColumn": 2 - }, - { - "name": "expected ", - "filePath": "model.bal", - "startLine": 79, - "startColumn": 0, - "endLine": 83, - "endColumn": 2 - } - ], - "name": "models" - } - ] - } - ] + "result": [ { + "name" : "project_other", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ ], + "records" : [ { + "name" : "ParseErrorDetail", + "filePath" : "model.bal", + "startLine" : 29, + "startColumn" : 0, + "endLine" : 31, + "endColumn" : 2 + } ], + "objects" : [ { + "name" : "StringIterator", + "filePath" : "model.bal", + "startLine" : 8, + "startColumn" : 0, + "endLine" : 12, + "endColumn" : 2 + } ], + "classes" : [ { + "name" : "Tokenizer", + "filePath" : "model.bal", + "startLine" : 35, + "startColumn" : 0, + "endLine" : 72, + "endColumn" : 1, + "functions" : [ { + "name" : "init", + "filePath" : "model.bal", + "startLine" : 51, + "startColumn" : 4, + "endLine" : 54, + "endColumn" : 5 + }, { + "name" : "advance", + "filePath" : "model.bal", + "startLine" : 58, + "startColumn" : 4, + "endLine" : 60, + "endColumn" : 5 + }, { + "name" : "current", + "filePath" : "model.bal", + "startLine" : 62, + "startColumn" : 4, + "endLine" : 64, + "endColumn" : 5 + }, { + "name" : "currentPos", + "filePath" : "model.bal", + "startLine" : 66, + "startColumn" : 4, + "endLine" : 71, + "endColumn" : 5 + } ] + } ], + "types" : [ { + "name" : "Char", + "filePath" : "model.bal", + "startLine" : 6, + "startColumn" : 0, + "endLine" : 6, + "endColumn" : 17 + }, { + "name" : "Position", + "filePath" : "model.bal", + "startLine" : 22, + "startColumn" : 0, + "endLine" : 27, + "endColumn" : 3 + }, { + "name" : "ParseError", + "filePath" : "model.bal", + "startLine" : 33, + "startColumn" : 0, + "endLine" : 33, + "endColumn" : 56 + } ], + "constants" : [ { + "name" : "LOWER", + "filePath" : "model.bal", + "startLine" : 0, + "startColumn" : 0, + "endLine" : 0, + "endColumn" : 43 + }, { + "name" : "UPPER", + "filePath" : "model.bal", + "startLine" : 1, + "startColumn" : 0, + "endLine" : 1, + "endColumn" : 43 + }, { + "name" : "DIGIT", + "filePath" : "model.bal", + "startLine" : 2, + "startColumn" : 0, + "endLine" : 2, + "endColumn" : 27 + }, { + "name" : "ALPHA", + "filePath" : "model.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 3, + "endColumn" : 35 + }, { + "name" : "IDENT", + "filePath" : "model.bal", + "startLine" : 4, + "startColumn" : 0, + "endLine" : 4, + "endColumn" : 41 + } ], + "enums" : [ { + "name" : "Language", + "filePath" : "model.bal", + "startLine" : 74, + "startColumn" : 0, + "endLine" : 77, + "endColumn" : 1 + } ], + "listeners" : [ ], + "moduleVariables" : [ { + "name" : "ESCAPES ", + "filePath" : "model.bal", + "startLine" : 14, + "startColumn" : 0, + "endLine" : 20, + "endColumn" : 2 + }, { + "name" : "expected ", + "filePath" : "model.bal", + "startLine" : 79, + "startColumn" : 0, + "endLine" : 83, + "endColumn" : 2 + } ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "models" + }, { + "functions" : [ { + "name" : "multiply", + "filePath" : "main.bal", + "startLine" : 0, + "startColumn" : 0, + "endLine" : 2, + "endColumn" : 1 + } ], + "services" : [ ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ] + } ] + } ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json index 3ccad17edee1..4c73148cc279 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json @@ -1,139 +1,115 @@ { "result": [ { - "filePath": "file:///", - "name": ".", - "modules": [ - { - "functions": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 44, - "startColumn": 0, - "endLine": 46, - "endColumn": 1 - } - ], - "services": [ - { - "name": "/hey ", - "resources": [ - { - "name": "get", - "filePath": "main.bal", - "startLine": 50, - "startColumn": 4, - "endLine": 52, - "endColumn": 5 - } - ], - "filePath": "main.bal", - "startLine": 48, - "startColumn": 0, - "endLine": 53, - "endColumn": 1 - } - ], - "records": [ - { - "name": "Coordinates", - "filePath": "main.bal", - "startLine": 12, - "startColumn": 0, - "endLine": 15, - "endColumn": 3 - } - ], - "objects": [ - { - "name": "Address", - "filePath": "main.bal", - "startLine": 33, - "startColumn": 0, - "endLine": 38, - "endColumn": 2 - } - ], - "classes": [ - { - "name": "Person", - "functions": [ - { - "name": "init", - "filePath": "main.bal", - "startLine": 28, - "startColumn": 4, - "endLine": 30, - "endColumn": 5 - } - ], - "filePath": "main.bal", - "startLine": 25, - "startColumn": 0, - "endLine": 31, - "endColumn": 1 - } - ], - "types": [ - { - "name": "SampleError", - "filePath": "main.bal", - "startLine": 40, - "startColumn": 0, - "endLine": 40, - "endColumn": 40 - }, - { - "name": "CountryCode", - "filePath": "main.bal", - "startLine": 42, - "startColumn": 0, - "endLine": 42, - "endColumn": 35 - } - ], - "constants": [ - { - "name": "BALLERINA", - "filePath": "main.bal", - "startLine": 10, - "startColumn": 0, - "endLine": 10, - "endColumn": 30 - } - ], - "enums": [ - { - "name": "Color", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 8, - "endColumn": 1 - } - ], - "listeners": [], - "moduleVariables": [ - { - "name": "modLevelVariable ", - "filePath": "main.bal", - "startLine": 17, - "startColumn": 0, - "endLine": 21, - "endColumn": 23 - }, - { - "name": "enableRemote ", - "filePath": "main.bal", - "startLine": 23, - "startColumn": 0, - "endLine": 23, - "endColumn": 41 - } - ] - } - ] + "name" : ".", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ { + "name" : "/hey ", + "filePath" : "main.bal", + "startLine" : 48, + "startColumn" : 0, + "endLine" : 53, + "endColumn" : 1, + "resources" : [ { + "name" : "get-satyHello", + "filePath" : "main.bal", + "startLine" : 50, + "startColumn" : 4, + "endLine" : 52, + "endColumn" : 5 + } ] + } ], + "records" : [ { + "name" : "Coordinates", + "filePath" : "main.bal", + "startLine" : 12, + "startColumn" : 0, + "endLine" : 15, + "endColumn" : 3 + } ], + "objects" : [ { + "name" : "Address", + "filePath" : "main.bal", + "startLine" : 33, + "startColumn" : 0, + "endLine" : 38, + "endColumn" : 2 + } ], + "classes" : [ { + "name" : "Person", + "filePath" : "main.bal", + "startLine" : 25, + "startColumn" : 0, + "endLine" : 31, + "endColumn" : 1, + "functions" : [ { + "name" : "init", + "filePath" : "main.bal", + "startLine" : 28, + "startColumn" : 4, + "endLine" : 30, + "endColumn" : 5 + } ] + } ], + "types" : [ { + "name" : "SampleError", + "filePath" : "main.bal", + "startLine" : 40, + "startColumn" : 0, + "endLine" : 40, + "endColumn" : 40 + }, { + "name" : "CountryCode", + "filePath" : "main.bal", + "startLine" : 42, + "startColumn" : 0, + "endLine" : 42, + "endColumn" : 35 + } ], + "constants" : [ { + "name" : "BALLERINA", + "filePath" : "main.bal", + "startLine" : 10, + "startColumn" : 0, + "endLine" : 10, + "endColumn" : 30 + } ], + "enums" : [ { + "name" : "Color", + "filePath" : "main.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 8, + "endColumn" : 1 + } ], + "listeners" : [ ], + "moduleVariables" : [ { + "name" : "modLevelVariable ", + "filePath" : "main.bal", + "startLine" : 17, + "startColumn" : 0, + "endLine" : 21, + "endColumn" : 23 + } ], + "configurableVariables" : [ { + "name" : "enableRemote ", + "filePath" : "main.bal", + "startLine" : 23, + "startColumn" : 0, + "endLine" : 23, + "endColumn" : 41 + } ], + "automations" : [ { + "name" : "main", + "filePath" : "main.bal", + "startLine" : 44, + "startColumn" : 0, + "endLine" : 46, + "endColumn" : 1 + } ] + } ] } ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json index ba7b5ba2e276..02cd51e5cef5 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json @@ -1,63 +1,58 @@ { "result": [ { - "filePath": "file:///", - "name": "project", - "modules": [ - { - "functions": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [] - }, - { - "functions": [], - "services": [ - { - "name": "/hello ", - "resources": [ - { - "name": "get", - "filePath": "hello.bal", - "startLine": 8, - "startColumn": 4, - "endLine": 10, - "endColumn": 5 - } - ], - "filePath": "hello.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 11, - "endColumn": 1 - } - ], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "name": "services" - } - ] + "name" : "project", + "filePath" : "file:///", + "modules" : [ { + "functions" : [ ], + "services" : [ { + "name" : "/hello ", + "filePath" : "hello.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 11, + "endColumn" : 1, + "resources" : [ { + "name" : "get-satyHello", + "filePath" : "hello.bal", + "startLine" : 8, + "startColumn" : 4, + "endLine" : 10, + "endColumn" : 5 + } ] + } ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ ], + "name" : "services" + }, { + "functions" : [ ], + "services" : [ ], + "records" : [ ], + "objects" : [ ], + "classes" : [ ], + "types" : [ ], + "constants" : [ ], + "enums" : [ ], + "listeners" : [ ], + "moduleVariables" : [ ], + "configurableVariables" : [ ], + "automations" : [ { + "name" : "main", + "filePath" : "main.bal", + "startLine" : 3, + "startColumn" : 0, + "endLine" : 6, + "endColumn" : 1 + } ] + } ] } ] } From a7a800efcee4a9871ef43640cfeb202b8fbb91c0 Mon Sep 17 00:00:00 2001 From: dulaj Date: Wed, 20 Nov 2024 17:33:08 +0530 Subject: [PATCH 40/42] Fix project-component API responses --- .../ballerina/packages/ModuleObject.java | 88 +- .../multiple-packages_expected.json | 758 ++++++++++-------- .../components/project-other_expected.json | 365 +++++---- .../single-file-package_expected.json | 262 +++--- .../components/single-package_expected.json | 122 +-- 5 files changed, 897 insertions(+), 698 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java index faaf15a9e1e7..0704f0cab044 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java @@ -49,70 +49,70 @@ protected void addFunction(DataObject dataObject) { this.functions.add(dataObject); } - protected void addConstant(DataObject dataObject) { + private void addConstant(DataObject dataObject) { this.constants.add(dataObject); } - protected void addService(DataObject dataObject) { + private void addService(DataObject dataObject) { this.services.add(dataObject); } - protected void addRecord(DataObject dataObject) { + private void addRecord(DataObject dataObject) { this.records.add(dataObject); } - protected void addObject(DataObject dataObject) { + private void addObject(DataObject dataObject) { this.objects.add(dataObject); } - protected void addClass(DataObject dataObject) { + private void addClass(DataObject dataObject) { this.classes.add(dataObject); } - protected void addType(DataObject dataObject) { + private void addType(DataObject dataObject) { this.types.add(dataObject); } + private void addAutomation(DataObject dataObject) { + this.automations.add(dataObject); + this.functions.add(dataObject); // The main function + } + + private void addModuleVariable(DataObject dataObject) { + this.moduleVariables.add(dataObject); + } + + private void addConfigurableVariable(DataObject dataObject) { + this.configurableVariables.add(dataObject); + this.moduleVariables.add(dataObject); // Configurable variable is also a module variable + } + + private void addListener(DataObject dataObject) { + this.listeners.add(dataObject); + } + + private void addEnum(DataObject dataObject) { + this.listeners.add(dataObject); + } + protected void addDataObject(MapperObject mapperObject) { switch (mapperObject.getKey()) { - case PackageServiceConstants.FUNCTIONS: - this.addFunction(mapperObject.getDataObject()); - break; - case PackageServiceConstants.SERVICES: - this.addService(mapperObject.getDataObject()); - break; - case PackageServiceConstants.CONSTANTS: - this.addConstant(mapperObject.getDataObject()); - break; - case PackageServiceConstants.RECORDS: - this.addRecord(mapperObject.getDataObject()); - break; - case PackageServiceConstants.OBJECTS: - this.addObject(mapperObject.getDataObject()); - break; - case PackageServiceConstants.CLASSES: - this.addClass(mapperObject.getDataObject()); - break; - case PackageServiceConstants.TYPES: - this.addType(mapperObject.getDataObject()); - break; - case PackageServiceConstants.ENUMS: - this.enums.add(mapperObject.getDataObject()); - break; - case PackageServiceConstants.LISTENERS: - this.listeners.add(mapperObject.getDataObject()); - break; - case PackageServiceConstants.MODULE_LEVEL_VARIABLE: - this.moduleVariables.add(mapperObject.getDataObject()); - break; - case PackageServiceConstants.CONFIGURABLE_VARIABLES: - this.configurableVariables.add(mapperObject.getDataObject()); - break; - case PackageServiceConstants.AUTOMATIONS: - this.automations.add(mapperObject.getDataObject()); - break; - default: - break; + case PackageServiceConstants.FUNCTIONS -> this.addFunction(mapperObject.getDataObject()); + case PackageServiceConstants.SERVICES -> this.addService(mapperObject.getDataObject()); + case PackageServiceConstants.CONSTANTS -> this.addConstant(mapperObject.getDataObject()); + case PackageServiceConstants.RECORDS -> this.addRecord(mapperObject.getDataObject()); + case PackageServiceConstants.OBJECTS -> this.addObject(mapperObject.getDataObject()); + case PackageServiceConstants.CLASSES -> this.addClass(mapperObject.getDataObject()); + case PackageServiceConstants.TYPES -> this.addType(mapperObject.getDataObject()); + case PackageServiceConstants.ENUMS -> this.addEnum(mapperObject.getDataObject()); + case PackageServiceConstants.LISTENERS -> this.addListener(mapperObject.getDataObject()); + case PackageServiceConstants.MODULE_LEVEL_VARIABLE -> + this.addModuleVariable(mapperObject.getDataObject()); + case PackageServiceConstants.CONFIGURABLE_VARIABLES -> + this.addConfigurableVariable(mapperObject.getDataObject()); + case PackageServiceConstants.AUTOMATIONS -> this.addAutomation(mapperObject.getDataObject()); + default -> { + } } } } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json index 1c30aa4057d5..fff340d5d9be 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json @@ -1,329 +1,433 @@ { - "result": [ { - "name" : "project", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ { - "name" : "main", - "filePath" : "main.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 6, - "endColumn" : 1 - } ] - }, { - "functions" : [ ], - "services" : [ { - "name" : "/hello ", - "filePath" : "hello.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 11, - "endColumn" : 1, - "resources" : [ { - "name" : "get-satyHello", - "filePath" : "hello.bal", - "startLine" : 8, - "startColumn" : 4, - "endLine" : 10, - "endColumn" : 5 - } ] - } ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "services" - } ] - }, { - "name" : "project_functions", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ { - "name" : "main", - "filePath" : "main.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 6, - "endColumn" : 1 - } ] - }, { - "functions" : [ { - "name" : "initDatabase", - "filePath" : "db.bal", - "startLine" : 0, - "startColumn" : 0, - "endLine" : 2, - "endColumn" : 1 - } ], - "services" : [ ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "storage" - }, { - "functions" : [ { - "name" : "runServices", - "filePath" : "svc.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 6, - "endColumn" : 1 - } ], - "services" : [ ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "services" - } ] - }, { - "name" : "project_services", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ { - "name" : "/ ", - "filePath" : "main.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 11, - "endColumn" : 1, - "resources" : [ { - "name" : "get-welcome", - "filePath" : "main.bal", - "startLine" : 8, - "startColumn" : 4, - "endLine" : 10, - "endColumn" : 5 - } ] - } ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ] - }, { - "functions" : [ ], - "services" : [ { - "name" : "\"process\" ", - "filePath" : "db.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 8, - "endColumn" : 1, - "resources" : [ { - "name" : "post-connect", - "filePath" : "db.bal", - "startLine" : 5, - "startColumn" : 4, - "endLine" : 7, - "endColumn" : 5 - } ] - } ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "db_service" - }, { - "functions" : [ ], - "services" : [ { - "name" : "/hello ", - "filePath" : "hello.bal", - "startLine" : 5, - "startColumn" : 0, - "endLine" : 13, - "endColumn" : 1, - "resources" : [ { - "name" : "get-satyHello", - "filePath" : "hello.bal", - "startLine" : 10, - "startColumn" : 4, - "endLine" : 12, - "endColumn" : 5 - } ] - } ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ { - "name" : "helloEp", - "filePath" : "hello.bal", - "startLine" : 2, - "startColumn" : 0, - "endLine" : 2, - "endColumn" : 44 - } ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "hello_service" - } ] - }, { - "name" : ".", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ { - "name" : "/hey ", - "filePath" : "main.bal", - "startLine" : 48, - "startColumn" : 0, - "endLine" : 53, - "endColumn" : 1, - "resources" : [ { - "name" : "get-satyHello", - "filePath" : "main.bal", - "startLine" : 50, - "startColumn" : 4, - "endLine" : 52, - "endColumn" : 5 - } ] - } ], - "records" : [ { - "name" : "Coordinates", - "filePath" : "main.bal", - "startLine" : 12, - "startColumn" : 0, - "endLine" : 15, - "endColumn" : 3 - } ], - "objects" : [ { - "name" : "Address", - "filePath" : "main.bal", - "startLine" : 33, - "startColumn" : 0, - "endLine" : 38, - "endColumn" : 2 - } ], - "classes" : [ { - "name" : "Person", - "filePath" : "main.bal", - "startLine" : 25, - "startColumn" : 0, - "endLine" : 31, - "endColumn" : 1, - "functions" : [ { - "name" : "init", - "filePath" : "main.bal", - "startLine" : 28, - "startColumn" : 4, - "endLine" : 30, - "endColumn" : 5 - } ] - } ], - "types" : [ { - "name" : "SampleError", - "filePath" : "main.bal", - "startLine" : 40, - "startColumn" : 0, - "endLine" : 40, - "endColumn" : 40 - }, { - "name" : "CountryCode", - "filePath" : "main.bal", - "startLine" : 42, - "startColumn" : 0, - "endLine" : 42, - "endColumn" : 35 - } ], - "constants" : [ { - "name" : "BALLERINA", - "filePath" : "main.bal", - "startLine" : 10, - "startColumn" : 0, - "endLine" : 10, - "endColumn" : 30 - } ], - "enums" : [ { - "name" : "Color", - "filePath" : "main.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 8, - "endColumn" : 1 - } ], - "listeners" : [ ], - "moduleVariables" : [ { - "name" : "modLevelVariable ", - "filePath" : "main.bal", - "startLine" : 17, - "startColumn" : 0, - "endLine" : 21, - "endColumn" : 23 - } ], - "configurableVariables" : [ { - "name" : "enableRemote ", - "filePath" : "main.bal", - "startLine" : 23, - "startColumn" : 0, - "endLine" : 23, - "endColumn" : 41 - } ], - "automations" : [ { - "name" : "main", - "filePath" : "main.bal", - "startLine" : 44, - "startColumn" : 0, - "endLine" : 46, - "endColumn" : 1 - } ] - } ] - } ] + "result": [ + { + "name": "project", + "filePath": "file:///", + "modules": [ + { + "functions": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ] + }, + { + "functions": [], + "services": [ + { + "name": "/hello ", + "filePath": "hello.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 11, + "endColumn": 1, + "resources": [ + { + "name": "get-satyHello", + "filePath": "hello.bal", + "startLine": 8, + "startColumn": 4, + "endLine": 10, + "endColumn": 5 + } + ] + } + ], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [], + "name": "services" + } + ] + }, + { + "name": "project_functions", + "filePath": "file:///", + "modules": [ + { + "functions": [ + { + "name": "initDatabase", + "filePath": "db.bal", + "startLine": 0, + "startColumn": 0, + "endLine": 2, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [], + "name": "storage" + }, + { + "functions": [ + { + "name": "runServices", + "filePath": "svc.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [], + "name": "services" + }, + { + "functions": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ] + } + ] + }, + { + "name": "project_services", + "filePath": "file:///", + "modules": [ + { + "functions": [], + "services": [ + { + "name": "/hello ", + "filePath": "hello.bal", + "startLine": 5, + "startColumn": 0, + "endLine": 13, + "endColumn": 1, + "resources": [ + { + "name": "get-satyHello", + "filePath": "hello.bal", + "startLine": 10, + "startColumn": 4, + "endLine": 12, + "endColumn": 5 + } + ] + } + ], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [ + { + "name": "helloEp", + "filePath": "hello.bal", + "startLine": 2, + "startColumn": 0, + "endLine": 2, + "endColumn": 44 + } + ], + "moduleVariables": [], + "configurableVariables": [], + "automations": [], + "name": "hello_service" + }, + { + "functions": [], + "services": [ + { + "name": "\"process\" ", + "filePath": "db.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 8, + "endColumn": 1, + "resources": [ + { + "name": "post-connect", + "filePath": "db.bal", + "startLine": 5, + "startColumn": 4, + "endLine": 7, + "endColumn": 5 + } + ] + } + ], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [], + "name": "db_service" + }, + { + "functions": [], + "services": [ + { + "name": "/ ", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 11, + "endColumn": 1, + "resources": [ + { + "name": "get-welcome", + "filePath": "main.bal", + "startLine": 8, + "startColumn": 4, + "endLine": 10, + "endColumn": 5 + } + ] + } + ], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [] + } + ] + }, + { + "name": ".", + "filePath": "file:///", + "modules": [ + { + "functions": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 44, + "startColumn": 0, + "endLine": 46, + "endColumn": 1 + } + ], + "services": [ + { + "name": "/hey ", + "filePath": "main.bal", + "startLine": 48, + "startColumn": 0, + "endLine": 53, + "endColumn": 1, + "resources": [ + { + "name": "get-satyHello", + "filePath": "main.bal", + "startLine": 50, + "startColumn": 4, + "endLine": 52, + "endColumn": 5 + } + ] + } + ], + "records": [ + { + "name": "Coordinates", + "filePath": "main.bal", + "startLine": 12, + "startColumn": 0, + "endLine": 15, + "endColumn": 3 + } + ], + "objects": [ + { + "name": "Address", + "filePath": "main.bal", + "startLine": 33, + "startColumn": 0, + "endLine": 38, + "endColumn": 2 + } + ], + "classes": [ + { + "name": "Person", + "filePath": "main.bal", + "startLine": 25, + "startColumn": 0, + "endLine": 31, + "endColumn": 1, + "functions": [ + { + "name": "init", + "filePath": "main.bal", + "startLine": 28, + "startColumn": 4, + "endLine": 30, + "endColumn": 5 + } + ] + } + ], + "types": [ + { + "name": "SampleError", + "filePath": "main.bal", + "startLine": 40, + "startColumn": 0, + "endLine": 40, + "endColumn": 40 + }, + { + "name": "CountryCode", + "filePath": "main.bal", + "startLine": 42, + "startColumn": 0, + "endLine": 42, + "endColumn": 35 + } + ], + "constants": [ + { + "name": "BALLERINA", + "filePath": "main.bal", + "startLine": 10, + "startColumn": 0, + "endLine": 10, + "endColumn": 30 + } + ], + "enums": [], + "listeners": [ + { + "name": "Color", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 8, + "endColumn": 1 + } + ], + "moduleVariables": [ + { + "name": "modLevelVariable ", + "filePath": "main.bal", + "startLine": 17, + "startColumn": 0, + "endLine": 21, + "endColumn": 23 + }, + { + "name": "enableRemote ", + "filePath": "main.bal", + "startLine": 23, + "startColumn": 0, + "endLine": 23, + "endColumn": 41 + } + ], + "configurableVariables": [ + { + "name": "enableRemote ", + "filePath": "main.bal", + "startLine": 23, + "startColumn": 0, + "endLine": 23, + "endColumn": 41 + } + ], + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 44, + "startColumn": 0, + "endLine": 46, + "endColumn": 1 + } + ] + } + ] + } + ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json index 330adf3df64f..f428396d926c 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json @@ -1,168 +1,201 @@ { - "result": [ { - "name" : "project_other", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ ], - "records" : [ { - "name" : "ParseErrorDetail", - "filePath" : "model.bal", - "startLine" : 29, - "startColumn" : 0, - "endLine" : 31, - "endColumn" : 2 - } ], - "objects" : [ { - "name" : "StringIterator", - "filePath" : "model.bal", - "startLine" : 8, - "startColumn" : 0, - "endLine" : 12, - "endColumn" : 2 - } ], - "classes" : [ { - "name" : "Tokenizer", - "filePath" : "model.bal", - "startLine" : 35, - "startColumn" : 0, - "endLine" : 72, - "endColumn" : 1, - "functions" : [ { - "name" : "init", - "filePath" : "model.bal", - "startLine" : 51, - "startColumn" : 4, - "endLine" : 54, - "endColumn" : 5 - }, { - "name" : "advance", - "filePath" : "model.bal", - "startLine" : 58, - "startColumn" : 4, - "endLine" : 60, - "endColumn" : 5 - }, { - "name" : "current", - "filePath" : "model.bal", - "startLine" : 62, - "startColumn" : 4, - "endLine" : 64, - "endColumn" : 5 - }, { - "name" : "currentPos", - "filePath" : "model.bal", - "startLine" : 66, - "startColumn" : 4, - "endLine" : 71, - "endColumn" : 5 - } ] - } ], - "types" : [ { - "name" : "Char", - "filePath" : "model.bal", - "startLine" : 6, - "startColumn" : 0, - "endLine" : 6, - "endColumn" : 17 - }, { - "name" : "Position", - "filePath" : "model.bal", - "startLine" : 22, - "startColumn" : 0, - "endLine" : 27, - "endColumn" : 3 - }, { - "name" : "ParseError", - "filePath" : "model.bal", - "startLine" : 33, - "startColumn" : 0, - "endLine" : 33, - "endColumn" : 56 - } ], - "constants" : [ { - "name" : "LOWER", - "filePath" : "model.bal", - "startLine" : 0, - "startColumn" : 0, - "endLine" : 0, - "endColumn" : 43 - }, { - "name" : "UPPER", - "filePath" : "model.bal", - "startLine" : 1, - "startColumn" : 0, - "endLine" : 1, - "endColumn" : 43 - }, { - "name" : "DIGIT", - "filePath" : "model.bal", - "startLine" : 2, - "startColumn" : 0, - "endLine" : 2, - "endColumn" : 27 - }, { - "name" : "ALPHA", - "filePath" : "model.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 3, - "endColumn" : 35 - }, { - "name" : "IDENT", - "filePath" : "model.bal", - "startLine" : 4, - "startColumn" : 0, - "endLine" : 4, - "endColumn" : 41 - } ], - "enums" : [ { - "name" : "Language", - "filePath" : "model.bal", - "startLine" : 74, - "startColumn" : 0, - "endLine" : 77, - "endColumn" : 1 - } ], - "listeners" : [ ], - "moduleVariables" : [ { - "name" : "ESCAPES ", - "filePath" : "model.bal", - "startLine" : 14, - "startColumn" : 0, - "endLine" : 20, - "endColumn" : 2 - }, { - "name" : "expected ", - "filePath" : "model.bal", - "startLine" : 79, - "startColumn" : 0, - "endLine" : 83, - "endColumn" : 2 - } ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "models" - }, { - "functions" : [ { - "name" : "multiply", - "filePath" : "main.bal", - "startLine" : 0, - "startColumn" : 0, - "endLine" : 2, - "endColumn" : 1 - } ], - "services" : [ ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ] - } ] - } ] + "result": [ + { + "name": "project_other", + "filePath": "file:///", + "modules": [ + { + "functions": [ + { + "name": "multiply", + "filePath": "main.bal", + "startLine": 0, + "startColumn": 0, + "endLine": 2, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [] + }, + { + "functions": [], + "services": [], + "records": [ + { + "name": "ParseErrorDetail", + "filePath": "model.bal", + "startLine": 29, + "startColumn": 0, + "endLine": 31, + "endColumn": 2 + } + ], + "objects": [ + { + "name": "StringIterator", + "filePath": "model.bal", + "startLine": 8, + "startColumn": 0, + "endLine": 12, + "endColumn": 2 + } + ], + "classes": [ + { + "name": "Tokenizer", + "filePath": "model.bal", + "startLine": 35, + "startColumn": 0, + "endLine": 72, + "endColumn": 1, + "functions": [ + { + "name": "init", + "filePath": "model.bal", + "startLine": 51, + "startColumn": 4, + "endLine": 54, + "endColumn": 5 + }, + { + "name": "advance", + "filePath": "model.bal", + "startLine": 58, + "startColumn": 4, + "endLine": 60, + "endColumn": 5 + }, + { + "name": "current", + "filePath": "model.bal", + "startLine": 62, + "startColumn": 4, + "endLine": 64, + "endColumn": 5 + }, + { + "name": "currentPos", + "filePath": "model.bal", + "startLine": 66, + "startColumn": 4, + "endLine": 71, + "endColumn": 5 + } + ] + } + ], + "types": [ + { + "name": "Char", + "filePath": "model.bal", + "startLine": 6, + "startColumn": 0, + "endLine": 6, + "endColumn": 17 + }, + { + "name": "Position", + "filePath": "model.bal", + "startLine": 22, + "startColumn": 0, + "endLine": 27, + "endColumn": 3 + }, + { + "name": "ParseError", + "filePath": "model.bal", + "startLine": 33, + "startColumn": 0, + "endLine": 33, + "endColumn": 56 + } + ], + "constants": [ + { + "name": "LOWER", + "filePath": "model.bal", + "startLine": 0, + "startColumn": 0, + "endLine": 0, + "endColumn": 43 + }, + { + "name": "UPPER", + "filePath": "model.bal", + "startLine": 1, + "startColumn": 0, + "endLine": 1, + "endColumn": 43 + }, + { + "name": "DIGIT", + "filePath": "model.bal", + "startLine": 2, + "startColumn": 0, + "endLine": 2, + "endColumn": 27 + }, + { + "name": "ALPHA", + "filePath": "model.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 3, + "endColumn": 35 + }, + { + "name": "IDENT", + "filePath": "model.bal", + "startLine": 4, + "startColumn": 0, + "endLine": 4, + "endColumn": 41 + } + ], + "enums": [], + "listeners": [ + { + "name": "Language", + "filePath": "model.bal", + "startLine": 74, + "startColumn": 0, + "endLine": 77, + "endColumn": 1 + } + ], + "moduleVariables": [ + { + "name": "ESCAPES ", + "filePath": "model.bal", + "startLine": 14, + "startColumn": 0, + "endLine": 20, + "endColumn": 2 + }, + { + "name": "expected ", + "filePath": "model.bal", + "startLine": 79, + "startColumn": 0, + "endLine": 83, + "endColumn": 2 + } + ], + "configurableVariables": [], + "automations": [], + "name": "models" + } + ] + } + ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json index 4c73148cc279..5a400e8babc6 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json @@ -1,115 +1,159 @@ { "result": [ { - "name" : ".", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ { - "name" : "/hey ", - "filePath" : "main.bal", - "startLine" : 48, - "startColumn" : 0, - "endLine" : 53, - "endColumn" : 1, - "resources" : [ { - "name" : "get-satyHello", - "filePath" : "main.bal", - "startLine" : 50, - "startColumn" : 4, - "endLine" : 52, - "endColumn" : 5 - } ] - } ], - "records" : [ { - "name" : "Coordinates", - "filePath" : "main.bal", - "startLine" : 12, - "startColumn" : 0, - "endLine" : 15, - "endColumn" : 3 - } ], - "objects" : [ { - "name" : "Address", - "filePath" : "main.bal", - "startLine" : 33, - "startColumn" : 0, - "endLine" : 38, - "endColumn" : 2 - } ], - "classes" : [ { - "name" : "Person", - "filePath" : "main.bal", - "startLine" : 25, - "startColumn" : 0, - "endLine" : 31, - "endColumn" : 1, - "functions" : [ { - "name" : "init", - "filePath" : "main.bal", - "startLine" : 28, - "startColumn" : 4, - "endLine" : 30, - "endColumn" : 5 - } ] - } ], - "types" : [ { - "name" : "SampleError", - "filePath" : "main.bal", - "startLine" : 40, - "startColumn" : 0, - "endLine" : 40, - "endColumn" : 40 - }, { - "name" : "CountryCode", - "filePath" : "main.bal", - "startLine" : 42, - "startColumn" : 0, - "endLine" : 42, - "endColumn" : 35 - } ], - "constants" : [ { - "name" : "BALLERINA", - "filePath" : "main.bal", - "startLine" : 10, - "startColumn" : 0, - "endLine" : 10, - "endColumn" : 30 - } ], - "enums" : [ { - "name" : "Color", - "filePath" : "main.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 8, - "endColumn" : 1 - } ], - "listeners" : [ ], - "moduleVariables" : [ { - "name" : "modLevelVariable ", - "filePath" : "main.bal", - "startLine" : 17, - "startColumn" : 0, - "endLine" : 21, - "endColumn" : 23 - } ], - "configurableVariables" : [ { - "name" : "enableRemote ", - "filePath" : "main.bal", - "startLine" : 23, - "startColumn" : 0, - "endLine" : 23, - "endColumn" : 41 - } ], - "automations" : [ { - "name" : "main", - "filePath" : "main.bal", - "startLine" : 44, - "startColumn" : 0, - "endLine" : 46, - "endColumn" : 1 - } ] - } ] + "name": ".", + "filePath": "file:///", + "modules": [ + { + "functions": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 44, + "startColumn": 0, + "endLine": 46, + "endColumn": 1 + } + ], + "services": [ + { + "name": "/hey ", + "filePath": "main.bal", + "startLine": 48, + "startColumn": 0, + "endLine": 53, + "endColumn": 1, + "resources": [ + { + "name": "get-satyHello", + "filePath": "main.bal", + "startLine": 50, + "startColumn": 4, + "endLine": 52, + "endColumn": 5 + } + ] + } + ], + "records": [ + { + "name": "Coordinates", + "filePath": "main.bal", + "startLine": 12, + "startColumn": 0, + "endLine": 15, + "endColumn": 3 + } + ], + "objects": [ + { + "name": "Address", + "filePath": "main.bal", + "startLine": 33, + "startColumn": 0, + "endLine": 38, + "endColumn": 2 + } + ], + "classes": [ + { + "name": "Person", + "filePath": "main.bal", + "startLine": 25, + "startColumn": 0, + "endLine": 31, + "endColumn": 1, + "functions": [ + { + "name": "init", + "filePath": "main.bal", + "startLine": 28, + "startColumn": 4, + "endLine": 30, + "endColumn": 5 + } + ] + } + ], + "types": [ + { + "name": "SampleError", + "filePath": "main.bal", + "startLine": 40, + "startColumn": 0, + "endLine": 40, + "endColumn": 40 + }, + { + "name": "CountryCode", + "filePath": "main.bal", + "startLine": 42, + "startColumn": 0, + "endLine": 42, + "endColumn": 35 + } + ], + "constants": [ + { + "name": "BALLERINA", + "filePath": "main.bal", + "startLine": 10, + "startColumn": 0, + "endLine": 10, + "endColumn": 30 + } + ], + "enums": [], + "listeners": [ + { + "name": "Color", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 8, + "endColumn": 1 + } + ], + "moduleVariables": [ + { + "name": "modLevelVariable ", + "filePath": "main.bal", + "startLine": 17, + "startColumn": 0, + "endLine": 21, + "endColumn": 23 + }, + { + "name": "enableRemote ", + "filePath": "main.bal", + "startLine": 23, + "startColumn": 0, + "endLine": 23, + "endColumn": 41 + } + ], + "configurableVariables": [ + { + "name": "enableRemote ", + "filePath": "main.bal", + "startLine": 23, + "startColumn": 0, + "endLine": 23, + "endColumn": 41 + } + ], + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 44, + "startColumn": 0, + "endLine": 46, + "endColumn": 1 + } + ] + } + ] } ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json index 02cd51e5cef5..ba5333b77f24 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/single-package_expected.json @@ -1,58 +1,76 @@ { "result": [ { - "name" : "project", - "filePath" : "file:///", - "modules" : [ { - "functions" : [ ], - "services" : [ { - "name" : "/hello ", - "filePath" : "hello.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 11, - "endColumn" : 1, - "resources" : [ { - "name" : "get-satyHello", - "filePath" : "hello.bal", - "startLine" : 8, - "startColumn" : 4, - "endLine" : 10, - "endColumn" : 5 - } ] - } ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ ], - "name" : "services" - }, { - "functions" : [ ], - "services" : [ ], - "records" : [ ], - "objects" : [ ], - "classes" : [ ], - "types" : [ ], - "constants" : [ ], - "enums" : [ ], - "listeners" : [ ], - "moduleVariables" : [ ], - "configurableVariables" : [ ], - "automations" : [ { - "name" : "main", - "filePath" : "main.bal", - "startLine" : 3, - "startColumn" : 0, - "endLine" : 6, - "endColumn" : 1 - } ] - } ] + "name": "project", + "filePath": "file:///", + "modules": [ + { + "functions": [], + "services": [ + { + "name": "/hello ", + "filePath": "hello.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 11, + "endColumn": 1, + "resources": [ + { + "name": "get-satyHello", + "filePath": "hello.bal", + "startLine": 8, + "startColumn": 4, + "endLine": 10, + "endColumn": 5 + } + ] + } + ], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [], + "name": "services" + }, + { + "functions": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ] + } + ] } ] } From ee48629af6179ea7eee1b3d6c280d3f6eea66384 Mon Sep 17 00:00:00 2001 From: dulaj Date: Thu, 21 Nov 2024 06:43:39 +0530 Subject: [PATCH 41/42] Fix language server checkstyle error --- .../main/java/org/ballerinalang/langserver/LSPackageLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java index 2c70b506af23..caf4b30d4ea1 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/LSPackageLoader.java @@ -16,9 +16,9 @@ package org.ballerinalang.langserver; import com.google.common.reflect.TypeToken; +import com.google.gson.Gson; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; -import com.google.gson.Gson; import io.ballerina.compiler.api.ModuleID; import io.ballerina.compiler.api.SemanticModel; import io.ballerina.projects.Module; From 12e9abfe2995baacd68c1a89ab578aa5141a47b8 Mon Sep 17 00:00:00 2001 From: dulaj Date: Thu, 21 Nov 2024 07:25:07 +0530 Subject: [PATCH 42/42] Fix language server tests --- .../ballerina/packages/ModuleObject.java | 2 +- .../multiple-packages_expected.json | 160 +++++++++--------- .../components/project-other_expected.json | 50 +++--- .../single-file-package_expected.json | 4 +- 4 files changed, 108 insertions(+), 108 deletions(-) diff --git a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java index 0704f0cab044..d480b5606243 100644 --- a/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java +++ b/language-server/modules/langserver-core/src/main/java/org/ballerinalang/langserver/extensions/ballerina/packages/ModuleObject.java @@ -92,7 +92,7 @@ private void addListener(DataObject dataObject) { } private void addEnum(DataObject dataObject) { - this.listeners.add(dataObject); + this.enums.add(dataObject); } protected void addDataObject(MapperObject mapperObject) { diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json index fff340d5d9be..4a225bd496fb 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/multiple-packages_expected.json @@ -4,38 +4,6 @@ "name": "project", "filePath": "file:///", "modules": [ - { - "functions": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "configurableVariables": [], - "automations": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ] - }, { "functions": [], "services": [ @@ -69,6 +37,38 @@ "configurableVariables": [], "automations": [], "name": "services" + }, + { + "functions": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ] } ] }, @@ -103,8 +103,8 @@ { "functions": [ { - "name": "runServices", - "filePath": "svc.bal", + "name": "main", + "filePath": "main.bal", "startLine": 3, "startColumn": 0, "endLine": 6, @@ -121,14 +121,22 @@ "listeners": [], "moduleVariables": [], "configurableVariables": [], - "automations": [], - "name": "services" + "automations": [ + { + "name": "main", + "filePath": "main.bal", + "startLine": 3, + "startColumn": 0, + "endLine": 6, + "endColumn": 1 + } + ] }, { "functions": [ { - "name": "main", - "filePath": "main.bal", + "name": "runServices", + "filePath": "svc.bal", "startLine": 3, "startColumn": 0, "endLine": 6, @@ -145,16 +153,8 @@ "listeners": [], "moduleVariables": [], "configurableVariables": [], - "automations": [ - { - "name": "main", - "filePath": "main.bal", - "startLine": 3, - "startColumn": 0, - "endLine": 6, - "endColumn": 1 - } - ] + "automations": [], + "name": "services" } ] }, @@ -166,19 +166,19 @@ "functions": [], "services": [ { - "name": "/hello ", - "filePath": "hello.bal", - "startLine": 5, + "name": "/ ", + "filePath": "main.bal", + "startLine": 3, "startColumn": 0, - "endLine": 13, + "endLine": 11, "endColumn": 1, "resources": [ { - "name": "get-satyHello", - "filePath": "hello.bal", - "startLine": 10, + "name": "get-welcome", + "filePath": "main.bal", + "startLine": 8, "startColumn": 4, - "endLine": 12, + "endLine": 10, "endColumn": 5 } ] @@ -190,20 +190,10 @@ "types": [], "constants": [], "enums": [], - "listeners": [ - { - "name": "helloEp", - "filePath": "hello.bal", - "startLine": 2, - "startColumn": 0, - "endLine": 2, - "endColumn": 44 - } - ], + "listeners": [], "moduleVariables": [], "configurableVariables": [], - "automations": [], - "name": "hello_service" + "automations": [] }, { "functions": [], @@ -243,19 +233,19 @@ "functions": [], "services": [ { - "name": "/ ", - "filePath": "main.bal", - "startLine": 3, + "name": "/hello ", + "filePath": "hello.bal", + "startLine": 5, "startColumn": 0, - "endLine": 11, + "endLine": 13, "endColumn": 1, "resources": [ { - "name": "get-welcome", - "filePath": "main.bal", - "startLine": 8, + "name": "get-satyHello", + "filePath": "hello.bal", + "startLine": 10, "startColumn": 4, - "endLine": 10, + "endLine": 12, "endColumn": 5 } ] @@ -267,10 +257,20 @@ "types": [], "constants": [], "enums": [], - "listeners": [], + "listeners": [ + { + "name": "helloEp", + "filePath": "hello.bal", + "startLine": 2, + "startColumn": 0, + "endLine": 2, + "endColumn": 44 + } + ], "moduleVariables": [], "configurableVariables": [], - "automations": [] + "automations": [], + "name": "hello_service" } ] }, @@ -377,8 +377,7 @@ "endColumn": 30 } ], - "enums": [], - "listeners": [ + "enums": [ { "name": "Color", "filePath": "main.bal", @@ -388,6 +387,7 @@ "endColumn": 1 } ], + "listeners": [], "moduleVariables": [ { "name": "modLevelVariable ", diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json index f428396d926c..9aef28e69104 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/project-other_expected.json @@ -4,29 +4,6 @@ "name": "project_other", "filePath": "file:///", "modules": [ - { - "functions": [ - { - "name": "multiply", - "filePath": "main.bal", - "startLine": 0, - "startColumn": 0, - "endLine": 2, - "endColumn": 1 - } - ], - "services": [], - "records": [], - "objects": [], - "classes": [], - "types": [], - "constants": [], - "enums": [], - "listeners": [], - "moduleVariables": [], - "configurableVariables": [], - "automations": [] - }, { "functions": [], "services": [], @@ -162,8 +139,7 @@ "endColumn": 41 } ], - "enums": [], - "listeners": [ + "enums": [ { "name": "Language", "filePath": "model.bal", @@ -173,6 +149,7 @@ "endColumn": 1 } ], + "listeners": [], "moduleVariables": [ { "name": "ESCAPES ", @@ -194,6 +171,29 @@ "configurableVariables": [], "automations": [], "name": "models" + }, + { + "functions": [ + { + "name": "multiply", + "filePath": "main.bal", + "startLine": 0, + "startColumn": 0, + "endLine": 2, + "endColumn": 1 + } + ], + "services": [], + "records": [], + "objects": [], + "classes": [], + "types": [], + "constants": [], + "enums": [], + "listeners": [], + "moduleVariables": [], + "configurableVariables": [], + "automations": [] } ] } diff --git a/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json b/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json index 5a400e8babc6..e3b25c9184f0 100644 --- a/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json +++ b/language-server/modules/langserver-core/src/test/resources/packages/components/single-file-package_expected.json @@ -103,8 +103,7 @@ "endColumn": 30 } ], - "enums": [], - "listeners": [ + "enums": [ { "name": "Color", "filePath": "main.bal", @@ -114,6 +113,7 @@ "endColumn": 1 } ], + "listeners": [], "moduleVariables": [ { "name": "modLevelVariable ",