@sentry/wizard 3.42.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.node-cache/node-v22.14.0-darwin-arm64 +0 -0
- package/.node-cache/node-v22.14.0-darwin-x64 +0 -0
- package/.node-cache/node-v22.14.0-linux-arm64 +0 -0
- package/.node-cache/node-v22.14.0-linux-x64 +0 -0
- package/.node-cache/node-v22.14.0-win-x64.exe +0 -0
- package/CHANGELOG.md +30 -0
- package/COPYING +3575 -0
- package/bin.ts +85 -80
- package/dist/bin.js +44 -35
- package/dist/bin.js.map +1 -1
- package/dist/e2e-tests/jest.config.js +1 -1
- package/dist/e2e-tests/jest.config.js.map +1 -1
- package/dist/e2e-tests/tests/flutter.test.js +62 -147
- package/dist/e2e-tests/tests/flutter.test.js.map +1 -1
- package/dist/e2e-tests/tests/nextjs.test.js +77 -175
- package/dist/e2e-tests/tests/nextjs.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-3.test.js +61 -162
- package/dist/e2e-tests/tests/nuxt-3.test.js.map +1 -1
- package/dist/e2e-tests/tests/nuxt-4.test.js +62 -163
- package/dist/e2e-tests/tests/nuxt-4.test.js.map +1 -1
- package/dist/e2e-tests/tests/remix.test.js +147 -189
- package/dist/e2e-tests/tests/remix.test.js.map +1 -1
- package/dist/e2e-tests/tests/sveltekit.test.js +133 -187
- package/dist/e2e-tests/tests/sveltekit.test.js.map +1 -1
- package/dist/e2e-tests/utils/index.d.ts +1 -1
- package/dist/e2e-tests/utils/index.js +113 -195
- package/dist/e2e-tests/utils/index.js.map +1 -1
- package/dist/lib/Constants.js +5 -5
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.d.ts +1 -1
- package/dist/lib/Helper/BottomBar.js +14 -15
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/Env.js +5 -2
- package/dist/lib/Helper/Env.js.map +1 -1
- package/dist/lib/Helper/File.js +14 -27
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Git.js +24 -59
- package/dist/lib/Helper/Git.js.map +1 -1
- package/dist/lib/Helper/Logging.js +2 -2
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/MergeConfig.js +4 -4
- package/dist/lib/Helper/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/Package.d.ts +4 -1
- package/dist/lib/Helper/Package.js +12 -38
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/SentryCli.js +77 -149
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.js +29 -124
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +4 -4
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +24 -24
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js +33 -23
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +23 -85
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.js +8 -8
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +80 -125
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.js +6 -66
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.js +16 -104
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.js +24 -118
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.js +95 -183
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.js +87 -145
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +40 -148
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.js +63 -126
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.js +110 -206
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.js +19 -79
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +57 -148
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +6 -66
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.js +43 -120
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.js +17 -76
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/__tests__/Env.js +3 -3
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/src/android/android-wizard.js +100 -176
- package/dist/src/android/android-wizard.js.map +1 -1
- package/dist/src/android/code-tools.js +24 -33
- package/dist/src/android/code-tools.js.map +1 -1
- package/dist/src/android/gradle.js +106 -165
- package/dist/src/android/gradle.js.map +1 -1
- package/dist/src/android/manifest.js +26 -27
- package/dist/src/android/manifest.js.map +1 -1
- package/dist/src/android/templates.js +76 -23
- package/dist/src/android/templates.js.map +1 -1
- package/dist/src/apple/apple-wizard.js +129 -225
- package/dist/src/apple/apple-wizard.js.map +1 -1
- package/dist/src/apple/cocoapod.js +47 -109
- package/dist/src/apple/cocoapod.js.map +1 -1
- package/dist/src/apple/code-tools.js +32 -35
- package/dist/src/apple/code-tools.js.map +1 -1
- package/dist/src/apple/fastlane.js +51 -97
- package/dist/src/apple/fastlane.js.map +1 -1
- package/dist/src/apple/templates.js +41 -5
- package/dist/src/apple/templates.js.map +1 -1
- package/dist/src/apple/xcode-manager.d.ts +2 -2
- package/dist/src/apple/xcode-manager.js +93 -108
- package/dist/src/apple/xcode-manager.js.map +1 -1
- package/dist/src/flutter/code-tools.js +79 -127
- package/dist/src/flutter/code-tools.js.map +1 -1
- package/dist/src/flutter/flutter-wizard.js +75 -136
- package/dist/src/flutter/flutter-wizard.js.map +1 -1
- package/dist/src/flutter/templates.js +48 -12
- package/dist/src/flutter/templates.js.map +1 -1
- package/dist/src/nextjs/nextjs-wizard.js +527 -805
- package/dist/src/nextjs/nextjs-wizard.js.map +1 -1
- package/dist/src/nextjs/templates.js +380 -40
- package/dist/src/nextjs/templates.js.map +1 -1
- package/dist/src/nextjs/utils.js +5 -5
- package/dist/src/nextjs/utils.js.map +1 -1
- package/dist/src/nuxt/nuxt-wizard.js +91 -188
- package/dist/src/nuxt/nuxt-wizard.js.map +1 -1
- package/dist/src/nuxt/sdk-example.js +68 -137
- package/dist/src/nuxt/sdk-example.js.map +1 -1
- package/dist/src/nuxt/sdk-setup.d.ts +4 -4
- package/dist/src/nuxt/sdk-setup.js +180 -336
- package/dist/src/nuxt/sdk-setup.js.map +1 -1
- package/dist/src/nuxt/templates.js +195 -18
- package/dist/src/nuxt/templates.js.map +1 -1
- package/dist/src/nuxt/utils.js +29 -76
- package/dist/src/nuxt/utils.js.map +1 -1
- package/dist/src/react-native/expo-env-file.js +41 -94
- package/dist/src/react-native/expo-env-file.js.map +1 -1
- package/dist/src/react-native/expo-metro.d.ts +1 -1
- package/dist/src/react-native/expo-metro.js +75 -130
- package/dist/src/react-native/expo-metro.js.map +1 -1
- package/dist/src/react-native/expo.js +61 -114
- package/dist/src/react-native/expo.js.map +1 -1
- package/dist/src/react-native/git.js +23 -56
- package/dist/src/react-native/git.js.map +1 -1
- package/dist/src/react-native/glob.js +3 -3
- package/dist/src/react-native/glob.js.map +1 -1
- package/dist/src/react-native/gradle.js +4 -4
- package/dist/src/react-native/gradle.js.map +1 -1
- package/dist/src/react-native/javascript.js +51 -95
- package/dist/src/react-native/javascript.js.map +1 -1
- package/dist/src/react-native/metro.js +176 -296
- package/dist/src/react-native/metro.js.map +1 -1
- package/dist/src/react-native/react-native-wizard.js +267 -418
- package/dist/src/react-native/react-native-wizard.js.map +1 -1
- package/dist/src/react-native/uninstall.js +37 -80
- package/dist/src/react-native/uninstall.js.map +1 -1
- package/dist/src/react-native/xcode.js +57 -55
- package/dist/src/react-native/xcode.js.map +1 -1
- package/dist/src/remix/codemods/express-server.js +27 -82
- package/dist/src/remix/codemods/express-server.js.map +1 -1
- package/dist/src/remix/codemods/handle-error.js +28 -31
- package/dist/src/remix/codemods/handle-error.js.map +1 -1
- package/dist/src/remix/codemods/root-common.js +11 -11
- package/dist/src/remix/codemods/root-common.js.map +1 -1
- package/dist/src/remix/codemods/root-v1.js +17 -67
- package/dist/src/remix/codemods/root-v1.js.map +1 -1
- package/dist/src/remix/codemods/root-v2.js +89 -140
- package/dist/src/remix/codemods/root-v2.js.map +1 -1
- package/dist/src/remix/remix-wizard.js +181 -343
- package/dist/src/remix/remix-wizard.js.map +1 -1
- package/dist/src/remix/sdk-example.js +84 -66
- package/dist/src/remix/sdk-example.js.map +1 -1
- package/dist/src/remix/sdk-setup.js +161 -293
- package/dist/src/remix/sdk-setup.js.map +1 -1
- package/dist/src/remix/templates.js +10 -2
- package/dist/src/remix/templates.js.map +1 -1
- package/dist/src/remix/utils.js +13 -14
- package/dist/src/remix/utils.js.map +1 -1
- package/dist/src/run.js +106 -178
- package/dist/src/run.js.map +1 -1
- package/dist/src/sourcemaps/sourcemaps-wizard.js +248 -372
- package/dist/src/sourcemaps/sourcemaps-wizard.js.map +1 -1
- package/dist/src/sourcemaps/tools/angular.js +32 -66
- package/dist/src/sourcemaps/tools/angular.js.map +1 -1
- package/dist/src/sourcemaps/tools/create-react-app.js +14 -59
- package/dist/src/sourcemaps/tools/create-react-app.js.map +1 -1
- package/dist/src/sourcemaps/tools/esbuild.js +34 -77
- package/dist/src/sourcemaps/tools/esbuild.js.map +1 -1
- package/dist/src/sourcemaps/tools/nextjs.d.ts +2 -2
- package/dist/src/sourcemaps/tools/nextjs.js +75 -102
- package/dist/src/sourcemaps/tools/nextjs.js.map +1 -1
- package/dist/src/sourcemaps/tools/remix.js +53 -93
- package/dist/src/sourcemaps/tools/remix.js.map +1 -1
- package/dist/src/sourcemaps/tools/rollup.js +35 -76
- package/dist/src/sourcemaps/tools/rollup.js.map +1 -1
- package/dist/src/sourcemaps/tools/sentry-cli.js +157 -289
- package/dist/src/sourcemaps/tools/sentry-cli.js.map +1 -1
- package/dist/src/sourcemaps/tools/tsc.js +68 -134
- package/dist/src/sourcemaps/tools/tsc.js.map +1 -1
- package/dist/src/sourcemaps/tools/vite.js +111 -196
- package/dist/src/sourcemaps/tools/vite.js.map +1 -1
- package/dist/src/sourcemaps/tools/webpack.d.ts +1 -1
- package/dist/src/sourcemaps/tools/webpack.js +158 -260
- package/dist/src/sourcemaps/tools/webpack.js.map +1 -1
- package/dist/src/sourcemaps/utils/detect-tool.js +9 -54
- package/dist/src/sourcemaps/utils/detect-tool.js.map +1 -1
- package/dist/src/sourcemaps/utils/other-wizards.js +77 -144
- package/dist/src/sourcemaps/utils/other-wizards.js.map +1 -1
- package/dist/src/sourcemaps/utils/sdk-version.js +112 -191
- package/dist/src/sourcemaps/utils/sdk-version.js.map +1 -1
- package/dist/src/sveltekit/sdk-example.js +20 -70
- package/dist/src/sveltekit/sdk-example.js.map +1 -1
- package/dist/src/sveltekit/sdk-setup.js +250 -411
- package/dist/src/sveltekit/sdk-setup.js.map +1 -1
- package/dist/src/sveltekit/sveltekit-wizard.js +107 -191
- package/dist/src/sveltekit/sveltekit-wizard.js.map +1 -1
- package/dist/src/sveltekit/templates.js +147 -13
- package/dist/src/sveltekit/templates.js.map +1 -1
- package/dist/src/sveltekit/utils.js +3 -3
- package/dist/src/sveltekit/utils.js.map +1 -1
- package/dist/src/telemetry.d.ts +2 -2
- package/dist/src/telemetry.js +58 -108
- package/dist/src/telemetry.js.map +1 -1
- package/dist/src/utils/ast-utils.js +39 -54
- package/dist/src/utils/ast-utils.js.map +1 -1
- package/dist/src/utils/bash.js +28 -75
- package/dist/src/utils/bash.js.map +1 -1
- package/dist/src/utils/clack-utils.d.ts +3 -7
- package/dist/src/utils/clack-utils.js +688 -1083
- package/dist/src/utils/clack-utils.js.map +1 -1
- package/dist/src/utils/debug.js +6 -10
- package/dist/src/utils/debug.js.map +1 -1
- package/dist/src/utils/package-json.js +5 -6
- package/dist/src/utils/package-json.js.map +1 -1
- package/dist/src/utils/package-manager.js +65 -139
- package/dist/src/utils/package-manager.js.map +1 -1
- package/dist/src/utils/release-registry.js +12 -59
- package/dist/src/utils/release-registry.js.map +1 -1
- package/dist/src/utils/semver.js +3 -4
- package/dist/src/utils/semver.js.map +1 -1
- package/dist/src/utils/sentrycli-utils.js +4 -4
- package/dist/src/utils/sentrycli-utils.js.map +1 -1
- package/dist/src/utils/url.js +5 -6
- package/dist/src/utils/url.js.map +1 -1
- package/dist/test/android/code-tools.test.js +18 -18
- package/dist/test/android/code-tools.test.js.map +1 -1
- package/dist/test/apple/cocoapod.test.js +154 -299
- package/dist/test/apple/cocoapod.test.js.map +1 -1
- package/dist/test/apple/code-tools.test.js +375 -263
- package/dist/test/apple/code-tools.test.js.map +1 -1
- package/dist/test/apple/fastfile.test.js +319 -271
- package/dist/test/apple/fastfile.test.js.map +1 -1
- package/dist/test/apple/templates.test.js +114 -30
- package/dist/test/apple/templates.test.js.map +1 -1
- package/dist/test/apple/xcode-manager.test.js +230 -234
- package/dist/test/apple/xcode-manager.test.js.map +1 -1
- package/dist/test/flutter/code-tools.test.js +119 -48
- package/dist/test/flutter/code-tools.test.js.map +1 -1
- package/dist/test/flutter/templates.test.js +63 -20
- package/dist/test/flutter/templates.test.js.map +1 -1
- package/dist/test/nextjs/templates.test.js +332 -43
- package/dist/test/nextjs/templates.test.js.map +1 -1
- package/dist/test/nuxt/templates.test.js +161 -33
- package/dist/test/nuxt/templates.test.js.map +1 -1
- package/dist/test/react-native/expo-metro.test.js +61 -15
- package/dist/test/react-native/expo-metro.test.js.map +1 -1
- package/dist/test/react-native/expo.test.js +37 -17
- package/dist/test/react-native/expo.test.js.map +1 -1
- package/dist/test/react-native/gradle.test.js +260 -28
- package/dist/test/react-native/gradle.test.js.map +1 -1
- package/dist/test/react-native/javascript.test.js +85 -19
- package/dist/test/react-native/javascript.test.js.map +1 -1
- package/dist/test/react-native/metro.test.js +261 -187
- package/dist/test/react-native/metro.test.js.map +1 -1
- package/dist/test/react-native/xcode.test.js +243 -62
- package/dist/test/react-native/xcode.test.js.map +1 -1
- package/dist/test/remix/client-entry.test.js +81 -21
- package/dist/test/remix/client-entry.test.js.map +1 -1
- package/dist/test/remix/server-instrumentation.test.js +21 -8
- package/dist/test/remix/server-instrumentation.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/sentry-cli.test.js +20 -72
- package/dist/test/sourcemaps/tools/sentry-cli.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/tsc.test.js +142 -68
- package/dist/test/sourcemaps/tools/tsc.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/vite.test.js +106 -75
- package/dist/test/sourcemaps/tools/vite.test.js.map +1 -1
- package/dist/test/sourcemaps/tools/webpack.test.js +226 -102
- package/dist/test/sourcemaps/tools/webpack.test.js.map +1 -1
- package/dist/test/sveltekit/templates.test.js +117 -18
- package/dist/test/sveltekit/templates.test.js.map +1 -1
- package/dist/test/utils/ast-utils.test.js +99 -58
- package/dist/test/utils/ast-utils.test.js.map +1 -1
- package/dist/test/utils/clack-utils.test.js +142 -247
- package/dist/test/utils/clack-utils.test.js.map +1 -1
- package/e2e-tests/package.json +1 -1
- package/e2e-tests/tests/flutter.test.ts +20 -20
- package/e2e-tests/tests/nextjs.test.ts +2 -2
- package/e2e-tests/tests/nuxt-3.test.ts +4 -4
- package/e2e-tests/tests/nuxt-4.test.ts +3 -3
- package/e2e-tests/tests/remix.test.ts +3 -3
- package/e2e-tests/tests/sveltekit.test.ts +3 -3
- package/e2e-tests/utils/index.ts +33 -15
- package/lib/Helper/BottomBar.ts +1 -1
- package/lib/Helper/Env.ts +1 -1
- package/lib/Helper/Package.ts +12 -10
- package/lib/Helper/SentryCli.ts +18 -27
- package/lib/Helper/Wizard.ts +1 -2
- package/lib/Setup.ts +4 -5
- package/lib/Steps/ChooseIntegration.ts +40 -8
- package/lib/Steps/Initial.ts +17 -26
- package/lib/Steps/Integrations/BaseIntegration.ts +2 -8
- package/lib/Steps/Integrations/Cordova.ts +9 -15
- package/lib/Steps/Integrations/Electron.ts +23 -20
- package/lib/Steps/Integrations/MobileProject.ts +18 -15
- package/lib/Steps/OpenSentry.ts +12 -7
- package/lib/Steps/PromptForParameters.ts +12 -19
- package/lib/Steps/SentryProjectSelector.ts +30 -29
- package/lib/Steps/WaitForSentry.ts +29 -23
- package/package.json +12 -8
- package/src/apple/xcode-manager.ts +10 -10
- package/src/nextjs/templates.ts +2 -6
- package/src/nuxt/sdk-setup.ts +21 -18
- package/src/react-native/expo-metro.ts +2 -2
- package/src/react-native/react-native-wizard.ts +1 -2
- package/src/react-native/uninstall.ts +1 -2
- package/src/react-native/xcode.ts +1 -1
- package/src/run.ts +12 -5
- package/src/sourcemaps/tools/nextjs.ts +2 -5
- package/src/sourcemaps/tools/webpack.ts +3 -3
- package/src/telemetry.ts +27 -7
- package/src/utils/clack-utils.ts +50 -47
- package/test/apple/cocoapod.test.ts +4 -0
- package/test/apple/fastfile.test.ts +12 -7
- package/test/apple/xcode-manager.test.ts +13 -11
- package/test/nextjs/templates.test.ts +0 -12
- package/test/utils/clack-utils.test.ts +40 -50
- package/types/read-env.d.ts +3 -0
- package/types/xcode.d.ts +1 -0
- package/dist/package.json +0 -128
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptForParameters.js","sourceRoot":"","sources":["../../../lib/Steps/PromptForParameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,wCAA4B;AAE5B,6CAAwC;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AAE;QACzB,OAAO,KAAK,CAAC;KACd;IAED,IAAI;QACF,IAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjE,IAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAsB,CAAC;QACpE,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE;YAC5D,OAAO,KAAK,CAAC;SACd;KACF;IAAC,WAAM;QACN,OAAO,KAAK,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { dim } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nexport class PromptForParameters extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n this.debug(answers);\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n return {};\n }\n if (this._argv.quiet) {\n return {};\n }\n\n let url = this._getFullUrl(answers);\n const organization: any = await prompt([\n {\n message: 'Organization Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.organization.slug', () => {\n dim('Please copy/paste your organization slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug);\n const project: any = await prompt([\n {\n message: 'Project Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.project.slug', () => {\n dim('Please copy/paste your project slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug, project.slug);\n const dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);\n const dsn = await prompt([\n {\n message: 'DSN:',\n name: 'public',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateDSN,\n when: this._shouldAsk(answers, 'config.dsn.public', () => {\n dim('Please copy/paste your DSN');\n dim(`It can be found here: ${dsnKeyUrl}`);\n }),\n },\n ]);\n\n const auth = await prompt([\n {\n message: 'Auth Token:',\n name: 'token',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateAuthToken,\n when: this._shouldAsk(answers, 'config.auth.token', () => {\n dim('Please copy/paste your auth token');\n dim(`It can be found here: ${this._argv.url}api/`);\n dim(\n 'In case there is none yet, create one with [project:releases] permission',\n );\n }),\n },\n ]);\n\n return {\n config: _.merge(_.get(answers, 'config'), {\n auth,\n dsn,\n project,\n organization,\n }),\n };\n }\n\n private _getFullUrl(\n answers: Answers,\n organizationSlug?: string,\n projectSlug?: string,\n ): string {\n const baseUrl = this._argv.url;\n const orgSlug = _.get(\n answers,\n 'config.organization.slug',\n organizationSlug || 'organization_slug',\n );\n const projSlug = _.get(\n answers,\n 'config.project.slug',\n projectSlug || 'project_slug',\n );\n return `${baseUrl}${orgSlug}/${projSlug}`;\n }\n\n private _getDSNKeyUrl(answers: Answers, projectSlug?: string): string {\n const baseUrl = this._argv.url;\n const projSlug = _.get(\n answers,\n 'config.project.slug',\n projectSlug || 'project_slug',\n );\n return `${baseUrl}settings/projects/${projSlug}/keys`;\n }\n\n private _shouldAsk(\n answers: Answers,\n configKey: string,\n preHook?: () => void,\n ): boolean {\n const shouldAsk = _.get(answers, configKey, null) === null;\n if (shouldAsk && preHook) {\n preHook();\n }\n return shouldAsk;\n }\n\n private _validateAuthToken(input: string): boolean | string {\n const isOrgToken = input.startsWith('sntrys_');\n\n if (isOrgToken) {\n if (!isValidOrgToken(input)) {\n return 'Make sure you correctly copied your auth token. It should start with \"sntrys_\"';\n }\n return true;\n }\n\n if (!input.match(/(sntrys_)?[0-9a-f]{64}/g)) {\n return 'Make sure you copied the correct auth token, it should be 64 hex chars';\n }\n return true;\n }\n\n private _validateSlug(input: string): boolean | string {\n if (input.match(/[A-Z]/g)) {\n return 'Please copy the slug from the url, it should be all lowercase';\n }\n if (input.length === 0) {\n return \"Can't be empty\";\n }\n return true;\n }\n\n private _validateDSN(input: string): boolean | string {\n const match = input.match(\n /^(?:(\\w+):)?\\/\\/(?:(\\w+)(:\\w+)?@)?([\\w.-]+)(?::(\\d+))?(\\/.*)$/,\n );\n if (!match) {\n return 'Invalid DSN format';\n }\n if (match[1] !== 'http' && match[1] !== 'https') {\n return `Unsupported protocol for DSN: ${match[1]}`;\n }\n return true;\n }\n}\n\ntype MaybeOrgAuthToken = {\n iat?: number;\n url?: string;\n org?: string;\n region_url?: string;\n};\n\n/**\n * Trying to parse and decode an org auth token. Based on:\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#parsing-tokens\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#token-facts\n */\nfunction isValidOrgToken(input: string): boolean {\n if (!input.startsWith('sntrys_')) {\n return false;\n }\n\n const tokenParts = input.split('_');\n if (tokenParts.length < 3) {\n return false;\n }\n\n try {\n const payload = tokenParts[1];\n const decodedPayload = Buffer.from(payload, 'base64').toString();\n const jsonPayload = JSON.parse(decodedPayload) as MaybeOrgAuthToken;\n if (!jsonPayload.iat || !jsonPayload.url || !jsonPayload.org) {\n return false;\n }\n } catch {\n return false;\n }\n\n return true;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"PromptForParameters.js","sourceRoot":"","sources":["../../../lib/Steps/PromptForParameters.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC,+CAAwC;AACxC,6CAAyD;AACzD,yCAAsC;AAEtC,MAAa,mBAAoB,SAAQ,mBAAQ;IACxC,KAAK,CAAC,IAAI,CAAC,OAAgB;QAChC,IAAI,CAAC,KAAK,CAAC,OA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CAAC;KACd;IAED,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\n\nimport { dim } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nexport class PromptForParameters extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n this.debug(answers);\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n return {};\n }\n if (this._argv.quiet) {\n return {};\n }\n\n let url = this._getFullUrl(answers);\n const organization: any = await prompt([\n {\n message: 'Organization Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.organization.slug', () => {\n dim('Please copy/paste your organization slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug);\n const project: any = await prompt([\n {\n message: 'Project Slug:',\n name: 'slug',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateSlug,\n when: this._shouldAsk(answers, 'config.project.slug', () => {\n dim('Please copy/paste your project slug');\n dim(`It can be found in the url ${url}`);\n }),\n },\n ]);\n\n url = this._getFullUrl(answers, organization.slug, project.slug);\n const dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);\n const dsn = await prompt([\n {\n message: 'DSN:',\n name: 'public',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateDSN,\n when: this._shouldAsk(answers, 'config.dsn.public', () => {\n dim('Please copy/paste your DSN');\n dim(`It can be found here: ${dsnKeyUrl}`);\n }),\n },\n ]);\n\n const auth = await prompt([\n {\n message: 'Auth Token:',\n name: 'token',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateAuthToken,\n when: this._shouldAsk(answers, 'config.auth.token', () => {\n dim('Please copy/paste your auth token');\n dim(`It can be found here: ${this._argv.url}api/`);\n dim(\n 'In case there is none yet, create one with [project:releases] permission',\n );\n }),\n },\n ]);\n\n return {\n config: {\n ...answers.config,\n auth,\n dsn,\n project,\n organization,\n },\n };\n }\n\n private _getFullUrl(\n answers: Answers,\n organizationSlug?: string,\n projectSlug?: string,\n ): string {\n const baseUrl = this._argv.url;\n const orgSlug =\n answers.config?.organization?.slug ??\n organizationSlug ??\n 'organization_slug';\n const projSlug =\n answers.config?.project?.slug ?? projectSlug ?? 'project_slug';\n return `${baseUrl}${orgSlug}/${projSlug}`;\n }\n\n private _getDSNKeyUrl(answers: Answers, projectSlug?: string): string {\n const baseUrl = this._argv.url;\n const projSlug =\n answers.config?.project?.slug ?? projectSlug ?? 'project_slug';\n return `${baseUrl}settings/projects/${projSlug}/keys`;\n }\n\n private _shouldAsk(\n answers: Answers,\n configKey: string,\n preHook?: () => void,\n ): boolean {\n const shouldAsk = answers[configKey] != null;\n if (shouldAsk && preHook) {\n preHook();\n }\n return shouldAsk;\n }\n\n private _validateAuthToken(input: string): boolean | string {\n const isOrgToken = input.startsWith('sntrys_');\n\n if (isOrgToken) {\n if (!isValidOrgToken(input)) {\n return 'Make sure you correctly copied your auth token. It should start with \"sntrys_\"';\n }\n return true;\n }\n\n if (!input.match(/(sntrys_)?[0-9a-f]{64}/g)) {\n return 'Make sure you copied the correct auth token, it should be 64 hex chars';\n }\n return true;\n }\n\n private _validateSlug(input: string): boolean | string {\n if (input.match(/[A-Z]/g)) {\n return 'Please copy the slug from the url, it should be all lowercase';\n }\n if (input.length === 0) {\n return \"Can't be empty\";\n }\n return true;\n }\n\n private _validateDSN(input: string): boolean | string {\n const match = input.match(\n /^(?:(\\w+):)?\\/\\/(?:(\\w+)(:\\w+)?@)?([\\w.-]+)(?::(\\d+))?(\\/.*)$/,\n );\n if (!match) {\n return 'Invalid DSN format';\n }\n if (match[1] !== 'http' && match[1] !== 'https') {\n return `Unsupported protocol for DSN: ${match[1]}`;\n }\n return true;\n }\n}\n\ntype MaybeOrgAuthToken = {\n iat?: number;\n url?: string;\n org?: string;\n region_url?: string;\n};\n\n/**\n * Trying to parse and decode an org auth token. Based on:\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#parsing-tokens\n * - https://github.com/getsentry/rfcs/blob/main/text/0091-ci-upload-tokens.md#token-facts\n */\nfunction isValidOrgToken(input: string): boolean {\n if (!input.startsWith('sntrys_')) {\n return false;\n }\n\n const tokenParts = input.split('_');\n if (tokenParts.length < 3) {\n return false;\n }\n\n try {\n const payload = tokenParts[1];\n const decodedPayload = Buffer.from(payload, 'base64').toString();\n const jsonPayload = JSON.parse(decodedPayload) as MaybeOrgAuthToken;\n if (!jsonPayload.iat || !jsonPayload.url || !jsonPayload.org) {\n return false;\n }\n } catch {\n return false;\n }\n\n return true;\n}\n"]}
|
package/dist/lib/Steps/Result.js
CHANGED
|
@@ -1,85 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
3
|
exports.Result = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
__extends(Result, _super);
|
|
59
|
-
function Result() {
|
|
60
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
61
|
-
}
|
|
4
|
+
const Logging_1 = require("../Helper/Logging");
|
|
5
|
+
const BaseStep_1 = require("./BaseStep");
|
|
6
|
+
class Result extends BaseStep_1.BaseStep {
|
|
62
7
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
return Result;
|
|
83
|
-
}(BaseStep_1.BaseStep));
|
|
8
|
+
async emit(answers) {
|
|
9
|
+
this.debug(answers);
|
|
10
|
+
(0, Logging_1.nl)();
|
|
11
|
+
if (this._argv.uninstall) {
|
|
12
|
+
(0, Logging_1.green)('😢 Successfully removed Sentry from your project 😢');
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
(0, Logging_1.green)('🎉 Successfully set up Sentry for your project 🎉');
|
|
16
|
+
}
|
|
17
|
+
// We need to exit here to stop everything
|
|
18
|
+
setTimeout(() => {
|
|
19
|
+
process.exit();
|
|
20
|
+
}, 100);
|
|
21
|
+
return {};
|
|
22
|
+
}
|
|
23
|
+
}
|
|
84
24
|
exports.Result = Result;
|
|
85
25
|
//# sourceMappingURL=Result.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Result.js","sourceRoot":"","sources":["../../../lib/Steps/Result.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Result.js","sourceRoot":"","sources":["../../../lib/Steps/Result.ts"],"names":[],"mappings":";;;AAEA,+CAA8C;AAC9C,yCAAsC;AAEtC,MAAa,MAAO,SAAQ,mBAAQ;IAClC,4DAA4D;IACrD,KAAK,CAAC,IAAI,CAAC,OAAgB;QAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpB,IAAA,YAAE,GAAE,CAAC;QACL,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;YACxB,IAAA,eAAK,EAAC,sDAAsD,CAAC,CAAC;SAC/D;aAAM;YACL,IAAA,eAAK,EAAC,oDAAoD,CAAC,CAAC;SAC7D;QACD,0CAA0C;QAC1C,UAAU,CAAC,GAAG,EAAE;YACd,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC,EAAE,GAAG,CAAC,CAAC;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AAhBD,wBAgBC","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport { green, nl } from '../Helper/Logging';\nimport { BaseStep } from './BaseStep';\n\nexport class Result extends BaseStep {\n // eslint-disable-next-line @typescript-eslint/require-await\n public async emit(answers: Answers): Promise<Answers> {\n this.debug(answers);\n nl();\n if (this._argv.uninstall) {\n green('😢 Successfully removed Sentry from your project 😢');\n } else {\n green('🎉 Successfully set up Sentry for your project 🎉');\n }\n // We need to exit here to stop everything\n setTimeout(() => {\n process.exit();\n }, 100);\n return {};\n }\n}\n"]}
|
|
@@ -1,156 +1,65 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
-
function step(op) {
|
|
54
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
56
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
-
switch (op[0]) {
|
|
59
|
-
case 0: case 1: t = op; break;
|
|
60
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
-
default:
|
|
64
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
-
if (t[2]) _.ops.pop();
|
|
69
|
-
_.trys.pop(); continue;
|
|
70
|
-
}
|
|
71
|
-
op = body.call(thisArg, _);
|
|
72
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
3
|
exports.SentryProjectSelector = void 0;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
var BaseStep_1 = require("./BaseStep");
|
|
4
|
+
const inquirer_1 = require("inquirer");
|
|
5
|
+
const BaseStep_1 = require("./BaseStep");
|
|
81
6
|
function sleep(n) {
|
|
82
|
-
return new Promise(
|
|
7
|
+
return new Promise((resolve) => setTimeout(resolve, n));
|
|
83
8
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
9
|
+
class SentryProjectSelector extends BaseStep_1.BaseStep {
|
|
10
|
+
async emit(answers) {
|
|
11
|
+
this.debug(answers);
|
|
12
|
+
if (!answers.wizard) {
|
|
13
|
+
// we skip this completely because the wizard wasn't running
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
if (!answers.wizard.projects || answers.wizard.projects.length === 0) {
|
|
17
|
+
throw new Error('No Projects found. Please create a new Project in Sentry and try again.');
|
|
18
|
+
}
|
|
19
|
+
let selectedProject = null;
|
|
20
|
+
if (answers.wizard.projects.length === 1) {
|
|
21
|
+
selectedProject = {
|
|
22
|
+
selectedProject: answers.wizard.projects[0],
|
|
23
|
+
};
|
|
24
|
+
// the wizard CLI closes too quickly when we skip the prompt
|
|
25
|
+
// as it will cause the UI to be stuck saying Waiting for wizard to connect
|
|
26
|
+
await sleep(1000);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
selectedProject = await (0, inquirer_1.prompt)([
|
|
30
|
+
{
|
|
31
|
+
choices: answers.wizard.projects.map((project) => {
|
|
32
|
+
return {
|
|
33
|
+
name: `${project.organization.name} / ${project.slug}`,
|
|
34
|
+
value: project,
|
|
35
|
+
};
|
|
36
|
+
}),
|
|
37
|
+
message: 'Please select your project in Sentry:',
|
|
38
|
+
name: 'selectedProject',
|
|
39
|
+
type: 'list',
|
|
40
|
+
},
|
|
41
|
+
]);
|
|
42
|
+
}
|
|
43
|
+
const dsn = selectedProject?.selectedProject.keys[0]?.dsn ?? {
|
|
44
|
+
public: null,
|
|
45
|
+
private: null,
|
|
46
|
+
};
|
|
47
|
+
return {
|
|
48
|
+
config: {
|
|
49
|
+
auth: {
|
|
50
|
+
token: answers.wizard.apiKeys?.token ?? null,
|
|
51
|
+
},
|
|
52
|
+
dsn,
|
|
53
|
+
organization: {
|
|
54
|
+
slug: selectedProject?.selectedProject.organization?.slug ?? null,
|
|
55
|
+
},
|
|
56
|
+
project: {
|
|
57
|
+
id: selectedProject?.selectedProject.id ?? null,
|
|
58
|
+
slug: selectedProject?.selectedProject.slug ?? null,
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
88
62
|
}
|
|
89
|
-
|
|
90
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
-
var selectedProject;
|
|
92
|
-
return __generator(this, function (_a) {
|
|
93
|
-
switch (_a.label) {
|
|
94
|
-
case 0:
|
|
95
|
-
this.debug(answers);
|
|
96
|
-
if (!_.has(answers, 'wizard')) {
|
|
97
|
-
// we skip this completely because the wizard wasn't running
|
|
98
|
-
return [2 /*return*/, {}];
|
|
99
|
-
}
|
|
100
|
-
if (_.has(answers, 'wizard.projects') &&
|
|
101
|
-
answers.wizard.projects.length === 0) {
|
|
102
|
-
throw new Error('No Projects found. Please create a new Project in Sentry and try again.');
|
|
103
|
-
}
|
|
104
|
-
selectedProject = null;
|
|
105
|
-
if (!(answers.wizard.projects.length === 1)) return [3 /*break*/, 2];
|
|
106
|
-
selectedProject = { selectedProject: answers.wizard.projects[0] };
|
|
107
|
-
// the wizard CLI closes too quickly when we skip the prompt
|
|
108
|
-
// as it will cause the UI to be stuck saying Waiting for wizard to connect
|
|
109
|
-
return [4 /*yield*/, sleep(1000)];
|
|
110
|
-
case 1:
|
|
111
|
-
// the wizard CLI closes too quickly when we skip the prompt
|
|
112
|
-
// as it will cause the UI to be stuck saying Waiting for wizard to connect
|
|
113
|
-
_a.sent();
|
|
114
|
-
return [3 /*break*/, 4];
|
|
115
|
-
case 2: return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
116
|
-
{
|
|
117
|
-
choices: answers.wizard.projects.map(function (project) {
|
|
118
|
-
return {
|
|
119
|
-
name: "".concat(project.organization.name, " / ").concat(project.slug),
|
|
120
|
-
value: project,
|
|
121
|
-
};
|
|
122
|
-
}),
|
|
123
|
-
message: 'Please select your project in Sentry:',
|
|
124
|
-
name: 'selectedProject',
|
|
125
|
-
type: 'list',
|
|
126
|
-
},
|
|
127
|
-
])];
|
|
128
|
-
case 3:
|
|
129
|
-
selectedProject = _a.sent();
|
|
130
|
-
_a.label = 4;
|
|
131
|
-
case 4: return [2 /*return*/, {
|
|
132
|
-
config: {
|
|
133
|
-
auth: {
|
|
134
|
-
token: _.get(answers, 'wizard.apiKeys.token', null),
|
|
135
|
-
},
|
|
136
|
-
dsn: {
|
|
137
|
-
public: _.get(selectedProject, 'selectedProject.keys.0.dsn.public', null),
|
|
138
|
-
secret: _.get(selectedProject, 'selectedProject.keys.0.dsn.secret', null),
|
|
139
|
-
},
|
|
140
|
-
organization: {
|
|
141
|
-
slug: _.get(selectedProject, 'selectedProject.organization.slug', null),
|
|
142
|
-
},
|
|
143
|
-
project: {
|
|
144
|
-
id: _.get(selectedProject, 'selectedProject.id', null),
|
|
145
|
-
slug: _.get(selectedProject, 'selectedProject.slug', null),
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
}];
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
};
|
|
153
|
-
return SentryProjectSelector;
|
|
154
|
-
}(BaseStep_1.BaseStep));
|
|
63
|
+
}
|
|
155
64
|
exports.SentryProjectSelector = SentryProjectSelector;
|
|
156
65
|
//# sourceMappingURL=SentryProjectSelector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SentryProjectSelector.js","sourceRoot":"","sources":["../../../lib/Steps/SentryProjectSelector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SentryProjectSelector.js","sourceRoot":"","sources":["../../../lib/Steps/SentryProjectSelector.ts"],"names":[],"mappings":";;;AACA,uCAAkC;AAElC,yCAAsC;AAiBtC,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC;AAED,MAAa,qBAAsB,SAAQ,mBAAQ;IAC1C,KAAK,CAAC,IAAI,CAAC,OAAgB;QAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAEpB,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,4DAA4D;YAC5D,OAAO,EAAE,CAAC;SACX;QAED,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACpE,MAAM,IAAI,KAAK,CACb,yEAAyE,CAC1E,CAAC;SACH;QAED,IAAI,eAAe,GAAwC,IAAI,CAAC;QAChE,IAAI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,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quirer';\n\nimport { BaseStep } from './BaseStep';\n\ntype Project = {\n id: string;\n slug: string;\n organization?: {\n name: string;\n slug: string;\n };\n keys: {\n dsn: {\n public: string;\n private: string;\n };\n }[];\n};\n\nfunction sleep(n: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, n));\n}\n\nexport class SentryProjectSelector extends BaseStep {\n public async emit(answers: Answers): Promise<any> {\n this.debug(answers);\n\n if (!answers.wizard) {\n // we skip this completely because the wizard wasn't running\n return {};\n }\n\n if (!answers.wizard.projects || answers.wizard.projects.length === 0) {\n throw new Error(\n 'No Projects found. Please create a new Project in Sentry and try again.',\n );\n }\n\n let selectedProject: { selectedProject: Project } | null = null;\n if (answers.wizard.projects.length === 1) {\n selectedProject = {\n selectedProject: answers.wizard.projects[0] as Project,\n };\n // the wizard CLI closes too quickly when we skip the prompt\n // as it will cause the UI to be stuck saying Waiting for wizard to connect\n await sleep(1000);\n } else {\n selectedProject = await prompt([\n {\n choices: answers.wizard.projects.map((project: any) => {\n return {\n name: `${project.organization.name} / ${project.slug}`,\n value: project,\n };\n }),\n message: 'Please select your project in Sentry:',\n name: 'selectedProject',\n type: 'list',\n },\n ]);\n }\n const dsn = selectedProject?.selectedProject.keys[0]?.dsn ?? {\n public: null,\n private: null,\n };\n return {\n config: {\n auth: {\n token: answers.wizard.apiKeys?.token ?? null,\n },\n dsn,\n organization: {\n slug: selectedProject?.selectedProject.organization?.slug ?? null,\n },\n project: {\n id: selectedProject?.selectedProject.id ?? null,\n slug: selectedProject?.selectedProject.slug ?? null,\n },\n },\n };\n }\n}\n"]}
|
|
@@ -1,72 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
3
|
exports.ShouldConfigure = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
4
|
+
const Wizard_1 = require("../Helper/Wizard");
|
|
5
|
+
const BaseStep_1 = require("./BaseStep");
|
|
6
|
+
class ShouldConfigure extends BaseStep_1.BaseStep {
|
|
7
|
+
async emit(answers) {
|
|
8
|
+
return (0, Wizard_1.getCurrentIntegration)(answers).shouldConfigure(answers);
|
|
61
9
|
}
|
|
62
|
-
|
|
63
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
-
return __generator(this, function (_a) {
|
|
65
|
-
return [2 /*return*/, (0, Wizard_1.getCurrentIntegration)(answers).shouldConfigure(answers)];
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
return ShouldConfigure;
|
|
70
|
-
}(BaseStep_1.BaseStep));
|
|
10
|
+
}
|
|
71
11
|
exports.ShouldConfigure = ShouldConfigure;
|
|
72
12
|
//# sourceMappingURL=ShouldConfigure.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShouldConfigure.js","sourceRoot":"","sources":["../../../lib/Steps/ShouldConfigure.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ShouldConfigure.js","sourceRoot":"","sources":["../../../lib/Steps/ShouldConfigure.ts"],"names":[],"mappings":";;;AAEA,6CAAyD;AACzD,yCAAsC;AAEtC,MAAa,eAAgB,SAAQ,mBAAQ;IACpC,KAAK,CAAC,IAAI,CAAC,OAAgB;QAChC,OAAO,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IACjE,CAAC;CACF;AAJD,0CAIC","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nexport class ShouldConfigure extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n return getCurrentIntegration(answers).shouldConfigure(answers);\n }\n}\n"]}
|