@eventcatalog/generator-apicurio 7.0.0 → 9.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/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3866,7 +3866,7 @@ var filterSchemas = (groupedSchemas, filters, includeAllVersions = false) => {
|
|
|
3866
3866
|
// package.json
|
|
3867
3867
|
var package_default = {
|
|
3868
3868
|
name: "@eventcatalog/generator-apicurio",
|
|
3869
|
-
version: "
|
|
3869
|
+
version: "9.0.0",
|
|
3870
3870
|
description: "Apicurio Registry generator for EventCatalog",
|
|
3871
3871
|
scripts: {
|
|
3872
3872
|
build: "tsup",
|
|
@@ -3898,14 +3898,14 @@ var package_default = {
|
|
|
3898
3898
|
types: "./dist/index.d.ts",
|
|
3899
3899
|
dependencies: {
|
|
3900
3900
|
"@changesets/cli": "^2.27.8",
|
|
3901
|
-
"@eventcatalog/sdk": "^2.
|
|
3902
|
-
axios: "^1.
|
|
3901
|
+
"@eventcatalog/sdk": "^2.18.2",
|
|
3902
|
+
axios: "^1.13.5",
|
|
3903
3903
|
chalk: "4.1.2",
|
|
3904
3904
|
"update-notifier": "^7.3.1"
|
|
3905
3905
|
},
|
|
3906
3906
|
peerDependencies: {
|
|
3907
|
-
"@eventcatalog/generator-asyncapi": ">=6.
|
|
3908
|
-
"@eventcatalog/generator-openapi": ">=7.
|
|
3907
|
+
"@eventcatalog/generator-asyncapi": ">=6.2.0",
|
|
3908
|
+
"@eventcatalog/generator-openapi": ">=7.10.0"
|
|
3909
3909
|
},
|
|
3910
3910
|
peerDependenciesMeta: {
|
|
3911
3911
|
"@eventcatalog/generator-openapi": {
|
|
@@ -4488,7 +4488,8 @@ var index_default = async (config, options) => {
|
|
|
4488
4488
|
writeDomain,
|
|
4489
4489
|
addServiceToDomain,
|
|
4490
4490
|
addFileToService,
|
|
4491
|
-
getSpecificationFilesForService
|
|
4491
|
+
getSpecificationFilesForService,
|
|
4492
|
+
getResourcePath
|
|
4492
4493
|
} = (0, import_sdk2.default)(eventCatalogDirectory);
|
|
4493
4494
|
const LICENSE_KEY = process.env.EVENTCATALOG_LICENSE_KEY_APICURIO_SCHEMA_REGISTRY || options.licenseKey || "";
|
|
4494
4495
|
await checkLicense_default(package_default.name, LICENSE_KEY);
|
|
@@ -4582,7 +4583,15 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4582
4583
|
markdown: getMarkdownForService({ registryUrl: REGISTRY_URL })
|
|
4583
4584
|
} : {}
|
|
4584
4585
|
};
|
|
4585
|
-
let servicePath =
|
|
4586
|
+
let servicePath = pathToService;
|
|
4587
|
+
if (options.domain) {
|
|
4588
|
+
const domainResource = await getResourcePath(eventCatalogDirectory, options.domain.id, options.domain.version);
|
|
4589
|
+
if (domainResource) {
|
|
4590
|
+
servicePath = import_path4.default.join("../", domainResource.directory, "services", service.id);
|
|
4591
|
+
} else {
|
|
4592
|
+
servicePath = import_path4.default.join("../", "domains", options.domain.id, "services", service.id);
|
|
4593
|
+
}
|
|
4594
|
+
}
|
|
4586
4595
|
let existingSpecifications = {};
|
|
4587
4596
|
if (serviceInCatalog?.specifications && typeof serviceInCatalog.specifications === "object" && !Array.isArray(serviceInCatalog.specifications)) {
|
|
4588
4597
|
existingSpecifications = serviceInCatalog.specifications;
|
|
@@ -4624,7 +4633,15 @@ Processing domain: ${domainName} (v${domainVersion})`));
|
|
|
4624
4633
|
await addFileToService(service.id, { content: specFile.content, fileName: specFile.fileName });
|
|
4625
4634
|
}
|
|
4626
4635
|
for (const { specConfig, fileName, content } of specsWithGenerators) {
|
|
4627
|
-
|
|
4636
|
+
let specFilePath = import_path4.default.join(eventCatalogDirectory, "services", service.id, fileName);
|
|
4637
|
+
if (options.domain) {
|
|
4638
|
+
const domainResource = await getResourcePath(eventCatalogDirectory, options.domain.id, options.domain.version);
|
|
4639
|
+
if (domainResource) {
|
|
4640
|
+
specFilePath = import_path4.default.join(eventCatalogDirectory, domainResource.directory, "services", service.id, fileName);
|
|
4641
|
+
} else {
|
|
4642
|
+
specFilePath = import_path4.default.join(eventCatalogDirectory, "domains", options.domain.id, "services", service.id, fileName);
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4628
4645
|
const specDir = import_path4.default.dirname(specFilePath);
|
|
4629
4646
|
if (!import_fs3.default.existsSync(specDir)) {
|
|
4630
4647
|
import_fs3.default.mkdirSync(specDir, { recursive: true });
|