BSB Node.js Type Definitions
    Preparing search index...

    Function exportEventSchemas

    • Export event schemas to JSON format for cross-language client generation.

      v9: This function converts BSB EventSchemas to a standardized JSON format that can be consumed by code generators in other languages (C#, Go, Java, etc.) similar to how TRPC exports schemas for TypeScript.

      The exported JSON includes:

      • Event names and categories
      • Input/output schemas in JSON Schema format
      • Type metadata for cross-language type mapping (int32, uuid, datetime, etc.)
      • Descriptions for documentation

      Client generators use this JSON to produce type-safe, idiomatic code in their target language.

      Parameters

      • pluginName: string

        Plugin identifier (e.g., "service-demo-todo")

      • version: string

        Plugin version (e.g., "1.0.0")

      • schemas: BSBEventSchemas

        Event schemas created with createEventSchemas()

      Returns EventSchemaExport

      JSON-serializable export object

      export class Plugin extends BSBService<typeof Config, typeof EventSchemas> {
      static exportSchemas(): EventSchemaExport {
      return exportEventSchemas(
      Config.metadata.name,
      Config.metadata.version || '1.0.0',
      EventSchemas
      );
      }
      }