@slack/bolt 3.9.0-hermesBeta.2 → 3.11.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 (85) hide show
  1. package/README.md +1 -1
  2. package/dist/App.d.ts +11 -8
  3. package/dist/App.d.ts.map +1 -1
  4. package/dist/App.js +184 -142
  5. package/dist/App.js.map +1 -1
  6. package/dist/errors.d.ts +1 -1
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/helpers.d.ts +1 -2
  9. package/dist/helpers.d.ts.map +1 -1
  10. package/dist/helpers.js +0 -8
  11. package/dist/helpers.js.map +1 -1
  12. package/dist/index.d.ts +6 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +12 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/middleware/builtin.js +1 -0
  17. package/dist/middleware/builtin.js.map +1 -1
  18. package/dist/middleware/process.d.ts.map +1 -1
  19. package/dist/middleware/process.js.map +1 -1
  20. package/dist/receivers/BufferedIncomingMessage.d.ts +6 -0
  21. package/dist/receivers/BufferedIncomingMessage.d.ts.map +1 -0
  22. package/dist/{types/subscription/index.js → receivers/BufferedIncomingMessage.js} +1 -1
  23. package/dist/receivers/BufferedIncomingMessage.js.map +1 -0
  24. package/dist/receivers/ExpressReceiver.d.ts +20 -6
  25. package/dist/receivers/ExpressReceiver.d.ts.map +1 -1
  26. package/dist/receivers/ExpressReceiver.js +68 -84
  27. package/dist/receivers/ExpressReceiver.js.map +1 -1
  28. package/dist/receivers/HTTPModuleFunctions.d.ts +47 -0
  29. package/dist/receivers/HTTPModuleFunctions.d.ts.map +1 -0
  30. package/dist/receivers/HTTPModuleFunctions.js +197 -0
  31. package/dist/receivers/HTTPModuleFunctions.js.map +1 -0
  32. package/dist/receivers/HTTPReceiver.d.ts +14 -32
  33. package/dist/receivers/HTTPReceiver.d.ts.map +1 -1
  34. package/dist/receivers/HTTPReceiver.js +44 -179
  35. package/dist/receivers/HTTPReceiver.js.map +1 -1
  36. package/dist/receivers/HTTPResponseAck.d.ts +29 -0
  37. package/dist/receivers/HTTPResponseAck.d.ts.map +1 -0
  38. package/dist/receivers/HTTPResponseAck.js +60 -0
  39. package/dist/receivers/HTTPResponseAck.js.map +1 -0
  40. package/dist/receivers/SocketModeFunctions.d.ts +12 -0
  41. package/dist/receivers/SocketModeFunctions.d.ts.map +1 -0
  42. package/dist/receivers/SocketModeFunctions.js +28 -0
  43. package/dist/receivers/SocketModeFunctions.js.map +1 -0
  44. package/dist/receivers/SocketModeReceiver.d.ts +10 -3
  45. package/dist/receivers/SocketModeReceiver.d.ts.map +1 -1
  46. package/dist/receivers/SocketModeReceiver.js +29 -37
  47. package/dist/receivers/SocketModeReceiver.js.map +1 -1
  48. package/dist/receivers/custom-routes.d.ts +1 -1
  49. package/dist/receivers/custom-routes.d.ts.map +1 -1
  50. package/dist/receivers/custom-routes.js +3 -3
  51. package/dist/receivers/custom-routes.js.map +1 -1
  52. package/dist/receivers/http-utils.d.ts.map +1 -1
  53. package/dist/receivers/http-utils.js +9 -25
  54. package/dist/receivers/http-utils.js.map +1 -1
  55. package/dist/receivers/render-html-for-install-path.d.ts.map +1 -1
  56. package/dist/receivers/render-html-for-install-path.js +8 -1
  57. package/dist/receivers/render-html-for-install-path.js.map +1 -1
  58. package/dist/receivers/verify-request.d.ts +25 -33
  59. package/dist/receivers/verify-request.d.ts.map +1 -1
  60. package/dist/receivers/verify-request.js +41 -61
  61. package/dist/receivers/verify-request.js.map +1 -1
  62. package/dist/types/events/base-events.d.ts +157 -19
  63. package/dist/types/events/base-events.d.ts.map +1 -1
  64. package/dist/types/events/base-events.js.map +1 -1
  65. package/dist/types/events/index.d.ts +1 -1
  66. package/dist/types/events/index.d.ts.map +1 -1
  67. package/dist/types/index.d.ts +0 -1
  68. package/dist/types/index.d.ts.map +1 -1
  69. package/dist/types/index.js +0 -1
  70. package/dist/types/index.js.map +1 -1
  71. package/dist/types/middleware.d.ts +1 -2
  72. package/dist/types/middleware.d.ts.map +1 -1
  73. package/package.json +10 -7
  74. package/CHANGELOG.md +0 -5
  75. package/dist/Subscription.d.ts +0 -61
  76. package/dist/Subscription.d.ts.map +0 -1
  77. package/dist/Subscription.js +0 -169
  78. package/dist/Subscription.js.map +0 -1
  79. package/dist/types/actions/notification-subscription.d.ts +0 -59
  80. package/dist/types/actions/notification-subscription.d.ts.map +0 -1
  81. package/dist/types/actions/notification-subscription.js +0 -3
  82. package/dist/types/actions/notification-subscription.js.map +0 -1
  83. package/dist/types/subscription/index.d.ts +0 -80
  84. package/dist/types/subscription/index.d.ts.map +0 -1
  85. package/dist/types/subscription/index.js.map +0 -1
