MCPcopy
hub / github.com/github/docs / getWebhookOperations

Function getWebhookOperations

src/rest/scripts/utils/decorator.js:48–67  ·  view source on GitHub ↗
(webhookSchemas)

Source from the content-addressed store, hash-verified

46}
47
48async 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
69async function createStaticRestFiles(restOperations) {
70 const operationsEnabledForGitHubApps = {}

Callers 1

decorateFunction · 0.85

Calls 3

getWebhooksFunction · 0.90
getDereferencedFilesFunction · 0.85
processMethod · 0.45

Tested by

no test coverage detected