Comparing version 0.0.3 to 0.0.4
@@ -1,2 +0,2 @@ | ||
import GQLResultInterface, { GQLEdgeInterface, GQLNodeInterface } from "./types"; | ||
import GQLResultInterface, { GQLEdgeInterface, GQLNodeInterface } from "./faces"; | ||
export declare const run: (query: string, variables?: Record<string, unknown> | undefined) => Promise<GQLResultInterface>; | ||
@@ -3,0 +3,0 @@ export declare const all: (query: string, variables?: Record<string, unknown> | undefined) => Promise<GQLEdgeInterface[]>; |
@@ -1,31 +0,8 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var fetch = require('node-fetch'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch); | ||
/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */ | ||
var __assign = function() { | ||
__assign = Object.assign || function __assign(t) { | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
@@ -36,4 +13,3 @@ return t; | ||
}; | ||
function __awaiter(thisArg, _arguments, P, generator) { | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
@@ -46,5 +22,4 @@ return new (P || (P = Promise))(function (resolve, reject) { | ||
}); | ||
} | ||
function __generator(thisArg, body) { | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
@@ -75,6 +50,7 @@ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
} | ||
} | ||
var txQuery = "query($id: ID!) {\n transaction(id: $id) {\n id\n anchor\n signature\n recipient\n owner {\n address\n key\n }\n fee {\n winston\n ar\n }\n quantity {\n winston\n ar\n }\n data {\n size\n type\n }\n tags {\n name\n value\n }\n block {\n id\n timestamp\n height\n previous\n }\n parent {\n id\n }\n }\n}\n"; | ||
}; | ||
exports.__esModule = true; | ||
exports.fetchTxTag = exports.tx = exports.all = exports.run = void 0; | ||
var axios_1 = require("axios"); | ||
var tx_1 = require("./queries/tx"); | ||
var run = function (query, variables) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -87,19 +63,18 @@ var graphql, requestOptions, res; | ||
query: query, | ||
variables: variables, | ||
variables: variables | ||
}); | ||
requestOptions = { | ||
method: "POST", | ||
headers: { | ||
"content-type": "application/json", | ||
"content-type": "application/json" | ||
}, | ||
body: graphql, | ||
data: graphql | ||
}; | ||
return [4 /*yield*/, fetch__default['default']("https://arweave.net/graphql", requestOptions)]; | ||
return [4 /*yield*/, axios_1["default"].get("https://arweave.net/graphql", requestOptions)]; | ||
case 1: | ||
res = _a.sent(); | ||
return [4 /*yield*/, res.clone().json()]; | ||
case 2: return [2 /*return*/, _a.sent()]; | ||
res = (_a.sent()).data; | ||
return [2 /*return*/, res]; | ||
} | ||
}); | ||
}); }; | ||
exports.run = run; | ||
var all = function (query, variables) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -116,3 +91,3 @@ var hasNextPage, edges, cursor, res; | ||
if (!hasNextPage) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, run(query, __assign(__assign({}, variables), { cursor: cursor }))]; | ||
return [4 /*yield*/, exports.run(query, __assign(__assign({}, variables), { cursor: cursor }))]; | ||
case 2: | ||
@@ -130,2 +105,3 @@ res = (_a.sent()).data.transactions; | ||
}); }; | ||
exports.all = all; | ||
var tx = function (id) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -142,3 +118,3 @@ var isBrowser, cache, res, cache; | ||
} | ||
return [4 /*yield*/, run(txQuery, { id: id })]; | ||
return [4 /*yield*/, exports.run(tx_1["default"], { id: id })]; | ||
case 1: | ||
@@ -155,2 +131,3 @@ res = _a.sent(); | ||
}); }; | ||
exports.tx = tx; | ||
var fetchTxTag = function (id, name) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -160,3 +137,3 @@ var res, tag; | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, tx(id)]; | ||
case 0: return [4 /*yield*/, exports.tx(id)]; | ||
case 1: | ||
@@ -171,6 +148,2 @@ res = _a.sent(); | ||
}); }; | ||
exports.all = all; | ||
exports.fetchTxTag = fetchTxTag; | ||
exports.run = run; | ||
exports.tx = tx; |
{ | ||
"name": "ar-gql", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"author": "John Letey <johnletey@gmail.com>", | ||
"repository": "git@github.com:johnletey/arGQL.git", | ||
"repository": "https://github.com/johnletey/arGQL", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build": "tsc", | ||
"fmt": "prettier --write ." | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.es.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"types": "dist/index.d.ts", | ||
"main": "dist/index", | ||
"types": "dist/index", | ||
"dependencies": { | ||
"node-fetch": "^2.6.1" | ||
"axios": "^0.21.1" | ||
}, | ||
"devDependencies": { | ||
"@rollup/pluginutils": "^4.1.0", | ||
"@types/node-fetch": "^2.5.7", | ||
"prettier": "^2.1.2", | ||
"rollup": "^2.33.3", | ||
"rollup-plugin-typescript2": "^0.29.0", | ||
"typescript": "^4.0.5" | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.2.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
2
13
379
0
58
1
14975
+ Addedaxios@^0.21.1
+ Addedaxios@0.21.4(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
- Removednode-fetch@^2.6.1
- Removednode-fetch@2.7.0(transitive)
- Removedtr46@0.0.3(transitive)
- Removedwebidl-conversions@3.0.1(transitive)
- Removedwhatwg-url@5.0.0(transitive)