@eventcatalog/core 2.18.2 → 2.18.3

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.
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "2.18.2";
40
+ var version = "2.18.3";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-JG77VIA4.js";
4
- import "../chunk-RF2R7CRK.js";
3
+ } from "../chunk-Z67TL5JF.js";
4
+ import "../chunk-Y65KQS5Z.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.18.2";
109
+ var version = "2.18.3";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-PSMNZFCI.js";
4
- import "../chunk-JG77VIA4.js";
5
- import "../chunk-RF2R7CRK.js";
3
+ } from "../chunk-AFQD2ZW3.js";
4
+ import "../chunk-Z67TL5JF.js";
5
+ import "../chunk-Y65KQS5Z.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-JG77VIA4.js";
3
+ } from "./chunk-Z67TL5JF.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.18.2";
2
+ var version = "2.18.3";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-RF2R7CRK.js";
3
+ } from "./chunk-Y65KQS5Z.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.18.2";
28
+ var version = "2.18.3";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-RF2R7CRK.js";
3
+ } from "./chunk-Y65KQS5Z.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
161
161
  var import_os = __toESM(require("os"), 1);
162
162
 
163
163
  // package.json
164
- var version = "2.18.2";
164
+ var version = "2.18.3";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -3,14 +3,14 @@ import {
3
3
  } from "./chunk-SHCMAL37.js";
4
4
  import {
5
5
  log_build_default
6
- } from "./chunk-PSMNZFCI.js";
7
- import "./chunk-JG77VIA4.js";
6
+ } from "./chunk-AFQD2ZW3.js";
7
+ import "./chunk-Z67TL5JF.js";
8
8
  import {
9
9
  catalogToAstro
10
10
  } from "./chunk-WF34R5UT.js";
11
11
  import {
12
12
  VERSION
13
- } from "./chunk-RF2R7CRK.js";
13
+ } from "./chunk-Y65KQS5Z.js";
14
14
  import {
15
15
  generate
16
16
  } from "./chunk-YEQVKHST.js";
@@ -20,11 +20,16 @@ interface Props {
20
20
  }
21
21
 
22
22
  // cache for build time
23
- export let cachedChannels: Channel[] = [];
23
+ let cachedChannels: Record<string, Channel[]> = {
24
+ allVersions: [],
25
+ currentVersions: [],
26
+ };
24
27
 
