@slack/bolt 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +4 -2
  2. package/dist/package.json +88 -0
  3. package/package.json +4 -4
  4. package/dist/App.d.ts +0 -159
  5. package/dist/App.d.ts.map +0 -1
  6. package/dist/App.js +0 -758
  7. package/dist/App.js.map +0 -1
  8. package/dist/WorkflowStep.d.ts +0 -106
  9. package/dist/WorkflowStep.d.ts.map +0 -1
  10. package/dist/WorkflowStep.js +0 -198
  11. package/dist/WorkflowStep.js.map +0 -1
  12. package/dist/conversation-store.d.ts +0 -31
  13. package/dist/conversation-store.d.ts.map +0 -1
  14. package/dist/conversation-store.js +0 -74
  15. package/dist/conversation-store.js.map +0 -1
  16. package/dist/errors.d.ts +0 -75
  17. package/dist/errors.d.ts.map +0 -1
  18. package/dist/errors.js +0 -112
  19. package/dist/errors.js.map +0 -1
  20. package/dist/helpers.d.ts +0 -24
  21. package/dist/helpers.d.ts.map +0 -1
  22. package/dist/helpers.js +0 -100
  23. package/dist/helpers.js.map +0 -1
  24. package/dist/index.d.ts +0 -13
  25. package/dist/index.d.ts.map +0 -1
  26. package/dist/index.js +0 -43
  27. package/dist/index.js.map +0 -1
  28. package/dist/middleware/builtin.d.ts +0 -52
  29. package/dist/middleware/builtin.d.ts.map +0 -1
  30. package/dist/middleware/builtin.js +0 -337
  31. package/dist/middleware/builtin.js.map +0 -1
  32. package/dist/middleware/process.d.ts +0 -5
  33. package/dist/middleware/process.d.ts.map +0 -1
  34. package/dist/middleware/process.js +0 -25
  35. package/dist/middleware/process.js.map +0 -1
  36. package/dist/receivers/AwsLambdaReceiver.d.ts +0 -50
  37. package/dist/receivers/AwsLambdaReceiver.d.ts.map +0 -1
  38. package/dist/receivers/AwsLambdaReceiver.js +0 -184
  39. package/dist/receivers/AwsLambdaReceiver.js.map +0 -1
  40. package/dist/receivers/ExpressReceiver.d.ts +0 -74
  41. package/dist/receivers/ExpressReceiver.d.ts.map +0 -1
  42. package/dist/receivers/ExpressReceiver.js +0 -440
  43. package/dist/receivers/ExpressReceiver.js.map +0 -1
  44. package/dist/receivers/HTTPReceiver.d.ts +0 -72
  45. package/dist/receivers/HTTPReceiver.d.ts.map +0 -1
  46. package/dist/receivers/HTTPReceiver.js +0 -431
  47. package/dist/receivers/HTTPReceiver.js.map +0 -1
  48. package/dist/receivers/SocketModeReceiver.d.ts +0 -57
  49. package/dist/receivers/SocketModeReceiver.d.ts.map +0 -1
  50. package/dist/receivers/SocketModeReceiver.js +0 -163
  51. package/dist/receivers/SocketModeReceiver.js.map +0 -1
  52. package/dist/receivers/custom-routes.d.ts +0 -14
  53. package/dist/receivers/custom-routes.d.ts.map +0 -1
  54. package/dist/receivers/custom-routes.js +0 -33
  55. package/dist/receivers/custom-routes.js.map +0 -1
  56. package/dist/receivers/render-html-for-install-path.d.ts +0 -3
  57. package/dist/receivers/render-html-for-install-path.d.ts.map +0 -1
  58. package/dist/receivers/render-html-for-install-path.js +0 -25
  59. package/dist/receivers/render-html-for-install-path.js.map +0 -1
  60. package/dist/receivers/verify-redirect-opts.d.ts +0 -7
  61. package/dist/receivers/verify-redirect-opts.d.ts.map +0 -1
  62. package/dist/receivers/verify-redirect-opts.js +0 -23
  63. package/dist/receivers/verify-redirect-opts.js.map +0 -1
  64. package/dist/receivers/verify-request.d.ts +0 -41
  65. package/dist/receivers/verify-request.d.ts.map +0 -1
  66. package/dist/receivers/verify-request.js +0 -98
  67. package/dist/receivers/verify-request.js.map +0 -1
  68. package/dist/types/actions/block-action.d.ts +0 -224
  69. package/dist/types/actions/block-action.d.ts.map +0 -1
  70. package/dist/types/actions/block-action.js +0 -3
  71. package/dist/types/actions/block-action.js.map +0 -1
  72. package/dist/types/actions/dialog-action.d.ts +0 -47
  73. package/dist/types/actions/dialog-action.d.ts.map +0 -1
  74. package/dist/types/actions/dialog-action.js +0 -3
  75. package/dist/types/actions/dialog-action.js.map +0 -1
  76. package/dist/types/actions/index.d.ts +0 -46
  77. package/dist/types/actions/index.d.ts.map +0 -1
  78. package/dist/types/actions/index.js +0 -17
  79. package/dist/types/actions/index.js.map +0 -1
  80. package/dist/types/actions/interactive-message.d.ts +0 -66
  81. package/dist/types/actions/interactive-message.d.ts.map +0 -1
  82. package/dist/types/actions/interactive-message.js +0 -3
  83. package/dist/types/actions/interactive-message.js.map +0 -1
  84. package/dist/types/actions/workflow-step-edit.d.ts +0 -49
  85. package/dist/types/actions/workflow-step-edit.d.ts.map +0 -1
  86. package/dist/types/actions/workflow-step-edit.js +0 -3
  87. package/dist/types/actions/workflow-step-edit.js.map +0 -1
  88. package/dist/types/command/index.d.ts +0 -36
  89. package/dist/types/command/index.d.ts.map +0 -1
  90. package/dist/types/command/index.js +0 -3
  91. package/dist/types/command/index.js.map +0 -1
  92. package/dist/types/events/base-events.d.ts +0 -699
  93. package/dist/types/events/base-events.d.ts.map +0 -1
  94. package/dist/types/events/base-events.js +0 -5
  95. package/dist/types/events/base-events.js.map +0 -1
  96. package/dist/types/events/index.d.ts +0 -63
  97. package/dist/types/events/index.d.ts.map +0 -1
  98. package/dist/types/events/index.js +0 -14
  99. package/dist/types/events/index.js.map +0 -1
  100. package/dist/types/events/message-events.d.ts +0 -312
  101. package/dist/types/events/message-events.d.ts.map +0 -1
  102. package/dist/types/events/message-events.js +0 -3
  103. package/dist/types/events/message-events.js.map +0 -1
  104. package/dist/types/helpers.d.ts +0 -17
  105. package/dist/types/helpers.d.ts.map +0 -1
  106. package/dist/types/helpers.js +0 -3
  107. package/dist/types/helpers.js.map +0 -1
  108. package/dist/types/index.d.ts +0 -10
  109. package/dist/types/index.d.ts.map +0 -1
  110. package/dist/types/index.js +0 -22
  111. package/dist/types/index.js.map +0 -1
  112. package/dist/types/middleware.d.ts +0 -56
  113. package/dist/types/middleware.d.ts.map +0 -1
  114. package/dist/types/middleware.js +0 -3
  115. package/dist/types/middleware.js.map +0 -1
  116. package/dist/types/options/index.d.ts +0 -192
  117. package/dist/types/options/index.d.ts.map +0 -1
  118. package/dist/types/options/index.js +0 -3
  119. package/dist/types/options/index.js.map +0 -1
  120. package/dist/types/receiver.d.ts +0 -13
  121. package/dist/types/receiver.d.ts.map +0 -1
  122. package/dist/types/receiver.js +0 -3
  123. package/dist/types/receiver.js.map +0 -1
  124. package/dist/types/shortcuts/global-shortcut.d.ts +0 -29
  125. package/dist/types/shortcuts/global-shortcut.d.ts.map +0 -1
  126. package/dist/types/shortcuts/global-shortcut.js +0 -3
  127. package/dist/types/shortcuts/global-shortcut.js.map +0 -1
  128. package/dist/types/shortcuts/index.d.ts +0 -23
  129. package/dist/types/shortcuts/index.d.ts.map +0 -1
  130. package/dist/types/shortcuts/index.js +0 -16
  131. package/dist/types/shortcuts/index.js.map +0 -1
  132. package/dist/types/shortcuts/message-shortcut.d.ts +0 -43
  133. package/dist/types/shortcuts/message-shortcut.d.ts.map +0 -1
  134. package/dist/types/shortcuts/message-shortcut.js +0 -3
  135. package/dist/types/shortcuts/message-shortcut.js.map +0 -1
  136. package/dist/types/utilities.d.ts +0 -23
  137. package/dist/types/utilities.d.ts.map +0 -1
  138. package/dist/types/utilities.js +0 -3
  139. package/dist/types/utilities.js.map +0 -1
  140. package/dist/types/view/index.d.ts +0 -175
  141. package/dist/types/view/index.d.ts.map +0 -1
  142. package/dist/types/view/index.js +0 -3
  143. package/dist/types/view/index.js.map +0 -1
