( manifestPath: string, userInput: UserInput, existingManifestData: Document )
| 414 | await fs.promises.writeFile(manifestPath, updateManifest, 'utf8'); |
| 415 | } |
| 416 | export 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 | |
| 434 | export function constructHandlerProps(methods: [SelectedMethod[], SelectedMethod[]], abiName: string): AbiPropType { |
| 435 | const handlers: HandlerPropType[] = []; |
no test coverage detected