Comparing version 0.0.6 to 0.0.10
import GQLResultInterface, { GQLEdgeInterface, GQLNodeInterface } from "./faces"; | ||
export declare const run: (query: string, variables?: Record<string, unknown> | undefined) => Promise<GQLResultInterface>; | ||
export declare const all: (query: string, variables?: Record<string, unknown> | undefined) => Promise<GQLEdgeInterface[]>; | ||
export declare const setEndpointUrl: (full_GQL_Url: string) => string; | ||
export declare const run: (query: string, variables?: Record<string, unknown>) => Promise<GQLResultInterface>; | ||
export declare const all: (query: string, variables?: Record<string, unknown>) => Promise<GQLEdgeInterface[]>; | ||
export declare const tx: (id: string) => Promise<GQLNodeInterface>; | ||
export declare const fetchTxTag: (id: string, name: string) => Promise<string | undefined>; |
@@ -50,5 +50,8 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.fetchTxTag = exports.tx = exports.all = exports.run = void 0; | ||
exports.fetchTxTag = exports.tx = exports.all = exports.run = exports.setEndpointUrl = void 0; | ||
var axios_1 = require("axios"); | ||
var tx_1 = require("./queries/tx"); | ||
var GQL_ENDPOINT = "https://arweave.net/graphql"; //default | ||
var setEndpointUrl = function (full_GQL_Url) { return GQL_ENDPOINT = full_GQL_Url; }; | ||
exports.setEndpointUrl = setEndpointUrl; | ||
var run = function (query, variables) { return __awaiter(void 0, void 0, void 0, function () { | ||
@@ -63,3 +66,3 @@ var graphql, res; | ||
}); | ||
return [4 /*yield*/, axios_1["default"].post("https://arweave.net/graphql", graphql, { | ||
return [4 /*yield*/, axios_1["default"].post(GQL_ENDPOINT, graphql, { | ||
headers: { | ||
@@ -87,3 +90,3 @@ "content-type": "application/json" | ||
if (!hasNextPage) return [3 /*break*/, 3]; | ||
return [4 /*yield*/, exports.run(query, __assign(__assign({}, variables), { cursor: cursor }))]; | ||
return [4 /*yield*/, (0, exports.run)(query, __assign(__assign({}, variables), { cursor: cursor }))]; | ||
case 2: | ||
@@ -113,3 +116,3 @@ res = (_a.sent()).data.transactions; | ||
} | ||
return [4 /*yield*/, exports.run(tx_1["default"], { id: id })]; | ||
return [4 /*yield*/, (0, exports.run)(tx_1["default"], { id: id })]; | ||
case 1: | ||
@@ -131,3 +134,3 @@ res = _a.sent(); | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, exports.tx(id)]; | ||
case 0: return [4 /*yield*/, (0, exports.tx)(id)]; | ||
case 1: | ||
@@ -134,0 +137,0 @@ res = _a.sent(); |
{ | ||
"name": "ar-gql", | ||
"version": "0.0.6", | ||
"version": "0.0.10", | ||
"author": "John Letey <johnletey@gmail.com>", | ||
"repository": "https://github.com/johnletey/arGQL", | ||
"contributors": [ | ||
"Ros McMahon <rosmcmahon@gmail.com>", | ||
"John Letey <johnletey@gmail.com>" | ||
], | ||
"repository": "https://github.com/johnletey/arGql", | ||
"license": "MIT", | ||
"scripts": { | ||
"build": "tsc", | ||
"build": "npx rimraf dist && tsc", | ||
"postversion": "git push && git push --tags && npm run build && npm publish", | ||
"fmt": "prettier --write ." | ||
@@ -14,3 +19,3 @@ }, | ||
"dependencies": { | ||
"axios": "^0.21.1" | ||
"axios": "^0.27.2" | ||
}, | ||
@@ -17,0 +22,0 @@ "devDependencies": { |
@@ -1,2 +0,2 @@ | ||
# `arGQL` | ||
# `ar-gql` | ||
@@ -11,3 +11,3 @@ [](https://www.npmjs.com/package/ar-gql) | ||
# npm | ||
npm install ar-gql | ||
npm i ar-gql | ||
# yarn | ||
@@ -36,4 +36,7 @@ yarn add ar-gql | ||
transactions( | ||
# your query parameters | ||
# your query parameters | ||
# standard template below | ||
after: $cursor | ||
first: 100 | ||
) { | ||
@@ -45,3 +48,6 @@ pageInfo { | ||
cursor | ||
# whatever else you want to query for | ||
node { | ||
# what tx data you want to query for: | ||
} | ||
} | ||
@@ -54,8 +60,10 @@ } | ||
The `tx` function recieves as an input a valid Arweave transaction id. The function will then return all information about the transaction that the GraphQL endpoint supports. | ||
The `tx` function recieves as an input a valid Arweave transaction id. The function will then return all metadata information about the transaction that the GraphQL endpoint supports. | ||
Note that this function does not return the transaction data. | ||
### `fetchTxTag(id, name)` | ||
This function will fetch all tags for the supplied transaction. Then, if it finds a tag with the name provided, it will return the tag value. Else, it will return `undefined`. | ||
### `setEndpointUrl(GQL_URL)` | ||
Set the GQL endpoint. Defaults to `https://arweave.net/graphql`. |
@@ -8,2 +8,5 @@ import GQLResultInterface, { | ||
let GQL_ENDPOINT = "https://arweave.net/graphql" //default | ||
export const setEndpointUrl = (full_GQL_Url: string) => GQL_ENDPOINT = full_GQL_Url | ||
export const run = async ( | ||
@@ -19,3 +22,3 @@ query: string, | ||
const { data: res } = await axios.post( | ||
"https://arweave.net/graphql", | ||
GQL_ENDPOINT, | ||
graphql, | ||
@@ -22,0 +25,0 @@ { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a 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
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
15575
382
65
1
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.27.2(transitive)
+ Addedcall-bind-apply-helpers@1.0.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddunder-proto@1.0.1(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.1.1(transitive)
+ Addedes-set-tostringtag@2.1.0(transitive)
+ Addedform-data@4.0.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.3.0(transitive)
+ Addedget-proto@1.0.1(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedmath-intrinsics@1.1.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
- Removedaxios@0.21.4(transitive)
Updatedaxios@^0.27.2