25
28
  export const getChannels = async ({ getAllVersions = true }: Props = {}): Promise<Channel[]> => {
26
- if (cachedChannels.length > 0) {
27
- return cachedChannels;
29
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
30
+
31
+ if (cachedChannels[cacheKey].length > 0) {
32
+ return cachedChannels[cacheKey];
28
33
  }
29
34
 
30
35
  const channels = await getCollection('channels', (query) => {
@@ -34,7 +39,7 @@ export const getChannels = async ({ getAllVersions = true }: Props = {}): Promis
34
39
  const { commands, events, queries } = await getMessages();
35
40
  const allMessages = [...commands, ...events, ...queries];
36
41
 
37
- cachedChannels = channels.map((channel) => {
42
+ cachedChannels[cacheKey] = channels.map((channel) => {
38
43
  const { latestVersion, versions } = getVersionForCollectionItem(channel, channels);
39
44
 
40
45
  const messagesForChannel = allMessages.filter((message) => {
@@ -69,5 +74,5 @@ export const getChannels = async ({ getAllVersions = true }: Props = {}): Promis
69
74
  };
70
75
  });
71
76
 
72
- return cachedChannels;
77
+ return cachedChannels[cacheKey];
73
78
  };
@@ -20,10 +20,10 @@ let cachedDomains: Record<string, Domain[]> = {
20
20
  export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise<Domain[]> => {
21
21
  const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
22
22
 
23
- // // Check if we have cached domains for this specific getAllVersions value
24
- // if (cachedDomains[cacheKey].length > 0) {
25
- // return cachedDomains[cacheKey];
26
- // }
23
+ // Check if we have cached domains for this specific getAllVersions value
24
+ if (cachedDomains[cacheKey].length > 0) {
25
+ return cachedDomains[cacheKey];
26
+ }
27
27
 
28
28
  // Get all the domains that are not versioned
29
29
  const domains = await getCollection('domains', (domain) => {
@@ -12,11 +12,16 @@ interface Props {
12
12
  }
13
13
 
14
14
  // Cache for build time
15
- let cachedFlows: Flow[] = [];
15
+ let cachedFlows: Record<string, Flow[]> = {
16
+ allVersions: [],
17
+ currentVersions: [],
18
+ };
16
19
 
17
20
  export const getFlows = async ({ getAllVersions = true }: Props = {}): Promise<Flow[]> => {
18
- if (cachedFlows.length > 0) {
19
- return cachedFlows;
21
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
22
+
23
+ if (cachedFlows[cacheKey].length > 0) {
24
+ return cachedFlows[cacheKey];
20
25
  }
21
26
 
22
27
  // Get flows that are not versioned
@@ -30,7 +35,7 @@ export const getFlows = async ({ getAllVersions = true }: Props = {}): Promise<F
30
35
  const allMessages = [...events, ...commands];
31
36
 
32
37
  // @ts-ignore // TODO: Fix this type
33
- cachedFlows = flows.map((flow) => {
38
+ cachedFlows[cacheKey] = flows.map((flow) => {
34
39
  // @ts-ignore
35
40
  const { latestVersion, versions } = getVersionForCollectionItem(flow, flows);
36
41
  const steps = flow.data.steps || [];
@@ -64,5 +69,5 @@ export const getFlows = async ({ getAllVersions = true }: Props = {}): Promise<F
64
69
  };
65
70
  });
66
71
 
67
- return cachedFlows;
72
+ return cachedFlows[cacheKey];
68
73
  };
@@ -13,11 +13,17 @@ interface Props {
13
13
  }
14
14
 
15
15
  // Cache for build time
16
- let cachedServices: Service[] = [];
16
+ let cachedServices: Record<string, Service[]> = {
17
+ allVersions: [],
18
+ currentVersions: [],
19
+ };
17
20
 
18
21
  export const getServices = async ({ getAllVersions = true }: Props = {}): Promise<Service[]> => {
19
- if (cachedServices.length > 0) {
20
- return cachedServices;
22
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
23
+
24
+ // Check if we have cached domains for this specific getAllVersions value
25
+ if (cachedServices[cacheKey].length > 0) {
26
+ return cachedServices[cacheKey];
21
27
  }
22
28
 
23
29
  // Get services that are not versioned
@@ -31,7 +37,7 @@ export const getServices = async ({ getAllVersions = true }: Props = {}): Promis
31
37
  const allMessages = [...events, ...commands, ...queries];
32
38
 
33
39
  // @ts-ignore // TODO: Fix this type
34
- cachedServices = services.map((service) => {
40
+ cachedServices[cacheKey] = services.map((service) => {
35
41
  const { latestVersion, versions } = getVersionForCollectionItem(service, services);
36
42
 
37
43
  const sendsMessages = service.data.sends || [];
@@ -73,7 +79,7 @@ export const getServices = async ({ getAllVersions = true }: Props = {}): Promis
73
79
  };
74
80
  });
75
81
 
76
- return cachedServices;
82
+ return cachedServices[cacheKey];
77
83
  };
78
84
 
79
85
  export const getProducersOfMessage = (services: Service[], message: CollectionEntry<'events' | 'commands' | 'queries'>) => {
@@ -18,11 +18,16 @@ interface Props {
18
18
  }
19
19
 
20
20
  // cache for build time
21
- export let cachedCommands: Command[] = [];
21
+ let cachedCommands: Record<string, Command[]> = {
22
+ allVersions: [],
23
+ currentVersions: [],
24
+ };
22
25
 
23
26
  export const getCommands = async ({ getAllVersions = true }: Props = {}): Promise<Command[]> => {
24
- if (cachedCommands.length > 0) {
25
- return cachedCommands;
27
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
28
+
29
+ if (cachedCommands[cacheKey].length > 0) {
30
+ return cachedCommands[cacheKey];
26
31
  }
27
32
 
28
33
  const commands = await getCollection('commands', (command) => {
@@ -32,7 +37,7 @@ export const getCommands = async ({ getAllVersions = true }: Props = {}): Promis
32
37
  const services = await getCollection('services');
33
38
  const allChannels = await getCollection('channels');
34
39
 
35
- cachedCommands = commands.map((command) => {
40
+ cachedCommands[cacheKey] = commands.map((command) => {
36
41
  const { latestVersion, versions } = getVersionForCollectionItem(command, commands);
37
42
 
38
43
  const producers = services.filter((service) => {
@@ -75,5 +80,5 @@ export const getCommands = async ({ getAllVersions = true }: Props = {}): Promis
75
80
  };
76
81
  });
77
82
 
78
- return cachedCommands;
83
+ return cachedCommands[cacheKey];
79
84
  };
@@ -18,11 +18,16 @@ interface Props {
18
18
  }
19
19
 
20
20
  // cache for build time
21
- export let cachedEvents: Event[] = [];
21
+ let cachedEvents: Record<string, Event[]> = {
22
+ allVersions: [],
23
+ currentVersions: [],
24
+ };
22
25
 
23
26
  export const getEvents = async ({ getAllVersions = true }: Props = {}): Promise<Event[]> => {
24
- if (cachedEvents.length > 0) {
25
- return cachedEvents;
27
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
28
+
29
+ if (cachedEvents[cacheKey].length > 0) {
30
+ return cachedEvents[cacheKey];
26
31
  }
27
32
 
28
33
  const events = await getCollection('events', (event) => {
@@ -32,7 +37,7 @@ export const getEvents = async ({ getAllVersions = true }: Props = {}): Promise<
32
37
  const services = await getCollection('services');
33
38
  const allChannels = await getCollection('channels');
34
39
 
35
- cachedEvents = events.map((event) => {
40
+ cachedEvents[cacheKey] = events.map((event) => {
36
41
  const { latestVersion, versions } = getVersionForCollectionItem(event, events);
37
42
 
38
43
  const producers = services.filter((service) =>
@@ -75,5 +80,5 @@ export const getEvents = async ({ getAllVersions = true }: Props = {}): Promise<
75
80
  };
76
81
  });
77
82
 
78
- return cachedEvents;
83
+ return cachedEvents[cacheKey];
79
84
  };
@@ -18,11 +18,16 @@ interface Props {
18
18
  }
19
19
 
20
20
  // Cache for build time
21
- let cachedQueries: Query[] = [];
21
+ let cachedQueries: Record<string, Query[]> = {
22
+ allVersions: [],
23
+ currentVersions: [],
24
+ };
22
25
 
23
26
  export const getQueries = async ({ getAllVersions = true }: Props = {}): Promise<Query[]> => {
24
- if (cachedQueries.length > 0) {
25
- return cachedQueries;
27
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
28
+
29
+ if (cachedQueries[cacheKey].length > 0) {
30
+ return cachedQueries[cacheKey];
26
31
  }
27
32
 
28
33
  const queries = await getCollection('queries', (query) => {
@@ -32,7 +37,7 @@ export const getQueries = async ({ getAllVersions = true }: Props = {}): Promise
32
37
  const services = await getCollection('services');
33
38
  const allChannels = await getCollection('channels');
34
39
 
35
- cachedQueries = queries.map((query) => {
40
+ cachedQueries[cacheKey] = queries.map((query) => {
36
41
  const { latestVersion, versions } = getVersionForCollectionItem(query, queries);
37
42
 
38
43
  const producers = services.filter((service) =>
@@ -75,5 +80,5 @@ export const getQueries = async ({ getAllVersions = true }: Props = {}): Promise
75
80
  };
76
81
  });
77
82
 
78
- return cachedQueries;
83
+ return cachedQueries[cacheKey];
79
84
  };
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.18.2",
9
+ "version": "2.18.3",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },