@devkong/cli-nx 0.0.46 → 0.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/generators/preset/files/kotlin/Dockerfile +1 -1
- package/src/generators/preset/files/kotlin/build.gradle.kts.template +3 -3
- package/src/generators/preset/files/kotlin/gradle.properties +2 -2
- package/src/generators/preset/files/kotlin/src/main/kotlin/io/kong/extension/Main.kt +7 -4
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ COPY --chown=quarkus:quarkus .editorconfig /code/
|
|
|
11
11
|
USER quarkus
|
|
12
12
|
WORKDIR /code
|
|
13
13
|
COPY src /code/src
|
|
14
|
-
RUN ./gradlew build -Dquarkus.package.main-class=io.kong.
|
|
14
|
+
RUN ./gradlew build -Dquarkus.package.main-class=io.kong.sdk.function.template.QuarkusApp -Dquarkus.native.enabled=true -Dquarkus.profile=prod -Dquarkus.package.jar.enabled=false
|
|
15
15
|
|
|
16
16
|
## Stage 2 : create the docker final image
|
|
17
17
|
FROM quay.io/quarkus/quarkus-micro-image:2.0
|
|
@@ -15,16 +15,16 @@ repositories {
|
|
|
15
15
|
mavenCentral()
|
|
16
16
|
mavenLocal()
|
|
17
17
|
maven {
|
|
18
|
-
url = uri("https://nexus.shared.app-dts.net/repository/maven-releases/")
|
|
18
|
+
url = uri("https://nexus.shared.sg.app-dts.net/repository/maven-releases/")
|
|
19
19
|
}
|
|
20
20
|
maven {
|
|
21
|
-
url = uri("https://nexus.shared.app-dts.net/repository/maven-snapshots/")
|
|
21
|
+
url = uri("https://nexus.shared.sg.app-dts.net/repository/maven-snapshots/")
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
dependencies {
|
|
26
26
|
implementation("io.kong:kong-common:$kongVersion")
|
|
27
|
-
implementation("io.kong:kong-sdk-
|
|
27
|
+
implementation("io.kong:kong-sdk-function-template:$kongSdkVersion")
|
|
28
28
|
|
|
29
29
|
implementation(enforcedPlatform("io.quarkus.platform:quarkus-bom:$quarkusVersion"))
|
|
30
30
|
implementation("io.quarkus:quarkus-arc")
|
|
@@ -13,10 +13,10 @@ jsonSchemaValidatorVersion=1.5.8
|
|
|
13
13
|
jnxplusGradlePluginVersion=0.4.0
|
|
14
14
|
|
|
15
15
|
# Version of Kong SDK artifacts
|
|
16
|
-
kongSdkVersion=0.0.
|
|
16
|
+
kongSdkVersion=0.0.8-SNAPSHOT
|
|
17
17
|
|
|
18
18
|
# Version of Kong non-SDK artifacts
|
|
19
|
-
kongVersion=0.0.
|
|
19
|
+
kongVersion=0.0.1-SNAPSHOT
|
|
20
20
|
|
|
21
21
|
# https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
|
|
22
22
|
kotlinVersion=2.1.10
|
|
@@ -2,8 +2,9 @@ package io.kong.extension
|
|
|
2
2
|
|
|
3
3
|
import com.fasterxml.jackson.databind.ObjectMapper
|
|
4
4
|
import io.kong.common.AppLogger
|
|
5
|
-
import io.kong.
|
|
6
|
-
import io.kong.
|
|
5
|
+
import io.kong.sdk.KongFunction
|
|
6
|
+
import io.kong.sdk.KongFunctionContext
|
|
7
|
+
import io.kong.sdk.function.template.Field
|
|
7
8
|
import io.quarkus.runtime.annotations.RegisterForReflection
|
|
8
9
|
import jakarta.inject.Singleton
|
|
9
10
|
|
|
@@ -39,6 +40,8 @@ val objectMapper = ObjectMapper()
|
|
|
39
40
|
class Main : KongFunction<InputData>(InputData::class.java) {
|
|
40
41
|
private val logger = AppLogger(Main::class.simpleName)
|
|
41
42
|
|
|
42
|
-
override suspend fun handle(
|
|
43
|
-
|
|
43
|
+
override suspend fun handle(
|
|
44
|
+
data: InputData,
|
|
45
|
+
context: KongFunctionContext,
|
|
46
|
+
): ByteArray? = objectMapper.writeValueAsBytes(OutputData(sum_of = data.a + data.b))
|
|
44
47
|
}
|