@devkong/cli-nx 0.0.33 → 0.0.35

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devkong/cli-nx",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -11,19 +11,20 @@ Content-Type: application/cloudevents+json
11
11
  {
12
12
  "id": "6056346e-af43-49aa-b794-977aa716ddc7",
13
13
  "time": "2024-04-25T11:30:50.517Z",
14
- "type": "KongFunctionCallEvent",
14
+ "type": "KongTaskCallEvent",
15
15
  "source": "/idea/http",
16
16
  "specversion": "1.0",
17
17
  "datacontenttype": "application/json",
18
18
  "sessionagent": "JOB",
19
19
  "sessionid": "1",
20
+ "sessionrootid": null,
20
21
  "sessionparentid": null,
21
22
  "sessiontenant": "sanb",
23
+ "sessionrootcreated": "2024-01-01T12:00:00Z",
22
24
  "sessioncreated": "2024-01-01T12:00:00Z",
23
25
  "sessionbusinesskey": "ABC123",
24
26
  "sessionsource": "/idea/http",
25
- "sessiontopic": "/sandbox/test",
26
- "sessionpartition": 0,
27
+ "sessiontopic": "/sandbox/test-events",
27
28
  "sessionpriority": "MAIN",
28
29
  "sessionexecutionmode": "SYNC",
29
30
  "sessiondeadline": "2024-12-31T23:59:59Z",
@@ -40,13 +41,6 @@ Content-Type: application/cloudevents+json
40
41
  }
41
42
  },
42
43
  "output": {
43
- "ack": {
44
- "producer": {
45
- "id": "PROCESS_EVENT_ID_001",
46
- "type": "KongProcessEvent"
47
- },
48
- "seqNum": 42
49
- },
50
44
  "type": "kong-process-events",
51
45
  "filter": ".output",
52
46
  "returns": []
@@ -34,10 +34,9 @@ data class OutputData(
34
34
  val objectMapper = ObjectMapper()
35
35
 
36
36
  @Singleton
37
- class MyExtension : KongFunction<InputData>(InputData::class.java) {
38
- private val logger = AppLogger(MyExtension::class.simpleName)
37
+ class Main : KongFunction<InputData>(InputData::class.java) {
38
+ private val logger = AppLogger(Main::class.simpleName)
39
39
 
40
- override suspend fun handle(data: InputData): JsonNode? {
41
- return objectMapper.valueToTree(OutputData(sum_of = data.a + data.b))
42
- }
40
+ override suspend fun handle(data: InputData): JsonNode? =
41
+ objectMapper.valueToTree(OutputData(sum_of = data.a + data.b))
43
42
  }
@@ -1,10 +1,10 @@
1
- black==24.10.0
2
- flake8==7.1.1
3
- isort==5.13.2
4
- pylint==3.3.2
5
- pylint-pydantic==0.3.4
6
- pytest==8.3.4
7
- pytest-asyncio==0.25.0
8
- pytest-cov==6.0.0
1
+ black==25.1.0
2
+ flake8==7.3.0
3
+ isort==6.0.1
4
+ pylint==3.3.8
5
+ pylint-pydantic==0.3.5
6
+ pytest==8.4.2
7
+ pytest-asyncio==1.2.0
8
+ pytest-cov==7.0.0
9
9
  pytest-html==4.1.1
10
- pytest-sugar==1.0.0
10
+ pytest-sugar==1.1.1
@@ -1,3 +1,3 @@
1
1
  --extra-index-url https://nexus.shared.app-dts.net/repository/python-hosted/simple
2
- pydantic==2.10.3
3
- kong-sdk==0.0.36
2
+ pydantic==2.11.9
3
+ kong-sdk==0.0.37
@@ -44,7 +44,7 @@ class OutputData(BaseModel):
44
44
  )
45
45
 
46
46
 
47
- class MyExtension(KongFunction):
47
+ class Main(KongFunction):
48
48
  # This is where you implement the logic to handle the input data
49
49
  # and produce the output.
50
50
 
@@ -60,7 +60,7 @@ class MyExtension(KongFunction):
60
60
  app = App(
61
61
  InputData,
62
62
  OutputData,
63
- MyExtension,
63
+ Main,
64
64
  )
65
65
 
66
66
  if __name__ == "__main__":
@@ -1,12 +1,12 @@
1
1
  from kong.sdk.conftest import ExtensionFixture
2
- from src.main import InputData, MyExtension
2
+ from src.main import InputData, Main
3
3
 
4
4
 
5
5
  # The test function to validate the behavior of the extension
6
6
  async def test_should_return_value_from_string_field_when_input_is_provided(
7
7
  create_extension: ExtensionFixture,
8
8
  ):
9
- extension = create_extension(MyExtension, InputData)
9
+ extension = create_extension(Main, InputData)
10
10
 
11
11
  # Prepare the input data
12
12
  input_data = InputData(