-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Azure Functions v4 support (#164)
- Loading branch information
1 parent
69e86c6
commit 9acbb12
Showing
7 changed files
with
140 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = azureFunctionV4; | ||
|
||
/** | ||
* @param {import('probot').Probot} probot | ||
* @param {import('@azure/functions').HttpRequest} request | ||
* @param {import('@azure/functions').InvocationContext} context | ||
* @returns {Promise<import('@azure/functions').HttpResponseInit>} | ||
*/ | ||
async function azureFunctionV4(probot, request, context) { | ||
await probot.webhooks.verifyAndReceive({ | ||
id: request.headers.get("X-GitHub-Delivery"), | ||
name: request.headers.get("X-GitHub-Event"), | ||
signature: request.headers.get("X-Hub-Signature-256"), | ||
payload: await request.text(), | ||
}); | ||
|
||
return { | ||
status: 200, | ||
body: "ok", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
declare module "@probot/adapter-azure-functions" { | ||
import ProbotExports = require("probot"); | ||
|
||
/** | ||
* @param {import('probot').ApplicationFunction} app | ||
* @param { { probot: import('probot').Probot } } options | ||
*/ | ||
function createAzureFunction(app: ProbotExports.ApplicationFunction, { probot }: { | ||
probot: ProbotExports.Probot; | ||
}): any; | ||
|
||
/** | ||
* @param {import('probot').ApplicationFunction} app | ||
* @param { { probot: import('probot').Probot } } options | ||
*/ | ||
function createAzureFunctionV4(app: ProbotExports.ApplicationFunction, { probot }: { | ||
probot: ProbotExports.Probot; | ||
}): any; | ||
|
||
const _exports: { | ||
createAzureFunction: typeof createAzureFunction; | ||
createAzureFunctionV4: typeof createAzureFunctionV4; | ||
Context: typeof ProbotExports.Context; | ||
ProbotOctokit: typeof import("@octokit/core").Octokit & import("@octokit/core/dist-types/types").Constructor<{ | ||
retry: { | ||
retryRequest: (error: import("@octokit/request-error").RequestError, retries: number, retryAfter: number) => import("@octokit/request-error").RequestError; | ||
}; | ||
} & { | ||
paginate: import("@octokit/plugin-paginate-rest").PaginateInterface; | ||
} & import("@octokit/plugin-rest-endpoint-methods/dist-types/generated/method-types").RestEndpointMethods & import("@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & import("@probot/octokit-plugin-config/dist-types/types").API>; | ||
run: typeof ProbotExports.run; | ||
Probot: typeof ProbotExports.Probot; | ||
Server: typeof ProbotExports.Server; | ||
createNodeMiddleware: typeof ProbotExports.createNodeMiddleware; | ||
createProbot: typeof ProbotExports.createProbot; | ||
}; | ||
|
||
export = _exports; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
// Change this to match your project | ||
"include": ["./index.js"], | ||
"compilerOptions": { | ||
// Tells TypeScript to read JS files, as | ||
// normally they are ignored as source files | ||
"allowJs": true, | ||
// Generate d.ts files | ||
"declaration": true, | ||
// This compiler run should | ||
// only output d.ts files | ||
"emitDeclarationOnly": true, | ||
// go to js file when using IDE functions like | ||
// "Go to Definition" in VSCode | ||
"declarationMap": true, | ||
"esModuleInterop": true, | ||
"outFile": "index.d.ts" | ||
} | ||
} |