diff --git a/src/App.ts b/src/App.ts index cb68dfa4e..d01560088 100644 --- a/src/App.ts +++ b/src/App.ts @@ -854,6 +854,7 @@ export default class App { const context: Context = { ...authorizeResult, ...event.customProperties, + isEnterpriseInstall, retryNum: event.retryNum, retryReason: event.retryReason, }; @@ -1329,7 +1330,7 @@ function buildSource( if (type === IncomingEventType.Event) { const bodyAsEvent = body as SlackEventMiddlewareArgs['body']; if (Array.isArray(bodyAsEvent.authorizations) && bodyAsEvent.authorizations[0] !== undefined) { - // The enteprise_id here can be null when the workspace is not in an Enterprise Grid + // The enterprise_id here can be null when the workspace is not in an Enterprise Grid const theId = bodyAsEvent.authorizations[0].enterprise_id; return theId !== null ? theId : undefined; } diff --git a/src/types/middleware.ts b/src/types/middleware.ts index 5419098b7..9426480c0 100644 --- a/src/types/middleware.ts +++ b/src/types/middleware.ts @@ -64,6 +64,10 @@ export interface Context extends StringIndexed { * Enterprise Grid Organization ID. */ enterpriseId?: string; + /** + * Is the app installed at an Enterprise level? + */ + isEnterpriseInstall: boolean, /** * Retry count of an Events API request (this property does not exist for other requests)