Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demos/simple-storage/dapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions demos/simple-storage/protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions packages/js/client/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/js/core/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/js/plugins/ens/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions packages/js/plugins/ethereum/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions packages/js/plugins/graph-node/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions packages/js/plugins/http/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
12 changes: 5 additions & 7 deletions packages/js/plugins/http/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/js/plugins/http/src/__tests__/e2e/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'}"
}
)
Expand Down Expand Up @@ -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"}]
Expand Down
9 changes: 5 additions & 4 deletions packages/js/plugins/http/src/__tests__/unit/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HttpPlugin } from "../../index";

import axios, { AxiosResponse, AxiosRequestConfig } from "axios";
import { ResponseType } from "../../types";

// mock axios
jest.mock("axios");
Expand Down Expand Up @@ -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", {
Expand Down Expand Up @@ -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", {
Expand Down Expand Up @@ -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}", {
Expand Down Expand Up @@ -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}", {
Expand Down
6 changes: 4 additions & 2 deletions packages/js/plugins/http/src/__tests__/unit/util.test.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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",
});

Expand All @@ -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",
});

Expand Down
5 changes: 4 additions & 1 deletion packages/js/plugins/http/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export class UrlParam {
value: string;
}

export type ResponseType = "TEXT" | "BINARY";
export enum ResponseType {
TEXT,
BINARY,
}

export class Request {
headers?: Header[];
Expand Down
5 changes: 3 additions & 2 deletions packages/js/plugins/http/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, Header } from "./types";
import { Request, Response, Header, ResponseType } from "./types";

import { AxiosResponse, AxiosRequestConfig } from "axios";

Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/js/plugins/ipfs/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion packages/manifest-schema/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/schema/bind/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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": {
Expand Down
Loading