@datadog/datadog-ci 2.1.0 → 2.3.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 (74) hide show
  1. package/README.md +6 -6
  2. package/dist/commands/lambda/__tests__/functions/commons.test.js +8 -21
  3. package/dist/commands/lambda/__tests__/functions/commons.test.js.map +1 -1
  4. package/dist/commands/lambda/__tests__/functions/uninstrument.test.js +71 -0
  5. package/dist/commands/lambda/__tests__/functions/uninstrument.test.js.map +1 -1
  6. package/dist/commands/lambda/__tests__/instrument.test.js +165 -75
  7. package/dist/commands/lambda/__tests__/instrument.test.js.map +1 -1
  8. package/dist/commands/lambda/__tests__/uninstrument.test.js +40 -16
  9. package/dist/commands/lambda/__tests__/uninstrument.test.js.map +1 -1
  10. package/dist/commands/lambda/constants.d.ts +3 -0
  11. package/dist/commands/lambda/constants.js +5 -2
  12. package/dist/commands/lambda/constants.js.map +1 -1
  13. package/dist/commands/lambda/functions/commons.d.ts +5 -3
  14. package/dist/commands/lambda/functions/commons.js +43 -10
  15. package/dist/commands/lambda/functions/commons.js.map +1 -1
  16. package/dist/commands/lambda/functions/uninstrument.js +10 -2
  17. package/dist/commands/lambda/functions/uninstrument.js.map +1 -1
  18. package/dist/commands/lambda/instrument.d.ts +3 -2
  19. package/dist/commands/lambda/instrument.js +123 -81
  20. package/dist/commands/lambda/instrument.js.map +1 -1
  21. package/dist/commands/lambda/interfaces.d.ts +1 -0
  22. package/dist/commands/lambda/prompt.d.ts +1 -0
  23. package/dist/commands/lambda/prompt.js +32 -9
  24. package/dist/commands/lambda/prompt.js.map +1 -1
  25. package/dist/commands/lambda/renderer.d.ts +366 -0
  26. package/dist/commands/lambda/renderer.js +450 -0
  27. package/dist/commands/lambda/renderer.js.map +1 -0
  28. package/dist/commands/lambda/uninstrument.d.ts +1 -0
  29. package/dist/commands/lambda/uninstrument.js +76 -30
  30. package/dist/commands/lambda/uninstrument.js.map +1 -1
  31. package/dist/commands/metric/__tests__/metric.test.js +1 -1
  32. package/dist/commands/metric/__tests__/metric.test.js.map +1 -1
  33. package/dist/commands/react-native/xcode.js +1 -1
  34. package/dist/commands/react-native/xcode.js.map +1 -1
  35. package/dist/commands/synthetics/__tests__/fixtures.d.ts +1 -1
  36. package/dist/commands/synthetics/__tests__/fixtures.js +3 -0
  37. package/dist/commands/synthetics/__tests__/fixtures.js.map +1 -1
  38. package/dist/commands/synthetics/__tests__/run-test.test.js +4 -4
  39. package/dist/commands/synthetics/__tests__/run-test.test.js.map +1 -1
  40. package/dist/commands/synthetics/__tests__/utils.test.js +25 -3
  41. package/dist/commands/synthetics/__tests__/utils.test.js.map +1 -1
  42. package/dist/commands/synthetics/command.js +5 -1
  43. package/dist/commands/synthetics/command.js.map +1 -1
  44. package/dist/commands/synthetics/errors.d.ts +1 -1
  45. package/dist/commands/synthetics/errors.js +1 -0
  46. package/dist/commands/synthetics/errors.js.map +1 -1
  47. package/dist/commands/synthetics/reporters/default.js +6 -0
  48. package/dist/commands/synthetics/reporters/default.js.map +1 -1
  49. package/dist/commands/synthetics/run-test.js +1 -1
  50. package/dist/commands/synthetics/run-test.js.map +1 -1
  51. package/dist/commands/synthetics/tunnel/crypto.d.ts +1 -1
  52. package/dist/commands/synthetics/tunnel/crypto.js.map +1 -1
  53. package/dist/commands/synthetics/tunnel/tunnel.js +1 -1
  54. package/dist/commands/synthetics/tunnel/tunnel.js.map +1 -1
  55. package/dist/commands/synthetics/utils.d.ts +4 -4
  56. package/dist/commands/synthetics/utils.js +8 -7
  57. package/dist/commands/synthetics/utils.js.map +1 -1
  58. package/dist/commands/tag/__tests__/tag.test.js +1 -1
  59. package/dist/commands/tag/__tests__/tag.test.js.map +1 -1
  60. package/dist/helpers/__tests__/ci.test.js +12 -1
  61. package/dist/helpers/__tests__/ci.test.js.map +1 -1
  62. package/dist/helpers/__tests__/validation.test.js +2 -0
  63. package/dist/helpers/__tests__/validation.test.js.map +1 -1
  64. package/dist/helpers/ci.js +19 -23
  65. package/dist/helpers/ci.js.map +1 -1
  66. package/dist/helpers/user-provided-git.js +1 -1
  67. package/dist/helpers/user-provided-git.js.map +1 -1
  68. package/dist/helpers/utils.d.ts +1 -0
  69. package/dist/helpers/utils.js +20 -1
  70. package/dist/helpers/utils.js.map +1 -1
  71. package/dist/helpers/validation.d.ts +10 -1
  72. package/dist/helpers/validation.js +12 -0
  73. package/dist/helpers/validation.js.map +1 -1
  74. package/package.json +7 -7
