Interface: XRPCEndpoint<TInput, TOutput>
Defined in: src/api/types/handlers.ts:106
XRPC endpoint definition.
Remarks
Defines a complete XRPC endpoint with metadata, schemas, and handler. Used for route registration and OpenAPI documentation generation.
Example
export const getSubmissionEndpoint: XRPCEndpoint<
GetSubmissionInput,
GetSubmissionOutput
> = {
method: 'pub.chive.preprint.getSubmission' as NSID,
type: 'query',
description: 'Get preprint by AT URI',
inputSchema: getSubmissionInputSchema,
outputSchema: getSubmissionOutputSchema,
handler: getSubmissionHandler,
auth: 'optional',
rateLimit: 'authenticated',
};
Type Parameters
• TInput
Input parameter type
• TOutput
Output response type
Properties
auth?
readonlyoptionalauth:AuthRequirement
Defined in: src/api/types/handlers.ts:142
Authentication requirement for this endpoint.
Default Value
'optional'
description
readonlydescription:string
Defined in: src/api/types/handlers.ts:120
Human-readable description for documentation.
handler
readonlyhandler:XRPCHandler<TInput,TOutput>
Defined in: src/api/types/handlers.ts:135
Handler function implementing the endpoint logic.
inputSchema
readonlyinputSchema:ZodType<TInput>
Defined in: src/api/types/handlers.ts:125
Zod schema for validating input parameters.
method
readonlymethod:NSID
Defined in: src/api/types/handlers.ts:110
NSID of the XRPC method (e.g., "pub.chive.preprint.getSubmission").
outputSchema
readonlyoutputSchema:ZodType<TOutput>
Defined in: src/api/types/handlers.ts:130
Zod schema for validating and documenting output.
rateLimit?
readonlyoptionalrateLimit:RateLimitTier
Defined in: src/api/types/handlers.ts:153
Rate limit tier to apply.
Remarks
Determines which rate limit bucket is used. Higher tiers get more requests per minute.
Default Value
'authenticated'
type
readonlytype:XRPCType
Defined in: src/api/types/handlers.ts:115
XRPC type: query (GET) or procedure (POST).