UNPKG

@hirosystems/api-toolkit

Version:
16 lines 764 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PaginatedResponse = exports.Optional = exports.Nullable = void 0; const typebox_1 = require("@sinclair/typebox"); const Nullable = (type) => typebox_1.Type.Union([type, typebox_1.Type.Null()]); exports.Nullable = Nullable; const Optional = (type) => typebox_1.Type.Optional(type); exports.Optional = Optional; const PaginatedResponse = (type, title) => typebox_1.Type.Object({ limit: typebox_1.Type.Integer({ examples: [20] }), offset: typebox_1.Type.Integer({ examples: [0] }), total: typebox_1.Type.Integer({ examples: [1] }), results: typebox_1.Type.Array(type), }, { title }); exports.PaginatedResponse = PaginatedResponse; //# sourceMappingURL=schemas.js.map