@datadog/datadog-ci 3.20.0 → 3.21.2
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.
- package/LICENSE +1 -1
- package/README.md +34 -34
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +11 -19
- package/dist/cli.js.map +1 -1
- package/dist/commands/cli.d.ts +35 -0
- package/dist/commands/cli.js +33 -0
- package/dist/commands/cli.js.map +1 -0
- package/dist/commands/coverage/api.d.ts +2 -2
- package/dist/commands/coverage/api.js +2 -2
- package/dist/commands/coverage/api.js.map +1 -1
- package/dist/commands/coverage/cli.d.ts +2 -1
- package/dist/commands/coverage/cli.js +2 -1
- package/dist/commands/coverage/cli.js.map +1 -1
- package/dist/commands/coverage/interfaces.d.ts +2 -2
- package/dist/commands/coverage/renderer.d.ts +1 -1
- package/dist/commands/coverage/renderer.js.map +1 -1
- package/dist/commands/coverage/upload.js +17 -17
- package/dist/commands/coverage/upload.js.map +1 -1
- package/dist/commands/coverage/utils.d.ts +3 -3
- package/dist/commands/coverage/utils.js +2 -2
- package/dist/commands/coverage/utils.js.map +1 -1
- package/dist/commands/dsyms/cli.d.ts +2 -1
- package/dist/commands/dsyms/cli.js +2 -1
- package/dist/commands/dsyms/cli.js.map +1 -1
- package/dist/commands/dsyms/interfaces.d.ts +1 -1
- package/dist/commands/dsyms/renderer.d.ts +1 -1
- package/dist/commands/dsyms/renderer.js +2 -2
- package/dist/commands/dsyms/renderer.js.map +1 -1
- package/dist/commands/dsyms/upload.d.ts +1 -1
- package/dist/commands/dsyms/upload.js +14 -14
- package/dist/commands/dsyms/upload.js.map +1 -1
- package/dist/commands/dsyms/utils.js +1 -1
- package/dist/commands/dsyms/utils.js.map +1 -1
- package/dist/commands/elf-symbols/cli.d.ts +2 -1
- package/dist/commands/elf-symbols/cli.js +2 -1
- package/dist/commands/elf-symbols/cli.js.map +1 -1
- package/dist/commands/elf-symbols/elf-constants.js +3 -0
- package/dist/commands/elf-symbols/elf-constants.js.map +1 -1
- package/dist/commands/elf-symbols/elf.d.ts +3 -2
- package/dist/commands/elf-symbols/elf.js +7 -4
- package/dist/commands/elf-symbols/elf.js.map +1 -1
- package/dist/commands/elf-symbols/helpers.d.ts +4 -4
- package/dist/commands/elf-symbols/helpers.js +3 -3
- package/dist/commands/elf-symbols/helpers.js.map +1 -1
- package/dist/commands/elf-symbols/renderer.d.ts +1 -1
- package/dist/commands/elf-symbols/renderer.js +3 -3
- package/dist/commands/elf-symbols/renderer.js.map +1 -1
- package/dist/commands/elf-symbols/upload.d.ts +1 -1
- package/dist/commands/elf-symbols/upload.js +14 -17
- package/dist/commands/elf-symbols/upload.js.map +1 -1
- package/dist/commands/flutter-symbols/cli.d.ts +2 -1
- package/dist/commands/flutter-symbols/cli.js +2 -1
- package/dist/commands/flutter-symbols/cli.js.map +1 -1
- package/dist/commands/flutter-symbols/helpers.d.ts +4 -4
- package/dist/commands/flutter-symbols/helpers.js +3 -3
- package/dist/commands/flutter-symbols/helpers.js.map +1 -1
- package/dist/commands/flutter-symbols/renderer.d.ts +1 -1
- package/dist/commands/flutter-symbols/renderer.js +3 -3
- package/dist/commands/flutter-symbols/renderer.js.map +1 -1
- package/dist/commands/flutter-symbols/upload.d.ts +1 -1
- package/dist/commands/flutter-symbols/upload.js +15 -18
- package/dist/commands/flutter-symbols/upload.js.map +1 -1
- package/dist/commands/junit/api.d.ts +2 -2
- package/dist/commands/junit/api.js +1 -1
- package/dist/commands/junit/api.js.map +1 -1
- package/dist/commands/junit/cli.d.ts +2 -1
- package/dist/commands/junit/cli.js +2 -1
- package/dist/commands/junit/cli.js.map +1 -1
- package/dist/commands/junit/interfaces.d.ts +1 -1
- package/dist/commands/junit/renderer.d.ts +1 -1
- package/dist/commands/junit/renderer.js.map +1 -1
- package/dist/commands/junit/upload.js +19 -19
- package/dist/commands/junit/upload.js.map +1 -1
- package/dist/commands/junit/utils.d.ts +1 -2
- package/dist/commands/junit/utils.js +4 -18
- package/dist/commands/junit/utils.js.map +1 -1
- package/dist/commands/measure/cli.d.ts +2 -1
- package/dist/commands/measure/cli.js +2 -1
- package/dist/commands/measure/cli.js.map +1 -1
- package/dist/commands/measure/measure.js +7 -7
- package/dist/commands/measure/measure.js.map +1 -1
- package/dist/commands/pe-symbols/cli.d.ts +2 -1
- package/dist/commands/pe-symbols/cli.js +2 -1
- package/dist/commands/pe-symbols/cli.js.map +1 -1
- package/dist/commands/pe-symbols/helpers.d.ts +4 -4
- package/dist/commands/pe-symbols/helpers.js +3 -3
- package/dist/commands/pe-symbols/helpers.js.map +1 -1
- package/dist/commands/pe-symbols/pe.js +4 -4
- package/dist/commands/pe-symbols/pe.js.map +1 -1
- package/dist/commands/pe-symbols/renderer.d.ts +1 -1
- package/dist/commands/pe-symbols/renderer.js +3 -3
- package/dist/commands/pe-symbols/renderer.js.map +1 -1
- package/dist/commands/pe-symbols/upload.d.ts +1 -1
- package/dist/commands/pe-symbols/upload.js +14 -17
- package/dist/commands/pe-symbols/upload.js.map +1 -1
- package/dist/commands/react-native/cli.d.ts +5 -1
- package/dist/commands/react-native/cli.js +2 -1
- package/dist/commands/react-native/cli.js.map +1 -1
- package/dist/commands/react-native/codepush.js +3 -3
- package/dist/commands/react-native/codepush.js.map +1 -1
- package/dist/commands/react-native/injectDebugId.js +3 -3
- package/dist/commands/react-native/injectDebugId.js.map +1 -1
- package/dist/commands/react-native/interfaces.d.ts +3 -3
- package/dist/commands/react-native/renderer.d.ts +1 -1
- package/dist/commands/react-native/renderer.js +3 -3
- package/dist/commands/react-native/renderer.js.map +1 -1
- package/dist/commands/react-native/upload.d.ts +1 -1
- package/dist/commands/react-native/upload.js +15 -15
- package/dist/commands/react-native/upload.js.map +1 -1
- package/dist/commands/react-native/validation.js +1 -1
- package/dist/commands/react-native/validation.js.map +1 -1
- package/dist/commands/react-native/xcode.js +4 -4
- package/dist/commands/react-native/xcode.js.map +1 -1
- package/dist/commands/sourcemaps/cli.d.ts +2 -1
- package/dist/commands/sourcemaps/cli.js +2 -1
- package/dist/commands/sourcemaps/cli.js.map +1 -1
- package/dist/commands/sourcemaps/interfaces.d.ts +1 -1
- package/dist/commands/sourcemaps/renderer.d.ts +1 -1
- package/dist/commands/sourcemaps/renderer.js +3 -3
- package/dist/commands/sourcemaps/renderer.js.map +1 -1
- package/dist/commands/sourcemaps/upload.d.ts +1 -1
- package/dist/commands/sourcemaps/upload.js +15 -15
- package/dist/commands/sourcemaps/upload.js.map +1 -1
- package/dist/commands/sourcemaps/utils.js +2 -2
- package/dist/commands/sourcemaps/utils.js.map +1 -1
- package/dist/commands/sourcemaps/validation.js +1 -1
- package/dist/commands/sourcemaps/validation.js.map +1 -1
- package/dist/commands/span/cli.d.ts +2 -1
- package/dist/commands/span/cli.js +2 -1
- package/dist/commands/span/cli.js.map +1 -1
- package/dist/commands/span/span.js +1 -1
- package/dist/commands/span/span.js.map +1 -1
- package/dist/commands/trace/api.d.ts +2 -2
- package/dist/commands/trace/api.js +1 -1
- package/dist/commands/trace/api.js.map +1 -1
- package/dist/commands/trace/cli.d.ts +2 -1
- package/dist/commands/trace/cli.js +2 -1
- package/dist/commands/trace/cli.js.map +1 -1
- package/dist/commands/trace/helper.js +8 -8
- package/dist/commands/trace/helper.js.map +1 -1
- package/dist/commands/trace/interfaces.d.ts +1 -1
- package/dist/commands/trace/interfaces.js +1 -1
- package/dist/commands/trace/interfaces.js.map +1 -1
- package/dist/commands/trace/test-utils.d.ts +1 -1
- package/dist/commands/unity-symbols/cli.d.ts +2 -1
- package/dist/commands/unity-symbols/cli.js +2 -1
- package/dist/commands/unity-symbols/cli.js.map +1 -1
- package/dist/commands/unity-symbols/helpers.d.ts +4 -4
- package/dist/commands/unity-symbols/helpers.js +3 -3
- package/dist/commands/unity-symbols/helpers.js.map +1 -1
- package/dist/commands/unity-symbols/renderer.d.ts +1 -1
- package/dist/commands/unity-symbols/renderer.js +3 -3
- package/dist/commands/unity-symbols/renderer.js.map +1 -1
- package/dist/commands/unity-symbols/upload.d.ts +1 -1
- package/dist/commands/unity-symbols/upload.js +14 -14
- package/dist/commands/unity-symbols/upload.js.map +1 -1
- package/dist/commands/version/cli.d.ts +7 -0
- package/dist/commands/version/cli.js +4 -3
- package/dist/commands/version/cli.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +32 -131
- package/dist/commands/aas/cli.d.ts +0 -1
- package/dist/commands/aas/cli.js +0 -6
- package/dist/commands/aas/cli.js.map +0 -1
- package/dist/commands/aas/common.d.ts +0 -48
- package/dist/commands/aas/common.js +0 -282
- package/dist/commands/aas/common.js.map +0 -1
- package/dist/commands/aas/instrument.d.ts +0 -30
- package/dist/commands/aas/instrument.js +0 -239
- package/dist/commands/aas/instrument.js.map +0 -1
- package/dist/commands/aas/interfaces.d.ts +0 -22
- package/dist/commands/aas/interfaces.js +0 -3
- package/dist/commands/aas/interfaces.js.map +0 -1
- package/dist/commands/aas/uninstrument.d.ts +0 -16
- package/dist/commands/aas/uninstrument.js +0 -100
- package/dist/commands/aas/uninstrument.js.map +0 -1
- package/dist/commands/cloud-run/cli.d.ts +0 -1
- package/dist/commands/cloud-run/cli.js +0 -7
- package/dist/commands/cloud-run/cli.js.map +0 -1
- package/dist/commands/cloud-run/constants.d.ts +0 -3
- package/dist/commands/cloud-run/constants.js +0 -24
- package/dist/commands/cloud-run/constants.js.map +0 -1
- package/dist/commands/cloud-run/flare.d.ts +0 -87
- package/dist/commands/cloud-run/flare.js +0 -631
- package/dist/commands/cloud-run/flare.js.map +0 -1
- package/dist/commands/cloud-run/instrument.d.ts +0 -36
- package/dist/commands/cloud-run/instrument.js +0 -383
- package/dist/commands/cloud-run/instrument.js.map +0 -1
- package/dist/commands/cloud-run/interfaces.d.ts +0 -51
- package/dist/commands/cloud-run/interfaces.js +0 -3
- package/dist/commands/cloud-run/interfaces.js.map +0 -1
- package/dist/commands/cloud-run/prompt.d.ts +0 -5
- package/dist/commands/cloud-run/prompt.js +0 -86
- package/dist/commands/cloud-run/prompt.js.map +0 -1
- package/dist/commands/cloud-run/renderer.d.ts +0 -13
- package/dist/commands/cloud-run/renderer.js +0 -86
- package/dist/commands/cloud-run/renderer.js.map +0 -1
- package/dist/commands/cloud-run/types.d.ts +0 -50
- package/dist/commands/cloud-run/types.js +0 -5
- package/dist/commands/cloud-run/types.js.map +0 -1
- package/dist/commands/cloud-run/uninstrument.d.ts +0 -21
- package/dist/commands/cloud-run/uninstrument.js +0 -186
- package/dist/commands/cloud-run/uninstrument.js.map +0 -1
- package/dist/commands/cloud-run/utils.d.ts +0 -15
- package/dist/commands/cloud-run/utils.js +0 -110
- package/dist/commands/cloud-run/utils.js.map +0 -1
- package/dist/commands/deployment/api.d.ts +0 -2
- package/dist/commands/deployment/api.js +0 -46
- package/dist/commands/deployment/api.js.map +0 -1
- package/dist/commands/deployment/cli.d.ts +0 -1
- package/dist/commands/deployment/cli.js +0 -13
- package/dist/commands/deployment/cli.js.map +0 -1
- package/dist/commands/deployment/constants.d.ts +0 -8
- package/dist/commands/deployment/constants.js +0 -12
- package/dist/commands/deployment/constants.js.map +0 -1
- package/dist/commands/deployment/correlate-image.d.ts +0 -15
- package/dist/commands/deployment/correlate-image.js +0 -121
- package/dist/commands/deployment/correlate-image.js.map +0 -1
- package/dist/commands/deployment/correlate.d.ts +0 -22
- package/dist/commands/deployment/correlate.js +0 -185
- package/dist/commands/deployment/correlate.js.map +0 -1
- package/dist/commands/deployment/gate.d.ts +0 -33
- package/dist/commands/deployment/gate.js +0 -340
- package/dist/commands/deployment/gate.js.map +0 -1
- package/dist/commands/deployment/interfaces.d.ts +0 -43
- package/dist/commands/deployment/interfaces.js +0 -3
- package/dist/commands/deployment/interfaces.js.map +0 -1
- package/dist/commands/deployment/mark.d.ts +0 -21
- package/dist/commands/deployment/mark.js +0 -115
- package/dist/commands/deployment/mark.js.map +0 -1
- package/dist/commands/dora/api.d.ts +0 -8
- package/dist/commands/dora/api.js +0 -58
- package/dist/commands/dora/api.js.map +0 -1
- package/dist/commands/dora/cli.d.ts +0 -1
- package/dist/commands/dora/cli.js +0 -5
- package/dist/commands/dora/cli.js.map +0 -1
- package/dist/commands/dora/deployment.d.ts +0 -28
- package/dist/commands/dora/deployment.js +0 -235
- package/dist/commands/dora/deployment.js.map +0 -1
- package/dist/commands/dora/interfaces.d.ts +0 -18
- package/dist/commands/dora/interfaces.js +0 -3
- package/dist/commands/dora/interfaces.js.map +0 -1
- package/dist/commands/dora/renderer.d.ts +0 -8
- package/dist/commands/dora/renderer.js +0 -24
- package/dist/commands/dora/renderer.js.map +0 -1
- package/dist/commands/gate/api.d.ts +0 -7
- package/dist/commands/gate/api.js +0 -49
- package/dist/commands/gate/api.js.map +0 -1
- package/dist/commands/gate/cli.d.ts +0 -1
- package/dist/commands/gate/cli.js +0 -5
- package/dist/commands/gate/cli.js.map +0 -1
- package/dist/commands/gate/evaluate.d.ts +0 -35
- package/dist/commands/gate/evaluate.js +0 -266
- package/dist/commands/gate/evaluate.js.map +0 -1
- package/dist/commands/gate/interfaces.d.ts +0 -40
- package/dist/commands/gate/interfaces.js +0 -3
- package/dist/commands/gate/interfaces.js.map +0 -1
- package/dist/commands/gate/renderer.d.ts +0 -11
- package/dist/commands/gate/renderer.js +0 -126
- package/dist/commands/gate/renderer.js.map +0 -1
- package/dist/commands/gate/utils.d.ts +0 -14
- package/dist/commands/gate/utils.js +0 -71
- package/dist/commands/gate/utils.js.map +0 -1
- package/dist/commands/git-metadata/api.d.ts +0 -3
- package/dist/commands/git-metadata/api.js +0 -13
- package/dist/commands/git-metadata/api.js.map +0 -1
- package/dist/commands/git-metadata/cli.d.ts +0 -1
- package/dist/commands/git-metadata/cli.js +0 -5
- package/dist/commands/git-metadata/cli.js.map +0 -1
- package/dist/commands/git-metadata/git.d.ts +0 -18
- package/dist/commands/git-metadata/git.js +0 -188
- package/dist/commands/git-metadata/git.js.map +0 -1
- package/dist/commands/git-metadata/gitdb.d.ts +0 -7
- package/dist/commands/git-metadata/gitdb.js +0 -334
- package/dist/commands/git-metadata/gitdb.js.map +0 -1
- package/dist/commands/git-metadata/index.d.ts +0 -1
- package/dist/commands/git-metadata/index.js +0 -18
- package/dist/commands/git-metadata/index.js.map +0 -1
- package/dist/commands/git-metadata/interfaces.d.ts +0 -10
- package/dist/commands/git-metadata/interfaces.js +0 -56
- package/dist/commands/git-metadata/interfaces.js.map +0 -1
- package/dist/commands/git-metadata/library.d.ts +0 -7
- package/dist/commands/git-metadata/library.js +0 -102
- package/dist/commands/git-metadata/library.js.map +0 -1
- package/dist/commands/git-metadata/renderer.d.ts +0 -7
- package/dist/commands/git-metadata/renderer.js +0 -29
- package/dist/commands/git-metadata/renderer.js.map +0 -1
- package/dist/commands/git-metadata/upload.d.ts +0 -20
- package/dist/commands/git-metadata/upload.js +0 -209
- package/dist/commands/git-metadata/upload.js.map +0 -1
- package/dist/commands/lambda/cli.d.ts +0 -1
- package/dist/commands/lambda/cli.js +0 -7
- package/dist/commands/lambda/cli.js.map +0 -1
- package/dist/commands/lambda/constants.d.ts +0 -87
- package/dist/commands/lambda/constants.js +0 -159
- package/dist/commands/lambda/constants.js.map +0 -1
- package/dist/commands/lambda/flare.d.ts +0 -102
- package/dist/commands/lambda/flare.js +0 -685
- package/dist/commands/lambda/flare.js.map +0 -1
- package/dist/commands/lambda/functions/commons.d.ts +0 -131
- package/dist/commands/lambda/functions/commons.js +0 -473
- package/dist/commands/lambda/functions/commons.js.map +0 -1
- package/dist/commands/lambda/functions/instrument.d.ts +0 -7
- package/dist/commands/lambda/functions/instrument.js +0 -271
- package/dist/commands/lambda/functions/instrument.js.map +0 -1
- package/dist/commands/lambda/functions/uninstrument.d.ts +0 -7
- package/dist/commands/lambda/functions/uninstrument.js +0 -156
- package/dist/commands/lambda/functions/uninstrument.js.map +0 -1
- package/dist/commands/lambda/functions/versionChecker.d.ts +0 -3
- package/dist/commands/lambda/functions/versionChecker.js +0 -38
- package/dist/commands/lambda/functions/versionChecker.js.map +0 -1
- package/dist/commands/lambda/instrument.d.ts +0 -41
- package/dist/commands/lambda/instrument.js +0 -439
- package/dist/commands/lambda/instrument.js.map +0 -1
- package/dist/commands/lambda/interfaces.d.ts +0 -91
- package/dist/commands/lambda/interfaces.js +0 -3
- package/dist/commands/lambda/interfaces.js.map +0 -1
- package/dist/commands/lambda/loggroup.d.ts +0 -17
- package/dist/commands/lambda/loggroup.js +0 -140
- package/dist/commands/lambda/loggroup.js.map +0 -1
- package/dist/commands/lambda/prompt.d.ts +0 -12
- package/dist/commands/lambda/prompt.js +0 -265
- package/dist/commands/lambda/prompt.js.map +0 -1
- package/dist/commands/lambda/renderers/__mocks__/instrument-uninstrument-renderer.d.ts +0 -2
- package/dist/commands/lambda/renderers/__mocks__/instrument-uninstrument-renderer.js +0 -11
- package/dist/commands/lambda/renderers/__mocks__/instrument-uninstrument-renderer.js.map +0 -1
- package/dist/commands/lambda/renderers/common-renderer.d.ts +0 -16
- package/dist/commands/lambda/renderers/common-renderer.js +0 -23
- package/dist/commands/lambda/renderers/common-renderer.js.map +0 -1
- package/dist/commands/lambda/renderers/instrument-uninstrument-renderer.d.ts +0 -397
- package/dist/commands/lambda/renderers/instrument-uninstrument-renderer.js +0 -506
- package/dist/commands/lambda/renderers/instrument-uninstrument-renderer.js.map +0 -1
- package/dist/commands/lambda/tags.d.ts +0 -8
- package/dist/commands/lambda/tags.js +0 -74
- package/dist/commands/lambda/tags.js.map +0 -1
- package/dist/commands/lambda/uninstrument.d.ts +0 -37
- package/dist/commands/lambda/uninstrument.js +0 -296
- package/dist/commands/lambda/uninstrument.js.map +0 -1
- package/dist/commands/sarif/api.d.ts +0 -7
- package/dist/commands/sarif/api.js +0 -49
- package/dist/commands/sarif/api.js.map +0 -1
- package/dist/commands/sarif/cli.d.ts +0 -1
- package/dist/commands/sarif/cli.js +0 -5
- package/dist/commands/sarif/cli.js.map +0 -1
- package/dist/commands/sarif/interfaces.d.ts +0 -12
- package/dist/commands/sarif/interfaces.js +0 -3
- package/dist/commands/sarif/interfaces.js.map +0 -1
- package/dist/commands/sarif/json-schema/sarif-schema-2.1.0.json +0 -2885
- package/dist/commands/sarif/renderer.d.ts +0 -11
- package/dist/commands/sarif/renderer.js +0 -97
- package/dist/commands/sarif/renderer.js.map +0 -1
- package/dist/commands/sarif/upload.d.ts +0 -22
- package/dist/commands/sarif/upload.js +0 -210
- package/dist/commands/sarif/upload.js.map +0 -1
- package/dist/commands/sarif/utils.d.ts +0 -21
- package/dist/commands/sarif/utils.js +0 -79
- package/dist/commands/sarif/utils.js.map +0 -1
- package/dist/commands/sarif/validation.d.ts +0 -16
- package/dist/commands/sarif/validation.js +0 -102
- package/dist/commands/sarif/validation.js.map +0 -1
- package/dist/commands/sbom/api.d.ts +0 -7
- package/dist/commands/sbom/api.js +0 -54
- package/dist/commands/sbom/api.js.map +0 -1
- package/dist/commands/sbom/cli.d.ts +0 -1
- package/dist/commands/sbom/cli.js +0 -5
- package/dist/commands/sbom/cli.js.map +0 -1
- package/dist/commands/sbom/constants.d.ts +0 -7
- package/dist/commands/sbom/constants.js +0 -11
- package/dist/commands/sbom/constants.js.map +0 -1
- package/dist/commands/sbom/json-schema/cyclonedx/bom-1.4.schema.json +0 -1687
- package/dist/commands/sbom/json-schema/cyclonedx/bom-1.5.schema.json +0 -3799
- package/dist/commands/sbom/json-schema/cyclonedx/bom-1.6.schema.json +0 -5699
- package/dist/commands/sbom/json-schema/jsf/jsf-0.82.schema.json +0 -244
- package/dist/commands/sbom/json-schema/spdx/spdx.schema.json +0 -737
- package/dist/commands/sbom/language.d.ts +0 -2
- package/dist/commands/sbom/language.js +0 -46
- package/dist/commands/sbom/language.js.map +0 -1
- package/dist/commands/sbom/payload.d.ts +0 -3
- package/dist/commands/sbom/payload.js +0 -344
- package/dist/commands/sbom/payload.js.map +0 -1
- package/dist/commands/sbom/renderer.d.ts +0 -9
- package/dist/commands/sbom/renderer.js +0 -99
- package/dist/commands/sbom/renderer.js.map +0 -1
- package/dist/commands/sbom/types.d.ts +0 -135
- package/dist/commands/sbom/types.js +0 -56
- package/dist/commands/sbom/types.js.map +0 -1
- package/dist/commands/sbom/upload.d.ts +0 -21
- package/dist/commands/sbom/upload.js +0 -153
- package/dist/commands/sbom/upload.js.map +0 -1
- package/dist/commands/sbom/validation.d.ts +0 -27
- package/dist/commands/sbom/validation.js +0 -162
- package/dist/commands/sbom/validation.js.map +0 -1
- package/dist/commands/stepfunctions/awsCommands.d.ts +0 -18
- package/dist/commands/stepfunctions/awsCommands.js +0 -244
- package/dist/commands/stepfunctions/awsCommands.js.map +0 -1
- package/dist/commands/stepfunctions/cli.d.ts +0 -1
- package/dist/commands/stepfunctions/cli.js +0 -6
- package/dist/commands/stepfunctions/cli.js.map +0 -1
- package/dist/commands/stepfunctions/constants.d.ts +0 -3
- package/dist/commands/stepfunctions/constants.js +0 -7
- package/dist/commands/stepfunctions/constants.js.map +0 -1
- package/dist/commands/stepfunctions/helpers.d.ts +0 -51
- package/dist/commands/stepfunctions/helpers.js +0 -232
- package/dist/commands/stepfunctions/helpers.js.map +0 -1
- package/dist/commands/stepfunctions/instrument.d.ts +0 -16
- package/dist/commands/stepfunctions/instrument.js +0 -264
- package/dist/commands/stepfunctions/instrument.js.map +0 -1
- package/dist/commands/stepfunctions/uninstrument.d.ts +0 -15
- package/dist/commands/stepfunctions/uninstrument.js +0 -151
- package/dist/commands/stepfunctions/uninstrument.js.map +0 -1
- package/dist/commands/synthetics/api.d.ts +0 -52
- package/dist/commands/synthetics/api.js +0 -333
- package/dist/commands/synthetics/api.js.map +0 -1
- package/dist/commands/synthetics/base-command.d.ts +0 -35
- package/dist/commands/synthetics/base-command.js +0 -132
- package/dist/commands/synthetics/base-command.js.map +0 -1
- package/dist/commands/synthetics/batch.d.ts +0 -9
- package/dist/commands/synthetics/batch.js +0 -325
- package/dist/commands/synthetics/batch.js.map +0 -1
- package/dist/commands/synthetics/build-and-test.d.ts +0 -25
- package/dist/commands/synthetics/build-and-test.js +0 -196
- package/dist/commands/synthetics/build-and-test.js.map +0 -1
- package/dist/commands/synthetics/cli.d.ts +0 -1
- package/dist/commands/synthetics/cli.js +0 -8
- package/dist/commands/synthetics/cli.js.map +0 -1
- package/dist/commands/synthetics/deploy-tests-command.d.ts +0 -15
- package/dist/commands/synthetics/deploy-tests-command.js +0 -78
- package/dist/commands/synthetics/deploy-tests-command.js.map +0 -1
- package/dist/commands/synthetics/deploy-tests-lib.d.ts +0 -2
- package/dist/commands/synthetics/deploy-tests-lib.js +0 -92
- package/dist/commands/synthetics/deploy-tests-lib.js.map +0 -1
- package/dist/commands/synthetics/errors.d.ts +0 -21
- package/dist/commands/synthetics/errors.js +0 -54
- package/dist/commands/synthetics/errors.js.map +0 -1
- package/dist/commands/synthetics/import-tests-command.d.ts +0 -14
- package/dist/commands/synthetics/import-tests-command.js +0 -75
- package/dist/commands/synthetics/import-tests-command.js.map +0 -1
- package/dist/commands/synthetics/import-tests-lib.d.ts +0 -2
- package/dist/commands/synthetics/import-tests-lib.js +0 -71
- package/dist/commands/synthetics/import-tests-lib.js.map +0 -1
- package/dist/commands/synthetics/index.d.ts +0 -7
- package/dist/commands/synthetics/index.js +0 -44
- package/dist/commands/synthetics/index.js.map +0 -1
- package/dist/commands/synthetics/interfaces.d.ts +0 -739
- package/dist/commands/synthetics/interfaces.js +0 -27
- package/dist/commands/synthetics/interfaces.js.map +0 -1
- package/dist/commands/synthetics/local-test-definition.d.ts +0 -2
- package/dist/commands/synthetics/local-test-definition.js +0 -16
- package/dist/commands/synthetics/local-test-definition.js.map +0 -1
- package/dist/commands/synthetics/mobile.d.ts +0 -28
- package/dist/commands/synthetics/mobile.js +0 -275
- package/dist/commands/synthetics/mobile.js.map +0 -1
- package/dist/commands/synthetics/multilocator.d.ts +0 -2
- package/dist/commands/synthetics/multilocator.js +0 -88
- package/dist/commands/synthetics/multilocator.js.map +0 -1
- package/dist/commands/synthetics/reporters/constants.d.ts +0 -6
- package/dist/commands/synthetics/reporters/constants.js +0 -14
- package/dist/commands/synthetics/reporters/constants.js.map +0 -1
- package/dist/commands/synthetics/reporters/default.d.ts +0 -31
- package/dist/commands/synthetics/reporters/default.js +0 -416
- package/dist/commands/synthetics/reporters/default.js.map +0 -1
- package/dist/commands/synthetics/reporters/junit.d.ts +0 -100
- package/dist/commands/synthetics/reporters/junit.js +0 -425
- package/dist/commands/synthetics/reporters/junit.js.map +0 -1
- package/dist/commands/synthetics/reporters/mobile/app-upload.d.ts +0 -15
- package/dist/commands/synthetics/reporters/mobile/app-upload.js +0 -54
- package/dist/commands/synthetics/reporters/mobile/app-upload.js.map +0 -1
- package/dist/commands/synthetics/run-tests-command.d.ts +0 -31
- package/dist/commands/synthetics/run-tests-command.js +0 -335
- package/dist/commands/synthetics/run-tests-command.js.map +0 -1
- package/dist/commands/synthetics/run-tests-lib.d.ts +0 -21
- package/dist/commands/synthetics/run-tests-lib.js +0 -247
- package/dist/commands/synthetics/run-tests-lib.js.map +0 -1
- package/dist/commands/synthetics/test.d.ts +0 -30
- package/dist/commands/synthetics/test.js +0 -204
- package/dist/commands/synthetics/test.js.map +0 -1
- package/dist/commands/synthetics/tunnel/crypto.d.ts +0 -6
- package/dist/commands/synthetics/tunnel/crypto.js +0 -48
- package/dist/commands/synthetics/tunnel/crypto.js.map +0 -1
- package/dist/commands/synthetics/tunnel/index.d.ts +0 -1
- package/dist/commands/synthetics/tunnel/index.js +0 -6
- package/dist/commands/synthetics/tunnel/index.js.map +0 -1
- package/dist/commands/synthetics/tunnel/tunnel.d.ts +0 -49
- package/dist/commands/synthetics/tunnel/tunnel.js +0 -329
- package/dist/commands/synthetics/tunnel/tunnel.js.map +0 -1
- package/dist/commands/synthetics/tunnel/websocket.d.ts +0 -39
- package/dist/commands/synthetics/tunnel/websocket.js +0 -154
- package/dist/commands/synthetics/tunnel/websocket.js.map +0 -1
- package/dist/commands/synthetics/upload-application-command.d.ts +0 -15
- package/dist/commands/synthetics/upload-application-command.js +0 -97
- package/dist/commands/synthetics/upload-application-command.js.map +0 -1
- package/dist/commands/synthetics/utils/internal.d.ts +0 -52
- package/dist/commands/synthetics/utils/internal.js +0 -297
- package/dist/commands/synthetics/utils/internal.js.map +0 -1
- package/dist/commands/synthetics/utils/public.d.ts +0 -76
- package/dist/commands/synthetics/utils/public.js +0 -509
- package/dist/commands/synthetics/utils/public.js.map +0 -1
- package/dist/commands/tag/cli.d.ts +0 -1
- package/dist/commands/tag/cli.js +0 -5
- package/dist/commands/tag/cli.js.map +0 -1
- package/dist/commands/tag/tag.d.ts +0 -20
- package/dist/commands/tag/tag.js +0 -162
- package/dist/commands/tag/tag.js.map +0 -1
- package/dist/constants.d.ts +0 -38
- package/dist/constants.js +0 -104
- package/dist/constants.js.map +0 -1
- package/dist/helpers/api.d.ts +0 -5
- package/dist/helpers/api.js +0 -16
- package/dist/helpers/api.js.map +0 -1
- package/dist/helpers/apikey.d.ts +0 -15
- package/dist/helpers/apikey.js +0 -85
- package/dist/helpers/apikey.js.map +0 -1
- package/dist/helpers/app.d.ts +0 -3
- package/dist/helpers/app.js +0 -23
- package/dist/helpers/app.js.map +0 -1
- package/dist/helpers/base-intake-url.d.ts +0 -1
- package/dist/helpers/base-intake-url.js +0 -14
- package/dist/helpers/base-intake-url.js.map +0 -1
- package/dist/helpers/ci.d.ts +0 -71
- package/dist/helpers/ci.js +0 -671
- package/dist/helpers/ci.js.map +0 -1
- package/dist/helpers/concurrency.d.ts +0 -1
- package/dist/helpers/concurrency.js +0 -45
- package/dist/helpers/concurrency.js.map +0 -1
- package/dist/helpers/config.d.ts +0 -5
- package/dist/helpers/config.js +0 -3
- package/dist/helpers/config.js.map +0 -1
- package/dist/helpers/env.d.ts +0 -6
- package/dist/helpers/env.js +0 -50
- package/dist/helpers/env.js.map +0 -1
- package/dist/helpers/errors.d.ts +0 -2
- package/dist/helpers/errors.js +0 -7
- package/dist/helpers/errors.js.map +0 -1
- package/dist/helpers/file-finder.d.ts +0 -20
- package/dist/helpers/file-finder.js +0 -203
- package/dist/helpers/file-finder.js.map +0 -1
- package/dist/helpers/filereader.d.ts +0 -21
- package/dist/helpers/filereader.js +0 -59
- package/dist/helpers/filereader.js.map +0 -1
- package/dist/helpers/fips.d.ts +0 -1
- package/dist/helpers/fips.js +0 -24
- package/dist/helpers/fips.js.map +0 -1
- package/dist/helpers/flare.d.ts +0 -43
- package/dist/helpers/flare.js +0 -204
- package/dist/helpers/flare.js.map +0 -1
- package/dist/helpers/formatting.d.ts +0 -5
- package/dist/helpers/formatting.js +0 -13
- package/dist/helpers/formatting.js.map +0 -1
- package/dist/helpers/fs.d.ts +0 -31
- package/dist/helpers/fs.js +0 -117
- package/dist/helpers/fs.js.map +0 -1
- package/dist/helpers/git/format-git-sourcemaps-data.d.ts +0 -16
- package/dist/helpers/git/format-git-sourcemaps-data.js +0 -183
- package/dist/helpers/git/format-git-sourcemaps-data.js.map +0 -1
- package/dist/helpers/git/format-git-span-data.d.ts +0 -2
- package/dist/helpers/git/format-git-span-data.js +0 -54
- package/dist/helpers/git/format-git-span-data.js.map +0 -1
- package/dist/helpers/git/get-git-data.d.ts +0 -13
- package/dist/helpers/git/get-git-data.js +0 -86
- package/dist/helpers/git/get-git-data.js.map +0 -1
- package/dist/helpers/git/instrument-helpers.d.ts +0 -10
- package/dist/helpers/git/instrument-helpers.js +0 -79
- package/dist/helpers/git/instrument-helpers.js.map +0 -1
- package/dist/helpers/glob.d.ts +0 -12
- package/dist/helpers/glob.js +0 -70
- package/dist/helpers/glob.js.map +0 -1
- package/dist/helpers/id.d.ts +0 -2
- package/dist/helpers/id.js +0 -53
- package/dist/helpers/id.js.map +0 -1
- package/dist/helpers/interfaces.d.ts +0 -59
- package/dist/helpers/interfaces.js +0 -3
- package/dist/helpers/interfaces.js.map +0 -1
- package/dist/helpers/logger.d.ts +0 -18
- package/dist/helpers/logger.js +0 -52
- package/dist/helpers/logger.js.map +0 -1
- package/dist/helpers/metrics.d.ts +0 -12
- package/dist/helpers/metrics.js +0 -36
- package/dist/helpers/metrics.js.map +0 -1
- package/dist/helpers/plist.d.ts +0 -44
- package/dist/helpers/plist.js +0 -93
- package/dist/helpers/plist.js.map +0 -1
- package/dist/helpers/prompt.d.ts +0 -9
- package/dist/helpers/prompt.js +0 -58
- package/dist/helpers/prompt.js.map +0 -1
- package/dist/helpers/renderer.d.ts +0 -60
- package/dist/helpers/renderer.js +0 -98
- package/dist/helpers/renderer.js.map +0 -1
- package/dist/helpers/retry.d.ts +0 -2
- package/dist/helpers/retry.js +0 -40
- package/dist/helpers/retry.js.map +0 -1
- package/dist/helpers/tags.d.ts +0 -82
- package/dist/helpers/tags.js +0 -244
- package/dist/helpers/tags.js.map +0 -1
- package/dist/helpers/upload.d.ts +0 -51
- package/dist/helpers/upload.js +0 -86
- package/dist/helpers/upload.js.map +0 -1
- package/dist/helpers/user-provided-git.d.ts +0 -2
- package/dist/helpers/user-provided-git.js +0 -49
- package/dist/helpers/user-provided-git.js.map +0 -1
- package/dist/helpers/utils.d.ts +0 -84
- package/dist/helpers/utils.js +0 -340
- package/dist/helpers/utils.js.map +0 -1
- package/dist/helpers/validation.d.ts +0 -19
- package/dist/helpers/validation.js +0 -77
- package/dist/helpers/validation.js.map +0 -1
- package/dist/helpers/version.d.ts +0 -5
- package/dist/helpers/version.js +0 -25
- package/dist/helpers/version.js.map +0 -1
|
@@ -1,264 +0,0 @@
|
|
|
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.InstrumentStepFunctionsCommand = void 0;
|
|
13
|
-
const client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
|
|
14
|
-
const client_iam_1 = require("@aws-sdk/client-iam");
|
|
15
|
-
const client_sfn_1 = require("@aws-sdk/client-sfn");
|
|
16
|
-
const clipanion_1 = require("clipanion");
|
|
17
|
-
const constants_1 = require("../../constants");
|
|
18
|
-
const env_1 = require("../../helpers/env");
|
|
19
|
-
const fips_1 = require("../../helpers/fips");
|
|
20
|
-
const version_1 = require("../../helpers/version");
|
|
21
|
-
const awsCommands_1 = require("./awsCommands");
|
|
22
|
-
const constants_2 = require("./constants");
|
|
23
|
-
const helpers_1 = require("./helpers");
|
|
24
|
-
const cliVersion = version_1.version;
|
|
25
|
-
class InstrumentStepFunctionsCommand extends clipanion_1.Command {
|
|
26
|
-
constructor() {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
super(...arguments);
|
|
29
|
-
this.dryRun = clipanion_1.Option.Boolean('-d,--dry-run', false);
|
|
30
|
-
this.environment = clipanion_1.Option.String('-e,--env');
|
|
31
|
-
this.forwarderArn = clipanion_1.Option.String('--forwarder');
|
|
32
|
-
this.service = clipanion_1.Option.String('--service');
|
|
33
|
-
this.stepFunctionArns = clipanion_1.Option.Array('-s,--step-function');
|
|
34
|
-
this.mergeStepFunctionAndLambdaTraces = clipanion_1.Option.Boolean('-mlt,--merge-lambda-traces,--merge-step-function-and-lambda-traces', false);
|
|
35
|
-
this.propagateUpstreamTrace = clipanion_1.Option.Boolean('--propagate-upstream-trace', false);
|
|
36
|
-
this.fips = clipanion_1.Option.Boolean('--fips', false);
|
|
37
|
-
this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
|
|
38
|
-
this.config = {
|
|
39
|
-
fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
|
|
40
|
-
fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
execute() {
|
|
44
|
-
var _a, _b, _c, _d, _e, _f;
|
|
45
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
(0, fips_1.enableFips)(this.fips || this.config.fips, this.fipsIgnoreError || this.config.fipsIgnoreError);
|
|
47
|
-
let validationError = false;
|
|
48
|
-
if (typeof this.forwarderArn !== 'string') {
|
|
49
|
-
this.context.stdout.write('[Error] `--forwarder` is required\n');
|
|
50
|
-
validationError = true;
|
|
51
|
-
}
|
|
52
|
-
else if (!(0, helpers_1.isValidArn)(this.forwarderArn)) {
|
|
53
|
-
this.context.stdout.write(`[Error] Invalid arn format for \`--forwarder\` ${this.forwarderArn}\n`);
|
|
54
|
-
validationError = true;
|
|
55
|
-
}
|
|
56
|
-
if (validationError) {
|
|
57
|
-
return 1;
|
|
58
|
-
}
|
|
59
|
-
// remove duplicate step function arns
|
|
60
|
-
const stepFunctionArns = [...new Set(this.stepFunctionArns)];
|
|
61
|
-
if (stepFunctionArns.length === 0) {
|
|
62
|
-
this.context.stdout.write(`[Error] Must specify at least one \`--step-function\`\n`);
|
|
63
|
-
validationError = true;
|
|
64
|
-
}
|
|
65
|
-
for (const stepFunctionArn of stepFunctionArns) {
|
|
66
|
-
if (!(0, helpers_1.isValidArn)(stepFunctionArn)) {
|
|
67
|
-
this.context.stdout.write(`[Error] Invalid arn format for \`--step-function\` ${stepFunctionArn}\n`);
|
|
68
|
-
validationError = true;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (validationError) {
|
|
72
|
-
return 1;
|
|
73
|
-
}
|
|
74
|
-
let hasChanges = false;
|
|
75
|
-
// loop over step functions passed as parameters and generate a list of requests to make to AWS for each step function
|
|
76
|
-
for (const stepFunctionArn of stepFunctionArns) {
|
|
77
|
-
this.context.stdout.write(`\n======= ${this.dryRun ? '[Dry Run] Planning for' : 'For'} ${stepFunctionArn} =========\n`);
|
|
78
|
-
// use region from the step function arn to make requests to AWS
|
|
79
|
-
const arnObject = (0, helpers_1.parseArn)(stepFunctionArn);
|
|
80
|
-
const region = arnObject.region;
|
|
81
|
-
const cloudWatchLogsClient = new client_cloudwatch_logs_1.CloudWatchLogsClient({ region });
|
|
82
|
-
const stepFunctionsClient = new client_sfn_1.SFNClient({ region });
|
|
83
|
-
const iamClient = new client_iam_1.IAMClient({ region });
|
|
84
|
-
let describeStateMachineCommandOutput;
|
|
85
|
-
try {
|
|
86
|
-
describeStateMachineCommandOutput = yield (0, awsCommands_1.describeStateMachine)(stepFunctionsClient, stepFunctionArn);
|
|
87
|
-
}
|
|
88
|
-
catch (err) {
|
|
89
|
-
if (err instanceof Error) {
|
|
90
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Unable to describe state machine ${stepFunctionArn}\n`);
|
|
91
|
-
}
|
|
92
|
-
return 1;
|
|
93
|
-
}
|
|
94
|
-
let listStepFunctionTagsResponse;
|
|
95
|
-
try {
|
|
96
|
-
listStepFunctionTagsResponse = yield (0, awsCommands_1.listTagsForResource)(stepFunctionsClient, stepFunctionArn);
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
if (err instanceof Error) {
|
|
100
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Unable to fetch tags for Step Function ${stepFunctionArn}\n`);
|
|
101
|
-
}
|
|
102
|
-
return 1;
|
|
103
|
-
}
|
|
104
|
-
const stepFunctionTagsToAdd = [];
|
|
105
|
-
// if env and service tags are not already set on step function, set these tags using the values passed as parameters
|
|
106
|
-
const hasEnvTag = (_a = listStepFunctionTagsResponse === null || listStepFunctionTagsResponse === void 0 ? void 0 : listStepFunctionTagsResponse.tags) === null || _a === void 0 ? void 0 : _a.some((tag) => tag.key === 'env');
|
|
107
|
-
if (!hasEnvTag && typeof this.environment === 'string') {
|
|
108
|
-
stepFunctionTagsToAdd.push({
|
|
109
|
-
key: 'env',
|
|
110
|
-
value: this.environment,
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
else if (!hasEnvTag && this.environment === undefined) {
|
|
114
|
-
this.context.stdout.write('\n[Error] --env is required when a Step Function has no env tag\n');
|
|
115
|
-
return 1;
|
|
116
|
-
}
|
|
117
|
-
if (!((_b = listStepFunctionTagsResponse === null || listStepFunctionTagsResponse === void 0 ? void 0 : listStepFunctionTagsResponse.tags) === null || _b === void 0 ? void 0 : _b.some((tag) => tag.key === 'service' && tag.value === this.service)) &&
|
|
118
|
-
typeof this.service === 'string') {
|
|
119
|
-
stepFunctionTagsToAdd.push({ key: 'service', value: this.service });
|
|
120
|
-
}
|
|
121
|
-
// set version tag if it changed
|
|
122
|
-
if (!((_c = listStepFunctionTagsResponse === null || listStepFunctionTagsResponse === void 0 ? void 0 : listStepFunctionTagsResponse.tags) === null || _c === void 0 ? void 0 : _c.some((tag) => tag.key === constants_2.TAG_VERSION_NAME && tag.value === `v${cliVersion}`))) {
|
|
123
|
-
stepFunctionTagsToAdd.push({ key: constants_2.TAG_VERSION_NAME, value: `v${cliVersion}` });
|
|
124
|
-
}
|
|
125
|
-
if (!((_d = listStepFunctionTagsResponse === null || listStepFunctionTagsResponse === void 0 ? void 0 : listStepFunctionTagsResponse.tags) === null || _d === void 0 ? void 0 : _d.some((tag) => { var _a; return tag.key === constants_2.DD_TRACE_ENABLED && ((_a = tag.value) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'true'; }))) {
|
|
126
|
-
stepFunctionTagsToAdd.push({ key: constants_2.DD_TRACE_ENABLED, value: 'true' });
|
|
127
|
-
}
|
|
128
|
-
if (stepFunctionTagsToAdd.length > 0) {
|
|
129
|
-
try {
|
|
130
|
-
yield (0, awsCommands_1.tagResource)(stepFunctionsClient, stepFunctionArn, stepFunctionTagsToAdd, this.context, this.dryRun);
|
|
131
|
-
}
|
|
132
|
-
catch (err) {
|
|
133
|
-
if (err instanceof Error) {
|
|
134
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to tag resource for ${stepFunctionArn}\n`);
|
|
135
|
-
}
|
|
136
|
-
return 1;
|
|
137
|
-
}
|
|
138
|
-
hasChanges = true;
|
|
139
|
-
}
|
|
140
|
-
const stateMachineName = describeStateMachineCommandOutput.name;
|
|
141
|
-
const subscriptionFilterName = (0, helpers_1.buildSubscriptionFilterName)(stateMachineName);
|
|
142
|
-
const logLevel = (_e = describeStateMachineCommandOutput.loggingConfiguration) === null || _e === void 0 ? void 0 : _e.level;
|
|
143
|
-
if (logLevel === 'OFF') {
|
|
144
|
-
// if step function logging is disabled, create a log group, subscribe the forwarder to it, and enable step function logging to the created log group
|
|
145
|
-
const logGroupName = (0, helpers_1.buildLogGroupName)(stateMachineName, this.environment);
|
|
146
|
-
try {
|
|
147
|
-
yield (0, awsCommands_1.createLogGroup)(cloudWatchLogsClient, logGroupName, stepFunctionArn, this.context, this.dryRun);
|
|
148
|
-
}
|
|
149
|
-
catch (err) {
|
|
150
|
-
if (err instanceof Error) {
|
|
151
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to Create Log Group ${logGroupName} for ${stepFunctionArn}\n`);
|
|
152
|
-
}
|
|
153
|
-
return 1;
|
|
154
|
-
}
|
|
155
|
-
try {
|
|
156
|
-
yield (0, awsCommands_1.putSubscriptionFilter)(cloudWatchLogsClient, this.forwarderArn, subscriptionFilterName, logGroupName, stepFunctionArn, this.context, this.dryRun);
|
|
157
|
-
}
|
|
158
|
-
catch (err) {
|
|
159
|
-
if (err instanceof Error) {
|
|
160
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to put subscription filter ${subscriptionFilterName} for Log Group ${logGroupName}\n`);
|
|
161
|
-
}
|
|
162
|
-
return 1;
|
|
163
|
-
}
|
|
164
|
-
const logGroupArn = (0, helpers_1.buildArn)(arnObject.partition, 'logs', arnObject.region, arnObject.accountId, 'log-group', `${logGroupName}:*`);
|
|
165
|
-
// Create Logs Access policy
|
|
166
|
-
try {
|
|
167
|
-
yield (0, awsCommands_1.createLogsAccessPolicy)(iamClient, describeStateMachineCommandOutput, stepFunctionArn, this.context, this.dryRun);
|
|
168
|
-
}
|
|
169
|
-
catch (err) {
|
|
170
|
-
if (err instanceof Error) {
|
|
171
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to create logs access policy for ${stepFunctionArn}\n`);
|
|
172
|
-
}
|
|
173
|
-
return 1;
|
|
174
|
-
}
|
|
175
|
-
// Attach policy to state machine IAM role
|
|
176
|
-
try {
|
|
177
|
-
yield (0, awsCommands_1.attachPolicyToStateMachineIamRole)(iamClient, describeStateMachineCommandOutput, arnObject.accountId, stepFunctionArn, this.context, this.dryRun);
|
|
178
|
-
}
|
|
179
|
-
catch (err) {
|
|
180
|
-
if (err instanceof Error) {
|
|
181
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to attach policy to state machine iam role for ${stepFunctionArn}\n`);
|
|
182
|
-
}
|
|
183
|
-
return 1;
|
|
184
|
-
}
|
|
185
|
-
// IAM policy on step function role should include log permissions now
|
|
186
|
-
try {
|
|
187
|
-
yield (0, awsCommands_1.enableStepFunctionLogs)(stepFunctionsClient, describeStateMachineCommandOutput, logGroupArn, stepFunctionArn, this.context, this.dryRun);
|
|
188
|
-
}
|
|
189
|
-
catch (err) {
|
|
190
|
-
if (err instanceof Error) {
|
|
191
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to enable log group ${logGroupArn} for ${stepFunctionArn}\n`);
|
|
192
|
-
}
|
|
193
|
-
return 1;
|
|
194
|
-
}
|
|
195
|
-
hasChanges = true;
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
// if step function logging is enabled, subscribe the forwarder to the log group in the step function logging config
|
|
199
|
-
const logGroupArn = (0, helpers_1.getStepFunctionLogGroupArn)(describeStateMachineCommandOutput);
|
|
200
|
-
if (logGroupArn === undefined) {
|
|
201
|
-
this.context.stdout.write('\n[Error] Unable to get Log Group arn from Step Function logging configuration\n');
|
|
202
|
-
return 1;
|
|
203
|
-
}
|
|
204
|
-
const logGroupName = (0, helpers_1.parseArn)(logGroupArn).resourceName;
|
|
205
|
-
// update step function logging config to have logLevel `ALL` and includeExecutionData `true` if not already configured
|
|
206
|
-
const includeExecutionData = (_f = describeStateMachineCommandOutput.loggingConfiguration) === null || _f === void 0 ? void 0 : _f.includeExecutionData;
|
|
207
|
-
if (logLevel !== 'ALL' || !includeExecutionData) {
|
|
208
|
-
try {
|
|
209
|
-
yield (0, awsCommands_1.enableStepFunctionLogs)(stepFunctionsClient, describeStateMachineCommandOutput, logGroupArn, stepFunctionArn, this.context, this.dryRun);
|
|
210
|
-
}
|
|
211
|
-
catch (err) {
|
|
212
|
-
if (err instanceof Error) {
|
|
213
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to enable step function logs for ${stepFunctionArn} when logLevel is not ALL or includeExecutionData is not true\n`);
|
|
214
|
-
}
|
|
215
|
-
return 1;
|
|
216
|
-
}
|
|
217
|
-
hasChanges = true;
|
|
218
|
-
}
|
|
219
|
-
try {
|
|
220
|
-
yield (0, awsCommands_1.putSubscriptionFilter)(cloudWatchLogsClient, this.forwarderArn, subscriptionFilterName, logGroupName, stepFunctionArn, this.context, this.dryRun);
|
|
221
|
-
}
|
|
222
|
-
catch (err) {
|
|
223
|
-
if (err instanceof Error) {
|
|
224
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to put subscription filter ${subscriptionFilterName} for ${stepFunctionArn}\n`);
|
|
225
|
-
}
|
|
226
|
-
return 1;
|
|
227
|
-
}
|
|
228
|
-
hasChanges = true;
|
|
229
|
-
}
|
|
230
|
-
if (this.mergeStepFunctionAndLambdaTraces || this.propagateUpstreamTrace) {
|
|
231
|
-
// Not putting the update operation into the business logic of logs subscription. This will
|
|
232
|
-
// add additional API call, but it would also allow easier testing and cleaner code.
|
|
233
|
-
yield (0, helpers_1.injectContextIntoTasks)(describeStateMachineCommandOutput, stepFunctionsClient, this.context, this.dryRun);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if (!hasChanges) {
|
|
237
|
-
this.context.stdout.write(`\nNo change is applied.\n `);
|
|
238
|
-
}
|
|
239
|
-
return 0;
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
exports.InstrumentStepFunctionsCommand = InstrumentStepFunctionsCommand;
|
|
244
|
-
InstrumentStepFunctionsCommand.paths = [['stepfunctions', 'instrument']];
|
|
245
|
-
InstrumentStepFunctionsCommand.usage = clipanion_1.Command.Usage({
|
|
246
|
-
category: 'Serverless',
|
|
247
|
-
description: 'Subscribe Step Function log groups to a Datadog Forwarder.',
|
|
248
|
-
details: '--step-function expects a Step Function ARN\n--forwarder expects a Lambda ARN',
|
|
249
|
-
examples: [
|
|
250
|
-
[
|
|
251
|
-
'View and apply changes to subscribe a Step Function Log Group to a Datadog Forwarder',
|
|
252
|
-
'datadog-ci stepfunctions instrument --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction --forwarder arn:aws:lambda:us-east-1:000000000000:function:ExampleDatadogForwarder --env dev --service example-service',
|
|
253
|
-
],
|
|
254
|
-
[
|
|
255
|
-
'View changes to subscribe a Step Function Log Group to a Datadog Forwarder',
|
|
256
|
-
'datadog-ci stepfunctions instrument --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction --forwarder arn:aws:lambda:us-east-1:000000000000:function:ExampleDatadogForwarder --env dev --service example-service --dry-run',
|
|
257
|
-
],
|
|
258
|
-
[
|
|
259
|
-
'View and apply changes to subscribe multiple Step Function Log Groups to a Datadog Forwarder',
|
|
260
|
-
'datadog-ci stepfunctions instrument --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction1 --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction2 --forwarder arn:aws:lambda:us-east-1:000000000000:function:ExampleDatadogForwarder --env dev --service example-service',
|
|
261
|
-
],
|
|
262
|
-
],
|
|
263
|
-
});
|
|
264
|
-
//# sourceMappingURL=instrument.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../../src/commands/stepfunctions/instrument.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4EAAoE;AACpE,oDAA6C;AAC7C,oDAA6C;AAC7C,yCAAyC;AAEzC,+CAAuE;AACvE,2CAA2C;AAC3C,6CAA6C;AAC7C,mDAA6C;AAE7C,+CASsB;AACtB,2CAA8D;AAC9D,uCAQkB;AAElB,MAAM,UAAU,GAAG,iBAAO,CAAA;AAE1B,MAAa,8BAA+B,SAAQ,mBAAO;IAA3D;;;QAuBU,WAAM,GAAG,kBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;QAC9C,gBAAW,GAAG,kBAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;QACvC,iBAAY,GAAG,kBAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;QAC3C,YAAO,GAAG,kBAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;QACpC,qBAAgB,GAAG,kBAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;QACrD,qCAAgC,GAAG,kBAAM,CAAC,OAAO,CACvD,oEAAoE,EACpE,KAAK,CACN,CAAA;QACO,2BAAsB,GAAG,kBAAM,CAAC,OAAO,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAA;QAE5E,SAAI,GAAG,kBAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,oBAAe,GAAG,kBAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;QAC9D,WAAM,GAAG;YACf,IAAI,EAAE,MAAA,IAAA,eAAS,EAAC,OAAO,CAAC,GAAG,CAAC,wBAAY,CAAC,CAAC,mCAAI,KAAK;YACnD,eAAe,EAAE,MAAA,IAAA,eAAS,EAAC,OAAO,CAAC,GAAG,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BAC3F,oFAAoF;oBACpF,MAAM,IAAA,gCAAsB,EAAC,iCAAiC,EAAE,mBAAmB,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;iBAChH;aACF;YACD,IAAI,CAAC,UAAU,EAAE;gBACf,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAA;aACxD;YAED,OAAO,CAAC,CAAA;;KACT;;AAvVH,wEAwVC;AAvVe,oCAAK,GAAG,CAAC,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,AAApC,CAAoC;AAEzC,oCAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,4DAA4D;IACzE,OAAO,EAAE,+EAA+E;IACxF,QAAQ,EAAE;QACR;YACE,sFAAsF;YACtF,mPAAmP;SACpP;QACD;YACE,4EAA4E;YAC5E,6PAA6P;SAC9P;QACD;YACE,8FAA8F;YAC9F,4UAA4U;SAC7U;KACF;CACF,CAAC,AAlBiB,CAkBjB"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare class UninstrumentStepFunctionsCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
private dryRun;
|
|
6
|
-
private stepFunctionArns;
|
|
7
|
-
private environment;
|
|
8
|
-
private forwarderArn;
|
|
9
|
-
private service;
|
|
10
|
-
private mergeStepFunctionAndLambdaTraces;
|
|
11
|
-
private fips;
|
|
12
|
-
private fipsIgnoreError;
|
|
13
|
-
private config;
|
|
14
|
-
execute(): Promise<0 | 1>;
|
|
15
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
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.UninstrumentStepFunctionsCommand = void 0;
|
|
13
|
-
const client_cloudwatch_logs_1 = require("@aws-sdk/client-cloudwatch-logs");
|
|
14
|
-
const client_sfn_1 = require("@aws-sdk/client-sfn");
|
|
15
|
-
const clipanion_1 = require("clipanion");
|
|
16
|
-
const constants_1 = require("../../constants");
|
|
17
|
-
const env_1 = require("../../helpers/env");
|
|
18
|
-
const fips_1 = require("../../helpers/fips");
|
|
19
|
-
const awsCommands_1 = require("./awsCommands");
|
|
20
|
-
const constants_2 = require("./constants");
|
|
21
|
-
const helpers_1 = require("./helpers");
|
|
22
|
-
class UninstrumentStepFunctionsCommand extends clipanion_1.Command {
|
|
23
|
-
constructor() {
|
|
24
|
-
var _a, _b;
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.dryRun = clipanion_1.Option.Boolean('-d,--dry-run', false);
|
|
27
|
-
this.stepFunctionArns = clipanion_1.Option.Array('-s,--step-function');
|
|
28
|
-
// The options below are to match what InstrumentStepFunctionsCommand has so that customers can switch from instrument to uninstrument.
|
|
29
|
-
// Lambda command adopts the same approach as well.
|
|
30
|
-
this.environment = clipanion_1.Option.String('-e,--env', { hidden: true });
|
|
31
|
-
this.forwarderArn = clipanion_1.Option.String('--forwarder', { hidden: true });
|
|
32
|
-
this.service = clipanion_1.Option.String('--service', { hidden: true });
|
|
33
|
-
this.mergeStepFunctionAndLambdaTraces = clipanion_1.Option.Boolean('-mlt,--merge-lambda-traces,--merge-step-function-and-lambda-traces', false, { hidden: true });
|
|
34
|
-
this.fips = clipanion_1.Option.Boolean('--fips', false);
|
|
35
|
-
this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
|
|
36
|
-
this.config = {
|
|
37
|
-
fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
|
|
38
|
-
fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
execute() {
|
|
42
|
-
var _a, _b;
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
(0, fips_1.enableFips)(this.fips || this.config.fips, this.fipsIgnoreError || this.config.fipsIgnoreError);
|
|
45
|
-
let validationError = false;
|
|
46
|
-
let hasChanges = false;
|
|
47
|
-
// remove duplicate step function arns
|
|
48
|
-
const stepFunctionArns = [...new Set(this.stepFunctionArns)];
|
|
49
|
-
if (stepFunctionArns.length === 0) {
|
|
50
|
-
this.context.stdout.write(`[Error] must specify at least one \`--step-function\`\n`);
|
|
51
|
-
validationError = true;
|
|
52
|
-
}
|
|
53
|
-
for (const stepFunctionArn of stepFunctionArns) {
|
|
54
|
-
if (!(0, helpers_1.isValidArn)(stepFunctionArn)) {
|
|
55
|
-
this.context.stdout.write(`[Error] invalid arn format for \`--step-function\` ${stepFunctionArn}\n`);
|
|
56
|
-
validationError = true;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
if (validationError) {
|
|
60
|
-
return 1;
|
|
61
|
-
}
|
|
62
|
-
// loop over step functions passed as parameters and generate a list of requests to make to AWS for each step function
|
|
63
|
-
for (const stepFunctionArn of stepFunctionArns) {
|
|
64
|
-
// use region from the step function arn to make requests to AWS
|
|
65
|
-
const arnObject = (0, helpers_1.parseArn)(stepFunctionArn);
|
|
66
|
-
const region = arnObject.region;
|
|
67
|
-
const cloudWatchLogsClient = new client_cloudwatch_logs_1.CloudWatchLogsClient({ region });
|
|
68
|
-
const stepFunctionsClient = new client_sfn_1.SFNClient({ region });
|
|
69
|
-
let describeStateMachineCommandOutput;
|
|
70
|
-
try {
|
|
71
|
-
describeStateMachineCommandOutput = yield (0, awsCommands_1.describeStateMachine)(stepFunctionsClient, stepFunctionArn);
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
if (err instanceof Error) {
|
|
75
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Unable to fetch Step Function ${stepFunctionArn}\n`);
|
|
76
|
-
}
|
|
77
|
-
return 1;
|
|
78
|
-
}
|
|
79
|
-
const logGroupArn = (0, helpers_1.getStepFunctionLogGroupArn)(describeStateMachineCommandOutput);
|
|
80
|
-
if (logGroupArn === undefined) {
|
|
81
|
-
this.context.stdout.write('\n[Error] Unable to get Log Group arn from Step Function logging configuration\n');
|
|
82
|
-
return 1;
|
|
83
|
-
}
|
|
84
|
-
const logGroupName = (0, helpers_1.parseArn)(logGroupArn).resourceName;
|
|
85
|
-
// delete subscription filters that are created by datadog-ci
|
|
86
|
-
let describeSubscriptionFiltersResponse;
|
|
87
|
-
try {
|
|
88
|
-
describeSubscriptionFiltersResponse = yield (0, awsCommands_1.describeSubscriptionFilters)(cloudWatchLogsClient, logGroupName);
|
|
89
|
-
}
|
|
90
|
-
catch (err) {
|
|
91
|
-
if (err instanceof Error) {
|
|
92
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Unable to fetch Subscription Filter to delete for Log Group ${logGroupName}\n`);
|
|
93
|
-
}
|
|
94
|
-
return 1;
|
|
95
|
-
}
|
|
96
|
-
const subscriptionFilters = (_b = (_a = describeSubscriptionFiltersResponse.subscriptionFilters) === null || _a === void 0 ? void 0 : _a.filter((subscriptionFilter) => { var _a; return (_a = subscriptionFilter.filterName) === null || _a === void 0 ? void 0 : _a.includes(constants_2.DD_CI_IDENTIFYING_STRING); })) !== null && _b !== void 0 ? _b : [];
|
|
97
|
-
for (const subscriptionFilter of subscriptionFilters) {
|
|
98
|
-
if (typeof subscriptionFilter.filterName === 'string') {
|
|
99
|
-
try {
|
|
100
|
-
yield (0, awsCommands_1.deleteSubscriptionFilter)(cloudWatchLogsClient, subscriptionFilter.filterName, logGroupName, stepFunctionArn, this.context, this.dryRun);
|
|
101
|
-
}
|
|
102
|
-
catch (err) {
|
|
103
|
-
if (err instanceof Error) {
|
|
104
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to delete subscription filter ${subscriptionFilter.filterName}\n`);
|
|
105
|
-
}
|
|
106
|
-
return 1;
|
|
107
|
-
}
|
|
108
|
-
hasChanges = true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
const tagKeysToRemove = [constants_2.TAG_VERSION_NAME];
|
|
112
|
-
// Untag resource command is idempotent, no need to verify if the tag exist by making an additional api call to get tags
|
|
113
|
-
try {
|
|
114
|
-
yield (0, awsCommands_1.untagResource)(stepFunctionsClient, tagKeysToRemove, stepFunctionArn, this.context, this.dryRun);
|
|
115
|
-
}
|
|
116
|
-
catch (err) {
|
|
117
|
-
if (err instanceof Error) {
|
|
118
|
-
this.context.stdout.write(`\n[Error] ${err.message}. Failed to untag resource for ${stepFunctionArn}\n`);
|
|
119
|
-
}
|
|
120
|
-
return 1;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (!hasChanges) {
|
|
124
|
-
this.context.stdout.write(`\nNo change is applied.\n`);
|
|
125
|
-
}
|
|
126
|
-
return 0;
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
exports.UninstrumentStepFunctionsCommand = UninstrumentStepFunctionsCommand;
|
|
131
|
-
UninstrumentStepFunctionsCommand.paths = [['stepfunctions', 'uninstrument']];
|
|
132
|
-
UninstrumentStepFunctionsCommand.usage = clipanion_1.Command.Usage({
|
|
133
|
-
category: 'Serverless',
|
|
134
|
-
description: 'Remove Step Function log groups subscription filter created by datadog-ci.',
|
|
135
|
-
details: '--stepfunction expects a Step Function ARN',
|
|
136
|
-
examples: [
|
|
137
|
-
[
|
|
138
|
-
'View and apply changes to remove Step Functions log groups subscription filters created by datadog-ci',
|
|
139
|
-
'datadog-ci stepfunctions uninstrument --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction',
|
|
140
|
-
],
|
|
141
|
-
[
|
|
142
|
-
'View changes to remove Step Functions log groups subscription filters created by datadog-ci',
|
|
143
|
-
'datadog-ci stepfunctions uninstrument --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction --dry-run',
|
|
144
|
-
],
|
|
145
|
-
[
|
|
146
|
-
'View and apply changes to remove Step Functions log groups subscription filters created by datadog-ci',
|
|
147
|
-
'datadog-ci stepfunctions uninstrument --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction1 --step-function arn:aws:states:us-east-1:000000000000:stateMachine:ExampleStepFunction2',
|
|
148
|
-
],
|
|
149
|
-
],
|
|
150
|
-
});
|
|
151
|
-
//# sourceMappingURL=uninstrument.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uninstrument.js","sourceRoot":"","sources":["../../../src/commands/stepfunctions/uninstrument.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4EAA8G;AAC9G,oDAA6C;AAC7C,yCAAyC;AAEzC,+CAAuE;AACvE,2CAA2C;AAC3C,6CAA6C;AAE7C,+CAAwH;AACxH,2CAAsE;AACtE,uCAA0E;AAE1E,MAAa,gCAAiC,SAAQ,mBAAO;IAA7D;;;QAuBU,WAAM,GAAG,kBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,CAAC,CAAA;QAC9C,qBAAgB,GAAG,kBAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;QAE7D,uIAAuI;QACvI,mDAAmD;QAC3C,gBAAW,GAAG,kBAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAC,MA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wHAAwH;gBACxH,IAAI;oBACF,MAAM,IAAA,2BAAa,EAAC,mBAAmB,EAAE,eAAe,EAAE,eAAe,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;iBACtG;gBAAC,OAAO,GAAG,EAAE;oBACZ,IAAI,GAAG,YAAY,KAAK,EAAE;wBACxB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,GAAG,CAAC,OAAO,kCAAkC,eAAe,IAAI,CAAC,CAAA;qBACzG;oBAED,OAAO,CAAC,CAAA;iBACT;aACF;YAED,IAAI,CAAC,UAAU,EAAE;gBACf,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAA;aACvD;YAED,OAAO,CAAC,CAAA;;KACT;;AA7JH,4EA8JC;AA7Je,sCAAK,GAAG,CAAC,CAAC,eAAe,EAAE,cAAc,CAAC,CAAC,AAAtC,CAAsC;AAE3C,sCAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,4EAA4E;IACzF,OAAO,EAAE,4CAA4C;IACrD,QAAQ,EAAE;QACR;YACE,uGAAuG;YACvG,8HAA8H;SAC/H;QACD;YACE,6FAA6F;YAC7F,wIAAwI;SACzI;QACD;YACE,uGAAuG;YACvG,uNAAuN;SACxN;KACF;CACF,CAAC,AAlBiB,CAkBjB"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { AxiosError, AxiosPromise, AxiosRequestConfig } from 'axios';
|
|
3
|
-
import { APIConfiguration, APIHelperConfig, Batch, LocalTestDefinition, MobileAppUploadResult, MobileApplicationNewVersionParams, MobileApplicationUploadPart, MobileApplicationUploadPartResponse, MultipartPresignedUrlsResponse, Payload, PollResult, ServerTest, SyntheticsOrgSettings, TestSearchResult, ServerTrigger } from './interfaces';
|
|
4
|
-
interface BackendError {
|
|
5
|
-
errors: string[];
|
|
6
|
-
}
|
|
7
|
-
export declare class EndpointError extends Error {
|
|
8
|
-
message: string;
|
|
9
|
-
status: number;
|
|
10
|
-
constructor(message: string, status: number);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Extracts the public IDs from an error message like `Cannot write tests or results (test ids: ['aaa-aaa-aaa', 'bbb-bbb-bbb'])`.
|
|
14
|
-
*/
|
|
15
|
-
export declare const extractUnauthorizedTestPublicIds: (requestError: AxiosError<BackendError>) => Set<string> | undefined;
|
|
16
|
-
export declare const formatBackendErrors: (requestError: AxiosError<BackendError>, scopeName?: string) => string;
|
|
17
|
-
export declare const completeMultipartMobileApplicationUpload: (request: (args: AxiosRequestConfig) => AxiosPromise<{
|
|
18
|
-
job_id: string;
|
|
19
|
-
}>) => (applicationId: string, uploadId: string, key: string, uploadPartResponses: MobileApplicationUploadPartResponse[], newVersionParams?: MobileApplicationNewVersionParams) => Promise<string>;
|
|
20
|
-
export declare const pollMobileApplicationUploadResponse: (request: (args: AxiosRequestConfig) => AxiosPromise<MobileAppUploadResult>) => (jobId: string) => Promise<MobileAppUploadResult>;
|
|
21
|
-
export type RetryPolicy = {
|
|
22
|
-
retryOn404?: boolean | undefined;
|
|
23
|
-
retryOn429?: boolean | undefined;
|
|
24
|
-
};
|
|
25
|
-
export declare const determineRetryDelay: (retries: number, error: Error, retryPolicy?: RetryPolicy) => number | undefined;
|
|
26
|
-
export declare const getErrorHttpStatus: (error: Error) => number | undefined;
|
|
27
|
-
export declare const isForbiddenError: (error: Error) => boolean;
|
|
28
|
-
export declare const isNotFoundError: (error: Error) => boolean;
|
|
29
|
-
export declare const isTooManyRequestsError: (error: Error) => boolean;
|
|
30
|
-
export declare const isNodeError: (error: unknown) => error is NodeJS.ErrnoException;
|
|
31
|
-
export declare const is5xxError: (error: Error) => boolean;
|
|
32
|
-
export declare const apiConstructor: (configuration: APIConfiguration) => {
|
|
33
|
-
getBatch: (batchId: string) => Promise<Batch>;
|
|
34
|
-
getMobileApplicationPresignedURLs: (applicationId: string, appSize: number, parts: MobileApplicationUploadPart[]) => Promise<MultipartPresignedUrlsResponse>;
|
|
35
|
-
getTest: (testId: string, testType?: string) => Promise<ServerTest>;
|
|
36
|
-
getTestVersion: (testId: string, version: number) => Promise<void>;
|
|
37
|
-
getLocalTestDefinition: (testId: string, testType?: string) => Promise<LocalTestDefinition>;
|
|
38
|
-
editTest: (testId: string, data: ServerTest) => Promise<void>;
|
|
39
|
-
getSyntheticsOrgSettings: () => Promise<SyntheticsOrgSettings>;
|
|
40
|
-
getTunnelPresignedURL: (testIds: string[]) => Promise<{
|
|
41
|
-
url: string;
|
|
42
|
-
}>;
|
|
43
|
-
pollResults: (resultIds: string[]) => Promise<PollResult[]>;
|
|
44
|
-
searchTests: (query: string) => Promise<TestSearchResult>;
|
|
45
|
-
triggerTests: (data: Payload) => Promise<ServerTrigger>;
|
|
46
|
-
uploadMobileApplicationPart: (parts: MobileApplicationUploadPart[], multipartPresignedUrlsParams: MultipartPresignedUrlsResponse['multipart_presigned_urls_params']) => Promise<MobileApplicationUploadPartResponse[]>;
|
|
47
|
-
completeMultipartMobileApplicationUpload: (applicationId: string, uploadId: string, key: string, uploadPartResponses: MobileApplicationUploadPartResponse[], newVersionParams?: MobileApplicationNewVersionParams) => Promise<string>;
|
|
48
|
-
pollMobileApplicationUploadResponse: (jobId: string) => Promise<MobileAppUploadResult>;
|
|
49
|
-
};
|
|
50
|
-
export type APIHelper = ReturnType<typeof apiConstructor>;
|
|
51
|
-
export declare const getApiHelper: (config: APIHelperConfig) => APIHelper;
|
|
52
|
-
export {};
|