UNPKG

counterfact

Version:

Generate a TypeScript-based mock server from an OpenAPI spec in seconds — with stateful routes, hot reload, and REPL support.

159 lines (158 loc) 5.43 kB
{ "name": "counterfact", "version": "2.14.0", "description": "Generate a TypeScript-based mock server from an OpenAPI spec in seconds — with stateful routes, hot reload, and REPL support.", "type": "module", "main": "./dist/app.js", "exports": { ".": { "import": "./dist/app.js", "types": "./dist/server/types.d.ts" } }, "types": "./dist/server/types.d.ts", "typesVersions": { "*": { "*": [ "dist/server/types.d.ts" ] } }, "author": "Patrick McElhaney <pmcelhaney@gmail.com>", "license": "MIT", "repository": { "type": "git", "url": "git+https://github.com/counterfact/api-simulator.git" }, "bugs": "https://github.com/counterfact/api-simulator/issues", "homepage": "https://counterfact.dev", "funding": { "type": "github", "url": "https://github.com/sponsors/pmcelhaney" }, "keywords": [ "mock", "mock-server", "openapi", "swagger", "typescript", "api", "api-mocking", "api-first", "openapi-mock", "mock-api", "dev-tools", "frontend", "backend", "prototyping", "testing", "stateful", "repl", "hot-reload", "cli", "openapi-tools", "swagger-tools" ], "engines": { "node": ">=22" }, "bin": { "counterfact": "bin/counterfact.js" }, "files": [ "bin", "dist" ], "sideEffects": false, "scripts": { "test": "yarn node --experimental-vm-modules ./node_modules/jest-cli/bin/jest --testPathIgnorePatterns=black-box", "test:black-box": "rimraf dist && yarn build && python3 -m pytest test-black-box/ -v", "test:tsd": "tsd --typings ./dist/server/counterfact-types/index.ts --files ./test/**/*.test-d.ts", "build": "rm -rf dist && tsc && copyfiles -f \"src/counterfact-types/*.ts\" dist/server/counterfact-types && copyfiles -f \"src/server/*.cjs\" dist/server", "prepack": "yarn build", "release": "npx changeset publish", "prepare": "husky install", "lint": "eslint . --plugin file-progress --rule 'file-progress/activate: 1' --ignore-pattern dist --ignore-pattern out --ignore-pattern coverage", "lint:fix": "eslint --fix . --ignore-pattern dist --ignore-pattern out --ignore-pattern coverage", "lint:quickfix": "eslint --fix . eslint --fix demo-ts --rule=\"import/namespace: 0,etc/no-deprecated:0,import/no-cycle:0,no-explicit-type-exports/no-explicit-type-exports:0,import/no-deprecated:0,import/no-self-import:0,import/default:0,import/no-named-as-default:0\" --ignore-pattern dist --ignore-pattern out", "go:petstore": "yarn build && yarn counterfact https://petstore3.swagger.io/api/v3/openapi.json out", "go:petstore2": "yarn build && yarn counterfact https://petstore.swagger.io/v2/swagger.json out", "go:example": "yarn build && node ./bin/counterfact.js ./test/fixtures/openapi/example.yaml out", "go:multiple-apis": "yarn build && node ./bin/counterfact.js --config ./test/fixtures/config/multiple-apis.yaml", "counterfact": "./bin/counterfact.js" }, "devDependencies": { "@changesets/cli": "2.31.0", "@eslint/js": "10.0.1", "@jest/globals": "30.4.1", "@swc/core": "1.15.40", "@swc/jest": "0.2.39", "@testing-library/dom": "10.4.1", "@types/debug": "4.1.13", "@types/jest": "30.0.0", "@types/js-yaml": "4.0.9", "@types/koa": "3.0.3", "@types/koa-bodyparser": "4.3.13", "@types/koa-proxy": "1.0.8", "@types/koa-static": "4.0.4", "@types/node": "22", "@typescript-eslint/eslint-plugin": "8.60.0", "@typescript-eslint/parser": "8.60.0", "copyfiles": "2.4.1", "eslint": "10.4.0", "eslint-formatter-github-annotations": "0.1.0", "eslint-import-resolver-typescript": "4.4.4", "eslint-plugin-etc": "2.0.3", "eslint-plugin-file-progress": "4.0.0", "eslint-plugin-import": "2.32.0", "eslint-plugin-jest": "29.15.2", "eslint-plugin-jest-dom": "5.5.0", "eslint-plugin-n": "18.0.1", "eslint-plugin-no-explicit-type-exports": "0.12.1", "eslint-plugin-prettier": "5.5.5", "eslint-plugin-promise": "7.3.0", "eslint-plugin-regexp": "3.1.0", "eslint-plugin-security": "4.0.0", "eslint-plugin-unused-imports": "4.4.1", "husky": "9.1.7", "jest": "30.4.2", "jest-retries": "1.0.1", "node-mocks-http": "1.17.2", "rimraf": "6.1.3", "supertest": "7.2.2", "tsd": "0.33.0", "using-temporary-files": "2.2.1" }, "dependencies": { "@apidevtools/json-schema-ref-parser": "15.3.5", "@hapi/accept": "6.0.3", "@types/json-schema": "7.0.15", "ajv": "8.20.0", "chokidar": "5.0.0", "commander": "14.0.3", "debug": "4.4.3", "fs-extra": "11.3.5", "http-terminator": "3.2.0", "js-yaml": "4.1.1", "json-schema-faker": "0.6.2", "jsonpath-plus": "10.4.0", "jsonwebtoken": "9.0.3", "koa": "3.2.1", "koa-bodyparser": "4.4.1", "koa-proxies": "0.12.4", "koa2-swagger-ui": "5.12.0", "node-fetch": "3.3.2", "open": "11.0.0", "posthog-node": "5.35.5", "precinct": "13.0.0", "prettier": "3.8.3", "recast": "0.23.11", "tsx": "4.22.3", "typescript": "6.0.3" }, "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e", "resolutions": { "js-yaml": "4.1.1", "@typescript-eslint/utils": "^8.58.0" } }