UNPKG

next-rest-framework

Version:

Next REST Framework - Type-safe, self-documenting APIs for Next.js

143 lines (140 loc) 4.75 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // package.json var require_package = __commonJS({ "package.json"(exports2, module2) { module2.exports = { name: "next-rest-framework", version: "5.1.6", description: "Next REST Framework - Type-safe, self-documenting APIs for Next.js", keywords: [ "nextjs", "rest", "api", "next-rest-framework" ], homepage: "https://next-rest-framework.vercel.app", bugs: { url: "https://github.com/blomqma/next-rest-framework/issues", email: "blomqma@omg.lol" }, license: "ISC", author: "Markus Blomqvist <blomqma@omg.lol>", files: [ "dist" ], main: "dist/index.js", module: "dist/index.mjs", types: "dist/index.d.ts", repository: { type: "git", url: "https://github.com/blomqma/next-rest-framework.git", directory: "packages/next-rest-framework" }, scripts: { lint: "tsc", test: "jest", "test:watch": "jest --watch", build: "tsup --dts" }, bin: { "next-rest-framework": "./dist/cli/index.js" }, dependencies: { chalk: "4.1.2", commander: "10.0.1", esbuild: "0.19.11", lodash: "4.17.21", prettier: "3.0.2", "tiny-glob": "0.2.9", "zod-to-json-schema": "3.21.4" }, devDependencies: { "@types/jest": "29.5.4", "@types/lodash": "4.14.197", jest: "29.6.4", "node-mocks-http": "1.13.0", "openapi-types": "12.1.3", "ts-jest": "29.1.1", "ts-node": "10.9.1", tsup: "8.0.1", typescript: "*", next: "*", zod: "*" } }; } }); // src/constants.ts var constants_exports = {}; __export(constants_exports, { DEFAULT_DESCRIPTION: () => DEFAULT_DESCRIPTION, DEFAULT_ERRORS: () => DEFAULT_ERRORS, DEFAULT_FAVICON_URL: () => DEFAULT_FAVICON_URL, DEFAULT_LOGO_URL: () => DEFAULT_LOGO_URL, DEFAULT_OG_TYPE: () => DEFAULT_OG_TYPE, DEFAULT_TITLE: () => DEFAULT_TITLE, HOMEPAGE: () => HOMEPAGE, VERSION: () => VERSION, ValidMethod: () => ValidMethod }); module.exports = __toCommonJS(constants_exports); var DEFAULT_ERRORS = { unexpectedError: "An unknown error occurred, trying again might help.", methodNotAllowed: "Method not allowed.", notFound: "Not found.", notImplemented: "Not implemented.", invalidMediaType: "Invalid media type.", operationNotAllowed: "Operation not allowed.", invalidRequestBody: "Invalid request body.", missingRequestBody: "Missing request body.", invalidQueryParameters: "Invalid query parameters." }; var ValidMethod = /* @__PURE__ */ ((ValidMethod2) => { ValidMethod2["GET"] = "GET"; ValidMethod2["PUT"] = "PUT"; ValidMethod2["POST"] = "POST"; ValidMethod2["DELETE"] = "DELETE"; ValidMethod2["OPTIONS"] = "OPTIONS"; ValidMethod2["HEAD"] = "HEAD"; ValidMethod2["PATCH"] = "PATCH"; return ValidMethod2; })(ValidMethod || {}); var VERSION = require_package().version; var HOMEPAGE = require_package().homepage; var DEFAULT_TITLE = "Next REST Framework"; var DEFAULT_OG_TYPE = "website"; var DEFAULT_DESCRIPTION = "This is an autogenerated documentation by Next REST Framework."; var DEFAULT_FAVICON_URL = "https://raw.githubusercontent.com/blomqma/next-rest-framework/main/docs/static/img/favicon.ico"; var DEFAULT_LOGO_URL = "https://raw.githubusercontent.com/blomqma/next-rest-framework/d02224b38d07ede85257b22ed50159a947681f99/packages/next-rest-framework/logo.svg"; // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { DEFAULT_DESCRIPTION, DEFAULT_ERRORS, DEFAULT_FAVICON_URL, DEFAULT_LOGO_URL, DEFAULT_OG_TYPE, DEFAULT_TITLE, HOMEPAGE, VERSION, ValidMethod });