diff --git a/package-lock.json b/package-lock.json index e1225fb7..7a6e440b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -526,24 +526,7 @@ "@open-rpc/meta-schema": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/@open-rpc/meta-schema/-/meta-schema-1.7.3.tgz", - "integrity": "sha512-4ZrMTipXCE28SOZKEfeJmobnrRvVRdPB5BK00lKam4Fb9Ad9E0l8htT5pRjCeapuceufzHtLMjPwCl2Onxr+UA==", - "dev": true - }, - "@open-rpc/schema-utils-js": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/@open-rpc/schema-utils-js/-/schema-utils-js-1.12.3.tgz", - "integrity": "sha512-SvBaIY95daAqBco3+sXqrn7XxipkX9w7644cgNKXdCMRHJXQfwSewTZvI1WmWNT+UXFa1/QhniY+WsqxVkeA1g==", - "dev": true, - "requires": { - "@open-rpc/meta-schema": "^1.7.2", - "ajv": "^6.10.0", - "detect-node": "^2.0.4", - "fs-extra": "^9.0.0", - "is-url": "^1.2.4", - "isomorphic-fetch": "^2.2.1", - "json-schema-ref-parser": "^7.0.1", - "lodash": "^4.17.15" - } + "integrity": "sha512-4ZrMTipXCE28SOZKEfeJmobnrRvVRdPB5BK00lKam4Fb9Ad9E0l8htT5pRjCeapuceufzHtLMjPwCl2Onxr+UA==" }, "@sinonjs/commons": { "version": "1.7.1", @@ -836,12 +819,6 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "dev": true }, - "at-least-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", - "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", - "dev": true - }, "atob": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", @@ -1394,12 +1371,6 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, - "detect-node": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/detect-node/-/detect-node-2.0.4.tgz", - "integrity": "sha512-ZIzRpLJrOj7jjP2miAtgqIfmzbxa4ZOr5jJc601zklsfEx9oTzmmj2nVpIPRpNlRTIh8lc1kyViIY7BWSGNmKw==", - "dev": true - }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -1437,15 +1408,6 @@ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, - "encoding": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "dev": true, - "requires": { - "iconv-lite": "~0.4.13" - } - }, "end-of-stream": { "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", @@ -1759,18 +1721,6 @@ "map-cache": "^0.2.2" } }, - "fs-extra": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.0.0.tgz", - "integrity": "sha512-pmEYSk3vYsG/bF651KPUXZ+hvjpgWYw/Gc7W9NFUe3ZVLczKKWIij3IKpOrQcdw4TILtibFslZ0UmR8Vvzig4g==", - "dev": true, - "requires": { - "at-least-node": "^1.0.0", - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^1.0.0" - } - }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -2125,12 +2075,6 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, - "is-url": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", - "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", - "dev": true - }, "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -2162,16 +2106,6 @@ "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", "dev": true }, - "isomorphic-fetch": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", - "dev": true, - "requires": { - "node-fetch": "^1.0.1", - "whatwg-fetch": ">=0.10.0" - } - }, "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", @@ -2819,16 +2753,6 @@ "minimist": "^1.2.5" } }, - "jsonfile": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.0.1.tgz", - "integrity": "sha512-jR2b5v7d2vIOust+w3wtFKZIfpC2pnRmFAhAC/BuweZFQR8qZzxH1OyrQ10HmdVYiXWkYUqPVsz91cG7EL2FBg==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^1.0.0" - } - }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -3063,16 +2987,6 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "node-fetch": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "dev": true, - "requires": { - "encoding": "^0.1.11", - "is-stream": "^1.0.1" - } - }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -4427,12 +4341,6 @@ "set-value": "^2.0.1" } }, - "universalify": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-1.0.0.tgz", - "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", - "dev": true - }, "unset-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", @@ -4574,12 +4482,6 @@ "iconv-lite": "0.4.24" } }, - "whatwg-fetch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", - "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==", - "dev": true - }, "whatwg-mimetype": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", diff --git a/package.json b/package.json index de90b695..2fc902dd 100644 --- a/package.json +++ b/package.json @@ -23,9 +23,10 @@ "files": [ "build" ], + "dependencies": { + "@open-rpc/meta-schema": "^1.7.3" + }, "devDependencies": { - "@open-rpc/meta-schema": "^1.7.3", - "@open-rpc/schema-utils-js": "^1.12.3", "@types/jest": "^25.1.0", "@types/json-schema": "^7.0.3", "@types/lodash": "^4.14.123", @@ -34,7 +35,8 @@ "lodash": "^4.17.11", "ts-jest": "^25.0.0", "tslint": "^6.0.0", - "typescript": "^3.3.3333" + "typescript": "^3.3.3333", + "json-schema-ref-parser": "^7.0.1" }, "keywords": [ "open-rpc", diff --git a/src/index.test.ts b/src/index.test.ts index 7b825903..92ffd26d 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,7 +1,9 @@ -import { parseOpenRPCDocument } from "@open-rpc/schema-utils-js"; import openRpcExamples from "./index"; import { forEach, uniqBy, values } from "lodash"; +import refParser from "json-schema-ref-parser"; +import { OpenrpcDocument } from "@open-rpc/meta-schema"; + describe("meta-schema validates all examples without error", () => { it("has unique titles for each example", () => { const vals = values(openRpcExamples); @@ -11,7 +13,7 @@ describe("meta-schema validates all examples without error", () => { forEach(openRpcExamples, (example, name: string) => { it(`validates the example: ${name}`, async () => { - const result = await parseOpenRPCDocument(example); + const result = await refParser.dereference(example) as OpenrpcDocument; expect(typeof result).toBe("object"); expect(result.methods.length).toBeGreaterThan(0); });