@@ -1,74 +0,0 @@
1
- /// <reference types="node" />
2
- import { Server, ServerOptions } from 'http';
3
- import { Server as HTTPSServer, ServerOptions as HTTPSServerOptions } from 'https';
4
- import { ListenOptions } from 'net';
5
- import { Application, RequestHandler, IRouter } from 'express';
6
- import { Logger, LogLevel } from '@slack/logger';
7
- import { InstallProvider, CallbackOptions, InstallProviderOptions, InstallURLOptions } from '@slack/oauth';
8
- import App from '../App';
9
- import { AnyMiddlewareArgs, Receiver } from '../types';
10
- export declare const respondToSslCheck: RequestHandler;
11
- export declare const respondToUrlVerification: RequestHandler;
12
- export interface ExpressReceiverOptions {
13
- signingSecret: string | (() => PromiseLike<string>);
14
- logger?: Logger;
15
- logLevel?: LogLevel;
16
- endpoints?: string | {
17
- [endpointType: string]: string;
18
- };
19
- signatureVerification?: boolean;
20
- processBeforeResponse?: boolean;
21
- clientId?: string;
22
- clientSecret?: string;
23
- stateSecret?: InstallProviderOptions['stateSecret'];
24
- redirectUri?: string;
25
- installationStore?: InstallProviderOptions['installationStore'];
26
- scopes?: InstallURLOptions['scopes'];
27
- installerOptions?: InstallerOptions;
28
- app?: Application;
29
- router?: IRouter;
30
- }
31
- interface InstallerOptions {
32
- stateStore?: InstallProviderOptions['stateStore'];
33
- stateVerification?: InstallProviderOptions['stateVerification'];
34
- authVersion?: InstallProviderOptions['authVersion'];
35
- metadata?: InstallURLOptions['metadata'];
36
- installPath?: string;
37
- directInstall?: boolean;
38
- renderHtmlForInstallPath?: (url: string) => string;
39
- redirectUriPath?: string;
40
- callbackOptions?: CallbackOptions;
41
- userScopes?: InstallURLOptions['userScopes'];
42
- clientOptions?: InstallProviderOptions['clientOptions'];
43
- authorizationUrl?: InstallProviderOptions['authorizationUrl'];
44
- }
45
- /**
46
- * Receives HTTP requests with Events, Slash Commands, and Actions
47
- */
48
- export default class ExpressReceiver implements Receiver {
49
- app: Application;
50
- private server?;
51
- private bolt;
52
- private logger;
53
- private processBeforeResponse;
54
- private signatureVerification;
55
- router: IRouter;
56
- installer: InstallProvider | undefined;
57
- installerOptions?: InstallerOptions;
58
- constructor({ signingSecret, logger, logLevel, endpoints, processBeforeResponse, signatureVerification, clientId, clientSecret, stateSecret, redirectUri, installationStore, scopes, installerOptions, app, router, }: ExpressReceiverOptions);
59
- private requestHandler;
60
- init(bolt: App): void;
61
- start(port: number): Promise<Server>;
62
- start(portOrListenOptions: number | ListenOptions, serverOptions?: ServerOptions): Promise<Server>;
63
- start(portOrListenOptions: number | ListenOptions, httpsServerOptions?: HTTPSServerOptions): Promise<HTTPSServer>;
64
- stop(): Promise<void>;
65
- }
66
- export declare function verifySignatureAndParseRawBody(logger: Logger, signingSecret: string | (() => PromiseLike<string>)): RequestHandler;
67
- /**
68
- * This request handler has two responsibilities:
69
- * - Verify the request signature
70
- * - Parse request.body and assign the successfully parsed object to it.
71
- */
72
- export declare function verifySignatureAndParseBody(signingSecret: string, body: string, headers: Record<string, any>): AnyMiddlewareArgs['body'];
73
- export {};
74
- //# sourceMappingURL=ExpressReceiver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpressReceiver.d.ts","sourceRoot":"","sources":["../../src/receivers/ExpressReceiver.ts"],"names":[],"mappings":";AACA,OAAO,EAAgB,MAAM,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAqC,MAAM,IAAI,WAAW,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAgB,EAAqB,WAAW,EAAE,cAAc,EAAU,OAAO,EAAE,MAAM,SAAS,CAAC;AAKnG,OAAO,EAAE,MAAM,EAAiB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC3G,OAAO,GAAG,MAAM,QAAQ,CAAC;AAQzB,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAiB,MAAM,UAAU,CAAC;AAwCtE,eAAO,MAAM,iBAAiB,EAAE,cAM/B,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,cAMtC,CAAC;AAIF,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,GAAG,CAAC,MAAM,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,SAAS,CAAC,EACR,MAAM,GACN;QACA,CAAC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,CAAC,GAC3B,iBAAiB,CAAC,MAAM,CAAC,CAW3B"}
@@ -1,440 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
10
- Object.defineProperty(o, "default", { enumerable: true, value: v });
11
- }) : function(o, v) {
12
- o["default"] = v;
13
- });
14
- var __importStar = (this && this.__importStar) || function (mod) {
15
- if (mod && mod.__esModule) return mod;
16
- var result = {};
17
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
18
- __setModuleDefault(result, mod);
19
- return result;
20
- };
21
- var __importDefault = (this && this.__importDefault) || function (mod) {
22
- return (mod && mod.__esModule) ? mod : { "default": mod };
23
- };
24
- Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.verifySignatureAndParseBody = exports.verifySignatureAndParseRawBody = exports.respondToUrlVerification = exports.respondToSslCheck = void 0;
26
- /* eslint-disable @typescript-eslint/no-explicit-any */
27
- const http_1 = require("http");
28
- const https_1 = require("https");
29
- const express_1 = __importStar(require("express"));
30
- const raw_body_1 = __importDefault(require("raw-body"));
31
- const querystring_1 = __importDefault(require("querystring"));
32
- const crypto_1 = __importDefault(require("crypto"));
33
- const tsscmp_1 = __importDefault(require("tsscmp"));
34
- const logger_1 = require("@slack/logger");
35
- const oauth_1 = require("@slack/oauth");
36
- const errors_1 = require("../errors");
37
- const render_html_for_install_path_1 = __importDefault(require("./render-html-for-install-path"));
38
- const verify_redirect_opts_1 = require("./verify-redirect-opts");
39
- // Option keys for tls.createServer() and tls.createSecureContext(), exclusive of those for http.createServer()
40
- const httpsOptionKeys = [
41
- 'ALPNProtocols',
42
- 'clientCertEngine',
43
- 'enableTrace',
44
- 'handshakeTimeout',
45
- 'rejectUnauthorized',
46
- 'requestCert',
47
- 'sessionTimeout',
48
- 'SNICallback',
49
- 'ticketKeys',
50
- 'pskCallback',
51
- 'pskIdentityHint',
52
- 'ca',
53
- 'cert',
54
- 'sigalgs',
55
- 'ciphers',
56
- 'clientCertEngine',
57
- 'crl',
58
- 'dhparam',
59
- 'ecdhCurve',
60
- 'honorCipherOrder',
61
- 'key',
62
- 'privateKeyEngine',
63
- 'privateKeyIdentifier',
64
- 'maxVersion',
65
- 'minVersion',
66
- 'passphrase',
67
- 'pfx',
68
- 'secureOptions',
69
- 'secureProtocol',
70
- 'sessionIdContext',
71
- ];
72
- const missingServerErrorDescription = 'The receiver cannot be started because private state was mutated. Please report this to the maintainers.';
73
- const respondToSslCheck = (req, res, next) => {
74
- if (req.body && req.body.ssl_check) {
75
- res.send();
76
- return;
77
- }
78
- next();
79
- };
80
- exports.respondToSslCheck = respondToSslCheck;
81
- const respondToUrlVerification = (req, res, next) => {
82
- if (req.body && req.body.type && req.body.type === 'url_verification') {
83
- res.json({ challenge: req.body.challenge });
84
- return;
85
- }
86
- next();
87
- };
88
- exports.respondToUrlVerification = respondToUrlVerification;
89
- /**
90
- * Receives HTTP requests with Events, Slash Commands, and Actions
91
- */
92
- class ExpressReceiver {
93
- constructor({ signingSecret = '', logger = undefined, logLevel = logger_1.LogLevel.INFO, endpoints = { events: '/slack/events' }, processBeforeResponse = false, signatureVerification = true, clientId = undefined, clientSecret = undefined, stateSecret = undefined, redirectUri = undefined, installationStore = undefined, scopes = undefined, installerOptions = {}, app = undefined, router = undefined, }) {
94
- var _a;
95
- this.installer = undefined;
96
- this.app = app !== undefined ? app : (0, express_1.default)();
97
- if (typeof logger !== 'undefined') {
98
- this.logger = logger;
99
- }
100
- else {
101
- this.logger = new logger_1.ConsoleLogger();
102
- this.logger.setLevel(logLevel);
103
- }
104
- this.signatureVerification = signatureVerification;
105
- const bodyParser = this.signatureVerification ?
106
- buildVerificationBodyParserMiddleware(this.logger, signingSecret) :
107
- buildBodyParserMiddleware(this.logger);
108
- const expressMiddleware = [
109
- bodyParser,
110
- exports.respondToSslCheck,
111
- exports.respondToUrlVerification,
112
- this.requestHandler.bind(this),
113
- ];
114
- this.processBeforeResponse = processBeforeResponse;
115
- const endpointList = typeof endpoints === 'string' ? [endpoints] : Object.values(endpoints);
116
- this.router = router !== undefined ? router : (0, express_1.Router)();
117
- endpointList.forEach((endpoint) => {
118
- this.router.post(endpoint, ...expressMiddleware);
119
- });
120
- // Verify redirect options if supplied, throws coded error if invalid
121
- (0, verify_redirect_opts_1.verifyRedirectOpts)({ redirectUri, redirectUriPath: installerOptions.redirectUriPath });
122
- if (clientId !== undefined &&
123
- clientSecret !== undefined &&
124
- (installerOptions.stateVerification === false || // state store not needed
125
- stateSecret !== undefined ||
126
- installerOptions.stateStore !== undefined) // user provided state store
127
- ) {
128
- this.installer = new oauth_1.InstallProvider({
129
- clientId,
130
- clientSecret,
131
- stateSecret,
132
- installationStore,
133
- logLevel,
134
- logger,
135
- stateStore: installerOptions.stateStore,
136
- stateVerification: installerOptions.stateVerification,
137
- authVersion: (_a = installerOptions.authVersion) !== null && _a !== void 0 ? _a : 'v2',
138
- clientOptions: installerOptions.clientOptions,
139
- authorizationUrl: installerOptions.authorizationUrl,
140
- });
141
- }
142
- // create install url options
143
- const installUrlOptions = {
144
- metadata: installerOptions.metadata,
145
- scopes: scopes !== null && scopes !== void 0 ? scopes : [],
146
- userScopes: installerOptions.userScopes,
147
- redirectUri,
148
- };
149
- // Add OAuth routes to receiver
150
- if (this.installer !== undefined) {
151
- const redirectUriPath = installerOptions.redirectUriPath === undefined ?
152
- '/slack/oauth_redirect' :
153
- installerOptions.redirectUriPath;
154
- const { callbackOptions, stateVerification } = installerOptions;
155
- this.router.use(redirectUriPath, async (req, res) => {
156
- if (stateVerification === false) {
157
- // when stateVerification is disabled pass install options directly to handler
158
- // since they won't be encoded in the state param of the generated url
159
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
160
- await this.installer.handleCallback(req, res, callbackOptions, installUrlOptions);
161
- }
162
- else {
163
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
164
- await this.installer.handleCallback(req, res, callbackOptions);
165
- }
166
- });
167
- const installPath = installerOptions.installPath === undefined ? '/slack/install' : installerOptions.installPath;
168
- this.router.get(installPath, async (_req, res, next) => {
169
- try {
170
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
171
- const url = await this.installer.generateInstallUrl(installUrlOptions, stateVerification);
172
- if (installerOptions.directInstall) {
173
- // If a Slack app sets "Direct Install URL" in the Slack app configuration,
174
- // the installation flow of the app should start with the Slack authorize URL.
175
- // See https://api.slack.com/start/distributing/directory#direct_install for more details.
176
- res.redirect(url);
177
- }
178
- else {
179
- // The installation starts from a landing page served by this app.
180
- const renderHtml = installerOptions.renderHtmlForInstallPath !== undefined ?
181
- installerOptions.renderHtmlForInstallPath :
182
- render_html_for_install_path_1.default;
183
- res.send(renderHtml(url));
184
- }
185
- }
186
- catch (error) {
187
- next(error);
188
- }
189
- });
190
- }
191
- this.app.use(this.router);
192
- }
193
- async requestHandler(req, res) {
194
- var _a;
195
- let isAcknowledged = false;
196
- setTimeout(() => {
197
- if (!isAcknowledged) {
198
- this.logger.error('An incoming event was not acknowledged within 3 seconds. Ensure that the ack() argument is called in a listener.');
199
- }
200
- }, 3001);
201
- let storedResponse;
202
- const event = {
203
- body: req.body,
204
- ack: async (response) => {
205
- this.logger.debug('ack() begin');
206
- if (isAcknowledged) {
207
- throw new errors_1.ReceiverMultipleAckError();
208
- }
209
- isAcknowledged = true;
210
- if (this.processBeforeResponse) {
211
- if (!response) {
212
- storedResponse = '';
213
- }
214
- else {
215
- storedResponse = response;
216
- }
217
- this.logger.debug('ack() response stored');
218
- }
219
- else {
220
- if (!response) {
221
- res.send('');
222
- }
223
- else if (typeof response === 'string') {
224
- res.send(response);
225
- }
226
- else {
227
- res.json(response);
228
- }
229
- this.logger.debug('ack() response sent');
230
- }
231
- },
232
- };
233
- try {
234
- await ((_a = this.bolt) === null || _a === void 0 ? void 0 : _a.processEvent(event));
235
- if (storedResponse !== undefined) {
236
- if (typeof storedResponse === 'string') {
237
- res.send(storedResponse);
238
- }
239
- else {
240
- res.json(storedResponse);
241
- }
242
- this.logger.debug('stored response sent');
243
- }
244
- }
245
- catch (err) {
246
- const e = err;
247
- if ('code' in e) {
248
- // CodedError has code: string
249
- const errorCode = err.code;
250
- if (errorCode === errors_1.ErrorCode.AuthorizationError) {
251
- // authorize function threw an exception, which means there is no valid installation data
252
- res.status(401).send();
253
- isAcknowledged = true;
254
- return;
255
- }
256
- }
257
- res.status(500).send();
258
- throw err;
259
- }
260
- }
261
- init(bolt) {
262
- this.bolt = bolt;
263
- }
264
- start(portOrListenOptions, serverOptions = {}) {
265
- let createServerFn = http_1.createServer;
266
- // Look for HTTPS-specific serverOptions to determine which factory function to use
267
- if (Object.keys(serverOptions).filter((k) => httpsOptionKeys.includes(k)).length > 0) {
268
- createServerFn = https_1.createServer;
269
- }
270
- if (this.server !== undefined) {
271
- return Promise.reject(new errors_1.ReceiverInconsistentStateError('The receiver cannot be started because it was already started.'));
272
- }
273
- this.server = createServerFn(serverOptions, this.app);
274
- return new Promise((resolve, reject) => {
275
- if (this.server === undefined) {
276
- throw new errors_1.ReceiverInconsistentStateError(missingServerErrorDescription);
277
- }
278
- this.server.on('error', (error) => {
279
- if (this.server === undefined) {
280
- throw new errors_1.ReceiverInconsistentStateError(missingServerErrorDescription);
281
- }
282
- this.server.close();
283
- // If the error event occurs before listening completes (like EADDRINUSE), this works well. However, if the
284
- // error event happens some after the Promise is already resolved, the error would be silently swallowed up.
285
- // The documentation doesn't describe any specific errors that can occur after listening has started, so this
286
- // feels safe.
287
- reject(error);
288
- });
289
- this.server.on('close', () => {
290
- // Not removing all listeners because consumers could have added their own `close` event listener, and those
291
- // should be called. If the consumer doesn't dispose of any references to the server properly, this would be
292
- // a memory leak.
293
- // this.server?.removeAllListeners();
294
- this.server = undefined;
295
- });
296
- this.server.listen(portOrListenOptions, () => {
297
- if (this.server === undefined) {
298
- return reject(new errors_1.ReceiverInconsistentStateError(missingServerErrorDescription));
299
- }
300
- return resolve(this.server);
301
- });
302
- });
303
- }
304
- // TODO: the arguments should be defined as the arguments to close() (which happen to be none), but for sake of
305
- // generic types
306
- stop() {
307
- if (this.server === undefined) {
308
- return Promise.reject(new errors_1.ReceiverInconsistentStateError('The receiver cannot be stopped because it was not started.'));
309
- }
310
- return new Promise((resolve, reject) => {
311
- var _a;
312
- (_a = this.server) === null || _a === void 0 ? void 0 : _a.close((error) => {
313
- if (error !== undefined) {
314
- return reject(error);
315
- }
316
- this.server = undefined;
317
- return resolve();
318
- });
319
- });
320
- }
321
- }
322
- exports.default = ExpressReceiver;
323
- function verifySignatureAndParseRawBody(logger, signingSecret) {
324
- return buildVerificationBodyParserMiddleware(logger, signingSecret);
325
- }
326
- exports.verifySignatureAndParseRawBody = verifySignatureAndParseRawBody;
327
- /**
328
- * This request handler has two responsibilities:
329
- * - Verify the request signature
330
- * - Parse request.body and assign the successfully parsed object to it.
331
- */
332
- function buildVerificationBodyParserMiddleware(logger, signingSecret) {
333
- return async (req, res, next) => {
334
- let stringBody;
335
- // On some environments like GCP (Google Cloud Platform),
336
- // req.body can be pre-parsed and be passed as req.rawBody here
337
- const preparsedRawBody = req.rawBody;
338
- if (preparsedRawBody !== undefined) {
339
- stringBody = preparsedRawBody.toString();
340
- }
341
- else {
342
- stringBody = (await (0, raw_body_1.default)(req)).toString();
343
- }
344
- // *** Parsing body ***
345
- // As the verification passed, parse the body as an object and assign it to req.body
346
- // Following middlewares can expect `req.body` is already a parsed one.
347
- try {
348
- // This handler parses `req.body` or `req.rawBody`(on Google Could Platform)
349
- // and overwrites `req.body` with the parsed JS object.
350
- req.body = verifySignatureAndParseBody(typeof signingSecret === 'string' ? signingSecret : await signingSecret(), stringBody, req.headers);
351
- }
352
- catch (error) {
353
- if (error) {
354
- if (error instanceof errors_1.ReceiverAuthenticityError) {
355
- logError(logger, 'Request verification failed', error);
356
- return res.status(401).send();
357
- }
358
- logError(logger, 'Parsing request body failed', error);
359
- return res.status(400).send();
360
- }
361
- }
362
- return next();
363
- };
364
- }
365
- function logError(logger, message, error) {
366
- const logMessage = 'code' in error ?
367
- `${message} (code: ${error.code}, message: ${error.message})` :
368
- `${message} (error: ${error})`;
369
- logger.warn(logMessage);
370
- }
371
- function verifyRequestSignature(signingSecret, body, signature, requestTimestamp) {
372
- if (signature === undefined || requestTimestamp === undefined) {
373
- throw new errors_1.ReceiverAuthenticityError('Slack request signing verification failed. Some headers are missing.');
374
- }
375
- const ts = Number(requestTimestamp);
376
- // eslint-disable-next-line no-restricted-globals
377
- if (isNaN(ts)) {
378
- throw new errors_1.ReceiverAuthenticityError('Slack request signing verification failed. Timestamp is invalid.');
379
- }
380
- // Divide current date to match Slack ts format
381
- // Subtract 5 minutes from current time
382
- const fiveMinutesAgo = Math.floor(Date.now() / 1000) - 60 * 5;
383
- if (ts < fiveMinutesAgo) {
384
- throw new errors_1.ReceiverAuthenticityError('Slack request signing verification failed. Timestamp is too old.');
385
- }
386
- const hmac = crypto_1.default.createHmac('sha256', signingSecret);
387
- const [version, hash] = signature.split('=');
388
- hmac.update(`${version}:${ts}:${body}`);
389
- if (!(0, tsscmp_1.default)(hash, hmac.digest('hex'))) {
390
- throw new errors_1.ReceiverAuthenticityError('Slack request signing verification failed. Signature mismatch.');
391
- }
392
- }
393
- /**
394
- * This request handler has two responsibilities:
395
- * - Verify the request signature
396
- * - Parse request.body and assign the successfully parsed object to it.
397
- */
398
- function verifySignatureAndParseBody(signingSecret, body, headers) {
399
- // *** Request verification ***
400
- const { 'x-slack-signature': signature, 'x-slack-request-timestamp': requestTimestamp, 'content-type': contentType, } = headers;
401
- verifyRequestSignature(signingSecret, body, signature, requestTimestamp);
402
- return parseRequestBody(body, contentType);
403
- }
404
- exports.verifySignatureAndParseBody = verifySignatureAndParseBody;
405
- function buildBodyParserMiddleware(logger) {
406
- return async (req, res, next) => {
407
- let stringBody;
408
- // On some environments like GCP (Google Cloud Platform),
409
- // req.body can be pre-parsed and be passed as req.rawBody here
410
- const preparsedRawBody = req.rawBody;
411
- if (preparsedRawBody !== undefined) {
412
- stringBody = preparsedRawBody.toString();
413
- }
414
- else {
415
- stringBody = (await (0, raw_body_1.default)(req)).toString();
416
- }
417
- try {
418
- const { 'content-type': contentType } = req.headers;
419
- req.body = parseRequestBody(stringBody, contentType);
420
- }
421
- catch (error) {
422
- if (error) {
423
- logError(logger, 'Parsing request body failed', error);
424
- return res.status(400).send();
425
- }
426
- }
427
- return next();
428
- };
429
- }
430
- function parseRequestBody(stringBody, contentType) {
431
- if (contentType === 'application/x-www-form-urlencoded') {
432
- const parsedBody = querystring_1.default.parse(stringBody);
433
- if (typeof parsedBody.payload === 'string') {
434
- return JSON.parse(parsedBody.payload);
435
- }
436
- return parsedBody;
437
- }
438
- return JSON.parse(stringBody);
439
- }
440
- //# sourceMappingURL=ExpressReceiver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpressReceiver.js","sourceRoot":"","sources":["../../src/receivers/ExpressReceiver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,+BAA2D;AAC3D,iCAAsH;AAEtH,mDAAmG;AACnG,wDAA+B;AAC/B,8DAAsC;AACtC,oDAA4B;AAC5B,oDAA4B;AAC5B,0CAAgE;AAChE,wCAA2G;AAE3G,sCAMmB;AAEnB,kGAA6E;AAC7E,iEAA4D;AAE5D,+GAA+G;AAC/G,MAAM,eAAe,GAAG;IACtB,eAAe;IACf,kBAAkB;IAClB,aAAa;IACb,kBAAkB;IAClB,oBAAoB;IACpB,aAAa;IACb,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,aAAa;IACb,iBAAiB;IACjB,IAAI;IACJ,MAAM;IACN,SAAS;IACT,SAAS;IACT,kBAAkB;IAClB,KAAK;I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AE;QAC9B,IAAI,UAAkB,CAAC;QACvB,yDAAyD;QACzD,+DAA+D;QAC/D,MAAM,gBAAgB,GAAS,GAAW,CAAC,OAAO,CAAC;QACnD,IAAI,gBAAgB,KAAK,SAAS,EAAE;YAClC,UAAU,GAAG,gBAAgB,CAAC,QAAQ,EAAE,CAAC;SAC1C;aAAM;YACL,UAAU,GAAG,CAAC,MAAM,IAAA,kBAAO,EAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;SAC9C;QACD,IAAI;YACF,MAAM,EAAE,cAAc,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC;YACpD,GAAG,CAAC,IAAI,GAAG,gBAAgB,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;SACtD;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,KAAK,EAAE;gBACT,QAAQ,CAAC,MAAM,EAAE,6BAA6B,EAAE,KAAK,CAAC,CAAC;gBACvD,OAAO,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;aAC/B;SACF;QACD,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAkB,EAAE,WAA+B;IAC3E,IAAI,WAAW,KAAK,mCAAmC,EAAE;QACvD,MAAM,UAAU,GAAG,qBAAW,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAEjD,IAAI,OAAO,UAAU,CAAC,OAAO,KAAK,QAAQ,EAAE;YAC1C,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;SACvC;QAED,OAAO,UAAU,CAAC;KACnB;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;AAChC,CAAC"}
@@ -1,72 +0,0 @@
1
- /// <reference types="node" />
2
- import { Server, ServerOptions, RequestListener } from 'http';
3
- import { Server as HTTPSServer, ServerOptions as HTTPSServerOptions } from 'https';
4
- import { ListenOptions } from 'net';
5
- import { Logger, LogLevel } from '@slack/logger';
6
- import { InstallProvider, CallbackOptions, InstallProviderOptions, InstallURLOptions } from '@slack/oauth';
7
- import App from '../App';
8
- import { Receiver } from '../types';
9
- import { CustomRoute } from './custom-routes';
10
- export interface HTTPReceiverOptions {
11
- signingSecret: string;
12
- endpoints?: string | string[];
13
- customRoutes?: CustomRoute[];
14
- logger?: Logger;
15
- logLevel?: LogLevel;
16
- processBeforeResponse?: boolean;
17
- signatureVerification?: boolean;
18
- clientId?: string;
19
- clientSecret?: string;
20
- stateSecret?: InstallProviderOptions['stateSecret'];
21
- redirectUri?: string;
22
- installationStore?: InstallProviderOptions['installationStore'];
23
- scopes?: InstallURLOptions['scopes'];
24
- installerOptions?: HTTPReceiverInstallerOptions;
25
- }
26
- export interface HTTPReceiverInstallerOptions {
27
- installPath?: string;
28
- directInstall?: boolean;
29
- renderHtmlForInstallPath?: (url: string) => string;
30
- redirectUriPath?: string;
31
- stateStore?: InstallProviderOptions['stateStore'];
32
- stateVerification?: InstallProviderOptions['stateVerification'];
33
- authVersion?: InstallProviderOptions['authVersion'];
34
- clientOptions?: InstallProviderOptions['clientOptions'];
35
- authorizationUrl?: InstallProviderOptions['authorizationUrl'];
36
- metadata?: InstallURLOptions['metadata'];
37
- userScopes?: InstallURLOptions['userScopes'];
38
- callbackOptions?: CallbackOptions;
39
- }
40
- /**
41
- * Receives HTTP requests with Events, Slash Commands, and Actions
42
- */
43
- export default class HTTPReceiver implements Receiver {
44
- private endpoints;
45
- private routes;
46
- private signingSecret;
47
- private processBeforeResponse;
48
- private signatureVerification;
49
- private app?;
50
- requestListener: RequestListener;
51
- private server?;
52
- installer?: InstallProvider;
53
- private installPath?;
54
- private directInstall?;
55
- private renderHtmlForInstallPath;
56
- private installRedirectUriPath?;
57
- private installUrlOptions?;
58
- private installCallbackOptions?;
59
- private stateVerification?;
60
- private logger;
61
- constructor({ signingSecret, endpoints, customRoutes, logger, logLevel, processBeforeResponse, signatureVerification, clientId, clientSecret, stateSecret, redirectUri, installationStore, scopes, installerOptions, }: HTTPReceiverOptions);
62
- init(app: App): void;
63
- start(port: number): Promise<Server>;
64
- start(portOrListenOptions: number | ListenOptions, serverOptions?: ServerOptions): Promise<Server>;
65
- start(portOrListenOptions: number | ListenOptions, httpsServerOptions?: HTTPSServerOptions): Promise<HTTPSServer>;
66
- stop(): Promise<void>;
67
- private unboundRequestListener;
68
- private handleIncomingEvent;
69
- private handleInstallPathRequest;
70
- private handleInstallRedirectRequest;
71
- }
72
- //# sourceMappingURL=HTTPReceiver.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HTTPReceiver.d.ts","sourceRoot":"","sources":["../../src/receivers/HTTPReceiver.ts"],"names":[],"mappings":";AACA,OAAO,EAAgB,MAAM,EAAE,aAAa,EAAE,eAAe,EAAmC,MAAM,MAAM,CAAC;AAC7G,OAAO,EAAqC,MAAM,IAAI,WAAW,EAAE,aAAa,IAAI,kBAAkB,EAAE,MAAM,OAAO,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,MAAM,EAAiB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAK3G,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAiB,MAAM,UAAU,CAAC;AASnD,OAAO,EAAE,WAAW,EAAiC,MAAM,iBAAiB,CAAC;AAsC7E,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC9B,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,qBAAqB,CAAC,EAAE,OA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