(restSchemas)
| 23 | } |
| 24 | |
| 25 | async function getRestOperations(restSchemas) { |
| 26 | console.log('\n⏭️ Start generating static REST files\n') |
| 27 | const restSchemaData = await getDereferencedFiles(restSchemas) |
| 28 | const restOperations = {} |
| 29 | for (const [schemaName, schema] of Object.entries(restSchemaData)) { |
| 30 | try { |
| 31 | // get all of the operations and wehbooks for a particular version of the openapi |
| 32 | const operations = await getOperations(schema) |
| 33 | // process each operation and webhook, asynchronously rendering markdown and stuff |
| 34 | if (operations.length) { |
| 35 | console.log(`...processing ${schemaName} rest operations`) |
| 36 | await Promise.all(operations.map((operation) => operation.process())) |
| 37 | restOperations[schemaName] = operations |
| 38 | } |
| 39 | } catch (error) { |
| 40 | throw new Error( |
| 41 | "🐛 Whoops! It looks like the decorator script wasn't able to parse the dereferenced schema. A recent change may not yet be supported by the decorator. Please reach out in the #docs-engineering slack channel for help." |
| 42 | ) |
| 43 | } |
| 44 | } |
| 45 | return restOperations |
| 46 | } |
| 47 | |
| 48 | async function getWebhookOperations(webhookSchemas) { |
| 49 | console.log('⏭️ Start generating static webhook files\n') |
no test coverage detected