(version)
| 60 | |
| 61 | // returns all the webhook data for the given version |
| 62 | export async function getWebhooks(version) { |
| 63 | const openApiVersion = getOpenApiVersion(version) |
| 64 | if (!webhooksCache.has(openApiVersion)) { |
| 65 | const filename = `${openApiVersion}.json` |
| 66 | |
| 67 | // The `readCompressedJsonFileFallback()` function |
| 68 | // will check for both a .br and .json extension. |
| 69 | webhooksCache.set( |
| 70 | openApiVersion, |
| 71 | readCompressedJsonFileFallback(path.join(schemasPath, filename)) |
| 72 | ) |
| 73 | } |
| 74 | |
| 75 | return webhooksCache.get(openApiVersion) |
| 76 | } |
| 77 | |
| 78 | function getOpenApiVersion(version) { |
| 79 | if (!(version in allVersions)) { |
no test coverage detected