@datadog/datadog-ci-base 3.21.0 → 3.21.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 (230) hide show
  1. package/README.md +2 -2
  2. package/dist/cli.d.ts +41 -0
  3. package/dist/cli.js +46 -0
  4. package/dist/cli.js.map +1 -0
  5. package/dist/commands/aas/common.d.ts +51 -0
  6. package/dist/commands/aas/common.js +129 -0
  7. package/dist/commands/aas/common.js.map +1 -0
  8. package/dist/commands/aas/instrument.d.ts +18 -0
  9. package/dist/commands/aas/instrument.js +80 -0
  10. package/dist/commands/aas/instrument.js.map +1 -0
  11. package/dist/commands/aas/uninstrument.d.ts +6 -0
  12. package/dist/commands/aas/uninstrument.js +29 -0
  13. package/dist/commands/aas/uninstrument.js.map +1 -0
  14. package/dist/commands/cloud-run/constants.d.ts +3 -0
  15. package/dist/commands/cloud-run/constants.js +24 -0
  16. package/dist/commands/cloud-run/constants.js.map +1 -0
  17. package/dist/commands/cloud-run/flare.d.ts +18 -0
  18. package/dist/commands/cloud-run/flare.js +42 -0
  19. package/dist/commands/cloud-run/flare.js.map +1 -0
  20. package/dist/commands/cloud-run/instrument.d.ts +30 -0
  21. package/dist/commands/cloud-run/instrument.js +88 -0
  22. package/dist/commands/cloud-run/instrument.js.map +1 -0
  23. package/dist/commands/cloud-run/uninstrument.d.ts +15 -0
  24. package/dist/commands/cloud-run/uninstrument.js +53 -0
  25. package/dist/commands/cloud-run/uninstrument.js.map +1 -0
  26. package/dist/commands/deployment/correlate-command.d.ts +17 -0
  27. package/dist/commands/deployment/correlate-command.js +57 -0
  28. package/dist/commands/deployment/correlate-command.js.map +1 -0
  29. package/dist/commands/deployment/correlate-image-command.d.ts +12 -0
  30. package/dist/commands/deployment/correlate-image-command.js +38 -0
  31. package/dist/commands/deployment/correlate-image-command.js.map +1 -0
  32. package/dist/commands/deployment/gate-command.d.ts +21 -0
  33. package/dist/commands/deployment/gate-command.js +119 -0
  34. package/dist/commands/deployment/gate-command.js.map +1 -0
  35. package/dist/commands/deployment/mark-command.d.ts +18 -0
  36. package/dist/commands/deployment/mark-command.js +63 -0
  37. package/dist/commands/deployment/mark-command.js.map +1 -0
  38. package/dist/commands/dora/deployment-command.d.ts +20 -0
  39. package/dist/commands/dora/deployment-command.js +118 -0
  40. package/dist/commands/dora/deployment-command.js.map +1 -0
  41. package/dist/commands/gate/evaluate-command.d.ts +15 -0
  42. package/dist/commands/gate/evaluate-command.js +98 -0
  43. package/dist/commands/gate/evaluate-command.js.map +1 -0
  44. package/dist/commands/git-metadata/api.d.ts +3 -0
  45. package/dist/commands/git-metadata/api.js +13 -0
  46. package/dist/commands/git-metadata/api.js.map +1 -0
  47. package/dist/commands/git-metadata/git.d.ts +18 -0
  48. package/dist/commands/git-metadata/git.js +188 -0
  49. package/dist/commands/git-metadata/git.js.map +1 -0
  50. package/dist/commands/git-metadata/gitdb.d.ts +7 -0
  51. package/dist/commands/git-metadata/gitdb.js +334 -0
  52. package/dist/commands/git-metadata/gitdb.js.map +1 -0
  53. package/dist/commands/git-metadata/index.d.ts +1 -0
  54. package/dist/commands/git-metadata/index.js +18 -0
  55. package/dist/commands/git-metadata/index.js.map +1 -0
  56. package/dist/commands/git-metadata/interfaces.d.ts +10 -0
  57. package/dist/commands/git-metadata/interfaces.js +56 -0
  58. package/dist/commands/git-metadata/interfaces.js.map +1 -0
  59. package/dist/commands/git-metadata/library.d.ts +7 -0
  60. package/dist/commands/git-metadata/library.js +102 -0
  61. package/dist/commands/git-metadata/library.js.map +1 -0
  62. package/dist/commands/git-metadata/renderer.d.ts +7 -0
  63. package/dist/commands/git-metadata/renderer.js +29 -0
  64. package/dist/commands/git-metadata/renderer.js.map +1 -0
  65. package/dist/commands/git-metadata/upload.d.ts +20 -0
  66. package/dist/commands/git-metadata/upload.js +209 -0
  67. package/dist/commands/git-metadata/upload.js.map +1 -0
  68. package/dist/commands/lambda/flare.d.ts +16 -0
  69. package/dist/commands/lambda/flare.js +41 -0
  70. package/dist/commands/lambda/flare.js.map +1 -0
  71. package/dist/commands/lambda/instrument.d.ts +35 -0
  72. package/dist/commands/lambda/instrument.js +60 -0
  73. package/dist/commands/lambda/instrument.js.map +1 -0
  74. package/dist/commands/lambda/uninstrument.d.ts +33 -0
  75. package/dist/commands/lambda/uninstrument.js +58 -0
  76. package/dist/commands/lambda/uninstrument.js.map +1 -0
  77. package/dist/commands/plugin/check-command.d.ts +7 -0
  78. package/dist/commands/plugin/check-command.js +48 -0
  79. package/dist/commands/plugin/check-command.js.map +1 -0
  80. package/dist/commands/sarif/upload-command.d.ts +17 -0
  81. package/dist/commands/sarif/upload-command.js +62 -0
  82. package/dist/commands/sarif/upload-command.js.map +1 -0
  83. package/dist/commands/sbom/upload-command.d.ts +15 -0
  84. package/dist/commands/sbom/upload-command.js +46 -0
  85. package/dist/commands/sbom/upload-command.js.map +1 -0
  86. package/dist/commands/stepfunctions/instrument.d.ts +15 -0
  87. package/dist/commands/stepfunctions/instrument.js +55 -0
  88. package/dist/commands/stepfunctions/instrument.js.map +1 -0
  89. package/dist/commands/stepfunctions/uninstrument.d.ts +14 -0
  90. package/dist/commands/stepfunctions/uninstrument.js +56 -0
  91. package/dist/commands/stepfunctions/uninstrument.js.map +1 -0
  92. package/dist/commands/synthetics/deploy-tests-command.d.ts +16 -0
  93. package/dist/commands/synthetics/deploy-tests-command.js +79 -0
  94. package/dist/commands/synthetics/deploy-tests-command.js.map +1 -0
  95. package/dist/commands/synthetics/import-tests-command.d.ts +15 -0
  96. package/dist/commands/synthetics/import-tests-command.js +77 -0
  97. package/dist/commands/synthetics/import-tests-command.js.map +1 -0
  98. package/dist/commands/synthetics/run-tests-command.d.ts +28 -0
  99. package/dist/commands/synthetics/run-tests-command.js +158 -0
  100. package/dist/commands/synthetics/run-tests-command.js.map +1 -0
  101. package/dist/commands/synthetics/upload-application-command.d.ts +16 -0
  102. package/dist/commands/synthetics/upload-application-command.js +77 -0
  103. package/dist/commands/synthetics/upload-application-command.js.map +1 -0
  104. package/dist/commands/tag/cli.d.ts +1 -0
  105. package/dist/commands/tag/cli.js +5 -0
  106. package/dist/commands/tag/cli.js.map +1 -0
  107. package/dist/commands/tag/tag-command.d.ts +20 -0
  108. package/dist/commands/tag/tag-command.js +162 -0
  109. package/dist/commands/tag/tag-command.js.map +1 -0
  110. package/dist/constants.d.ts +39 -0
  111. package/dist/constants.js +105 -0
  112. package/dist/constants.js.map +1 -0
  113. package/dist/helpers/api.d.ts +5 -0
  114. package/dist/helpers/api.js +16 -0
  115. package/dist/helpers/api.js.map +1 -0
  116. package/dist/helpers/apikey.d.ts +15 -0
  117. package/dist/helpers/apikey.js +85 -0
  118. package/dist/helpers/apikey.js.map +1 -0
  119. package/dist/helpers/app.d.ts +5 -0
  120. package/dist/helpers/app.js +38 -0
  121. package/dist/helpers/app.js.map +1 -0
  122. package/dist/helpers/base-intake-url.d.ts +1 -0
  123. package/dist/helpers/base-intake-url.js +14 -0
  124. package/dist/helpers/base-intake-url.js.map +1 -0
  125. package/dist/helpers/ci.d.ts +71 -0
  126. package/dist/helpers/ci.js +671 -0
  127. package/dist/helpers/ci.js.map +1 -0
  128. package/dist/helpers/concurrency.d.ts +1 -0
  129. package/dist/helpers/concurrency.js +45 -0
  130. package/dist/helpers/concurrency.js.map +1 -0
  131. package/dist/helpers/config.d.ts +5 -0
  132. package/dist/helpers/config.js +3 -0
  133. package/dist/helpers/config.js.map +1 -0
  134. package/dist/helpers/env.d.ts +6 -0
  135. package/dist/helpers/env.js +50 -0
  136. package/dist/helpers/env.js.map +1 -0
  137. package/dist/helpers/errors.d.ts +2 -0
  138. package/dist/helpers/errors.js +7 -0
  139. package/dist/helpers/errors.js.map +1 -0
  140. package/dist/helpers/file-finder.d.ts +20 -0
  141. package/dist/helpers/file-finder.js +203 -0
  142. package/dist/helpers/file-finder.js.map +1 -0
  143. package/dist/helpers/filereader.d.ts +21 -0
  144. package/dist/helpers/filereader.js +59 -0
  145. package/dist/helpers/filereader.js.map +1 -0
  146. package/dist/helpers/fips.d.ts +1 -0
  147. package/dist/helpers/fips.js +24 -0
  148. package/dist/helpers/fips.js.map +1 -0
  149. package/dist/helpers/flare.d.ts +51 -0
  150. package/dist/helpers/flare.js +238 -0
  151. package/dist/helpers/flare.js.map +1 -0
  152. package/dist/helpers/formatting.d.ts +5 -0
  153. package/dist/helpers/formatting.js +13 -0
  154. package/dist/helpers/formatting.js.map +1 -0
  155. package/dist/helpers/fs.d.ts +31 -0
  156. package/dist/helpers/fs.js +117 -0
  157. package/dist/helpers/fs.js.map +1 -0
  158. package/dist/helpers/get-latest-version.d.ts +1 -0
  159. package/dist/helpers/get-latest-version.js +20 -0
  160. package/dist/helpers/get-latest-version.js.map +1 -0
  161. package/dist/helpers/git/format-git-sourcemaps-data.d.ts +16 -0
  162. package/dist/helpers/git/format-git-sourcemaps-data.js +178 -0
  163. package/dist/helpers/git/format-git-sourcemaps-data.js.map +1 -0
  164. package/dist/helpers/git/format-git-span-data.d.ts +2 -0
  165. package/dist/helpers/git/format-git-span-data.js +54 -0
  166. package/dist/helpers/git/format-git-span-data.js.map +1 -0
  167. package/dist/helpers/git/get-git-data.d.ts +13 -0
  168. package/dist/helpers/git/get-git-data.js +86 -0
  169. package/dist/helpers/git/get-git-data.js.map +1 -0
  170. package/dist/helpers/git/source-code-integration.d.ts +10 -0
  171. package/dist/helpers/git/source-code-integration.js +81 -0
  172. package/dist/helpers/git/source-code-integration.js.map +1 -0
  173. package/dist/helpers/glob.d.ts +12 -0
  174. package/dist/helpers/glob.js +70 -0
  175. package/dist/helpers/glob.js.map +1 -0
  176. package/dist/helpers/id.d.ts +2 -0
  177. package/dist/helpers/id.js +50 -0
  178. package/dist/helpers/id.js.map +1 -0
  179. package/dist/helpers/interfaces.d.ts +59 -0
  180. package/dist/helpers/interfaces.js +3 -0
  181. package/dist/helpers/interfaces.js.map +1 -0
  182. package/dist/helpers/is-standalone-binary.d.ts +1 -0
  183. package/dist/helpers/is-standalone-binary.js +25 -0
  184. package/dist/helpers/is-standalone-binary.js.map +1 -0
  185. package/dist/helpers/logger.d.ts +18 -0
  186. package/dist/helpers/logger.js +52 -0
  187. package/dist/helpers/logger.js.map +1 -0
  188. package/dist/helpers/message-box.d.ts +2 -0
  189. package/dist/helpers/message-box.js +28 -0
  190. package/dist/helpers/message-box.js.map +1 -0
  191. package/dist/helpers/metrics.d.ts +12 -0
  192. package/dist/helpers/metrics.js +36 -0
  193. package/dist/helpers/metrics.js.map +1 -0
  194. package/dist/helpers/plist.d.ts +44 -0
  195. package/dist/helpers/plist.js +93 -0
  196. package/dist/helpers/plist.js.map +1 -0
  197. package/dist/helpers/plugin.d.ts +10 -0
  198. package/dist/helpers/plugin.js +149 -0
  199. package/dist/helpers/plugin.js.map +1 -0
  200. package/dist/helpers/prompt.d.ts +9 -0
  201. package/dist/helpers/prompt.js +58 -0
  202. package/dist/helpers/prompt.js.map +1 -0
  203. package/dist/helpers/renderer.d.ts +60 -0
  204. package/dist/helpers/renderer.js +98 -0
  205. package/dist/helpers/renderer.js.map +1 -0
  206. package/dist/helpers/retry.d.ts +2 -0
  207. package/dist/helpers/retry.js +40 -0
  208. package/dist/helpers/retry.js.map +1 -0
  209. package/dist/helpers/tags.d.ts +82 -0
  210. package/dist/helpers/tags.js +244 -0
  211. package/dist/helpers/tags.js.map +1 -0
  212. package/dist/helpers/types.d.ts +3 -0
  213. package/dist/helpers/types.js +3 -0
  214. package/dist/helpers/types.js.map +1 -0
  215. package/dist/helpers/upload.d.ts +51 -0
  216. package/dist/helpers/upload.js +86 -0
  217. package/dist/helpers/upload.js.map +1 -0
  218. package/dist/helpers/user-provided-git.d.ts +2 -0
  219. package/dist/helpers/user-provided-git.js +49 -0
  220. package/dist/helpers/user-provided-git.js.map +1 -0
  221. package/dist/helpers/utils.d.ts +84 -0
  222. package/dist/helpers/utils.js +340 -0
  223. package/dist/helpers/utils.js.map +1 -0
  224. package/dist/helpers/validation.d.ts +19 -0
  225. package/dist/helpers/validation.js +77 -0
  226. package/dist/helpers/validation.js.map +1 -0
  227. package/dist/version.d.ts +1 -0
  228. package/dist/version.js +6 -0
  229. package/dist/version.js.map +1 -0
  230. package/package.json +19 -10
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # @datadog/datadog-ci-base
2
2
 