@@ -1,5 +1,6 @@
1
1
  import inquirer from 'inquirer';
2
2
  declare const checkboxPlusPrompt: any;
3
+ export declare const awsProfileQuestion: (mfaSerial: string) => inquirer.InputQuestion;
3
4
  export declare const datadogApiKeyTypeQuestion: (datadogSite: string) => inquirer.ListQuestion;
4
5
  export declare const datadogEnvVarsQuestions: (datadogApiKeyType: Record<string, any>) => inquirer.InputQuestion;
5
6
  export declare const confirmationQuestion: (message: string) => inquirer.ConfirmQuestion;
@@ -12,15 +12,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.requestFunctionSelection = exports.requestChangesConfirmation = exports.requestEnvServiceVersion = exports.requestDatadogEnvVars = exports.requestAWSRegion = exports.requestAWSCredentials = exports.functionSelectionQuestion = exports.confirmationQuestion = exports.datadogEnvVarsQuestions = exports.datadogApiKeyTypeQuestion = void 0;
15
+ exports.requestFunctionSelection = exports.requestChangesConfirmation = exports.requestEnvServiceVersion = exports.requestDatadogEnvVars = exports.requestAWSRegion = exports.requestAWSCredentials = exports.functionSelectionQuestion = exports.confirmationQuestion = exports.datadogEnvVarsQuestions = exports.datadogApiKeyTypeQuestion = exports.awsProfileQuestion = void 0;
16
16
  const chalk_1 = require("chalk");
17
17
  const fuzzy_1 = require("fuzzy");
18
18
  const inquirer_1 = __importDefault(require("inquirer"));
19
19
  const constants_1 = require("../../constants");
20
+ const validation_1 = require("../../helpers/validation");
20
21
  const constants_2 = require("./constants");
21
22
  const commons_1 = require("./functions/commons");
22
23
  const checkboxPlusPrompt = require('inquirer-checkbox-plus-prompt');
23
24
  inquirer_1.default.registerPrompt('checkbox-plus', checkboxPlusPrompt);
