@eclipse-che/che-devworkspace-generator 7.92.0 → 7.93.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/lib/api/devfile-context.js +2 -2
- package/lib/api/devfile-context.js.map +1 -1
- package/lib/bitbucket/bitbucket-module.js +6 -6
- package/lib/bitbucket/bitbucket-module.js.map +1 -1
- package/lib/bitbucket/bitbucket-resolver.js +23 -26
- package/lib/bitbucket/bitbucket-resolver.js.map +1 -1
- package/lib/bitbucket/bitbucket-url.js +21 -19
- package/lib/bitbucket/bitbucket-url.js.map +1 -1
- package/lib/bitbucket-server/bitbucket-server-module.js +6 -6
- package/lib/bitbucket-server/bitbucket-server-module.js.map +1 -1
- package/lib/bitbucket-server/bitbucket-server-resolver.js +32 -35
- package/lib/bitbucket-server/bitbucket-server-resolver.js.map +1 -1
- package/lib/bitbucket-server/bitbucket-server-url.js +26 -21
- package/lib/bitbucket-server/bitbucket-server-url.js.map +1 -1
- package/lib/devfile/dev-container-component-finder.js +39 -81
- package/lib/devfile/dev-container-component-finder.js.map +1 -1
- package/lib/devfile/dev-container-component-inserter.js +30 -75
- package/lib/devfile/dev-container-component-inserter.js.map +1 -1
- package/lib/devfile/devfile-module.js +5 -5
- package/lib/devfile/devfile-module.js.map +1 -1
- package/lib/devfile-schema/devfile-schema-module.js +4 -4
- package/lib/devfile-schema/devfile-schema-module.js.map +1 -1
- package/lib/devfile-schema/devfile-schema-validator.js +22 -25
- package/lib/devfile-schema/devfile-schema-validator.js.map +1 -1
- package/lib/entrypoint.js +9 -54
- package/lib/entrypoint.js.map +1 -1
- package/lib/fetch/fetch-module.js +4 -4
- package/lib/fetch/fetch-module.js.map +1 -1
- package/lib/fetch/url-fetcher.js +33 -87
- package/lib/fetch/url-fetcher.js.map +1 -1
- package/lib/generate.js +89 -144
- package/lib/generate.js.map +1 -1
- package/lib/github/github-module.js +6 -6
- package/lib/github/github-module.js.map +1 -1
- package/lib/github/github-resolver.js +26 -29
- package/lib/github/github-resolver.js.map +1 -1
- package/lib/github/github-url.js +24 -19
- package/lib/github/github-url.js.map +1 -1
- package/lib/inversify/inversify-binding.js +26 -68
- package/lib/inversify/inversify-binding.js.map +1 -1
- package/lib/main.js +170 -225
- package/lib/main.js.map +1 -1
- package/lib/plugin-registry/plugin-registry-module.js +4 -4
- package/lib/plugin-registry/plugin-registry-module.js.map +1 -1
- package/lib/plugin-registry/plugin-registry-resolver.js +23 -70
- package/lib/plugin-registry/plugin-registry-resolver.js.map +1 -1
- package/lib/resolve/git-url-resolver.js +16 -18
- package/lib/resolve/git-url-resolver.js.map +1 -1
- package/lib/resolve/resolve-module.js +4 -4
- package/lib/resolve/resolve-module.js.map +1 -1
- package/lib/resolve/resolver.js +1 -1
- package/lib/resolve/url.js +1 -1
- package/lib/types.js +3 -3
- package/lib/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -14,85 +14,40 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
14
14
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
15
15
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16
16
|
};
|
|
17
|
-
|
|
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
|
-
exports.__esModule = true;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
18
|
exports.DevContainerComponentInserter = void 0;
|
|
55
|
-
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
56
20
|
/**
|
|
57
21
|
* Adds a new component on empty devfile with specific name and image
|
|
58
22
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
23
|
+
let DevContainerComponentInserter = class DevContainerComponentInserter {
|
|
24
|
+
DEFAULT_DEV_CONTAINER_IMAGE = 'quay.io/devfile/universal-developer-image:ubi8-latest';
|
|
25
|
+
DEFAULT_DEV_CONTAINER_NAME = 'dev';
|
|
26
|
+
async insert(devfileContext, defaultComponentImage) {
|
|
27
|
+
if (!devfileContext.devWorkspace.spec) {
|
|
28
|
+
devfileContext.devWorkspace.spec = {
|
|
29
|
+
started: true,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
if (!devfileContext.devWorkspace.spec.template) {
|
|
33
|
+
devfileContext.devWorkspace.spec.template = {};
|
|
34
|
+
}
|
|
35
|
+
if (!devfileContext.devWorkspace.spec.template.components) {
|
|
36
|
+
devfileContext.devWorkspace.spec.template.components = [];
|
|
37
|
+
}
|
|
38
|
+
const devContainerImage = defaultComponentImage ? defaultComponentImage : this.DEFAULT_DEV_CONTAINER_IMAGE;
|
|
39
|
+
console.log(`No container component has been found. A default container component with image ${devContainerImage} will be added.`);
|
|
40
|
+
const devContainerComponent = {
|
|
41
|
+
name: this.DEFAULT_DEV_CONTAINER_NAME,
|
|
42
|
+
container: {
|
|
43
|
+
image: devContainerImage,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
devfileContext.devWorkspace.spec.template.components.push(devContainerComponent);
|
|
63
47
|
}
|
|
64
|
-
|
|
65
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
-
var devContainerImage, devContainerComponent;
|
|
67
|
-
return __generator(this, function (_a) {
|
|
68
|
-
if (!devfileContext.devWorkspace.spec) {
|
|
69
|
-
devfileContext.devWorkspace.spec = {
|
|
70
|
-
started: true
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
if (!devfileContext.devWorkspace.spec.template) {
|
|
74
|
-
devfileContext.devWorkspace.spec.template = {};
|
|
75
|
-
}
|
|
76
|
-
if (!devfileContext.devWorkspace.spec.template.components) {
|
|
77
|
-
devfileContext.devWorkspace.spec.template.components = [];
|
|
78
|
-
}
|
|
79
|
-
devContainerImage = defaultComponentImage ? defaultComponentImage : this.DEFAULT_DEV_CONTAINER_IMAGE;
|
|
80
|
-
console.log("No container component has been found. A default container component with image ".concat(devContainerImage, " will be added."));
|
|
81
|
-
devContainerComponent = {
|
|
82
|
-
name: this.DEFAULT_DEV_CONTAINER_NAME,
|
|
83
|
-
container: {
|
|
84
|
-
image: devContainerImage
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
devfileContext.devWorkspace.spec.template.components.push(devContainerComponent);
|
|
88
|
-
return [2 /*return*/];
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
|
-
DevContainerComponentInserter = __decorate([
|
|
93
|
-
(0, inversify_1.injectable)()
|
|
94
|
-
], DevContainerComponentInserter);
|
|
95
|
-
return DevContainerComponentInserter;
|
|
96
|
-
}());
|
|
48
|
+
};
|
|
97
49
|
exports.DevContainerComponentInserter = DevContainerComponentInserter;
|
|
50
|
+
exports.DevContainerComponentInserter = DevContainerComponentInserter = __decorate([
|
|
51
|
+
(0, inversify_1.injectable)()
|
|
52
|
+
], DevContainerComponentInserter);
|
|
98
53
|
//# sourceMappingURL=dev-container-component-inserter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-container-component-inserter.js","sourceRoot":"","sources":["../../src/devfile/dev-container-component-inserter.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE
|
|
1
|
+
{"version":3,"file":"dev-container-component-inserter.js","sourceRoot":"","sources":["../../src/devfile/dev-container-component-inserter.ts"],"names":[],"mappings":";AAAA;;;;;;;;yEAQyE;;;;;;;;;AAIzE,yCAAuC;AAEvC;;GAEG;AAEI,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;IAC/B,2BAA2B,GAAG,uDAAuD,CAAC;IACtF,0BAA0B,GAAG,KAAK,CAAC;IAE5C,KAAK,CAAC,MAAM,CAAC,cAA8B,EAAE,qBAA8B;QACzE,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;YACtC,cAAc,CAAC,YAAY,CAAC,IAAI,GAAG;gBACjC,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC/C,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACjD,CAAC;QACD,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC1D,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,GAAG,EAAE,CAAC;QAC5D,CAAC;QAED,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,IAAI,CAAC,2BAA2B,CAAC;QAC3G,OAAO,CAAC,GAAG,CACT,mFAAmF,iBAAiB,iBAAiB,CACtH,CAAC;QACF,MAAM,qBAAqB,GAA+C;YACxE,IAAI,EAAE,IAAI,CAAC,0BAA0B;YACrC,SAAS,EAAE;gBACT,KAAK,EAAE,iBAAiB;aACzB;SACF,CAAC;QAEF,cAAc,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IACnF,CAAC;CACF,CAAA;AA9BY,sEAA6B;wCAA7B,6BAA6B;IADzC,IAAA,sBAAU,GAAE;GACA,6BAA6B,CA8BzC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.devfileModule = void 0;
|
|
4
4
|
/**********************************************************************
|
|
5
5
|
* Copyright (c) 2022-2024
|
|
@@ -10,10 +10,10 @@ exports.devfileModule = void 0;
|
|
|
10
10
|
*
|
|
11
11
|
* SPDX-License-Identifier: EPL-2.0
|
|
12
12
|
***********************************************************************/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
const dev_container_component_finder_1 = require("./dev-container-component-finder");
|
|
15
|
+
const dev_container_component_inserter_1 = require("./dev-container-component-inserter");
|
|
16
|
+
const devfileModule = new inversify_1.ContainerModule((bind) => {
|
|
17
17
|
bind(dev_container_component_finder_1.DevContainerComponentFinder).toSelf().inSingletonScope();
|
|
18
18
|
bind(dev_container_component_inserter_1.DevContainerComponentInserter).toSelf().inSingletonScope();
|
|
19
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devfile-module.js","sourceRoot":"","sources":["../../src/devfile/devfile-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,
|
|
1
|
+
{"version":3,"file":"devfile-module.js","sourceRoot":"","sources":["../../src/devfile/devfile-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,yCAAwD;AAExD,qFAA+E;AAC/E,yFAAmF;AAEnF,MAAM,aAAa,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,EAAE;IAClE,IAAI,CAAC,4DAA2B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAC9D,IAAI,CAAC,gEAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAClE,CAAC,CAAC,CAAC;AAEM,sCAAa"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.devfileSchemaModule = void 0;
|
|
4
4
|
/**********************************************************************
|
|
5
5
|
* Copyright (c) 2022-2024
|
|
@@ -10,9 +10,9 @@ exports.devfileSchemaModule = void 0;
|
|
|
10
10
|
*
|
|
11
11
|
* SPDX-License-Identifier: EPL-2.0
|
|
12
12
|
***********************************************************************/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
const devfile_schema_validator_1 = require("./devfile-schema-validator");
|
|
15
|
+
const devfileSchemaModule = new inversify_1.ContainerModule((bind) => {
|
|
16
16
|
bind(devfile_schema_validator_1.DevfileSchemaValidator).toSelf().inSingletonScope();
|
|
17
17
|
});
|
|
18
18
|
exports.devfileSchemaModule = devfileSchemaModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devfile-schema-module.js","sourceRoot":"","sources":["../../src/devfile-schema/devfile-schema-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,
|
|
1
|
+
{"version":3,"file":"devfile-schema-module.js","sourceRoot":"","sources":["../../src/devfile-schema/devfile-schema-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,yCAAwD;AAExD,yEAAoE;AAEpE,MAAM,mBAAmB,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,EAAE;IACxE,IAAI,CAAC,iDAAsB,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAC3D,CAAC,CAAC,CAAC;AAEM,kDAAmB"}
|
|
@@ -28,7 +28,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
28
28
|
__setModuleDefault(result, mod);
|
|
29
29
|
return result;
|
|
30
30
|
};
|
|
31
|
-
exports
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
32
|
exports.DevfileSchemaValidator = void 0;
|
|
33
33
|
/**********************************************************************
|
|
34
34
|
* Copyright (c) 2022-2024
|
|
@@ -39,19 +39,17 @@ exports.DevfileSchemaValidator = void 0;
|
|
|
39
39
|
*
|
|
40
40
|
* SPDX-License-Identifier: EPL-2.0
|
|
41
41
|
***********************************************************************/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
DevfileSchemaValidator.prototype.getDevfileSchema = function (version) {
|
|
42
|
+
const inversify_1 = require("inversify");
|
|
43
|
+
const devfileSchemaV200 = __importStar(require("./2.0.0/devfile.json"));
|
|
44
|
+
const devfileSchemaV210 = __importStar(require("./2.1.0/devfile.json"));
|
|
45
|
+
const devfileSchemaV220 = __importStar(require("./2.2.0/devfile.json"));
|
|
46
|
+
const devfileSchemaV221 = __importStar(require("./2.2.1/devfile.json"));
|
|
47
|
+
const devfileSchemaV222 = __importStar(require("./2.2.2/devfile.json"));
|
|
48
|
+
const devfileSchemaV230 = __importStar(require("./2.3.0/devfile.json"));
|
|
49
|
+
const Validator = __importStar(require("jsonschema"));
|
|
50
|
+
const devfile_context_1 = require("../api/devfile-context");
|
|
51
|
+
let DevfileSchemaValidator = class DevfileSchemaValidator {
|
|
52
|
+
getDevfileSchema(version) {
|
|
55
53
|
switch (version) {
|
|
56
54
|
case devfile_context_1.DevfileSchemaVersion.V200:
|
|
57
55
|
return devfileSchemaV200;
|
|
@@ -66,19 +64,18 @@ var DevfileSchemaValidator = /** @class */ (function () {
|
|
|
66
64
|
case devfile_context_1.DevfileSchemaVersion.V230:
|
|
67
65
|
return devfileSchemaV230;
|
|
68
66
|
default:
|
|
69
|
-
throw new Error(
|
|
67
|
+
throw new Error(`Dev Workspace generator tool doesn't support devfile version: ${version}`);
|
|
70
68
|
}
|
|
71
|
-
}
|
|
69
|
+
}
|
|
72
70
|
// Validates devfile against schema
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
validateDevfile(devfile, version) {
|
|
72
|
+
const schema = this.getDevfileSchema(version);
|
|
73
|
+
const validatorResult = Validator.validate(devfile, schema, { nestedErrors: true });
|
|
76
74
|
return validatorResult;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
(0, inversify_1.injectable)()
|
|
80
|
-
], DevfileSchemaValidator);
|
|
81
|
-
return DevfileSchemaValidator;
|
|
82
|
-
}());
|
|
75
|
+
}
|
|
76
|
+
};
|
|
83
77
|
exports.DevfileSchemaValidator = DevfileSchemaValidator;
|
|
78
|
+
exports.DevfileSchemaValidator = DevfileSchemaValidator = __decorate([
|
|
79
|
+
(0, inversify_1.injectable)()
|
|
80
|
+
], DevfileSchemaValidator);
|
|
84
81
|
//# sourceMappingURL=devfile-schema-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devfile-schema-validator.js","sourceRoot":"","sources":["../../src/devfile-schema/devfile-schema-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;yEAQyE;AACzE,
|
|
1
|
+
{"version":3,"file":"devfile-schema-validator.js","sourceRoot":"","sources":["../../src/devfile-schema/devfile-schema-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;yEAQyE;AACzE,yCAAuC;AAEvC,wEAA0D;AAC1D,wEAA0D;AAC1D,wEAA0D;AAC1D,wEAA0D;AAC1D,wEAA0D;AAC1D,wEAA0D;AAC1D,sDAAwC;AACxC,4DAA8D;AAGvD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IACjC,gBAAgB,CAAC,OAAe;QAC9B,QAAQ,OAAO,EAAE,CAAC;YAChB,KAAK,sCAAoB,CAAC,IAAI;gBAC5B,OAAO,iBAAiB,CAAC;YAC3B,KAAK,sCAAoB,CAAC,IAAI;gBAC5B,OAAO,iBAAiB,CAAC;YAC3B,KAAK,sCAAoB,CAAC,IAAI;gBAC5B,OAAO,iBAAiB,CAAC;YAC3B,KAAK,sCAAoB,CAAC,IAAI;gBAC5B,OAAO,iBAAiB,CAAC;YAC3B,KAAK,sCAAoB,CAAC,IAAI;gBAC5B,OAAO,iBAAiB,CAAC;YAC3B,KAAK,sCAAoB,CAAC,IAAI;gBAC5B,OAAO,iBAAiB,CAAC;YAC3B;gBACE,MAAM,IAAI,KAAK,CAAC,iEAAiE,OAAO,EAAE,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED,mCAAmC;IACnC,eAAe,CAAC,OAAY,EAAE,OAAe;QAC3C,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC9C,MAAM,eAAe,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QAEpF,OAAO,eAAe,CAAC;IACzB,CAAC;CACF,CAAA;AA3BY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CA2BlC"}
|
package/lib/entrypoint.js
CHANGED
|
@@ -9,59 +9,14 @@
|
|
|
9
9
|
*
|
|
10
10
|
* SPDX-License-Identifier: EPL-2.0
|
|
11
11
|
***********************************************************************/
|
|
12
|
-
|
|
13
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
14
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
15
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
16
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
18
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
22
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
23
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
24
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
25
|
-
function step(op) {
|
|
26
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
27
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
28
|
-
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;
|
|
29
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
30
|
-
switch (op[0]) {
|
|
31
|
-
case 0: case 1: t = op; break;
|
|
32
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
33
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
34
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
35
|
-
default:
|
|
36
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
37
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
38
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
39
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
40
|
-
if (t[2]) _.ops.pop();
|
|
41
|
-
_.trys.pop(); continue;
|
|
42
|
-
}
|
|
43
|
-
op = body.call(thisArg, _);
|
|
44
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
45
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
exports.__esModule = true;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
49
13
|
require("reflect-metadata");
|
|
50
|
-
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
case 1:
|
|
59
|
-
success = _a.sent();
|
|
60
|
-
if (!success) {
|
|
61
|
-
process.exit(1);
|
|
62
|
-
}
|
|
63
|
-
return [2 /*return*/];
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
}); })();
|
|
14
|
+
const main_1 = require("./main");
|
|
15
|
+
(async () => {
|
|
16
|
+
const main = new main_1.Main();
|
|
17
|
+
const success = await main.start();
|
|
18
|
+
if (!success) {
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
67
22
|
//# sourceMappingURL=entrypoint.js.map
|
package/lib/entrypoint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":";;AACA;;;;;;;;yEAQyE
|
|
1
|
+
{"version":3,"file":"entrypoint.js","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":";;AACA;;;;;;;;yEAQyE;;AAEzE,4BAA0B;AAE1B,iCAA8B;AAE9B,CAAC,KAAK,IAAmB,EAAE;IACzB,MAAM,IAAI,GAAG,IAAI,WAAI,EAAE,CAAC;IACxB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;IACnC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchModule = void 0;
|
|
4
4
|
/**********************************************************************
|
|
5
5
|
* Copyright (c) 2022-2024
|
|
@@ -10,9 +10,9 @@ exports.fetchModule = void 0;
|
|
|
10
10
|
*
|
|
11
11
|
* SPDX-License-Identifier: EPL-2.0
|
|
12
12
|
***********************************************************************/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const inversify_1 = require("inversify");
|
|
14
|
+
const url_fetcher_1 = require("./url-fetcher");
|
|
15
|
+
const fetchModule = new inversify_1.ContainerModule((bind) => {
|
|
16
16
|
bind(url_fetcher_1.UrlFetcher).toSelf().inSingletonScope();
|
|
17
17
|
});
|
|
18
18
|
exports.fetchModule = fetchModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-module.js","sourceRoot":"","sources":["../../src/fetch/fetch-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,
|
|
1
|
+
{"version":3,"file":"fetch-module.js","sourceRoot":"","sources":["../../src/fetch/fetch-module.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;yEAQyE;AACzE,yCAAwD;AAExD,+CAA2C;AAE3C,MAAM,WAAW,GAAG,IAAI,2BAAe,CAAC,CAAC,IAAqB,EAAE,EAAE;IAChE,IAAI,CAAC,wBAAU,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;AAC/C,CAAC,CAAC,CAAC;AAEM,kCAAW"}
|
package/lib/fetch/url-fetcher.js
CHANGED
|
@@ -5,43 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
18
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
19
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
20
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
21
|
-
function step(op) {
|
|
22
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
23
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
24
|
-
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;
|
|
25
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26
|
-
switch (op[0]) {
|
|
27
|
-
case 0: case 1: t = op; break;
|
|
28
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
29
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
30
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
31
|
-
default:
|
|
32
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
33
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
34
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
35
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
36
|
-
if (t[2]) _.ops.pop();
|
|
37
|
-
_.trys.pop(); continue;
|
|
38
|
-
}
|
|
39
|
-
op = body.call(thisArg, _);
|
|
40
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
41
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
exports.__esModule = true;
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
9
|
exports.UrlFetcher = void 0;
|
|
46
10
|
/**********************************************************************
|
|
47
11
|
* Copyright (c) 2022-2024
|
|
@@ -52,63 +16,45 @@ exports.UrlFetcher = void 0;
|
|
|
52
16
|
*
|
|
53
17
|
* SPDX-License-Identifier: EPL-2.0
|
|
54
18
|
***********************************************************************/
|
|
55
|
-
|
|
19
|
+
const inversify_1 = require("inversify");
|
|
56
20
|
/**
|
|
57
21
|
* Allow to grab external content
|
|
58
22
|
* if browser support is enabled, it will update URLs to make them work on browser side.
|
|
59
23
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
24
|
+
let UrlFetcher = class UrlFetcher {
|
|
25
|
+
// Can't use AxiosInstance interface there
|
|
26
|
+
axiosInstance;
|
|
63
27
|
// fetch content optionally, if the URL is not found, we return undefined without throwing errors
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
switch (_a.label) {
|
|
69
|
-
case 0:
|
|
70
|
-
_a.trys.push([0, 2, , 3]);
|
|
71
|
-
return [4 /*yield*/, this.axiosInstance.get(url, {
|
|
72
|
-
responseType: 'text'
|
|
73
|
-
})];
|
|
74
|
-
case 1:
|
|
75
|
-
response = _a.sent();
|
|
76
|
-
return [2 /*return*/, response.data];
|
|
77
|
-
case 2:
|
|
78
|
-
error_1 = _a.sent();
|
|
79
|
-
// not found then we return undefined
|
|
80
|
-
if (error_1.response && error_1.response.status === 404) {
|
|
81
|
-
return [2 /*return*/, undefined];
|
|
82
|
-
}
|
|
83
|
-
throw error_1;
|
|
84
|
-
case 3: return [2 /*return*/];
|
|
85
|
-
}
|
|
28
|
+
async fetchTextOptionalContent(url) {
|
|
29
|
+
try {
|
|
30
|
+
const response = await this.axiosInstance.get(url, {
|
|
31
|
+
responseType: 'text',
|
|
86
32
|
});
|
|
87
|
-
|
|
88
|
-
|
|
33
|
+
return response.data;
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
// not found then we return undefined
|
|
38
|
+
if (error.response && error.response.status === 404) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
throw error;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
89
44
|
// fetch content
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
return __generator(this, function (_a) {
|
|
94
|
-
switch (_a.label) {
|
|
95
|
-
case 0: return [4 /*yield*/, this.axiosInstance.get(url, {
|
|
96
|
-
responseType: 'text'
|
|
97
|
-
})];
|
|
98
|
-
case 1:
|
|
99
|
-
response = _a.sent();
|
|
100
|
-
return [2 /*return*/, response.data];
|
|
101
|
-
}
|
|
102
|
-
});
|
|
45
|
+
async fetchText(url) {
|
|
46
|
+
const response = await this.axiosInstance.get(url, {
|
|
47
|
+
responseType: 'text',
|
|
103
48
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
UrlFetcher = __decorate([
|
|
109
|
-
(0, inversify_1.injectable)()
|
|
110
|
-
], UrlFetcher);
|
|
111
|
-
return UrlFetcher;
|
|
112
|
-
}());
|
|
49
|
+
return response.data;
|
|
50
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
|
+
}
|
|
52
|
+
};
|
|
113
53
|
exports.UrlFetcher = UrlFetcher;
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, inversify_1.inject)(Symbol.for('AxiosInstance'))
|
|
56
|
+
], UrlFetcher.prototype, "axiosInstance", void 0);
|
|
57
|
+
exports.UrlFetcher = UrlFetcher = __decorate([
|
|
58
|
+
(0, inversify_1.injectable)()
|
|
59
|
+
], UrlFetcher);
|
|
114
60
|
//# sourceMappingURL=url-fetcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url-fetcher.js","sourceRoot":"","sources":["../../src/fetch/url-fetcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"url-fetcher.js","sourceRoot":"","sources":["../../src/fetch/url-fetcher.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;yEAQyE;AACzE,yCAA+C;AAI/C;;;GAGG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,0CAA0C;IAElC,aAAa,CAAgB;IAErC,iGAAiG;IACjG,KAAK,CAAC,wBAAwB,CAAC,GAAW;QACxC,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,GAAG,EAAE;gBACzD,YAAY,EAAE,MAAM;aACrB,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;YACrB,8DAA8D;QAChE,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,qCAAqC;YACrC,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;gBACpD,OAAO,SAAS,CAAC;YACnB,CAAC;YACD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,gBAAgB;IAChB,KAAK,CAAC,SAAS,CAAC,GAAW;QACzB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAS,GAAG,EAAE;YACzD,YAAY,EAAE,MAAM;SACrB,CAAC,CAAC;QACH,OAAO,QAAQ,CAAC,IAAI,CAAC;QACrB,8DAA8D;IAChE,CAAC;CACF,CAAA;AA9BY,gCAAU;AAGb;IADP,IAAA,kBAAM,EAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;iDACC;qBAH1B,UAAU;IADtB,IAAA,sBAAU,GAAE;GACA,UAAU,CA8BtB"}
|