@slack/bolt 4.0.0-nextGen.9 → 4.0.0-rc.1

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 (155) hide show
  1. package/dist/App.d.ts +17 -42
  2. package/dist/App.d.ts.map +1 -1
  3. package/dist/App.js +53 -152
  4. package/dist/App.js.map +1 -1
  5. package/dist/WorkflowFunction.d.ts +63 -0
  6. package/dist/WorkflowFunction.d.ts.map +1 -0
  7. package/dist/WorkflowFunction.js +130 -0
  8. package/dist/WorkflowFunction.js.map +1 -0
  9. package/dist/errors.d.ts +1 -13
  10. package/dist/errors.d.ts.map +1 -1
  11. package/dist/errors.js +1 -25
  12. package/dist/errors.js.map +1 -1
  13. package/dist/helpers.d.ts +15 -2
  14. package/dist/helpers.d.ts.map +1 -1
  15. package/dist/helpers.js +40 -9
  16. package/dist/helpers.js.map +1 -1
  17. package/dist/index.d.ts +0 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +0 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/middleware/builtin.d.ts +2 -2
  22. package/dist/middleware/builtin.d.ts.map +1 -1
  23. package/dist/middleware/builtin.js +1 -0
  24. package/dist/middleware/builtin.js.map +1 -1
  25. package/dist/middleware/process.d.ts.map +1 -1
  26. package/dist/middleware/process.js.map +1 -1
  27. package/dist/receivers/AwsLambdaReceiver.d.ts.map +1 -1
  28. package/dist/receivers/AwsLambdaReceiver.js +1 -1
  29. package/dist/receivers/AwsLambdaReceiver.js.map +1 -1
  30. package/dist/receivers/ExpressReceiver.d.ts.map +1 -1
  31. package/dist/receivers/ExpressReceiver.js +2 -2
  32. package/dist/receivers/ExpressReceiver.js.map +1 -1
  33. package/dist/receivers/HTTPModuleFunctions.d.ts +1 -1
  34. package/dist/receivers/HTTPModuleFunctions.d.ts.map +1 -1
  35. package/dist/receivers/HTTPModuleFunctions.js +13 -1
  36. package/dist/receivers/HTTPModuleFunctions.js.map +1 -1
  37. package/dist/receivers/HTTPReceiver.d.ts.map +1 -1
  38. package/dist/receivers/HTTPReceiver.js +11 -5
  39. package/dist/receivers/HTTPReceiver.js.map +1 -1
  40. package/dist/receivers/HTTPResponseAck.d.ts +1 -1
  41. package/dist/receivers/HTTPResponseAck.d.ts.map +1 -1
  42. package/dist/receivers/ParamsIncomingMessage.d.ts +14 -0
  43. package/dist/receivers/ParamsIncomingMessage.d.ts.map +1 -0
  44. package/dist/{types/block-suggestion/index.js → receivers/ParamsIncomingMessage.js} +1 -1
  45. package/dist/receivers/ParamsIncomingMessage.js.map +1 -0
  46. package/dist/receivers/SocketModeReceiver.d.ts +3 -2
  47. package/dist/receivers/SocketModeReceiver.d.ts.map +1 -1
  48. package/dist/receivers/SocketModeReceiver.js +13 -5
  49. package/dist/receivers/SocketModeReceiver.js.map +1 -1
  50. package/dist/receivers/custom-routes.d.ts +4 -3
  51. package/dist/receivers/custom-routes.d.ts.map +1 -1
  52. package/dist/receivers/custom-routes.js.map +1 -1
  53. package/dist/receivers/http-utils.d.ts.map +1 -1
  54. package/dist/receivers/http-utils.js.map +1 -1
  55. package/dist/receivers/verify-request.d.ts +1 -1
  56. package/dist/receivers/verify-request.d.ts.map +1 -1
  57. package/dist/receivers/verify-request.js +1 -1
  58. package/dist/receivers/verify-request.js.map +1 -1
  59. package/dist/types/actions/block-action.d.ts +27 -8
  60. package/dist/types/actions/block-action.d.ts.map +1 -1
  61. package/dist/types/actions/dialog-action.d.ts +0 -4
  62. package/dist/types/actions/dialog-action.d.ts.map +1 -1
  63. package/dist/types/events/base-events.d.ts +85 -33
  64. package/dist/types/events/base-events.d.ts.map +1 -1
  65. package/dist/types/events/base-events.js.map +1 -1
  66. package/dist/types/index.d.ts +0 -2
  67. package/dist/types/index.d.ts.map +1 -1
  68. package/dist/types/index.js +0 -2
  69. package/dist/types/index.js.map +1 -1
  70. package/dist/types/middleware.d.ts +5 -17
  71. package/dist/types/middleware.d.ts.map +1 -1
  72. package/dist/types/middleware.js.map +1 -1
  73. package/dist/types/options/index.d.ts +9 -10
  74. package/dist/types/options/index.d.ts.map +1 -1
  75. package/dist/types/shortcuts/index.d.ts +1 -1
  76. package/dist/types/shortcuts/index.d.ts.map +1 -1
  77. package/dist/types/utilities.d.ts +9 -8
  78. package/dist/types/utilities.d.ts.map +1 -1
  79. package/dist/types/view/index.d.ts +134 -6
  80. package/dist/types/view/index.d.ts.map +1 -1
  81. package/package.json +14 -29
  82. package/dist/Manifest.d.ts +0 -5
  83. package/dist/Manifest.d.ts.map +0 -1
  84. package/dist/Manifest.js +0 -16
  85. package/dist/Manifest.js.map +0 -1
  86. package/dist/SlackFunction.d.ts +0 -190
  87. package/dist/SlackFunction.d.ts.map +0 -1
  88. package/dist/SlackFunction.js +0 -441
  89. package/dist/SlackFunction.js.map +0 -1
  90. package/dist/Subscription.d.ts +0 -61
  91. package/dist/Subscription.d.ts.map +0 -1
  92. package/dist/Subscription.js +0 -169
  93. package/dist/Subscription.js.map +0 -1
  94. package/dist/cli/check-update.d.ts +0 -3
  95. package/dist/cli/check-update.d.ts.map +0 -1
  96. package/dist/cli/check-update.js +0 -13
  97. package/dist/cli/check-update.js.map +0 -1
  98. package/dist/cli/get-hooks.d.ts +0 -2
  99. package/dist/cli/get-hooks.d.ts.map +0 -1
  100. package/dist/cli/get-hooks.js +0 -19
  101. package/dist/cli/get-hooks.js.map +0 -1
  102. package/dist/cli/get-manifest.d.ts +0 -3
  103. package/dist/cli/get-manifest.d.ts.map +0 -1
  104. package/dist/cli/get-manifest.js +0 -16
  105. package/dist/cli/get-manifest.js.map +0 -1
  106. package/dist/cli/hook-utils/get-check-update-data.d.ts +0 -49
  107. package/dist/cli/hook-utils/get-check-update-data.d.ts.map +0 -1
  108. package/dist/cli/hook-utils/get-check-update-data.js +0 -252
  109. package/dist/cli/hook-utils/get-check-update-data.js.map +0 -1
  110. package/dist/cli/hook-utils/get-check-update-data.spec.d.ts +0 -2
  111. package/dist/cli/hook-utils/get-check-update-data.spec.d.ts.map +0 -1
  112. package/dist/cli/hook-utils/get-check-update-data.spec.js +0 -266
  113. package/dist/cli/hook-utils/get-check-update-data.spec.js.map +0 -1
  114. package/dist/cli/hook-utils/get-manifest-data.d.ts +0 -7
  115. package/dist/cli/hook-utils/get-manifest-data.d.ts.map +0 -1
  116. package/dist/cli/hook-utils/get-manifest-data.js +0 -30
  117. package/dist/cli/hook-utils/get-manifest-data.js.map +0 -1
  118. package/dist/cli/hook-utils/get-manifest-data.spec.d.ts +0 -2
  119. package/dist/cli/hook-utils/get-manifest-data.spec.d.ts.map +0 -1
  120. package/dist/cli/hook-utils/get-manifest-data.spec.js +0 -113
  121. package/dist/cli/hook-utils/get-manifest-data.spec.js.map +0 -1
  122. package/dist/cli/hook-utils/manifest.d.ts +0 -30
  123. package/dist/cli/hook-utils/manifest.d.ts.map +0 -1
  124. package/dist/cli/hook-utils/manifest.js +0 -103
  125. package/dist/cli/hook-utils/manifest.js.map +0 -1
  126. package/dist/cli/hook-utils/manifest.spec.d.ts +0 -2
  127. package/dist/cli/hook-utils/manifest.spec.d.ts.map +0 -1
  128. package/dist/cli/hook-utils/manifest.spec.js +0 -79
  129. package/dist/cli/hook-utils/manifest.spec.js.map +0 -1
  130. package/dist/cli/run.d.ts +0 -2
  131. package/dist/cli/run.d.ts.map +0 -1
  132. package/dist/cli/run.js +0 -37
  133. package/dist/cli/run.js.map +0 -1
  134. package/dist/cli/start.d.ts +0 -3
  135. package/dist/cli/start.d.ts.map +0 -1
  136. package/dist/cli/start.js +0 -40
  137. package/dist/cli/start.js.map +0 -1
  138. package/dist/types/block-suggestion/index.d.ts +0 -97
  139. package/dist/types/block-suggestion/index.d.ts.map +0 -1
  140. package/dist/types/block-suggestion/index.js.map +0 -1
  141. package/dist/types/functions/index.d.ts +0 -26
  142. package/dist/types/functions/index.d.ts.map +0 -1
  143. package/dist/types/functions/index.js +0 -3
  144. package/dist/types/functions/index.js.map +0 -1
  145. package/dist/types/subscription/index.d.ts +0 -80
  146. package/dist/types/subscription/index.d.ts.map +0 -1
  147. package/dist/types/subscription/index.js +0 -3
  148. package/dist/types/subscription/index.js.map +0 -1
  149. package/src/cli/check-update.js +0 -13
  150. package/src/cli/get-hooks.js +0 -17
  151. package/src/cli/get-manifest.js +0 -16
  152. package/src/cli/hook-utils/get-check-update-data.js +0 -292
  153. package/src/cli/hook-utils/get-manifest-data.js +0 -39
  154. package/src/cli/hook-utils/manifest.js +0 -108
  155. package/src/cli/start.js +0 -43
