@sentry/wizard 2.7.0 → 3.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/CHANGELOG.md +12 -3
- package/dist/NextJs/configs/next.config.template.js +1 -1
- package/dist/bin.js +7 -3
- package/dist/bin.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/Constants.js +1 -1
- package/dist/lib/Constants.js.map +1 -1
- package/dist/lib/Helper/BottomBar.js +2 -2
- package/dist/lib/Helper/BottomBar.js.map +1 -1
- package/dist/lib/Helper/File.js +10 -12
- package/dist/lib/Helper/File.js.map +1 -1
- package/dist/lib/Helper/Logging.js +1 -1
- package/dist/lib/Helper/Logging.js.map +1 -1
- package/dist/lib/Helper/Package.js +10 -10
- package/dist/lib/Helper/Package.js.map +1 -1
- package/dist/lib/Helper/PackageManager.js +6 -9
- package/dist/lib/Helper/PackageManager.js.map +1 -1
- package/dist/lib/Helper/SentryCli.d.ts +3 -3
- package/dist/lib/Helper/SentryCli.js +3 -3
- package/dist/lib/Helper/SentryCli.js.map +1 -1
- package/dist/lib/Helper/Wizard.d.ts +4 -4
- package/dist/lib/Helper/Wizard.js +11 -11
- package/dist/lib/Helper/Wizard.js.map +1 -1
- package/dist/lib/Helper/__tests__/File.js +5 -5
- package/dist/lib/Helper/__tests__/File.js.map +1 -1
- package/dist/lib/Helper/__tests__/MergeConfig.js +9 -9
- package/dist/lib/Helper/__tests__/MergeConfig.js.map +1 -1
- package/dist/lib/Helper/__tests__/SentryCli.js.map +1 -1
- package/dist/lib/Setup.js +11 -9
- package/dist/lib/Setup.js.map +1 -1
- package/dist/lib/Steps/BaseStep.d.ts +2 -2
- package/dist/lib/Steps/BaseStep.js +3 -3
- package/dist/lib/Steps/BaseStep.js.map +1 -1
- package/dist/lib/Steps/ChooseIntegration.d.ts +1 -1
- package/dist/lib/Steps/ChooseIntegration.js +7 -5
- package/dist/lib/Steps/ChooseIntegration.js.map +1 -1
- package/dist/lib/Steps/ConfigureProject.d.ts +1 -1
- package/dist/lib/Steps/ConfigureProject.js +5 -3
- package/dist/lib/Steps/ConfigureProject.js.map +1 -1
- package/dist/lib/Steps/Initial.d.ts +1 -1
- package/dist/lib/Steps/Initial.js +6 -4
- package/dist/lib/Steps/Initial.js.map +1 -1
- package/dist/lib/Steps/Integrations/BaseIntegration.d.ts +2 -2
- package/dist/lib/Steps/Integrations/BaseIntegration.js +5 -4
- package/dist/lib/Steps/Integrations/BaseIntegration.js.map +1 -1
- package/dist/lib/Steps/Integrations/Cordova.d.ts +2 -2
- package/dist/lib/Steps/Integrations/Cordova.js +12 -10
- package/dist/lib/Steps/Integrations/Cordova.js.map +1 -1
- package/dist/lib/Steps/Integrations/Electron.d.ts +2 -2
- package/dist/lib/Steps/Integrations/Electron.js +23 -21
- package/dist/lib/Steps/Integrations/Electron.js.map +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.d.ts +1 -1
- package/dist/lib/Steps/Integrations/MobileProject.js +7 -5
- package/dist/lib/Steps/Integrations/MobileProject.js.map +1 -1
- package/dist/lib/Steps/Integrations/NextJs.d.ts +2 -2
- package/dist/lib/Steps/Integrations/NextJs.js +56 -52
- package/dist/lib/Steps/Integrations/NextJs.js.map +1 -1
- package/dist/lib/Steps/Integrations/ReactNative.d.ts +2 -2
- package/dist/lib/Steps/Integrations/ReactNative.js +52 -51
- package/dist/lib/Steps/Integrations/ReactNative.js.map +1 -1
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js +1 -1
- package/dist/lib/Steps/Integrations/__tests__/ReactNative.js.map +1 -1
- package/dist/lib/Steps/OpenSentry.d.ts +1 -1
- package/dist/lib/Steps/OpenSentry.js +19 -17
- package/dist/lib/Steps/OpenSentry.js.map +1 -1
- package/dist/lib/Steps/PromptForParameters.d.ts +1 -1
- package/dist/lib/Steps/PromptForParameters.js +21 -19
- package/dist/lib/Steps/PromptForParameters.js.map +1 -1
- package/dist/lib/Steps/Result.d.ts +1 -1
- package/dist/lib/Steps/Result.js +7 -5
- package/dist/lib/Steps/Result.js.map +1 -1
- package/dist/lib/Steps/SentryProjectSelector.d.ts +1 -1
- package/dist/lib/Steps/SentryProjectSelector.js +6 -4
- package/dist/lib/Steps/SentryProjectSelector.js.map +1 -1
- package/dist/lib/Steps/ShouldConfigure.d.ts +1 -1
- package/dist/lib/Steps/ShouldConfigure.js +5 -3
- package/dist/lib/Steps/ShouldConfigure.js.map +1 -1
- package/dist/lib/Steps/WaitForSentry.d.ts +1 -1
- package/dist/lib/Steps/WaitForSentry.js +11 -9
- package/dist/lib/Steps/WaitForSentry.js.map +1 -1
- package/dist/lib/Steps/Welcome.d.ts +1 -1
- package/dist/lib/Steps/Welcome.js +7 -6
- package/dist/lib/Steps/Welcome.js.map +1 -1
- package/dist/lib/Steps/index.js +1 -0
- package/dist/lib/Steps/index.js.map +1 -1
- package/dist/lib/__tests__/Env.js +1 -1
- package/dist/lib/__tests__/Env.js.map +1 -1
- package/dist/lib/__tests__/Setup.js +1 -1
- package/dist/lib/__tests__/Setup.js.map +1 -1
- package/lib/Helper/File.ts +2 -8
- package/lib/Helper/SentryCli.ts +3 -3
- package/lib/Helper/Wizard.ts +6 -5
- package/lib/Helper/__tests__/File.ts +5 -5
- package/lib/Helper/__tests__/SentryCli.ts +3 -2
- package/lib/Helper/test-fixtures/next.config.1-merged.js +1 -1
- package/lib/Helper/test-fixtures/next.config.3-merged.js +1 -1
- package/lib/Helper/test-fixtures/next.config.4-merged.js +1 -1
- package/lib/Steps/BaseStep.ts +3 -3
- package/lib/Steps/ChooseIntegration.ts +2 -1
- package/lib/Steps/ConfigureProject.ts +1 -1
- package/lib/Steps/Initial.ts +1 -1
- package/lib/Steps/Integrations/BaseIntegration.ts +3 -3
- package/lib/Steps/Integrations/Cordova.ts +5 -5
- package/lib/Steps/Integrations/Electron.ts +7 -6
- package/lib/Steps/Integrations/MobileProject.ts +2 -1
- package/lib/Steps/Integrations/NextJs.ts +7 -6
- package/lib/Steps/Integrations/ReactNative.ts +44 -24
- package/lib/Steps/Integrations/__tests__/ReactNative.ts +3 -2
- package/lib/Steps/OpenSentry.ts +1 -1
- package/lib/Steps/PromptForParameters.ts +3 -2
- package/lib/Steps/Result.ts +1 -1
- package/lib/Steps/SentryProjectSelector.ts +3 -2
- package/lib/Steps/ShouldConfigure.ts +1 -1
- package/lib/Steps/WaitForSentry.ts +3 -3
- package/lib/Steps/Welcome.ts +1 -1
- package/lib/__tests__/Setup.ts +1 -1
- package/package.json +9 -13
- package/scripts/NextJs/configs/next.config.template.js +1 -1
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -68,32 +70,32 @@ var OpenSentry = /** @class */ (function (_super) {
|
|
|
68
70
|
var baseUrl, data, urlObj, urlToOpen, e_1;
|
|
69
71
|
return __generator(this, function (_a) {
|
|
70
72
|
switch (_a.label) {
|
|
71
|
-
case 0: return [4 /*yield*/, Wizard_1.getCurrentIntegration(answers).shouldEmit(answers)];
|
|
73
|
+
case 0: return [4 /*yield*/, (0, Wizard_1.getCurrentIntegration)(answers).shouldEmit(answers)];
|
|
72
74
|
case 1:
|
|
73
75
|
if (!(_a.sent())) {
|
|
74
|
-
Logging_1.dim('Skipping connection to Sentry due files already patched');
|
|
76
|
+
(0, Logging_1.dim)('Skipping connection to Sentry due files already patched');
|
|
75
77
|
return [2 /*return*/, {}];
|
|
76
78
|
}
|
|
77
79
|
if (this._argv.skipConnect) {
|
|
78
|
-
Logging_1.dim('Skipping connection to Sentry');
|
|
80
|
+
(0, Logging_1.dim)('Skipping connection to Sentry');
|
|
79
81
|
return [2 /*return*/, {}];
|
|
80
82
|
}
|
|
81
83
|
baseUrl = this._argv.url;
|
|
82
84
|
BottomBar_1.BottomBar.show('Loading wizard...');
|
|
83
|
-
this.debug("Loading wizard for "
|
|
85
|
+
this.debug("Loading wizard for ".concat(baseUrl));
|
|
84
86
|
_a.label = 2;
|
|
85
87
|
case 2:
|
|
86
88
|
_a.trys.push([2, 4, , 5]);
|
|
87
|
-
return [4 /*yield*/, r2.get(baseUrl
|
|
89
|
+
return [4 /*yield*/, r2.get("".concat(baseUrl, "api/0/wizard/")).json];
|
|
88
90
|
case 3:
|
|
89
91
|
data = _a.sent();
|
|
90
92
|
BottomBar_1.BottomBar.hide();
|
|
91
|
-
urlObj = new url_1.URL(baseUrl
|
|
93
|
+
urlObj = new url_1.URL("".concat(baseUrl, "account/settings/wizard/").concat(data.hash, "/"));
|
|
92
94
|
if (this._argv.signup) {
|
|
93
95
|
urlObj.searchParams.set('signup', '1');
|
|
94
96
|
// integration maps to platform in the wizard
|
|
95
97
|
if (this._argv.integration) {
|
|
96
|
-
urlObj.searchParams.set('project_platform', Constants_1.mapIntegrationToPlatform(this._argv.integration));
|
|
98
|
+
urlObj.searchParams.set('project_platform', (0, Constants_1.mapIntegrationToPlatform)(this._argv.integration));
|
|
97
99
|
}
|
|
98
100
|
if (this._argv.promoCode) {
|
|
99
101
|
urlObj.searchParams.set('code', this._argv.promoCode);
|
|
@@ -101,19 +103,19 @@ var OpenSentry = /** @class */ (function (_super) {
|
|
|
101
103
|
}
|
|
102
104
|
urlToOpen = urlObj.toString();
|
|
103
105
|
opn(urlToOpen);
|
|
104
|
-
Logging_1.nl();
|
|
105
|
-
Logging_1.l('Please open');
|
|
106
|
-
Logging_1.green(urlToOpen);
|
|
107
|
-
Logging_1.l("in your browser (if it's not open already)");
|
|
108
|
-
Logging_1.nl();
|
|
106
|
+
(0, Logging_1.nl)();
|
|
107
|
+
(0, Logging_1.l)('Please open');
|
|
108
|
+
(0, Logging_1.green)(urlToOpen);
|
|
109
|
+
(0, Logging_1.l)("in your browser (if it's not open already)");
|
|
110
|
+
(0, Logging_1.nl)();
|
|
109
111
|
return [2 /*return*/, { hash: data.hash }];
|
|
110
112
|
case 4:
|
|
111
113
|
e_1 = _a.sent();
|
|
112
114
|
this._argv.skipConnect = true;
|
|
113
115
|
BottomBar_1.BottomBar.hide();
|
|
114
|
-
Logging_1.nl();
|
|
115
|
-
Logging_1.red("Wizard couldn't connect to "
|
|
116
|
-
Logging_1.l('But no worries, we fall back to asking you stuff instead, so here we go:');
|
|
116
|
+
(0, Logging_1.nl)();
|
|
117
|
+
(0, Logging_1.red)("Wizard couldn't connect to ".concat(baseUrl, "\nmake sure the url is correct"));
|
|
118
|
+
(0, Logging_1.l)('But no worries, we fall back to asking you stuff instead, so here we go:');
|
|
117
119
|
return [2 /*return*/, {}];
|
|
118
120
|
case 5: return [2 /*return*/];
|
|
119
121
|
}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2BAA0B;AAE1B,0CAAwD;AACxD,iDAAgD;AAChD,6CAA2D;AAC3D,2CAAyD;AACzD,uCAAsC;AAEtC,IAAM,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;AAC3B,IAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB;IAAgC,8BAAQ;IAAxC;;IA2DA,CAAC;IA1Dc,yBAAI,GAAjB,UAAkB,OAAgB;;;;;4BAC1B,qBAAM,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAA;;wBAA9D,IAAI,CAAC,CAAC,SAAwD,CAAC,EAAE;4BAC/D,IAAA,aAAG,EAAC,yDAAyD,CAAC,CAAC;4BAC/D,sBAAO,EAAE,EAAC;yBACX;wBACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;4BAC1B,IAAA,aAAG,EAAC,+BAA+B,CAAC,CAAC;4BACrC,sBAAO,EAAE,EAAC;yBACX;wBAEK,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;wBAE/B,qBAAS,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;wBACpC,IAAI,CAAC,KAAK,CAAC,6BAAsB,OAAO,CAAE,CAAC,CAAC;;;;wBAG7B,qBAAM,EAAE,CAAC,GAAG,CAAC,UAAG,OAAO,kBAAe,CAAC,CAAC,IAAI,EAAA;;wBAAnD,IAAI,GAAG,SAA4C;wBAEzD,qBAAS,CAAC,IAAI,EAAE,CAAC;wBAEX,MAAM,GA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3DY,gCAAU","sourcesContent":["import type { Answers } from 'inquirer';\nimport { URL } from 'url';\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\nconst opn = require('opn');\nconst r2 = require('r2');\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 data = await r2.get(`${baseUrl}api/0/wizard/`).json;\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 urlObj.searchParams.set(\n 'project_platform',\n mapIntegrationToPlatform(this._argv.integration),\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(urlToOpen);\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"]}
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -68,7 +70,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
68
70
|
switch (_a.label) {
|
|
69
71
|
case 0:
|
|
70
72
|
this.debug(answers);
|
|
71
|
-
return [4 /*yield*/, Wizard_1.getCurrentIntegration(answers).shouldEmit(answers)];
|
|
73
|
+
return [4 /*yield*/, (0, Wizard_1.getCurrentIntegration)(answers).shouldEmit(answers)];
|
|
72
74
|
case 1:
|
|
73
75
|
if (!(_a.sent())) {
|
|
74
76
|
return [2 /*return*/, {}];
|
|
@@ -77,7 +79,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
77
79
|
return [2 /*return*/, {}];
|
|
78
80
|
}
|
|
79
81
|
url = this._getFullUrl(answers);
|
|
80
|
-
return [4 /*yield*/, inquirer_1.prompt([
|
|
82
|
+
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
81
83
|
{
|
|
82
84
|
message: 'Organization Slug:',
|
|
83
85
|
name: 'slug',
|
|
@@ -85,15 +87,15 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
85
87
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
86
88
|
validate: this._validateSlug,
|
|
87
89
|
when: this._shouldAsk(answers, 'config.organization.slug', function () {
|
|
88
|
-
Logging_1.dim('Please copy/paste your organization slug');
|
|
89
|
-
Logging_1.dim("It can be found in the url "
|
|
90
|
+
(0, Logging_1.dim)('Please copy/paste your organization slug');
|
|
91
|
+
(0, Logging_1.dim)("It can be found in the url ".concat(url));
|
|
90
92
|
}),
|
|
91
93
|
},
|
|
92
94
|
])];
|
|
93
95
|
case 2:
|
|
94
96
|
organization = _a.sent();
|
|
95
97
|
url = this._getFullUrl(answers, organization.slug);
|
|
96
|
-
return [4 /*yield*/, inquirer_1.prompt([
|
|
98
|
+
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
97
99
|
{
|
|
98
100
|
message: 'Project Slug:',
|
|
99
101
|
name: 'slug',
|
|
@@ -101,15 +103,15 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
101
103
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
102
104
|
validate: this._validateSlug,
|
|
103
105
|
when: this._shouldAsk(answers, 'config.project.slug', function () {
|
|
104
|
-
Logging_1.dim('Please copy/paste your project slug');
|
|
105
|
-
Logging_1.dim("It can be found in the url "
|
|
106
|
+
(0, Logging_1.dim)('Please copy/paste your project slug');
|
|
107
|
+
(0, Logging_1.dim)("It can be found in the url ".concat(url));
|
|
106
108
|
}),
|
|
107
109
|
},
|
|
108
110
|
])];
|
|
109
111
|
case 3:
|
|
110
112
|
project = _a.sent();
|
|
111
113
|
url = this._getFullUrl(answers, organization.slug, project.slug);
|
|
112
|
-
return [4 /*yield*/, inquirer_1.prompt([
|
|
114
|
+
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
113
115
|
{
|
|
114
116
|
message: 'DSN:',
|
|
115
117
|
name: 'secret',
|
|
@@ -117,14 +119,14 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
117
119
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
118
120
|
validate: this._validateDSN,
|
|
119
121
|
when: this._shouldAsk(answers, 'config.dsn.secret', function () {
|
|
120
|
-
Logging_1.dim('Please copy/paste your DSN');
|
|
121
|
-
Logging_1.dim("It can be found here: "
|
|
122
|
+
(0, Logging_1.dim)('Please copy/paste your DSN');
|
|
123
|
+
(0, Logging_1.dim)("It can be found here: ".concat(url));
|
|
122
124
|
}),
|
|
123
125
|
},
|
|
124
126
|
])];
|
|
125
127
|
case 4:
|
|
126
128
|
dsn = _a.sent();
|
|
127
|
-
return [4 /*yield*/, inquirer_1.prompt([
|
|
129
|
+
return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
128
130
|
{
|
|
129
131
|
message: 'Auth Token:',
|
|
130
132
|
name: 'token',
|
|
@@ -132,9 +134,9 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
132
134
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
133
135
|
validate: this._validateAuthToken,
|
|
134
136
|
when: this._shouldAsk(answers, 'config.auth.token', function () {
|
|
135
|
-
Logging_1.dim('Please copy/paste your auth token');
|
|
136
|
-
Logging_1.dim("It can be found here: "
|
|
137
|
-
Logging_1.dim('In case there is none yet, create one with [project:releases] permission');
|
|
137
|
+
(0, Logging_1.dim)('Please copy/paste your auth token');
|
|
138
|
+
(0, Logging_1.dim)("It can be found here: ".concat(_this._argv.url, "api/"));
|
|
139
|
+
(0, Logging_1.dim)('In case there is none yet, create one with [project:releases] permission');
|
|
138
140
|
}),
|
|
139
141
|
},
|
|
140
142
|
])];
|
|
@@ -156,7 +158,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
156
158
|
var baseUrl = this._argv.url;
|
|
157
159
|
var orgSlug = _.get(answers, 'config.organization.slug', organizationSlug || 'organization_slug');
|
|
158
160
|
var projSlug = _.get(answers, 'config.project.slug', projectSlug || 'project_slug');
|
|
159
|
-
return ""
|
|
161
|
+
return "".concat(baseUrl).concat(orgSlug, "/").concat(projSlug);
|
|
160
162
|
};
|
|
161
163
|
PromptForParameters.prototype._shouldAsk = function (answers, configKey, preHook) {
|
|
162
164
|
var shouldAsk = _.get(answers, configKey, null) === null;
|
|
@@ -176,7 +178,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
176
178
|
return 'Please copy the slug from the url, it should be all lowercase';
|
|
177
179
|
}
|
|
178
180
|
if (input.length === 0) {
|
|
179
|
-
return
|
|
181
|
+
return "Can't be empty";
|
|
180
182
|
}
|
|
181
183
|
return true;
|
|
182
184
|
};
|
|
@@ -186,7 +188,7 @@ var PromptForParameters = /** @class */ (function (_super) {
|
|
|
186
188
|
return 'Invalid DSN format';
|
|
187
189
|
}
|
|
188
190
|
if (match[1] !== 'http' && match[1] !== 'https') {
|
|
189
|
-
return "Unsupported protocol for DSN: "
|
|
191
|
+
return "Unsupported protocol for DSN: ".concat(match[1]);
|
|
190
192
|
}
|
|
191
193
|
return true;
|
|
192
194
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PromptForParameters.js","sourceRoot":"","sources":["../../../lib/Steps/PromptForParameters.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PromptForParameters.js","sourceRoot":"","sources":["../../../lib/Steps/PromptForParameters.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAAkC;AAClC,0BAA4B;AAE5B,6CAAwC;AACxC,2CAAyD;AACzD,uCAAsC;AAEtC;IAAyC,uCAAQ;IAAjD;;IA8IA,CAAC;IA7Ic,kCAAI,GAAjB,UAAkB,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I,CAAC,KAAK,EAAE;YACV,OAAO,oBAAoB,CAAC;SAC7B;QACD,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,EAAE;YAC/C,OAAO,wCAAiC,KAAK,CAAC,CAAC,CAAC,CAAE,CAAC;SACpD;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACH,0BAAC;AAAD,CAAC,AA9ID,CAAyC,mBAAQ,GA8IhD;AA9IY,kDAAmB","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 dsn = await prompt([\n {\n message: 'DSN:',\n name: 'secret',\n type: 'input',\n // eslint-disable-next-line @typescript-eslint/unbound-method\n validate: this._validateDSN,\n when: this._shouldAsk(answers, 'config.dsn.secret', () => {\n dim('Please copy/paste your DSN');\n dim(`It can be found here: ${url}`);\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 _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 if (!input.match(/[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"]}
|
package/dist/lib/Steps/Result.js
CHANGED
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -61,12 +63,12 @@ var Result = /** @class */ (function (_super) {
|
|
|
61
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
64
|
return __generator(this, function (_a) {
|
|
63
65
|
this.debug(answers);
|
|
64
|
-
Logging_1.nl();
|
|
66
|
+
(0, Logging_1.nl)();
|
|
65
67
|
if (this._argv.uninstall) {
|
|
66
|
-
Logging_1.green('😢 Successfully removed Sentry from your project 😢');
|
|
68
|
+
(0, Logging_1.green)('😢 Successfully removed Sentry from your project 😢');
|
|
67
69
|
}
|
|
68
70
|
else {
|
|
69
|
-
Logging_1.green('🎉 Successfully set up Sentry for your project 🎉');
|
|
71
|
+
(0, Logging_1.green)('🎉 Successfully set up Sentry for your project 🎉');
|
|
70
72
|
}
|
|
71
73
|
// We need to exit here to stop everything
|
|
72
74
|
setTimeout(function () {
|
|
@@ -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,6CAA8C;AAC9C,uCAAsC;AAEtC;IAA4B,0BAAQ;IAApC;;IAeA,CAAC;IAdc,qBAAI,GAAjB,UAAkB,OAAgB;;;gBAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBACpB,IAAA,YAAE,GAAE,CAAC;gBACL,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE;oBACxB,IAAA,eAAK,EAAC,sDAAsD,CAAC,CAAC;iBAC/D;qBAAM;oBACL,IAAA,eAAK,EAAC,oDAAoD,CAAC,CAAC;iBAC7D;gBACD,0CAA0C;gBAC1C,UAAU,CAAC;oBACT,OAAO,CAAC,IAAI,EAAE,CAAC;gBACjB,CAAC,EAAE,GAAG,CAAC,CAAC;gBACR,sBAAO,EAAE,EAAC;;;KACX;IACH,aAAC;AAAD,CAAC,AAfD,CAA4B,mBAAQ,GAenC;AAfY,wBAAM","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport { green, nl } from '../Helper/Logging';\nimport { BaseStep } from './BaseStep';\n\nexport class Result extends BaseStep {\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"]}
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -87,11 +89,11 @@ var SentryProjectSelector = /** @class */ (function (_super) {
|
|
|
87
89
|
// as it will cause the UI to be stuck saying Waiting for wizard to connect
|
|
88
90
|
_a.sent();
|
|
89
91
|
return [3 /*break*/, 4];
|
|
90
|
-
case 2: return [4 /*yield*/, inquirer_1.prompt([
|
|
92
|
+
case 2: return [4 /*yield*/, (0, inquirer_1.prompt)([
|
|
91
93
|
{
|
|
92
94
|
choices: answers.wizard.projects.map(function (project) {
|
|
93
95
|
return {
|
|
94
|
-
name: project.organization.name
|
|
96
|
+
name: "".concat(project.organization.name, " / ").concat(project.slug),
|
|
95
97
|
value: project,
|
|
96
98
|
};
|
|
97
99
|
}),
|
|
@@ -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,qCAAkC;AAClC,0BAA4B;AAE5B,uCAAsC;AAEtC,SAAS,KAAK,CAAC,CAAS;IACtB,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,IAAK,OAAA,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,EAAtB,CAAsB,CAAC,CAAC;AAC1D,CAAC;AAED;IAA2C,yCAAQ;IAAnD;;IAoEA,CAAC;IAnEc,oCAAI,GAAjB,UAAkB,OAAgB;;;;;;wBAChC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;wBAEpB,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;4BAC7B,2DAA2D;4BAC3D,sBAAO,EAAE,EAAC;yBACX;wBAED,IACE,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,iBAAiB,CAAC;4BACjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EACpC;4BACA,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;yBAChC;wBAEG,eAAe,GAAG,IAAI,CAAC;6BACvB,CAAA,OAAO,CAAC,MAA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C3D;6BACF;yBACF,EAAC;;;;KACH;IACH,4BAAC;AAAD,CAAC,AApED,CAA2C,mBAAQ,GAoElD;AApEY,sDAAqB","sourcesContent":["import type { Answers } from 'inquirer';\nimport { prompt } from 'inquirer';\nimport * as _ from 'lodash';\n\nimport { BaseStep } from './BaseStep';\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 (!_.has(answers, 'wizard')) {\n // we skip this completly because the wizard wasn't running\n return {};\n }\n\n if (\n _.has(answers, 'wizard.projects') &&\n answers.wizard.projects.length === 0\n ) {\n throw new Error('no projects');\n }\n\n let selectedProject = null;\n if (answers.wizard.projects.length === 1) {\n selectedProject = { selectedProject: answers.wizard.projects[0] };\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\n return {\n config: {\n auth: {\n token: _.get(answers, 'wizard.apiKeys.token', null),\n },\n dsn: {\n public: _.get(\n selectedProject,\n 'selectedProject.keys.0.dsn.public',\n null,\n ),\n secret: _.get(\n selectedProject,\n 'selectedProject.keys.0.dsn.secret',\n null,\n ),\n },\n organization: {\n slug: _.get(\n selectedProject,\n 'selectedProject.organization.slug',\n null,\n ),\n },\n project: {\n slug: _.get(selectedProject, 'selectedProject.slug', null),\n },\n },\n };\n }\n}\n"]}
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -60,7 +62,7 @@ var ShouldConfigure = /** @class */ (function (_super) {
|
|
|
60
62
|
ShouldConfigure.prototype.emit = function (answers) {
|
|
61
63
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
64
|
return __generator(this, function (_a) {
|
|
63
|
-
return [2 /*return*/, Wizard_1.getCurrentIntegration(answers).shouldConfigure(answers)];
|
|
65
|
+
return [2 /*return*/, (0, Wizard_1.getCurrentIntegration)(answers).shouldConfigure(answers)];
|
|
64
66
|
});
|
|
65
67
|
});
|
|
66
68
|
};
|
|
@@ -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,2CAAyD;AACzD,uCAAsC;AAEtC;IAAqC,mCAAQ;IAA7C;;IAIA,CAAC;IAHc,8BAAI,GAAjB,UAAkB,OAAgB;;;gBAChC,sBAAO,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,EAAC;;;KAChE;IACH,sBAAC;AAAD,CAAC,AAJD,CAAqC,mBAAQ,GAI5C;AAJY,0CAAe","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"]}
|
|
@@ -3,10 +3,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
3
3
|
var extendStatics = function (d, b) {
|
|
4
4
|
extendStatics = Object.setPrototypeOf ||
|
|
5
5
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
7
|
return extendStatics(d, b);
|
|
8
8
|
};
|
|
9
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");
|
|
10
12
|
extendStatics(d, b);
|
|
11
13
|
function __() { this.constructor = d; }
|
|
12
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -27,7 +29,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
27
29
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
28
30
|
function step(op) {
|
|
29
31
|
if (f) throw new TypeError("Generator is already executing.");
|
|
30
|
-
while (_) try {
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
31
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;
|
|
32
34
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
33
35
|
switch (op[0]) {
|
|
@@ -64,7 +66,7 @@ var WaitForSentry = /** @class */ (function (_super) {
|
|
|
64
66
|
var _this = this;
|
|
65
67
|
return __generator(this, function (_a) {
|
|
66
68
|
switch (_a.label) {
|
|
67
|
-
case 0: return [4 /*yield*/, Wizard_1.getCurrentIntegration(answers).shouldEmit(answers)];
|
|
69
|
+
case 0: return [4 /*yield*/, (0, Wizard_1.getCurrentIntegration)(answers).shouldEmit(answers)];
|
|
68
70
|
case 1:
|
|
69
71
|
if (!(_a.sent())) {
|
|
70
72
|
return [2 /*return*/, {}];
|
|
@@ -86,24 +88,24 @@ var WaitForSentry = /** @class */ (function (_super) {
|
|
|
86
88
|
switch (_a.label) {
|
|
87
89
|
case 0:
|
|
88
90
|
_a.trys.push([0, 4, , 5]);
|
|
89
|
-
this.debug("Polling: "
|
|
90
|
-
return [4 /*yield*/, r2.get(baseUrl
|
|
91
|
+
this.debug("Polling: ".concat(baseUrl, "api/0/wizard/").concat(answers.hash, "/"));
|
|
92
|
+
return [4 /*yield*/, r2.get("".concat(baseUrl, "api/0/wizard/").concat(answers.hash, "/")).response];
|
|
91
93
|
case 1:
|
|
92
94
|
response = _a.sent();
|
|
93
|
-
this.debug(
|
|
95
|
+
this.debug('Polling received data');
|
|
94
96
|
if (response.status !== 200) {
|
|
95
|
-
throw new Error("Received status "
|
|
97
|
+
throw new Error("Received status ".concat(response.status));
|
|
96
98
|
}
|
|
97
99
|
return [4 /*yield*/, response.json()];
|
|
98
100
|
case 2:
|
|
99
101
|
data = _a.sent();
|
|
100
102
|
// Delete the wizard hash since we were able to fetch the data
|
|
101
|
-
return [4 /*yield*/, r2.delete(baseUrl
|
|
103
|
+
return [4 /*yield*/, r2.delete("".concat(baseUrl, "api/0/wizard/").concat(answers.hash, "/"))];
|
|
102
104
|
case 3:
|
|
103
105
|
// Delete the wizard hash since we were able to fetch the data
|
|
104
106
|
_a.sent();
|
|
105
107
|
BottomBar_1.BottomBar.hide();
|
|
106
|
-
this.debug(
|
|
108
|
+
this.debug('Polling Success!');
|
|
107
109
|
resolve({ wizard: data });
|
|
108
110
|
return [3 /*break*/, 5];
|
|
109
111
|
case 4:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WaitForSentry.js","sourceRoot":"","sources":["../../../lib/Steps/WaitForSentry.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WaitForSentry.js","sourceRoot":"","sources":["../../../lib/Steps/WaitForSentry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,iDAAgD;AAChD,2CAAyD;AACzD,uCAAsC;AAEtC,IAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzB;IAAmC,iCAAQ;IAA3C;;IAyCA,CAAC;IAxCc,4BAAI,GAAjB,UAAkB,OAAgB;;;;;4BAC1B,qBAAM,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAA;;wBAA9D,IAAI,CAAC,CAAC,SAAwD,CAAC,EAAE;4BAC/D,sBAAO,EAAE,EAAC;yBACX;wBACD,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE;4BAC1B,sBAAO,EAAE,EAAC;yBACX;wBAED,qDAAqD;wBACrD,sBAAO,IAAI,OAAO,CAAC,UAAO,OAAO,EAAE,OAAO;;;;oCACxC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC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oBAAC;AAAD,CAAC,AAzCD,CAAmC,mBAAQ,GAyC1C;AAzCY,sCAAa","sourcesContent":["import type { Answers } from 'inquirer';\n\nimport { BottomBar } from '../Helper/BottomBar';\nimport { getCurrentIntegration } from '../Helper/Wizard';\nimport { BaseStep } from './BaseStep';\n\nconst r2 = require('r2');\n\nexport class WaitForSentry extends BaseStep {\n public async emit(answers: Answers): Promise<Answers> {\n if (!(await getCurrentIntegration(answers).shouldEmit(answers))) {\n return {};\n }\n if (this._argv.skipConnect) {\n return {};\n }\n\n // eslint-disable-next-line no-async-promise-executor\n return new Promise(async (resolve, _reject) => {\n this.debug(answers);\n\n BottomBar.show('Waiting for Sentry...');\n const baseUrl = this._argv.url;\n\n const polling = async (): Promise<void> => {\n try {\n this.debug(`Polling: ${baseUrl}api/0/wizard/${answers.hash}/`);\n const response = await r2.get(\n `${baseUrl}api/0/wizard/${answers.hash}/`,\n ).response;\n this.debug('Polling received data');\n if (response.status !== 200) {\n throw new Error(`Received status ${response.status}`);\n }\n const data = await response.json();\n // Delete the wizard hash since we were able to fetch the data\n await r2.delete(`${baseUrl}api/0/wizard/${answers.hash}/`);\n BottomBar.hide();\n this.debug('Polling Success!');\n resolve({ wizard: data });\n } catch (e) {\n this.debug('Polling received:');\n this.debug(e);\n setTimeout(polling.bind(this), 1000);\n }\n };\n polling.bind(this)();\n });\n }\n}\n"]}
|