@eventcatalog/core 2.55.5 → 2.56.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/README.md +5 -1
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/chunk-5VBIXL6C.js +26 -0
- package/dist/{chunk-VHDHWCNH.js → chunk-BN73V2HE.js} +1 -1
- package/dist/{chunk-7G5UA26D.js → chunk-KO6TU5OM.js} +1 -1
- package/dist/{chunk-TB6YQPH5.js → chunk-RMZ427FV.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +45 -150
- package/dist/eventcatalog.js +36 -16
- package/dist/features.cjs +0 -134
- package/dist/features.d.cts +1 -4
- package/dist/features.d.ts +1 -4
- package/dist/features.js +1 -7
- package/eventcatalog/src/components/MDX/NodeGraph/Nodes/Actor.tsx +26 -4
- package/eventcatalog/src/components/MDX/SchemaViewer/SchemaProperty.astro +7 -0
- package/eventcatalog/src/content.config.ts +7 -0
- package/package.json +6 -5
- package/dist/chunk-I23A46WZ.js +0 -157
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
35
35
|
|
|
36
36
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
37
|
-
[](#contributors-)
|
|
38
38
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
39
39
|
|
|
40
40
|
[Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
|
|
@@ -259,6 +259,10 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
259
259
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/simonwfarrow"><img src="https://avatars.githubusercontent.com/u/3245908?v=4?s=100" width="100px;" alt="simonwfarrow"/><br /><sub><b>simonwfarrow</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=simonwfarrow" title="Code">💻</a></td>
|
|
260
260
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/augusto-romero-arango"><img src="https://avatars.githubusercontent.com/u/142316821?v=4?s=100" width="100px;" alt="Augusto Romero Arango"/><br /><sub><b>Augusto Romero Arango</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=augusto-romero-arango" title="Code">💻</a></td>
|
|
261
261
|
</tr>
|
|
262
|
+
<tr>
|
|
263
|
+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/cc-stjm"><img src="https://avatars.githubusercontent.com/u/47748595?v=4?s=100" width="100px;" alt="cc-stjm"/><br /><sub><b>cc-stjm</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=cc-stjm" title="Code">💻</a></td>
|
|
264
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/lucianlature/"><img src="https://avatars.githubusercontent.com/u/24992?v=4?s=100" width="100px;" alt="Lucian Lature"/><br /><sub><b>Lucian Lature</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/issues?q=author%3Alucianlature" title="Bug reports">🐛</a></td>
|
|
265
|
+
</tr>
|
|
262
266
|
</tbody>
|
|
263
267
|
</table>
|
|
264
268
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-BN73V2HE.js";
|
|
4
|
+
import "../chunk-KO6TU5OM.js";
|
|
5
|
+
import "../chunk-RMZ427FV.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getEventCatalogConfigFile
|
|
3
|
+
} from "./chunk-UPONRQSN.js";
|
|
4
|
+
|
|
5
|
+
// src/features.ts
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
var getProjectOutDir = async () => {
|
|
9
|
+
const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
|
|
10
|
+
return config?.outDir || "dist";
|
|
11
|
+
};
|
|
12
|
+
var isOutputServer = async () => {
|
|
13
|
+
const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
|
|
14
|
+
return config?.output === "server";
|
|
15
|
+
};
|
|
16
|
+
var isAuthEnabled = async () => {
|
|
17
|
+
const directory = process.env.PROJECT_DIR || process.cwd();
|
|
18
|
+
const hasAuthConfig = fs.existsSync(join(directory, "eventcatalog.auth.js"));
|
|
19
|
+
return hasAuthConfig;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export {
|
|
23
|
+
getProjectOutDir,
|
|
24
|
+
isOutputServer,
|
|
25
|
+
isAuthEnabled
|
|
26
|
+
};
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
|
|
|
157
157
|
var import_os = __toESM(require("os"), 1);
|
|
158
158
|
|
|
159
159
|
// package.json
|
|
160
|
-
var version = "2.
|
|
160
|
+
var version = "2.56.0";
|
|
161
161
|
|
|
162
162
|
// src/constants.ts
|
|
163
163
|
var VERSION = version;
|
|
@@ -195,7 +195,7 @@ var getFeatures = async (configFile) => {
|
|
|
195
195
|
output: configFile.output || "static"
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
|
-
var main = async (projectDir, { isEventCatalogStarterEnabled: isEventCatalogStarterEnabled2, isEventCatalogScaleEnabled: isEventCatalogScaleEnabled2, isBackstagePluginEnabled
|
|
198
|
+
var main = async (projectDir, { isEventCatalogStarterEnabled: isEventCatalogStarterEnabled2, isEventCatalogScaleEnabled: isEventCatalogScaleEnabled2, isBackstagePluginEnabled }) => {
|
|
199
199
|
if (process.env.NODE_ENV === "CI") return;
|
|
200
200
|
try {
|
|
201
201
|
await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
|
|
@@ -208,7 +208,7 @@ var main = async (projectDir, { isEventCatalogStarterEnabled: isEventCatalogStar
|
|
|
208
208
|
if (isEventCatalogScaleEnabled2) {
|
|
209
209
|
generatorNames.push("@eventcatalog/eventcatalog-scale");
|
|
210
210
|
}
|
|
211
|
-
if (
|
|
211
|
+
if (isBackstagePluginEnabled) {
|
|
212
212
|
generatorNames.push("@eventcatalog/backstage-plugin-eventcatalog");
|
|
213
213
|
}
|
|
214
214
|
const features = await getFeatures(configFile);
|
|
@@ -500,10 +500,9 @@ var resolve_catalog_dependencies_default = async (catalogDir, core2) => {
|
|
|
500
500
|
};
|
|
501
501
|
|
|
502
502
|
// src/eventcatalog.ts
|
|
503
|
-
var
|
|
503
|
+
var import_boxen = __toESM(require("boxen"), 1);
|
|
504
504
|
|
|
505
505
|
// src/features.ts
|
|
506
|
-
var import_boxen = __toESM(require("boxen"), 1);
|
|
507
506
|
var import_node_path5 = require("path");
|
|
508
507
|
var import_node_fs4 = __toESM(require("fs"), 1);
|
|
509
508
|
var getProjectOutDir = async () => {
|
|
@@ -519,137 +518,11 @@ var isAuthEnabled = async () => {
|
|
|
519
518
|
const hasAuthConfig = import_node_fs4.default.existsSync((0, import_node_path5.join)(directory, "eventcatalog.auth.js"));
|
|
520
519
|
return hasAuthConfig;
|
|
521
520
|
};
|
|
522
|
-
var isBackstagePluginEnabled = async (licenseKey) => {
|
|
523
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE || process.env.EVENTCATALOG_SCALE_LICENSE_KEY || null;
|
|
524
|
-
const acceptedPlugins = ["@eventcatalog/backstage-plugin-eventcatalog", "@eventcatalog/eventcatalog-scale"];
|
|
525
|
-
if (!LICENSE_KEY) {
|
|
526
|
-
return false;
|
|
527
|
-
}
|
|
528
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
529
|
-
method: "POST",
|
|
530
|
-
headers: {
|
|
531
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
532
|
-
"Content-Type": "application/json"
|
|
533
|
-
}
|
|
534
|
-
});
|
|
535
|
-
if (response.status !== 200) {
|
|
536
|
-
console.log(
|
|
537
|
-
"\nTried to verify your backstage license but it is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
538
|
-
);
|
|
539
|
-
return false;
|
|
540
|
-
}
|
|
541
|
-
if (response.status === 200) {
|
|
542
|
-
const data = await response.json();
|
|
543
|
-
if (!acceptedPlugins.includes(data.plugin)) {
|
|
544
|
-
console.log(
|
|
545
|
-
"\nInvalid license key for backstage integration, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
546
|
-
);
|
|
547
|
-
return false;
|
|
548
|
-
}
|
|
549
|
-
let message = "Backstage integration is enabled for EventCatalog";
|
|
550
|
-
if (data.is_trial) {
|
|
551
|
-
message += "\nYou are using a trial license for backstage integration.";
|
|
552
|
-
}
|
|
553
|
-
console.log(
|
|
554
|
-
(0, import_boxen.default)(message, {
|
|
555
|
-
padding: 1,
|
|
556
|
-
margin: 1,
|
|
557
|
-
borderColor: "green",
|
|
558
|
-
title: data.plugin,
|
|
559
|
-
titleAlignment: "center"
|
|
560
|
-
})
|
|
561
|
-
);
|
|
562
|
-
}
|
|
563
|
-
return true;
|
|
564
|
-
};
|
|
565
|
-
var isEventCatalogScaleEnabled = async (licenseKey) => {
|
|
566
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_SCALE_LICENSE_KEY || null;
|
|
567
|
-
if (!LICENSE_KEY) {
|
|
568
|
-
return false;
|
|
569
|
-
}
|
|
570
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
571
|
-
method: "POST",
|
|
572
|
-
headers: {
|
|
573
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
574
|
-
"Content-Type": "application/json"
|
|
575
|
-
}
|
|
576
|
-
});
|
|
577
|
-
if (response.status !== 200) {
|
|
578
|
-
console.log(
|
|
579
|
-
"\nTried to verify your EventCatalog Scale plan, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
580
|
-
);
|
|
581
|
-
return false;
|
|
582
|
-
}
|
|
583
|
-
if (response.status === 200) {
|
|
584
|
-
const data = await response.json();
|
|
585
|
-
if ("@eventcatalog/eventcatalog-scale" !== data.plugin) {
|
|
586
|
-
console.log(
|
|
587
|
-
"\nInvalid license key for EventCatalog Scale plan, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
588
|
-
);
|
|
589
|
-
return false;
|
|
590
|
-
}
|
|
591
|
-
let message = "EventCatalog Scale plan is enabled for EventCatalog";
|
|
592
|
-
if (data.is_trial) {
|
|
593
|
-
message += "\nYou are using a trial license for EventCatalog Scale plan.";
|
|
594
|
-
}
|
|
595
|
-
console.log(
|
|
596
|
-
(0, import_boxen.default)(message, {
|
|
597
|
-
padding: 1,
|
|
598
|
-
margin: 1,
|
|
599
|
-
borderColor: "green",
|
|
600
|
-
title: "@eventcatalog/eventcatalog-scale",
|
|
601
|
-
titleAlignment: "center"
|
|
602
|
-
})
|
|
603
|
-
);
|
|
604
|
-
}
|
|
605
|
-
return true;
|
|
606
|
-
};
|
|
607
|
-
var isEventCatalogStarterEnabled = async (licenseKey) => {
|
|
608
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_STARTER_LICENSE_KEY || null;
|
|
609
|
-
if (!LICENSE_KEY) {
|
|
610
|
-
return false;
|
|
611
|
-
}
|
|
612
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
613
|
-
method: "POST",
|
|
614
|
-
headers: {
|
|
615
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
616
|
-
"Content-Type": "application/json"
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
if (response.status !== 200) {
|
|
620
|
-
console.log(
|
|
621
|
-
"\nTried to verify your EventCatalog Starter plan, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
622
|
-
);
|
|
623
|
-
return false;
|
|
624
|
-
}
|
|
625
|
-
if (response.status === 200) {
|
|
626
|
-
const data = await response.json();
|
|
627
|
-
if ("@eventcatalog/eventcatalog-starter" !== data.plugin) {
|
|
628
|
-
console.log(
|
|
629
|
-
"\nInvalid license key for EventCatalog Starter plan, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
630
|
-
);
|
|
631
|
-
return false;
|
|
632
|
-
}
|
|
633
|
-
let message = "EventCatalog Starter plan is enabled for EventCatalog";
|
|
634
|
-
if (data.is_trial) {
|
|
635
|
-
message += "\nYou are using a trial license for EventCatalog Starter Plan.";
|
|
636
|
-
}
|
|
637
|
-
console.log(
|
|
638
|
-
(0, import_boxen.default)(message, {
|
|
639
|
-
padding: 1,
|
|
640
|
-
margin: 1,
|
|
641
|
-
borderColor: "green",
|
|
642
|
-
title: "@eventcatalog/eventcatalog-starter",
|
|
643
|
-
titleAlignment: "center"
|
|
644
|
-
})
|
|
645
|
-
);
|
|
646
|
-
}
|
|
647
|
-
return true;
|
|
648
|
-
};
|
|
649
521
|
|
|
650
522
|
// src/eventcatalog.ts
|
|
651
523
|
var import_update_notifier = __toESM(require("update-notifier"), 1);
|
|
652
524
|
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
525
|
+
var import_license = require("@eventcatalog/license");
|
|
653
526
|
var currentDir = import_node_path7.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
654
527
|
var program = new import_commander.Command().version(VERSION);
|
|
655
528
|
var dir = import_node_path7.default.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
@@ -723,7 +596,7 @@ var checkForUpdate = () => {
|
|
|
723
596
|
const message = `EventCatalog update available ${notifier.update.current} \u2192 ${notifier.update.latest}
|
|
724
597
|
Run npm i @eventcatalog/core to update`;
|
|
725
598
|
console.log(
|
|
726
|
-
(0,
|
|
599
|
+
(0, import_boxen.default)(message, {
|
|
727
600
|
padding: 1,
|
|
728
601
|
margin: 1,
|
|
729
602
|
align: "center",
|
|
@@ -758,9 +631,12 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
758
631
|
await checkAndConvertMdToMdx(dir, core);
|
|
759
632
|
await catalogToAstro(dir, core);
|
|
760
633
|
await copyServerFiles();
|
|
761
|
-
const canEmbedPages = await
|
|
762
|
-
|
|
763
|
-
|
|
634
|
+
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
635
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
636
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
637
|
+
);
|
|
638
|
+
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
639
|
+
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
764
640
|
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
765
641
|
checkForUpdate();
|
|
766
642
|
let watchUnsub;
|
|
@@ -775,7 +651,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
775
651
|
env: {
|
|
776
652
|
PROJECT_DIR: dir,
|
|
777
653
|
CATALOG_DIR: core,
|
|
778
|
-
ENABLE_EMBED: canEmbedPages,
|
|
654
|
+
ENABLE_EMBED: canEmbedPages || isEventCatalogScale,
|
|
779
655
|
EVENTCATALOG_STARTER: isEventCatalogStarter,
|
|
780
656
|
EVENTCATALOG_SCALE: isEventCatalogScale,
|
|
781
657
|
NODE_NO_WARNINGS: "1"
|
|
@@ -800,15 +676,18 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
800
676
|
}
|
|
801
677
|
copyCore();
|
|
802
678
|
await copyServerFiles();
|
|
803
|
-
const canEmbedPages = await
|
|
804
|
-
|
|
805
|
-
|
|
679
|
+
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
680
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
681
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
682
|
+
);
|
|
683
|
+
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
684
|
+
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
806
685
|
const isServerOutput = await isOutputServer();
|
|
807
686
|
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
808
687
|
await log_build_default(dir, {
|
|
809
688
|
isEventCatalogStarterEnabled: isEventCatalogStarter,
|
|
810
689
|
isEventCatalogScaleEnabled: isEventCatalogScale,
|
|
811
|
-
isBackstagePluginEnabled: canEmbedPages
|
|
690
|
+
isBackstagePluginEnabled: canEmbedPages || isEventCatalogScale
|
|
812
691
|
});
|
|
813
692
|
await resolve_catalog_dependencies_default(dir, core);
|
|
814
693
|
await checkAndConvertMdToMdx(dir, core);
|
|
@@ -874,26 +753,42 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
874
753
|
if (import_fs2.default.existsSync(import_node_path7.default.join(dir, ".env"))) {
|
|
875
754
|
import_dotenv.default.config({ path: import_node_path7.default.join(dir, ".env") });
|
|
876
755
|
}
|
|
877
|
-
const canEmbedPages = await
|
|
878
|
-
|
|
879
|
-
|
|
756
|
+
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
757
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
758
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
759
|
+
);
|
|
760
|
+
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
761
|
+
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
880
762
|
await copyServerFiles();
|
|
881
763
|
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
882
|
-
previewCatalog({ command, canEmbedPages, isEventCatalogStarter, isEventCatalogScale });
|
|
764
|
+
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
883
765
|
});
|
|
884
766
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
885
767
|
console.log("Starting preview of your build...");
|
|
886
768
|
if (import_fs2.default.existsSync(import_node_path7.default.join(dir, ".env"))) {
|
|
887
769
|
import_dotenv.default.config({ path: import_node_path7.default.join(dir, ".env") });
|
|
888
770
|
}
|
|
889
|
-
const canEmbedPages = await
|
|
890
|
-
|
|
891
|
-
|
|
771
|
+
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
772
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
773
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
774
|
+
);
|
|
775
|
+
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
776
|
+
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
892
777
|
const isServerOutput = await isOutputServer();
|
|
893
778
|
if (isServerOutput) {
|
|
894
|
-
startServerCatalog({
|
|
779
|
+
startServerCatalog({
|
|
780
|
+
command,
|
|
781
|
+
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
782
|
+
isEventCatalogStarter,
|
|
783
|
+
isEventCatalogScale
|
|
784
|
+
});
|
|
895
785
|
} else {
|
|
896
|
-
previewCatalog({
|
|
786
|
+
previewCatalog({
|
|
787
|
+
command,
|
|
788
|
+
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
789
|
+
isEventCatalogStarter,
|
|
790
|
+
isEventCatalogScale
|
|
791
|
+
});
|
|
897
792
|
}
|
|
898
793
|
});
|
|
899
794
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-BN73V2HE.js";
|
|
10
|
+
import "./chunk-KO6TU5OM.js";
|
|
11
11
|
import {
|
|
12
12
|
catalogToAstro,
|
|
13
13
|
checkAndConvertMdToMdx
|
|
@@ -15,15 +15,12 @@ import {
|
|
|
15
15
|
import "./chunk-55D645EH.js";
|
|
16
16
|
import {
|
|
17
17
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RMZ427FV.js";
|
|
19
19
|
import {
|
|
20
20
|
getProjectOutDir,
|
|
21
21
|
isAuthEnabled,
|
|
22
|
-
isBackstagePluginEnabled,
|
|
23
|
-
isEventCatalogScaleEnabled,
|
|
24
|
-
isEventCatalogStarterEnabled,
|
|
25
22
|
isOutputServer
|
|
26
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5VBIXL6C.js";
|
|
27
24
|
import {
|
|
28
25
|
generate
|
|
29
26
|
} from "./chunk-3W6JYTHP.js";
|
|
@@ -40,6 +37,7 @@ import concurrently from "concurrently";
|
|
|
40
37
|
import boxen from "boxen";
|
|
41
38
|
import updateNotifier from "update-notifier";
|
|
42
39
|
import dotenv from "dotenv";
|
|
40
|
+
import { isEventCatalogStarterEnabled, isEventCatalogScaleEnabled, isFeatureEnabled } from "@eventcatalog/license";
|
|
43
41
|
var currentDir = path.dirname(fileURLToPath(import.meta.url));
|
|
44
42
|
var program = new Command().version(VERSION);
|
|
45
43
|
var dir = path.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
@@ -148,7 +146,10 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
148
146
|
await checkAndConvertMdToMdx(dir, core);
|
|
149
147
|
await catalogToAstro(dir, core);
|
|
150
148
|
await copyServerFiles();
|
|
151
|
-
const canEmbedPages = await
|
|
149
|
+
const canEmbedPages = await isFeatureEnabled(
|
|
150
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
151
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
152
|
+
);
|
|
152
153
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
153
154
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
154
155
|
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
@@ -165,7 +166,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
165
166
|
env: {
|
|
166
167
|
PROJECT_DIR: dir,
|
|
167
168
|
CATALOG_DIR: core,
|
|
168
|
-
ENABLE_EMBED: canEmbedPages,
|
|
169
|
+
ENABLE_EMBED: canEmbedPages || isEventCatalogScale,
|
|
169
170
|
EVENTCATALOG_STARTER: isEventCatalogStarter,
|
|
170
171
|
EVENTCATALOG_SCALE: isEventCatalogScale,
|
|
171
172
|
NODE_NO_WARNINGS: "1"
|
|
@@ -190,7 +191,10 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
190
191
|
}
|
|
191
192
|
copyCore();
|
|
192
193
|
await copyServerFiles();
|
|
193
|
-
const canEmbedPages = await
|
|
194
|
+
const canEmbedPages = await isFeatureEnabled(
|
|
195
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
196
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
197
|
+
);
|
|
194
198
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
195
199
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
196
200
|
const isServerOutput = await isOutputServer();
|
|
@@ -198,7 +202,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
198
202
|
await log_build_default(dir, {
|
|
199
203
|
isEventCatalogStarterEnabled: isEventCatalogStarter,
|
|
200
204
|
isEventCatalogScaleEnabled: isEventCatalogScale,
|
|
201
|
-
isBackstagePluginEnabled: canEmbedPages
|
|
205
|
+
isBackstagePluginEnabled: canEmbedPages || isEventCatalogScale
|
|
202
206
|
});
|
|
203
207
|
await resolve_catalog_dependencies_default(dir, core);
|
|
204
208
|
await checkAndConvertMdToMdx(dir, core);
|
|
@@ -264,26 +268,42 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
264
268
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
265
269
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
266
270
|
}
|
|
267
|
-
const canEmbedPages = await
|
|
271
|
+
const canEmbedPages = await isFeatureEnabled(
|
|
272
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
273
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
274
|
+
);
|
|
268
275
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
269
276
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
270
277
|
await copyServerFiles();
|
|
271
278
|
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
272
|
-
previewCatalog({ command, canEmbedPages, isEventCatalogStarter, isEventCatalogScale });
|
|
279
|
+
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
273
280
|
});
|
|
274
281
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
275
282
|
console.log("Starting preview of your build...");
|
|
276
283
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
277
284
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
278
285
|
}
|
|
279
|
-
const canEmbedPages = await
|
|
286
|
+
const canEmbedPages = await isFeatureEnabled(
|
|
287
|
+
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
288
|
+
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
289
|
+
);
|
|
280
290
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
281
291
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
282
292
|
const isServerOutput = await isOutputServer();
|
|
283
293
|
if (isServerOutput) {
|
|
284
|
-
startServerCatalog({
|
|
294
|
+
startServerCatalog({
|
|
295
|
+
command,
|
|
296
|
+
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
297
|
+
isEventCatalogStarter,
|
|
298
|
+
isEventCatalogScale
|
|
299
|
+
});
|
|
285
300
|
} else {
|
|
286
|
-
previewCatalog({
|
|
301
|
+
previewCatalog({
|
|
302
|
+
command,
|
|
303
|
+
canEmbedPages: canEmbedPages || isEventCatalogScale,
|
|
304
|
+
isEventCatalogStarter,
|
|
305
|
+
isEventCatalogScale
|
|
306
|
+
});
|
|
287
307
|
}
|
|
288
308
|
});
|
|
289
309
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
package/dist/features.cjs
CHANGED
|
@@ -32,13 +32,9 @@ var features_exports = {};
|
|
|
32
32
|
__export(features_exports, {
|
|
33
33
|
getProjectOutDir: () => getProjectOutDir,
|
|
34
34
|
isAuthEnabled: () => isAuthEnabled,
|
|
35
|
-
isBackstagePluginEnabled: () => isBackstagePluginEnabled,
|
|
36
|
-
isEventCatalogScaleEnabled: () => isEventCatalogScaleEnabled,
|
|
37
|
-
isEventCatalogStarterEnabled: () => isEventCatalogStarterEnabled,
|
|
38
35
|
isOutputServer: () => isOutputServer
|
|
39
36
|
});
|
|
40
37
|
module.exports = __toCommonJS(features_exports);
|
|
41
|
-
var import_boxen = __toESM(require("boxen"), 1);
|
|
42
38
|
|
|
43
39
|
// src/eventcatalog-config-file-utils.js
|
|
44
40
|
var import_promises = require("fs/promises");
|
|
@@ -90,139 +86,9 @@ var isAuthEnabled = async () => {
|
|
|
90
86
|
const hasAuthConfig = import_node_fs2.default.existsSync((0, import_node_path2.join)(directory, "eventcatalog.auth.js"));
|
|
91
87
|
return hasAuthConfig;
|
|
92
88
|
};
|
|
93
|
-
var isBackstagePluginEnabled = async (licenseKey) => {
|
|
94
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE || process.env.EVENTCATALOG_SCALE_LICENSE_KEY || null;
|
|
95
|
-
const acceptedPlugins = ["@eventcatalog/backstage-plugin-eventcatalog", "@eventcatalog/eventcatalog-scale"];
|
|
96
|
-
if (!LICENSE_KEY) {
|
|
97
|
-
return false;
|
|
98
|
-
}
|
|
99
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
100
|
-
method: "POST",
|
|
101
|
-
headers: {
|
|
102
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
103
|
-
"Content-Type": "application/json"
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
if (response.status !== 200) {
|
|
107
|
-
console.log(
|
|
108
|
-
"\nTried to verify your backstage license but it is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
109
|
-
);
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
if (response.status === 200) {
|
|
113
|
-
const data = await response.json();
|
|
114
|
-
if (!acceptedPlugins.includes(data.plugin)) {
|
|
115
|
-
console.log(
|
|
116
|
-
"\nInvalid license key for backstage integration, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
117
|
-
);
|
|
118
|
-
return false;
|
|
119
|
-
}
|
|
120
|
-
let message = "Backstage integration is enabled for EventCatalog";
|
|
121
|
-
if (data.is_trial) {
|
|
122
|
-
message += "\nYou are using a trial license for backstage integration.";
|
|
123
|
-
}
|
|
124
|
-
console.log(
|
|
125
|
-
(0, import_boxen.default)(message, {
|
|
126
|
-
padding: 1,
|
|
127
|
-
margin: 1,
|
|
128
|
-
borderColor: "green",
|
|
129
|
-
title: data.plugin,
|
|
130
|
-
titleAlignment: "center"
|
|
131
|
-
})
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
return true;
|
|
135
|
-
};
|
|
136
|
-
var isEventCatalogScaleEnabled = async (licenseKey) => {
|
|
137
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_SCALE_LICENSE_KEY || null;
|
|
138
|
-
if (!LICENSE_KEY) {
|
|
139
|
-
return false;
|
|
140
|
-
}
|
|
141
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
142
|
-
method: "POST",
|
|
143
|
-
headers: {
|
|
144
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
145
|
-
"Content-Type": "application/json"
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
if (response.status !== 200) {
|
|
149
|
-
console.log(
|
|
150
|
-
"\nTried to verify your EventCatalog Scale plan, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
151
|
-
);
|
|
152
|
-
return false;
|
|
153
|
-
}
|
|
154
|
-
if (response.status === 200) {
|
|
155
|
-
const data = await response.json();
|
|
156
|
-
if ("@eventcatalog/eventcatalog-scale" !== data.plugin) {
|
|
157
|
-
console.log(
|
|
158
|
-
"\nInvalid license key for EventCatalog Scale plan, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
159
|
-
);
|
|
160
|
-
return false;
|
|
161
|
-
}
|
|
162
|
-
let message = "EventCatalog Scale plan is enabled for EventCatalog";
|
|
163
|
-
if (data.is_trial) {
|
|
164
|
-
message += "\nYou are using a trial license for EventCatalog Scale plan.";
|
|
165
|
-
}
|
|
166
|
-
console.log(
|
|
167
|
-
(0, import_boxen.default)(message, {
|
|
168
|
-
padding: 1,
|
|
169
|
-
margin: 1,
|
|
170
|
-
borderColor: "green",
|
|
171
|
-
title: "@eventcatalog/eventcatalog-scale",
|
|
172
|
-
titleAlignment: "center"
|
|
173
|
-
})
|
|
174
|
-
);
|
|
175
|
-
}
|
|
176
|
-
return true;
|
|
177
|
-
};
|
|
178
|
-
var isEventCatalogStarterEnabled = async (licenseKey) => {
|
|
179
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_STARTER_LICENSE_KEY || null;
|
|
180
|
-
if (!LICENSE_KEY) {
|
|
181
|
-
return false;
|
|
182
|
-
}
|
|
183
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
184
|
-
method: "POST",
|
|
185
|
-
headers: {
|
|
186
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
187
|
-
"Content-Type": "application/json"
|
|
188
|
-
}
|
|
189
|
-
});
|
|
190
|
-
if (response.status !== 200) {
|
|
191
|
-
console.log(
|
|
192
|
-
"\nTried to verify your EventCatalog Starter plan, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
193
|
-
);
|
|
194
|
-
return false;
|
|
195
|
-
}
|
|
196
|
-
if (response.status === 200) {
|
|
197
|
-
const data = await response.json();
|
|
198
|
-
if ("@eventcatalog/eventcatalog-starter" !== data.plugin) {
|
|
199
|
-
console.log(
|
|
200
|
-
"\nInvalid license key for EventCatalog Starter plan, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
201
|
-
);
|
|
202
|
-
return false;
|
|
203
|
-
}
|
|
204
|
-
let message = "EventCatalog Starter plan is enabled for EventCatalog";
|
|
205
|
-
if (data.is_trial) {
|
|
206
|
-
message += "\nYou are using a trial license for EventCatalog Starter Plan.";
|
|
207
|
-
}
|
|
208
|
-
console.log(
|
|
209
|
-
(0, import_boxen.default)(message, {
|
|
210
|
-
padding: 1,
|
|
211
|
-
margin: 1,
|
|
212
|
-
borderColor: "green",
|
|
213
|
-
title: "@eventcatalog/eventcatalog-starter",
|
|
214
|
-
titleAlignment: "center"
|
|
215
|
-
})
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
return true;
|
|
219
|
-
};
|
|
220
89
|
// Annotate the CommonJS export names for ESM import in node:
|
|
221
90
|
0 && (module.exports = {
|
|
222
91
|
getProjectOutDir,
|
|
223
92
|
isAuthEnabled,
|
|
224
|
-
isBackstagePluginEnabled,
|
|
225
|
-
isEventCatalogScaleEnabled,
|
|
226
|
-
isEventCatalogStarterEnabled,
|
|
227
93
|
isOutputServer
|
|
228
94
|
});
|
package/dist/features.d.cts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
declare const getProjectOutDir: () => Promise<any>;
|
|
2
2
|
declare const isOutputServer: () => Promise<boolean>;
|
|
3
3
|
declare const isAuthEnabled: () => Promise<boolean>;
|
|
4
|
-
declare const isBackstagePluginEnabled: (licenseKey?: string) => Promise<boolean>;
|
|
5
|
-
declare const isEventCatalogScaleEnabled: (licenseKey?: string) => Promise<boolean>;
|
|
6
|
-
declare const isEventCatalogStarterEnabled: (licenseKey?: string) => Promise<boolean>;
|
|
7
4
|
|
|
8
|
-
export { getProjectOutDir, isAuthEnabled,
|
|
5
|
+
export { getProjectOutDir, isAuthEnabled, isOutputServer };
|
package/dist/features.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
declare const getProjectOutDir: () => Promise<any>;
|
|
2
2
|
declare const isOutputServer: () => Promise<boolean>;
|
|
3
3
|
declare const isAuthEnabled: () => Promise<boolean>;
|
|
4
|
-
declare const isBackstagePluginEnabled: (licenseKey?: string) => Promise<boolean>;
|
|
5
|
-
declare const isEventCatalogScaleEnabled: (licenseKey?: string) => Promise<boolean>;
|
|
6
|
-
declare const isEventCatalogStarterEnabled: (licenseKey?: string) => Promise<boolean>;
|
|
7
4
|
|
|
8
|
-
export { getProjectOutDir, isAuthEnabled,
|
|
5
|
+
export { getProjectOutDir, isAuthEnabled, isOutputServer };
|
package/dist/features.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getProjectOutDir,
|
|
3
3
|
isAuthEnabled,
|
|
4
|
-
isBackstagePluginEnabled,
|
|
5
|
-
isEventCatalogScaleEnabled,
|
|
6
|
-
isEventCatalogStarterEnabled,
|
|
7
4
|
isOutputServer
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5VBIXL6C.js";
|
|
9
6
|
import "./chunk-UPONRQSN.js";
|
|
10
7
|
export {
|
|
11
8
|
getProjectOutDir,
|
|
12
9
|
isAuthEnabled,
|
|
13
|
-
isBackstagePluginEnabled,
|
|
14
|
-
isEventCatalogScaleEnabled,
|
|
15
|
-
isEventCatalogStarterEnabled,
|
|
16
10
|
isOutputServer
|
|
17
11
|
};
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
import { Handle, Position } from '@xyflow/react';
|
|
1
|
+
import { Handle, Position, type XYPosition } from '@xyflow/react';
|
|
2
2
|
|
|
3
|
-
import { nodeComponents
|
|
3
|
+
import { nodeComponents } from '@eventcatalog/visualizer';
|
|
4
4
|
const ActorComponent = nodeComponents.actor;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
interface Data {
|
|
7
|
+
data: {
|
|
8
|
+
actor: {
|
|
9
|
+
name: string;
|
|
10
|
+
summary: string;
|
|
11
|
+
};
|
|
12
|
+
mode: 'simple' | 'full';
|
|
13
|
+
};
|
|
14
|
+
type: 'actor';
|
|
15
|
+
id: string;
|
|
16
|
+
position: XYPosition;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default function ActorNode(props: Data) {
|
|
20
|
+
const componentData = {
|
|
21
|
+
...props,
|
|
22
|
+
data: {
|
|
23
|
+
...props.data,
|
|
24
|
+
name: props.data.actor.name,
|
|
25
|
+
summary: props.data.actor.summary,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
7
29
|
return (
|
|
8
30
|
<div className="relative">
|
|
9
31
|
<Handle
|
|
@@ -18,7 +40,7 @@ export default function ActorNode(props: ActorNode) {
|
|
|
18
40
|
style={{ width: 10, height: 10, background: 'orange', zIndex: 10 }}
|
|
19
41
|
className="bg-gray-500"
|
|
20
42
|
/>
|
|
21
|
-
<ActorComponent {...
|
|
43
|
+
<ActorComponent {...componentData} />
|
|
22
44
|
</div>
|
|
23
45
|
);
|
|
24
46
|
}
|
|
@@ -57,6 +57,13 @@ const contentId = `prop-${name}-${level}-${Math.random().toString(36).substring(
|
|
|
57
57
|
{details.format ? `<${details.format}>` : ''}
|
|
58
58
|
{details._refPath && <span class="text-blue-600 ml-1">→ {details._refName || details._refPath}</span>}
|
|
59
59
|
{details._refNotFound && <span class="text-red-600 ml-1">❌ ref not found</span>}
|
|
60
|
+
{
|
|
61
|
+
details.const !== undefined && (
|
|
62
|
+
<span>
|
|
63
|
+
constant: <code>{details.const}</code>
|
|
64
|
+
</span>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
60
67
|
</span>
|
|
61
68
|
</div>
|
|
62
69
|
{isRequired && <span class="text-red-600 text-xs ml-3 flex-shrink-0">required</span>}
|
|
@@ -203,6 +203,7 @@ const flows = defineCollection({
|
|
|
203
203
|
actor: z
|
|
204
204
|
.object({
|
|
205
205
|
name: z.string(),
|
|
206
|
+
summary: z.string().optional(),
|
|
206
207
|
})
|
|
207
208
|
.optional(),
|
|
208
209
|
custom: z
|
|
@@ -500,6 +501,12 @@ const entities = defineCollection({
|
|
|
500
501
|
references: z.string().optional(),
|
|
501
502
|
referencesIdentifier: z.string().optional(),
|
|
502
503
|
relationType: z.string().optional(),
|
|
504
|
+
enum: z.array(z.string()).optional(),
|
|
505
|
+
items: z
|
|
506
|
+
.object({
|
|
507
|
+
type: z.string(),
|
|
508
|
+
})
|
|
509
|
+
.optional(),
|
|
503
510
|
})
|
|
504
511
|
)
|
|
505
512
|
.optional(),
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"url": "https://github.com/event-catalog/eventcatalog.git"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
-
"version": "2.
|
|
9
|
+
"version": "2.56.0",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"@ai-sdk/anthropic": "^1.2.11",
|
|
25
25
|
"@ai-sdk/google": "^1.2.17",
|
|
26
26
|
"@ai-sdk/openai": "^1.3.16",
|
|
27
|
-
"@astrojs/markdown-remark": "^6.3.
|
|
28
|
-
"@astrojs/mdx": "^4.3.
|
|
29
|
-
"@astrojs/node": "^9.3
|
|
27
|
+
"@astrojs/markdown-remark": "^6.3.6",
|
|
28
|
+
"@astrojs/mdx": "^4.3.4",
|
|
29
|
+
"@astrojs/node": "^9.4.3",
|
|
30
30
|
"@astrojs/react": "^4.3.0",
|
|
31
31
|
"@astrojs/rss": "^4.0.12",
|
|
32
32
|
"@astrojs/tailwind": "^6.0.2",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@asyncapi/react-component": "^2.4.3",
|
|
36
36
|
"@auth/core": "^0.37.4",
|
|
37
37
|
"@eventcatalog/generator-ai": "^1.1.0",
|
|
38
|
+
"@eventcatalog/license": "^0.0.6",
|
|
38
39
|
"@eventcatalog/linter": "^0.0.2",
|
|
39
40
|
"@eventcatalog/sdk": "^2.2.7",
|
|
40
41
|
"@eventcatalog/visualizer": "^0.0.5",
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"@tanstack/react-table": "^8.17.3",
|
|
58
59
|
"@xyflow/react": "^12.3.6",
|
|
59
60
|
"ai": "^4.3.9",
|
|
60
|
-
"astro": "^5.
|
|
61
|
+
"astro": "^5.13.5",
|
|
61
62
|
"astro-compress": "^2.3.8",
|
|
62
63
|
"astro-expressive-code": "^0.40.1",
|
|
63
64
|
"astro-seo": "^0.8.4",
|
package/dist/chunk-I23A46WZ.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getEventCatalogConfigFile
|
|
3
|
-
} from "./chunk-UPONRQSN.js";
|
|
4
|
-
|
|
5
|
-
// src/features.ts
|
|
6
|
-
import boxen from "boxen";
|
|
7
|
-
import { join } from "path";
|
|
8
|
-
import fs from "fs";
|
|
9
|
-
var getProjectOutDir = async () => {
|
|
10
|
-
const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
|
|
11
|
-
return config?.outDir || "dist";
|
|
12
|
-
};
|
|
13
|
-
var isOutputServer = async () => {
|
|
14
|
-
const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
|
|
15
|
-
return config?.output === "server";
|
|
16
|
-
};
|
|
17
|
-
var isAuthEnabled = async () => {
|
|
18
|
-
const directory = process.env.PROJECT_DIR || process.cwd();
|
|
19
|
-
const hasAuthConfig = fs.existsSync(join(directory, "eventcatalog.auth.js"));
|
|
20
|
-
return hasAuthConfig;
|
|
21
|
-
};
|
|
22
|
-
var isBackstagePluginEnabled = async (licenseKey) => {
|
|
23
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE || process.env.EVENTCATALOG_SCALE_LICENSE_KEY || null;
|
|
24
|
-
const acceptedPlugins = ["@eventcatalog/backstage-plugin-eventcatalog", "@eventcatalog/eventcatalog-scale"];
|
|
25
|
-
if (!LICENSE_KEY) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
29
|
-
method: "POST",
|
|
30
|
-
headers: {
|
|
31
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
32
|
-
"Content-Type": "application/json"
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
if (response.status !== 200) {
|
|
36
|
-
console.log(
|
|
37
|
-
"\nTried to verify your backstage license but it is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
38
|
-
);
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
if (response.status === 200) {
|
|
42
|
-
const data = await response.json();
|
|
43
|
-
if (!acceptedPlugins.includes(data.plugin)) {
|
|
44
|
-
console.log(
|
|
45
|
-
"\nInvalid license key for backstage integration, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
46
|
-
);
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
let message = "Backstage integration is enabled for EventCatalog";
|
|
50
|
-
if (data.is_trial) {
|
|
51
|
-
message += "\nYou are using a trial license for backstage integration.";
|
|
52
|
-
}
|
|
53
|
-
console.log(
|
|
54
|
-
boxen(message, {
|
|
55
|
-
padding: 1,
|
|
56
|
-
margin: 1,
|
|
57
|
-
borderColor: "green",
|
|
58
|
-
title: data.plugin,
|
|
59
|
-
titleAlignment: "center"
|
|
60
|
-
})
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return true;
|
|
64
|
-
};
|
|
65
|
-
var isEventCatalogScaleEnabled = async (licenseKey) => {
|
|
66
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_SCALE_LICENSE_KEY || null;
|
|
67
|
-
if (!LICENSE_KEY) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
71
|
-
method: "POST",
|
|
72
|
-
headers: {
|
|
73
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
74
|
-
"Content-Type": "application/json"
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
if (response.status !== 200) {
|
|
78
|
-
console.log(
|
|
79
|
-
"\nTried to verify your EventCatalog Scale plan, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
80
|
-
);
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
if (response.status === 200) {
|
|
84
|
-
const data = await response.json();
|
|
85
|
-
if ("@eventcatalog/eventcatalog-scale" !== data.plugin) {
|
|
86
|
-
console.log(
|
|
87
|
-
"\nInvalid license key for EventCatalog Scale plan, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
88
|
-
);
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
let message = "EventCatalog Scale plan is enabled for EventCatalog";
|
|
92
|
-
if (data.is_trial) {
|
|
93
|
-
message += "\nYou are using a trial license for EventCatalog Scale plan.";
|
|
94
|
-
}
|
|
95
|
-
console.log(
|
|
96
|
-
boxen(message, {
|
|
97
|
-
padding: 1,
|
|
98
|
-
margin: 1,
|
|
99
|
-
borderColor: "green",
|
|
100
|
-
title: "@eventcatalog/eventcatalog-scale",
|
|
101
|
-
titleAlignment: "center"
|
|
102
|
-
})
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return true;
|
|
106
|
-
};
|
|
107
|
-
var isEventCatalogStarterEnabled = async (licenseKey) => {
|
|
108
|
-
const LICENSE_KEY = process.env.EVENTCATALOG_STARTER_LICENSE_KEY || null;
|
|
109
|
-
if (!LICENSE_KEY) {
|
|
110
|
-
return false;
|
|
111
|
-
}
|
|
112
|
-
const response = await fetch("https://api.eventcatalog.cloud/functions/v1/license", {
|
|
113
|
-
method: "POST",
|
|
114
|
-
headers: {
|
|
115
|
-
Authorization: `Bearer ${LICENSE_KEY}`,
|
|
116
|
-
"Content-Type": "application/json"
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
if (response.status !== 200) {
|
|
120
|
-
console.log(
|
|
121
|
-
"\nTried to verify your EventCatalog Starter plan, but your license key is not valid. Please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
122
|
-
);
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
if (response.status === 200) {
|
|
126
|
-
const data = await response.json();
|
|
127
|
-
if ("@eventcatalog/eventcatalog-starter" !== data.plugin) {
|
|
128
|
-
console.log(
|
|
129
|
-
"\nInvalid license key for EventCatalog Starter plan, please check your license key or purchase a license at https://eventcatalog.cloud/\n"
|
|
130
|
-
);
|
|
131
|
-
return false;
|
|
132
|
-
}
|
|
133
|
-
let message = "EventCatalog Starter plan is enabled for EventCatalog";
|
|
134
|
-
if (data.is_trial) {
|
|
135
|
-
message += "\nYou are using a trial license for EventCatalog Starter Plan.";
|
|
136
|
-
}
|
|
137
|
-
console.log(
|
|
138
|
-
boxen(message, {
|
|
139
|
-
padding: 1,
|
|
140
|
-
margin: 1,
|
|
141
|
-
borderColor: "green",
|
|
142
|
-
title: "@eventcatalog/eventcatalog-starter",
|
|
143
|
-
titleAlignment: "center"
|
|
144
|
-
})
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
return true;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
export {
|
|
151
|
-
getProjectOutDir,
|
|
152
|
-
isOutputServer,
|
|
153
|
-
isAuthEnabled,
|
|
154
|
-
isBackstagePluginEnabled,
|
|
155
|
-
isEventCatalogScaleEnabled,
|
|
156
|
-
isEventCatalogStarterEnabled
|
|
157
|
-
};
|