3
- This package is imported by every other package in the monorepo.
3
+ This package is imported by all other packages in the monorepo.
4
4
 
5
- It contains shared constants, helpers, and every command definition.
5
+ It contains shared constants, helpers, and command definitions.
package/dist/cli.d.ts ADDED
@@ -0,0 +1,41 @@
1
+ import { CloudRunFlareCommand } from './commands/cloud-run/flare';
2
+ import { InstrumentCommand as CloudRunInstrumentCommand } from './commands/cloud-run/instrument';
3
+ import { UninstrumentCommand as CloudRunUninstrumentCommand } from './commands/cloud-run/uninstrument';
4
+ import { DeploymentCorrelateCommand } from './commands/deployment/correlate-command';
5
+ import { DeploymentCorrelateImageCommand } from './commands/deployment/correlate-image-command';
6
+ import { DeploymentGateCommand } from './commands/deployment/gate-command';
7
+ import { DeploymentMarkCommand } from './commands/deployment/mark-command';
8
+ import { DORADeploymentCommand } from './commands/dora/deployment-command';
9
+ import { GateEvaluateCommand } from './commands/gate/evaluate-command';
10
+ import { UploadCommand } from './commands/git-metadata/upload';
11
+ import { LambdaFlareCommand } from './commands/lambda/flare';
12
+ import { InstrumentCommand as LambdaInstrumentCommand } from './commands/lambda/instrument';
13
+ import { UninstrumentCommand as LambdaUninstrumentCommand } from './commands/lambda/uninstrument';
14
+ import { CheckCommand } from './commands/plugin/check-command';
15
+ import { SarifUploadCommand } from './commands/sarif/upload-command';
16
+ import { SbomUploadCommand } from './commands/sbom/upload-command';
17
+ import { InstrumentStepFunctionsCommand } from './commands/stepfunctions/instrument';
18
+ import { UninstrumentStepFunctionsCommand } from './commands/stepfunctions/uninstrument';
19
+ import { DeployTestsCommand } from './commands/synthetics/deploy-tests-command';
20
+ import { ImportTestsCommand } from './commands/synthetics/import-tests-command';
21
+ import { RunTestsCommand } from './commands/synthetics/run-tests-command';
22
+ import { UploadApplicationCommand } from './commands/synthetics/upload-application-command';
23
+ import { TagCommand } from './commands/tag/tag-command';
24
+ export declare const commands: {
25
+ 'cloud-run': (typeof CloudRunFlareCommand | typeof CloudRunInstrumentCommand | typeof CloudRunUninstrumentCommand)[];
26
+ deployment: (typeof DeploymentCorrelateCommand | typeof DeploymentCorrelateImageCommand | typeof DeploymentGateCommand | typeof DeploymentMarkCommand)[];
27
+ dora: (typeof DORADeploymentCommand)[];
28
+ gate: (typeof GateEvaluateCommand)[];
29
+ 'git-metadata': (typeof UploadCommand)[];
30
+ lambda: (typeof LambdaFlareCommand | typeof LambdaInstrumentCommand | typeof LambdaUninstrumentCommand)[];
31
+ plugin: (typeof CheckCommand)[];
32
+ sarif: (typeof SarifUploadCommand)[];
33
+ sbom: (typeof SbomUploadCommand)[];
34
+ stepfunctions: (typeof InstrumentStepFunctionsCommand | typeof UninstrumentStepFunctionsCommand)[];
35
+ synthetics: (typeof DeployTestsCommand | typeof ImportTestsCommand | typeof RunTestsCommand | typeof UploadApplicationCommand)[];
36
+ tag: (typeof TagCommand)[];
37
+ };
38
+ /**
39
+ * Some command scopes do not have a plugin package, and their logic is entirely included in `@datadog/datadog-ci-base`.
40
+ */
41
+ export declare const noPluginExceptions: Set<string>;
package/dist/cli.js ADDED
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noPluginExceptions = exports.commands = void 0;
4
+ const flare_1 = require("./commands/cloud-run/flare");
5
+ const instrument_1 = require("./commands/cloud-run/instrument");
6
+ const uninstrument_1 = require("./commands/cloud-run/uninstrument");
7
+ const correlate_command_1 = require("./commands/deployment/correlate-command");
8
+ const correlate_image_command_1 = require("./commands/deployment/correlate-image-command");
9
+ const gate_command_1 = require("./commands/deployment/gate-command");
10
+ const mark_command_1 = require("./commands/deployment/mark-command");
11
+ const deployment_command_1 = require("./commands/dora/deployment-command");
12
+ const evaluate_command_1 = require("./commands/gate/evaluate-command");
13
+ const upload_1 = require("./commands/git-metadata/upload");
14
+ const flare_2 = require("./commands/lambda/flare");
15
+ const instrument_2 = require("./commands/lambda/instrument");
16
+ const uninstrument_2 = require("./commands/lambda/uninstrument");
17
+ const check_command_1 = require("./commands/plugin/check-command");
18
+ const upload_command_1 = require("./commands/sarif/upload-command");
19
+ const upload_command_2 = require("./commands/sbom/upload-command");
20
+ const instrument_3 = require("./commands/stepfunctions/instrument");
21
+ const uninstrument_3 = require("./commands/stepfunctions/uninstrument");
22
+ const deploy_tests_command_1 = require("./commands/synthetics/deploy-tests-command");
23
+ const import_tests_command_1 = require("./commands/synthetics/import-tests-command");
24
+ const run_tests_command_1 = require("./commands/synthetics/run-tests-command");
25
+ const upload_application_command_1 = require("./commands/synthetics/upload-application-command");
26
+ const tag_command_1 = require("./commands/tag/tag-command");
27
+ // prettier-ignore
28
+ exports.commands = {
29
+ 'cloud-run': [instrument_1.InstrumentCommand, uninstrument_1.UninstrumentCommand, flare_1.CloudRunFlareCommand],
30
+ 'deployment': [mark_command_1.DeploymentMarkCommand, correlate_command_1.DeploymentCorrelateCommand, correlate_image_command_1.DeploymentCorrelateImageCommand, gate_command_1.DeploymentGateCommand],
31
+ 'dora': [deployment_command_1.DORADeploymentCommand],
32
+ 'gate': [evaluate_command_1.GateEvaluateCommand],
33
+ 'git-metadata': [upload_1.UploadCommand],
34
+ 'lambda': [instrument_2.InstrumentCommand, uninstrument_2.UninstrumentCommand, flare_2.LambdaFlareCommand],
35
+ 'plugin': [check_command_1.CheckCommand],
36
+ 'sarif': [upload_command_1.SarifUploadCommand],
37
+ 'sbom': [upload_command_2.SbomUploadCommand],
38
+ 'stepfunctions': [instrument_3.InstrumentStepFunctionsCommand, uninstrument_3.UninstrumentStepFunctionsCommand],
39
+ 'synthetics': [run_tests_command_1.RunTestsCommand, deploy_tests_command_1.DeployTestsCommand, upload_application_command_1.UploadApplicationCommand, import_tests_command_1.ImportTestsCommand],
40
+ 'tag': [tag_command_1.TagCommand],
41
+ };
42
+ /**
43
+ * Some command scopes do not have a plugin package, and their logic is entirely included in `@datadog/datadog-ci-base`.
44
+ */
45
+ exports.noPluginExceptions = new Set(['git-metadata', 'plugin', 'tag']);
46
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAGA,sDAA+D;AAC/D,gEAA8F;AAC9F,oEAAoG;AACpG,+EAAkF;AAClF,2FAA6F;AAC7F,qEAAwE;AACxE,qEAAwE;AACxE,2EAAwE;AACxE,uEAAoE;AACpE,2DAA4D;AAC5D,mDAA0D;AAC1D,6DAAyF;AACzF,iEAA+F;AAC/F,mEAA4D;AAC5D,oEAAkE;AAClE,mEAAgE;AAChE,oEAAkF;AAClF,wEAAsF;AACtF,qFAA6E;AAC7E,qFAA6E;AAC7E,+EAAuE;AACvE,iGAAyF;AACzF,4DAAqD;AAErD,kBAAkB;AACL,QAAA,QAAQ,GAAG;IACtB,WAAW,EAAE,CAAC,8BAAyB,EAAE,kCAA2B,EAAE,4BAAoB,CAAC;IAC3F,YAAY,EAAE,CAAC,oCAAqB,EAAE,8CAA0B,EAAE,yDAA+B,EAAE,oCAAqB,CAAC;IACzH,MAAM,EAAE,CAAC,0CAAqB,CAAC;IAC/B,MAAM,EAAE,CAAC,sCAAmB,CAAC;IAC7B,cAAc,EAAE,CAAC,sBAAa,CAAC;IAC/B,QAAQ,EAAE,CAAC,8BAAuB,EAAE,kCAAyB,EAAE,0BAAkB,CAAC;IAClF,QAAQ,EAAE,CAAC,4BAAY,CAAC;IACxB,OAAO,EAAE,CAAC,mCAAkB,CAAC;IAC7B,MAAM,EAAE,CAAC,kCAAiB,CAAC;IAC3B,eAAe,EAAE,CAAC,2CAA8B,EAAE,+CAAgC,CAAC;IACnF,YAAY,EAAE,CAAC,mCAAe,EAAE,yCAAkB,EAAE,qDAAwB,EAAE,yCAAkB,CAAC;IACjG,KAAK,EAAE,CAAC,wBAAU,CAAC;CACc,CAAA;AAEnC;;GAEG;AACU,QAAA,kBAAkB,GAAgB,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,CAEvF,CAAA"}
@@ -0,0 +1,51 @@
1
+ import { Command } from 'clipanion';
2
+ export declare const ENV_VAR_REGEX: RegExp;
3
+ /**
4
+ * Maps Subscription ID to Resource Group to App Service names.
5
+ */
6
+ export type AasBySubscriptionAndGroup = Record<string, Record<string, string[]>>;
7
+ /**
8
+ * Configuration options provided by the user through
9
+ * the CLI in order to instrument properly.
10
+ */
11
+ export type AasConfigOptions = Partial<{
12
+ subscriptionId: string;
13
+ resourceGroup: string;
14
+ aasName: string;
15
+ resourceIds: string[];
16
+ service: string;
17
+ environment: string;
18
+ version: string;
19
+ isInstanceLoggingEnabled: boolean;
20
+ logPath: string;
21
+ envVars: string[];
22
+ isDotnet: boolean;
23
+ isMusl: boolean;
24
+ shouldNotRestart: boolean;
25
+ sourceCodeIntegration: boolean;
26
+ uploadGitMetadata: boolean;
27
+ extraTags: string;
28
+ }>;
29
+ interface Resource {
30
+ subscriptionId: string;
31
+ resourceGroup: string;
32
+ name: string;
33
+ }
34
+ export declare const parseResourceId: (resourceId: string) => Resource | undefined;
35
+ export declare abstract class AasCommand extends Command {
36
+ dryRun: boolean;
37
+ private subscriptionId;
38
+ private resourceGroup;
39
+ private aasName;
40
+ private resourceIds;
41
+ private envVars;
42
+ private configPath;
43
+ private fips;
44
+ private fipsIgnoreError;
45
+ private fipsConfig;
46
+ get dryRunPrefix(): string;
47
+ get additionalConfig(): Partial<AasConfigOptions>;
48
+ enableFips(): void;
49
+ ensureConfig(): Promise<[AasBySubscriptionAndGroup, AasConfigOptions, string[]]>;
50
+ }
51
+ export {};
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AasCommand = exports.parseResourceId = exports.ENV_VAR_REGEX = void 0;
13
+ const clipanion_1 = require("clipanion");
14
+ const constants_1 = require("../../constants");
15
+ const env_1 = require("../../helpers/env");
16
+ const fips_1 = require("../../helpers/fips");
17
+ const renderer_1 = require("../../helpers/renderer");
18
+ const utils_1 = require("../../helpers/utils");
19
+ exports.ENV_VAR_REGEX = /^([\w.]+)=(.*)$/;
20
+ const parseResourceId = (resourceId) => {
21
+ const match = resourceId.match(/^\/subscriptions\/([^/]+)\/resourceGroups\/([^/]+)\/providers\/Microsoft\.Web\/sites\/([^/]+)$/i);
22
+ if (match) {
23
+ const [, subscriptionId, resourceGroup, name] = match;
24
+ return { subscriptionId, resourceGroup, name };
25
+ }
26
+ };
27
+ exports.parseResourceId = parseResourceId;
28
+ class AasCommand extends clipanion_1.Command {
29
+ constructor() {
30
+ var _a, _b;
31
+ super(...arguments);
32
+ this.dryRun = clipanion_1.Option.Boolean('-d,--dry-run', false, {
33
+ description: 'Run the command in dry-run mode, without making any changes',
34
+ });
35
+ this.subscriptionId = clipanion_1.Option.String('-s,--subscription-id', {
36
+ description: 'Azure Subscription ID containing the App Service',
37
+ });
38
+ this.resourceGroup = clipanion_1.Option.String('-g,--resource-group', {
39
+ description: 'Name of the Azure Resource Group containing the App Service',
40
+ });
41
+ this.aasName = clipanion_1.Option.String('-n,--name', {
42
+ description: 'Name of the Azure App Service to instrument',
43
+ });
44
+ this.resourceIds = clipanion_1.Option.Array('-r,--resource-id', {
45
+ description: 'Full Azure resource IDs to instrument, eg "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Web/sites/{aasName}"',
46
+ });
47
+ this.envVars = clipanion_1.Option.Array('-e,--env-vars', {
48
+ description: 'Additional environment variables to set for the App Service. Can specify multiple in the form `--env-vars VAR1=VALUE1 --env-vars VAR2=VALUE2`.',
49
+ });
50
+ this.configPath = clipanion_1.Option.String('--config', {
51
+ description: 'Path to the configuration file',
52
+ });
53
+ this.fips = clipanion_1.Option.Boolean('--fips', false);
54
+ this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
55
+ this.fipsConfig = {
56
+ fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
57
+ fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
58
+ };
59
+ }
60
+ get dryRunPrefix() {
61
+ return this.dryRun ? renderer_1.dryRunTag + ' ' : '';
62
+ }
63
+ get additionalConfig() {
64
+ return {};
65
+ }
66
+ enableFips() {
67
+ (0, fips_1.enableFips)(this.fips || this.fipsConfig.fips, this.fipsIgnoreError || this.fipsConfig.fipsIgnoreError);
68
+ }
69
+ ensureConfig() {
70
+ var _a, _b, _c;
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const config = (yield (0, utils_1.resolveConfigFromFile)({
73
+ aas: Object.assign({ subscriptionId: this.subscriptionId, resourceGroup: this.resourceGroup, aasName: this.aasName, envVars: this.envVars }, this.additionalConfig),
74
+ }, {
75
+ configPath: this.configPath,
76
+ defaultConfigPaths: utils_1.DEFAULT_CONFIG_PATHS,
77
+ })).aas;
78
+ const appServices = {};
79
+ const errors = [];
80
+ if (process.env.DD_API_KEY === undefined) {
81
+ errors.push('DD_API_KEY environment variable is required');
82
+ }
83
+ // Validate that envVars, if provided, are in the format 'key=value'
84
+ if ((_a = config.envVars) === null || _a === void 0 ? void 0 : _a.some((e) => !exports.ENV_VAR_REGEX.test(e))) {
85
+ errors.push('All envVars must be in the format `KEY=VALUE`');
86
+ }
87
+ // Validate that extraTags, if provided, comply with the expected format
88
+ if (config.extraTags && !config.extraTags.match(constants_1.EXTRA_TAGS_REG_EXP)) {
89
+ errors.push('Extra tags do not comply with the <key>:<value> array.');
90
+ }
91
+ // Validate musl setting
92
+ if (config.isMusl && !config.isDotnet) {
93
+ errors.push('--musl can only be set if --dotnet is also set, as it is only relevant for containerized .NET applications.');
94
+ }
95
+ const specifiedSiteArgs = [config.subscriptionId, config.resourceGroup, config.aasName];
96
+ // all or none of the site args should be specified
97
+ if (!(specifiedSiteArgs.every((arg) => arg) || specifiedSiteArgs.every((arg) => !arg))) {
98
+ errors.push('--subscription-id, --resource-group, and --name must be specified together or not at all');
99
+ }
100
+ else if (specifiedSiteArgs.every((arg) => arg)) {
101
+ appServices[config.subscriptionId] = { [config.resourceGroup]: [config.aasName] };
102
+ }
103
+ if ((_b = this.resourceIds) === null || _b === void 0 ? void 0 : _b.length) {
104
+ for (const resourceId of this.resourceIds) {
105
+ const parsed = (0, exports.parseResourceId)(resourceId);
106
+ if (parsed) {
107
+ const { subscriptionId, resourceGroup, name } = parsed;
108
+ if (!appServices[subscriptionId]) {
109
+ appServices[subscriptionId] = {};
110
+ }
111
+ if (!appServices[subscriptionId][resourceGroup]) {
112
+ appServices[subscriptionId][resourceGroup] = [];
113
+ }
114
+ appServices[subscriptionId][resourceGroup].push(name);
115
+ }
116
+ else {
117
+ errors.push(`Invalid AAS resource ID: ${resourceId}`);
118
+ }
119
+ }
120
+ }
121
+ if (!((_c = this.resourceIds) === null || _c === void 0 ? void 0 : _c.length) && specifiedSiteArgs.every((arg) => !arg)) {
122
+ errors.push('No App Services specified to instrument');
123
+ }
124
+ return [appServices, config, errors];
125
+ });
126
+ }
127
+ }
128
+ exports.AasCommand = AasCommand;
129
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":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AAC,CAAA;aACnF;YACD,IAAI,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,EAAE;gBAC5B,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE;oBACzC,MAAM,MAAM,GAAG,IAAA,uBAAe,EAAC,UAAU,CAAC,CAAA;oBAC1C,IAAI,MAAM,EAAE;wBACV,MAAM,EAAC,cAAc,EAAE,aAAa,EAAE,IAAI,EAAC,GAAG,MAAM,CAAA;wBACpD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,EAAE;4BAChC,WAAW,CAAC,cAAc,CAAC,GAAG,EAAE,CAAA;yBACjC;wBACD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,EAAE;4BAC/C,WAAW,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;yBAChD;wBACD,WAAW,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;qBACtD;yBAAM;wBACL,MAAM,CAAC,IAAI,CAAC,4BAA4B,UAAU,EAAE,CAAC,CAAA;qBACtD;iBACF;aACF;YACD,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAA,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE;gBACvE,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAA;aACvD;YAED,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;;KACrC;CACF;AAhHD,gCAgHC"}
@@ -0,0 +1,18 @@
1
+ import { AasCommand, AasConfigOptions } from './common';
2
+ export declare class InstrumentCommand extends AasCommand {
3
+ static paths: string[][];
4
+ static usage: import("clipanion").Usage;
5
+ private service;
6
+ private environment;
7
+ private version;
8
+ private isInstanceLoggingEnabled;
9
+ private logPath;
10
+ private shouldNotRestart;
11
+ private isDotnet;
12
+ private isMusl;
13
+ private sourceCodeIntegration;
14
+ private uploadGitMetadata;
15
+ private extraTags;
16
+ get additionalConfig(): Partial<AasConfigOptions>;
17
+ execute(): Promise<number | void>;
18
+ }
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.InstrumentCommand = void 0;
13
+ const clipanion_1 = require("clipanion");
14
+ const plugin_1 = require("../../helpers/plugin");
15
+ const common_1 = require("./common");
16
+ class InstrumentCommand extends common_1.AasCommand {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.service = clipanion_1.Option.String('--service', {
20
+ description: 'The value for the service tag. For example, `my-service`',
21
+ });
22
+ this.environment = clipanion_1.Option.String('--env,--environment', {
23
+ description: 'The value for the env tag. For example, `prod`',
24
+ });
25
+ this.version = clipanion_1.Option.String('--version', {
26
+ description: 'The value for the version tag. For example, `1.0.0`',
27
+ });
28
+ this.isInstanceLoggingEnabled = clipanion_1.Option.Boolean('--instance-logging', false, {
29
+ description: 'When enabled, log collection is automatically configured for an additional file path: /home/LogFiles/*$COMPUTERNAME*.log',
30
+ });
31
+ this.logPath = clipanion_1.Option.String('--log-path', {
32
+ description: 'Where you write your logs. For example, /home/LogFiles/*.log or /home/LogFiles/myapp/*.log',
33
+ });
34
+ this.shouldNotRestart = clipanion_1.Option.Boolean('--no-restart', false, {
35
+ description: 'Do not restart the App Service after applying instrumentation.',
36
+ });
37
+ this.isDotnet = clipanion_1.Option.Boolean('--dotnet', false, {
38
+ description: 'Add in required .NET-specific configuration options, is automatically inferred for code runtimes. This should be specified if you are using a containerized .NET app.',
39
+ });
40
+ this.isMusl = clipanion_1.Option.Boolean('--musl', false, {
41
+ description: 'Add in required .NET-specific configuration options for musl-based .NET apps. This should be specified if you are using a containerized .NET app on a musl-based distribution like Alpine Linux.',
42
+ });
43
+ this.sourceCodeIntegration = clipanion_1.Option.Boolean('--source-code-integration,--sourceCodeIntegration', true, {
44
+ description: 'Enable source code integration to add git metadata as tags. Defaults to enabled. Specify `--no-source-code-integration` to disable.',
45
+ });
46
+ this.uploadGitMetadata = clipanion_1.Option.Boolean('--upload-git-metadata,--uploadGitMetadata', true, {
47
+ description: 'Upload git metadata to Datadog. Defaults to enabled. Specify `--no-upload-git-metadata` to disable.',
48
+ });
49
+ this.extraTags = clipanion_1.Option.String('--extra-tags,--extraTags', {
50
+ description: 'Additional tags to add to the service in the format "key1:value1,key2:value2"',
51
+ });
52
+ }
53
+ get additionalConfig() {
54
+ return {
55
+ service: this.service,
56
+ environment: this.environment,
57
+ version: this.version,
58
+ isInstanceLoggingEnabled: this.isInstanceLoggingEnabled,
59
+ logPath: this.logPath,
60
+ shouldNotRestart: this.shouldNotRestart,
61
+ isDotnet: this.isDotnet,
62
+ isMusl: this.isMusl,
63
+ sourceCodeIntegration: this.sourceCodeIntegration,
64
+ uploadGitMetadata: this.uploadGitMetadata,
65
+ extraTags: this.extraTags,
66
+ };
67
+ }
68
+ execute() {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ return (0, plugin_1.executePluginCommand)(this);
71
+ });
72
+ }
73
+ }
74
+ exports.InstrumentCommand = InstrumentCommand;
75
+ InstrumentCommand.paths = [['aas', 'instrument']];
76
+ InstrumentCommand.usage = clipanion_1.Command.Usage({
77
+ category: 'Serverless',
78
+ description: 'Apply Datadog instrumentation to an Azure App Service.',
79
+ });
80
+ //# sourceMappingURL=instrument.js.map
@@ -0,0 +1 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YAC5F,WAAW,EAAE,qGAAqG;SACnH,CAAC,CAAA;QAEM,cAAS,GAAG,kBAAM,CAAC,MAAM,CAAC,0BAA0B,EAAE;YAC5D,WAAW,EAAE,+EAA+E;SAC7F,CAAC,CAAA;IAqBJ,CAAC;IAnBC,IAAW,gBAAgB;QACzB,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,wBAAwB,EAAE,IAAI,CAAC,wBAAwB;YACvD,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;IAEY,OAAO;;YAClB,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAA;QACnC,CAAC;KAAA;;AAnEH,8CAoEC;AAnEe,uBAAK,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC,AAA1B,CAA0B;AAC/B,uBAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,wDAAwD;CACtE,CAAC,AAHiB,CAGjB"}
@@ -0,0 +1,6 @@
1
+ import { AasCommand } from './common';
2
+ export declare class UninstrumentCommand extends AasCommand {
3
+ static paths: string[][];
4
+ static usage: import("clipanion").Usage;
5
+ execute(): Promise<number | void>;
6
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.UninstrumentCommand = void 0;
13
+ const clipanion_1 = require("clipanion");
14
+ const plugin_1 = require("../../helpers/plugin");
15
+ const common_1 = require("./common");
16
+ class UninstrumentCommand extends common_1.AasCommand {
17
+ execute() {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ return (0, plugin_1.executePluginCommand)(this);
20
+ });
21
+ }
22
+ }
23
+ exports.UninstrumentCommand = UninstrumentCommand;
24
+ UninstrumentCommand.paths = [['aas', 'uninstrument']];
25
+ UninstrumentCommand.usage = clipanion_1.Command.Usage({
26
+ category: 'Serverless',
27
+ description: 'Remove Datadog instrumentation from an Azure App Service.',
28
+ });
29
+ //# sourceMappingURL=uninstrument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uninstrument.js","sourceRoot":"","sources":["../../../src/commands/aas/uninstrument.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAiC;AAEjC,iDAAyD;AAEzD,qCAAmC;AAEnC,MAAa,mBAAoB,SAAQ,mBAAU;IAOpC,OAAO;;YAClB,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAA;QACnC,CAAC;KAAA;;AATH,kDAUC;AATe,yBAAK,GAAG,CAAC,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAA;AACjC,yBAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,2DAA2D;CACzE,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const SKIP_MASKING_CLOUDRUN_ENV_VARS: Set<string>;
2
+ export declare const DEFAULT_SIDECAR_NAME = "datadog-sidecar";
3
+ export declare const DEFAULT_VOLUME_NAME = "shared-volume";
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_VOLUME_NAME = exports.DEFAULT_SIDECAR_NAME = exports.SKIP_MASKING_CLOUDRUN_ENV_VARS = void 0;
4
+ const constants_1 = require("../../constants");
5
+ exports.SKIP_MASKING_CLOUDRUN_ENV_VARS = new Set([
6
+ constants_1.SITE_ENV_VAR,
7
+ constants_1.SERVICE_ENV_VAR,
8
+ constants_1.ENVIRONMENT_ENV_VAR,
9
+ 'NODE_OPTIONS',
10
+ 'DD_TRACE_PROPAGATION_STYLE',
11
+ 'DD_SOURCE',
12
+ 'DD_TAGS',
13
+ 'DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_HTTP_ENDPOINT',
14
+ 'DD_OTLP_CONFIG_RECEIVER_PROTOCOLS_GRPC_ENDPOINT',
15
+ 'GCP_PROJECT_ID',
16
+ 'DD_VERSION',
17
+ 'DD_AGENT_HOST',
18
+ 'DD_LOG_LEVEL',
19
+ 'GCP_PUBSUB_PROJECT_ID',
20
+ 'GCP_PUBSUB_SUBSCRIBER_ID',
21
+ ]);
22
+ exports.DEFAULT_SIDECAR_NAME = 'datadog-sidecar';
23
+ exports.DEFAULT_VOLUME_NAME = 'shared-volume';
24
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/cloud-run/constants.ts"],"names":[],"mappings":";;;AAAA,+CAAkF;AAErE,QAAA,8BAA8B,GAAG,IAAI,GAAG,CAAC;IACpD,wBAAY;IACZ,2BAAe;IACf,+BAAmB;IACnB,cAAc;IACd,4BAA4B;IAC5B,WAAW;IACX,SAAS;IACT,iDAAiD;IACjD,iDAAiD;IACjD,gBAAgB;IAChB,YAAY;IACZ,eAAe;IACf,cAAc;IACd,uBAAuB;IACvB,0BAA0B;CAC3B,CAAC,CAAA;AAEW,QAAA,oBAAoB,GAAG,iBAAiB,CAAA;AACxC,QAAA,mBAAmB,GAAG,eAAe,CAAA"}
@@ -0,0 +1,18 @@
1
+ import { Command } from 'clipanion';
2
+ export declare class CloudRunFlareCommand extends Command {
3
+ static paths: string[][];
4
+ static usage: import("clipanion").Usage;
5
+ protected isDryRun: boolean;
6
+ protected withLogs: boolean;
7
+ protected service: string | undefined;
8
+ protected project: string | undefined;
9
+ protected region: string | undefined;
10
+ protected caseId: string | undefined;
11
+ protected email: string | undefined;
12
+ protected start: string | undefined;
13
+ protected end: string | undefined;
14
+ protected apiKey?: string;
15
+ protected fips: boolean;
16
+ protected fipsIgnoreError: boolean;
17
+ execute(): Promise<number | void>;
18
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CloudRunFlareCommand = void 0;
13
+ const clipanion_1 = require("clipanion");
14
+ const plugin_1 = require("../../helpers/plugin");
15
+ class CloudRunFlareCommand extends clipanion_1.Command {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.isDryRun = clipanion_1.Option.Boolean('-d,--dry,--dry-run', false);
19
+ this.withLogs = clipanion_1.Option.Boolean('--with-logs', false);
20
+ this.service = clipanion_1.Option.String('-s,--service');
21
+ this.project = clipanion_1.Option.String('-p,--project');
22
+ this.region = clipanion_1.Option.String('-r,--region,-l,--location');
23
+ this.caseId = clipanion_1.Option.String('-c,--case-id');
24
+ this.email = clipanion_1.Option.String('-e,--email');
25
+ this.start = clipanion_1.Option.String('--start');
26
+ this.end = clipanion_1.Option.String('--end');
27
+ this.fips = clipanion_1.Option.Boolean('--fips', false);
28
+ this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
29
+ }
30
+ execute() {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ return (0, plugin_1.executePluginCommand)(this);
33
+ });
34
+ }
35
+ }
36
+ exports.CloudRunFlareCommand = CloudRunFlareCommand;
37
+ CloudRunFlareCommand.paths = [['cloud-run', 'flare']];
38
+ CloudRunFlareCommand.usage = clipanion_1.Command.Usage({
39
+ category: 'Serverless',
40
+ description: 'Gather Cloud Run service configuration and sends it to Datadog.',
41
+ });
42
+ //# sourceMappingURL=flare.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flare.js","sourceRoot":"","sources":["../../../src/commands/cloud-run/flare.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAyC;AAEzC,iDAAyD;AAEzD,MAAa,oBAAqB,SAAQ,mBAAO;IAAjD;;QAQY,aAAQ,GAAG,kBAAM,CAAC,OAAO,CAAC,oBAAoB,EAAE,KAAK,CAAC,CAAA;QACtD,aAAQ,GAAG,kBAAM,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC,CAAA;QAC/C,YAAO,GAAG,kBAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;QACvC,YAAO,GAAG,kBAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;QACvC,WAAM,GAAG,kBAAM,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAA;QACnD,WAAM,GAAG,kBAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;QACtC,UAAK,GAAG,kBAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;QACnC,UAAK,GAAG,kBAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;QAChC,QAAG,GAAG,kBAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAI5B,SAAI,GAAG,kBAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,oBAAe,GAAG,kBAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;IAI1E,CAAC;IAHc,OAAO;;YAClB,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAA;QACnC,CAAC;KAAA;;AAxBH,oDAyBC;AAxBe,0BAAK,GAAG,CAAC,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,AAA3B,CAA2B;AAEhC,0BAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,iEAAiE;CAC/E,CAAC,AAHiB,CAGjB"}
@@ -0,0 +1,30 @@
1
+ import { Command } from 'clipanion';
2
+ export declare class InstrumentCommand extends Command {
3
+ static paths: string[][];
4
+ static usage: import("clipanion").Usage;
5
+ protected dryRun: boolean;
6
+ protected environment: string | undefined;
7
+ protected extraTags: string | undefined;
8
+ protected project: string | undefined;
9
+ protected services: string[];
10
+ protected interactive: boolean;
11
+ protected region: string | undefined;
12
+ protected logLevel: string | undefined;
13
+ protected sourceCodeIntegration: boolean;
14
+ protected uploadGitMetadata: boolean;
15
+ protected tracing: string | undefined;
16
+ protected version: string | undefined;
17
+ protected llmobs: string | undefined;
18
+ protected healthCheckPort: string | undefined;
19
+ protected sidecarImage: string;
20
+ protected sidecarName: string;
21
+ protected sharedVolumeName: string;
22
+ protected sharedVolumePath: string;
23
+ protected logsPath: string;
24
+ protected sidecarCpus: string;
25
+ protected sidecarMemory: string;
26
+ protected language: string | undefined;
27
+ protected fips: boolean;
28
+ protected fipsIgnoreError: boolean;
29
+ execute(): Promise<number | void>;
30
+ }