package/CHANGELOG.md DELETED
@@ -1,5 +0,0 @@
1
- # Changelog (legacy)
2
-
3
- Version history is now published in the [releases page](https://github.com/slackapi/bolt/releases).
4
-
5
- For releases of Slapp before it was renamed to Bolt, see the [v3 Changelog](https://github.com/MissionsAI/slapp/blob/v3/CHANGELOG.md).
@@ -1,61 +0,0 @@
1
- import { Middleware, AnyMiddlewareArgs, AllMiddlewareArgs } from './types';
2
- import { SubscriptionOnCreateMiddleware, SubscriptionOnConfigureMiddleware, SubscriptionOnDeletedMiddleware, SlackSubscriptionMiddlewareArgs, SubConfigureFn } from './types/subscription';
3
- export interface SubscriptionOptions {
4
- onCreate: SubscriptionOnCreateMiddleware | SubscriptionOnCreateMiddleware[];
5
- onConfigure: SubscriptionOnConfigureMiddleware | SubscriptionOnConfigureMiddleware[];
6
- onDeleted?: SubscriptionOnDeletedMiddleware | SubscriptionOnDeletedMiddleware[];
7
- }
8
- declare type AllSubscriptionMiddlewareArgs<T extends SlackSubscriptionMiddlewareArgs = SlackSubscriptionMiddlewareArgs> = T & AllMiddlewareArgs;
9
- export declare type SubscriptionMiddleware = SubscriptionOnCreateMiddleware[] | SubscriptionOnConfigureMiddleware[] | SubscriptionOnDeletedMiddleware[] | [];
10
- export declare const VALID_NOTIFICATION_SUBSCRIPTION_INTERACTION_TYPES: string[];
11
- /**
12
- * Subscription describes a collection of named middlewares
13
- * for handling notification subscription related interaction
14
- * payloads.
15
- * */
16
- export declare class Subscription {
17
- /**
18
- * @description The unique resource id for this Subscription.
19
- * */
20
- private id;
21
- /** Middleware to process :: 'notification_subscription_create_requested'
22
- * interaction payload
23
- * */
24
- private onCreate;
25
- /** Middleware to process :: 'notification_subscription_configure_requested'
26
- * interaction payload
27
- * */
28
- private onConfigure;
29
- /** Middleware to process :: 'notification_subscription_deleted' interaction
30
- * payload
31
- * */
32
- private onDeleted;
33
- constructor(id: string, options: SubscriptionOptions);
34
- getMiddleware(): Middleware<AnyMiddlewareArgs>;
35
- /**
36
- * `matchesConstraints()` implements any required constraints
37
- * on notification subscription interaction payloads.
38
- * */
39
- private matchesConstraints;
40
- private process;
41
- private getSubMiddleware;
42
- }
43
- export declare function validate(id: string, options: SubscriptionOptions): void;
44
- export declare function isSubscriptionInteraction(args: AnyMiddlewareArgs): args is AllSubscriptionMiddlewareArgs;
45
- /**
46
- * `processSubMiddleware()` processes subscription interaction payload with the
47
- * middleware supplied by the user.
48
- * */
49
- export declare function processSubMiddleware(args: AllSubscriptionMiddlewareArgs, origMiddleware: SubscriptionMiddleware): Promise<void>;
50
- /**
51
- * `prepareSubArgs()` prepares the arguments for the specific middlewares
52
- * adding specific arguments for utilities
53
- * */
54
- export declare function prepareSubArgs(args: AllMiddlewareArgs): AllSubscriptionMiddlewareArgs;
55
- /**
56
- * Utility which returns a fxn which can be used to
57
- * open a configure view for configuring a Slack subscription
58
- * */
59
- export declare function createConfigure(args: any): SubConfigureFn;
60
- export {};
61
- //# sourceMappingURL=Subscription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Subscription.d.ts","sourceRoot":"","sources":["../src/Subscription.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,8BAA8B,EAC9B,iCAAiC,EACjC,+BAA+B,EAC/B,+BA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,CAAC,IAAI,EAAE,iBAAiB,GAAG,6BAA6B,CAcrF;AAED;;;KAGK;AACL,wBAAgB,eAAe,CAAC,IAAI,EAAE,GAAG,GAAG,cAAc,CAUzD"}
@@ -1,169 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createConfigure = exports.prepareSubArgs = exports.processSubMiddleware = exports.isSubscriptionInteraction = exports.validate = exports.Subscription = exports.VALID_NOTIFICATION_SUBSCRIPTION_INTERACTION_TYPES = void 0;
4
- /* Constants */
5
- exports.VALID_NOTIFICATION_SUBSCRIPTION_INTERACTION_TYPES = [
6
- 'notification_subscription_create_requested',
7
- 'notification_subscription_configure_requested',
8
- 'notification_subscription_deleted',
9
- ];
10
- /**
11
- * Subscription describes a collection of named middlewares
12
- * for handling notification subscription related interaction
13
- * payloads.
14
- * */
15
- class Subscription {
16
- constructor(id, options) {
17
- /** Middleware to process :: 'notification_subscription_deleted' interaction
18
- * payload
19
- * */
20
- this.onDeleted = [];
21
- this.process = async (args) => {
22
- const { payload } = args;
23
- const subArgs = prepareSubArgs(args);
24
- const subMiddleware = this.getSubMiddleware(payload);
25
- return processSubMiddleware(subArgs, subMiddleware);
26
- };
27
- this.getSubMiddleware = (payload) => {
28
- switch (payload.type) {
29
- case 'notification_subscription_create_requested':
30
- return this.onCreate;
31
- case 'notification_subscription_configure_requested':
32
- return this.onConfigure;
33
- case 'notification_subscription_deleted':
34
- return this.onDeleted;
35
- default:
36
- return [];
37
- }
38
- };
39
- validate(id, options);
40
- const { onCreate, onConfigure, onDeleted } = options;
41
- this.id = id;
42
- this.onCreate = Array.isArray(onCreate) ? onCreate : [onCreate];
43
- this.onConfigure = Array.isArray(onConfigure) ? onConfigure : [onConfigure];
44
- if (onDeleted !== undefined) {
45
- this.onDeleted = Array.isArray(onDeleted) ? onDeleted : [onDeleted];
46
- }
47
- }
48
- /* Utilities */
49
- getMiddleware() {
50
- return async (args) => {
51
- if (isSubscriptionInteraction(args) && this.matchesConstraints(args)) {
52
- return this.process(args);
53
- }
54
- return args.next();
55
- };
56
- }
57
- /**
58
- * `matchesConstraints()` implements any required constraints
59
- * on notification subscription interaction payloads.
60
- * */
61
- matchesConstraints(args) {
62
- // TODO :: implement constraint matching against custom action_id
63
- // when supported
64
- // If a custom action_id is provided, it should match the id of the Subscription
65
- // in order for proper middlewares to be invoked.
66
- return typeof this.id === 'string' && typeof args.payload.action_id === 'string';
67
- }
68
- }
69
- exports.Subscription = Subscription;
70
- /* Utilities */
71
- function validate(id, options) {
72
- // id must be a string
73
- if (typeof id !== 'string') {
74
- throw new Error('Subscription id must be a string');
75
- }
76
- // Check user has supplied minimal required middleware
77
- const requiredKeys = ['onCreate', 'onConfigure'];
78
- const missingKeys = requiredKeys.filter((key) => !(key in options));
79
- if (missingKeys.length > 0) {
80
- throw new Error(`Subscription handling options provided are missing required keys: ${missingKeys.join(', ')}`);
81
- }
82
- // Check user has supplied valid middleware
83
- const currentKeys = Object.keys(options);
84
- currentKeys.forEach((fnKey) => {
85
- // must be non-falsy value
86
- if (!options[fnKey]) {
87
- throw new Error(`You must supply a middleware for ${fnKey}`);
88
- }
89
- // must be either a fn or array
90
- if (typeof options[fnKey] !== 'function' && !Array.isArray(options[fnKey])) {
91
- throw new Error(`Subscription handling option ${fnKey} must be a function or an array of functions`);
92
- }
93
- // arrays must contain middleware functions
94
- if (Array.isArray(options[fnKey])) {
95
- const array = options[fnKey];
96
- array.forEach((middleware) => {
97
- if (typeof middleware !== 'function') {
98
- throw new Error('Subscription handling option(s) supplied as arrays must contain only functions');
99
- }
100
- });
101
- }
102
- });
103
- }
104
- exports.validate = validate;
105
- function isSubscriptionInteraction(args) {
106
- return exports.VALID_NOTIFICATION_SUBSCRIPTION_INTERACTION_TYPES
107
- .includes(args.payload.type);
108
- }
109
- exports.isSubscriptionInteraction = isSubscriptionInteraction;
110
- /**
111
- * `processSubMiddleware()` processes subscription interaction payload with the
112
- * middleware supplied by the user.
113
- * */
114
- async function processSubMiddleware(args, origMiddleware) {
115
- // Copy the array so modifications don't affect the original
116
- const middlewares = [...origMiddleware];
117
- // Don't process the last item in the array, it shouldn't get a next fn
118
- let lastCalledMiddlewareIndex = -1;
119
- // recursively call each middleware in array
120
- const invokeMiddleware = async (toCallMiddlewareIndex) => {
121
- if (lastCalledMiddlewareIndex < middlewares.length - 1) {
122
- lastCalledMiddlewareIndex = toCallMiddlewareIndex;
123
- // invoke middleware
124
- await middlewares[toCallMiddlewareIndex]({
125
- ...args,
126
- });
127
- invokeMiddleware(toCallMiddlewareIndex + 1);
128
- }
129
- };
130
- invokeMiddleware(0);
131
- }
132
- exports.processSubMiddleware = processSubMiddleware;
133
- /**
134
- * `prepareSubArgs()` prepares the arguments for the specific middlewares
135
- * adding specific arguments for utilities
136
- * */
137
- function prepareSubArgs(args) {
138
- const { next: _next, ...subArgs } = args;
139
- const preparedArgs = { ...subArgs };
140
- switch (preparedArgs.payload.type) {
141
- case 'notification_subscription_create_requested':
142
- preparedArgs.configure = createConfigure(preparedArgs);
143
- break;
144
- case 'notification_subscription_configure_requested':
145
- preparedArgs.configure = createConfigure(preparedArgs);
146
- break;
147
- default:
148
- break;
149
- }
150
- return preparedArgs;
151
- }
152
- exports.prepareSubArgs = prepareSubArgs;
153
- /**
154
- * Utility which returns a fxn which can be used to
155
- * open a configure view for configuring a Slack subscription
156
- * */
157
- function createConfigure(args) {
158
- const { payload } = args;
159
- const trigger_id = payload.notification_subscription_action_trigger_id;
160
- const { client, context } = args;
161
- const token = context.botToken !== undefined ? context.botToken : context.userToken;
162
- return (view) => client.views.open({
163
- token,
164
- trigger_id,
165
- view,
166
- });
167
- }
168
- exports.createConfigure = createConfigure;
169
- //# sourceMappingURL=Subscription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Subscription.js","sourceRoot":"","sources":["../src/Subscription.ts"],"names":[],"mappings":";;;AA+BA,eAAe;AACF,QAAA,iDAAiD,GAAG;IAC/D,4CAA4C;IAC5C,+CAA+C;IAC/C,m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vC,KAAK;QACL,UAAU;QACV,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAVD,0CAUC"}
@@ -1,59 +0,0 @@
1
- interface NotificationSubscriptionConfigureRequested {
2
- type: 'notification_subscription_configure_requested';
3
- token: string;
4
- action_ts: string;
5
- user: {
6
- id: string;
7
- name: string;
8
- };
9
- team: {
10
- id: string;
11
- domain: string;
12
- };
13
- notification_subscription_action_trigger_id: string;
14
- action_id: 'notification_subscription_configured';
15
- notification_subscription: {
16
- id: string;
17
- };
18
- }
19
- interface NotificationSubscriptionCreateRequested {
20
- type: 'notification_subscription_create_requested';
21
- token: string;
22
- action_ts: string;
23
- user: {
24
- id: string;
25
- name: string;
26
- };
27
- team: {
28
- id: string;
29
- domain: string;
30
- };
31
- channel: {
32
- id: string;
33
- };
34
- notification_subscription_action_trigger_id: string;
35
- action_id: 'notification_subscription_created';
36
- notification_subscription: {
37
- resource_link: string;
38
- };
39
- }
40
- interface NotificationSubscriptionDeleted {
41
- type: 'notification_subscription_deleted';
42
- token: string;
43
- action_ts: string;
44
- user: {
45
- id: string;
46
- name: string;
47
- };
48
- team: {
49
- id: string;
50
- domain: string;
51
- };
52
- notification_subscription: {
53
- id: string;
54
- };
55
- action_id: 'notification_subscription_deleted';
56
- }
57
- export declare type NotificationSubscriptionAction = NotificationSubscriptionConfigureRequested | NotificationSubscriptionCreateRequested | NotificationSubscriptionDeleted;
58
- export {};
59
- //# sourceMappingURL=notification-subscription.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification-subscription.d.ts","sourceRoot":"","sources":["../../../src/types/actions/notification-subscription.ts"],"names":[],"mappings":"AAAA,UAAU,0CAA0C;IAClD,IAAI,EAAE,+CAA+C,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,2CAA2C,EAAE,MAAM,CAAC;IACpD,SAAS,EAAE,sCAAsC,CAAC;IAClD,yBAAyB,EAAE;QACzB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH;AAED,UAAU,uCAAuC;IAC/C,IAAI,EAAE,4CAA4C,CAAC;IACnD,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,2CAA2C,EAAE,MAAM,CAAC;IACpD,SAAS,EAAE,mCAAmC,CAAC;IAC/C,yBAAyB,EAAE;QACzB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,UAAU,+BAA+B;IACvC,IAAI,EAAE,mCAAmC,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,yBAAyB,EAAE;QACzB,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,SAAS,EAAE,mCAAmC,CAAC;CAChD;AAED,oBAAY,8BAA8B,GACtC,0CAA0C,GAC1C,uCAAuC,GACvC,+BAA+B,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=notification-subscription.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notification-subscription.js","sourceRoot":"","sources":["../../../src/types/actions/notification-subscription.ts"],"names":[],"mappings":""}
@@ -1,80 +0,0 @@
1
- import { ViewsOpenResponse } from '@slack/web-api';
2
- import { View } from '@slack/types';
3
- import { Middleware } from '../middleware';
4
- import { SayFn, AckFn } from '../utilities';
5
- export interface NotificationSubscription<T extends string = string> {
6
- type: T;
7
- token: string;
8
- action_ts: string;
9
- action_id: string;
10
- user: {
11
- id: string;
12
- name: string;
13
- };
14
- team: {
15
- id: string;
16
- domain: string;
17
- enterprise_id?: string;
18
- enterprise_name?: string;
19
- };
20
- }
21
- export interface SubscriptionCreateRequested extends NotificationSubscription<'notification_subscription_create_requested'> {
22
- channel: {
23
- id: string;
24
- };
25
- notification_subscription_action_trigger_id: string;
26
- notification_subscription: {
27
- resource_link: string;
28
- };
29
- }
30
- export interface SubscriptionConfigureRequested extends NotificationSubscription<'notification_subscription_configure_requested'> {
31
- notification_subscription_action_trigger_id: string;
32
- notification_subscription: {
33
- id: string;
34
- };
35
- }
36
- export interface SubscriptionDeleted extends NotificationSubscription<'notification_subscription_deleted'> {
37
- notification_subscription: {
38
- id: string;
39
- };
40
- }
41
- export declare type SubscriptionInteraction = SubscriptionCreateRequested | SubscriptionConfigureRequested | SubscriptionDeleted;
42
- /**
43
- * Utility mixin for middlewares to open a configuration modal view (views.open)
44
- */
45
- export interface UseConfigure {
46
- configure: {
47
- (params: View): Promise<ViewsOpenResponse>;
48
- };
49
- }
50
- /**
51
- * Utility mixin for middlewares which can be used to send a message to the user
52
- * */
53
- export interface UseSay {
54
- say: SayFn;
55
- }
56
- /**
57
- * Values and utilities middlewares receive in order to process incoming notification
58
- * subscription interactive payloads.
59
- * */
60
- export interface SubscriptionMiddlewareArgs<S extends SubscriptionInteraction = SubscriptionInteraction> {
61
- payload: S;
62
- body: S;
63
- ack: AckFn<void>;
64
- }
65
- export interface SubscriptionOnCreateMiddlewareArgs extends SubscriptionMiddlewareArgs, UseConfigure, UseSay {
66
- }
67
- export interface SubscriptionOnConfigureMiddlewareArgs extends SubscriptionMiddlewareArgs, UseConfigure {
68
- }
69
- export declare type SlackSubscriptionMiddlewareArgs = SubscriptionMiddlewareArgs | SubscriptionOnCreateMiddlewareArgs | SubscriptionOnConfigureMiddlewareArgs;
70
- /**
71
- * Types for middleware which handle notification subscription interaction
72
- * payloads defined above
73
- * */
74
- export declare type SubscriptionOnCreateMiddleware = Middleware<SubscriptionOnCreateMiddlewareArgs>;
75
- export declare type SubscriptionOnConfigureMiddleware = Middleware<SubscriptionOnConfigureMiddlewareArgs>;
76
- export declare type SubscriptionOnDeletedMiddleware = Middleware<SubscriptionMiddlewareArgs>;
77
- export interface SubConfigureFn {
78
- (params: View): Promise<ViewsOpenResponse>;
79
- }
80
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/subscription/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,WAAW,wBAAwB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IACjE,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CA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