MCPcopy
hub / github.com/subquery/subql / generateManifestYaml

Function generateManifestYaml

packages/cli/src/controller/generate-controller.ts:416–432  ·  view source on GitHub ↗
(
  manifestPath: string,
  userInput: UserInput,
  existingManifestData: Document
)

Source from the content-addressed store, hash-verified

414 await fs.promises.writeFile(manifestPath, updateManifest, 'utf8');
415}
416export async function generateManifestYaml(
417 manifestPath: string,
418 userInput: UserInput,
419 existingManifestData: Document
420): Promise<void> {
421 const inputDs = constructDatasourcesYaml(userInput, manifestPath);
422 const dsNode = existingManifestData.get('dataSources') as YAMLSeq;
423 if (!dsNode || !dsNode.items.length) {
424 // To ensure output is in yaml format
425 const cleanDs = new YAMLSeq();
426 cleanDs.add(inputDs);
427 existingManifestData.set('dataSources', cleanDs);
428 } else {
429 dsNode.add(inputDs);
430 }
431 await fs.promises.writeFile(path.join(manifestPath), existingManifestData.toString(), 'utf8');
432}
433
434export function constructHandlerProps(methods: [SelectedMethod[], SelectedMethod[]], abiName: string): AbiPropType {
435 const handlers: HandlerPropType[] = [];

Callers 2

generateAdapterFunction · 0.90

Calls 4

constructDatasourcesYamlFunction · 0.85
addMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected