@ioka-technologies/asyncapi-ts-client-template 0.0.21 → 0.0.23
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 +3478 -0
- package/package.json +12 -5
- 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 +12 -369
- 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="headers.ts">
|
|
7
7
|
{`import { AuthCredentials, AuthError } from './types';
|
|
@@ -92,4 +92,4 @@ export function getAuthType(auth: AuthCredentials): string | null {
|
|
|
92
92
|
`}
|
|
93
93
|
</File>
|
|
94
94
|
);
|
|
95
|
-
}
|
|
95
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="index.ts">
|
|
7
7
|
{`// Auth types and interfaces
|
|
@@ -12,4 +12,4 @@ export * from './headers';
|
|
|
12
12
|
`}
|
|
13
13
|
</File>
|
|
14
14
|
);
|
|
15
|
-
}
|
|
15
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="types.ts">
|
|
7
7
|
{`/**
|
|
@@ -71,4 +71,4 @@ export interface SecurityRequirement {
|
|
|
71
71
|
`}
|
|
72
72
|
</File>
|
|
73
73
|
);
|
|
74
|
-
}
|
|
74
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="errors.ts">
|
|
7
7
|
{`export class TransportError extends Error {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="index.ts">
|
|
7
7
|
{`// Retry types and interfaces
|
|
@@ -15,4 +15,4 @@ export * from './manager';
|
|
|
15
15
|
`}
|
|
16
16
|
</File>
|
|
17
17
|
);
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="manager.ts">
|
|
7
7
|
{`import { RetryConfig, RetryEventCallbacks, MaxRetriesExceededError } from './types';
|
|
@@ -147,4 +147,4 @@ export function createRetryManager(
|
|
|
147
147
|
`}
|
|
148
148
|
</File>
|
|
149
149
|
);
|
|
150
|
-
}
|
|
150
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="presets.ts">
|
|
7
7
|
{`import { RetryConfig, RetryPreset } from './types';
|
|
@@ -78,4 +78,4 @@ export function mergeRetryConfig(preset: RetryPreset, overrides: Partial<RetryCo
|
|
|
78
78
|
`}
|
|
79
79
|
</File>
|
|
80
80
|
);
|
|
81
|
-
}
|
|
81
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="types.ts">
|
|
7
7
|
{`/**
|
|
@@ -57,4 +57,4 @@ export class MaxRetriesExceededError extends RetryError {
|
|
|
57
57
|
`}
|
|
58
58
|
</File>
|
|
59
59
|
);
|
|
60
|
-
}
|
|
60
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
const transports = (params.transports || 'websocket,http').split(',').map(t => t.trim());
|
|
6
6
|
|
|
7
7
|
let imports = `import { Transport, TransportConfig } from '../types';\n`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
const transports = (params.transports || 'websocket,http').split(',').map(t => t.trim());
|
|
6
6
|
|
|
7
7
|
if (!transports.includes('http')) {
|
|
@@ -214,4 +214,4 @@ export class HttpTransport implements Transport {
|
|
|
214
214
|
}`}
|
|
215
215
|
</File>
|
|
216
216
|
);
|
|
217
|
-
}
|
|
217
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
const transports = (params.transports || 'websocket,http').split(',').map(t => t.trim());
|
|
6
6
|
|
|
7
7
|
if (!transports.includes('websocket')) {
|
|
@@ -402,4 +402,4 @@ export class WebSocketTransport implements Transport {
|
|
|
402
402
|
}`}
|
|
403
403
|
</File>
|
|
404
404
|
);
|
|
405
|
-
}
|
|
405
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
|
2
2
|
import { File } from '@asyncapi/generator-react-sdk';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
export default function ({ asyncapi, params }) {
|
|
5
5
|
return (
|
|
6
6
|
<File name="types.ts">
|
|
7
7
|
{`import { AuthCredentials, AuthEventCallbacks } from './auth';
|
|
@@ -81,4 +81,4 @@ export type UnsubscribeFunction = () => void;
|
|
|
81
81
|
export type EnvelopeCallback = (envelope: MessageEnvelope) => void;`}
|
|
82
82
|
</File>
|
|
83
83
|
);
|
|
84
|
-
}
|
|
84
|
+
}
|