@graphprotocol/graph-cli 0.69.0-alpha-20240304175325-ee351c6 → 0.69.0-alpha-20240315144301-ea4b16f
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 +6 -4
- package/dist/commands/init.js +1 -6
- package/dist/compiler/index.js +0 -1
- package/dist/protocols/ethereum/manifest.graphql +2 -0
- package/dist/protocols/index.d.ts +1 -1
- package/dist/protocols/index.js +6 -23
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/dist/protocols/dataset/manifest.graphql +0 -56
- package/dist/protocols/dataset/subgraph.d.ts +0 -10
- package/dist/protocols/dataset/subgraph.js +0 -20
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.69.0-alpha-
|
|
3
|
+
## 0.69.0-alpha-20240315144301-ea4b16f
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
8
|
-
[`
|
|
9
|
-
Thanks [@
|
|
7
|
+
- [#1611](https://github.com/graphprotocol/graph-tooling/pull/1611)
|
|
8
|
+
[`ea4b16f`](https://github.com/graphprotocol/graph-tooling/commit/ea4b16f903098665f80247af5085a8dbf0e1d4f3)
|
|
9
|
+
Thanks [@lutter](https://github.com/lutter)! - Allow declared calls in the manifest
|
|
10
|
+
|
|
11
|
+
## 0.68.5
|
|
10
12
|
|
|
11
13
|
### Patch Changes
|
|
12
14
|
|
package/dist/commands/init.js
CHANGED
|
@@ -44,12 +44,7 @@ const protocols_1 = __importDefault(require("../protocols"));
|
|
|
44
44
|
const schema_1 = require("../scaffold/schema");
|
|
45
45
|
const validation_1 = require("../validation");
|
|
46
46
|
const add_1 = __importDefault(require("./add"));
|
|
47
|
-
|
|
48
|
-
* Today we have protocol -> data source -> kind
|
|
49
|
-
* Not the best but it is too deeply rooted to change now
|
|
50
|
-
* So simpler just add a new protocol and hide from the `init` command
|
|
51
|
-
*/
|
|
52
|
-
const protocolChoices = Array.from(protocols_1.default.availableProtocols().keys()).filter(n => n !== 'dataset');
|
|
47
|
+
const protocolChoices = Array.from(protocols_1.default.availableProtocols().keys());
|
|
53
48
|
const initDebugger = (0, debug_1.default)('graph-cli:commands:init');
|
|
54
49
|
/**
|
|
55
50
|
* a dynamic list of available networks supported by the studio
|
package/dist/compiler/index.js
CHANGED
|
@@ -362,7 +362,6 @@ class Compiler {
|
|
|
362
362
|
fs_extra_1.default.copyFileSync(schemaFilePath, targetFile);
|
|
363
363
|
return path_1.default.relative(this.options.outputDir, targetFile);
|
|
364
364
|
});
|
|
365
|
-
compilerDebug('Has ABIs: %s', protocol.hasABIs());
|
|
366
365
|
// Copy data source files and update their paths
|
|
367
366
|
subgraph = subgraph.update('dataSources', (dataSources) => dataSources.map(dataSource => {
|
|
368
367
|
let updatedDataSource = dataSource;
|
|
@@ -25,7 +25,7 @@ export default class Protocol {
|
|
|
25
25
|
getManifestScaffold(): any;
|
|
26
26
|
getMappingScaffold(): any;
|
|
27
27
|
}
|
|
28
|
-
export type ProtocolName = 'arweave' | 'ethereum' | 'near' | 'cosmos' | 'substreams' | 'substreams/triggers'
|
|
28
|
+
export type ProtocolName = 'arweave' | 'ethereum' | 'near' | 'cosmos' | 'substreams' | 'substreams/triggers';
|
|
29
29
|
export interface ProtocolConfig {
|
|
30
30
|
displayName: string;
|
|
31
31
|
abi?: any;
|
package/dist/protocols/index.js
CHANGED
|
@@ -34,20 +34,19 @@ const subgraph_1 = __importDefault(require("./arweave/subgraph"));
|
|
|
34
34
|
const CosmosManifestScaffold = __importStar(require("./cosmos/scaffold/manifest"));
|
|
35
35
|
const CosmosMappingScaffold = __importStar(require("./cosmos/scaffold/mapping"));
|
|
36
36
|
const subgraph_2 = __importDefault(require("./cosmos/subgraph"));
|
|
37
|
-
const subgraph_3 = __importDefault(require("./dataset/subgraph"));
|
|
38
37
|
const abi_1 = __importDefault(require("./ethereum/abi"));
|
|
39
38
|
const template_1 = __importDefault(require("./ethereum/codegen/template"));
|
|
40
39
|
const contract_1 = __importDefault(require("./ethereum/contract"));
|
|
41
40
|
const EthereumManifestScaffold = __importStar(require("./ethereum/scaffold/manifest"));
|
|
42
41
|
const EthereumMappingScaffold = __importStar(require("./ethereum/scaffold/mapping"));
|
|
43
|
-
const
|
|
42
|
+
const subgraph_3 = __importDefault(require("./ethereum/subgraph"));
|
|
44
43
|
const type_generator_1 = __importDefault(require("./ethereum/type-generator"));
|
|
45
44
|
const contract_2 = __importDefault(require("./near/contract"));
|
|
46
45
|
const NearManifestScaffold = __importStar(require("./near/scaffold/manifest"));
|
|
47
46
|
const NearMappingScaffold = __importStar(require("./near/scaffold/mapping"));
|
|
48
|
-
const
|
|
47
|
+
const subgraph_4 = __importDefault(require("./near/subgraph"));
|
|
49
48
|
const SubstreamsManifestScaffold = __importStar(require("./substreams/scaffold/manifest"));
|
|
50
|
-
const
|
|
49
|
+
const subgraph_5 = __importDefault(require("./substreams/subgraph"));
|
|
51
50
|
const protocolDebug = (0, debug_1.default)('graph-cli:protocol');
|
|
52
51
|
class Protocol {
|
|
53
52
|
static fromDataSources(dataSourcesAndTemplates) {
|
|
@@ -76,9 +75,6 @@ class Protocol {
|
|
|
76
75
|
case 'near':
|
|
77
76
|
this.config = nearProtocol;
|
|
78
77
|
break;
|
|
79
|
-
case 'dataset':
|
|
80
|
-
this.config = datasetProtocol;
|
|
81
|
-
break;
|
|
82
78
|
case 'substreams':
|
|
83
79
|
this.config = substreamsProtocol;
|
|
84
80
|
/**
|
|
@@ -103,7 +99,6 @@ class Protocol {
|
|
|
103
99
|
near: ['near'],
|
|
104
100
|
cosmos: ['cosmos'],
|
|
105
101
|
substreams: ['substreams'],
|
|
106
|
-
dataset: ['dataset'],
|
|
107
102
|
});
|
|
108
103
|
}
|
|
109
104
|
static availableNetworks() {
|
|
@@ -255,7 +250,7 @@ const ethereumProtocol = {
|
|
|
255
250
|
return new type_generator_1.default(options);
|
|
256
251
|
},
|
|
257
252
|
getSubgraph(options) {
|
|
258
|
-
return new
|
|
253
|
+
return new subgraph_3.default(options);
|
|
259
254
|
},
|
|
260
255
|
manifestScaffold: EthereumManifestScaffold,
|
|
261
256
|
mappingScaffold: EthereumMappingScaffold,
|
|
@@ -267,7 +262,7 @@ const nearProtocol = {
|
|
|
267
262
|
getTypeGenerator: undefined,
|
|
268
263
|
getTemplateCodeGen: undefined,
|
|
269
264
|
getSubgraph(options) {
|
|
270
|
-
return new
|
|
265
|
+
return new subgraph_4.default(options);
|
|
271
266
|
},
|
|
272
267
|
manifestScaffold: NearManifestScaffold,
|
|
273
268
|
mappingScaffold: NearMappingScaffold,
|
|
@@ -279,21 +274,9 @@ const substreamsProtocol = {
|
|
|
279
274
|
getTypeGenerator: undefined,
|
|
280
275
|
getTemplateCodeGen: undefined,
|
|
281
276
|
getSubgraph(options) {
|
|
282
|
-
return new
|
|
277
|
+
return new subgraph_5.default(options);
|
|
283
278
|
},
|
|
284
279
|
manifestScaffold: SubstreamsManifestScaffold,
|
|
285
280
|
mappingScaffold: undefined,
|
|
286
281
|
};
|
|
287
|
-
const datasetProtocol = {
|
|
288
|
-
displayName: 'Dataset',
|
|
289
|
-
abi: abi_1.default,
|
|
290
|
-
contract: undefined,
|
|
291
|
-
getTypeGenerator: undefined,
|
|
292
|
-
getTemplateCodeGen: undefined,
|
|
293
|
-
getSubgraph(options) {
|
|
294
|
-
return new subgraph_3.default(options);
|
|
295
|
-
},
|
|
296
|
-
manifestScaffold: undefined,
|
|
297
|
-
mappingScaffold: undefined,
|
|
298
|
-
};
|
|
299
282
|
protocolDebug('Available networks %M', Protocol.availableNetworks());
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Each referenced type's in any of the types below must be listed
|
|
2
|
-
# here either as `scalar` or `type` for the validation code to work
|
|
3
|
-
# properly.
|
|
4
|
-
#
|
|
5
|
-
# That's why `String` is listed as a scalar even though it's built-in
|
|
6
|
-
# GraphQL basic types.
|
|
7
|
-
scalar String
|
|
8
|
-
scalar File
|
|
9
|
-
scalar BigInt
|
|
10
|
-
scalar Boolean
|
|
11
|
-
scalar JSON
|
|
12
|
-
|
|
13
|
-
union StringOrBigInt = String | BigInt
|
|
14
|
-
|
|
15
|
-
type SubgraphManifest {
|
|
16
|
-
specVersion: String!
|
|
17
|
-
features: [String!]
|
|
18
|
-
schema: Schema!
|
|
19
|
-
description: String
|
|
20
|
-
repository: String
|
|
21
|
-
dataSources: [DataSource!]!
|
|
22
|
-
indexerHints: IndexerHints
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type Schema {
|
|
26
|
-
file: File!
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type IndexerHints {
|
|
30
|
-
prune: StringOrBigInt
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type DataSource {
|
|
34
|
-
kind: String!
|
|
35
|
-
name: String!
|
|
36
|
-
network: String!
|
|
37
|
-
source: DatasetSource!
|
|
38
|
-
mapping: DatasetMapping!
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
type DatasetSource {
|
|
42
|
-
dataset: String!
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
type ContractAbi {
|
|
46
|
-
name: String!
|
|
47
|
-
file: File!
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
type DatasetMapping {
|
|
51
|
-
kind: String!
|
|
52
|
-
apiVersion: String!
|
|
53
|
-
file: File!
|
|
54
|
-
handler: String!
|
|
55
|
-
abis: [ContractAbi!]!
|
|
56
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import immutable from 'immutable';
|
|
2
|
-
import { Subgraph, SubgraphOptions } from '../subgraph';
|
|
3
|
-
export default class DatasetSubgraph implements Subgraph {
|
|
4
|
-
manifest: SubgraphOptions['manifest'];
|
|
5
|
-
resolveFile: SubgraphOptions['resolveFile'];
|
|
6
|
-
protocol: SubgraphOptions['protocol'];
|
|
7
|
-
constructor(options: SubgraphOptions);
|
|
8
|
-
validateManifest(): immutable.List<unknown>;
|
|
9
|
-
handlerTypes(): immutable.List<never>;
|
|
10
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const immutable_1 = __importDefault(require("immutable"));
|
|
7
|
-
class DatasetSubgraph {
|
|
8
|
-
constructor(options) {
|
|
9
|
-
this.manifest = options.manifest;
|
|
10
|
-
this.resolveFile = options.resolveFile;
|
|
11
|
-
this.protocol = options.protocol;
|
|
12
|
-
}
|
|
13
|
-
validateManifest() {
|
|
14
|
-
return immutable_1.default.List();
|
|
15
|
-
}
|
|
16
|
-
handlerTypes() {
|
|
17
|
-
return immutable_1.default.List([]);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.default = DatasetSubgraph;
|