@@ -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,+BAA+B,EAC/B,cAAc,EAGf,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,8BAA8B,GAAG,8BAA8B,EAAE,CAAC;IAC5E,WAAW,EAAE,iCAAiC,GAAG,iCAAiC,EAAE,CAAC;IACrF,SAAS,CAAC,EAAE,+BAA+B,GAAG,+BAA+B,EAAE,CAAC;CACjF;AAED,aAAK,6BAA6B,CAAC,CAAC,SAAS,+BAA+B,GAAG,+BAA+B,IAC9G,CAAC,GAAG,iBAAiB,CAAC;AAEtB,oBAAY,sBAAsB,GAAG,8BAA8B,EAAE,GACrE,iCAAiC,EAAE,GACnC,+BAA+B,EAAE,GAAG,EAAE,CAAC;AAGvC,eAAO,MAAM,iDAAiD,UAI7D,CAAC;AACF;;;;KAIK;AACL,qBAAa,YAAY;IACvB;;SAEK;IACL,OAAO,CAAC,EAAE,CAAS;IAEnB;;SAEK;IACL,OAAO,CAAC,QAAQ,CAAmC;IAEnD;;SAEK;IACL,OAAO,CAAC,WAAW,CAAsC;IAEzD;;SAEK;IACL,OAAO,CAAC,SAAS,CAAyC;gBAEvC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB;IAYpD,aAAa,IAAI,UAAU,CAAC,iBAAiB,CAAC;IASrD;;;SAGK;IACL,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,OAAO,CAKb;IAEF,OAAO,CAAC,gBAAgB,CAWtB;CACH;AAGD,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAkCvE;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,IAAI,IAAI,6BAA6B,CAGxG;AAED;;;KAGK;AACL,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,6BAA6B,EACnC,cAAc,EAAE,sBAAsB,GACrC,OAAO,CAAC,IAAI,CAAC,CAiBf;AACD;;;KAGK;AACL,wBAAgB,cAAc,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,mCAAmC;CACpC,CAAC;AACF;;;;KAIK;AACL,MAAa,YAAY;IAqBvB,YAAmB,EAAU,EAAE,OAA4B;QAL3D;;aAEK;QACG,cAAS,GAAsC,EAAE,CAAC;QAmClD,YAAO,GAAG,KAAK,EAAE,IAAmC,EAAiB,EAAE;YAC7E,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;YACzB,MAAM,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,aAAa,G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;AACtB,CAAC;AApBD,oDAoBC;AACD;;;KAGK;AACL,SAAgB,cAAc,CAAC,IAAuB;IACpD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;IACzC,MAAM,YAAY,GAAQ,EAAE,GAAG,OAAO,EAAE,CAAC;IACzC,QAAQ,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE;QACjC,KAAK,4CAA4C;YAC/C,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;YACvD,MAAM;QACR,KAAK,+CAA+C;YAClD,YAAY,CAAC,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC;YACvD,MAAM;QACR;YACE,MAAM;KACT;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAdD,wCAcC;AAED;;;KAGK;AACL,SAAgB,eAAe,CAAC,IAAS;IACvC,MAAM,EAAE,OAAO,EAAE,GAA8E,IAAI,CAAC;IACpG,MAAM,UAAU,GAAG,OAAO,CAAC,2CAA2C,CAAC;IACvE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACpF,OAAO,CAAC,IAAU,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC;QACvC,KAAK;QACL,UAAU;QACV,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAVD,0CAUC"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node --no-warnings
2
- export {};
3
- //# sourceMappingURL=check-update.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-update.d.ts","sourceRoot":"","sources":["../../src/cli/check-update.js"],"names":[],"mappings":""}
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node --no-warnings
2
- "use strict";
3
- const { checkForSDKUpdates } = require('./hook-utils/get-check-update-data');
4
- /**
5
- * Implements the check-update hook and looks for available SDK updates.
6
- * Returns an object detailing info on Slack dependencies to pass up to the CLI.
7
- */
8
- (async function _(cwd) {
9
- let updates = await checkForSDKUpdates(cwd);
10
- // write updates to stdout
11
- console.log(JSON.stringify(updates));
12
- }(process.cwd()));
13
- //# sourceMappingURL=check-update.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-update.js","sourceRoot":"","sources":["../../src/cli/check-update.js"],"names":[],"mappings":";;AACA,MAAM,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;AAE7E;;;EAGE;AACF,CAAC,KAAK,UAAU,CAAC,CAAC,GAAG;IACnB,IAAI,OAAO,GAAG,MAAM,kBAAkB,CAAC,GAAG,CAAC,CAAC;IAE5C,0BAA0B;IAC1B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;AACvC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- //# sourceMappingURL=get-hooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-hooks.d.ts","sourceRoot":"","sources":["../../src/cli/get-hooks.js"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- console.log(JSON.stringify({
4
- hooks: {
5
- 'get-manifest': 'npx -q --no-install -p @slack/bolt slack-cli-get-manifest',
6
- 'check-update': 'npx -q --no-install -p @slack/bolt slack-cli-check-update',
7
- start: 'npx -q --no-install -p @slack/bolt slack-cli-start',
8
- },
9
- config: {
10
- watch: {
11
- 'filter-regex': '^manifest\\.(ts|js|json)$',
12
- paths: [
13
- '.',
14
- ],
15
- },
16
- 'sdk-managed-connection-enabled': true,
17
- },
18
- }));
19
- //# sourceMappingURL=get-hooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-hooks.js","sourceRoot":"","sources":["../../src/cli/get-hooks.js"],"names":[],"mappings":";;AACA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;IACzB,KAAK,EAAE;QACL,cAAc,EAAE,2DAA2D;QAC3E,cAAc,EAAE,2DAA2D;QAC3E,KAAK,EAAE,oDAAoD;KAC5D;IACD,MAAM,EAAE;QACN,KAAK,EAAE;YACL,cAAc,EAAE,2BAA2B;YAC3C,KAAK,EAAE;gBACL,GAAG;aACJ;SACF;QACD,gCAAgC,EAAE,IAAI;KACvC;CACF,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
3
- //# sourceMappingURL=get-manifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-manifest.d.ts","sourceRoot":"","sources":["../../src/cli/get-manifest.js"],"names":[],"mappings":""}
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- const { getManifestData } = require('./hook-utils/get-manifest-data');
4
- /**
5
- * Implements the get-manifest script hook required by the Slack CLI
6
- * Returns a manifest JSON string to stdout.
7
- * Looks for a manifest.ts, .js and .json files. If multiple are found
8
- * Then any manifest.ts (or missing that, manifest.js) defined
9
- * properties will merge into any manifest.json
10
- */
11
- (function _(cwd) {
12
- let manifest = getManifestData(cwd);
13
- // write manifest to stdout
14
- console.log(JSON.stringify(manifest));
15
- }(process.cwd()));
16
- //# sourceMappingURL=get-manifest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-manifest.js","sourceRoot":"","sources":["../../src/cli/get-manifest.js"],"names":[],"mappings":";;AACA,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAEtE;;;;;;EAME;AACF,CAAC,SAAS,CAAC,CAAC,GAAG;IACb,IAAI,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;IAEpC,2BAA2B;IAC3B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Checks for available SDK updates for specified dependencies, creates a version map,
3
- * and then wraps everything up into a response to be passed to the CLI.
4
- * @param cwd the current working directory
5
- */
6
- export function checkForSDKUpdates(cwd: any): Promise<{
7
- name: string;
8
- message: string;
9
- releases: any[];
10
- url: string;
11
- error: {
12
- message: string;
13
- } | null;
14
- }>;
15
- /**
16
- * Reads and parses JSON file - if it works, returns the file contents.
17
- * If not, returns an empty object
18
- * @param filePath the path of the file being read
19
- */
20
- export function getJSON(filePath: any): Promise<{}>;
21
- /**
22
- * Gets the needed files that contain dependency info (package.json).
23
- * @param cwd the current working directory of the CLI project
24
- */
25
- export function getJSONFiles(cwd: any): Promise<{
26
- jsonDepFile: {
27
- name: string;
28
- body: {};
29
- };
30
- inaccessibleFiles: {
31
- name: string;
32
- error: unknown;
33
- }[];
34
- }>;
35
- export namespace checkUpdateExports {
36
- /**
37
- * Pulls dependencies from a given file and JSON structure.
38
- * @param json JSON information that includes dependencies
39
- * @param fileName name of the file that the dependency list is coming from
40
- */
41
- function extractDependencies(json: any, fileName: any): Promise<(string | {
42
- version: string;
43
- })[]>;
44
- /**
45
- * Queries for current Bolt version of the project.
46
- */
47
- function getBoltCurrentVersion(): Promise<string>;
48
- }
49
- //# sourceMappingURL=get-check-update-data.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-check-update-data.d.ts","sourceRoot":"","sources":["../../../src/cli/hook-utils/get-check-update-data.js"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH;;;;;;;;GAIC;AAgED;;;;GAIG;AACH,oDAYC;AAYD;;;GAGG;AACH;;;;;;;;;GAsBC;;IAED;;;;OAIG;IACH;;UA2BC;IAmGD;;OAEG;IACH,kDAGC"}
@@ -1,252 +0,0 @@
1
- "use strict";
2
- const fs = require('fs');
3
- const path = require('path');
4
- const util = require('util');
5
- const exec = util.promisify(require('child_process').exec);
6
- const SLACK_BOLT_SDK = '@slack/bolt';
7
- let checkUpdateExports = {};
8
- /**
9
- * Wraps and parses the output of the exec() function
10
- * @param command the command being run by the exec() function
11
- */
12
- async function execWrapper(command) {
13
- const { stdout } = await exec(command);
14
- return stdout.trim();
15
- }
16
- /**
17
- * Checks for available SDK updates for specified dependencies, creates a version map,
18
- * and then wraps everything up into a response to be passed to the CLI.
19
- * @param cwd the current working directory
20
- */
21
- async function checkForSDKUpdates(cwd) {
22
- const { versionMap, inaccessibleFiles } = await createVersionMap(cwd);
23
- const updateResp = createUpdateResp(versionMap, inaccessibleFiles);
24
- return updateResp;
25
- }
26
- /**
27
- * Create a version map that contains each (Slack) dependency, detailing info about
28
- * current and latest versions, as well as if breaking changes are present or if there
29
- * were any errors with getting version retrieval.
30
- * @param cwd the current working directory of the CLI project
31
- */
32
- async function createVersionMap(cwd) {
33
- const { versionMap, inaccessibleFiles } = await readProjectDependencies(cwd);
34
- if (versionMap && versionMap[SLACK_BOLT_SDK]) {
35
- const current = versionMap[SLACK_BOLT_SDK].current || '';
36
- let latest = '', error = null;
37
- try {
38
- latest = await fetchLatestModuleVersion(SLACK_BOLT_SDK);
39
- }
40
- catch (err) {
41
- error = err;
42
- }
43
- const update = !!current && !!latest && current !== latest;
44
- const breaking = hasBreakingChange(current, latest);
45
- versionMap[SLACK_BOLT_SDK] = {
46
- ...versionMap[SLACK_BOLT_SDK],
47
- latest,
48
- update,
49
- breaking,
50
- error,
51
- };
52
- }
53
- return { versionMap, inaccessibleFiles };
54
- }
55
- /**
56
- * Reads project dependencies - cycles through project dependency files, extracts
57
- * the listed dependencies, and adds it in to the version map with version info.
58
- * @param cwd the current working directory of the CLI project
59
- */
60
- async function readProjectDependencies(cwd) {
61
- const versionMap = {};
62
- const { dependencyFile, inaccessibleFiles } = await gatherDependencyFiles(cwd);
63
- try {
64
- const [sdk, value] = await checkUpdateExports.extractDependencies(dependencyFile.body, dependencyFile.name);
65
- if (sdk !== '' && sdk === SLACK_BOLT_SDK) {
66
- versionMap[SLACK_BOLT_SDK] = {
67
- name: sdk,
68
- current: value.version,
69
- };
70
- }
71
- }
72
- catch (err) {
73
- inaccessibleFiles.push({ name: dependencyFile.name, error: err });
74
- }
75
- return { versionMap, inaccessibleFiles };
76
- }
77
- /**
78
- * Reads and parses JSON file - if it works, returns the file contents.
79
- * If not, returns an empty object
80
- * @param filePath the path of the file being read
81
- */
82
- async function getJSON(filePath) {
83
- let fileContents = {};
84
- try {
85
- if (fs.existsSync(filePath)) {
86
- fileContents = JSON.parse(fs.readFileSync(filePath, 'utf8'));
87
- }
88
- else {
89
- throw new Error('Cannot find a file at path ' + filePath);
90
- }
91
- }
92
- catch (err) {
93
- throw new Error(err);
94
- }
95
- return fileContents;
96
- }
97
- /**
98
- * Gathers all related dependency files for the CLI project (package.json).
99
- * @param cwd the current working directory of the CLI project
100
- */
101
- async function gatherDependencyFiles(cwd) {
102
- const { jsonDepFile, inaccessibleFiles } = await getJSONFiles(cwd);
103
- const dependencyFile = jsonDepFile;
104
- return { dependencyFile, inaccessibleFiles };
105
- }
106
- /**
107
- * Gets the needed files that contain dependency info (package.json).
108
- * @param cwd the current working directory of the CLI project
109
- */
110
- async function getJSONFiles(cwd) {
111
- const packageJSON = 'package.json';
112
- const jsonDepFile = {};
113
- const inaccessibleFiles = [];
114
- try {
115
- const jsonFile = await getJSON(`${cwd}/${packageJSON}`);
116
- const jsonIsParsable = jsonFile &&
117
- typeof jsonFile === 'object' &&
118
- !Array.isArray(jsonFile) &&
119
- jsonFile.dependencies;
120
- if (jsonIsParsable) {
121
- jsonDepFile.name = packageJSON;
122
- jsonDepFile.body = jsonFile;
123
- }
124
- }
125
- catch (err) {
126
- inaccessibleFiles.push({ name: packageJSON, error: err });
127
- }
128
- return { jsonDepFile, inaccessibleFiles };
129
- }
130
- /**
131
- * Pulls dependencies from a given file and JSON structure.
132
- * @param json JSON information that includes dependencies
133
- * @param fileName name of the file that the dependency list is coming from
134
- */
135
- checkUpdateExports.extractDependencies = async (json, fileName) => {
136
- // Determine if the JSON passed is an object
137
- const jsonIsParsable = json !== null && typeof json === 'object' && !Array.isArray(json);
138
- if (jsonIsParsable) {
139
- let boltCurrentVersion = '';
140
- if (json['dependencies']['@slack/bolt']) {
141
- const boltCurrentVersionOutput = JSON.parse(await checkUpdateExports.getBoltCurrentVersion());
142
- if (boltCurrentVersionOutput !== '') {
143
- boltCurrentVersion =
144
- boltCurrentVersionOutput['dependencies']['@slack/bolt']['version'];
145
- }
146
- }
147
- return [
148
- '@slack/bolt',
149
- {
150
- version: boltCurrentVersion,
151
- },
152
- ];
153
- }
154
- return [];
155
- };
156
- /**
157
- * Gets the latest module version.
158
- * @param moduleName the module that the latest version is being queried for
159
- */
160
- async function fetchLatestModuleVersion(moduleName) {
161
- let command = '';
162
- if (moduleName === '@slack/bolt') {
163
- command = `npm info ${moduleName} version --tag next-gen`;
164
- }
165
- else if (moduleName === '@slack/deno-slack-sdk') {
166
- command = `npm info ${moduleName} version --tag latest`;
167
- }
168
- const stdout = await execWrapper(command);
169
- return stdout;
170
- }
171
- /**
172
- * Checks if a dependency's upgrade from a current to the latest version will cause a
173
- * breaking change.
174
- * @param current current dependency version in project
175
- * @param latest most up-to-date dependency version available on NPM
176
- */
177
- function hasBreakingChange(current, latest) {
178
- return current !== latest;
179
- }
180
- /**
181
- * Creates the update response - returns an object in the expected response format.
182
- * @param versionMap version map of checked dependencies, current versions, and info on upgrade + breaking changes
183
- * @param inaccessibleFiles array of files that could not be read or accessed
184
- */
185
- function createUpdateResp(versionMap, inaccessibleFiles) {
186
- const name = 'the Slack SDK';
187
- const releases = [];
188
- const url = 'https://api.slack.com/future/changelog';
189
- const fileErrorMsg = createFileErrorMsg(inaccessibleFiles);
190
- let error = null;
191
- let errorMsg = '';
192
- let message = '';
193
- // Output information for each dependency
194
- for (const sdk of Object.values(versionMap)) {
195
- // Dependency has an update OR the fetch of update failed
196
- if (sdk) {
197
- releases.push(sdk);
198
- // Add the dependency that failed to be fetched to the top-level error message
199
- if (sdk.error && sdk.error.message) {
200
- errorMsg += errorMsg
201
- ? `, ${sdk}`
202
- : `An error occurred fetching updates for the following packages: ${sdk.name}`;
203
- }
204
- }
205
- }
206
- // Surface release notes for breaking changes
207
- if (releases && releases[0] && releases[0].breaking) {
208
- message = `Learn more about the breaking change at https://github.com/slackapi/bolt-js/releases/tag/@slack/bolt@${releases[0].latest}`;
209
- }
210
- // If there were issues accessing dependency files, append error message(s)
211
- if (inaccessibleFiles.length) {
212
- errorMsg += errorMsg ? `\n\n ${fileErrorMsg}` : fileErrorMsg;
213
- }
214
- if (errorMsg) {
215
- error = { message: errorMsg };
216
- }
217
- return {
218
- name,
219
- message,
220
- releases,
221
- url,
222
- error,
223
- };
224
- }
225
- /**
226
- * Returns error when dependency files cannot be read.
227
- * @param inaccessibleFiles array of files that could not be read or accessed
228
- */
229
- function createFileErrorMsg(inaccessibleFiles) {
230
- let fileErrorMsg = '';
231
- // There were issues with reading some of the files that were found
232
- for (const file of inaccessibleFiles) {
233
- fileErrorMsg += fileErrorMsg
234
- ? `\n ${file.name}: ${file.error.message}`
235
- : `An error occurred while reading the following files: \n\n ${file.name}: ${file.error.message}`;
236
- }
237
- return fileErrorMsg;
238
- }
239
- /**
240
- * Queries for current Bolt version of the project.
241
- */
242
- checkUpdateExports.getBoltCurrentVersion = async () => {
243
- const stdout = await execWrapper('npm list @slack/bolt --depth=0 --json');
244
- return stdout;
245
- };
246
- module.exports = {
247
- checkForSDKUpdates,
248
- getJSON,
249
- getJSONFiles,
250
- checkUpdateExports,
251
- };
252
- //# sourceMappingURL=get-check-update-data.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-check-update-data.js","sourceRoot":"","sources":["../../../src/cli/hook-utils/get-check-update-data.js"],"names":[],"mappings":";AAAA,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,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CAAC,iBAAiB;IAC3C,IAAI,YAAY,GAAG,EAAE,CAAC;IAEtB,mEAAmE;IACnE,KAAK,MAAM,IAAI,IAAI,iBAAiB,EAAE;QACpC,YAAY,IAAI,YAAY;YAC1B,CAAC,CAAC,QAAQ,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YAC5C,CAAC,CAAC,+DAA+D,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;KACvG;IAED,OAAO,YAAY,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,kBAAkB,CAAC,qBAAqB,GAAG,KAAK,IAAI,EAAE;IACpD,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,uCAAuC,CAAC,CAAC;IAC1E,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG;IACf,kBAAkB;IAClB,OAAO;IACP,YAAY;IACZ,kBAAkB;CACnB,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=get-check-update-data.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-check-update-data.spec.d.ts","sourceRoot":"","sources":["../../../src/cli/hook-utils/get-check-update-data.spec.js"],"names":[],"mappings":""}