Interface: XRPCMethod<TParams, TInput, TOutput>
Defined in: src/api/xrpc/types.ts:92
XRPC method definition.
Remarks
Defines a complete XRPC method with lexicon reference, auth requirements, and handler function. Used for type-safe route registration.
Example
const getSubmission: XRPCMethod<GetSubmissionParams, void, Submission> = {
auth: false,
handler: async ({ params, c }) => {
const eprintService = c.get('services').eprint;
const result = await eprintService.getSubmission(params.uri);
return { encoding: 'application/json', body: result };
},
};
Extended by
Type Parameters
• TParams = unknown
Query/input parameters type
• TInput = unknown
Request body type (procedures only)
• TOutput = unknown
Response body type
Properties
auth?
optionalauth:boolean|"optional"
Defined in: src/api/xrpc/types.ts:115
Authentication requirement.
Remarks
true: Authentication required (401 if not authenticated)false: No authentication required (public endpoint)'optional': Authentication optional (different behavior for authed users)
Default Value
false
handler()
handler: (
ctx) =>Promise<XRPCResponse<TOutput>>
Defined in: src/api/xrpc/types.ts:120
Handler function implementing the method logic.