@swimmesberger/elarion-jsonrpc-client-generator 0.2.1-preview.16.1 → 0.2.1-preview.18.1
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/rpc-client-source.js +14 -10
- package/package.json +1 -1
|
@@ -107,13 +107,14 @@ export function generateRpcClientSource(options) {
|
|
|
107
107
|
'}',
|
|
108
108
|
'',
|
|
109
109
|
'export class RpcError extends Error {',
|
|
110
|
-
'
|
|
111
|
-
'
|
|
112
|
-
'
|
|
113
|
-
'
|
|
114
|
-
' ) {',
|
|
110
|
+
' readonly code: number',
|
|
111
|
+
' readonly data?: unknown',
|
|
112
|
+
'',
|
|
113
|
+
' constructor(code: number, message: string, data?: unknown) {',
|
|
115
114
|
' super(message)',
|
|
116
115
|
" this.name = 'RpcError'",
|
|
116
|
+
' this.code = code',
|
|
117
|
+
' this.data = data',
|
|
117
118
|
' }',
|
|
118
119
|
'',
|
|
119
120
|
' get isParseError() {',
|
|
@@ -138,13 +139,16 @@ export function generateRpcClientSource(options) {
|
|
|
138
139
|
'}',
|
|
139
140
|
'',
|
|
140
141
|
'export class RpcTransportError extends Error {',
|
|
141
|
-
'
|
|
142
|
-
'
|
|
143
|
-
'
|
|
144
|
-
'
|
|
145
|
-
' ) {',
|
|
142
|
+
' readonly status: number',
|
|
143
|
+
' readonly statusText: string',
|
|
144
|
+
' readonly body: string',
|
|
145
|
+
'',
|
|
146
|
+
' constructor(status: number, statusText: string, body: string) {',
|
|
146
147
|
' super(`RPC transport error: ${status} ${statusText}`.trim())',
|
|
147
148
|
" this.name = 'RpcTransportError'",
|
|
149
|
+
' this.status = status',
|
|
150
|
+
' this.statusText = statusText',
|
|
151
|
+
' this.body = body',
|
|
148
152
|
' }',
|
|
149
153
|
'}',
|
|
150
154
|
'',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swimmesberger/elarion-jsonrpc-client-generator",
|
|
3
|
-
"version": "0.2.1-preview.
|
|
3
|
+
"version": "0.2.1-preview.18.1",
|
|
4
4
|
"description": "Generate TypeScript RPC contracts, Zod schemas, and a fetch client from Elarion JSON-RPC schema exports.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|