@eventcatalog/core 2.42.9 → 2.43.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.
Files changed (58) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/catalog-to-astro-content-directory.js +2 -2
  6. package/dist/{chunk-4A2C2PVU.js → chunk-4DXH4NAT.js} +1 -1
  7. package/dist/{chunk-OQA3PAMR.js → chunk-IZ7E57FH.js} +1 -1
  8. package/dist/{chunk-HDG7YSFG.js → chunk-LUUBKWYP.js} +8 -0
  9. package/dist/{chunk-ISA6KNLN.js → chunk-MXNHNGRS.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.auth.cjs +18 -0
  13. package/dist/eventcatalog.auth.d.cts +18 -0
  14. package/dist/eventcatalog.auth.d.ts +18 -0
  15. package/dist/eventcatalog.auth.js +0 -0
  16. package/dist/eventcatalog.cjs +50 -23
  17. package/dist/eventcatalog.js +29 -8
  18. package/dist/features.cjs +9 -0
  19. package/dist/features.d.cts +2 -1
  20. package/dist/features.d.ts +2 -1
  21. package/dist/features.js +3 -1
  22. package/dist/watcher.js +1 -1
  23. package/eventcatalog/astro.config.mjs +7 -3
  24. package/eventcatalog/auth.config.ts +142 -0
  25. package/eventcatalog/src/components/Header.astro +125 -25
  26. package/eventcatalog/src/middleware.ts +62 -0
  27. package/eventcatalog/src/pages/auth/error.astro +55 -0
  28. package/eventcatalog/src/pages/auth/login.astro +231 -0
  29. package/eventcatalog/src/pages/directory/[type]/_index.data.ts +63 -0
  30. package/eventcatalog/src/pages/directory/[type]/index.astro +6 -23
  31. package/eventcatalog/src/pages/discover/[type]/_index.data.ts +62 -0
  32. package/eventcatalog/src/pages/discover/[type]/index.astro +7 -24
  33. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/_index.data.ts +62 -0
  34. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +5 -37
  35. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/_[filename].data.ts +98 -0
  36. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/_index.data.ts +68 -0
  37. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +5 -25
  38. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +6 -25
  39. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/[filename].astro +6 -35
  40. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/spec/_[filename].data.ts +99 -0
  41. package/eventcatalog/src/pages/docs/[type]/[id]/index.astro +1 -0
  42. package/eventcatalog/src/pages/docs/[type]/[id]/language/_index.data.ts +40 -0
  43. package/eventcatalog/src/pages/docs/[type]/[id]/{language.astro → language/index.astro} +6 -20
  44. package/eventcatalog/src/pages/docs/custom/[...path]/_index.data.ts +49 -0
  45. package/eventcatalog/src/pages/docs/custom/[...path]/index.astro +5 -11
  46. package/eventcatalog/src/pages/docs/teams/[id]/_index.data.ts +46 -0
  47. package/eventcatalog/src/pages/docs/teams/[id]/index.astro +6 -10
  48. package/eventcatalog/src/pages/docs/users/[id]/_index.data.ts +46 -0
  49. package/eventcatalog/src/pages/docs/users/[id]/index.astro +5 -9
  50. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/_index.data.ts +99 -0
  51. package/eventcatalog/src/pages/visualiser/[type]/[id]/[version]/index.astro +5 -29
  52. package/eventcatalog/src/utils/feature.ts +10 -0
  53. package/eventcatalog/src/utils/node-graphs/domains-node-graph.ts +12 -1
  54. package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +11 -1
  55. package/eventcatalog/src/utils/page-loaders/hybrid-page.ts +68 -0
  56. package/eventcatalog/tsconfig.json +2 -1
  57. package/package.json +3 -1
  58. package/dist/{chunk-SLEMYHTU.js → chunk-SFA7F3CQ.js} +3 -3
@@ -0,0 +1,68 @@
1
+ import type { AstroGlobal } from 'astro';
2
+ import { isSSR } from '@utils/feature';
3
+
4
+ /**
5
+ * Base class for all hybrid pages with static methods
6
+ */
7
+ export class HybridPage<T = any> {
8
+ /**
9
+ * Static method for prerender setting
10
+ */
11
+ static get prerender(): boolean {
12
+ return !isSSR();
13
+ }
14
+
15
+ /**
16
+ * Static method for generating static paths
17
+ */
18
+ static async getStaticPaths(): Promise<Array<{ params: any; props: any }>> {
19
+ if (isSSR()) {
20
+ return [];
21
+ }
22
+ // Don't call this.generateStaticPaths() here - let each subclass implement this method directly
23
+ throw new Error('getStaticPaths must be implemented by subclass');
24
+ }
25
+
26
+ /**
27
+ * Static method for getting data
28
+ */
29
+ static async getData(astro: AstroGlobal): Promise<any> {
30
+ // Try props first (static mode)
31
+ if (astro.props && this.hasValidProps(astro.props)) {
32
+ return this.transformProps(astro.props);
33
+ }
34
+
35
+ const data = await this.fetchData(astro.params);
36
+
37
+ if (!data) {
38
+ throw this.createNotFoundResponse();
39
+ }
40
+
41
+ return data;
42
+ }
43
+
44
+ /**
45
+ * Methods to be overridden by subclasses
46
+ */
47
+ protected static async fetchData(params: any): Promise<any> {
48
+ throw new Error('fetchData must be implemented by subclass');
49
+ }
50
+
51
+ /**
52
+ * Override these static methods if needed
53
+ */
54
+ protected static hasValidProps(props: any): boolean {
55
+ return props && Object.keys(props).length > 0 && props.data;
56
+ }
57
+
58
+ protected static transformProps(props: any): any {
59
+ return props;
60
+ }
61
+
62
+ protected static createNotFoundResponse(): Response {
63
+ return new Response(null, {
64
+ status: 404,
65
+ statusText: 'Not found',
66
+ });
67
+ }
68
+ }
@@ -13,7 +13,8 @@
13
13
  "@utils/*": ["src/utils/*"],
14
14
  "@layouts/*": ["src/layouts/*"],
15
15
  "@enterprise/*": ["src/enterprise/*"],
16
- "@ai/*": ["src/generated-ai/*"]
16
+ "@ai/*": ["src/generated-ai/*"],
17
+ "auth:config": ["./auth.config.ts"]
17
18
  },
