From 707af1ec583dfbe76a8e240bd294689020fcd866 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 21 Nov 2018 21:09:37 +0000 Subject: Updated CHANGELOGS --- packages/json-schemas/CHANGELOG.json | 9 +++++++++ packages/json-schemas/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index bf815e523..17cabc473 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1542821676, + "version": "2.1.2", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1542208198, "version": "2.1.1", diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index dc412bded..2f39c9596 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.1.2 - _November 21, 2018_ + + * Dependencies updated + ## v2.1.1 - _November 14, 2018_ * Dependencies updated -- cgit v1.2.3 From f46a49fd13c88dd86c9661d76bace18844642c04 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 21 Nov 2018 21:09:47 +0000 Subject: Publish - 0x.js@2.0.5 - @0x/abi-gen@1.0.17 - @0x/abi-gen-wrappers@1.1.0 - @0x/assert@1.0.18 - @0x/asset-buyer@3.0.1 - @0x/base-contract@3.0.7 - @0x/connect@3.0.7 - @0x/contract-addresses@1.2.0 - @0x/contract-wrappers@4.1.0 - contracts@2.1.55 - @0x/dev-tools-pages@0.0.7 - @0x/dev-utils@1.0.18 - @0x/fill-scenarios@1.0.13 - @0x/instant@1.0.1 - @0x/json-schemas@2.1.2 - @0x/metacoin@0.0.29 - @0x/migrations@2.1.0 - @0x/monorepo-scripts@1.0.14 - @0x/order-utils@3.0.3 - @0x/order-watcher@2.2.5 - @0x/react-docs@1.0.19 - @0x/react-shared@1.0.22 - @0x/sol-compiler@1.1.13 - @0x/sol-cov@2.1.13 - @0x/sol-doc@1.0.8 - @0x/sol-resolver@1.0.17 - @0x/sra-spec@1.0.11 - @0x/subproviders@2.1.5 - @0x/testnet-faucets@1.0.57 - @0x/types@1.3.0 - @0x/utils@2.0.6 - @0x/web3-wrapper@3.1.5 - @0x/website@0.0.60 --- packages/json-schemas/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index fb89a2d5b..da3231b57 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0x/json-schemas", - "version": "2.1.1", + "version": "2.1.2", "engines": { "node": ">=6.12" }, @@ -46,7 +46,7 @@ }, "devDependencies": { "@0x/tslint-config": "^1.0.10", - "@0x/utils": "^2.0.5", + "@0x/utils": "^2.0.6", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", -- cgit v1.2.3 From 86f1697934436faa6c0c2aea7c958b7d0f3496ba Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 10 Dec 2018 15:06:05 -0800 Subject: Updated CHANGELOGS --- packages/json-schemas/CHANGELOG.json | 9 +++++++++ packages/json-schemas/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 17cabc473..aabcf7bec 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1544482891, + "version": "2.1.3", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "timestamp": 1542821676, "version": "2.1.2", diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index 2f39c9596..2e3daa711 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.1.3 - _December 10, 2018_ + + * Dependencies updated + ## v2.1.2 - _November 21, 2018_ * Dependencies updated -- cgit v1.2.3 From e2b0c4d116acd6a707596574c6851d73c29e5092 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 11 Dec 2018 15:38:32 -0800 Subject: Updated CHANGELOGS --- packages/json-schemas/CHANGELOG.json | 4 ++-- packages/json-schemas/CHANGELOG.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index aabcf7bec..07649aa60 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,12 +1,12 @@ [ { - "timestamp": 1544482891, "version": "2.1.3", "changes": [ { "note": "Dependencies updated" } - ] + ], + "timestamp": 1544570656 }, { "timestamp": 1542821676, diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index 2e3daa711..cb5d315c2 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,7 +5,7 @@ Edit the package's CHANGELOG.json file only. CHANGELOG -## v2.1.3 - _December 10, 2018_ +## v2.1.3 - _December 11, 2018_ * Dependencies updated -- cgit v1.2.3 From 96b8100a787d00142dcf875d940c9125571cbde6 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 11 Dec 2018 15:38:43 -0800 Subject: Publish - 0x.js@2.0.7 - @0x/abi-gen@1.0.18 - @0x/abi-gen-wrappers@2.0.1 - @0x/assert@1.0.19 - @0x/asset-buyer@3.0.3 - @0x/base-contract@3.0.9 - @0x/connect@3.0.9 - @0x/contract-wrappers@4.1.2 - @0x/dev-tools-pages@0.0.9 - @0x/dev-utils@1.0.20 - ethereum-types@1.1.3 - @0x/fill-scenarios@1.0.15 - @0x/instant@1.0.3 - @0x/json-schemas@2.1.3 - @0x/metacoin@0.0.31 - @0x/migrations@2.2.1 - @0x/monorepo-scripts@1.0.15 - @0x/order-utils@3.0.6 - @0x/order-watcher@2.2.7 - @0x/pipeline@1.0.1 - @0x/react-docs@1.0.21 - @0x/react-shared@1.0.24 - @0x/sol-compiler@1.1.15 - @0x/sol-cov@2.1.15 - @0x/sol-doc@1.0.10 - @0x/sol-resolver@1.1.0 - @0x/sra-spec@1.0.12 - @0x/subproviders@2.1.7 - @0x/testnet-faucets@1.0.59 - @0x/types@1.4.0 - @0x/typescript-typings@3.0.5 - @0x/utils@2.0.7 - @0x/web3-wrapper@3.2.0 - @0x/website@0.0.62 - @0x/contracts-examples@1.0.1 - @0x/contracts-extensions@1.0.1 - @0x/contracts-interfaces@1.0.1 - @0x/contracts-libs@1.0.1 - @0x/contracts-multisig@1.0.1 - @0x/contracts-protocol@2.1.57 - @0x/contracts-test-utils@1.0.1 - @0x/contracts-tokens@1.0.1 - @0x/contracts-utils@1.0.1 --- packages/json-schemas/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index da3231b57..01662beed 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0x/json-schemas", - "version": "2.1.2", + "version": "2.1.3", "engines": { "node": ">=6.12" }, @@ -39,14 +39,14 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { - "@0x/typescript-typings": "^3.0.4", + "@0x/typescript-typings": "^3.0.5", "@types/node": "*", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, "devDependencies": { "@0x/tslint-config": "^1.0.10", - "@0x/utils": "^2.0.6", + "@0x/utils": "^2.0.7", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", -- cgit v1.2.3 From 597b2f38f50485e00b99dcfdce400b246141e5a3 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:04:56 -0800 Subject: Updated CHANGELOGS --- packages/json-schemas/CHANGELOG.json | 9 +++++++++ packages/json-schemas/CHANGELOG.md | 4 ++++ 2 files changed, 13 insertions(+) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 07649aa60..519026266 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,4 +1,13 @@ [ + { + "timestamp": 1544738225, + "version": "2.1.4", + "changes": [ + { + "note": "Dependencies updated" + } + ] + }, { "version": "2.1.3", "changes": [ diff --git a/packages/json-schemas/CHANGELOG.md b/packages/json-schemas/CHANGELOG.md index cb5d315c2..7e407bdda 100644 --- a/packages/json-schemas/CHANGELOG.md +++ b/packages/json-schemas/CHANGELOG.md @@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only. CHANGELOG +## v2.1.4 - _December 13, 2018_ + + * Dependencies updated + ## v2.1.3 - _December 11, 2018_ * Dependencies updated -- cgit v1.2.3 From 3c578cfda9b9c05c9c113921fa451a06f27caa7b Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:28:17 -0800 Subject: Updated CHANGELOGS --- packages/json-schemas/CHANGELOG.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/CHANGELOG.json b/packages/json-schemas/CHANGELOG.json index 519026266..201190145 100644 --- a/packages/json-schemas/CHANGELOG.json +++ b/packages/json-schemas/CHANGELOG.json @@ -1,12 +1,12 @@ [ { - "timestamp": 1544738225, "version": "2.1.4", "changes": [ { "note": "Dependencies updated" } - ] + ], + "timestamp": 1544739608 }, { "version": "2.1.3", -- cgit v1.2.3 From 2abd8fe4ee860e5a4008a9f92f6d29239d14b2bc Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Dec 2018 14:28:27 -0800 Subject: Publish - 0x.js@2.0.8 - @0x/abi-gen@1.0.19 - @0x/abi-gen-wrappers@2.0.2 - @0x/assert@1.0.20 - @0x/asset-buyer@3.0.4 - @0x/base-contract@3.0.10 - @0x/connect@3.0.10 - @0x/contract-wrappers@4.1.3 - @0x/dev-tools-pages@0.0.10 - @0x/dev-utils@1.0.21 - ethereum-types@1.1.4 - @0x/fill-scenarios@1.0.16 - @0x/instant@1.0.4 - @0x/json-schemas@2.1.4 - @0x/metacoin@0.0.32 - @0x/migrations@2.2.2 - @0x/order-utils@3.0.7 - @0x/order-watcher@2.2.8 - @0x/pipeline@1.0.2 - @0x/react-docs@1.0.22 - @0x/react-shared@1.0.25 - @0x/sol-compiler@1.1.16 - @0x/sol-cov@2.1.16 - @0x/sol-doc@1.0.11 - @0x/sol-resolver@1.1.1 - @0x/sra-spec@1.0.13 - @0x/subproviders@2.1.8 - @0x/testnet-faucets@1.0.60 - @0x/tslint-config@2.0.0 - @0x/types@1.4.1 - @0x/typescript-typings@3.0.6 - @0x/utils@2.0.8 - @0x/web3-wrapper@3.2.1 - @0x/website@0.0.63 - @0x/contracts-examples@1.0.1 - @0x/contracts-extensions@1.0.1 - @0x/contracts-interfaces@1.0.1 - @0x/contracts-libs@1.0.1 - @0x/contracts-multisig@1.0.1 - @0x/contracts-protocol@2.1.58 - @0x/contracts-test-utils@1.0.2 - @0x/contracts-tokens@1.0.1 - @0x/contracts-utils@1.0.1 --- packages/json-schemas/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/package.json b/packages/json-schemas/package.json index 01662beed..57dd9dc00 100644 --- a/packages/json-schemas/package.json +++ b/packages/json-schemas/package.json @@ -1,6 +1,6 @@ { "name": "@0x/json-schemas", - "version": "2.1.3", + "version": "2.1.4", "engines": { "node": ">=6.12" }, @@ -39,14 +39,14 @@ }, "homepage": "https://github.com/0xProject/0x-monorepo/packages/json-schemas/README.md", "dependencies": { - "@0x/typescript-typings": "^3.0.5", + "@0x/typescript-typings": "^3.0.6", "@types/node": "*", "jsonschema": "^1.2.0", "lodash.values": "^4.3.0" }, "devDependencies": { - "@0x/tslint-config": "^1.0.10", - "@0x/utils": "^2.0.7", + "@0x/tslint-config": "^2.0.0", + "@0x/utils": "^2.0.8", "@types/lodash.foreach": "^4.5.3", "@types/lodash.values": "^4.3.3", "@types/mocha": "^2.2.42", -- cgit v1.2.3 From ee4185ab465c76b64b65efefb92e11b0ca4ecad4 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 16 Dec 2018 16:52:37 -0800 Subject: Move OrderWatcher Websocket schemas to json-schemas and convert to JSON so that they are language agnostic --- .../order_watcher_web_socket_request_schema.json | 52 ++++++++++++++++++++++ ...der_watcher_web_socket_utf8_message_schema.json | 10 +++++ packages/json-schemas/src/schemas.ts | 4 ++ packages/json-schemas/tsconfig.json | 2 + 4 files changed, 68 insertions(+) create mode 100644 packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json create mode 100644 packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json b/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json new file mode 100644 index 000000000..4666c6291 --- /dev/null +++ b/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json @@ -0,0 +1,52 @@ +{ + "id": "/orderWatcherWebSocketRequestSchema", + "type": "object", + "definitions": { + "signedOrderParam": { + "type": "object", + "properties": { + "signedOrder": { "$ref": "/signedOrderSchema" } + }, + "required": ["signedOrder"] + }, + "orderHashParam": { + "type": "object", + "properties": { + "orderHash": { "$ref": "/hexSchema" } + }, + "required": ["orderHash"] + } + }, + "oneOf": [ + { + "type": "object", + "properties": { + "id": { "type": "string" }, + "jsonrpc": { "type": "string" }, + "method": { "enum": ["ADD_ORDER"] }, + "params": { "$ref": "#/definitions/signedOrderParam" } + }, + "required": ["id", "jsonrpc", "method", "params"] + }, + { + "type": "object", + "properties": { + "id": { "type": "string" }, + "jsonrpc": { "type": "string" }, + "method": { "enum": ["REMOVE_ORDER"] }, + "params": { "$ref": "#/definitions/orderHashParam" } + }, + "required": ["id", "jsonrpc", "method", "params"] + }, + { + "type": "object", + "properties": { + "id": { "type": "string" }, + "jsonrpc": { "type": "string" }, + "method": { "enum": ["GET_STATS"] }, + "params": {} + }, + "required": ["id", "jsonrpc", "method"] + } + ] +} \ No newline at end of file diff --git a/packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json b/packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json new file mode 100644 index 000000000..154d6d754 --- /dev/null +++ b/packages/json-schemas/schemas/order_watcher_web_socket_utf8_message_schema.json @@ -0,0 +1,10 @@ +{ + "id": "/orderWatcherWebSocketUtf8MessageSchema", + "properties": { + "utf8Data": { "type": "string" } + }, + "required": [ + "utf8Data" + ], + "type": "object" +} diff --git a/packages/json-schemas/src/schemas.ts b/packages/json-schemas/src/schemas.ts index 21a6f424c..050f4e625 100644 --- a/packages/json-schemas/src/schemas.ts +++ b/packages/json-schemas/src/schemas.ts @@ -16,6 +16,8 @@ import * as orderFillOrKillRequestsSchema from '../schemas/order_fill_or_kill_re import * as orderFillRequestsSchema from '../schemas/order_fill_requests_schema.json'; import * as orderHashSchema from '../schemas/order_hash_schema.json'; import * as orderSchema from '../schemas/order_schema.json'; +import * as orderWatcherWebSocketRequestSchema from '../schemas/order_watcher_web_socket_request_schema.json'; +import * as orderWatcherWebSocketUtf8MessageSchema from '../schemas/order_watcher_web_socket_utf8_message_schema.json'; import * as orderBookRequestSchema from '../schemas/orderbook_request_schema.json'; import * as ordersRequestOptsSchema from '../schemas/orders_request_opts_schema.json'; import * as ordersSchema from '../schemas/orders_schema.json'; @@ -66,6 +68,8 @@ export const schemas = { jsNumber, requestOptsSchema, pagedRequestOptsSchema, + orderWatcherWebSocketRequestSchema, + orderWatcherWebSocketUtf8MessageSchema, ordersRequestOptsSchema, orderBookRequestSchema, orderConfigRequestSchema, diff --git a/packages/json-schemas/tsconfig.json b/packages/json-schemas/tsconfig.json index a79d54385..ec573290c 100644 --- a/packages/json-schemas/tsconfig.json +++ b/packages/json-schemas/tsconfig.json @@ -23,6 +23,8 @@ "./schemas/order_schema.json", "./schemas/signed_order_schema.json", "./schemas/orders_schema.json", + "./schemas/order_watcher_web_socket_request_schema.json", + "./schemas/order_watcher_web_socket_utf8_message_schema.json", "./schemas/paginated_collection_schema.json", "./schemas/relayer_api_asset_data_pairs_response_schema.json", "./schemas/relayer_api_asset_data_pairs_schema.json", -- cgit v1.2.3 From 896c8d17c16c4f1e9670ab0747ae8934ce5400a5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 16 Dec 2018 17:31:38 -0800 Subject: Fix schemas and tests --- .../schemas/order_watcher_web_socket_request_schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json b/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json index 4666c6291..b0c419f94 100644 --- a/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json +++ b/packages/json-schemas/schemas/order_watcher_web_socket_request_schema.json @@ -21,7 +21,7 @@ { "type": "object", "properties": { - "id": { "type": "string" }, + "id": { "type": "number" }, "jsonrpc": { "type": "string" }, "method": { "enum": ["ADD_ORDER"] }, "params": { "$ref": "#/definitions/signedOrderParam" } @@ -31,7 +31,7 @@ { "type": "object", "properties": { - "id": { "type": "string" }, + "id": { "type": "number" }, "jsonrpc": { "type": "string" }, "method": { "enum": ["REMOVE_ORDER"] }, "params": { "$ref": "#/definitions/orderHashParam" } @@ -41,7 +41,7 @@ { "type": "object", "properties": { - "id": { "type": "string" }, + "id": { "type": "number" }, "jsonrpc": { "type": "string" }, "method": { "enum": ["GET_STATS"] }, "params": {} -- cgit v1.2.3 From a3eab71908cd2e188438b4d411b7c426c874f0b2 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Fri, 28 Dec 2018 15:08:15 -0500 Subject: Correct inconsistencies in JSON schema names In both ref ID's and file names. --- packages/json-schemas/schemas/asset_pairs_request_opts_schema.json | 2 +- packages/json-schemas/schemas/call_data_schema.json | 6 +++--- packages/json-schemas/schemas/ec_signature_schema.json | 2 +- packages/json-schemas/schemas/js_number.json | 5 ----- packages/json-schemas/schemas/js_number_schema.json | 5 +++++ packages/json-schemas/schemas/order_config_request_schema.json | 2 +- packages/json-schemas/schemas/orderbook_request_schema.json | 4 ++-- packages/json-schemas/schemas/orders_request_opts_schema.json | 2 +- packages/json-schemas/schemas/paged_request_opts_schema.json | 2 +- packages/json-schemas/schemas/request_opts_schema.json | 2 +- packages/json-schemas/schemas/tx_data_schema.json | 6 +++--- packages/json-schemas/src/schemas.ts | 2 +- packages/json-schemas/tsconfig.json | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 packages/json-schemas/schemas/js_number.json create mode 100644 packages/json-schemas/schemas/js_number_schema.json (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/schemas/asset_pairs_request_opts_schema.json b/packages/json-schemas/schemas/asset_pairs_request_opts_schema.json index 174a8fdc3..fad0bd371 100644 --- a/packages/json-schemas/schemas/asset_pairs_request_opts_schema.json +++ b/packages/json-schemas/schemas/asset_pairs_request_opts_schema.json @@ -1,5 +1,5 @@ { - "id": "/AssetPairsRequestOpts", + "id": "/AssetPairsRequestOptsSchema", "type": "object", "properties": { "assetDataA": { "$ref": "/hexSchema" }, diff --git a/packages/json-schemas/schemas/call_data_schema.json b/packages/json-schemas/schemas/call_data_schema.json index c5972e8c1..e5e6e3282 100644 --- a/packages/json-schemas/schemas/call_data_schema.json +++ b/packages/json-schemas/schemas/call_data_schema.json @@ -4,13 +4,13 @@ "from": { "$ref": "/addressSchema" }, "to": { "$ref": "/addressSchema" }, "value": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }] + "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }] }, "gas": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }] + "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }] }, "gasPrice": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }] + "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }] }, "data": { "type": "string", diff --git a/packages/json-schemas/schemas/ec_signature_schema.json b/packages/json-schemas/schemas/ec_signature_schema.json index bc79ca5e9..52ccfe7bb 100644 --- a/packages/json-schemas/schemas/ec_signature_schema.json +++ b/packages/json-schemas/schemas/ec_signature_schema.json @@ -1,5 +1,5 @@ { - "id": "/ECSignature", + "id": "/ecSignatureSchema", "properties": { "v": { "type": "number", diff --git a/packages/json-schemas/schemas/js_number.json b/packages/json-schemas/schemas/js_number.json deleted file mode 100644 index 6a72d92c0..000000000 --- a/packages/json-schemas/schemas/js_number.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "id": "/jsNumber", - "type": "number", - "minimum": 0 -} diff --git a/packages/json-schemas/schemas/js_number_schema.json b/packages/json-schemas/schemas/js_number_schema.json new file mode 100644 index 000000000..7df1c4747 --- /dev/null +++ b/packages/json-schemas/schemas/js_number_schema.json @@ -0,0 +1,5 @@ +{ + "id": "/jsNumberSchema", + "type": "number", + "minimum": 0 +} diff --git a/packages/json-schemas/schemas/order_config_request_schema.json b/packages/json-schemas/schemas/order_config_request_schema.json index ca9b2e30e..19b043e7f 100644 --- a/packages/json-schemas/schemas/order_config_request_schema.json +++ b/packages/json-schemas/schemas/order_config_request_schema.json @@ -1,5 +1,5 @@ { - "id": "/OrderConfigRequest", + "id": "/OrderConfigRequestSchema", "type": "object", "properties": { "makerAddress": { "$ref": "/addressSchema" }, diff --git a/packages/json-schemas/schemas/orderbook_request_schema.json b/packages/json-schemas/schemas/orderbook_request_schema.json index 27848bdcb..5ce6e8ab0 100644 --- a/packages/json-schemas/schemas/orderbook_request_schema.json +++ b/packages/json-schemas/schemas/orderbook_request_schema.json @@ -1,9 +1,9 @@ { - "id": "/OrderBookRequest", + "id": "/OrderbookRequestSchema", "type": "object", "properties": { "baseAssetData": { "$ref": "/hexSchema" }, "quoteAssetData": { "$ref": "/hexSchema" } }, "required": ["baseAssetData", "quoteAssetData"] -} \ No newline at end of file +} diff --git a/packages/json-schemas/schemas/orders_request_opts_schema.json b/packages/json-schemas/schemas/orders_request_opts_schema.json index 10da51060..4c1b9b4e9 100644 --- a/packages/json-schemas/schemas/orders_request_opts_schema.json +++ b/packages/json-schemas/schemas/orders_request_opts_schema.json @@ -1,5 +1,5 @@ { - "id": "/OrdersRequestOpts", + "id": "/OrdersRequestOptsSchema", "type": "object", "properties": { "makerAssetProxyId": { "$ref": "/hexSchema" }, diff --git a/packages/json-schemas/schemas/paged_request_opts_schema.json b/packages/json-schemas/schemas/paged_request_opts_schema.json index 7cfc73947..f143c28b0 100644 --- a/packages/json-schemas/schemas/paged_request_opts_schema.json +++ b/packages/json-schemas/schemas/paged_request_opts_schema.json @@ -1,5 +1,5 @@ { - "id": "/PagedRequestOpts", + "id": "/PagedRequestOptsSchema", "type": "object", "properties": { "page": { "type": "number" }, diff --git a/packages/json-schemas/schemas/request_opts_schema.json b/packages/json-schemas/schemas/request_opts_schema.json index b50547d18..2206f5016 100644 --- a/packages/json-schemas/schemas/request_opts_schema.json +++ b/packages/json-schemas/schemas/request_opts_schema.json @@ -1,5 +1,5 @@ { - "id": "/RequestOpts", + "id": "/RequestOptsSchema", "type": "object", "properties": { "networkId": { "type": "number" } diff --git a/packages/json-schemas/schemas/tx_data_schema.json b/packages/json-schemas/schemas/tx_data_schema.json index 4643521ce..8c3daba4e 100644 --- a/packages/json-schemas/schemas/tx_data_schema.json +++ b/packages/json-schemas/schemas/tx_data_schema.json @@ -4,13 +4,13 @@ "from": { "$ref": "/addressSchema" }, "to": { "$ref": "/addressSchema" }, "value": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }] + "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }] }, "gas": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }] + "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }] }, "gasPrice": { - "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumber" }] + "oneOf": [{ "$ref": "/numberSchema" }, { "$ref": "/jsNumberSchema" }] }, "data": { "type": "string", diff --git a/packages/json-schemas/src/schemas.ts b/packages/json-schemas/src/schemas.ts index 21a6f424c..44673383d 100644 --- a/packages/json-schemas/src/schemas.ts +++ b/packages/json-schemas/src/schemas.ts @@ -8,7 +8,7 @@ import * as ecSignatureSchema from '../schemas/ec_signature_schema.json'; import * as eip712TypedDataSchema from '../schemas/eip712_typed_data_schema.json'; import * as hexSchema from '../schemas/hex_schema.json'; import * as indexFilterValuesSchema from '../schemas/index_filter_values_schema.json'; -import * as jsNumber from '../schemas/js_number.json'; +import * as jsNumber from '../schemas/js_number_schema.json'; import * as numberSchema from '../schemas/number_schema.json'; import * as orderCancellationRequestsSchema from '../schemas/order_cancel_schema.json'; import * as orderConfigRequestSchema from '../schemas/order_config_request_schema.json'; diff --git a/packages/json-schemas/tsconfig.json b/packages/json-schemas/tsconfig.json index a79d54385..11e68b6fb 100644 --- a/packages/json-schemas/tsconfig.json +++ b/packages/json-schemas/tsconfig.json @@ -40,7 +40,7 @@ "./schemas/relayer_api_orders_schema.json", "./schemas/signed_orders_schema.json", "./schemas/token_schema.json", - "./schemas/js_number.json", + "./schemas/js_number_schema.json", "./schemas/zero_ex_transaction_schema.json", "./schemas/tx_data_schema.json", "./schemas/index_filter_values_schema.json", -- cgit v1.2.3 From e2df4b355ba97e4212f5e42251defe8d9e432763 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 8 Jan 2019 17:07:10 +0100 Subject: Add assertions to catch trying to add undefined schemas --- packages/json-schemas/src/schema_validator.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/src/schema_validator.ts b/packages/json-schemas/src/schema_validator.ts index 3f303137b..6ccd981be 100644 --- a/packages/json-schemas/src/schema_validator.ts +++ b/packages/json-schemas/src/schema_validator.ts @@ -8,12 +8,18 @@ import { schemas } from './schemas'; */ export class SchemaValidator { private readonly _validator: Validator; + private static _assertSchemaNotUndefined(schema: Schema): void { + if (schema === undefined) { + throw new Error(`Cannot add undefined schema`); + } + } /** * Instantiates a SchemaValidator instance */ constructor() { this._validator = new Validator(); for (const schema of values(schemas)) { + SchemaValidator._assertSchemaNotUndefined(schema); this._validator.addSchema(schema, schema.id); } } @@ -24,6 +30,7 @@ export class SchemaValidator { * @param schema The schema to add */ public addSchema(schema: Schema): void { + SchemaValidator._assertSchemaNotUndefined(schema); this._validator.addSchema(schema, schema.id); } // In order to validate a complex JS object using jsonschema, we must replace any complex @@ -37,6 +44,8 @@ export class SchemaValidator { * @returns The results of the validation */ public validate(instance: any, schema: Schema): ValidatorResult { + console.log('validating....'); + SchemaValidator._assertSchemaNotUndefined(schema); const jsonSchemaCompatibleObject = JSON.parse(JSON.stringify(instance)); return this._validator.validate(jsonSchemaCompatibleObject, schema); } -- cgit v1.2.3 From 0cfeea7c8c9b4c07cc53b3a47bfd01e6b1c81281 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 8 Jan 2019 17:15:05 +0100 Subject: Remove stray console --- packages/json-schemas/src/schema_validator.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/src/schema_validator.ts b/packages/json-schemas/src/schema_validator.ts index 6ccd981be..8fadae97a 100644 --- a/packages/json-schemas/src/schema_validator.ts +++ b/packages/json-schemas/src/schema_validator.ts @@ -44,7 +44,6 @@ export class SchemaValidator { * @returns The results of the validation */ public validate(instance: any, schema: Schema): ValidatorResult { - console.log('validating....'); SchemaValidator._assertSchemaNotUndefined(schema); const jsonSchemaCompatibleObject = JSON.parse(JSON.stringify(instance)); return this._validator.validate(jsonSchemaCompatibleObject, schema); -- cgit v1.2.3 From 28aa12691e00344fe80bd022188a1e7657397aa5 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 9 Jan 2019 11:06:15 +0100 Subject: rename method --- packages/json-schemas/src/schema_validator.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'packages/json-schemas') diff --git a/packages/json-schemas/src/schema_validator.ts b/packages/json-schemas/src/schema_validator.ts index 8fadae97a..43647b594 100644 --- a/packages/json-schemas/src/schema_validator.ts +++ b/packages/json-schemas/src/schema_validator.ts @@ -8,7 +8,7 @@ import { schemas } from './schemas'; */ export class SchemaValidator { private readonly _validator: Validator; - private static _assertSchemaNotUndefined(schema: Schema): void { + private static _assertSchemaDefined(schema: Schema): void { if (schema === undefined) { throw new Error(`Cannot add undefined schema`); } @@ -19,7 +19,7 @@ export class SchemaValidator { constructor() { this._validator = new Validator(); for (const schema of values(schemas)) { - SchemaValidator._assertSchemaNotUndefined(schema); + SchemaValidator._assertSchemaDefined(schema); this._validator.addSchema(schema, schema.id); } } @@ -30,7 +30,7 @@ export class SchemaValidator { * @param schema The schema to add */ public addSchema(schema: Schema): void { - SchemaValidator._assertSchemaNotUndefined(schema); + SchemaValidator._assertSchemaDefined(schema); this._validator.addSchema(schema, schema.id); } // In order to validate a complex JS object using jsonschema, we must replace any complex @@ -44,7 +44,7 @@ export class SchemaValidator { * @returns The results of the validation */ public validate(instance: any, schema: Schema): ValidatorResult { - SchemaValidator._assertSchemaNotUndefined(schema); + SchemaValidator._assertSchemaDefined(schema); const jsonSchemaCompatibleObject = JSON.parse(JSON.stringify(instance)); return this._validator.validate(jsonSchemaCompatibleObject, schema); } -- cgit v1.2.3