@eventcatalog/sdk 2.10.0 → 2.12.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 (108) hide show
  1. package/README.md +86 -1
  2. package/dist/cli/index.d.mts +1 -0
  3. package/dist/cli/index.d.ts +1 -0
  4. package/dist/{eventcatalog.js → cli/index.js} +691 -347
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/{eventcatalog.mjs → cli/index.mjs} +765 -401
  7. package/dist/cli/index.mjs.map +1 -0
  8. package/dist/cli-docs.d.mts +43 -0
  9. package/dist/cli-docs.d.ts +43 -0
  10. package/dist/cli-docs.js +1513 -0
  11. package/dist/cli-docs.js.map +1 -0
  12. package/dist/cli-docs.mjs +1485 -0
  13. package/dist/cli-docs.mjs.map +1 -0
  14. package/dist/index.d.mts +504 -4
  15. package/dist/index.d.ts +504 -4
  16. package/dist/index.js +325 -108
  17. package/dist/index.js.map +1 -1
  18. package/dist/index.mjs +325 -108
  19. package/dist/index.mjs.map +1 -1
  20. package/package.json +13 -4
  21. package/dist/channels.d.mts +0 -214
  22. package/dist/channels.d.ts +0 -214
  23. package/dist/channels.js +0 -432
  24. package/dist/channels.js.map +0 -1
  25. package/dist/channels.mjs +0 -384
  26. package/dist/channels.mjs.map +0 -1
  27. package/dist/commands.d.mts +0 -274
  28. package/dist/commands.d.ts +0 -274
  29. package/dist/commands.js +0 -394
  30. package/dist/commands.js.map +0 -1
  31. package/dist/commands.mjs +0 -350
  32. package/dist/commands.mjs.map +0 -1
  33. package/dist/containers.d.mts +0 -179
  34. package/dist/containers.d.ts +0 -179
  35. package/dist/containers.js +0 -388
  36. package/dist/containers.js.map +0 -1
  37. package/dist/containers.mjs +0 -345
  38. package/dist/containers.mjs.map +0 -1
  39. package/dist/custom-docs.d.mts +0 -89
  40. package/dist/custom-docs.d.ts +0 -89
  41. package/dist/custom-docs.js +0 -164
  42. package/dist/custom-docs.js.map +0 -1
  43. package/dist/custom-docs.mjs +0 -122
  44. package/dist/custom-docs.mjs.map +0 -1
  45. package/dist/data-stores.d.mts +0 -179
  46. package/dist/data-stores.d.ts +0 -179
  47. package/dist/data-stores.js +0 -401
  48. package/dist/data-stores.js.map +0 -1
  49. package/dist/data-stores.mjs +0 -356
  50. package/dist/data-stores.mjs.map +0 -1
  51. package/dist/domains.d.mts +0 -297
  52. package/dist/domains.d.ts +0 -297
  53. package/dist/domains.js +0 -480
  54. package/dist/domains.js.map +0 -1
  55. package/dist/domains.mjs +0 -433
  56. package/dist/domains.mjs.map +0 -1
  57. package/dist/entities.d.mts +0 -174
  58. package/dist/entities.d.ts +0 -174
  59. package/dist/entities.js +0 -348
  60. package/dist/entities.js.map +0 -1
  61. package/dist/entities.mjs +0 -307
  62. package/dist/entities.mjs.map +0 -1
  63. package/dist/eventcatalog.d.mts +0 -21
  64. package/dist/eventcatalog.d.ts +0 -21
  65. package/dist/eventcatalog.js.map +0 -1
  66. package/dist/eventcatalog.mjs.map +0 -1
  67. package/dist/events.d.mts +0 -276
  68. package/dist/events.d.ts +0 -276
  69. package/dist/events.js +0 -393
  70. package/dist/events.js.map +0 -1
  71. package/dist/events.mjs +0 -349
  72. package/dist/events.mjs.map +0 -1
  73. package/dist/messages.d.mts +0 -65
  74. package/dist/messages.d.ts +0 -65
  75. package/dist/messages.js +0 -312
  76. package/dist/messages.js.map +0 -1
  77. package/dist/messages.mjs +0 -269
  78. package/dist/messages.mjs.map +0 -1
  79. package/dist/queries.d.mts +0 -276
  80. package/dist/queries.d.ts +0 -276
  81. package/dist/queries.js +0 -394
  82. package/dist/queries.js.map +0 -1
  83. package/dist/queries.mjs +0 -350
  84. package/dist/queries.mjs.map +0 -1
  85. package/dist/services.d.mts +0 -384
  86. package/dist/services.d.ts +0 -384
  87. package/dist/services.js +0 -577
  88. package/dist/services.js.map +0 -1
  89. package/dist/services.mjs +0 -526
  90. package/dist/services.mjs.map +0 -1
  91. package/dist/teams.d.mts +0 -90
  92. package/dist/teams.d.ts +0 -90
  93. package/dist/teams.js +0 -246
  94. package/dist/teams.js.map +0 -1
  95. package/dist/teams.mjs +0 -202
  96. package/dist/teams.mjs.map +0 -1
  97. package/dist/types.d.d.mts +0 -304
  98. package/dist/types.d.d.ts +0 -304
  99. package/dist/types.d.js +0 -19
  100. package/dist/types.d.js.map +0 -1
  101. package/dist/types.d.mjs +0 -1
  102. package/dist/types.d.mjs.map +0 -1
  103. package/dist/users.d.mts +0 -83
  104. package/dist/users.d.ts +0 -83
  105. package/dist/users.js +0 -127
  106. package/dist/users.js.map +0 -1
  107. package/dist/users.mjs +0 -88
  108. package/dist/users.mjs.map +0 -1
