@eventcatalog/sdk 2.11.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 (110) 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} +505 -378
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/{eventcatalog.mjs → cli/index.mjs} +583 -436
  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 +330 -3
  15. package/dist/index.d.ts +330 -3
  16. package/package.json +13 -4
  17. package/dist/channels.d.mts +0 -214
  18. package/dist/channels.d.ts +0 -214
  19. package/dist/channels.js +0 -432
  20. package/dist/channels.js.map +0 -1
  21. package/dist/channels.mjs +0 -384
  22. package/dist/channels.mjs.map +0 -1
  23. package/dist/commands.d.mts +0 -274
  24. package/dist/commands.d.ts +0 -274
  25. package/dist/commands.js +0 -394
  26. package/dist/commands.js.map +0 -1
  27. package/dist/commands.mjs +0 -350
  28. package/dist/commands.mjs.map +0 -1
  29. package/dist/containers.d.mts +0 -179
  30. package/dist/containers.d.ts +0 -179
  31. package/dist/containers.js +0 -388
  32. package/dist/containers.js.map +0 -1
  33. package/dist/containers.mjs +0 -345
  34. package/dist/containers.mjs.map +0 -1
  35. package/dist/custom-docs.d.mts +0 -89
  36. package/dist/custom-docs.d.ts +0 -89
  37. package/dist/custom-docs.js +0 -164
  38. package/dist/custom-docs.js.map +0 -1
  39. package/dist/custom-docs.mjs +0 -122
  40. package/dist/custom-docs.mjs.map +0 -1
  41. package/dist/data-products.d.mts +0 -225
  42. package/dist/data-products.d.ts +0 -225
  43. package/dist/data-products.js +0 -375
  44. package/dist/data-products.js.map +0 -1
  45. package/dist/data-products.mjs +0 -332
  46. package/dist/data-products.mjs.map +0 -1
  47. package/dist/data-stores.d.mts +0 -179
  48. package/dist/data-stores.d.ts +0 -179
  49. package/dist/data-stores.js +0 -401
  50. package/dist/data-stores.js.map +0 -1
  51. package/dist/data-stores.mjs +0 -356
  52. package/dist/data-stores.mjs.map +0 -1
  53. package/dist/domains.d.mts +0 -347
  54. package/dist/domains.d.ts +0 -347
  55. package/dist/domains.js +0 -547
  56. package/dist/domains.js.map +0 -1
  57. package/dist/domains.mjs +0 -498
  58. package/dist/domains.mjs.map +0 -1
  59. package/dist/entities.d.mts +0 -174
  60. package/dist/entities.d.ts +0 -174
  61. package/dist/entities.js +0 -348
  62. package/dist/entities.js.map +0 -1
  63. package/dist/entities.mjs +0 -307
  64. package/dist/entities.mjs.map +0 -1
  65. package/dist/eventcatalog.d.mts +0 -21
  66. package/dist/eventcatalog.d.ts +0 -21
  67. package/dist/eventcatalog.js.map +0 -1
  68. package/dist/eventcatalog.mjs.map +0 -1
  69. package/dist/events.d.mts +0 -276
  70. package/dist/events.d.ts +0 -276
  71. package/dist/events.js +0 -393
  72. package/dist/events.js.map +0 -1
  73. package/dist/events.mjs +0 -349
  74. package/dist/events.mjs.map +0 -1
  75. package/dist/messages.d.mts +0 -65
  76. package/dist/messages.d.ts +0 -65
  77. package/dist/messages.js +0 -312
  78. package/dist/messages.js.map +0 -1
  79. package/dist/messages.mjs +0 -269
  80. package/dist/messages.mjs.map +0 -1
  81. package/dist/queries.d.mts +0 -276
  82. package/dist/queries.d.ts +0 -276
  83. package/dist/queries.js +0 -394
  84. package/dist/queries.js.map +0 -1
  85. package/dist/queries.mjs +0 -350
  86. package/dist/queries.mjs.map +0 -1
  87. package/dist/services.d.mts +0 -384
  88. package/dist/services.d.ts +0 -384
  89. package/dist/services.js +0 -577
  90. package/dist/services.js.map +0 -1
  91. package/dist/services.mjs +0 -526
  92. package/dist/services.mjs.map +0 -1
  93. package/dist/teams.d.mts +0 -90
  94. package/dist/teams.d.ts +0 -90
  95. package/dist/teams.js +0 -246
  96. package/dist/teams.js.map +0 -1
  97. package/dist/teams.mjs +0 -202
  98. package/dist/teams.mjs.map +0 -1
  99. package/dist/types.d.d.mts +0 -331
  100. package/dist/types.d.d.ts +0 -331
  101. package/dist/types.d.js +0 -19
  102. package/dist/types.d.js.map +0 -1
  103. package/dist/types.d.mjs +0 -1
  104. package/dist/types.d.mjs.map +0 -1
  105. package/dist/users.d.mts +0 -83
  106. package/dist/users.d.ts +0 -83
  107. package/dist/users.js +0 -127
  108. package/dist/users.js.map +0 -1
  109. package/dist/users.mjs +0 -88
  110. package/dist/users.mjs.map +0 -1
