From 6346118168dd82ebc69022fb8369f642f155c312 Mon Sep 17 00:00:00 2001 From: Zane Starr Date: Thu, 12 Feb 2026 15:37:50 -0800 Subject: [PATCH 01/46] feat: wip init --- .gitignore | 2 ++ bun.lock | 25 +++++++++++++++++++++++++ index.ts | 1 + package.json | 9 +++++++++ tsconfig.json | 29 +++++++++++++++++++++++++++++ 5 files changed, 66 insertions(+) create mode 100644 bun.lock create mode 100644 index.ts create mode 100644 package.json create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 9a5aced..e539e68 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,5 @@ dist # Vite logs files vite.config.js.timestamp-* vite.config.ts.timestamp-* + +.cursor \ No newline at end of file diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..0e561c1 --- /dev/null +++ b/bun.lock @@ -0,0 +1,25 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "spec-types", + "devDependencies": { + "@types/bun": "latest", + }, + "peerDependencies": { + "typescript": "^5.9.3", + }, + }, + }, + "packages": { + "@types/bun": ["@types/bun@1.3.9", "", { "dependencies": { "bun-types": "1.3.9" } }, "sha512-KQ571yULOdWJiMH+RIWIOZ7B2RXQGpL1YQrBtLIV3FqDcCu6FsbFUBwhdKUlCKUpS3PJDsHlJ1QKlpxoVR+xtw=="], + + "@types/node": ["@types/node@25.2.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ=="], + + "bun-types": ["bun-types@1.3.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-+UBWWOakIP4Tswh0Bt0QD0alpTY8cb5hvgiYeWCMet9YukHbzuruIEeXC2D7nMJPB12kbh8C7XJykSexEqGKJg=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + + "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + } +} diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..f67b2c6 --- /dev/null +++ b/index.ts @@ -0,0 +1 @@ +console.log("Hello via Bun!"); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..f25ee55 --- /dev/null +++ b/package.json @@ -0,0 +1,9 @@ +{ + "name": "spec-types", + "module": "index.ts", + "type": "module", + "devDependencies": { + "@types/bun": "latest" + "typescript": "^5.9.3" + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bfa0fea --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + // Environment setup & latest features + "lib": ["ESNext"], + "target": "ESNext", + "module": "Preserve", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "noEmit": true, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false + } +} From 539a85b87def7b2ea6f17a8c79edc8fc65235242 Mon Sep 17 00:00:00 2001 From: Zane Starr Date: Thu, 12 Feb 2026 21:14:02 -0800 Subject: [PATCH 02/46] feat: wip init structure --- .prettierc | 12 + bun.lock | 250 ++++++++- eslintrc.mjs | 94 ++++ generated/packages/ts/1_4/index.ts | 724 ++++++++++++++++++++++++++ generated/packages/ts/legacy/index.ts | 382 ++++++++++++++ package.json | 18 +- src/index.ts | 223 ++++++++ src/util.ts | 42 ++ 8 files changed, 1740 insertions(+), 5 deletions(-) create mode 100644 .prettierc create mode 100644 eslintrc.mjs create mode 100644 generated/packages/ts/1_4/index.ts create mode 100644 generated/packages/ts/legacy/index.ts create mode 100644 src/index.ts create mode 100644 src/util.ts diff --git a/.prettierc b/.prettierc new file mode 100644 index 0000000..20133e6 --- /dev/null +++ b/.prettierc @@ -0,0 +1,12 @@ +{ + "endOfLine": "lf", + "bracketSameLine": false, + "arrowParens": "always", + "bracketSpacing": true, + "useTabs": false, + "tabWidth": 2, + "printWidth": 100, + "trailingComma": "esnext", + "singleQuote": true, + "semi": true +} \ No newline at end of file diff --git a/bun.lock b/bun.lock index 0e561c1..c070ce1 100644 --- a/bun.lock +++ b/bun.lock @@ -3,23 +3,269 @@ "workspaces": { "": { "name": "spec-types", + "dependencies": { + "@json-schema-tools/transpiler": "^1.10.5", + "eslint": "^10.0.0", + "eslint-config-prettier": "^10.1.8", + "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz", + }, "devDependencies": { + "@iarna/toml": "^2.2.5", + "@json-schema-tools/dereferencer": "^1.6.3", + "@json-schema-tools/meta-schema": "^1.8.0", "@types/bun": "latest", - }, - "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^8.55.0", + "eslint-plugin-prettier": "^5.5.5", + "prettier": "^3.8.1", "typescript": "^5.9.3", }, }, }, "packages": { + "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.9.1", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ=="], + + "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.2", "", {}, "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew=="], + + "@eslint/config-array": ["@eslint/config-array@0.23.1", "", { "dependencies": { "@eslint/object-schema": "^3.0.1", "debug": "^4.3.1", "minimatch": "^10.1.1" } }, "sha512-uVSdg/V4dfQmTjJzR0szNczjOH/J+FyUMMjYtr07xFRXR7EDf9i1qdxrD0VusZH9knj1/ecxzCQQxyic5NzAiA=="], + + "@eslint/config-helpers": ["@eslint/config-helpers@0.5.2", "", { "dependencies": { "@eslint/core": "^1.1.0" } }, "sha512-a5MxrdDXEvqnIq+LisyCX6tQMPF/dSJpCfBgBauY+pNZ28yCtSsTvyTYrMhaI+LK26bVyCJfJkT0u8KIj2i1dQ=="], + + "@eslint/core": ["@eslint/core@1.1.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw=="], + + "@eslint/object-schema": ["@eslint/object-schema@3.0.1", "", {}, "sha512-P9cq2dpr+LU8j3qbLygLcSZrl2/ds/pUpfnHNNuk5HW7mnngHs+6WSq5C9mO3rqRX8A1poxqLTC9cu0KOyJlBg=="], + + "@eslint/plugin-kit": ["@eslint/plugin-kit@0.6.0", "", { "dependencies": { "@eslint/core": "^1.1.0", "levn": "^0.4.1" } }, "sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ=="], + + "@humanfs/core": ["@humanfs/core@0.19.1", "", {}, "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA=="], + + "@humanfs/node": ["@humanfs/node@0.16.7", "", { "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.4.0" } }, "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ=="], + + "@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="], + + "@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="], + + "@iarna/toml": ["@iarna/toml@2.2.5", "", {}, "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg=="], + + "@isaacs/cliui": ["@isaacs/cliui@9.0.0", "", {}, "sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg=="], + + "@json-schema-spec/json-pointer": ["@json-schema-spec/json-pointer@0.1.2", "", {}, "sha512-BYY7IavBjwsWWSmVcMz2A9mKiDD9RvacnsItgmy1xV8cmgbtxFfKmKMtkVpD7pYtkx4mIW4800yZBXueVFIWPw=="], + + "@json-schema-tools/dereferencer": ["@json-schema-tools/dereferencer@1.6.3", "", { "dependencies": { "@json-schema-tools/reference-resolver": "^1.2.6", "@json-schema-tools/traverse": "^1.10.4", "fast-safe-stringify": "^2.1.1" } }, "sha512-NoQkj6hx9Joqbd/GZAOHSGtE6R+OzlnOcDfyidmx8e/CUv1Q+Z6/fmZo2wwCQWiwP1pnGYc95iKwp8M7XlV7wQ=="], + + "@json-schema-tools/meta-schema": ["@json-schema-tools/meta-schema@1.8.0", "", {}, "sha512-pbRAbHidPTf96LhmHXA6bl4D4tz4HrwjZ7A5ConcLFPdCj+93GhsCCFsq+AWti4VOs+9QTezX5l0zLNA+TZv1g=="], + + "@json-schema-tools/reference-resolver": ["@json-schema-tools/reference-resolver@1.2.6", "", { "dependencies": { "@json-schema-spec/json-pointer": "^0.1.2", "isomorphic-fetch": "^3.0.0" } }, "sha512-4QZu5ROb5EpLSvV+buzk8WR30W+dffSNaKqD3VGFYJ3y0BLDi2OHoSz5e6NKcLYTyUYXV8IKxocNOszeVBJI4Q=="], + + "@json-schema-tools/referencer": ["@json-schema-tools/referencer@1.1.3", "", { "dependencies": { "@json-schema-tools/traverse": "^1.10.4" } }, "sha512-p2JU7GpHn1kMyP7gnB2Wnki+OnifsSi75Uj5PxqIg2pT4fqh+BM3rEEZKpaET4xv0ZszG46CCI9eEvs68v2rXg=="], + + "@json-schema-tools/titleizer": ["@json-schema-tools/titleizer@1.0.9", "", { "dependencies": { "@json-schema-tools/traverse": "^1.10.4" } }, "sha512-Gwg3YTP5P+3Q+OnvEcthTnsup3AsEkxZCrRLXoWppdjtSzRnsWxtvmpKdGLbVcocPC7Sh3aqJ7Arp85Ii6q2GA=="], + + "@json-schema-tools/transpiler": ["@json-schema-tools/transpiler@1.10.5", "", { "dependencies": { "@json-schema-tools/referencer": "^1.1.3", "@json-schema-tools/titleizer": "^1.0.9", "@json-schema-tools/traverse": "^1.10.4", "lodash.camelcase": "^4.3.0", "lodash.deburr": "^4.1.0", "lodash.snakecase": "^4.1.1", "lodash.trim": "^4.5.1" } }, "sha512-uRm43U8wKWQV8czvvkJYwcUERpQC+azKmqbd7RhV1gWx7s1t0frLtrWqGbXh9xMcgdtF7+Tkiwex48nW5EnX1w=="], + + "@json-schema-tools/traverse": ["@json-schema-tools/traverse@1.11.0", "", {}, "sha512-GWQRiXXsbt5ZuewItpW2nqB/D0x4pKWi6XXOwoh1wvmsU/tQSq/rKzpgGvOHTe6v30TYDwZYxuwnRnArIsUzLQ=="], + + "@pkgr/core": ["@pkgr/core@0.2.9", "", {}, "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA=="], + "@types/bun": ["@types/bun@1.3.9", "", { "dependencies": { "bun-types": "1.3.9" } }, "sha512-KQ571yULOdWJiMH+RIWIOZ7B2RXQGpL1YQrBtLIV3FqDcCu6FsbFUBwhdKUlCKUpS3PJDsHlJ1QKlpxoVR+xtw=="], + "@types/esrecurse": ["@types/esrecurse@4.3.1", "", {}, "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw=="], + + "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + + "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], + "@types/node": ["@types/node@25.2.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ=="], + "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.55.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.55.0", "@typescript-eslint/type-utils": "8.55.0", "@typescript-eslint/utils": "8.55.0", "@typescript-eslint/visitor-keys": "8.55.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.55.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-1y/MVSz0NglV1ijHC8OT49mPJ4qhPYjiK08YUQVbIOyu+5k862LKUHFkpKHWu//zmr7hDR2rhwUm6gnCGNmGBQ=="], + + "@typescript-eslint/parser": ["@typescript-eslint/parser@8.55.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.55.0", "@typescript-eslint/types": "8.55.0", "@typescript-eslint/typescript-estree": "8.55.0", "@typescript-eslint/visitor-keys": "8.55.0", "debug": "^4.4.3" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-4z2nCSBfVIMnbuu8uinj+f0o4qOeggYJLbjpPHka3KH1om7e+H9yLKTYgksTaHcGco+NClhhY2vyO3HsMH1RGw=="], + + "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.55.0", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.55.0", "@typescript-eslint/types": "^8.55.0", "debug": "^4.4.3" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-zRcVVPFUYWa3kNnjaZGXSu3xkKV1zXy8M4nO/pElzQhFweb7PPtluDLQtKArEOGmjXoRjnUZ29NjOiF0eCDkcQ=="], + + "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.55.0", "", { "dependencies": { "@typescript-eslint/types": "8.55.0", "@typescript-eslint/visitor-keys": "8.55.0" } }, "sha512-fVu5Omrd3jeqeQLiB9f1YsuK/iHFOwb04bCtY4BSCLgjNbOD33ZdV6KyEqplHr+IlpgT0QTZ/iJ+wT7hvTx49Q=="], + + "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.55.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-1R9cXqY7RQd7WuqSN47PK9EDpgFUK3VqdmbYrvWJZYDd0cavROGn+74ktWBlmJ13NXUQKlZ/iAEQHI/V0kKe0Q=="], + + "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.55.0", "", { "dependencies": { "@typescript-eslint/types": "8.55.0", "@typescript-eslint/typescript-estree": "8.55.0", "@typescript-eslint/utils": "8.55.0", "debug": "^4.4.3", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-x1iH2unH4qAt6I37I2CGlsNs+B9WGxurP2uyZLRz6UJoZWDBx9cJL1xVN/FiOmHEONEg6RIufdvyT0TEYIgC5g=="], + + "@typescript-eslint/types": ["@typescript-eslint/types@8.55.0", "", {}, "sha512-ujT0Je8GI5BJWi+/mMoR0wxwVEQaxM+pi30xuMiJETlX80OPovb2p9E8ss87gnSVtYXtJoU9U1Cowcr6w2FE0w=="], + + "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.55.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.55.0", "@typescript-eslint/tsconfig-utils": "8.55.0", "@typescript-eslint/types": "8.55.0", "@typescript-eslint/visitor-keys": "8.55.0", "debug": "^4.4.3", "minimatch": "^9.0.5", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "typescript": ">=4.8.4 <6.0.0" } }, "sha512-EwrH67bSWdx/3aRQhCoxDaHM+CrZjotc2UCCpEDVqfCE+7OjKAGWNY2HsCSTEVvWH2clYQK8pdeLp42EVs+xQw=="], + + "@typescript-eslint/utils": ["@typescript-eslint/utils@8.55.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", "@typescript-eslint/scope-manager": "8.55.0", "@typescript-eslint/types": "8.55.0", "@typescript-eslint/typescript-estree": "8.55.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-BqZEsnPGdYpgyEIkDC1BadNY8oMwckftxBT+C8W0g1iKPdeqKZBtTfnvcq0nf60u7MkjFO8RBvpRGZBPw4L2ow=="], + + "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.55.0", "", { "dependencies": { "@typescript-eslint/types": "8.55.0", "eslint-visitor-keys": "^4.2.1" } }, "sha512-AxNRwEie8Nn4eFS1FzDMJWIISMGoXMb037sgCBJ3UR6o0fQTzr2tqN9WT+DkWJPhIdQCfV7T6D387566VtnCJA=="], + + "acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="], + + "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], + + "ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="], + + "balanced-match": ["balanced-match@4.0.2", "", { "dependencies": { "jackspeak": "^4.2.3" } }, "sha512-x0K50QvKQ97fdEz2kPehIerj+YTeptKF9hyYkKf6egnwmMWAkADiO0QCzSp0R5xN8FTZgYaBfSaue46Ej62nMg=="], + + "brace-expansion": ["brace-expansion@5.0.2", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-Pdk8c9poy+YhOgVWw1JNN22/HcivgKWwpxKq04M/jTmHyCZn12WPJebZxdjSa5TmBqISrUSgNYU3eRORljfCCw=="], + "bun-types": ["bun-types@1.3.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-+UBWWOakIP4Tswh0Bt0QD0alpTY8cb5hvgiYeWCMet9YukHbzuruIEeXC2D7nMJPB12kbh8C7XJykSexEqGKJg=="], + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + + "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], + + "deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="], + + "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], + + "eslint": ["eslint@10.0.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", "@eslint/config-array": "^0.23.0", "@eslint/config-helpers": "^0.5.2", "@eslint/core": "^1.1.0", "@eslint/plugin-kit": "^0.6.0", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "ajv": "^6.12.4", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^9.1.0", "eslint-visitor-keys": "^5.0.0", "espree": "^11.1.0", "esquery": "^1.7.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "minimatch": "^10.1.1", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-O0piBKY36YSJhlFSG8p9VUdPV/SxxS4FYDWVpr/9GJuMaepzwlf4J8I4ov1b+ySQfDTPhc3DtLaxcT1fN0yqCg=="], + + "eslint-config-prettier": ["eslint-config-prettier@10.1.8", "", { "peerDependencies": { "eslint": ">=7.0.0" }, "bin": { "eslint-config-prettier": "bin/cli.js" } }, "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w=="], + + "eslint-plugin-prettier": ["eslint-plugin-prettier@5.5.5", "", { "dependencies": { "prettier-linter-helpers": "^1.0.1", "synckit": "^0.11.12" }, "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", "prettier": ">=3.0.0" }, "optionalPeers": ["@types/eslint", "eslint-config-prettier"] }, "sha512-hscXkbqUZ2sPithAuLm5MXL+Wph+U7wHngPBv9OMWwlP8iaflyxpjTYZkmdgB4/vPIhemRlBEoLrH7UC1n7aUw=="], + + "eslint-scope": ["eslint-scope@9.1.0", "", { "dependencies": { "@types/esrecurse": "^4.3.1", "@types/estree": "^1.0.8", "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-CkWE42hOJsNj9FJRaoMX9waUFYhqY4jmyLFdAdzZr6VaCg3ynLYx4WnOdkaIifGfH4gsUcBTn4OZbHXkpLD0FQ=="], + + "eslint-visitor-keys": ["eslint-visitor-keys@5.0.0", "", {}, "sha512-A0XeIi7CXU7nPlfHS9loMYEKxUaONu/hTEzHTGba9Huu94Cq1hPivf+DE5erJozZOky0LfvXAyrV/tcswpLI0Q=="], + + "espree": ["espree@11.1.0", "", { "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^5.0.0" } }, "sha512-WFWYhO1fV4iYkqOOvq8FbqIhr2pYfoDY0kCotMkDeNtGpiGGkZ1iov2u8ydjtgM8yF8rzK7oaTbw2NAzbAbehw=="], + + "esquery": ["esquery@1.7.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g=="], + + "esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="], + + "estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="], + + "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], + + "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], + + "fast-diff": ["fast-diff@1.3.0", "", {}, "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw=="], + + "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], + + "fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="], + + "fast-safe-stringify": ["fast-safe-stringify@2.1.1", "", {}, "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="], + + "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + + "file-entry-cache": ["file-entry-cache@8.0.0", "", { "dependencies": { "flat-cache": "^4.0.0" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="], + + "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], + + "flat-cache": ["flat-cache@4.0.1", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" } }, "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw=="], + + "flatted": ["flatted@3.3.3", "", {}, "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg=="], + + "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], + + "ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="], + + "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], + + "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], + + "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], + + "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + + "isomorphic-fetch": ["isomorphic-fetch@3.0.0", "", { "dependencies": { "node-fetch": "^2.6.1", "whatwg-fetch": "^3.4.1" } }, "sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA=="], + + "jackspeak": ["jackspeak@4.2.3", "", { "dependencies": { "@isaacs/cliui": "^9.0.0" } }, "sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg=="], + + "json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="], + + "json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], + + "json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="], + + "keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="], + + "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], + + "locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="], + + "lodash.camelcase": ["lodash.camelcase@4.3.0", "", {}, "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA=="], + + "lodash.deburr": ["lodash.deburr@4.1.0", "", {}, "sha512-m/M1U1f3ddMCs6Hq2tAsYThTBDaAKFDX3dwDo97GEYzamXi9SqUpjWi/Rrj/gf3X2n8ktwgZrlP1z6E3v/IExQ=="], + + "lodash.snakecase": ["lodash.snakecase@4.1.1", "", {}, "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw=="], + + "lodash.trim": ["lodash.trim@4.5.1", "", {}, "sha512-nJAlRl/K+eiOehWKDzoBVrSMhK0K3A3YQsUNXHQa5yIrKBAhsZgSu3KoAFoFT+mEgiyBHddZ0pRk1ITpIp90Wg=="], + + "minimatch": ["minimatch@10.2.0", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-ugkC31VaVg9cF0DFVoADH12k6061zNZkZON+aX8AWsR9GhPcErkcMBceb6znR8wLERM2AkkOxy2nWRLpT9Jq5w=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], + + "node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="], + + "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], + + "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], + + "p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="], + + "path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="], + + "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], + + "picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], + + "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], + + "prettier": ["prettier@3.8.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="], + + "prettier-linter-helpers": ["prettier-linter-helpers@1.0.1", "", { "dependencies": { "fast-diff": "^1.1.2" } }, "sha512-SxToR7P8Y2lWmv/kTzVLC1t/GDI2WGjMwNhLLE9qtH8Q13C+aEmuRlzDst4Up4s0Wc8sF2M+J57iB3cMLqftfg=="], + + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + + "semver": ["semver@7.7.4", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA=="], + + "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], + + "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + + "synckit": ["synckit@0.11.12", "", { "dependencies": { "@pkgr/core": "^0.2.9" } }, "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ=="], + + "test-open-rpc-spec": ["test-open-rpc-spec@test-open-rpc-spec-1.3.2.tgz", {}], + + "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], + + "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="], + + "ts-api-utils": ["ts-api-utils@2.4.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-3TaVTaAv2gTiMB35i3FiGJaRfwb3Pyn/j3m/bfAvGe8FB7CF6u+LMYqYlDh7reQf7UNvoTvdfAqHGmPGOSsPmA=="], + + "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + + "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], + + "webidl-conversions": ["webidl-conversions@3.0.1", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="], + + "whatwg-fetch": ["whatwg-fetch@3.6.20", "", {}, "sha512-EqhiFU6daOA8kpjOWTL0olhVOF3i7OrFzSYiGsEMB8GcXS+RrzauAERX65xMeNWVqxA6HXH2m69Z9LaKKdisfg=="], + + "whatwg-url": ["whatwg-url@5.0.0", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="], + + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + + "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], + + "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], + + "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], + + "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + + "@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@4.2.1", "", {}, "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ=="], + + "eslint/ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], + + "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + + "@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], } } diff --git a/eslintrc.mjs b/eslintrc.mjs new file mode 100644 index 0000000..e603c27 --- /dev/null +++ b/eslintrc.mjs @@ -0,0 +1,94 @@ +import eslint from '@eslint/js'; +import tseslint from '@typescript-eslint/eslint-plugin'; +import tsParser from '@typescript-eslint/parser'; +import prettierConfig from 'eslint-config-prettier'; +import prettierPlugin from 'eslint-plugin-prettier'; +import { fileURLToPath } from 'url'; +import { dirname } from 'path'; +import globals from "globals"; + + +const __filename = fileURLToPath(import.meta.url); +const __dirname = dirname(__filename); + +export default [ + eslint.configs.recommended, + // Add ignores as a separate config object + { + ignores: [ + "package.json", + "node_modules/", + "**/dist/", + "dist/", + "docs/", // This will now work + "build/", + "coverage/", + "*.config.js", + "**/*.config.ts", + "vitest.config.ts", + "vite.config.ts", + "build.ts" // Add this + + ] + }, + { + files: ['**/*.{ts,tsx}'], + languageOptions: { + parser: tsParser, + parserOptions: { + project: ['./tsconfig.json'], + tsconfigRootDir: __dirname, + ecmaVersion: 2022, + sourceType: 'module', + ecmaFeatures: { + jsx: true + } + }, + globals: { + ...globals.browser, + ...globals.node, + ...globals.es6, + chrome: 'readonly', + browser: 'readonly' + } + }, + plugins: { + '@typescript-eslint': tseslint, + 'prettier': prettierPlugin + }, + rules: { + ...tseslint.configs['recommended'].rules, + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + 'no-console': ['warn', { allow: ['warn', 'error'] }], + 'prettier/prettier': 'error' + }, + settings: { } + }, + // Jest test files configuration + { + files: ['**/*.test.{ts,tsx}', '**/*.spec.{ts,tsx}'], + languageOptions: { + globals: { + ...globals.jest, + ...globals.browser, + ...globals.node, + ...globals.es6, + window: 'readonly', + document: 'readonly', + navigator: 'readonly', + console: 'readonly', + localStorage: 'readonly', + sessionStorage: 'readonly', + fetch: 'readonly', + FormData: 'readonly', + URLSearchParams: 'readonly', + chrome: 'readonly', + browser: 'readonly' + } + } + }, + prettierConfig +]; \ No newline at end of file diff --git a/generated/packages/ts/1_4/index.ts b/generated/packages/ts/1_4/index.ts new file mode 100644 index 0000000..2838073 --- /dev/null +++ b/generated/packages/ts/1_4/index.ts @@ -0,0 +1,724 @@ +/** + * + * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. + * + */ +export type Openrpc = string; +/** + * + * The title of the application. + * + */ +export type InfoObjectTitle = string; +/** + * + * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type InfoObjectDescription = string; +/** + * + * A URL to the Terms of Service for the API. MUST be in the format of a URL. + * + */ +export type InfoObjectTermsOfService = string; +/** + * + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * + */ +export type InfoObjectVersion = string; +/** + * + * The identifying name of the contact person/organization. + * + */ +export type ContactObjectName = string; +/** + * + * The email address of the contact person/organization. MUST be in the format of an email address. + * + */ +export type ContactObjectEmail = string; +/** + * + * The URL pointing to the contact information. MUST be in the format of a URL. + * + */ +export type ContactObjectUrl = string; +/** + * + * This object MAY be extended with [Specification Extensions](#specification-extensions). + * + */ +export type SpecificationExtension = any; +/** + * + * Contact information for the exposed API. + * + */ +export interface ContactObject { + name?: ContactObjectName; + email?: ContactObjectEmail; + url?: ContactObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The license name used for the API. + * + */ +export type LicenseObjectName = string; +/** + * + * A URL to the license used for the API. MUST be in the format of a URL. + * + */ +export type LicenseObjectUrl = string; +/** + * + * License information for the exposed API. + * + */ +export interface LicenseObject { + name?: LicenseObjectName; + url?: LicenseObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. + * + */ +export type InfoObject = any; +/** + * + * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExternalDocumentationObjectDescription = string; +/** + * + * The URL for the target documentation. Value MUST be in the format of a URL. + * + */ +export type ExternalDocumentationObjectUrl = string; +/** + * + * Additional external documentation for this tag. + * + */ +export interface ExternalDocumentationObject { + description?: ExternalDocumentationObjectDescription; + url: ExternalDocumentationObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export type ServerObjectUrl = string; +/** + * + * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectName = string; +/** + * + * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectDescription = string; +/** + * + * A short summary of what the server is. + * + */ +export type ServerObjectSummary = string; +/** + * + * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. + * + */ +export type ServerObjectVariableDefault = string; +/** + * + * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectVariableDescription = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnumItem = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +/** + * + * An object representing a Server Variable for server URL template substitution. + * + */ +export interface ServerObjectVariable { + default: ServerObjectVariableDefault; + description?: ServerObjectVariableDescription; + enum?: ServerObjectVariableEnum; + [k: string]: any; +} +/** + * + * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export interface ServerObjectVariables { [key: string]: any; } +/** + * + * A object representing a Server + * + */ +export interface ServerObject { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +type AlwaysFalse = any; +/** + * + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * + */ +export type Servers = ServerObject[]; +/** + * + * The cannonical name for the method. The name MUST be unique within the methods array. + * + */ +export type MethodObjectName = string; +/** + * + * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. + * + */ +export type MethodObjectDescription = string; +/** + * + * A short summary of what the method does. + * + */ +export type MethodObjectSummary = string; +/** + * + * The name of the tag. + * + */ +export type TagObjectName = string; +/** + * + * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type TagObjectDescription = string; +/** + * + * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. + * + */ +export interface TagObject { + name: TagObjectName; + description?: TagObjectDescription; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type $Ref = string; +export interface ReferenceObject { + $ref: $Ref; +} +export type TagOrReference = TagObject | ReferenceObject; +/** + * + * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. + * + */ +export type MethodObjectTags = TagOrReference[]; +/** + * + * Format the server expects the params. Defaults to 'either'. + * + * @default either + * + */ +export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +/** + * + * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). + * + */ +export type ContentDescriptorObjectName = string; +/** + * + * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ContentDescriptorObjectDescription = string; +/** + * + * A short summary of the content that is being described. + * + */ +export type ContentDescriptorObjectSummary = string; +export type $Id = string; +export type $Schema = string; +export type $Comment = string; +export type Title = string; +export type Description = string; +type AlwaysTrue = any; +export type ReadOnly = boolean; +export type Examples = AlwaysTrue[]; +export type MultipleOf = number; +export type Maximum = number; +export type ExclusiveMaximum = number; +export type Minimum = number; +export type ExclusiveMinimum = number; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefaultZero = number; +export type Pattern = string; +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; +export type SchemaArray = JSONSchema[]; +/** + * + * @default true + * + */ +export type Items = JSONSchema | SchemaArray; +export type UniqueItems = boolean; +export type StringDoaGddGA = string; +/** + * + * @default [] + * + */ +export type StringArray = StringDoaGddGA[]; +/** + * + * @default {} + * + */ +export interface Definitions { [key: string]: any; } +/** + * + * @default {} + * + */ +export interface Properties { [key: string]: any; } +export type PropertyNames = any; +/** + * + * @default {} + * + */ +export interface PatternProperties { [key: string]: any; } +export type DependenciesSet = JSONSchema | StringArray; +export interface Dependencies { [key: string]: any; } +export type Enum = AlwaysTrue[]; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type ArrayOfSimpleTypes = SimpleTypes[]; +export type Type = SimpleTypes | ArrayOfSimpleTypes; +export type Format = string; +export type ContentMediaType = string; +export type ContentEncoding = string; +export interface JSONSchemaObject { + $id?: $Id; + $schema?: $Schema; + $ref?: $Ref; + $comment?: $Comment; + title?: Title; + description?: Description; + default?: AlwaysTrue; + readOnly?: ReadOnly; + examples?: Examples; + multipleOf?: MultipleOf; + maximum?: Maximum; + exclusiveMaximum?: ExclusiveMaximum; + minimum?: Minimum; + exclusiveMinimum?: ExclusiveMinimum; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefaultZero; + pattern?: Pattern; + additionalItems?: JSONSchema; + items?: Items; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefaultZero; + uniqueItems?: UniqueItems; + contains?: JSONSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefaultZero; + required?: StringArray; + additionalProperties?: JSONSchema; + definitions?: Definitions; + properties?: Properties; + patternProperties?: PatternProperties; + dependencies?: Dependencies; + propertyNames?: JSONSchema; + const?: AlwaysTrue; + enum?: Enum; + type?: Type; + format?: Format; + contentMediaType?: ContentMediaType; + contentEncoding?: ContentEncoding; + if?: JSONSchema; + then?: JSONSchema; + else?: JSONSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JSONSchema; + [k: string]: any; +} +/** + * + * Schema that describes the content. + * + * @default {} + * + */ +export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; +/** + * + * Determines if the content is a required field. Default value is `false`. + * + */ +export type ContentDescriptorObjectRequired = boolean; +/** + * + * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. + * + */ +export type ContentDescriptorObjectDeprecated = boolean; +/** + * + * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. + * + */ +export interface ContentDescriptorObject { + name: ContentDescriptorObjectName; + description?: ContentDescriptorObjectDescription; + summary?: ContentDescriptorObjectSummary; + schema: ContentDescriptorObjectSchema; + required?: ContentDescriptorObjectRequired; + deprecated?: ContentDescriptorObjectDeprecated; + [regex: string]: SpecificationExtension | any; +} +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +/** + * + * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. + * + */ +export type MethodObjectParams = ContentDescriptorOrReference[]; +/** + * + * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) + * + */ +export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; +/** + * + * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. + * + */ +export type ErrorObjectCode = number; +/** + * + * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. + * + */ +export type ErrorObjectMessage = string; +/** + * + * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). + * + */ +export type ErrorObjectData = any; +/** + * + * Defines an application level error. + * + */ +export interface ErrorObject { + code: ErrorObjectCode; + message: ErrorObjectMessage; + data?: ErrorObjectData; +} +export type ErrorOrReference = ErrorObject | ReferenceObject; +/** + * + * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. + * + */ +export type MethodObjectErrors = ErrorOrReference[]; +/** + * + * Cannonical name of the link. + * + */ +export type LinkObjectName = any; +/** + * + * Short description for the link. + * + */ +export type LinkObjectSummary = string; +/** + * + * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. + * + */ +export type LinkObjectMethod = string; +/** + * + * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type LinkObjectDescription = string; +/** + * + * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. + * + */ +export type LinkObjectParams = any; +/** + * + * A server object to be used by the target method. + * + */ +export interface LinkObjectServer { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A object representing a Link + * + */ +export type LinkObject = any; +export type LinkOrReference = LinkObject | ReferenceObject; +/** + * + * A list of possible links from this method call. + * + */ +export type MethodObjectLinks = LinkOrReference[]; +/** + * + * Name for the example pairing. + * + */ +export type ExamplePairingObjectName = string; +/** + * + * A verbose explanation of the example pairing. + * + */ +export type ExamplePairingObjectDescription = string; +/** + * + * Short description for the example. + * + */ +export type ExampleObjectSummary = string; +/** + * + * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. + * + */ +export type ExampleObjectValue = any; +/** + * + * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExampleObjectDescription = string; +/** + * + * Cannonical name of the example. + * + */ +export type ExampleObjectName = string; +/** + * + * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). + * + */ +export interface ExampleObject { + summary?: ExampleObjectSummary; + value: ExampleObjectValue; + description?: ExampleObjectDescription; + name: ExampleObjectName; + [regex: string]: SpecificationExtension | any; +} +export type ExampleOrReference = ExampleObject | ReferenceObject; +/** + * + * Example parameters. + * + */ +export type ExamplePairingObjectParams = ExampleOrReference[]; +/** + * + * Example result. When not provided, the example pairing represents usage of the method as a notification. + * + */ +export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +/** + * + * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. + * + */ +export interface ExamplePairingObject { + name: ExamplePairingObjectName; + description?: ExamplePairingObjectDescription; + params: ExamplePairingObjectParams; + result?: ExamplePairingObjectResult; + [k: string]: any; +} +export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +/** + * + * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. + * + */ +export type MethodObjectExamples = ExamplePairingOrReference[]; +/** + * + * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. + * + */ +export type MethodObjectDeprecated = boolean; +/** + * + * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. + * + */ +export interface MethodObject { + name: MethodObjectName; + description?: MethodObjectDescription; + summary?: MethodObjectSummary; + servers?: Servers; + tags?: MethodObjectTags; + paramStructure?: MethodObjectParamStructure; + params: MethodObjectParams; + result?: MethodObjectResult; + errors?: MethodObjectErrors; + links?: MethodObjectLinks; + examples?: MethodObjectExamples; + deprecated?: MethodObjectDeprecated; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type MethodOrReference = MethodObject | ReferenceObject; +/** + * + * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). + * + */ +export type Methods = MethodOrReference[]; +/** + * + * An object to hold reusable [Schema Objects](#schema-object). + * + */ +export interface SchemaComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Link Objects](#link-object). + * + */ +export interface LinkComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Error Objects](#error-object). + * + */ +export interface ErrorComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Example Objects](#example-object). + * + */ +export interface ExampleComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Example Pairing Objects](#example-pairing-object). + * + */ +export interface ExamplePairingComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). + * + */ +export interface ContentDescriptorComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Tag Objects](#tag-object). + * + */ +export interface TagComponents { [key: string]: any; } +/** + * + * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. + * + */ +export interface Components { + schemas?: SchemaComponents; + links?: LinkComponents; + errors?: ErrorComponents; + examples?: ExampleComponents; + examplePairings?: ExamplePairingComponents; + contentDescriptors?: ContentDescriptorComponents; + tags?: TagComponents; + [k: string]: any; +} +/** + * + * JSON Schema URI (used by some editors) + * + * @default https://meta.open-rpc.org/ + * + */ +export type MetaSchema = string; +export interface OpenrpcDocument { + openrpc: Openrpc; + info: InfoObject; + externalDocs?: ExternalDocumentationObject; + servers?: Servers; + methods: Methods; + components?: Components; + $schema?: MetaSchema; + [regex: string]: SpecificationExtension | any; +} \ No newline at end of file diff --git a/generated/packages/ts/legacy/index.ts b/generated/packages/ts/legacy/index.ts new file mode 100644 index 0000000..39e6c36 --- /dev/null +++ b/generated/packages/ts/legacy/index.ts @@ -0,0 +1,382 @@ +export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.0" | "1.1.0" | "1.0.0" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc0" | "1.0.0-rc1"; +export type InfoObjectProperties = string; +export type InfoObjectDescription = string; +export type InfoObjectTermsOfService = string; +export type InfoObjectVersion = string; +export type ContactObjectName = string; +export type ContactObjectEmail = string; +export type ContactObjectUrl = string; +export type SpecificationExtension = any; +export interface ContactObject { + name?: ContactObjectName; + email?: ContactObjectEmail; + url?: ContactObjectUrl; + [regex: string]: SpecificationExtension | any; +} +export type LicenseObjectName = string; +export type LicenseObjectUrl = string; +export interface LicenseObject { + name?: LicenseObjectName; + url?: LicenseObjectUrl; + [regex: string]: SpecificationExtension | any; +} +export interface InfoObject { + title: InfoObjectProperties; + description?: InfoObjectDescription; + termsOfService?: InfoObjectTermsOfService; + version: InfoObjectVersion; + contact?: ContactObject; + license?: LicenseObject; + [regex: string]: SpecificationExtension | any; +} +export type ExternalDocumentationObjectDescription = string; +export type ExternalDocumentationObjectUrl = string; +/** + * + * information about external documentation + * + */ +export interface ExternalDocumentationObject { + description?: ExternalDocumentationObjectDescription; + url: ExternalDocumentationObjectUrl; + [regex: string]: SpecificationExtension | any; +} +export type ServerObjectUrl = string; +export type ServerObjectName = string; +export type ServerObjectDescription = string; +export type ServerObjectSummary = string; +export type ServerObjectVariableDefault = string; +export type ServerObjectVariableDescription = string; +export type ServerObjectVariableEnumItem = string; +export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +export interface ServerObjectVariable { + default: ServerObjectVariableDefault; + description?: ServerObjectVariableDescription; + enum?: ServerObjectVariableEnum; + [k: string]: any; +} +export interface ServerObjectVariables { [key: string]: any; } +export interface ServerObject { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +type AlwaysFalse = any; +export type Servers = ServerObject[]; +/** + * + * The cannonical name for the method. The name MUST be unique within the methods array. + * + */ +export type MethodObjectName = string; +/** + * + * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. + * + */ +export type MethodObjectDescription = string; +/** + * + * A short summary of what the method does. + * + */ +export type MethodObjectSummary = string; +export type TagObjectName = string; +export type TagObjectDescription = string; +export interface TagObject { + name: TagObjectName; + description?: TagObjectDescription; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type $Ref = string; +export interface ReferenceObject { + $ref: $Ref; +} +export type TagOrReference = TagObject | ReferenceObject; +export type MethodObjectTags = TagOrReference[]; +/** + * + * Format the server expects the params. Defaults to 'either'. + * + * @default either + * + */ +export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +export type ContentDescriptorObjectName = string; +export type ContentDescriptorObjectDescription = string; +export type ContentDescriptorObjectSummary = string; +export type $Id = string; +export type $Schema = string; +export type $Comment = string; +export type Title = string; +export type Description = string; +type AlwaysTrue = any; +export type ReadOnly = boolean; +export type Examples = AlwaysTrue[]; +export type MultipleOf = number; +export type Maximum = number; +export type ExclusiveMaximum = number; +export type Minimum = number; +export type ExclusiveMinimum = number; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefaultZero = number; +export type Pattern = string; +export type SchemaArray = JSONSchema[]; +/** + * + * @default true + * + */ +export type Items = JSONSchema | SchemaArray; +export type UniqueItems = boolean; +export type StringDoaGddGA = string; +/** + * + * @default [] + * + */ +export type StringArray = StringDoaGddGA[]; +/** + * + * @default {} + * + */ +export interface Definitions { [key: string]: any; } +/** + * + * @default {} + * + */ +export interface Properties { [key: string]: any; } +export type PropertyNames = any; +/** + * + * @default {} + * + */ +export interface PatternProperties { [key: string]: any; } +export type DependenciesSet = JSONSchema | StringArray; +export interface Dependencies { [key: string]: any; } +export type Enum = AlwaysTrue[]; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type ArrayOfSimpleTypes = SimpleTypes[]; +export type Type = SimpleTypes | ArrayOfSimpleTypes; +export type Format = string; +export type ContentMediaType = string; +export type ContentEncoding = string; +export interface JSONSchemaObject { + $id?: $Id; + $schema?: $Schema; + $ref?: $Ref; + $comment?: $Comment; + title?: Title; + description?: Description; + default?: AlwaysTrue; + readOnly?: ReadOnly; + examples?: Examples; + multipleOf?: MultipleOf; + maximum?: Maximum; + exclusiveMaximum?: ExclusiveMaximum; + minimum?: Minimum; + exclusiveMinimum?: ExclusiveMinimum; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefaultZero; + pattern?: Pattern; + additionalItems?: JSONSchema; + items?: Items; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefaultZero; + uniqueItems?: UniqueItems; + contains?: JSONSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefaultZero; + required?: StringArray; + additionalProperties?: JSONSchema; + definitions?: Definitions; + properties?: Properties; + patternProperties?: PatternProperties; + dependencies?: Dependencies; + propertyNames?: JSONSchema; + const?: AlwaysTrue; + enum?: Enum; + type?: Type; + format?: Format; + contentMediaType?: ContentMediaType; + contentEncoding?: ContentEncoding; + if?: JSONSchema; + then?: JSONSchema; + else?: JSONSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JSONSchema; + [k: string]: any; +} +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; +export type ContentDescriptorObjectRequired = boolean; +export type ContentDescriptorObjectDeprecated = boolean; +export interface ContentDescriptorObject { + name: ContentDescriptorObjectName; + description?: ContentDescriptorObjectDescription; + summary?: ContentDescriptorObjectSummary; + schema: JSONSchema; + required?: ContentDescriptorObjectRequired; + deprecated?: ContentDescriptorObjectDeprecated; + [regex: string]: SpecificationExtension | any; +} +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +export type MethodObjectParams = ContentDescriptorOrReference[]; +export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; +/** + * + * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. + * + */ +export type ErrorObjectCode = number; +/** + * + * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. + * + */ +export type ErrorObjectMessage = string; +/** + * + * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). + * + */ +export type ErrorObjectData = any; +/** + * + * Defines an application level error. + * + */ +export interface ErrorObject { + code: ErrorObjectCode; + message: ErrorObjectMessage; + data?: ErrorObjectData; +} +export type ErrorOrReference = ErrorObject | ReferenceObject; +/** + * + * Defines an application level error. + * + */ +export type MethodObjectErrors = ErrorOrReference[]; +export type LinkObjectName = string; +export type LinkObjectSummary = string; +export type LinkObjectMethod = string; +export type LinkObjectDescription = string; +export type LinkObjectParams = any; +export interface LinkObjectServer { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +export interface LinkObject { + name?: LinkObjectName; + summary?: LinkObjectSummary; + method?: LinkObjectMethod; + description?: LinkObjectDescription; + params?: LinkObjectParams; + server?: LinkObjectServer; + [regex: string]: SpecificationExtension | any; +} +export type LinkOrReference = LinkObject | ReferenceObject; +export type MethodObjectLinks = LinkOrReference[]; +export type ExamplePairingObjectName = string; +export type ExamplePairingObjectDescription = string; +export type ExampleObjectSummary = string; +export type ExampleObjectValue = any; +export type ExampleObjectDescription = string; +export type ExampleObjectName = string; +export interface ExampleObject { + summary?: ExampleObjectSummary; + value: ExampleObjectValue; + description?: ExampleObjectDescription; + name: ExampleObjectName; + [regex: string]: SpecificationExtension | any; +} +export type ExampleOrReference = ExampleObject | ReferenceObject; +export type ExamplePairingObjectParams = ExampleOrReference[]; +export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +export interface ExamplePairingObject { + name: ExamplePairingObjectName; + description?: ExamplePairingObjectDescription; + params: ExamplePairingObjectParams; + result?: ExamplePairingObjectResult; + [k: string]: any; +} +export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +export type MethodObjectExamples = ExamplePairingOrReference[]; +export type MethodObjectDeprecated = boolean; +export interface MethodObject { + name: MethodObjectName; + description?: MethodObjectDescription; + summary?: MethodObjectSummary; + servers?: Servers; + tags?: MethodObjectTags; + paramStructure?: MethodObjectParamStructure; + params: MethodObjectParams; + result?: MethodObjectResult; + errors?: MethodObjectErrors; + links?: MethodObjectLinks; + examples?: MethodObjectExamples; + deprecated?: MethodObjectDeprecated; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type MethodOrReference = MethodObject | ReferenceObject; +export type Methods = MethodOrReference[]; +export interface SchemaComponents { [key: string]: any; } +export interface LinkComponents { [key: string]: any; } +export interface ErrorComponents { [key: string]: any; } +export interface ExampleComponents { [key: string]: any; } +export interface ExamplePairingComponents { [key: string]: any; } +export interface ContentDescriptorComponents { [key: string]: any; } +export interface TagComponents { [key: string]: any; } +export interface Components { + schemas?: SchemaComponents; + links?: LinkComponents; + errors?: ErrorComponents; + examples?: ExampleComponents; + examplePairings?: ExamplePairingComponents; + contentDescriptors?: ContentDescriptorComponents; + tags?: TagComponents; + [k: string]: any; +} +/** + * + * JSON Schema URI (used by some editors) + * + * @default https://meta.open-rpc.org/ + * + */ +export type MetaSchema = string; +export interface OpenrpcDocument { + openrpc: Openrpc; + info: InfoObject; + externalDocs?: ExternalDocumentationObject; + servers?: Servers; + methods: Methods; + components?: Components; + $schema?: MetaSchema; + [regex: string]: SpecificationExtension | any; +} \ No newline at end of file diff --git a/package.json b/package.json index f25ee55..8dc839e 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,19 @@ "module": "index.ts", "type": "module", "devDependencies": { - "@types/bun": "latest" - "typescript": "^5.9.3" + "@iarna/toml": "^2.2.5", + "@json-schema-tools/dereferencer": "^1.6.3", + "@json-schema-tools/meta-schema": "^1.8.0", + "@types/bun": "latest", + "@typescript-eslint/eslint-plugin": "^8.55.0", + "eslint-plugin-prettier": "^5.5.5", + "prettier": "^3.8.1", + "typescript": "^5.9.3" + }, + "dependencies": { + "@json-schema-tools/transpiler": "^1.10.5", + "eslint": "^10.0.0", + "eslint-config-prettier": "^10.1.8", + "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz" } -} +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..7d3f94a --- /dev/null +++ b/src/index.ts @@ -0,0 +1,223 @@ +import * as path from "path"; +import Transpiler from "@json-schema-tools/transpiler"; +import { compileTypescript, StringUtils } from "./util"; +import * as fs from "fs"; +import { promisify } from "util"; +import type { JSONSchemaObject } from "@json-schema-tools/meta-schema"; +import Dereferencer from "@json-schema-tools/dereferencer"; +import toml from "@iarna/toml"; +import {getAllSchemas} from "test-open-rpc-spec" + +const readFile = promisify(fs.readFile); +const writeFile = promisify(fs.writeFile); +const mkdir = promisify(fs.mkdir); + +import ts from "typescript"; +import { config } from "process"; + +let transpilerCache: Record = {}; +interface GetTranspiler { + (name: string): Transpiler +} + +const buildTranspilerCache = async (schemas: Record): Promise => { + const cache: Record = {}; + for(const [name, schema] of Object.entries(schemas)) { + try { + const dereffer = new Dereferencer(JSON.parse(JSON.stringify(schema))); + const dereffedSchema = await dereffer.resolve(); + cache[name] = new Transpiler(dereffedSchema); + }catch(e: any) { + throw new Error(`Failed to get transpiler for ${name}: ${e.message}`); + } + } + return (name: string) => { + const transpiler = cache[name]; + if(!transpiler) { + throw new Error(`Transpiler for ${name} not found`); + } + return transpiler; + } +} + +type Op = + | { + "type": "write"; path: string; content: string; + } + | { + "type": "mkdir"; path: string; + } + | { + "type": "compile"; fileNames: string[]; options: ts.CompilerOptions | any, lang: "ts" | "go" | "rs" | "py"; + } + + + +const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , outpath: string): Op[] => { + const ops: Op[] = [{ type: "mkdir", path: outpath }] + + return ops.concat(schemasNames.flatMap((name) => { + return [ + { type: "mkdir", path: `${outpath}/${name}` }, + { type: "write", path: `${outpath}/${name}/index.ts`, content: getTranspiler(name).toTs() } + ]; + })).concat([ + { type: "compile", fileNames: [outpath], options: { + target: ts.ScriptTarget.ES2022, + module: ts.ModuleKind.ES2022, + lib: ["lib.es2022.d.ts"], + moduleResolution: ts.ModuleResolutionKind.Bundler, + declaration: true, + outDir: outpath, + strict: true, + }, lang: "ts" } + ]); +} + +// Interpreter does the actual work +const execute = async (ops: Op[]) => { + for (const op of ops) { + switch (op.type) { + case "write": await writeFile(op.path, op.content); break; + case "mkdir": await mkdir(op.path, { recursive: true }); break; + case "compile": { + switch (op.lang) { + case "ts": compileTypescript(op.fileNames, op.options as ts.CompilerOptions); break; + default: throw new Error(`Unsupported language: ${op.lang}`); + } + } + } + } +}; + +const run = async () => { + + const getTranspiler = await buildTranspilerCache(getAllSchemas()); + const ops = generateTsOp(getTranspiler, Object.keys(getAllSchemas()), "./generated/packages/ts"); + await execute(ops); +} + +run() + +const generateTs = async (transpiler: Transpiler, schema: JSONSchemaObject, outpath: string): Promise => { + const indexTS = `${outpath}/src/index.ts`; + const regularName = StringUtils.camelCase(schema.title); + const tsCode = [ + `export const ${regularName} = ${JSON.stringify(schema)};`, + `export default ${regularName}` + ].join("\n"); + await writeFile(indexTS, tsCode); + const program = ts.createProgram([indexTS, `${outpath}/src/schema.json`], { + target: ts.ScriptTarget.ES2022, + module: ts.ModuleKind.ES2022, + lib: ["lib.es2022.d.ts"], + moduleResolution: ts.ModuleResolutionKind.Bundler, + declaration: true, + outDir: outpath, + strict: true, + esModuleInterop: true, + resolveJsonModule: true, + }); + const emitResult = program.emit(); + const diagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); + if (diagnostics.length > 0) { + const msg = ts.formatDiagnosticsWithColorAndContext(diagnostics, { + getCanonicalFileName: (f) => f, + getCurrentDirectory: ts.sys.getCurrentDirectory, + getNewLine: () => ts.sys.newLine, + }); + throw new Error(msg); + } + await writeFile(`${outpath}/index.d.ts`, transpiler.toTs()); + return true; +} + +const generateGo = async (transpiler: Transpiler, schema: JSONSchemaObject, outpath: string): Promise => { + const packageName = StringUtils.snakeCase(schema.title); + const exportName = `Raw${StringUtils.upperFirst(packageName)}`; + const escapedS = JSON.stringify(schema).replace(/"/g, "\\\""); + + const go = [ + `package ${packageName}`, + "", + "", + transpiler.toGo(), + "", + `const ${exportName} = "${escapedS}"`, + ].join("\n"); + + await writeFile(`${outpath}/${packageName}.go`, go); + return true; +} + +const generateRs = async (transpiler: Transpiler, schema: JSONSchemaObject, outpath: string, version: string): Promise => { + const crateName = StringUtils.snakeCase(schema.title); + + let cargotoml; + + try { + cargotoml = toml.parse(await readFile("${outpath}/Cargo.toml", "utf8")); + cargotoml.version = version; + } catch (e) { + cargotoml = { + package: { + name: crateName, + version, + description: "Generated types based on the JSON-Schema for " + crateName, + license: "Apache-2.0" + }, + dependencies: { + serde: { version: "1.0", features: ["derive"] }, + serde_json: "1.0", // eslint-disable-line + derive_builder: "0.10" // eslint-disable-line + } + } + } + + await writeFile(`${outpath}/Cargo.toml`, toml.stringify(cargotoml)); + await writeFile(`${outpath}/src/lib.rs`, transpiler.toRs()); + + return true; +}; + +export const prepare = async (): Promise => { + + const outpath = pluginConfig.outpath || process.cwd(); + await mkdir(`./${outpath}/src`, { recursive: true }); + + const schemaPath = path.resolve(process.cwd(), pluginConfig.schemaLocation); + + const schemaString = await readFile(schemaPath, "utf8"); + const schema = JSON.parse(schemaString); + + await writeFile(`${outpath}/src/schema.json`, schemaString); + + if (!schema.title) { + throw new Error("The schema must have a title", "ENOTITLE", "Schema requires a title"); + } + + let dereffedSchema; + try { + const dereffer = new Dereferencer(JSON.parse(JSON.stringify(schema))); + dereffedSchema = await dereffer.resolve(); + } catch (e: any) { + throw new Error(e.message); + } + + const transpiler = new Transpiler(dereffedSchema); + + if (config.languages?.ts) { + await generateTs(transpiler, schema, outpath); + } + if (config.languages?.go) { + await generateGo(transpiler, schema, outpath); + } + if (config.languages?.rs) { + await generateRs(transpiler, schema, outpath, context.nextRelease.version) + } + if (config.languages?.py) { + await writeFile(`${outpath}/index.py`, transpiler.toPy()); + } + + return true; +} \ No newline at end of file diff --git a/src/util.ts b/src/util.ts new file mode 100644 index 0000000..fc6ce96 --- /dev/null +++ b/src/util.ts @@ -0,0 +1,42 @@ +import * as ts from 'typescript'; + +export const StringUtils = { + upperFirst: (str?: string): string => + str ? str.charAt(0).toUpperCase() + str.slice(1) : '', + + camelCase: (str?: string): string => + str ? str + .toLowerCase() + .replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase()) : '', + + snakeCase: (str?: string): string => + str ? str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)! + .map((x: string) => x.toLowerCase()) + .join('_') : '' +}; + + + +export const compileTypescript = (fileNames: string[], options: ts.CompilerOptions): void => { + const program = ts.createProgram(fileNames, options); + const emitResult = program.emit(); + + const allDiagnostics = ts + .getPreEmitDiagnostics(program) + .concat(emitResult.diagnostics); + + allDiagnostics.forEach(diagnostic => { + const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + console.log(`${diagnostic.file?.fileName}: ${message}`); + }); +} + +// Usage +/* +compile(['src/index.ts'], { + noEmitOnError: true, + target: ts.ScriptTarget.ESNext, + module: ts.ModuleKind.CommonJS, + outDir: './dist' +}); +*/ \ No newline at end of file From e34838f1a25bb4486c628e1be6daf2acb6abe463 Mon Sep 17 00:00:00 2001 From: Zane Starr Date: Fri, 13 Feb 2026 12:04:58 -0800 Subject: [PATCH 03/46] fix: wip add index.ts --- generated/packages/ts/index.ts | 4 +++ index.ts | 1 - src/index.ts | 47 +++++++++++++++++++++++++++++----- 3 files changed, 44 insertions(+), 8 deletions(-) create mode 100644 generated/packages/ts/index.ts delete mode 100644 index.ts diff --git a/generated/packages/ts/index.ts b/generated/packages/ts/index.ts new file mode 100644 index 0000000..53c41bc --- /dev/null +++ b/generated/packages/ts/index.ts @@ -0,0 +1,4 @@ +import type * as V1_4 from "./1_4/index.ts"; +import type * as Legacy from "./legacy/index.ts"; + +export type { V1_4, Legacy } \ No newline at end of file diff --git a/index.ts b/index.ts deleted file mode 100644 index f67b2c6..0000000 --- a/index.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello via Bun!"); \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 7d3f94a..b7acfb3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,12 @@ import * as path from "path"; import Transpiler from "@json-schema-tools/transpiler"; import { compileTypescript, StringUtils } from "./util"; -import * as fs from "fs"; -import { promisify } from "util"; +import {readFile, writeFile, mkdir} from "fs/promises"; import type { JSONSchemaObject } from "@json-schema-tools/meta-schema"; import Dereferencer from "@json-schema-tools/dereferencer"; import toml from "@iarna/toml"; import {getAllSchemas} from "test-open-rpc-spec" -const readFile = promisify(fs.readFile); -const writeFile = promisify(fs.writeFile); -const mkdir = promisify(fs.mkdir); import ts from "typescript"; import { config } from "process"; @@ -19,6 +15,23 @@ let transpilerCache: Record = {}; interface GetTranspiler { (name: string): Transpiler } +// Programatically construct all the assets tomls pyprojects generate them +// then we will use Knope to have the changesets and versions propogated and committed +// this will then allow us to have nice generated assets that can be used in the spec like changesets + +const packageJson = { + name: "spec-types", + version: "1.0.0", + description: "Generated programmatically", + main: "index.js", + scripts: { + start: "node index.js" + }, + dependencies: { + express: "^4.18.2" + } +}; + const buildTranspilerCache = async (schemas: Record): Promise => { const cache: Record = {}; @@ -51,7 +64,26 @@ type Op = "type": "compile"; fileNames: string[]; options: ts.CompilerOptions | any, lang: "ts" | "go" | "rs" | "py"; } - +// versions to version path +const tsIndexFile = (schemaNames: string[], outpath: string): string => { + const getName = (name: string) => { + if(name.toLowerCase() === "legacy") return "Legacy"; + return `V${name}`; + } + // import all the schema types + const imports = schemaNames.map((name) => { + const typeName = getName(name); + return [ + `import type * as ${typeName} from "./${name}/index.ts";`, + ] + }) + // export all the schema types + const exports = [ + "", + `export type { ${schemaNames.map(getName).join(", ")} }`, + ] + return imports.concat(exports).join("\n"); +} const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , outpath: string): Op[] => { const ops: Op[] = [{ type: "mkdir", path: outpath }] @@ -59,7 +91,8 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , out return ops.concat(schemasNames.flatMap((name) => { return [ { type: "mkdir", path: `${outpath}/${name}` }, - { type: "write", path: `${outpath}/${name}/index.ts`, content: getTranspiler(name).toTs() } + { type: "write", path: `${outpath}/${name}/index.ts`, content: getTranspiler(name).toTs() }, + { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames, outpath) } ]; })).concat([ { type: "compile", fileNames: [outpath], options: { From e9eb5e7706eff07a6787f788825628deb1fff8cf Mon Sep 17 00:00:00 2001 From: Zane Starr Date: Fri, 13 Feb 2026 18:10:23 -0800 Subject: [PATCH 04/46] fix: add remaining generators and remove stale ones --- src/assets.ts | 91 ++++++++++++++ src/index.ts | 327 +++++++++++++++++++++++--------------------------- 2 files changed, 240 insertions(+), 178 deletions(-) create mode 100644 src/assets.ts diff --git a/src/assets.ts b/src/assets.ts new file mode 100644 index 0000000..03bfae9 --- /dev/null +++ b/src/assets.ts @@ -0,0 +1,91 @@ +export interface PackageJsonOptions { + name: string; + version: string; +} + +export interface CargoTomlOptions { + name: string; + version: string; +} + +export const buildCargoToml = ( + schemaNames: string[], + opts: CargoTomlOptions = { name: "open-rpc-spec-types", version: "0.0.0" }, +): object => ({ + package: { + name: opts.name, + version: opts.version, + edition: "2021", + description: "Generated OpenRPC specification types", + license: "Apache-2.0", + }, + dependencies: { + serde: { version: "1.0", features: ["derive"] }, + serde_json: "1.0", + derive_builder: "0.20", + }, +}); + +export interface GoModOptions { + module: string; + goVersion: string; +} + +export const buildGoMod = ( + opts: GoModOptions = { module: "github.com/open-rpc/spec-types", goVersion: "1.24.5" }, +): string => `module ${opts.module}\n\ngo ${opts.goVersion}\n`; + +export interface PyProjectTomlOptions { + name: string; + version: string; +} + +export const buildPyProjectToml = ( + opts: PyProjectTomlOptions = { name: "open-rpc-spec-types", version: "0.0.0" }, +): object => ({ + "build-system": { + requires: ["hatchling"], + "build-backend": "hatchling.build", + }, + project: { + name: opts.name, + version: opts.version, + description: "Generated OpenRPC specification types", + license: "Apache-2.0", + "requires-python": ">=3.12", + }, +}); + +export const buildPackageJson = ( + schemaNames: string[], + opts: PackageJsonOptions = { name: "@open-rpc/spec-types", version: "0.0.0" }, +) => { + const subpathExports = Object.fromEntries( + schemaNames.map((name) => [ + `./${name}`, + { + bun: `./${name}/index.ts`, + types: `./${name}/index.d.ts`, + import: `./${name}/index.js`, + default: `./${name}/index.js`, + }, + ]), + ); + + return { + name: opts.name, + version: opts.version, + type: "module", + module: "index.ts", + exports: { + ".": { + bun: "./index.ts", + types: "./index.d.ts", + import: "./index.js", + default: "./index.js", + }, + ...subpathExports, + }, + files: ["**/*.ts", "**/*.d.ts", "**/*.js", "!node_modules"], + }; +}; diff --git a/src/index.ts b/src/index.ts index b7acfb3..925dd7c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,38 +1,39 @@ import * as path from "path"; import Transpiler from "@json-schema-tools/transpiler"; import { compileTypescript, StringUtils } from "./util"; -import {readFile, writeFile, mkdir} from "fs/promises"; +import { buildPackageJson, buildCargoToml, buildGoMod, buildPyProjectToml } from "./assets.ts"; +import {readFile, writeFile, mkdir, rmdir, rm} from "fs/promises"; import type { JSONSchemaObject } from "@json-schema-tools/meta-schema"; import Dereferencer from "@json-schema-tools/dereferencer"; import toml from "@iarna/toml"; import {getAllSchemas} from "test-open-rpc-spec" - - import ts from "typescript"; -import { config } from "process"; -let transpilerCache: Record = {}; + interface GetTranspiler { (name: string): Transpiler } -// Programatically construct all the assets tomls pyprojects generate them -// then we will use Knope to have the changesets and versions propogated and committed -// this will then allow us to have nice generated assets that can be used in the spec like changesets -const packageJson = { - name: "spec-types", - version: "1.0.0", - description: "Generated programmatically", - main: "index.js", - scripts: { - start: "node index.js" - }, - dependencies: { - express: "^4.18.2" +// Operation types for the system +type Op = + | { + "type": "write"; path: string; content: string; + } + | { + "type": "rm"; path: string; + } + | { + "type": "mkdir"; path: string; + } + | { + "type": "compile"; fileNames: string[]; options: ts.CompilerOptions | any, lang: "ts" | "go" | "rs" | "py"; } -}; +// Programatically construct all the assets tomls pyprojects generate them +// then we will use Knope to have the changesets and versions propogated and committed +// this will then allow us to have nice generated assets that can be used in the spec like changesets + const buildTranspilerCache = async (schemas: Record): Promise => { const cache: Record = {}; for(const [name, schema] of Object.entries(schemas)) { @@ -53,41 +54,33 @@ const buildTranspilerCache = async (schemas: Record): Promise { - const getName = (name: string) => { - if(name.toLowerCase() === "legacy") return "Legacy"; - return `V${name}`; - } - // import all the schema types - const imports = schemaNames.map((name) => { - const typeName = getName(name); - return [ - `import type * as ${typeName} from "./${name}/index.ts";`, - ] - }) - // export all the schema types - const exports = [ - "", - `export type { ${schemaNames.map(getName).join(", ")} }`, - ] - return imports.concat(exports).join("\n"); +const tsIndexFile = (schemaNames: string[]): string => { + const imports = schemaNames + .map((name) => `import type * as V${name} from "./${name}/index.js";`); + + const reexport = `export type { ${schemaNames.map((name) => `V${name}`).join(", ")} }`; + + return [...imports, "", reexport].join("\n"); +}; + +const rsLibFile = (schemaNames: string[]): string => { + return schemaNames.map((name) => `pub mod v${name};`).join("\n") + "\n"; } -const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , outpath: string): Op[] => { - const ops: Op[] = [{ type: "mkdir", path: outpath }] +const goPackageFile = (name: string, goCode: string): string => { + return `package v${name}\n\n${goCode}\n`; +} +const pyInitFile = (schemaNames: string[]): string => { + return schemaNames.map((name) => `from . import v${name}`).join("\n") + "\n"; +} + +// Operations generators + +const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , outpath: string): Op[] => { + const ops: Op[] = [{ type: "rm", path: `${outpath}` }, { type: "mkdir", path: outpath }] return ops.concat(schemasNames.flatMap((name) => { return [ { type: "mkdir", path: `${outpath}/${name}` }, @@ -95,7 +88,11 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , out { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames, outpath) } ]; })).concat([ - { type: "compile", fileNames: [outpath], options: { + { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames), null, 2) }, + { type: "compile", fileNames: [ + `${outpath}/index.ts`, + ...schemasNames.map((name) => `${outpath}/${name}/index.ts`), + ], options: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.ES2022, lib: ["lib.es2022.d.ts"], @@ -107,12 +104,99 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , out ]); } +const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string): Op[] => { + const ops: Op[] = [ + { type: "rm", path: outpath }, + { type: "mkdir", path: outpath }, + { type: "mkdir", path: `${outpath}/src` }, + ]; + + return ops + .concat( + schemasNames.map((name) => ({ + type: "write" as const, + path: `${outpath}/src/v${name}.rs`, + content: getTranspiler(name).toRs(), + })), + ) + .concat([ + { + type: "write", + path: `${outpath}/src/lib.rs`, + content: rsLibFile(schemasNames), + }, + { + type: "write", + path: `${outpath}/Cargo.toml`, + content: toml.stringify(buildCargoToml(schemasNames) as any), + }, + ]); +} + +const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string): Op[] => { + const ops: Op[] = [ + { type: "rm", path: outpath }, + { type: "mkdir", path: outpath }, + ]; + + return ops + .concat( + schemasNames.flatMap((name) => [ + { type: "mkdir" as const, path: `${outpath}/v${name}` }, + { + type: "write" as const, + path: `${outpath}/v${name}/v${name}.go`, + content: goPackageFile(name, getTranspiler(name).toGo()), + }, + ]), + ) + .concat([ + { + type: "write", + path: `${outpath}/go.mod`, + content: buildGoMod(), + }, + ]); +} + +const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string): Op[] => { + const pkg = "open_rpc_spec_types"; + const ops: Op[] = [ + { type: "rm", path: outpath }, + { type: "mkdir", path: outpath }, + { type: "mkdir", path: `${outpath}/src/${pkg}` }, + ]; + + return ops + .concat( + schemasNames.map((name) => ({ + type: "write" as const, + path: `${outpath}/src/${pkg}/v${name}.py`, + content: getTranspiler(name).toPy(), + })), + ) + .concat([ + { + type: "write", + path: `${outpath}/src/${pkg}/__init__.py`, + content: pyInitFile(schemasNames), + }, + { + type: "write", + path: `${outpath}/pyproject.toml`, + content: toml.stringify(buildPyProjectToml() as any), + }, + ]); +} + + // Interpreter does the actual work const execute = async (ops: Op[]) => { for (const op of ops) { switch (op.type) { case "write": await writeFile(op.path, op.content); break; case "mkdir": await mkdir(op.path, { recursive: true }); break; + case "rm": await rm(op.path, { recursive: true, force: true }); break; case "compile": { switch (op.lang) { case "ts": compileTypescript(op.fileNames, op.options as ts.CompilerOptions); break; @@ -124,133 +208,20 @@ const execute = async (ops: Op[]) => { }; const run = async () => { - const getTranspiler = await buildTranspilerCache(getAllSchemas()); - const ops = generateTsOp(getTranspiler, Object.keys(getAllSchemas()), "./generated/packages/ts"); - await execute(ops); -} - -run() - -const generateTs = async (transpiler: Transpiler, schema: JSONSchemaObject, outpath: string): Promise => { - const indexTS = `${outpath}/src/index.ts`; - const regularName = StringUtils.camelCase(schema.title); - const tsCode = [ - `export const ${regularName} = ${JSON.stringify(schema)};`, - `export default ${regularName}` - ].join("\n"); - await writeFile(indexTS, tsCode); - const program = ts.createProgram([indexTS, `${outpath}/src/schema.json`], { - target: ts.ScriptTarget.ES2022, - module: ts.ModuleKind.ES2022, - lib: ["lib.es2022.d.ts"], - moduleResolution: ts.ModuleResolutionKind.Bundler, - declaration: true, - outDir: outpath, - strict: true, - esModuleInterop: true, - resolveJsonModule: true, - }); - const emitResult = program.emit(); - const diagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); - if (diagnostics.length > 0) { - const msg = ts.formatDiagnosticsWithColorAndContext(diagnostics, { - getCanonicalFileName: (f) => f, - getCurrentDirectory: ts.sys.getCurrentDirectory, - getNewLine: () => ts.sys.newLine, - }); - throw new Error(msg); - } - await writeFile(`${outpath}/index.d.ts`, transpiler.toTs()); - return true; -} - -const generateGo = async (transpiler: Transpiler, schema: JSONSchemaObject, outpath: string): Promise => { - const packageName = StringUtils.snakeCase(schema.title); - const exportName = `Raw${StringUtils.upperFirst(packageName)}`; - const escapedS = JSON.stringify(schema).replace(/"/g, "\\\""); - - const go = [ - `package ${packageName}`, - "", - "", - transpiler.toGo(), - "", - `const ${exportName} = "${escapedS}"`, - ].join("\n"); - - await writeFile(`${outpath}/${packageName}.go`, go); - return true; + const schemaNames = Object.keys(getAllSchemas()); + + const tsOps = generateTsOp(getTranspiler, schemaNames, "./generated/packages/ts"); + const rsOps = generateRsOp(getTranspiler, schemaNames, "./generated/packages/rs"); + const goOps = generateGoOp(getTranspiler, schemaNames, "./generated/packages/go"); + const pyOps = generatePyOp(getTranspiler, schemaNames, "./generated/packages/py"); + + await Promise.all([ + execute(tsOps), + execute(rsOps), + execute(goOps), + execute(pyOps), + ]); } -const generateRs = async (transpiler: Transpiler, schema: JSONSchemaObject, outpath: string, version: string): Promise => { - const crateName = StringUtils.snakeCase(schema.title); - - let cargotoml; - - try { - cargotoml = toml.parse(await readFile("${outpath}/Cargo.toml", "utf8")); - cargotoml.version = version; - } catch (e) { - cargotoml = { - package: { - name: crateName, - version, - description: "Generated types based on the JSON-Schema for " + crateName, - license: "Apache-2.0" - }, - dependencies: { - serde: { version: "1.0", features: ["derive"] }, - serde_json: "1.0", // eslint-disable-line - derive_builder: "0.10" // eslint-disable-line - } - } - } - - await writeFile(`${outpath}/Cargo.toml`, toml.stringify(cargotoml)); - await writeFile(`${outpath}/src/lib.rs`, transpiler.toRs()); - - return true; -}; - -export const prepare = async (): Promise => { - - const outpath = pluginConfig.outpath || process.cwd(); - await mkdir(`./${outpath}/src`, { recursive: true }); - - const schemaPath = path.resolve(process.cwd(), pluginConfig.schemaLocation); - - const schemaString = await readFile(schemaPath, "utf8"); - const schema = JSON.parse(schemaString); - - await writeFile(`${outpath}/src/schema.json`, schemaString); - - if (!schema.title) { - throw new Error("The schema must have a title", "ENOTITLE", "Schema requires a title"); - } - - let dereffedSchema; - try { - const dereffer = new Dereferencer(JSON.parse(JSON.stringify(schema))); - dereffedSchema = await dereffer.resolve(); - } catch (e: any) { - throw new Error(e.message); - } - - const transpiler = new Transpiler(dereffedSchema); - - if (config.languages?.ts) { - await generateTs(transpiler, schema, outpath); - } - if (config.languages?.go) { - await generateGo(transpiler, schema, outpath); - } - if (config.languages?.rs) { - await generateRs(transpiler, schema, outpath, context.nextRelease.version) - } - if (config.languages?.py) { - await writeFile(`${outpath}/index.py`, transpiler.toPy()); - } - - return true; -} \ No newline at end of file +run() \ No newline at end of file From 1d018676ec2490124ddfff53d2280c3704f67180 Mon Sep 17 00:00:00 2001 From: Zane Starr Date: Fri, 13 Feb 2026 18:10:43 -0800 Subject: [PATCH 05/46] chore: add missing generated files --- bun.lock | 1 + generated/packages/go/go.mod | 3 + generated/packages/go/v1_3/v1_3.go | 805 ++++++++++++++++ generated/packages/go/v1_4/v1_4.go | 805 ++++++++++++++++ generated/packages/py/pyproject.toml | 10 + .../py/src/open_rpc_spec_types/__init__.py | 2 + .../py/src/open_rpc_spec_types/v1_3.py | 472 ++++++++++ .../py/src/open_rpc_spec_types/v1_4.py | 472 ++++++++++ generated/packages/rs/Cargo.toml | 14 + generated/packages/rs/src/lib.rs | 2 + generated/packages/rs/src/v1_3.rs | 856 ++++++++++++++++++ generated/packages/rs/src/v1_4.rs | 856 ++++++++++++++++++ generated/packages/ts/1_3/index.d.ts | 748 +++++++++++++++ generated/packages/ts/1_3/index.js | 1 + .../packages/ts/{legacy => 1_3}/index.ts | 398 +++++++- generated/packages/ts/1_4/index.d.ts | 748 +++++++++++++++ generated/packages/ts/1_4/index.js | 1 + generated/packages/ts/index.d.ts | 3 + generated/packages/ts/index.js | 1 + generated/packages/ts/index.ts | 6 +- generated/packages/ts/package.json | 32 + 21 files changed, 6205 insertions(+), 31 deletions(-) create mode 100644 generated/packages/go/go.mod create mode 100644 generated/packages/go/v1_3/v1_3.go create mode 100644 generated/packages/go/v1_4/v1_4.go create mode 100644 generated/packages/py/pyproject.toml create mode 100644 generated/packages/py/src/open_rpc_spec_types/__init__.py create mode 100644 generated/packages/py/src/open_rpc_spec_types/v1_3.py create mode 100644 generated/packages/py/src/open_rpc_spec_types/v1_4.py create mode 100644 generated/packages/rs/Cargo.toml create mode 100644 generated/packages/rs/src/lib.rs create mode 100644 generated/packages/rs/src/v1_3.rs create mode 100644 generated/packages/rs/src/v1_4.rs create mode 100644 generated/packages/ts/1_3/index.d.ts create mode 100644 generated/packages/ts/1_3/index.js rename generated/packages/ts/{legacy => 1_3}/index.ts (52%) create mode 100644 generated/packages/ts/1_4/index.d.ts create mode 100644 generated/packages/ts/1_4/index.js create mode 100644 generated/packages/ts/index.d.ts create mode 100644 generated/packages/ts/index.js create mode 100644 generated/packages/ts/package.json diff --git a/bun.lock b/bun.lock index c070ce1..3c6ed11 100644 --- a/bun.lock +++ b/bun.lock @@ -8,6 +8,7 @@ "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz", + "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz", }, "devDependencies": { "@iarna/toml": "^2.2.5", diff --git a/generated/packages/go/go.mod b/generated/packages/go/go.mod new file mode 100644 index 0000000..8a8f356 --- /dev/null +++ b/generated/packages/go/go.mod @@ -0,0 +1,3 @@ +module github.com/open-rpc/spec-types + +go 1.24.5 diff --git a/generated/packages/go/v1_3/v1_3.go b/generated/packages/go/v1_3/v1_3.go new file mode 100644 index 0000000..d877a7b --- /dev/null +++ b/generated/packages/go/v1_3/v1_3.go @@ -0,0 +1,805 @@ +package v1_3 + +import "encoding/json" +import "errors" +// This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. +type Openrpc string +// The title of the application. +type InfoObjectTitle string +// A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type InfoObjectDescription string +// A URL to the Terms of Service for the API. MUST be in the format of a URL. +type InfoObjectTermsOfService string +// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +type InfoObjectVersion string +// The identifying name of the contact person/organization. +type ContactObjectName string +// The email address of the contact person/organization. MUST be in the format of an email address. +type ContactObjectEmail string +// The URL pointing to the contact information. MUST be in the format of a URL. +type ContactObjectUrl string +// This object MAY be extended with [Specification Extensions](#specification-extensions). +type SpecificationExtension interface{} +// Contact information for the exposed API. +type ContactObject struct { + Name *ContactObjectName `json:"name,omitempty"` + Email *ContactObjectEmail `json:"email,omitempty"` + Url *ContactObjectUrl `json:"url,omitempty"` +} +// The license name used for the API. +type LicenseObjectName string +// A URL to the license used for the API. MUST be in the format of a URL. +type LicenseObjectUrl string +// License information for the exposed API. +type LicenseObject struct { + Name *LicenseObjectName `json:"name,omitempty"` + Url *LicenseObjectUrl `json:"url,omitempty"` +} +// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +type InfoObject interface{} +// A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ExternalDocumentationObjectDescription string +// The URL for the target documentation. Value MUST be in the format of a URL. +type ExternalDocumentationObjectUrl string +// Additional external documentation for this tag. +type ExternalDocumentationObject struct { + Description *ExternalDocumentationObjectDescription `json:"description,omitempty"` + Url *ExternalDocumentationObjectUrl `json:"url"` +} +// A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +type ServerObjectUrl string +// An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ServerObjectName string +// An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ServerObjectDescription string +// A short summary of what the server is. +type ServerObjectSummary string +// The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. +type ServerObjectVariableDefault string +// An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ServerObjectVariableDescription string +// An enumeration of string values to be used if the substitution options are from a limited set. +type ServerObjectVariableEnumItem string +// An enumeration of string values to be used if the substitution options are from a limited set. +type ServerObjectVariableEnum []ServerObjectVariableEnumItem +// An object representing a Server Variable for server URL template substitution. +type ServerObjectVariable struct { + Default *ServerObjectVariableDefault `json:"default"` + Description *ServerObjectVariableDescription `json:"description,omitempty"` + Enum *ServerObjectVariableEnum `json:"enum,omitempty"` +} +// A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +type ServerObjectVariables map[string]interface{} +// A object representing a Server +type ServerObject struct { + Url *ServerObjectUrl `json:"url"` + Name *ServerObjectName `json:"name,omitempty"` + Description *ServerObjectDescription `json:"description,omitempty"` + Summary *ServerObjectSummary `json:"summary,omitempty"` + Variables *ServerObjectVariables `json:"variables,omitempty"` +} +type AlwaysFalse interface{} +// An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. +type Servers []ServerObject +// The cannonical name for the method. The name MUST be unique within the methods array. +type MethodObjectName string +// A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. +type MethodObjectDescription string +// A short summary of what the method does. +type MethodObjectSummary string +// The name of the tag. +type TagObjectName string +// A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type TagObjectDescription string +// Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. +type TagObject struct { + Name *TagObjectName `json:"name"` + Description *TagObjectDescription `json:"description,omitempty"` + ExternalDocs *ExternalDocumentationObject `json:"externalDocs,omitempty"` +} +type Ref string +type ReferenceObject struct { + Ref *Ref `json:"$ref"` +} +type TagOrReference struct { + TagObject *TagObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *TagOrReference) UnmarshalJSON(bytes []byte) error { + var myTagObject TagObject + if err := json.Unmarshal(bytes, &myTagObject); err == nil { + o.TagObject = &myTagObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o TagOrReference) MarshalJSON() ([]byte, error) { + if o.TagObject != nil { + return json.Marshal(o.TagObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. +type MethodObjectTags []TagOrReference +// Format the server expects the params. Defaults to 'either'. +// +// --- Default --- +// +// either +type MethodObjectParamStructure string +const ( + MethodObjectParamStructureEnum0 MethodObjectParamStructure = "by-position" + MethodObjectParamStructureEnum1 MethodObjectParamStructure = "by-name" + MethodObjectParamStructureEnum2 MethodObjectParamStructure = "either" +) +// Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). +type ContentDescriptorObjectName string +// A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ContentDescriptorObjectDescription string +// A short summary of the content that is being described. +type ContentDescriptorObjectSummary string +type Id string +type Schema string +type Comment string +type Title string +type Description string +type AlwaysTrue interface{} +type ReadOnly bool +type Examples []AlwaysTrue +type MultipleOf float64 +type Maximum float64 +type ExclusiveMaximum float64 +type Minimum float64 +type ExclusiveMinimum float64 +type NonNegativeInteger int64 +type NonNegativeIntegerDefaultZero int64 +type Pattern string +// Always valid if true. Never valid if false. Is constant. +type JSONSchemaBoolean bool +// +// --- Default --- +// +// {} +type JSONSchema struct { + JSONSchemaObject *JSONSchemaObject + JSONSchemaBoolean *JSONSchemaBoolean +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *JSONSchema) UnmarshalJSON(bytes []byte) error { + var myJSONSchemaObject JSONSchemaObject + if err := json.Unmarshal(bytes, &myJSONSchemaObject); err == nil { + o.JSONSchemaObject = &myJSONSchemaObject + return nil + } + var myJSONSchemaBoolean JSONSchemaBoolean + if err := json.Unmarshal(bytes, &myJSONSchemaBoolean); err == nil { + o.JSONSchemaBoolean = &myJSONSchemaBoolean + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o JSONSchema) MarshalJSON() ([]byte, error) { + if o.JSONSchemaObject != nil { + return json.Marshal(o.JSONSchemaObject) + } + if o.JSONSchemaBoolean != nil { + return json.Marshal(o.JSONSchemaBoolean) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +type SchemaArray []JSONSchema +// +// --- Default --- +// +// true +type Items struct { + JSONSchema *JSONSchema + SchemaArray *SchemaArray +} +func (a *Items) UnmarshalJSON(bytes []byte) error { + var ok bool + var myJSONSchema JSONSchema + if err := json.Unmarshal(bytes, &myJSONSchema); err == nil { + ok = true + a.JSONSchema = &myJSONSchema + } + var mySchemaArray SchemaArray + if err := json.Unmarshal(bytes, &mySchemaArray); err == nil { + ok = true + a.SchemaArray = &mySchemaArray + } + if ok { + return nil + } + return errors.New("failed to unmarshal any of the object properties") +} +func (o Items) MarshalJSON() ([]byte, error) { + out := []interface{}{} + if o.JSONSchema != nil { + out = append(out, o.JSONSchema) + } + if o.SchemaArray != nil { + out = append(out, o.SchemaArray) + } + return json.Marshal(out) +} +type UniqueItems bool +type StringDoaGddGA string +// +// --- Default --- +// +// [] +type StringArray []StringDoaGddGA +// +// --- Default --- +// +// {} +type Definitions map[string]interface{} +// +// --- Default --- +// +// {} +type Properties map[string]interface{} +type PropertyNames interface{} +// +// --- Default --- +// +// {} +type PatternProperties map[string]interface{} +type DependenciesSet struct { + JSONSchema *JSONSchema + StringArray *StringArray +} +func (a *DependenciesSet) UnmarshalJSON(bytes []byte) error { + var ok bool + var myJSONSchema JSONSchema + if err := json.Unmarshal(bytes, &myJSONSchema); err == nil { + ok = true + a.JSONSchema = &myJSONSchema + } + var myStringArray StringArray + if err := json.Unmarshal(bytes, &myStringArray); err == nil { + ok = true + a.StringArray = &myStringArray + } + if ok { + return nil + } + return errors.New("failed to unmarshal any of the object properties") +} +func (o DependenciesSet) MarshalJSON() ([]byte, error) { + out := []interface{}{} + if o.JSONSchema != nil { + out = append(out, o.JSONSchema) + } + if o.StringArray != nil { + out = append(out, o.StringArray) + } + return json.Marshal(out) +} +type Dependencies map[string]interface{} +type Enum []AlwaysTrue +type SimpleTypes string +const ( + SimpleTypesEnum0 SimpleTypes = "array" + SimpleTypesEnum1 SimpleTypes = "boolean" + SimpleTypesEnum2 SimpleTypes = "integer" + SimpleTypesEnum3 SimpleTypes = "null" + SimpleTypesEnum4 SimpleTypes = "number" + SimpleTypesEnum5 SimpleTypes = "object" + SimpleTypesEnum6 SimpleTypes = "string" +) +type ArrayOfSimpleTypes []SimpleTypes +type Type struct { + SimpleTypes *SimpleTypes + ArrayOfSimpleTypes *ArrayOfSimpleTypes +} +func (a *Type) UnmarshalJSON(bytes []byte) error { + var ok bool + var mySimpleTypes SimpleTypes + if err := json.Unmarshal(bytes, &mySimpleTypes); err == nil { + ok = true + a.SimpleTypes = &mySimpleTypes + } + var myArrayOfSimpleTypes ArrayOfSimpleTypes + if err := json.Unmarshal(bytes, &myArrayOfSimpleTypes); err == nil { + ok = true + a.ArrayOfSimpleTypes = &myArrayOfSimpleTypes + } + if ok { + return nil + } + return errors.New("failed to unmarshal any of the object properties") +} +func (o Type) MarshalJSON() ([]byte, error) { + out := []interface{}{} + if o.SimpleTypes != nil { + out = append(out, o.SimpleTypes) + } + if o.ArrayOfSimpleTypes != nil { + out = append(out, o.ArrayOfSimpleTypes) + } + return json.Marshal(out) +} +type Format string +type ContentMediaType string +type ContentEncoding string +type JSONSchemaObject struct { + Id *Id `json:"$id,omitempty"` + Schema *Schema `json:"$schema,omitempty"` + Ref *Ref `json:"$ref,omitempty"` + Comment *Comment `json:"$comment,omitempty"` + Title *Title `json:"title,omitempty"` + Description *Description `json:"description,omitempty"` + Default *AlwaysTrue `json:"default,omitempty"` + ReadOnly *ReadOnly `json:"readOnly,omitempty"` + Examples *Examples `json:"examples,omitempty"` + MultipleOf *MultipleOf `json:"multipleOf,omitempty"` + Maximum *Maximum `json:"maximum,omitempty"` + ExclusiveMaximum *ExclusiveMaximum `json:"exclusiveMaximum,omitempty"` + Minimum *Minimum `json:"minimum,omitempty"` + ExclusiveMinimum *ExclusiveMinimum `json:"exclusiveMinimum,omitempty"` + MaxLength *NonNegativeInteger `json:"maxLength,omitempty"` + MinLength *NonNegativeIntegerDefaultZero `json:"minLength,omitempty"` + Pattern *Pattern `json:"pattern,omitempty"` + AdditionalItems *JSONSchema `json:"additionalItems,omitempty"` + Items *Items `json:"items,omitempty"` + MaxItems *NonNegativeInteger `json:"maxItems,omitempty"` + MinItems *NonNegativeIntegerDefaultZero `json:"minItems,omitempty"` + UniqueItems *UniqueItems `json:"uniqueItems,omitempty"` + Contains *JSONSchema `json:"contains,omitempty"` + MaxProperties *NonNegativeInteger `json:"maxProperties,omitempty"` + MinProperties *NonNegativeIntegerDefaultZero `json:"minProperties,omitempty"` + Required *StringArray `json:"required,omitempty"` + AdditionalProperties *JSONSchema `json:"additionalProperties,omitempty"` + Definitions *Definitions `json:"definitions,omitempty"` + Properties *Properties `json:"properties,omitempty"` + PatternProperties *PatternProperties `json:"patternProperties,omitempty"` + Dependencies *Dependencies `json:"dependencies,omitempty"` + PropertyNames *JSONSchema `json:"propertyNames,omitempty"` + Const *AlwaysTrue `json:"const,omitempty"` + Enum *Enum `json:"enum,omitempty"` + Type *Type `json:"type,omitempty"` + Format *Format `json:"format,omitempty"` + ContentMediaType *ContentMediaType `json:"contentMediaType,omitempty"` + ContentEncoding *ContentEncoding `json:"contentEncoding,omitempty"` + If *JSONSchema `json:"if,omitempty"` + Then *JSONSchema `json:"then,omitempty"` + Else *JSONSchema `json:"else,omitempty"` + AllOf *SchemaArray `json:"allOf,omitempty"` + AnyOf *SchemaArray `json:"anyOf,omitempty"` + OneOf *SchemaArray `json:"oneOf,omitempty"` + Not *JSONSchema `json:"not,omitempty"` +} +// Schema that describes the content. +// +// --- Default --- +// +// {} +type ContentDescriptorObjectSchema struct { + JSONSchemaObject *JSONSchemaObject + JSONSchemaBoolean *JSONSchemaBoolean +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ContentDescriptorObjectSchema) UnmarshalJSON(bytes []byte) error { + var myJSONSchemaObject JSONSchemaObject + if err := json.Unmarshal(bytes, &myJSONSchemaObject); err == nil { + o.JSONSchemaObject = &myJSONSchemaObject + return nil + } + var myJSONSchemaBoolean JSONSchemaBoolean + if err := json.Unmarshal(bytes, &myJSONSchemaBoolean); err == nil { + o.JSONSchemaBoolean = &myJSONSchemaBoolean + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ContentDescriptorObjectSchema) MarshalJSON() ([]byte, error) { + if o.JSONSchemaObject != nil { + return json.Marshal(o.JSONSchemaObject) + } + if o.JSONSchemaBoolean != nil { + return json.Marshal(o.JSONSchemaBoolean) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// Determines if the content is a required field. Default value is `false`. +type ContentDescriptorObjectRequired bool +// Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. +type ContentDescriptorObjectDeprecated bool +// Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. +type ContentDescriptorObject struct { + Name *ContentDescriptorObjectName `json:"name"` + Description *ContentDescriptorObjectDescription `json:"description,omitempty"` + Summary *ContentDescriptorObjectSummary `json:"summary,omitempty"` + Schema *ContentDescriptorObjectSchema `json:"schema"` + Required *ContentDescriptorObjectRequired `json:"required,omitempty"` + Deprecated *ContentDescriptorObjectDeprecated `json:"deprecated,omitempty"` +} +type ContentDescriptorOrReference struct { + ContentDescriptorObject *ContentDescriptorObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ContentDescriptorOrReference) UnmarshalJSON(bytes []byte) error { + var myContentDescriptorObject ContentDescriptorObject + if err := json.Unmarshal(bytes, &myContentDescriptorObject); err == nil { + o.ContentDescriptorObject = &myContentDescriptorObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ContentDescriptorOrReference) MarshalJSON() ([]byte, error) { + if o.ContentDescriptorObject != nil { + return json.Marshal(o.ContentDescriptorObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. +type MethodObjectParams []ContentDescriptorOrReference +// The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) +type MethodObjectResult struct { + ContentDescriptorObject *ContentDescriptorObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *MethodObjectResult) UnmarshalJSON(bytes []byte) error { + var myContentDescriptorObject ContentDescriptorObject + if err := json.Unmarshal(bytes, &myContentDescriptorObject); err == nil { + o.ContentDescriptorObject = &myContentDescriptorObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o MethodObjectResult) MarshalJSON() ([]byte, error) { + if o.ContentDescriptorObject != nil { + return json.Marshal(o.ContentDescriptorObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. +type ErrorObjectCode int64 +// A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. +type ErrorObjectMessage string +// A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). +type ErrorObjectData interface{} +// Defines an application level error. +type ErrorObject struct { + Code *ErrorObjectCode `json:"code"` + Message *ErrorObjectMessage `json:"message"` + Data *ErrorObjectData `json:"data,omitempty"` +} +type ErrorOrReference struct { + ErrorObject *ErrorObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ErrorOrReference) UnmarshalJSON(bytes []byte) error { + var myErrorObject ErrorObject + if err := json.Unmarshal(bytes, &myErrorObject); err == nil { + o.ErrorObject = &myErrorObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ErrorOrReference) MarshalJSON() ([]byte, error) { + if o.ErrorObject != nil { + return json.Marshal(o.ErrorObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +type MethodObjectErrors []ErrorOrReference +// Cannonical name of the link. +type LinkObjectName interface{} +// Short description for the link. +type LinkObjectSummary string +// The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. +type LinkObjectMethod string +// A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type LinkObjectDescription string +// A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. +type LinkObjectParams interface{} +// A server object to be used by the target method. +type LinkObjectServer struct { + Url *ServerObjectUrl `json:"url"` + Name *ServerObjectName `json:"name,omitempty"` + Description *ServerObjectDescription `json:"description,omitempty"` + Summary *ServerObjectSummary `json:"summary,omitempty"` + Variables *ServerObjectVariables `json:"variables,omitempty"` +} +// A object representing a Link +type LinkObject interface{} +type LinkOrReference struct { + LinkObject *LinkObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *LinkOrReference) UnmarshalJSON(bytes []byte) error { + var myLinkObject LinkObject + if err := json.Unmarshal(bytes, &myLinkObject); err == nil { + o.LinkObject = &myLinkObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o LinkOrReference) MarshalJSON() ([]byte, error) { + if o.LinkObject != nil { + return json.Marshal(o.LinkObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of possible links from this method call. +type MethodObjectLinks []LinkOrReference +// Name for the example pairing. +type ExamplePairingObjectName string +// A verbose explanation of the example pairing. +type ExamplePairingObjectDescription string +// Short description for the example. +type ExampleObjectSummary string +// Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. +type ExampleObjectValue interface{} +// A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ExampleObjectDescription string +// Cannonical name of the example. +type ExampleObjectName string +// The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). +type ExampleObject struct { + Summary *ExampleObjectSummary `json:"summary,omitempty"` + Value *ExampleObjectValue `json:"value"` + Description *ExampleObjectDescription `json:"description,omitempty"` + Name *ExampleObjectName `json:"name"` +} +type ExampleOrReference struct { + ExampleObject *ExampleObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ExampleOrReference) UnmarshalJSON(bytes []byte) error { + var myExampleObject ExampleObject + if err := json.Unmarshal(bytes, &myExampleObject); err == nil { + o.ExampleObject = &myExampleObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ExampleOrReference) MarshalJSON() ([]byte, error) { + if o.ExampleObject != nil { + return json.Marshal(o.ExampleObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// Example parameters. +type ExamplePairingObjectParams []ExampleOrReference +// Example result. When not provided, the example pairing represents usage of the method as a notification. +type ExamplePairingObjectResult struct { + ExampleObject *ExampleObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ExamplePairingObjectResult) UnmarshalJSON(bytes []byte) error { + var myExampleObject ExampleObject + if err := json.Unmarshal(bytes, &myExampleObject); err == nil { + o.ExampleObject = &myExampleObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ExamplePairingObjectResult) MarshalJSON() ([]byte, error) { + if o.ExampleObject != nil { + return json.Marshal(o.ExampleObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. +type ExamplePairingObject struct { + Name *ExamplePairingObjectName `json:"name"` + Description *ExamplePairingObjectDescription `json:"description,omitempty"` + Params *ExamplePairingObjectParams `json:"params"` + Result *ExamplePairingObjectResult `json:"result,omitempty"` +} +type ExamplePairingOrReference struct { + ExamplePairingObject *ExamplePairingObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ExamplePairingOrReference) UnmarshalJSON(bytes []byte) error { + var myExamplePairingObject ExamplePairingObject + if err := json.Unmarshal(bytes, &myExamplePairingObject); err == nil { + o.ExamplePairingObject = &myExamplePairingObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ExamplePairingOrReference) MarshalJSON() ([]byte, error) { + if o.ExamplePairingObject != nil { + return json.Marshal(o.ExamplePairingObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. +type MethodObjectExamples []ExamplePairingOrReference +// Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. +type MethodObjectDeprecated bool +// Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. +type MethodObject struct { + Name *MethodObjectName `json:"name"` + Description *MethodObjectDescription `json:"description,omitempty"` + Summary *MethodObjectSummary `json:"summary,omitempty"` + Servers *Servers `json:"servers,omitempty"` + Tags *MethodObjectTags `json:"tags,omitempty"` + ParamStructure *MethodObjectParamStructure `json:"paramStructure,omitempty"` + Params *MethodObjectParams `json:"params"` + Result *MethodObjectResult `json:"result,omitempty"` + Errors *MethodObjectErrors `json:"errors,omitempty"` + Links *MethodObjectLinks `json:"links,omitempty"` + Examples *MethodObjectExamples `json:"examples,omitempty"` + Deprecated *MethodObjectDeprecated `json:"deprecated,omitempty"` + ExternalDocs *ExternalDocumentationObject `json:"externalDocs,omitempty"` +} +type MethodOrReference struct { + MethodObject *MethodObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *MethodOrReference) UnmarshalJSON(bytes []byte) error { + var myMethodObject MethodObject + if err := json.Unmarshal(bytes, &myMethodObject); err == nil { + o.MethodObject = &myMethodObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o MethodOrReference) MarshalJSON() ([]byte, error) { + if o.MethodObject != nil { + return json.Marshal(o.MethodObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). +type Methods []MethodOrReference +// An object to hold reusable [Schema Objects](#schema-object). +type SchemaComponents map[string]interface{} +// An object to hold reusable [Link Objects](#link-object). +type LinkComponents map[string]interface{} +// An object to hold reusable [Error Objects](#error-object). +type ErrorComponents map[string]interface{} +// An object to hold reusable [Example Objects](#example-object). +type ExampleComponents map[string]interface{} +// An object to hold reusable [Example Pairing Objects](#example-pairing-object). +type ExamplePairingComponents map[string]interface{} +// An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). +type ContentDescriptorComponents map[string]interface{} +// An object to hold reusable [Tag Objects](#tag-object). +type TagComponents map[string]interface{} +// Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +type Components struct { + Schemas *SchemaComponents `json:"schemas,omitempty"` + Links *LinkComponents `json:"links,omitempty"` + Errors *ErrorComponents `json:"errors,omitempty"` + Examples *ExampleComponents `json:"examples,omitempty"` + ExamplePairings *ExamplePairingComponents `json:"examplePairings,omitempty"` + ContentDescriptors *ContentDescriptorComponents `json:"contentDescriptors,omitempty"` + Tags *TagComponents `json:"tags,omitempty"` +} +// JSON Schema URI (used by some editors) +// +// --- Default --- +// +// https://meta.open-rpc.org/ +type MetaSchema string +type OpenrpcDocument struct { + Openrpc *Openrpc `json:"openrpc"` + Info *InfoObject `json:"info"` + ExternalDocs *ExternalDocumentationObject `json:"externalDocs,omitempty"` + Servers *Servers `json:"servers,omitempty"` + Methods *Methods `json:"methods"` + Components *Components `json:"components,omitempty"` + Schema *MetaSchema `json:"$schema,omitempty"` +} diff --git a/generated/packages/go/v1_4/v1_4.go b/generated/packages/go/v1_4/v1_4.go new file mode 100644 index 0000000..2244f07 --- /dev/null +++ b/generated/packages/go/v1_4/v1_4.go @@ -0,0 +1,805 @@ +package v1_4 + +import "encoding/json" +import "errors" +// This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. +type Openrpc string +// The title of the application. +type InfoObjectTitle string +// A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type InfoObjectDescription string +// A URL to the Terms of Service for the API. MUST be in the format of a URL. +type InfoObjectTermsOfService string +// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +type InfoObjectVersion string +// The identifying name of the contact person/organization. +type ContactObjectName string +// The email address of the contact person/organization. MUST be in the format of an email address. +type ContactObjectEmail string +// The URL pointing to the contact information. MUST be in the format of a URL. +type ContactObjectUrl string +// This object MAY be extended with [Specification Extensions](#specification-extensions). +type SpecificationExtension interface{} +// Contact information for the exposed API. +type ContactObject struct { + Name *ContactObjectName `json:"name,omitempty"` + Email *ContactObjectEmail `json:"email,omitempty"` + Url *ContactObjectUrl `json:"url,omitempty"` +} +// The license name used for the API. +type LicenseObjectName string +// A URL to the license used for the API. MUST be in the format of a URL. +type LicenseObjectUrl string +// License information for the exposed API. +type LicenseObject struct { + Name *LicenseObjectName `json:"name,omitempty"` + Url *LicenseObjectUrl `json:"url,omitempty"` +} +// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +type InfoObject interface{} +// A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ExternalDocumentationObjectDescription string +// The URL for the target documentation. Value MUST be in the format of a URL. +type ExternalDocumentationObjectUrl string +// Additional external documentation for this tag. +type ExternalDocumentationObject struct { + Description *ExternalDocumentationObjectDescription `json:"description,omitempty"` + Url *ExternalDocumentationObjectUrl `json:"url"` +} +// A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +type ServerObjectUrl string +// An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ServerObjectName string +// An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ServerObjectDescription string +// A short summary of what the server is. +type ServerObjectSummary string +// The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. +type ServerObjectVariableDefault string +// An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ServerObjectVariableDescription string +// An enumeration of string values to be used if the substitution options are from a limited set. +type ServerObjectVariableEnumItem string +// An enumeration of string values to be used if the substitution options are from a limited set. +type ServerObjectVariableEnum []ServerObjectVariableEnumItem +// An object representing a Server Variable for server URL template substitution. +type ServerObjectVariable struct { + Default *ServerObjectVariableDefault `json:"default"` + Description *ServerObjectVariableDescription `json:"description,omitempty"` + Enum *ServerObjectVariableEnum `json:"enum,omitempty"` +} +// A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +type ServerObjectVariables map[string]interface{} +// A object representing a Server +type ServerObject struct { + Url *ServerObjectUrl `json:"url"` + Name *ServerObjectName `json:"name,omitempty"` + Description *ServerObjectDescription `json:"description,omitempty"` + Summary *ServerObjectSummary `json:"summary,omitempty"` + Variables *ServerObjectVariables `json:"variables,omitempty"` +} +type AlwaysFalse interface{} +// An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. +type Servers []ServerObject +// The cannonical name for the method. The name MUST be unique within the methods array. +type MethodObjectName string +// A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. +type MethodObjectDescription string +// A short summary of what the method does. +type MethodObjectSummary string +// The name of the tag. +type TagObjectName string +// A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type TagObjectDescription string +// Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. +type TagObject struct { + Name *TagObjectName `json:"name"` + Description *TagObjectDescription `json:"description,omitempty"` + ExternalDocs *ExternalDocumentationObject `json:"externalDocs,omitempty"` +} +type Ref string +type ReferenceObject struct { + Ref *Ref `json:"$ref"` +} +type TagOrReference struct { + TagObject *TagObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *TagOrReference) UnmarshalJSON(bytes []byte) error { + var myTagObject TagObject + if err := json.Unmarshal(bytes, &myTagObject); err == nil { + o.TagObject = &myTagObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o TagOrReference) MarshalJSON() ([]byte, error) { + if o.TagObject != nil { + return json.Marshal(o.TagObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. +type MethodObjectTags []TagOrReference +// Format the server expects the params. Defaults to 'either'. +// +// --- Default --- +// +// either +type MethodObjectParamStructure string +const ( + MethodObjectParamStructureEnum0 MethodObjectParamStructure = "by-position" + MethodObjectParamStructureEnum1 MethodObjectParamStructure = "by-name" + MethodObjectParamStructureEnum2 MethodObjectParamStructure = "either" +) +// Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). +type ContentDescriptorObjectName string +// A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ContentDescriptorObjectDescription string +// A short summary of the content that is being described. +type ContentDescriptorObjectSummary string +type Id string +type Schema string +type Comment string +type Title string +type Description string +type AlwaysTrue interface{} +type ReadOnly bool +type Examples []AlwaysTrue +type MultipleOf float64 +type Maximum float64 +type ExclusiveMaximum float64 +type Minimum float64 +type ExclusiveMinimum float64 +type NonNegativeInteger int64 +type NonNegativeIntegerDefaultZero int64 +type Pattern string +// Always valid if true. Never valid if false. Is constant. +type JSONSchemaBoolean bool +// +// --- Default --- +// +// {} +type JSONSchema struct { + JSONSchemaObject *JSONSchemaObject + JSONSchemaBoolean *JSONSchemaBoolean +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *JSONSchema) UnmarshalJSON(bytes []byte) error { + var myJSONSchemaObject JSONSchemaObject + if err := json.Unmarshal(bytes, &myJSONSchemaObject); err == nil { + o.JSONSchemaObject = &myJSONSchemaObject + return nil + } + var myJSONSchemaBoolean JSONSchemaBoolean + if err := json.Unmarshal(bytes, &myJSONSchemaBoolean); err == nil { + o.JSONSchemaBoolean = &myJSONSchemaBoolean + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o JSONSchema) MarshalJSON() ([]byte, error) { + if o.JSONSchemaObject != nil { + return json.Marshal(o.JSONSchemaObject) + } + if o.JSONSchemaBoolean != nil { + return json.Marshal(o.JSONSchemaBoolean) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +type SchemaArray []JSONSchema +// +// --- Default --- +// +// true +type Items struct { + JSONSchema *JSONSchema + SchemaArray *SchemaArray +} +func (a *Items) UnmarshalJSON(bytes []byte) error { + var ok bool + var myJSONSchema JSONSchema + if err := json.Unmarshal(bytes, &myJSONSchema); err == nil { + ok = true + a.JSONSchema = &myJSONSchema + } + var mySchemaArray SchemaArray + if err := json.Unmarshal(bytes, &mySchemaArray); err == nil { + ok = true + a.SchemaArray = &mySchemaArray + } + if ok { + return nil + } + return errors.New("failed to unmarshal any of the object properties") +} +func (o Items) MarshalJSON() ([]byte, error) { + out := []interface{}{} + if o.JSONSchema != nil { + out = append(out, o.JSONSchema) + } + if o.SchemaArray != nil { + out = append(out, o.SchemaArray) + } + return json.Marshal(out) +} +type UniqueItems bool +type StringDoaGddGA string +// +// --- Default --- +// +// [] +type StringArray []StringDoaGddGA +// +// --- Default --- +// +// {} +type Definitions map[string]interface{} +// +// --- Default --- +// +// {} +type Properties map[string]interface{} +type PropertyNames interface{} +// +// --- Default --- +// +// {} +type PatternProperties map[string]interface{} +type DependenciesSet struct { + JSONSchema *JSONSchema + StringArray *StringArray +} +func (a *DependenciesSet) UnmarshalJSON(bytes []byte) error { + var ok bool + var myJSONSchema JSONSchema + if err := json.Unmarshal(bytes, &myJSONSchema); err == nil { + ok = true + a.JSONSchema = &myJSONSchema + } + var myStringArray StringArray + if err := json.Unmarshal(bytes, &myStringArray); err == nil { + ok = true + a.StringArray = &myStringArray + } + if ok { + return nil + } + return errors.New("failed to unmarshal any of the object properties") +} +func (o DependenciesSet) MarshalJSON() ([]byte, error) { + out := []interface{}{} + if o.JSONSchema != nil { + out = append(out, o.JSONSchema) + } + if o.StringArray != nil { + out = append(out, o.StringArray) + } + return json.Marshal(out) +} +type Dependencies map[string]interface{} +type Enum []AlwaysTrue +type SimpleTypes string +const ( + SimpleTypesEnum0 SimpleTypes = "array" + SimpleTypesEnum1 SimpleTypes = "boolean" + SimpleTypesEnum2 SimpleTypes = "integer" + SimpleTypesEnum3 SimpleTypes = "null" + SimpleTypesEnum4 SimpleTypes = "number" + SimpleTypesEnum5 SimpleTypes = "object" + SimpleTypesEnum6 SimpleTypes = "string" +) +type ArrayOfSimpleTypes []SimpleTypes +type Type struct { + SimpleTypes *SimpleTypes + ArrayOfSimpleTypes *ArrayOfSimpleTypes +} +func (a *Type) UnmarshalJSON(bytes []byte) error { + var ok bool + var mySimpleTypes SimpleTypes + if err := json.Unmarshal(bytes, &mySimpleTypes); err == nil { + ok = true + a.SimpleTypes = &mySimpleTypes + } + var myArrayOfSimpleTypes ArrayOfSimpleTypes + if err := json.Unmarshal(bytes, &myArrayOfSimpleTypes); err == nil { + ok = true + a.ArrayOfSimpleTypes = &myArrayOfSimpleTypes + } + if ok { + return nil + } + return errors.New("failed to unmarshal any of the object properties") +} +func (o Type) MarshalJSON() ([]byte, error) { + out := []interface{}{} + if o.SimpleTypes != nil { + out = append(out, o.SimpleTypes) + } + if o.ArrayOfSimpleTypes != nil { + out = append(out, o.ArrayOfSimpleTypes) + } + return json.Marshal(out) +} +type Format string +type ContentMediaType string +type ContentEncoding string +type JSONSchemaObject struct { + Id *Id `json:"$id,omitempty"` + Schema *Schema `json:"$schema,omitempty"` + Ref *Ref `json:"$ref,omitempty"` + Comment *Comment `json:"$comment,omitempty"` + Title *Title `json:"title,omitempty"` + Description *Description `json:"description,omitempty"` + Default *AlwaysTrue `json:"default,omitempty"` + ReadOnly *ReadOnly `json:"readOnly,omitempty"` + Examples *Examples `json:"examples,omitempty"` + MultipleOf *MultipleOf `json:"multipleOf,omitempty"` + Maximum *Maximum `json:"maximum,omitempty"` + ExclusiveMaximum *ExclusiveMaximum `json:"exclusiveMaximum,omitempty"` + Minimum *Minimum `json:"minimum,omitempty"` + ExclusiveMinimum *ExclusiveMinimum `json:"exclusiveMinimum,omitempty"` + MaxLength *NonNegativeInteger `json:"maxLength,omitempty"` + MinLength *NonNegativeIntegerDefaultZero `json:"minLength,omitempty"` + Pattern *Pattern `json:"pattern,omitempty"` + AdditionalItems *JSONSchema `json:"additionalItems,omitempty"` + Items *Items `json:"items,omitempty"` + MaxItems *NonNegativeInteger `json:"maxItems,omitempty"` + MinItems *NonNegativeIntegerDefaultZero `json:"minItems,omitempty"` + UniqueItems *UniqueItems `json:"uniqueItems,omitempty"` + Contains *JSONSchema `json:"contains,omitempty"` + MaxProperties *NonNegativeInteger `json:"maxProperties,omitempty"` + MinProperties *NonNegativeIntegerDefaultZero `json:"minProperties,omitempty"` + Required *StringArray `json:"required,omitempty"` + AdditionalProperties *JSONSchema `json:"additionalProperties,omitempty"` + Definitions *Definitions `json:"definitions,omitempty"` + Properties *Properties `json:"properties,omitempty"` + PatternProperties *PatternProperties `json:"patternProperties,omitempty"` + Dependencies *Dependencies `json:"dependencies,omitempty"` + PropertyNames *JSONSchema `json:"propertyNames,omitempty"` + Const *AlwaysTrue `json:"const,omitempty"` + Enum *Enum `json:"enum,omitempty"` + Type *Type `json:"type,omitempty"` + Format *Format `json:"format,omitempty"` + ContentMediaType *ContentMediaType `json:"contentMediaType,omitempty"` + ContentEncoding *ContentEncoding `json:"contentEncoding,omitempty"` + If *JSONSchema `json:"if,omitempty"` + Then *JSONSchema `json:"then,omitempty"` + Else *JSONSchema `json:"else,omitempty"` + AllOf *SchemaArray `json:"allOf,omitempty"` + AnyOf *SchemaArray `json:"anyOf,omitempty"` + OneOf *SchemaArray `json:"oneOf,omitempty"` + Not *JSONSchema `json:"not,omitempty"` +} +// Schema that describes the content. +// +// --- Default --- +// +// {} +type ContentDescriptorObjectSchema struct { + JSONSchemaObject *JSONSchemaObject + JSONSchemaBoolean *JSONSchemaBoolean +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ContentDescriptorObjectSchema) UnmarshalJSON(bytes []byte) error { + var myJSONSchemaObject JSONSchemaObject + if err := json.Unmarshal(bytes, &myJSONSchemaObject); err == nil { + o.JSONSchemaObject = &myJSONSchemaObject + return nil + } + var myJSONSchemaBoolean JSONSchemaBoolean + if err := json.Unmarshal(bytes, &myJSONSchemaBoolean); err == nil { + o.JSONSchemaBoolean = &myJSONSchemaBoolean + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ContentDescriptorObjectSchema) MarshalJSON() ([]byte, error) { + if o.JSONSchemaObject != nil { + return json.Marshal(o.JSONSchemaObject) + } + if o.JSONSchemaBoolean != nil { + return json.Marshal(o.JSONSchemaBoolean) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// Determines if the content is a required field. Default value is `false`. +type ContentDescriptorObjectRequired bool +// Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. +type ContentDescriptorObjectDeprecated bool +// Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. +type ContentDescriptorObject struct { + Name *ContentDescriptorObjectName `json:"name"` + Description *ContentDescriptorObjectDescription `json:"description,omitempty"` + Summary *ContentDescriptorObjectSummary `json:"summary,omitempty"` + Schema *ContentDescriptorObjectSchema `json:"schema"` + Required *ContentDescriptorObjectRequired `json:"required,omitempty"` + Deprecated *ContentDescriptorObjectDeprecated `json:"deprecated,omitempty"` +} +type ContentDescriptorOrReference struct { + ContentDescriptorObject *ContentDescriptorObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ContentDescriptorOrReference) UnmarshalJSON(bytes []byte) error { + var myContentDescriptorObject ContentDescriptorObject + if err := json.Unmarshal(bytes, &myContentDescriptorObject); err == nil { + o.ContentDescriptorObject = &myContentDescriptorObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ContentDescriptorOrReference) MarshalJSON() ([]byte, error) { + if o.ContentDescriptorObject != nil { + return json.Marshal(o.ContentDescriptorObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. +type MethodObjectParams []ContentDescriptorOrReference +// The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) +type MethodObjectResult struct { + ContentDescriptorObject *ContentDescriptorObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *MethodObjectResult) UnmarshalJSON(bytes []byte) error { + var myContentDescriptorObject ContentDescriptorObject + if err := json.Unmarshal(bytes, &myContentDescriptorObject); err == nil { + o.ContentDescriptorObject = &myContentDescriptorObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o MethodObjectResult) MarshalJSON() ([]byte, error) { + if o.ContentDescriptorObject != nil { + return json.Marshal(o.ContentDescriptorObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. +type ErrorObjectCode int64 +// A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. +type ErrorObjectMessage string +// A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). +type ErrorObjectData interface{} +// Defines an application level error. +type ErrorObject struct { + Code *ErrorObjectCode `json:"code"` + Message *ErrorObjectMessage `json:"message"` + Data *ErrorObjectData `json:"data,omitempty"` +} +type ErrorOrReference struct { + ErrorObject *ErrorObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ErrorOrReference) UnmarshalJSON(bytes []byte) error { + var myErrorObject ErrorObject + if err := json.Unmarshal(bytes, &myErrorObject); err == nil { + o.ErrorObject = &myErrorObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ErrorOrReference) MarshalJSON() ([]byte, error) { + if o.ErrorObject != nil { + return json.Marshal(o.ErrorObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +type MethodObjectErrors []ErrorOrReference +// Cannonical name of the link. +type LinkObjectName interface{} +// Short description for the link. +type LinkObjectSummary string +// The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. +type LinkObjectMethod string +// A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type LinkObjectDescription string +// A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. +type LinkObjectParams interface{} +// A server object to be used by the target method. +type LinkObjectServer struct { + Url *ServerObjectUrl `json:"url"` + Name *ServerObjectName `json:"name,omitempty"` + Description *ServerObjectDescription `json:"description,omitempty"` + Summary *ServerObjectSummary `json:"summary,omitempty"` + Variables *ServerObjectVariables `json:"variables,omitempty"` +} +// A object representing a Link +type LinkObject interface{} +type LinkOrReference struct { + LinkObject *LinkObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *LinkOrReference) UnmarshalJSON(bytes []byte) error { + var myLinkObject LinkObject + if err := json.Unmarshal(bytes, &myLinkObject); err == nil { + o.LinkObject = &myLinkObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o LinkOrReference) MarshalJSON() ([]byte, error) { + if o.LinkObject != nil { + return json.Marshal(o.LinkObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// A list of possible links from this method call. +type MethodObjectLinks []LinkOrReference +// Name for the example pairing. +type ExamplePairingObjectName string +// A verbose explanation of the example pairing. +type ExamplePairingObjectDescription string +// Short description for the example. +type ExampleObjectSummary string +// Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. +type ExampleObjectValue interface{} +// A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type ExampleObjectDescription string +// Cannonical name of the example. +type ExampleObjectName string +// The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). +type ExampleObject struct { + Summary *ExampleObjectSummary `json:"summary,omitempty"` + Value *ExampleObjectValue `json:"value"` + Description *ExampleObjectDescription `json:"description,omitempty"` + Name *ExampleObjectName `json:"name"` +} +type ExampleOrReference struct { + ExampleObject *ExampleObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ExampleOrReference) UnmarshalJSON(bytes []byte) error { + var myExampleObject ExampleObject + if err := json.Unmarshal(bytes, &myExampleObject); err == nil { + o.ExampleObject = &myExampleObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ExampleOrReference) MarshalJSON() ([]byte, error) { + if o.ExampleObject != nil { + return json.Marshal(o.ExampleObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// Example parameters. +type ExamplePairingObjectParams []ExampleOrReference +// Example result. When not provided, the example pairing represents usage of the method as a notification. +type ExamplePairingObjectResult struct { + ExampleObject *ExampleObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ExamplePairingObjectResult) UnmarshalJSON(bytes []byte) error { + var myExampleObject ExampleObject + if err := json.Unmarshal(bytes, &myExampleObject); err == nil { + o.ExampleObject = &myExampleObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ExamplePairingObjectResult) MarshalJSON() ([]byte, error) { + if o.ExampleObject != nil { + return json.Marshal(o.ExampleObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. +type ExamplePairingObject struct { + Name *ExamplePairingObjectName `json:"name"` + Description *ExamplePairingObjectDescription `json:"description,omitempty"` + Params *ExamplePairingObjectParams `json:"params"` + Result *ExamplePairingObjectResult `json:"result,omitempty"` +} +type ExamplePairingOrReference struct { + ExamplePairingObject *ExamplePairingObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *ExamplePairingOrReference) UnmarshalJSON(bytes []byte) error { + var myExamplePairingObject ExamplePairingObject + if err := json.Unmarshal(bytes, &myExamplePairingObject); err == nil { + o.ExamplePairingObject = &myExamplePairingObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o ExamplePairingOrReference) MarshalJSON() ([]byte, error) { + if o.ExamplePairingObject != nil { + return json.Marshal(o.ExamplePairingObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. +type MethodObjectExamples []ExamplePairingOrReference +// Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. +type MethodObjectDeprecated bool +// Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. +type MethodObject struct { + Name *MethodObjectName `json:"name"` + Description *MethodObjectDescription `json:"description,omitempty"` + Summary *MethodObjectSummary `json:"summary,omitempty"` + Servers *Servers `json:"servers,omitempty"` + Tags *MethodObjectTags `json:"tags,omitempty"` + ParamStructure *MethodObjectParamStructure `json:"paramStructure,omitempty"` + Params *MethodObjectParams `json:"params"` + Result *MethodObjectResult `json:"result,omitempty"` + Errors *MethodObjectErrors `json:"errors,omitempty"` + Links *MethodObjectLinks `json:"links,omitempty"` + Examples *MethodObjectExamples `json:"examples,omitempty"` + Deprecated *MethodObjectDeprecated `json:"deprecated,omitempty"` + ExternalDocs *ExternalDocumentationObject `json:"externalDocs,omitempty"` +} +type MethodOrReference struct { + MethodObject *MethodObject + ReferenceObject *ReferenceObject +} +// UnmarshalJSON implements the json Unmarshaler interface. +// This implementation DOES NOT assert that ONE AND ONLY ONE +// of the simple properties is satisfied; it lazily uses the first one that is satisfied. +// Ergo, it will not return an error if more than one property is valid. +func (o *MethodOrReference) UnmarshalJSON(bytes []byte) error { + var myMethodObject MethodObject + if err := json.Unmarshal(bytes, &myMethodObject); err == nil { + o.MethodObject = &myMethodObject + return nil + } + var myReferenceObject ReferenceObject + if err := json.Unmarshal(bytes, &myReferenceObject); err == nil { + o.ReferenceObject = &myReferenceObject + return nil + } + return errors.New("failed to unmarshal one of the object properties") +} +func (o MethodOrReference) MarshalJSON() ([]byte, error) { + if o.MethodObject != nil { + return json.Marshal(o.MethodObject) + } + if o.ReferenceObject != nil { + return json.Marshal(o.ReferenceObject) + } + return nil, errors.New("failed to marshal any one of the object properties") +} +// The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). +type Methods []MethodOrReference +// An object to hold reusable [Schema Objects](#schema-object). +type SchemaComponents map[string]interface{} +// An object to hold reusable [Link Objects](#link-object). +type LinkComponents map[string]interface{} +// An object to hold reusable [Error Objects](#error-object). +type ErrorComponents map[string]interface{} +// An object to hold reusable [Example Objects](#example-object). +type ExampleComponents map[string]interface{} +// An object to hold reusable [Example Pairing Objects](#example-pairing-object). +type ExamplePairingComponents map[string]interface{} +// An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). +type ContentDescriptorComponents map[string]interface{} +// An object to hold reusable [Tag Objects](#tag-object). +type TagComponents map[string]interface{} +// Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +type Components struct { + Schemas *SchemaComponents `json:"schemas,omitempty"` + Links *LinkComponents `json:"links,omitempty"` + Errors *ErrorComponents `json:"errors,omitempty"` + Examples *ExampleComponents `json:"examples,omitempty"` + ExamplePairings *ExamplePairingComponents `json:"examplePairings,omitempty"` + ContentDescriptors *ContentDescriptorComponents `json:"contentDescriptors,omitempty"` + Tags *TagComponents `json:"tags,omitempty"` +} +// JSON Schema URI (used by some editors) +// +// --- Default --- +// +// https://meta.open-rpc.org/ +type MetaSchema string +type OpenrpcDocument struct { + Openrpc *Openrpc `json:"openrpc"` + Info *InfoObject `json:"info"` + ExternalDocs *ExternalDocumentationObject `json:"externalDocs,omitempty"` + Servers *Servers `json:"servers,omitempty"` + Methods *Methods `json:"methods"` + Components *Components `json:"components,omitempty"` + Schema *MetaSchema `json:"$schema,omitempty"` +} diff --git a/generated/packages/py/pyproject.toml b/generated/packages/py/pyproject.toml new file mode 100644 index 0000000..7f3ef0b --- /dev/null +++ b/generated/packages/py/pyproject.toml @@ -0,0 +1,10 @@ +[build-system] +requires = [ "hatchling" ] +build-backend = "hatchling.build" + +[project] +name = "open-rpc-spec-types" +version = "0.0.0" +description = "Generated OpenRPC specification types" +license = "Apache-2.0" +requires-python = ">=3.12" diff --git a/generated/packages/py/src/open_rpc_spec_types/__init__.py b/generated/packages/py/src/open_rpc_spec_types/__init__.py new file mode 100644 index 0000000..7f5ede2 --- /dev/null +++ b/generated/packages/py/src/open_rpc_spec_types/__init__.py @@ -0,0 +1,2 @@ +from . import v1_4 +from . import v1_3 diff --git a/generated/packages/py/src/open_rpc_spec_types/v1_3.py b/generated/packages/py/src/open_rpc_spec_types/v1_3.py new file mode 100644 index 0000000..5a732c7 --- /dev/null +++ b/generated/packages/py/src/open_rpc_spec_types/v1_3.py @@ -0,0 +1,472 @@ +from typing import TypedDict +from typing import Optional +from typing import NewType +from typing import Any +from typing import List +from typing import Mapping +from typing import Union +from enum import Enum +"""This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. +""" +Openrpc = NewType("Openrpc", str) +"""The title of the application. +""" +InfoObjectTitle = NewType("InfoObjectTitle", str) +"""A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +InfoObjectDescription = NewType("InfoObjectDescription", str) +"""A URL to the Terms of Service for the API. MUST be in the format of a URL. +""" +InfoObjectTermsOfService = NewType("InfoObjectTermsOfService", str) +"""The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +""" +InfoObjectVersion = NewType("InfoObjectVersion", str) +"""The identifying name of the contact person/organization. +""" +ContactObjectName = NewType("ContactObjectName", str) +"""The email address of the contact person/organization. MUST be in the format of an email address. +""" +ContactObjectEmail = NewType("ContactObjectEmail", str) +"""The URL pointing to the contact information. MUST be in the format of a URL. +""" +ContactObjectUrl = NewType("ContactObjectUrl", str) +"""This object MAY be extended with [Specification Extensions](#specification-extensions). +""" +SpecificationExtension = NewType("SpecificationExtension", Any) +"""Contact information for the exposed API. +""" +class ContactObject(TypedDict): + name: Optional[ContactObjectName] + email: Optional[ContactObjectEmail] + url: Optional[ContactObjectUrl] +"""The license name used for the API. +""" +LicenseObjectName = NewType("LicenseObjectName", str) +"""A URL to the license used for the API. MUST be in the format of a URL. +""" +LicenseObjectUrl = NewType("LicenseObjectUrl", str) +"""License information for the exposed API. +""" +class LicenseObject(TypedDict): + name: Optional[LicenseObjectName] + url: Optional[LicenseObjectUrl] +"""The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +""" +InfoObject = NewType("InfoObject", Any) +"""A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ExternalDocumentationObjectDescription = NewType("ExternalDocumentationObjectDescription", str) +"""The URL for the target documentation. Value MUST be in the format of a URL. +""" +ExternalDocumentationObjectUrl = NewType("ExternalDocumentationObjectUrl", str) +"""Additional external documentation for this tag. +""" +class ExternalDocumentationObject(TypedDict): + description: Optional[ExternalDocumentationObjectDescription] + url: Optional[ExternalDocumentationObjectUrl] +"""A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +""" +ServerObjectUrl = NewType("ServerObjectUrl", str) +"""An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ServerObjectName = NewType("ServerObjectName", str) +"""An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ServerObjectDescription = NewType("ServerObjectDescription", str) +"""A short summary of what the server is. +""" +ServerObjectSummary = NewType("ServerObjectSummary", str) +"""The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. +""" +ServerObjectVariableDefault = NewType("ServerObjectVariableDefault", str) +"""An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ServerObjectVariableDescription = NewType("ServerObjectVariableDescription", str) +"""An enumeration of string values to be used if the substitution options are from a limited set. +""" +ServerObjectVariableEnumItem = NewType("ServerObjectVariableEnumItem", str) +"""An enumeration of string values to be used if the substitution options are from a limited set. +""" +ServerObjectVariableEnum = NewType("ServerObjectVariableEnum", List[ServerObjectVariableEnumItem]) +"""An object representing a Server Variable for server URL template substitution. +""" +class ServerObjectVariable(TypedDict): + default: Optional[ServerObjectVariableDefault] + description: Optional[ServerObjectVariableDescription] + enum: Optional[ServerObjectVariableEnum] +"""A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +""" +ServerObjectVariables = NewType("ServerObjectVariables", Mapping[Any, Any]) +"""A object representing a Server +""" +class ServerObject(TypedDict): + url: Optional[ServerObjectUrl] + name: Optional[ServerObjectName] + description: Optional[ServerObjectDescription] + summary: Optional[ServerObjectSummary] + variables: Optional[ServerObjectVariables] +AlwaysFalse = NewType("AlwaysFalse", Any) +"""An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. +""" +Servers = NewType("Servers", List[ServerObject]) +"""The cannonical name for the method. The name MUST be unique within the methods array. +""" +MethodObjectName = NewType("MethodObjectName", str) +"""A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. +""" +MethodObjectDescription = NewType("MethodObjectDescription", str) +"""A short summary of what the method does. +""" +MethodObjectSummary = NewType("MethodObjectSummary", str) +"""The name of the tag. +""" +TagObjectName = NewType("TagObjectName", str) +"""A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +TagObjectDescription = NewType("TagObjectDescription", str) +"""Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. +""" +class TagObject(TypedDict): + name: Optional[TagObjectName] + description: Optional[TagObjectDescription] + externalDocs: Optional[ExternalDocumentationObject] + +Ref = NewType("Ref", str) + +class ReferenceObject(TypedDict): + $ref: undefined + +TagOrReference = NewType("TagOrReference", Union[TagObject, ReferenceObject]) +"""A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. +""" +MethodObjectTags = NewType("MethodObjectTags", List[TagOrReference]) +"""Format the server expects the params. Defaults to 'either'. +""" +class MethodObjectParamStructure(Enum): + ByPosition = 0 + ByName = 1 + Either = 2 +"""Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). +""" +ContentDescriptorObjectName = NewType("ContentDescriptorObjectName", str) +"""A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ContentDescriptorObjectDescription = NewType("ContentDescriptorObjectDescription", str) +"""A short summary of the content that is being described. +""" +ContentDescriptorObjectSummary = NewType("ContentDescriptorObjectSummary", str) + +Id = NewType("Id", str) + +Schema = NewType("Schema", str) + +Comment = NewType("Comment", str) + +Title = NewType("Title", str) + +Description = NewType("Description", str) +AlwaysTrue = NewType("AlwaysTrue", Any) + +ReadOnly = NewType("ReadOnly", bool) + +Examples = NewType("Examples", List[AlwaysTrue]) + +MultipleOf = NewType("MultipleOf", float) + +Maximum = NewType("Maximum", float) + +ExclusiveMaximum = NewType("ExclusiveMaximum", float) + +Minimum = NewType("Minimum", float) + +ExclusiveMinimum = NewType("ExclusiveMinimum", float) + +NonNegativeInteger = NewType("NonNegativeInteger", int) + +NonNegativeIntegerDefaultZero = NewType("NonNegativeIntegerDefaultZero", int) + +Pattern = NewType("Pattern", str) +"""Always valid if true. Never valid if false. Is constant. +""" +JSONSchemaBoolean = NewType("JSONSchemaBoolean", bool) + +JSONSchema = NewType("JSONSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) + +SchemaArray = NewType("SchemaArray", List[JSONSchema]) + +Items = NewType("Items", Union[JSONSchema, SchemaArray]) + +UniqueItems = NewType("UniqueItems", bool) + +StringDoaGddGA = NewType("StringDoaGddGA", str) + +StringArray = NewType("StringArray", List[StringDoaGddGA]) + +Definitions = NewType("Definitions", Mapping[Any, Any]) + +Properties = NewType("Properties", Mapping[Any, Any]) + +PropertyNames = NewType("PropertyNames", Any) + +PatternProperties = NewType("PatternProperties", Mapping[Any, Any]) + +DependenciesSet = NewType("DependenciesSet", Union[JSONSchema, StringArray]) + +Dependencies = NewType("Dependencies", Mapping[Any, Any]) + +Enum = NewType("Enum", List[AlwaysTrue]) + +class SimpleTypes(Enum): + Array = 0 + Boolean = 1 + Integer = 2 + Null = 3 + Number = 4 + Object = 5 + String = 6 + +ArrayOfSimpleTypes = NewType("ArrayOfSimpleTypes", List[SimpleTypes]) + +Type = NewType("Type", Union[SimpleTypes, ArrayOfSimpleTypes]) + +Format = NewType("Format", str) + +ContentMediaType = NewType("ContentMediaType", str) + +ContentEncoding = NewType("ContentEncoding", str) + +class JSONSchemaObject(TypedDict): + $id: Optional[Id] + $schema: Optional[Schema] + $ref: Optional[Ref] + $comment: Optional[Comment] + title: Optional[Title] + description: Optional[Description] + default: Optional[AlwaysTrue] + readOnly: Optional[ReadOnly] + examples: Optional[Examples] + multipleOf: Optional[MultipleOf] + maximum: Optional[Maximum] + exclusiveMaximum: Optional[ExclusiveMaximum] + minimum: Optional[Minimum] + exclusiveMinimum: Optional[ExclusiveMinimum] + maxLength: Optional[NonNegativeInteger] + minLength: Optional[NonNegativeIntegerDefaultZero] + pattern: Optional[Pattern] + additionalItems: Optional[JSONSchema] + items: Optional[Items] + maxItems: Optional[NonNegativeInteger] + minItems: Optional[NonNegativeIntegerDefaultZero] + uniqueItems: Optional[UniqueItems] + contains: Optional[JSONSchema] + maxProperties: Optional[NonNegativeInteger] + minProperties: Optional[NonNegativeIntegerDefaultZero] + required: Optional[StringArray] + additionalProperties: Optional[JSONSchema] + definitions: Optional[Definitions] + properties: Optional[Properties] + patternProperties: Optional[PatternProperties] + dependencies: Optional[Dependencies] + propertyNames: Optional[JSONSchema] + const: Optional[AlwaysTrue] + enum: Optional[Enum] + type: Optional[Type] + format: Optional[Format] + contentMediaType: Optional[ContentMediaType] + contentEncoding: Optional[ContentEncoding] + if: Optional[JSONSchema] + then: Optional[JSONSchema] + else: Optional[JSONSchema] + allOf: Optional[SchemaArray] + anyOf: Optional[SchemaArray] + oneOf: Optional[SchemaArray] + not: Optional[JSONSchema] +"""Schema that describes the content. +""" +ContentDescriptorObjectSchema = NewType("ContentDescriptorObjectSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) +"""Determines if the content is a required field. Default value is `false`. +""" +ContentDescriptorObjectRequired = NewType("ContentDescriptorObjectRequired", bool) +"""Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. +""" +ContentDescriptorObjectDeprecated = NewType("ContentDescriptorObjectDeprecated", bool) +"""Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. +""" +class ContentDescriptorObject(TypedDict): + name: Optional[ContentDescriptorObjectName] + description: Optional[ContentDescriptorObjectDescription] + summary: Optional[ContentDescriptorObjectSummary] + schema: Optional[ContentDescriptorObjectSchema] + required: Optional[ContentDescriptorObjectRequired] + deprecated: Optional[ContentDescriptorObjectDeprecated] + +ContentDescriptorOrReference = NewType("ContentDescriptorOrReference", Union[ContentDescriptorObject, ReferenceObject]) +""" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. +""" +MethodObjectParams = NewType("MethodObjectParams", List[ContentDescriptorOrReference]) +"""The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) +""" +MethodObjectResult = NewType("MethodObjectResult", Union[ContentDescriptorObject, ReferenceObject]) +"""A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. +""" +ErrorObjectCode = NewType("ErrorObjectCode", int) +"""A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. +""" +ErrorObjectMessage = NewType("ErrorObjectMessage", str) +"""A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). +""" +ErrorObjectData = NewType("ErrorObjectData", Any) +"""Defines an application level error. +""" +class ErrorObject(TypedDict): + code: Optional[ErrorObjectCode] + message: Optional[ErrorObjectMessage] + data: Optional[ErrorObjectData] + +ErrorOrReference = NewType("ErrorOrReference", Union[ErrorObject, ReferenceObject]) +"""A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +""" +MethodObjectErrors = NewType("MethodObjectErrors", List[ErrorOrReference]) +"""Cannonical name of the link. +""" +LinkObjectName = NewType("LinkObjectName", Any) +"""Short description for the link. +""" +LinkObjectSummary = NewType("LinkObjectSummary", str) +"""The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. +""" +LinkObjectMethod = NewType("LinkObjectMethod", str) +"""A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +LinkObjectDescription = NewType("LinkObjectDescription", str) +"""A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. +""" +LinkObjectParams = NewType("LinkObjectParams", Any) +"""A server object to be used by the target method. +""" +class LinkObjectServer(TypedDict): + url: Optional[ServerObjectUrl] + name: Optional[ServerObjectName] + description: Optional[ServerObjectDescription] + summary: Optional[ServerObjectSummary] + variables: Optional[ServerObjectVariables] +"""A object representing a Link +""" +LinkObject = NewType("LinkObject", Any) + +LinkOrReference = NewType("LinkOrReference", Union[LinkObject, ReferenceObject]) +"""A list of possible links from this method call. +""" +MethodObjectLinks = NewType("MethodObjectLinks", List[LinkOrReference]) +"""Name for the example pairing. +""" +ExamplePairingObjectName = NewType("ExamplePairingObjectName", str) +"""A verbose explanation of the example pairing. +""" +ExamplePairingObjectDescription = NewType("ExamplePairingObjectDescription", str) +"""Short description for the example. +""" +ExampleObjectSummary = NewType("ExampleObjectSummary", str) +"""Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. +""" +ExampleObjectValue = NewType("ExampleObjectValue", Any) +"""A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ExampleObjectDescription = NewType("ExampleObjectDescription", str) +"""Cannonical name of the example. +""" +ExampleObjectName = NewType("ExampleObjectName", str) +"""The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). +""" +class ExampleObject(TypedDict): + summary: Optional[ExampleObjectSummary] + value: Optional[ExampleObjectValue] + description: Optional[ExampleObjectDescription] + name: Optional[ExampleObjectName] + +ExampleOrReference = NewType("ExampleOrReference", Union[ExampleObject, ReferenceObject]) +"""Example parameters. +""" +ExamplePairingObjectParams = NewType("ExamplePairingObjectParams", List[ExampleOrReference]) +"""Example result. When not provided, the example pairing represents usage of the method as a notification. +""" +ExamplePairingObjectResult = NewType("ExamplePairingObjectResult", Union[ExampleObject, ReferenceObject]) +"""The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. +""" +class ExamplePairingObject(TypedDict): + name: Optional[ExamplePairingObjectName] + description: Optional[ExamplePairingObjectDescription] + params: Optional[ExamplePairingObjectParams] + result: Optional[ExamplePairingObjectResult] + +ExamplePairingOrReference = NewType("ExamplePairingOrReference", Union[ExamplePairingObject, ReferenceObject]) +"""Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. +""" +MethodObjectExamples = NewType("MethodObjectExamples", List[ExamplePairingOrReference]) +"""Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. +""" +MethodObjectDeprecated = NewType("MethodObjectDeprecated", bool) +"""Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. +""" +class MethodObject(TypedDict): + name: Optional[MethodObjectName] + description: Optional[MethodObjectDescription] + summary: Optional[MethodObjectSummary] + servers: Optional[Servers] + tags: Optional[MethodObjectTags] + paramStructure: Optional[MethodObjectParamStructure] + params: Optional[MethodObjectParams] + result: Optional[MethodObjectResult] + errors: Optional[MethodObjectErrors] + links: Optional[MethodObjectLinks] + examples: Optional[MethodObjectExamples] + deprecated: Optional[MethodObjectDeprecated] + externalDocs: Optional[ExternalDocumentationObject] + +MethodOrReference = NewType("MethodOrReference", Union[MethodObject, ReferenceObject]) +"""The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). +""" +Methods = NewType("Methods", List[MethodOrReference]) +"""An object to hold reusable [Schema Objects](#schema-object). +""" +SchemaComponents = NewType("SchemaComponents", Mapping[Any, Any]) +"""An object to hold reusable [Link Objects](#link-object). +""" +LinkComponents = NewType("LinkComponents", Mapping[Any, Any]) +"""An object to hold reusable [Error Objects](#error-object). +""" +ErrorComponents = NewType("ErrorComponents", Mapping[Any, Any]) +"""An object to hold reusable [Example Objects](#example-object). +""" +ExampleComponents = NewType("ExampleComponents", Mapping[Any, Any]) +"""An object to hold reusable [Example Pairing Objects](#example-pairing-object). +""" +ExamplePairingComponents = NewType("ExamplePairingComponents", Mapping[Any, Any]) +"""An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). +""" +ContentDescriptorComponents = NewType("ContentDescriptorComponents", Mapping[Any, Any]) +"""An object to hold reusable [Tag Objects](#tag-object). +""" +TagComponents = NewType("TagComponents", Mapping[Any, Any]) +"""Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +""" +class Components(TypedDict): + schemas: Optional[SchemaComponents] + links: Optional[LinkComponents] + errors: Optional[ErrorComponents] + examples: Optional[ExampleComponents] + examplePairings: Optional[ExamplePairingComponents] + contentDescriptors: Optional[ContentDescriptorComponents] + tags: Optional[TagComponents] +"""JSON Schema URI (used by some editors) +""" +MetaSchema = NewType("MetaSchema", str) + +class OpenrpcDocument(TypedDict): + openrpc: undefined + info: Optional[InfoObject] + externalDocs: Optional[ExternalDocumentationObject] + servers: Optional[Servers] + methods: undefined + components: Optional[Components] + $schema: Optional[MetaSchema] \ No newline at end of file diff --git a/generated/packages/py/src/open_rpc_spec_types/v1_4.py b/generated/packages/py/src/open_rpc_spec_types/v1_4.py new file mode 100644 index 0000000..5a732c7 --- /dev/null +++ b/generated/packages/py/src/open_rpc_spec_types/v1_4.py @@ -0,0 +1,472 @@ +from typing import TypedDict +from typing import Optional +from typing import NewType +from typing import Any +from typing import List +from typing import Mapping +from typing import Union +from enum import Enum +"""This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. +""" +Openrpc = NewType("Openrpc", str) +"""The title of the application. +""" +InfoObjectTitle = NewType("InfoObjectTitle", str) +"""A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +InfoObjectDescription = NewType("InfoObjectDescription", str) +"""A URL to the Terms of Service for the API. MUST be in the format of a URL. +""" +InfoObjectTermsOfService = NewType("InfoObjectTermsOfService", str) +"""The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +""" +InfoObjectVersion = NewType("InfoObjectVersion", str) +"""The identifying name of the contact person/organization. +""" +ContactObjectName = NewType("ContactObjectName", str) +"""The email address of the contact person/organization. MUST be in the format of an email address. +""" +ContactObjectEmail = NewType("ContactObjectEmail", str) +"""The URL pointing to the contact information. MUST be in the format of a URL. +""" +ContactObjectUrl = NewType("ContactObjectUrl", str) +"""This object MAY be extended with [Specification Extensions](#specification-extensions). +""" +SpecificationExtension = NewType("SpecificationExtension", Any) +"""Contact information for the exposed API. +""" +class ContactObject(TypedDict): + name: Optional[ContactObjectName] + email: Optional[ContactObjectEmail] + url: Optional[ContactObjectUrl] +"""The license name used for the API. +""" +LicenseObjectName = NewType("LicenseObjectName", str) +"""A URL to the license used for the API. MUST be in the format of a URL. +""" +LicenseObjectUrl = NewType("LicenseObjectUrl", str) +"""License information for the exposed API. +""" +class LicenseObject(TypedDict): + name: Optional[LicenseObjectName] + url: Optional[LicenseObjectUrl] +"""The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +""" +InfoObject = NewType("InfoObject", Any) +"""A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ExternalDocumentationObjectDescription = NewType("ExternalDocumentationObjectDescription", str) +"""The URL for the target documentation. Value MUST be in the format of a URL. +""" +ExternalDocumentationObjectUrl = NewType("ExternalDocumentationObjectUrl", str) +"""Additional external documentation for this tag. +""" +class ExternalDocumentationObject(TypedDict): + description: Optional[ExternalDocumentationObjectDescription] + url: Optional[ExternalDocumentationObjectUrl] +"""A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +""" +ServerObjectUrl = NewType("ServerObjectUrl", str) +"""An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ServerObjectName = NewType("ServerObjectName", str) +"""An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ServerObjectDescription = NewType("ServerObjectDescription", str) +"""A short summary of what the server is. +""" +ServerObjectSummary = NewType("ServerObjectSummary", str) +"""The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. +""" +ServerObjectVariableDefault = NewType("ServerObjectVariableDefault", str) +"""An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ServerObjectVariableDescription = NewType("ServerObjectVariableDescription", str) +"""An enumeration of string values to be used if the substitution options are from a limited set. +""" +ServerObjectVariableEnumItem = NewType("ServerObjectVariableEnumItem", str) +"""An enumeration of string values to be used if the substitution options are from a limited set. +""" +ServerObjectVariableEnum = NewType("ServerObjectVariableEnum", List[ServerObjectVariableEnumItem]) +"""An object representing a Server Variable for server URL template substitution. +""" +class ServerObjectVariable(TypedDict): + default: Optional[ServerObjectVariableDefault] + description: Optional[ServerObjectVariableDescription] + enum: Optional[ServerObjectVariableEnum] +"""A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +""" +ServerObjectVariables = NewType("ServerObjectVariables", Mapping[Any, Any]) +"""A object representing a Server +""" +class ServerObject(TypedDict): + url: Optional[ServerObjectUrl] + name: Optional[ServerObjectName] + description: Optional[ServerObjectDescription] + summary: Optional[ServerObjectSummary] + variables: Optional[ServerObjectVariables] +AlwaysFalse = NewType("AlwaysFalse", Any) +"""An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. +""" +Servers = NewType("Servers", List[ServerObject]) +"""The cannonical name for the method. The name MUST be unique within the methods array. +""" +MethodObjectName = NewType("MethodObjectName", str) +"""A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. +""" +MethodObjectDescription = NewType("MethodObjectDescription", str) +"""A short summary of what the method does. +""" +MethodObjectSummary = NewType("MethodObjectSummary", str) +"""The name of the tag. +""" +TagObjectName = NewType("TagObjectName", str) +"""A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +TagObjectDescription = NewType("TagObjectDescription", str) +"""Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. +""" +class TagObject(TypedDict): + name: Optional[TagObjectName] + description: Optional[TagObjectDescription] + externalDocs: Optional[ExternalDocumentationObject] + +Ref = NewType("Ref", str) + +class ReferenceObject(TypedDict): + $ref: undefined + +TagOrReference = NewType("TagOrReference", Union[TagObject, ReferenceObject]) +"""A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. +""" +MethodObjectTags = NewType("MethodObjectTags", List[TagOrReference]) +"""Format the server expects the params. Defaults to 'either'. +""" +class MethodObjectParamStructure(Enum): + ByPosition = 0 + ByName = 1 + Either = 2 +"""Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). +""" +ContentDescriptorObjectName = NewType("ContentDescriptorObjectName", str) +"""A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ContentDescriptorObjectDescription = NewType("ContentDescriptorObjectDescription", str) +"""A short summary of the content that is being described. +""" +ContentDescriptorObjectSummary = NewType("ContentDescriptorObjectSummary", str) + +Id = NewType("Id", str) + +Schema = NewType("Schema", str) + +Comment = NewType("Comment", str) + +Title = NewType("Title", str) + +Description = NewType("Description", str) +AlwaysTrue = NewType("AlwaysTrue", Any) + +ReadOnly = NewType("ReadOnly", bool) + +Examples = NewType("Examples", List[AlwaysTrue]) + +MultipleOf = NewType("MultipleOf", float) + +Maximum = NewType("Maximum", float) + +ExclusiveMaximum = NewType("ExclusiveMaximum", float) + +Minimum = NewType("Minimum", float) + +ExclusiveMinimum = NewType("ExclusiveMinimum", float) + +NonNegativeInteger = NewType("NonNegativeInteger", int) + +NonNegativeIntegerDefaultZero = NewType("NonNegativeIntegerDefaultZero", int) + +Pattern = NewType("Pattern", str) +"""Always valid if true. Never valid if false. Is constant. +""" +JSONSchemaBoolean = NewType("JSONSchemaBoolean", bool) + +JSONSchema = NewType("JSONSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) + +SchemaArray = NewType("SchemaArray", List[JSONSchema]) + +Items = NewType("Items", Union[JSONSchema, SchemaArray]) + +UniqueItems = NewType("UniqueItems", bool) + +StringDoaGddGA = NewType("StringDoaGddGA", str) + +StringArray = NewType("StringArray", List[StringDoaGddGA]) + +Definitions = NewType("Definitions", Mapping[Any, Any]) + +Properties = NewType("Properties", Mapping[Any, Any]) + +PropertyNames = NewType("PropertyNames", Any) + +PatternProperties = NewType("PatternProperties", Mapping[Any, Any]) + +DependenciesSet = NewType("DependenciesSet", Union[JSONSchema, StringArray]) + +Dependencies = NewType("Dependencies", Mapping[Any, Any]) + +Enum = NewType("Enum", List[AlwaysTrue]) + +class SimpleTypes(Enum): + Array = 0 + Boolean = 1 + Integer = 2 + Null = 3 + Number = 4 + Object = 5 + String = 6 + +ArrayOfSimpleTypes = NewType("ArrayOfSimpleTypes", List[SimpleTypes]) + +Type = NewType("Type", Union[SimpleTypes, ArrayOfSimpleTypes]) + +Format = NewType("Format", str) + +ContentMediaType = NewType("ContentMediaType", str) + +ContentEncoding = NewType("ContentEncoding", str) + +class JSONSchemaObject(TypedDict): + $id: Optional[Id] + $schema: Optional[Schema] + $ref: Optional[Ref] + $comment: Optional[Comment] + title: Optional[Title] + description: Optional[Description] + default: Optional[AlwaysTrue] + readOnly: Optional[ReadOnly] + examples: Optional[Examples] + multipleOf: Optional[MultipleOf] + maximum: Optional[Maximum] + exclusiveMaximum: Optional[ExclusiveMaximum] + minimum: Optional[Minimum] + exclusiveMinimum: Optional[ExclusiveMinimum] + maxLength: Optional[NonNegativeInteger] + minLength: Optional[NonNegativeIntegerDefaultZero] + pattern: Optional[Pattern] + additionalItems: Optional[JSONSchema] + items: Optional[Items] + maxItems: Optional[NonNegativeInteger] + minItems: Optional[NonNegativeIntegerDefaultZero] + uniqueItems: Optional[UniqueItems] + contains: Optional[JSONSchema] + maxProperties: Optional[NonNegativeInteger] + minProperties: Optional[NonNegativeIntegerDefaultZero] + required: Optional[StringArray] + additionalProperties: Optional[JSONSchema] + definitions: Optional[Definitions] + properties: Optional[Properties] + patternProperties: Optional[PatternProperties] + dependencies: Optional[Dependencies] + propertyNames: Optional[JSONSchema] + const: Optional[AlwaysTrue] + enum: Optional[Enum] + type: Optional[Type] + format: Optional[Format] + contentMediaType: Optional[ContentMediaType] + contentEncoding: Optional[ContentEncoding] + if: Optional[JSONSchema] + then: Optional[JSONSchema] + else: Optional[JSONSchema] + allOf: Optional[SchemaArray] + anyOf: Optional[SchemaArray] + oneOf: Optional[SchemaArray] + not: Optional[JSONSchema] +"""Schema that describes the content. +""" +ContentDescriptorObjectSchema = NewType("ContentDescriptorObjectSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) +"""Determines if the content is a required field. Default value is `false`. +""" +ContentDescriptorObjectRequired = NewType("ContentDescriptorObjectRequired", bool) +"""Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. +""" +ContentDescriptorObjectDeprecated = NewType("ContentDescriptorObjectDeprecated", bool) +"""Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. +""" +class ContentDescriptorObject(TypedDict): + name: Optional[ContentDescriptorObjectName] + description: Optional[ContentDescriptorObjectDescription] + summary: Optional[ContentDescriptorObjectSummary] + schema: Optional[ContentDescriptorObjectSchema] + required: Optional[ContentDescriptorObjectRequired] + deprecated: Optional[ContentDescriptorObjectDeprecated] + +ContentDescriptorOrReference = NewType("ContentDescriptorOrReference", Union[ContentDescriptorObject, ReferenceObject]) +""" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. +""" +MethodObjectParams = NewType("MethodObjectParams", List[ContentDescriptorOrReference]) +"""The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) +""" +MethodObjectResult = NewType("MethodObjectResult", Union[ContentDescriptorObject, ReferenceObject]) +"""A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. +""" +ErrorObjectCode = NewType("ErrorObjectCode", int) +"""A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. +""" +ErrorObjectMessage = NewType("ErrorObjectMessage", str) +"""A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). +""" +ErrorObjectData = NewType("ErrorObjectData", Any) +"""Defines an application level error. +""" +class ErrorObject(TypedDict): + code: Optional[ErrorObjectCode] + message: Optional[ErrorObjectMessage] + data: Optional[ErrorObjectData] + +ErrorOrReference = NewType("ErrorOrReference", Union[ErrorObject, ReferenceObject]) +"""A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +""" +MethodObjectErrors = NewType("MethodObjectErrors", List[ErrorOrReference]) +"""Cannonical name of the link. +""" +LinkObjectName = NewType("LinkObjectName", Any) +"""Short description for the link. +""" +LinkObjectSummary = NewType("LinkObjectSummary", str) +"""The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. +""" +LinkObjectMethod = NewType("LinkObjectMethod", str) +"""A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +LinkObjectDescription = NewType("LinkObjectDescription", str) +"""A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. +""" +LinkObjectParams = NewType("LinkObjectParams", Any) +"""A server object to be used by the target method. +""" +class LinkObjectServer(TypedDict): + url: Optional[ServerObjectUrl] + name: Optional[ServerObjectName] + description: Optional[ServerObjectDescription] + summary: Optional[ServerObjectSummary] + variables: Optional[ServerObjectVariables] +"""A object representing a Link +""" +LinkObject = NewType("LinkObject", Any) + +LinkOrReference = NewType("LinkOrReference", Union[LinkObject, ReferenceObject]) +"""A list of possible links from this method call. +""" +MethodObjectLinks = NewType("MethodObjectLinks", List[LinkOrReference]) +"""Name for the example pairing. +""" +ExamplePairingObjectName = NewType("ExamplePairingObjectName", str) +"""A verbose explanation of the example pairing. +""" +ExamplePairingObjectDescription = NewType("ExamplePairingObjectDescription", str) +"""Short description for the example. +""" +ExampleObjectSummary = NewType("ExampleObjectSummary", str) +"""Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. +""" +ExampleObjectValue = NewType("ExampleObjectValue", Any) +"""A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +""" +ExampleObjectDescription = NewType("ExampleObjectDescription", str) +"""Cannonical name of the example. +""" +ExampleObjectName = NewType("ExampleObjectName", str) +"""The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). +""" +class ExampleObject(TypedDict): + summary: Optional[ExampleObjectSummary] + value: Optional[ExampleObjectValue] + description: Optional[ExampleObjectDescription] + name: Optional[ExampleObjectName] + +ExampleOrReference = NewType("ExampleOrReference", Union[ExampleObject, ReferenceObject]) +"""Example parameters. +""" +ExamplePairingObjectParams = NewType("ExamplePairingObjectParams", List[ExampleOrReference]) +"""Example result. When not provided, the example pairing represents usage of the method as a notification. +""" +ExamplePairingObjectResult = NewType("ExamplePairingObjectResult", Union[ExampleObject, ReferenceObject]) +"""The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. +""" +class ExamplePairingObject(TypedDict): + name: Optional[ExamplePairingObjectName] + description: Optional[ExamplePairingObjectDescription] + params: Optional[ExamplePairingObjectParams] + result: Optional[ExamplePairingObjectResult] + +ExamplePairingOrReference = NewType("ExamplePairingOrReference", Union[ExamplePairingObject, ReferenceObject]) +"""Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. +""" +MethodObjectExamples = NewType("MethodObjectExamples", List[ExamplePairingOrReference]) +"""Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. +""" +MethodObjectDeprecated = NewType("MethodObjectDeprecated", bool) +"""Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. +""" +class MethodObject(TypedDict): + name: Optional[MethodObjectName] + description: Optional[MethodObjectDescription] + summary: Optional[MethodObjectSummary] + servers: Optional[Servers] + tags: Optional[MethodObjectTags] + paramStructure: Optional[MethodObjectParamStructure] + params: Optional[MethodObjectParams] + result: Optional[MethodObjectResult] + errors: Optional[MethodObjectErrors] + links: Optional[MethodObjectLinks] + examples: Optional[MethodObjectExamples] + deprecated: Optional[MethodObjectDeprecated] + externalDocs: Optional[ExternalDocumentationObject] + +MethodOrReference = NewType("MethodOrReference", Union[MethodObject, ReferenceObject]) +"""The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). +""" +Methods = NewType("Methods", List[MethodOrReference]) +"""An object to hold reusable [Schema Objects](#schema-object). +""" +SchemaComponents = NewType("SchemaComponents", Mapping[Any, Any]) +"""An object to hold reusable [Link Objects](#link-object). +""" +LinkComponents = NewType("LinkComponents", Mapping[Any, Any]) +"""An object to hold reusable [Error Objects](#error-object). +""" +ErrorComponents = NewType("ErrorComponents", Mapping[Any, Any]) +"""An object to hold reusable [Example Objects](#example-object). +""" +ExampleComponents = NewType("ExampleComponents", Mapping[Any, Any]) +"""An object to hold reusable [Example Pairing Objects](#example-pairing-object). +""" +ExamplePairingComponents = NewType("ExamplePairingComponents", Mapping[Any, Any]) +"""An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). +""" +ContentDescriptorComponents = NewType("ContentDescriptorComponents", Mapping[Any, Any]) +"""An object to hold reusable [Tag Objects](#tag-object). +""" +TagComponents = NewType("TagComponents", Mapping[Any, Any]) +"""Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +""" +class Components(TypedDict): + schemas: Optional[SchemaComponents] + links: Optional[LinkComponents] + errors: Optional[ErrorComponents] + examples: Optional[ExampleComponents] + examplePairings: Optional[ExamplePairingComponents] + contentDescriptors: Optional[ContentDescriptorComponents] + tags: Optional[TagComponents] +"""JSON Schema URI (used by some editors) +""" +MetaSchema = NewType("MetaSchema", str) + +class OpenrpcDocument(TypedDict): + openrpc: undefined + info: Optional[InfoObject] + externalDocs: Optional[ExternalDocumentationObject] + servers: Optional[Servers] + methods: undefined + components: Optional[Components] + $schema: Optional[MetaSchema] \ No newline at end of file diff --git a/generated/packages/rs/Cargo.toml b/generated/packages/rs/Cargo.toml new file mode 100644 index 0000000..461b6e3 --- /dev/null +++ b/generated/packages/rs/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "open-rpc-spec-types" +version = "0.0.0" +edition = "2021" +description = "Generated OpenRPC specification types" +license = "Apache-2.0" + +[dependencies] +serde_json = "1.0" +derive_builder = "0.20" + + [dependencies.serde] + version = "1.0" + features = [ "derive" ] diff --git a/generated/packages/rs/src/lib.rs b/generated/packages/rs/src/lib.rs new file mode 100644 index 0000000..8e8426c --- /dev/null +++ b/generated/packages/rs/src/lib.rs @@ -0,0 +1,2 @@ +pub mod v1_4; +pub mod v1_3; diff --git a/generated/packages/rs/src/v1_3.rs b/generated/packages/rs/src/v1_3.rs new file mode 100644 index 0000000..7aa6ac6 --- /dev/null +++ b/generated/packages/rs/src/v1_3.rs @@ -0,0 +1,856 @@ +extern crate serde; +extern crate serde_json; +extern crate derive_builder; + +use serde::{Serialize, Deserialize}; +use derive_builder::Builder; +use std::collections::HashMap; +/// Openrpc +/// +/// This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. +/// +pub type Openrpc = String; +/// InfoObjectTitle +/// +/// The title of the application. +/// +pub type InfoObjectTitle = String; +/// InfoObjectDescription +/// +/// A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type InfoObjectDescription = String; +/// InfoObjectTermsOfService +/// +/// A URL to the Terms of Service for the API. MUST be in the format of a URL. +/// +pub type InfoObjectTermsOfService = String; +/// InfoObjectVersion +/// +/// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +/// +pub type InfoObjectVersion = String; +/// ContactObjectName +/// +/// The identifying name of the contact person/organization. +/// +pub type ContactObjectName = String; +/// ContactObjectEmail +/// +/// The email address of the contact person/organization. MUST be in the format of an email address. +/// +pub type ContactObjectEmail = String; +/// ContactObjectUrl +/// +/// The URL pointing to the contact information. MUST be in the format of a URL. +/// +pub type ContactObjectUrl = String; +/// SpecificationExtension +/// +/// This object MAY be extended with [Specification Extensions](#specification-extensions). +/// +pub type SpecificationExtension = serde_json::Value; +/// ContactObject +/// +/// Contact information for the exposed API. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ContactObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} +/// LicenseObjectName +/// +/// The license name used for the API. +/// +pub type LicenseObjectName = String; +/// LicenseObjectUrl +/// +/// A URL to the license used for the API. MUST be in the format of a URL. +/// +pub type LicenseObjectUrl = String; +/// LicenseObject +/// +/// License information for the exposed API. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct LicenseObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option, +} +/// InfoObject +/// +/// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +/// +pub type InfoObject = serde_json::Value; +/// ExternalDocumentationObjectDescription +/// +/// A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ExternalDocumentationObjectDescription = String; +/// ExternalDocumentationObjectUrl +/// +/// The URL for the target documentation. Value MUST be in the format of a URL. +/// +pub type ExternalDocumentationObjectUrl = String; +/// ExternalDocumentationObject +/// +/// Additional external documentation for this tag. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ExternalDocumentationObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + pub url: ExternalDocumentationObjectUrl, +} +/// ServerObjectUrl +/// +/// A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +/// +pub type ServerObjectUrl = String; +/// ServerObjectName +/// +/// An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ServerObjectName = String; +/// ServerObjectDescription +/// +/// An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ServerObjectDescription = String; +/// ServerObjectSummary +/// +/// A short summary of what the server is. +/// +pub type ServerObjectSummary = String; +/// ServerObjectVariableDefault +/// +/// The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. +/// +pub type ServerObjectVariableDefault = String; +/// ServerObjectVariableDescription +/// +/// An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ServerObjectVariableDescription = String; +/// ServerObjectVariableEnumItem +/// +/// An enumeration of string values to be used if the substitution options are from a limited set. +/// +pub type ServerObjectVariableEnumItem = String; +/// ServerObjectVariableEnum +/// +/// An enumeration of string values to be used if the substitution options are from a limited set. +/// +pub type ServerObjectVariableEnum = Vec; +/// ServerObjectVariable +/// +/// An object representing a Server Variable for server URL template substitution. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ServerObjectVariable { + #[serde(rename = "default")] + pub _default: ServerObjectVariableDefault, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "enum", skip_serializing_if = "Option::is_none")] + pub _enum: Option, +} +/// ServerObjectVariables +/// +/// A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +/// +pub type ServerObjectVariables = HashMap; +/// ServerObject +/// +/// A object representing a Server +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ServerObject { + pub url: ServerObjectUrl, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub variables: Option, +} +type AlwaysFalse = serde_json::Value; +/// Servers +/// +/// An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. +/// +pub type Servers = Vec; +/// MethodObjectName +/// +/// The cannonical name for the method. The name MUST be unique within the methods array. +/// +pub type MethodObjectName = String; +/// MethodObjectDescription +/// +/// A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. +/// +pub type MethodObjectDescription = String; +/// MethodObjectSummary +/// +/// A short summary of what the method does. +/// +pub type MethodObjectSummary = String; +/// TagObjectName +/// +/// The name of the tag. +/// +pub type TagObjectName = String; +/// TagObjectDescription +/// +/// A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type TagObjectDescription = String; +/// TagObject +/// +/// Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct TagObject { + pub name: TagObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(rename = "externalDocs", skip_serializing_if = "Option::is_none")] + pub external_docs: Option, +} +pub type Ref = String; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ReferenceObject { + #[serde(rename = "$ref")] + pub _ref: Ref, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum TagOrReference { + TagObject(TagObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectTags +/// +/// A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. +/// +pub type MethodObjectTags = Vec; +/// MethodObjectParamStructure +/// +/// Format the server expects the params. Defaults to 'either'. +/// +/// # Default +/// +/// either +/// +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub enum MethodObjectParamStructure { + #[serde(rename = "by-position")] + ByPosition, + #[serde(rename = "by-name")] + ByName, + #[serde(rename = "either")] + Either, +} +/// ContentDescriptorObjectName +/// +/// Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). +/// +pub type ContentDescriptorObjectName = String; +/// ContentDescriptorObjectDescription +/// +/// A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ContentDescriptorObjectDescription = String; +/// ContentDescriptorObjectSummary +/// +/// A short summary of the content that is being described. +/// +pub type ContentDescriptorObjectSummary = String; +pub type Id = String; +pub type Schema = String; +pub type Comment = String; +pub type Title = String; +pub type Description = String; +type AlwaysTrue = serde_json::Value; +pub type ReadOnly = bool; +pub type Examples = Vec; +pub type MultipleOf = f64; +pub type Maximum = f64; +pub type ExclusiveMaximum = f64; +pub type Minimum = f64; +pub type ExclusiveMinimum = f64; +pub type NonNegativeInteger = i64; +pub type NonNegativeIntegerDefaultZero = i64; +pub type Pattern = String; +/// JSONSchemaBoolean +/// +/// Always valid if true. Never valid if false. Is constant. +/// +pub type JSONSchemaBoolean = bool; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum JSONSchema { + JSONSchemaObject(Box), + JSONSchemaBoolean(JSONSchemaBoolean), +} +pub type SchemaArray = Vec; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum Items { + JSONSchema(JSONSchema), + SchemaArray(SchemaArray), +} +pub type UniqueItems = bool; +pub type StringDoaGddGA = String; +/// StringArray +/// +/// # Default +/// +/// [] +/// +pub type StringArray = Vec; +/// Definitions +/// +/// # Default +/// +/// {} +/// +pub type Definitions = HashMap; +/// Properties +/// +/// # Default +/// +/// {} +/// +pub type Properties = HashMap; +pub type PropertyNames = serde_json::Value; +/// PatternProperties +/// +/// # Default +/// +/// {} +/// +pub type PatternProperties = HashMap; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum DependenciesSet { + JSONSchema(JSONSchema), + StringArray(StringArray), +} +pub type Dependencies = HashMap; +pub type Enum = Vec; +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub enum SimpleTypes { + #[serde(rename = "array")] + Array, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "null")] + Null, + #[serde(rename = "number")] + Number, + #[serde(rename = "object")] + Object, + #[serde(rename = "string")] + String, +} +pub type ArrayOfSimpleTypes = Vec; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum Type { + SimpleTypes(SimpleTypes), + ArrayOfSimpleTypes(ArrayOfSimpleTypes), +} +pub type Format = String; +pub type ContentMediaType = String; +pub type ContentEncoding = String; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct JSONSchemaObject { + #[serde(rename = "$id", skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option, + #[serde(rename = "$ref", skip_serializing_if = "Option::is_none")] + pub _ref: Option, + #[serde(rename = "$comment", skip_serializing_if = "Option::is_none")] + pub comment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<Description>, + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub _default: Option<AlwaysTrue>, + #[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")] + pub read_only: Option<ReadOnly>, + #[serde(skip_serializing_if = "Option::is_none")] + pub examples: Option<Examples>, + #[serde(rename = "multipleOf", skip_serializing_if = "Option::is_none")] + pub multiple_of: Option<MultipleOf>, + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option<Maximum>, + #[serde(rename = "exclusiveMaximum", skip_serializing_if = "Option::is_none")] + pub exclusive_maximum: Option<ExclusiveMaximum>, + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option<Minimum>, + #[serde(rename = "exclusiveMinimum", skip_serializing_if = "Option::is_none")] + pub exclusive_minimum: Option<ExclusiveMinimum>, + #[serde(rename = "maxLength", skip_serializing_if = "Option::is_none")] + pub max_length: Option<NonNegativeInteger>, + #[serde(rename = "minLength", skip_serializing_if = "Option::is_none")] + pub min_length: Option<NonNegativeIntegerDefaultZero>, + #[serde(skip_serializing_if = "Option::is_none")] + pub pattern: Option<Pattern>, + #[serde(rename = "additionalItems", skip_serializing_if = "Option::is_none")] + pub additional_items: Option<JSONSchema>, + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<Items>, + #[serde(rename = "maxItems", skip_serializing_if = "Option::is_none")] + pub max_items: Option<NonNegativeInteger>, + #[serde(rename = "minItems", skip_serializing_if = "Option::is_none")] + pub min_items: Option<NonNegativeIntegerDefaultZero>, + #[serde(rename = "uniqueItems", skip_serializing_if = "Option::is_none")] + pub unique_items: Option<UniqueItems>, + #[serde(skip_serializing_if = "Option::is_none")] + pub contains: Option<JSONSchema>, + #[serde(rename = "maxProperties", skip_serializing_if = "Option::is_none")] + pub max_properties: Option<NonNegativeInteger>, + #[serde(rename = "minProperties", skip_serializing_if = "Option::is_none")] + pub min_properties: Option<NonNegativeIntegerDefaultZero>, + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option<StringArray>, + #[serde(rename = "additionalProperties", skip_serializing_if = "Option::is_none")] + pub additional_properties: Option<JSONSchema>, + #[serde(skip_serializing_if = "Option::is_none")] + pub definitions: Option<Definitions>, + #[serde(skip_serializing_if = "Option::is_none")] + pub properties: Option<Properties>, + #[serde(rename = "patternProperties", skip_serializing_if = "Option::is_none")] + pub pattern_properties: Option<PatternProperties>, + #[serde(skip_serializing_if = "Option::is_none")] + pub dependencies: Option<Dependencies>, + #[serde(rename = "propertyNames", skip_serializing_if = "Option::is_none")] + pub property_names: Option<JSONSchema>, + #[serde(rename = "const", skip_serializing_if = "Option::is_none")] + pub _const: Option<AlwaysTrue>, + #[serde(rename = "enum", skip_serializing_if = "Option::is_none")] + pub _enum: Option<Enum>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option<Type>, + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option<Format>, + #[serde(rename = "contentMediaType", skip_serializing_if = "Option::is_none")] + pub content_media_type: Option<ContentMediaType>, + #[serde(rename = "contentEncoding", skip_serializing_if = "Option::is_none")] + pub content_encoding: Option<ContentEncoding>, + #[serde(rename = "if", skip_serializing_if = "Option::is_none")] + pub _if: Option<JSONSchema>, + #[serde(skip_serializing_if = "Option::is_none")] + pub then: Option<JSONSchema>, + #[serde(rename = "else", skip_serializing_if = "Option::is_none")] + pub _else: Option<JSONSchema>, + #[serde(rename = "allOf", skip_serializing_if = "Option::is_none")] + pub all_of: Option<SchemaArray>, + #[serde(rename = "anyOf", skip_serializing_if = "Option::is_none")] + pub any_of: Option<SchemaArray>, + #[serde(rename = "oneOf", skip_serializing_if = "Option::is_none")] + pub one_of: Option<SchemaArray>, + #[serde(skip_serializing_if = "Option::is_none")] + pub not: Option<JSONSchema>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ContentDescriptorObjectSchema { + JSONSchemaObject(Box<JSONSchemaObject>), + JSONSchemaBoolean(JSONSchemaBoolean), +} +/// ContentDescriptorObjectRequired +/// +/// Determines if the content is a required field. Default value is `false`. +/// +pub type ContentDescriptorObjectRequired = bool; +/// ContentDescriptorObjectDeprecated +/// +/// Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. +/// +pub type ContentDescriptorObjectDeprecated = bool; +/// ContentDescriptorObject +/// +/// Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ContentDescriptorObject { + pub name: ContentDescriptorObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ContentDescriptorObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ContentDescriptorObjectSummary>, + pub schema: ContentDescriptorObjectSchema, + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option<ContentDescriptorObjectRequired>, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option<ContentDescriptorObjectDeprecated>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ContentDescriptorOrReference { + ContentDescriptorObject(ContentDescriptorObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectParams +/// +/// A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. +/// +pub type MethodObjectParams = Vec<ContentDescriptorOrReference>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum MethodObjectResult { + ContentDescriptorObject(ContentDescriptorObject), + ReferenceObject(ReferenceObject), +} +/// ErrorObjectCode +/// +/// A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. +/// +pub type ErrorObjectCode = i64; +/// ErrorObjectMessage +/// +/// A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. +/// +pub type ErrorObjectMessage = String; +/// ErrorObjectData +/// +/// A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). +/// +pub type ErrorObjectData = serde_json::Value; +/// ErrorObject +/// +/// Defines an application level error. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ErrorObject { + pub code: ErrorObjectCode, + pub message: ErrorObjectMessage, + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option<ErrorObjectData>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ErrorOrReference { + ErrorObject(ErrorObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectErrors +/// +/// A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +/// +pub type MethodObjectErrors = Vec<ErrorOrReference>; +/// LinkObjectName +/// +/// Cannonical name of the link. +/// +pub type LinkObjectName = serde_json::Value; +/// LinkObjectSummary +/// +/// Short description for the link. +/// +pub type LinkObjectSummary = String; +/// LinkObjectMethod +/// +/// The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. +/// +pub type LinkObjectMethod = String; +/// LinkObjectDescription +/// +/// A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type LinkObjectDescription = String; +/// LinkObjectParams +/// +/// A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. +/// +pub type LinkObjectParams = serde_json::Value; +/// LinkObjectServer +/// +/// A server object to be used by the target method. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct LinkObjectServer { + pub url: ServerObjectUrl, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<ServerObjectName>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ServerObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ServerObjectSummary>, + #[serde(skip_serializing_if = "Option::is_none")] + pub variables: Option<ServerObjectVariables>, +} +/// LinkObject +/// +/// A object representing a Link +/// +pub type LinkObject = serde_json::Value; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum LinkOrReference { + LinkObject(LinkObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectLinks +/// +/// A list of possible links from this method call. +/// +pub type MethodObjectLinks = Vec<LinkOrReference>; +/// ExamplePairingObjectName +/// +/// Name for the example pairing. +/// +pub type ExamplePairingObjectName = String; +/// ExamplePairingObjectDescription +/// +/// A verbose explanation of the example pairing. +/// +pub type ExamplePairingObjectDescription = String; +/// ExampleObjectSummary +/// +/// Short description for the example. +/// +pub type ExampleObjectSummary = String; +/// ExampleObjectValue +/// +/// Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. +/// +pub type ExampleObjectValue = serde_json::Value; +/// ExampleObjectDescription +/// +/// A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ExampleObjectDescription = String; +/// ExampleObjectName +/// +/// Cannonical name of the example. +/// +pub type ExampleObjectName = String; +/// ExampleObject +/// +/// The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ExampleObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ExampleObjectSummary>, + pub value: ExampleObjectValue, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ExampleObjectDescription>, + pub name: ExampleObjectName, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ExampleOrReference { + ExampleObject(ExampleObject), + ReferenceObject(ReferenceObject), +} +/// ExamplePairingObjectParams +/// +/// Example parameters. +/// +pub type ExamplePairingObjectParams = Vec<ExampleOrReference>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ExamplePairingObjectResult { + ExampleObject(ExampleObject), + ReferenceObject(ReferenceObject), +} +/// ExamplePairingObject +/// +/// The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ExamplePairingObject { + pub name: ExamplePairingObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ExamplePairingObjectDescription>, + pub params: ExamplePairingObjectParams, + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option<ExamplePairingObjectResult>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ExamplePairingOrReference { + ExamplePairingObject(ExamplePairingObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectExamples +/// +/// Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. +/// +pub type MethodObjectExamples = Vec<ExamplePairingOrReference>; +/// MethodObjectDeprecated +/// +/// Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. +/// +pub type MethodObjectDeprecated = bool; +/// MethodObject +/// +/// Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct MethodObject { + pub name: MethodObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<MethodObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<MethodObjectSummary>, + #[serde(skip_serializing_if = "Option::is_none")] + pub servers: Option<Servers>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option<MethodObjectTags>, + #[serde(rename = "paramStructure", skip_serializing_if = "Option::is_none")] + pub param_structure: Option<MethodObjectParamStructure>, + pub params: MethodObjectParams, + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option<MethodObjectResult>, + #[serde(skip_serializing_if = "Option::is_none")] + pub errors: Option<MethodObjectErrors>, + #[serde(skip_serializing_if = "Option::is_none")] + pub links: Option<MethodObjectLinks>, + #[serde(skip_serializing_if = "Option::is_none")] + pub examples: Option<MethodObjectExamples>, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option<MethodObjectDeprecated>, + #[serde(rename = "externalDocs", skip_serializing_if = "Option::is_none")] + pub external_docs: Option<ExternalDocumentationObject>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum MethodOrReference { + MethodObject(MethodObject), + ReferenceObject(ReferenceObject), +} +/// Methods +/// +/// The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). +/// +pub type Methods = Vec<MethodOrReference>; +/// SchemaComponents +/// +/// An object to hold reusable [Schema Objects](#schema-object). +/// +pub type SchemaComponents = HashMap<String, serde_json::Value>; +/// LinkComponents +/// +/// An object to hold reusable [Link Objects](#link-object). +/// +pub type LinkComponents = HashMap<String, serde_json::Value>; +/// ErrorComponents +/// +/// An object to hold reusable [Error Objects](#error-object). +/// +pub type ErrorComponents = HashMap<String, serde_json::Value>; +/// ExampleComponents +/// +/// An object to hold reusable [Example Objects](#example-object). +/// +pub type ExampleComponents = HashMap<String, serde_json::Value>; +/// ExamplePairingComponents +/// +/// An object to hold reusable [Example Pairing Objects](#example-pairing-object). +/// +pub type ExamplePairingComponents = HashMap<String, serde_json::Value>; +/// ContentDescriptorComponents +/// +/// An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). +/// +pub type ContentDescriptorComponents = HashMap<String, serde_json::Value>; +/// TagComponents +/// +/// An object to hold reusable [Tag Objects](#tag-object). +/// +pub type TagComponents = HashMap<String, serde_json::Value>; +/// Components +/// +/// Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct Components { + #[serde(skip_serializing_if = "Option::is_none")] + pub schemas: Option<SchemaComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub links: Option<LinkComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub errors: Option<ErrorComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub examples: Option<ExampleComponents>, + #[serde(rename = "examplePairings", skip_serializing_if = "Option::is_none")] + pub example_pairings: Option<ExamplePairingComponents>, + #[serde(rename = "contentDescriptors", skip_serializing_if = "Option::is_none")] + pub content_descriptors: Option<ContentDescriptorComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option<TagComponents>, +} +/// MetaSchema +/// +/// JSON Schema URI (used by some editors) +/// +/// # Default +/// +/// https://meta.open-rpc.org/ +/// +pub type MetaSchema = String; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct OpenrpcDocument { + pub openrpc: Openrpc, + pub info: InfoObject, + #[serde(rename = "externalDocs", skip_serializing_if = "Option::is_none")] + pub external_docs: Option<ExternalDocumentationObject>, + #[serde(skip_serializing_if = "Option::is_none")] + pub servers: Option<Servers>, + pub methods: Methods, + #[serde(skip_serializing_if = "Option::is_none")] + pub components: Option<Components>, + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option<MetaSchema>, +} \ No newline at end of file diff --git a/generated/packages/rs/src/v1_4.rs b/generated/packages/rs/src/v1_4.rs new file mode 100644 index 0000000..7aa6ac6 --- /dev/null +++ b/generated/packages/rs/src/v1_4.rs @@ -0,0 +1,856 @@ +extern crate serde; +extern crate serde_json; +extern crate derive_builder; + +use serde::{Serialize, Deserialize}; +use derive_builder::Builder; +use std::collections::HashMap; +/// Openrpc +/// +/// This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. +/// +pub type Openrpc = String; +/// InfoObjectTitle +/// +/// The title of the application. +/// +pub type InfoObjectTitle = String; +/// InfoObjectDescription +/// +/// A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type InfoObjectDescription = String; +/// InfoObjectTermsOfService +/// +/// A URL to the Terms of Service for the API. MUST be in the format of a URL. +/// +pub type InfoObjectTermsOfService = String; +/// InfoObjectVersion +/// +/// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +/// +pub type InfoObjectVersion = String; +/// ContactObjectName +/// +/// The identifying name of the contact person/organization. +/// +pub type ContactObjectName = String; +/// ContactObjectEmail +/// +/// The email address of the contact person/organization. MUST be in the format of an email address. +/// +pub type ContactObjectEmail = String; +/// ContactObjectUrl +/// +/// The URL pointing to the contact information. MUST be in the format of a URL. +/// +pub type ContactObjectUrl = String; +/// SpecificationExtension +/// +/// This object MAY be extended with [Specification Extensions](#specification-extensions). +/// +pub type SpecificationExtension = serde_json::Value; +/// ContactObject +/// +/// Contact information for the exposed API. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ContactObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<ContactObjectName>, + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<ContactObjectEmail>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<ContactObjectUrl>, +} +/// LicenseObjectName +/// +/// The license name used for the API. +/// +pub type LicenseObjectName = String; +/// LicenseObjectUrl +/// +/// A URL to the license used for the API. MUST be in the format of a URL. +/// +pub type LicenseObjectUrl = String; +/// LicenseObject +/// +/// License information for the exposed API. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct LicenseObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<LicenseObjectName>, + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<LicenseObjectUrl>, +} +/// InfoObject +/// +/// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. +/// +pub type InfoObject = serde_json::Value; +/// ExternalDocumentationObjectDescription +/// +/// A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ExternalDocumentationObjectDescription = String; +/// ExternalDocumentationObjectUrl +/// +/// The URL for the target documentation. Value MUST be in the format of a URL. +/// +pub type ExternalDocumentationObjectUrl = String; +/// ExternalDocumentationObject +/// +/// Additional external documentation for this tag. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ExternalDocumentationObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ExternalDocumentationObjectDescription>, + pub url: ExternalDocumentationObjectUrl, +} +/// ServerObjectUrl +/// +/// A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +/// +pub type ServerObjectUrl = String; +/// ServerObjectName +/// +/// An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ServerObjectName = String; +/// ServerObjectDescription +/// +/// An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ServerObjectDescription = String; +/// ServerObjectSummary +/// +/// A short summary of what the server is. +/// +pub type ServerObjectSummary = String; +/// ServerObjectVariableDefault +/// +/// The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. +/// +pub type ServerObjectVariableDefault = String; +/// ServerObjectVariableDescription +/// +/// An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ServerObjectVariableDescription = String; +/// ServerObjectVariableEnumItem +/// +/// An enumeration of string values to be used if the substitution options are from a limited set. +/// +pub type ServerObjectVariableEnumItem = String; +/// ServerObjectVariableEnum +/// +/// An enumeration of string values to be used if the substitution options are from a limited set. +/// +pub type ServerObjectVariableEnum = Vec<ServerObjectVariableEnumItem>; +/// ServerObjectVariable +/// +/// An object representing a Server Variable for server URL template substitution. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ServerObjectVariable { + #[serde(rename = "default")] + pub _default: ServerObjectVariableDefault, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ServerObjectVariableDescription>, + #[serde(rename = "enum", skip_serializing_if = "Option::is_none")] + pub _enum: Option<ServerObjectVariableEnum>, +} +/// ServerObjectVariables +/// +/// A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. +/// +pub type ServerObjectVariables = HashMap<String, serde_json::Value>; +/// ServerObject +/// +/// A object representing a Server +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ServerObject { + pub url: ServerObjectUrl, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<ServerObjectName>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ServerObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ServerObjectSummary>, + #[serde(skip_serializing_if = "Option::is_none")] + pub variables: Option<ServerObjectVariables>, +} +type AlwaysFalse = serde_json::Value; +/// Servers +/// +/// An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. +/// +pub type Servers = Vec<ServerObject>; +/// MethodObjectName +/// +/// The cannonical name for the method. The name MUST be unique within the methods array. +/// +pub type MethodObjectName = String; +/// MethodObjectDescription +/// +/// A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. +/// +pub type MethodObjectDescription = String; +/// MethodObjectSummary +/// +/// A short summary of what the method does. +/// +pub type MethodObjectSummary = String; +/// TagObjectName +/// +/// The name of the tag. +/// +pub type TagObjectName = String; +/// TagObjectDescription +/// +/// A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type TagObjectDescription = String; +/// TagObject +/// +/// Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct TagObject { + pub name: TagObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<TagObjectDescription>, + #[serde(rename = "externalDocs", skip_serializing_if = "Option::is_none")] + pub external_docs: Option<ExternalDocumentationObject>, +} +pub type Ref = String; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ReferenceObject { + #[serde(rename = "$ref")] + pub _ref: Ref, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum TagOrReference { + TagObject(TagObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectTags +/// +/// A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. +/// +pub type MethodObjectTags = Vec<TagOrReference>; +/// MethodObjectParamStructure +/// +/// Format the server expects the params. Defaults to 'either'. +/// +/// # Default +/// +/// either +/// +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub enum MethodObjectParamStructure { + #[serde(rename = "by-position")] + ByPosition, + #[serde(rename = "by-name")] + ByName, + #[serde(rename = "either")] + Either, +} +/// ContentDescriptorObjectName +/// +/// Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). +/// +pub type ContentDescriptorObjectName = String; +/// ContentDescriptorObjectDescription +/// +/// A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ContentDescriptorObjectDescription = String; +/// ContentDescriptorObjectSummary +/// +/// A short summary of the content that is being described. +/// +pub type ContentDescriptorObjectSummary = String; +pub type Id = String; +pub type Schema = String; +pub type Comment = String; +pub type Title = String; +pub type Description = String; +type AlwaysTrue = serde_json::Value; +pub type ReadOnly = bool; +pub type Examples = Vec<AlwaysTrue>; +pub type MultipleOf = f64; +pub type Maximum = f64; +pub type ExclusiveMaximum = f64; +pub type Minimum = f64; +pub type ExclusiveMinimum = f64; +pub type NonNegativeInteger = i64; +pub type NonNegativeIntegerDefaultZero = i64; +pub type Pattern = String; +/// JSONSchemaBoolean +/// +/// Always valid if true. Never valid if false. Is constant. +/// +pub type JSONSchemaBoolean = bool; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum JSONSchema { + JSONSchemaObject(Box<JSONSchemaObject>), + JSONSchemaBoolean(JSONSchemaBoolean), +} +pub type SchemaArray = Vec<JSONSchema>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum Items { + JSONSchema(JSONSchema), + SchemaArray(SchemaArray), +} +pub type UniqueItems = bool; +pub type StringDoaGddGA = String; +/// StringArray +/// +/// # Default +/// +/// [] +/// +pub type StringArray = Vec<StringDoaGddGA>; +/// Definitions +/// +/// # Default +/// +/// {} +/// +pub type Definitions = HashMap<String, JSONSchema>; +/// Properties +/// +/// # Default +/// +/// {} +/// +pub type Properties = HashMap<String, JSONSchema>; +pub type PropertyNames = serde_json::Value; +/// PatternProperties +/// +/// # Default +/// +/// {} +/// +pub type PatternProperties = HashMap<String, JSONSchema>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum DependenciesSet { + JSONSchema(JSONSchema), + StringArray(StringArray), +} +pub type Dependencies = HashMap<String, DependenciesSet>; +pub type Enum = Vec<AlwaysTrue>; +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub enum SimpleTypes { + #[serde(rename = "array")] + Array, + #[serde(rename = "boolean")] + Boolean, + #[serde(rename = "integer")] + Integer, + #[serde(rename = "null")] + Null, + #[serde(rename = "number")] + Number, + #[serde(rename = "object")] + Object, + #[serde(rename = "string")] + String, +} +pub type ArrayOfSimpleTypes = Vec<SimpleTypes>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum Type { + SimpleTypes(SimpleTypes), + ArrayOfSimpleTypes(ArrayOfSimpleTypes), +} +pub type Format = String; +pub type ContentMediaType = String; +pub type ContentEncoding = String; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct JSONSchemaObject { + #[serde(rename = "$id", skip_serializing_if = "Option::is_none")] + pub id: Option<Id>, + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option<Schema>, + #[serde(rename = "$ref", skip_serializing_if = "Option::is_none")] + pub _ref: Option<Ref>, + #[serde(rename = "$comment", skip_serializing_if = "Option::is_none")] + pub comment: Option<Comment>, + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<Title>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<Description>, + #[serde(rename = "default", skip_serializing_if = "Option::is_none")] + pub _default: Option<AlwaysTrue>, + #[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")] + pub read_only: Option<ReadOnly>, + #[serde(skip_serializing_if = "Option::is_none")] + pub examples: Option<Examples>, + #[serde(rename = "multipleOf", skip_serializing_if = "Option::is_none")] + pub multiple_of: Option<MultipleOf>, + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option<Maximum>, + #[serde(rename = "exclusiveMaximum", skip_serializing_if = "Option::is_none")] + pub exclusive_maximum: Option<ExclusiveMaximum>, + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option<Minimum>, + #[serde(rename = "exclusiveMinimum", skip_serializing_if = "Option::is_none")] + pub exclusive_minimum: Option<ExclusiveMinimum>, + #[serde(rename = "maxLength", skip_serializing_if = "Option::is_none")] + pub max_length: Option<NonNegativeInteger>, + #[serde(rename = "minLength", skip_serializing_if = "Option::is_none")] + pub min_length: Option<NonNegativeIntegerDefaultZero>, + #[serde(skip_serializing_if = "Option::is_none")] + pub pattern: Option<Pattern>, + #[serde(rename = "additionalItems", skip_serializing_if = "Option::is_none")] + pub additional_items: Option<JSONSchema>, + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<Items>, + #[serde(rename = "maxItems", skip_serializing_if = "Option::is_none")] + pub max_items: Option<NonNegativeInteger>, + #[serde(rename = "minItems", skip_serializing_if = "Option::is_none")] + pub min_items: Option<NonNegativeIntegerDefaultZero>, + #[serde(rename = "uniqueItems", skip_serializing_if = "Option::is_none")] + pub unique_items: Option<UniqueItems>, + #[serde(skip_serializing_if = "Option::is_none")] + pub contains: Option<JSONSchema>, + #[serde(rename = "maxProperties", skip_serializing_if = "Option::is_none")] + pub max_properties: Option<NonNegativeInteger>, + #[serde(rename = "minProperties", skip_serializing_if = "Option::is_none")] + pub min_properties: Option<NonNegativeIntegerDefaultZero>, + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option<StringArray>, + #[serde(rename = "additionalProperties", skip_serializing_if = "Option::is_none")] + pub additional_properties: Option<JSONSchema>, + #[serde(skip_serializing_if = "Option::is_none")] + pub definitions: Option<Definitions>, + #[serde(skip_serializing_if = "Option::is_none")] + pub properties: Option<Properties>, + #[serde(rename = "patternProperties", skip_serializing_if = "Option::is_none")] + pub pattern_properties: Option<PatternProperties>, + #[serde(skip_serializing_if = "Option::is_none")] + pub dependencies: Option<Dependencies>, + #[serde(rename = "propertyNames", skip_serializing_if = "Option::is_none")] + pub property_names: Option<JSONSchema>, + #[serde(rename = "const", skip_serializing_if = "Option::is_none")] + pub _const: Option<AlwaysTrue>, + #[serde(rename = "enum", skip_serializing_if = "Option::is_none")] + pub _enum: Option<Enum>, + #[serde(rename = "type", skip_serializing_if = "Option::is_none")] + pub _type: Option<Type>, + #[serde(skip_serializing_if = "Option::is_none")] + pub format: Option<Format>, + #[serde(rename = "contentMediaType", skip_serializing_if = "Option::is_none")] + pub content_media_type: Option<ContentMediaType>, + #[serde(rename = "contentEncoding", skip_serializing_if = "Option::is_none")] + pub content_encoding: Option<ContentEncoding>, + #[serde(rename = "if", skip_serializing_if = "Option::is_none")] + pub _if: Option<JSONSchema>, + #[serde(skip_serializing_if = "Option::is_none")] + pub then: Option<JSONSchema>, + #[serde(rename = "else", skip_serializing_if = "Option::is_none")] + pub _else: Option<JSONSchema>, + #[serde(rename = "allOf", skip_serializing_if = "Option::is_none")] + pub all_of: Option<SchemaArray>, + #[serde(rename = "anyOf", skip_serializing_if = "Option::is_none")] + pub any_of: Option<SchemaArray>, + #[serde(rename = "oneOf", skip_serializing_if = "Option::is_none")] + pub one_of: Option<SchemaArray>, + #[serde(skip_serializing_if = "Option::is_none")] + pub not: Option<JSONSchema>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ContentDescriptorObjectSchema { + JSONSchemaObject(Box<JSONSchemaObject>), + JSONSchemaBoolean(JSONSchemaBoolean), +} +/// ContentDescriptorObjectRequired +/// +/// Determines if the content is a required field. Default value is `false`. +/// +pub type ContentDescriptorObjectRequired = bool; +/// ContentDescriptorObjectDeprecated +/// +/// Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. +/// +pub type ContentDescriptorObjectDeprecated = bool; +/// ContentDescriptorObject +/// +/// Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ContentDescriptorObject { + pub name: ContentDescriptorObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ContentDescriptorObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ContentDescriptorObjectSummary>, + pub schema: ContentDescriptorObjectSchema, + #[serde(skip_serializing_if = "Option::is_none")] + pub required: Option<ContentDescriptorObjectRequired>, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option<ContentDescriptorObjectDeprecated>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ContentDescriptorOrReference { + ContentDescriptorObject(ContentDescriptorObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectParams +/// +/// A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. +/// +pub type MethodObjectParams = Vec<ContentDescriptorOrReference>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum MethodObjectResult { + ContentDescriptorObject(ContentDescriptorObject), + ReferenceObject(ReferenceObject), +} +/// ErrorObjectCode +/// +/// A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. +/// +pub type ErrorObjectCode = i64; +/// ErrorObjectMessage +/// +/// A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. +/// +pub type ErrorObjectMessage = String; +/// ErrorObjectData +/// +/// A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). +/// +pub type ErrorObjectData = serde_json::Value; +/// ErrorObject +/// +/// Defines an application level error. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ErrorObject { + pub code: ErrorObjectCode, + pub message: ErrorObjectMessage, + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option<ErrorObjectData>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ErrorOrReference { + ErrorObject(ErrorObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectErrors +/// +/// A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +/// +pub type MethodObjectErrors = Vec<ErrorOrReference>; +/// LinkObjectName +/// +/// Cannonical name of the link. +/// +pub type LinkObjectName = serde_json::Value; +/// LinkObjectSummary +/// +/// Short description for the link. +/// +pub type LinkObjectSummary = String; +/// LinkObjectMethod +/// +/// The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. +/// +pub type LinkObjectMethod = String; +/// LinkObjectDescription +/// +/// A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type LinkObjectDescription = String; +/// LinkObjectParams +/// +/// A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. +/// +pub type LinkObjectParams = serde_json::Value; +/// LinkObjectServer +/// +/// A server object to be used by the target method. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct LinkObjectServer { + pub url: ServerObjectUrl, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<ServerObjectName>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ServerObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ServerObjectSummary>, + #[serde(skip_serializing_if = "Option::is_none")] + pub variables: Option<ServerObjectVariables>, +} +/// LinkObject +/// +/// A object representing a Link +/// +pub type LinkObject = serde_json::Value; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum LinkOrReference { + LinkObject(LinkObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectLinks +/// +/// A list of possible links from this method call. +/// +pub type MethodObjectLinks = Vec<LinkOrReference>; +/// ExamplePairingObjectName +/// +/// Name for the example pairing. +/// +pub type ExamplePairingObjectName = String; +/// ExamplePairingObjectDescription +/// +/// A verbose explanation of the example pairing. +/// +pub type ExamplePairingObjectDescription = String; +/// ExampleObjectSummary +/// +/// Short description for the example. +/// +pub type ExampleObjectSummary = String; +/// ExampleObjectValue +/// +/// Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. +/// +pub type ExampleObjectValue = serde_json::Value; +/// ExampleObjectDescription +/// +/// A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +/// +pub type ExampleObjectDescription = String; +/// ExampleObjectName +/// +/// Cannonical name of the example. +/// +pub type ExampleObjectName = String; +/// ExampleObject +/// +/// The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ExampleObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<ExampleObjectSummary>, + pub value: ExampleObjectValue, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ExampleObjectDescription>, + pub name: ExampleObjectName, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ExampleOrReference { + ExampleObject(ExampleObject), + ReferenceObject(ReferenceObject), +} +/// ExamplePairingObjectParams +/// +/// Example parameters. +/// +pub type ExamplePairingObjectParams = Vec<ExampleOrReference>; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ExamplePairingObjectResult { + ExampleObject(ExampleObject), + ReferenceObject(ReferenceObject), +} +/// ExamplePairingObject +/// +/// The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct ExamplePairingObject { + pub name: ExamplePairingObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<ExamplePairingObjectDescription>, + pub params: ExamplePairingObjectParams, + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option<ExamplePairingObjectResult>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum ExamplePairingOrReference { + ExamplePairingObject(ExamplePairingObject), + ReferenceObject(ReferenceObject), +} +/// MethodObjectExamples +/// +/// Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. +/// +pub type MethodObjectExamples = Vec<ExamplePairingOrReference>; +/// MethodObjectDeprecated +/// +/// Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. +/// +pub type MethodObjectDeprecated = bool; +/// MethodObject +/// +/// Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct MethodObject { + pub name: MethodObjectName, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<MethodObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<MethodObjectSummary>, + #[serde(skip_serializing_if = "Option::is_none")] + pub servers: Option<Servers>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option<MethodObjectTags>, + #[serde(rename = "paramStructure", skip_serializing_if = "Option::is_none")] + pub param_structure: Option<MethodObjectParamStructure>, + pub params: MethodObjectParams, + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option<MethodObjectResult>, + #[serde(skip_serializing_if = "Option::is_none")] + pub errors: Option<MethodObjectErrors>, + #[serde(skip_serializing_if = "Option::is_none")] + pub links: Option<MethodObjectLinks>, + #[serde(skip_serializing_if = "Option::is_none")] + pub examples: Option<MethodObjectExamples>, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option<MethodObjectDeprecated>, + #[serde(rename = "externalDocs", skip_serializing_if = "Option::is_none")] + pub external_docs: Option<ExternalDocumentationObject>, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] +#[serde(untagged)] +pub enum MethodOrReference { + MethodObject(MethodObject), + ReferenceObject(ReferenceObject), +} +/// Methods +/// +/// The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). +/// +pub type Methods = Vec<MethodOrReference>; +/// SchemaComponents +/// +/// An object to hold reusable [Schema Objects](#schema-object). +/// +pub type SchemaComponents = HashMap<String, serde_json::Value>; +/// LinkComponents +/// +/// An object to hold reusable [Link Objects](#link-object). +/// +pub type LinkComponents = HashMap<String, serde_json::Value>; +/// ErrorComponents +/// +/// An object to hold reusable [Error Objects](#error-object). +/// +pub type ErrorComponents = HashMap<String, serde_json::Value>; +/// ExampleComponents +/// +/// An object to hold reusable [Example Objects](#example-object). +/// +pub type ExampleComponents = HashMap<String, serde_json::Value>; +/// ExamplePairingComponents +/// +/// An object to hold reusable [Example Pairing Objects](#example-pairing-object). +/// +pub type ExamplePairingComponents = HashMap<String, serde_json::Value>; +/// ContentDescriptorComponents +/// +/// An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). +/// +pub type ContentDescriptorComponents = HashMap<String, serde_json::Value>; +/// TagComponents +/// +/// An object to hold reusable [Tag Objects](#tag-object). +/// +pub type TagComponents = HashMap<String, serde_json::Value>; +/// Components +/// +/// Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. +/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct Components { + #[serde(skip_serializing_if = "Option::is_none")] + pub schemas: Option<SchemaComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub links: Option<LinkComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub errors: Option<ErrorComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub examples: Option<ExampleComponents>, + #[serde(rename = "examplePairings", skip_serializing_if = "Option::is_none")] + pub example_pairings: Option<ExamplePairingComponents>, + #[serde(rename = "contentDescriptors", skip_serializing_if = "Option::is_none")] + pub content_descriptors: Option<ContentDescriptorComponents>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tags: Option<TagComponents>, +} +/// MetaSchema +/// +/// JSON Schema URI (used by some editors) +/// +/// # Default +/// +/// https://meta.open-rpc.org/ +/// +pub type MetaSchema = String; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct OpenrpcDocument { + pub openrpc: Openrpc, + pub info: InfoObject, + #[serde(rename = "externalDocs", skip_serializing_if = "Option::is_none")] + pub external_docs: Option<ExternalDocumentationObject>, + #[serde(skip_serializing_if = "Option::is_none")] + pub servers: Option<Servers>, + pub methods: Methods, + #[serde(skip_serializing_if = "Option::is_none")] + pub components: Option<Components>, + #[serde(rename = "$schema", skip_serializing_if = "Option::is_none")] + pub schema: Option<MetaSchema>, +} \ No newline at end of file diff --git a/generated/packages/ts/1_3/index.d.ts b/generated/packages/ts/1_3/index.d.ts new file mode 100644 index 0000000..6ed21ff --- /dev/null +++ b/generated/packages/ts/1_3/index.d.ts @@ -0,0 +1,748 @@ +/** + * + * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. + * + */ +export type Openrpc = string; +/** + * + * The title of the application. + * + */ +export type InfoObjectTitle = string; +/** + * + * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type InfoObjectDescription = string; +/** + * + * A URL to the Terms of Service for the API. MUST be in the format of a URL. + * + */ +export type InfoObjectTermsOfService = string; +/** + * + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * + */ +export type InfoObjectVersion = string; +/** + * + * The identifying name of the contact person/organization. + * + */ +export type ContactObjectName = string; +/** + * + * The email address of the contact person/organization. MUST be in the format of an email address. + * + */ +export type ContactObjectEmail = string; +/** + * + * The URL pointing to the contact information. MUST be in the format of a URL. + * + */ +export type ContactObjectUrl = string; +/** + * + * This object MAY be extended with [Specification Extensions](#specification-extensions). + * + */ +export type SpecificationExtension = any; +/** + * + * Contact information for the exposed API. + * + */ +export interface ContactObject { + name?: ContactObjectName; + email?: ContactObjectEmail; + url?: ContactObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The license name used for the API. + * + */ +export type LicenseObjectName = string; +/** + * + * A URL to the license used for the API. MUST be in the format of a URL. + * + */ +export type LicenseObjectUrl = string; +/** + * + * License information for the exposed API. + * + */ +export interface LicenseObject { + name?: LicenseObjectName; + url?: LicenseObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. + * + */ +export type InfoObject = any; +/** + * + * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExternalDocumentationObjectDescription = string; +/** + * + * The URL for the target documentation. Value MUST be in the format of a URL. + * + */ +export type ExternalDocumentationObjectUrl = string; +/** + * + * Additional external documentation for this tag. + * + */ +export interface ExternalDocumentationObject { + description?: ExternalDocumentationObjectDescription; + url: ExternalDocumentationObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export type ServerObjectUrl = string; +/** + * + * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectName = string; +/** + * + * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectDescription = string; +/** + * + * A short summary of what the server is. + * + */ +export type ServerObjectSummary = string; +/** + * + * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. + * + */ +export type ServerObjectVariableDefault = string; +/** + * + * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectVariableDescription = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnumItem = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +/** + * + * An object representing a Server Variable for server URL template substitution. + * + */ +export interface ServerObjectVariable { + default: ServerObjectVariableDefault; + description?: ServerObjectVariableDescription; + enum?: ServerObjectVariableEnum; + [k: string]: any; +} +/** + * + * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export interface ServerObjectVariables { + [key: string]: any; +} +/** + * + * A object representing a Server + * + */ +export interface ServerObject { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * + */ +export type Servers = ServerObject[]; +/** + * + * The cannonical name for the method. The name MUST be unique within the methods array. + * + */ +export type MethodObjectName = string; +/** + * + * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. + * + */ +export type MethodObjectDescription = string; +/** + * + * A short summary of what the method does. + * + */ +export type MethodObjectSummary = string; +/** + * + * The name of the tag. + * + */ +export type TagObjectName = string; +/** + * + * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type TagObjectDescription = string; +/** + * + * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. + * + */ +export interface TagObject { + name: TagObjectName; + description?: TagObjectDescription; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type $Ref = string; +export interface ReferenceObject { + $ref: $Ref; +} +export type TagOrReference = TagObject | ReferenceObject; +/** + * + * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. + * + */ +export type MethodObjectTags = TagOrReference[]; +/** + * + * Format the server expects the params. Defaults to 'either'. + * + * @default either + * + */ +export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +/** + * + * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). + * + */ +export type ContentDescriptorObjectName = string; +/** + * + * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ContentDescriptorObjectDescription = string; +/** + * + * A short summary of the content that is being described. + * + */ +export type ContentDescriptorObjectSummary = string; +export type $Id = string; +export type $Schema = string; +export type $Comment = string; +export type Title = string; +export type Description = string; +type AlwaysTrue = any; +export type ReadOnly = boolean; +export type Examples = AlwaysTrue[]; +export type MultipleOf = number; +export type Maximum = number; +export type ExclusiveMaximum = number; +export type Minimum = number; +export type ExclusiveMinimum = number; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefaultZero = number; +export type Pattern = string; +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; +export type SchemaArray = JSONSchema[]; +/** + * + * @default true + * + */ +export type Items = JSONSchema | SchemaArray; +export type UniqueItems = boolean; +export type StringDoaGddGA = string; +/** + * + * @default [] + * + */ +export type StringArray = StringDoaGddGA[]; +/** + * + * @default {} + * + */ +export interface Definitions { + [key: string]: any; +} +/** + * + * @default {} + * + */ +export interface Properties { + [key: string]: any; +} +export type PropertyNames = any; +/** + * + * @default {} + * + */ +export interface PatternProperties { + [key: string]: any; +} +export type DependenciesSet = JSONSchema | StringArray; +export interface Dependencies { + [key: string]: any; +} +export type Enum = AlwaysTrue[]; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type ArrayOfSimpleTypes = SimpleTypes[]; +export type Type = SimpleTypes | ArrayOfSimpleTypes; +export type Format = string; +export type ContentMediaType = string; +export type ContentEncoding = string; +export interface JSONSchemaObject { + $id?: $Id; + $schema?: $Schema; + $ref?: $Ref; + $comment?: $Comment; + title?: Title; + description?: Description; + default?: AlwaysTrue; + readOnly?: ReadOnly; + examples?: Examples; + multipleOf?: MultipleOf; + maximum?: Maximum; + exclusiveMaximum?: ExclusiveMaximum; + minimum?: Minimum; + exclusiveMinimum?: ExclusiveMinimum; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefaultZero; + pattern?: Pattern; + additionalItems?: JSONSchema; + items?: Items; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefaultZero; + uniqueItems?: UniqueItems; + contains?: JSONSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefaultZero; + required?: StringArray; + additionalProperties?: JSONSchema; + definitions?: Definitions; + properties?: Properties; + patternProperties?: PatternProperties; + dependencies?: Dependencies; + propertyNames?: JSONSchema; + const?: AlwaysTrue; + enum?: Enum; + type?: Type; + format?: Format; + contentMediaType?: ContentMediaType; + contentEncoding?: ContentEncoding; + if?: JSONSchema; + then?: JSONSchema; + else?: JSONSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JSONSchema; + [k: string]: any; +} +/** + * + * Schema that describes the content. + * + * @default {} + * + */ +export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; +/** + * + * Determines if the content is a required field. Default value is `false`. + * + */ +export type ContentDescriptorObjectRequired = boolean; +/** + * + * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. + * + */ +export type ContentDescriptorObjectDeprecated = boolean; +/** + * + * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. + * + */ +export interface ContentDescriptorObject { + name: ContentDescriptorObjectName; + description?: ContentDescriptorObjectDescription; + summary?: ContentDescriptorObjectSummary; + schema: ContentDescriptorObjectSchema; + required?: ContentDescriptorObjectRequired; + deprecated?: ContentDescriptorObjectDeprecated; + [regex: string]: SpecificationExtension | any; +} +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +/** + * + * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. + * + */ +export type MethodObjectParams = ContentDescriptorOrReference[]; +/** + * + * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) + * + */ +export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; +/** + * + * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. + * + */ +export type ErrorObjectCode = number; +/** + * + * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. + * + */ +export type ErrorObjectMessage = string; +/** + * + * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). + * + */ +export type ErrorObjectData = any; +/** + * + * Defines an application level error. + * + */ +export interface ErrorObject { + code: ErrorObjectCode; + message: ErrorObjectMessage; + data?: ErrorObjectData; +} +export type ErrorOrReference = ErrorObject | ReferenceObject; +/** + * + * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. + * + */ +export type MethodObjectErrors = ErrorOrReference[]; +/** + * + * Cannonical name of the link. + * + */ +export type LinkObjectName = any; +/** + * + * Short description for the link. + * + */ +export type LinkObjectSummary = string; +/** + * + * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. + * + */ +export type LinkObjectMethod = string; +/** + * + * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type LinkObjectDescription = string; +/** + * + * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. + * + */ +export type LinkObjectParams = any; +/** + * + * A server object to be used by the target method. + * + */ +export interface LinkObjectServer { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A object representing a Link + * + */ +export type LinkObject = any; +export type LinkOrReference = LinkObject | ReferenceObject; +/** + * + * A list of possible links from this method call. + * + */ +export type MethodObjectLinks = LinkOrReference[]; +/** + * + * Name for the example pairing. + * + */ +export type ExamplePairingObjectName = string; +/** + * + * A verbose explanation of the example pairing. + * + */ +export type ExamplePairingObjectDescription = string; +/** + * + * Short description for the example. + * + */ +export type ExampleObjectSummary = string; +/** + * + * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. + * + */ +export type ExampleObjectValue = any; +/** + * + * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExampleObjectDescription = string; +/** + * + * Cannonical name of the example. + * + */ +export type ExampleObjectName = string; +/** + * + * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). + * + */ +export interface ExampleObject { + summary?: ExampleObjectSummary; + value: ExampleObjectValue; + description?: ExampleObjectDescription; + name: ExampleObjectName; + [regex: string]: SpecificationExtension | any; +} +export type ExampleOrReference = ExampleObject | ReferenceObject; +/** + * + * Example parameters. + * + */ +export type ExamplePairingObjectParams = ExampleOrReference[]; +/** + * + * Example result. When not provided, the example pairing represents usage of the method as a notification. + * + */ +export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +/** + * + * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. + * + */ +export interface ExamplePairingObject { + name: ExamplePairingObjectName; + description?: ExamplePairingObjectDescription; + params: ExamplePairingObjectParams; + result?: ExamplePairingObjectResult; + [k: string]: any; +} +export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +/** + * + * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. + * + */ +export type MethodObjectExamples = ExamplePairingOrReference[]; +/** + * + * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. + * + */ +export type MethodObjectDeprecated = boolean; +/** + * + * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. + * + */ +export interface MethodObject { + name: MethodObjectName; + description?: MethodObjectDescription; + summary?: MethodObjectSummary; + servers?: Servers; + tags?: MethodObjectTags; + paramStructure?: MethodObjectParamStructure; + params: MethodObjectParams; + result?: MethodObjectResult; + errors?: MethodObjectErrors; + links?: MethodObjectLinks; + examples?: MethodObjectExamples; + deprecated?: MethodObjectDeprecated; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type MethodOrReference = MethodObject | ReferenceObject; +/** + * + * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). + * + */ +export type Methods = MethodOrReference[]; +/** + * + * An object to hold reusable [Schema Objects](#schema-object). + * + */ +export interface SchemaComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Link Objects](#link-object). + * + */ +export interface LinkComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Error Objects](#error-object). + * + */ +export interface ErrorComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Example Objects](#example-object). + * + */ +export interface ExampleComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Example Pairing Objects](#example-pairing-object). + * + */ +export interface ExamplePairingComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). + * + */ +export interface ContentDescriptorComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Tag Objects](#tag-object). + * + */ +export interface TagComponents { + [key: string]: any; +} +/** + * + * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. + * + */ +export interface Components { + schemas?: SchemaComponents; + links?: LinkComponents; + errors?: ErrorComponents; + examples?: ExampleComponents; + examplePairings?: ExamplePairingComponents; + contentDescriptors?: ContentDescriptorComponents; + tags?: TagComponents; + [k: string]: any; +} +/** + * + * JSON Schema URI (used by some editors) + * + * @default https://meta.open-rpc.org/ + * + */ +export type MetaSchema = string; +export interface OpenrpcDocument { + openrpc: Openrpc; + info: InfoObject; + externalDocs?: ExternalDocumentationObject; + servers?: Servers; + methods: Methods; + components?: Components; + $schema?: MetaSchema; + [regex: string]: SpecificationExtension | any; +} +export {}; diff --git a/generated/packages/ts/1_3/index.js b/generated/packages/ts/1_3/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/generated/packages/ts/1_3/index.js @@ -0,0 +1 @@ +export {}; diff --git a/generated/packages/ts/legacy/index.ts b/generated/packages/ts/1_3/index.ts similarity index 52% rename from generated/packages/ts/legacy/index.ts rename to generated/packages/ts/1_3/index.ts index 39e6c36..2838073 100644 --- a/generated/packages/ts/legacy/index.ts +++ b/generated/packages/ts/1_3/index.ts @@ -1,39 +1,111 @@ -export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.0" | "1.1.0" | "1.0.0" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc0" | "1.0.0-rc1"; -export type InfoObjectProperties = string; +/** + * + * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. + * + */ +export type Openrpc = string; +/** + * + * The title of the application. + * + */ +export type InfoObjectTitle = string; +/** + * + * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type InfoObjectDescription = string; +/** + * + * A URL to the Terms of Service for the API. MUST be in the format of a URL. + * + */ export type InfoObjectTermsOfService = string; +/** + * + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * + */ export type InfoObjectVersion = string; +/** + * + * The identifying name of the contact person/organization. + * + */ export type ContactObjectName = string; +/** + * + * The email address of the contact person/organization. MUST be in the format of an email address. + * + */ export type ContactObjectEmail = string; +/** + * + * The URL pointing to the contact information. MUST be in the format of a URL. + * + */ export type ContactObjectUrl = string; +/** + * + * This object MAY be extended with [Specification Extensions](#specification-extensions). + * + */ export type SpecificationExtension = any; +/** + * + * Contact information for the exposed API. + * + */ export interface ContactObject { name?: ContactObjectName; email?: ContactObjectEmail; url?: ContactObjectUrl; [regex: string]: SpecificationExtension | any; } +/** + * + * The license name used for the API. + * + */ export type LicenseObjectName = string; +/** + * + * A URL to the license used for the API. MUST be in the format of a URL. + * + */ export type LicenseObjectUrl = string; +/** + * + * License information for the exposed API. + * + */ export interface LicenseObject { name?: LicenseObjectName; url?: LicenseObjectUrl; [regex: string]: SpecificationExtension | any; } -export interface InfoObject { - title: InfoObjectProperties; - description?: InfoObjectDescription; - termsOfService?: InfoObjectTermsOfService; - version: InfoObjectVersion; - contact?: ContactObject; - license?: LicenseObject; - [regex: string]: SpecificationExtension | any; -} +/** + * + * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. + * + */ +export type InfoObject = any; +/** + * + * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type ExternalDocumentationObjectDescription = string; +/** + * + * The URL for the target documentation. Value MUST be in the format of a URL. + * + */ export type ExternalDocumentationObjectUrl = string; /** * - * information about external documentation + * Additional external documentation for this tag. * */ export interface ExternalDocumentationObject { @@ -41,21 +113,76 @@ export interface ExternalDocumentationObject { url: ExternalDocumentationObjectUrl; [regex: string]: SpecificationExtension | any; } +/** + * + * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ export type ServerObjectUrl = string; +/** + * + * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type ServerObjectName = string; +/** + * + * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type ServerObjectDescription = string; +/** + * + * A short summary of what the server is. + * + */ export type ServerObjectSummary = string; +/** + * + * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. + * + */ export type ServerObjectVariableDefault = string; +/** + * + * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type ServerObjectVariableDescription = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ export type ServerObjectVariableEnumItem = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +/** + * + * An object representing a Server Variable for server URL template substitution. + * + */ export interface ServerObjectVariable { default: ServerObjectVariableDefault; description?: ServerObjectVariableDescription; enum?: ServerObjectVariableEnum; [k: string]: any; } +/** + * + * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ export interface ServerObjectVariables { [key: string]: any; } +/** + * + * A object representing a Server + * + */ export interface ServerObject { url: ServerObjectUrl; name?: ServerObjectName; @@ -65,6 +192,11 @@ export interface ServerObject { [regex: string]: SpecificationExtension | any; } type AlwaysFalse = any; +/** + * + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * + */ export type Servers = ServerObject[]; /** * @@ -84,8 +216,23 @@ export type MethodObjectDescription = string; * */ export type MethodObjectSummary = string; +/** + * + * The name of the tag. + * + */ export type TagObjectName = string; +/** + * + * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type TagObjectDescription = string; +/** + * + * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. + * + */ export interface TagObject { name: TagObjectName; description?: TagObjectDescription; @@ -97,6 +244,11 @@ export interface ReferenceObject { $ref: $Ref; } export type TagOrReference = TagObject | ReferenceObject; +/** + * + * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. + * + */ export type MethodObjectTags = TagOrReference[]; /** * @@ -106,8 +258,23 @@ export type MethodObjectTags = TagOrReference[]; * */ export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +/** + * + * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). + * + */ export type ContentDescriptorObjectName = string; +/** + * + * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type ContentDescriptorObjectDescription = string; +/** + * + * A short summary of the content that is being described. + * + */ export type ContentDescriptorObjectSummary = string; export type $Id = string; export type $Schema = string; @@ -125,6 +292,18 @@ export type ExclusiveMinimum = number; export type NonNegativeInteger = number; export type NonNegativeIntegerDefaultZero = number; export type Pattern = string; +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; export type SchemaArray = JSONSchema[]; /** * @@ -218,29 +397,50 @@ export interface JSONSchemaObject { } /** * - * Always valid if true. Never valid if false. Is constant. + * Schema that describes the content. + * + * @default {} * */ -export type JSONSchemaBoolean = boolean; +export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; /** * - * @default {} + * Determines if the content is a required field. Default value is `false`. * */ -export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; export type ContentDescriptorObjectRequired = boolean; +/** + * + * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. + * + */ export type ContentDescriptorObjectDeprecated = boolean; +/** + * + * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. + * + */ export interface ContentDescriptorObject { name: ContentDescriptorObjectName; description?: ContentDescriptorObjectDescription; summary?: ContentDescriptorObjectSummary; - schema: JSONSchema; + schema: ContentDescriptorObjectSchema; required?: ContentDescriptorObjectRequired; deprecated?: ContentDescriptorObjectDeprecated; [regex: string]: SpecificationExtension | any; } export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +/** + * + * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. + * + */ export type MethodObjectParams = ContentDescriptorOrReference[]; +/** + * + * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) + * + */ export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; /** * @@ -273,15 +473,45 @@ export interface ErrorObject { export type ErrorOrReference = ErrorObject | ReferenceObject; /** * - * Defines an application level error. + * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. * */ export type MethodObjectErrors = ErrorOrReference[]; -export type LinkObjectName = string; +/** + * + * Cannonical name of the link. + * + */ +export type LinkObjectName = any; +/** + * + * Short description for the link. + * + */ export type LinkObjectSummary = string; +/** + * + * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. + * + */ export type LinkObjectMethod = string; +/** + * + * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type LinkObjectDescription = string; +/** + * + * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. + * + */ export type LinkObjectParams = any; +/** + * + * A server object to be used by the target method. + * + */ export interface LinkObjectServer { url: ServerObjectUrl; name?: ServerObjectName; @@ -290,23 +520,60 @@ export interface LinkObjectServer { variables?: ServerObjectVariables; [regex: string]: SpecificationExtension | any; } -export interface LinkObject { - name?: LinkObjectName; - summary?: LinkObjectSummary; - method?: LinkObjectMethod; - description?: LinkObjectDescription; - params?: LinkObjectParams; - server?: LinkObjectServer; - [regex: string]: SpecificationExtension | any; -} +/** + * + * A object representing a Link + * + */ +export type LinkObject = any; export type LinkOrReference = LinkObject | ReferenceObject; +/** + * + * A list of possible links from this method call. + * + */ export type MethodObjectLinks = LinkOrReference[]; +/** + * + * Name for the example pairing. + * + */ export type ExamplePairingObjectName = string; +/** + * + * A verbose explanation of the example pairing. + * + */ export type ExamplePairingObjectDescription = string; +/** + * + * Short description for the example. + * + */ export type ExampleObjectSummary = string; +/** + * + * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. + * + */ export type ExampleObjectValue = any; +/** + * + * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ export type ExampleObjectDescription = string; +/** + * + * Cannonical name of the example. + * + */ export type ExampleObjectName = string; +/** + * + * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). + * + */ export interface ExampleObject { summary?: ExampleObjectSummary; value: ExampleObjectValue; @@ -315,8 +582,23 @@ export interface ExampleObject { [regex: string]: SpecificationExtension | any; } export type ExampleOrReference = ExampleObject | ReferenceObject; +/** + * + * Example parameters. + * + */ export type ExamplePairingObjectParams = ExampleOrReference[]; +/** + * + * Example result. When not provided, the example pairing represents usage of the method as a notification. + * + */ export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +/** + * + * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. + * + */ export interface ExamplePairingObject { name: ExamplePairingObjectName; description?: ExamplePairingObjectDescription; @@ -325,8 +607,23 @@ export interface ExamplePairingObject { [k: string]: any; } export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +/** + * + * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. + * + */ export type MethodObjectExamples = ExamplePairingOrReference[]; +/** + * + * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. + * + */ export type MethodObjectDeprecated = boolean; +/** + * + * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. + * + */ export interface MethodObject { name: MethodObjectName; description?: MethodObjectDescription; @@ -344,14 +641,59 @@ export interface MethodObject { [regex: string]: SpecificationExtension | any; } export type MethodOrReference = MethodObject | ReferenceObject; +/** + * + * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). + * + */ export type Methods = MethodOrReference[]; +/** + * + * An object to hold reusable [Schema Objects](#schema-object). + * + */ export interface SchemaComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Link Objects](#link-object). + * + */ export interface LinkComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Error Objects](#error-object). + * + */ export interface ErrorComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Example Objects](#example-object). + * + */ export interface ExampleComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Example Pairing Objects](#example-pairing-object). + * + */ export interface ExamplePairingComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). + * + */ export interface ContentDescriptorComponents { [key: string]: any; } +/** + * + * An object to hold reusable [Tag Objects](#tag-object). + * + */ export interface TagComponents { [key: string]: any; } +/** + * + * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. + * + */ export interface Components { schemas?: SchemaComponents; links?: LinkComponents; diff --git a/generated/packages/ts/1_4/index.d.ts b/generated/packages/ts/1_4/index.d.ts new file mode 100644 index 0000000..6ed21ff --- /dev/null +++ b/generated/packages/ts/1_4/index.d.ts @@ -0,0 +1,748 @@ +/** + * + * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. + * + */ +export type Openrpc = string; +/** + * + * The title of the application. + * + */ +export type InfoObjectTitle = string; +/** + * + * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type InfoObjectDescription = string; +/** + * + * A URL to the Terms of Service for the API. MUST be in the format of a URL. + * + */ +export type InfoObjectTermsOfService = string; +/** + * + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * + */ +export type InfoObjectVersion = string; +/** + * + * The identifying name of the contact person/organization. + * + */ +export type ContactObjectName = string; +/** + * + * The email address of the contact person/organization. MUST be in the format of an email address. + * + */ +export type ContactObjectEmail = string; +/** + * + * The URL pointing to the contact information. MUST be in the format of a URL. + * + */ +export type ContactObjectUrl = string; +/** + * + * This object MAY be extended with [Specification Extensions](#specification-extensions). + * + */ +export type SpecificationExtension = any; +/** + * + * Contact information for the exposed API. + * + */ +export interface ContactObject { + name?: ContactObjectName; + email?: ContactObjectEmail; + url?: ContactObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The license name used for the API. + * + */ +export type LicenseObjectName = string; +/** + * + * A URL to the license used for the API. MUST be in the format of a URL. + * + */ +export type LicenseObjectUrl = string; +/** + * + * License information for the exposed API. + * + */ +export interface LicenseObject { + name?: LicenseObjectName; + url?: LicenseObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. + * + */ +export type InfoObject = any; +/** + * + * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExternalDocumentationObjectDescription = string; +/** + * + * The URL for the target documentation. Value MUST be in the format of a URL. + * + */ +export type ExternalDocumentationObjectUrl = string; +/** + * + * Additional external documentation for this tag. + * + */ +export interface ExternalDocumentationObject { + description?: ExternalDocumentationObjectDescription; + url: ExternalDocumentationObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export type ServerObjectUrl = string; +/** + * + * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectName = string; +/** + * + * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectDescription = string; +/** + * + * A short summary of what the server is. + * + */ +export type ServerObjectSummary = string; +/** + * + * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. + * + */ +export type ServerObjectVariableDefault = string; +/** + * + * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectVariableDescription = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnumItem = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +/** + * + * An object representing a Server Variable for server URL template substitution. + * + */ +export interface ServerObjectVariable { + default: ServerObjectVariableDefault; + description?: ServerObjectVariableDescription; + enum?: ServerObjectVariableEnum; + [k: string]: any; +} +/** + * + * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export interface ServerObjectVariables { + [key: string]: any; +} +/** + * + * A object representing a Server + * + */ +export interface ServerObject { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * + */ +export type Servers = ServerObject[]; +/** + * + * The cannonical name for the method. The name MUST be unique within the methods array. + * + */ +export type MethodObjectName = string; +/** + * + * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. + * + */ +export type MethodObjectDescription = string; +/** + * + * A short summary of what the method does. + * + */ +export type MethodObjectSummary = string; +/** + * + * The name of the tag. + * + */ +export type TagObjectName = string; +/** + * + * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type TagObjectDescription = string; +/** + * + * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. + * + */ +export interface TagObject { + name: TagObjectName; + description?: TagObjectDescription; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type $Ref = string; +export interface ReferenceObject { + $ref: $Ref; +} +export type TagOrReference = TagObject | ReferenceObject; +/** + * + * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. + * + */ +export type MethodObjectTags = TagOrReference[]; +/** + * + * Format the server expects the params. Defaults to 'either'. + * + * @default either + * + */ +export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +/** + * + * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). + * + */ +export type ContentDescriptorObjectName = string; +/** + * + * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ContentDescriptorObjectDescription = string; +/** + * + * A short summary of the content that is being described. + * + */ +export type ContentDescriptorObjectSummary = string; +export type $Id = string; +export type $Schema = string; +export type $Comment = string; +export type Title = string; +export type Description = string; +type AlwaysTrue = any; +export type ReadOnly = boolean; +export type Examples = AlwaysTrue[]; +export type MultipleOf = number; +export type Maximum = number; +export type ExclusiveMaximum = number; +export type Minimum = number; +export type ExclusiveMinimum = number; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefaultZero = number; +export type Pattern = string; +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; +export type SchemaArray = JSONSchema[]; +/** + * + * @default true + * + */ +export type Items = JSONSchema | SchemaArray; +export type UniqueItems = boolean; +export type StringDoaGddGA = string; +/** + * + * @default [] + * + */ +export type StringArray = StringDoaGddGA[]; +/** + * + * @default {} + * + */ +export interface Definitions { + [key: string]: any; +} +/** + * + * @default {} + * + */ +export interface Properties { + [key: string]: any; +} +export type PropertyNames = any; +/** + * + * @default {} + * + */ +export interface PatternProperties { + [key: string]: any; +} +export type DependenciesSet = JSONSchema | StringArray; +export interface Dependencies { + [key: string]: any; +} +export type Enum = AlwaysTrue[]; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type ArrayOfSimpleTypes = SimpleTypes[]; +export type Type = SimpleTypes | ArrayOfSimpleTypes; +export type Format = string; +export type ContentMediaType = string; +export type ContentEncoding = string; +export interface JSONSchemaObject { + $id?: $Id; + $schema?: $Schema; + $ref?: $Ref; + $comment?: $Comment; + title?: Title; + description?: Description; + default?: AlwaysTrue; + readOnly?: ReadOnly; + examples?: Examples; + multipleOf?: MultipleOf; + maximum?: Maximum; + exclusiveMaximum?: ExclusiveMaximum; + minimum?: Minimum; + exclusiveMinimum?: ExclusiveMinimum; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefaultZero; + pattern?: Pattern; + additionalItems?: JSONSchema; + items?: Items; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefaultZero; + uniqueItems?: UniqueItems; + contains?: JSONSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefaultZero; + required?: StringArray; + additionalProperties?: JSONSchema; + definitions?: Definitions; + properties?: Properties; + patternProperties?: PatternProperties; + dependencies?: Dependencies; + propertyNames?: JSONSchema; + const?: AlwaysTrue; + enum?: Enum; + type?: Type; + format?: Format; + contentMediaType?: ContentMediaType; + contentEncoding?: ContentEncoding; + if?: JSONSchema; + then?: JSONSchema; + else?: JSONSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JSONSchema; + [k: string]: any; +} +/** + * + * Schema that describes the content. + * + * @default {} + * + */ +export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; +/** + * + * Determines if the content is a required field. Default value is `false`. + * + */ +export type ContentDescriptorObjectRequired = boolean; +/** + * + * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. + * + */ +export type ContentDescriptorObjectDeprecated = boolean; +/** + * + * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. + * + */ +export interface ContentDescriptorObject { + name: ContentDescriptorObjectName; + description?: ContentDescriptorObjectDescription; + summary?: ContentDescriptorObjectSummary; + schema: ContentDescriptorObjectSchema; + required?: ContentDescriptorObjectRequired; + deprecated?: ContentDescriptorObjectDeprecated; + [regex: string]: SpecificationExtension | any; +} +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +/** + * + * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. + * + */ +export type MethodObjectParams = ContentDescriptorOrReference[]; +/** + * + * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) + * + */ +export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; +/** + * + * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. + * + */ +export type ErrorObjectCode = number; +/** + * + * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. + * + */ +export type ErrorObjectMessage = string; +/** + * + * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). + * + */ +export type ErrorObjectData = any; +/** + * + * Defines an application level error. + * + */ +export interface ErrorObject { + code: ErrorObjectCode; + message: ErrorObjectMessage; + data?: ErrorObjectData; +} +export type ErrorOrReference = ErrorObject | ReferenceObject; +/** + * + * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. + * + */ +export type MethodObjectErrors = ErrorOrReference[]; +/** + * + * Cannonical name of the link. + * + */ +export type LinkObjectName = any; +/** + * + * Short description for the link. + * + */ +export type LinkObjectSummary = string; +/** + * + * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. + * + */ +export type LinkObjectMethod = string; +/** + * + * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type LinkObjectDescription = string; +/** + * + * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. + * + */ +export type LinkObjectParams = any; +/** + * + * A server object to be used by the target method. + * + */ +export interface LinkObjectServer { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A object representing a Link + * + */ +export type LinkObject = any; +export type LinkOrReference = LinkObject | ReferenceObject; +/** + * + * A list of possible links from this method call. + * + */ +export type MethodObjectLinks = LinkOrReference[]; +/** + * + * Name for the example pairing. + * + */ +export type ExamplePairingObjectName = string; +/** + * + * A verbose explanation of the example pairing. + * + */ +export type ExamplePairingObjectDescription = string; +/** + * + * Short description for the example. + * + */ +export type ExampleObjectSummary = string; +/** + * + * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. + * + */ +export type ExampleObjectValue = any; +/** + * + * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExampleObjectDescription = string; +/** + * + * Cannonical name of the example. + * + */ +export type ExampleObjectName = string; +/** + * + * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). + * + */ +export interface ExampleObject { + summary?: ExampleObjectSummary; + value: ExampleObjectValue; + description?: ExampleObjectDescription; + name: ExampleObjectName; + [regex: string]: SpecificationExtension | any; +} +export type ExampleOrReference = ExampleObject | ReferenceObject; +/** + * + * Example parameters. + * + */ +export type ExamplePairingObjectParams = ExampleOrReference[]; +/** + * + * Example result. When not provided, the example pairing represents usage of the method as a notification. + * + */ +export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +/** + * + * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. + * + */ +export interface ExamplePairingObject { + name: ExamplePairingObjectName; + description?: ExamplePairingObjectDescription; + params: ExamplePairingObjectParams; + result?: ExamplePairingObjectResult; + [k: string]: any; +} +export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +/** + * + * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. + * + */ +export type MethodObjectExamples = ExamplePairingOrReference[]; +/** + * + * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. + * + */ +export type MethodObjectDeprecated = boolean; +/** + * + * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. + * + */ +export interface MethodObject { + name: MethodObjectName; + description?: MethodObjectDescription; + summary?: MethodObjectSummary; + servers?: Servers; + tags?: MethodObjectTags; + paramStructure?: MethodObjectParamStructure; + params: MethodObjectParams; + result?: MethodObjectResult; + errors?: MethodObjectErrors; + links?: MethodObjectLinks; + examples?: MethodObjectExamples; + deprecated?: MethodObjectDeprecated; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type MethodOrReference = MethodObject | ReferenceObject; +/** + * + * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). + * + */ +export type Methods = MethodOrReference[]; +/** + * + * An object to hold reusable [Schema Objects](#schema-object). + * + */ +export interface SchemaComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Link Objects](#link-object). + * + */ +export interface LinkComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Error Objects](#error-object). + * + */ +export interface ErrorComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Example Objects](#example-object). + * + */ +export interface ExampleComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Example Pairing Objects](#example-pairing-object). + * + */ +export interface ExamplePairingComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). + * + */ +export interface ContentDescriptorComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Tag Objects](#tag-object). + * + */ +export interface TagComponents { + [key: string]: any; +} +/** + * + * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. + * + */ +export interface Components { + schemas?: SchemaComponents; + links?: LinkComponents; + errors?: ErrorComponents; + examples?: ExampleComponents; + examplePairings?: ExamplePairingComponents; + contentDescriptors?: ContentDescriptorComponents; + tags?: TagComponents; + [k: string]: any; +} +/** + * + * JSON Schema URI (used by some editors) + * + * @default https://meta.open-rpc.org/ + * + */ +export type MetaSchema = string; +export interface OpenrpcDocument { + openrpc: Openrpc; + info: InfoObject; + externalDocs?: ExternalDocumentationObject; + servers?: Servers; + methods: Methods; + components?: Components; + $schema?: MetaSchema; + [regex: string]: SpecificationExtension | any; +} +export {}; diff --git a/generated/packages/ts/1_4/index.js b/generated/packages/ts/1_4/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/generated/packages/ts/1_4/index.js @@ -0,0 +1 @@ +export {}; diff --git a/generated/packages/ts/index.d.ts b/generated/packages/ts/index.d.ts new file mode 100644 index 0000000..6d4c7a3 --- /dev/null +++ b/generated/packages/ts/index.d.ts @@ -0,0 +1,3 @@ +import type * as V1_4 from "./1_4/index.js"; +import type * as V1_3 from "./1_3/index.js"; +export type { V1_4, V1_3 }; diff --git a/generated/packages/ts/index.js b/generated/packages/ts/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/generated/packages/ts/index.js @@ -0,0 +1 @@ +export {}; diff --git a/generated/packages/ts/index.ts b/generated/packages/ts/index.ts index 53c41bc..092ad0e 100644 --- a/generated/packages/ts/index.ts +++ b/generated/packages/ts/index.ts @@ -1,4 +1,4 @@ -import type * as V1_4 from "./1_4/index.ts"; -import type * as Legacy from "./legacy/index.ts"; +import type * as V1_4 from "./1_4/index.js"; +import type * as V1_3 from "./1_3/index.js"; -export type { V1_4, Legacy } \ No newline at end of file +export type { V1_4, V1_3 } \ No newline at end of file diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json new file mode 100644 index 0000000..a0f30e9 --- /dev/null +++ b/generated/packages/ts/package.json @@ -0,0 +1,32 @@ +{ + "name": "@open-rpc/spec-types", + "version": "0.0.0", + "type": "module", + "module": "index.ts", + "exports": { + ".": { + "bun": "./index.ts", + "types": "./index.d.ts", + "import": "./index.js", + "default": "./index.js" + }, + "./1_4": { + "bun": "./1_4/index.ts", + "types": "./1_4/index.d.ts", + "import": "./1_4/index.js", + "default": "./1_4/index.js" + }, + "./1_3": { + "bun": "./1_3/index.ts", + "types": "./1_3/index.d.ts", + "import": "./1_3/index.js", + "default": "./1_3/index.js" + } + }, + "files": [ + "**/*.ts", + "**/*.d.ts", + "**/*.js", + "!node_modules" + ] +} \ No newline at end of file From 27a35609f987e247f67d034d4232779e0e55d59e Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 13 Feb 2026 21:25:42 -0800 Subject: [PATCH 06/46] fix: add support for persisting version and changelog data --- generated/packages/go/CHANGELOG.md | 1 + generated/packages/py/CHANGELOG.md | 1 + generated/packages/rs/CHANGELOG.md | 1 + generated/packages/ts/CHANGELOG.md | 1 + src/index.ts | 92 +++++++++++++++++++++++++----- 5 files changed, 83 insertions(+), 13 deletions(-) create mode 100644 generated/packages/go/CHANGELOG.md create mode 100644 generated/packages/py/CHANGELOG.md create mode 100644 generated/packages/rs/CHANGELOG.md create mode 100644 generated/packages/ts/CHANGELOG.md diff --git a/generated/packages/go/CHANGELOG.md b/generated/packages/go/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/generated/packages/go/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/generated/packages/py/CHANGELOG.md b/generated/packages/py/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/generated/packages/py/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/generated/packages/rs/CHANGELOG.md b/generated/packages/rs/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/generated/packages/rs/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/generated/packages/ts/CHANGELOG.md b/generated/packages/ts/CHANGELOG.md new file mode 100644 index 0000000..825c32f --- /dev/null +++ b/generated/packages/ts/CHANGELOG.md @@ -0,0 +1 @@ +# Changelog diff --git a/src/index.ts b/src/index.ts index 925dd7c..631250e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -14,6 +14,16 @@ interface GetTranspiler { (name: string): Transpiler } +// Package assets preserved across rebuilds +type Lang = "ts" | "go" | "rs" | "py"; + +interface PackageAssets { + version: string; + changelogContents: string; +} + +type GetPackageAssets = (lang: Lang) => PackageAssets; + // Operation types for the system type Op = | { @@ -26,7 +36,7 @@ type Op = "type": "mkdir"; path: string; } | { - "type": "compile"; fileNames: string[]; options: ts.CompilerOptions | any, lang: "ts" | "go" | "rs" | "py"; + "type": "compile"; fileNames: string[]; options: ts.CompilerOptions | any, lang: Lang; } @@ -54,6 +64,45 @@ const buildTranspilerCache = async (schemas: Record<string, any>): Promise<GetTr } } +// Reads existing versions and changelogs before the generator wipes directories +const buildPackageAssetsCache = async (basePath: string): Promise<GetPackageAssets> => { + const defaults: PackageAssets = { version: "0.0.0", changelogContents: "" }; + const cache: Record<string, PackageAssets> = {}; + + const tryRead = async (p: string, fallback: string): Promise<string> => { + try { return await readFile(p, "utf-8"); } catch { return fallback; } + }; + + // ts - read version from package.json + const tsPkg = await tryRead(`${basePath}/ts/package.json`, "{}"); + cache["ts"] = { + version: JSON.parse(tsPkg).version ?? defaults.version, + changelogContents: await tryRead(`${basePath}/ts/CHANGELOG.md`, ""), + }; + + // rs - read version from Cargo.toml + const rsRaw = await tryRead(`${basePath}/rs/Cargo.toml`, ""); + cache["rs"] = { + version: rsRaw ? ((toml.parse(rsRaw) as any)?.package?.version ?? defaults.version) : defaults.version, + changelogContents: await tryRead(`${basePath}/rs/CHANGELOG.md`, ""), + }; + + // py - read version from pyproject.toml + const pyRaw = await tryRead(`${basePath}/py/pyproject.toml`, ""); + cache["py"] = { + version: pyRaw ? ((toml.parse(pyRaw) as any)?.project?.version ?? defaults.version) : defaults.version, + changelogContents: await tryRead(`${basePath}/py/CHANGELOG.md`, ""), + }; + + // go - no version in go.mod, uses git tags + cache["go"] = { + version: "", + changelogContents: await tryRead(`${basePath}/go/CHANGELOG.md`, ""), + }; + + return (lang: Lang): PackageAssets => cache[lang] ?? defaults; +}; + // Index file generators const tsIndexFile = (schemaNames: string[]): string => { @@ -79,16 +128,17 @@ const pyInitFile = (schemaNames: string[]): string => { // Operations generators -const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , outpath: string): Op[] => { +const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { const ops: Op[] = [{ type: "rm", path: `${outpath}` }, { type: "mkdir", path: outpath }] return ops.concat(schemasNames.flatMap((name) => { return [ { type: "mkdir", path: `${outpath}/${name}` }, { type: "write", path: `${outpath}/${name}/index.ts`, content: getTranspiler(name).toTs() }, - { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames, outpath) } + { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames) } ]; })).concat([ - { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames), null, 2) }, + { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "@open-rpc/spec-types", version: assets.version }), null, 2) }, + { type: "write", path: `${outpath}/CHANGELOG.md`, content: assets.changelogContents }, { type: "compile", fileNames: [ `${outpath}/index.ts`, ...schemasNames.map((name) => `${outpath}/${name}/index.ts`), @@ -104,7 +154,7 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[] , out ]); } -const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string): Op[] => { +const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { const ops: Op[] = [ { type: "rm", path: outpath }, { type: "mkdir", path: outpath }, @@ -128,12 +178,17 @@ const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/Cargo.toml`, - content: toml.stringify(buildCargoToml(schemasNames) as any), + content: toml.stringify(buildCargoToml(schemasNames, { name: "open-rpc-spec-types", version: assets.version }) as any), + }, + { + type: "write", + path: `${outpath}/CHANGELOG.md`, + content: assets.changelogContents, }, ]); } -const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string): Op[] => { +const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { const ops: Op[] = [ { type: "rm", path: outpath }, { type: "mkdir", path: outpath }, @@ -156,10 +211,15 @@ const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp path: `${outpath}/go.mod`, content: buildGoMod(), }, + { + type: "write", + path: `${outpath}/CHANGELOG.md`, + content: assets.changelogContents, + }, ]); } -const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string): Op[] => { +const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { const pkg = "open_rpc_spec_types"; const ops: Op[] = [ { type: "rm", path: outpath }, @@ -184,7 +244,12 @@ const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/pyproject.toml`, - content: toml.stringify(buildPyProjectToml() as any), + content: toml.stringify(buildPyProjectToml({ name: "open-rpc-spec-types", version: assets.version }) as any), + }, + { + type: "write", + path: `${outpath}/CHANGELOG.md`, + content: assets.changelogContents, }, ]); } @@ -209,12 +274,13 @@ const execute = async (ops: Op[]) => { const run = async () => { const getTranspiler = await buildTranspilerCache(getAllSchemas()); + const getAssets = await buildPackageAssetsCache("./generated/packages"); const schemaNames = Object.keys(getAllSchemas()); - const tsOps = generateTsOp(getTranspiler, schemaNames, "./generated/packages/ts"); - const rsOps = generateRsOp(getTranspiler, schemaNames, "./generated/packages/rs"); - const goOps = generateGoOp(getTranspiler, schemaNames, "./generated/packages/go"); - const pyOps = generatePyOp(getTranspiler, schemaNames, "./generated/packages/py"); + const tsOps = generateTsOp(getTranspiler, schemaNames, "./generated/packages/ts", getAssets("ts")); + const rsOps = generateRsOp(getTranspiler, schemaNames, "./generated/packages/rs", getAssets("rs")); + const goOps = generateGoOp(getTranspiler, schemaNames, "./generated/packages/go", getAssets("go")); + const pyOps = generatePyOp(getTranspiler, schemaNames, "./generated/packages/py", getAssets("py")); await Promise.all([ execute(tsOps), From 956b5d83a9cff1fb6a8804f05408009648e371ad Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 13 Feb 2026 21:27:21 -0800 Subject: [PATCH 07/46] chore: add support for ci --- .github/workflows/prepare-release.yml | 28 ++++++++ .github/workflows/release.yml | 94 +++++++++++++++++++++++++++ knope.toml | 49 ++++++++++++++ 3 files changed, 171 insertions(+) create mode 100644 .github/workflows/prepare-release.yml create mode 100644 .github/workflows/release.yml create mode 100644 knope.toml diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..7c0e247 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,28 @@ +name: Prepare Release + +on: workflow_dispatch + +permissions: + contents: write + +jobs: + prepare-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT }} + + - name: Configure Git + run: | + git config --global user.name "GitHub Actions" + git config user.email "github-actions@github.com" + + - name: Install Knope + uses: knope-dev/action@v2.1.2 + with: + version: 0.22.2 + + - name: Prepare release + run: knope prepare-release --verbose diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..cc72977 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,94 @@ +name: Release + +on: workflow_dispatch + +permissions: + contents: write + id-token: write + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Knope + uses: knope-dev/action@v2.1.2 + with: + version: 0.22.2 + + - name: Create GitHub releases + run: knope release --verbose + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + + publish-ts: + needs: create-release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22" + registry-url: "https://registry.npmjs.org" + + - name: Publish to npm + working-directory: generated/packages/ts + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-py: + needs: create-release + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install build tools + run: pip install build + + - name: Build package + working-directory: generated/packages/py + run: python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: generated/packages/py/dist/ + + publish-rs: + needs: create-release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - name: Publish to crates.io + working-directory: generated/packages/rs + run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + + publish-go: + needs: create-release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Verify Go module tag + run: | + echo "Go modules use git tags for versioning." + echo "The tag created by knope release is sufficient for go get." + git tag --list 'go/v*' | tail -5 diff --git a/knope.toml b/knope.toml new file mode 100644 index 0000000..c56c6e4 --- /dev/null +++ b/knope.toml @@ -0,0 +1,49 @@ +[packages.go] +versioned_files = ["generated/packages/go/go.mod"] +changelog = "generated/packages/go/CHANGELOG.md" +scopes = ["go"] + +[packages.py] +versioned_files = ["generated/packages/py/pyproject.toml"] +changelog = "generated/packages/py/CHANGELOG.md" +scopes = ["py"] + +[packages.rs] +versioned_files = ["generated/packages/rs/Cargo.toml"] +changelog = "generated/packages/rs/CHANGELOG.md" +scopes = ["rs"] + +[packages.ts] +versioned_files = ["generated/packages/ts/package.json"] +changelog = "generated/packages/ts/CHANGELOG.md" +scopes = ["ts"] + +[[workflows]] +name = "prepare-release" + +[[workflows.steps]] +type = "PrepareRelease" + +[[workflows.steps]] +type = "Command" +command = "git commit -m \"chore: prepare release\"" + +[[workflows.steps]] +type = "Command" +command = "git push" + +[[workflows]] +name = "release" + +[[workflows.steps]] +type = "Release" + +[[workflows]] +name = "document-change" + +[[workflows.steps]] +type = "CreateChangeFile" + +[github] +owner = "open-rpc" +repo = "spec-types" From d39a012d56160a1e88d15df7d8820b8ed4496c7d Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 13 Feb 2026 21:44:56 -0800 Subject: [PATCH 08/46] fix: adjust workflows to safe guard not generating the package after a change --- .github/workflows/check-generated.yml | 29 +++++++++++++++++++++++++++ package.json | 3 +++ src/index.ts | 4 +++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/check-generated.yml diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml new file mode 100644 index 0000000..282218d --- /dev/null +++ b/.github/workflows/check-generated.yml @@ -0,0 +1,29 @@ +name: Check Generated Code + +on: + pull_request: + branches: [main] + +jobs: + check-generated: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install + + - name: Regenerate types + run: bun run generate + + - name: Check for stale generated code + run: | + if ! git diff --exit-code generated/; then + echo "" + echo "ERROR: Generated code is out of date." + echo "Run 'bun run generate' locally and commit the result." + exit 1 + fi diff --git a/package.json b/package.json index 8dc839e..9d9017b 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,9 @@ "name": "spec-types", "module": "index.ts", "type": "module", + "scripts": { + "generate": "bun run src/index.ts" + }, "devDependencies": { "@iarna/toml": "^2.2.5", "@json-schema-tools/dereferencer": "^1.6.3", diff --git a/src/index.ts b/src/index.ts index 631250e..aecd238 100644 --- a/src/index.ts +++ b/src/index.ts @@ -290,4 +290,6 @@ const run = async () => { ]); } -run() \ No newline at end of file +if (import.meta.main) { + run(); +} \ No newline at end of file From 38e217be9f736b3dab016b00c15c4ff4f09a5c20 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Tue, 17 Feb 2026 13:08:02 -0800 Subject: [PATCH 09/46] feat: wip that shows the generated types and knope semantic workflow --- .github/workflows/test-installs.yml | 62 ++++++++++++++++++++++++++++ docker-compose.test.yml | 58 ++++++++++++++++++++++++++ generated/packages/go/v1_3/v1_3.go | 2 + generated/packages/go/v1_4/v1_4.go | 2 + generated/packages/ts/index.d.ts | 1 + generated/packages/ts/index.js | 2 +- generated/packages/ts/index.ts | 3 +- generated/packages/ts/package.json | 3 ++ src/assets.ts | 4 +- src/index.ts | 28 +++++++++---- test-builds.sh | 63 +++++++++++++++++++++++++++++ test-docker.sh | 24 +++++++++++ 12 files changed, 242 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-installs.yml create mode 100644 docker-compose.test.yml create mode 100755 test-builds.sh create mode 100755 test-docker.sh diff --git a/.github/workflows/test-installs.yml b/.github/workflows/test-installs.yml new file mode 100644 index 0000000..6209ec3 --- /dev/null +++ b/.github/workflows/test-installs.yml @@ -0,0 +1,62 @@ +name: Test Package Installs + +on: + push: + branches: [main, "feat/**"] + pull_request: + +jobs: + test-ts: + name: TypeScript Install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: "22" + - name: Install & smoke test + run: | + cp test-open-rpc-spec-1.3.2.tgz generated/packages/ts/ + cd generated/packages/ts + npm install --ignore-scripts + node -e "import('./index.js').then(m => console.log('TS OK:', Object.keys(m)))" + + test-go: + name: Go Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version: "1.24" + - name: Build + run: | + cd generated/packages/go + go build ./... + echo "Go OK" + + test-py: + name: Python Install + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install & smoke test + run: | + cd generated/packages/py + pip install . --quiet + python -c "from open_rpc_spec_types import v1_4, v1_3; print('Py OK')" + + test-rs: + name: Rust Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - name: Check + run: | + cd generated/packages/rs + cargo check + echo "Rust OK" diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..ca099fa --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,58 @@ +services: + test-ts: + image: node:22-slim + volumes: + - ./generated/packages/ts:/pkg:ro + - ./test-open-rpc-spec-1.3.2.tgz:/tgz/test-open-rpc-spec-1.3.2.tgz:ro + command: + - sh + - -c + - | + set -e + cp -r /pkg /tmp/ts + cp /tgz/test-open-rpc-spec-1.3.2.tgz /tmp/ts/ + cd /tmp/ts + npm install --ignore-scripts 2>&1 + node -e "import('./index.js').then(m => console.log('TS OK:', Object.keys(m)))" + + test-go: + image: golang:1.24 + volumes: + - ./generated/packages/go:/pkg:ro + command: + - sh + - -c + - | + set -e + cp -r /pkg /tmp/go + cd /tmp/go + go build ./... + echo "Go OK" + + test-py: + image: python:3.12-slim + volumes: + - ./generated/packages/py:/pkg:ro + command: + - sh + - -c + - | + set -e + cp -r /pkg /tmp/py + cd /tmp/py + pip install . --quiet 2>&1 + python -c "from open_rpc_spec_types import v1_4, v1_3; print('Py OK')" + + test-rs: + image: rust:1.83-slim + volumes: + - ./generated/packages/rs:/pkg:ro + command: + - sh + - -c + - | + set -e + cp -r /pkg /tmp/rs + cd /tmp/rs + cargo check 2>&1 + echo "Rust OK" diff --git a/generated/packages/go/v1_3/v1_3.go b/generated/packages/go/v1_3/v1_3.go index d877a7b..9dbc545 100644 --- a/generated/packages/go/v1_3/v1_3.go +++ b/generated/packages/go/v1_3/v1_3.go @@ -803,3 +803,5 @@ type OpenrpcDocument struct { Components *Components `json:"components,omitempty"` Schema *MetaSchema `json:"$schema,omitempty"` } + +const RawOpenrpcDocument = "{\"$schema\":\"https://meta.json-schema.tools/\",\"$id\":\"https://meta.open-rpc.org/\",\"title\":\"openrpcDocument\",\"type\":\"object\",\"required\":[\"info\",\"methods\",\"openrpc\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"openrpc\":{\"description\":\"This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string.\",\"title\":\"openrpc\",\"type\":\"string\",\"regex\":\"^1\\\\.4\\\\.\\\\d+$\"},\"info\":{\"$ref\":\"#/definitions/infoObject\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"},\"servers\":{\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"methods\":{\"title\":\"methods\",\"type\":\"array\",\"description\":\"The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example).\",\"additionalItems\":false,\"items\":{\"title\":\"methodOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/methodObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"components\":{\"title\":\"components\",\"description\":\"Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\",\"type\":\"object\",\"properties\":{\"schemas\":{\"title\":\"schemaComponents\",\"description\":\"An object to hold reusable [Schema Objects](#schema-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/JSONSchema\"}}},\"links\":{\"title\":\"linkComponents\",\"type\":\"object\",\"description\":\"An object to hold reusable [Link Objects](#link-object).\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/linkObject\"}}},\"errors\":{\"title\":\"errorComponents\",\"description\":\"An object to hold reusable [Error Objects](#error-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/errorObject\"}}},\"examples\":{\"title\":\"exampleComponents\",\"description\":\"An object to hold reusable [Example Objects](#example-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/exampleObject\"}}},\"examplePairings\":{\"title\":\"examplePairingComponents\",\"description\":\"An object to hold reusable [Example Pairing Objects](#example-pairing-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/examplePairingObject\"}}},\"contentDescriptors\":{\"title\":\"contentDescriptorComponents\",\"description\":\"An object to hold reusable [Content Descriptor Objects](#content-descriptor-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/contentDescriptorObject\"}}},\"tags\":{\"title\":\"tagComponents\",\"description\":\"An object to hold reusable [Tag Objects](#tag-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/tagObject\"}}}}},\"$schema\":{\"title\":\"metaSchema\",\"description\":\"JSON Schema URI (used by some editors)\",\"type\":\"string\",\"default\":\"https://meta.open-rpc.org/\"}},\"definitions\":{\"specificationExtension\":{\"title\":\"specificationExtension\",\"description\":\"This object MAY be extended with [Specification Extensions](#specification-extensions).\"},\"JSONSchema\":{\"$ref\":\"https://meta.json-schema.tools\"},\"referenceObject\":{\"title\":\"referenceObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"description\":\"The reference string.\",\"$ref\":\"https://meta.json-schema.tools/#/definitions/JSONSchemaObject/properties/$ref\"}}},\"errorObject\":{\"title\":\"errorObject\",\"type\":\"object\",\"description\":\"Defines an application level error.\",\"additionalProperties\":false,\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"title\":\"errorObjectCode\",\"description\":\"A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.\",\"type\":\"integer\"},\"message\":{\"title\":\"errorObjectMessage\",\"description\":\"A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.\",\"type\":\"string\"},\"data\":{\"title\":\"errorObjectData\",\"description\":\"A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).\"}}},\"licenseObject\":{\"title\":\"licenseObject\",\"description\":\"License information for the exposed API.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"licenseObjectName\",\"description\":\"The license name used for the API.\",\"type\":\"string\"},\"url\":{\"title\":\"licenseObjectUrl\",\"description\":\"A URL to the license used for the API. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"contactObject\":{\"description\":\"Contact information for the exposed API.\",\"title\":\"contactObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"contactObjectName\",\"description\":\"The identifying name of the contact person/organization.\",\"type\":\"string\"},\"email\":{\"title\":\"contactObjectEmail\",\"description\":\"The email address of the contact person/organization. MUST be in the format of an email address.\",\"type\":\"string\"},\"url\":{\"title\":\"contactObjectUrl\",\"description\":\"The URL pointing to the contact information. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"infoObject\":{\"title\":\"infoObject\",\"description\":\"The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.\",\"additionalProperties\":false,\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"title\":\"infoObjectTitle\",\"description\":\"The title of the application.\",\"type\":\"string\"},\"description\":{\"title\":\"infoObjectDescription\",\"description\":\"A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"termsOfService\":{\"title\":\"infoObjectTermsOfService\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"title\":\"infoObjectVersion\",\"description\":\"The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version).\",\"type\":\"string\"},\"contact\":{\"$ref\":\"#/definitions/contactObject\"},\"license\":{\"$ref\":\"#/definitions/licenseObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"serverObject\":{\"title\":\"serverObject\",\"description\":\"A object representing a Server\",\"type\":\"object\",\"required\":[\"url\"],\"additionalProperties\":false,\"properties\":{\"url\":{\"title\":\"serverObjectUrl\",\"description\":\"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"string\",\"format\":\"uri\"},\"name\":{\"title\":\"serverObjectName\",\"description\":\"An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectDescription\",\"description\":\"An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"serverObjectSummary\",\"description\":\"A short summary of what the server is.\",\"type\":\"string\"},\"variables\":{\"title\":\"serverObjectVariables\",\"description\":\"A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"title\":\"serverObjectVariable\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"type\":\"object\",\"required\":[\"default\"],\"properties\":{\"default\":{\"title\":\"serverObjectVariableDefault\",\"description\":\"The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectVariableDescription\",\"description\":\"An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"enum\":{\"title\":\"serverObjectVariableEnum\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"array\",\"items\":{\"title\":\"serverObjectVariableEnumItem\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"string\"}}}}}}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"linkObject\":{\"title\":\"linkObject\",\"description\":\"A object representing a Link\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"linkObjectName\",\"description\":\"Cannonical name of the link.\",\"minLength\":1},\"summary\":{\"title\":\"linkObjectSummary\",\"description\":\"Short description for the link.\",\"type\":\"string\"},\"method\":{\"title\":\"linkObjectMethod\",\"description\":\"The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted.\",\"type\":\"string\"},\"description\":{\"title\":\"linkObjectDescription\",\"description\":\"A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"params\":{\"title\":\"linkObjectParams\",\"description\":\"A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method.\"},\"server\":{\"title\":\"linkObjectServer\",\"description\":\"A server object to be used by the target method.\",\"$ref\":\"#/definitions/serverObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"externalDocumentationObject\":{\"description\":\"Additional external documentation.\",\"title\":\"externalDocumentationObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"url\"],\"properties\":{\"description\":{\"description\":\"A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"title\":\"externalDocumentationObjectDescription\",\"type\":\"string\"},\"url\":{\"description\":\"The URL for the target documentation. Value MUST be in the format of a URL.\",\"title\":\"externalDocumentationObjectUrl\",\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"methodObject\":{\"title\":\"methodObject\",\"description\":\"Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"methodObjectName\",\"description\":\"The cannonical name for the method. The name MUST be unique within the methods array.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"methodObjectDescription\",\"description\":\"A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"methodObjectSummary\",\"description\":\"A short summary of what the method does.\",\"type\":\"string\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"tags\":{\"title\":\"methodObjectTags\",\"description\":\"A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.\",\"type\":\"array\",\"items\":{\"title\":\"tagOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/tagObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"paramStructure\":{\"title\":\"methodObjectParamStructure\",\"type\":\"string\",\"description\":\"Format the server expects the params. Defaults to 'either'.\",\"enum\":[\"by-position\",\"by-name\",\"either\"],\"default\":\"either\"},\"params\":{\"title\":\"methodObjectParams\",\"description\":\" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with \\\"required\\\": false) MUST be positioned after all required params in the list.\",\"type\":\"array\",\"items\":{\"title\":\"contentDescriptorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"methodObjectResult\",\"description\":\"The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification)\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]},\"errors\":{\"title\":\"methodObjectErrors\",\"description\":\"A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes.\",\"type\":\"array\",\"items\":{\"title\":\"errorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/errorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"links\":{\"title\":\"methodObjectLinks\",\"description\":\"A list of possible links from this method call.\",\"type\":\"array\",\"items\":{\"title\":\"linkOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/linkObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"examples\":{\"title\":\"methodObjectExamples\",\"description\":\"Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing.\",\"type\":\"array\",\"items\":{\"title\":\"examplePairingOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/examplePairingObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"deprecated\":{\"title\":\"methodObjectDeprecated\",\"description\":\"Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"tagObject\":{\"title\":\"tagObject\",\"description\":\"Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"title\":\"tagObjectName\",\"description\":\"The name of the tag.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"tagObjectDescription\",\"description\":\"A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"externalDocs\":{\"description\":\"Additional external documentation for this tag.\",\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"exampleObject\":{\"title\":\"exampleObject\",\"description\":\"The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object).\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"summary\":{\"title\":\"exampleObjectSummary\",\"description\":\"Short description for the example.\",\"type\":\"string\"},\"value\":{\"title\":\"exampleObjectValue\",\"description\":\"Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary.\"},\"description\":{\"title\":\"exampleObjectDescription\",\"description\":\"A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"name\":{\"title\":\"exampleObjectName\",\"description\":\"Cannonical name of the example.\",\"type\":\"string\",\"minLength\":1}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"examplePairingObject\":{\"title\":\"examplePairingObject\",\"description\":\"The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"properties\":{\"name\":{\"title\":\"examplePairingObjectName\",\"description\":\"Name for the example pairing.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"examplePairingObjectDescription\",\"description\":\"A verbose explanation of the example pairing.\",\"type\":\"string\"},\"params\":{\"title\":\"examplePairingObjectParams\",\"description\":\"Example parameters.\",\"type\":\"array\",\"items\":{\"title\":\"exampleOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"examplePairingObjectResult\",\"description\":\"Example result. When not provided, the example pairing represents usage of the method as a notification.\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}}},\"contentDescriptorObject\":{\"title\":\"contentDescriptorObject\",\"description\":\"Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"schema\"],\"properties\":{\"name\":{\"title\":\"contentDescriptorObjectName\",\"description\":\"Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name).\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"contentDescriptorObjectDescription\",\"description\":\"A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"contentDescriptorObjectSummary\",\"description\":\"A short summary of the content that is being described.\",\"type\":\"string\"},\"schema\":{\"title\":\"contentDescriptorObjectSchema\",\"description\":\"Schema that describes the content.\",\"$ref\":\"#/definitions/JSONSchema\"},\"required\":{\"title\":\"contentDescriptorObjectRequired\",\"description\":\"Determines if the content is a required field. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"deprecated\":{\"title\":\"contentDescriptorObjectDeprecated\",\"description\":\"Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`.\",\"type\":\"boolean\",\"default\":false}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}}}}" diff --git a/generated/packages/go/v1_4/v1_4.go b/generated/packages/go/v1_4/v1_4.go index 2244f07..c0c0980 100644 --- a/generated/packages/go/v1_4/v1_4.go +++ b/generated/packages/go/v1_4/v1_4.go @@ -803,3 +803,5 @@ type OpenrpcDocument struct { Components *Components `json:"components,omitempty"` Schema *MetaSchema `json:"$schema,omitempty"` } + +const RawOpenrpcDocument = "{\"$schema\":\"https://meta.json-schema.tools/\",\"$id\":\"https://meta.open-rpc.org/\",\"title\":\"openrpcDocument\",\"type\":\"object\",\"required\":[\"info\",\"methods\",\"openrpc\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"openrpc\":{\"description\":\"This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string.\",\"title\":\"openrpc\",\"type\":\"string\",\"regex\":\"^1\\\\.4\\\\.\\\\d+$\"},\"info\":{\"$ref\":\"#/definitions/infoObject\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"},\"servers\":{\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"methods\":{\"title\":\"methods\",\"type\":\"array\",\"description\":\"The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example).\",\"additionalItems\":false,\"items\":{\"title\":\"methodOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/methodObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"components\":{\"title\":\"components\",\"description\":\"Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\",\"type\":\"object\",\"properties\":{\"schemas\":{\"title\":\"schemaComponents\",\"description\":\"An object to hold reusable [Schema Objects](#schema-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/JSONSchema\"}}},\"links\":{\"title\":\"linkComponents\",\"type\":\"object\",\"description\":\"An object to hold reusable [Link Objects](#link-object).\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/linkObject\"}}},\"errors\":{\"title\":\"errorComponents\",\"description\":\"An object to hold reusable [Error Objects](#error-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/errorObject\"}}},\"examples\":{\"title\":\"exampleComponents\",\"description\":\"An object to hold reusable [Example Objects](#example-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/exampleObject\"}}},\"examplePairings\":{\"title\":\"examplePairingComponents\",\"description\":\"An object to hold reusable [Example Pairing Objects](#example-pairing-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/examplePairingObject\"}}},\"contentDescriptors\":{\"title\":\"contentDescriptorComponents\",\"description\":\"An object to hold reusable [Content Descriptor Objects](#content-descriptor-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/contentDescriptorObject\"}}},\"tags\":{\"title\":\"tagComponents\",\"description\":\"An object to hold reusable [Tag Objects](#tag-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/tagObject\"}}}}},\"$schema\":{\"title\":\"metaSchema\",\"description\":\"JSON Schema URI (used by some editors)\",\"type\":\"string\",\"default\":\"https://meta.open-rpc.org/\"}},\"definitions\":{\"specificationExtension\":{\"title\":\"specificationExtension\",\"description\":\"This object MAY be extended with [Specification Extensions](#specification-extensions).\"},\"JSONSchema\":{\"$ref\":\"https://meta.json-schema.tools\"},\"referenceObject\":{\"title\":\"referenceObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"description\":\"The reference string.\",\"$ref\":\"https://meta.json-schema.tools/#/definitions/JSONSchemaObject/properties/$ref\"}}},\"errorObject\":{\"title\":\"errorObject\",\"type\":\"object\",\"description\":\"Defines an application level error.\",\"additionalProperties\":false,\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"title\":\"errorObjectCode\",\"description\":\"A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.\",\"type\":\"integer\"},\"message\":{\"title\":\"errorObjectMessage\",\"description\":\"A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.\",\"type\":\"string\"},\"data\":{\"title\":\"errorObjectData\",\"description\":\"A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).\"}}},\"licenseObject\":{\"title\":\"licenseObject\",\"description\":\"License information for the exposed API.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"licenseObjectName\",\"description\":\"The license name used for the API.\",\"type\":\"string\"},\"url\":{\"title\":\"licenseObjectUrl\",\"description\":\"A URL to the license used for the API. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"contactObject\":{\"description\":\"Contact information for the exposed API.\",\"title\":\"contactObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"contactObjectName\",\"description\":\"The identifying name of the contact person/organization.\",\"type\":\"string\"},\"email\":{\"title\":\"contactObjectEmail\",\"description\":\"The email address of the contact person/organization. MUST be in the format of an email address.\",\"type\":\"string\"},\"url\":{\"title\":\"contactObjectUrl\",\"description\":\"The URL pointing to the contact information. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"infoObject\":{\"title\":\"infoObject\",\"description\":\"The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.\",\"additionalProperties\":false,\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"title\":\"infoObjectTitle\",\"description\":\"The title of the application.\",\"type\":\"string\"},\"description\":{\"title\":\"infoObjectDescription\",\"description\":\"A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"termsOfService\":{\"title\":\"infoObjectTermsOfService\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"title\":\"infoObjectVersion\",\"description\":\"The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version).\",\"type\":\"string\"},\"contact\":{\"$ref\":\"#/definitions/contactObject\"},\"license\":{\"$ref\":\"#/definitions/licenseObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"serverObject\":{\"title\":\"serverObject\",\"description\":\"A object representing a Server\",\"type\":\"object\",\"required\":[\"url\"],\"additionalProperties\":false,\"properties\":{\"url\":{\"title\":\"serverObjectUrl\",\"description\":\"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"string\",\"format\":\"uri\"},\"name\":{\"title\":\"serverObjectName\",\"description\":\"An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectDescription\",\"description\":\"An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"serverObjectSummary\",\"description\":\"A short summary of what the server is.\",\"type\":\"string\"},\"variables\":{\"title\":\"serverObjectVariables\",\"description\":\"A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"title\":\"serverObjectVariable\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"type\":\"object\",\"required\":[\"default\"],\"properties\":{\"default\":{\"title\":\"serverObjectVariableDefault\",\"description\":\"The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectVariableDescription\",\"description\":\"An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"enum\":{\"title\":\"serverObjectVariableEnum\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"array\",\"items\":{\"title\":\"serverObjectVariableEnumItem\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"string\"}}}}}}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"linkObject\":{\"title\":\"linkObject\",\"description\":\"A object representing a Link\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"linkObjectName\",\"description\":\"Cannonical name of the link.\",\"minLength\":1},\"summary\":{\"title\":\"linkObjectSummary\",\"description\":\"Short description for the link.\",\"type\":\"string\"},\"method\":{\"title\":\"linkObjectMethod\",\"description\":\"The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted.\",\"type\":\"string\"},\"description\":{\"title\":\"linkObjectDescription\",\"description\":\"A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"params\":{\"title\":\"linkObjectParams\",\"description\":\"A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method.\"},\"server\":{\"title\":\"linkObjectServer\",\"description\":\"A server object to be used by the target method.\",\"$ref\":\"#/definitions/serverObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"externalDocumentationObject\":{\"description\":\"Additional external documentation.\",\"title\":\"externalDocumentationObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"url\"],\"properties\":{\"description\":{\"description\":\"A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"title\":\"externalDocumentationObjectDescription\",\"type\":\"string\"},\"url\":{\"description\":\"The URL for the target documentation. Value MUST be in the format of a URL.\",\"title\":\"externalDocumentationObjectUrl\",\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"methodObject\":{\"title\":\"methodObject\",\"description\":\"Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"methodObjectName\",\"description\":\"The cannonical name for the method. The name MUST be unique within the methods array.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"methodObjectDescription\",\"description\":\"A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"methodObjectSummary\",\"description\":\"A short summary of what the method does.\",\"type\":\"string\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"tags\":{\"title\":\"methodObjectTags\",\"description\":\"A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.\",\"type\":\"array\",\"items\":{\"title\":\"tagOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/tagObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"paramStructure\":{\"title\":\"methodObjectParamStructure\",\"type\":\"string\",\"description\":\"Format the server expects the params. Defaults to 'either'.\",\"enum\":[\"by-position\",\"by-name\",\"either\"],\"default\":\"either\"},\"params\":{\"title\":\"methodObjectParams\",\"description\":\" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with \\\"required\\\": false) MUST be positioned after all required params in the list.\",\"type\":\"array\",\"items\":{\"title\":\"contentDescriptorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"methodObjectResult\",\"description\":\"The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification)\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]},\"errors\":{\"title\":\"methodObjectErrors\",\"description\":\"A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes.\",\"type\":\"array\",\"items\":{\"title\":\"errorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/errorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"links\":{\"title\":\"methodObjectLinks\",\"description\":\"A list of possible links from this method call.\",\"type\":\"array\",\"items\":{\"title\":\"linkOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/linkObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"examples\":{\"title\":\"methodObjectExamples\",\"description\":\"Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing.\",\"type\":\"array\",\"items\":{\"title\":\"examplePairingOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/examplePairingObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"deprecated\":{\"title\":\"methodObjectDeprecated\",\"description\":\"Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"tagObject\":{\"title\":\"tagObject\",\"description\":\"Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"title\":\"tagObjectName\",\"description\":\"The name of the tag.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"tagObjectDescription\",\"description\":\"A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"externalDocs\":{\"description\":\"Additional external documentation for this tag.\",\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"exampleObject\":{\"title\":\"exampleObject\",\"description\":\"The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object).\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"summary\":{\"title\":\"exampleObjectSummary\",\"description\":\"Short description for the example.\",\"type\":\"string\"},\"value\":{\"title\":\"exampleObjectValue\",\"description\":\"Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary.\"},\"description\":{\"title\":\"exampleObjectDescription\",\"description\":\"A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"name\":{\"title\":\"exampleObjectName\",\"description\":\"Cannonical name of the example.\",\"type\":\"string\",\"minLength\":1}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"examplePairingObject\":{\"title\":\"examplePairingObject\",\"description\":\"The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"properties\":{\"name\":{\"title\":\"examplePairingObjectName\",\"description\":\"Name for the example pairing.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"examplePairingObjectDescription\",\"description\":\"A verbose explanation of the example pairing.\",\"type\":\"string\"},\"params\":{\"title\":\"examplePairingObjectParams\",\"description\":\"Example parameters.\",\"type\":\"array\",\"items\":{\"title\":\"exampleOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"examplePairingObjectResult\",\"description\":\"Example result. When not provided, the example pairing represents usage of the method as a notification.\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}}},\"contentDescriptorObject\":{\"title\":\"contentDescriptorObject\",\"description\":\"Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"schema\"],\"properties\":{\"name\":{\"title\":\"contentDescriptorObjectName\",\"description\":\"Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name).\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"contentDescriptorObjectDescription\",\"description\":\"A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"contentDescriptorObjectSummary\",\"description\":\"A short summary of the content that is being described.\",\"type\":\"string\"},\"schema\":{\"title\":\"contentDescriptorObjectSchema\",\"description\":\"Schema that describes the content.\",\"$ref\":\"#/definitions/JSONSchema\"},\"required\":{\"title\":\"contentDescriptorObjectRequired\",\"description\":\"Determines if the content is a required field. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"deprecated\":{\"title\":\"contentDescriptorObjectDeprecated\",\"description\":\"Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`.\",\"type\":\"boolean\",\"default\":false}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}}}}" diff --git a/generated/packages/ts/index.d.ts b/generated/packages/ts/index.d.ts index 6d4c7a3..49172de 100644 --- a/generated/packages/ts/index.d.ts +++ b/generated/packages/ts/index.d.ts @@ -1,3 +1,4 @@ import type * as V1_4 from "./1_4/index.js"; import type * as V1_3 from "./1_3/index.js"; export type { V1_4, V1_3 }; +export * as spec from "test-open-rpc-spec"; diff --git a/generated/packages/ts/index.js b/generated/packages/ts/index.js index cb0ff5c..d20edbd 100644 --- a/generated/packages/ts/index.js +++ b/generated/packages/ts/index.js @@ -1 +1 @@ -export {}; +export * as spec from "test-open-rpc-spec"; diff --git a/generated/packages/ts/index.ts b/generated/packages/ts/index.ts index 092ad0e..e43b1dd 100644 --- a/generated/packages/ts/index.ts +++ b/generated/packages/ts/index.ts @@ -1,4 +1,5 @@ import type * as V1_4 from "./1_4/index.js"; import type * as V1_3 from "./1_3/index.js"; -export type { V1_4, V1_3 } \ No newline at end of file +export type { V1_4, V1_3 } +export * as spec from "test-open-rpc-spec"; \ No newline at end of file diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index a0f30e9..d8e58e6 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -23,6 +23,9 @@ "default": "./1_3/index.js" } }, + "dependencies": { + "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz" + }, "files": [ "**/*.ts", "**/*.d.ts", diff --git a/src/assets.ts b/src/assets.ts index 03bfae9..e90eaaf 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -1,6 +1,7 @@ export interface PackageJsonOptions { name: string; version: string; + dependencies: Record<string, string>; } export interface CargoTomlOptions { @@ -58,7 +59,7 @@ export const buildPyProjectToml = ( export const buildPackageJson = ( schemaNames: string[], - opts: PackageJsonOptions = { name: "@open-rpc/spec-types", version: "0.0.0" }, + opts: PackageJsonOptions = { name: "@open-rpc/spec-types", version: "0.0.0", dependencies: {} }, ) => { const subpathExports = Object.fromEntries( schemaNames.map((name) => [ @@ -86,6 +87,7 @@ export const buildPackageJson = ( }, ...subpathExports, }, + dependencies: opts.dependencies, files: ["**/*.ts", "**/*.d.ts", "**/*.js", "!node_modules"], }; }; diff --git a/src/index.ts b/src/index.ts index aecd238..9edadd2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,8 @@ import Dereferencer from "@json-schema-tools/dereferencer"; import toml from "@iarna/toml"; import {getAllSchemas} from "test-open-rpc-spec" import ts from "typescript"; +import { readFileSync } from "node:fs"; + interface GetTranspiler { @@ -105,39 +107,50 @@ const buildPackageAssetsCache = async (basePath: string): Promise<GetPackageAsse // Index file generators -const tsIndexFile = (schemaNames: string[]): string => { +const tsIndexFile = (schemaNames: string[], specPackageName: string): string => { const imports = schemaNames .map((name) => `import type * as V${name} from "./${name}/index.js";`); const reexport = `export type { ${schemaNames.map((name) => `V${name}`).join(", ")} }`; + const reexportAll = `export * as spec from "${specPackageName}";`; - return [...imports, "", reexport].join("\n"); + return [...imports, "", reexport, reexportAll].join("\n"); }; const rsLibFile = (schemaNames: string[]): string => { return schemaNames.map((name) => `pub mod v${name};`).join("\n") + "\n"; } -const goPackageFile = (name: string, goCode: string): string => { - return `package v${name}\n\n${goCode}\n`; +const goPackageFile = (name: string, goCode: string, rawSchema: string): string => { + const escaped = JSON.stringify(rawSchema); + return `package v${name}\n\n${goCode}\n\nconst RawOpenrpcDocument = ${escaped}\n`; } const pyInitFile = (schemaNames: string[]): string => { return schemaNames.map((name) => `from . import v${name}`).join("\n") + "\n"; } +const getPackageJsonSpecDependency = (packageName: string): Record<string, string> => { + const selfPkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8")); + const dependencyValue = selfPkg.dependencies?.[packageName]; + if (!dependencyValue) + throw new Error(`${packageName} not found in package.json`); + return { [packageName]: dependencyValue }; +} // Operations generators const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { + const specPackageName = "test-open-rpc-spec"; + const deps = getPackageJsonSpecDependency(specPackageName) const ops: Op[] = [{ type: "rm", path: `${outpath}` }, { type: "mkdir", path: outpath }] return ops.concat(schemasNames.flatMap((name) => { return [ { type: "mkdir", path: `${outpath}/${name}` }, { type: "write", path: `${outpath}/${name}/index.ts`, content: getTranspiler(name).toTs() }, - { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames) } + { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames,specPackageName) } ]; })).concat([ - { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "@open-rpc/spec-types", version: assets.version }), null, 2) }, + { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "@open-rpc/spec-types", version: assets.version, dependencies: deps }), null, 2) }, { type: "write", path: `${outpath}/CHANGELOG.md`, content: assets.changelogContents }, { type: "compile", fileNames: [ `${outpath}/index.ts`, @@ -189,6 +202,7 @@ const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp } const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { + const schemas: Record<string, any> = getAllSchemas(); const ops: Op[] = [ { type: "rm", path: outpath }, { type: "mkdir", path: outpath }, @@ -201,7 +215,7 @@ const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write" as const, path: `${outpath}/v${name}/v${name}.go`, - content: goPackageFile(name, getTranspiler(name).toGo()), + content: goPackageFile(name, getTranspiler(name).toGo(), JSON.stringify(schemas[name])), }, ]), ) diff --git a/test-builds.sh b/test-builds.sh new file mode 100755 index 0000000..44c2ea6 --- /dev/null +++ b/test-builds.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +set -euo pipefail + +PACKAGES_DIR="$(cd "$(dirname "$0")/generated/packages" && pwd)" +RESULTS=() + +# --- TypeScript --- +test_ts() { + local tmp=$(mktemp -d) + trap "rm -rf $tmp" RETURN + + # pack the package as a tarball (true install test) + cp ./test-open-rpc-spec-1.3.2.tgz "$tmp/" + cd "$PACKAGES_DIR/ts" + npm pack --pack-destination "$tmp" 2>/dev/null + + # install it in a clean project + cd "$tmp" + npm init -y > /dev/null 2>&1 + npm install ./open-rpc-spec-types-*.tgz + + # smoke test: can we import it? + node -e "import('@open-rpc/spec-types').then(m => console.log('TS OK:', Object.keys(m)))" +} + +# --- Go --- +test_go() { + local tmp=$(mktemp -d) + trap "rm -rf $tmp" RETURN + cp -r "$PACKAGES_DIR/go/"* "$tmp/" + cd "$tmp" + go build ./... + echo "Go OK" +} + +# --- Python --- + +test_py() { + local tmp=$(mktemp -d) + trap "rm -rf $tmp" RETURN + cp -r "$PACKAGES_DIR/py/"* "$tmp/" + cd "$tmp" + python3.12 -m venv "$tmp/.venv" + "$tmp/.venv/bin/python" -m pip install . --quiet + "$tmp/.venv/bin/python" -c "from open_rpc_spec_types import v1_4; print('Py OK')" +} + +# --- Rust --- +test_rs() { + local tmp=$(mktemp -d) + trap "rm -rf $tmp" RETURN + cp -r "$PACKAGES_DIR/rs/"* "$tmp/" + cd "$tmp" + cargo check 2>&1 + echo "Rust OK" +} + +echo "=== Testing TS ===" && test_ts +echo "=== Testing Go ===" && test_go +# echo "=== Testing Py ===" && test_py +echo "=== Testing Rs ===" && test_rs + +echo "All install tests passed." \ No newline at end of file diff --git a/test-docker.sh b/test-docker.sh new file mode 100755 index 0000000..fd3dc40 --- /dev/null +++ b/test-docker.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")" + +echo "=== Running install tests in Docker ===" + +docker compose -f docker-compose.test.yml up \ + --remove-orphans \ + --force-recreate 2>&1 + +FAILED=$(docker compose -f docker-compose.test.yml ps -a --format '{{.Name}} {{.ExitCode}}' | grep -v ' 0$' || true) + +docker compose -f docker-compose.test.yml down --volumes --remove-orphans 2>/dev/null + +if [ -n "$FAILED" ]; then + echo "" + echo "=== FAILED ===" + echo "$FAILED" + exit 1 +else + echo "" + echo "=== All install tests passed ===" +fi From 39250c93d4f29a97885754f91881f1b586ec38a5 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 16:39:28 -0800 Subject: [PATCH 10/46] fix: go lang spec types --- src/assets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets.ts b/src/assets.ts index e90eaaf..dd5d742 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -33,7 +33,7 @@ export interface GoModOptions { } export const buildGoMod = ( - opts: GoModOptions = { module: "github.com/open-rpc/spec-types", goVersion: "1.24.5" }, + opts: GoModOptions = { module: "github.com/open-rpc/spec-types/generated/packages/go", goVersion: "1.24.5" }, ): string => `module ${opts.module}\n\ngo ${opts.goVersion}\n`; export interface PyProjectTomlOptions { From fedcca0f8b29f780b551e6df036fd20ccdd039d9 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 16:39:58 -0800 Subject: [PATCH 11/46] chore: bump temp package for release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d9017b..33c505d 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,6 @@ "@json-schema-tools/transpiler": "^1.10.5", "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", - "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz" + "test-open-rpc-spec": "^1.6.0" } } \ No newline at end of file From 188f4634ad486188ba4d5e88badb6ea463a0b2c3 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 16:48:04 -0800 Subject: [PATCH 12/46] chore: go mod file an bump package.json --- bun.lock | 5 +- generated/packages/ts/1_3/index.d.ts | 748 --------------------------- generated/packages/ts/1_3/index.js | 1 - generated/packages/ts/1_4/index.d.ts | 748 --------------------------- generated/packages/ts/1_4/index.js | 1 - generated/packages/ts/index.d.ts | 4 - generated/packages/ts/index.js | 1 - generated/packages/ts/package.json | 4 +- 8 files changed, 4 insertions(+), 1508 deletions(-) delete mode 100644 generated/packages/ts/1_3/index.d.ts delete mode 100644 generated/packages/ts/1_3/index.js delete mode 100644 generated/packages/ts/1_4/index.d.ts delete mode 100644 generated/packages/ts/1_4/index.js delete mode 100644 generated/packages/ts/index.d.ts delete mode 100644 generated/packages/ts/index.js diff --git a/bun.lock b/bun.lock index 3c6ed11..5480efd 100644 --- a/bun.lock +++ b/bun.lock @@ -7,8 +7,7 @@ "@json-schema-tools/transpiler": "^1.10.5", "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", - "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz", - "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz", + "test-open-rpc-spec": "^1.6.0", }, "devDependencies": { "@iarna/toml": "^2.2.5", @@ -229,7 +228,7 @@ "synckit": ["synckit@0.11.12", "", { "dependencies": { "@pkgr/core": "^0.2.9" } }, "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ=="], - "test-open-rpc-spec": ["test-open-rpc-spec@test-open-rpc-spec-1.3.2.tgz", {}], + "test-open-rpc-spec": ["test-open-rpc-spec@1.6.0", "", {}, "sha512-QF7qjTQ47DZr8945H4HoMMSqhs8At8enZlRFxAuZs95zb+zRv23yEbbOG1uwZmsp9ndDqentXPOKUG+FqLgoBA=="], "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], diff --git a/generated/packages/ts/1_3/index.d.ts b/generated/packages/ts/1_3/index.d.ts deleted file mode 100644 index 6ed21ff..0000000 --- a/generated/packages/ts/1_3/index.d.ts +++ /dev/null @@ -1,748 +0,0 @@ -/** - * - * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. - * - */ -export type Openrpc = string; -/** - * - * The title of the application. - * - */ -export type InfoObjectTitle = string; -/** - * - * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type InfoObjectDescription = string; -/** - * - * A URL to the Terms of Service for the API. MUST be in the format of a URL. - * - */ -export type InfoObjectTermsOfService = string; -/** - * - * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). - * - */ -export type InfoObjectVersion = string; -/** - * - * The identifying name of the contact person/organization. - * - */ -export type ContactObjectName = string; -/** - * - * The email address of the contact person/organization. MUST be in the format of an email address. - * - */ -export type ContactObjectEmail = string; -/** - * - * The URL pointing to the contact information. MUST be in the format of a URL. - * - */ -export type ContactObjectUrl = string; -/** - * - * This object MAY be extended with [Specification Extensions](#specification-extensions). - * - */ -export type SpecificationExtension = any; -/** - * - * Contact information for the exposed API. - * - */ -export interface ContactObject { - name?: ContactObjectName; - email?: ContactObjectEmail; - url?: ContactObjectUrl; - [regex: string]: SpecificationExtension | any; -} -/** - * - * The license name used for the API. - * - */ -export type LicenseObjectName = string; -/** - * - * A URL to the license used for the API. MUST be in the format of a URL. - * - */ -export type LicenseObjectUrl = string; -/** - * - * License information for the exposed API. - * - */ -export interface LicenseObject { - name?: LicenseObjectName; - url?: LicenseObjectUrl; - [regex: string]: SpecificationExtension | any; -} -/** - * - * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. - * - */ -export type InfoObject = any; -/** - * - * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ExternalDocumentationObjectDescription = string; -/** - * - * The URL for the target documentation. Value MUST be in the format of a URL. - * - */ -export type ExternalDocumentationObjectUrl = string; -/** - * - * Additional external documentation for this tag. - * - */ -export interface ExternalDocumentationObject { - description?: ExternalDocumentationObjectDescription; - url: ExternalDocumentationObjectUrl; - [regex: string]: SpecificationExtension | any; -} -/** - * - * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. - * - */ -export type ServerObjectUrl = string; -/** - * - * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ServerObjectName = string; -/** - * - * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ServerObjectDescription = string; -/** - * - * A short summary of what the server is. - * - */ -export type ServerObjectSummary = string; -/** - * - * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. - * - */ -export type ServerObjectVariableDefault = string; -/** - * - * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ServerObjectVariableDescription = string; -/** - * - * An enumeration of string values to be used if the substitution options are from a limited set. - * - */ -export type ServerObjectVariableEnumItem = string; -/** - * - * An enumeration of string values to be used if the substitution options are from a limited set. - * - */ -export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; -/** - * - * An object representing a Server Variable for server URL template substitution. - * - */ -export interface ServerObjectVariable { - default: ServerObjectVariableDefault; - description?: ServerObjectVariableDescription; - enum?: ServerObjectVariableEnum; - [k: string]: any; -} -/** - * - * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. - * - */ -export interface ServerObjectVariables { - [key: string]: any; -} -/** - * - * A object representing a Server - * - */ -export interface ServerObject { - url: ServerObjectUrl; - name?: ServerObjectName; - description?: ServerObjectDescription; - summary?: ServerObjectSummary; - variables?: ServerObjectVariables; - [regex: string]: SpecificationExtension | any; -} -/** - * - * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. - * - */ -export type Servers = ServerObject[]; -/** - * - * The cannonical name for the method. The name MUST be unique within the methods array. - * - */ -export type MethodObjectName = string; -/** - * - * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. - * - */ -export type MethodObjectDescription = string; -/** - * - * A short summary of what the method does. - * - */ -export type MethodObjectSummary = string; -/** - * - * The name of the tag. - * - */ -export type TagObjectName = string; -/** - * - * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type TagObjectDescription = string; -/** - * - * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. - * - */ -export interface TagObject { - name: TagObjectName; - description?: TagObjectDescription; - externalDocs?: ExternalDocumentationObject; - [regex: string]: SpecificationExtension | any; -} -export type $Ref = string; -export interface ReferenceObject { - $ref: $Ref; -} -export type TagOrReference = TagObject | ReferenceObject; -/** - * - * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. - * - */ -export type MethodObjectTags = TagOrReference[]; -/** - * - * Format the server expects the params. Defaults to 'either'. - * - * @default either - * - */ -export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; -/** - * - * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). - * - */ -export type ContentDescriptorObjectName = string; -/** - * - * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ContentDescriptorObjectDescription = string; -/** - * - * A short summary of the content that is being described. - * - */ -export type ContentDescriptorObjectSummary = string; -export type $Id = string; -export type $Schema = string; -export type $Comment = string; -export type Title = string; -export type Description = string; -type AlwaysTrue = any; -export type ReadOnly = boolean; -export type Examples = AlwaysTrue[]; -export type MultipleOf = number; -export type Maximum = number; -export type ExclusiveMaximum = number; -export type Minimum = number; -export type ExclusiveMinimum = number; -export type NonNegativeInteger = number; -export type NonNegativeIntegerDefaultZero = number; -export type Pattern = string; -/** - * - * Always valid if true. Never valid if false. Is constant. - * - */ -export type JSONSchemaBoolean = boolean; -/** - * - * @default {} - * - */ -export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; -export type SchemaArray = JSONSchema[]; -/** - * - * @default true - * - */ -export type Items = JSONSchema | SchemaArray; -export type UniqueItems = boolean; -export type StringDoaGddGA = string; -/** - * - * @default [] - * - */ -export type StringArray = StringDoaGddGA[]; -/** - * - * @default {} - * - */ -export interface Definitions { - [key: string]: any; -} -/** - * - * @default {} - * - */ -export interface Properties { - [key: string]: any; -} -export type PropertyNames = any; -/** - * - * @default {} - * - */ -export interface PatternProperties { - [key: string]: any; -} -export type DependenciesSet = JSONSchema | StringArray; -export interface Dependencies { - [key: string]: any; -} -export type Enum = AlwaysTrue[]; -export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; -export type ArrayOfSimpleTypes = SimpleTypes[]; -export type Type = SimpleTypes | ArrayOfSimpleTypes; -export type Format = string; -export type ContentMediaType = string; -export type ContentEncoding = string; -export interface JSONSchemaObject { - $id?: $Id; - $schema?: $Schema; - $ref?: $Ref; - $comment?: $Comment; - title?: Title; - description?: Description; - default?: AlwaysTrue; - readOnly?: ReadOnly; - examples?: Examples; - multipleOf?: MultipleOf; - maximum?: Maximum; - exclusiveMaximum?: ExclusiveMaximum; - minimum?: Minimum; - exclusiveMinimum?: ExclusiveMinimum; - maxLength?: NonNegativeInteger; - minLength?: NonNegativeIntegerDefaultZero; - pattern?: Pattern; - additionalItems?: JSONSchema; - items?: Items; - maxItems?: NonNegativeInteger; - minItems?: NonNegativeIntegerDefaultZero; - uniqueItems?: UniqueItems; - contains?: JSONSchema; - maxProperties?: NonNegativeInteger; - minProperties?: NonNegativeIntegerDefaultZero; - required?: StringArray; - additionalProperties?: JSONSchema; - definitions?: Definitions; - properties?: Properties; - patternProperties?: PatternProperties; - dependencies?: Dependencies; - propertyNames?: JSONSchema; - const?: AlwaysTrue; - enum?: Enum; - type?: Type; - format?: Format; - contentMediaType?: ContentMediaType; - contentEncoding?: ContentEncoding; - if?: JSONSchema; - then?: JSONSchema; - else?: JSONSchema; - allOf?: SchemaArray; - anyOf?: SchemaArray; - oneOf?: SchemaArray; - not?: JSONSchema; - [k: string]: any; -} -/** - * - * Schema that describes the content. - * - * @default {} - * - */ -export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; -/** - * - * Determines if the content is a required field. Default value is `false`. - * - */ -export type ContentDescriptorObjectRequired = boolean; -/** - * - * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. - * - */ -export type ContentDescriptorObjectDeprecated = boolean; -/** - * - * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. - * - */ -export interface ContentDescriptorObject { - name: ContentDescriptorObjectName; - description?: ContentDescriptorObjectDescription; - summary?: ContentDescriptorObjectSummary; - schema: ContentDescriptorObjectSchema; - required?: ContentDescriptorObjectRequired; - deprecated?: ContentDescriptorObjectDeprecated; - [regex: string]: SpecificationExtension | any; -} -export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; -/** - * - * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. - * - */ -export type MethodObjectParams = ContentDescriptorOrReference[]; -/** - * - * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) - * - */ -export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; -/** - * - * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. - * - */ -export type ErrorObjectCode = number; -/** - * - * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. - * - */ -export type ErrorObjectMessage = string; -/** - * - * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). - * - */ -export type ErrorObjectData = any; -/** - * - * Defines an application level error. - * - */ -export interface ErrorObject { - code: ErrorObjectCode; - message: ErrorObjectMessage; - data?: ErrorObjectData; -} -export type ErrorOrReference = ErrorObject | ReferenceObject; -/** - * - * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. - * - */ -export type MethodObjectErrors = ErrorOrReference[]; -/** - * - * Cannonical name of the link. - * - */ -export type LinkObjectName = any; -/** - * - * Short description for the link. - * - */ -export type LinkObjectSummary = string; -/** - * - * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. - * - */ -export type LinkObjectMethod = string; -/** - * - * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type LinkObjectDescription = string; -/** - * - * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. - * - */ -export type LinkObjectParams = any; -/** - * - * A server object to be used by the target method. - * - */ -export interface LinkObjectServer { - url: ServerObjectUrl; - name?: ServerObjectName; - description?: ServerObjectDescription; - summary?: ServerObjectSummary; - variables?: ServerObjectVariables; - [regex: string]: SpecificationExtension | any; -} -/** - * - * A object representing a Link - * - */ -export type LinkObject = any; -export type LinkOrReference = LinkObject | ReferenceObject; -/** - * - * A list of possible links from this method call. - * - */ -export type MethodObjectLinks = LinkOrReference[]; -/** - * - * Name for the example pairing. - * - */ -export type ExamplePairingObjectName = string; -/** - * - * A verbose explanation of the example pairing. - * - */ -export type ExamplePairingObjectDescription = string; -/** - * - * Short description for the example. - * - */ -export type ExampleObjectSummary = string; -/** - * - * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. - * - */ -export type ExampleObjectValue = any; -/** - * - * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ExampleObjectDescription = string; -/** - * - * Cannonical name of the example. - * - */ -export type ExampleObjectName = string; -/** - * - * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). - * - */ -export interface ExampleObject { - summary?: ExampleObjectSummary; - value: ExampleObjectValue; - description?: ExampleObjectDescription; - name: ExampleObjectName; - [regex: string]: SpecificationExtension | any; -} -export type ExampleOrReference = ExampleObject | ReferenceObject; -/** - * - * Example parameters. - * - */ -export type ExamplePairingObjectParams = ExampleOrReference[]; -/** - * - * Example result. When not provided, the example pairing represents usage of the method as a notification. - * - */ -export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; -/** - * - * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. - * - */ -export interface ExamplePairingObject { - name: ExamplePairingObjectName; - description?: ExamplePairingObjectDescription; - params: ExamplePairingObjectParams; - result?: ExamplePairingObjectResult; - [k: string]: any; -} -export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; -/** - * - * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. - * - */ -export type MethodObjectExamples = ExamplePairingOrReference[]; -/** - * - * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. - * - */ -export type MethodObjectDeprecated = boolean; -/** - * - * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. - * - */ -export interface MethodObject { - name: MethodObjectName; - description?: MethodObjectDescription; - summary?: MethodObjectSummary; - servers?: Servers; - tags?: MethodObjectTags; - paramStructure?: MethodObjectParamStructure; - params: MethodObjectParams; - result?: MethodObjectResult; - errors?: MethodObjectErrors; - links?: MethodObjectLinks; - examples?: MethodObjectExamples; - deprecated?: MethodObjectDeprecated; - externalDocs?: ExternalDocumentationObject; - [regex: string]: SpecificationExtension | any; -} -export type MethodOrReference = MethodObject | ReferenceObject; -/** - * - * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). - * - */ -export type Methods = MethodOrReference[]; -/** - * - * An object to hold reusable [Schema Objects](#schema-object). - * - */ -export interface SchemaComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Link Objects](#link-object). - * - */ -export interface LinkComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Error Objects](#error-object). - * - */ -export interface ErrorComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Example Objects](#example-object). - * - */ -export interface ExampleComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Example Pairing Objects](#example-pairing-object). - * - */ -export interface ExamplePairingComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). - * - */ -export interface ContentDescriptorComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Tag Objects](#tag-object). - * - */ -export interface TagComponents { - [key: string]: any; -} -/** - * - * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. - * - */ -export interface Components { - schemas?: SchemaComponents; - links?: LinkComponents; - errors?: ErrorComponents; - examples?: ExampleComponents; - examplePairings?: ExamplePairingComponents; - contentDescriptors?: ContentDescriptorComponents; - tags?: TagComponents; - [k: string]: any; -} -/** - * - * JSON Schema URI (used by some editors) - * - * @default https://meta.open-rpc.org/ - * - */ -export type MetaSchema = string; -export interface OpenrpcDocument { - openrpc: Openrpc; - info: InfoObject; - externalDocs?: ExternalDocumentationObject; - servers?: Servers; - methods: Methods; - components?: Components; - $schema?: MetaSchema; - [regex: string]: SpecificationExtension | any; -} -export {}; diff --git a/generated/packages/ts/1_3/index.js b/generated/packages/ts/1_3/index.js deleted file mode 100644 index cb0ff5c..0000000 --- a/generated/packages/ts/1_3/index.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/generated/packages/ts/1_4/index.d.ts b/generated/packages/ts/1_4/index.d.ts deleted file mode 100644 index 6ed21ff..0000000 --- a/generated/packages/ts/1_4/index.d.ts +++ /dev/null @@ -1,748 +0,0 @@ -/** - * - * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. - * - */ -export type Openrpc = string; -/** - * - * The title of the application. - * - */ -export type InfoObjectTitle = string; -/** - * - * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type InfoObjectDescription = string; -/** - * - * A URL to the Terms of Service for the API. MUST be in the format of a URL. - * - */ -export type InfoObjectTermsOfService = string; -/** - * - * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). - * - */ -export type InfoObjectVersion = string; -/** - * - * The identifying name of the contact person/organization. - * - */ -export type ContactObjectName = string; -/** - * - * The email address of the contact person/organization. MUST be in the format of an email address. - * - */ -export type ContactObjectEmail = string; -/** - * - * The URL pointing to the contact information. MUST be in the format of a URL. - * - */ -export type ContactObjectUrl = string; -/** - * - * This object MAY be extended with [Specification Extensions](#specification-extensions). - * - */ -export type SpecificationExtension = any; -/** - * - * Contact information for the exposed API. - * - */ -export interface ContactObject { - name?: ContactObjectName; - email?: ContactObjectEmail; - url?: ContactObjectUrl; - [regex: string]: SpecificationExtension | any; -} -/** - * - * The license name used for the API. - * - */ -export type LicenseObjectName = string; -/** - * - * A URL to the license used for the API. MUST be in the format of a URL. - * - */ -export type LicenseObjectUrl = string; -/** - * - * License information for the exposed API. - * - */ -export interface LicenseObject { - name?: LicenseObjectName; - url?: LicenseObjectUrl; - [regex: string]: SpecificationExtension | any; -} -/** - * - * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. - * - */ -export type InfoObject = any; -/** - * - * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ExternalDocumentationObjectDescription = string; -/** - * - * The URL for the target documentation. Value MUST be in the format of a URL. - * - */ -export type ExternalDocumentationObjectUrl = string; -/** - * - * Additional external documentation for this tag. - * - */ -export interface ExternalDocumentationObject { - description?: ExternalDocumentationObjectDescription; - url: ExternalDocumentationObjectUrl; - [regex: string]: SpecificationExtension | any; -} -/** - * - * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. - * - */ -export type ServerObjectUrl = string; -/** - * - * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ServerObjectName = string; -/** - * - * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ServerObjectDescription = string; -/** - * - * A short summary of what the server is. - * - */ -export type ServerObjectSummary = string; -/** - * - * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. - * - */ -export type ServerObjectVariableDefault = string; -/** - * - * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ServerObjectVariableDescription = string; -/** - * - * An enumeration of string values to be used if the substitution options are from a limited set. - * - */ -export type ServerObjectVariableEnumItem = string; -/** - * - * An enumeration of string values to be used if the substitution options are from a limited set. - * - */ -export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; -/** - * - * An object representing a Server Variable for server URL template substitution. - * - */ -export interface ServerObjectVariable { - default: ServerObjectVariableDefault; - description?: ServerObjectVariableDescription; - enum?: ServerObjectVariableEnum; - [k: string]: any; -} -/** - * - * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. - * - */ -export interface ServerObjectVariables { - [key: string]: any; -} -/** - * - * A object representing a Server - * - */ -export interface ServerObject { - url: ServerObjectUrl; - name?: ServerObjectName; - description?: ServerObjectDescription; - summary?: ServerObjectSummary; - variables?: ServerObjectVariables; - [regex: string]: SpecificationExtension | any; -} -/** - * - * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. - * - */ -export type Servers = ServerObject[]; -/** - * - * The cannonical name for the method. The name MUST be unique within the methods array. - * - */ -export type MethodObjectName = string; -/** - * - * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. - * - */ -export type MethodObjectDescription = string; -/** - * - * A short summary of what the method does. - * - */ -export type MethodObjectSummary = string; -/** - * - * The name of the tag. - * - */ -export type TagObjectName = string; -/** - * - * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type TagObjectDescription = string; -/** - * - * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. - * - */ -export interface TagObject { - name: TagObjectName; - description?: TagObjectDescription; - externalDocs?: ExternalDocumentationObject; - [regex: string]: SpecificationExtension | any; -} -export type $Ref = string; -export interface ReferenceObject { - $ref: $Ref; -} -export type TagOrReference = TagObject | ReferenceObject; -/** - * - * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. - * - */ -export type MethodObjectTags = TagOrReference[]; -/** - * - * Format the server expects the params. Defaults to 'either'. - * - * @default either - * - */ -export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; -/** - * - * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). - * - */ -export type ContentDescriptorObjectName = string; -/** - * - * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ContentDescriptorObjectDescription = string; -/** - * - * A short summary of the content that is being described. - * - */ -export type ContentDescriptorObjectSummary = string; -export type $Id = string; -export type $Schema = string; -export type $Comment = string; -export type Title = string; -export type Description = string; -type AlwaysTrue = any; -export type ReadOnly = boolean; -export type Examples = AlwaysTrue[]; -export type MultipleOf = number; -export type Maximum = number; -export type ExclusiveMaximum = number; -export type Minimum = number; -export type ExclusiveMinimum = number; -export type NonNegativeInteger = number; -export type NonNegativeIntegerDefaultZero = number; -export type Pattern = string; -/** - * - * Always valid if true. Never valid if false. Is constant. - * - */ -export type JSONSchemaBoolean = boolean; -/** - * - * @default {} - * - */ -export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; -export type SchemaArray = JSONSchema[]; -/** - * - * @default true - * - */ -export type Items = JSONSchema | SchemaArray; -export type UniqueItems = boolean; -export type StringDoaGddGA = string; -/** - * - * @default [] - * - */ -export type StringArray = StringDoaGddGA[]; -/** - * - * @default {} - * - */ -export interface Definitions { - [key: string]: any; -} -/** - * - * @default {} - * - */ -export interface Properties { - [key: string]: any; -} -export type PropertyNames = any; -/** - * - * @default {} - * - */ -export interface PatternProperties { - [key: string]: any; -} -export type DependenciesSet = JSONSchema | StringArray; -export interface Dependencies { - [key: string]: any; -} -export type Enum = AlwaysTrue[]; -export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; -export type ArrayOfSimpleTypes = SimpleTypes[]; -export type Type = SimpleTypes | ArrayOfSimpleTypes; -export type Format = string; -export type ContentMediaType = string; -export type ContentEncoding = string; -export interface JSONSchemaObject { - $id?: $Id; - $schema?: $Schema; - $ref?: $Ref; - $comment?: $Comment; - title?: Title; - description?: Description; - default?: AlwaysTrue; - readOnly?: ReadOnly; - examples?: Examples; - multipleOf?: MultipleOf; - maximum?: Maximum; - exclusiveMaximum?: ExclusiveMaximum; - minimum?: Minimum; - exclusiveMinimum?: ExclusiveMinimum; - maxLength?: NonNegativeInteger; - minLength?: NonNegativeIntegerDefaultZero; - pattern?: Pattern; - additionalItems?: JSONSchema; - items?: Items; - maxItems?: NonNegativeInteger; - minItems?: NonNegativeIntegerDefaultZero; - uniqueItems?: UniqueItems; - contains?: JSONSchema; - maxProperties?: NonNegativeInteger; - minProperties?: NonNegativeIntegerDefaultZero; - required?: StringArray; - additionalProperties?: JSONSchema; - definitions?: Definitions; - properties?: Properties; - patternProperties?: PatternProperties; - dependencies?: Dependencies; - propertyNames?: JSONSchema; - const?: AlwaysTrue; - enum?: Enum; - type?: Type; - format?: Format; - contentMediaType?: ContentMediaType; - contentEncoding?: ContentEncoding; - if?: JSONSchema; - then?: JSONSchema; - else?: JSONSchema; - allOf?: SchemaArray; - anyOf?: SchemaArray; - oneOf?: SchemaArray; - not?: JSONSchema; - [k: string]: any; -} -/** - * - * Schema that describes the content. - * - * @default {} - * - */ -export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; -/** - * - * Determines if the content is a required field. Default value is `false`. - * - */ -export type ContentDescriptorObjectRequired = boolean; -/** - * - * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. - * - */ -export type ContentDescriptorObjectDeprecated = boolean; -/** - * - * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. - * - */ -export interface ContentDescriptorObject { - name: ContentDescriptorObjectName; - description?: ContentDescriptorObjectDescription; - summary?: ContentDescriptorObjectSummary; - schema: ContentDescriptorObjectSchema; - required?: ContentDescriptorObjectRequired; - deprecated?: ContentDescriptorObjectDeprecated; - [regex: string]: SpecificationExtension | any; -} -export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; -/** - * - * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. - * - */ -export type MethodObjectParams = ContentDescriptorOrReference[]; -/** - * - * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) - * - */ -export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; -/** - * - * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. - * - */ -export type ErrorObjectCode = number; -/** - * - * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. - * - */ -export type ErrorObjectMessage = string; -/** - * - * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). - * - */ -export type ErrorObjectData = any; -/** - * - * Defines an application level error. - * - */ -export interface ErrorObject { - code: ErrorObjectCode; - message: ErrorObjectMessage; - data?: ErrorObjectData; -} -export type ErrorOrReference = ErrorObject | ReferenceObject; -/** - * - * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. - * - */ -export type MethodObjectErrors = ErrorOrReference[]; -/** - * - * Cannonical name of the link. - * - */ -export type LinkObjectName = any; -/** - * - * Short description for the link. - * - */ -export type LinkObjectSummary = string; -/** - * - * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. - * - */ -export type LinkObjectMethod = string; -/** - * - * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type LinkObjectDescription = string; -/** - * - * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. - * - */ -export type LinkObjectParams = any; -/** - * - * A server object to be used by the target method. - * - */ -export interface LinkObjectServer { - url: ServerObjectUrl; - name?: ServerObjectName; - description?: ServerObjectDescription; - summary?: ServerObjectSummary; - variables?: ServerObjectVariables; - [regex: string]: SpecificationExtension | any; -} -/** - * - * A object representing a Link - * - */ -export type LinkObject = any; -export type LinkOrReference = LinkObject | ReferenceObject; -/** - * - * A list of possible links from this method call. - * - */ -export type MethodObjectLinks = LinkOrReference[]; -/** - * - * Name for the example pairing. - * - */ -export type ExamplePairingObjectName = string; -/** - * - * A verbose explanation of the example pairing. - * - */ -export type ExamplePairingObjectDescription = string; -/** - * - * Short description for the example. - * - */ -export type ExampleObjectSummary = string; -/** - * - * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. - * - */ -export type ExampleObjectValue = any; -/** - * - * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ -export type ExampleObjectDescription = string; -/** - * - * Cannonical name of the example. - * - */ -export type ExampleObjectName = string; -/** - * - * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). - * - */ -export interface ExampleObject { - summary?: ExampleObjectSummary; - value: ExampleObjectValue; - description?: ExampleObjectDescription; - name: ExampleObjectName; - [regex: string]: SpecificationExtension | any; -} -export type ExampleOrReference = ExampleObject | ReferenceObject; -/** - * - * Example parameters. - * - */ -export type ExamplePairingObjectParams = ExampleOrReference[]; -/** - * - * Example result. When not provided, the example pairing represents usage of the method as a notification. - * - */ -export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; -/** - * - * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. - * - */ -export interface ExamplePairingObject { - name: ExamplePairingObjectName; - description?: ExamplePairingObjectDescription; - params: ExamplePairingObjectParams; - result?: ExamplePairingObjectResult; - [k: string]: any; -} -export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; -/** - * - * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. - * - */ -export type MethodObjectExamples = ExamplePairingOrReference[]; -/** - * - * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. - * - */ -export type MethodObjectDeprecated = boolean; -/** - * - * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. - * - */ -export interface MethodObject { - name: MethodObjectName; - description?: MethodObjectDescription; - summary?: MethodObjectSummary; - servers?: Servers; - tags?: MethodObjectTags; - paramStructure?: MethodObjectParamStructure; - params: MethodObjectParams; - result?: MethodObjectResult; - errors?: MethodObjectErrors; - links?: MethodObjectLinks; - examples?: MethodObjectExamples; - deprecated?: MethodObjectDeprecated; - externalDocs?: ExternalDocumentationObject; - [regex: string]: SpecificationExtension | any; -} -export type MethodOrReference = MethodObject | ReferenceObject; -/** - * - * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). - * - */ -export type Methods = MethodOrReference[]; -/** - * - * An object to hold reusable [Schema Objects](#schema-object). - * - */ -export interface SchemaComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Link Objects](#link-object). - * - */ -export interface LinkComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Error Objects](#error-object). - * - */ -export interface ErrorComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Example Objects](#example-object). - * - */ -export interface ExampleComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Example Pairing Objects](#example-pairing-object). - * - */ -export interface ExamplePairingComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). - * - */ -export interface ContentDescriptorComponents { - [key: string]: any; -} -/** - * - * An object to hold reusable [Tag Objects](#tag-object). - * - */ -export interface TagComponents { - [key: string]: any; -} -/** - * - * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. - * - */ -export interface Components { - schemas?: SchemaComponents; - links?: LinkComponents; - errors?: ErrorComponents; - examples?: ExampleComponents; - examplePairings?: ExamplePairingComponents; - contentDescriptors?: ContentDescriptorComponents; - tags?: TagComponents; - [k: string]: any; -} -/** - * - * JSON Schema URI (used by some editors) - * - * @default https://meta.open-rpc.org/ - * - */ -export type MetaSchema = string; -export interface OpenrpcDocument { - openrpc: Openrpc; - info: InfoObject; - externalDocs?: ExternalDocumentationObject; - servers?: Servers; - methods: Methods; - components?: Components; - $schema?: MetaSchema; - [regex: string]: SpecificationExtension | any; -} -export {}; diff --git a/generated/packages/ts/1_4/index.js b/generated/packages/ts/1_4/index.js deleted file mode 100644 index cb0ff5c..0000000 --- a/generated/packages/ts/1_4/index.js +++ /dev/null @@ -1 +0,0 @@ -export {}; diff --git a/generated/packages/ts/index.d.ts b/generated/packages/ts/index.d.ts deleted file mode 100644 index 49172de..0000000 --- a/generated/packages/ts/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type * as V1_4 from "./1_4/index.js"; -import type * as V1_3 from "./1_3/index.js"; -export type { V1_4, V1_3 }; -export * as spec from "test-open-rpc-spec"; diff --git a/generated/packages/ts/index.js b/generated/packages/ts/index.js deleted file mode 100644 index d20edbd..0000000 --- a/generated/packages/ts/index.js +++ /dev/null @@ -1 +0,0 @@ -export * as spec from "test-open-rpc-spec"; diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index d8e58e6..171ca07 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -1,5 +1,5 @@ { - "name": "@open-rpc/spec-types", + "name": "test-open-rpc-spec-types", "version": "0.0.0", "type": "module", "module": "index.ts", @@ -24,7 +24,7 @@ } }, "dependencies": { - "test-open-rpc-spec": "test-open-rpc-spec-1.3.2.tgz" + "test-open-rpc-spec": "1.6.0" }, "files": [ "**/*.ts", From 8ba5c0e9d9b7c8dceb8c7df237db01f4390dc717 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 20:08:44 -0800 Subject: [PATCH 13/46] chore: temp. shift assets to test naming --- src/assets.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets.ts b/src/assets.ts index dd5d742..8a6ebc5 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -11,7 +11,7 @@ export interface CargoTomlOptions { export const buildCargoToml = ( schemaNames: string[], - opts: CargoTomlOptions = { name: "open-rpc-spec-types", version: "0.0.0" }, + opts: CargoTomlOptions = { name: "test-open-rpc-spec-types", version: "0.0.0" }, ): object => ({ package: { name: opts.name, @@ -42,7 +42,7 @@ export interface PyProjectTomlOptions { } export const buildPyProjectToml = ( - opts: PyProjectTomlOptions = { name: "open-rpc-spec-types", version: "0.0.0" }, + opts: PyProjectTomlOptions = { name: "test-open-rpc-spec-types", version: "0.0.0" }, ): object => ({ "build-system": { requires: ["hatchling"], From 5ad21330594b7aa3fee81e4a37ef61a70fa66aa2 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 22:25:23 -0800 Subject: [PATCH 14/46] chore: tmp adjust repo to fork --- knope.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knope.toml b/knope.toml index c56c6e4..738d408 100644 --- a/knope.toml +++ b/knope.toml @@ -45,5 +45,5 @@ name = "document-change" type = "CreateChangeFile" [github] -owner = "open-rpc" +owner = "zcstarr" repo = "spec-types" From 56247197abeb1ed4cdfc1c15c76e5ab308cfe3d1 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 23:16:32 -0800 Subject: [PATCH 15/46] fix: build to export js assets alongside ts --- generated/packages/go/go.mod | 2 +- generated/packages/go/v1_3/v1_3.go | 173 +++----- .../py/src/open_rpc_spec_types/v1_3.py | 277 +++++------- generated/packages/rs/src/v1_3.rs | 412 +++++------------- generated/packages/ts/1_3/index.ts | 398 ++--------------- generated/packages/ts/bun.lock | 19 + generated/packages/ts/package.json | 9 +- generated/packages/ts/tsconfig.json | 14 + src/assets.ts | 20 + src/index.ts | 5 +- 10 files changed, 378 insertions(+), 951 deletions(-) create mode 100644 generated/packages/ts/bun.lock create mode 100644 generated/packages/ts/tsconfig.json diff --git a/generated/packages/go/go.mod b/generated/packages/go/go.mod index 8a8f356..bebeabd 100644 --- a/generated/packages/go/go.mod +++ b/generated/packages/go/go.mod @@ -1,3 +1,3 @@ -module github.com/open-rpc/spec-types +module github.com/open-rpc/spec-types/generated/packages/go go 1.24.5 diff --git a/generated/packages/go/v1_3/v1_3.go b/generated/packages/go/v1_3/v1_3.go index 9dbc545..3c48396 100644 --- a/generated/packages/go/v1_3/v1_3.go +++ b/generated/packages/go/v1_3/v1_3.go @@ -2,75 +2,83 @@ package v1_3 import "encoding/json" import "errors" -// This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. type Openrpc string -// The title of the application. -type InfoObjectTitle string -// A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +const ( + OpenrpcEnum0 Openrpc = "1.3.2" + OpenrpcEnum1 Openrpc = "1.3.1" + OpenrpcEnum2 Openrpc = "1.3.0" + OpenrpcEnum3 Openrpc = "1.2.6" + OpenrpcEnum4 Openrpc = "1.2.5" + OpenrpcEnum5 Openrpc = "1.2.4" + OpenrpcEnum6 Openrpc = "1.2.3" + OpenrpcEnum7 Openrpc = "1.2.2" + OpenrpcEnum8 Openrpc = "1.2.1" + OpenrpcEnum9 Openrpc = "1.2.0" + OpenrpcEnum10 Openrpc = "1.1.12" + OpenrpcEnum11 Openrpc = "1.1.11" + OpenrpcEnum12 Openrpc = "1.1.10" + OpenrpcEnum13 Openrpc = "1.1.9" + OpenrpcEnum14 Openrpc = "1.1.8" + OpenrpcEnum15 Openrpc = "1.1.7" + OpenrpcEnum16 Openrpc = "1.1.6" + OpenrpcEnum17 Openrpc = "1.1.5" + OpenrpcEnum18 Openrpc = "1.1.4" + OpenrpcEnum19 Openrpc = "1.1.3" + OpenrpcEnum20 Openrpc = "1.1.2" + OpenrpcEnum21 Openrpc = "1.1.1" + OpenrpcEnum22 Openrpc = "1.1.0" + OpenrpcEnum23 Openrpc = "1.0.0" + OpenrpcEnum24 Openrpc = "1.0.0-rc0" + OpenrpcEnum25 Openrpc = "1.0.0-rc1" +) +type InfoObjectProperties string type InfoObjectDescription string -// A URL to the Terms of Service for the API. MUST be in the format of a URL. type InfoObjectTermsOfService string -// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). type InfoObjectVersion string -// The identifying name of the contact person/organization. type ContactObjectName string -// The email address of the contact person/organization. MUST be in the format of an email address. type ContactObjectEmail string -// The URL pointing to the contact information. MUST be in the format of a URL. type ContactObjectUrl string -// This object MAY be extended with [Specification Extensions](#specification-extensions). type SpecificationExtension interface{} -// Contact information for the exposed API. type ContactObject struct { Name *ContactObjectName `json:"name,omitempty"` Email *ContactObjectEmail `json:"email,omitempty"` Url *ContactObjectUrl `json:"url,omitempty"` } -// The license name used for the API. type LicenseObjectName string -// A URL to the license used for the API. MUST be in the format of a URL. type LicenseObjectUrl string -// License information for the exposed API. type LicenseObject struct { Name *LicenseObjectName `json:"name,omitempty"` Url *LicenseObjectUrl `json:"url,omitempty"` } -// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. -type InfoObject interface{} -// A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. +type InfoObject struct { + Title *InfoObjectProperties `json:"title"` + Description *InfoObjectDescription `json:"description,omitempty"` + TermsOfService *InfoObjectTermsOfService `json:"termsOfService,omitempty"` + Version *InfoObjectVersion `json:"version"` + Contact *ContactObject `json:"contact,omitempty"` + License *LicenseObject `json:"license,omitempty"` +} type ExternalDocumentationObjectDescription string -// The URL for the target documentation. Value MUST be in the format of a URL. type ExternalDocumentationObjectUrl string -// Additional external documentation for this tag. +// information about external documentation type ExternalDocumentationObject struct { Description *ExternalDocumentationObjectDescription `json:"description,omitempty"` Url *ExternalDocumentationObjectUrl `json:"url"` } -// A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. type ServerObjectUrl string -// An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type ServerObjectName string -// An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type ServerObjectDescription string -// A short summary of what the server is. type ServerObjectSummary string -// The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. type ServerObjectVariableDefault string -// An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type ServerObjectVariableDescription string -// An enumeration of string values to be used if the substitution options are from a limited set. type ServerObjectVariableEnumItem string -// An enumeration of string values to be used if the substitution options are from a limited set. type ServerObjectVariableEnum []ServerObjectVariableEnumItem -// An object representing a Server Variable for server URL template substitution. type ServerObjectVariable struct { Default *ServerObjectVariableDefault `json:"default"` Description *ServerObjectVariableDescription `json:"description,omitempty"` Enum *ServerObjectVariableEnum `json:"enum,omitempty"` } -// A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. type ServerObjectVariables map[string]interface{} -// A object representing a Server type ServerObject struct { Url *ServerObjectUrl `json:"url"` Name *ServerObjectName `json:"name,omitempty"` @@ -79,7 +87,6 @@ type ServerObject struct { Variables *ServerObjectVariables `json:"variables,omitempty"` } type AlwaysFalse interface{} -// An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. type Servers []ServerObject // The cannonical name for the method. The name MUST be unique within the methods array. type MethodObjectName string @@ -87,11 +94,8 @@ type MethodObjectName string type MethodObjectDescription string // A short summary of what the method does. type MethodObjectSummary string -// The name of the tag. type TagObjectName string -// A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type TagObjectDescription string -// Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. type TagObject struct { Name *TagObjectName `json:"name"` Description *TagObjectDescription `json:"description,omitempty"` @@ -131,7 +135,6 @@ func (o TagOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. type MethodObjectTags []TagOrReference // Format the server expects the params. Defaults to 'either'. // @@ -144,11 +147,8 @@ const ( MethodObjectParamStructureEnum1 MethodObjectParamStructure = "by-name" MethodObjectParamStructureEnum2 MethodObjectParamStructure = "either" ) -// Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). type ContentDescriptorObjectName string -// A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type ContentDescriptorObjectDescription string -// A short summary of the content that is being described. type ContentDescriptorObjectSummary string type Id string type Schema string @@ -166,42 +166,6 @@ type ExclusiveMinimum float64 type NonNegativeInteger int64 type NonNegativeIntegerDefaultZero int64 type Pattern string -// Always valid if true. Never valid if false. Is constant. -type JSONSchemaBoolean bool -// -// --- Default --- -// -// {} -type JSONSchema struct { - JSONSchemaObject *JSONSchemaObject - JSONSchemaBoolean *JSONSchemaBoolean -} -// UnmarshalJSON implements the json Unmarshaler interface. -// This implementation DOES NOT assert that ONE AND ONLY ONE -// of the simple properties is satisfied; it lazily uses the first one that is satisfied. -// Ergo, it will not return an error if more than one property is valid. -func (o *JSONSchema) UnmarshalJSON(bytes []byte) error { - var myJSONSchemaObject JSONSchemaObject - if err := json.Unmarshal(bytes, &myJSONSchemaObject); err == nil { - o.JSONSchemaObject = &myJSONSchemaObject - return nil - } - var myJSONSchemaBoolean JSONSchemaBoolean - if err := json.Unmarshal(bytes, &myJSONSchemaBoolean); err == nil { - o.JSONSchemaBoolean = &myJSONSchemaBoolean - return nil - } - return errors.New("failed to unmarshal one of the object properties") -} -func (o JSONSchema) MarshalJSON() ([]byte, error) { - if o.JSONSchemaObject != nil { - return json.Marshal(o.JSONSchemaObject) - } - if o.JSONSchemaBoolean != nil { - return json.Marshal(o.JSONSchemaBoolean) - } - return nil, errors.New("failed to marshal any one of the object properties") -} type SchemaArray []JSONSchema // // --- Default --- @@ -386,12 +350,13 @@ type JSONSchemaObject struct { OneOf *SchemaArray `json:"oneOf,omitempty"` Not *JSONSchema `json:"not,omitempty"` } -// Schema that describes the content. +// Always valid if true. Never valid if false. Is constant. +type JSONSchemaBoolean bool // // --- Default --- // // {} -type ContentDescriptorObjectSchema struct { +type JSONSchema struct { JSONSchemaObject *JSONSchemaObject JSONSchemaBoolean *JSONSchemaBoolean } @@ -399,7 +364,7 @@ type ContentDescriptorObjectSchema struct { // This implementation DOES NOT assert that ONE AND ONLY ONE // of the simple properties is satisfied; it lazily uses the first one that is satisfied. // Ergo, it will not return an error if more than one property is valid. -func (o *ContentDescriptorObjectSchema) UnmarshalJSON(bytes []byte) error { +func (o *JSONSchema) UnmarshalJSON(bytes []byte) error { var myJSONSchemaObject JSONSchemaObject if err := json.Unmarshal(bytes, &myJSONSchemaObject); err == nil { o.JSONSchemaObject = &myJSONSchemaObject @@ -412,7 +377,7 @@ func (o *ContentDescriptorObjectSchema) UnmarshalJSON(bytes []byte) error { } return errors.New("failed to unmarshal one of the object properties") } -func (o ContentDescriptorObjectSchema) MarshalJSON() ([]byte, error) { +func (o JSONSchema) MarshalJSON() ([]byte, error) { if o.JSONSchemaObject != nil { return json.Marshal(o.JSONSchemaObject) } @@ -421,16 +386,13 @@ func (o ContentDescriptorObjectSchema) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// Determines if the content is a required field. Default value is `false`. type ContentDescriptorObjectRequired bool -// Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. type ContentDescriptorObjectDeprecated bool -// Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. type ContentDescriptorObject struct { Name *ContentDescriptorObjectName `json:"name"` Description *ContentDescriptorObjectDescription `json:"description,omitempty"` Summary *ContentDescriptorObjectSummary `json:"summary,omitempty"` - Schema *ContentDescriptorObjectSchema `json:"schema"` + Schema *JSONSchema `json:"schema"` Required *ContentDescriptorObjectRequired `json:"required,omitempty"` Deprecated *ContentDescriptorObjectDeprecated `json:"deprecated,omitempty"` } @@ -464,9 +426,7 @@ func (o ContentDescriptorOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. type MethodObjectParams []ContentDescriptorOrReference -// The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) type MethodObjectResult struct { ContentDescriptorObject *ContentDescriptorObject ReferenceObject *ReferenceObject @@ -539,19 +499,13 @@ func (o ErrorOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +// Defines an application level error. type MethodObjectErrors []ErrorOrReference -// Cannonical name of the link. -type LinkObjectName interface{} -// Short description for the link. +type LinkObjectName string type LinkObjectSummary string -// The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. type LinkObjectMethod string -// A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type LinkObjectDescription string -// A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. type LinkObjectParams interface{} -// A server object to be used by the target method. type LinkObjectServer struct { Url *ServerObjectUrl `json:"url"` Name *ServerObjectName `json:"name,omitempty"` @@ -559,8 +513,14 @@ type LinkObjectServer struct { Summary *ServerObjectSummary `json:"summary,omitempty"` Variables *ServerObjectVariables `json:"variables,omitempty"` } -// A object representing a Link -type LinkObject interface{} +type LinkObject struct { + Name *LinkObjectName `json:"name,omitempty"` + Summary *LinkObjectSummary `json:"summary,omitempty"` + Method *LinkObjectMethod `json:"method,omitempty"` + Description *LinkObjectDescription `json:"description,omitempty"` + Params *LinkObjectParams `json:"params,omitempty"` + Server *LinkObjectServer `json:"server,omitempty"` +} type LinkOrReference struct { LinkObject *LinkObject ReferenceObject *ReferenceObject @@ -591,21 +551,13 @@ func (o LinkOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// A list of possible links from this method call. type MethodObjectLinks []LinkOrReference -// Name for the example pairing. type ExamplePairingObjectName string -// A verbose explanation of the example pairing. type ExamplePairingObjectDescription string -// Short description for the example. type ExampleObjectSummary string -// Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. type ExampleObjectValue interface{} -// A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. type ExampleObjectDescription string -// Cannonical name of the example. type ExampleObjectName string -// The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). type ExampleObject struct { Summary *ExampleObjectSummary `json:"summary,omitempty"` Value *ExampleObjectValue `json:"value"` @@ -642,9 +594,7 @@ func (o ExampleOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// Example parameters. type ExamplePairingObjectParams []ExampleOrReference -// Example result. When not provided, the example pairing represents usage of the method as a notification. type ExamplePairingObjectResult struct { ExampleObject *ExampleObject ReferenceObject *ReferenceObject @@ -675,7 +625,6 @@ func (o ExamplePairingObjectResult) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. type ExamplePairingObject struct { Name *ExamplePairingObjectName `json:"name"` Description *ExamplePairingObjectDescription `json:"description,omitempty"` @@ -712,11 +661,8 @@ func (o ExamplePairingOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. type MethodObjectExamples []ExamplePairingOrReference -// Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. type MethodObjectDeprecated bool -// Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. type MethodObject struct { Name *MethodObjectName `json:"name"` Description *MethodObjectDescription `json:"description,omitempty"` @@ -762,23 +708,14 @@ func (o MethodOrReference) MarshalJSON() ([]byte, error) { } return nil, errors.New("failed to marshal any one of the object properties") } -// The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). type Methods []MethodOrReference -// An object to hold reusable [Schema Objects](#schema-object). type SchemaComponents map[string]interface{} -// An object to hold reusable [Link Objects](#link-object). type LinkComponents map[string]interface{} -// An object to hold reusable [Error Objects](#error-object). type ErrorComponents map[string]interface{} -// An object to hold reusable [Example Objects](#example-object). type ExampleComponents map[string]interface{} -// An object to hold reusable [Example Pairing Objects](#example-pairing-object). type ExamplePairingComponents map[string]interface{} -// An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). type ContentDescriptorComponents map[string]interface{} -// An object to hold reusable [Tag Objects](#tag-object). type TagComponents map[string]interface{} -// Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. type Components struct { Schemas *SchemaComponents `json:"schemas,omitempty"` Links *LinkComponents `json:"links,omitempty"` @@ -804,4 +741,4 @@ type OpenrpcDocument struct { Schema *MetaSchema `json:"$schema,omitempty"` } -const RawOpenrpcDocument = "{\"$schema\":\"https://meta.json-schema.tools/\",\"$id\":\"https://meta.open-rpc.org/\",\"title\":\"openrpcDocument\",\"type\":\"object\",\"required\":[\"info\",\"methods\",\"openrpc\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"openrpc\":{\"description\":\"This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string.\",\"title\":\"openrpc\",\"type\":\"string\",\"regex\":\"^1\\\\.4\\\\.\\\\d+$\"},\"info\":{\"$ref\":\"#/definitions/infoObject\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"},\"servers\":{\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"methods\":{\"title\":\"methods\",\"type\":\"array\",\"description\":\"The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example).\",\"additionalItems\":false,\"items\":{\"title\":\"methodOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/methodObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"components\":{\"title\":\"components\",\"description\":\"Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\",\"type\":\"object\",\"properties\":{\"schemas\":{\"title\":\"schemaComponents\",\"description\":\"An object to hold reusable [Schema Objects](#schema-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/JSONSchema\"}}},\"links\":{\"title\":\"linkComponents\",\"type\":\"object\",\"description\":\"An object to hold reusable [Link Objects](#link-object).\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/linkObject\"}}},\"errors\":{\"title\":\"errorComponents\",\"description\":\"An object to hold reusable [Error Objects](#error-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/errorObject\"}}},\"examples\":{\"title\":\"exampleComponents\",\"description\":\"An object to hold reusable [Example Objects](#example-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/exampleObject\"}}},\"examplePairings\":{\"title\":\"examplePairingComponents\",\"description\":\"An object to hold reusable [Example Pairing Objects](#example-pairing-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/examplePairingObject\"}}},\"contentDescriptors\":{\"title\":\"contentDescriptorComponents\",\"description\":\"An object to hold reusable [Content Descriptor Objects](#content-descriptor-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/contentDescriptorObject\"}}},\"tags\":{\"title\":\"tagComponents\",\"description\":\"An object to hold reusable [Tag Objects](#tag-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/tagObject\"}}}}},\"$schema\":{\"title\":\"metaSchema\",\"description\":\"JSON Schema URI (used by some editors)\",\"type\":\"string\",\"default\":\"https://meta.open-rpc.org/\"}},\"definitions\":{\"specificationExtension\":{\"title\":\"specificationExtension\",\"description\":\"This object MAY be extended with [Specification Extensions](#specification-extensions).\"},\"JSONSchema\":{\"$ref\":\"https://meta.json-schema.tools\"},\"referenceObject\":{\"title\":\"referenceObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"description\":\"The reference string.\",\"$ref\":\"https://meta.json-schema.tools/#/definitions/JSONSchemaObject/properties/$ref\"}}},\"errorObject\":{\"title\":\"errorObject\",\"type\":\"object\",\"description\":\"Defines an application level error.\",\"additionalProperties\":false,\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"title\":\"errorObjectCode\",\"description\":\"A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.\",\"type\":\"integer\"},\"message\":{\"title\":\"errorObjectMessage\",\"description\":\"A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.\",\"type\":\"string\"},\"data\":{\"title\":\"errorObjectData\",\"description\":\"A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).\"}}},\"licenseObject\":{\"title\":\"licenseObject\",\"description\":\"License information for the exposed API.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"licenseObjectName\",\"description\":\"The license name used for the API.\",\"type\":\"string\"},\"url\":{\"title\":\"licenseObjectUrl\",\"description\":\"A URL to the license used for the API. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"contactObject\":{\"description\":\"Contact information for the exposed API.\",\"title\":\"contactObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"contactObjectName\",\"description\":\"The identifying name of the contact person/organization.\",\"type\":\"string\"},\"email\":{\"title\":\"contactObjectEmail\",\"description\":\"The email address of the contact person/organization. MUST be in the format of an email address.\",\"type\":\"string\"},\"url\":{\"title\":\"contactObjectUrl\",\"description\":\"The URL pointing to the contact information. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"infoObject\":{\"title\":\"infoObject\",\"description\":\"The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.\",\"additionalProperties\":false,\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"title\":\"infoObjectTitle\",\"description\":\"The title of the application.\",\"type\":\"string\"},\"description\":{\"title\":\"infoObjectDescription\",\"description\":\"A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"termsOfService\":{\"title\":\"infoObjectTermsOfService\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"title\":\"infoObjectVersion\",\"description\":\"The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version).\",\"type\":\"string\"},\"contact\":{\"$ref\":\"#/definitions/contactObject\"},\"license\":{\"$ref\":\"#/definitions/licenseObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"serverObject\":{\"title\":\"serverObject\",\"description\":\"A object representing a Server\",\"type\":\"object\",\"required\":[\"url\"],\"additionalProperties\":false,\"properties\":{\"url\":{\"title\":\"serverObjectUrl\",\"description\":\"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"string\",\"format\":\"uri\"},\"name\":{\"title\":\"serverObjectName\",\"description\":\"An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectDescription\",\"description\":\"An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"serverObjectSummary\",\"description\":\"A short summary of what the server is.\",\"type\":\"string\"},\"variables\":{\"title\":\"serverObjectVariables\",\"description\":\"A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"title\":\"serverObjectVariable\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"type\":\"object\",\"required\":[\"default\"],\"properties\":{\"default\":{\"title\":\"serverObjectVariableDefault\",\"description\":\"The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectVariableDescription\",\"description\":\"An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"enum\":{\"title\":\"serverObjectVariableEnum\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"array\",\"items\":{\"title\":\"serverObjectVariableEnumItem\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"string\"}}}}}}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"linkObject\":{\"title\":\"linkObject\",\"description\":\"A object representing a Link\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"linkObjectName\",\"description\":\"Cannonical name of the link.\",\"minLength\":1},\"summary\":{\"title\":\"linkObjectSummary\",\"description\":\"Short description for the link.\",\"type\":\"string\"},\"method\":{\"title\":\"linkObjectMethod\",\"description\":\"The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted.\",\"type\":\"string\"},\"description\":{\"title\":\"linkObjectDescription\",\"description\":\"A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"params\":{\"title\":\"linkObjectParams\",\"description\":\"A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method.\"},\"server\":{\"title\":\"linkObjectServer\",\"description\":\"A server object to be used by the target method.\",\"$ref\":\"#/definitions/serverObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"externalDocumentationObject\":{\"description\":\"Additional external documentation.\",\"title\":\"externalDocumentationObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"url\"],\"properties\":{\"description\":{\"description\":\"A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"title\":\"externalDocumentationObjectDescription\",\"type\":\"string\"},\"url\":{\"description\":\"The URL for the target documentation. Value MUST be in the format of a URL.\",\"title\":\"externalDocumentationObjectUrl\",\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"methodObject\":{\"title\":\"methodObject\",\"description\":\"Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"methodObjectName\",\"description\":\"The cannonical name for the method. The name MUST be unique within the methods array.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"methodObjectDescription\",\"description\":\"A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"methodObjectSummary\",\"description\":\"A short summary of what the method does.\",\"type\":\"string\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"tags\":{\"title\":\"methodObjectTags\",\"description\":\"A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.\",\"type\":\"array\",\"items\":{\"title\":\"tagOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/tagObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"paramStructure\":{\"title\":\"methodObjectParamStructure\",\"type\":\"string\",\"description\":\"Format the server expects the params. Defaults to 'either'.\",\"enum\":[\"by-position\",\"by-name\",\"either\"],\"default\":\"either\"},\"params\":{\"title\":\"methodObjectParams\",\"description\":\" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with \\\"required\\\": false) MUST be positioned after all required params in the list.\",\"type\":\"array\",\"items\":{\"title\":\"contentDescriptorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"methodObjectResult\",\"description\":\"The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification)\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]},\"errors\":{\"title\":\"methodObjectErrors\",\"description\":\"A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes.\",\"type\":\"array\",\"items\":{\"title\":\"errorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/errorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"links\":{\"title\":\"methodObjectLinks\",\"description\":\"A list of possible links from this method call.\",\"type\":\"array\",\"items\":{\"title\":\"linkOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/linkObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"examples\":{\"title\":\"methodObjectExamples\",\"description\":\"Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing.\",\"type\":\"array\",\"items\":{\"title\":\"examplePairingOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/examplePairingObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"deprecated\":{\"title\":\"methodObjectDeprecated\",\"description\":\"Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"tagObject\":{\"title\":\"tagObject\",\"description\":\"Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"title\":\"tagObjectName\",\"description\":\"The name of the tag.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"tagObjectDescription\",\"description\":\"A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"externalDocs\":{\"description\":\"Additional external documentation for this tag.\",\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"exampleObject\":{\"title\":\"exampleObject\",\"description\":\"The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object).\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"summary\":{\"title\":\"exampleObjectSummary\",\"description\":\"Short description for the example.\",\"type\":\"string\"},\"value\":{\"title\":\"exampleObjectValue\",\"description\":\"Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary.\"},\"description\":{\"title\":\"exampleObjectDescription\",\"description\":\"A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"name\":{\"title\":\"exampleObjectName\",\"description\":\"Cannonical name of the example.\",\"type\":\"string\",\"minLength\":1}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"examplePairingObject\":{\"title\":\"examplePairingObject\",\"description\":\"The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"properties\":{\"name\":{\"title\":\"examplePairingObjectName\",\"description\":\"Name for the example pairing.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"examplePairingObjectDescription\",\"description\":\"A verbose explanation of the example pairing.\",\"type\":\"string\"},\"params\":{\"title\":\"examplePairingObjectParams\",\"description\":\"Example parameters.\",\"type\":\"array\",\"items\":{\"title\":\"exampleOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"examplePairingObjectResult\",\"description\":\"Example result. When not provided, the example pairing represents usage of the method as a notification.\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}}},\"contentDescriptorObject\":{\"title\":\"contentDescriptorObject\",\"description\":\"Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"schema\"],\"properties\":{\"name\":{\"title\":\"contentDescriptorObjectName\",\"description\":\"Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name).\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"contentDescriptorObjectDescription\",\"description\":\"A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"contentDescriptorObjectSummary\",\"description\":\"A short summary of the content that is being described.\",\"type\":\"string\"},\"schema\":{\"title\":\"contentDescriptorObjectSchema\",\"description\":\"Schema that describes the content.\",\"$ref\":\"#/definitions/JSONSchema\"},\"required\":{\"title\":\"contentDescriptorObjectRequired\",\"description\":\"Determines if the content is a required field. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"deprecated\":{\"title\":\"contentDescriptorObjectDeprecated\",\"description\":\"Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`.\",\"type\":\"boolean\",\"default\":false}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}}}}" +const RawOpenrpcDocument = "{\"$schema\":\"https://meta.json-schema.tools/\",\"$id\":\"https://meta.open-rpc.org/\",\"title\":\"openrpcDocument\",\"type\":\"object\",\"required\":[\"info\",\"methods\",\"openrpc\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"openrpc\":{\"title\":\"openrpc\",\"type\":\"string\",\"enum\":[\"1.3.2\",\"1.3.1\",\"1.3.0\",\"1.2.6\",\"1.2.5\",\"1.2.4\",\"1.2.3\",\"1.2.2\",\"1.2.1\",\"1.2.0\",\"1.1.12\",\"1.1.11\",\"1.1.10\",\"1.1.9\",\"1.1.8\",\"1.1.7\",\"1.1.6\",\"1.1.5\",\"1.1.4\",\"1.1.3\",\"1.1.2\",\"1.1.1\",\"1.1.0\",\"1.0.0\",\"1.0.0-rc0\",\"1.0.0-rc1\"]},\"info\":{\"$ref\":\"#/definitions/infoObject\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"methods\":{\"title\":\"methods\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"title\":\"methodOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/methodObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"components\":{\"title\":\"components\",\"type\":\"object\",\"properties\":{\"schemas\":{\"title\":\"schemaComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/JSONSchema\"}}},\"links\":{\"title\":\"linkComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/linkObject\"}}},\"errors\":{\"title\":\"errorComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/errorObject\"}}},\"examples\":{\"title\":\"exampleComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/exampleObject\"}}},\"examplePairings\":{\"title\":\"examplePairingComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/examplePairingObject\"}}},\"contentDescriptors\":{\"title\":\"contentDescriptorComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/contentDescriptorObject\"}}},\"tags\":{\"title\":\"tagComponents\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/tagObject\"}}}}},\"$schema\":{\"title\":\"metaSchema\",\"description\":\"JSON Schema URI (used by some editors)\",\"type\":\"string\",\"default\":\"https://meta.open-rpc.org/\"}},\"definitions\":{\"specificationExtension\":{\"title\":\"specificationExtension\"},\"JSONSchema\":{\"$ref\":\"https://meta.json-schema.tools\"},\"referenceObject\":{\"title\":\"referenceObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"$ref\":\"https://meta.json-schema.tools/#/definitions/JSONSchemaObject/properties/$ref\"}}},\"errorObject\":{\"title\":\"errorObject\",\"type\":\"object\",\"description\":\"Defines an application level error.\",\"additionalProperties\":false,\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"title\":\"errorObjectCode\",\"description\":\"A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.\",\"type\":\"integer\"},\"message\":{\"title\":\"errorObjectMessage\",\"description\":\"A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.\",\"type\":\"string\"},\"data\":{\"title\":\"errorObjectData\",\"description\":\"A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).\"}}},\"licenseObject\":{\"title\":\"licenseObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"licenseObjectName\",\"type\":\"string\"},\"url\":{\"title\":\"licenseObjectUrl\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"contactObject\":{\"title\":\"contactObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"contactObjectName\",\"type\":\"string\"},\"email\":{\"title\":\"contactObjectEmail\",\"type\":\"string\"},\"url\":{\"title\":\"contactObjectUrl\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"infoObject\":{\"title\":\"infoObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"title\":\"infoObjectProperties\",\"type\":\"string\"},\"description\":{\"title\":\"infoObjectDescription\",\"type\":\"string\"},\"termsOfService\":{\"title\":\"infoObjectTermsOfService\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"title\":\"infoObjectVersion\",\"type\":\"string\"},\"contact\":{\"$ref\":\"#/definitions/contactObject\"},\"license\":{\"$ref\":\"#/definitions/licenseObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"serverObject\":{\"title\":\"serverObject\",\"type\":\"object\",\"required\":[\"url\"],\"additionalProperties\":false,\"properties\":{\"url\":{\"title\":\"serverObjectUrl\",\"type\":\"string\",\"format\":\"uri\"},\"name\":{\"title\":\"serverObjectName\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectDescription\",\"type\":\"string\"},\"summary\":{\"title\":\"serverObjectSummary\",\"type\":\"string\"},\"variables\":{\"title\":\"serverObjectVariables\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"title\":\"serverObjectVariable\",\"type\":\"object\",\"required\":[\"default\"],\"properties\":{\"default\":{\"title\":\"serverObjectVariableDefault\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectVariableDescription\",\"type\":\"string\"},\"enum\":{\"title\":\"serverObjectVariableEnum\",\"type\":\"array\",\"items\":{\"title\":\"serverObjectVariableEnumItem\",\"type\":\"string\"}}}}}}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"linkObject\":{\"title\":\"linkObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"linkObjectName\",\"type\":\"string\",\"minLength\":1},\"summary\":{\"title\":\"linkObjectSummary\",\"type\":\"string\"},\"method\":{\"title\":\"linkObjectMethod\",\"type\":\"string\"},\"description\":{\"title\":\"linkObjectDescription\",\"type\":\"string\"},\"params\":{\"title\":\"linkObjectParams\"},\"server\":{\"title\":\"linkObjectServer\",\"$ref\":\"#/definitions/serverObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"externalDocumentationObject\":{\"title\":\"externalDocumentationObject\",\"type\":\"object\",\"additionalProperties\":false,\"description\":\"information about external documentation\",\"required\":[\"url\"],\"properties\":{\"description\":{\"title\":\"externalDocumentationObjectDescription\",\"type\":\"string\"},\"url\":{\"title\":\"externalDocumentationObjectUrl\",\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"methodObject\":{\"title\":\"methodObject\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"methodObjectName\",\"description\":\"The cannonical name for the method. The name MUST be unique within the methods array.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"methodObjectDescription\",\"description\":\"A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"methodObjectSummary\",\"description\":\"A short summary of what the method does.\",\"type\":\"string\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"tags\":{\"title\":\"methodObjectTags\",\"type\":\"array\",\"items\":{\"title\":\"tagOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/tagObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"paramStructure\":{\"title\":\"methodObjectParamStructure\",\"type\":\"string\",\"description\":\"Format the server expects the params. Defaults to 'either'.\",\"enum\":[\"by-position\",\"by-name\",\"either\"],\"default\":\"either\"},\"params\":{\"title\":\"methodObjectParams\",\"type\":\"array\",\"items\":{\"title\":\"contentDescriptorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"methodObjectResult\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]},\"errors\":{\"title\":\"methodObjectErrors\",\"description\":\"Defines an application level error.\",\"type\":\"array\",\"items\":{\"title\":\"errorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/errorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"links\":{\"title\":\"methodObjectLinks\",\"type\":\"array\",\"items\":{\"title\":\"linkOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/linkObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"examples\":{\"title\":\"methodObjectExamples\",\"type\":\"array\",\"items\":{\"title\":\"examplePairingOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/examplePairingObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"deprecated\":{\"title\":\"methodObjectDeprecated\",\"type\":\"boolean\",\"default\":false},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"tagObject\":{\"title\":\"tagObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"title\":\"tagObjectName\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"tagObjectDescription\",\"type\":\"string\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"exampleObject\":{\"title\":\"exampleObject\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"summary\":{\"title\":\"exampleObjectSummary\",\"type\":\"string\"},\"value\":{\"title\":\"exampleObjectValue\"},\"description\":{\"title\":\"exampleObjectDescription\",\"type\":\"string\"},\"name\":{\"title\":\"exampleObjectName\",\"type\":\"string\",\"minLength\":1}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"examplePairingObject\":{\"title\":\"examplePairingObject\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"properties\":{\"name\":{\"title\":\"examplePairingObjectName\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"examplePairingObjectDescription\",\"type\":\"string\"},\"params\":{\"title\":\"examplePairingObjectParams\",\"type\":\"array\",\"items\":{\"title\":\"exampleOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"examplePairingObjectResult\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}}},\"contentDescriptorObject\":{\"title\":\"contentDescriptorObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"schema\"],\"properties\":{\"name\":{\"title\":\"contentDescriptorObjectName\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"contentDescriptorObjectDescription\",\"type\":\"string\"},\"summary\":{\"title\":\"contentDescriptorObjectSummary\",\"type\":\"string\"},\"schema\":{\"$ref\":\"#/definitions/JSONSchema\"},\"required\":{\"title\":\"contentDescriptorObjectRequired\",\"type\":\"boolean\",\"default\":false},\"deprecated\":{\"title\":\"contentDescriptorObjectDeprecated\",\"type\":\"boolean\",\"default\":false}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}}}}" diff --git a/generated/packages/py/src/open_rpc_spec_types/v1_3.py b/generated/packages/py/src/open_rpc_spec_types/v1_3.py index 5a732c7..c6bbfe1 100644 --- a/generated/packages/py/src/open_rpc_spec_types/v1_3.py +++ b/generated/packages/py/src/open_rpc_spec_types/v1_3.py @@ -1,104 +1,109 @@ from typing import TypedDict from typing import Optional +from enum import Enum from typing import NewType from typing import Any from typing import List from typing import Mapping from typing import Union -from enum import Enum -"""This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. -""" -Openrpc = NewType("Openrpc", str) -"""The title of the application. -""" -InfoObjectTitle = NewType("InfoObjectTitle", str) -"""A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + +class Openrpc(Enum): + OneThreeTwo = 0 + OneThreeOne = 1 + OneThreeZero = 2 + OneTwoSix = 3 + OneTwoFive = 4 + OneTwoFour = 5 + OneTwoThree = 6 + OneTwoTwo = 7 + OneTwoOne = 8 + OneTwoZero = 9 + OneOneOneTwo = 10 + OneOneOneOne = 11 + OneOneOneZero = 12 + OneOneNine = 13 + OneOneEight = 14 + OneOneSeven = 15 + OneOneSix = 16 + OneOneFive = 17 + OneOneFour = 18 + OneOneThree = 19 + OneOneTwo = 20 + OneOneOne = 21 + OneOneZero = 22 + OneZeroZero = 23 + OneZeroZeroRcZero = 24 + OneZeroZeroRcOne = 25 + +InfoObjectProperties = NewType("InfoObjectProperties", str) + InfoObjectDescription = NewType("InfoObjectDescription", str) -"""A URL to the Terms of Service for the API. MUST be in the format of a URL. -""" + InfoObjectTermsOfService = NewType("InfoObjectTermsOfService", str) -"""The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). -""" + InfoObjectVersion = NewType("InfoObjectVersion", str) -"""The identifying name of the contact person/organization. -""" + ContactObjectName = NewType("ContactObjectName", str) -"""The email address of the contact person/organization. MUST be in the format of an email address. -""" + ContactObjectEmail = NewType("ContactObjectEmail", str) -"""The URL pointing to the contact information. MUST be in the format of a URL. -""" + ContactObjectUrl = NewType("ContactObjectUrl", str) -"""This object MAY be extended with [Specification Extensions](#specification-extensions). -""" + SpecificationExtension = NewType("SpecificationExtension", Any) -"""Contact information for the exposed API. -""" + class ContactObject(TypedDict): name: Optional[ContactObjectName] email: Optional[ContactObjectEmail] url: Optional[ContactObjectUrl] -"""The license name used for the API. -""" + LicenseObjectName = NewType("LicenseObjectName", str) -"""A URL to the license used for the API. MUST be in the format of a URL. -""" + LicenseObjectUrl = NewType("LicenseObjectUrl", str) -"""License information for the exposed API. -""" + class LicenseObject(TypedDict): name: Optional[LicenseObjectName] url: Optional[LicenseObjectUrl] -"""The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. -""" -InfoObject = NewType("InfoObject", Any) -"""A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + +class InfoObject(TypedDict): + title: Optional[InfoObjectProperties] + description: Optional[InfoObjectDescription] + termsOfService: Optional[InfoObjectTermsOfService] + version: Optional[InfoObjectVersion] + contact: Optional[ContactObject] + license: Optional[LicenseObject] + ExternalDocumentationObjectDescription = NewType("ExternalDocumentationObjectDescription", str) -"""The URL for the target documentation. Value MUST be in the format of a URL. -""" + ExternalDocumentationObjectUrl = NewType("ExternalDocumentationObjectUrl", str) -"""Additional external documentation for this tag. +"""information about external documentation """ class ExternalDocumentationObject(TypedDict): description: Optional[ExternalDocumentationObjectDescription] url: Optional[ExternalDocumentationObjectUrl] -"""A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. -""" + ServerObjectUrl = NewType("ServerObjectUrl", str) -"""An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + ServerObjectName = NewType("ServerObjectName", str) -"""An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + ServerObjectDescription = NewType("ServerObjectDescription", str) -"""A short summary of what the server is. -""" + ServerObjectSummary = NewType("ServerObjectSummary", str) -"""The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. -""" + ServerObjectVariableDefault = NewType("ServerObjectVariableDefault", str) -"""An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + ServerObjectVariableDescription = NewType("ServerObjectVariableDescription", str) -"""An enumeration of string values to be used if the substitution options are from a limited set. -""" + ServerObjectVariableEnumItem = NewType("ServerObjectVariableEnumItem", str) -"""An enumeration of string values to be used if the substitution options are from a limited set. -""" + ServerObjectVariableEnum = NewType("ServerObjectVariableEnum", List[ServerObjectVariableEnumItem]) -"""An object representing a Server Variable for server URL template substitution. -""" + class ServerObjectVariable(TypedDict): default: Optional[ServerObjectVariableDefault] description: Optional[ServerObjectVariableDescription] enum: Optional[ServerObjectVariableEnum] -"""A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. -""" + ServerObjectVariables = NewType("ServerObjectVariables", Mapping[Any, Any]) -"""A object representing a Server -""" + class ServerObject(TypedDict): url: Optional[ServerObjectUrl] name: Optional[ServerObjectName] @@ -106,8 +111,7 @@ class ServerObject(TypedDict): summary: Optional[ServerObjectSummary] variables: Optional[ServerObjectVariables] AlwaysFalse = NewType("AlwaysFalse", Any) -"""An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. -""" + Servers = NewType("Servers", List[ServerObject]) """The cannonical name for the method. The name MUST be unique within the methods array. """ @@ -118,14 +122,11 @@ class ServerObject(TypedDict): """A short summary of what the method does. """ MethodObjectSummary = NewType("MethodObjectSummary", str) -"""The name of the tag. -""" + TagObjectName = NewType("TagObjectName", str) -"""A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + TagObjectDescription = NewType("TagObjectDescription", str) -"""Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. -""" + class TagObject(TypedDict): name: Optional[TagObjectName] description: Optional[TagObjectDescription] @@ -137,8 +138,7 @@ class ReferenceObject(TypedDict): $ref: undefined TagOrReference = NewType("TagOrReference", Union[TagObject, ReferenceObject]) -"""A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. -""" + MethodObjectTags = NewType("MethodObjectTags", List[TagOrReference]) """Format the server expects the params. Defaults to 'either'. """ @@ -146,14 +146,11 @@ class MethodObjectParamStructure(Enum): ByPosition = 0 ByName = 1 Either = 2 -"""Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). -""" + ContentDescriptorObjectName = NewType("ContentDescriptorObjectName", str) -"""A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + ContentDescriptorObjectDescription = NewType("ContentDescriptorObjectDescription", str) -"""A short summary of the content that is being described. -""" + ContentDescriptorObjectSummary = NewType("ContentDescriptorObjectSummary", str) Id = NewType("Id", str) @@ -186,11 +183,6 @@ class MethodObjectParamStructure(Enum): NonNegativeIntegerDefaultZero = NewType("NonNegativeIntegerDefaultZero", int) Pattern = NewType("Pattern", str) -"""Always valid if true. Never valid if false. Is constant. -""" -JSONSchemaBoolean = NewType("JSONSchemaBoolean", bool) - -JSONSchema = NewType("JSONSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) SchemaArray = NewType("SchemaArray", List[JSONSchema]) @@ -281,31 +273,28 @@ class JSONSchemaObject(TypedDict): anyOf: Optional[SchemaArray] oneOf: Optional[SchemaArray] not: Optional[JSONSchema] -"""Schema that describes the content. -""" -ContentDescriptorObjectSchema = NewType("ContentDescriptorObjectSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) -"""Determines if the content is a required field. Default value is `false`. +"""Always valid if true. Never valid if false. Is constant. """ +JSONSchemaBoolean = NewType("JSONSchemaBoolean", bool) + +JSONSchema = NewType("JSONSchema", Union[JSONSchemaObject, JSONSchemaBoolean]) + ContentDescriptorObjectRequired = NewType("ContentDescriptorObjectRequired", bool) -"""Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. -""" + ContentDescriptorObjectDeprecated = NewType("ContentDescriptorObjectDeprecated", bool) -"""Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. -""" + class ContentDescriptorObject(TypedDict): name: Optional[ContentDescriptorObjectName] description: Optional[ContentDescriptorObjectDescription] summary: Optional[ContentDescriptorObjectSummary] - schema: Optional[ContentDescriptorObjectSchema] + schema: Optional[JSONSchema] required: Optional[ContentDescriptorObjectRequired] deprecated: Optional[ContentDescriptorObjectDeprecated] ContentDescriptorOrReference = NewType("ContentDescriptorOrReference", Union[ContentDescriptorObject, ReferenceObject]) -""" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. -""" + MethodObjectParams = NewType("MethodObjectParams", List[ContentDescriptorOrReference]) -"""The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) -""" + MethodObjectResult = NewType("MethodObjectResult", Union[ContentDescriptorObject, ReferenceObject]) """A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. """ @@ -324,60 +313,51 @@ class ErrorObject(TypedDict): data: Optional[ErrorObjectData] ErrorOrReference = NewType("ErrorOrReference", Union[ErrorObject, ReferenceObject]) -"""A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +"""Defines an application level error. """ MethodObjectErrors = NewType("MethodObjectErrors", List[ErrorOrReference]) -"""Cannonical name of the link. -""" -LinkObjectName = NewType("LinkObjectName", Any) -"""Short description for the link. -""" + +LinkObjectName = NewType("LinkObjectName", str) + LinkObjectSummary = NewType("LinkObjectSummary", str) -"""The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. -""" + LinkObjectMethod = NewType("LinkObjectMethod", str) -"""A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + LinkObjectDescription = NewType("LinkObjectDescription", str) -"""A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. -""" + LinkObjectParams = NewType("LinkObjectParams", Any) -"""A server object to be used by the target method. -""" + class LinkObjectServer(TypedDict): url: Optional[ServerObjectUrl] name: Optional[ServerObjectName] description: Optional[ServerObjectDescription] summary: Optional[ServerObjectSummary] variables: Optional[ServerObjectVariables] -"""A object representing a Link -""" -LinkObject = NewType("LinkObject", Any) + +class LinkObject(TypedDict): + name: Optional[LinkObjectName] + summary: Optional[LinkObjectSummary] + method: Optional[LinkObjectMethod] + description: Optional[LinkObjectDescription] + params: Optional[LinkObjectParams] + server: Optional[LinkObjectServer] LinkOrReference = NewType("LinkOrReference", Union[LinkObject, ReferenceObject]) -"""A list of possible links from this method call. -""" + MethodObjectLinks = NewType("MethodObjectLinks", List[LinkOrReference]) -"""Name for the example pairing. -""" + ExamplePairingObjectName = NewType("ExamplePairingObjectName", str) -"""A verbose explanation of the example pairing. -""" + ExamplePairingObjectDescription = NewType("ExamplePairingObjectDescription", str) -"""Short description for the example. -""" + ExampleObjectSummary = NewType("ExampleObjectSummary", str) -"""Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. -""" + ExampleObjectValue = NewType("ExampleObjectValue", Any) -"""A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -""" + ExampleObjectDescription = NewType("ExampleObjectDescription", str) -"""Cannonical name of the example. -""" + ExampleObjectName = NewType("ExampleObjectName", str) -"""The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). -""" + class ExampleObject(TypedDict): summary: Optional[ExampleObjectSummary] value: Optional[ExampleObjectValue] @@ -385,14 +365,11 @@ class ExampleObject(TypedDict): name: Optional[ExampleObjectName] ExampleOrReference = NewType("ExampleOrReference", Union[ExampleObject, ReferenceObject]) -"""Example parameters. -""" + ExamplePairingObjectParams = NewType("ExamplePairingObjectParams", List[ExampleOrReference]) -"""Example result. When not provided, the example pairing represents usage of the method as a notification. -""" + ExamplePairingObjectResult = NewType("ExamplePairingObjectResult", Union[ExampleObject, ReferenceObject]) -"""The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. -""" + class ExamplePairingObject(TypedDict): name: Optional[ExamplePairingObjectName] description: Optional[ExamplePairingObjectDescription] @@ -400,14 +377,11 @@ class ExamplePairingObject(TypedDict): result: Optional[ExamplePairingObjectResult] ExamplePairingOrReference = NewType("ExamplePairingOrReference", Union[ExamplePairingObject, ReferenceObject]) -"""Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. -""" + MethodObjectExamples = NewType("MethodObjectExamples", List[ExamplePairingOrReference]) -"""Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. -""" + MethodObjectDeprecated = NewType("MethodObjectDeprecated", bool) -"""Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. -""" + class MethodObject(TypedDict): name: Optional[MethodObjectName] description: Optional[MethodObjectDescription] @@ -424,32 +398,23 @@ class MethodObject(TypedDict): externalDocs: Optional[ExternalDocumentationObject] MethodOrReference = NewType("MethodOrReference", Union[MethodObject, ReferenceObject]) -"""The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). -""" + Methods = NewType("Methods", List[MethodOrReference]) -"""An object to hold reusable [Schema Objects](#schema-object). -""" + SchemaComponents = NewType("SchemaComponents", Mapping[Any, Any]) -"""An object to hold reusable [Link Objects](#link-object). -""" + LinkComponents = NewType("LinkComponents", Mapping[Any, Any]) -"""An object to hold reusable [Error Objects](#error-object). -""" + ErrorComponents = NewType("ErrorComponents", Mapping[Any, Any]) -"""An object to hold reusable [Example Objects](#example-object). -""" + ExampleComponents = NewType("ExampleComponents", Mapping[Any, Any]) -"""An object to hold reusable [Example Pairing Objects](#example-pairing-object). -""" + ExamplePairingComponents = NewType("ExamplePairingComponents", Mapping[Any, Any]) -"""An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). -""" + ContentDescriptorComponents = NewType("ContentDescriptorComponents", Mapping[Any, Any]) -"""An object to hold reusable [Tag Objects](#tag-object). -""" + TagComponents = NewType("TagComponents", Mapping[Any, Any]) -"""Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. -""" + class Components(TypedDict): schemas: Optional[SchemaComponents] links: Optional[LinkComponents] diff --git a/generated/packages/rs/src/v1_3.rs b/generated/packages/rs/src/v1_3.rs index 7aa6ac6..11e5e18 100644 --- a/generated/packages/rs/src/v1_3.rs +++ b/generated/packages/rs/src/v1_3.rs @@ -5,55 +5,69 @@ extern crate derive_builder; use serde::{Serialize, Deserialize}; use derive_builder::Builder; use std::collections::HashMap; -/// Openrpc -/// -/// This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. -/// -pub type Openrpc = String; -/// InfoObjectTitle -/// -/// The title of the application. -/// -pub type InfoObjectTitle = String; -/// InfoObjectDescription -/// -/// A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// +#[derive(Serialize, Deserialize, Clone, Debug, Eq, PartialEq)] +pub enum Openrpc { + #[serde(rename = "1.3.2")] + OneThreeTwo, + #[serde(rename = "1.3.1")] + OneThreeOne, + #[serde(rename = "1.3.0")] + OneThreeZero, + #[serde(rename = "1.2.6")] + OneTwoSix, + #[serde(rename = "1.2.5")] + OneTwoFive, + #[serde(rename = "1.2.4")] + OneTwoFour, + #[serde(rename = "1.2.3")] + OneTwoThree, + #[serde(rename = "1.2.2")] + OneTwoTwo, + #[serde(rename = "1.2.1")] + OneTwoOne, + #[serde(rename = "1.2.0")] + OneTwoZero, + #[serde(rename = "1.1.12")] + OneOneOneTwo, + #[serde(rename = "1.1.11")] + OneOneOneOne, + #[serde(rename = "1.1.10")] + OneOneOneZero, + #[serde(rename = "1.1.9")] + OneOneNine, + #[serde(rename = "1.1.8")] + OneOneEight, + #[serde(rename = "1.1.7")] + OneOneSeven, + #[serde(rename = "1.1.6")] + OneOneSix, + #[serde(rename = "1.1.5")] + OneOneFive, + #[serde(rename = "1.1.4")] + OneOneFour, + #[serde(rename = "1.1.3")] + OneOneThree, + #[serde(rename = "1.1.2")] + OneOneTwo, + #[serde(rename = "1.1.1")] + OneOneOne, + #[serde(rename = "1.1.0")] + OneOneZero, + #[serde(rename = "1.0.0")] + OneZeroZero, + #[serde(rename = "1.0.0-rc0")] + OneZeroZeroRcZero, + #[serde(rename = "1.0.0-rc1")] + OneZeroZeroRcOne, +} +pub type InfoObjectProperties = String; pub type InfoObjectDescription = String; -/// InfoObjectTermsOfService -/// -/// A URL to the Terms of Service for the API. MUST be in the format of a URL. -/// pub type InfoObjectTermsOfService = String; -/// InfoObjectVersion -/// -/// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). -/// pub type InfoObjectVersion = String; -/// ContactObjectName -/// -/// The identifying name of the contact person/organization. -/// pub type ContactObjectName = String; -/// ContactObjectEmail -/// -/// The email address of the contact person/organization. MUST be in the format of an email address. -/// pub type ContactObjectEmail = String; -/// ContactObjectUrl -/// -/// The URL pointing to the contact information. MUST be in the format of a URL. -/// pub type ContactObjectUrl = String; -/// SpecificationExtension -/// -/// This object MAY be extended with [Specification Extensions](#specification-extensions). -/// pub type SpecificationExtension = serde_json::Value; -/// ContactObject -/// -/// Contact information for the exposed API. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -65,20 +79,8 @@ pub struct ContactObject { #[serde(skip_serializing_if = "Option::is_none")] pub url: Option<ContactObjectUrl>, } -/// LicenseObjectName -/// -/// The license name used for the API. -/// pub type LicenseObjectName = String; -/// LicenseObjectUrl -/// -/// A URL to the license used for the API. MUST be in the format of a URL. -/// pub type LicenseObjectUrl = String; -/// LicenseObject -/// -/// License information for the exposed API. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -88,24 +90,26 @@ pub struct LicenseObject { #[serde(skip_serializing_if = "Option::is_none")] pub url: Option<LicenseObjectUrl>, } -/// InfoObject -/// -/// The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. -/// -pub type InfoObject = serde_json::Value; -/// ExternalDocumentationObjectDescription -/// -/// A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct InfoObject { + pub title: InfoObjectProperties, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<InfoObjectDescription>, + #[serde(rename = "termsOfService", skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option<InfoObjectTermsOfService>, + pub version: InfoObjectVersion, + #[serde(skip_serializing_if = "Option::is_none")] + pub contact: Option<ContactObject>, + #[serde(skip_serializing_if = "Option::is_none")] + pub license: Option<LicenseObject>, +} pub type ExternalDocumentationObjectDescription = String; -/// ExternalDocumentationObjectUrl -/// -/// The URL for the target documentation. Value MUST be in the format of a URL. -/// pub type ExternalDocumentationObjectUrl = String; /// ExternalDocumentationObject /// -/// Additional external documentation for this tag. +/// information about external documentation /// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] @@ -115,50 +119,14 @@ pub struct ExternalDocumentationObject { pub description: Option<ExternalDocumentationObjectDescription>, pub url: ExternalDocumentationObjectUrl, } -/// ServerObjectUrl -/// -/// A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. -/// pub type ServerObjectUrl = String; -/// ServerObjectName -/// -/// An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type ServerObjectName = String; -/// ServerObjectDescription -/// -/// An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type ServerObjectDescription = String; -/// ServerObjectSummary -/// -/// A short summary of what the server is. -/// pub type ServerObjectSummary = String; -/// ServerObjectVariableDefault -/// -/// The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. -/// pub type ServerObjectVariableDefault = String; -/// ServerObjectVariableDescription -/// -/// An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type ServerObjectVariableDescription = String; -/// ServerObjectVariableEnumItem -/// -/// An enumeration of string values to be used if the substitution options are from a limited set. -/// pub type ServerObjectVariableEnumItem = String; -/// ServerObjectVariableEnum -/// -/// An enumeration of string values to be used if the substitution options are from a limited set. -/// pub type ServerObjectVariableEnum = Vec<ServerObjectVariableEnumItem>; -/// ServerObjectVariable -/// -/// An object representing a Server Variable for server URL template substitution. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -170,15 +138,7 @@ pub struct ServerObjectVariable { #[serde(rename = "enum", skip_serializing_if = "Option::is_none")] pub _enum: Option<ServerObjectVariableEnum>, } -/// ServerObjectVariables -/// -/// A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. -/// pub type ServerObjectVariables = HashMap<String, serde_json::Value>; -/// ServerObject -/// -/// A object representing a Server -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -194,10 +154,6 @@ pub struct ServerObject { pub variables: Option<ServerObjectVariables>, } type AlwaysFalse = serde_json::Value; -/// Servers -/// -/// An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. -/// pub type Servers = Vec<ServerObject>; /// MethodObjectName /// @@ -214,20 +170,8 @@ pub type MethodObjectDescription = String; /// A short summary of what the method does. /// pub type MethodObjectSummary = String; -/// TagObjectName -/// -/// The name of the tag. -/// pub type TagObjectName = String; -/// TagObjectDescription -/// -/// A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type TagObjectDescription = String; -/// TagObject -/// -/// Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -252,10 +196,6 @@ pub enum TagOrReference { TagObject(TagObject), ReferenceObject(ReferenceObject), } -/// MethodObjectTags -/// -/// A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. -/// pub type MethodObjectTags = Vec<TagOrReference>; /// MethodObjectParamStructure /// @@ -274,20 +214,8 @@ pub enum MethodObjectParamStructure { #[serde(rename = "either")] Either, } -/// ContentDescriptorObjectName -/// -/// Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). -/// pub type ContentDescriptorObjectName = String; -/// ContentDescriptorObjectDescription -/// -/// A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type ContentDescriptorObjectDescription = String; -/// ContentDescriptorObjectSummary -/// -/// A short summary of the content that is being described. -/// pub type ContentDescriptorObjectSummary = String; pub type Id = String; pub type Schema = String; @@ -305,22 +233,11 @@ pub type ExclusiveMinimum = f64; pub type NonNegativeInteger = i64; pub type NonNegativeIntegerDefaultZero = i64; pub type Pattern = String; -/// JSONSchemaBoolean -/// -/// Always valid if true. Never valid if false. Is constant. -/// -pub type JSONSchemaBoolean = bool; -#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] -#[serde(untagged)] -pub enum JSONSchema { - JSONSchemaObject(Box<JSONSchemaObject>), - JSONSchemaBoolean(JSONSchemaBoolean), -} pub type SchemaArray = Vec<JSONSchema>; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(untagged)] pub enum Items { - JSONSchema(JSONSchema), + JSONSchema(Box<JSONSchema>), SchemaArray(SchemaArray), } pub type UniqueItems = bool; @@ -357,7 +274,7 @@ pub type PatternProperties = HashMap<String, JSONSchema>; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(untagged)] pub enum DependenciesSet { - JSONSchema(JSONSchema), + JSONSchema(Box<JSONSchema>), StringArray(StringArray), } pub type Dependencies = HashMap<String, DependenciesSet>; @@ -428,7 +345,7 @@ pub struct JSONSchemaObject { #[serde(skip_serializing_if = "Option::is_none")] pub pattern: Option<Pattern>, #[serde(rename = "additionalItems", skip_serializing_if = "Option::is_none")] - pub additional_items: Option<JSONSchema>, + pub additional_items: Option<Box<JSONSchema>>, #[serde(skip_serializing_if = "Option::is_none")] pub items: Option<Items>, #[serde(rename = "maxItems", skip_serializing_if = "Option::is_none")] @@ -438,7 +355,7 @@ pub struct JSONSchemaObject { #[serde(rename = "uniqueItems", skip_serializing_if = "Option::is_none")] pub unique_items: Option<UniqueItems>, #[serde(skip_serializing_if = "Option::is_none")] - pub contains: Option<JSONSchema>, + pub contains: Option<Box<JSONSchema>>, #[serde(rename = "maxProperties", skip_serializing_if = "Option::is_none")] pub max_properties: Option<NonNegativeInteger>, #[serde(rename = "minProperties", skip_serializing_if = "Option::is_none")] @@ -446,7 +363,7 @@ pub struct JSONSchemaObject { #[serde(skip_serializing_if = "Option::is_none")] pub required: Option<StringArray>, #[serde(rename = "additionalProperties", skip_serializing_if = "Option::is_none")] - pub additional_properties: Option<JSONSchema>, + pub additional_properties: Option<Box<JSONSchema>>, #[serde(skip_serializing_if = "Option::is_none")] pub definitions: Option<Definitions>, #[serde(skip_serializing_if = "Option::is_none")] @@ -456,7 +373,7 @@ pub struct JSONSchemaObject { #[serde(skip_serializing_if = "Option::is_none")] pub dependencies: Option<Dependencies>, #[serde(rename = "propertyNames", skip_serializing_if = "Option::is_none")] - pub property_names: Option<JSONSchema>, + pub property_names: Option<Box<JSONSchema>>, #[serde(rename = "const", skip_serializing_if = "Option::is_none")] pub _const: Option<AlwaysTrue>, #[serde(rename = "enum", skip_serializing_if = "Option::is_none")] @@ -470,11 +387,11 @@ pub struct JSONSchemaObject { #[serde(rename = "contentEncoding", skip_serializing_if = "Option::is_none")] pub content_encoding: Option<ContentEncoding>, #[serde(rename = "if", skip_serializing_if = "Option::is_none")] - pub _if: Option<JSONSchema>, + pub _if: Option<Box<JSONSchema>>, #[serde(skip_serializing_if = "Option::is_none")] - pub then: Option<JSONSchema>, + pub then: Option<Box<JSONSchema>>, #[serde(rename = "else", skip_serializing_if = "Option::is_none")] - pub _else: Option<JSONSchema>, + pub _else: Option<Box<JSONSchema>>, #[serde(rename = "allOf", skip_serializing_if = "Option::is_none")] pub all_of: Option<SchemaArray>, #[serde(rename = "anyOf", skip_serializing_if = "Option::is_none")] @@ -482,28 +399,21 @@ pub struct JSONSchemaObject { #[serde(rename = "oneOf", skip_serializing_if = "Option::is_none")] pub one_of: Option<SchemaArray>, #[serde(skip_serializing_if = "Option::is_none")] - pub not: Option<JSONSchema>, + pub not: Option<Box<JSONSchema>>, } +/// JSONSchemaBoolean +/// +/// Always valid if true. Never valid if false. Is constant. +/// +pub type JSONSchemaBoolean = bool; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(untagged)] -pub enum ContentDescriptorObjectSchema { - JSONSchemaObject(Box<JSONSchemaObject>), +pub enum JSONSchema { + JSONSchemaObject(JSONSchemaObject), JSONSchemaBoolean(JSONSchemaBoolean), } -/// ContentDescriptorObjectRequired -/// -/// Determines if the content is a required field. Default value is `false`. -/// pub type ContentDescriptorObjectRequired = bool; -/// ContentDescriptorObjectDeprecated -/// -/// Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. -/// pub type ContentDescriptorObjectDeprecated = bool; -/// ContentDescriptorObject -/// -/// Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -513,7 +423,7 @@ pub struct ContentDescriptorObject { pub description: Option<ContentDescriptorObjectDescription>, #[serde(skip_serializing_if = "Option::is_none")] pub summary: Option<ContentDescriptorObjectSummary>, - pub schema: ContentDescriptorObjectSchema, + pub schema: Box<JSONSchema>, #[serde(skip_serializing_if = "Option::is_none")] pub required: Option<ContentDescriptorObjectRequired>, #[serde(skip_serializing_if = "Option::is_none")] @@ -525,10 +435,6 @@ pub enum ContentDescriptorOrReference { ContentDescriptorObject(ContentDescriptorObject), ReferenceObject(ReferenceObject), } -/// MethodObjectParams -/// -/// A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. -/// pub type MethodObjectParams = Vec<ContentDescriptorOrReference>; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(untagged)] @@ -572,38 +478,14 @@ pub enum ErrorOrReference { } /// MethodObjectErrors /// -/// A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. +/// Defines an application level error. /// pub type MethodObjectErrors = Vec<ErrorOrReference>; -/// LinkObjectName -/// -/// Cannonical name of the link. -/// -pub type LinkObjectName = serde_json::Value; -/// LinkObjectSummary -/// -/// Short description for the link. -/// +pub type LinkObjectName = String; pub type LinkObjectSummary = String; -/// LinkObjectMethod -/// -/// The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. -/// pub type LinkObjectMethod = String; -/// LinkObjectDescription -/// -/// A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type LinkObjectDescription = String; -/// LinkObjectParams -/// -/// A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. -/// pub type LinkObjectParams = serde_json::Value; -/// LinkObjectServer -/// -/// A server object to be used by the target method. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -618,56 +500,36 @@ pub struct LinkObjectServer { #[serde(skip_serializing_if = "Option::is_none")] pub variables: Option<ServerObjectVariables>, } -/// LinkObject -/// -/// A object representing a Link -/// -pub type LinkObject = serde_json::Value; +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] +#[builder(setter(strip_option), default)] +#[serde(default)] +pub struct LinkObject { + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<LinkObjectName>, + #[serde(skip_serializing_if = "Option::is_none")] + pub summary: Option<LinkObjectSummary>, + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option<LinkObjectMethod>, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<LinkObjectDescription>, + #[serde(skip_serializing_if = "Option::is_none")] + pub params: Option<LinkObjectParams>, + #[serde(skip_serializing_if = "Option::is_none")] + pub server: Option<LinkObjectServer>, +} #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(untagged)] pub enum LinkOrReference { LinkObject(LinkObject), ReferenceObject(ReferenceObject), } -/// MethodObjectLinks -/// -/// A list of possible links from this method call. -/// pub type MethodObjectLinks = Vec<LinkOrReference>; -/// ExamplePairingObjectName -/// -/// Name for the example pairing. -/// pub type ExamplePairingObjectName = String; -/// ExamplePairingObjectDescription -/// -/// A verbose explanation of the example pairing. -/// pub type ExamplePairingObjectDescription = String; -/// ExampleObjectSummary -/// -/// Short description for the example. -/// pub type ExampleObjectSummary = String; -/// ExampleObjectValue -/// -/// Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. -/// pub type ExampleObjectValue = serde_json::Value; -/// ExampleObjectDescription -/// -/// A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. -/// pub type ExampleObjectDescription = String; -/// ExampleObjectName -/// -/// Cannonical name of the example. -/// pub type ExampleObjectName = String; -/// ExampleObject -/// -/// The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -685,10 +547,6 @@ pub enum ExampleOrReference { ExampleObject(ExampleObject), ReferenceObject(ReferenceObject), } -/// ExamplePairingObjectParams -/// -/// Example parameters. -/// pub type ExamplePairingObjectParams = Vec<ExampleOrReference>; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq)] #[serde(untagged)] @@ -696,10 +554,6 @@ pub enum ExamplePairingObjectResult { ExampleObject(ExampleObject), ReferenceObject(ReferenceObject), } -/// ExamplePairingObject -/// -/// The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -717,20 +571,8 @@ pub enum ExamplePairingOrReference { ExamplePairingObject(ExamplePairingObject), ReferenceObject(ReferenceObject), } -/// MethodObjectExamples -/// -/// Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. -/// pub type MethodObjectExamples = Vec<ExamplePairingOrReference>; -/// MethodObjectDeprecated -/// -/// Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. -/// pub type MethodObjectDeprecated = bool; -/// MethodObject -/// -/// Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] @@ -766,50 +608,14 @@ pub enum MethodOrReference { MethodObject(MethodObject), ReferenceObject(ReferenceObject), } -/// Methods -/// -/// The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). -/// pub type Methods = Vec<MethodOrReference>; -/// SchemaComponents -/// -/// An object to hold reusable [Schema Objects](#schema-object). -/// pub type SchemaComponents = HashMap<String, serde_json::Value>; -/// LinkComponents -/// -/// An object to hold reusable [Link Objects](#link-object). -/// pub type LinkComponents = HashMap<String, serde_json::Value>; -/// ErrorComponents -/// -/// An object to hold reusable [Error Objects](#error-object). -/// pub type ErrorComponents = HashMap<String, serde_json::Value>; -/// ExampleComponents -/// -/// An object to hold reusable [Example Objects](#example-object). -/// pub type ExampleComponents = HashMap<String, serde_json::Value>; -/// ExamplePairingComponents -/// -/// An object to hold reusable [Example Pairing Objects](#example-pairing-object). -/// pub type ExamplePairingComponents = HashMap<String, serde_json::Value>; -/// ContentDescriptorComponents -/// -/// An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). -/// pub type ContentDescriptorComponents = HashMap<String, serde_json::Value>; -/// TagComponents -/// -/// An object to hold reusable [Tag Objects](#tag-object). -/// pub type TagComponents = HashMap<String, serde_json::Value>; -/// Components -/// -/// Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. -/// #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Builder, Default)] #[builder(setter(strip_option), default)] #[serde(default)] diff --git a/generated/packages/ts/1_3/index.ts b/generated/packages/ts/1_3/index.ts index 2838073..4550a42 100644 --- a/generated/packages/ts/1_3/index.ts +++ b/generated/packages/ts/1_3/index.ts @@ -1,111 +1,39 @@ -/** - * - * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. - * - */ -export type Openrpc = string; -/** - * - * The title of the application. - * - */ -export type InfoObjectTitle = string; -/** - * - * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ +export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc0" | "1.0.0-rc1"; +export type InfoObjectProperties = string; export type InfoObjectDescription = string; -/** - * - * A URL to the Terms of Service for the API. MUST be in the format of a URL. - * - */ export type InfoObjectTermsOfService = string; -/** - * - * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). - * - */ export type InfoObjectVersion = string; -/** - * - * The identifying name of the contact person/organization. - * - */ export type ContactObjectName = string; -/** - * - * The email address of the contact person/organization. MUST be in the format of an email address. - * - */ export type ContactObjectEmail = string; -/** - * - * The URL pointing to the contact information. MUST be in the format of a URL. - * - */ export type ContactObjectUrl = string; -/** - * - * This object MAY be extended with [Specification Extensions](#specification-extensions). - * - */ export type SpecificationExtension = any; -/** - * - * Contact information for the exposed API. - * - */ export interface ContactObject { name?: ContactObjectName; email?: ContactObjectEmail; url?: ContactObjectUrl; [regex: string]: SpecificationExtension | any; } -/** - * - * The license name used for the API. - * - */ export type LicenseObjectName = string; -/** - * - * A URL to the license used for the API. MUST be in the format of a URL. - * - */ export type LicenseObjectUrl = string; -/** - * - * License information for the exposed API. - * - */ export interface LicenseObject { name?: LicenseObjectName; url?: LicenseObjectUrl; [regex: string]: SpecificationExtension | any; } -/** - * - * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. - * - */ -export type InfoObject = any; -/** - * - * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ +export interface InfoObject { + title: InfoObjectProperties; + description?: InfoObjectDescription; + termsOfService?: InfoObjectTermsOfService; + version: InfoObjectVersion; + contact?: ContactObject; + license?: LicenseObject; + [regex: string]: SpecificationExtension | any; +} export type ExternalDocumentationObjectDescription = string; -/** - * - * The URL for the target documentation. Value MUST be in the format of a URL. - * - */ export type ExternalDocumentationObjectUrl = string; /** * - * Additional external documentation for this tag. + * information about external documentation * */ export interface ExternalDocumentationObject { @@ -113,76 +41,21 @@ export interface ExternalDocumentationObject { url: ExternalDocumentationObjectUrl; [regex: string]: SpecificationExtension | any; } -/** - * - * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. - * - */ export type ServerObjectUrl = string; -/** - * - * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type ServerObjectName = string; -/** - * - * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type ServerObjectDescription = string; -/** - * - * A short summary of what the server is. - * - */ export type ServerObjectSummary = string; -/** - * - * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. - * - */ export type ServerObjectVariableDefault = string; -/** - * - * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type ServerObjectVariableDescription = string; -/** - * - * An enumeration of string values to be used if the substitution options are from a limited set. - * - */ export type ServerObjectVariableEnumItem = string; -/** - * - * An enumeration of string values to be used if the substitution options are from a limited set. - * - */ export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; -/** - * - * An object representing a Server Variable for server URL template substitution. - * - */ export interface ServerObjectVariable { default: ServerObjectVariableDefault; description?: ServerObjectVariableDescription; enum?: ServerObjectVariableEnum; [k: string]: any; } -/** - * - * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. - * - */ export interface ServerObjectVariables { [key: string]: any; } -/** - * - * A object representing a Server - * - */ export interface ServerObject { url: ServerObjectUrl; name?: ServerObjectName; @@ -192,11 +65,6 @@ export interface ServerObject { [regex: string]: SpecificationExtension | any; } type AlwaysFalse = any; -/** - * - * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. - * - */ export type Servers = ServerObject[]; /** * @@ -216,23 +84,8 @@ export type MethodObjectDescription = string; * */ export type MethodObjectSummary = string; -/** - * - * The name of the tag. - * - */ export type TagObjectName = string; -/** - * - * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type TagObjectDescription = string; -/** - * - * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. - * - */ export interface TagObject { name: TagObjectName; description?: TagObjectDescription; @@ -244,11 +97,6 @@ export interface ReferenceObject { $ref: $Ref; } export type TagOrReference = TagObject | ReferenceObject; -/** - * - * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. - * - */ export type MethodObjectTags = TagOrReference[]; /** * @@ -258,23 +106,8 @@ export type MethodObjectTags = TagOrReference[]; * */ export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; -/** - * - * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). - * - */ export type ContentDescriptorObjectName = string; -/** - * - * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type ContentDescriptorObjectDescription = string; -/** - * - * A short summary of the content that is being described. - * - */ export type ContentDescriptorObjectSummary = string; export type $Id = string; export type $Schema = string; @@ -292,18 +125,6 @@ export type ExclusiveMinimum = number; export type NonNegativeInteger = number; export type NonNegativeIntegerDefaultZero = number; export type Pattern = string; -/** - * - * Always valid if true. Never valid if false. Is constant. - * - */ -export type JSONSchemaBoolean = boolean; -/** - * - * @default {} - * - */ -export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; export type SchemaArray = JSONSchema[]; /** * @@ -397,50 +218,29 @@ export interface JSONSchemaObject { } /** * - * Schema that describes the content. - * - * @default {} + * Always valid if true. Never valid if false. Is constant. * */ -export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; +export type JSONSchemaBoolean = boolean; /** * - * Determines if the content is a required field. Default value is `false`. + * @default {} * */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; export type ContentDescriptorObjectRequired = boolean; -/** - * - * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. - * - */ export type ContentDescriptorObjectDeprecated = boolean; -/** - * - * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. - * - */ export interface ContentDescriptorObject { name: ContentDescriptorObjectName; description?: ContentDescriptorObjectDescription; summary?: ContentDescriptorObjectSummary; - schema: ContentDescriptorObjectSchema; + schema: JSONSchema; required?: ContentDescriptorObjectRequired; deprecated?: ContentDescriptorObjectDeprecated; [regex: string]: SpecificationExtension | any; } export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; -/** - * - * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. - * - */ export type MethodObjectParams = ContentDescriptorOrReference[]; -/** - * - * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) - * - */ export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; /** * @@ -473,45 +273,15 @@ export interface ErrorObject { export type ErrorOrReference = ErrorObject | ReferenceObject; /** * - * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. + * Defines an application level error. * */ export type MethodObjectErrors = ErrorOrReference[]; -/** - * - * Cannonical name of the link. - * - */ -export type LinkObjectName = any; -/** - * - * Short description for the link. - * - */ +export type LinkObjectName = string; export type LinkObjectSummary = string; -/** - * - * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. - * - */ export type LinkObjectMethod = string; -/** - * - * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type LinkObjectDescription = string; -/** - * - * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. - * - */ export type LinkObjectParams = any; -/** - * - * A server object to be used by the target method. - * - */ export interface LinkObjectServer { url: ServerObjectUrl; name?: ServerObjectName; @@ -520,60 +290,23 @@ export interface LinkObjectServer { variables?: ServerObjectVariables; [regex: string]: SpecificationExtension | any; } -/** - * - * A object representing a Link - * - */ -export type LinkObject = any; +export interface LinkObject { + name?: LinkObjectName; + summary?: LinkObjectSummary; + method?: LinkObjectMethod; + description?: LinkObjectDescription; + params?: LinkObjectParams; + server?: LinkObjectServer; + [regex: string]: SpecificationExtension | any; +} export type LinkOrReference = LinkObject | ReferenceObject; -/** - * - * A list of possible links from this method call. - * - */ export type MethodObjectLinks = LinkOrReference[]; -/** - * - * Name for the example pairing. - * - */ export type ExamplePairingObjectName = string; -/** - * - * A verbose explanation of the example pairing. - * - */ export type ExamplePairingObjectDescription = string; -/** - * - * Short description for the example. - * - */ export type ExampleObjectSummary = string; -/** - * - * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. - * - */ export type ExampleObjectValue = any; -/** - * - * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. - * - */ export type ExampleObjectDescription = string; -/** - * - * Cannonical name of the example. - * - */ export type ExampleObjectName = string; -/** - * - * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). - * - */ export interface ExampleObject { summary?: ExampleObjectSummary; value: ExampleObjectValue; @@ -582,23 +315,8 @@ export interface ExampleObject { [regex: string]: SpecificationExtension | any; } export type ExampleOrReference = ExampleObject | ReferenceObject; -/** - * - * Example parameters. - * - */ export type ExamplePairingObjectParams = ExampleOrReference[]; -/** - * - * Example result. When not provided, the example pairing represents usage of the method as a notification. - * - */ export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; -/** - * - * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. - * - */ export interface ExamplePairingObject { name: ExamplePairingObjectName; description?: ExamplePairingObjectDescription; @@ -607,23 +325,8 @@ export interface ExamplePairingObject { [k: string]: any; } export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; -/** - * - * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. - * - */ export type MethodObjectExamples = ExamplePairingOrReference[]; -/** - * - * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. - * - */ export type MethodObjectDeprecated = boolean; -/** - * - * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. - * - */ export interface MethodObject { name: MethodObjectName; description?: MethodObjectDescription; @@ -641,59 +344,14 @@ export interface MethodObject { [regex: string]: SpecificationExtension | any; } export type MethodOrReference = MethodObject | ReferenceObject; -/** - * - * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). - * - */ export type Methods = MethodOrReference[]; -/** - * - * An object to hold reusable [Schema Objects](#schema-object). - * - */ export interface SchemaComponents { [key: string]: any; } -/** - * - * An object to hold reusable [Link Objects](#link-object). - * - */ export interface LinkComponents { [key: string]: any; } -/** - * - * An object to hold reusable [Error Objects](#error-object). - * - */ export interface ErrorComponents { [key: string]: any; } -/** - * - * An object to hold reusable [Example Objects](#example-object). - * - */ export interface ExampleComponents { [key: string]: any; } -/** - * - * An object to hold reusable [Example Pairing Objects](#example-pairing-object). - * - */ export interface ExamplePairingComponents { [key: string]: any; } -/** - * - * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). - * - */ export interface ContentDescriptorComponents { [key: string]: any; } -/** - * - * An object to hold reusable [Tag Objects](#tag-object). - * - */ export interface TagComponents { [key: string]: any; } -/** - * - * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. - * - */ export interface Components { schemas?: SchemaComponents; links?: LinkComponents; diff --git a/generated/packages/ts/bun.lock b/generated/packages/ts/bun.lock new file mode 100644 index 0000000..d800a8e --- /dev/null +++ b/generated/packages/ts/bun.lock @@ -0,0 +1,19 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "test-open-rpc-spec-types", + "dependencies": { + "test-open-rpc-spec": "^1.6.0", + }, + "devDependencies": { + "typescript": "^5.0.0", + }, + }, + }, + "packages": { + "test-open-rpc-spec": ["test-open-rpc-spec@1.6.0", "", {}, "sha512-QF7qjTQ47DZr8945H4HoMMSqhs8At8enZlRFxAuZs95zb+zRv23yEbbOG1uwZmsp9ndDqentXPOKUG+FqLgoBA=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + } +} diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index 171ca07..4eaa09c 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -3,6 +3,10 @@ "version": "0.0.0", "type": "module", "module": "index.ts", + "scripts": { + "build": "./node_modules/.bin/tsc", + "prepack": "./node_modules/.bin/tsc" + }, "exports": { ".": { "bun": "./index.ts", @@ -24,7 +28,10 @@ } }, "dependencies": { - "test-open-rpc-spec": "1.6.0" + "test-open-rpc-spec": "^1.6.0" + }, + "devDependencies": { + "typescript": "^5.0.0" }, "files": [ "**/*.ts", diff --git a/generated/packages/ts/tsconfig.json b/generated/packages/ts/tsconfig.json new file mode 100644 index 0000000..d9d94a8 --- /dev/null +++ b/generated/packages/ts/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "declaration": true, + "emitDeclarationOnly": false, + "strict": true, + "skipLibCheck": true + }, + "include": [ + "./**/*.ts" + ] +} \ No newline at end of file diff --git a/src/assets.ts b/src/assets.ts index 8a6ebc5..694c9a9 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -57,6 +57,19 @@ export const buildPyProjectToml = ( }, }); +export const buildTsConfig = () => ({ + compilerOptions: { + target: "ESNext", + module: "NodeNext", + moduleResolution: "NodeNext", + declaration: true, + emitDeclarationOnly: false, + strict: true, + skipLibCheck: true, + }, + include: ["./**/*.ts"], +}); + export const buildPackageJson = ( schemaNames: string[], opts: PackageJsonOptions = { name: "@open-rpc/spec-types", version: "0.0.0", dependencies: {} }, @@ -78,6 +91,10 @@ export const buildPackageJson = ( version: opts.version, type: "module", module: "index.ts", + scripts: { + build: "./node_modules/.bin/tsc", + prepack: "./node_modules/.bin/tsc", + }, exports: { ".": { bun: "./index.ts", @@ -88,6 +105,9 @@ export const buildPackageJson = ( ...subpathExports, }, dependencies: opts.dependencies, + devDependencies: { + typescript: "^5.0.0", + }, files: ["**/*.ts", "**/*.d.ts", "**/*.js", "!node_modules"], }; }; diff --git a/src/index.ts b/src/index.ts index 9edadd2..66f51cb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import * as path from "path"; import Transpiler from "@json-schema-tools/transpiler"; import { compileTypescript, StringUtils } from "./util"; -import { buildPackageJson, buildCargoToml, buildGoMod, buildPyProjectToml } from "./assets.ts"; +import { buildPackageJson, buildTsConfig, buildCargoToml, buildGoMod, buildPyProjectToml } from "./assets.ts"; import {readFile, writeFile, mkdir, rmdir, rm} from "fs/promises"; import type { JSONSchemaObject } from "@json-schema-tools/meta-schema"; import Dereferencer from "@json-schema-tools/dereferencer"; @@ -150,7 +150,8 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames,specPackageName) } ]; })).concat([ - { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "@open-rpc/spec-types", version: assets.version, dependencies: deps }), null, 2) }, + { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "test-open-rpc-spec-types", version: assets.version, dependencies: deps }), null, 2) }, + { type: "write", path: `${outpath}/tsconfig.json`, content: JSON.stringify(buildTsConfig(), null, 2) }, { type: "write", path: `${outpath}/CHANGELOG.md`, content: assets.changelogContents }, { type: "compile", fileNames: [ `${outpath}/index.ts`, From 3cf7d113a93e1fd64ae3c40c1689a6569653d364 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 23:17:17 -0800 Subject: [PATCH 16/46] fix: the release workflow --- .github/workflows/release.yml | 22 ++++++++++++++++++++-- .gitignore | 6 +++++- test-builds.sh | 21 +++++++++------------ 3 files changed, 34 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc72977..56154ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,16 @@ name: Release -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + publish-py: + description: "Publish Python package" + type: boolean + default: true + publish-rs: + description: "Publish Rust crate" + type: boolean + default: true permissions: contents: write @@ -35,13 +45,20 @@ jobs: node-version: "22" registry-url: "https://registry.npmjs.org" + - uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + working-directory: generated/packages/ts + run: bun install + - name: Publish to npm working-directory: generated/packages/ts - run: npm publish --access public + run: bun publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-py: + if: ${{ inputs.publish-py }} needs: create-release runs-on: ubuntu-latest permissions: @@ -66,6 +83,7 @@ jobs: packages-dir: generated/packages/py/dist/ publish-rs: + if: ${{ inputs.publish-rs }} needs: create-release runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index e539e68..76a94cf 100644 --- a/.gitignore +++ b/.gitignore @@ -138,4 +138,8 @@ dist vite.config.js.timestamp-* vite.config.ts.timestamp-* -.cursor \ No newline at end of file +.cursor + +# Generated TS build artifacts (source of truth is .ts) +generated/packages/ts/**/*.js +generated/packages/ts/**/*.d.ts \ No newline at end of file diff --git a/test-builds.sh b/test-builds.sh index 44c2ea6..3a4338c 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -8,19 +8,16 @@ RESULTS=() test_ts() { local tmp=$(mktemp -d) trap "rm -rf $tmp" RETURN - - # pack the package as a tarball (true install test) - cp ./test-open-rpc-spec-1.3.2.tgz "$tmp/" + cd "$PACKAGES_DIR/ts" - npm pack --pack-destination "$tmp" 2>/dev/null - - # install it in a clean project + bun install + bun pm pack --destination "$tmp" + cd "$tmp" npm init -y > /dev/null 2>&1 - npm install ./open-rpc-spec-types-*.tgz - - # smoke test: can we import it? - node -e "import('@open-rpc/spec-types').then(m => console.log('TS OK:', Object.keys(m)))" + npm install ./test-open-rpc-spec-types-*.tgz + + node -e "import('test-open-rpc-spec-types').then(m => console.log('TS OK:', Object.keys(m)))" } # --- Go --- @@ -42,7 +39,7 @@ test_py() { cd "$tmp" python3.12 -m venv "$tmp/.venv" "$tmp/.venv/bin/python" -m pip install . --quiet - "$tmp/.venv/bin/python" -c "from open_rpc_spec_types import v1_4; print('Py OK')" + "$tmp/.venv/bin/python" -c "from test_open_rpc_spec_types import v1_4; print('Py OK')" } # --- Rust --- @@ -58,6 +55,6 @@ test_rs() { echo "=== Testing TS ===" && test_ts echo "=== Testing Go ===" && test_go # echo "=== Testing Py ===" && test_py -echo "=== Testing Rs ===" && test_rs +# echo "=== Testing Rs ===" && test_rs echo "All install tests passed." \ No newline at end of file From 73aa0b236e639bcbc67478e691d2d06ffe381a1e Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Thu, 19 Feb 2026 23:17:36 -0800 Subject: [PATCH 17/46] chore: rename package for test tmp --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 33c505d..8808281 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "spec-types", + "name": "test-open-rpc-spec-types", "module": "index.ts", "type": "module", "scripts": { From caf64c481ab63aed71b60465906e0b81af607be8 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 10:13:32 -0800 Subject: [PATCH 18/46] fix: compile step type validation and version bump spec --- .gitignore | 4 ++- bun.lock | 4 +-- docker-compose.test.yml | 58 ------------------------------ generated/packages/ts/bun.lock | 19 ---------- generated/packages/ts/package.json | 2 +- knope.toml | 3 ++ package.json | 2 +- src/index.ts | 1 + tsconfig.json | 14 +++++--- 9 files changed, 20 insertions(+), 87 deletions(-) delete mode 100644 docker-compose.test.yml delete mode 100644 generated/packages/ts/bun.lock diff --git a/.gitignore b/.gitignore index 76a94cf..32cf04d 100644 --- a/.gitignore +++ b/.gitignore @@ -142,4 +142,6 @@ vite.config.ts.timestamp-* # Generated TS build artifacts (source of truth is .ts) generated/packages/ts/**/*.js -generated/packages/ts/**/*.d.ts \ No newline at end of file +generated/packages/ts/**/*.d.ts +LLMLOG.MD +.DS_Store \ No newline at end of file diff --git a/bun.lock b/bun.lock index 5480efd..3be7f48 100644 --- a/bun.lock +++ b/bun.lock @@ -7,7 +7,7 @@ "@json-schema-tools/transpiler": "^1.10.5", "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", - "test-open-rpc-spec": "^1.6.0", + "test-open-rpc-spec": "^1.6.1", }, "devDependencies": { "@iarna/toml": "^2.2.5", @@ -228,7 +228,7 @@ "synckit": ["synckit@0.11.12", "", { "dependencies": { "@pkgr/core": "^0.2.9" } }, "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ=="], - "test-open-rpc-spec": ["test-open-rpc-spec@1.6.0", "", {}, "sha512-QF7qjTQ47DZr8945H4HoMMSqhs8At8enZlRFxAuZs95zb+zRv23yEbbOG1uwZmsp9ndDqentXPOKUG+FqLgoBA=="], + "test-open-rpc-spec": ["test-open-rpc-spec@1.6.1", "", {}, "sha512-5tS4VA3u1S+XeAlb29MGRGlIgcIfnOlmrjZBAKsjKdhcG5qMZG0SuBZa+TXEgzxhQJzYLGwRX5G0MVf8JPdaEA=="], "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], diff --git a/docker-compose.test.yml b/docker-compose.test.yml deleted file mode 100644 index ca099fa..0000000 --- a/docker-compose.test.yml +++ /dev/null @@ -1,58 +0,0 @@ -services: - test-ts: - image: node:22-slim - volumes: - - ./generated/packages/ts:/pkg:ro - - ./test-open-rpc-spec-1.3.2.tgz:/tgz/test-open-rpc-spec-1.3.2.tgz:ro - command: - - sh - - -c - - | - set -e - cp -r /pkg /tmp/ts - cp /tgz/test-open-rpc-spec-1.3.2.tgz /tmp/ts/ - cd /tmp/ts - npm install --ignore-scripts 2>&1 - node -e "import('./index.js').then(m => console.log('TS OK:', Object.keys(m)))" - - test-go: - image: golang:1.24 - volumes: - - ./generated/packages/go:/pkg:ro - command: - - sh - - -c - - | - set -e - cp -r /pkg /tmp/go - cd /tmp/go - go build ./... - echo "Go OK" - - test-py: - image: python:3.12-slim - volumes: - - ./generated/packages/py:/pkg:ro - command: - - sh - - -c - - | - set -e - cp -r /pkg /tmp/py - cd /tmp/py - pip install . --quiet 2>&1 - python -c "from open_rpc_spec_types import v1_4, v1_3; print('Py OK')" - - test-rs: - image: rust:1.83-slim - volumes: - - ./generated/packages/rs:/pkg:ro - command: - - sh - - -c - - | - set -e - cp -r /pkg /tmp/rs - cd /tmp/rs - cargo check 2>&1 - echo "Rust OK" diff --git a/generated/packages/ts/bun.lock b/generated/packages/ts/bun.lock deleted file mode 100644 index d800a8e..0000000 --- a/generated/packages/ts/bun.lock +++ /dev/null @@ -1,19 +0,0 @@ -{ - "lockfileVersion": 1, - "workspaces": { - "": { - "name": "test-open-rpc-spec-types", - "dependencies": { - "test-open-rpc-spec": "^1.6.0", - }, - "devDependencies": { - "typescript": "^5.0.0", - }, - }, - }, - "packages": { - "test-open-rpc-spec": ["test-open-rpc-spec@1.6.0", "", {}, "sha512-QF7qjTQ47DZr8945H4HoMMSqhs8At8enZlRFxAuZs95zb+zRv23yEbbOG1uwZmsp9ndDqentXPOKUG+FqLgoBA=="], - - "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], - } -} diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index 4eaa09c..a2abb08 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -28,7 +28,7 @@ } }, "dependencies": { - "test-open-rpc-spec": "^1.6.0" + "test-open-rpc-spec": "^1.6.1" }, "devDependencies": { "typescript": "^5.0.0" diff --git a/knope.toml b/knope.toml index 738d408..2611d4b 100644 --- a/knope.toml +++ b/knope.toml @@ -44,6 +44,9 @@ name = "document-change" [[workflows.steps]] type = "CreateChangeFile" + + [github] owner = "zcstarr" repo = "spec-types" + diff --git a/package.json b/package.json index 8808281..4e22ec4 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,6 @@ "@json-schema-tools/transpiler": "^1.10.5", "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", - "test-open-rpc-spec": "^1.6.0" + "test-open-rpc-spec": "^1.6.1" } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 66f51cb..c293950 100644 --- a/src/index.ts +++ b/src/index.ts @@ -164,6 +164,7 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp declaration: true, outDir: outpath, strict: true, + skipLibCheck: true, }, lang: "ts" } ]); } diff --git a/tsconfig.json b/tsconfig.json index bfa0fea..74d734a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,29 +1,33 @@ { "compilerOptions": { // Environment setup & latest features - "lib": ["ESNext"], + "lib": [ + "ESNext", + "DOM" + ], + "types": [], + "typeRoots": [ + "./node_modules/@types" + ], "target": "ESNext", "module": "Preserve", "moduleDetection": "force", "jsx": "react-jsx", "allowJs": true, - // Bundler mode "moduleResolution": "bundler", "allowImportingTsExtensions": true, "verbatimModuleSyntax": true, "noEmit": true, - // Best practices "strict": true, "skipLibCheck": true, "noFallthroughCasesInSwitch": true, "noUncheckedIndexedAccess": true, "noImplicitOverride": true, - // Some stricter flags (disabled by default) "noUnusedLocals": false, "noUnusedParameters": false, "noPropertyAccessFromIndexSignature": false } -} +} \ No newline at end of file From e0465f77c4d6dbba5f90a291c0eadeb7e2511917 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 10:15:11 -0800 Subject: [PATCH 19/46] chore: fix release logs format --- knope.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/knope.toml b/knope.toml index 2611d4b..7b12afd 100644 --- a/knope.toml +++ b/knope.toml @@ -44,7 +44,12 @@ name = "document-change" [[workflows.steps]] type = "CreateChangeFile" - +[release_notes] +change_templates = [ + "- $summary ([`$commit_hash`](https://github.com/zcstarr/spec-types/commit/$commit_hash))", + "### $summary\n\n$details", + "- $summary", +] [github] owner = "zcstarr" From ed9229949af2592fc108e600faaf69c90a515710 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 10:25:50 -0800 Subject: [PATCH 20/46] chore: refactor to support filtering status --- .github/workflows/test-installs.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-installs.yml b/.github/workflows/test-installs.yml index 6209ec3..84f602e 100644 --- a/.github/workflows/test-installs.yml +++ b/.github/workflows/test-installs.yml @@ -6,6 +6,15 @@ on: pull_request: jobs: + check-status: + if: always() + needs: [test-ts, test-go, test-py, test-rs] + runs-on: ubuntu-latest + steps: + - name: Check status + if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} + run: exit 1 + test-ts: name: TypeScript Install runs-on: ubuntu-latest @@ -16,7 +25,6 @@ jobs: node-version: "22" - name: Install & smoke test run: | - cp test-open-rpc-spec-1.3.2.tgz generated/packages/ts/ cd generated/packages/ts npm install --ignore-scripts node -e "import('./index.js').then(m => console.log('TS OK:', Object.keys(m)))" From 24fce1f506f49638b78a409d22884733f770d991 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 10:26:18 -0800 Subject: [PATCH 21/46] chore: tmp disable rust and python builds --- .github/workflows/test-installs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-installs.yml b/.github/workflows/test-installs.yml index 84f602e..6c75518 100644 --- a/.github/workflows/test-installs.yml +++ b/.github/workflows/test-installs.yml @@ -8,7 +8,7 @@ on: jobs: check-status: if: always() - needs: [test-ts, test-go, test-py, test-rs] + needs: [test-ts, test-go] runs-on: ubuntu-latest steps: - name: Check status From b7efb8264ee324e03dc384411df7939ecd2919e5 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 10:30:01 -0800 Subject: [PATCH 22/46] chore: correct missing assets --- .gitignore | 3 - generated/packages/ts/1_3/index.d.ts | 406 +++++++++++++++ generated/packages/ts/1_3/index.js | 1 + generated/packages/ts/1_4/index.d.ts | 748 +++++++++++++++++++++++++++ generated/packages/ts/1_4/index.js | 1 + generated/packages/ts/index.d.ts | 4 + generated/packages/ts/index.js | 1 + 7 files changed, 1161 insertions(+), 3 deletions(-) create mode 100644 generated/packages/ts/1_3/index.d.ts create mode 100644 generated/packages/ts/1_3/index.js create mode 100644 generated/packages/ts/1_4/index.d.ts create mode 100644 generated/packages/ts/1_4/index.js create mode 100644 generated/packages/ts/index.d.ts create mode 100644 generated/packages/ts/index.js diff --git a/.gitignore b/.gitignore index 32cf04d..83cda72 100644 --- a/.gitignore +++ b/.gitignore @@ -140,8 +140,5 @@ vite.config.ts.timestamp-* .cursor -# Generated TS build artifacts (source of truth is .ts) -generated/packages/ts/**/*.js -generated/packages/ts/**/*.d.ts LLMLOG.MD .DS_Store \ No newline at end of file diff --git a/generated/packages/ts/1_3/index.d.ts b/generated/packages/ts/1_3/index.d.ts new file mode 100644 index 0000000..1508737 --- /dev/null +++ b/generated/packages/ts/1_3/index.d.ts @@ -0,0 +1,406 @@ +export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc0" | "1.0.0-rc1"; +export type InfoObjectProperties = string; +export type InfoObjectDescription = string; +export type InfoObjectTermsOfService = string; +export type InfoObjectVersion = string; +export type ContactObjectName = string; +export type ContactObjectEmail = string; +export type ContactObjectUrl = string; +export type SpecificationExtension = any; +export interface ContactObject { + name?: ContactObjectName; + email?: ContactObjectEmail; + url?: ContactObjectUrl; + [regex: string]: SpecificationExtension | any; +} +export type LicenseObjectName = string; +export type LicenseObjectUrl = string; +export interface LicenseObject { + name?: LicenseObjectName; + url?: LicenseObjectUrl; + [regex: string]: SpecificationExtension | any; +} +export interface InfoObject { + title: InfoObjectProperties; + description?: InfoObjectDescription; + termsOfService?: InfoObjectTermsOfService; + version: InfoObjectVersion; + contact?: ContactObject; + license?: LicenseObject; + [regex: string]: SpecificationExtension | any; +} +export type ExternalDocumentationObjectDescription = string; +export type ExternalDocumentationObjectUrl = string; +/** + * + * information about external documentation + * + */ +export interface ExternalDocumentationObject { + description?: ExternalDocumentationObjectDescription; + url: ExternalDocumentationObjectUrl; + [regex: string]: SpecificationExtension | any; +} +export type ServerObjectUrl = string; +export type ServerObjectName = string; +export type ServerObjectDescription = string; +export type ServerObjectSummary = string; +export type ServerObjectVariableDefault = string; +export type ServerObjectVariableDescription = string; +export type ServerObjectVariableEnumItem = string; +export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +export interface ServerObjectVariable { + default: ServerObjectVariableDefault; + description?: ServerObjectVariableDescription; + enum?: ServerObjectVariableEnum; + [k: string]: any; +} +export interface ServerObjectVariables { + [key: string]: any; +} +export interface ServerObject { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +export type Servers = ServerObject[]; +/** + * + * The cannonical name for the method. The name MUST be unique within the methods array. + * + */ +export type MethodObjectName = string; +/** + * + * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. + * + */ +export type MethodObjectDescription = string; +/** + * + * A short summary of what the method does. + * + */ +export type MethodObjectSummary = string; +export type TagObjectName = string; +export type TagObjectDescription = string; +export interface TagObject { + name: TagObjectName; + description?: TagObjectDescription; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type $Ref = string; +export interface ReferenceObject { + $ref: $Ref; +} +export type TagOrReference = TagObject | ReferenceObject; +export type MethodObjectTags = TagOrReference[]; +/** + * + * Format the server expects the params. Defaults to 'either'. + * + * @default either + * + */ +export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +export type ContentDescriptorObjectName = string; +export type ContentDescriptorObjectDescription = string; +export type ContentDescriptorObjectSummary = string; +export type $Id = string; +export type $Schema = string; +export type $Comment = string; +export type Title = string; +export type Description = string; +type AlwaysTrue = any; +export type ReadOnly = boolean; +export type Examples = AlwaysTrue[]; +export type MultipleOf = number; +export type Maximum = number; +export type ExclusiveMaximum = number; +export type Minimum = number; +export type ExclusiveMinimum = number; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefaultZero = number; +export type Pattern = string; +export type SchemaArray = JSONSchema[]; +/** + * + * @default true + * + */ +export type Items = JSONSchema | SchemaArray; +export type UniqueItems = boolean; +export type StringDoaGddGA = string; +/** + * + * @default [] + * + */ +export type StringArray = StringDoaGddGA[]; +/** + * + * @default {} + * + */ +export interface Definitions { + [key: string]: any; +} +/** + * + * @default {} + * + */ +export interface Properties { + [key: string]: any; +} +export type PropertyNames = any; +/** + * + * @default {} + * + */ +export interface PatternProperties { + [key: string]: any; +} +export type DependenciesSet = JSONSchema | StringArray; +export interface Dependencies { + [key: string]: any; +} +export type Enum = AlwaysTrue[]; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type ArrayOfSimpleTypes = SimpleTypes[]; +export type Type = SimpleTypes | ArrayOfSimpleTypes; +export type Format = string; +export type ContentMediaType = string; +export type ContentEncoding = string; +export interface JSONSchemaObject { + $id?: $Id; + $schema?: $Schema; + $ref?: $Ref; + $comment?: $Comment; + title?: Title; + description?: Description; + default?: AlwaysTrue; + readOnly?: ReadOnly; + examples?: Examples; + multipleOf?: MultipleOf; + maximum?: Maximum; + exclusiveMaximum?: ExclusiveMaximum; + minimum?: Minimum; + exclusiveMinimum?: ExclusiveMinimum; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefaultZero; + pattern?: Pattern; + additionalItems?: JSONSchema; + items?: Items; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefaultZero; + uniqueItems?: UniqueItems; + contains?: JSONSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefaultZero; + required?: StringArray; + additionalProperties?: JSONSchema; + definitions?: Definitions; + properties?: Properties; + patternProperties?: PatternProperties; + dependencies?: Dependencies; + propertyNames?: JSONSchema; + const?: AlwaysTrue; + enum?: Enum; + type?: Type; + format?: Format; + contentMediaType?: ContentMediaType; + contentEncoding?: ContentEncoding; + if?: JSONSchema; + then?: JSONSchema; + else?: JSONSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JSONSchema; + [k: string]: any; +} +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; +export type ContentDescriptorObjectRequired = boolean; +export type ContentDescriptorObjectDeprecated = boolean; +export interface ContentDescriptorObject { + name: ContentDescriptorObjectName; + description?: ContentDescriptorObjectDescription; + summary?: ContentDescriptorObjectSummary; + schema: JSONSchema; + required?: ContentDescriptorObjectRequired; + deprecated?: ContentDescriptorObjectDeprecated; + [regex: string]: SpecificationExtension | any; +} +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +export type MethodObjectParams = ContentDescriptorOrReference[]; +export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; +/** + * + * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. + * + */ +export type ErrorObjectCode = number; +/** + * + * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. + * + */ +export type ErrorObjectMessage = string; +/** + * + * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). + * + */ +export type ErrorObjectData = any; +/** + * + * Defines an application level error. + * + */ +export interface ErrorObject { + code: ErrorObjectCode; + message: ErrorObjectMessage; + data?: ErrorObjectData; +} +export type ErrorOrReference = ErrorObject | ReferenceObject; +/** + * + * Defines an application level error. + * + */ +export type MethodObjectErrors = ErrorOrReference[]; +export type LinkObjectName = string; +export type LinkObjectSummary = string; +export type LinkObjectMethod = string; +export type LinkObjectDescription = string; +export type LinkObjectParams = any; +export interface LinkObjectServer { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +export interface LinkObject { + name?: LinkObjectName; + summary?: LinkObjectSummary; + method?: LinkObjectMethod; + description?: LinkObjectDescription; + params?: LinkObjectParams; + server?: LinkObjectServer; + [regex: string]: SpecificationExtension | any; +} +export type LinkOrReference = LinkObject | ReferenceObject; +export type MethodObjectLinks = LinkOrReference[]; +export type ExamplePairingObjectName = string; +export type ExamplePairingObjectDescription = string; +export type ExampleObjectSummary = string; +export type ExampleObjectValue = any; +export type ExampleObjectDescription = string; +export type ExampleObjectName = string; +export interface ExampleObject { + summary?: ExampleObjectSummary; + value: ExampleObjectValue; + description?: ExampleObjectDescription; + name: ExampleObjectName; + [regex: string]: SpecificationExtension | any; +} +export type ExampleOrReference = ExampleObject | ReferenceObject; +export type ExamplePairingObjectParams = ExampleOrReference[]; +export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +export interface ExamplePairingObject { + name: ExamplePairingObjectName; + description?: ExamplePairingObjectDescription; + params: ExamplePairingObjectParams; + result?: ExamplePairingObjectResult; + [k: string]: any; +} +export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +export type MethodObjectExamples = ExamplePairingOrReference[]; +export type MethodObjectDeprecated = boolean; +export interface MethodObject { + name: MethodObjectName; + description?: MethodObjectDescription; + summary?: MethodObjectSummary; + servers?: Servers; + tags?: MethodObjectTags; + paramStructure?: MethodObjectParamStructure; + params: MethodObjectParams; + result?: MethodObjectResult; + errors?: MethodObjectErrors; + links?: MethodObjectLinks; + examples?: MethodObjectExamples; + deprecated?: MethodObjectDeprecated; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type MethodOrReference = MethodObject | ReferenceObject; +export type Methods = MethodOrReference[]; +export interface SchemaComponents { + [key: string]: any; +} +export interface LinkComponents { + [key: string]: any; +} +export interface ErrorComponents { + [key: string]: any; +} +export interface ExampleComponents { + [key: string]: any; +} +export interface ExamplePairingComponents { + [key: string]: any; +} +export interface ContentDescriptorComponents { + [key: string]: any; +} +export interface TagComponents { + [key: string]: any; +} +export interface Components { + schemas?: SchemaComponents; + links?: LinkComponents; + errors?: ErrorComponents; + examples?: ExampleComponents; + examplePairings?: ExamplePairingComponents; + contentDescriptors?: ContentDescriptorComponents; + tags?: TagComponents; + [k: string]: any; +} +/** + * + * JSON Schema URI (used by some editors) + * + * @default https://meta.open-rpc.org/ + * + */ +export type MetaSchema = string; +export interface OpenrpcDocument { + openrpc: Openrpc; + info: InfoObject; + externalDocs?: ExternalDocumentationObject; + servers?: Servers; + methods: Methods; + components?: Components; + $schema?: MetaSchema; + [regex: string]: SpecificationExtension | any; +} +export {}; diff --git a/generated/packages/ts/1_3/index.js b/generated/packages/ts/1_3/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/generated/packages/ts/1_3/index.js @@ -0,0 +1 @@ +export {}; diff --git a/generated/packages/ts/1_4/index.d.ts b/generated/packages/ts/1_4/index.d.ts new file mode 100644 index 0000000..6ed21ff --- /dev/null +++ b/generated/packages/ts/1_4/index.d.ts @@ -0,0 +1,748 @@ +/** + * + * This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string. + * + */ +export type Openrpc = string; +/** + * + * The title of the application. + * + */ +export type InfoObjectTitle = string; +/** + * + * A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type InfoObjectDescription = string; +/** + * + * A URL to the Terms of Service for the API. MUST be in the format of a URL. + * + */ +export type InfoObjectTermsOfService = string; +/** + * + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * + */ +export type InfoObjectVersion = string; +/** + * + * The identifying name of the contact person/organization. + * + */ +export type ContactObjectName = string; +/** + * + * The email address of the contact person/organization. MUST be in the format of an email address. + * + */ +export type ContactObjectEmail = string; +/** + * + * The URL pointing to the contact information. MUST be in the format of a URL. + * + */ +export type ContactObjectUrl = string; +/** + * + * This object MAY be extended with [Specification Extensions](#specification-extensions). + * + */ +export type SpecificationExtension = any; +/** + * + * Contact information for the exposed API. + * + */ +export interface ContactObject { + name?: ContactObjectName; + email?: ContactObjectEmail; + url?: ContactObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The license name used for the API. + * + */ +export type LicenseObjectName = string; +/** + * + * A URL to the license used for the API. MUST be in the format of a URL. + * + */ +export type LicenseObjectUrl = string; +/** + * + * License information for the exposed API. + * + */ +export interface LicenseObject { + name?: LicenseObjectName; + url?: LicenseObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience. + * + */ +export type InfoObject = any; +/** + * + * A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExternalDocumentationObjectDescription = string; +/** + * + * The URL for the target documentation. Value MUST be in the format of a URL. + * + */ +export type ExternalDocumentationObjectUrl = string; +/** + * + * Additional external documentation for this tag. + * + */ +export interface ExternalDocumentationObject { + description?: ExternalDocumentationObjectDescription; + url: ExternalDocumentationObjectUrl; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export type ServerObjectUrl = string; +/** + * + * An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectName = string; +/** + * + * An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectDescription = string; +/** + * + * A short summary of what the server is. + * + */ +export type ServerObjectSummary = string; +/** + * + * The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional. + * + */ +export type ServerObjectVariableDefault = string; +/** + * + * An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ServerObjectVariableDescription = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnumItem = string; +/** + * + * An enumeration of string values to be used if the substitution options are from a limited set. + * + */ +export type ServerObjectVariableEnum = ServerObjectVariableEnumItem[]; +/** + * + * An object representing a Server Variable for server URL template substitution. + * + */ +export interface ServerObjectVariable { + default: ServerObjectVariableDefault; + description?: ServerObjectVariableDescription; + enum?: ServerObjectVariableEnum; + [k: string]: any; +} +/** + * + * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. + * + */ +export interface ServerObjectVariables { + [key: string]: any; +} +/** + * + * A object representing a Server + * + */ +export interface ServerObject { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * + */ +export type Servers = ServerObject[]; +/** + * + * The cannonical name for the method. The name MUST be unique within the methods array. + * + */ +export type MethodObjectName = string; +/** + * + * A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation. + * + */ +export type MethodObjectDescription = string; +/** + * + * A short summary of what the method does. + * + */ +export type MethodObjectSummary = string; +/** + * + * The name of the tag. + * + */ +export type TagObjectName = string; +/** + * + * A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type TagObjectDescription = string; +/** + * + * Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances. + * + */ +export interface TagObject { + name: TagObjectName; + description?: TagObjectDescription; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type $Ref = string; +export interface ReferenceObject { + $ref: $Ref; +} +export type TagOrReference = TagObject | ReferenceObject; +/** + * + * A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier. + * + */ +export type MethodObjectTags = TagOrReference[]; +/** + * + * Format the server expects the params. Defaults to 'either'. + * + * @default either + * + */ +export type MethodObjectParamStructure = "by-position" | "by-name" | "either"; +/** + * + * Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name). + * + */ +export type ContentDescriptorObjectName = string; +/** + * + * A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ContentDescriptorObjectDescription = string; +/** + * + * A short summary of the content that is being described. + * + */ +export type ContentDescriptorObjectSummary = string; +export type $Id = string; +export type $Schema = string; +export type $Comment = string; +export type Title = string; +export type Description = string; +type AlwaysTrue = any; +export type ReadOnly = boolean; +export type Examples = AlwaysTrue[]; +export type MultipleOf = number; +export type Maximum = number; +export type ExclusiveMaximum = number; +export type Minimum = number; +export type ExclusiveMinimum = number; +export type NonNegativeInteger = number; +export type NonNegativeIntegerDefaultZero = number; +export type Pattern = string; +/** + * + * Always valid if true. Never valid if false. Is constant. + * + */ +export type JSONSchemaBoolean = boolean; +/** + * + * @default {} + * + */ +export type JSONSchema = JSONSchemaObject | JSONSchemaBoolean; +export type SchemaArray = JSONSchema[]; +/** + * + * @default true + * + */ +export type Items = JSONSchema | SchemaArray; +export type UniqueItems = boolean; +export type StringDoaGddGA = string; +/** + * + * @default [] + * + */ +export type StringArray = StringDoaGddGA[]; +/** + * + * @default {} + * + */ +export interface Definitions { + [key: string]: any; +} +/** + * + * @default {} + * + */ +export interface Properties { + [key: string]: any; +} +export type PropertyNames = any; +/** + * + * @default {} + * + */ +export interface PatternProperties { + [key: string]: any; +} +export type DependenciesSet = JSONSchema | StringArray; +export interface Dependencies { + [key: string]: any; +} +export type Enum = AlwaysTrue[]; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type ArrayOfSimpleTypes = SimpleTypes[]; +export type Type = SimpleTypes | ArrayOfSimpleTypes; +export type Format = string; +export type ContentMediaType = string; +export type ContentEncoding = string; +export interface JSONSchemaObject { + $id?: $Id; + $schema?: $Schema; + $ref?: $Ref; + $comment?: $Comment; + title?: Title; + description?: Description; + default?: AlwaysTrue; + readOnly?: ReadOnly; + examples?: Examples; + multipleOf?: MultipleOf; + maximum?: Maximum; + exclusiveMaximum?: ExclusiveMaximum; + minimum?: Minimum; + exclusiveMinimum?: ExclusiveMinimum; + maxLength?: NonNegativeInteger; + minLength?: NonNegativeIntegerDefaultZero; + pattern?: Pattern; + additionalItems?: JSONSchema; + items?: Items; + maxItems?: NonNegativeInteger; + minItems?: NonNegativeIntegerDefaultZero; + uniqueItems?: UniqueItems; + contains?: JSONSchema; + maxProperties?: NonNegativeInteger; + minProperties?: NonNegativeIntegerDefaultZero; + required?: StringArray; + additionalProperties?: JSONSchema; + definitions?: Definitions; + properties?: Properties; + patternProperties?: PatternProperties; + dependencies?: Dependencies; + propertyNames?: JSONSchema; + const?: AlwaysTrue; + enum?: Enum; + type?: Type; + format?: Format; + contentMediaType?: ContentMediaType; + contentEncoding?: ContentEncoding; + if?: JSONSchema; + then?: JSONSchema; + else?: JSONSchema; + allOf?: SchemaArray; + anyOf?: SchemaArray; + oneOf?: SchemaArray; + not?: JSONSchema; + [k: string]: any; +} +/** + * + * Schema that describes the content. + * + * @default {} + * + */ +export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; +/** + * + * Determines if the content is a required field. Default value is `false`. + * + */ +export type ContentDescriptorObjectRequired = boolean; +/** + * + * Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`. + * + */ +export type ContentDescriptorObjectDeprecated = boolean; +/** + * + * Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema. + * + */ +export interface ContentDescriptorObject { + name: ContentDescriptorObjectName; + description?: ContentDescriptorObjectDescription; + summary?: ContentDescriptorObjectSummary; + schema: ContentDescriptorObjectSchema; + required?: ContentDescriptorObjectRequired; + deprecated?: ContentDescriptorObjectDeprecated; + [regex: string]: SpecificationExtension | any; +} +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +/** + * + * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. + * + */ +export type MethodObjectParams = ContentDescriptorOrReference[]; +/** + * + * The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification) + * + */ +export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; +/** + * + * A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api. + * + */ +export type ErrorObjectCode = number; +/** + * + * A String providing a short description of the error. The message SHOULD be limited to a concise single sentence. + * + */ +export type ErrorObjectMessage = string; +/** + * + * A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.). + * + */ +export type ErrorObjectData = any; +/** + * + * Defines an application level error. + * + */ +export interface ErrorObject { + code: ErrorObjectCode; + message: ErrorObjectMessage; + data?: ErrorObjectData; +} +export type ErrorOrReference = ErrorObject | ReferenceObject; +/** + * + * A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes. + * + */ +export type MethodObjectErrors = ErrorOrReference[]; +/** + * + * Cannonical name of the link. + * + */ +export type LinkObjectName = any; +/** + * + * Short description for the link. + * + */ +export type LinkObjectSummary = string; +/** + * + * The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted. + * + */ +export type LinkObjectMethod = string; +/** + * + * A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type LinkObjectDescription = string; +/** + * + * A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method. + * + */ +export type LinkObjectParams = any; +/** + * + * A server object to be used by the target method. + * + */ +export interface LinkObjectServer { + url: ServerObjectUrl; + name?: ServerObjectName; + description?: ServerObjectDescription; + summary?: ServerObjectSummary; + variables?: ServerObjectVariables; + [regex: string]: SpecificationExtension | any; +} +/** + * + * A object representing a Link + * + */ +export type LinkObject = any; +export type LinkOrReference = LinkObject | ReferenceObject; +/** + * + * A list of possible links from this method call. + * + */ +export type MethodObjectLinks = LinkOrReference[]; +/** + * + * Name for the example pairing. + * + */ +export type ExamplePairingObjectName = string; +/** + * + * A verbose explanation of the example pairing. + * + */ +export type ExamplePairingObjectDescription = string; +/** + * + * Short description for the example. + * + */ +export type ExampleObjectSummary = string; +/** + * + * Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary. + * + */ +export type ExampleObjectValue = any; +/** + * + * A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation. + * + */ +export type ExampleObjectDescription = string; +/** + * + * Cannonical name of the example. + * + */ +export type ExampleObjectName = string; +/** + * + * The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object). + * + */ +export interface ExampleObject { + summary?: ExampleObjectSummary; + value: ExampleObjectValue; + description?: ExampleObjectDescription; + name: ExampleObjectName; + [regex: string]: SpecificationExtension | any; +} +export type ExampleOrReference = ExampleObject | ReferenceObject; +/** + * + * Example parameters. + * + */ +export type ExamplePairingObjectParams = ExampleOrReference[]; +/** + * + * Example result. When not provided, the example pairing represents usage of the method as a notification. + * + */ +export type ExamplePairingObjectResult = ExampleObject | ReferenceObject; +/** + * + * The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params. + * + */ +export interface ExamplePairingObject { + name: ExamplePairingObjectName; + description?: ExamplePairingObjectDescription; + params: ExamplePairingObjectParams; + result?: ExamplePairingObjectResult; + [k: string]: any; +} +export type ExamplePairingOrReference = ExamplePairingObject | ReferenceObject; +/** + * + * Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing. + * + */ +export type MethodObjectExamples = ExamplePairingOrReference[]; +/** + * + * Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`. + * + */ +export type MethodObjectDeprecated = boolean; +/** + * + * Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique. + * + */ +export interface MethodObject { + name: MethodObjectName; + description?: MethodObjectDescription; + summary?: MethodObjectSummary; + servers?: Servers; + tags?: MethodObjectTags; + paramStructure?: MethodObjectParamStructure; + params: MethodObjectParams; + result?: MethodObjectResult; + errors?: MethodObjectErrors; + links?: MethodObjectLinks; + examples?: MethodObjectExamples; + deprecated?: MethodObjectDeprecated; + externalDocs?: ExternalDocumentationObject; + [regex: string]: SpecificationExtension | any; +} +export type MethodOrReference = MethodObject | ReferenceObject; +/** + * + * The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example). + * + */ +export type Methods = MethodOrReference[]; +/** + * + * An object to hold reusable [Schema Objects](#schema-object). + * + */ +export interface SchemaComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Link Objects](#link-object). + * + */ +export interface LinkComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Error Objects](#error-object). + * + */ +export interface ErrorComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Example Objects](#example-object). + * + */ +export interface ExampleComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Example Pairing Objects](#example-pairing-object). + * + */ +export interface ExamplePairingComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). + * + */ +export interface ContentDescriptorComponents { + [key: string]: any; +} +/** + * + * An object to hold reusable [Tag Objects](#tag-object). + * + */ +export interface TagComponents { + [key: string]: any; +} +/** + * + * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. + * + */ +export interface Components { + schemas?: SchemaComponents; + links?: LinkComponents; + errors?: ErrorComponents; + examples?: ExampleComponents; + examplePairings?: ExamplePairingComponents; + contentDescriptors?: ContentDescriptorComponents; + tags?: TagComponents; + [k: string]: any; +} +/** + * + * JSON Schema URI (used by some editors) + * + * @default https://meta.open-rpc.org/ + * + */ +export type MetaSchema = string; +export interface OpenrpcDocument { + openrpc: Openrpc; + info: InfoObject; + externalDocs?: ExternalDocumentationObject; + servers?: Servers; + methods: Methods; + components?: Components; + $schema?: MetaSchema; + [regex: string]: SpecificationExtension | any; +} +export {}; diff --git a/generated/packages/ts/1_4/index.js b/generated/packages/ts/1_4/index.js new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/generated/packages/ts/1_4/index.js @@ -0,0 +1 @@ +export {}; diff --git a/generated/packages/ts/index.d.ts b/generated/packages/ts/index.d.ts new file mode 100644 index 0000000..49172de --- /dev/null +++ b/generated/packages/ts/index.d.ts @@ -0,0 +1,4 @@ +import type * as V1_4 from "./1_4/index.js"; +import type * as V1_3 from "./1_3/index.js"; +export type { V1_4, V1_3 }; +export * as spec from "test-open-rpc-spec"; diff --git a/generated/packages/ts/index.js b/generated/packages/ts/index.js new file mode 100644 index 0000000..d20edbd --- /dev/null +++ b/generated/packages/ts/index.js @@ -0,0 +1 @@ +export * as spec from "test-open-rpc-spec"; From 6c3117f38d05166a7a1f1f643d79fe2ccc8b7eab Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 11:01:04 -0800 Subject: [PATCH 23/46] chore: adjust tmp disable rs and py install test --- .github/workflows/test-installs.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-installs.yml b/.github/workflows/test-installs.yml index 6c75518..d2e41ce 100644 --- a/.github/workflows/test-installs.yml +++ b/.github/workflows/test-installs.yml @@ -4,17 +4,18 @@ on: push: branches: [main, "feat/**"] pull_request: + workflow_dispatch: + inputs: + test-py: + description: "Run Python install test" + type: boolean + default: false + test-rs: + description: "Run Rust check test" + type: boolean + default: false jobs: - check-status: - if: always() - needs: [test-ts, test-go] - runs-on: ubuntu-latest - steps: - - name: Check status - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} - run: exit 1 - test-ts: name: TypeScript Install runs-on: ubuntu-latest @@ -44,6 +45,7 @@ jobs: echo "Go OK" test-py: + if: ${{ inputs.test-py == true }} name: Python Install runs-on: ubuntu-latest steps: @@ -58,6 +60,7 @@ jobs: python -c "from open_rpc_spec_types import v1_4, v1_3; print('Py OK')" test-rs: + if: ${{ inputs.test-rs == true }} name: Rust Check runs-on: ubuntu-latest steps: From 5dac7725c93513909d2a9c30b422f2b2351399a7 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 11:18:11 -0800 Subject: [PATCH 24/46] chore: update the knope release flow --- .github/workflows/prepare-release.yml | 20 +++++++++++--------- .github/workflows/release.yml | 24 +++++++++++------------- knope.toml | 8 -------- 3 files changed, 22 insertions(+), 30 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index 7c0e247..d4496a1 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -1,28 +1,30 @@ -name: Prepare Release +name: Create Release PR -on: workflow_dispatch +on: + push: + branches: [main] permissions: contents: write jobs: prepare-release: + if: "!contains(github.event.head_commit.message, 'chore: prepare release')" runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PAT }} - - name: Configure Git run: | git config --global user.name "GitHub Actions" - git config user.email "github-actions@github.com" - + git config --global user.email "github-actions@github.com" - name: Install Knope uses: knope-dev/action@v2.1.2 with: - version: 0.22.2 - - - name: Prepare release - run: knope prepare-release --verbose + version: 0.22.3 + - run: knope prepare-release --verbose + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + continue-on-error: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56154ac..1d7faf1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,16 +1,13 @@ name: Release on: - workflow_dispatch: - inputs: - publish-py: - description: "Publish Python package" - type: boolean - default: true - publish-rs: - description: "Publish Rust crate" - type: boolean - default: true + pull_request: + types: [closed] + branches: [main] + +env: + PUBLISH_PY: "false" + PUBLISH_RS: "false" permissions: contents: write @@ -18,6 +15,7 @@ permissions: jobs: create-release: + if: github.head_ref == 'release' && github.event.pull_request.merged == true runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -27,7 +25,7 @@ jobs: - name: Install Knope uses: knope-dev/action@v2.1.2 with: - version: 0.22.2 + version: 0.22.3 - name: Create GitHub releases run: knope release --verbose @@ -58,7 +56,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-py: - if: ${{ inputs.publish-py }} + if: ${{ env.PUBLISH_PY == 'true' }} needs: create-release runs-on: ubuntu-latest permissions: @@ -83,7 +81,7 @@ jobs: packages-dir: generated/packages/py/dist/ publish-rs: - if: ${{ inputs.publish-rs }} + if: ${{ env.PUBLISH_RS == 'true' }} needs: create-release runs-on: ubuntu-latest steps: diff --git a/knope.toml b/knope.toml index 7b12afd..3486a5a 100644 --- a/knope.toml +++ b/knope.toml @@ -24,14 +24,6 @@ name = "prepare-release" [[workflows.steps]] type = "PrepareRelease" -[[workflows.steps]] -type = "Command" -command = "git commit -m \"chore: prepare release\"" - -[[workflows.steps]] -type = "Command" -command = "git push" - [[workflows]] name = "release" From 6291e6a2156e7ecd2265c14195fb6c42a3b5a6ae Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 11:27:04 -0800 Subject: [PATCH 25/46] chore: fix ci --- .github/workflows/release.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1d7faf1..833b63d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,10 +5,6 @@ on: types: [closed] branches: [main] -env: - PUBLISH_PY: "false" - PUBLISH_RS: "false" - permissions: contents: write id-token: write @@ -56,7 +52,7 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-py: - if: ${{ env.PUBLISH_PY == 'true' }} + if: true # set to false to skip PyPI publish needs: create-release runs-on: ubuntu-latest permissions: @@ -81,7 +77,7 @@ jobs: packages-dir: generated/packages/py/dist/ publish-rs: - if: ${{ env.PUBLISH_RS == 'true' }} + if: true # set to false to skip crates.io publish needs: create-release runs-on: ubuntu-latest steps: From f84bb88282abd12d2b88ba1071d8f68e945aa050 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 11:48:14 -0800 Subject: [PATCH 26/46] fix: version bump lint issues --- bun.lock | 9 +++++++-- package.json | 1 + src/index.ts | 6 ++---- tsconfig.json | 4 +++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/bun.lock b/bun.lock index 3be7f48..595325a 100644 --- a/bun.lock +++ b/bun.lock @@ -14,6 +14,7 @@ "@json-schema-tools/dereferencer": "^1.6.3", "@json-schema-tools/meta-schema": "^1.8.0", "@types/bun": "latest", + "@types/node": "^25.3.0", "@typescript-eslint/eslint-plugin": "^8.55.0", "eslint-plugin-prettier": "^5.5.5", "prettier": "^3.8.1", @@ -74,7 +75,7 @@ "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], - "@types/node": ["@types/node@25.2.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ=="], + "@types/node": ["@types/node@25.3.0", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A=="], "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.55.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.12.2", "@typescript-eslint/scope-manager": "8.55.0", "@typescript-eslint/type-utils": "8.55.0", "@typescript-eslint/utils": "8.55.0", "@typescript-eslint/visitor-keys": "8.55.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.4.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.55.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" } }, "sha512-1y/MVSz0NglV1ijHC8OT49mPJ4qhPYjiK08YUQVbIOyu+5k862LKUHFkpKHWu//zmr7hDR2rhwUm6gnCGNmGBQ=="], @@ -240,7 +241,7 @@ "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], - "undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="], "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], @@ -262,10 +263,14 @@ "@typescript-eslint/visitor-keys/eslint-visitor-keys": ["eslint-visitor-keys@4.2.1", "", {}, "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ=="], + "bun-types/@types/node": ["@types/node@25.2.3", "", { "dependencies": { "undici-types": "~7.16.0" } }, "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ=="], + "eslint/ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + "bun-types/@types/node/undici-types": ["undici-types@7.16.0", "", {}, "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw=="], + "@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], } } diff --git a/package.json b/package.json index 4e22ec4..97c9bdb 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "@json-schema-tools/dereferencer": "^1.6.3", "@json-schema-tools/meta-schema": "^1.8.0", "@types/bun": "latest", + "@types/node": "^25.3.0", "@typescript-eslint/eslint-plugin": "^8.55.0", "eslint-plugin-prettier": "^5.5.5", "prettier": "^3.8.1", diff --git a/src/index.ts b/src/index.ts index c293950..ac37478 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,7 @@ -import * as path from "path"; import Transpiler from "@json-schema-tools/transpiler"; -import { compileTypescript, StringUtils } from "./util"; +import { compileTypescript } from "./util"; import { buildPackageJson, buildTsConfig, buildCargoToml, buildGoMod, buildPyProjectToml } from "./assets.ts"; -import {readFile, writeFile, mkdir, rmdir, rm} from "fs/promises"; -import type { JSONSchemaObject } from "@json-schema-tools/meta-schema"; +import {readFile, writeFile, mkdir, rm} from "fs/promises"; import Dereferencer from "@json-schema-tools/dereferencer"; import toml from "@iarna/toml"; import {getAllSchemas} from "test-open-rpc-spec" diff --git a/tsconfig.json b/tsconfig.json index 74d734a..7297ff6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,9 @@ "ESNext", "DOM" ], - "types": [], + "types": [ + "bun" + ], "typeRoots": [ "./node_modules/@types" ], From 0210a0814fcbbbfd82c33505c37ffbe644139813 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 11:58:33 -0800 Subject: [PATCH 27/46] chore: fix ci --- knope.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/knope.toml b/knope.toml index 3486a5a..9081ba7 100644 --- a/knope.toml +++ b/knope.toml @@ -21,9 +21,31 @@ scopes = ["ts"] [[workflows]] name = "prepare-release" +[[workflows.steps]] +type = "Command" +command = "git switch -c release" + [[workflows.steps]] type = "PrepareRelease" +[[workflows.steps]] +type = "Command" +command = "git commit -m \"chore: prepare release $version\"" + +[[workflows.steps]] +type = "Command" +command = "git push --force --set-upstream origin release" + +[[workflows.steps]] +type = "CreatePullRequest" +base = "master" + +[workflows.steps.title] +template = "chore: prepare release $version" + +[workflows.steps.body] +template = "Merging this PR will create a new release\n\n$changelog" + [[workflows]] name = "release" From 85019e84bc6da21c25e5607376594e76af19ef92 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 12:02:09 -0800 Subject: [PATCH 28/46] chore: tmp fix go mod to unbreak build --- src/assets.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets.ts b/src/assets.ts index 694c9a9..1aaeb26 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -33,7 +33,7 @@ export interface GoModOptions { } export const buildGoMod = ( - opts: GoModOptions = { module: "github.com/open-rpc/spec-types/generated/packages/go", goVersion: "1.24.5" }, + opts: GoModOptions = { module: "github.com/zcstarr/spec-types/generated/packages/go", goVersion: "1.24.5" }, ): string => `module ${opts.module}\n\ngo ${opts.goVersion}\n`; export interface PyProjectTomlOptions { From 9a9126aa8d3e64625b1845e87d2569ec745f6fbd Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 12:05:03 -0800 Subject: [PATCH 29/46] chore: forgot to generate the code --- generated/packages/go/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generated/packages/go/go.mod b/generated/packages/go/go.mod index bebeabd..6b35d02 100644 --- a/generated/packages/go/go.mod +++ b/generated/packages/go/go.mod @@ -1,3 +1,3 @@ -module github.com/open-rpc/spec-types/generated/packages/go +module github.com/zcstarr/spec-types/generated/packages/go go 1.24.5 From 3f33cac5b786eb2dd4d347b8d88401d26109e451 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 14:14:40 -0800 Subject: [PATCH 30/46] chore: adjust build to handle multiple version release for knope --- knope.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/knope.toml b/knope.toml index 9081ba7..8615cff 100644 --- a/knope.toml +++ b/knope.toml @@ -30,7 +30,7 @@ type = "PrepareRelease" [[workflows.steps]] type = "Command" -command = "git commit -m \"chore: prepare release $version\"" +command = "git commit -m \"chore: prepare release go/$go_version py/$py_version rs/$rs_version ts/$ts_version\"" [[workflows.steps]] type = "Command" @@ -41,10 +41,10 @@ type = "CreatePullRequest" base = "master" [workflows.steps.title] -template = "chore: prepare release $version" +template = "chore: prepare release go/$go_version py/$py_version rs/$rs_version ts/$ts_version" [workflows.steps.body] -template = "Merging this PR will create a new release\n\n$changelog" +template = "Merging this PR will create a new release\n\n## Go\n$go_changelog\n\n## Python\n$py_changelog\n\n## Rust\n$rs_changelog\n\n## TypeScript\n$ts_changelog" [[workflows]] name = "release" From 7dd76c7aef000cecc090cee8ebc01c19fe0de3b4 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 14:22:54 -0800 Subject: [PATCH 31/46] chore: ci adjust workflow to create proper pull request --- .github/workflows/prepare-release.yml | 1 - knope.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml index d4496a1..aa542ce 100644 --- a/.github/workflows/prepare-release.yml +++ b/.github/workflows/prepare-release.yml @@ -27,4 +27,3 @@ jobs: - run: knope prepare-release --verbose env: GITHUB_TOKEN: ${{ secrets.PAT }} - continue-on-error: true diff --git a/knope.toml b/knope.toml index 8615cff..5e75485 100644 --- a/knope.toml +++ b/knope.toml @@ -38,7 +38,7 @@ command = "git push --force --set-upstream origin release" [[workflows.steps]] type = "CreatePullRequest" -base = "master" +base = "main" [workflows.steps.title] template = "chore: prepare release go/$go_version py/$py_version rs/$rs_version ts/$ts_version" From 1617b087951fb6a33724550907ae620169fec2ee Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 14:51:41 -0800 Subject: [PATCH 32/46] chore: adjust the pre release PR --- knope.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/knope.toml b/knope.toml index 5e75485..7b9f283 100644 --- a/knope.toml +++ b/knope.toml @@ -30,7 +30,7 @@ type = "PrepareRelease" [[workflows.steps]] type = "Command" -command = "git commit -m \"chore: prepare release go/$go_version py/$py_version rs/$rs_version ts/$ts_version\"" +command = "git commit -m \"chore: prepare release\"" [[workflows.steps]] type = "Command" @@ -41,10 +41,12 @@ type = "CreatePullRequest" base = "main" [workflows.steps.title] -template = "chore: prepare release go/$go_version py/$py_version rs/$rs_version ts/$ts_version" +template = "chore: prepare release" +variables = {} [workflows.steps.body] -template = "Merging this PR will create a new release\n\n## Go\n$go_changelog\n\n## Python\n$py_changelog\n\n## Rust\n$rs_changelog\n\n## TypeScript\n$ts_changelog" +template = "Merging this PR will create a new release. See the diff for version bumps and changelogs." +variables = {} [[workflows]] name = "release" From c40fe01538ada893ef1495b18f3aec2295f838ca Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 14:52:18 -0800 Subject: [PATCH 33/46] chore: adjust ci for the release PR to skip generated because the code has already been checked just need version bumps --- .github/workflows/check-generated.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 282218d..1513dcf 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -6,6 +6,7 @@ on: jobs: check-generated: + if: github.head_ref != 'release' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 9b72598d3a837cf20ff4c4cc865f4b8dc3be7a1b Mon Sep 17 00:00:00 2001 From: GitHub Actions <github-actions@github.com> Date: Fri, 20 Feb 2026 22:54:38 +0000 Subject: [PATCH 34/46] chore: prepare release --- generated/packages/go/CHANGELOG.md | 19 +++++++++++++++++++ generated/packages/go/go.mod | 2 +- generated/packages/py/CHANGELOG.md | 19 +++++++++++++++++++ generated/packages/py/pyproject.toml | 2 +- generated/packages/rs/CHANGELOG.md | 19 +++++++++++++++++++ generated/packages/rs/Cargo.toml | 2 +- generated/packages/ts/CHANGELOG.md | 19 +++++++++++++++++++ generated/packages/ts/package.json | 2 +- 8 files changed, 80 insertions(+), 4 deletions(-) diff --git a/generated/packages/go/CHANGELOG.md b/generated/packages/go/CHANGELOG.md index 825c32f..bc09837 100644 --- a/generated/packages/go/CHANGELOG.md +++ b/generated/packages/go/CHANGELOG.md @@ -1 +1,20 @@ # Changelog +## 0.1.1 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/go/go.mod b/generated/packages/go/go.mod index 6b35d02..6ac729b 100644 --- a/generated/packages/go/go.mod +++ b/generated/packages/go/go.mod @@ -1,3 +1,3 @@ -module github.com/zcstarr/spec-types/generated/packages/go +module github.com/zcstarr/spec-types/generated/packages/go // v0.1.1 go 1.24.5 diff --git a/generated/packages/py/CHANGELOG.md b/generated/packages/py/CHANGELOG.md index 825c32f..88d15f9 100644 --- a/generated/packages/py/CHANGELOG.md +++ b/generated/packages/py/CHANGELOG.md @@ -1 +1,20 @@ # Changelog +## 0.0.1 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/py/pyproject.toml b/generated/packages/py/pyproject.toml index 7f3ef0b..7646317 100644 --- a/generated/packages/py/pyproject.toml +++ b/generated/packages/py/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "open-rpc-spec-types" -version = "0.0.0" +version = "0.0.1" description = "Generated OpenRPC specification types" license = "Apache-2.0" requires-python = ">=3.12" diff --git a/generated/packages/rs/CHANGELOG.md b/generated/packages/rs/CHANGELOG.md index 825c32f..88d15f9 100644 --- a/generated/packages/rs/CHANGELOG.md +++ b/generated/packages/rs/CHANGELOG.md @@ -1 +1,20 @@ # Changelog +## 0.0.1 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/rs/Cargo.toml b/generated/packages/rs/Cargo.toml index 461b6e3..cb1499d 100644 --- a/generated/packages/rs/Cargo.toml +++ b/generated/packages/rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "open-rpc-spec-types" -version = "0.0.0" +version = "0.0.1" edition = "2021" description = "Generated OpenRPC specification types" license = "Apache-2.0" diff --git a/generated/packages/ts/CHANGELOG.md b/generated/packages/ts/CHANGELOG.md index 825c32f..88d15f9 100644 --- a/generated/packages/ts/CHANGELOG.md +++ b/generated/packages/ts/CHANGELOG.md @@ -1 +1,20 @@ # Changelog +## 0.0.1 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index a2abb08..dee73c1 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -1,6 +1,6 @@ { "name": "test-open-rpc-spec-types", - "version": "0.0.0", + "version": "0.0.1", "type": "module", "module": "index.ts", "scripts": { From f6f8f8f2cc0ae165377142e0e0ed782c6da35005 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 15:11:14 -0800 Subject: [PATCH 35/46] chore: fix ci release --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 833b63d..85c19d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,6 +23,11 @@ jobs: with: version: 0.22.3 + - name: Configure Git identity + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + - name: Create GitHub releases run: knope release --verbose env: From a516a282bd969eaae3f1145aa81e00a1804382d8 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 15:26:19 -0800 Subject: [PATCH 36/46] chore: fix the release tagging so publishing works --- src/assets.ts | 6 +++++- src/index.ts | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/assets.ts b/src/assets.ts index 1aaeb26..9ead9f5 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -34,7 +34,11 @@ export interface GoModOptions { export const buildGoMod = ( opts: GoModOptions = { module: "github.com/zcstarr/spec-types/generated/packages/go", goVersion: "1.24.5" }, -): string => `module ${opts.module}\n\ngo ${opts.goVersion}\n`; + version?: string, +): string => { + const versionComment = version ? ` // ${version}` : ""; + return `module ${opts.module}${versionComment}\n\ngo ${opts.goVersion}\n`; +}; export interface PyProjectTomlOptions { name: string; diff --git a/src/index.ts b/src/index.ts index ac37478..fc7a400 100644 --- a/src/index.ts +++ b/src/index.ts @@ -94,9 +94,11 @@ const buildPackageAssetsCache = async (basePath: string): Promise<GetPackageAsse changelogContents: await tryRead(`${basePath}/py/CHANGELOG.md`, ""), }; - // go - no version in go.mod, uses git tags + // go - version stored as comment on module line: `module foo // v1.2.3` + const goModRaw = await tryRead(`${basePath}/go/go.mod`, ""); + const goVersionMatch = goModRaw.match(/^module\s+\S+\s+\/\/\s*(v\S+)/m); cache["go"] = { - version: "", + version: goVersionMatch?.[1] ?? "", changelogContents: await tryRead(`${basePath}/go/CHANGELOG.md`, ""), }; @@ -223,7 +225,7 @@ const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/go.mod`, - content: buildGoMod(), + content: buildGoMod(undefined, assets.version || undefined), }, { type: "write", From 918164c3dcbb5648d2069872bf4f742f3707b390 Mon Sep 17 00:00:00 2001 From: GitHub Actions <github-actions@github.com> Date: Fri, 20 Feb 2026 23:35:18 +0000 Subject: [PATCH 37/46] chore: prepare release --- generated/packages/py/CHANGELOG.md | 20 ++++++++++++++++++++ generated/packages/py/pyproject.toml | 2 +- generated/packages/rs/CHANGELOG.md | 20 ++++++++++++++++++++ generated/packages/rs/Cargo.toml | 2 +- generated/packages/ts/CHANGELOG.md | 20 ++++++++++++++++++++ generated/packages/ts/package.json | 2 +- 6 files changed, 63 insertions(+), 3 deletions(-) diff --git a/generated/packages/py/CHANGELOG.md b/generated/packages/py/CHANGELOG.md index 88d15f9..c575b73 100644 --- a/generated/packages/py/CHANGELOG.md +++ b/generated/packages/py/CHANGELOG.md @@ -1,4 +1,24 @@ # Changelog +## 0.0.2 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) + ## 0.0.1 (2026-02-20) ### Features diff --git a/generated/packages/py/pyproject.toml b/generated/packages/py/pyproject.toml index 7646317..b74155f 100644 --- a/generated/packages/py/pyproject.toml +++ b/generated/packages/py/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "open-rpc-spec-types" -version = "0.0.1" +version = "0.0.2" description = "Generated OpenRPC specification types" license = "Apache-2.0" requires-python = ">=3.12" diff --git a/generated/packages/rs/CHANGELOG.md b/generated/packages/rs/CHANGELOG.md index 88d15f9..c575b73 100644 --- a/generated/packages/rs/CHANGELOG.md +++ b/generated/packages/rs/CHANGELOG.md @@ -1,4 +1,24 @@ # Changelog +## 0.0.2 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) + ## 0.0.1 (2026-02-20) ### Features diff --git a/generated/packages/rs/Cargo.toml b/generated/packages/rs/Cargo.toml index cb1499d..17bef39 100644 --- a/generated/packages/rs/Cargo.toml +++ b/generated/packages/rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "open-rpc-spec-types" -version = "0.0.1" +version = "0.0.2" edition = "2021" description = "Generated OpenRPC specification types" license = "Apache-2.0" diff --git a/generated/packages/ts/CHANGELOG.md b/generated/packages/ts/CHANGELOG.md index 88d15f9..c575b73 100644 --- a/generated/packages/ts/CHANGELOG.md +++ b/generated/packages/ts/CHANGELOG.md @@ -1,4 +1,24 @@ # Changelog +## 0.0.2 (2026-02-20) + +### Features + +- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) +- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) +- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) + +### Fixes + +- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) +- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) +- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) +- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) +- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) +- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) +- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) +- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) +- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) + ## 0.0.1 (2026-02-20) ### Features diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index dee73c1..1d0b54f 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -1,6 +1,6 @@ { "name": "test-open-rpc-spec-types", - "version": "0.0.1", + "version": "0.0.2", "type": "module", "module": "index.ts", "scripts": { From 4d4884080bc16abcce35865efb0957dfb9105be9 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 15:50:04 -0800 Subject: [PATCH 38/46] chore(ts): fix auth on ts publication --- .github/workflows/release.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85c19d8..58969d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,9 +55,10 @@ jobs: run: bun publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} publish-py: - if: true # set to false to skip PyPI publish + if: false # set to false to skip PyPI publish needs: create-release runs-on: ubuntu-latest permissions: @@ -82,7 +83,7 @@ jobs: packages-dir: generated/packages/py/dist/ publish-rs: - if: true # set to false to skip crates.io publish + if: false # set to false to skip crates.io publish needs: create-release runs-on: ubuntu-latest steps: From bf43eecb7e4a84b52581b594d9d708e383646f48 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 15:55:11 -0800 Subject: [PATCH 39/46] fix(ts): forced bump --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58969d7..27151ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: - uses: oven-sh/setup-bun@v2 - - name: Install dependencies + - name: Install dependencies (TS) working-directory: generated/packages/ts run: bun install From 4d8ed9fc01f732aae2b98f2e9ec98b02703b0156 Mon Sep 17 00:00:00 2001 From: GitHub Actions <github-actions@github.com> Date: Fri, 20 Feb 2026 23:56:35 +0000 Subject: [PATCH 40/46] chore: prepare release --- generated/packages/ts/CHANGELOG.md | 6 ++++++ generated/packages/ts/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/generated/packages/ts/CHANGELOG.md b/generated/packages/ts/CHANGELOG.md index c575b73..4cb06b6 100644 --- a/generated/packages/ts/CHANGELOG.md +++ b/generated/packages/ts/CHANGELOG.md @@ -1,4 +1,10 @@ # Changelog +## 0.0.3 (2026-02-20) + +### Fixes + +- forced bump ([`bf43eec`](https://github.com/zcstarr/spec-types/commit/bf43eec)) + ## 0.0.2 (2026-02-20) ### Features diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index 1d0b54f..8a364ca 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -1,6 +1,6 @@ { "name": "test-open-rpc-spec-types", - "version": "0.0.2", + "version": "0.0.3", "type": "module", "module": "index.ts", "scripts": { From c546a9277634106d311cf1693fd92a2b122a9ea3 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Fri, 20 Feb 2026 16:05:46 -0800 Subject: [PATCH 41/46] fix(ts): switch to npm publish --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 27151ef..85dbc5f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,7 @@ jobs: - name: Publish to npm working-directory: generated/packages/ts - run: bun publish --access public + run: npm publish --access public env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} BUN_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From 7cd6e762c69d280a1d1e0142b4824b74b7d8d733 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Tue, 24 Feb 2026 15:47:07 -0800 Subject: [PATCH 42/46] chore: udpate all packages to use prod package --- bun.lock | 10 +++++----- generated/packages/ts/bun.lock | 19 ++++++++++++++++++ generated/packages/ts/index.d.ts | 2 +- generated/packages/ts/index.js | 2 +- generated/packages/ts/index.ts | 2 +- generated/packages/ts/package.json | 4 ++-- package.json | 8 ++++---- prepare_release.yml | 27 +++++++++++++++++++++++++ release.yml | 32 ++++++++++++++++++++++++++++++ src/assets.ts | 4 ++-- src/index.ts | 6 +++--- test-builds.sh | 6 +++--- 12 files changed, 100 insertions(+), 22 deletions(-) create mode 100644 generated/packages/ts/bun.lock create mode 100644 prepare_release.yml create mode 100644 release.yml diff --git a/bun.lock b/bun.lock index 595325a..f5a194b 100644 --- a/bun.lock +++ b/bun.lock @@ -5,9 +5,7 @@ "name": "spec-types", "dependencies": { "@json-schema-tools/transpiler": "^1.10.5", - "eslint": "^10.0.0", - "eslint-config-prettier": "^10.1.8", - "test-open-rpc-spec": "^1.6.1", + "@open-rpc/spec": "^1.4.0", }, "devDependencies": { "@iarna/toml": "^2.2.5", @@ -16,6 +14,8 @@ "@types/bun": "latest", "@types/node": "^25.3.0", "@typescript-eslint/eslint-plugin": "^8.55.0", + "eslint": "^10.0.0", + "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.5", "prettier": "^3.8.1", "typescript": "^5.9.3", @@ -65,6 +65,8 @@ "@json-schema-tools/traverse": ["@json-schema-tools/traverse@1.11.0", "", {}, "sha512-GWQRiXXsbt5ZuewItpW2nqB/D0x4pKWi6XXOwoh1wvmsU/tQSq/rKzpgGvOHTe6v30TYDwZYxuwnRnArIsUzLQ=="], + "@open-rpc/spec": ["@open-rpc/spec@1.4.0", "", {}, "sha512-PbfLgGMJZNUurFLFmu+5KU5CwQ6gKto3eLP8oVZh4Onf+paQkR/4L3/SYU8bqGwatMyXiqYwtXRjE6cenQkQ+g=="], + "@pkgr/core": ["@pkgr/core@0.2.9", "", {}, "sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA=="], "@types/bun": ["@types/bun@1.3.9", "", { "dependencies": { "bun-types": "1.3.9" } }, "sha512-KQ571yULOdWJiMH+RIWIOZ7B2RXQGpL1YQrBtLIV3FqDcCu6FsbFUBwhdKUlCKUpS3PJDsHlJ1QKlpxoVR+xtw=="], @@ -229,8 +231,6 @@ "synckit": ["synckit@0.11.12", "", { "dependencies": { "@pkgr/core": "^0.2.9" } }, "sha512-Bh7QjT8/SuKUIfObSXNHNSK6WHo6J1tHCqJsuaFDP7gP0fkzSfTxI8y85JrppZ0h8l0maIgc2tfuZQ6/t3GtnQ=="], - "test-open-rpc-spec": ["test-open-rpc-spec@1.6.1", "", {}, "sha512-5tS4VA3u1S+XeAlb29MGRGlIgcIfnOlmrjZBAKsjKdhcG5qMZG0SuBZa+TXEgzxhQJzYLGwRX5G0MVf8JPdaEA=="], - "tinyglobby": ["tinyglobby@0.2.15", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.3" } }, "sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ=="], "tr46": ["tr46@0.0.3", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="], diff --git a/generated/packages/ts/bun.lock b/generated/packages/ts/bun.lock new file mode 100644 index 0000000..c3e4c85 --- /dev/null +++ b/generated/packages/ts/bun.lock @@ -0,0 +1,19 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "@open-rpc/spec-types", + "dependencies": { + "@open-rpc/spec": "1.4.0", + }, + "devDependencies": { + "typescript": "^5.0.0", + }, + }, + }, + "packages": { + "@open-rpc/spec": ["@open-rpc/spec@1.4.0", "", {}, "sha512-PbfLgGMJZNUurFLFmu+5KU5CwQ6gKto3eLP8oVZh4Onf+paQkR/4L3/SYU8bqGwatMyXiqYwtXRjE6cenQkQ+g=="], + + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + } +} diff --git a/generated/packages/ts/index.d.ts b/generated/packages/ts/index.d.ts index 49172de..c461c28 100644 --- a/generated/packages/ts/index.d.ts +++ b/generated/packages/ts/index.d.ts @@ -1,4 +1,4 @@ import type * as V1_4 from "./1_4/index.js"; import type * as V1_3 from "./1_3/index.js"; export type { V1_4, V1_3 }; -export * as spec from "test-open-rpc-spec"; +export * as spec from "@open-rpc/spec"; diff --git a/generated/packages/ts/index.js b/generated/packages/ts/index.js index d20edbd..3ced1e2 100644 --- a/generated/packages/ts/index.js +++ b/generated/packages/ts/index.js @@ -1 +1 @@ -export * as spec from "test-open-rpc-spec"; +export * as spec from "@open-rpc/spec"; diff --git a/generated/packages/ts/index.ts b/generated/packages/ts/index.ts index e43b1dd..5f1d33c 100644 --- a/generated/packages/ts/index.ts +++ b/generated/packages/ts/index.ts @@ -2,4 +2,4 @@ import type * as V1_4 from "./1_4/index.js"; import type * as V1_3 from "./1_3/index.js"; export type { V1_4, V1_3 } -export * as spec from "test-open-rpc-spec"; \ No newline at end of file +export * as spec from "@open-rpc/spec"; \ No newline at end of file diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index 8a364ca..ca1378a 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -1,5 +1,5 @@ { - "name": "test-open-rpc-spec-types", + "name": "@open-rpc/spec-types", "version": "0.0.3", "type": "module", "module": "index.ts", @@ -28,7 +28,7 @@ } }, "dependencies": { - "test-open-rpc-spec": "^1.6.1" + "@open-rpc/spec": "1.4.0" }, "devDependencies": { "typescript": "^5.0.0" diff --git a/package.json b/package.json index 97c9bdb..e84a5aa 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "test-open-rpc-spec-types", + "name": "@open-rpc/spec-types", "module": "index.ts", "type": "module", "scripts": { @@ -14,12 +14,12 @@ "@typescript-eslint/eslint-plugin": "^8.55.0", "eslint-plugin-prettier": "^5.5.5", "prettier": "^3.8.1", + "eslint": "^10.0.0", + "eslint-config-prettier": "^10.1.8", "typescript": "^5.9.3" }, "dependencies": { "@json-schema-tools/transpiler": "^1.10.5", - "eslint": "^10.0.0", - "eslint-config-prettier": "^10.1.8", - "test-open-rpc-spec": "^1.6.1" + "@open-rpc/spec": "^1.4.0" } } \ No newline at end of file diff --git a/prepare_release.yml b/prepare_release.yml new file mode 100644 index 0000000..3b0adcc --- /dev/null +++ b/prepare_release.yml @@ -0,0 +1,27 @@ +name: Create Release PR + +on: + push: + branches: [master] + +jobs: + prepare-release: + if: "!contains(github.event.head_commit.message, 'chore: prepare release')" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT }} + - name: Configure Git + run: | + git config --global user.name "GitHub Actions" + git config --global user.email "github-actions@github.com" + - name: Install Knope + uses: knope-dev/action@v2.1.2 + with: + version: 0.22.3 + - run: knope prepare-release --verbose + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + continue-on-error: true diff --git a/release.yml b/release.yml new file mode 100644 index 0000000..1e87aea --- /dev/null +++ b/release.yml @@ -0,0 +1,32 @@ +name: Release + +on: + pull_request: + types: [closed] + branches: [master] + +jobs: + release: + if: github.head_ref == 'release' && github.event.pull_request.merged == true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Knope + uses: knope-dev/action@v2.1.2 + with: + version: 0.22.3 + - run: knope release --verbose + env: + GITHUB_TOKEN: ${{ secrets.PAT }} + - uses: actions/setup-node@v4 + with: + node-version: "24" + registry-url: "https://registry.npmjs.org" + - uses: oven-sh/setup-bun@v2 + - run: bun install + - run: bun run build:bundle + - run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/src/assets.ts b/src/assets.ts index 9ead9f5..f4b4f8f 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -11,7 +11,7 @@ export interface CargoTomlOptions { export const buildCargoToml = ( schemaNames: string[], - opts: CargoTomlOptions = { name: "test-open-rpc-spec-types", version: "0.0.0" }, + opts: CargoTomlOptions = { name: "@open-rpc/spec-types", version: "0.0.0" }, ): object => ({ package: { name: opts.name, @@ -46,7 +46,7 @@ export interface PyProjectTomlOptions { } export const buildPyProjectToml = ( - opts: PyProjectTomlOptions = { name: "test-open-rpc-spec-types", version: "0.0.0" }, + opts: PyProjectTomlOptions = { name: "@open-rpc/spec-types", version: "0.0.0" }, ): object => ({ "build-system": { requires: ["hatchling"], diff --git a/src/index.ts b/src/index.ts index fc7a400..db04193 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import { buildPackageJson, buildTsConfig, buildCargoToml, buildGoMod, buildPyPro import {readFile, writeFile, mkdir, rm} from "fs/promises"; import Dereferencer from "@json-schema-tools/dereferencer"; import toml from "@iarna/toml"; -import {getAllSchemas} from "test-open-rpc-spec" +import {getAllSchemas} from "@open-rpc/spec" import ts from "typescript"; import { readFileSync } from "node:fs"; @@ -140,7 +140,7 @@ const getPackageJsonSpecDependency = (packageName: string): Record<string, strin // Operations generators const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { - const specPackageName = "test-open-rpc-spec"; + const specPackageName = "@open-rpc/spec"; const deps = getPackageJsonSpecDependency(specPackageName) const ops: Op[] = [{ type: "rm", path: `${outpath}` }, { type: "mkdir", path: outpath }] return ops.concat(schemasNames.flatMap((name) => { @@ -150,7 +150,7 @@ const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames,specPackageName) } ]; })).concat([ - { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "test-open-rpc-spec-types", version: assets.version, dependencies: deps }), null, 2) }, + { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "@open-rpc/spec-types", version: assets.version, dependencies: deps }), null, 2) }, { type: "write", path: `${outpath}/tsconfig.json`, content: JSON.stringify(buildTsConfig(), null, 2) }, { type: "write", path: `${outpath}/CHANGELOG.md`, content: assets.changelogContents }, { type: "compile", fileNames: [ diff --git a/test-builds.sh b/test-builds.sh index 3a4338c..7091f7d 100755 --- a/test-builds.sh +++ b/test-builds.sh @@ -15,9 +15,9 @@ test_ts() { cd "$tmp" npm init -y > /dev/null 2>&1 - npm install ./test-open-rpc-spec-types-*.tgz + npm install ./open-rpc-spec-types-*.tgz - node -e "import('test-open-rpc-spec-types').then(m => console.log('TS OK:', Object.keys(m)))" + node -e "import('@open-rpc/spec-types').then(m => console.log('TS OK:', Object.keys(m)))" } # --- Go --- @@ -39,7 +39,7 @@ test_py() { cd "$tmp" python3.12 -m venv "$tmp/.venv" "$tmp/.venv/bin/python" -m pip install . --quiet - "$tmp/.venv/bin/python" -c "from test_open_rpc_spec_types import v1_4; print('Py OK')" + "$tmp/.venv/bin/python" -c "from open_rpc_spec_types import v1_4; print('Py OK')" } # --- Rust --- From f58193b7671859b4136bec89a6a432fb67cc1562 Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Tue, 24 Feb 2026 15:47:36 -0800 Subject: [PATCH 43/46] chore: rm dead asset --- test-docker.sh | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100755 test-docker.sh diff --git a/test-docker.sh b/test-docker.sh deleted file mode 100755 index fd3dc40..0000000 --- a/test-docker.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -cd "$(dirname "$0")" - -echo "=== Running install tests in Docker ===" - -docker compose -f docker-compose.test.yml up \ - --remove-orphans \ - --force-recreate 2>&1 - -FAILED=$(docker compose -f docker-compose.test.yml ps -a --format '{{.Name}} {{.ExitCode}}' | grep -v ' 0$' || true) - -docker compose -f docker-compose.test.yml down --volumes --remove-orphans 2>/dev/null - -if [ -n "$FAILED" ]; then - echo "" - echo "=== FAILED ===" - echo "$FAILED" - exit 1 -else - echo "" - echo "=== All install tests passed ===" -fi From 32277969a7a681e2c5db7c035229310bcbd385fd Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Tue, 24 Feb 2026 16:05:40 -0800 Subject: [PATCH 44/46] chore: lint --- .github/workflows/check-generated.yml | 3 + bun.lock | 6 + eslintrc.mjs => eslint.config.mjs | 1 + generated/packages/ts/1_3/index.ts | 91 +++++-- generated/packages/ts/1_4/index.ts | 69 ++++-- generated/packages/ts/index.ts | 4 +- package.json | 9 +- src/assets.ts | 16 +- src/index.ts | 328 +++++++++++++++++++------- src/util.ts | 44 ++-- 10 files changed, 423 insertions(+), 148 deletions(-) rename eslintrc.mjs => eslint.config.mjs (99%) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 1513dcf..19e8cfb 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -17,6 +17,9 @@ jobs: - name: Install dependencies run: bun install + - name: Lint + run: bun run lint + - name: Regenerate types run: bun run generate diff --git a/bun.lock b/bun.lock index f5a194b..c8a2ef2 100644 --- a/bun.lock +++ b/bun.lock @@ -8,6 +8,7 @@ "@open-rpc/spec": "^1.4.0", }, "devDependencies": { + "@eslint/js": "^10.0.1", "@iarna/toml": "^2.2.5", "@json-schema-tools/dereferencer": "^1.6.3", "@json-schema-tools/meta-schema": "^1.8.0", @@ -17,6 +18,7 @@ "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-prettier": "^5.5.5", + "globals": "^17.3.0", "prettier": "^3.8.1", "typescript": "^5.9.3", }, @@ -33,6 +35,8 @@ "@eslint/core": ["@eslint/core@1.1.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-/nr9K9wkr3P1EzFTdFdMoLuo1PmIxjmwvPozwoSodjNBdefGujXQUF93u1DDZpEaTuDvMsIQddsd35BwtrW9Xw=="], + "@eslint/js": ["@eslint/js@10.0.1", "", { "peerDependencies": { "eslint": "^10.0.0" }, "optionalPeers": ["eslint"] }, "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA=="], + "@eslint/object-schema": ["@eslint/object-schema@3.0.1", "", {}, "sha512-P9cq2dpr+LU8j3qbLygLcSZrl2/ds/pUpfnHNNuk5HW7mnngHs+6WSq5C9mO3rqRX8A1poxqLTC9cu0KOyJlBg=="], "@eslint/plugin-kit": ["@eslint/plugin-kit@0.6.0", "", { "dependencies": { "@eslint/core": "^1.1.0", "levn": "^0.4.1" } }, "sha512-bIZEUzOI1jkhviX2cp5vNyXQc6olzb2ohewQubuYlMXZ2Q/XjBO0x0XhGPvc9fjSIiUN0vw+0hq53BJ4eQSJKQ=="], @@ -161,6 +165,8 @@ "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], + "globals": ["globals@17.3.0", "", {}, "sha512-yMqGUQVVCkD4tqjOJf3TnrvaaHDMYp4VlUSObbkIiuCPe/ofdMBFIAcBbCSRFWOnos6qRiTVStDwqPLUclaxIw=="], + "ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="], "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], diff --git a/eslintrc.mjs b/eslint.config.mjs similarity index 99% rename from eslintrc.mjs rename to eslint.config.mjs index e603c27..a33e775 100644 --- a/eslintrc.mjs +++ b/eslint.config.mjs @@ -18,6 +18,7 @@ export default [ ignores: [ "package.json", "node_modules/", + "generated/", "**/dist/", "dist/", "docs/", // This will now work diff --git a/generated/packages/ts/1_3/index.ts b/generated/packages/ts/1_3/index.ts index 4550a42..8547e38 100644 --- a/generated/packages/ts/1_3/index.ts +++ b/generated/packages/ts/1_3/index.ts @@ -1,4 +1,30 @@ -export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc0" | "1.0.0-rc1"; +export type Openrpc = + | "1.3.2" + | "1.3.1" + | "1.3.0" + | "1.2.6" + | "1.2.5" + | "1.2.4" + | "1.2.3" + | "1.2.2" + | "1.2.1" + | "1.2.0" + | "1.1.12" + | "1.1.11" + | "1.1.10" + | "1.1.9" + | "1.1.8" + | "1.1.7" + | "1.1.6" + | "1.1.5" + | "1.1.4" + | "1.1.3" + | "1.1.2" + | "1.1.1" + | "1.1.0" + | "1.0.0" + | "1.0.0-rc0" + | "1.0.0-rc1"; export type InfoObjectProperties = string; export type InfoObjectDescription = string; export type InfoObjectTermsOfService = string; @@ -55,7 +81,9 @@ export interface ServerObjectVariable { enum?: ServerObjectVariableEnum; [k: string]: any; } -export interface ServerObjectVariables { [key: string]: any; } +export interface ServerObjectVariables { + [key: string]: any; +} export interface ServerObject { url: ServerObjectUrl; name?: ServerObjectName; @@ -145,24 +173,39 @@ export type StringArray = StringDoaGddGA[]; * @default {} * */ -export interface Definitions { [key: string]: any; } +export interface Definitions { + [key: string]: any; +} /** * * @default {} * */ -export interface Properties { [key: string]: any; } +export interface Properties { + [key: string]: any; +} export type PropertyNames = any; /** * * @default {} * */ -export interface PatternProperties { [key: string]: any; } +export interface PatternProperties { + [key: string]: any; +} export type DependenciesSet = JSONSchema | StringArray; -export interface Dependencies { [key: string]: any; } +export interface Dependencies { + [key: string]: any; +} export type Enum = AlwaysTrue[]; -export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type SimpleTypes = + | "array" + | "boolean" + | "integer" + | "null" + | "number" + | "object" + | "string"; export type ArrayOfSimpleTypes = SimpleTypes[]; export type Type = SimpleTypes | ArrayOfSimpleTypes; export type Format = string; @@ -239,7 +282,9 @@ export interface ContentDescriptorObject { deprecated?: ContentDescriptorObjectDeprecated; [regex: string]: SpecificationExtension | any; } -export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +export type ContentDescriptorOrReference = + | ContentDescriptorObject + | ReferenceObject; export type MethodObjectParams = ContentDescriptorOrReference[]; export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; /** @@ -345,13 +390,27 @@ export interface MethodObject { } export type MethodOrReference = MethodObject | ReferenceObject; export type Methods = MethodOrReference[]; -export interface SchemaComponents { [key: string]: any; } -export interface LinkComponents { [key: string]: any; } -export interface ErrorComponents { [key: string]: any; } -export interface ExampleComponents { [key: string]: any; } -export interface ExamplePairingComponents { [key: string]: any; } -export interface ContentDescriptorComponents { [key: string]: any; } -export interface TagComponents { [key: string]: any; } +export interface SchemaComponents { + [key: string]: any; +} +export interface LinkComponents { + [key: string]: any; +} +export interface ErrorComponents { + [key: string]: any; +} +export interface ExampleComponents { + [key: string]: any; +} +export interface ExamplePairingComponents { + [key: string]: any; +} +export interface ContentDescriptorComponents { + [key: string]: any; +} +export interface TagComponents { + [key: string]: any; +} export interface Components { schemas?: SchemaComponents; links?: LinkComponents; @@ -379,4 +438,4 @@ export interface OpenrpcDocument { components?: Components; $schema?: MetaSchema; [regex: string]: SpecificationExtension | any; -} \ No newline at end of file +} diff --git a/generated/packages/ts/1_4/index.ts b/generated/packages/ts/1_4/index.ts index 2838073..7ad27e0 100644 --- a/generated/packages/ts/1_4/index.ts +++ b/generated/packages/ts/1_4/index.ts @@ -177,7 +177,9 @@ export interface ServerObjectVariable { * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. * */ -export interface ServerObjectVariables { [key: string]: any; } +export interface ServerObjectVariables { + [key: string]: any; +} /** * * A object representing a Server @@ -194,7 +196,7 @@ export interface ServerObject { type AlwaysFalse = any; /** * - * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. * */ export type Servers = ServerObject[]; @@ -324,24 +326,39 @@ export type StringArray = StringDoaGddGA[]; * @default {} * */ -export interface Definitions { [key: string]: any; } +export interface Definitions { + [key: string]: any; +} /** * * @default {} * */ -export interface Properties { [key: string]: any; } +export interface Properties { + [key: string]: any; +} export type PropertyNames = any; /** * * @default {} * */ -export interface PatternProperties { [key: string]: any; } +export interface PatternProperties { + [key: string]: any; +} export type DependenciesSet = JSONSchema | StringArray; -export interface Dependencies { [key: string]: any; } +export interface Dependencies { + [key: string]: any; +} export type Enum = AlwaysTrue[]; -export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; +export type SimpleTypes = + | "array" + | "boolean" + | "integer" + | "null" + | "number" + | "object" + | "string"; export type ArrayOfSimpleTypes = SimpleTypes[]; export type Type = SimpleTypes | ArrayOfSimpleTypes; export type Format = string; @@ -402,7 +419,9 @@ export interface JSONSchemaObject { * @default {} * */ -export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; +export type ContentDescriptorObjectSchema = + | JSONSchemaObject + | JSONSchemaBoolean; /** * * Determines if the content is a required field. Default value is `false`. @@ -429,7 +448,9 @@ export interface ContentDescriptorObject { deprecated?: ContentDescriptorObjectDeprecated; [regex: string]: SpecificationExtension | any; } -export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; +export type ContentDescriptorOrReference = + | ContentDescriptorObject + | ReferenceObject; /** * * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. @@ -652,43 +673,57 @@ export type Methods = MethodOrReference[]; * An object to hold reusable [Schema Objects](#schema-object). * */ -export interface SchemaComponents { [key: string]: any; } +export interface SchemaComponents { + [key: string]: any; +} /** * * An object to hold reusable [Link Objects](#link-object). * */ -export interface LinkComponents { [key: string]: any; } +export interface LinkComponents { + [key: string]: any; +} /** * * An object to hold reusable [Error Objects](#error-object). * */ -export interface ErrorComponents { [key: string]: any; } +export interface ErrorComponents { + [key: string]: any; +} /** * * An object to hold reusable [Example Objects](#example-object). * */ -export interface ExampleComponents { [key: string]: any; } +export interface ExampleComponents { + [key: string]: any; +} /** * * An object to hold reusable [Example Pairing Objects](#example-pairing-object). * */ -export interface ExamplePairingComponents { [key: string]: any; } +export interface ExamplePairingComponents { + [key: string]: any; +} /** * * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). * */ -export interface ContentDescriptorComponents { [key: string]: any; } +export interface ContentDescriptorComponents { + [key: string]: any; +} /** * * An object to hold reusable [Tag Objects](#tag-object). * */ -export interface TagComponents { [key: string]: any; } +export interface TagComponents { + [key: string]: any; +} /** * * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. @@ -721,4 +756,4 @@ export interface OpenrpcDocument { components?: Components; $schema?: MetaSchema; [regex: string]: SpecificationExtension | any; -} \ No newline at end of file +} diff --git a/generated/packages/ts/index.ts b/generated/packages/ts/index.ts index 5f1d33c..e880e40 100644 --- a/generated/packages/ts/index.ts +++ b/generated/packages/ts/index.ts @@ -1,5 +1,5 @@ import type * as V1_4 from "./1_4/index.js"; import type * as V1_3 from "./1_3/index.js"; -export type { V1_4, V1_3 } -export * as spec from "@open-rpc/spec"; \ No newline at end of file +export type { V1_4, V1_3 }; +export * as spec from "@open-rpc/spec"; diff --git a/package.json b/package.json index e84a5aa..b2118c4 100644 --- a/package.json +++ b/package.json @@ -3,19 +3,22 @@ "module": "index.ts", "type": "module", "scripts": { - "generate": "bun run src/index.ts" + "generate": "bun run src/index.ts", + "lint": "bun run eslint ." }, "devDependencies": { + "@eslint/js": "^10.0.1", "@iarna/toml": "^2.2.5", "@json-schema-tools/dereferencer": "^1.6.3", "@json-schema-tools/meta-schema": "^1.8.0", "@types/bun": "latest", "@types/node": "^25.3.0", "@typescript-eslint/eslint-plugin": "^8.55.0", - "eslint-plugin-prettier": "^5.5.5", - "prettier": "^3.8.1", "eslint": "^10.0.0", "eslint-config-prettier": "^10.1.8", + "eslint-plugin-prettier": "^5.5.5", + "globals": "^17.3.0", + "prettier": "^3.8.1", "typescript": "^5.9.3" }, "dependencies": { diff --git a/src/assets.ts b/src/assets.ts index f4b4f8f..4b6c6a6 100644 --- a/src/assets.ts +++ b/src/assets.ts @@ -33,7 +33,10 @@ export interface GoModOptions { } export const buildGoMod = ( - opts: GoModOptions = { module: "github.com/zcstarr/spec-types/generated/packages/go", goVersion: "1.24.5" }, + opts: GoModOptions = { + module: "github.com/zcstarr/spec-types/generated/packages/go", + goVersion: "1.24.5", + }, version?: string, ): string => { const versionComment = version ? ` // ${version}` : ""; @@ -46,7 +49,10 @@ export interface PyProjectTomlOptions { } export const buildPyProjectToml = ( - opts: PyProjectTomlOptions = { name: "@open-rpc/spec-types", version: "0.0.0" }, + opts: PyProjectTomlOptions = { + name: "@open-rpc/spec-types", + version: "0.0.0", + }, ): object => ({ "build-system": { requires: ["hatchling"], @@ -76,7 +82,11 @@ export const buildTsConfig = () => ({ export const buildPackageJson = ( schemaNames: string[], - opts: PackageJsonOptions = { name: "@open-rpc/spec-types", version: "0.0.0", dependencies: {} }, + opts: PackageJsonOptions = { + name: "@open-rpc/spec-types", + version: "0.0.0", + dependencies: {}, + }, ) => { const subpathExports = Object.fromEntries( schemaNames.map((name) => [ diff --git a/src/index.ts b/src/index.ts index db04193..419b67a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,17 +1,21 @@ import Transpiler from "@json-schema-tools/transpiler"; import { compileTypescript } from "./util"; -import { buildPackageJson, buildTsConfig, buildCargoToml, buildGoMod, buildPyProjectToml } from "./assets.ts"; -import {readFile, writeFile, mkdir, rm} from "fs/promises"; +import { + buildPackageJson, + buildTsConfig, + buildCargoToml, + buildGoMod, + buildPyProjectToml, +} from "./assets.ts"; +import { readFile, writeFile, mkdir, rm } from "fs/promises"; import Dereferencer from "@json-schema-tools/dereferencer"; import toml from "@iarna/toml"; -import {getAllSchemas} from "@open-rpc/spec" +import { getAllSchemas } from "@open-rpc/spec"; import ts from "typescript"; import { readFileSync } from "node:fs"; - - interface GetTranspiler { - (name: string): Transpiler + (name: string): Transpiler; } // Package assets preserved across rebuilds @@ -24,53 +28,72 @@ interface PackageAssets { type GetPackageAssets = (lang: Lang) => PackageAssets; -// Operation types for the system -type Op = +// Operation types for the system +type Op = | { - "type": "write"; path: string; content: string; - } + type: "write"; + path: string; + content: string; + } | { - "type": "rm"; path: string; - } + type: "rm"; + path: string; + } | { - "type": "mkdir"; path: string; - } + type: "mkdir"; + path: string; + } | { - "type": "compile"; fileNames: string[]; options: ts.CompilerOptions | any, lang: Lang; - } - - -// Programatically construct all the assets tomls pyprojects generate them -// then we will use Knope to have the changesets and versions propogated and committed + type: "compile"; + fileNames: string[]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + options: ts.CompilerOptions | any; + lang: Lang; + }; + +// Programatically construct all the assets tomls pyprojects generate them +// then we will use Knope to have the changesets and versions propogated and committed // this will then allow us to have nice generated assets that can be used in the spec like changesets -const buildTranspilerCache = async (schemas: Record<string, any>): Promise<GetTranspiler> => { +const buildTranspilerCache = async ( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + schemas: Record<string, any>, +): Promise<GetTranspiler> => { const cache: Record<string, Transpiler> = {}; - for(const [name, schema] of Object.entries(schemas)) { + for (const [name, schema] of Object.entries(schemas)) { try { const dereffer = new Dereferencer(JSON.parse(JSON.stringify(schema))); const dereffedSchema = await dereffer.resolve(); cache[name] = new Transpiler(dereffedSchema); - }catch(e: any) { - throw new Error(`Failed to get transpiler for ${name}: ${e.message}`); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } catch (e: any) { + throw new Error(`Failed to get transpiler for ${name}: ${e.message}`, { + cause: e, + }); } } return (name: string) => { const transpiler = cache[name]; - if(!transpiler) { + if (!transpiler) { throw new Error(`Transpiler for ${name} not found`); } return transpiler; - } -} + }; +}; // Reads existing versions and changelogs before the generator wipes directories -const buildPackageAssetsCache = async (basePath: string): Promise<GetPackageAssets> => { +const buildPackageAssetsCache = async ( + basePath: string, +): Promise<GetPackageAssets> => { const defaults: PackageAssets = { version: "0.0.0", changelogContents: "" }; const cache: Record<string, PackageAssets> = {}; const tryRead = async (p: string, fallback: string): Promise<string> => { - try { return await readFile(p, "utf-8"); } catch { return fallback; } + try { + return await readFile(p, "utf-8"); + } catch { + return fallback; + } }; // ts - read version from package.json @@ -83,14 +106,20 @@ const buildPackageAssetsCache = async (basePath: string): Promise<GetPackageAsse // rs - read version from Cargo.toml const rsRaw = await tryRead(`${basePath}/rs/Cargo.toml`, ""); cache["rs"] = { - version: rsRaw ? ((toml.parse(rsRaw) as any)?.package?.version ?? defaults.version) : defaults.version, + version: rsRaw + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + ((toml.parse(rsRaw) as any)?.package?.version ?? defaults.version) + : defaults.version, changelogContents: await tryRead(`${basePath}/rs/CHANGELOG.md`, ""), }; // py - read version from pyproject.toml const pyRaw = await tryRead(`${basePath}/py/pyproject.toml`, ""); cache["py"] = { - version: pyRaw ? ((toml.parse(pyRaw) as any)?.project?.version ?? defaults.version) : defaults.version, + version: pyRaw + ? // eslint-disable-next-line @typescript-eslint/no-explicit-any + ((toml.parse(pyRaw) as any)?.project?.version ?? defaults.version) + : defaults.version, changelogContents: await tryRead(`${basePath}/py/CHANGELOG.md`, ""), }; @@ -107,9 +136,13 @@ const buildPackageAssetsCache = async (basePath: string): Promise<GetPackageAsse // Index file generators -const tsIndexFile = (schemaNames: string[], specPackageName: string): string => { - const imports = schemaNames - .map((name) => `import type * as V${name} from "./${name}/index.js";`); +const tsIndexFile = ( + schemaNames: string[], + specPackageName: string, +): string => { + const imports = schemaNames.map( + (name) => `import type * as V${name} from "./${name}/index.js";`, + ); const reexport = `export type { ${schemaNames.map((name) => `V${name}`).join(", ")} }`; const reexportAll = `export * as spec from "${specPackageName}";`; @@ -119,57 +152,115 @@ const tsIndexFile = (schemaNames: string[], specPackageName: string): string => const rsLibFile = (schemaNames: string[]): string => { return schemaNames.map((name) => `pub mod v${name};`).join("\n") + "\n"; -} +}; -const goPackageFile = (name: string, goCode: string, rawSchema: string): string => { +const goPackageFile = ( + name: string, + goCode: string, + rawSchema: string, +): string => { const escaped = JSON.stringify(rawSchema); return `package v${name}\n\n${goCode}\n\nconst RawOpenrpcDocument = ${escaped}\n`; -} +}; const pyInitFile = (schemaNames: string[]): string => { return schemaNames.map((name) => `from . import v${name}`).join("\n") + "\n"; -} +}; -const getPackageJsonSpecDependency = (packageName: string): Record<string, string> => { - const selfPkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8")); +const getPackageJsonSpecDependency = ( + packageName: string, +): Record<string, string> => { + const selfPkg = JSON.parse( + readFileSync(new URL("../package.json", import.meta.url), "utf-8"), + ); const dependencyValue = selfPkg.dependencies?.[packageName]; if (!dependencyValue) throw new Error(`${packageName} not found in package.json`); return { [packageName]: dependencyValue }; -} +}; // Operations generators -const generateTsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { +const generateTsOp = ( + getTranspiler: GetTranspiler, + schemasNames: string[], + outpath: string, + assets: PackageAssets, +): Op[] => { const specPackageName = "@open-rpc/spec"; - const deps = getPackageJsonSpecDependency(specPackageName) - const ops: Op[] = [{ type: "rm", path: `${outpath}` }, { type: "mkdir", path: outpath }] - return ops.concat(schemasNames.flatMap((name) => { - return [ - { type: "mkdir", path: `${outpath}/${name}` }, - { type: "write", path: `${outpath}/${name}/index.ts`, content: getTranspiler(name).toTs() }, - { type: "write", path: `${outpath}/index.ts`, content: tsIndexFile(schemasNames,specPackageName) } - ]; - })).concat([ - { type: "write", path: `${outpath}/package.json`, content: JSON.stringify(buildPackageJson(schemasNames, { name: "@open-rpc/spec-types", version: assets.version, dependencies: deps }), null, 2) }, - { type: "write", path: `${outpath}/tsconfig.json`, content: JSON.stringify(buildTsConfig(), null, 2) }, - { type: "write", path: `${outpath}/CHANGELOG.md`, content: assets.changelogContents }, - { type: "compile", fileNames: [ - `${outpath}/index.ts`, - ...schemasNames.map((name) => `${outpath}/${name}/index.ts`), - ], options: { - target: ts.ScriptTarget.ES2022, - module: ts.ModuleKind.ES2022, - lib: ["lib.es2022.d.ts"], - moduleResolution: ts.ModuleResolutionKind.Bundler, - declaration: true, - outDir: outpath, - strict: true, - skipLibCheck: true, - }, lang: "ts" } - ]); -} + const deps = getPackageJsonSpecDependency(specPackageName); + const ops: Op[] = [ + { type: "rm", path: `${outpath}` }, + { type: "mkdir", path: outpath }, + ]; + return ops + .concat( + schemasNames.flatMap((name) => { + return [ + { type: "mkdir", path: `${outpath}/${name}` }, + { + type: "write", + path: `${outpath}/${name}/index.ts`, + content: getTranspiler(name).toTs(), + }, + { + type: "write", + path: `${outpath}/index.ts`, + content: tsIndexFile(schemasNames, specPackageName), + }, + ]; + }), + ) + .concat([ + { + type: "write", + path: `${outpath}/package.json`, + content: JSON.stringify( + buildPackageJson(schemasNames, { + name: "@open-rpc/spec-types", + version: assets.version, + dependencies: deps, + }), + null, + 2, + ), + }, + { + type: "write", + path: `${outpath}/tsconfig.json`, + content: JSON.stringify(buildTsConfig(), null, 2), + }, + { + type: "write", + path: `${outpath}/CHANGELOG.md`, + content: assets.changelogContents, + }, + { + type: "compile", + fileNames: [ + `${outpath}/index.ts`, + ...schemasNames.map((name) => `${outpath}/${name}/index.ts`), + ], + options: { + target: ts.ScriptTarget.ES2022, + module: ts.ModuleKind.ES2022, + lib: ["lib.es2022.d.ts"], + moduleResolution: ts.ModuleResolutionKind.Bundler, + declaration: true, + outDir: outpath, + strict: true, + skipLibCheck: true, + }, + lang: "ts", + }, + ]); +}; -const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { +const generateRsOp = ( + getTranspiler: GetTranspiler, + schemasNames: string[], + outpath: string, + assets: PackageAssets, +): Op[] => { const ops: Op[] = [ { type: "rm", path: outpath }, { type: "mkdir", path: outpath }, @@ -193,7 +284,13 @@ const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/Cargo.toml`, - content: toml.stringify(buildCargoToml(schemasNames, { name: "open-rpc-spec-types", version: assets.version }) as any), + content: toml.stringify( + buildCargoToml(schemasNames, { + name: "open-rpc-spec-types", + version: assets.version, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }) as any, + ), }, { type: "write", @@ -201,9 +298,15 @@ const generateRsOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp content: assets.changelogContents, }, ]); -} +}; -const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { +const generateGoOp = ( + getTranspiler: GetTranspiler, + schemasNames: string[], + outpath: string, + assets: PackageAssets, +): Op[] => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const schemas: Record<string, any> = getAllSchemas(); const ops: Op[] = [ { type: "rm", path: outpath }, @@ -217,7 +320,11 @@ const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write" as const, path: `${outpath}/v${name}/v${name}.go`, - content: goPackageFile(name, getTranspiler(name).toGo(), JSON.stringify(schemas[name])), + content: goPackageFile( + name, + getTranspiler(name).toGo(), + JSON.stringify(schemas[name]), + ), }, ]), ) @@ -233,9 +340,14 @@ const generateGoOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp content: assets.changelogContents, }, ]); -} +}; -const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outpath: string, assets: PackageAssets): Op[] => { +const generatePyOp = ( + getTranspiler: GetTranspiler, + schemasNames: string[], + outpath: string, + assets: PackageAssets, +): Op[] => { const pkg = "open_rpc_spec_types"; const ops: Op[] = [ { type: "rm", path: outpath }, @@ -260,7 +372,13 @@ const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp { type: "write", path: `${outpath}/pyproject.toml`, - content: toml.stringify(buildPyProjectToml({ name: "open-rpc-spec-types", version: assets.version }) as any), + content: toml.stringify( + buildPyProjectToml({ + name: "open-rpc-spec-types", + version: assets.version, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + }) as any, + ), }, { type: "write", @@ -268,20 +386,28 @@ const generatePyOp = (getTranspiler: GetTranspiler, schemasNames: string[], outp content: assets.changelogContents, }, ]); -} - +}; // Interpreter does the actual work const execute = async (ops: Op[]) => { for (const op of ops) { switch (op.type) { - case "write": await writeFile(op.path, op.content); break; - case "mkdir": await mkdir(op.path, { recursive: true }); break; - case "rm": await rm(op.path, { recursive: true, force: true }); break; - case "compile": { + case "write": + await writeFile(op.path, op.content); + break; + case "mkdir": + await mkdir(op.path, { recursive: true }); + break; + case "rm": + await rm(op.path, { recursive: true, force: true }); + break; + case "compile": { switch (op.lang) { - case "ts": compileTypescript(op.fileNames, op.options as ts.CompilerOptions); break; - default: throw new Error(`Unsupported language: ${op.lang}`); + case "ts": + compileTypescript(op.fileNames, op.options as ts.CompilerOptions); + break; + default: + throw new Error(`Unsupported language: ${op.lang}`); } } } @@ -293,10 +419,30 @@ const run = async () => { const getAssets = await buildPackageAssetsCache("./generated/packages"); const schemaNames = Object.keys(getAllSchemas()); - const tsOps = generateTsOp(getTranspiler, schemaNames, "./generated/packages/ts", getAssets("ts")); - const rsOps = generateRsOp(getTranspiler, schemaNames, "./generated/packages/rs", getAssets("rs")); - const goOps = generateGoOp(getTranspiler, schemaNames, "./generated/packages/go", getAssets("go")); - const pyOps = generatePyOp(getTranspiler, schemaNames, "./generated/packages/py", getAssets("py")); + const tsOps = generateTsOp( + getTranspiler, + schemaNames, + "./generated/packages/ts", + getAssets("ts"), + ); + const rsOps = generateRsOp( + getTranspiler, + schemaNames, + "./generated/packages/rs", + getAssets("rs"), + ); + const goOps = generateGoOp( + getTranspiler, + schemaNames, + "./generated/packages/go", + getAssets("go"), + ); + const pyOps = generatePyOp( + getTranspiler, + schemaNames, + "./generated/packages/py", + getAssets("py"), + ); await Promise.all([ execute(tsOps), @@ -304,8 +450,8 @@ const run = async () => { execute(goOps), execute(pyOps), ]); -} +}; if (import.meta.main) { run(); -} \ No newline at end of file +} diff --git a/src/util.ts b/src/util.ts index fc6ce96..a324ec1 100644 --- a/src/util.ts +++ b/src/util.ts @@ -1,23 +1,31 @@ -import * as ts from 'typescript'; +import * as ts from "typescript"; export const StringUtils = { - upperFirst: (str?: string): string => - str ? str.charAt(0).toUpperCase() + str.slice(1) : '', + upperFirst: (str?: string): string => + str ? str.charAt(0).toUpperCase() + str.slice(1) : "", camelCase: (str?: string): string => - str ? str - .toLowerCase() - .replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase()) : '', + str + ? str + .toLowerCase() + .replace(/[^a-zA-Z0-9]+(.)/g, (m, chr) => chr.toUpperCase()) + : "", snakeCase: (str?: string): string => - str ? str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g)! - .map((x: string) => x.toLowerCase()) - .join('_') : '' + str + ? str + .match( + /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g, + )! + .map((x: string) => x.toLowerCase()) + .join("_") + : "", }; - - -export const compileTypescript = (fileNames: string[], options: ts.CompilerOptions): void => { +export const compileTypescript = ( + fileNames: string[], + options: ts.CompilerOptions, +): void => { const program = ts.createProgram(fileNames, options); const emitResult = program.emit(); @@ -25,11 +33,15 @@ export const compileTypescript = (fileNames: string[], options: ts.CompilerOptio .getPreEmitDiagnostics(program) .concat(emitResult.diagnostics); - allDiagnostics.forEach(diagnostic => { - const message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); + allDiagnostics.forEach((diagnostic) => { + const message = ts.flattenDiagnosticMessageText( + diagnostic.messageText, + "\n", + ); + // eslint-disable-next-line no-console console.log(`${diagnostic.file?.fileName}: ${message}`); }); -} +}; // Usage /* @@ -39,4 +51,4 @@ compile(['src/index.ts'], { module: ts.ModuleKind.CommonJS, outDir: './dist' }); -*/ \ No newline at end of file +*/ From 44ec600ab9db8085ef9e6d08dce72f793989f06c Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Tue, 24 Feb 2026 16:07:52 -0800 Subject: [PATCH 45/46] chore: regenerate types --- generated/packages/go/v1_4/v1_4.go | 4 +- .../py/src/open_rpc_spec_types/v1_4.py | 2 +- generated/packages/rs/src/v1_4.rs | 2 +- generated/packages/ts/1_3/index.ts | 91 ++++--------------- generated/packages/ts/1_4/index.d.ts | 2 +- generated/packages/ts/1_4/index.ts | 71 ++++----------- generated/packages/ts/bun.lock | 19 ---- generated/packages/ts/index.ts | 4 +- generated/packages/ts/package.json | 2 +- 9 files changed, 42 insertions(+), 155 deletions(-) delete mode 100644 generated/packages/ts/bun.lock diff --git a/generated/packages/go/v1_4/v1_4.go b/generated/packages/go/v1_4/v1_4.go index c0c0980..47e6415 100644 --- a/generated/packages/go/v1_4/v1_4.go +++ b/generated/packages/go/v1_4/v1_4.go @@ -10,7 +10,7 @@ type InfoObjectTitle string type InfoObjectDescription string // A URL to the Terms of Service for the API. MUST be in the format of a URL. type InfoObjectTermsOfService string -// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-document-openrpc) or the API implementation version). type InfoObjectVersion string // The identifying name of the contact person/organization. type ContactObjectName string @@ -804,4 +804,4 @@ type OpenrpcDocument struct { Schema *MetaSchema `json:"$schema,omitempty"` } -const RawOpenrpcDocument = "{\"$schema\":\"https://meta.json-schema.tools/\",\"$id\":\"https://meta.open-rpc.org/\",\"title\":\"openrpcDocument\",\"type\":\"object\",\"required\":[\"info\",\"methods\",\"openrpc\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"openrpc\":{\"description\":\"This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string.\",\"title\":\"openrpc\",\"type\":\"string\",\"regex\":\"^1\\\\.4\\\\.\\\\d+$\"},\"info\":{\"$ref\":\"#/definitions/infoObject\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"},\"servers\":{\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"methods\":{\"title\":\"methods\",\"type\":\"array\",\"description\":\"The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example).\",\"additionalItems\":false,\"items\":{\"title\":\"methodOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/methodObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"components\":{\"title\":\"components\",\"description\":\"Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\",\"type\":\"object\",\"properties\":{\"schemas\":{\"title\":\"schemaComponents\",\"description\":\"An object to hold reusable [Schema Objects](#schema-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/JSONSchema\"}}},\"links\":{\"title\":\"linkComponents\",\"type\":\"object\",\"description\":\"An object to hold reusable [Link Objects](#link-object).\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/linkObject\"}}},\"errors\":{\"title\":\"errorComponents\",\"description\":\"An object to hold reusable [Error Objects](#error-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/errorObject\"}}},\"examples\":{\"title\":\"exampleComponents\",\"description\":\"An object to hold reusable [Example Objects](#example-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/exampleObject\"}}},\"examplePairings\":{\"title\":\"examplePairingComponents\",\"description\":\"An object to hold reusable [Example Pairing Objects](#example-pairing-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/examplePairingObject\"}}},\"contentDescriptors\":{\"title\":\"contentDescriptorComponents\",\"description\":\"An object to hold reusable [Content Descriptor Objects](#content-descriptor-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/contentDescriptorObject\"}}},\"tags\":{\"title\":\"tagComponents\",\"description\":\"An object to hold reusable [Tag Objects](#tag-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/tagObject\"}}}}},\"$schema\":{\"title\":\"metaSchema\",\"description\":\"JSON Schema URI (used by some editors)\",\"type\":\"string\",\"default\":\"https://meta.open-rpc.org/\"}},\"definitions\":{\"specificationExtension\":{\"title\":\"specificationExtension\",\"description\":\"This object MAY be extended with [Specification Extensions](#specification-extensions).\"},\"JSONSchema\":{\"$ref\":\"https://meta.json-schema.tools\"},\"referenceObject\":{\"title\":\"referenceObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"description\":\"The reference string.\",\"$ref\":\"https://meta.json-schema.tools/#/definitions/JSONSchemaObject/properties/$ref\"}}},\"errorObject\":{\"title\":\"errorObject\",\"type\":\"object\",\"description\":\"Defines an application level error.\",\"additionalProperties\":false,\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"title\":\"errorObjectCode\",\"description\":\"A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.\",\"type\":\"integer\"},\"message\":{\"title\":\"errorObjectMessage\",\"description\":\"A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.\",\"type\":\"string\"},\"data\":{\"title\":\"errorObjectData\",\"description\":\"A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).\"}}},\"licenseObject\":{\"title\":\"licenseObject\",\"description\":\"License information for the exposed API.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"licenseObjectName\",\"description\":\"The license name used for the API.\",\"type\":\"string\"},\"url\":{\"title\":\"licenseObjectUrl\",\"description\":\"A URL to the license used for the API. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"contactObject\":{\"description\":\"Contact information for the exposed API.\",\"title\":\"contactObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"contactObjectName\",\"description\":\"The identifying name of the contact person/organization.\",\"type\":\"string\"},\"email\":{\"title\":\"contactObjectEmail\",\"description\":\"The email address of the contact person/organization. MUST be in the format of an email address.\",\"type\":\"string\"},\"url\":{\"title\":\"contactObjectUrl\",\"description\":\"The URL pointing to the contact information. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"infoObject\":{\"title\":\"infoObject\",\"description\":\"The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.\",\"additionalProperties\":false,\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"title\":\"infoObjectTitle\",\"description\":\"The title of the application.\",\"type\":\"string\"},\"description\":{\"title\":\"infoObjectDescription\",\"description\":\"A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"termsOfService\":{\"title\":\"infoObjectTermsOfService\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"title\":\"infoObjectVersion\",\"description\":\"The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version).\",\"type\":\"string\"},\"contact\":{\"$ref\":\"#/definitions/contactObject\"},\"license\":{\"$ref\":\"#/definitions/licenseObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"serverObject\":{\"title\":\"serverObject\",\"description\":\"A object representing a Server\",\"type\":\"object\",\"required\":[\"url\"],\"additionalProperties\":false,\"properties\":{\"url\":{\"title\":\"serverObjectUrl\",\"description\":\"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"string\",\"format\":\"uri\"},\"name\":{\"title\":\"serverObjectName\",\"description\":\"An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectDescription\",\"description\":\"An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"serverObjectSummary\",\"description\":\"A short summary of what the server is.\",\"type\":\"string\"},\"variables\":{\"title\":\"serverObjectVariables\",\"description\":\"A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"title\":\"serverObjectVariable\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"type\":\"object\",\"required\":[\"default\"],\"properties\":{\"default\":{\"title\":\"serverObjectVariableDefault\",\"description\":\"The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectVariableDescription\",\"description\":\"An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"enum\":{\"title\":\"serverObjectVariableEnum\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"array\",\"items\":{\"title\":\"serverObjectVariableEnumItem\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"string\"}}}}}}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"linkObject\":{\"title\":\"linkObject\",\"description\":\"A object representing a Link\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"linkObjectName\",\"description\":\"Cannonical name of the link.\",\"minLength\":1},\"summary\":{\"title\":\"linkObjectSummary\",\"description\":\"Short description for the link.\",\"type\":\"string\"},\"method\":{\"title\":\"linkObjectMethod\",\"description\":\"The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted.\",\"type\":\"string\"},\"description\":{\"title\":\"linkObjectDescription\",\"description\":\"A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"params\":{\"title\":\"linkObjectParams\",\"description\":\"A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method.\"},\"server\":{\"title\":\"linkObjectServer\",\"description\":\"A server object to be used by the target method.\",\"$ref\":\"#/definitions/serverObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"externalDocumentationObject\":{\"description\":\"Additional external documentation.\",\"title\":\"externalDocumentationObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"url\"],\"properties\":{\"description\":{\"description\":\"A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"title\":\"externalDocumentationObjectDescription\",\"type\":\"string\"},\"url\":{\"description\":\"The URL for the target documentation. Value MUST be in the format of a URL.\",\"title\":\"externalDocumentationObjectUrl\",\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"methodObject\":{\"title\":\"methodObject\",\"description\":\"Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"methodObjectName\",\"description\":\"The cannonical name for the method. The name MUST be unique within the methods array.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"methodObjectDescription\",\"description\":\"A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"methodObjectSummary\",\"description\":\"A short summary of what the method does.\",\"type\":\"string\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"tags\":{\"title\":\"methodObjectTags\",\"description\":\"A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.\",\"type\":\"array\",\"items\":{\"title\":\"tagOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/tagObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"paramStructure\":{\"title\":\"methodObjectParamStructure\",\"type\":\"string\",\"description\":\"Format the server expects the params. Defaults to 'either'.\",\"enum\":[\"by-position\",\"by-name\",\"either\"],\"default\":\"either\"},\"params\":{\"title\":\"methodObjectParams\",\"description\":\" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with \\\"required\\\": false) MUST be positioned after all required params in the list.\",\"type\":\"array\",\"items\":{\"title\":\"contentDescriptorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"methodObjectResult\",\"description\":\"The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification)\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]},\"errors\":{\"title\":\"methodObjectErrors\",\"description\":\"A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes.\",\"type\":\"array\",\"items\":{\"title\":\"errorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/errorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"links\":{\"title\":\"methodObjectLinks\",\"description\":\"A list of possible links from this method call.\",\"type\":\"array\",\"items\":{\"title\":\"linkOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/linkObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"examples\":{\"title\":\"methodObjectExamples\",\"description\":\"Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing.\",\"type\":\"array\",\"items\":{\"title\":\"examplePairingOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/examplePairingObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"deprecated\":{\"title\":\"methodObjectDeprecated\",\"description\":\"Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"tagObject\":{\"title\":\"tagObject\",\"description\":\"Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"title\":\"tagObjectName\",\"description\":\"The name of the tag.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"tagObjectDescription\",\"description\":\"A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"externalDocs\":{\"description\":\"Additional external documentation for this tag.\",\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"exampleObject\":{\"title\":\"exampleObject\",\"description\":\"The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object).\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"summary\":{\"title\":\"exampleObjectSummary\",\"description\":\"Short description for the example.\",\"type\":\"string\"},\"value\":{\"title\":\"exampleObjectValue\",\"description\":\"Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary.\"},\"description\":{\"title\":\"exampleObjectDescription\",\"description\":\"A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"name\":{\"title\":\"exampleObjectName\",\"description\":\"Cannonical name of the example.\",\"type\":\"string\",\"minLength\":1}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"examplePairingObject\":{\"title\":\"examplePairingObject\",\"description\":\"The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"properties\":{\"name\":{\"title\":\"examplePairingObjectName\",\"description\":\"Name for the example pairing.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"examplePairingObjectDescription\",\"description\":\"A verbose explanation of the example pairing.\",\"type\":\"string\"},\"params\":{\"title\":\"examplePairingObjectParams\",\"description\":\"Example parameters.\",\"type\":\"array\",\"items\":{\"title\":\"exampleOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"examplePairingObjectResult\",\"description\":\"Example result. When not provided, the example pairing represents usage of the method as a notification.\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}}},\"contentDescriptorObject\":{\"title\":\"contentDescriptorObject\",\"description\":\"Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"schema\"],\"properties\":{\"name\":{\"title\":\"contentDescriptorObjectName\",\"description\":\"Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name).\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"contentDescriptorObjectDescription\",\"description\":\"A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"contentDescriptorObjectSummary\",\"description\":\"A short summary of the content that is being described.\",\"type\":\"string\"},\"schema\":{\"title\":\"contentDescriptorObjectSchema\",\"description\":\"Schema that describes the content.\",\"$ref\":\"#/definitions/JSONSchema\"},\"required\":{\"title\":\"contentDescriptorObjectRequired\",\"description\":\"Determines if the content is a required field. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"deprecated\":{\"title\":\"contentDescriptorObjectDeprecated\",\"description\":\"Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`.\",\"type\":\"boolean\",\"default\":false}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}}}}" +const RawOpenrpcDocument = "{\"$schema\":\"https://meta.json-schema.tools/\",\"$id\":\"https://meta.open-rpc.org/\",\"title\":\"openrpcDocument\",\"type\":\"object\",\"required\":[\"info\",\"methods\",\"openrpc\"],\"additionalProperties\":false,\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}},\"properties\":{\"openrpc\":{\"description\":\"This string MUST be the [semantic version number](https://semver.org/spec/v2.0.0.html) of the [OpenRPC Specification version](#versions) that the OpenRPC document uses. The `openrpc` field SHOULD be used by tooling specifications and clients to interpret the OpenRPC document. This is *not* related to the API [`info.version`](#info-version) string.\",\"title\":\"openrpc\",\"type\":\"string\",\"regex\":\"^1\\\\.4\\\\.\\\\d+$\"},\"info\":{\"$ref\":\"#/definitions/infoObject\"},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"},\"servers\":{\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"title\":\"servers\",\"type\":\"array\",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"methods\":{\"title\":\"methods\",\"type\":\"array\",\"description\":\"The available methods for the API. While it is required, the array may be empty (to handle security filtering, for example).\",\"additionalItems\":false,\"items\":{\"title\":\"methodOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/methodObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"components\":{\"title\":\"components\",\"description\":\"Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.\",\"type\":\"object\",\"properties\":{\"schemas\":{\"title\":\"schemaComponents\",\"description\":\"An object to hold reusable [Schema Objects](#schema-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/JSONSchema\"}}},\"links\":{\"title\":\"linkComponents\",\"type\":\"object\",\"description\":\"An object to hold reusable [Link Objects](#link-object).\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/linkObject\"}}},\"errors\":{\"title\":\"errorComponents\",\"description\":\"An object to hold reusable [Error Objects](#error-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/errorObject\"}}},\"examples\":{\"title\":\"exampleComponents\",\"description\":\"An object to hold reusable [Example Objects](#example-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/exampleObject\"}}},\"examplePairings\":{\"title\":\"examplePairingComponents\",\"description\":\"An object to hold reusable [Example Pairing Objects](#example-pairing-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/examplePairingObject\"}}},\"contentDescriptors\":{\"title\":\"contentDescriptorComponents\",\"description\":\"An object to hold reusable [Content Descriptor Objects](#content-descriptor-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/contentDescriptorObject\"}}},\"tags\":{\"title\":\"tagComponents\",\"description\":\"An object to hold reusable [Tag Objects](#tag-object).\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"$ref\":\"#/definitions/tagObject\"}}}}},\"$schema\":{\"title\":\"metaSchema\",\"description\":\"JSON Schema URI (used by some editors)\",\"type\":\"string\",\"default\":\"https://meta.open-rpc.org/\"}},\"definitions\":{\"specificationExtension\":{\"title\":\"specificationExtension\",\"description\":\"This object MAY be extended with [Specification Extensions](#specification-extensions).\"},\"JSONSchema\":{\"$ref\":\"https://meta.json-schema.tools\"},\"referenceObject\":{\"title\":\"referenceObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"$ref\"],\"properties\":{\"$ref\":{\"description\":\"The reference string.\",\"$ref\":\"https://meta.json-schema.tools/#/definitions/JSONSchemaObject/properties/$ref\"}}},\"errorObject\":{\"title\":\"errorObject\",\"type\":\"object\",\"description\":\"Defines an application level error.\",\"additionalProperties\":false,\"required\":[\"code\",\"message\"],\"properties\":{\"code\":{\"title\":\"errorObjectCode\",\"description\":\"A Number that indicates the error type that occurred. This MUST be an integer. The error codes from and including -32768 to -32000 are reserved for pre-defined errors. These pre-defined errors SHOULD be assumed to be returned from any JSON-RPC api.\",\"type\":\"integer\"},\"message\":{\"title\":\"errorObjectMessage\",\"description\":\"A String providing a short description of the error. The message SHOULD be limited to a concise single sentence.\",\"type\":\"string\"},\"data\":{\"title\":\"errorObjectData\",\"description\":\"A Primitive or Structured value that contains additional information about the error. This may be omitted. The value of this member is defined by the Server (e.g. detailed error information, nested errors etc.).\"}}},\"licenseObject\":{\"title\":\"licenseObject\",\"description\":\"License information for the exposed API.\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"licenseObjectName\",\"description\":\"The license name used for the API.\",\"type\":\"string\"},\"url\":{\"title\":\"licenseObjectUrl\",\"description\":\"A URL to the license used for the API. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"contactObject\":{\"description\":\"Contact information for the exposed API.\",\"title\":\"contactObject\",\"type\":\"object\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"contactObjectName\",\"description\":\"The identifying name of the contact person/organization.\",\"type\":\"string\"},\"email\":{\"title\":\"contactObjectEmail\",\"description\":\"The email address of the contact person/organization. MUST be in the format of an email address.\",\"type\":\"string\"},\"url\":{\"title\":\"contactObjectUrl\",\"description\":\"The URL pointing to the contact information. MUST be in the format of a URL.\",\"type\":\"string\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"infoObject\":{\"title\":\"infoObject\",\"description\":\"The object provides metadata about the API. The metadata MAY be used by the clients if needed, and MAY be presented in editing or documentation generation tools for convenience.\",\"additionalProperties\":false,\"required\":[\"title\",\"version\"],\"properties\":{\"title\":{\"title\":\"infoObjectTitle\",\"description\":\"The title of the application.\",\"type\":\"string\"},\"description\":{\"title\":\"infoObjectDescription\",\"description\":\"A verbose description of the application. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"termsOfService\":{\"title\":\"infoObjectTermsOfService\",\"description\":\"A URL to the Terms of Service for the API. MUST be in the format of a URL.\",\"type\":\"string\",\"format\":\"uri\"},\"version\":{\"title\":\"infoObjectVersion\",\"description\":\"The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-document-openrpc) or the API implementation version).\",\"type\":\"string\"},\"contact\":{\"$ref\":\"#/definitions/contactObject\"},\"license\":{\"$ref\":\"#/definitions/licenseObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"serverObject\":{\"title\":\"serverObject\",\"description\":\"A object representing a Server\",\"type\":\"object\",\"required\":[\"url\"],\"additionalProperties\":false,\"properties\":{\"url\":{\"title\":\"serverObjectUrl\",\"description\":\"A URL to the target host. This URL supports Server Variables and MAY be relative, to indicate that the host location is relative to the location where the OpenRPC document is being served. [Server Variables](#server-variables) are passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"string\",\"format\":\"uri\"},\"name\":{\"title\":\"serverObjectName\",\"description\":\"An optional string describing the name of the server. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectDescription\",\"description\":\"An optional string describing the host designated by the URL. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"serverObjectSummary\",\"description\":\"A short summary of what the server is.\",\"type\":\"string\"},\"variables\":{\"title\":\"serverObjectVariables\",\"description\":\"A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL.\",\"type\":\"object\",\"patternProperties\":{\"[0-z]+\":{\"title\":\"serverObjectVariable\",\"description\":\"An object representing a Server Variable for server URL template substitution.\",\"type\":\"object\",\"required\":[\"default\"],\"properties\":{\"default\":{\"title\":\"serverObjectVariableDefault\",\"description\":\"The default value to use for substitution, which SHALL be sent if an alternate value is _not_ supplied. Note this behavior is different than the [Schema Object's](#schema-object) treatment of default values, because in those cases parameter values are optional.\",\"type\":\"string\"},\"description\":{\"title\":\"serverObjectVariableDescription\",\"description\":\"An optional description for the server variable. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"enum\":{\"title\":\"serverObjectVariableEnum\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"array\",\"items\":{\"title\":\"serverObjectVariableEnumItem\",\"description\":\"An enumeration of string values to be used if the substitution options are from a limited set.\",\"type\":\"string\"}}}}}}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"linkObject\":{\"title\":\"linkObject\",\"description\":\"A object representing a Link\",\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"linkObjectName\",\"description\":\"Cannonical name of the link.\",\"minLength\":1},\"summary\":{\"title\":\"linkObjectSummary\",\"description\":\"Short description for the link.\",\"type\":\"string\"},\"method\":{\"title\":\"linkObjectMethod\",\"description\":\"The name of an existing, resolvable OpenRPC method, as defined with a unique `method`. This field MUST resolve to a unique [Method Object](#method-object). As opposed to Open Api, Relative `method` values ARE NOT permitted.\",\"type\":\"string\"},\"description\":{\"title\":\"linkObjectDescription\",\"description\":\"A description of the link. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"params\":{\"title\":\"linkObjectParams\",\"description\":\"A map representing parameters to pass to a method as specified with `method`. The key is the parameter name to be used, whereas the value can be a constant or a [runtime expression](#runtime-expression) to be evaluated and passed to the linked method.\"},\"server\":{\"title\":\"linkObjectServer\",\"description\":\"A server object to be used by the target method.\",\"$ref\":\"#/definitions/serverObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"externalDocumentationObject\":{\"description\":\"Additional external documentation.\",\"title\":\"externalDocumentationObject\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"url\"],\"properties\":{\"description\":{\"description\":\"A verbose explanation of the documentation. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"title\":\"externalDocumentationObjectDescription\",\"type\":\"string\"},\"url\":{\"description\":\"The URL for the target documentation. Value MUST be in the format of a URL.\",\"title\":\"externalDocumentationObjectUrl\",\"type\":\"string\",\"format\":\"uri\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"methodObject\":{\"title\":\"methodObject\",\"description\":\"Describes the interface for the given method name. The method name is used as the `method` field of the JSON-RPC body. It therefore MUST be unique.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"additionalProperties\":false,\"properties\":{\"name\":{\"title\":\"methodObjectName\",\"description\":\"The cannonical name for the method. The name MUST be unique within the methods array.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"methodObjectDescription\",\"description\":\"A verbose explanation of the method behavior. GitHub Flavored Markdown syntax MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"methodObjectSummary\",\"description\":\"A short summary of what the method does.\",\"type\":\"string\"},\"servers\":{\"title\":\"servers\",\"type\":\"array\",\"description\":\"An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. \",\"additionalItems\":false,\"items\":{\"$ref\":\"#/definitions/serverObject\"}},\"tags\":{\"title\":\"methodObjectTags\",\"description\":\"A list of tags for API documentation control. Tags can be used for logical grouping of methods by resources or any other qualifier.\",\"type\":\"array\",\"items\":{\"title\":\"tagOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/tagObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"paramStructure\":{\"title\":\"methodObjectParamStructure\",\"type\":\"string\",\"description\":\"Format the server expects the params. Defaults to 'either'.\",\"enum\":[\"by-position\",\"by-name\",\"either\"],\"default\":\"either\"},\"params\":{\"title\":\"methodObjectParams\",\"description\":\" A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with \\\"required\\\": false) MUST be positioned after all required params in the list.\",\"type\":\"array\",\"items\":{\"title\":\"contentDescriptorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"methodObjectResult\",\"description\":\"The description of the result returned by the method. If defined, it MUST be a Content Descriptor or Reference Object. If undefined, the method MUST only be used as a [notification](https://www.jsonrpc.org/specification#notification)\",\"oneOf\":[{\"$ref\":\"#/definitions/contentDescriptorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]},\"errors\":{\"title\":\"methodObjectErrors\",\"description\":\"A list of custom application defined errors that MAY be returned. The Errors MUST have unique error codes.\",\"type\":\"array\",\"items\":{\"title\":\"errorOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/errorObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"links\":{\"title\":\"methodObjectLinks\",\"description\":\"A list of possible links from this method call.\",\"type\":\"array\",\"items\":{\"title\":\"linkOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/linkObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"examples\":{\"title\":\"methodObjectExamples\",\"description\":\"Array of [Example Pairing Objects](#example-pairing-object) where each example includes a valid params-to-result [Content Descriptor](#content-descriptor-object) pairing.\",\"type\":\"array\",\"items\":{\"title\":\"examplePairingOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/examplePairingObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"deprecated\":{\"title\":\"methodObjectDeprecated\",\"description\":\"Declares this method to be deprecated. Consumers SHOULD refrain from usage of the declared method. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"externalDocs\":{\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"tagObject\":{\"title\":\"tagObject\",\"description\":\"Adds metadata to a single tag that is used by the [Method Object](#method-object). It is not mandatory to have a Tag Object per tag defined in the Method Object instances.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\"],\"properties\":{\"name\":{\"title\":\"tagObjectName\",\"description\":\"The name of the tag.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"tagObjectDescription\",\"description\":\"A verbose explanation for the tag. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"externalDocs\":{\"description\":\"Additional external documentation for this tag.\",\"$ref\":\"#/definitions/externalDocumentationObject\"}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"exampleObject\":{\"title\":\"exampleObject\",\"description\":\"The Example object is an object that defines an example that is intended to match the `schema` of a given [Content Descriptor](#content-descriptor-object).\",\"type\":\"object\",\"required\":[\"name\",\"value\"],\"properties\":{\"summary\":{\"title\":\"exampleObjectSummary\",\"description\":\"Short description for the example.\",\"type\":\"string\"},\"value\":{\"title\":\"exampleObjectValue\",\"description\":\"Embedded literal example. The `value` field and `externalValue` field are mutually exclusive. To represent examples of media types that cannot naturally represented in JSON, use a string value to contain the example, escaping where necessary.\"},\"description\":{\"title\":\"exampleObjectDescription\",\"description\":\"A verbose explanation of the example. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"name\":{\"title\":\"exampleObjectName\",\"description\":\"Cannonical name of the example.\",\"type\":\"string\",\"minLength\":1}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}},\"examplePairingObject\":{\"title\":\"examplePairingObject\",\"description\":\"The Example Pairing object consists of a set of example params and result. The result is what you can expect from the JSON-RPC service given the exact params.\",\"type\":\"object\",\"required\":[\"name\",\"params\"],\"properties\":{\"name\":{\"title\":\"examplePairingObjectName\",\"description\":\"Name for the example pairing.\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"examplePairingObjectDescription\",\"description\":\"A verbose explanation of the example pairing.\",\"type\":\"string\"},\"params\":{\"title\":\"examplePairingObjectParams\",\"description\":\"Example parameters.\",\"type\":\"array\",\"items\":{\"title\":\"exampleOrReference\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}},\"result\":{\"title\":\"examplePairingObjectResult\",\"description\":\"Example result. When not provided, the example pairing represents usage of the method as a notification.\",\"oneOf\":[{\"$ref\":\"#/definitions/exampleObject\"},{\"$ref\":\"#/definitions/referenceObject\"}]}}},\"contentDescriptorObject\":{\"title\":\"contentDescriptorObject\",\"description\":\"Content Descriptors are objects that do just as they suggest - describe content. They are reusable ways of describing either parameters or result. They MUST have a schema.\",\"type\":\"object\",\"additionalProperties\":false,\"required\":[\"name\",\"schema\"],\"properties\":{\"name\":{\"title\":\"contentDescriptorObjectName\",\"description\":\"Name of the content that is being described. If the content described is a method parameter assignable [`by-name`](#method-param-structure), this field SHALL define the parameter's key (ie name).\",\"type\":\"string\",\"minLength\":1},\"description\":{\"title\":\"contentDescriptorObjectDescription\",\"description\":\"A verbose explanation of the content descriptor behavior. [GitHub Flavored Markdown syntax](https://github.github.com/gfm/) MAY be used for rich text representation.\",\"type\":\"string\"},\"summary\":{\"title\":\"contentDescriptorObjectSummary\",\"description\":\"A short summary of the content that is being described.\",\"type\":\"string\"},\"schema\":{\"title\":\"contentDescriptorObjectSchema\",\"description\":\"Schema that describes the content.\",\"$ref\":\"#/definitions/JSONSchema\"},\"required\":{\"title\":\"contentDescriptorObjectRequired\",\"description\":\"Determines if the content is a required field. Default value is `false`.\",\"type\":\"boolean\",\"default\":false},\"deprecated\":{\"title\":\"contentDescriptorObjectDeprecated\",\"description\":\"Specifies that the content is deprecated and SHOULD be transitioned out of usage. Default value is `false`.\",\"type\":\"boolean\",\"default\":false}},\"patternProperties\":{\"^x-\":{\"$ref\":\"#/definitions/specificationExtension\"}}}}}" diff --git a/generated/packages/py/src/open_rpc_spec_types/v1_4.py b/generated/packages/py/src/open_rpc_spec_types/v1_4.py index 5a732c7..de8013a 100644 --- a/generated/packages/py/src/open_rpc_spec_types/v1_4.py +++ b/generated/packages/py/src/open_rpc_spec_types/v1_4.py @@ -18,7 +18,7 @@ """A URL to the Terms of Service for the API. MUST be in the format of a URL. """ InfoObjectTermsOfService = NewType("InfoObjectTermsOfService", str) -"""The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +"""The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-document-openrpc) or the API implementation version). """ InfoObjectVersion = NewType("InfoObjectVersion", str) """The identifying name of the contact person/organization. diff --git a/generated/packages/rs/src/v1_4.rs b/generated/packages/rs/src/v1_4.rs index 7aa6ac6..80e4187 100644 --- a/generated/packages/rs/src/v1_4.rs +++ b/generated/packages/rs/src/v1_4.rs @@ -27,7 +27,7 @@ pub type InfoObjectDescription = String; pub type InfoObjectTermsOfService = String; /// InfoObjectVersion /// -/// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). +/// The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-document-openrpc) or the API implementation version). /// pub type InfoObjectVersion = String; /// ContactObjectName diff --git a/generated/packages/ts/1_3/index.ts b/generated/packages/ts/1_3/index.ts index 8547e38..4550a42 100644 --- a/generated/packages/ts/1_3/index.ts +++ b/generated/packages/ts/1_3/index.ts @@ -1,30 +1,4 @@ -export type Openrpc = - | "1.3.2" - | "1.3.1" - | "1.3.0" - | "1.2.6" - | "1.2.5" - | "1.2.4" - | "1.2.3" - | "1.2.2" - | "1.2.1" - | "1.2.0" - | "1.1.12" - | "1.1.11" - | "1.1.10" - | "1.1.9" - | "1.1.8" - | "1.1.7" - | "1.1.6" - | "1.1.5" - | "1.1.4" - | "1.1.3" - | "1.1.2" - | "1.1.1" - | "1.1.0" - | "1.0.0" - | "1.0.0-rc0" - | "1.0.0-rc1"; +export type Openrpc = "1.3.2" | "1.3.1" | "1.3.0" | "1.2.6" | "1.2.5" | "1.2.4" | "1.2.3" | "1.2.2" | "1.2.1" | "1.2.0" | "1.1.12" | "1.1.11" | "1.1.10" | "1.1.9" | "1.1.8" | "1.1.7" | "1.1.6" | "1.1.5" | "1.1.4" | "1.1.3" | "1.1.2" | "1.1.1" | "1.1.0" | "1.0.0" | "1.0.0-rc0" | "1.0.0-rc1"; export type InfoObjectProperties = string; export type InfoObjectDescription = string; export type InfoObjectTermsOfService = string; @@ -81,9 +55,7 @@ export interface ServerObjectVariable { enum?: ServerObjectVariableEnum; [k: string]: any; } -export interface ServerObjectVariables { - [key: string]: any; -} +export interface ServerObjectVariables { [key: string]: any; } export interface ServerObject { url: ServerObjectUrl; name?: ServerObjectName; @@ -173,39 +145,24 @@ export type StringArray = StringDoaGddGA[]; * @default {} * */ -export interface Definitions { - [key: string]: any; -} +export interface Definitions { [key: string]: any; } /** * * @default {} * */ -export interface Properties { - [key: string]: any; -} +export interface Properties { [key: string]: any; } export type PropertyNames = any; /** * * @default {} * */ -export interface PatternProperties { - [key: string]: any; -} +export interface PatternProperties { [key: string]: any; } export type DependenciesSet = JSONSchema | StringArray; -export interface Dependencies { - [key: string]: any; -} +export interface Dependencies { [key: string]: any; } export type Enum = AlwaysTrue[]; -export type SimpleTypes = - | "array" - | "boolean" - | "integer" - | "null" - | "number" - | "object" - | "string"; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; export type ArrayOfSimpleTypes = SimpleTypes[]; export type Type = SimpleTypes | ArrayOfSimpleTypes; export type Format = string; @@ -282,9 +239,7 @@ export interface ContentDescriptorObject { deprecated?: ContentDescriptorObjectDeprecated; [regex: string]: SpecificationExtension | any; } -export type ContentDescriptorOrReference = - | ContentDescriptorObject - | ReferenceObject; +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; export type MethodObjectParams = ContentDescriptorOrReference[]; export type MethodObjectResult = ContentDescriptorObject | ReferenceObject; /** @@ -390,27 +345,13 @@ export interface MethodObject { } export type MethodOrReference = MethodObject | ReferenceObject; export type Methods = MethodOrReference[]; -export interface SchemaComponents { - [key: string]: any; -} -export interface LinkComponents { - [key: string]: any; -} -export interface ErrorComponents { - [key: string]: any; -} -export interface ExampleComponents { - [key: string]: any; -} -export interface ExamplePairingComponents { - [key: string]: any; -} -export interface ContentDescriptorComponents { - [key: string]: any; -} -export interface TagComponents { - [key: string]: any; -} +export interface SchemaComponents { [key: string]: any; } +export interface LinkComponents { [key: string]: any; } +export interface ErrorComponents { [key: string]: any; } +export interface ExampleComponents { [key: string]: any; } +export interface ExamplePairingComponents { [key: string]: any; } +export interface ContentDescriptorComponents { [key: string]: any; } +export interface TagComponents { [key: string]: any; } export interface Components { schemas?: SchemaComponents; links?: LinkComponents; @@ -438,4 +379,4 @@ export interface OpenrpcDocument { components?: Components; $schema?: MetaSchema; [regex: string]: SpecificationExtension | any; -} +} \ No newline at end of file diff --git a/generated/packages/ts/1_4/index.d.ts b/generated/packages/ts/1_4/index.d.ts index 6ed21ff..ded167d 100644 --- a/generated/packages/ts/1_4/index.d.ts +++ b/generated/packages/ts/1_4/index.d.ts @@ -24,7 +24,7 @@ export type InfoObjectDescription = string; export type InfoObjectTermsOfService = string; /** * - * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-document-openrpc) or the API implementation version). * */ export type InfoObjectVersion = string; diff --git a/generated/packages/ts/1_4/index.ts b/generated/packages/ts/1_4/index.ts index 7ad27e0..f50dadf 100644 --- a/generated/packages/ts/1_4/index.ts +++ b/generated/packages/ts/1_4/index.ts @@ -24,7 +24,7 @@ export type InfoObjectDescription = string; export type InfoObjectTermsOfService = string; /** * - * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-version) or the API implementation version). + * The version of the OpenRPC document (which is distinct from the [OpenRPC Specification version](#openrpc-document-openrpc) or the API implementation version). * */ export type InfoObjectVersion = string; @@ -177,9 +177,7 @@ export interface ServerObjectVariable { * A map between a variable name and its value. The value is passed into the [Runtime Expression](#runtime-expression) to produce a server URL. * */ -export interface ServerObjectVariables { - [key: string]: any; -} +export interface ServerObjectVariables { [key: string]: any; } /** * * A object representing a Server @@ -196,7 +194,7 @@ export interface ServerObject { type AlwaysFalse = any; /** * - * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. + * An array of Server Objects, which provide connectivity information to a target server. If the `servers` property is not provided, or is an empty array, the default value would be a [Server Object](#server-object) with a [url](#server-url) value of `localhost`. * */ export type Servers = ServerObject[]; @@ -326,39 +324,24 @@ export type StringArray = StringDoaGddGA[]; * @default {} * */ -export interface Definitions { - [key: string]: any; -} +export interface Definitions { [key: string]: any; } /** * * @default {} * */ -export interface Properties { - [key: string]: any; -} +export interface Properties { [key: string]: any; } export type PropertyNames = any; /** * * @default {} * */ -export interface PatternProperties { - [key: string]: any; -} +export interface PatternProperties { [key: string]: any; } export type DependenciesSet = JSONSchema | StringArray; -export interface Dependencies { - [key: string]: any; -} +export interface Dependencies { [key: string]: any; } export type Enum = AlwaysTrue[]; -export type SimpleTypes = - | "array" - | "boolean" - | "integer" - | "null" - | "number" - | "object" - | "string"; +export type SimpleTypes = "array" | "boolean" | "integer" | "null" | "number" | "object" | "string"; export type ArrayOfSimpleTypes = SimpleTypes[]; export type Type = SimpleTypes | ArrayOfSimpleTypes; export type Format = string; @@ -419,9 +402,7 @@ export interface JSONSchemaObject { * @default {} * */ -export type ContentDescriptorObjectSchema = - | JSONSchemaObject - | JSONSchemaBoolean; +export type ContentDescriptorObjectSchema = JSONSchemaObject | JSONSchemaBoolean; /** * * Determines if the content is a required field. Default value is `false`. @@ -448,9 +429,7 @@ export interface ContentDescriptorObject { deprecated?: ContentDescriptorObjectDeprecated; [regex: string]: SpecificationExtension | any; } -export type ContentDescriptorOrReference = - | ContentDescriptorObject - | ReferenceObject; +export type ContentDescriptorOrReference = ContentDescriptorObject | ReferenceObject; /** * * A list of parameters that are applicable for this method. The list MUST NOT include duplicated parameters and therefore require [name](#content-descriptor-name) to be unique. The list can use the [Reference Object](#reference-object) to link to parameters that are defined by the [Content Descriptor Object](#content-descriptor-object). All optional params (content descriptor objects with "required": false) MUST be positioned after all required params in the list. @@ -673,57 +652,43 @@ export type Methods = MethodOrReference[]; * An object to hold reusable [Schema Objects](#schema-object). * */ -export interface SchemaComponents { - [key: string]: any; -} +export interface SchemaComponents { [key: string]: any; } /** * * An object to hold reusable [Link Objects](#link-object). * */ -export interface LinkComponents { - [key: string]: any; -} +export interface LinkComponents { [key: string]: any; } /** * * An object to hold reusable [Error Objects](#error-object). * */ -export interface ErrorComponents { - [key: string]: any; -} +export interface ErrorComponents { [key: string]: any; } /** * * An object to hold reusable [Example Objects](#example-object). * */ -export interface ExampleComponents { - [key: string]: any; -} +export interface ExampleComponents { [key: string]: any; } /** * * An object to hold reusable [Example Pairing Objects](#example-pairing-object). * */ -export interface ExamplePairingComponents { - [key: string]: any; -} +export interface ExamplePairingComponents { [key: string]: any; } /** * * An object to hold reusable [Content Descriptor Objects](#content-descriptor-object). * */ -export interface ContentDescriptorComponents { - [key: string]: any; -} +export interface ContentDescriptorComponents { [key: string]: any; } /** * * An object to hold reusable [Tag Objects](#tag-object). * */ -export interface TagComponents { - [key: string]: any; -} +export interface TagComponents { [key: string]: any; } /** * * Holds a set of reusable objects for different aspects of the OpenRPC. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object. @@ -756,4 +721,4 @@ export interface OpenrpcDocument { components?: Components; $schema?: MetaSchema; [regex: string]: SpecificationExtension | any; -} +} \ No newline at end of file diff --git a/generated/packages/ts/bun.lock b/generated/packages/ts/bun.lock deleted file mode 100644 index c3e4c85..0000000 --- a/generated/packages/ts/bun.lock +++ /dev/null @@ -1,19 +0,0 @@ -{ - "lockfileVersion": 1, - "workspaces": { - "": { - "name": "@open-rpc/spec-types", - "dependencies": { - "@open-rpc/spec": "1.4.0", - }, - "devDependencies": { - "typescript": "^5.0.0", - }, - }, - }, - "packages": { - "@open-rpc/spec": ["@open-rpc/spec@1.4.0", "", {}, "sha512-PbfLgGMJZNUurFLFmu+5KU5CwQ6gKto3eLP8oVZh4Onf+paQkR/4L3/SYU8bqGwatMyXiqYwtXRjE6cenQkQ+g=="], - - "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], - } -} diff --git a/generated/packages/ts/index.ts b/generated/packages/ts/index.ts index e880e40..5f1d33c 100644 --- a/generated/packages/ts/index.ts +++ b/generated/packages/ts/index.ts @@ -1,5 +1,5 @@ import type * as V1_4 from "./1_4/index.js"; import type * as V1_3 from "./1_3/index.js"; -export type { V1_4, V1_3 }; -export * as spec from "@open-rpc/spec"; +export type { V1_4, V1_3 } +export * as spec from "@open-rpc/spec"; \ No newline at end of file diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index ca1378a..8e27350 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -28,7 +28,7 @@ } }, "dependencies": { - "@open-rpc/spec": "1.4.0" + "@open-rpc/spec": "^1.4.0" }, "devDependencies": { "typescript": "^5.0.0" From f6cf57df55dda71ffa7282a38748ab2d9ce667bb Mon Sep 17 00:00:00 2001 From: Zane Starr <zcstarr@gmail.com> Date: Tue, 24 Feb 2026 16:32:12 -0800 Subject: [PATCH 46/46] chore: readjust all the changelogs and versions --- generated/packages/go/CHANGELOG.md | 20 ------------ generated/packages/go/go.mod | 2 +- generated/packages/py/CHANGELOG.md | 40 ------------------------ generated/packages/py/pyproject.toml | 2 +- generated/packages/rs/CHANGELOG.md | 40 ------------------------ generated/packages/rs/Cargo.toml | 2 +- generated/packages/ts/CHANGELOG.md | 46 ---------------------------- generated/packages/ts/package.json | 2 +- 8 files changed, 4 insertions(+), 150 deletions(-) diff --git a/generated/packages/go/CHANGELOG.md b/generated/packages/go/CHANGELOG.md index bc09837..e69de29 100644 --- a/generated/packages/go/CHANGELOG.md +++ b/generated/packages/go/CHANGELOG.md @@ -1,20 +0,0 @@ -# Changelog -## 0.1.1 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/go/go.mod b/generated/packages/go/go.mod index 6ac729b..676bca0 100644 --- a/generated/packages/go/go.mod +++ b/generated/packages/go/go.mod @@ -1,3 +1,3 @@ -module github.com/zcstarr/spec-types/generated/packages/go // v0.1.1 +module github.com/zcstarr/spec-types/generated/packages/go // v0.0.0 go 1.24.5 diff --git a/generated/packages/py/CHANGELOG.md b/generated/packages/py/CHANGELOG.md index c575b73..e69de29 100644 --- a/generated/packages/py/CHANGELOG.md +++ b/generated/packages/py/CHANGELOG.md @@ -1,40 +0,0 @@ -# Changelog -## 0.0.2 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) - -## 0.0.1 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/py/pyproject.toml b/generated/packages/py/pyproject.toml index b74155f..7f3ef0b 100644 --- a/generated/packages/py/pyproject.toml +++ b/generated/packages/py/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "open-rpc-spec-types" -version = "0.0.2" +version = "0.0.0" description = "Generated OpenRPC specification types" license = "Apache-2.0" requires-python = ">=3.12" diff --git a/generated/packages/rs/CHANGELOG.md b/generated/packages/rs/CHANGELOG.md index c575b73..e69de29 100644 --- a/generated/packages/rs/CHANGELOG.md +++ b/generated/packages/rs/CHANGELOG.md @@ -1,40 +0,0 @@ -# Changelog -## 0.0.2 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) - -## 0.0.1 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/rs/Cargo.toml b/generated/packages/rs/Cargo.toml index 17bef39..461b6e3 100644 --- a/generated/packages/rs/Cargo.toml +++ b/generated/packages/rs/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "open-rpc-spec-types" -version = "0.0.2" +version = "0.0.0" edition = "2021" description = "Generated OpenRPC specification types" license = "Apache-2.0" diff --git a/generated/packages/ts/CHANGELOG.md b/generated/packages/ts/CHANGELOG.md index 4cb06b6..e69de29 100644 --- a/generated/packages/ts/CHANGELOG.md +++ b/generated/packages/ts/CHANGELOG.md @@ -1,46 +0,0 @@ -# Changelog -## 0.0.3 (2026-02-20) - -### Fixes - -- forced bump ([`bf43eec`](https://github.com/zcstarr/spec-types/commit/bf43eec)) - -## 0.0.2 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) - -## 0.0.1 (2026-02-20) - -### Features - -- wip init ([`6346118`](https://github.com/zcstarr/spec-types/commit/6346118)) -- wip init structure ([`539a85b`](https://github.com/zcstarr/spec-types/commit/539a85b)) -- wip that shows the generated types and knope semantic workflow ([`38e217b`](https://github.com/zcstarr/spec-types/commit/38e217b)) - -### Fixes - -- wip add index.ts ([`e34838f`](https://github.com/zcstarr/spec-types/commit/e34838f)) -- add remaining generators and remove stale ones ([`e9eb5e7`](https://github.com/zcstarr/spec-types/commit/e9eb5e7)) -- add support for persisting version and changelog data ([`27a3560`](https://github.com/zcstarr/spec-types/commit/27a3560)) -- adjust workflows to safe guard not generating the package after a change ([`d39a012`](https://github.com/zcstarr/spec-types/commit/d39a012)) -- go lang spec types ([`39250c9`](https://github.com/zcstarr/spec-types/commit/39250c9)) -- build to export js assets alongside ts ([`5624719`](https://github.com/zcstarr/spec-types/commit/5624719)) -- the release workflow ([`3cf7d11`](https://github.com/zcstarr/spec-types/commit/3cf7d11)) -- compile step type validation and version bump spec ([`caf64c4`](https://github.com/zcstarr/spec-types/commit/caf64c4)) -- version bump lint issues ([`f84bb88`](https://github.com/zcstarr/spec-types/commit/f84bb88)) diff --git a/generated/packages/ts/package.json b/generated/packages/ts/package.json index 8e27350..c181ba8 100644 --- a/generated/packages/ts/package.json +++ b/generated/packages/ts/package.json @@ -1,6 +1,6 @@ { "name": "@open-rpc/spec-types", - "version": "0.0.3", + "version": "0.0.0", "type": "module", "module": "index.ts", "scripts": {