MCPcopy
hub / github.com/github/docs / getWebhooks

Function getWebhooks

src/rest/scripts/utils/get-operations.js:22–33  ·  view source on GitHub ↗
(schema)

Source from the content-addressed store, hash-verified

20}
21
22export async function getWebhooks(schema) {
23 // In OpenAPI version 3.1, the schema data is under the `webhooks` key, but
24 // in 3.0 the schema data was in `x-webhooks`. We just fallback to
25 // `x-webhooks` for now since there's currently otherwise no difference with
26 // the schema data so we can handle either version.
27 const webhooks = schema.webhooks ?? schema['x-webhooks']
28 if (webhooks) {
29 return Object.values(webhooks).map((webhook) => new Webhook(webhook.post))
30 }
31
32 return []
33}

Callers 1

getWebhookOperationsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected