@graphprotocol/graph-cli 0.46.2-alpha-20230413194654-0af077e → 0.46.2-alpha-20230413212618-56318b4

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.
Files changed (97) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/bin.d.ts +2 -0
  3. package/dist/codegen/schema.d.ts +43 -0
  4. package/dist/codegen/schema.test.d.ts +1 -0
  5. package/dist/codegen/template.d.ts +11 -0
  6. package/dist/codegen/types/conversions.d.ts +6 -0
  7. package/dist/codegen/types/index.d.ts +9 -0
  8. package/dist/codegen/types/index.test.d.ts +1 -0
  9. package/dist/codegen/typescript.d.ts +78 -0
  10. package/dist/codegen/util.d.ts +14 -0
  11. package/dist/codegen/util.test.d.ts +1 -0
  12. package/dist/command-helpers/abi.d.ts +8 -0
  13. package/dist/command-helpers/abi.test.d.ts +1 -0
  14. package/dist/command-helpers/auth.d.ts +2 -0
  15. package/dist/command-helpers/compiler.d.ts +13 -0
  16. package/dist/command-helpers/data-sources.d.ts +4 -0
  17. package/dist/command-helpers/fs.d.ts +2 -0
  18. package/dist/command-helpers/ipfs.d.ts +2 -0
  19. package/dist/command-helpers/jsonrpc.d.ts +2 -0
  20. package/dist/command-helpers/network.d.ts +3 -0
  21. package/dist/command-helpers/network.test.d.ts +1 -0
  22. package/dist/command-helpers/node.d.ts +13 -0
  23. package/dist/command-helpers/scaffold.d.ts +35 -0
  24. package/dist/command-helpers/spinner.d.ts +4 -0
  25. package/dist/command-helpers/studio.d.ts +6 -0
  26. package/dist/command-helpers/studio.test.d.ts +1 -0
  27. package/dist/command-helpers/subgraph.d.ts +4 -0
  28. package/dist/command-helpers/version.d.ts +2 -0
  29. package/dist/command-helpers/version.test.d.ts +1 -0
  30. package/dist/commands/add.d.ts +17 -0
  31. package/dist/commands/auth.d.ts +14 -0
  32. package/dist/commands/build.d.ts +18 -0
  33. package/dist/commands/codegen.d.ts +16 -0
  34. package/dist/commands/create.d.ts +13 -0
  35. package/dist/commands/deploy.d.ts +26 -0
  36. package/dist/commands/init.d.ts +24 -0
  37. package/dist/commands/local.d.ts +21 -0
  38. package/dist/commands/remove.d.ts +13 -0
  39. package/dist/commands/test.d.ts +17 -0
  40. package/dist/compiler/asc.d.ts +9 -0
  41. package/dist/compiler/index.d.ts +53 -0
  42. package/dist/debug.d.ts +2 -0
  43. package/dist/index.d.ts +1 -0
  44. package/dist/migrations/mapping_api_version_0_0_1.d.ts +11 -0
  45. package/dist/migrations/mapping_api_version_0_0_2.d.ts +11 -0
  46. package/dist/migrations/mapping_api_version_0_0_3.d.ts +11 -0
  47. package/dist/migrations/mapping_api_version_0_0_4.d.ts +11 -0
  48. package/dist/migrations/mapping_api_version_0_0_5.d.ts +11 -0
  49. package/dist/migrations/spec_version_0_0_2.d.ts +10 -0
  50. package/dist/migrations/spec_version_0_0_3.d.ts +10 -0
  51. package/dist/migrations/util/load-manifest.d.ts +1 -0
  52. package/dist/migrations/util/versions.d.ts +1 -0
  53. package/dist/migrations.d.ts +4 -0
  54. package/dist/protocols/arweave/scaffold/manifest.d.ts +4 -0
  55. package/dist/protocols/arweave/scaffold/mapping.d.ts +1 -0
  56. package/dist/protocols/arweave/subgraph.d.ts +10 -0
  57. package/dist/protocols/contract.d.ts +10 -0
  58. package/dist/protocols/cosmos/scaffold/manifest.d.ts +2 -0
  59. package/dist/protocols/cosmos/scaffold/mapping.d.ts +1 -0
  60. package/dist/protocols/cosmos/subgraph.d.ts +10 -0
  61. package/dist/protocols/ethereum/abi.d.ts +30 -0
  62. package/dist/protocols/ethereum/codegen/abi.d.ts +30 -0
  63. package/dist/protocols/ethereum/codegen/abi.test.d.ts +1 -0
  64. package/dist/protocols/ethereum/codegen/template.d.ts +9 -0
  65. package/dist/protocols/ethereum/contract.d.ts +10 -0
  66. package/dist/protocols/ethereum/scaffold/manifest.d.ts +10 -0
  67. package/dist/protocols/ethereum/scaffold/mapping.d.ts +6 -0
  68. package/dist/protocols/ethereum/subgraph.d.ts +15 -0
  69. package/dist/protocols/ethereum/type-generator.d.ts +23 -0
  70. package/dist/protocols/index.d.ts +38 -0
  71. package/dist/protocols/ipfs/codegen/file_template.d.ts +9 -0
  72. package/dist/protocols/near/contract.d.ts +15 -0
  73. package/dist/protocols/near/scaffold/manifest.d.ts +6 -0
  74. package/dist/protocols/near/scaffold/mapping.d.ts +1 -0
  75. package/dist/protocols/near/subgraph.d.ts +10 -0
  76. package/dist/protocols/subgraph.d.ts +10 -0
  77. package/dist/protocols/substreams/scaffold/manifest.d.ts +2 -0
  78. package/dist/protocols/substreams/subgraph.d.ts +10 -0
  79. package/dist/scaffold/cosmos.test.d.ts +1 -0
  80. package/dist/scaffold/ethereum.test.d.ts +1 -0
  81. package/dist/scaffold/index.d.ts +54 -0
  82. package/dist/scaffold/mapping.d.ts +15 -0
  83. package/dist/scaffold/near.test.d.ts +1 -0
  84. package/dist/scaffold/schema.d.ts +18 -0
  85. package/dist/scaffold/tests.d.ts +3 -0
  86. package/dist/schema.d.ts +10 -0
  87. package/dist/subgraph.d.ts +27 -0
  88. package/dist/type-generator.d.ts +29 -0
  89. package/dist/validation/contract.d.ts +11 -0
  90. package/dist/validation/index.d.ts +3 -0
  91. package/dist/validation/manifest.d.ts +4 -0
  92. package/dist/validation/schema.d.ts +7 -0
  93. package/dist/validation/schema.test.d.ts +1 -0
  94. package/dist/version.d.ts +1 -0
  95. package/dist/watcher.d.ts +15 -0
  96. package/oclif.manifest.json +1 -1
  97. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.46.2-alpha-20230413194654-0af077e
