diff --git a/demos/simple-storage/dapp/package.json b/demos/simple-storage/dapp/package.json index 417336db41..6c7a8a7cd4 100644 --- a/demos/simple-storage/dapp/package.json +++ b/demos/simple-storage/dapp/package.json @@ -2,14 +2,14 @@ "name": "@web3api/demo-simple-storage-dapp", "description": "Web3API SimpleStorage dApp Demo", "private": true, - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", "url": "https://github.com/web3-api/monorepo.git" }, "dependencies": { - "@web3api/client-js": "0.0.1-prealpha.4", + "@web3api/client-js": "0.0.1-prealpha.5", "react": "^16.13.1", "react-dom": "^16.13.1", "react-lottie": "1.2.3", diff --git a/demos/simple-storage/protocol/package.json b/demos/simple-storage/protocol/package.json index 9ca78deb33..caa92e2816 100644 --- a/demos/simple-storage/protocol/package.json +++ b/demos/simple-storage/protocol/package.json @@ -2,7 +2,7 @@ "name": "@web3api/demo-simple-storage", "description": "Web3API SimpleStorage Demo", "private": true, - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -15,9 +15,9 @@ "test:env:down": "npx w3 test-env down" }, "devDependencies": { - "@web3api/cli": "0.0.1-prealpha.4", - "@web3api/ethereum-plugin-js": "0.0.1-prealpha.4", - "@web3api/wasm-as": "0.0.1-prealpha.4", + "@web3api/cli": "0.0.1-prealpha.5", + "@web3api/ethereum-plugin-js": "0.0.1-prealpha.5", + "@web3api/wasm-as": "0.0.1-prealpha.5", "ethers": "5.0.8", "js-yaml": "3.14.0" } diff --git a/packages/cli/package.json b/packages/cli/package.json index e1a6ce374f..3c69998bf1 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/cli", "description": "Web3API CLI", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -22,15 +22,15 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/client-js": "0.0.1-prealpha.4", - "@web3api/client-test-env": "0.0.1-prealpha.4", - "@web3api/core-js": "0.0.1-prealpha.4", - "@web3api/ens-plugin-js": "0.0.1-prealpha.4", - "@web3api/ethereum-plugin-js": "0.0.1-prealpha.4", - "@web3api/ipfs-plugin-js": "0.0.1-prealpha.4", - "@web3api/schema-bind": "0.0.1-prealpha.4", - "@web3api/schema-compose": "0.0.1-prealpha.4", - "@web3api/schema-parse": "0.0.1-prealpha.4", + "@web3api/client-js": "0.0.1-prealpha.5", + "@web3api/client-test-env": "0.0.1-prealpha.5", + "@web3api/core-js": "0.0.1-prealpha.5", + "@web3api/ens-plugin-js": "0.0.1-prealpha.5", + "@web3api/ethereum-plugin-js": "0.0.1-prealpha.5", + "@web3api/ipfs-plugin-js": "0.0.1-prealpha.5", + "@web3api/schema-bind": "0.0.1-prealpha.5", + "@web3api/schema-compose": "0.0.1-prealpha.5", + "@web3api/schema-parse": "0.0.1-prealpha.5", "assemblyscript": "0.17.14", "axios": "0.19.2", "chalk": "4.1.0", diff --git a/packages/js/client/package.json b/packages/js/client/package.json index b8533e78a7..26a6c82226 100644 --- a/packages/js/client/package.json +++ b/packages/js/client/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/client-js", "description": "Web3API Javascript Client", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -24,11 +24,11 @@ }, "dependencies": { "@msgpack/msgpack": "2.3.0", - "@web3api/core-js": "0.0.1-prealpha.4", - "@web3api/ens-plugin-js": "0.0.1-prealpha.4", - "@web3api/ethereum-plugin-js": "0.0.1-prealpha.4", - "@web3api/ipfs-plugin-js": "0.0.1-prealpha.4", - "@web3api/schema-parse": "0.0.1-prealpha.4", + "@web3api/core-js": "0.0.1-prealpha.5", + "@web3api/ens-plugin-js": "0.0.1-prealpha.5", + "@web3api/ethereum-plugin-js": "0.0.1-prealpha.5", + "@web3api/ipfs-plugin-js": "0.0.1-prealpha.5", + "@web3api/schema-parse": "0.0.1-prealpha.5", "graphql": "^15.4.0", "js-yaml": "3.14.0", "web-worker": "1.0.0" @@ -37,8 +37,8 @@ "@types/jest": "26.0.8", "@types/js-yaml": "3.11.1", "@types/semver": "^7.3.4", + "@web3api/cli": "0.0.1-prealpha.5", "@web3api/test-cases": "0.0.1-prealpha.1", - "@web3api/cli": "0.0.1-prealpha.4", "axios": "0.19.2", "jest": "26.2.2", "rimraf": "3.0.2", diff --git a/packages/js/core/package.json b/packages/js/core/package.json index 3d79a69dd2..722f81f757 100644 --- a/packages/js/core/package.json +++ b/packages/js/core/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/core-js", "description": "Web3API Javascript Core", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/manifest-schema": "0.0.1-prealpha.4", + "@web3api/manifest-schema": "0.0.1-prealpha.5", "graphql": "15.3.0", "graphql-tag": "2.10.4", "js-yaml": "3.14.0", diff --git a/packages/js/plugins/ens/package.json b/packages/js/plugins/ens/package.json index f3649284ae..c49074102d 100644 --- a/packages/js/plugins/ens/package.json +++ b/packages/js/plugins/ens/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/ens-plugin-js", "description": "Web3API ENS Javascript Plugin", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/core-js": "0.0.1-prealpha.4", + "@web3api/core-js": "0.0.1-prealpha.5", "ethers": "5.0.7" }, "devDependencies": { diff --git a/packages/js/plugins/ethereum/package.json b/packages/js/plugins/ethereum/package.json index b49dce0c21..20729eb4c9 100644 --- a/packages/js/plugins/ethereum/package.json +++ b/packages/js/plugins/ethereum/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/ethereum-plugin-js", "description": "Web3API Ethereum Javascript Plugin", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/core-js": "0.0.1-prealpha.4", + "@web3api/core-js": "0.0.1-prealpha.5", "ethers": "5.0.7" }, "devDependencies": { diff --git a/packages/js/plugins/graph-node/package.json b/packages/js/plugins/graph-node/package.json index e5c3135f30..6f236767aa 100644 --- a/packages/js/plugins/graph-node/package.json +++ b/packages/js/plugins/graph-node/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/graph-node-plugin-js", "description": "Web3API Graph Node Javascript Plugin", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/core-js": "0.0.1-prealpha.4", + "@web3api/core-js": "0.0.1-prealpha.5", "apollo-link": "1.2.14", "apollo-link-http": "1.5.17", "cross-fetch": "3.0.5", diff --git a/packages/js/plugins/http/package.json b/packages/js/plugins/http/package.json index 523f82693a..b7d0d8e677 100644 --- a/packages/js/plugins/http/package.json +++ b/packages/js/plugins/http/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/http-plugin-js", "description": "Web3API HTTP Javascript Plugin", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,12 +20,12 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/core-js": "0.0.1-prealpha.4", + "@web3api/core-js": "0.0.1-prealpha.5", "axios": "0.21.1" }, "devDependencies": { "@types/jest": "26.0.8", - "@web3api/client-js": "0.0.1-prealpha.4", + "@web3api/client-js": "0.0.1-prealpha.5", "jest": "26.2.2", "nock": "13.0.7", "rimraf": "3.0.2", diff --git a/packages/js/plugins/http/schema.graphql b/packages/js/plugins/http/schema.graphql index c28a43c9cf..da6abf4404 100644 --- a/packages/js/plugins/http/schema.graphql +++ b/packages/js/plugins/http/schema.graphql @@ -18,16 +18,14 @@ type Response { type Request { headers: [Header!] urlParams: [UrlParam!] - responseType: String! # "TEXT" || "BINARY" + responseType: ResponseType! body: String } -# Enum types curently not supported -# -# enum ResponseType { -# TEXT -# BINARY -# } +enum ResponseType { + TEXT + BINARY +} type Query { get(url: String!, request: Request): Response diff --git a/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts b/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts index 45c6f498d3..f0e4168220 100644 --- a/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts +++ b/packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts @@ -251,7 +251,7 @@ describe("e2e tests for HttpPlugin", () => { post( url: "http://www.example.com/api" request: { - responseType: BINARY + responseType: 1 body: "{data: 'test-request'}" } ) @@ -293,7 +293,7 @@ describe("e2e tests for HttpPlugin", () => { post( url: "http://www.example.com/api" request: { - responseType: TEXT + responseType: 0 body: "{data: 'test-request'}" urlParams: [{key: "query", value: "foo"}] headers: [{key: "X-Request-Header", value: "req-foo"}] diff --git a/packages/js/plugins/http/src/__tests__/unit/index.test.ts b/packages/js/plugins/http/src/__tests__/unit/index.test.ts index f58140df85..4708063a48 100644 --- a/packages/js/plugins/http/src/__tests__/unit/index.test.ts +++ b/packages/js/plugins/http/src/__tests__/unit/index.test.ts @@ -1,6 +1,7 @@ import { HttpPlugin } from "../../index"; import axios, { AxiosResponse, AxiosRequestConfig } from "axios"; +import { ResponseType } from "../../types"; // mock axios jest.mock("axios"); @@ -35,7 +36,7 @@ describe("test http plugin", () => { { key: "X-Test-Header", value: "test-header-value" }, ], urlParams: [{ key: "q", value: "test-param" }], - responseType: "TEXT", + responseType: ResponseType.TEXT, }); expect(mockedAxios.get).lastCalledWith("/api/test", { @@ -72,7 +73,7 @@ describe("test http plugin", () => { { key: "X-Test-Header", value: "test-header-value" }, ], urlParams: [{ key: "q", value: "test-param" }], - responseType: "BINARY", + responseType: ResponseType.BINARY, }); expect(mockedAxios.get).lastCalledWith("/api/test", { @@ -114,7 +115,7 @@ describe("test http plugin", () => { ], urlParams: [{ key: "q", value: "test-param" }], body: "{request: 1001}", - responseType: "TEXT", + responseType: ResponseType.TEXT, }); expect(mockedAxios.post).lastCalledWith("/api/test", "{request: 1001}", { @@ -152,7 +153,7 @@ describe("test http plugin", () => { ], urlParams: [{ key: "q", value: "test-param" }], body: "{request: 1001}", - responseType: "BINARY", + responseType: ResponseType.BINARY, }); expect(mockedAxios.post).lastCalledWith("/api/test", "{request: 1001}", { diff --git a/packages/js/plugins/http/src/__tests__/unit/util.test.ts b/packages/js/plugins/http/src/__tests__/unit/util.test.ts index 479274ce0c..c3a39367d8 100644 --- a/packages/js/plugins/http/src/__tests__/unit/util.test.ts +++ b/packages/js/plugins/http/src/__tests__/unit/util.test.ts @@ -1,6 +1,8 @@ import { fromAxiosResponse, toAxiosRequestConfig } from "../../util"; +import { ResponseType } from "../../types"; describe("converting axios response", () => { + test("response type: text", () => { const response = fromAxiosResponse({ status: 200, @@ -45,7 +47,7 @@ describe("creating axios config", () => { { key: "Accept", value: "application-json" }, { key: "X-Header", value: "test-value" }, ], - responseType: "TEXT", + responseType: ResponseType.TEXT, body: "body-content", }); @@ -60,7 +62,7 @@ describe("creating axios config", () => { test("with url params", () => { const config = toAxiosRequestConfig({ urlParams: [{ key: "tag", value: "data" }], - responseType: "BINARY", + responseType: ResponseType.BINARY, body: "body-content", }); diff --git a/packages/js/plugins/http/src/types.ts b/packages/js/plugins/http/src/types.ts index 11dd7e7d3d..ad92d05af4 100644 --- a/packages/js/plugins/http/src/types.ts +++ b/packages/js/plugins/http/src/types.ts @@ -11,7 +11,10 @@ export class UrlParam { value: string; } -export type ResponseType = "TEXT" | "BINARY"; +export enum ResponseType { + TEXT, + BINARY, +} export class Request { headers?: Header[]; diff --git a/packages/js/plugins/http/src/util.ts b/packages/js/plugins/http/src/util.ts index 1f9c9b553e..6f0ac9fa33 100644 --- a/packages/js/plugins/http/src/util.ts +++ b/packages/js/plugins/http/src/util.ts @@ -1,4 +1,4 @@ -import { Request, Response, Header } from "./types"; +import { Request, Response, Header, ResponseType } from "./types"; import { AxiosResponse, AxiosRequestConfig } from "axios"; @@ -50,7 +50,8 @@ export function toAxiosRequestConfig(request: Request): AxiosRequestConfig { }, {}); let config: AxiosRequestConfig = { - responseType: request.responseType == "BINARY" ? "arraybuffer" : "text", + responseType: + request.responseType == ResponseType.BINARY ? "arraybuffer" : "text", }; if (urlParams) { diff --git a/packages/js/plugins/ipfs/package.json b/packages/js/plugins/ipfs/package.json index 7b27fa770c..2e114dddd2 100644 --- a/packages/js/plugins/ipfs/package.json +++ b/packages/js/plugins/ipfs/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/ipfs-plugin-js", "description": "Web3API IPFS Javascript Plugin", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,7 +20,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/core-js": "0.0.1-prealpha.4", + "@web3api/core-js": "0.0.1-prealpha.5", "cids": "^1.1.4", "ipfs-http-client-lite": "0.3.0", "is-ipfs": "1.0.3" diff --git a/packages/manifest-schema/package.json b/packages/manifest-schema/package.json index 69f0423b4b..fa776b8dc0 100644 --- a/packages/manifest-schema/package.json +++ b/packages/manifest-schema/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/manifest-schema", "description": "Web3API Manifest Schema", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", diff --git a/packages/schema/bind/package.json b/packages/schema/bind/package.json index 80138b3741..b4e19dde87 100644 --- a/packages/schema/bind/package.json +++ b/packages/schema/bind/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/schema-bind", "description": "Web3API Schema Binding", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -20,7 +20,7 @@ "copy:templates": "copyfiles -u 1 src/**/*.mustache build/" }, "dependencies": { - "@web3api/schema-parse": "0.0.1-prealpha.4", + "@web3api/schema-parse": "0.0.1-prealpha.5", "mustache": "4.0.1" }, "devDependencies": { diff --git a/packages/schema/compose/package.json b/packages/schema/compose/package.json index 79046ee710..5c78faf412 100644 --- a/packages/schema/compose/package.json +++ b/packages/schema/compose/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/schema-compose", "description": "Web3API Schema Composition", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", @@ -19,7 +19,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/schema-parse": "0.0.1-prealpha.4", + "@web3api/schema-parse": "0.0.1-prealpha.5", "graphql": "15.4.0", "mustache": "4.0.1" }, diff --git a/packages/schema/parse/package.json b/packages/schema/parse/package.json index 97cce3fd66..0d7cfe172f 100644 --- a/packages/schema/parse/package.json +++ b/packages/schema/parse/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/schema-parse", "description": "Web3API Schema Parsing", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", diff --git a/packages/templates/api/assemblyscript/package.json b/packages/templates/api/assemblyscript/package.json index 309db024d8..dc86774f74 100644 --- a/packages/templates/api/assemblyscript/package.json +++ b/packages/templates/api/assemblyscript/package.json @@ -2,7 +2,7 @@ "name": "templates-api-assemblyscript", "description": "Web3API Assemblyscript Template", "private": true, - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "scripts": { "build": "npx w3 build", "contracts:deploy": "node ./deploy-contracts.js", @@ -10,9 +10,9 @@ "test:env:down": "npx w3 test-env down" }, "devDependencies": { - "@web3api/cli": "0.0.1-prealpha.4", - "@web3api/ethereum-plugin-js": "0.0.1-prealpha.4", - "@web3api/wasm-as": "0.0.1-prealpha.4", + "@web3api/cli": "0.0.1-prealpha.5", + "@web3api/ethereum-plugin-js": "0.0.1-prealpha.5", + "@web3api/wasm-as": "0.0.1-prealpha.5", "ethers": "5.0.8", "js-yaml": "3.14.0" } diff --git a/packages/templates/app/react/package.json b/packages/templates/app/react/package.json index 0b84362e58..2dcf5ab6ff 100644 --- a/packages/templates/app/react/package.json +++ b/packages/templates/app/react/package.json @@ -2,14 +2,14 @@ "name": "templates-app-react", "description": "Web3API dApp React Template", "private": true, - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "dependencies": { "@testing-library/react": "^9.3.2", "@testing-library/user-event": "^7.1.2", "@types/node": "^12.0.0", "@types/react": "^16.9.0", "@types/react-dom": "^16.9.0", - "@web3api/client-js": "0.0.1-prealpha.4", + "@web3api/client-js": "0.0.1-prealpha.5", "http-proxy": "1.18.1", "http-proxy-middleware": "1.0.6", "react": "^16.13.1", diff --git a/packages/templates/package.json b/packages/templates/package.json index 5f42997dcb..75c1671320 100644 --- a/packages/templates/package.json +++ b/packages/templates/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/templates", "description": "Web3API Templates", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", diff --git a/packages/templates/plugin/typescript/package.json b/packages/templates/plugin/typescript/package.json index eb0a4ee912..be684046de 100644 --- a/packages/templates/plugin/typescript/package.json +++ b/packages/templates/plugin/typescript/package.json @@ -2,7 +2,7 @@ "name": "templates-plugin-typescript", "description": "Web3API Plugin Typescript Template", "private": true, - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "main": "build/index.js", "scripts": { "build": "rimraf ./build && tsc --project tsconfig.json", @@ -12,7 +12,7 @@ "test:watch": "jest --watch --passWithNoTests --verbose" }, "dependencies": { - "@web3api/core-js": "0.0.1-prealpha.4" + "@web3api/core-js": "0.0.1-prealpha.5" }, "devDependencies": { "@types/jest": "26.0.8", diff --git a/packages/test-env/dev-server/package.json b/packages/test-env/dev-server/package.json index aedd0780d7..68bc6a02f5 100644 --- a/packages/test-env/dev-server/package.json +++ b/packages/test-env/dev-server/package.json @@ -1,6 +1,6 @@ { "name": "@web3api/dev-server", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "private": true, "main": "build/index.js", "scripts": { diff --git a/packages/test-env/package.json b/packages/test-env/package.json index 033bb85ebb..9187b805a9 100644 --- a/packages/test-env/package.json +++ b/packages/test-env/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/client-test-env", "description": "Web3API Client Test Env", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git", diff --git a/packages/wasm/as/package.json b/packages/wasm/as/package.json index 9984923c23..26f7997aae 100644 --- a/packages/wasm/as/package.json +++ b/packages/wasm/as/package.json @@ -1,7 +1,7 @@ { "name": "@web3api/wasm-as", "description": "Web3API Assemblyscript Runtime", - "version": "0.0.1-prealpha.4", + "version": "0.0.1-prealpha.5", "license": "MIT", "repository": { "type": "git",