@devkong/cli-nx 0.0.55 → 0.0.57
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 +6 -0
- package/src/generators/preset/files/kotlin/README.md +25 -0
- package/src/generators/preset/files/kotlin/build.gradle.kts.template +3 -4
- package/src/generators/preset/files/kotlin/gradle.properties +7 -9
- package/src/generators/preset/files/kotlin/src/main/kotlin/io/kong/extension/Main.kt +10 -3
- package/src/generators/preset/files/python/README.md +25 -0
- package/src/generators/preset/files/python/kong.json.template +6 -0
- package/src/generators/preset/files/kotlin/nx.json +0 -14
- /package/src/generators/preset/files/{python/kong.json → kotlin/kong.json.template} +0 -0
package/package.json
CHANGED
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
## Stage 1: Build native extension image
|
|
2
2
|
FROM quay.io/quarkus/ubi-quarkus-mandrel-builder-image:jdk-21 AS build
|
|
3
|
+
|
|
3
4
|
USER root
|
|
4
5
|
RUN microdnf install findutils
|
|
6
|
+
|
|
5
7
|
COPY --chown=quarkus:quarkus gradlew /code/gradlew
|
|
6
8
|
COPY --chown=quarkus:quarkus gradle /code/gradle
|
|
7
9
|
COPY --chown=quarkus:quarkus build.gradle.kts /code/
|
|
8
10
|
COPY --chown=quarkus:quarkus settings.gradle.kts /code/
|
|
9
11
|
COPY --chown=quarkus:quarkus gradle.properties /code/
|
|
10
12
|
COPY --chown=quarkus:quarkus .editorconfig /code/
|
|
13
|
+
|
|
11
14
|
USER quarkus
|
|
12
15
|
WORKDIR /code
|
|
13
16
|
COPY src /code/src
|
|
17
|
+
|
|
14
18
|
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
19
|
|
|
16
20
|
## Stage 2 : create the docker final image
|
|
17
21
|
FROM quay.io/quarkus/quarkus-micro-image:2.0
|
|
22
|
+
|
|
18
23
|
WORKDIR /work/
|
|
19
24
|
COPY --from=build /code/build/*-runner /work/application
|
|
20
25
|
RUN chmod 775 /work
|
|
26
|
+
|
|
21
27
|
EXPOSE 8080
|
|
22
28
|
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
|
|
@@ -43,6 +43,31 @@ To automatically tag your code with an incremented version number (e.g., 1, 2, 3
|
|
|
43
43
|
kong publish-version --verbose
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
+
**NOTE:** before publishing a new version, ensure that your extension JSON Schema includes the required `operation` field. This input field has `enum` type and defines the action to be performed by the extension.
|
|
47
|
+
|
|
48
|
+
**Purpose:**
|
|
49
|
+
|
|
50
|
+
- When an extension supports multiple usage variants or endpoints, this field identifies the specific operation to execute.
|
|
51
|
+
- It enables routing and logic selection within the extension workflow.
|
|
52
|
+
- If an extension has only one primary function, this `enum` contains a single value that uniquely identifies its operation.
|
|
53
|
+
|
|
54
|
+
**Usage Example:**
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
58
|
+
"title": "Input",
|
|
59
|
+
"type": "object",
|
|
60
|
+
"properties": {
|
|
61
|
+
"operation": {
|
|
62
|
+
"enum": ["score digital profile", ...],
|
|
63
|
+
"examples": ["score digital profile"],
|
|
64
|
+
"description": "Operation type."
|
|
65
|
+
},
|
|
66
|
+
...
|
|
67
|
+
"required": ["operation", ... ]
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
46
71
|
### List Available Versions
|
|
47
72
|
|
|
48
73
|
To see all available versions of your extension, run:
|
|
@@ -59,10 +59,9 @@ allOpen {
|
|
|
59
59
|
|
|
60
60
|
kotlin {
|
|
61
61
|
compilerOptions {
|
|
62
|
-
jvmTarget
|
|
62
|
+
jvmTarget =
|
|
63
63
|
org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
64
|
-
.
|
|
65
|
-
|
|
66
|
-
javaParameters.set(true)
|
|
64
|
+
.fromTarget(javaVersion)
|
|
65
|
+
javaParameters = true
|
|
67
66
|
}
|
|
68
67
|
}
|
|
@@ -3,21 +3,19 @@ org.gradle.jvmargs=-Xms4g -Xmx4g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfM
|
|
|
3
3
|
kotlin.code.style=official
|
|
4
4
|
javaVersion=21
|
|
5
5
|
|
|
6
|
+
# kong artifacts
|
|
7
|
+
kongSdkVersion=0.0.19-SNAPSHOT
|
|
8
|
+
kongVersion=0.0.1-SNAPSHOT
|
|
9
|
+
|
|
6
10
|
# https://mvnrepository.com/artifact/org.jlleitschuh.gradle/ktlint-gradle
|
|
7
|
-
jlleitschuhGradlePluginVersion=
|
|
11
|
+
jlleitschuhGradlePluginVersion=14.0.1
|
|
8
12
|
|
|
9
13
|
#https://mvnrepository.com/artifact/com.networknt/json-schema-validator
|
|
10
|
-
jsonSchemaValidatorVersion=
|
|
14
|
+
jsonSchemaValidatorVersion=3.0.0
|
|
11
15
|
|
|
12
16
|
# https://mvnrepository.com/artifact/io.github.khalilou88.jnxplus/jnxplus-gradle-plugin
|
|
13
17
|
jnxplusGradlePluginVersion=0.4.0
|
|
14
18
|
|
|
15
|
-
# Version of Kong SDK artifacts
|
|
16
|
-
kongSdkVersion=0.0.16-SNAPSHOT
|
|
17
|
-
|
|
18
|
-
# Version of Kong non-SDK artifacts
|
|
19
|
-
kongVersion=0.0.1-SNAPSHOT
|
|
20
|
-
|
|
21
19
|
# https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib
|
|
22
20
|
kotlinVersion=2.1.10
|
|
23
21
|
|
|
@@ -25,4 +23,4 @@ kotlinVersion=2.1.10
|
|
|
25
23
|
kotlinxCoroutinesTestVersion=1.10.2
|
|
26
24
|
|
|
27
25
|
# https://mvnrepository.com/artifact/io.quarkus/quarkus-core
|
|
28
|
-
quarkusVersion=3.
|
|
26
|
+
quarkusVersion=3.20.3
|
|
@@ -17,15 +17,22 @@ import jakarta.inject.Singleton
|
|
|
17
17
|
@RegisterForReflection
|
|
18
18
|
data class InputData(
|
|
19
19
|
// REPLACE BELLOW WITH YOUR FIELDS
|
|
20
|
-
|
|
21
|
-
@Field(description = "An integer number", examples = ["
|
|
20
|
+
|
|
21
|
+
@Field(description = "An integer number", examples = ["1"])
|
|
22
|
+
val a: Int,
|
|
23
|
+
|
|
24
|
+
@Field(description = "An integer number", examples = ["2"])
|
|
25
|
+
val b: Int,
|
|
22
26
|
)
|
|
23
27
|
|
|
24
28
|
@RegisterForReflection
|
|
25
29
|
data class OutputData(
|
|
26
30
|
// Define the structure of the output data that your extension will return.
|
|
27
31
|
// REPLACE BELLOW WITH YOUR FIELDS
|
|
28
|
-
|
|
32
|
+
|
|
33
|
+
@Field(description = "Result of a + b", examples = ["3"])
|
|
34
|
+
val sum_of: Int,
|
|
35
|
+
|
|
29
36
|
@Field(
|
|
30
37
|
description = "A string field",
|
|
31
38
|
examples = ["This example extension returns sum of a and b"],
|
|
@@ -46,6 +46,31 @@ To automatically tag your code with an incremented version number (e.g., 1, 2, 3
|
|
|
46
46
|
kong publish-version --verbose
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
+
**NOTE:** before publishing a new version, ensure that your extension JSON Schema includes the required `operation` field. This input field has `enum` type and defines the action to be performed by the extension.
|
|
50
|
+
|
|
51
|
+
**Purpose:**
|
|
52
|
+
|
|
53
|
+
- When an extension supports multiple usage variants or endpoints, this field identifies the specific operation to execute.
|
|
54
|
+
- It enables routing and logic selection within the extension workflow.
|
|
55
|
+
- If an extension has only one primary function, this `enum` contains a single value that uniquely identifies its operation.
|
|
56
|
+
|
|
57
|
+
**Usage Example:**
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
61
|
+
"title": "Input",
|
|
62
|
+
"type": "object",
|
|
63
|
+
"properties": {
|
|
64
|
+
"operation": {
|
|
65
|
+
"enum": ["score digital profile", ...],
|
|
66
|
+
"examples": ["score digital profile"],
|
|
67
|
+
"description": "Operation type."
|
|
68
|
+
},
|
|
69
|
+
...
|
|
70
|
+
"required": ["operation", ... ]
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
49
74
|
### List Available Versions
|
|
50
75
|
|
|
51
76
|
To see all available versions of your extension, run:
|
|
File without changes
|