package/dist/types.d.d.ts DELETED
@@ -1,304 +0,0 @@
1
- // Base type for all resources (domains, services and messages)
2
- interface BaseSchema {
3
- id: string;
4
- name: string;
5
- summary?: string;
6
- version: string;
7
- badges?: Badge[];
8
- sidebar?: {
9
- badge?: string;
10
- };
11
- owners?: string[];
12
- schemaPath?: string;
13
- markdown: string;
14
- repository?: {
15
- language?: string;
16
- url?: string;
17
- };
18
- deprecated?:
19
- | boolean
20
- | {
21
- date?: string;
22
- message?: string;
23
- };
24
- styles?: {
25
- icon?: string;
26
- node?: {
27
- color?: string;
28
- label?: string;
29
- };
30
- };
31
- attachments?:
32
- | string[]
33
- | {
34
- url: string;
35
- title?: string;
36
- type?: string;
37
- description?: string;
38
- icon?: string;
39
- }[];
40
- resourceGroups?: ResourceGroup[];
41
- diagrams?: ResourcePointer[];
42
- editUrl?: string;
43
- draft?: boolean | { title?: string; message?: string };
44
- // SDK types
45
- schema?: any;
46
- }
47
-
48
- type ResourcePointer = {
49
- id: string;
50
- version?: string;
51
- type?: string;
52
- };
53
-
54
- type SendsPointer = {
55
- id: string;
56
- version?: string;
57
- to?: ChannelPointer[];
58
- };
59
-
60
- type ReceivesPointer = {
61
- id: string;
62
- version?: string;
63
- from?: ChannelPointer[];
64
- };
65
-
66
- interface ResourceGroup {
67
- id?: string;
68
- title?: string;
69
- items: ResourcePointer[];
70
- limit?: number;
71
- sidebar?: boolean;
72
- }
73
-
74
- interface ChannelPointer extends ResourcePointer {
75
- parameters?: Record<string, string>;
76
- }
77
-
78
- type Message = Event | Command | Query;
79
-
80
- interface CustomDoc {
81
- title: string;
82
- summary: string;
83
- slug?: string;
84
- sidebar?: {
85
- label: string;
86
- order: number;
87
- };
88
- owners?: string[];
89
- badges?: Badge[];
90
- fileName?: string;
91
- markdown: string;
92
- }
93
-
94
- interface MessageDetailsPanelProperty {
95
- producers?: DetailPanelProperty;
96
- consumers?: DetailPanelProperty;
97
- channels?: DetailPanelProperty;
98
- versions?: DetailPanelProperty;
99
- repository?: DetailPanelProperty;
100
- }
101
-
102
- interface Event extends BaseSchema {
103
- channels?: ChannelPointer[];
104
- detailsPanel?: MessageDetailsPanelProperty;
105
- }
106
- interface Command extends BaseSchema {
107
- channels?: ChannelPointer[];
108
- detailsPanel?: MessageDetailsPanelProperty;
109
- }
110
- interface Query extends BaseSchema {
111
- channels?: ChannelPointer[];
112
- detailsPanel?: MessageDetailsPanelProperty;
113
- }
114
- interface Channel extends BaseSchema {
115
- address?: string;
116
- protocols?: string[];
117
- routes?: ChannelPointer[];
118
- detailsPanel?: {
119
- producers?: DetailPanelProperty;
120
- consumers?: DetailPanelProperty;
121
- messages?: DetailPanelProperty;
122
- protocols?: DetailPanelProperty;
123
- versions?: DetailPanelProperty;
124
- repository?: DetailPanelProperty;
125
- owners?: DetailPanelProperty;
126
- changelog?: DetailPanelProperty;
127
- };
128
- // parameters?: Record<string, Parameter>;
129
- parameters?: {
130
- [key: string]: {
131
- enum?: string[];
132
- default?: string;
133
- examples?: string[];
134
- description?: string;
135
- };
136
- };
137
- }
138
-
139
- interface Specifications {
140
- asyncapiPath?: string;
141
- openapiPath?: string;
142
- graphqlPath?: string;
143
- }
144
-
145
- interface Specification {
146
- type: 'openapi' | 'asyncapi' | 'graphql';
147
- path: string;
148
- name?: string;
149
- }
150
-
151
- interface Service extends BaseSchema {
152
- sends?: SendsPointer[];
153
- receives?: ReceivesPointer[];
154
- entities?: ResourcePointer[];
155
- writesTo?: ResourcePointer[];
156
- readsFrom?: ResourcePointer[];
157
- specifications?: Specifications | Specification[];
158
- detailsPanel?: {
159
- domains?: DetailPanelProperty;
160
- messages?: DetailPanelProperty;
161
- versions?: DetailPanelProperty;
162
- specifications?: DetailPanelProperty;
163
- entities?: DetailPanelProperty;
164
- repository?: DetailPanelProperty;
165
- owners?: DetailPanelProperty;
166
- changelog?: DetailPanelProperty;
167
- };
168
- }
169
-
170
- interface Domain extends BaseSchema {
171
- services?: ResourcePointer[];
172
- domains?: ResourcePointer[];
173
- entities?: ResourcePointer[];
174
- detailsPanel?: {
175
- parentDomains?: DetailPanelProperty;
176
- subdomains?: DetailPanelProperty;
177
- services?: DetailPanelProperty;
178
- entities?: DetailPanelProperty;
179
- messages?: DetailPanelProperty;
180
- ubiquitousLanguage?: DetailPanelProperty;
181
- repository?: DetailPanelProperty;
182
- versions?: DetailPanelProperty;
183
- owners?: DetailPanelProperty;
184
- changelog?: DetailPanelProperty;
185
- };
186
- }
187
-
188
- interface Team {
189
- id: string;
190
- name: string;
191
- summary?: string;
192
- email?: string;
193
- hidden?: boolean;
194
- slackDirectMessageUrl?: string;
195
- members?: User[];
196
- ownedCommands?: Command[];
197
- ownedServices?: Service[];
198
- ownedEvents?: Event[];
199
- markdown: string;
200
- }
201
-
202
- interface User {
203
- id: string;
204
- name: string;
205
- avatarUrl: string;
206
- role?: string;
207
- hidden?: boolean;
208
- email?: string;
209
- slackDirectMessageUrl?: string;
210
- ownedServices?: Service[];
211
- ownedEvents?: Event[];
212
- ownedCommands?: Command[];
213
- associatedTeams?: Team[];
214
- markdown: string;
215
- }
216
-
217
- interface Badge {
218
- content: string;
219
- backgroundColor: string;
220
- textColor: string;
221
- icon?: string;
222
- }
223
-
224
- interface UbiquitousLanguage {
225
- id: string;
226
- name: string;
227
- summary?: string;
228
- description?: string;
229
- icon?: string;
230
- }
231
-
232
- interface UbiquitousLanguageDictionary {
233
- dictionary: UbiquitousLanguage[];
234
- }
235
-
236
- interface DetailPanelProperty {
237
- visible: boolean;
238
- }
239
-
240
- interface Entity extends BaseSchema {
241
- aggregateRoot?: boolean;
242
- identifier?: string;
243
- properties?: {
244
- name: string;
245
- type: string;
246
- required?: boolean;
247
- description?: string;
248
- references?: string;
249
- referencesIdentifier?: string;
250
- relationType?: string;
251
- }[];
252
- detailsPanel?: {
253
- domains?: DetailPanelProperty;
254
- services?: DetailPanelProperty;
255
- messages?: DetailPanelProperty;
256
- versions?: DetailPanelProperty;
257
- owners?: DetailPanelProperty;
258
- changelog?: DetailPanelProperty;
259
- };
260
- }
261
-
262
- declare enum DataClassification {
263
- Public = 'public',
264
- Internal = 'internal',
265
- Confidential = 'confidential',
266
- Regulated = 'regulated',
267
- }
268
-
269
- interface Container extends BaseSchema {
270
- container_type: 'database' | 'cache' | 'objectStore' | 'searchIndex' | 'dataWarehouse' | 'dataLake' | 'externalSaaS' | 'other';
271
- technology?: string;
272
- authoritative?: boolean;
273
- access_mode?: string;
274
- classification?: DataClassification;
275
- residency?: string;
276
- retention?: string;
277
- detailsPanel?: {
278
- versions?: DetailPanelProperty;
279
- repository?: DetailPanelProperty;
280
- owners?: DetailPanelProperty;
281
- changelog?: DetailPanelProperty;
282
- };
283
- }
284
-
285
- type EventCatalog = {
286
- version: string;
287
- catalogVersion: string;
288
- createdAt: string;
289
- resources: {
290
- domains?: ExportedResource<Domain>[];
291
- services?: ExportedResource<Service>[];
292
- messages?: {
293
- events?: ExportedResource<Event>[];
294
- queries?: ExportedResource<Query>[];
295
- commands?: ExportedResource<Command>[];
296
- };
297
- teams?: ExportedResource<Team>[];
298
- users?: ExportedResource<User>[];
299
- channels?: ExportedResource<Channel>[];
300
- customDocs?: ExportedResource<CustomDoc>[];
301
- };
302
- };
303
-
304
- export type { Badge, BaseSchema, Channel, ChannelPointer, Command, Container, CustomDoc, Domain, Entity, Event, EventCatalog, Message, Query, ReceivesPointer, ResourceGroup, ResourcePointer, SendsPointer, Service, Specification, Specifications, Team, UbiquitousLanguage, UbiquitousLanguageDictionary, User };
package/dist/types.d.js DELETED
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (let key of __getOwnPropNames(from))
9
- if (!__hasOwnProp.call(to, key) && key !== except)
10
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
- }
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
-
16
- // src/types.d.ts
17
- var types_d_exports = {};
18
- module.exports = __toCommonJS(types_d_exports);
19
- //# sourceMappingURL=types.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/types.d.ts"],"sourcesContent":["// Base type for all resources (domains, services and messages)\nexport interface BaseSchema {\n id: string;\n name: string;\n summary?: string;\n version: string;\n badges?: Badge[];\n sidebar?: {\n badge?: string;\n };\n owners?: string[];\n schemaPath?: string;\n markdown: string;\n repository?: {\n language?: string;\n url?: string;\n };\n deprecated?:\n | boolean\n | {\n date?: string;\n message?: string;\n };\n styles?: {\n icon?: string;\n node?: {\n color?: string;\n label?: string;\n };\n };\n attachments?:\n | string[]\n | {\n url: string;\n title?: string;\n type?: string;\n description?: string;\n icon?: string;\n }[];\n resourceGroups?: ResourceGroup[];\n diagrams?: ResourcePointer[];\n editUrl?: string;\n draft?: boolean | { title?: string; message?: string };\n // SDK types\n schema?: any;\n}\n\nexport type ResourcePointer = {\n id: string;\n version?: string;\n type?: string;\n};\n\nexport type SendsPointer = {\n id: string;\n version?: string;\n to?: ChannelPointer[];\n};\n\nexport type ReceivesPointer = {\n id: string;\n version?: string;\n from?: ChannelPointer[];\n};\n\nexport interface ResourceGroup {\n id?: string;\n title?: string;\n items: ResourcePointer[];\n limit?: number;\n sidebar?: boolean;\n}\n\nexport interface ChannelPointer extends ResourcePointer {\n parameters?: Record<string, string>;\n}\n\nexport type Message = Event | Command | Query;\n\nenum ResourceType {\n Service = 'service',\n Event = 'event',\n Command = 'command',\n}\n\nexport interface CustomDoc {\n title: string;\n summary: string;\n slug?: string;\n sidebar?: {\n label: string;\n order: number;\n };\n owners?: string[];\n badges?: Badge[];\n fileName?: string;\n markdown: string;\n}\n\ninterface MessageDetailsPanelProperty {\n producers?: DetailPanelProperty;\n consumers?: DetailPanelProperty;\n channels?: DetailPanelProperty;\n versions?: DetailPanelProperty;\n repository?: DetailPanelProperty;\n}\n\nexport interface Event extends BaseSchema {\n channels?: ChannelPointer[];\n detailsPanel?: MessageDetailsPanelProperty;\n}\nexport interface Command extends BaseSchema {\n channels?: ChannelPointer[];\n detailsPanel?: MessageDetailsPanelProperty;\n}\nexport interface Query extends BaseSchema {\n channels?: ChannelPointer[];\n detailsPanel?: MessageDetailsPanelProperty;\n}\nexport interface Channel extends BaseSchema {\n address?: string;\n protocols?: string[];\n routes?: ChannelPointer[];\n detailsPanel?: {\n producers?: DetailPanelProperty;\n consumers?: DetailPanelProperty;\n messages?: DetailPanelProperty;\n protocols?: DetailPanelProperty;\n versions?: DetailPanelProperty;\n repository?: DetailPanelProperty;\n owners?: DetailPanelProperty;\n changelog?: DetailPanelProperty;\n };\n // parameters?: Record<string, Parameter>;\n parameters?: {\n [key: string]: {\n enum?: string[];\n default?: string;\n examples?: string[];\n description?: string;\n };\n };\n}\n\nexport interface Specifications {\n asyncapiPath?: string;\n openapiPath?: string;\n graphqlPath?: string;\n}\n\nexport interface Specification {\n type: 'openapi' | 'asyncapi' | 'graphql';\n path: string;\n name?: string;\n}\n\nexport interface Service extends BaseSchema {\n sends?: SendsPointer[];\n receives?: ReceivesPointer[];\n entities?: ResourcePointer[];\n writesTo?: ResourcePointer[];\n readsFrom?: ResourcePointer[];\n specifications?: Specifications | Specification[];\n detailsPanel?: {\n domains?: DetailPanelProperty;\n messages?: DetailPanelProperty;\n versions?: DetailPanelProperty;\n specifications?: DetailPanelProperty;\n entities?: DetailPanelProperty;\n repository?: DetailPanelProperty;\n owners?: DetailPanelProperty;\n changelog?: DetailPanelProperty;\n };\n}\n\nexport interface Domain extends BaseSchema {\n services?: ResourcePointer[];\n domains?: ResourcePointer[];\n entities?: ResourcePointer[];\n detailsPanel?: {\n parentDomains?: DetailPanelProperty;\n subdomains?: DetailPanelProperty;\n services?: DetailPanelProperty;\n entities?: DetailPanelProperty;\n messages?: DetailPanelProperty;\n ubiquitousLanguage?: DetailPanelProperty;\n repository?: DetailPanelProperty;\n versions?: DetailPanelProperty;\n owners?: DetailPanelProperty;\n changelog?: DetailPanelProperty;\n };\n}\n\nexport interface Team {\n id: string;\n name: string;\n summary?: string;\n email?: string;\n hidden?: boolean;\n slackDirectMessageUrl?: string;\n members?: User[];\n ownedCommands?: Command[];\n ownedServices?: Service[];\n ownedEvents?: Event[];\n markdown: string;\n}\n\nexport interface User {\n id: string;\n name: string;\n avatarUrl: string;\n role?: string;\n hidden?: boolean;\n email?: string;\n slackDirectMessageUrl?: string;\n ownedServices?: Service[];\n ownedEvents?: Event[];\n ownedCommands?: Command[];\n associatedTeams?: Team[];\n markdown: string;\n}\n\nexport interface Badge {\n content: string;\n backgroundColor: string;\n textColor: string;\n icon?: string;\n}\n\nexport interface UbiquitousLanguage {\n id: string;\n name: string;\n summary?: string;\n description?: string;\n icon?: string;\n}\n\nexport interface UbiquitousLanguageDictionary {\n dictionary: UbiquitousLanguage[];\n}\n\ninterface DetailPanelProperty {\n visible: boolean;\n}\n\nexport interface Entity extends BaseSchema {\n aggregateRoot?: boolean;\n identifier?: string;\n properties?: {\n name: string;\n type: string;\n required?: boolean;\n description?: string;\n references?: string;\n referencesIdentifier?: string;\n relationType?: string;\n }[];\n detailsPanel?: {\n domains?: DetailPanelProperty;\n services?: DetailPanelProperty;\n messages?: DetailPanelProperty;\n versions?: DetailPanelProperty;\n owners?: DetailPanelProperty;\n changelog?: DetailPanelProperty;\n };\n}\n\nenum DataClassification {\n Public = 'public',\n Internal = 'internal',\n Confidential = 'confidential',\n Regulated = 'regulated',\n}\n\nexport interface Container extends BaseSchema {\n container_type: 'database' | 'cache' | 'objectStore' | 'searchIndex' | 'dataWarehouse' | 'dataLake' | 'externalSaaS' | 'other';\n technology?: string;\n authoritative?: boolean;\n access_mode?: string;\n classification?: DataClassification;\n residency?: string;\n retention?: string;\n detailsPanel?: {\n versions?: DetailPanelProperty;\n repository?: DetailPanelProperty;\n owners?: DetailPanelProperty;\n changelog?: DetailPanelProperty;\n };\n}\n\nexport type EventCatalog = {\n version: string;\n catalogVersion: string;\n createdAt: string;\n resources: {\n domains?: ExportedResource<Domain>[];\n services?: ExportedResource<Service>[];\n messages?: {\n events?: ExportedResource<Event>[];\n queries?: ExportedResource<Query>[];\n commands?: ExportedResource<Command>[];\n };\n teams?: ExportedResource<Team>[];\n users?: ExportedResource<User>[];\n channels?: ExportedResource<Channel>[];\n customDocs?: ExportedResource<CustomDoc>[];\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
package/dist/types.d.mjs DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=types.d.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/users.d.mts DELETED
@@ -1,83 +0,0 @@
1
- import { User } from './types.d.mjs';
2
-
3
- /**
4
- * Returns a user from EventCatalog.
5
- *
6
- *
7
- * @example
8
- * ```ts
9
- * import utils from '@eventcatalog/utils';
10
- *
11
- * const { getUser } = utils('/path/to/eventcatalog');
12
- *
13
- * // Gets the user with the given id
14
- * const user = await getUser('eventcatalog-core-user');
15
- *
16
- * ```
17
- */
18
- declare const getUser: (catalogDir: string) => (id: string) => Promise<User | undefined>;
19
- /**
20
- * Returns all users from EventCatalog.
21
- *
22
- * @example
23
- * ```ts
24
- * import utils from '@eventcatalog/utils';
25
- *
26
- * const { getUsers } = utils('/path/to/eventcatalog');
27
- *
28
- * // Gets all users from the catalog
29
- * const channels = await getUsers();
30
- *
31
- * ```
32
- */
33
- declare const getUsers: (catalogDir: string) => (options?: {}) => Promise<User[]>;
34
- /**
35
- * Write a user to EventCatalog.
36
- *
37
- * @example
38
- * ```ts
39
- * import utils from '@eventcatalog/utils';
40
- *
41
- * const { writeUser } = utils('/path/to/eventcatalog');
42
- *
43
- * // Write a user to the catalog
44
- * // user would be written to users/eventcatalog-tech-lead
45
- * await writeUser({
46
- * id: 'eventcatalog-tech-lead',
47
- * name: 'EventCatalog Tech Lead',
48
- * email: 'test@test.com',
49
- * avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
50
- * slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
51
- * });
52
- *
53
- * // Write a team to the catalog and override the existing content (if there is any)
54
- * await writeUser({
55
- * id: 'eventcatalog-tech-lead',
56
- * name: 'EventCatalog Tech Lead',
57
- * email: 'test@test.com',
58
- * avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
59
- * slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
60
- * }, { override: true });
61
- *
62
- * ```
63
- */
64
- declare const writeUser: (catalogDir: string) => (user: User, options?: {
65
- override?: boolean;
66
- }) => Promise<void>;
67
- /**
68
- * Delete a user by it's id.
69
- *
70
- * @example
71
- * ```ts
72
- * import utils from '@eventcatalog/utils';
73
- *
74
- * const { rmUserById } = utils('/path/to/eventcatalog');
75
- *
76
- * // deletes the user with id eventcatalog-core-user
77
- * await rmUserById('eventcatalog-core-user');
78
- *
79
- * ```
80
- */
81
- declare const rmUserById: (catalogDir: string) => (id: string) => Promise<void>;
82
-
83
- export { getUser, getUsers, rmUserById, writeUser };
package/dist/users.d.ts DELETED
@@ -1,83 +0,0 @@
1
- import { User } from './types.d.js';
2
-
3
- /**
4
- * Returns a user from EventCatalog.
5
- *
6
- *
7
- * @example
8
- * ```ts
9
- * import utils from '@eventcatalog/utils';
10
- *
11
- * const { getUser } = utils('/path/to/eventcatalog');
12
- *
13
- * // Gets the user with the given id
14
- * const user = await getUser('eventcatalog-core-user');
15
- *
16
- * ```
17
- */
18
- declare const getUser: (catalogDir: string) => (id: string) => Promise<User | undefined>;
19
- /**
20
- * Returns all users from EventCatalog.
21
- *
22
- * @example
23
- * ```ts
24
- * import utils from '@eventcatalog/utils';
25
- *
26
- * const { getUsers } = utils('/path/to/eventcatalog');
27
- *
28
- * // Gets all users from the catalog
29
- * const channels = await getUsers();
30
- *
31
- * ```
32
- */
33
- declare const getUsers: (catalogDir: string) => (options?: {}) => Promise<User[]>;
34
- /**
35
- * Write a user to EventCatalog.
36
- *
37
- * @example
38
- * ```ts
39
- * import utils from '@eventcatalog/utils';
40
- *
41
- * const { writeUser } = utils('/path/to/eventcatalog');
42
- *
43
- * // Write a user to the catalog
44
- * // user would be written to users/eventcatalog-tech-lead
45
- * await writeUser({
46
- * id: 'eventcatalog-tech-lead',
47
- * name: 'EventCatalog Tech Lead',
48
- * email: 'test@test.com',
49
- * avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
50
- * slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
51
- * });
52
- *
53
- * // Write a team to the catalog and override the existing content (if there is any)
54
- * await writeUser({
55
- * id: 'eventcatalog-tech-lead',
56
- * name: 'EventCatalog Tech Lead',
57
- * email: 'test@test.com',
58
- * avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',
59
- * slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123
60
- * }, { override: true });
61
- *
62
- * ```
63
- */
64
- declare const writeUser: (catalogDir: string) => (user: User, options?: {
65
- override?: boolean;
66
- }) => Promise<void>;
67
- /**
68
- * Delete a user by it's id.
69
- *
70
- * @example
71
- * ```ts
72
- * import utils from '@eventcatalog/utils';
73
- *
74
- * const { rmUserById } = utils('/path/to/eventcatalog');
75
- *
76
- * // deletes the user with id eventcatalog-core-user
77
- * await rmUserById('eventcatalog-core-user');
78
- *
79
- * ```
80
- */
81
- declare const rmUserById: (catalogDir: string) => (id: string) => Promise<void>;
82
-
83
- export { getUser, getUsers, rmUserById, writeUser };
package/dist/users.js DELETED
@@ -1,127 +0,0 @@
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/users.ts
31
- var users_exports = {};
32
- __export(users_exports, {
33
- getUser: () => getUser,
34
- getUsers: () => getUsers,
35
- rmUserById: () => rmUserById,
36
- writeUser: () => writeUser
37
- });
38
- module.exports = __toCommonJS(users_exports);
39
- var import_node_fs2 = __toESM(require("fs"));
40
- var import_node_path2 = require("path");
41
- var import_gray_matter2 = __toESM(require("gray-matter"));
42
-
43
- // src/internal/utils.ts
44
- var import_glob = require("glob");
45
- var import_node_fs = __toESM(require("fs"));
46
- var import_fs_extra = require("fs-extra");
47
- var import_node_path = require("path");
48
- var import_gray_matter = __toESM(require("gray-matter"));
49
- var import_semver = require("semver");
50
- var getFiles = async (pattern, ignore = "") => {
51
- try {
52
- const normalizedInputPattern = (0, import_node_path.normalize)(pattern);
53
- const absoluteBaseDir = (0, import_node_path.resolve)(
54
- normalizedInputPattern.includes("**") ? normalizedInputPattern.split("**")[0] : (0, import_node_path.dirname)(normalizedInputPattern)
55
- );
56
- let relativePattern = (0, import_node_path.relative)(absoluteBaseDir, normalizedInputPattern);
57
- relativePattern = relativePattern.replace(/\\/g, "/");
58
- const ignoreList = Array.isArray(ignore) ? ignore : [ignore];
59
- const files = (0, import_glob.globSync)(relativePattern, {
60
- cwd: absoluteBaseDir,
61
- ignore: ["node_modules/**", ...ignoreList],
62
- absolute: true,
63
- nodir: true
64
- });
65
- return files.map(import_node_path.normalize);
66
- } catch (error) {
67
- const absoluteBaseDirForError = (0, import_node_path.resolve)(
68
- (0, import_node_path.normalize)(pattern).includes("**") ? (0, import_node_path.normalize)(pattern).split("**")[0] : (0, import_node_path.dirname)((0, import_node_path.normalize)(pattern))
69
- );
70
- const relativePatternForError = (0, import_node_path.relative)(absoluteBaseDirForError, (0, import_node_path.normalize)(pattern)).replace(/\\/g, "/");
71
- throw new Error(
72
- `Error finding files for pattern "${pattern}" (using cwd: "${absoluteBaseDirForError}", globPattern: "${relativePatternForError}"): ${error.message}`
73
- );
74
- }
75
- };
76
-
77
- // src/users.ts
78
- var getUser = (catalogDir) => async (id) => {
79
- const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);
80
- if (files.length == 0) return void 0;
81
- const file = files[0];
82
- const { data, content } = import_gray_matter2.default.read(file);
83
- return {
84
- ...data,
85
- id: data.id,
86
- name: data.name,
87
- avatarUrl: data.avatarUrl,
88
- markdown: content.trim()
89
- };
90
- };
91
- var getUsers = (catalogDir) => async (options) => {
92
- const files = await getFiles(`${catalogDir}/users/*.{md,mdx}`);
93
- if (files.length === 0) return [];
94
- return files.map((file) => {
95
- const { data, content } = import_gray_matter2.default.read(file);
96
- return {
97
- ...data,
98
- id: data.id,
99
- name: data.name,
100
- avatarUrl: data.avatarUrl,
101
- markdown: content.trim()
102
- };
103
- });
104
- };
105
- var writeUser = (catalogDir) => async (user, options = {}) => {
106
- const resource = { ...user };
107
- const currentUser = await getUser(catalogDir)(resource.id);
108
- const exists = currentUser !== void 0;
109
- if (exists && !options.override) {
110
- throw new Error(`Failed to write ${resource.id} (user) as it already exists`);
111
- }
112
- const { markdown, ...frontmatter } = resource;
113
- const document = import_gray_matter2.default.stringify(markdown, frontmatter);
114
- import_node_fs2.default.mkdirSync((0, import_node_path2.join)(catalogDir, ""), { recursive: true });
115
- import_node_fs2.default.writeFileSync((0, import_node_path2.join)(catalogDir, "", `${resource.id}.mdx`), document);
116
- };
117
- var rmUserById = (catalogDir) => async (id) => {
118
- import_node_fs2.default.rmSync((0, import_node_path2.join)(catalogDir, `${id}.mdx`), { recursive: true });
119
- };
120
- // Annotate the CommonJS export names for ESM import in node:
121
- 0 && (module.exports = {
122
- getUser,
123
- getUsers,
124
- rmUserById,
125
- writeUser
126
- });
127
- //# sourceMappingURL=users.js.map
package/dist/users.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/users.ts","../src/internal/utils.ts"],"sourcesContent":["import fs from 'node:fs/promises';\nimport fsSync from 'node:fs';\nimport { join } from 'node:path';\nimport type { User } from './types';\nimport matter from 'gray-matter';\nimport { getFiles } from './internal/utils';\n\n/**\n * Returns a user from EventCatalog.\n *\n *\n * @example\n * ```ts\n * import utils from '@eventcatalog/utils';\n *\n * const { getUser } = utils('/path/to/eventcatalog');\n *\n * // Gets the user with the given id\n * const user = await getUser('eventcatalog-core-user');\n *\n * ```\n */\nexport const getUser =\n (catalogDir: string) =>\n async (id: string): Promise<User | undefined> => {\n const files = await getFiles(`${catalogDir}/${id}.{md,mdx}`);\n\n if (files.length == 0) return undefined;\n const file = files[0];\n\n const { data, content } = matter.read(file);\n return {\n ...data,\n id: data.id,\n name: data.name,\n avatarUrl: data.avatarUrl,\n markdown: content.trim(),\n } as User;\n };\n\n/**\n * Returns all users from EventCatalog.\n *\n * @example\n * ```ts\n * import utils from '@eventcatalog/utils';\n *\n * const { getUsers } = utils('/path/to/eventcatalog');\n *\n * // Gets all users from the catalog\n * const channels = await getUsers();\n *\n * ```\n */\nexport const getUsers =\n (catalogDir: string) =>\n async (options?: {}): Promise<User[]> => {\n const files = await getFiles(`${catalogDir}/users/*.{md,mdx}`);\n if (files.length === 0) return [];\n\n return files.map((file) => {\n const { data, content } = matter.read(file);\n return {\n ...data,\n id: data.id,\n name: data.name,\n avatarUrl: data.avatarUrl,\n markdown: content.trim(),\n } as User;\n });\n };\n\n/**\n * Write a user to EventCatalog.\n *\n * @example\n * ```ts\n * import utils from '@eventcatalog/utils';\n *\n * const { writeUser } = utils('/path/to/eventcatalog');\n *\n * // Write a user to the catalog\n * // user would be written to users/eventcatalog-tech-lead\n * await writeUser({\n * id: 'eventcatalog-tech-lead',\n * name: 'EventCatalog Tech Lead',\n * email: 'test@test.com',\n * avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',\n * slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123\n * });\n *\n * // Write a team to the catalog and override the existing content (if there is any)\n * await writeUser({\n * id: 'eventcatalog-tech-lead',\n * name: 'EventCatalog Tech Lead',\n * email: 'test@test.com',\n * avatarUrl: 'https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png',\n * slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123\n * }, { override: true });\n *\n * ```\n */\nexport const writeUser =\n (catalogDir: string) =>\n async (user: User, options: { override?: boolean } = {}) => {\n const resource: User = { ...user };\n\n // Get the path\n const currentUser = await getUser(catalogDir)(resource.id);\n const exists = currentUser !== undefined;\n\n if (exists && !options.override) {\n throw new Error(`Failed to write ${resource.id} (user) as it already exists`);\n }\n\n const { markdown, ...frontmatter } = resource;\n\n const document = matter.stringify(markdown, frontmatter);\n fsSync.mkdirSync(join(catalogDir, ''), { recursive: true });\n fsSync.writeFileSync(join(catalogDir, '', `${resource.id}.mdx`), document);\n };\n\n/**\n * Delete a user by it's id.\n *\n * @example\n * ```ts\n * import utils from '@eventcatalog/utils';\n *\n * const { rmUserById } = utils('/path/to/eventcatalog');\n *\n * // deletes the user with id eventcatalog-core-user\n * await rmUserById('eventcatalog-core-user');\n *\n * ```\n */\nexport const rmUserById = (catalogDir: string) => async (id: string) => {\n fsSync.rmSync(join(catalogDir, `${id}.mdx`), { recursive: true });\n};\n","import { globSync } from 'glob';\nimport fsSync from 'node:fs';\nimport { copy, CopyFilterAsync, CopyFilterSync } from 'fs-extra';\nimport { join, dirname, normalize, sep as pathSeparator, resolve, basename, relative } from 'node:path';\nimport matter from 'gray-matter';\nimport { satisfies, validRange, valid } from 'semver';\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,mdx}`);\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,mdx}`);\n\n const matchedFiles = (await searchFilesForId(files, id)) || [];\n const latestVersion = matchedFiles.find((path) => !path.includes('versioned'));\n\n // If no version is provided, return the latest version\n if (!version) {\n return latestVersion;\n }\n\n // map files into gray matter to get versions\n const parsedFiles = matchedFiles.map((path) => {\n const { data } = matter.read(path);\n return { ...data, path };\n }) as any[];\n\n // Handle 'latest' version - return the latest (non-versioned) file\n if (version === 'latest') {\n return latestVersion;\n }\n\n // First, check for exact version match (handles non-semver versions like '1', '2', etc.)\n const exactMatch = parsedFiles.find((c) => c.version === version);\n if (exactMatch) {\n return exactMatch.path;\n }\n\n // Try semver range matching\n const semverRange = validRange(version);\n\n if (semverRange) {\n const match = parsedFiles.filter((c) => {\n try {\n return satisfies(c.version, semverRange);\n } catch (error) {\n // If satisfies fails (e.g., comparing semver range with non-semver version), skip this file\n return false;\n }\n });\n return match.length > 0 ? match[0].path : undefined;\n }\n\n // If no exact match and no valid semver range, return undefined\n return undefined;\n};\n\nexport const getFiles = async (pattern: string, ignore: string | string[] = '') => {\n try {\n // 1. Normalize the input pattern to handle mixed separators potentially\n const normalizedInputPattern = normalize(pattern);\n\n // 2. Determine the absolute base directory (cwd for glob)\n // Resolve ensures it's absolute. Handles cases with/without globstar.\n const absoluteBaseDir = resolve(\n normalizedInputPattern.includes('**') ? normalizedInputPattern.split('**')[0] : dirname(normalizedInputPattern)\n );\n\n // 3. Determine the pattern part relative to the absolute base directory\n // We extract the part of the normalized pattern that comes *after* the absoluteBaseDir\n let relativePattern = relative(absoluteBaseDir, normalizedInputPattern);\n\n // On Windows, relative() might return empty string if paths are identical,\n // or might need normalization if the original pattern didn't have `**`\n // Example: pattern = 'dir/file.md', absoluteBaseDir='.../dir', normalized='...\\dir\\file.md'\n // relative() -> 'file.md'\n // Example: pattern = 'dir/**/file.md', absoluteBaseDir='.../dir', normalized='...\\dir\\**\\file.md'\n // relative() -> '**\\file.md'\n // Convert separators in the relative pattern to forward slashes for glob\n relativePattern = relativePattern.replace(/\\\\/g, '/');\n\n const ignoreList = Array.isArray(ignore) ? ignore : [ignore];\n\n const files = globSync(relativePattern, {\n cwd: absoluteBaseDir,\n ignore: ['node_modules/**', ...ignoreList],\n absolute: true,\n nodir: true,\n });\n\n // 5. Normalize results for consistency before returning\n return files.map(normalize);\n } catch (error: any) {\n // Add more diagnostic info to the error\n const absoluteBaseDirForError = resolve(\n normalize(pattern).includes('**') ? normalize(pattern).split('**')[0] : dirname(normalize(pattern))\n );\n const relativePatternForError = relative(absoluteBaseDirForError, normalize(pattern)).replace(/\\\\/g, '/');\n throw new Error(\n `Error finding files for pattern \"${pattern}\" (using cwd: \"${absoluteBaseDirForError}\", globPattern: \"${relativePatternForError}\"): ${error.message}`\n );\n }\n};\n\nexport const readMdxFile = async (path: string) => {\n const { data } = matter.read(path);\n const { markdown, ...frontmatter } = data;\n return { ...frontmatter, markdown };\n};\n\nexport const searchFilesForId = async (files: string[], id: string, version?: string) => {\n // Escape the id to avoid regex issues\n const escapedId = id.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n const idRegex = new RegExp(`^id:\\\\s*(['\"]|>-)?\\\\s*${escapedId}['\"]?\\\\s*$`, 'm');\n\n const versionRegex = new RegExp(`^version:\\\\s*['\"]?${version}['\"]?\\\\s*$`, 'm');\n\n const matches = files.map((file) => {\n const content = fsSync.readFileSync(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 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 fsSync.mkdirSync(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 fsSync.rmSync(tmpDirectory, { recursive: true });\n};\n\n// Makes sure values in sends/recieves are unique\nexport const uniqueVersions = (messages: { id: string; version: string }[]): { id: string; version: string }[] => {\n const uniqueSet = new Set();\n\n return messages.filter((message) => {\n const key = `${message.id}-${message.version}`;\n if (!uniqueSet.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