@ioka-technologies/asyncapi-ts-client-template 0.0.21 → 0.0.22
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/dist/common/index.js +2004 -0
- package/examples/test-sanitization/asyncapi.yaml +142 -0
- package/package.json +10 -3
- package/template/dist/common/index.js +2004 -0
- package/template/helpers/security.js +20 -73
- package/template/helpers/security.js.dev +84 -0
- package/template/index.js +4 -4
- package/template/src/client.ts.js +2 -2
- package/template/src/index.ts.js +1 -1
- package/template/src/models.ts.js +2 -2
- package/template/src/runtime/auth/headers.ts.js +2 -2
- package/template/src/runtime/auth/index.ts.js +2 -2
- package/template/src/runtime/auth/types.ts.js +2 -2
- package/template/src/runtime/errors.ts.js +1 -1
- package/template/src/runtime/retry/index.ts.js +2 -2
- package/template/src/runtime/retry/manager.ts.js +2 -2
- package/template/src/runtime/retry/presets.ts.js +2 -2
- package/template/src/runtime/retry/types.ts.js +2 -2
- package/template/src/runtime/transports/factory.ts.js +1 -1
- package/template/src/runtime/transports/http.ts.js +2 -2
- package/template/src/runtime/transports/websocket.ts.js +2 -2
- package/template/src/runtime/types.ts.js +2 -2
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# yaml-language-server: $schema=https://raw.githubusercontent.com/asyncapi/spec-json-schemas/refs/heads/master/schemas/all.schema-store.json
|
|
2
|
+
asyncapi: 3.0.0
|
|
3
|
+
info:
|
|
4
|
+
title: Method Name Sanitization Test API
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
description: Test API for validating method name sanitization
|
|
7
|
+
|
|
8
|
+
channels:
|
|
9
|
+
deviceList:
|
|
10
|
+
address: device/list
|
|
11
|
+
messages:
|
|
12
|
+
DeviceListRequest:
|
|
13
|
+
name: DeviceListRequest
|
|
14
|
+
title: Device List Request
|
|
15
|
+
payload:
|
|
16
|
+
type: object
|
|
17
|
+
properties:
|
|
18
|
+
filter:
|
|
19
|
+
type: string
|
|
20
|
+
DeviceListResponse:
|
|
21
|
+
name: DeviceListResponse
|
|
22
|
+
title: Device List Response
|
|
23
|
+
payload:
|
|
24
|
+
type: object
|
|
25
|
+
properties:
|
|
26
|
+
devices:
|
|
27
|
+
type: array
|
|
28
|
+
items:
|
|
29
|
+
type: object
|
|
30
|
+
|
|
31
|
+
userProfile:
|
|
32
|
+
address: user-profile
|
|
33
|
+
messages:
|
|
34
|
+
UserProfileRequest:
|
|
35
|
+
name: UserProfileRequest
|
|
36
|
+
title: User Profile Request
|
|
37
|
+
payload:
|
|
38
|
+
type: object
|
|
39
|
+
properties:
|
|
40
|
+
userId:
|
|
41
|
+
type: string
|
|
42
|
+
UserProfileResponse:
|
|
43
|
+
name: UserProfileResponse
|
|
44
|
+
title: User Profile Response
|
|
45
|
+
payload:
|
|
46
|
+
type: object
|
|
47
|
+
properties:
|
|
48
|
+
profile:
|
|
49
|
+
type: object
|
|
50
|
+
|
|
51
|
+
apiStatus:
|
|
52
|
+
address: api.status
|
|
53
|
+
messages:
|
|
54
|
+
StatusRequest:
|
|
55
|
+
name: StatusRequest
|
|
56
|
+
title: Status Request
|
|
57
|
+
payload:
|
|
58
|
+
type: object
|
|
59
|
+
StatusResponse:
|
|
60
|
+
name: StatusResponse
|
|
61
|
+
title: Status Response
|
|
62
|
+
payload:
|
|
63
|
+
type: object
|
|
64
|
+
properties:
|
|
65
|
+
status:
|
|
66
|
+
type: string
|
|
67
|
+
|
|
68
|
+
eventStream:
|
|
69
|
+
address: event_stream
|
|
70
|
+
messages:
|
|
71
|
+
EventMessage:
|
|
72
|
+
name: EventMessage
|
|
73
|
+
title: Event Message
|
|
74
|
+
payload:
|
|
75
|
+
type: object
|
|
76
|
+
properties:
|
|
77
|
+
eventType:
|
|
78
|
+
type: string
|
|
79
|
+
|
|
80
|
+
operations:
|
|
81
|
+
# Test operation with dots
|
|
82
|
+
device.list:
|
|
83
|
+
action: send
|
|
84
|
+
channel:
|
|
85
|
+
$ref: '#/channels/deviceList'
|
|
86
|
+
messages:
|
|
87
|
+
- $ref: '#/channels/deviceList/messages/DeviceListRequest'
|
|
88
|
+
reply:
|
|
89
|
+
channel:
|
|
90
|
+
$ref: '#/channels/deviceList'
|
|
91
|
+
messages:
|
|
92
|
+
- $ref: '#/channels/deviceList/messages/DeviceListResponse'
|
|
93
|
+
|
|
94
|
+
# Test operation with hyphens
|
|
95
|
+
user-profile:
|
|
96
|
+
action: send
|
|
97
|
+
channel:
|
|
98
|
+
$ref: '#/channels/userProfile'
|
|
99
|
+
messages:
|
|
100
|
+
- $ref: '#/channels/userProfile/messages/UserProfileRequest'
|
|
101
|
+
reply:
|
|
102
|
+
channel:
|
|
103
|
+
$ref: '#/channels/userProfile'
|
|
104
|
+
messages:
|
|
105
|
+
- $ref: '#/channels/userProfile/messages/UserProfileResponse'
|
|
106
|
+
|
|
107
|
+
# Test operation with forward slashes
|
|
108
|
+
api/status:
|
|
109
|
+
action: send
|
|
110
|
+
channel:
|
|
111
|
+
$ref: '#/channels/apiStatus'
|
|
112
|
+
messages:
|
|
113
|
+
- $ref: '#/channels/apiStatus/messages/StatusRequest'
|
|
114
|
+
reply:
|
|
115
|
+
channel:
|
|
116
|
+
$ref: '#/channels/apiStatus'
|
|
117
|
+
messages:
|
|
118
|
+
- $ref: '#/channels/apiStatus/messages/StatusResponse'
|
|
119
|
+
|
|
120
|
+
# Test operation with underscores
|
|
121
|
+
event_stream:
|
|
122
|
+
action: receive
|
|
123
|
+
channel:
|
|
124
|
+
$ref: '#/channels/eventStream'
|
|
125
|
+
messages:
|
|
126
|
+
- $ref: '#/channels/eventStream/messages/EventMessage'
|
|
127
|
+
|
|
128
|
+
# Test operation that conflicts with class method
|
|
129
|
+
connect:
|
|
130
|
+
action: send
|
|
131
|
+
channel:
|
|
132
|
+
$ref: '#/channels/apiStatus'
|
|
133
|
+
messages:
|
|
134
|
+
- $ref: '#/channels/apiStatus/messages/StatusRequest'
|
|
135
|
+
|
|
136
|
+
# Test operation with reserved word
|
|
137
|
+
return:
|
|
138
|
+
action: send
|
|
139
|
+
channel:
|
|
140
|
+
$ref: '#/channels/apiStatus'
|
|
141
|
+
messages:
|
|
142
|
+
- $ref: '#/channels/apiStatus/messages/StatusRequest'
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ioka-technologies/asyncapi-ts-client-template",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "TypeScript AsyncAPI client generator template compatible with rust-asyncapi patterns",
|
|
5
5
|
"main": "template/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
+
"build": "webpack --config ../webpack.config.js --env template=ts-client",
|
|
8
|
+
"build:dev": "webpack --config ../webpack.config.js --env template=ts-client --mode development",
|
|
9
|
+
"prepublishOnly": "npm run build",
|
|
7
10
|
"test": "npm run test:generate",
|
|
8
11
|
"test:generate": "asyncapi generate fromTemplate examples/auth-retry/asyncapi.yaml . -o test-output-auth-retry --force-write && cd test-output-auth-retry && npm install && npm run build",
|
|
9
12
|
"test:realworld": "asyncapi generate fromTemplate ../examples/realworld/asyncapi.yaml . -o test-output-realworld --force-write",
|
|
10
|
-
"test:simple": "asyncapi generate fromTemplate ../examples/simple/asyncapi.yaml
|
|
11
|
-
"clean": "rm -rf test-output-*"
|
|
13
|
+
"test:simple": "asyncapi generate fromTemplate ../examples/simple/asyncapi.yaml ./ -o test-output-simple --force-write",
|
|
14
|
+
"clean": "rm -rf test-output-* dist"
|
|
12
15
|
},
|
|
13
16
|
"keywords": [
|
|
14
17
|
"asyncapi",
|
|
@@ -22,6 +25,9 @@
|
|
|
22
25
|
],
|
|
23
26
|
"author": "AsyncAPI TypeScript Generator",
|
|
24
27
|
"license": "Apache-2.0",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@asyncapi/generator-react-sdk": "^1.0.20"
|
|
30
|
+
},
|
|
25
31
|
"devDependencies": {
|
|
26
32
|
"@asyncapi/cli": "^1.18.0"
|
|
27
33
|
},
|
|
@@ -86,6 +92,7 @@
|
|
|
86
92
|
},
|
|
87
93
|
"files": [
|
|
88
94
|
"template/**/*",
|
|
95
|
+
"dist/common/**/*",
|
|
89
96
|
"examples/**/*",
|
|
90
97
|
"README.md",
|
|
91
98
|
"USAGE.md",
|