3
+ ## 0.46.2-alpha-20230413212618-56318b4
4
4
 
5
5
  ### Patch Changes
6
6
 
package/dist/bin.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,43 @@
1
+ import Schema from '../schema';
2
+ import * as tsCodegen from './typescript';
3
+ import type { DefinitionNode, FieldDefinitionNode, InterfaceTypeDefinitionNode, NamedTypeNode, ObjectTypeDefinitionNode, TypeNode } from 'graphql/language';
4
+ declare class IdField {
5
+ static BYTES: symbol;
6
+ static STRING: symbol;
7
+ private kind;
8
+ constructor(idField: FieldDefinitionNode | undefined);
9
+ typeName(): "string" | "Bytes";
10
+ gqlTypeName(): "Bytes" | "String";
11
+ tsNamedType(): tsCodegen.NamedType;
12
+ tsValueFrom(): "Value.fromBytes(id)" | "Value.fromString(id)";
13
+ tsValueKind(): "ValueKind.BYTES" | "ValueKind.STRING";
14
+ tsValueToString(): "id.toBytes().toHexString()" | "id.toString()";
15
+ tsToString(): "id.toHexString()" | "id";
16
+ static fromFields(fields: readonly FieldDefinitionNode[] | undefined): IdField;
17
+ static fromTypeDef(def: ObjectTypeDefinitionNode | InterfaceTypeDefinitionNode): IdField;
18
+ }
19
+ export default class SchemaCodeGenerator {
20
+ private schema;
21
+ constructor(schema: Schema);
22
+ generateModuleImports(): tsCodegen.ModuleImports[];
23
+ generateTypes(): Array<tsCodegen.Class>;
24
+ _isEntityTypeDefinition(def: DefinitionNode): def is ObjectTypeDefinitionNode;
25
+ _isInterfaceDefinition(def: DefinitionNode): def is InterfaceTypeDefinitionNode;
26
+ _generateEntityType(def: ObjectTypeDefinitionNode): tsCodegen.Class;
27
+ _generateConstructor(_entityName: string, fields: readonly FieldDefinitionNode[] | undefined): tsCodegen.Method;
28
+ _generateStoreMethods(entityName: string, idField: IdField): Array<tsCodegen.Method | tsCodegen.StaticMethod>;
29
+ _generateEntityFieldMethods(entityDef: ObjectTypeDefinitionNode, fieldDef: FieldDefinitionNode): Array<tsCodegen.Method>;
30
+ _generateEntityFieldGetter(_entityDef: ObjectTypeDefinitionNode, fieldDef: FieldDefinitionNode): tsCodegen.Method;
31
+ _generateEntityFieldSetter(_entityDef: ObjectTypeDefinitionNode, fieldDef: FieldDefinitionNode): tsCodegen.Method | null;
32
+ _resolveFieldType(gqlType: NamedTypeNode): string;
33
+ /** Return the type that values for this field must have. For scalar
34
+ * types, that's the type from the subgraph schema. For references to
35
+ * other entity types, this is the same as the type of the id of the
36
+ * referred type, i.e., `string` or `Bytes`*/
37
+ _valueTypeFromGraphQl(gqlType: TypeNode): string;
38
+ /** Determine the base type of `gqlType` by removing any non-null
39
+ * constraints and using the type of elements of lists */
40
+ _baseType(gqlType: TypeNode): string;
41
+ _typeFromGraphQl(gqlType: TypeNode, nullable?: boolean): tsCodegen.ArrayType | tsCodegen.NullableType | tsCodegen.NamedType;
42
+ }
43
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import immutable from 'immutable';
2
+ import Protocol from '../protocols';
3
+ import * as tsCodegen from './typescript';
4
+ export default class DataSourceTemplateCodeGenerator {
5
+ template: immutable.Map<any, any>;
6
+ protocolTemplateCodeGen: any;
7
+ constructor(template: immutable.Map<any, any>, protocol: Protocol);
8
+ generateModuleImports(): tsCodegen.ModuleImports[];
9
+ generateTypes(): immutable.List<tsCodegen.Class>;
10
+ _generateTemplateType(): tsCodegen.Class;
11
+ }
@@ -0,0 +1,6 @@
1
+ import immutable from 'immutable';
2
+ /**
3
+ * Type conversions
4
+ */
5
+ declare const _default: immutable.Collection<unknown, unknown>;
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export declare const ascTypeForProtocol: (protocol: string, protocolType: string) => string;
2
+ export declare const ascTypeForEthereum: (ethereumType: string) => string;
3
+ export declare const ethereumTypeForAsc: (ascType: string) => string | RegExp;
4
+ export declare const ethereumToAsc: (code: string, ethereumType: string, internalType?: string) => any;
5
+ export declare const ethereumFromAsc: (code: string, ethereumType: string) => any;
6
+ export declare const ascTypeForValue: (valueType: string) => unknown;
7
+ export declare const valueTypeForAsc: (ascType: string) => unknown;
8
+ export declare const valueToAsc: (code: string, valueType: string) => any;
9
+ export declare const valueFromAsc: (code: string, valueType: string) => any;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,78 @@
1
+ declare class Param {
2
+ name: string;
3
+ type: string | NamedType | ArrayType | NullableType;
4
+ constructor(name: string, type: string | NamedType | ArrayType | NullableType);
5
+ toString(): string;
6
+ }
7
+ declare class Method {
8
+ name: string;
9
+ params: Param[];
10
+ returnType: string | NamedType | ArrayType | NullableType | null | undefined;
11
+ body: string;
12
+ constructor(name: string, params: Param[], returnType: string | NamedType | ArrayType | NullableType | null | undefined, body: string);
13
+ toString(): string;
14
+ }
15
+ declare class StaticMethod {
16
+ name: string;
17
+ params: Param[];
18
+ returnType: NamedType | NullableType;
19
+ body: string;
20
+ constructor(name: string, params: Param[], returnType: NamedType | NullableType, body: string);
21
+ toString(): string;
22
+ }
23
+ interface ClassOptions {
24
+ extends?: string;
25
+ export?: boolean;
26
+ }
27
+ declare class Class {
28
+ name: string;
29
+ extends: string | undefined;
30
+ methods: string[];
31
+ members: any[];
32
+ export: boolean;
33
+ constructor(name: string, options: ClassOptions);
34
+ addMember(member: any): void;
35
+ addMethod(method: any): void;
36
+ toString(): string;
37
+ }
38
+ declare class ClassMember {
39
+ name: string;
40
+ type: string;
41
+ constructor(name: string, type: string);
42
+ toString(): string;
43
+ }
44
+ declare class NamedType {
45
+ name: string;
46
+ constructor(name: string);
47
+ toString(): string;
48
+ capitalize(): this;
49
+ isPrimitive(): boolean;
50
+ }
51
+ declare class ArrayType {
52
+ inner: NamedType;
53
+ name: string;
54
+ constructor(inner: NamedType);
55
+ toString(): string;
56
+ }
57
+ declare class NullableType {
58
+ inner: NamedType | ArrayType;
59
+ constructor(inner: NamedType | ArrayType);
60
+ toString(): string;
61
+ }
62
+ declare class ModuleImports {
63
+ nameOrNames: string | string[];
64
+ module: string;
65
+ constructor(nameOrNames: string | string[], module: string);
66
+ toString(): string;
67
+ }
68
+ declare const namedType: (name: string) => NamedType;
69
+ declare const arrayType: (name: NamedType) => ArrayType;
70
+ declare const param: (name: string, type: string | NamedType | ArrayType | NullableType) => Param;
71
+ declare const method: (name: string, params: Param[], returnType: string | NamedType | ArrayType | NullableType | null | undefined, body: string) => Method;
72
+ declare const staticMethod: (name: string, params: Param[], returnType: NamedType | NullableType, body: string) => StaticMethod;
73
+ declare const klass: (name: string, options: ClassOptions) => Class;
74
+ declare const klassMember: (name: string, type: string) => ClassMember;
75
+ declare const nullableType: (type: NamedType | ArrayType) => NullableType;
76
+ declare const moduleImports: (nameOrNames: string | string[], module: string) => ModuleImports;
77
+ declare const GENERATED_FILE_NOTE = "\n// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.\n";
78
+ export { ArrayType, arrayType, Class, ClassMember, GENERATED_FILE_NOTE, klass, klassMember, Method, method, ModuleImports, moduleImports, NamedType, namedType, NullableType, nullableType, Param, param, StaticMethod, staticMethod, };
@@ -0,0 +1,14 @@
1
+ export declare function disambiguateNames<T>({ values, getName, setName, }: {
2
+ values: T[];
3
+ getName: (value: T, index: number) => string;
4
+ setName: (value: T, name: string) => void;
5
+ }): void[];
6
+ export declare function isTupleType(t: string): boolean;
7
+ export declare function containsTupleType(t: string): true | RegExpMatchArray | null;
8
+ export declare function isTupleArrayType(t: string): RegExpMatchArray | null;
9
+ export declare function isTupleMatrixType(t: string): RegExpMatchArray | null;
10
+ export declare const unrollTuple: ({ path, value, }: {
11
+ path: string[];
12
+ index: number;
13
+ value: any;
14
+ }) => any;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import ABI from '../protocols/ethereum/abi';
2
+ export declare const loadAbiFromEtherscan: (ABICtor: typeof ABI, network: string, address: string) => Promise<ABI>;
3
+ export declare const loadStartBlockForContract: (network: string, address: string) => Promise<string>;
4
+ export declare const fetchDeployContractTransactionFromEtherscan: (network: string, address: string) => Promise<string>;
5
+ export declare const fetchContractCreationHashWithRetry: (url: string, retryCount: number) => Promise<any>;
6
+ export declare const fetchTransactionByHashFromRPC: (network: string, transactionHash: string) => Promise<any>;
7
+ export declare const getStartBlockForContract: (network: string, address: string) => Promise<number>;
8
+ export declare const loadAbiFromBlockScout: (ABICtor: typeof ABI, network: string, address: string) => Promise<any>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const identifyDeployKey: (node: string, deployKey: string | undefined) => Promise<any>;
2
+ export declare const saveDeployKey: (node: string, deployKey: string) => Promise<void>;
@@ -0,0 +1,13 @@
1
+ import Compiler from '../compiler';
2
+ import Protocol from '../protocols';
3
+ interface CreateCompilerOptions {
4
+ ipfs: any;
5
+ headers?: any;
6
+ outputDir: string;
7
+ outputFormat: string;
8
+ skipMigrations: boolean;
9
+ blockIpfsMethods?: RegExpMatchArray;
10
+ protocol: Protocol;
11
+ }
12
+ export declare function createCompiler(manifest: string, { ipfs, headers, outputDir, outputFormat, skipMigrations, blockIpfsMethods, protocol, }: CreateCompilerOptions): Compiler | null;
13
+ export {};
@@ -0,0 +1,4 @@
1
+ import immutable from 'immutable';
2
+ import Protocol from '../protocols';
3
+ export declare const fromFilePath: (manifestPath: string) => Promise<any>;
4
+ export declare const fromManifest: (manifest: immutable.Map<any, any>, protocol: Protocol) => any;
@@ -0,0 +1,2 @@
1
+ declare const displayPath: (p: string) => string;
2
+ export { displayPath };
@@ -0,0 +1,2 @@
1
+ declare const DEFAULT_IPFS_URL: "https://api.thegraph.com/ipfs/api/v0";
2
+ export { DEFAULT_IPFS_URL };
@@ -0,0 +1,2 @@
1
+ import jayson from 'jayson';
2
+ export declare function createJsonRpcClient(url: URL): jayson.Client | null;
@@ -0,0 +1,3 @@
1
+ export declare const updateSubgraphNetwork: (manifest: any, network: string, networksFile: string, identifierName: string) => Promise<any>;
2
+ export declare const initNetworksConfig: (directory: string, identifierName: string) => Promise<any>;
3
+ export declare function updateNetworksFile(network: string, dataSource: any, address: string, networksFile: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ /// <reference types="node" />
2
+ import { URL } from 'url';
3
+ export declare const validateNodeUrl: (node: string) => URL;
4
+ export declare const normalizeNodeUrl: (node: string) => string;
5
+ export declare function chooseNodeUrl({ product, studio, node, allowSimpleName, }: {
6
+ product: string | undefined;
7
+ studio: boolean | undefined;
8
+ node?: string;
9
+ allowSimpleName?: boolean;
10
+ }): {
11
+ node: string | undefined;
12
+ allowSimpleName: boolean | undefined;
13
+ };
@@ -0,0 +1,35 @@
1
+ import { Map } from 'immutable';
2
+ import Protocol from '../protocols';
3
+ import ABI from '../protocols/ethereum/abi';
4
+ import { Spinner } from './spinner';
5
+ export declare const generateDataSource: (protocol: Protocol, contractName: string, network: string, contractAddress: string, abi: ABI, startBlock?: string) => Promise<Map<unknown, unknown>>;
6
+ export declare const generateScaffold: ({ protocolInstance, abi, contract, network, subgraphName, indexEvents, contractName, startBlock, node, }: {
7
+ protocolInstance: Protocol;
8
+ abi: ABI;
9
+ contract: string;
10
+ network: string;
11
+ subgraphName: string;
12
+ indexEvents: boolean;
13
+ contractName?: string | undefined;
14
+ startBlock?: string | undefined;
15
+ node?: string | undefined;
16
+ }, spinner: Spinner) => Promise<{
17
+ 'package.json': string;
18
+ 'subgraph.yaml': string;
19
+ 'schema.graphql': string;
20
+ 'tsconfig.json': string;
21
+ src: {
22
+ [x: string]: string;
23
+ } | undefined;
24
+ abis: {
25
+ [x: string]: string;
26
+ } | undefined;
27
+ tests: {
28
+ [x: string]: string;
29
+ } | undefined;
30
+ }>;
31
+ export declare const writeScaffold: (scaffold: any, directory: string, spinner: Spinner) => Promise<void>;
32
+ export declare const writeABI: (abi: ABI, contractName: string) => Promise<void>;
33
+ export declare const writeSchema: (abi: ABI, protocol: Protocol, schemaPath: string, entities: any, contractName: string) => Promise<void>;
34
+ export declare const writeMapping: (abi: ABI, protocol: Protocol, contractName: string, entities: any) => Promise<void>;
35
+ export declare const writeTestsFiles: (abi: ABI, protocol: Protocol, contractName: string) => Promise<void>;
@@ -0,0 +1,4 @@
1
+ import { GluegunPrint } from 'gluegun';
2
+ export type Spinner = ReturnType<GluegunPrint['spin']>;
3
+ export declare const step: (spinner: Spinner, subject: string, text?: string) => Spinner;
4
+ export declare const withSpinner: (text: string, errorText: string, warningText: string, f: (spinner: Spinner) => Promise<any> | any) => Promise<any>;
@@ -0,0 +1,6 @@
1
+ export declare const allowedStudioNetworks: readonly ["mainnet", "rinkeby", "goerli", "gnosis", "chapel", "optimism-goerli", "clover", "fantom-testnet", "arbitrum-goerli", "fuji", "celo-alfajores", "mumbai", "aurora-testnet", "near-testnet", "theta-testnet-001", "osmo-test-4", "base-testnet", "celo", "arbitrum-one", "avalanche", "zksync-era", "sepolia", "polygon-zkevm-testnet", "polygon-zkevm"];
2
+ export declare const validateStudioNetwork: ({ studio, product, network, }: {
3
+ studio?: string | boolean | undefined;
4
+ product?: string | undefined;
5
+ network?: string | undefined;
6
+ }) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const validateSubgraphName: (name: string, { allowSimpleName }: {
2
+ allowSimpleName?: boolean | undefined;
3
+ }) => string | undefined;
4
+ export declare const getSubgraphBasename: (name: string) => string;
@@ -0,0 +1,2 @@
1
+ export declare const assertManifestApiVersion: (manifestPath: string, minimumApiVersion: string) => Promise<void>;
2
+ export declare const assertGraphTsVersion: (sourceDir: string, minimumGraphTsVersion: string) => Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,17 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class AddCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ address: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ 'subgraph-manifest': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
+ abi: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ 'start-block': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
+ 'contract-name': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
+ 'merge-entities': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ 'network-file': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,14 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class AuthCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ node: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
6
+ 'deploy-key': import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
+ product: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ studio: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
@@ -0,0 +1,18 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class BuildCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ 'subgraph-manifest': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ ipfs: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ 'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ 'output-format': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
+ 'skip-migrations': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ network: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ 'network-file': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
+ };
17
+ run(): Promise<void>;
18
+ }
@@ -0,0 +1,16 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class CodegenCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ 'subgraph-manifest': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ 'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ 'skip-migrations': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ uncrashable: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ 'uncrashable-config': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ };
15
+ run(): Promise<void>;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class CreateCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ 'subgraph-name': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ 'access-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,26 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class DeployCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ 'subgraph-name': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ 'subgraph-manifest': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
+ product: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ studio: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
+ 'deploy-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ 'access-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ 'version-label': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
+ ipfs: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
17
+ headers: import("@oclif/core/lib/interfaces").OptionFlag<Record<string, string> | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
18
+ 'debug-fork': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
19
+ 'output-dir': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
20
+ 'skip-migrations': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
+ watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
22
+ network: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
23
+ 'network-file': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
24
+ };
25
+ run(): Promise<void>;
26
+ }
@@ -0,0 +1,24 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class InitCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ subgraphName: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
6
+ directory: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
10
+ protocol: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ product: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
+ studio: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ 'allow-simple-name': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ 'from-contract': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
16
+ 'from-example': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
17
+ 'contract-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
18
+ 'index-events': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ 'start-block': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
20
+ abi: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
21
+ network: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
22
+ };
23
+ run(): Promise<void>;
24
+ }
@@ -0,0 +1,21 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class LocalCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ 'local-command': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ 'node-logs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ 'ethereum-logs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ 'compose-file': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
+ 'node-image': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
13
+ 'standalone-node': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ 'standalone-node-args': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ 'skip-wait-for-ipfs': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ 'skip-wait-for-etherium': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
+ 'skip-wait-for-postgres': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
+ timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
19
+ };
20
+ run(): Promise<void>;
21
+ }
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class RemoveCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ 'subgraph-name': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ node: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ 'access-token': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
+ };
12
+ run(): Promise<void>;
13
+ }
@@ -0,0 +1,17 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class TestCommand extends Command {
3
+ static description: string;
4
+ static args: {
5
+ datasource: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
9
+ coverage: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ docker: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ logs: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ recompile: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ };
16
+ run(): Promise<void>;
17
+ }
@@ -0,0 +1,9 @@
1
+ export declare const ready: () => Promise<void>;
2
+ export interface CompileOptions {
3
+ inputFile: string;
4
+ global: string;
5
+ baseDir: string;
6
+ libs: string;
7
+ outputFile: string;
8
+ }
9
+ export declare const compile: ({ inputFile, global, baseDir, libs, outputFile }: CompileOptions) => void;
@@ -0,0 +1,53 @@
1
+ /// <reference types="node" />
2
+ import immutable from 'immutable';
3
+ import { Spinner } from '../command-helpers/spinner';
4
+ import Protocol from '../protocols';
5
+ interface CompilerOptions {
6
+ ipfs: any;
7
+ subgraphManifest: string;
8
+ outputDir: string;
9
+ outputFormat: string;
10
+ skipMigrations: boolean;
11
+ blockIpfsMethods?: RegExpMatchArray;
12
+ protocol: Protocol;
13
+ }
14
+ export default class Compiler {
15
+ private options;
16
+ private ipfs;
17
+ private sourceDir;
18
+ private blockIpfsMethods?;
19
+ private libsDirs;
20
+ /**
21
+ * Path to the global.ts file in the graph-ts package.
22
+ *
23
+ * @note if you are using substreams as a protocol, this will be undefined.
24
+ */
25
+ private globalsFile?;
26
+ private protocol;
27
+ private ABI;
28
+ constructor(options: CompilerOptions);
29
+ subgraphDir(parent: string, subgraph: immutable.Map<any, any>): string;
30
+ displayPath(p: string): string;
31
+ cacheKeyForFile(filename: string): string;
32
+ compile(): Promise<any>;
33
+ completed(ipfsHashOrPath: string): void;
34
+ loadSubgraph({ quiet }?: {
35
+ quiet: boolean;
36
+ }): Promise<any>;
37
+ getFilesToWatch(): Promise<string[]>;
38
+ watchAndCompile(onCompiled?: (ipfsHash: string) => void): Promise<void>;
39
+ _writeSubgraphFile(maybeRelativeFile: string, data: string | Buffer, sourceDir: string, targetDir: string, spinner: Spinner): string;
40
+ compileSubgraph(subgraph: any): Promise<any>;
41
+ _compileDataSourceMapping(protocol: Protocol, dataSource: immutable.Map<any, any>, mappingPath: string, compiledFiles: Map<any, any>, spinner: Spinner): any;
42
+ _compileTemplateMapping(template: immutable.Collection<any, any>, mappingPath: string, compiledFiles: Map<any, any>, spinner: Spinner): any;
43
+ _validateMappingContent(filePath: string): void;
44
+ writeSubgraphToOutputDirectory(protocol: Protocol, subgraph: immutable.Map<any, any>): Promise<any>;
45
+ uploadSubgraphToIPFS(subgraph: immutable.Map<any, any>): Promise<any>;
46
+ _uploadFileToIPFS(maybeRelativeFile: string, uploadedFiles: Map<any, any>, spinner: Spinner): Promise<immutable.Collection<unknown, unknown>>;
47
+ _uploadSubgraphDefinitionToIPFS(subgraph: immutable.Map<any, any>): Promise<string>;
48
+ _uploadToIPFS(file: {
49
+ path: string;
50
+ content: Buffer;
51
+ }): Promise<string>;
52
+ }
53
+ export {};
@@ -0,0 +1,2 @@
1
+ import debugFactory from 'debug';
2
+ export default debugFactory;
@@ -0,0 +1 @@
1
+ export { run } from '@oclif/core';
@@ -0,0 +1,11 @@
1
+ declare const _default: {
2
+ name: string;
3
+ predicate: ({ sourceDir, manifestFile }: {
4
+ sourceDir: string;
5
+ manifestFile: string;
6
+ }) => Promise<any>;
7
+ apply: ({ manifestFile }: {
8
+ manifestFile: string;
9
+ }) => Promise<void>;
10
+ };
11
+ export default _default;