@eventcatalog/sdk 0.0.1 → 0.0.2

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.mjs ADDED
@@ -0,0 +1,191 @@
1
+ // src/index.ts
2
+ import { join as join3 } from "path";
3
+
4
+ // src/events.ts
5
+ import matter from "gray-matter";
6
+ import fs2 from "fs/promises";
7
+ import { join as join2 } from "path";
8
+ import { dirname } from "path";
9
+
10
+ // src/internal/utils.ts
11
+ import { glob } from "glob";
12
+ import fs from "fs/promises";
13
+ import { copy } from "fs-extra";
14
+ import { join } from "path";
15
+ var versionExists = async (catalogDir, id, version) => {
16
+ const files = await getFiles(`${catalogDir}/**/index.md`);
17
+ const matchedFiles = await searchFilesForId(files, id, version) || [];
18
+ return matchedFiles.length > 0;
19
+ };
20
+ var findFileById = async (catalogDir, id, version) => {
21
+ const files = await getFiles(`${catalogDir}/**/index.md`);
22
+ const matchedFiles = await searchFilesForId(files, id) || [];
23
+ if (!version) {
24
+ return matchedFiles.find((path) => !path.includes("versioned"));
25
+ }
26
+ return matchedFiles.find((path) => path.includes(`versioned/${version}`));
27
+ };
28
+ var getFiles = async (pattern) => {
29
+ try {
30
+ const files = await glob(pattern, { ignore: "node_modules/**" });
31
+ return files;
32
+ } catch (error) {
33
+ throw new Error(`Error finding files: ${error}`);
34
+ }
35
+ };
36
+ var searchFilesForId = async (files, id, version) => {
37
+ const idRegex = new RegExp(`^id:\\s*['"]?${id}['"]?\\s*$`, "m");
38
+ const versionRegex = new RegExp(`^version:\\s*['"]?${version}['"]?\\s*$`, "m");
39
+ const matches = await Promise.all(
40
+ files.map(async (file) => {
41
+ const content = await fs.readFile(file, "utf-8");
42
+ const hasIdMatch = content.match(idRegex);
43
+ if (version && !content.match(versionRegex)) {
44
+ return void 0;
45
+ }
46
+ if (hasIdMatch) {
47
+ return file;
48
+ }
49
+ })
50
+ );
51
+ return matches.filter(Boolean).filter((file) => file !== void 0);
52
+ };
53
+ var copyDir = async (catalogDir, source, target, filter) => {
54
+ const tmpDirectory = join(catalogDir, "tmp");
55
+ await fs.mkdir(tmpDirectory, { recursive: true });
56
+ await copy(source, tmpDirectory, {
57
+ overwrite: true,
58
+ filter
59
+ });
60
+ await copy(tmpDirectory, target, {
61
+ overwrite: true,
62
+ filter
63
+ });
64
+ await fs.rm(tmpDirectory, { recursive: true });
65
+ };
66
+
67
+ // src/events.ts
68
+ var getEvent = (directory) => async (id, version) => {
69
+ const file = await findFileById(directory, id, version);
70
+ if (!file) throw new Error(`No event found for the given id: ${id}` + (version ? ` and version ${version}` : ""));
71
+ const { data, content } = matter.read(file);
72
+ return {
73
+ ...data,
74
+ markdown: content.trim()
75
+ };
76
+ };
77
+ var writeEvent = (directory) => async (event, options = { path: "" }) => {
78
+ const path = options.path || `/${event.id}`;
79
+ const exists = await versionExists(directory, event.id, event.version);
80
+ if (exists) {
81
+ throw new Error(`Failed to write event as the version ${event.version} already exists`);
82
+ }
83
+ const { markdown, ...frontmatter } = event;
84
+ const document = matter.stringify(markdown.trim(), frontmatter);
85
+ await fs2.mkdir(join2(directory, path), { recursive: true });
86
+ await fs2.writeFile(join2(directory, path, "index.md"), document);
87
+ };
88
+ var rmEvent = (directory) => async (path) => {
89
+ await fs2.rm(join2(directory, path), { recursive: true });
90
+ };
91
+ var rmEventById = (directory) => async (id, version) => {
92
+ const files = await getFiles(`${directory}/**/index.md`);
93
+ const matchedFiles = await searchFilesForId(files, id, version);
94
+ if (matchedFiles.length === 0) {
95
+ throw new Error(`No event found with id: ${id}`);
96
+ }
97
+ await Promise.all(matchedFiles.map((file) => fs2.rm(file)));
98
+ };
99
+ var versionEvent = (directory) => async (id) => {
100
+ const files = await getFiles(`${directory}/**/index.md`);
101
+ const matchedFiles = await searchFilesForId(files, id);
102
+ if (matchedFiles.length === 0) {
103
+ throw new Error(`No event found with id: ${id}`);
104
+ }
105
+ const file = matchedFiles[0];
106
+ const eventDirectory = dirname(file);
107
+ const { data: { version = "0.0.1" } = {} } = matter.read(file);
108
+ const targetDirectory = join2(eventDirectory, "versioned", version);
109
+ await fs2.mkdir(targetDirectory, { recursive: true });
110
+ await copyDir(directory, eventDirectory, targetDirectory, (src) => {
111
+ return !src.includes("versioned");
112
+ });
113
+ await fs2.readdir(eventDirectory).then(async (resourceFiles) => {
114
+ await Promise.all(
115
+ resourceFiles.map(async (file2) => {
116
+ if (file2 !== "versioned") {
117
+ await fs2.rm(join2(eventDirectory, file2), { recursive: true });
118
+ }
119
+ })
120
+ );
121
+ });
122
+ };
123
+ var addFileToEvent = (directory) => async (id, file, version) => {
124
+ const pathToEvent = await findFileById(directory, id, version);
125
+ if (!pathToEvent) throw new Error("Cannot find directory to write file to");
126
+ const contentDirectory = dirname(pathToEvent);
127
+ await fs2.writeFile(join2(contentDirectory, file.fileName), file.content);
128
+ };
129
+ var addSchemaToEvent = (directory) => async (id, schema, version) => {
130
+ await addFileToEvent(directory)(id, { content: schema.schema, fileName: schema.fileName }, version);
131
+ };
132
+
133
+ // src/index.ts
134
+ var src_default = (path) => {
135
+ return {
136
+ /**
137
+ * Returns an events from EventCatalog
138
+ * @param id - The id of the event to retrieve
139
+ * @param version - Optional id of the version to get
140
+ * @returns
141
+ */
142
+ getEvent: getEvent(join3(path, "events")),
143
+ /**
144
+ * Adds an event to EventCatalog
145
+ *
146
+ * @param event - The event to write
147
+ * @param options - Optional options to write the event
148
+ *
149
+ */
150
+ writeEvent: writeEvent(join3(path, "events")),
151
+ /**
152
+ * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)
153
+ *
154
+ * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`
155
+ *
156
+ */
157
+ rmEvent: rmEvent(join3(path, "events")),
158
+ /**
159
+ * Remove an event by an Event id
160
+ *
161
+ * @param id - The id of the event you want to remove
162
+ *
163
+ */
164
+ rmEventById: rmEventById(join3(path, "events")),
165
+ /**
166
+ * Moves a given event id to the version directory
167
+ * @param directory
168
+ */
169
+ versionEvent: versionEvent(join3(path, "events")),
170
+ /**
171
+ * Adds a file to the given event
172
+ * @param id - The id of the event to add the file to
173
+ * @param file - File contents to add including the content and the file name
174
+ * @param version - Optional version of the event to add the file to
175
+ * @returns
176
+ */
177
+ addFileToEvent: addFileToEvent(join3(path, "events")),
178
+ /**
179
+ * Adds a schema to the given event
180
+ * @param id - The id of the event to add the schema to
181
+ * @param schema - Schema contents to add including the content and the file name
182
+ * @param version - Optional version of the event to add the schema to
183
+ * @returns
184
+ */
185
+ addSchemaToEvent: addSchemaToEvent(join3(path, "events"))
186
+ };
187
+ };
188
+ export {
189
+ src_default as default
190
+ };
191
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/events.ts","../src/internal/utils.ts"],"sourcesContent":["import { join } from 'node:path';\nimport { rmEvent, rmEventById, writeEvent, versionEvent, getEvent, addFileToEvent, addSchemaToEvent } from './events';\n\n/**\n * Init the SDK for EventCatalog\n *\n * @param path - The path to the EventCatalog directory\n *\n */\nexport default (path: string) => {\n return {\n /**\n * Returns an events from EventCatalog\n * @param id - The id of the event to retrieve\n * @param version - Optional id of the version to get\n * @returns\n */\n getEvent: getEvent(join(path, 'events')),\n /**\n * Adds an event to EventCatalog\n *\n * @param event - The event to write\n * @param options - Optional options to write the event\n *\n */\n writeEvent: writeEvent(join(path, 'events')),\n /**\n * Remove an event to EventCatalog (modeled on the standard POSIX rm utility)\n *\n * @param path - The path to your event, e.g. `/Inventory/InventoryAdjusted`\n *\n */\n rmEvent: rmEvent(join(path, 'events')),\n /**\n * Remove an event by an Event id\n *\n * @param id - The id of the event you want to remove\n *\n */\n rmEventById: rmEventById(join(path, 'events')),\n /**\n * Moves a given event id to the version directory\n * @param directory\n */\n versionEvent: versionEvent(join(path, 'events')),\n /**\n * Adds a file to the given event\n * @param id - The id of the event to add the file to\n * @param file - File contents to add including the content and the file name\n * @param version - Optional version of the event to add the file to\n * @returns\n */\n addFileToEvent: addFileToEvent(join(path, 'events')),\n /**\n * Adds a schema to the given event\n * @param id - The id of the event to add the schema to\n * @param schema - Schema contents to add including the content and the file name\n * @param version - Optional version of the event to add the schema to\n * @returns\n */\n addSchemaToEvent: addSchemaToEvent(join(path, 'events')),\n };\n};\n","import matter from 'gray-matter';\nimport fs from 'node:fs/promises';\nimport { join } from 'node:path';\nimport { dirname } from 'node:path';\nimport { copyDir, findFileById, getFiles, searchFilesForId, versionExists } from './internal/utils';\nimport type { Event } from './types';\n\n/**\n * Returns an event from EventCatalog.\n *\n * You can optionally specify a version to get a specific version of the event.\n *\n * @example\n * ```ts\n * import utils from '@eventcatalog/utils`;\n *\n * const { getEvent } = utils('/path/to/eventcatalog');\n *\n * // Gets the latest version of the event\n * cont event = await getEvent('InventoryAdjusted');\n *\n * // Gets a version of the event\n * cont event = await getEvent('InventoryAdjusted', '0.0.1');\n * ```\n */\nexport const getEvent =\n (directory: string) =>\n async (id: string, version?: string): Promise<Event> => {\n const file = await findFileById(directory, id, version);\n\n if (!file) throw new Error(`No event found for the given id: ${id}` + (version ? ` and version ${version}` : ''));\n\n const { data, content } = matter.read(file);\n\n return {\n ...data,\n markdown: content.trim(),\n } as Event;\n };\n\nexport const writeEvent =\n (directory: string) =>\n async (event: Event, options: { path: string } = { path: '' }) => {\n // Get the path\n const path = options.path || `/${event.id}`;\n const exists = await versionExists(directory, event.id, event.version);\n\n if (exists) {\n throw new Error(`Failed to write event as the version ${event.version} already exists`);\n }\n\n const { markdown, ...frontmatter } = event;\n const document = matter.stringify(markdown.trim(), frontmatter);\n await fs.mkdir(join(directory, path), { recursive: true });\n await fs.writeFile(join(directory, path, 'index.md'), document);\n };\n\nexport const rmEvent = (directory: string) => async (path: string) => {\n await fs.rm(join(directory, path), { recursive: true });\n};\n\nexport const rmEventById = (directory: string) => async (id: string, version?: string) => {\n // Find all the events in the directory\n const files = await getFiles(`${directory}/**/index.md`);\n\n const matchedFiles = await searchFilesForId(files, id, version);\n\n if (matchedFiles.length === 0) {\n throw new Error(`No event found with id: ${id}`);\n }\n\n await Promise.all(matchedFiles.map((file) => fs.rm(file)));\n};\n\nexport const versionEvent = (directory: string) => async (id: string) => {\n // Find all the events in the directory\n const files = await getFiles(`${directory}/**/index.md`);\n const matchedFiles = await searchFilesForId(files, id);\n\n if (matchedFiles.length === 0) {\n throw new Error(`No event found with id: ${id}`);\n }\n\n // Event that is in the route of the project\n const file = matchedFiles[0];\n const eventDirectory = dirname(file);\n const { data: { version = '0.0.1' } = {} } = matter.read(file);\n const targetDirectory = join(eventDirectory, 'versioned', version);\n\n await fs.mkdir(targetDirectory, { recursive: true });\n\n // Copy the event to the versioned directory\n await copyDir(directory, eventDirectory, targetDirectory, (src) => {\n return !src.includes('versioned');\n });\n\n // Remove all the files in the root of the resource as they have now been versioned\n await fs.readdir(eventDirectory).then(async (resourceFiles) => {\n await Promise.all(\n resourceFiles.map(async (file) => {\n if (file !== 'versioned') {\n await fs.rm(join(eventDirectory, file), { recursive: true });\n }\n })\n );\n });\n};\n\nexport const addFileToEvent =\n (directory: string) => async (id: string, file: { content: string; fileName: string }, version?: string) => {\n const pathToEvent = await findFileById(directory, id, version);\n if (!pathToEvent) throw new Error('Cannot find directory to write file to');\n const contentDirectory = dirname(pathToEvent);\n await fs.writeFile(join(contentDirectory, file.fileName), file.content);\n };\n\nexport const addSchemaToEvent =\n (directory: string) => async (id: string, schema: { schema: string; fileName: string }, version?: string) => {\n await addFileToEvent(directory)(id, { content: schema.schema, fileName: schema.fileName }, version);\n };\n","import { glob } from 'glob';\nimport fs from 'node:fs/promises';\nimport { copy, CopyFilterAsync, CopyFilterSync } from 'fs-extra';\nimport { join } from 'node:path';\n\n/**\n * Returns true if a given version of a resource id exists in the catalog\n */\nexport const versionExists = async (catalogDir: string, id: string, version: string) => {\n const files = await getFiles(`${catalogDir}/**/index.md`);\n const matchedFiles = (await searchFilesForId(files, id, version)) || [];\n return matchedFiles.length > 0;\n};\n\nexport const findFileById = async (catalogDir: string, id: string, version?: string): Promise<string | undefined> => {\n const files = await getFiles(`${catalogDir}/**/index.md`);\n const matchedFiles = (await searchFilesForId(files, id)) || [];\n\n // Return the latest one\n if (!version) {\n return matchedFiles.find((path) => !path.includes('versioned'));\n }\n\n // Find the versioned event\n return matchedFiles.find((path) => path.includes(`versioned/${version}`));\n};\n\nexport const getFiles = async (pattern: string) => {\n try {\n const files = await glob(pattern, { ignore: 'node_modules/**' });\n return files;\n } catch (error) {\n throw new Error(`Error finding files: ${error}`);\n }\n};\n\nexport const searchFilesForId = async (files: string[], id: string, version?: string) => {\n const idRegex = new RegExp(`^id:\\\\s*['\"]?${id}['\"]?\\\\s*$`, 'm');\n const versionRegex = new RegExp(`^version:\\\\s*['\"]?${version}['\"]?\\\\s*$`, 'm');\n\n const matches = await Promise.all(\n files.map(async (file) => {\n const content = await fs.readFile(file, 'utf-8');\n const hasIdMatch = content.match(idRegex);\n\n // Check version if provided\n if (version && !content.match(versionRegex)) {\n return undefined;\n }\n\n if (hasIdMatch) {\n return file;\n }\n })\n );\n\n return matches.filter(Boolean).filter((file) => file !== undefined);\n};\n\n/**\n * Function to copy a directory from source to target, uses a tmp directory\n * @param catalogDir\n * @param source\n * @param target\n * @param filter\n */\nexport const copyDir = async (catalogDir: string, source: string, target: string, filter?: CopyFilterAsync | CopyFilterSync) => {\n const tmpDirectory = join(catalogDir, 'tmp');\n await fs.mkdir(tmpDirectory, { recursive: true });\n\n // Copy everything over\n await copy(source, tmpDirectory, {\n overwrite: true,\n filter,\n });\n\n await copy(tmpDirectory, target, {\n overwrite: true,\n filter,\n });\n\n // Remove the tmp directory\n await fs.rm(tmpDirectory, { recursive: true });\n};\n"],"mappings":";AAAA,SAAS,QAAAA,aAAY;;;ACArB,OAAO,YAAY;AACnB,OAAOC,SAAQ;AACf,SAAS,QAAAC,aAAY;AACrB,SAAS,eAAe;;;ACHxB,SAAS,YAAY;AACrB,OAAO,QAAQ;AACf,SAAS,YAA6C;AACtD,SAAS,YAAY;AAKd,IAAM,gBAAgB,OAAO,YAAo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@
1
+ import { CopyFilterAsync, CopyFilterSync } from 'fs-extra';
2
+
3
+ /**
4
+ * Returns true if a given version of a resource id exists in the catalog
5
+ */
6
+ declare const versionExists: (catalogDir: string, id: string, version: string) => Promise<boolean>;
7
+ declare const findFileById: (catalogDir: string, id: string, version?: string) => Promise<string | undefined>;
8
+ declare const getFiles: (pattern: string) => Promise<string[]>;
9
+ declare const searchFilesForId: (files: string[], id: string, version?: string) => Promise<string[]>;
10
+ /**
11
+ * Function to copy a directory from source to target, uses a tmp directory
12
+ * @param catalogDir
13
+ * @param source
14
+ * @param target
15
+ * @param filter
16
+ */
17
+ declare const copyDir: (catalogDir: string, source: string, target: string, filter?: CopyFilterAsync | CopyFilterSync) => Promise<void>;
18
+
19
+ export { copyDir, findFileById, getFiles, searchFilesForId, versionExists };
@@ -0,0 +1,19 @@
1
+ import { CopyFilterAsync, CopyFilterSync } from 'fs-extra';
2
+
3
+ /**
4
+ * Returns true if a given version of a resource id exists in the catalog
5
+ */
6
+ declare const versionExists: (catalogDir: string, id: string, version: string) => Promise<boolean>;
7
+ declare const findFileById: (catalogDir: string, id: string, version?: string) => Promise<string | undefined>;
8
+ declare const getFiles: (pattern: string) => Promise<string[]>;
9
+ declare const searchFilesForId: (files: string[], id: string, version?: string) => Promise<string[]>;
10
+ /**
11
+ * Function to copy a directory from source to target, uses a tmp directory
12
+ * @param catalogDir
13
+ * @param source
14
+ * @param target
15
+ * @param filter
16
+ */
17
+ declare const copyDir: (catalogDir: string, source: string, target: string, filter?: CopyFilterAsync | CopyFilterSync) => Promise<void>;
18
+
19
+ export { copyDir, findFileById, getFiles, searchFilesForId, versionExists };
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/internal/utils.ts
31
+ var utils_exports = {};
32
+ __export(utils_exports, {
33
+ copyDir: () => copyDir,
34
+ findFileById: () => findFileById,
35
+ getFiles: () => getFiles,
36
+ searchFilesForId: () => searchFilesForId,
37
+ versionExists: () => versionExists
38
+ });
39
+ module.exports = __toCommonJS(utils_exports);
40
+ var import_glob = require("glob");
41
+ var import_promises = __toESM(require("fs/promises"));
42
+ var import_fs_extra = require("fs-extra");
43
+ var import_node_path = require("path");
44
+ var versionExists = async (catalogDir, id, version) => {
45
+ const files = await getFiles(`${catalogDir}/**/index.md`);
46
+ const matchedFiles = await searchFilesForId(files, id, version) || [];
47
+ return matchedFiles.length > 0;
48
+ };
49
+ var findFileById = async (catalogDir, id, version) => {
50
+ const files = await getFiles(`${catalogDir}/**/index.md`);
51
+ const matchedFiles = await searchFilesForId(files, id) || [];
52
+ if (!version) {
53
+ return matchedFiles.find((path) => !path.includes("versioned"));
54
+ }
55
+ return matchedFiles.find((path) => path.includes(`versioned/${version}`));
56
+ };
57
+ var getFiles = async (pattern) => {
58
+ try {
59
+ const files = await (0, import_glob.glob)(pattern, { ignore: "node_modules/**" });
60
+ return files;
61
+ } catch (error) {
62
+ throw new Error(`Error finding files: ${error}`);
63
+ }
64
+ };
65
+ var searchFilesForId = async (files, id, version) => {
66
+ const idRegex = new RegExp(`^id:\\s*['"]?${id}['"]?\\s*$`, "m");
67
+ const versionRegex = new RegExp(`^version:\\s*['"]?${version}['"]?\\s*$`, "m");
68
+ const matches = await Promise.all(
69
+ files.map(async (file) => {
70
+ const content = await import_promises.default.readFile(file, "utf-8");
71
+ const hasIdMatch = content.match(idRegex);
72
+ if (version && !content.match(versionRegex)) {
73
+ return void 0;
74
+ }
75
+ if (hasIdMatch) {
76
+ return file;
77
+ }
78
+ })
79
+ );
80
+ return matches.filter(Boolean).filter((file) => file !== void 0);
81
+ };
82
+ var copyDir = async (catalogDir, source, target, filter) => {
83
+ const tmpDirectory = (0, import_node_path.join)(catalogDir, "tmp");
84
+ await import_promises.default.mkdir(tmpDirectory, { recursive: true });
85
+ await (0, import_fs_extra.copy)(source, tmpDirectory, {
86
+ overwrite: true,
87
+ filter
88
+ });
89
+ await (0, import_fs_extra.copy)(tmpDirectory, target, {
90
+ overwrite: true,
91
+ filter
92
+ });
93
+ await import_promises.default.rm(tmpDirectory, { recursive: true });
94
+ };
95
+ // Annotate the CommonJS export names for ESM import in node:
96
+ 0 && (module.exports = {
97
+ copyDir,
98
+ findFileById,
99
+ getFiles,
100
+ searchFilesForId,
101
+ versionExists
102
+ });
103
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/utils.ts"],"sourcesContent":["import { glob } from 'glob';\nimport fs from 'node:fs/promises';\nimport { copy, CopyFilterAsync, CopyFilterSync } from 'fs-extra';\nimport { join } from 'node:path';\n\n/**\n * Returns true if a given version of a resource id exists in the catalog\n */\nexport const versionExists = async (catalogDir: string, id: string, version: string) => {\n const files = await getFiles(`${catalogDir}/**/index.md`);\n const matchedFiles = (await searchFilesForId(files, id, version)) || [];\n return matchedFiles.length > 0;\n};\n\nexport const findFileById = async (catalogDir: string, id: string, version?: string): Promise<string | undefined> => {\n const files = await getFiles(`${catalogDir}/**/index.md`);\n const matchedFiles = (await searchFilesForId(files, id)) || [];\n\n // Return the latest one\n if (!version) {\n return matchedFiles.find((path) => !path.includes('versioned'));\n }\n\n // Find the versioned event\n return matchedFiles.find((path) => path.includes(`versioned/${version}`));\n};\n\nexport const getFiles = async (pattern: string) => {\n try {\n const files = await glob(pattern, { ignore: 'node_modules/**' });\n return files;\n } catch (error) {\n throw new Error(`Error finding files: ${error}`);\n }\n};\n\nexport const searchFilesForId = async (files: string[], id: string, version?: string) => {\n const idRegex = new RegExp(`^id:\\\\s*['\"]?${id}['\"]?\\\\s*$`, 'm');\n const versionRegex = new RegExp(`^version:\\\\s*['\"]?${version}['\"]?\\\\s*$`, 'm');\n\n const matches = await Promise.all(\n files.map(async (file) => {\n const content = await fs.readFile(file, 'utf-8');\n const hasIdMatch = content.match(idRegex);\n\n // Check version if provided\n if (version && !content.match(versionRegex)) {\n return undefined;\n }\n\n if (hasIdMatch) {\n return file;\n }\n })\n );\n\n return matches.filter(Boolean).filter((file) => file !== undefined);\n};\n\n/**\n * Function to copy a directory from source to target, uses a tmp directory\n * @param catalogDir\n * @param source\n * @param target\n * @param filter\n */\nexport const copyDir = async (catalogDir: string, source: string, target: string, filter?: CopyFilterAsync | CopyFilterSync) => {\n const tmpDirectory = join(catalogDir, 'tmp');\n await fs.mkdir(tmpDirectory, { recursive: true });\n\n // Copy everything over\n await copy(source, tmpDirectory, {\n overwrite: true,\n filter,\n });\n\n await copy(tmpDirectory, target, {\n overwrite: true,\n filter,\n });\n\n // Remove the tmp directory\n await fs.rm(tmpDirectory, { recursive: true });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAO;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,QAAQ,OAAO,OAAO,EAAE,OAAO,CAAC,SAAS,SAAS,MAAS;AACpE;AASO,IAAM,UAAU,OAAO,YAAoB,QAAgB,QAAgB,WAA8C;AAC9H,QAAM,mBAAe,uBAAK,YAAY,KAAK;AAC3C,QAAM,gBAAAA,QAAG,MAAM,cAAc,EAAE,WAAW,KAAK,CAAC;AAGhD,YAAM,sBAAK,QAAQ,cAAc;AAAA,IAC/B,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AAED,YAAM,sBAAK,cAAc,QAAQ;AAAA,IAC/B,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AAGD,QAAM,gBAAAA,QAAG,GAAG,cAAc,EAAE,WAAW,KAAK,CAAC;AAC/C;","names":["fs"]}
@@ -0,0 +1,64 @@
1
+ // src/internal/utils.ts
2
+ import { glob } from "glob";
3
+ import fs from "fs/promises";
4
+ import { copy } from "fs-extra";
5
+ import { join } from "path";
6
+ var versionExists = async (catalogDir, id, version) => {
7
+ const files = await getFiles(`${catalogDir}/**/index.md`);
8
+ const matchedFiles = await searchFilesForId(files, id, version) || [];
9
+ return matchedFiles.length > 0;
10
+ };
11
+ var findFileById = async (catalogDir, id, version) => {
12
+ const files = await getFiles(`${catalogDir}/**/index.md`);
13
+ const matchedFiles = await searchFilesForId(files, id) || [];
14
+ if (!version) {
15
+ return matchedFiles.find((path) => !path.includes("versioned"));
16
+ }
17
+ return matchedFiles.find((path) => path.includes(`versioned/${version}`));
18
+ };
19
+ var getFiles = async (pattern) => {
20
+ try {
21
+ const files = await glob(pattern, { ignore: "node_modules/**" });
22
+ return files;
23
+ } catch (error) {
24
+ throw new Error(`Error finding files: ${error}`);
25
+ }
26
+ };
27
+ var searchFilesForId = async (files, id, version) => {
28
+ const idRegex = new RegExp(`^id:\\s*['"]?${id}['"]?\\s*$`, "m");
29
+ const versionRegex = new RegExp(`^version:\\s*['"]?${version}['"]?\\s*$`, "m");
30
+ const matches = await Promise.all(
31
+ files.map(async (file) => {
32
+ const content = await fs.readFile(file, "utf-8");
33
+ const hasIdMatch = content.match(idRegex);
34
+ if (version && !content.match(versionRegex)) {
35
+ return void 0;
36
+ }
37
+ if (hasIdMatch) {
38
+ return file;
39
+ }
40
+ })
41
+ );
42
+ return matches.filter(Boolean).filter((file) => file !== void 0);
43
+ };
44
+ var copyDir = async (catalogDir, source, target, filter) => {
45
+ const tmpDirectory = join(catalogDir, "tmp");
46
+ await fs.mkdir(tmpDirectory, { recursive: true });
47
+ await copy(source, tmpDirectory, {
48
+ overwrite: true,
49
+ filter
50
+ });
51
+ await copy(tmpDirectory, target, {
52
+ overwrite: true,
53
+ filter
54
+ });
55
+ await fs.rm(tmpDirectory, { recursive: true });
56
+ };
57
+ export {
58
+ copyDir,
59
+ findFileById,
60
+ getFiles,
61
+ searchFilesForId,
62
+ versionExists
63
+ };
64
+ //# sourceMappingURL=utils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/internal/utils.ts"],"sourcesContent":["import { glob } from 'glob';\nimport fs from 'node:fs/promises';\nimport { copy, CopyFilterAsync, CopyFilterSync } from 'fs-extra';\nimport { join } from 'node:path';\n\n/**\n * Returns true if a given version of a resource id exists in the catalog\n */\nexport const versionExists = async (catalogDir: string, id: string, version: string) => {\n const files = await getFiles(`${catalogDir}/**/index.md`);\n const matchedFiles = (await searchFilesForId(files, id, version)) || [];\n return matchedFiles.length > 0;\n};\n\nexport const findFileById = async (catalogDir: string, id: string, version?: string): Promise<string | undefined> => {\n const files = await getFiles(`${catalogDir}/**/index.md`);\n const matchedFiles = (await searchFilesForId(files, id)) || [];\n\n // Return the latest one\n if (!version) {\n return matchedFiles.find((path) => !path.includes('versioned'));\n }\n\n // Find the versioned event\n return matchedFiles.find((path) => path.includes(`versioned/${version}`));\n};\n\nexport const getFiles = async (pattern: string) => {\n try {\n const files = await glob(pattern, { ignore: 'node_modules/**' });\n return files;\n } catch (error) {\n throw new Error(`Error finding files: ${error}`);\n }\n};\n\nexport const searchFilesForId = async (files: string[], id: string, version?: string) => {\n const idRegex = new RegExp(`^id:\\\\s*['\"]?${id}['\"]?\\\\s*$`, 'm');\n const versionRegex = new RegExp(`^version:\\\\s*['\"]?${version}['\"]?\\\\s*$`, 'm');\n\n const matches = await Promise.all(\n files.map(async (file) => {\n const content = await fs.readFile(file, 'utf-8');\n const hasIdMatch = content.match(idRegex);\n\n // Check version if provided\n if (version && !content.match(versionRegex)) {\n return undefined;\n }\n\n if (hasIdMatch) {\n return file;\n }\n })\n );\n\n return matches.filter(Boolean).filter((file) => file !== undefined);\n};\n\n/**\n * Function to copy a directory from source to target, uses a tmp directory\n * @param catalogDir\n * @param source\n * @param target\n * @param filter\n */\nexport const copyDir = async (catalogDir: string, source: string, target: string, filter?: CopyFilterAsync | CopyFilterSync) => {\n const tmpDirectory = join(catalogDir, 'tmp');\n await fs.mkdir(tmpDirectory, { recursive: true });\n\n // Copy everything over\n await copy(source, tmpDirectory, {\n overwrite: true,\n filter,\n });\n\n await copy(tmpDirectory, target, {\n overwrite: true,\n filter,\n });\n\n // Remove the tmp directory\n await fs.rm(tmpDirectory, { recursive: true });\n};\n"],"mappings":";AAAA,SAAS,YAAY;AACrB,OAAO,QAAQ;AACf,SAAS,YAA6C;AACtD,SAAS,YAAY;AAKd,IAAM,gBAAgB,OAAO,YAAoB,IAAY,YAAoB;AACtF,QAAM,QAAQ,MAAM,SAAS,GAAG,UAAU,cAAc;AACxD,QAAM,eAAgB,MAAM,iBAAiB,OAAO,IAAI,OAAO,KAAM,CAAC;AACtE,SAAO,aAAa,SAAS;AAC/B;AAEO,IAAM,eAAe,OAAO,YAAoB,IAAY,YAAkD;AACnH,QAAM,QAAQ,MAAM,SAAS,GAAG,UAAU,cAAc;AACxD,QAAM,eAAgB,MAAM,iBAAiB,OAAO,EAAE,KAAM,CAAC;AAG7D,MAAI,CAAC,SAAS;AACZ,WAAO,aAAa,KAAK,CAAC,SAAS,CA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