"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.radarAsyncApiDoc = void 0;
const typebox_1 = require("@signalk/server-api/typebox");
const typebox_2 = require("@sinclair/typebox");
// eslint-disable-next-line @typescript-eslint/no-require-imports
const serverVersion = require('../../../' + 'package.json').version;
exports.radarAsyncApiDoc = {
    asyncapi: '3.0.0',
    info: {
        title: 'Signal K Radar API - WebSocket Streams',
        version: serverVersion,
        description: `
WebSocket streams for the Signal K Radar API.

## Spoke Stream
Radar providers stream spoke data over a dedicated WebSocket endpoint.
Clients connect to receive raw radar returns for rendering.

## REST API
For the REST API documentation, see OpenAPI at \`/admin/openapi/\`.
    `.trim(),
        license: {
            name: 'Apache 2.0',
            url: 'https://www.apache.org/licenses/LICENSE-2.0.html'
        }
    },
    servers: {
        signalk: {
            host: 'localhost:3000',
            protocol: 'ws',
            description: 'Signal K server WebSocket endpoint',
            pathname: '/signalk/v2/api/vessels/self/radars/{radarId}/stream'
        }
    },
    channels: {
        'radars.stream': {
            address: 'radars/{radarId}/stream',
            description: 'Radar spoke data stream. Binary spoke data for rendering.',
            parameters: {
                radarId: {
                    description: 'The radar identifier'
                }
            },
            messages: {
                spokeData: {
                    name: 'spokeData',
                    title: 'Spoke Data',
                    summary: 'Raw radar spoke data for display rendering',
                    contentType: 'application/octet-stream',
                    payload: typebox_2.Type.Object({
                        angle: typebox_2.Type.Number({ description: 'Spoke angle in degrees' }),
                        data: typebox_2.Type.String({
                            description: 'Base64-encoded spoke sample data'
                        })
                    })
                }
            }
        }
    },
    operations: {
        receiveSpokeData: {
            action: 'receive',
            channel: { $ref: '#/channels/radars.stream' },
            summary: 'Receive radar spoke data'
        }
    },
    components: {
        schemas: {
            RadarInfo: typebox_1.RadarInfoSchema,
            RadarStatus: typebox_1.RadarStatusSchema
        }
    }
};
//# sourceMappingURL=asyncApi.js.map