@graphprotocol/graph-cli 0.59.0-alpha-20230928172030-9e0d14a → 0.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -15
- package/dist/{src/command-helpers → command-helpers}/abi.js +5 -7
- package/dist/{src/command-helpers → command-helpers}/compiler.js +1 -8
- package/dist/{src/command-helpers → command-helpers}/node.js +1 -2
- package/dist/{src/commands → commands}/create.js +1 -5
- package/dist/{src/commands → commands}/deploy.js +3 -13
- package/dist/{src/commands → commands}/remove.js +1 -5
- package/dist/{src/commands → commands}/test.js +4 -5
- package/oclif.manifest.json +865 -2
- package/package.json +1 -1
- package/dist/package.json +0 -92
- package/dist/src/constants.d.ts +0 -3
- package/dist/src/constants.js +0 -7
- package/dist/src/fetch.d.ts +0 -2
- package/dist/src/fetch.js +0 -15
- /package/dist/{src/codegen → codegen}/schema.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/schema.js +0 -0
- /package/dist/{src/codegen → codegen}/schema.test.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/schema.test.js +0 -0
- /package/dist/{src/codegen → codegen}/template.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/template.js +0 -0
- /package/dist/{src/codegen → codegen}/types/conversions.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/types/conversions.js +0 -0
- /package/dist/{src/codegen → codegen}/types/index.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/types/index.js +0 -0
- /package/dist/{src/codegen → codegen}/types/index.test.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/types/index.test.js +0 -0
- /package/dist/{src/codegen → codegen}/typescript.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/typescript.js +0 -0
- /package/dist/{src/codegen → codegen}/util.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/util.js +0 -0
- /package/dist/{src/codegen → codegen}/util.test.d.ts +0 -0
- /package/dist/{src/codegen → codegen}/util.test.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/abi.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/abi.test.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/abi.test.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/auth.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/auth.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/compiler.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/compiler.test.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/compiler.test.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/data-sources.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/data-sources.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/fs.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/fs.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/ipfs.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/ipfs.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/jsonrpc.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/jsonrpc.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/network.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/network.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/network.test.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/network.test.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/node.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/scaffold.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/scaffold.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/spinner.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/spinner.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/studio.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/studio.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/studio.test.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/studio.test.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/subgraph.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/subgraph.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/version.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/version.js +0 -0
- /package/dist/{src/command-helpers → command-helpers}/version.test.d.ts +0 -0
- /package/dist/{src/command-helpers → command-helpers}/version.test.js +0 -0
- /package/dist/{src/commands → commands}/add.d.ts +0 -0
- /package/dist/{src/commands → commands}/add.js +0 -0
- /package/dist/{src/commands → commands}/auth.d.ts +0 -0
- /package/dist/{src/commands → commands}/auth.js +0 -0
- /package/dist/{src/commands → commands}/build.d.ts +0 -0
- /package/dist/{src/commands → commands}/build.js +0 -0
- /package/dist/{src/commands → commands}/clean.d.ts +0 -0
- /package/dist/{src/commands → commands}/clean.js +0 -0
- /package/dist/{src/commands → commands}/codegen.d.ts +0 -0
- /package/dist/{src/commands → commands}/codegen.js +0 -0
- /package/dist/{src/commands → commands}/create.d.ts +0 -0
- /package/dist/{src/commands → commands}/deploy.d.ts +0 -0
- /package/dist/{src/commands → commands}/init.d.ts +0 -0
- /package/dist/{src/commands → commands}/init.js +0 -0
- /package/dist/{src/commands → commands}/local.d.ts +0 -0
- /package/dist/{src/commands → commands}/local.js +0 -0
- /package/dist/{src/commands → commands}/remove.d.ts +0 -0
- /package/dist/{src/commands → commands}/test.d.ts +0 -0
- /package/dist/{src/compiler → compiler}/asc.d.ts +0 -0
- /package/dist/{src/compiler → compiler}/asc.js +0 -0
- /package/dist/{src/compiler → compiler}/index.d.ts +0 -0
- /package/dist/{src/compiler → compiler}/index.js +0 -0
- /package/dist/{src/debug.d.ts → debug.d.ts} +0 -0
- /package/dist/{src/debug.js → debug.js} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/index.js → index.js} +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_1.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_1.js +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_2.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_2.js +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_3.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_3.js +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_4.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_4.js +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_5.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/mapping_api_version_0_0_5.js +0 -0
- /package/dist/{src/migrations → migrations}/spec_version_0_0_2.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/spec_version_0_0_2.js +0 -0
- /package/dist/{src/migrations → migrations}/spec_version_0_0_3.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/spec_version_0_0_3.js +0 -0
- /package/dist/{src/migrations → migrations}/util/load-manifest.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/util/load-manifest.js +0 -0
- /package/dist/{src/migrations → migrations}/util/versions.d.ts +0 -0
- /package/dist/{src/migrations → migrations}/util/versions.js +0 -0
- /package/dist/{src/migrations.d.ts → migrations.d.ts} +0 -0
- /package/dist/{src/migrations.js → migrations.js} +0 -0
- /package/dist/{src/protocols → protocols}/arweave/scaffold/manifest.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/arweave/scaffold/manifest.js +0 -0
- /package/dist/{src/protocols → protocols}/arweave/scaffold/mapping.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/arweave/scaffold/mapping.js +0 -0
- /package/dist/{src/protocols → protocols}/arweave/subgraph.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/arweave/subgraph.js +0 -0
- /package/dist/{src/protocols → protocols}/contract.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/contract.js +0 -0
- /package/dist/{src/protocols → protocols}/cosmos/scaffold/manifest.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/cosmos/scaffold/manifest.js +0 -0
- /package/dist/{src/protocols → protocols}/cosmos/scaffold/mapping.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/cosmos/scaffold/mapping.js +0 -0
- /package/dist/{src/protocols → protocols}/cosmos/subgraph.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/cosmos/subgraph.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/abi.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/abi.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/codegen/abi.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/codegen/abi.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/codegen/abi.test.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/codegen/abi.test.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/codegen/template.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/codegen/template.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/contract.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/contract.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/scaffold/manifest.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/scaffold/manifest.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/scaffold/mapping.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/scaffold/mapping.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/subgraph.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/subgraph.js +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/type-generator.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/ethereum/type-generator.js +0 -0
- /package/dist/{src/protocols → protocols}/file_template.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/file_template.js +0 -0
- /package/dist/{src/protocols → protocols}/index.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/index.js +0 -0
- /package/dist/{src/protocols → protocols}/near/contract.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/near/contract.js +0 -0
- /package/dist/{src/protocols → protocols}/near/scaffold/manifest.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/near/scaffold/manifest.js +0 -0
- /package/dist/{src/protocols → protocols}/near/scaffold/mapping.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/near/scaffold/mapping.js +0 -0
- /package/dist/{src/protocols → protocols}/near/subgraph.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/near/subgraph.js +0 -0
- /package/dist/{src/protocols → protocols}/subgraph.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/subgraph.js +0 -0
- /package/dist/{src/protocols → protocols}/substreams/scaffold/manifest.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/substreams/scaffold/manifest.js +0 -0
- /package/dist/{src/protocols → protocols}/substreams/subgraph.d.ts +0 -0
- /package/dist/{src/protocols → protocols}/substreams/subgraph.js +0 -0
- /package/dist/{src/scaffold → scaffold}/cosmos.test.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/cosmos.test.js +0 -0
- /package/dist/{src/scaffold → scaffold}/ethereum.test.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/ethereum.test.js +0 -0
- /package/dist/{src/scaffold → scaffold}/index.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/index.js +0 -0
- /package/dist/{src/scaffold → scaffold}/mapping.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/mapping.js +0 -0
- /package/dist/{src/scaffold → scaffold}/near.test.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/near.test.js +0 -0
- /package/dist/{src/scaffold → scaffold}/schema.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/schema.js +0 -0
- /package/dist/{src/scaffold → scaffold}/tests.d.ts +0 -0
- /package/dist/{src/scaffold → scaffold}/tests.js +0 -0
- /package/dist/{src/schema.d.ts → schema.d.ts} +0 -0
- /package/dist/{src/schema.js → schema.js} +0 -0
- /package/dist/{src/subgraph.d.ts → subgraph.d.ts} +0 -0
- /package/dist/{src/subgraph.js → subgraph.js} +0 -0
- /package/dist/{src/type-generator.d.ts → type-generator.d.ts} +0 -0
- /package/dist/{src/type-generator.js → type-generator.js} +0 -0
- /package/dist/{src/validation → validation}/contract.d.ts +0 -0
- /package/dist/{src/validation → validation}/contract.js +0 -0
- /package/dist/{src/validation → validation}/index.d.ts +0 -0
- /package/dist/{src/validation → validation}/index.js +0 -0
- /package/dist/{src/validation → validation}/manifest.d.ts +0 -0
- /package/dist/{src/validation → validation}/manifest.js +0 -0
- /package/dist/{src/validation → validation}/schema.d.ts +0 -0
- /package/dist/{src/validation → validation}/schema.js +0 -0
- /package/dist/{src/validation → validation}/schema.test.d.ts +0 -0
- /package/dist/{src/validation → validation}/schema.test.js +0 -0
- /package/dist/{src/version.d.ts → version.d.ts} +0 -0
- /package/dist/{src/version.js → version.js} +0 -0
- /package/dist/{src/watcher.d.ts → watcher.d.ts} +0 -0
- /package/dist/{src/watcher.js → watcher.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.59.0
|
|
3
|
+
## 0.59.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -10,10 +10,6 @@
|
|
|
10
10
|
|
|
11
11
|
### Patch Changes
|
|
12
12
|
|
|
13
|
-
- [#1461](https://github.com/graphprotocol/graph-tooling/pull/1461)
|
|
14
|
-
[`a95cc2e`](https://github.com/graphprotocol/graph-tooling/commit/a95cc2e7adb2216c004311d2f5996840a746f905)
|
|
15
|
-
Thanks [@saihaj](https://github.com/saihaj)! - include user agent for CLI fetch calls
|
|
16
|
-
|
|
17
13
|
- [#1470](https://github.com/graphprotocol/graph-tooling/pull/1470)
|
|
18
14
|
[`4c1ca35`](https://github.com/graphprotocol/graph-tooling/commit/4c1ca35d7c5cf6ee3aae119d578978e55074f5e9)
|
|
19
15
|
Thanks [@axiomatic-aardvark](https://github.com/axiomatic-aardvark)! - Update 'test' command to
|
|
@@ -32,16 +28,6 @@
|
|
|
32
28
|
[`129d003`](https://github.com/graphprotocol/graph-tooling/commit/129d003838b9b138391835f5a03b21aa05c34e15)
|
|
33
29
|
Thanks [@pustovalov](https://github.com/pustovalov)! - fix ABI api endpoint aurora networks
|
|
34
30
|
|
|
35
|
-
- [#1461](https://github.com/graphprotocol/graph-tooling/pull/1461)
|
|
36
|
-
[`66cee74`](https://github.com/graphprotocol/graph-tooling/commit/66cee7421debef12b41744a270e586786daa4286)
|
|
37
|
-
Thanks [@saihaj](https://github.com/saihaj)! - send graph cli version as user agent for all third
|
|
38
|
-
party API calls
|
|
39
|
-
|
|
40
|
-
- [#1461](https://github.com/graphprotocol/graph-tooling/pull/1461)
|
|
41
|
-
[`66cee74`](https://github.com/graphprotocol/graph-tooling/commit/66cee7421debef12b41744a270e586786daa4286)
|
|
42
|
-
Thanks [@saihaj](https://github.com/saihaj)! - send graph cli version as user agent for all ipfs
|
|
43
|
-
requests
|
|
44
|
-
|
|
45
31
|
## 0.58.0
|
|
46
32
|
|
|
47
33
|
### Minor Changes
|
|
@@ -5,12 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.loadAbiFromBlockScout = exports.getStartBlockForContract = exports.fetchTransactionByHashFromRPC = exports.fetchContractCreationHashWithRetry = exports.fetchDeployContractTransactionFromEtherscan = exports.loadStartBlockForContract = exports.loadAbiFromEtherscan = void 0;
|
|
7
7
|
const immutable_1 = __importDefault(require("immutable"));
|
|
8
|
-
const
|
|
9
|
-
const fetch_1 = __importDefault(require("../fetch"));
|
|
8
|
+
const fetch_1 = require("@whatwg-node/fetch");
|
|
10
9
|
const spinner_1 = require("./spinner");
|
|
11
10
|
const loadAbiFromEtherscan = async (ABICtor, network, address) => await (0, spinner_1.withSpinner)(`Fetching ABI from Etherscan`, `Failed to fetch ABI from Etherscan`, `Warnings while fetching ABI from Etherscan`, async () => {
|
|
12
11
|
const scanApiUrl = getEtherscanLikeAPIUrl(network);
|
|
13
|
-
const result = await (0, fetch_1.
|
|
12
|
+
const result = await (0, fetch_1.fetch)(`${scanApiUrl}?module=contract&action=getabi&address=${address}`);
|
|
14
13
|
const json = await result.json();
|
|
15
14
|
// Etherscan returns a JSON object that has a `status`, a `message` and
|
|
16
15
|
// a `result` field. The `status` is '0' in case of errors and '1' in
|
|
@@ -38,7 +37,7 @@ const fetchContractCreationHashWithRetry = async (url, retryCount) => {
|
|
|
38
37
|
let json;
|
|
39
38
|
for (let i = 0; i < retryCount; i++) {
|
|
40
39
|
try {
|
|
41
|
-
const result = await (0, fetch_1.
|
|
40
|
+
const result = await (0, fetch_1.fetch)(url);
|
|
42
41
|
json = await result.json();
|
|
43
42
|
if (json.status !== '0') {
|
|
44
43
|
return json;
|
|
@@ -58,11 +57,10 @@ const fetchTransactionByHashFromRPC = async (network, transactionHash) => {
|
|
|
58
57
|
const RPCURL = getPublicRPCEndpoint(network);
|
|
59
58
|
if (!RPCURL)
|
|
60
59
|
throw new Error(`Unable to fetch RPC URL for ${network}`);
|
|
61
|
-
const result = await (0, fetch_1.
|
|
60
|
+
const result = await (0, fetch_1.fetch)(String(RPCURL), {
|
|
62
61
|
method: 'POST',
|
|
63
62
|
headers: {
|
|
64
63
|
'Content-Type': 'application/json',
|
|
65
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
66
64
|
},
|
|
67
65
|
body: JSON.stringify({
|
|
68
66
|
jsonrpc: '2.0',
|
|
@@ -91,7 +89,7 @@ const getStartBlockForContract = async (network, address) => {
|
|
|
91
89
|
};
|
|
92
90
|
exports.getStartBlockForContract = getStartBlockForContract;
|
|
93
91
|
const loadAbiFromBlockScout = async (ABICtor, network, address) => await (0, spinner_1.withSpinner)(`Fetching ABI from BlockScout`, `Failed to fetch ABI from BlockScout`, `Warnings while fetching ABI from BlockScout`, async () => {
|
|
94
|
-
const result = await (0, fetch_1.
|
|
92
|
+
const result = await (0, fetch_1.fetch)(`https://blockscout.com/${network.replace('-', '/')}/api?module=contract&action=getabi&address=${address}`);
|
|
95
93
|
const json = await result.json();
|
|
96
94
|
// BlockScout returns a JSON object that has a `status`, a `message` and
|
|
97
95
|
// a `result` field. The `status` is '0' in case of errors and '1' in
|
|
@@ -31,7 +31,6 @@ const url_1 = require("url");
|
|
|
31
31
|
const toolbox = __importStar(require("gluegun"));
|
|
32
32
|
const ipfs_http_client_1 = require("ipfs-http-client");
|
|
33
33
|
const compiler_1 = __importDefault(require("../compiler"));
|
|
34
|
-
const constants_1 = require("../constants");
|
|
35
34
|
/**
|
|
36
35
|
* Appends /api/v0 to the end of a The Graph IPFS URL
|
|
37
36
|
*/
|
|
@@ -62,13 +61,7 @@ The IPFS URL must be of the following format: http(s)://host[:port]/[path]`);
|
|
|
62
61
|
}
|
|
63
62
|
// Connect to the IPFS node (if a node address was provided)
|
|
64
63
|
const ipfsClient = ipfs
|
|
65
|
-
? (0, ipfs_http_client_1.create)({
|
|
66
|
-
url: appendApiVersionForGraph(ipfs.toString()),
|
|
67
|
-
headers: {
|
|
68
|
-
...headers,
|
|
69
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
70
|
-
},
|
|
71
|
-
})
|
|
64
|
+
? (0, ipfs_http_client_1.create)({ url: appendApiVersionForGraph(ipfs.toString()), headers })
|
|
72
65
|
: undefined;
|
|
73
66
|
return new compiler_1.default({
|
|
74
67
|
ipfs: ipfsClient,
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getHostedServiceSubgraphId = exports.chooseNodeUrl = exports.normalizeNodeUrl = exports.validateNodeUrl = void 0;
|
|
4
4
|
const url_1 = require("url");
|
|
5
5
|
const gluegun_1 = require("gluegun");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
7
6
|
const SUBGRAPH_STUDIO_URL = 'https://api.studio.thegraph.com/deploy/';
|
|
8
7
|
const HOSTED_SERVICE_URL = 'https://api.thegraph.com/deploy/';
|
|
9
8
|
const HOSTED_SERVICE_INDEX_NODE_URL = 'https://api.thegraph.com/index-node/graphql';
|
|
@@ -59,7 +58,7 @@ async function getHostedServiceSubgraphId({ subgraphName, }) {
|
|
|
59
58
|
}),
|
|
60
59
|
headers: {
|
|
61
60
|
'content-type': 'application/json',
|
|
62
|
-
|
|
61
|
+
'User-Agent': '@graphprotocol/graph-cli',
|
|
63
62
|
},
|
|
64
63
|
});
|
|
65
64
|
const { data, errors } = await response.json();
|
|
@@ -6,7 +6,6 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const auth_1 = require("../command-helpers/auth");
|
|
7
7
|
const jsonrpc_1 = require("../command-helpers/jsonrpc");
|
|
8
8
|
const node_1 = require("../command-helpers/node");
|
|
9
|
-
const constants_1 = require("../constants");
|
|
10
9
|
class CreateCommand extends core_1.Command {
|
|
11
10
|
async run() {
|
|
12
11
|
const { args: { 'subgraph-name': subgraphName }, flags: { 'access-token': accessTokenFlag, node }, } = await this.parse(CreateCommand);
|
|
@@ -27,10 +26,7 @@ class CreateCommand extends core_1.Command {
|
|
|
27
26
|
const accessToken = await (0, auth_1.identifyDeployKey)(node, accessTokenFlag);
|
|
28
27
|
if (accessToken !== undefined && accessToken !== null) {
|
|
29
28
|
// @ts-expect-error options property seems to exist
|
|
30
|
-
client.options.headers = {
|
|
31
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
32
|
-
Authorization: `Bearer ${accessToken}`,
|
|
33
|
-
};
|
|
29
|
+
client.options.headers = { Authorization: `Bearer ${accessToken}` };
|
|
34
30
|
}
|
|
35
31
|
const spinner = gluegun_1.print.spin(`Creating subgraph in Graph node: ${requestUrl}`);
|
|
36
32
|
client.request('subgraph_create', { name: subgraphName }, (
|
|
@@ -40,7 +40,6 @@ const network_1 = require("../command-helpers/network");
|
|
|
40
40
|
const node_1 = require("../command-helpers/node");
|
|
41
41
|
const studio_1 = require("../command-helpers/studio");
|
|
42
42
|
const version_1 = require("../command-helpers/version");
|
|
43
|
-
const constants_1 = require("../constants");
|
|
44
43
|
const protocols_1 = __importDefault(require("../protocols"));
|
|
45
44
|
const headersFlag = core_1.Flags.custom({
|
|
46
45
|
summary: 'Add custom headers that will be used by the IPFS HTTP client.',
|
|
@@ -87,10 +86,7 @@ class DeployCommand extends core_1.Command {
|
|
|
87
86
|
this.error('No deploy key available');
|
|
88
87
|
}
|
|
89
88
|
// @ts-expect-error options property seems to exist
|
|
90
|
-
client.options.headers = {
|
|
91
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
92
|
-
Authorization: 'Bearer ' + deployKey,
|
|
93
|
-
};
|
|
89
|
+
client.options.headers = { Authorization: 'Bearer ' + deployKey };
|
|
94
90
|
const subgraphName = await core_1.ux.prompt('What is the name of the subgraph you want to deploy?', {
|
|
95
91
|
required: true,
|
|
96
92
|
});
|
|
@@ -198,10 +194,7 @@ class DeployCommand extends core_1.Command {
|
|
|
198
194
|
deployKey = await (0, auth_1.identifyDeployKey)(node, deployKey);
|
|
199
195
|
if (deployKey !== undefined && deployKey !== null) {
|
|
200
196
|
// @ts-expect-error options property seems to exist
|
|
201
|
-
client.options.headers = {
|
|
202
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
203
|
-
Authorization: 'Bearer ' + deployKey,
|
|
204
|
-
};
|
|
197
|
+
client.options.headers = { Authorization: 'Bearer ' + deployKey };
|
|
205
198
|
}
|
|
206
199
|
// Ask for label if not on hosted service
|
|
207
200
|
let versionLabel = versionLabelFlag;
|
|
@@ -278,10 +271,7 @@ class DeployCommand extends core_1.Command {
|
|
|
278
271
|
// Connect to the IPFS node (if a node address was provided)
|
|
279
272
|
const ipfsClient = (0, ipfs_http_client_1.create)({
|
|
280
273
|
url: (0, compiler_1.appendApiVersionForGraph)(ipfs.toString()),
|
|
281
|
-
headers
|
|
282
|
-
...headers,
|
|
283
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
284
|
-
},
|
|
274
|
+
headers,
|
|
285
275
|
});
|
|
286
276
|
// Fetch the manifest from IPFS
|
|
287
277
|
const manifestBuffer = ipfsClient.cat(ipfsHash);
|
|
@@ -6,7 +6,6 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const auth_1 = require("../command-helpers/auth");
|
|
7
7
|
const jsonrpc_1 = require("../command-helpers/jsonrpc");
|
|
8
8
|
const node_1 = require("../command-helpers/node");
|
|
9
|
-
const constants_1 = require("../constants");
|
|
10
9
|
class RemoveCommand extends core_1.Command {
|
|
11
10
|
async run() {
|
|
12
11
|
const { args: { 'subgraph-name': subgraphName }, flags: { 'access-token': accessTokenFlag, node }, } = await this.parse(RemoveCommand);
|
|
@@ -27,10 +26,7 @@ class RemoveCommand extends core_1.Command {
|
|
|
27
26
|
const accessToken = await (0, auth_1.identifyDeployKey)(node, accessTokenFlag);
|
|
28
27
|
if (accessToken !== undefined && accessToken !== null) {
|
|
29
28
|
// @ts-expect-error options property seems to exist
|
|
30
|
-
client.options.headers = {
|
|
31
|
-
...constants_1.GRAPH_CLI_SHARED_HEADERS,
|
|
32
|
-
Authorization: `Bearer ${accessToken}`,
|
|
33
|
-
};
|
|
29
|
+
client.options.headers = { Authorization: `Bearer ${accessToken}` };
|
|
34
30
|
}
|
|
35
31
|
const spinner = gluegun_1.print.spin(`Creating subgraph in Graph node: ${requestUrl}`);
|
|
36
32
|
client.request('subgraph_remove', { name: subgraphName }, (
|
|
@@ -11,8 +11,7 @@ const gluegun_1 = require("gluegun");
|
|
|
11
11
|
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
12
12
|
const semver_1 = __importDefault(require("semver"));
|
|
13
13
|
const core_1 = require("@oclif/core");
|
|
14
|
-
const
|
|
15
|
-
const fetch_1 = __importDefault(require("../fetch"));
|
|
14
|
+
const fetch_1 = require("@whatwg-node/fetch");
|
|
16
15
|
class TestCommand extends core_1.Command {
|
|
17
16
|
async run() {
|
|
18
17
|
const { args: { datasource }, flags: { coverage, docker, force, logs, recompile, version }, } = await this.parse(TestCommand);
|
|
@@ -49,9 +48,9 @@ class TestCommand extends core_1.Command {
|
|
|
49
48
|
// Fetch the latest version tag if version is not specified with -v/--version or if the version is not cached
|
|
50
49
|
if (opts.force || (!opts.version && !opts.latestVersion)) {
|
|
51
50
|
this.log('Fetching latest version tag...');
|
|
52
|
-
const result = await (0, fetch_1.
|
|
51
|
+
const result = await (0, fetch_1.fetch)('https://api.github.com/repos/LimeChain/matchstick/releases/latest', {
|
|
53
52
|
headers: {
|
|
54
|
-
|
|
53
|
+
'User-Agent': '@graphprotocol/graph-cli',
|
|
55
54
|
},
|
|
56
55
|
});
|
|
57
56
|
const json = await result.json();
|
|
@@ -282,7 +281,7 @@ async function dockerfile(dockerfilePath, versionOpt, latestVersion) {
|
|
|
282
281
|
const spinner = gluegun_1.print.spin('Generating Dockerfile...');
|
|
283
282
|
try {
|
|
284
283
|
// Fetch the Dockerfile template content from the demo-subgraph repo
|
|
285
|
-
const content = await (0, fetch_1.
|
|
284
|
+
const content = await (0, fetch_1.fetch)('https://raw.githubusercontent.com/LimeChain/demo-subgraph/main/Dockerfile').then(response => {
|
|
286
285
|
if (response.ok) {
|
|
287
286
|
return response.text();
|
|
288
287
|
}
|