18
19
  "jsx": "react-jsx",
19
20
  "jsxImportSource": "react",
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.42.9",
9
+ "version": "2.43.0",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -33,6 +33,7 @@
33
33
  "@asyncapi/avro-schema-parser": "^3.0.24",
34
34
  "@asyncapi/parser": "^3.4.0",
35
35
  "@asyncapi/react-component": "^2.4.3",
36
+ "@auth/core": "^0.37.4",
36
37
  "@eventcatalog/generator-ai": "^1.1.0",
37
38
  "@eventcatalog/sdk": "^2.2.7",
38
39
  "@fontsource/inter": "^5.2.5",
@@ -58,6 +59,7 @@
58
59
  "astro-expressive-code": "^0.40.1",
59
60
  "astro-pagefind": "^1.6.0",
60
61
  "astro-seo": "^0.8.4",
62
+ "auth-astro": "^4.2.0",
61
63
  "axios": "^1.7.7",
62
64
  "boxen": "^8.0.1",
63
65
  "commander": "^12.1.0",
@@ -1,9 +1,9 @@
1
- import {
2
- verifyRequiredFieldsAreInCatalogConfigFile
3
- } from "./chunk-E7TXTI7G.js";
4
1
  import {
5
2
  mapCatalogToAstro
6
3
  } from "./chunk-EXAALOQA.js";
4
+ import {
5
+ verifyRequiredFieldsAreInCatalogConfigFile
6
+ } from "./chunk-E7TXTI7G.js";
7
7
 
8
8
  // src/catalog-to-astro-content-directory.js
9
9
  import { glob } from "glob";