@eventcatalog/core 5.0.0-beta.7 → 5.0.0-beta.9
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/LICENSE +227 -128
- package/dist/analytics/analytics.cjs +18 -3
- package/dist/analytics/analytics.d.cts +1 -1
- package/dist/analytics/analytics.d.ts +1 -1
- package/dist/analytics/analytics.js +3 -2
- package/dist/analytics/log-build.cjs +70 -34
- package/dist/analytics/log-build.js +5 -4
- package/dist/analytics/telemetry.cjs +42 -0
- package/dist/analytics/telemetry.d.cts +20 -0
- package/dist/analytics/telemetry.d.ts +20 -0
- package/dist/analytics/telemetry.js +8 -0
- package/dist/{chunk-3VBB2ZMP.js → chunk-4CFZUHGG.js} +9 -3
- package/dist/{chunk-PIYJM642.js → chunk-AWOO63ME.js} +70 -44
- package/dist/chunk-CPW6G62V.js +17 -0
- package/dist/{chunk-MDWB5HLO.js → chunk-ENAG6UH7.js} +5 -0
- package/dist/{chunk-FARBIZ7Y.js → chunk-EUNQJO3J.js} +1 -1
- package/dist/{chunk-S7ODHVII.js → chunk-GAHKCOQM.js} +1 -1
- package/dist/{chunk-BOKAG5XC.js → chunk-JQMYHZWI.js} +58 -35
- package/dist/{chunk-SJJKWZYZ.js → chunk-TZVDMWQX.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +207 -123
- package/dist/eventcatalog.config.d.cts +55 -0
- package/dist/eventcatalog.config.d.ts +55 -0
- package/dist/eventcatalog.js +39 -19
- package/dist/features.cjs +8 -2
- package/dist/features.d.cts +3 -1
- package/dist/features.d.ts +3 -1
- package/dist/features.js +5 -3
- package/dist/federation/federate.js +4 -4
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/dist/utils/license-status.cjs +70 -44
- package/dist/utils/license-status.d.cts +14 -5
- package/dist/utils/license-status.d.ts +14 -5
- package/dist/utils/license-status.js +1 -1
- package/eventcatalog/integrations/studio-server.mjs +15 -3
- package/eventcatalog/src/components/Header.astro +3 -3
- package/eventcatalog/src/features/integrations/eventcatalog-features.ts +10 -2
- package/eventcatalog/src/features/mcp/apps/canvas/shared.ts +9 -1
- package/eventcatalog/src/features/mcp/apps/canvas/view.tsx +9 -2
- package/eventcatalog/src/features/mcp/apps/generated/canvas.html +70 -69
- package/eventcatalog/src/features/mcp/apps/generated/viewer.html +69 -69
- package/eventcatalog/src/features/mcp/mcp-server.ts +5 -3
- package/eventcatalog/src/features/studio/agent-choreography.ts +8 -5
- package/eventcatalog/src/features/studio/canvas-actions.ts +148 -21
- package/eventcatalog/src/features/studio/canvas-doc.ts +138 -9
- package/eventcatalog/src/features/studio/canvas-preview.ts +53 -0
- package/eventcatalog/src/features/studio/catalog-resources.ts +5 -2
- package/eventcatalog/src/features/studio/clipboard.ts +97 -0
- package/eventcatalog/src/features/studio/components/CanvasControls.tsx +4 -3
- package/eventcatalog/src/features/studio/components/CanvasHeader.tsx +39 -22
- package/eventcatalog/src/features/studio/components/CanvasStatusMenu.tsx +117 -0
- package/eventcatalog/src/features/studio/components/Comments.tsx +345 -30
- package/eventcatalog/src/features/studio/components/ConnectAgentDialog.tsx +140 -76
- package/eventcatalog/src/features/studio/components/ConnectionsChooser.tsx +144 -0
- package/eventcatalog/src/features/studio/components/ContainerChooser.tsx +1 -1
- package/eventcatalog/src/features/studio/components/DragGhost.tsx +115 -0
- package/eventcatalog/src/features/studio/components/JoinForm.tsx +0 -24
- package/eventcatalog/src/features/studio/components/LeftPanel.tsx +131 -35
- package/eventcatalog/src/features/studio/components/Picture.tsx +21 -0
- package/eventcatalog/src/features/studio/components/Presence.tsx +2 -0
- package/eventcatalog/src/features/studio/components/PropertiesPanel.tsx +187 -50
- package/eventcatalog/src/features/studio/components/ShareDialog.tsx +260 -0
- package/eventcatalog/src/features/studio/components/StudioDesigner.tsx +442 -40
- package/eventcatalog/src/features/studio/components/canvas-nodes.tsx +198 -22
- package/eventcatalog/src/features/studio/components/icons.ts +6 -1
- package/eventcatalog/src/features/studio/components/status.ts +30 -1
- package/eventcatalog/src/features/studio/edges.ts +2 -0
- package/eventcatalog/src/features/studio/grouping.ts +95 -2
- package/eventcatalog/src/features/studio/hooks/presence-store.ts +5 -1
- package/eventcatalog/src/features/studio/hooks/use-canvas-webmcp.ts +13 -3
- package/eventcatalog/src/features/studio/hooks/use-comments.ts +8 -1
- package/eventcatalog/src/features/studio/hooks/use-follow-camera.ts +7 -2
- package/eventcatalog/src/features/studio/hooks/use-studio-flow.ts +174 -27
- package/eventcatalog/src/features/studio/identity.ts +35 -0
- package/eventcatalog/src/features/studio/layout.ts +7 -4
- package/eventcatalog/src/features/studio/levels.ts +138 -72
- package/eventcatalog/src/features/studio/node-types.ts +35 -3
- package/eventcatalog/src/features/studio/pages/[id].astro +7 -2
- package/eventcatalog/src/features/studio/pages/index.astro +555 -2
- package/eventcatalog/src/features/studio/pages/new.astro +24 -0
- package/eventcatalog/src/features/studio/pages/wake.ts +15 -0
- package/eventcatalog/src/features/studio/server/canvas-mcp.ts +48 -13
- package/eventcatalog/src/features/studio/server/runtime.ts +193 -14
- package/eventcatalog/src/features/studio/server/sign-in.ts +18 -0
- package/eventcatalog/src/features/studio/server/storage.ts +110 -0
- package/eventcatalog/src/features/studio/studio.css +184 -0
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +1 -1
- package/eventcatalog/src/utils/feature.ts +7 -3
- package/eventcatalog/src/utils/node-graphs/export-mermaid.ts +0 -2
- package/package.json +3 -3
- package/dist/{chunk-AYNZXUB5.js → chunk-ZEY2XUJN.js} +7 -7
package/LICENSE
CHANGED
|
@@ -3,145 +3,244 @@ License text copyright (c) 2024 MariaDB plc, All Rights Reserved.
|
|
|
3
3
|
|
|
4
4
|
Parameters
|
|
5
5
|
|
|
6
|
-
Licensor: EventCatalog Ltd
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
Licensor: EventCatalog Ltd, a company registered in England and
|
|
7
|
+
Wales (company number 15764703).
|
|
8
|
+
Licensed Work: EventCatalog version 5.0 or later, including pre-releases,
|
|
9
|
+
as published by the Licensor in this repository and as the
|
|
10
|
+
npm package @eventcatalog/core, other than any file,
|
|
11
|
+
directory or package that states it is licensed under a
|
|
12
|
+
different license. The following are licensed under the
|
|
13
|
+
MIT License and are not part of the Licensed Work:
|
|
14
|
+
packages/sdk, packages/cli, packages/connectors,
|
|
15
|
+
packages/diff, packages/linter, packages/visualiser,
|
|
16
|
+
packages/breaking-changes, packages/create-eventcatalog
|
|
17
|
+
and the examples directory. The Licensed Work is (c) 2026
|
|
18
|
+
EventCatalog Ltd.
|
|
19
|
+
Additional Use Grant: You may make Production use of the Licensed Work if You
|
|
20
|
+
are an Eligible User and Your use is not a Hosted
|
|
21
|
+
Offering. Sections 1 to 7 below form part of this grant.
|
|
22
|
+
Capitalised terms are defined in section 6.
|
|
13
23
|
|
|
14
24
|
1. Eligible Users
|
|
15
25
|
|
|
16
|
-
|
|
26
|
+
You are an "Eligible User" if You are:
|
|
17
27
|
|
|
18
|
-
(a) an individual using the Licensed Work
|
|
19
|
-
|
|
20
|
-
|
|
28
|
+
(a) an individual using the Licensed Work for Your own
|
|
29
|
+
personal purposes, and not for or on behalf of any
|
|
30
|
+
Organisation (including Your employer or Your own
|
|
31
|
+
business);
|
|
21
32
|
|
|
22
|
-
(b) an Organisation whose Annual Revenue is less than
|
|
23
|
-
|
|
33
|
+
(b) an Organisation whose Annual Revenue is less than USD
|
|
34
|
+
10,000,000 (ten million US dollars) and whose Total
|
|
35
|
+
Funding is less than USD 10,000,000;
|
|
24
36
|
|
|
25
|
-
(c)
|
|
37
|
+
(c) a person or Organisation using the Licensed Work
|
|
26
38
|
solely to document a Public Open Source Project;
|
|
27
39
|
|
|
28
|
-
(d)
|
|
40
|
+
(d) a school, college or university recognised by the
|
|
41
|
+
education authorities of its country, using the
|
|
29
42
|
Licensed Work solely for teaching or academic
|
|
30
|
-
research, and not for its administrative or
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(e)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Your use
|
|
58
|
-
User or holds a
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
in
|
|
109
|
-
|
|
43
|
+
research, and not for its administrative or commercial
|
|
44
|
+
operations; or
|
|
45
|
+
|
|
46
|
+
(e) an Organisation in its Evaluation Period.
|
|
47
|
+
|
|
48
|
+
2. Growing past the thresholds
|
|
49
|
+
|
|
50
|
+
An Organisation that is an Eligible User under 1(b)
|
|
51
|
+
remains one until ninety (90) days after the first of the
|
|
52
|
+
following to happen:
|
|
53
|
+
|
|
54
|
+
(a) the end of the first financial year in which its
|
|
55
|
+
Annual Revenue reaches USD 10,000,000; or
|
|
56
|
+
|
|
57
|
+
(b) the date on which its Total Funding reaches USD
|
|
58
|
+
10,000,000; or
|
|
59
|
+
|
|
60
|
+
(c) the date on which a change in its Affiliates (for
|
|
61
|
+
example an acquisition) takes it over either
|
|
62
|
+
threshold.
|
|
63
|
+
|
|
64
|
+
3. Working for clients
|
|
65
|
+
|
|
66
|
+
If You use the Licensed Work for a client's benefit (for
|
|
67
|
+
example as a consultant, contractor, agency or software
|
|
68
|
+
vendor), including building, customising, hosting or
|
|
69
|
+
distributing the Licensed Work or a catalog built with it
|
|
70
|
+
for that client, Your use for that client is permitted if
|
|
71
|
+
the client is an Eligible User or holds a Commercial
|
|
72
|
+
License covering that use. You may rely on a client's
|
|
73
|
+
written statement of its status unless You know it is
|
|
74
|
+
wrong. Your own use of the Licensed Work for Your own
|
|
75
|
+
systems is judged on Your own status.
|
|
76
|
+
|
|
77
|
+
4. Coming into compliance
|
|
78
|
+
|
|
79
|
+
(a) If You stop being an Eligible User (for example
|
|
80
|
+
because Your Evaluation Period ends), or You become
|
|
81
|
+
aware (including by notice from the Licensor) that
|
|
82
|
+
Your Production use is not permitted by this grant,
|
|
83
|
+
You may continue that use for thirty (30) days (the
|
|
84
|
+
"Cure Period") in order to obtain a Commercial License
|
|
85
|
+
or stop that use. Use during the Cure Period is
|
|
86
|
+
permitted Production use, is not a violation of this
|
|
87
|
+
License, and Your rights under this License do not
|
|
88
|
+
terminate during the Cure Period for that reason. One
|
|
89
|
+
Cure Period applies to each such event; stopping and
|
|
90
|
+
later resuming substantially the same use does not
|
|
91
|
+
create a new one.
|
|
92
|
+
|
|
93
|
+
(b) Production use that was not permitted, but that You
|
|
94
|
+
made before You knew or reasonably ought to have known
|
|
95
|
+
that it was not permitted, is treated as permitted
|
|
96
|
+
Production use if You obtain a Commercial License or
|
|
97
|
+
stop that use within the Cure Period.
|
|
98
|
+
|
|
99
|
+
(c) For a Hosted Offering, the Cure Period is available
|
|
100
|
+
only once, starts only on notice from the Licensor,
|
|
101
|
+
and section 4(b) does not apply.
|
|
102
|
+
|
|
103
|
+
5. Guidance and Commercial Licenses
|
|
104
|
+
|
|
105
|
+
The Licensor publishes guidance on this License at
|
|
106
|
+
https://www.eventcatalog.dev/license-faq. The guidance is
|
|
107
|
+
for information only. It does not form part of this
|
|
108
|
+
License and does not change it. If the guidance and this
|
|
109
|
+
License differ, this License applies.
|
|
110
|
+
|
|
111
|
+
A Commercial License or other written permission from the
|
|
112
|
+
Licensor may permit uses not covered by this grant. A
|
|
113
|
+
Commercial License held by a vendor or distributor does
|
|
114
|
+
not cover its customers' Production use unless it
|
|
115
|
+
expressly says so.
|
|
116
|
+
|
|
117
|
+
6. Definitions
|
|
118
|
+
|
|
119
|
+
"You" means the individual or Organisation exercising
|
|
120
|
+
rights under this License, and has the same meaning as
|
|
121
|
+
"you" in the Terms below.
|
|
122
|
+
|
|
123
|
+
"Organisation" means any company, partnership, sole
|
|
124
|
+
trader, trust, government or public body, or other entity
|
|
125
|
+
or undertaking, together with all of its Affiliates. A
|
|
126
|
+
government or public body is treated as an Organisation at
|
|
127
|
+
the level of the individual body (for example a ministry,
|
|
128
|
+
department, agency, local authority or health trust), not
|
|
129
|
+
the wider government of which it forms part.
|
|
130
|
+
|
|
131
|
+
"Affiliate" means any entity that controls, is controlled
|
|
132
|
+
by, or is under common control with another, where
|
|
133
|
+
"control" means owning more than fifty percent (50%) of
|
|
134
|
+
the voting interests or otherwise having the power to
|
|
135
|
+
direct its management and policies. Two entities are not
|
|
136
|
+
Affiliates of each other solely because both are owned or
|
|
137
|
+
controlled by (i) a government or public body, or (ii) an
|
|
138
|
+
investment fund or other financial investor that does not
|
|
139
|
+
include them in its own consolidated financial statements.
|
|
140
|
+
|
|
141
|
+
"Annual Revenue" means the total gross revenue (or, for a
|
|
142
|
+
business such as a bank or insurer that does not report
|
|
143
|
+
revenue in that form, the nearest equivalent measure of
|
|
144
|
+
its total income) of the whole Organisation for its most
|
|
145
|
+
recently completed financial year, taken from consolidated
|
|
146
|
+
financial statements where they exist and otherwise by
|
|
147
|
+
adding together the figures for each member. For a
|
|
148
|
+
government or public body, charity or non-profit
|
|
149
|
+
organisation, it means the greater of its total income
|
|
150
|
+
(including grants and donations) and its total annual
|
|
151
|
+
budget for that year. An Organisation that has not
|
|
152
|
+
completed a financial year uses its reasonably projected
|
|
153
|
+
figure for its first year. Amounts in other currencies are
|
|
154
|
+
converted to US dollars at the average exchange rate for
|
|
155
|
+
that year from a recognised published source.
|
|
156
|
+
|
|
157
|
+
"Total Funding" means the total amount of equity
|
|
158
|
+
investment, and of convertible or other investment
|
|
159
|
+
intended to convert into equity (such as convertible notes
|
|
160
|
+
or SAFEs), that the whole Organisation has received from
|
|
161
|
+
investors outside the Organisation since it was formed,
|
|
162
|
+
measured at the amounts invested. It does not include
|
|
163
|
+
revenue, government or charitable grants, or loans and
|
|
164
|
+
other debt.
|
|
165
|
+
|
|
166
|
+
"Production use" means any use of the Licensed Work other
|
|
167
|
+
than (i) trying it out with sample, test or throwaway
|
|
168
|
+
content that no one relies on, or (ii) developing, testing
|
|
169
|
+
or contributing to the Licensed Work itself. It includes
|
|
170
|
+
running a catalog built with the Licensed Work that an
|
|
171
|
+
Organisation's employees, contractors or automated systems
|
|
172
|
+
(including AI agents) use or rely on to document,
|
|
173
|
+
discover, understand or govern its software systems,
|
|
174
|
+
whether that catalog is available internally, privately or
|
|
175
|
+
publicly, and using the Licensed Work in continuous
|
|
176
|
+
integration or deployment pipelines to build, update or
|
|
177
|
+
validate such a catalog. Use is Production use if it meets
|
|
178
|
+
this definition, whatever the catalog, environment or
|
|
179
|
+
project is called (including "evaluation", "pilot", "proof
|
|
180
|
+
of concept" or "internal").
|
|
181
|
+
|
|
182
|
+
"Evaluation Period" means the sixty (60) days starting on
|
|
183
|
+
the date an Organisation first makes Production use of any
|
|
184
|
+
version of the Licensed Work, or any longer period the
|
|
185
|
+
Licensor agrees in writing. Each Organisation, including
|
|
186
|
+
all of its Affiliates, has one Evaluation Period in total
|
|
187
|
+
across all versions of the Licensed Work. Upgrading,
|
|
188
|
+
reinstalling, creating another catalog, or a change in the
|
|
189
|
+
Organisation's Affiliates does not start a new Evaluation
|
|
190
|
+
Period. If two Organisations that have each started an
|
|
191
|
+
Evaluation Period become Affiliates, the earlier period
|
|
192
|
+
applies to the combined Organisation.
|
|
110
193
|
|
|
111
194
|
"Public Open Source Project" means a software project
|
|
112
|
-
whose source code is publicly available under a
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
195
|
+
whose source code is publicly available under a license
|
|
196
|
+
approved by the Open Source Initiative, where the catalog
|
|
197
|
+
documents only that project's software and not the systems
|
|
198
|
+
of an Organisation.
|
|
199
|
+
|
|
200
|
+
"Hosted Offering" means using the Licensed Work to give
|
|
201
|
+
third parties access to the Licensed Work, or to a catalog
|
|
202
|
+
built with it, as a hosted, managed or multi-tenant
|
|
203
|
+
service, whether or not for a fee, and whether offered on
|
|
204
|
+
its own or as part of another product. Members of Your
|
|
205
|
+
Organisation are not third parties. The following are not
|
|
206
|
+
Hosted Offerings:
|
|
207
|
+
|
|
208
|
+
(a) publishing a catalog that documents Your own software
|
|
209
|
+
systems, including making it publicly accessible to
|
|
210
|
+
Your customers, partners or the public;
|
|
211
|
+
|
|
212
|
+
(b) hosting a catalog for a specific client under section
|
|
213
|
+
3 as part of services You provide to that client,
|
|
214
|
+
where the catalog documents that client's software
|
|
215
|
+
systems and You do not offer hosting of the Licensed
|
|
216
|
+
Work as a standardised or self-service product; and
|
|
217
|
+
|
|
218
|
+
(c) hosting, without charge, catalogs that document only
|
|
219
|
+
Public Open Source Projects.
|
|
220
|
+
|
|
221
|
+
"Commercial License" means a written license from the
|
|
222
|
+
Licensor permitting Production use beyond this grant.
|
|
223
|
+
|
|
224
|
+
7. Everything else
|
|
225
|
+
|
|
226
|
+
All other Production use requires a Commercial License.
|
|
227
|
+
Nothing in this grant limits the rights granted in the
|
|
228
|
+
Terms below, including the right to copy, modify,
|
|
229
|
+
redistribute and make non-production use of the Licensed
|
|
230
|
+
Work. The content of Your own catalog (the documentation,
|
|
231
|
+
schemas, diagrams and configuration You create) is Yours
|
|
232
|
+
and is not part of the Licensed Work.
|
|
233
|
+
Change Date: Four years after the first public release, including any
|
|
234
|
+
pre-release, of any release in the same release series as
|
|
235
|
+
the Licensed Work.
|
|
236
|
+
|
|
237
|
+
A "release series" is every release that shares the same
|
|
238
|
+
major and minor release number, including its pre-releases
|
|
239
|
+
and patch releases: for example, 5.1 includes
|
|
240
|
+
5.1.0-beta.1, 5.1.0 and 5.1.3, and they all share one
|
|
241
|
+
Change Date. Unreleased builds, such as individual commits
|
|
242
|
+
or nightly builds, belong to the next release series to be
|
|
243
|
+
released.
|
|
145
244
|
Change License: MIT
|
|
146
245
|
|
|
147
246
|
For information about commercial licensing of the Licensed Work, please
|
|
@@ -36,13 +36,27 @@ module.exports = __toCommonJS(analytics_exports);
|
|
|
36
36
|
var import_os = __toESM(require("os"), 1);
|
|
37
37
|
|
|
38
38
|
// package.json
|
|
39
|
-
var version = "5.0.0-beta.
|
|
39
|
+
var version = "5.0.0-beta.9";
|
|
40
40
|
|
|
41
41
|
// src/constants.ts
|
|
42
42
|
var VERSION = version;
|
|
43
43
|
|
|
44
|
+
// src/analytics/telemetry.ts
|
|
45
|
+
var TELEMETRY_REQUEST_TIMEOUT_MS = 2e3;
|
|
46
|
+
var isOptOutEnvValue = (value) => {
|
|
47
|
+
if (typeof value !== "string") return false;
|
|
48
|
+
const normalized = value.trim().toLowerCase();
|
|
49
|
+
return normalized === "1" || normalized === "true";
|
|
50
|
+
};
|
|
51
|
+
var isTelemetryDisabled = (config, env) => {
|
|
52
|
+
if (isOptOutEnvValue(env.EVENTCATALOG_TELEMETRY_DISABLED)) return true;
|
|
53
|
+
if (isOptOutEnvValue(env.DO_NOT_TRACK)) return true;
|
|
54
|
+
return config?.telemetry === false;
|
|
55
|
+
};
|
|
56
|
+
|
|
44
57
|
// src/analytics/analytics.js
|
|
45
|
-
async function raiseEvent(eventData) {
|
|
58
|
+
async function raiseEvent(eventData, config) {
|
|
59
|
+
if (isTelemetryDisabled(config, process.env)) return;
|
|
46
60
|
if (typeof eventData?.command !== "string" || typeof eventData?.cId !== "string") return;
|
|
47
61
|
const url = "https://queue.simpleanalyticscdn.com/events";
|
|
48
62
|
const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${import_os.default.platform()}; ${import_os.default.arch()}; Node/${process.version})`;
|
|
@@ -64,7 +78,8 @@ async function raiseEvent(eventData) {
|
|
|
64
78
|
const response = await fetch(url, {
|
|
65
79
|
method: "POST",
|
|
66
80
|
headers,
|
|
67
|
-
body: JSON.stringify(payload)
|
|
81
|
+
body: JSON.stringify(payload),
|
|
82
|
+
signal: AbortSignal.timeout(TELEMETRY_REQUEST_TIMEOUT_MS)
|
|
68
83
|
});
|
|
69
84
|
if (!response.ok) {
|
|
70
85
|
throw new Error(`Failed to raise analytics event: ${response.status}`);
|
|
@@ -176,13 +176,27 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
176
176
|
var import_os = __toESM(require("os"), 1);
|
|
177
177
|
|
|
178
178
|
// package.json
|
|
179
|
-
var version = "5.0.0-beta.
|
|
179
|
+
var version = "5.0.0-beta.9";
|
|
180
180
|
|
|
181
181
|
// src/constants.ts
|
|
182
182
|
var VERSION = version;
|
|
183
183
|
|
|
184
|
+
// src/analytics/telemetry.ts
|
|
185
|
+
var TELEMETRY_REQUEST_TIMEOUT_MS = 2e3;
|
|
186
|
+
var isOptOutEnvValue = (value) => {
|
|
187
|
+
if (typeof value !== "string") return false;
|
|
188
|
+
const normalized = value.trim().toLowerCase();
|
|
189
|
+
return normalized === "1" || normalized === "true";
|
|
190
|
+
};
|
|
191
|
+
var isTelemetryDisabled = (config, env) => {
|
|
192
|
+
if (isOptOutEnvValue(env.EVENTCATALOG_TELEMETRY_DISABLED)) return true;
|
|
193
|
+
if (isOptOutEnvValue(env.DO_NOT_TRACK)) return true;
|
|
194
|
+
return config?.telemetry === false;
|
|
195
|
+
};
|
|
196
|
+
|
|
184
197
|
// src/analytics/analytics.js
|
|
185
|
-
async function raiseEvent(eventData) {
|
|
198
|
+
async function raiseEvent(eventData, config) {
|
|
199
|
+
if (isTelemetryDisabled(config, process.env)) return;
|
|
186
200
|
if (typeof eventData?.command !== "string" || typeof eventData?.cId !== "string") return;
|
|
187
201
|
const url = "https://queue.simpleanalyticscdn.com/events";
|
|
188
202
|
const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${import_os.default.platform()}; ${import_os.default.arch()}; Node/${process.version})`;
|
|
@@ -204,7 +218,8 @@ async function raiseEvent(eventData) {
|
|
|
204
218
|
const response = await fetch(url, {
|
|
205
219
|
method: "POST",
|
|
206
220
|
headers,
|
|
207
|
-
body: JSON.stringify(payload)
|
|
221
|
+
body: JSON.stringify(payload),
|
|
222
|
+
signal: AbortSignal.timeout(TELEMETRY_REQUEST_TIMEOUT_MS)
|
|
208
223
|
});
|
|
209
224
|
if (!response.ok) {
|
|
210
225
|
throw new Error(`Failed to raise analytics event: ${response.status}`);
|
|
@@ -281,6 +296,7 @@ function serializeCounts(counts) {
|
|
|
281
296
|
|
|
282
297
|
// src/utils/license-status.ts
|
|
283
298
|
var import_boxen = __toESM(require("boxen"), 1);
|
|
299
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
284
300
|
var import_license2 = require("@eventcatalog/license");
|
|
285
301
|
|
|
286
302
|
// eventcatalog/src/utils/trial.ts
|
|
@@ -311,6 +327,7 @@ var getLicenseAnalytics = (license = { state: "none" }, tsd) => ({
|
|
|
311
327
|
licenseExpiry: "expiresAt" in license ? license.expiresAt?.getTime() : void 0,
|
|
312
328
|
trialExpiry: getTrialStatus(tsd)?.endsAt.getTime()
|
|
313
329
|
});
|
|
330
|
+
var COLOURS = { bold: import_picocolors.default.bold, dim: import_picocolors.default.dim, link: (text) => import_picocolors.default.cyan(text) };
|
|
314
331
|
|
|
315
332
|
// src/analytics/log-build.js
|
|
316
333
|
var isMCPEnabled = (configFile) => configFile.output === "server" && (configFile.mcp?.enabled ?? true);
|
|
@@ -367,50 +384,69 @@ var toCloudResourceCounts = (counts) => ({
|
|
|
367
384
|
customPages: counts.customPages || 0,
|
|
368
385
|
customApis: counts.customApis || 0
|
|
369
386
|
});
|
|
370
|
-
var
|
|
387
|
+
var getEnabledCloudAnalytics = (configFile) => {
|
|
371
388
|
const analytics = configFile.cloud?.analytics;
|
|
372
|
-
if (!analytics?.enabled || !analytics.trackingId || !analytics.writeKey) return;
|
|
389
|
+
if (!analytics?.enabled || !analytics.trackingId || !analytics.writeKey) return null;
|
|
390
|
+
return analytics;
|
|
391
|
+
};
|
|
392
|
+
var reportCloudResourceInventory = async (configFile, resourceCounts) => {
|
|
393
|
+
const analytics = getEnabledCloudAnalytics(configFile);
|
|
394
|
+
if (!analytics) return;
|
|
373
395
|
const endpoint = analytics.endpoint || CLOUD_ANALYTICS_ENDPOINT;
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
396
|
+
try {
|
|
397
|
+
await fetch(endpoint, {
|
|
398
|
+
method: "POST",
|
|
399
|
+
headers: {
|
|
400
|
+
"Content-Type": "application/json",
|
|
401
|
+
"X-EventCatalog-Analytics-Key": analytics.writeKey
|
|
402
|
+
},
|
|
403
|
+
body: JSON.stringify({
|
|
404
|
+
trackingId: analytics.trackingId,
|
|
405
|
+
event: "catalog.resource_inventory_reported",
|
|
406
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
407
|
+
counts: toCloudResourceCounts(resourceCounts)
|
|
408
|
+
}),
|
|
409
|
+
signal: AbortSignal.timeout(TELEMETRY_REQUEST_TIMEOUT_MS)
|
|
410
|
+
});
|
|
411
|
+
} catch {
|
|
412
|
+
}
|
|
387
413
|
};
|
|
388
414
|
var main = async (projectDir, { command = "build", license } = {}) => {
|
|
389
415
|
try {
|
|
390
416
|
await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
|
|
391
417
|
const configFile = await getEventCatalogConfigFile(projectDir);
|
|
418
|
+
if (isTelemetryDisabled(configFile, process.env)) {
|
|
419
|
+
if (getEnabledCloudAnalytics(configFile)) {
|
|
420
|
+
const resourceCounts2 = await countResources(projectDir);
|
|
421
|
+
await reportCloudResourceInventory(configFile, resourceCounts2);
|
|
422
|
+
}
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
392
425
|
const { cId, tsd, organizationName, generators = [] } = configFile;
|
|
393
426
|
const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
|
|
394
427
|
const features = await getFeatures(configFile);
|
|
395
428
|
const resourceCounts = await countResources(projectDir);
|
|
396
429
|
const contentHash = await hashCatalogContent(projectDir);
|
|
397
430
|
await reportCloudResourceInventory(configFile, resourceCounts);
|
|
398
|
-
await raiseEvent(
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
431
|
+
await raiseEvent(
|
|
432
|
+
{
|
|
433
|
+
command,
|
|
434
|
+
org: organizationName,
|
|
435
|
+
cId,
|
|
436
|
+
// Trial start date (unix ms) from eventcatalog.config.js
|
|
437
|
+
tsd,
|
|
438
|
+
// Commercial license or trial, and when each expires (unix ms)
|
|
439
|
+
...getLicenseAnalytics(license, tsd),
|
|
440
|
+
// CI redeploys and human-run builds are different signals; tag rather than suppress
|
|
441
|
+
ci: process.env.CI ? "true" : "false",
|
|
442
|
+
contentHash,
|
|
443
|
+
generators: generatorNames.toString(),
|
|
444
|
+
features: Object.keys(features).map((feature) => `${feature}:${features[feature]}`).join(","),
|
|
445
|
+
directorySources: serializeDirectorySources(configFile),
|
|
446
|
+
resources: serializeCounts(resourceCounts)
|
|
447
|
+
},
|
|
448
|
+
configFile
|
|
449
|
+
);
|
|
414
450
|
} catch (error) {
|
|
415
451
|
}
|
|
416
452
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-JQMYHZWI.js";
|
|
4
|
+
import "../chunk-4CFZUHGG.js";
|
|
5
5
|
import "../chunk-ZAZHAVKB.js";
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-CPW6G62V.js";
|
|
7
|
+
import "../chunk-AWOO63ME.js";
|
|
8
|
+
import "../chunk-EUNQJO3J.js";
|
|
8
9
|
import "../chunk-RFIXKATC.js";
|
|
9
10
|
export {
|
|
10
11
|
log_build_default as default
|