@eventcatalog/core 2.20.1 → 2.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-P4LJB7KO.js → chunk-F4GCNRKV.js} +1 -1
- package/dist/{chunk-IXGDS55I.js → chunk-IOBMNGC6.js} +1 -1
- package/dist/{chunk-IMSJ6ZK2.js → chunk-U2ID5L3C.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +3 -3
- package/eventcatalog/src/components/Tables/Table.tsx +2 -1
- package/eventcatalog/src/components/Tables/columns/TeamsTableColumns.tsx +69 -33
- package/eventcatalog/src/components/Tables/columns/UserTableColumns.tsx +73 -38
- package/eventcatalog/src/content/config.ts +2 -0
- package/eventcatalog/src/pages/directory/[type]/index.astro +3 -0
- package/eventcatalog/src/pages/docs/teams/[id]/index.astro +15 -0
- package/eventcatalog/src/pages/docs/users/[id]/index.astro +2 -1
- package/eventcatalog/src/utils/teams.ts +6 -1
- package/eventcatalog/src/utils/users.ts +11 -15
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-U2ID5L3C.js";
|
|
4
|
+
import "../chunk-IOBMNGC6.js";
|
|
5
|
+
import "../chunk-F4GCNRKV.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
package/dist/eventcatalog.js
CHANGED
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-SHCMAL37.js";
|
|
4
4
|
import {
|
|
5
5
|
log_build_default
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-U2ID5L3C.js";
|
|
7
|
+
import "./chunk-IOBMNGC6.js";
|
|
8
8
|
import {
|
|
9
9
|
catalogToAstro
|
|
10
10
|
} from "./chunk-WF34R5UT.js";
|
|
11
11
|
import {
|
|
12
12
|
VERSION
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-F4GCNRKV.js";
|
|
14
14
|
import {
|
|
15
15
|
generate
|
|
16
16
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -28,6 +28,7 @@ declare module '@tanstack/react-table' {
|
|
|
28
28
|
| 'receives'
|
|
29
29
|
| 'services'
|
|
30
30
|
| 'ownedCommands'
|
|
31
|
+
| 'ownedQueries'
|
|
31
32
|
| 'ownedEvents'
|
|
32
33
|
| 'ownedServices'
|
|
33
34
|
| 'associatedTeams';
|
|
@@ -112,7 +113,7 @@ export type TData<T extends TCollectionTypes> = {
|
|
|
112
113
|
ownedEvents: any;
|
|
113
114
|
ownedServices: any;
|
|
114
115
|
associatedTeams: any;
|
|
115
|
-
|
|
116
|
+
ownedQueries: any;
|
|
116
117
|
// Teams
|
|
117
118
|
members: any;
|
|
118
119
|
};
|
|
@@ -38,13 +38,10 @@ export const columns = () => [
|
|
|
38
38
|
href={buildUrl(`/docs/${messageRaw.collection}/${messageRaw.data.id}`)}
|
|
39
39
|
className={`group-hover:text-pink-500 flex space-x-1 items-center`}
|
|
40
40
|
>
|
|
41
|
-
<div className={`flex items-center
|
|
41
|
+
<div className={`flex items-center rounded-md group-hover:border-pink-400`}>
|
|
42
42
|
<span className="flex items-center">
|
|
43
|
-
<span className=
|
|
44
|
-
|
|
45
|
-
</span>
|
|
46
|
-
<span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
47
|
-
{messageRaw.data.name}
|
|
43
|
+
<span className="flex flex-col leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
44
|
+
<span className="font-semibold">{messageRaw.data.name}</span>
|
|
48
45
|
</span>
|
|
49
46
|
</span>
|
|
50
47
|
</div>
|
|
@@ -59,21 +56,56 @@ export const columns = () => [
|
|
|
59
56
|
filterFn: filterByName,
|
|
60
57
|
}),
|
|
61
58
|
|
|
62
|
-
columnHelper.accessor('data.
|
|
63
|
-
header: () => <span>
|
|
59
|
+
columnHelper.accessor('data.ownedEvents', {
|
|
60
|
+
header: () => <span>Owned events</span>,
|
|
64
61
|
meta: {
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
filterVariant: 'collection',
|
|
63
|
+
collectionFilterKey: 'ownedEvents',
|
|
67
64
|
},
|
|
68
65
|
cell: (info) => {
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
return <div className="font-light text-sm text-gray-400/
|
|
66
|
+
const events = info.getValue();
|
|
67
|
+
if (events?.length === 0 || !events)
|
|
68
|
+
return <div className="font-light text-sm text-gray-400/80 text-left italic">Team owns no events</div>;
|
|
72
69
|
|
|
73
|
-
|
|
70
|
+
const isExpandable = events?.length > 10;
|
|
71
|
+
const isOpen = isExpandable ? events?.length < 10 : true;
|
|
72
|
+
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<div>
|
|
76
|
+
{isExpandable && (
|
|
77
|
+
<button onClick={() => setIsExpanded(!isExpanded)} className="mb-2 text-sm text-gray-600 hover:text-gray-900">
|
|
78
|
+
{isExpanded ? '▼' : '▶'} {events.length} event{events.length !== 1 ? 's' : ''}
|
|
79
|
+
</button>
|
|
80
|
+
)}
|
|
81
|
+
{isExpanded && (
|
|
82
|
+
<ul>
|
|
83
|
+
{events.map((event: CollectionEntry<'events'>, index: number) => (
|
|
84
|
+
<li key={`${event.data.id}-${index}`} className="py-1 group font-light ">
|
|
85
|
+
<a
|
|
86
|
+
href={buildUrl(`/docs/${event.collection}/${event.data.id}/${event.data.version}`)}
|
|
87
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
88
|
+
>
|
|
89
|
+
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
90
|
+
<span className="flex items-center">
|
|
91
|
+
<span className={`bg-orange-500 h-full rounded-tl rounded-bl p-1`}>
|
|
92
|
+
<BoltIcon className="h-4 w-4 text-white" />
|
|
93
|
+
</span>
|
|
94
|
+
<span className="leading-none px-2 group-hover:underline ">
|
|
95
|
+
{event.data.name} (v{event.data.version})
|
|
96
|
+
</span>
|
|
97
|
+
</span>
|
|
98
|
+
</div>
|
|
99
|
+
</a>
|
|
100
|
+
</li>
|
|
101
|
+
))}
|
|
102
|
+
</ul>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
74
106
|
},
|
|
75
107
|
footer: (info) => info.column.id,
|
|
76
|
-
filterFn:
|
|
108
|
+
filterFn: filterCollectionByName('ownedEvents'),
|
|
77
109
|
}),
|
|
78
110
|
|
|
79
111
|
columnHelper.accessor('data.ownedCommands', {
|
|
@@ -85,7 +117,7 @@ export const columns = () => [
|
|
|
85
117
|
cell: (info) => {
|
|
86
118
|
const commands = info.getValue();
|
|
87
119
|
if (commands?.length === 0 || !commands)
|
|
88
|
-
return <div className="font-light text-sm text-gray-400/60 text-left italic">
|
|
120
|
+
return <div className="font-light text-sm text-gray-400/60 text-left italic">Team owns no commands</div>;
|
|
89
121
|
|
|
90
122
|
const isExpandable = commands?.length > 10;
|
|
91
123
|
const isOpen = isExpandable ? commands?.length < 10 : true;
|
|
@@ -129,43 +161,44 @@ export const columns = () => [
|
|
|
129
161
|
footer: (info) => info.column.id,
|
|
130
162
|
filterFn: filterCollectionByName('ownedCommands'),
|
|
131
163
|
}),
|
|
132
|
-
|
|
133
|
-
|
|
164
|
+
|
|
165
|
+
columnHelper.accessor('data.ownedQueries', {
|
|
166
|
+
header: () => <span>Owned queries</span>,
|
|
134
167
|
meta: {
|
|
135
168
|
filterVariant: 'collection',
|
|
136
|
-
collectionFilterKey: '
|
|
169
|
+
collectionFilterKey: 'ownedQueries',
|
|
137
170
|
},
|
|
138
171
|
cell: (info) => {
|
|
139
|
-
const
|
|
140
|
-
if (
|
|
141
|
-
return <div className="font-light text-sm text-gray-400/
|
|
172
|
+
const queries = info.getValue();
|
|
173
|
+
if (queries?.length === 0 || !queries)
|
|
174
|
+
return <div className="font-light text-sm text-gray-400/60 text-left italic">Team owns no queries</div>;
|
|
142
175
|
|
|
143
|
-
const isExpandable =
|
|
144
|
-
const isOpen = isExpandable ?
|
|
176
|
+
const isExpandable = queries?.length > 10;
|
|
177
|
+
const isOpen = isExpandable ? queries?.length < 10 : true;
|
|
145
178
|
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
146
179
|
|
|
147
180
|
return (
|
|
148
181
|
<div>
|
|
149
182
|
{isExpandable && (
|
|
150
183
|
<button onClick={() => setIsExpanded(!isExpanded)} className="mb-2 text-sm text-gray-600 hover:text-gray-900">
|
|
151
|
-
{isExpanded ? '▼' : '▶'} {
|
|
184
|
+
{isExpanded ? '▼' : '▶'} {queries.length} query{queries.length !== 1 ? 's' : ''}
|
|
152
185
|
</button>
|
|
153
186
|
)}
|
|
154
187
|
{isExpanded && (
|
|
155
188
|
<ul>
|
|
156
|
-
{
|
|
157
|
-
<li key={`${
|
|
189
|
+
{queries.map((query: CollectionEntry<'queries'>, index: number) => (
|
|
190
|
+
<li key={`${query.data.id}-${index}`} className="py-1 group font-light ">
|
|
158
191
|
<a
|
|
159
|
-
href={buildUrl(`/docs/${
|
|
192
|
+
href={buildUrl(`/docs/${query.collection}/${query.data.id}/${query.data.version}`)}
|
|
160
193
|
className="group-hover:text-primary flex space-x-1 items-center "
|
|
161
194
|
>
|
|
162
195
|
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
163
196
|
<span className="flex items-center">
|
|
164
|
-
<span className={`bg-
|
|
165
|
-
<
|
|
197
|
+
<span className={`bg-blue-500 h-full rounded-tl rounded-bl p-1`}>
|
|
198
|
+
<ChatBubbleLeftIcon className="h-4 w-4 text-white" />
|
|
166
199
|
</span>
|
|
167
200
|
<span className="leading-none px-2 group-hover:underline ">
|
|
168
|
-
{
|
|
201
|
+
{query.data.name} (v{query.data.version})
|
|
169
202
|
</span>
|
|
170
203
|
</span>
|
|
171
204
|
</div>
|
|
@@ -176,10 +209,13 @@ export const columns = () => [
|
|
|
176
209
|
)}
|
|
177
210
|
</div>
|
|
178
211
|
);
|
|
212
|
+
|
|
213
|
+
// return commands.length;
|
|
179
214
|
},
|
|
180
215
|
footer: (info) => info.column.id,
|
|
181
|
-
filterFn: filterCollectionByName('
|
|
216
|
+
filterFn: filterCollectionByName('ownedCommands'),
|
|
182
217
|
}),
|
|
218
|
+
|
|
183
219
|
columnHelper.accessor('data.ownedServices', {
|
|
184
220
|
header: () => <span>Owned Services</span>,
|
|
185
221
|
meta: {
|
|
@@ -189,7 +225,7 @@ export const columns = () => [
|
|
|
189
225
|
cell: (info) => {
|
|
190
226
|
const services = info.getValue();
|
|
191
227
|
if (services?.length === 0 || !services)
|
|
192
|
-
return <div className="font-light text-sm text-gray-400/80 text-left italic">
|
|
228
|
+
return <div className="font-light text-sm text-gray-400/80 text-left italic">Team owns no services</div>;
|
|
193
229
|
|
|
194
230
|
const isExpandable = services?.length > 10;
|
|
195
231
|
const isOpen = isExpandable ? services?.length < 10 : true;
|
|
@@ -6,7 +6,7 @@ import type { TData } from '../Table';
|
|
|
6
6
|
import type { CollectionUserTypes } from '@types';
|
|
7
7
|
import { User, Users } from 'lucide-react';
|
|
8
8
|
import type { CollectionEntry } from 'astro:content';
|
|
9
|
-
import { ServerIcon, BoltIcon, ChatBubbleLeftIcon } from '@heroicons/react/24/solid';
|
|
9
|
+
import { ServerIcon, BoltIcon, ChatBubbleLeftIcon, MagnifyingGlassIcon } from '@heroicons/react/24/solid';
|
|
10
10
|
|
|
11
11
|
const columnHelper = createColumnHelper<TData<CollectionUserTypes>>();
|
|
12
12
|
|
|
@@ -23,19 +23,10 @@ export const columns = () => [
|
|
|
23
23
|
href={buildUrl(`/docs/${messageRaw.collection}/${messageRaw.data.id}`)}
|
|
24
24
|
className={`group-hover:text-gray-500 flex space-x-1 items-center`}
|
|
25
25
|
>
|
|
26
|
-
<div className={`flex items-center
|
|
26
|
+
<div className={`flex items-center rounded-md group-hover:border-gray-400`}>
|
|
27
27
|
<span className="flex items-center">
|
|
28
|
-
|
|
29
|
-
<span className={
|
|
30
|
-
<User className="h-4 w-4 text-white" />
|
|
31
|
-
</span>
|
|
32
|
-
)}
|
|
33
|
-
{messageRaw.data.avatarUrl && (
|
|
34
|
-
<img src={messageRaw.data.avatarUrl} alt={messageRaw.data.name} className="h-12 w-12 rounded-md p-0.5" />
|
|
35
|
-
)}
|
|
36
|
-
|
|
37
|
-
<span className="leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
38
|
-
{messageRaw.data.name}
|
|
28
|
+
<span className="flex flex-col leading-none px-2 group-hover:underline group-hover:text-primary font-light">
|
|
29
|
+
<span className="font-semibold">{messageRaw.data.name}</span>
|
|
39
30
|
</span>
|
|
40
31
|
</span>
|
|
41
32
|
</div>
|
|
@@ -50,16 +41,56 @@ export const columns = () => [
|
|
|
50
41
|
filterFn: filterByName,
|
|
51
42
|
}),
|
|
52
43
|
|
|
53
|
-
columnHelper.accessor('data.
|
|
54
|
-
|
|
55
|
-
header: () => 'Role',
|
|
56
|
-
cell: (info) => <span className="font-light ">{info.renderValue()}</span>,
|
|
57
|
-
footer: (info) => info.column.id,
|
|
44
|
+
columnHelper.accessor('data.ownedEvents', {
|
|
45
|
+
header: () => <span>Owned events</span>,
|
|
58
46
|
meta: {
|
|
59
|
-
|
|
60
|
-
|
|
47
|
+
filterVariant: 'collection',
|
|
48
|
+
collectionFilterKey: 'ownedEvents',
|
|
61
49
|
},
|
|
62
|
-
|
|
50
|
+
cell: (info) => {
|
|
51
|
+
const events = info.getValue();
|
|
52
|
+
if (events?.length === 0 || !events)
|
|
53
|
+
return <div className="font-light text-sm text-gray-400/80 text-left italic">User owns no events</div>;
|
|
54
|
+
|
|
55
|
+
const isExpandable = events?.length > 10;
|
|
56
|
+
const isOpen = isExpandable ? events?.length < 10 : true;
|
|
57
|
+
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<div>
|
|
61
|
+
{isExpandable && (
|
|
62
|
+
<button onClick={() => setIsExpanded(!isExpanded)} className="mb-2 text-sm text-gray-600 hover:text-gray-900">
|
|
63
|
+
{isExpanded ? '▼' : '▶'} {events.length} event{events.length !== 1 ? 's' : ''}
|
|
64
|
+
</button>
|
|
65
|
+
)}
|
|
66
|
+
{isExpanded && (
|
|
67
|
+
<ul>
|
|
68
|
+
{events.map((event: CollectionEntry<'events'>, index: number) => (
|
|
69
|
+
<li key={`${event.data.id}-${index}`} className="py-1 group font-light ">
|
|
70
|
+
<a
|
|
71
|
+
href={buildUrl(`/docs/${event.collection}/${event.data.id}/${event.data.version}`)}
|
|
72
|
+
className="group-hover:text-primary flex space-x-1 items-center "
|
|
73
|
+
>
|
|
74
|
+
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
75
|
+
<span className="flex items-center">
|
|
76
|
+
<span className={`bg-orange-500 h-full rounded-tl rounded-bl p-1`}>
|
|
77
|
+
<BoltIcon className="h-4 w-4 text-white" />
|
|
78
|
+
</span>
|
|
79
|
+
<span className="leading-none px-2 group-hover:underline ">
|
|
80
|
+
{event.data.name} (v{event.data.version})
|
|
81
|
+
</span>
|
|
82
|
+
</span>
|
|
83
|
+
</div>
|
|
84
|
+
</a>
|
|
85
|
+
</li>
|
|
86
|
+
))}
|
|
87
|
+
</ul>
|
|
88
|
+
)}
|
|
89
|
+
</div>
|
|
90
|
+
);
|
|
91
|
+
},
|
|
92
|
+
footer: (info) => info.column.id,
|
|
93
|
+
filterFn: filterCollectionByName('ownedEvents'),
|
|
63
94
|
}),
|
|
64
95
|
|
|
65
96
|
columnHelper.accessor('data.ownedCommands', {
|
|
@@ -115,43 +146,44 @@ export const columns = () => [
|
|
|
115
146
|
footer: (info) => info.column.id,
|
|
116
147
|
filterFn: filterCollectionByName('ownedCommands'),
|
|
117
148
|
}),
|
|
118
|
-
|
|
119
|
-
|
|
149
|
+
|
|
150
|
+
columnHelper.accessor('data.ownedQueries', {
|
|
151
|
+
header: () => <span>Owned queries</span>,
|
|
120
152
|
meta: {
|
|
121
153
|
filterVariant: 'collection',
|
|
122
|
-
collectionFilterKey: '
|
|
154
|
+
collectionFilterKey: 'ownedQueries',
|
|
123
155
|
},
|
|
124
156
|
cell: (info) => {
|
|
125
|
-
const
|
|
126
|
-
if (
|
|
127
|
-
return <div className="font-light text-sm text-gray-400/
|
|
157
|
+
const queries = info.getValue();
|
|
158
|
+
if (queries?.length === 0 || !queries)
|
|
159
|
+
return <div className="font-light text-sm text-gray-400/60 text-left italic">User owns no queries</div>;
|
|
128
160
|
|
|
129
|
-
const isExpandable =
|
|
130
|
-
const isOpen = isExpandable ?
|
|
161
|
+
const isExpandable = queries?.length > 10;
|
|
162
|
+
const isOpen = isExpandable ? queries?.length < 10 : true;
|
|
131
163
|
const [isExpanded, setIsExpanded] = useState(isOpen);
|
|
132
164
|
|
|
133
165
|
return (
|
|
134
166
|
<div>
|
|
135
167
|
{isExpandable && (
|
|
136
168
|
<button onClick={() => setIsExpanded(!isExpanded)} className="mb-2 text-sm text-gray-600 hover:text-gray-900">
|
|
137
|
-
{isExpanded ? '▼' : '▶'} {
|
|
169
|
+
{isExpanded ? '▼' : '▶'} {queries.length} query{queries.length !== 1 ? 's' : ''}
|
|
138
170
|
</button>
|
|
139
171
|
)}
|
|
140
172
|
{isExpanded && (
|
|
141
173
|
<ul>
|
|
142
|
-
{
|
|
143
|
-
<li key={`${
|
|
174
|
+
{queries.map((query: CollectionEntry<'queries'>, index: number) => (
|
|
175
|
+
<li key={`${query.data.id}-${index}`} className="py-1 group font-light ">
|
|
144
176
|
<a
|
|
145
|
-
href={buildUrl(`/docs/${
|
|
177
|
+
href={buildUrl(`/docs/${query.collection}/${query.data.id}/${query.data.version}`)}
|
|
146
178
|
className="group-hover:text-primary flex space-x-1 items-center "
|
|
147
179
|
>
|
|
148
|
-
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md`}>
|
|
180
|
+
<div className={`flex items-center border border-gray-300 shadow-sm rounded-md h-full`}>
|
|
149
181
|
<span className="flex items-center">
|
|
150
|
-
<span className={`bg-
|
|
151
|
-
<
|
|
182
|
+
<span className={`bg-green-500 flex rounded-tl rounded-bl p-1 h-full`}>
|
|
183
|
+
<MagnifyingGlassIcon className="h-4 w-4 text-white" />
|
|
152
184
|
</span>
|
|
153
185
|
<span className="leading-none px-2 group-hover:underline ">
|
|
154
|
-
{
|
|
186
|
+
{query.data.name} (v{query.data.version})
|
|
155
187
|
</span>
|
|
156
188
|
</span>
|
|
157
189
|
</div>
|
|
@@ -162,10 +194,13 @@ export const columns = () => [
|
|
|
162
194
|
)}
|
|
163
195
|
</div>
|
|
164
196
|
);
|
|
197
|
+
|
|
198
|
+
// return commands.length;
|
|
165
199
|
},
|
|
166
200
|
footer: (info) => info.column.id,
|
|
167
|
-
filterFn: filterCollectionByName('
|
|
201
|
+
filterFn: filterCollectionByName('ownedCommands'),
|
|
168
202
|
}),
|
|
203
|
+
|
|
169
204
|
columnHelper.accessor('data.ownedServices', {
|
|
170
205
|
header: () => <span>Owned Services</span>,
|
|
171
206
|
meta: {
|
|
@@ -267,6 +267,7 @@ const users = defineCollection({
|
|
|
267
267
|
ownedServices: z.array(reference('services')).optional(),
|
|
268
268
|
ownedEvents: z.array(reference('events')).optional(),
|
|
269
269
|
ownedCommands: z.array(reference('commands')).optional(),
|
|
270
|
+
ownedQueries: z.array(reference('queries')).optional(),
|
|
270
271
|
associatedTeams: z.array(reference('teams')).optional(),
|
|
271
272
|
}),
|
|
272
273
|
});
|
|
@@ -283,6 +284,7 @@ const teams = defineCollection({
|
|
|
283
284
|
msTeamsDirectMessageUrl: z.string().optional(),
|
|
284
285
|
members: z.array(reference('users')).optional(),
|
|
285
286
|
ownedCommands: z.array(reference('commands')).optional(),
|
|
287
|
+
ownedQueries: z.array(reference('queries')).optional(),
|
|
286
288
|
ownedDomains: z.array(reference('domains')).optional(),
|
|
287
289
|
ownedServices: z.array(reference('services')).optional(),
|
|
288
290
|
ownedEvents: z.array(reference('events')).optional(),
|
|
@@ -46,6 +46,7 @@ function mapToItem(i: any) {
|
|
|
46
46
|
({
|
|
47
47
|
collection: d.collection,
|
|
48
48
|
data: {
|
|
49
|
+
// @ts-ignore
|
|
49
50
|
id: d.data.id,
|
|
50
51
|
name: d.data.name,
|
|
51
52
|
// @ts-ignore
|
|
@@ -57,6 +58,8 @@ function mapToItem(i: any) {
|
|
|
57
58
|
// @ts-ignore
|
|
58
59
|
ownedCommands: d.data?.ownedCommands?.map(mapToItem) ?? [],
|
|
59
60
|
// @ts-ignore
|
|
61
|
+
ownedQueries: d.data?.ownedQueries?.map(mapToItem) ?? [],
|
|
62
|
+
// @ts-ignore
|
|
60
63
|
ownedEvents: d.data?.ownedEvents?.map(mapToItem) ?? [],
|
|
61
64
|
// @ts-ignore
|
|
62
65
|
ownedServices: d.data?.ownedServices?.map(mapToItem) ?? [],
|
|
@@ -37,6 +37,7 @@ const domains = props.data.ownedDomains as CollectionEntry<'domains'>[];
|
|
|
37
37
|
const services = props.data.ownedServices as CollectionEntry<'services'>[];
|
|
38
38
|
const events = props.data.ownedEvents as CollectionEntry<'events'>[];
|
|
39
39
|
const commands = props.data.ownedCommands as CollectionEntry<'commands'>[];
|
|
40
|
+
const queries = props.data.ownedQueries as CollectionEntry<'queries'>[];
|
|
40
41
|
|
|
41
42
|
const membersList = members.map((o) => ({
|
|
42
43
|
label: o.data.name,
|
|
@@ -68,6 +69,13 @@ const ownedEventsList = [...events, ...commands].map((p) => ({
|
|
|
68
69
|
collection: p.collection,
|
|
69
70
|
tag: `v${p.data.version}`,
|
|
70
71
|
}));
|
|
72
|
+
|
|
73
|
+
const ownedQueriesList = queries.map((p) => ({
|
|
74
|
+
label: `${p.data.name}`,
|
|
75
|
+
href: buildUrl(`/docs/${p.collection}/${p.data.id}/${p.data.version}`),
|
|
76
|
+
collection: p.collection,
|
|
77
|
+
tag: `v${p.data.version}`,
|
|
78
|
+
}));
|
|
71
79
|
---
|
|
72
80
|
|
|
73
81
|
<VerticalSideBarLayout title={`Team | ${props.data.name}`} description={props.data.summary}>
|
|
@@ -153,6 +161,13 @@ const ownedEventsList = [...events, ...commands].map((p) => ({
|
|
|
153
161
|
emptyMessage={`This team does not own any messages .`}
|
|
154
162
|
client:load
|
|
155
163
|
/>
|
|
164
|
+
<PillListFlat
|
|
165
|
+
color="purple"
|
|
166
|
+
title={`Owned queries (${ownedQueriesList.length})`}
|
|
167
|
+
pills={ownedQueriesList}
|
|
168
|
+
emptyMessage={`This team does not own any queries .`}
|
|
169
|
+
client:load
|
|
170
|
+
/>
|
|
156
171
|
<OwnersList
|
|
157
172
|
title={`Team members (${membersList.length})`}
|
|
158
173
|
owners={membersList}
|
|
@@ -33,6 +33,7 @@ const domains = props.data.ownedDomains as CollectionEntry<'domains'>[];
|
|
|
33
33
|
const services = props.data.ownedServices as CollectionEntry<'services'>[];
|
|
34
34
|
const events = props.data.ownedEvents as CollectionEntry<'events'>[];
|
|
35
35
|
const commands = props.data.ownedCommands as CollectionEntry<'commands'>[];
|
|
36
|
+
const queries = props.data.ownedQueries as CollectionEntry<'queries'>[];
|
|
36
37
|
const teams = props.data.associatedTeams as CollectionEntry<'teams'>[];
|
|
37
38
|
|
|
38
39
|
const ownedDomainsList = domains.map((p) => ({
|
|
@@ -49,7 +50,7 @@ const ownedServicesList = services.map((p) => ({
|
|
|
49
50
|
tag: `v${p.data.version}`,
|
|
50
51
|
}));
|
|
51
52
|
|
|
52
|
-
const ownedMessageList = [...events, ...commands].map((p) => ({
|
|
53
|
+
const ownedMessageList = [...events, ...commands, ...queries].map((p) => ({
|
|
53
54
|
label: `${p.data.name}`,
|
|
54
55
|
badge: p.collection,
|
|
55
56
|
color: p.collection === 'events' ? 'orange' : 'blue',
|
|
@@ -23,7 +23,7 @@ export const getTeams = async (): Promise<Team[]> => {
|
|
|
23
23
|
// What do they own?
|
|
24
24
|
const events = await getCollection('events');
|
|
25
25
|
const commands = await getCollection('commands');
|
|
26
|
-
|
|
26
|
+
const queries = await getCollection('queries');
|
|
27
27
|
cachedTeams = teams.map((team) => {
|
|
28
28
|
const ownedDomains = domains.filter((domain) => {
|
|
29
29
|
return domain.data.owners?.find((owner) => owner.id === team.data.id);
|
|
@@ -41,6 +41,10 @@ export const getTeams = async (): Promise<Team[]> => {
|
|
|
41
41
|
return command.data.owners?.find((owner) => owner.id === team.data.id);
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
const ownedQueries = queries.filter((query) => {
|
|
45
|
+
return query.data.owners?.find((owner) => owner.id === team.data.id);
|
|
46
|
+
});
|
|
47
|
+
|
|
44
48
|
return {
|
|
45
49
|
...team,
|
|
46
50
|
data: {
|
|
@@ -48,6 +52,7 @@ export const getTeams = async (): Promise<Team[]> => {
|
|
|
48
52
|
ownedDomains,
|
|
49
53
|
ownedServices,
|
|
50
54
|
ownedCommands,
|
|
55
|
+
ownedQueries,
|
|
51
56
|
ownedEvents,
|
|
52
57
|
},
|
|
53
58
|
catalog: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CollectionTypes } from '@types';
|
|
1
2
|
import { getCollection } from 'astro:content';
|
|
2
3
|
import type { CollectionEntry } from 'astro:content';
|
|
3
4
|
import path from 'path';
|
|
@@ -12,15 +13,10 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
12
13
|
|
|
13
14
|
// What do they own?
|
|
14
15
|
const domains = await getCollection('domains');
|
|
15
|
-
|
|
16
|
-
// What do they own?
|
|
17
16
|
const services = await getCollection('services');
|
|
18
|
-
|
|
19
|
-
// What do they own?
|
|
20
17
|
const events = await getCollection('events');
|
|
21
|
-
|
|
22
|
-
// What do they own?
|
|
23
18
|
const commands = await getCollection('commands');
|
|
19
|
+
const queries = await getCollection('queries');
|
|
24
20
|
|
|
25
21
|
const teams = await getCollection('teams', (team) => {
|
|
26
22
|
return team.data.hidden !== true;
|
|
@@ -35,19 +31,18 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
35
31
|
return domain.data.owners?.find((owner) => owner.id === user.data.id);
|
|
36
32
|
});
|
|
37
33
|
|
|
38
|
-
const isOwnedByUserOrAssociatedTeam = () => {
|
|
39
|
-
const associatedTeamsSlug: string[] = associatedTeams.map((team) => team.
|
|
40
|
-
|
|
41
|
-
return ({ data }: { data: { owners?: Array<{ slug: string }> } }) => {
|
|
42
|
-
return data.owners?.some((owner) => owner.slug === user.data.id || associatedTeamsSlug.includes(owner.slug));
|
|
43
|
-
};
|
|
34
|
+
const isOwnedByUserOrAssociatedTeam = (item: CollectionEntry<CollectionTypes>) => {
|
|
35
|
+
const associatedTeamsSlug: string[] = associatedTeams.map((team) => team.slug);
|
|
36
|
+
return item.data.owners?.some((owner) => owner.id === user.data.id || associatedTeamsSlug.includes(owner.id));
|
|
44
37
|
};
|
|
45
38
|
|
|
46
|
-
const ownedServices = services.filter(
|
|
39
|
+
const ownedServices = services.filter(isOwnedByUserOrAssociatedTeam);
|
|
40
|
+
|
|
41
|
+
const ownedEvents = events.filter(isOwnedByUserOrAssociatedTeam);
|
|
47
42
|
|
|
48
|
-
const
|
|
43
|
+
const ownedCommands = commands.filter(isOwnedByUserOrAssociatedTeam);
|
|
49
44
|
|
|
50
|
-
const
|
|
45
|
+
const ownedQueries = queries.filter(isOwnedByUserOrAssociatedTeam);
|
|
51
46
|
|
|
52
47
|
return {
|
|
53
48
|
...user,
|
|
@@ -57,6 +52,7 @@ export const getUsers = async (): Promise<User[]> => {
|
|
|
57
52
|
ownedServices,
|
|
58
53
|
ownedEvents,
|
|
59
54
|
ownedCommands,
|
|
55
|
+
ownedQueries,
|
|
60
56
|
associatedTeams,
|
|
61
57
|
},
|
|
62
58
|
catalog: {
|