@float-capital/float-subgraph-uncrashable
Advanced tools
Comparing version 0.0.0-alpha.3 to 0.0.0-alpha.4
{ | ||
"name": "@float-capital/float-subgraph-uncrashable", | ||
"version": "0.0.0-alpha.3", | ||
"version": "0.0.0-alpha.4", | ||
"description": "Safe Subgraph Code Generation Framework by Float", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,3 +14,3 @@ // Generated by ReScript, PLEASE EDIT WITH CARE | ||
var outputEntityFilePath = "./src/" + generatedFolderName; | ||
var outputEntityFilePath = "./" + generatedFolderName; | ||
@@ -17,0 +17,0 @@ var safeMode = Belt_Option.getWithDefault(env.SAFE_MODE, "false"); |
@@ -79,3 +79,3 @@ // Generated by ReScript, PLEASE EDIT WITH CARE | ||
function outputCode(entityImports, networkIdPrefix, functions) { | ||
return "import {\n" + entityImports + "\n} from \"../../" + CodegenConfig.generatedFolderName + "/schema\";\nimport {\n Address,\n BigInt,\n Bytes,\n BigDecimal,\n log,\n Entity,\n dataSource, \n} from \"@graphprotocol/graph-ts\";\n\nexport let NETWORK_NAME = dataSource.network(); // e.g. \"mainnet\", \"matic\", \"avalanche\", \"ropsten\", \"poa-core\"\n\nfunction getIdPrefix(network: string): string {\n" + networkIdPrefix + "\n}\nexport let ENTITY_ID_PREFIX = getIdPrefix(NETWORK_NAME);\n\nfunction ensureEntityIdHasCorrectPrefix(entityId: string): string {\n if (entityId.startsWith(ENTITY_ID_PREFIX)) {\n return entityId;\n } else {\n return ENTITY_ID_PREFIX + entityId;\n }\n}\n\nexport class GetOrCreateReturn<EntityType> {\n entity: EntityType;\n wasCreated: boolean;\n\n constructor(entity: EntityType, wasCreated: boolean) {\n this.entity = entity;\n this.wasCreated = wasCreated;\n }\n}\n" + functions + "\n"; | ||
return "import {\n" + entityImports + "\n} from \"./schema\";\nimport {\n Address,\n BigInt,\n Bytes,\n BigDecimal,\n log,\n Entity,\n dataSource, \n} from \"@graphprotocol/graph-ts\";\n\nexport let NETWORK_NAME = dataSource.network(); // e.g. \"mainnet\", \"matic\", \"avalanche\", \"ropsten\", \"poa-core\"\n\nfunction getIdPrefix(network: string): string {\n" + networkIdPrefix + "\n}\nexport let ENTITY_ID_PREFIX = getIdPrefix(NETWORK_NAME);\n\nfunction ensureEntityIdHasCorrectPrefix(entityId: string): string {\n if (entityId.startsWith(ENTITY_ID_PREFIX)) {\n return entityId;\n } else {\n return ENTITY_ID_PREFIX + entityId;\n }\n}\n\nexport class GetOrCreateReturn<EntityType> {\n entity: EntityType;\n wasCreated: boolean;\n\n constructor(entity: EntityType, wasCreated: boolean) {\n this.entity = entity;\n this.wasCreated = wasCreated;\n }\n}\n" + functions + "\n"; | ||
} | ||
@@ -82,0 +82,0 @@ |
@@ -322,4 +322,4 @@ // Generated by ReScript, PLEASE EDIT WITH CARE | ||
} | ||
Fs.writeFileSync(outputFilePath + "/UncrashableHelpers.ts", GraphEntityGenTemplates.outputCode(entityImports, entityPrefixDefinition, functions), "utf8"); | ||
console.log("Output saved to " + outputFilePath + "UncrashableHelpers.ts"); | ||
Fs.writeFileSync(outputFilePath + "/UncrashableEntityHelpers.ts", GraphEntityGenTemplates.outputCode(entityImports, entityPrefixDefinition, functions), "utf8"); | ||
console.log("Output saved to " + outputFilePath + "/UncrashableEntityHelpers.ts"); | ||
@@ -326,0 +326,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
405248