package/dist/types.d.d.ts DELETED
@@ -1,331 +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
- dataProducts?: ResourcePointer[];
175
- sends?: SendsPointer[];
176
- receives?: ReceivesPointer[];
177
- detailsPanel?: {
178
- parentDomains?: DetailPanelProperty;
179
- subdomains?: DetailPanelProperty;
180
- services?: DetailPanelProperty;
181
- entities?: DetailPanelProperty;
182
- messages?: DetailPanelProperty;
183
- ubiquitousLanguage?: DetailPanelProperty;
184
- repository?: DetailPanelProperty;
185
- versions?: DetailPanelProperty;
186
- owners?: DetailPanelProperty;
187
- changelog?: DetailPanelProperty;
188
- };
189
- }
190
-
191
- interface Team {
192
- id: string;
193
- name: string;
194
- summary?: string;
195
- email?: string;
196
- hidden?: boolean;
197
- slackDirectMessageUrl?: string;
198
- members?: User[];
199
- ownedCommands?: Command[];
200
- ownedServices?: Service[];
201
- ownedEvents?: Event[];
202
- markdown: string;
203
- }
204
-
205
- interface User {
206
- id: string;
207
- name: string;
208
- avatarUrl: string;
209
- role?: string;
210
- hidden?: boolean;
211
- email?: string;
212
- slackDirectMessageUrl?: string;
213
- ownedServices?: Service[];
214
- ownedEvents?: Event[];
215
- ownedCommands?: Command[];
216
- associatedTeams?: Team[];
217
- markdown: string;
218
- }
219
-
220
- interface Badge {
221
- content: string;
222
- backgroundColor: string;
223
- textColor: string;
224
- icon?: string;
225
- }
226
-
227
- interface UbiquitousLanguage {
228
- id: string;
229
- name: string;
230
- summary?: string;
231
- description?: string;
232
- icon?: string;
233
- }
234
-
235
- interface UbiquitousLanguageDictionary {
236
- dictionary: UbiquitousLanguage[];
237
- }
238
-
239
- interface DetailPanelProperty {
240
- visible: boolean;
241
- }
242
-
243
- interface Entity extends BaseSchema {
244
- aggregateRoot?: boolean;
245
- identifier?: string;
246
- properties?: {
247
- name: string;
248
- type: string;
249
- required?: boolean;
250
- description?: string;
251
- references?: string;
252
- referencesIdentifier?: string;
253
- relationType?: string;
254
- }[];
255
- detailsPanel?: {
256
- domains?: DetailPanelProperty;
257
- services?: DetailPanelProperty;
258
- messages?: DetailPanelProperty;
259
- versions?: DetailPanelProperty;
260
- owners?: DetailPanelProperty;
261
- changelog?: DetailPanelProperty;
262
- };
263
- }
264
-
265
- type DataProductOutputPointer = {
266
- id: string;
267
- version?: string;
268
- contract?: {
269
- path: string;
270
- name: string;
271
- type?: string;
272
- };
273
- };
274
-
275
- interface DataProduct extends BaseSchema {
276
- inputs?: ResourcePointer[];
277
- outputs?: DataProductOutputPointer[];
278
- detailsPanel?: {
279
- domains?: DetailPanelProperty;
280
- inputs?: DetailPanelProperty;
281
- outputs?: DetailPanelProperty;
282
- versions?: DetailPanelProperty;
283
- repository?: DetailPanelProperty;
284
- owners?: DetailPanelProperty;
285
- changelog?: DetailPanelProperty;
286
- };
287
- }
288
-
289
- declare enum DataClassification {
290
- Public = 'public',
291
- Internal = 'internal',
292
- Confidential = 'confidential',
293
- Regulated = 'regulated',
294
- }
295
-
296
- interface Container extends BaseSchema {
297
- container_type: 'database' | 'cache' | 'objectStore' | 'searchIndex' | 'dataWarehouse' | 'dataLake' | 'externalSaaS' | 'other';
298
- technology?: string;
299
- authoritative?: boolean;
300
- access_mode?: string;
301
- classification?: DataClassification;
302
- residency?: string;
303
- retention?: string;
304
- detailsPanel?: {
305
- versions?: DetailPanelProperty;
306
- repository?: DetailPanelProperty;
307
- owners?: DetailPanelProperty;
308
- changelog?: DetailPanelProperty;
309
- };
310
- }
311
-
312
- type EventCatalog = {
313
- version: string;
314
- catalogVersion: string;
315
- createdAt: string;
316
- resources: {
317
- domains?: ExportedResource<Domain>[];
318
- services?: ExportedResource<Service>[];
319
- messages?: {
320
- events?: ExportedResource<Event>[];
321
- queries?: ExportedResource<Query>[];
322
- commands?: ExportedResource<Command>[];
323
- };
324
- teams?: ExportedResource<Team>[];
325
- users?: ExportedResource<User>[];
326
- channels?: ExportedResource<Channel>[];
327
- customDocs?: ExportedResource<CustomDoc>[];
328
- };
329
- };
330
-
331
- export type { Badge, BaseSchema, Channel, ChannelPointer, Command, Container, CustomDoc, DataProduct, DataProductOutputPointer, 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 dataProducts?: ResourcePointer[];\n sends?: SendsPointer[];\n receives?: ReceivesPointer[];\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\nexport type DataProductOutputPointer = {\n id: string;\n version?: string;\n contract?: {\n path: string;\n name: string;\n type?: string;\n };\n};\n\nexport interface DataProduct extends BaseSchema {\n inputs?: ResourcePointer[];\n outputs?: DataProductOutputPointer[];\n detailsPanel?: {\n domains?: DetailPanelProperty;\n inputs?: DetailPanelProperty;\n outputs?: DetailPanelProperty;\n versions?: DetailPanelProperty;\n repository?: 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