@sentry/wizard 3.42.1 → 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 +26 -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 -3
- 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 -2
- 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/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,133 +1,70 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
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
|
-
}
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
52
4
|
};
|
|
53
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
6
|
exports.OpenSentry = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (this._argv.signup) {
|
|
95
|
-
urlObj.searchParams.set('signup', '1');
|
|
96
|
-
// integration maps to platform in the wizard
|
|
97
|
-
if (this._argv.integration) {
|
|
98
|
-
platform = (0, Constants_1.mapIntegrationToPlatform)(this._argv.integration);
|
|
99
|
-
if (platform) {
|
|
100
|
-
urlObj.searchParams.set('project_platform', platform);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
if (this._argv.promoCode) {
|
|
104
|
-
urlObj.searchParams.set('code', this._argv.promoCode);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
urlToOpen = urlObj.toString();
|
|
108
|
-
opn(urlToOpen, { wait: false }).catch(function () {
|
|
109
|
-
// opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
|
|
110
|
-
});
|
|
111
|
-
(0, Logging_1.nl)();
|
|
112
|
-
(0, Logging_1.l)('Please open');
|
|
113
|
-
(0, Logging_1.green)(urlToOpen);
|
|
114
|
-
(0, Logging_1.l)("in your browser (if it's not open already)");
|
|
115
|
-
(0, Logging_1.nl)();
|
|
116
|
-
return [2 /*return*/, { hash: data.hash }];
|
|
117
|
-
case 4:
|
|
118
|
-
e_1 = _a.sent();
|
|
119
|
-
this._argv.skipConnect = true;
|
|
120
|
-
BottomBar_1.BottomBar.hide();
|
|
121
|
-
(0, Logging_1.nl)();
|
|
122
|
-
(0, Logging_1.red)("Wizard couldn't connect to ".concat(baseUrl, "\nmake sure the url is correct"));
|
|
123
|
-
(0, Logging_1.l)('But no worries, we fall back to asking you stuff instead, so here we go:');
|
|
124
|
-
return [2 /*return*/, {}];
|
|
125
|
-
case 5: return [2 /*return*/];
|
|
7
|
+
const node_url_1 = require("node:url");
|
|
8
|
+
const Constants_1 = require("../Constants");
|
|
9
|
+
const BottomBar_1 = require("../Helper/BottomBar");
|
|
10
|
+
const Logging_1 = require("../Helper/Logging");
|
|
11
|
+
const Wizard_1 = require("../Helper/Wizard");
|
|
12
|
+
const BaseStep_1 = require("./BaseStep");
|
|
13
|
+
const opn_1 = __importDefault(require("opn"));
|
|
14
|
+
class OpenSentry extends BaseStep_1.BaseStep {
|
|
15
|
+
async emit(answers) {
|
|
16
|
+
if (!(await (0, Wizard_1.getCurrentIntegration)(answers).shouldEmit(answers))) {
|
|
17
|
+
(0, Logging_1.dim)('Skipping connection to Sentry due files already patched');
|
|
18
|
+
return {};
|
|
19
|
+
}
|
|
20
|
+
if (this._argv.skipConnect) {
|
|
21
|
+
(0, Logging_1.dim)('Skipping connection to Sentry');
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
const baseUrl = this._argv.url;
|
|
25
|
+
BottomBar_1.BottomBar.show('Loading wizard...');
|
|
26
|
+
this.debug(`Loading wizard for ${baseUrl}`);
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch(`${baseUrl}api/0/wizard/`);
|
|
29
|
+
if (!response.ok) {
|
|
30
|
+
throw new Error(`Failed to connect to Sentry: ${response.status} ${response.statusText}`);
|
|
31
|
+
}
|
|
32
|
+
const data = (await response.json());
|
|
33
|
+
BottomBar_1.BottomBar.hide();
|
|
34
|
+
const urlObj = new node_url_1.URL(`${baseUrl}account/settings/wizard/${data.hash}/`);
|
|
35
|
+
if (this._argv.signup) {
|
|
36
|
+
urlObj.searchParams.set('signup', '1');
|
|
37
|
+
// integration maps to platform in the wizard
|
|
38
|
+
if (this._argv.integration) {
|
|
39
|
+
const platform = (0, Constants_1.mapIntegrationToPlatform)(this._argv.integration);
|
|
40
|
+
if (platform) {
|
|
41
|
+
urlObj.searchParams.set('project_platform', platform);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
if (this._argv.promoCode) {
|
|
45
|
+
urlObj.searchParams.set('code', this._argv.promoCode);
|
|
126
46
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}(
|
|
47
|
+
}
|
|
48
|
+
const urlToOpen = urlObj.toString();
|
|
49
|
+
// opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here
|
|
50
|
+
const noop = () => { }; // eslint-disable-line @typescript-eslint/no-empty-function
|
|
51
|
+
(0, opn_1.default)(urlToOpen, { wait: false }).then((cp) => cp.on('error', noop), noop);
|
|
52
|
+
(0, Logging_1.nl)();
|
|
53
|
+
(0, Logging_1.l)('Please open');
|
|
54
|
+
(0, Logging_1.green)(urlToOpen);
|
|
55
|
+
(0, Logging_1.l)("in your browser (if it's not open already)");
|
|
56
|
+
(0, Logging_1.nl)();
|
|
57
|
+
return { hash: data.hash };
|
|
58
|
+
}
|
|
59
|
+
catch (e) {
|
|
60
|
+
this._argv.skipConnect = true;
|
|
61
|
+
BottomBar_1.BottomBar.hide();
|
|
62
|
+
(0, Logging_1.nl)();
|
|
63
|
+
(0, Logging_1.red)(`Wizard couldn't connect to ${baseUrl}\nmake sure the url is correct`);
|
|
64
|
+
(0, Logging_1.l)('But no worries, we fall back to asking you stuff instead, so here we go:');
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
132
69
|
exports.OpenSentry = OpenSentry;
|
|
133
70
|
//# sourceMappingURL=OpenSentry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OpenSentry.js","sourceRoot":"","sources":["../../../lib/Steps/OpenSentry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"OpenSentry.js","sourceRoot":"","sources":["../../../lib/Steps/OpenSentry.ts"],"names":[],"mappings":"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","sourcesContent":["import { URL } from 'node:url';\nimport type { Answers } from 'inquirer';\n\nimport { mapIntegrationToPlatform } from '../Constants';\nimport { BottomBar } from '../Helper/BottomBar';\nimport { dim, green, l, nl, red } from '../Helper/Logging';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nimport opn from 'opn';\n\nexport class OpenSentry extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n dim('Skipping connection to Sentry due files already patched');\n return {};\n }\n if (this._argv.skipConnect) {\n dim('Skipping connection to Sentry');\n return {};\n }\n\n const baseUrl = this._argv.url;\n\n BottomBar.show('Loading wizard...');\n this.debug(`Loading wizard for ${baseUrl}`);\n\n try {\n const response = await fetch(`${baseUrl}api/0/wizard/`);\n if (!response.ok) {\n throw new Error(\n `Failed to connect to Sentry: ${response.status} ${response.statusText}`,\n );\n }\n const data = (await response.json()) as { hash: string };\n\n BottomBar.hide();\n\n const urlObj = new URL(`${baseUrl}account/settings/wizard/${data.hash}/`);\n if (this._argv.signup) {\n urlObj.searchParams.set('signup', '1');\n // integration maps to platform in the wizard\n if (this._argv.integration) {\n const platform = mapIntegrationToPlatform(this._argv.integration);\n if (platform) {\n urlObj.searchParams.set('project_platform', platform);\n }\n }\n if (this._argv.promoCode) {\n urlObj.searchParams.set('code', this._argv.promoCode);\n }\n }\n\n const urlToOpen = urlObj.toString();\n\n // opn throws in environments that don't have a browser (e.g. remote shells) so we just noop here\n const noop = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function\n opn(urlToOpen, { wait: false }).then((cp) => cp.on('error', noop), noop);\n\n nl();\n l('Please open');\n green(urlToOpen);\n l(\"in your browser (if it's not open already)\");\n nl();\n\n return { hash: data.hash };\n } catch (e) {\n this._argv.skipConnect = true;\n BottomBar.hide();\n nl();\n red(\n `Wizard couldn't connect to ${baseUrl}\\nmake sure the url is correct`,\n );\n l(\n 'But no worries, we fall back to asking you stuff instead, so here we go:',\n );\n return {};\n }\n }\n}\n"]}
|
|
@@ -1,203 +1,108 @@
|
|
|
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.PromptForParameters = void 0;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
4
|
+
const inquirer_1 = require("inquirer");
|
|
5
|
+
const Logging_1 = require("../Helper/Logging");
|
|
6
|
+
const Wizard_1 = require("../Helper/Wizard");
|
|
7
|
+
const BaseStep_1 = require("./BaseStep");
|
|
8
|
+
class PromptForParameters extends BaseStep_1.BaseStep {
|
|
9
|
+
async emit(answers) {
|
|
10
|
+
this.debug(answers);
|
|
11
|
+
if (!(await (0, Wizard_1.getCurrentIntegration)(answers).shouldEmit(answers))) {
|
|
12
|
+
return {};
|
|
13
|
+
}
|
|
14
|
+
if (this._argv.quiet) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
17
|
+
let url = this._getFullUrl(answers);
|
|
18
|
+
const organization = await (0, inquirer_1.prompt)([
|
|
19
|
+
{
|
|
20
|
+
message: 'Organization Slug:',
|
|
21
|
+
name: 'slug',
|
|
22
|
+
type: 'input',
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
24
|
+
validate: this._validateSlug,
|
|
25
|
+
when: this._shouldAsk(answers, 'config.organization.slug', () => {
|
|
26
|
+
(0, Logging_1.dim)('Please copy/paste your organization slug');
|
|
27
|
+
(0, Logging_1.dim)(`It can be found in the url ${url}`);
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
]);
|
|
31
|
+
url = this._getFullUrl(answers, organization.slug);
|
|
32
|
+
const project = await (0, inquirer_1.prompt)([
|
|
33
|
+
{
|
|
34
|
+
message: 'Project Slug:',
|
|
35
|
+
name: 'slug',
|
|
36
|
+
type: 'input',
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
38
|
+
validate: this._validateSlug,
|
|
39
|
+
when: this._shouldAsk(answers, 'config.project.slug', () => {
|
|
40
|
+
(0, Logging_1.dim)('Please copy/paste your project slug');
|
|
41
|
+
(0, Logging_1.dim)(`It can be found in the url ${url}`);
|
|
42
|
+
}),
|
|
43
|
+
},
|
|
44
|
+
]);
|
|
45
|
+
url = this._getFullUrl(answers, organization.slug, project.slug);
|
|
46
|
+
const dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);
|
|
47
|
+
const dsn = await (0, inquirer_1.prompt)([
|
|
48
|
+
{
|
|
49
|
+
message: 'DSN:',
|
|
50
|
+
name: 'public',
|
|
51
|
+
type: 'input',
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
53
|
+
validate: this._validateDSN,
|
|
54
|
+
when: this._shouldAsk(answers, 'config.dsn.public', () => {
|
|
55
|
+
(0, Logging_1.dim)('Please copy/paste your DSN');
|
|
56
|
+
(0, Logging_1.dim)(`It can be found here: ${dsnKeyUrl}`);
|
|
57
|
+
}),
|
|
58
|
+
},
|
|
59
|
+
]);
|
|
60
|
+
const auth = await (0, inquirer_1.prompt)([
|
|
61
|
+
{
|
|
62
|
+
message: 'Auth Token:',
|
|
63
|
+
name: 'token',
|
|
64
|
+
type: 'input',
|
|
65
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
66
|
+
validate: this._validateAuthToken,
|
|
67
|
+
when: this._shouldAsk(answers, 'config.auth.token', () => {
|
|
68
|
+
(0, Logging_1.dim)('Please copy/paste your auth token');
|
|
69
|
+
(0, Logging_1.dim)(`It can be found here: ${this._argv.url}api/`);
|
|
70
|
+
(0, Logging_1.dim)('In case there is none yet, create one with [project:releases] permission');
|
|
71
|
+
}),
|
|
72
|
+
},
|
|
73
|
+
]);
|
|
74
|
+
return {
|
|
75
|
+
config: {
|
|
76
|
+
...answers.config,
|
|
77
|
+
auth,
|
|
78
|
+
dsn,
|
|
79
|
+
project,
|
|
80
|
+
organization,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
_getFullUrl(answers, organizationSlug, projectSlug) {
|
|
85
|
+
const baseUrl = this._argv.url;
|
|
86
|
+
const orgSlug = answers.config?.organization?.slug ??
|
|
87
|
+
organizationSlug ??
|
|
88
|
+
'organization_slug';
|
|
89
|
+
const projSlug = answers.config?.project?.slug ?? projectSlug ?? 'project_slug';
|
|
90
|
+
return `${baseUrl}${orgSlug}/${projSlug}`;
|
|
87
91
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.debug(answers);
|
|
96
|
-
return [4 /*yield*/, (0, Wizard_1.getCurrentIntegration)(answers).shouldEmit(answers)];
|
|
97
|
-
case 1:
|
|
98
|
-
if (!(_a.sent())) {
|
|
99
|
-
return [2 /*return*/, {}];
|
|
100
|
-
}
|
|
101
|
-
if (this._argv.quiet) {
|
|
102
|
-
return [2 /*return*/, {}];
|
|
103
|
-
}
|
|
104
|
-
url = this._getFullUrl(answers);
|
|
105
|
-
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
106
|
-
{
|
|
107
|
-
message: 'Organization Slug:',
|
|
108
|
-
name: 'slug',
|
|
109
|
-
type: 'input',
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
111
|
-
validate: this._validateSlug,
|
|
112
|
-
when: this._shouldAsk(answers, 'config.organization.slug', function () {
|
|
113
|
-
(0, Logging_1.dim)('Please copy/paste your organization slug');
|
|
114
|
-
(0, Logging_1.dim)("It can be found in the url ".concat(url));
|
|
115
|
-
}),
|
|
116
|
-
},
|
|
117
|
-
])];
|
|
118
|
-
case 2:
|
|
119
|
-
organization = _a.sent();
|
|
120
|
-
url = this._getFullUrl(answers, organization.slug);
|
|
121
|
-
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
122
|
-
{
|
|
123
|
-
message: 'Project Slug:',
|
|
124
|
-
name: 'slug',
|
|
125
|
-
type: 'input',
|
|
126
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
127
|
-
validate: this._validateSlug,
|
|
128
|
-
when: this._shouldAsk(answers, 'config.project.slug', function () {
|
|
129
|
-
(0, Logging_1.dim)('Please copy/paste your project slug');
|
|
130
|
-
(0, Logging_1.dim)("It can be found in the url ".concat(url));
|
|
131
|
-
}),
|
|
132
|
-
},
|
|
133
|
-
])];
|
|
134
|
-
case 3:
|
|
135
|
-
project = _a.sent();
|
|
136
|
-
url = this._getFullUrl(answers, organization.slug, project.slug);
|
|
137
|
-
dsnKeyUrl = this._getDSNKeyUrl(answers, project.slug);
|
|
138
|
-
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
139
|
-
{
|
|
140
|
-
message: 'DSN:',
|
|
141
|
-
name: 'public',
|
|
142
|
-
type: 'input',
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
144
|
-
validate: this._validateDSN,
|
|
145
|
-
when: this._shouldAsk(answers, 'config.dsn.public', function () {
|
|
146
|
-
(0, Logging_1.dim)('Please copy/paste your DSN');
|
|
147
|
-
(0, Logging_1.dim)("It can be found here: ".concat(dsnKeyUrl));
|
|
148
|
-
}),
|
|
149
|
-
},
|
|
150
|
-
])];
|
|
151
|
-
case 4:
|
|
152
|
-
dsn = _a.sent();
|
|
153
|
-
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
154
|
-
{
|
|
155
|
-
message: 'Auth Token:',
|
|
156
|
-
name: 'token',
|
|
157
|
-
type: 'input',
|
|
158
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
159
|
-
validate: this._validateAuthToken,
|
|
160
|
-
when: this._shouldAsk(answers, 'config.auth.token', function () {
|
|
161
|
-
(0, Logging_1.dim)('Please copy/paste your auth token');
|
|
162
|
-
(0, Logging_1.dim)("It can be found here: ".concat(_this._argv.url, "api/"));
|
|
163
|
-
(0, Logging_1.dim)('In case there is none yet, create one with [project:releases] permission');
|
|
164
|
-
}),
|
|
165
|
-
},
|
|
166
|
-
])];
|
|
167
|
-
case 5:
|
|
168
|
-
auth = _a.sent();
|
|
169
|
-
return [2 /*return*/, {
|
|
170
|
-
config: _.merge(_.get(answers, 'config'), {
|
|
171
|
-
auth: auth,
|
|
172
|
-
dsn: dsn,
|
|
173
|
-
project: project,
|
|
174
|
-
organization: organization,
|
|
175
|
-
}),
|
|
176
|
-
}];
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
PromptForParameters.prototype._getFullUrl = function (answers, organizationSlug, projectSlug) {
|
|
182
|
-
var baseUrl = this._argv.url;
|
|
183
|
-
var orgSlug = _.get(answers, 'config.organization.slug', organizationSlug || 'organization_slug');
|
|
184
|
-
var projSlug = _.get(answers, 'config.project.slug', projectSlug || 'project_slug');
|
|
185
|
-
return "".concat(baseUrl).concat(orgSlug, "/").concat(projSlug);
|
|
186
|
-
};
|
|
187
|
-
PromptForParameters.prototype._getDSNKeyUrl = function (answers, projectSlug) {
|
|
188
|
-
var baseUrl = this._argv.url;
|
|
189
|
-
var projSlug = _.get(answers, 'config.project.slug', projectSlug || 'project_slug');
|
|
190
|
-
return "".concat(baseUrl, "settings/projects/").concat(projSlug, "/keys");
|
|
191
|
-
};
|
|
192
|
-
PromptForParameters.prototype._shouldAsk = function (answers, configKey, preHook) {
|
|
193
|
-
var shouldAsk = _.get(answers, configKey, null) === null;
|
|
92
|
+
_getDSNKeyUrl(answers, projectSlug) {
|
|
93
|
+
const baseUrl = this._argv.url;
|
|
94
|
+
const projSlug = answers.config?.project?.slug ?? projectSlug ?? 'project_slug';
|
|
95
|
+
return `${baseUrl}settings/projects/${projSlug}/keys`;
|
|
96
|
+
}
|
|
97
|
+
_shouldAsk(answers, configKey, preHook) {
|
|
98
|
+
const shouldAsk = answers[configKey] != null;
|
|
194
99
|
if (shouldAsk && preHook) {
|
|
195
100
|
preHook();
|
|
196
101
|
}
|
|
197
102
|
return shouldAsk;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
103
|
+
}
|
|
104
|
+
_validateAuthToken(input) {
|
|
105
|
+
const isOrgToken = input.startsWith('sntrys_');
|
|
201
106
|
if (isOrgToken) {
|
|
202
107
|
if (!isValidOrgToken(input)) {
|
|
203
108
|
return 'Make sure you correctly copied your auth token. It should start with "sntrys_"';
|
|
@@ -208,8 +113,8 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
208
113
|
return 'Make sure you copied the correct auth token, it should be 64 hex chars';
|
|
209
114
|
}
|
|
210
115
|
return true;
|
|
211
|
-
}
|
|
212
|
-
|
|
116
|
+
}
|
|
117
|
+
_validateSlug(input) {
|
|
213
118
|
if (input.match(/[A-Z]/g)) {
|
|
214
119
|
return 'Please copy the slug from the url, it should be all lowercase';
|
|
215
120
|
}
|
|
@@ -217,19 +122,18 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
217
122
|
return "Can't be empty";
|
|
218
123
|
}
|
|
219
124
|
return true;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
125
|
+
}
|
|
126
|
+
_validateDSN(input) {
|
|
127
|
+
const match = input.match(/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w.-]+)(?::(\d+))?(\/.*)$/);
|
|
223
128
|
if (!match) {
|
|
224
129
|
return 'Invalid DSN format';
|
|
225
130
|
}
|
|
226
131
|
if (match[1] !== 'http' && match[1] !== 'https') {
|
|
227
|
-
return
|
|
132
|
+
return `Unsupported protocol for DSN: ${match[1]}`;
|
|
228
133
|
}
|
|
229
134
|
return true;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
}(BaseStep_1.BaseStep));
|
|
135
|
+
}
|
|
136
|
+
}
|
|
233
137
|
exports.PromptForParameters = PromptForParameters;
|
|
234
138
|
/**
|
|
235
139
|
* Trying to parse and decode an org auth token. Based on:
|
|
@@ -240,19 +144,19 @@ function isValidOrgToken(input) {
|
|
|
240
144
|
if (!input.startsWith('sntrys_')) {
|
|
241
145
|
return false;
|
|
242
146
|
}
|
|
243
|
-
|
|
147
|
+
const tokenParts = input.split('_');
|
|
244
148
|
if (tokenParts.length < 3) {
|
|
245
149
|
return false;
|
|
246
150
|
}
|
|
247
151
|
try {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
152
|
+
const payload = tokenParts[1];
|
|
153
|
+
const decodedPayload = Buffer.from(payload, 'base64').toString();
|
|
154
|
+
const jsonPayload = JSON.parse(decodedPayload);
|
|
251
155
|
if (!jsonPayload.iat || !jsonPayload.url || !jsonPayload.org) {
|
|
252
156
|
return false;
|
|
253
157
|
}
|
|
254
158
|
}
|
|
255
|
-
catch
|
|
159
|
+
catch {
|
|
256
160
|
return false;
|
|
257
161
|
}
|
|
258
162
|
return true;
|