A plugin published as its own package cannot import HttpError without depending on core's version, and under CalVer no dependency range survives next month's beta. A Symbol.for brand crosses copies, so a plugin throws a 429 core renders, while importing nothing but types. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
99 lines
3.0 KiB
TypeScript
99 lines
3.0 KiB
TypeScript
/**
|
|
* @green-tea/core — a decorator-driven, type-safe HTTP framework.
|
|
* Public API barrel: application bootstrap, routing/DI decorators, streaming,
|
|
* request validation, security helpers, and the cross-server mesh.
|
|
*/
|
|
import 'reflect-metadata';
|
|
|
|
/** Package version, replaced at publish time. */
|
|
export const VERSION = '26.8.0-beta.0';
|
|
|
|
// Application
|
|
export { createApp } from './app';
|
|
export type { App, InspectLine, Explain, MeshConfig } from './app';
|
|
|
|
// Graph visualization
|
|
export { toMermaid, toDOT } from './graph-viz';
|
|
export type { GraphView } from './graph-viz';
|
|
export { buildOpenApi } from './openapi';
|
|
export type { OpenApiDoc, OpenApiInfo, OpenApiRoute } from './openapi';
|
|
|
|
// Views
|
|
export { render } from './views';
|
|
|
|
// Routing & decorators
|
|
export {
|
|
Provider,
|
|
Step,
|
|
Route,
|
|
Get,
|
|
Head,
|
|
Module,
|
|
Transformer,
|
|
Sse,
|
|
Ws,
|
|
Stream,
|
|
Post,
|
|
Put,
|
|
Patch,
|
|
Delete,
|
|
Options,
|
|
Html,
|
|
} from './metadata';
|
|
export type { Transport, HttpMethod, RouteDecorator, TransformerFn } from './metadata';
|
|
export type { Plugin, PluginApi, ScopeApi, ScopeNode } from './plugin';
|
|
export type { Hooks } from './app';
|
|
export type { TeardownFn } from './lifecycle';
|
|
|
|
// Transformers & error signals
|
|
export { JsonTransformer } from './transformers';
|
|
export type { ErrorRenderer, ErrorRequest, ErrorResponse } from './transformers';
|
|
export {
|
|
HttpError,
|
|
Unauthorized,
|
|
NotFound,
|
|
Redirect,
|
|
NotModified,
|
|
ValidationError,
|
|
TransportMismatchError,
|
|
HTTP_ERROR,
|
|
VALIDATION_ERROR,
|
|
isHttpError,
|
|
isValidationError,
|
|
} from './signals';
|
|
export type { HttpErrorLike } from './signals';
|
|
|
|
// Bus & flow
|
|
export { Bus } from './bus';
|
|
export type { LifecycleEvent, EventPayload, Correlation, Events } from './bus';
|
|
export { flow, Flow } from './flow';
|
|
export type { StepFn, CompiledFlow } from './flow';
|
|
|
|
// Parameter decorators
|
|
export { needs, ctx, param, query, body, headers, header, inbound, abort } from './params';
|
|
export type { Query, Headers, Context, ArgSpec, ArgDecorator } from './params';
|
|
|
|
// Observability
|
|
export { createDefaultLogger, logRequests, withConsoleFallback } from './logger';
|
|
export type { Logger, LogLevel, LogFields } from './logger';
|
|
|
|
// Streaming
|
|
export { channel, isAsyncIterable } from './channel';
|
|
export type { Channel } from './channel';
|
|
export { Rooms } from './rooms';
|
|
export { sse, isSseEvent, sseEncoder, ndjsonEncoder } from './encoders';
|
|
export type { StreamEncoder, SseEvent, SseFields } from './encoders';
|
|
|
|
// HTTP, security & validation
|
|
export type { RequestLimits } from './http';
|
|
export { UNMATCHED_ROUTE } from './http/core';
|
|
export type { TlsOptions, CorsOptions, SecurityOptions } from './security';
|
|
export type { UploadedFile, MultipartBody } from './multipart';
|
|
export type { StandardSchemaV1 } from './standard-schema';
|
|
|
|
// Mesh
|
|
export { connectLink } from './mesh/link';
|
|
export { buildRemote, envelopeFrom } from './mesh/teacup';
|
|
export { buildManifest, createMeshControl, MESH_CONTROL_PATH } from './mesh/teapot';
|
|
export type { Manifest, RequestEnvelope, Frame } from './mesh/protocol';
|