Exports
@tahanabavi/typewire-nestjs
| Export | Kind | Purpose |
|---|---|---|
TypeFetchEndpoint | decorator | Bind route + validation from an http contract endpoint |
UseContract | decorator | Validation only, on manually declared routes — any transport |
ContractInput / ContractPath / ContractQuery / ContractBody / ContractHeaders | param decorators | Validated request data |
TypeFetchModule | module | forRoot() global options |
ContractValidationInterceptor | interceptor | Applied automatically; exported for advanced wiring |
ResponseEnvelopeInterceptor / ContractEnvelopeExceptionFilter | interceptor / filter | Response-envelope success + error wrapping |
decryptRequestBody / encryptResponseData / encryptValue / decryptValue | functions | Field-level encryption building blocks |
getContractEndpoint | helper | Read the bound endpoint in guards/interceptors |
createPermissionGuard | function | Build a guard enforcing the contract's permission key → typed 403 |
RequirePermission | decorator | Declare/override a permission requirement on a route |
PermissionGuardConfig / PermissionDecisionLike | types | Config and decision shapes for the permission guard |
setupContractSwagger | helper | Build + mount Swagger UI from contracts |
buildOpenApiDocument | function | Contracts → plain OpenAPI 3.0 document |
InferRequest / InferResponse / ContractHandler | types | End-to-end handler typing |
ContractValidationException / ContractResponseViolationException | exceptions | Thrown on 400 / 500 |
formatZodIssues, coerceInput, validateRequest | utilities | Building blocks for custom pipelines |
contractFile / isContractFile / CONTRACT_EXPOSED_HEADERS | function / helpers | Non-JSON responseType responses and the headers they need |
SkipEnvelope | decorator | Exempt a route from the global response envelope |
transportOf / isHttpEndpoint / assertTransport / describeContractRoute | helpers | Read an endpoint's wire without touching a field it may not have |
TYPEFETCH_ENDPOINT_METADATA, TYPEFETCH_OPTIONS_METADATA, TYPEFETCH_MODULE_OPTIONS, TYPEFETCH_PERMISSION_METADATA, TYPEFETCH_SKIP_ENVELOPE_METADATA, PARSED_REQUEST_KEY | constants | Metadata & DI tokens |
@tahanabavi/typewire-nestjs/grpc
| Export | Kind | Purpose |
|---|---|---|
GrpcEndpoint | decorator | Bind a Connect JSON route from a transport: "grpc" contract |
GrpcException | exception | Throw a specific gRPC status from a handler |
GrpcDeadline | param decorator | The caller's deadline, with an AbortSignal |
ConnectExceptionFilter / ConnectDeadlineInterceptor | filter / interceptor | Applied automatically; exported for manual wiring |
toConnectError / codeFromThrownStatus / parseDeadline | functions | The mapping rules, testable on their own |
GrpcCode / codeName / statusFromGrpcCode | re-exports | From @tahanabavi/typefetch-grpc, so a handler needs one import |
@tahanabavi/typewire-nestjs/graphql
| Export | Kind | Purpose |
|---|---|---|
ContractGraphQLModule | module | forRoot({ contracts, path?, allowGet?, requireAllResolvers? }) |
GraphQLEndpoint | decorator | Mark a provider method as the resolver for a GraphQL contract |
GraphqlException | exception | Throw a specific extensions.code |
ContractGraphQLRegistry / ContractGraphQLDispatcher | services | The operation index and the request pipeline |
toGraphqlError / graphqlCodeFromStatus / statusFromGraphqlCode | functions | The mapping rules |
@tahanabavi/typewire-nestjs/socket
| Export | Kind | Purpose |
|---|---|---|
bindSocketContracts | function | Give every contract event its wire name and id |
SocketEvent | decorator | Bind a gateway handler to a client->server event |
SocketPayload / SocketEventInfo | param decorators | The validated frame; the bound event |
emitSocketEvent / createSocketEmitter | functions | Push a server->client event, validated |
createSocketPermissionGuard | function | Enforce an event's contract permission server-side |
SocketContractException / SocketAckInterceptor | exception / interceptor | Contract failures on a frame; ack validation |
InferSocketRequest / InferSocketAck / InferSocketPayload | types | End-to-end gateway typing |
License
MIT © Taha Nabavi