(webhookSchemas)
| 46 | } |
| 47 | |
| 48 | async function getWebhookOperations(webhookSchemas) { |
| 49 | console.log('⏭️ Start generating static webhook files\n') |
| 50 | const webhookSchemaData = await getDereferencedFiles(webhookSchemas) |
| 51 | const webhookOperations = {} |
| 52 | for (const [schemaName, schema] of Object.entries(webhookSchemaData)) { |
| 53 | try { |
| 54 | const webhooks = await getWebhooks(schema) |
| 55 | if (webhooks.length) { |
| 56 | console.log(`...processing ${schemaName} webhook operations`) |
| 57 | await Promise.all(webhooks.map((webhook) => webhook.process())) |
| 58 | webhookOperations[schemaName] = webhooks |
| 59 | } |
| 60 | } catch (error) { |
| 61 | throw new Error( |
| 62 | "🐛 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." |
| 63 | ) |
| 64 | } |
| 65 | } |
| 66 | return webhookOperations |
| 67 | } |
| 68 | |
| 69 | async function createStaticRestFiles(restOperations) { |
| 70 | const operationsEnabledForGitHubApps = {} |
no test coverage detected