25
+ const awsProfileQuestion = (mfaSerial) => ({
26
+ default: undefined,
27
+ message: `Enter MFA code for ${mfaSerial}: `,
28
+ name: 'AWS_MFA',
29
+ type: 'input',
30
+ validate: (value) => {
31
+ if (!value || value === undefined || value.length < 6) {
32
+ return 'Enter a valid MFA token. Length must be greater than or equal to 6.';
33
+ }
34
+ return true;
35
+ },
36
+ });
37
+ exports.awsProfileQuestion = awsProfileQuestion;
24
38
  const awsCredentialsQuestions = [
25
39
  {
26
40
  // AWS_ACCESS_KEY_ID question
@@ -101,18 +115,21 @@ const datadogSiteQuestion = {
101
115
  const envQuestion = {
102
116
  default: undefined,
103
117
  message: 'Enter a value for the environment variable DD_ENV',
118
+ suffix: chalk_1.dim(' (recommended)'),
104
119
  name: constants_2.ENVIRONMENT_ENV_VAR,
105
120
  type: 'input',
106
121
  };
107
122
  const serviceQuestion = {
108
123
  default: undefined,
109
124
  message: 'Enter a value for the environment variable DD_SERVICE',
125
+ suffix: chalk_1.dim(' (recommended)'),
110
126
  name: constants_2.SERVICE_ENV_VAR,
111
127
  type: 'input',
112
128
  };
113
129
  const versionQuestion = {
114
130
  default: undefined,
115
131
  message: 'Enter a value for the environment variable DD_VERSION',
132
+ suffix: chalk_1.dim(' (recommended)'),
116
133
  name: constants_2.VERSION_ENV_VAR,
117
134
  type: 'input',
118
135
  };
@@ -198,14 +215,20 @@ const requestAWSRegion = (defaultRegion) => __awaiter(void 0, void 0, void 0, fu
198
215
  exports.requestAWSRegion = requestAWSRegion;
199
216
  const requestDatadogEnvVars = () => __awaiter(void 0, void 0, void 0, function* () {
200
217
  try {
201
- const datadogSiteAnswer = yield inquirer_1.default.prompt(datadogSiteQuestion);
202
- const selectedDatadogSite = datadogSiteAnswer[constants_2.CI_SITE_ENV_VAR];
203
- process.env[constants_2.CI_SITE_ENV_VAR] = selectedDatadogSite;
204
- const datadogApiKeyTypeAnswer = yield inquirer_1.default.prompt(exports.datadogApiKeyTypeQuestion(selectedDatadogSite));
205
- const datadogApiKeyType = datadogApiKeyTypeAnswer.type;
206
- const datadogEnvVars = yield inquirer_1.default.prompt(exports.datadogEnvVarsQuestions(datadogApiKeyType));
207
- const selectedDatadogApiKeyEnvVar = datadogApiKeyType.envVar;
208
- process.env[selectedDatadogApiKeyEnvVar] = datadogEnvVars[selectedDatadogApiKeyEnvVar];
218
+ const envSite = process.env[constants_2.CI_SITE_ENV_VAR];
219
+ let selectedDatadogSite = envSite;
220
+ if (!validation_1.isValidDatadogSite(envSite)) {
221
+ const datadogSiteAnswer = yield inquirer_1.default.prompt(datadogSiteQuestion);
222
+ selectedDatadogSite = datadogSiteAnswer[constants_2.CI_SITE_ENV_VAR];
223
+ process.env[constants_2.CI_SITE_ENV_VAR] = selectedDatadogSite;
224
+ }
225
+ if (commons_1.isMissingAnyDatadogApiKeyEnvVar()) {
226
+ const datadogApiKeyTypeAnswer = yield inquirer_1.default.prompt(exports.datadogApiKeyTypeQuestion(selectedDatadogSite));
227
+ const datadogApiKeyType = datadogApiKeyTypeAnswer.type;
228
+ const datadogEnvVars = yield inquirer_1.default.prompt(exports.datadogEnvVarsQuestions(datadogApiKeyType));
229
+ const selectedDatadogApiKeyEnvVar = datadogApiKeyType.envVar;
230
+ process.env[selectedDatadogApiKeyEnvVar] = datadogEnvVars[selectedDatadogApiKeyEnvVar];
231
+ }
209
232
  }
210
233
  catch (e) {
211
234
  if (e instanceof Error) {
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/commands/lambda/prompt.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iCAAsC;AACtC,iCAA4B;AAC5B,wDAA+B;AAE/B,+CAA6C;AAE7C,2CAgBoB;AACpB,iDAAwD;AAExD,MAAM,kBAAkB,GAAG,OAAO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CAAA,CAAA;AAVY,QAAA,0BAA0B,8BAUtC;AAEM,MAAM,wBAAwB,GAAG,CAAO,aAAuB,EAAE,EAAE;IACxE,IAAI;QACF,MAAM,uBAAuB,GAAQ,MAAM,kBAAQ,CAAC,MAAM,CAAC,iCAAyB,CAAC,aAAa,CAAC,CAAC,CAAA;QAEpG,OAAO,uBAAuB,CAAC,SAAS,CAAA;KACzC;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,CAAC,YAAY,KAAK,EAAE;YACtB,MAAM,KAAK,CAAC,wCAAwC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;SACjE;KACF;AACH,CAAC,CAAA,CAAA;AAVY,QAAA,wBAAwB,4BAUpC"}
@@ -0,0 +1,366 @@
1
+ import ora from 'ora';
2
+ import { InstrumentCommand } from './instrument';
3
+ import { UninstrumentCommand } from './uninstrument';
4
+ /**
5
+ * @returns a header indicating which `lambda` subcommand is running.
6
+ * @param command current selected lambda subcommand.
7
+ *
8
+ * ```txt
9
+ * [Dry Run] 🐶 Instrumenting Lambda function
10
+ * ```
11
+ */
12
+ export declare const renderLambdaHeader: (commandType: InstrumentCommand | UninstrumentCommand, isDryRun: boolean) => string;
13
+ /**
14
+ * @param commandType the type of command being used.
15
+ * @returns a message indicating that no functions are specified depending on the given command.
16
+ *
17
+ * ```txt
18
+ * [Error] No functions specified for instrumentation.
19
+ * or
20
+ * [Error] No functions specified for uninstrumentation.
21
+ * ```
22
+ */
23
+ export declare const renderNoFunctionsSpecifiedError: (commandType: InstrumentCommand | UninstrumentCommand) => string;
24
+ /**
25
+ * @returns a message indicating that both options `--extensionVersion` and `--forwarder` are set.
26
+ *
27
+ * ```txt
28
+ * [Error] "extensionVersion" and "forwarder" should not be used at the same time.
29
+ * ```
30
+ */
31
+ export declare const renderExtensionAndForwarderOptionsBothSetError: () => string;
32
+ /**
33
+ * @returns a message indicating that the environment variable `DATADOG_API_KEY` is missing.
34
+ *
35
+ * ```txt
36
+ * [Error] Missing DATADOG_API_KEY in your environment.
37
+ * ```
38
+ */
39
+ export declare const renderMissingDatadogApiKeyError: () => string;
40
+ /**
41
+ * @param functionsCommandUsed a boolean indicating which command was used for the specified functions.
42
+ * @returns a message indicating that option `--functions-regex`
43
+ * is being used along with either `--functions` or the parameter
44
+ * `functions` in a config file.
45
+ *
46
+ * ```txt
47
+ * [Error] "--functions" and "--functions-regex" should not be used at the same time.
48
+ * or
49
+ * [Error] Functions in config file and "--functions-regex" should not be used at the same time.
50
+ * ```
51
+ */
52
+ export declare const renderFunctionsAndFunctionsRegexOptionsBothSetError: (functionsCommandUsed: boolean) => string;
53
+ /**
54
+ * @returns a message indicating that `--functions-regex` argument contains `:` which is mainly used with ARNs.
55
+ *
56
+ * ```txt
57
+ * [Error] "--functions-regex" isn't meant to be used with ARNs.
58
+ * ```
59
+ */
60
+ export declare const renderRegexSetWithARNError: () => string;
61
+ /**
62
+ * @returns a message indicating that no default region has been specified.
63
+ *
64
+ * ```txt
65
+ * [Error] No default region specified. Use `-r`, `--region`.'
66
+ * ```
67
+ */
68
+ export declare const renderNoDefaultRegionSpecifiedError: () => string;
69
+ /**
70
+ * @param error an error message or an object of type `unknown`*.
71
+ * @returns a message indicating that an error occurred while grouping functions.
72
+ *
73
+ * * Using unknown since we're not type guarding.
74
+ *
75
+ * ```txt
76
+ * [Error] Couldn't group functions. The provided error goes here!
77
+ * ```
78
+ */
79
+ export declare const renderCouldntGroupFunctionsError: (error: unknown) => string;
80
+ /**
81
+ * @param error an error message or an object of type `unknown`*.
82
+ * @returns a message indicating that an error occurred while updating.
83
+ *
84
+ * * Using unknown since we're not type guarding.
85
+ *
86
+ * ```txt
87
+ * [Error] Failure during update. The provided error goes here!
88
+ * ```
89
+ */
90
+ export declare const renderFailureDuringUpdateError: (error: unknown) => string;
91
+ /**
92
+ * @param error an error message or an object of type `unknown`*.
93
+ * @returns the provided error prefixed by {@link errorTag}.
94
+ *
95
+ * * Using unknown since we're not type guarding.
96
+ *
97
+ * ```txt
98
+ * [Error] The provided error goes here!
99
+ * ```
100
+ */
101
+ export declare const renderError: (error: unknown) => string;
102
+ /**
103
+ * @param warning the message to warn about
104
+ * @returns the provided warning prefixed by {@link warningTag}.
105
+ *
106
+ * ```txt
107
+ * [Warning] The provided warning goes here!
108
+ * ```
109
+ */
110
+ export declare const renderWarning: (warning: string) => string;
111
+ /**
112
+ * @param warning the message to warn about
113
+ * @returns the provided warning prefixed by {@link warningExclamationSignTag}.
114
+ *
115
+ * ```txt
116
+ * [!] The provided warning goes here!
117
+ * ```
118
+ */
119
+ export declare const renderSoftWarning: (warning: string) => string;
120
+ /**
121
+ * @returns a message suggesting to instrument in dev or staging environment first.
122
+ *
123
+ * ```txt
124
+ * [Warning] Instrument your Lambda functions in a dev or staging environment first. Should the instrumentation result be unsatisfactory, run `uninstrument` with the same arguments to revert the changes.
125
+ * ```
126
+ */
127
+ export declare const renderInstrumentInStagingFirst: () => string;
128
+ /**
129
+ * @returns a soft warning message indicating that functions are going to be updated.
130
+ *
131
+ * ```txt
132
+ * Functions to be updated:
133
+ * ```
134
+ */
135
+ export declare const renderFunctionsToBeUpdated: () => string;
136
+ /**
137
+ * @returns a warning message reminding the user to lock versions for production.
138
+ *
139
+ * ```txt
140
+ * [Warning] At least one latest layer version is being used. Ensure to lock in versions for production applications using `--layerVersion` and `--extensionVersion`.
141
+ * ```
142
+ */
143
+ export declare const renderEnsureToLockLayerVersionsWarning: () => string;
144
+ /**
145
+ * @returns a message indicating that no AWS credentials where found.
146
+ *
147
+ * ```txt
148
+ * [!] No AWS credentials found, lets set them up! Or you can re-run the command and supply the AWS credentials in the same way when you invoke the AWS CLI.
149
+ * ```
150
+ */
151
+ export declare const renderNoAWSCredentialsFound: () => string;
152
+ /**
153
+ * @returns a message indicating to configure AWS region.
154
+ *
155
+ * ```txt
156
+ * [!] Configure AWS region.
157
+ * ```
158
+ */
159
+ export declare const renderConfigureAWSRegion: () => string;
160
+ /**
161
+ * @returns a message indicating to configure Datadog settings.
162
+ *
163
+ * ```txt
164
+ * [!] Configure Datadog settings.
165
+ * ```
166
+ */
167
+ export declare const renderConfigureDatadog: () => string;
168
+ /**
169
+ * @returns a message indicating that no Lambda functions were found
170
+ * in the specified region.
171
+ *
172
+ * ```txt
173
+ * [Error] Couldn't find any Lambda functions in the specified region.
174
+ * ```
175
+ */
176
+ export declare const renderCouldntFindLambdaFunctionsInRegionError: () => string;
177
+ /**
178
+ * @param error an error message or an object of type `unknown`*.
179
+ * @returns a message indicating that no Lambda functions were fetched.
180
+ *
181
+ * * Using unknown since we're not type guarding.
182
+ *
183
+ * ```txt
184
+ * [Error] Couldn't fetch Lambda functions. The provided error goes here!
185
+ * ```
186
+ */
187
+ export declare const renderCouldntFetchLambdaFunctionsError: (error: unknown) => string;
188
+ /**
189
+ * @param tagsMissing an array containing the tags that are not configured
190
+ * @returns a message indicating which tags are not configured and where to
191
+ * learn more about Datadog's unified service tagging.
192
+ *
193
+ * ```txt
194
+ * [Warning] The service tag has not been configures. Learn more about Datadog unified service tagging: https://docs.datadoghq.com/getting_started/tagging/unified_service_tagging/#serverless-environment.
195
+ * ```
196
+ */
197
+ export declare const renderTagsNotConfiguredWarning: (tagsMissing: string[]) => string;
198
+ /**
199
+ * @returns a message indicating that the extra tags provided do not comply
200
+ * with the <key>:<value> array standard.
201
+ *
202
+ * ```txt
203
+ * [Error] Extra tags do not comply with the <key>:<value> array.
204
+ * ```
205
+ */
206
+ export declare const renderExtraTagsDontComplyError: () => string;
207
+ /**
208
+ * @returns a message indicating that the `--layerVersion` argument provided is invalid.
209
+ *
210
+ * ```txt
211
+ * [Error] Invalid layer version "provided value".
212
+ * ```
213
+ */
214
+ export declare const renderInvalidLayerVersionError: (layerVersion?: string | undefined) => string;
215
+ /**
216
+ * @returns a message indicating that the `--extensionVersion` argument provided is invalid.
217
+ *
218
+ * ```txt
219
+ * [Error] Invalid extension version "provided value".
220
+ * ```
221
+ */
222
+ export declare const renderInvalidExtensionVersionError: (extensionVersion?: string | undefined) => string;
223
+ /**
224
+ * @returns a message indicating that the provided argument for a specific string boolean
225
+ * field was invalid.
226
+ *
227
+ * ```txt
228
+ * [Error] Invalid boolean specified for "string boolean field".
229
+ * ```
230
+ */
231
+ export declare const renderInvalidStringBooleanSpecifiedError: (stringBoolean: string) => string;
232
+ /**
233
+ * @param isDryRun a boolean to define if a prefix should be added.
234
+ * @returns a message indicating that no updates will be applied.
235
+ *
236
+ * ```txt
237
+ * [Dry Run] No updates will be applied.
238
+ * or
239
+ * No updates will be applied.
240
+ * ```
241
+ */
242
+ export declare const renderNoUpdatesApplied: (isDryRun: boolean) => string;
243
+ /**
244
+ * @param isDryRun a boolean to define if a prefix should be added.
245
+ * @returns a message indicating that updates will be applied.
246
+ *
247
+ * ```txt
248
+ * [Dry Run] Will apply the following updates:
249
+ * or
250
+ * Will apply the following updates:
251
+ * ```
252
+ */
253
+ export declare const renderWillApplyUpdates: (isDryRun: boolean) => string;
254
+ /**
255
+ * @returns a soft warning message indicating that confirmation is needed.
256
+ *
257
+ * ```txt
258
+ * [!] Confirmation needed.
259
+ * ```
260
+ */
261
+ export declare const renderConfirmationNeededSoftWarning: () => string;
262
+ /**
263
+ * @returns a soft warning message indicating that functions are being instrumented.
264
+ *
265
+ * ```txt
266
+ * [!] Instrumenting functions.
267
+ * ```
268
+ */
269
+ export declare const renderInstrumentingFunctionsSoftWarning: () => string;
270
+ /**
271
+ * @returns a soft warning message indicating the removal of instrumentation
272
+ * for functions.
273
+ *
274
+ * ```txt
275
+ * [!] Uninstrumenting functions.
276
+ * ```
277
+ */
278
+ export declare const renderUninstrumentingFunctionsSoftWarning: () => string;
279
+ /**
280
+ * @param functionsLength the number of Lambda functions that were fetched.
281
+ * @returns a message indicating that it fetched Lambda functions.
282
+ *
283
+ * ```txt
284
+ * Fetched 42 Lambda functions.
285
+ * ```
286
+ */
287
+ export declare const renderFetchedLambdaFunctions: (functionsLength: number) => string;
288
+ /**
289
+ * @param region the AWS region where the Lambda configs belong to.
290
+ * @param configsLength the number of Lambda configuration that were fetched.
291
+ * @returns a message indicating that it updated Lambda functions.
292
+ *
293
+ * ```txt
294
+ * [us-east-1] Fetched 42 Lambda configurations.
295
+ * ```
296
+ */
297
+ export declare const renderFetchedLambdaConfigurationsFromRegion: (region: string, configsLength: number) => string;
298
+ /**
299
+ * @param functionsLength the number of Lambda functions that were updated.
300
+ * @returns a message indicating that it updated Lambda functions.
301
+ *
302
+ * ```txt
303
+ * Updated 42 Lambda functions.
304
+ * ```
305
+ */
306
+ export declare const renderUpdatedLambdaFunctions: (functionsLength: number) => string;
307
+ /**
308
+ * @returns a message indicating that it failed to fetch Lambda functions.
309
+ *
310
+ * ```txt
311
+ * Failed fetching Lambda functions.
312
+ * ```
313
+ */
314
+ export declare const renderFailedFetchingLambdaFunctions: () => string;
315
+ /**
316
+ * @param region the AWS region where the Lambda configs belong to.
317
+ * @returns a message indicating that it failed to fetch Lambda configurations.
318
+ * from a region.
319
+ *
320
+ * ```txt
321
+ * [us-east-1] Failed fetching Lambda configurations.
322
+ * ```
323
+ */
324
+ export declare const renderFailedFetchingLambdaConfigurationsFromRegion: (region: string) => string;
325
+ /**
326
+ * @returns a message indicating that it failed to update Lambda functions.
327
+ *
328
+ * ```txt
329
+ * Failed updating Lambda functions.
330
+ * ```
331
+ */
332
+ export declare const renderFailedUpdatingLambdaFunctions: () => string;
333
+ /**
334
+ * Returns a spinner instance with text for lambda functions fetching.
335
+ *
336
+ * @returns an instance of an {@link ora} spinner.
337
+ *
338
+ * ```txt
339
+ * ⠋ Fetching Lambda functions.
340
+ * ```
341
+ */
342
+ export declare const fetchingFunctionsSpinner: () => ora.Ora;
343
+ /**
344
+ * Returns a spinner instance with text for lambda configurations fetching.
345
+ *
346
+ * @returns an instance of {@link ora} spinner.
347
+ *
348
+ * ```txt
349
+ * ⠋ [us-east-1] Fetching Lambda configurations.
350
+ * ```
351
+ */
352
+ export declare const fetchingFunctionsConfigSpinner: (region: string) => ora.Ora;
353
+ /**
354
+ * Returns a spinner instance with text for lambda functions updating.
355
+ *
356
+ * @returns an instance of an {@link ora} spinner.
357
+ *
358
+ * ```txt
359
+ * ⠋ Updating 5 Lambda functions.
360
+ * ```
361
+ */
362
+ export declare const updatingFunctionsSpinner: (functions: number) => ora.Ora;
363
+ export declare const dryRunTag: string;
364
+ export declare const errorTag: string;
365
+ export declare const warningTag: string;
366
+ export declare const warningExclamationSignTag: string;