@spotify/backstage-plugin-soundcheck 0.14.5 → 0.15.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.
- package/CHANGELOG.md +31 -0
- package/dist/alpha.d.ts +17 -17
- package/dist/api.esm.js +1 -1
- package/dist/components/Badges/LevelBadge.esm.js +1 -1
- package/dist/components/Badges/StatusBadge.esm.js +2 -0
- package/dist/components/CampaignForm/CampaignForm.esm.js +1 -1
- package/dist/components/CampaignInsightsPage/CampaignInsightsPage.esm.js +1 -1
- package/dist/components/CampaignInsightsPage/CampaignStatusHistoryTile.esm.js +1 -1
- package/dist/components/CampaignInsightsPage/CampaignStatusTile.esm.js +1 -1
- package/dist/components/CampaignInsightsPage/DaysRemainingTile.esm.js +1 -1
- package/dist/components/CampaignsPage/EditCampaignView.esm.js +1 -1
- package/dist/components/CertificationAccordion/CertificationAccordion.esm.js +1 -1
- package/dist/components/CertificationSidebar/CertificationSidebar.esm.js +1 -1
- package/dist/components/CertificationSidebar/CertificationSummary.esm.js +1 -1
- package/dist/components/CertificationSidebar/Check.esm.js +1 -1
- package/dist/components/CertificationSidebar/LevelSummary.esm.js +1 -1
- package/dist/components/CertificationSidebar/StatusDetails.esm.js +2 -0
- package/dist/components/CertificationsPage/CertificationTabs.esm.js +1 -1
- package/dist/components/CertificationsPage/Playlist/PlaylistProgress.esm.js +1 -1
- package/dist/components/Charts/LineChart/LineChartPlaceholder.esm.js +1 -1
- package/dist/components/CheckCard/CheckCard.esm.js +1 -1
- package/dist/components/CheckCard/CheckHistoryChart.esm.js +1 -1
- package/dist/components/CheckDetails/ResultStateBox.esm.js +1 -1
- package/dist/components/CheckForm/FormFields/RuleInput/Conditions/ValueListInput.esm.js +1 -1
- package/dist/components/CheckForm/utils/checkFormUtils.esm.js +1 -1
- package/dist/components/CheckPage/CheckEditPage.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/BigQuery/BigQueryConfigurator.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/BigQuery/QueryFactDetailsComponent.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/BigQuery/css/prism-dark-sql.css.esm.js +260 -0
- package/dist/components/CollectorPage/Configurators/BigQuery/utils.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/BigQuery/validation.esm.js +2 -0
- package/dist/components/CollectorPage/Configurators/Common/CollectorOption.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/CollectorSchedulingOptions.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/FactCollectionConfig.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Common/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Configurator.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Github/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Gitlab/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Kubernetes/KubernetesConfigurator.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/Kubernetes/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/ExistsFactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/FactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/JsonFactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/RegexFactDetailsComponent.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/ScmConfigurator.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/utils.esm.js +1 -1
- package/dist/components/CollectorPage/Configurators/SCM/validation.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorListPage/CollectorLogo.esm.js +1 -1
- package/dist/components/CollectorsPage/CollectorListPage/CollectorSummaryCard.esm.js +1 -1
- package/dist/components/EntitySoundcheckCard/Card.esm.js +1 -1
- package/dist/components/Filter/EntityAutocompletePicker.esm.js +1 -1
- package/dist/components/Filter/FilterComponent.esm.js +1 -1
- package/dist/components/Filter/FilterPreviewTable/EntityTableColumns.esm.js +1 -1
- package/dist/components/Filter/FilterPreviewTable/FilterPreviewTable.esm.js +1 -1
- package/dist/components/Filter/types.esm.js +1 -1
- package/dist/components/Filter/utils.esm.js +1 -1
- package/dist/components/FormControlledSelect/FormControlledSelect.esm.js +2 -0
- package/dist/components/FormFilterSection/FormFilterSection.esm.js +1 -1
- package/dist/components/Frequency/FrequencyComponent.esm.js +1 -1
- package/dist/components/Frequency/util.esm.js +1 -1
- package/dist/components/LevelCard/LevelCard.esm.js +1 -1
- package/dist/components/LevelCard/LevelTooltip.esm.js +1 -1
- package/dist/components/OverviewTable/Cell/TrackBadgeCell.esm.js +2 -0
- package/dist/components/OverviewTable/Cell/cellRenderer.esm.js +1 -1
- package/dist/components/OverviewTable/ResultsTableRow.esm.js +1 -1
- package/dist/components/OverviewTable/resultsTableUtils.esm.js +1 -1
- package/dist/components/PassRateGrid/PassRateMetadata.esm.js +1 -1
- package/dist/components/RoutingPage/RoutingPage.esm.js +1 -1
- package/dist/components/SoundcheckHeader/SoundcheckHeader.esm.js +1 -1
- package/dist/components/SummaryCard/SummaryCard.esm.js +1 -1
- package/dist/components/TechHealth/Filters/FacetFilter.esm.js +1 -1
- package/dist/components/TrackEditPage/TrackEditPage.esm.js +1 -1
- package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackBadgeTypeSelect/TrackBadgeTypeSelect.esm.js +2 -0
- package/dist/components/TrackForm/Steps/TrackDetailsStep/TrackDetailsStep.esm.js +1 -1
- package/dist/components/TrackForm/utils/useTrackForm.esm.js +1 -1
- package/dist/components/TrackPage/TrackHistoryChart.esm.js +1 -1
- package/dist/components/TrackPage/TrackLevelsChart.esm.js +1 -1
- package/dist/graphql/generated/index.esm.js +141 -109
- package/dist/hooks/aggregations/useCheckStatusHistories.esm.js +2 -0
- package/dist/hooks/aggregations/useCheckStatuses.esm.js +2 -0
- package/dist/hooks/graphqlKeys.esm.js +1 -1
- package/dist/images/bigquery-rgb.svg +15 -0
- package/dist/images/bigquery-white.svg +15 -0
- package/dist/node_modules_dist/style-inject/dist/style-inject.es.esm.js +2 -0
- package/package.json +25 -22
- package/dist/components/CheckPage/CheckDetailsView.esm.js +0 -2
- package/dist/components/CheckPage/CheckPage.esm.js +0 -2
- package/dist/components/CollectorPage/Configurators/SCM/FactCollectionConfig.esm.js +0 -2
- package/dist/components/Filter/FilterPreviewTable/EntityKindsFilter.esm.js +0 -2
- package/dist/components/Filter/FilterPreviewTable/EntitySystemsFilter.esm.js +0 -2
- package/dist/components/Filter/FilterPreviewTable/EntityTableToolbar.esm.js +0 -2
- package/dist/components/Filter/FilterPreviewTable/EntityTagFilter.esm.js +0 -2
- package/dist/components/OverviewTable/Cell/HighestLevelBadge.esm.js +0 -2
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import e from"../../../../../node_modules_dist/style-inject/dist/style-inject.es.esm.js";var n=`/**
|
|
2
|
+
* prism.js Dark theme for JavaScript, CSS and HTML
|
|
3
|
+
* Based on the slides of the talk \u201C/Reg(exp){2}lained/\u201D
|
|
4
|
+
* @author Lea Verou
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
code[class*='language-sql'],
|
|
8
|
+
pre[class*='language-sql'] {
|
|
9
|
+
color: white;
|
|
10
|
+
background: none;
|
|
11
|
+
text-shadow: 0 -0.1em 0.2em black;
|
|
12
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
13
|
+
font-size: 1em;
|
|
14
|
+
text-align: left;
|
|
15
|
+
white-space: pre;
|
|
16
|
+
word-spacing: normal;
|
|
17
|
+
word-break: normal;
|
|
18
|
+
word-wrap: normal;
|
|
19
|
+
line-height: 1.5;
|
|
20
|
+
|
|
21
|
+
-moz-tab-size: 4;
|
|
22
|
+
-o-tab-size: 4;
|
|
23
|
+
tab-size: 4;
|
|
24
|
+
|
|
25
|
+
-webkit-hyphens: none;
|
|
26
|
+
-moz-hyphens: none;
|
|
27
|
+
-ms-hyphens: none;
|
|
28
|
+
hyphens: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@media print {
|
|
32
|
+
code[class*='language-sql'],
|
|
33
|
+
pre[class*='language-sql'] {
|
|
34
|
+
text-shadow: none;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
pre[class*='language-sql'],
|
|
39
|
+
:not(pre) > code[class*='language-sql'] {
|
|
40
|
+
background: hsl(30, 20%, 25%);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Code blocks */
|
|
44
|
+
pre[class*='language-sql'] {
|
|
45
|
+
padding: 1em;
|
|
46
|
+
margin: 0.5em 0;
|
|
47
|
+
overflow: auto;
|
|
48
|
+
border: 0.3em solid hsl(30, 20%, 40%);
|
|
49
|
+
border-radius: 0.5em;
|
|
50
|
+
box-shadow: 1px 1px 0.5em black inset;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* Inline code */
|
|
54
|
+
:not(pre) > code[class*='language-sql'] {
|
|
55
|
+
padding: 0.15em 0.2em 0.05em;
|
|
56
|
+
border-radius: 0.3em;
|
|
57
|
+
border: 0.13em solid hsl(30, 20%, 40%);
|
|
58
|
+
box-shadow: 1px 1px 0.3em -0.1em black inset;
|
|
59
|
+
white-space: normal;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.token.comment,
|
|
63
|
+
.token.prolog,
|
|
64
|
+
.token.doctype,
|
|
65
|
+
.token.cdata {
|
|
66
|
+
color: hsl(30, 20%, 50%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.token.punctuation {
|
|
70
|
+
opacity: 0.7;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.token.namespace {
|
|
74
|
+
opacity: 0.7;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.token.property,
|
|
78
|
+
.token.tag,
|
|
79
|
+
.token.boolean,
|
|
80
|
+
.token.number,
|
|
81
|
+
.token.constant,
|
|
82
|
+
.token.symbol {
|
|
83
|
+
color: hsl(350, 40%, 70%);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.token.selector,
|
|
87
|
+
.token.attr-name,
|
|
88
|
+
.token.string,
|
|
89
|
+
.token.char,
|
|
90
|
+
.token.builtin,
|
|
91
|
+
.token.inserted {
|
|
92
|
+
color: hsl(75, 70%, 60%);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.token.operator,
|
|
96
|
+
.token.entity,
|
|
97
|
+
.token.url,
|
|
98
|
+
.language-css .token.string,
|
|
99
|
+
.style .token.string,
|
|
100
|
+
.token.variable {
|
|
101
|
+
color: hsl(40, 90%, 60%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.token.atrule,
|
|
105
|
+
.token.attr-value,
|
|
106
|
+
.token.keyword {
|
|
107
|
+
color: hsl(350, 40%, 70%);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.token.regex,
|
|
111
|
+
.token.important {
|
|
112
|
+
color: #e90;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.token.important,
|
|
116
|
+
.token.bold {
|
|
117
|
+
font-weight: bold;
|
|
118
|
+
}
|
|
119
|
+
.token.italic {
|
|
120
|
+
font-style: italic;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.token.entity {
|
|
124
|
+
cursor: help;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.token.deleted {
|
|
128
|
+
color: red;
|
|
129
|
+
}
|
|
130
|
+
`,o=`/**
|
|
131
|
+
* prism.js Dark theme for JavaScript, CSS and HTML
|
|
132
|
+
* Based on the slides of the talk \u201C/Reg(exp){2}lained/\u201D
|
|
133
|
+
* @author Lea Verou
|
|
134
|
+
*/
|
|
135
|
+
|
|
136
|
+
code[class*='language-sql'],
|
|
137
|
+
pre[class*='language-sql'] {
|
|
138
|
+
color: white;
|
|
139
|
+
background: none;
|
|
140
|
+
text-shadow: 0 -0.1em 0.2em black;
|
|
141
|
+
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
142
|
+
font-size: 1em;
|
|
143
|
+
text-align: left;
|
|
144
|
+
white-space: pre;
|
|
145
|
+
word-spacing: normal;
|
|
146
|
+
word-break: normal;
|
|
147
|
+
word-wrap: normal;
|
|
148
|
+
line-height: 1.5;
|
|
149
|
+
|
|
150
|
+
-moz-tab-size: 4;
|
|
151
|
+
-o-tab-size: 4;
|
|
152
|
+
tab-size: 4;
|
|
153
|
+
|
|
154
|
+
-webkit-hyphens: none;
|
|
155
|
+
-moz-hyphens: none;
|
|
156
|
+
-ms-hyphens: none;
|
|
157
|
+
hyphens: none;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
@media print {
|
|
161
|
+
code[class*='language-sql'],
|
|
162
|
+
pre[class*='language-sql'] {
|
|
163
|
+
text-shadow: none;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
pre[class*='language-sql'],
|
|
168
|
+
:not(pre) > code[class*='language-sql'] {
|
|
169
|
+
background: hsl(30, 20%, 25%);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* Code blocks */
|
|
173
|
+
pre[class*='language-sql'] {
|
|
174
|
+
padding: 1em;
|
|
175
|
+
margin: 0.5em 0;
|
|
176
|
+
overflow: auto;
|
|
177
|
+
border: 0.3em solid hsl(30, 20%, 40%);
|
|
178
|
+
border-radius: 0.5em;
|
|
179
|
+
box-shadow: 1px 1px 0.5em black inset;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Inline code */
|
|
183
|
+
:not(pre) > code[class*='language-sql'] {
|
|
184
|
+
padding: 0.15em 0.2em 0.05em;
|
|
185
|
+
border-radius: 0.3em;
|
|
186
|
+
border: 0.13em solid hsl(30, 20%, 40%);
|
|
187
|
+
box-shadow: 1px 1px 0.3em -0.1em black inset;
|
|
188
|
+
white-space: normal;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.token.comment,
|
|
192
|
+
.token.prolog,
|
|
193
|
+
.token.doctype,
|
|
194
|
+
.token.cdata {
|
|
195
|
+
color: hsl(30, 20%, 50%);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
.token.punctuation {
|
|
199
|
+
opacity: 0.7;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.token.namespace {
|
|
203
|
+
opacity: 0.7;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.token.property,
|
|
207
|
+
.token.tag,
|
|
208
|
+
.token.boolean,
|
|
209
|
+
.token.number,
|
|
210
|
+
.token.constant,
|
|
211
|
+
.token.symbol {
|
|
212
|
+
color: hsl(350, 40%, 70%);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.token.selector,
|
|
216
|
+
.token.attr-name,
|
|
217
|
+
.token.string,
|
|
218
|
+
.token.char,
|
|
219
|
+
.token.builtin,
|
|
220
|
+
.token.inserted {
|
|
221
|
+
color: hsl(75, 70%, 60%);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.token.operator,
|
|
225
|
+
.token.entity,
|
|
226
|
+
.token.url,
|
|
227
|
+
.language-css .token.string,
|
|
228
|
+
.style .token.string,
|
|
229
|
+
.token.variable {
|
|
230
|
+
color: hsl(40, 90%, 60%);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.token.atrule,
|
|
234
|
+
.token.attr-value,
|
|
235
|
+
.token.keyword {
|
|
236
|
+
color: hsl(350, 40%, 70%);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.token.regex,
|
|
240
|
+
.token.important {
|
|
241
|
+
color: #e90;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.token.important,
|
|
245
|
+
.token.bold {
|
|
246
|
+
font-weight: bold;
|
|
247
|
+
}
|
|
248
|
+
.token.italic {
|
|
249
|
+
font-style: italic;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.token.entity {
|
|
253
|
+
cursor: help;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.token.deleted {
|
|
257
|
+
color: red;
|
|
258
|
+
}
|
|
259
|
+
`;e(n);export{n as default,o as stylesheet};
|
|
260
|
+
//# sourceMappingURL=prism-dark-sql.css.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{asArray as u}from"@spotify/backstage-plugin-soundcheck-common";import{defaultBaseCollectorOption as p}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as g,mapFormIntegrationConfigToBackendConfig as E}from"../Common/utils.esm.js";const i="query",C=[{value:"string",label:"STRING"},{value:"number",label:"NUMBER"},{value:"integer",label:"INTEGER"},{value:"boolean",label:"BOOLEAN"},{value:"object",label:"OBJECT"}],r="no",c="entity_ref",f="entity_name",d=[{value:r,label:"no"},{value:c,label:"Entity(entity_ref)"},{value:f,label:"Entity(metadata.name)"}],s={name:"",type:"string",foreignKey:r};function T(t){return t.isEntityRef?c:t.isEntityName?f:r}const m=(t,n)=>({...p(),factDetails:{factName:t??"",query:n??"",schema:[s]}}),y=()=>({query:{enabled:!1,collectors:[m(i)]}});function b(t){const{query:n}=t;if(n.enabled){const o={},l=[];return o.collects=l,n.collectors.forEach(e=>{l.push(E({factType:i,configOption:e,additionalParams:{factName:e.factDetails.factName,projectId:e.factDetails.projectId?.length?e.factDetails.projectId:void 0,query:e.factDetails.query,schema:e.factDetails.schema?.length?e.factDetails.schema.map(a=>({name:a.name,type:a.type,isEntityRef:a.foreignKey===c?!0:void 0,isEntityName:a.foreignKey===f?!0:void 0})):void 0}}))}),o}return{collects:[]}}function N(t){const n=y();if(t){const o=t.collects;if(o){const l=u(o).filter(e=>e.type===i);l.length&&(n.query={enabled:!0,collectors:l.map(e=>({...g({parentConfig:t,factTypeConfig:e}),factDetails:{factName:e.factName,projectId:e.projectId,query:e.query.trim(),schema:e.schema?.map(a=>({name:a.name,type:a.type,foreignKey:T(a)}))}}))})}}return n}export{C as DATA_TYPES,s as DEFAULT_SCHEMA_ITEM,d as FOREIGN_KEY_OPTIONS,i as QUERY_COLLECTOR_TYPE,y as defaultBigQueryConfig,b as mapBigQueryCollectorConfigToConfig,N as mapConfigToBigQueryCollectorConfig,m as queryCollectorConfig};
|
|
2
|
+
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{validNameRegex as c}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FIELD_IS_REQUIRED_MSG as a}from"../../../../utils/validation.esm.js";import{BaseCollectorSchema as d}from"../Common/CollectorOption.esm.js";const l="Fact name is not unique",r="The field contains forbidden characters",i="Max 100 characters",g=d.extend({factDetails:e.strictObject({factName:e.string().min(1,a).max(100,i).regex(c,r),projectId:e.string().optional(),query:e.string().min(1,a),schema:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(c,r),type:e.string().min(1,a).max(100,i).regex(c,r).optional(),foreignKey:e.string().optional()})).optional()})}).strict(),p=e.strictObject({enabled:e.boolean(),collectors:e.array(g).superRefine((s,f)=>{const n=s.map(t=>t.factDetails.factName),m=n.filter((t,o)=>n.indexOf(t)!==o);m.length&&s.forEach((t,o)=>{m.includes(t.factDetails.factName)&&f.addIssue({code:e.ZodIssueCode.custom,message:l,path:[o,"factDetails","factName"]})})})}),_=e.strictObject({query:p});export{l as FACT_NAME_IS_NOT_UNIQUE_MSG,r as INVALID_CHARACTERS_MSG,i as MAX_100_CHARACTERS_MSG,_ as bigQueryCollectorFormSchema};
|
|
2
|
+
//# sourceMappingURL=validation.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z as
|
|
1
|
+
import{z as t}from"zod";import{FrequencySchema as o,FiltersSchema as l,CacheConfigSchema as c}from"../../../../utils/validation.esm.js";import{mapToCacheConfig as n,defaultCacheConfig as m}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as f}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import{emptyFilters as p}from"../../../Filter/types.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as i,defaultFrequency as h}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";const a=(e={})=>({filters:e?.filter&&typeof e.filter=="object"?f(e.filter):{...p(),selectedKinds:["Component"]},frequency:e?.frequency?i(e.frequency):h(),cacheConfig:e?.cache?n(e.cache):m(),batchSize:e?.batchSize,initialDelay:e?.initialDelay?i(e.initialDelay):void 0}),u=(e={})=>({enabled:!1,...a(e)}),r=t.object({frequency:o,filters:l,cacheConfig:c,initialDelay:o.optional(),batchSize:t.number().min(1,"Batch size should be at least 1").optional().nullable()}),C=r.extend({enabled:t.boolean()}).strict();export{r as BaseCollectorSchema,C as CollectorOptionSchema,a as defaultBaseCollectorOption,u as defaultCollectorOption};
|
|
2
2
|
//# sourceMappingURL=CollectorOption.esm.js.map
|
package/dist/components/CollectorPage/Configurators/Common/CollectorSchedulingOptions.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as T,Box as n,Typography as s,Divider as b,Button as D,TextField as S}from"@material-ui/core";import e,{useCallback as h}from"react";import{useFormContext as B,Controller as d}from"react-hook-form";import{validateFrequency as g}from"../../../../utils/frequency.esm.js";import{FormFieldLabel as p}from"../../../FormFieldLabel/FormFieldLabel.esm.js";import"../../../Frequency/types.esm.js";import{defaultInitialDelay as F}from"../../../Frequency/util.esm.js";import{FrequencyComponent as v}from"../../../Frequency/FrequencyComponent.esm.js";const $=T(a=>({root:{borderTop:`1px solid ${a.palette.divider}`},divider:{marginTop:a.spacing(3),marginBottom:a.spacing(3)}})),x=({name:a,disabled:i})=>{const u=$(),{control:c,setValue:o,watch:f}=B(),E=h(()=>{o(`${a}.initialDelay`,F())},[a,o]),y=h(()=>{o(`${a}.initialDelay`,void 0)},[a,o]),m=f(`${a}.initialDelay`);return e.createElement(e.Fragment,null,e.createElement(n,{marginBottom:2},e.createElement(p,{title:"Schedule For Automatic Collection"}),e.createElement(s,{variant:"caption"},"Checks that depend on this fact are automatically updated when the facts are collected.")),e.createElement(d,{name:`${a}.frequency`,control:c,rules:{validate:g},render:({field:t,fieldState:{error:r}})=>e.createElement(v,{disabled:i,value:t.value,onChange:t.onChange,errors:r})}),e.createElement(b,{className:u.divider}),e.createElement(n,{marginBottom:2,marginTop:2},e.createElement(p,{title:"Initial Delay (Optional)"}),e.createElement(s,{variant:"caption"},"The collection will start after the initial delay when soundcheck starts up."),m&&e.createElement(n,{marginTop:2,marginBottom:3},e.createElement(d,{name:`${a}.initialDelay`,control:c,rules:{validate:t=>t?g(t):!0},render:({field:t,fieldState:{error:r}})=>e.createElement(v,{disabled:i,value:t.value,onChange:t.onChange,errors:r,intervalTitle:"Start after a set interval",intervalDescription:"Collection will start when soundcheck starts up after the set interval.",intervalLabel:"After",cronTitle:"Start on a cron schedule",cronDescription:"Set a specific start schedule using a cron expression."})})),e.createElement(n,{marginTop:2},e.createElement(D,{variant:"outlined",size:"small",onClick:m?y:E},m?"Remove":"Add"," Initial Delay"))),e.createElement(n,{marginTop:3,paddingTop:2,paddingBottom:2,className:u.root},e.createElement(p,{title:"Batch Size (Optional)"}),e.createElement(s,{variant:"caption"},"Modifies the batch size that the collector uses. In general this option should not be changed and can affect rate limits."),e.createElement(n,{marginTop:1},e.createElement(d,{name:`${a}.batchSize`,control:c,render:({field:t,fieldState:r})=>e.createElement(S,{...t,onChange:l=>{if(l.target.value){const C=parseInt(l.target.value,10)??null;t.onChange({...l,target:{...l.target,value:C}})}else t.onChange({...l,target:{...l.target,value:null}})},placeholder:"Default: 1",value:t.value??void 0,type:"number",variant:"outlined",margin:"dense",disabled:i,error:!!r.error,helperText:r.error?.message})}))))};export{x as CollectorSchedulingOptions};
|
|
2
2
|
//# sourceMappingURL=CollectorSchedulingOptions.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as G,FormControlLabel as R,Switch as L,Box as O,Typography as $,Divider as P,Tabs as V,Tab as d,Grid as g,Button as y}from"@material-ui/core";import W from"@material-ui/icons/Add";import Z from"@material-ui/icons/Remove";import e,{useState as j}from"react";import{useFormContext as q,useFieldArray as H,useWatch as J,Controller as C}from"react-hook-form";import{validateCacheConfig as K}from"../../../../utils/collectors.esm.js";import"lodash";import"../../../Frequency/types.esm.js";import"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";import{CacheConfigComponent as M}from"../../../CacheConfig/CacheConfigComponent.esm.js";import"@backstage/catalog-model";import"@spotify/backstage-plugin-soundcheck-common";import{FilterComponent as Q}from"../../../Filter/FilterComponent.esm.js";import{CollectorSchedulingOptions as U}from"./CollectorSchedulingOptions.esm.js";const X=G(t=>({root:{padding:t.spacing(1.5,6)},tabsContainer:{marginRight:16},tab:{height:"64px",textAlign:"left"},contentContainer:{width:"100%",padding:t.spacing(1)},divider:{marginTop:t.spacing(1),marginBottom:t.spacing(1)},switchTrack:{backgroundColor:`${t.palette.primary.main} !important`},buttonsContainer:{marginTop:t.spacing(1),marginBottom:t.spacing(2)}})),u="FactDetails",f="Schedule",F="Filters",k="Caching",Y=({name:t,label:h,description:x,disabled:i,FactDetailsComponent:s,multipleCollectors:c})=>{const{control:m,formState:N}=q(),E=N.errors?.[t],{fields:S,insert:D,remove:T}=H({control:m,name:c?.enable?`${t}.collectors`:t}),p=c?.enable?S:[{id:t}],v=s?u:f,[n,b]=j(Array(p.length).fill(v)),w=(l,a,r)=>{b([...n.slice(0,r),a,...n.slice(r+1)])},A=l=>{D(l+1,c?.defaultConfig),b([...n.slice(0,l+1),v,...n.slice(l+1)])},B=l=>{T(l),b([...n.slice(0,l),...n.slice(l+1)])},z=J({control:m,name:`${t}.enabled`}),o=X();return e.createElement("div",{className:o.root},e.createElement(C,{name:`${t}.enabled`,control:m,render:({field:l})=>e.createElement(R,{control:e.createElement(L,{...l,checked:l.value,"data-testid":`${t}-switch`,classes:{track:l.value?o.switchTrack:void 0},disabled:i}),label:e.createElement(O,{display:"flex",flexDirection:"column"},e.createElement($,{variant:"body1",component:"span"},e.createElement("b",null,`${h}`)),e.createElement($,{variant:"caption",color:"textSecondary",component:"p"},`${x}`))})}),z&&e.createElement("div",null,p.map((l,a)=>e.createElement("div",{key:l.id},a!==0&&e.createElement(P,{className:o.divider}),e.createElement(V,{orientation:"horizontal",variant:"scrollable",value:n[a],onChange:(r,I)=>w(r,I,a),className:o.tabsContainer},s&&e.createElement(d,{label:"Fact Details",value:u,className:o.tab}),e.createElement(d,{label:"Schedule",value:f,className:o.tab}),e.createElement(d,{label:"Filters",value:F,className:o.tab}),e.createElement(d,{label:"Caching",value:k,className:o.tab})),e.createElement("div",{className:o.contentContainer},n[a]===u&&s&&e.createElement(s,{name:c?.enable?`${t}.collectors.${a}.factDetails`:`${t}.factDetails`,disabled:i}),n[a]===f&&e.createElement(e.Fragment,null,e.createElement(U,{name:c?.enable?`${t}.collectors.${a}`:t})),n[a]===F&&e.createElement(C,{name:c?.enable?`${t}.collectors.${a}.filters`:`${t}.filters`,control:m,render:({field:r})=>e.createElement(Q,{disabled:i,value:r.value,onChange:r.onChange})}),n[a]===k&&e.createElement(C,{name:c?.enable?`${t}.collectors.${a}.cacheConfig`:`${t}.cacheConfig`,control:m,rules:{validate:K},render:({field:r})=>e.createElement(M,{disabled:i,value:r.value,onChange:r.onChange,errors:c?.enable?E?.collectors?.[a]?.cacheConfig:E?.cacheConfig})})),c?.enable&&e.createElement(g,{container:!0,spacing:1,className:o.buttonsContainer},p.length>1&&e.createElement(g,{item:!0},e.createElement(y,{startIcon:e.createElement(Z,null),onClick:()=>B(a),disabled:i,variant:"outlined",size:"small",color:"secondary"},"Remove")),e.createElement(g,{item:!0},e.createElement(y,{startIcon:e.createElement(W,null),onClick:()=>A(a),disabled:i,variant:"outlined",size:"small",color:"primary"},"Add ",h)))))))};export{Y as FactCollectionConfig};
|
|
2
2
|
//# sourceMappingURL=FactCollectionConfig.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{mapToCacheConfig as
|
|
1
|
+
import{mapToCacheConfig as n,mapCacheConfigToHumanDurationOrBoolean as r}from"../../../CacheConfig/utils.esm.js";import"../../../CacheConfig/CacheConfigComponent.esm.js";import{mapCatalogFilterToFilters as c,mapFiltersToCatalogFilter as l}from"../../../Filter/utils.esm.js";import"../../../Filter/FilterComponent.esm.js";import"../../../Frequency/types.esm.js";import{mapHumanDurationOrCronToFrequency as a,mapFrequencyToHumanDurationOrCron as e}from"../../../Frequency/util.esm.js";import"../../../Frequency/FrequencyComponent.esm.js";const p=i=>({title:i.name??i.id,description:i.description,docLink:`https://backstage.spotify.com/docs/plugins/soundcheck/core-concepts/fact-collectors/3p-integrations/${i.id}`}),f=i=>({title:"Update Integration",message:`Are you sure you want to update the ${i.name} integration?`,error:!1}),m=({configOption:i,factType:o,additionalParams:t={}})=>({type:o,frequency:e(i.frequency),filter:l(i.filters),cache:r(i.cacheConfig),batchSize:i.batchSize??void 0,initialDelay:i.initialDelay?e(i.initialDelay):void 0,...t}),g=({parentConfig:i,factTypeConfig:o})=>{const t=o.initialDelay??i.initialDelay;return{frequency:a(o.frequency??i.frequency),filters:c(o.filter??i.filter),cacheConfig:n(o.cache??i.cache),batchSize:o.batchSize??i.batchSize,initialDelay:t?a(t):void 0}};export{p as collectorHeaderContent,f as confirmationModalContent,g as mapBackendConfigToFormIntegrationConfig,m as mapFormIntegrationConfigToBackendConfig};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import t from"react";import{DataDogConfigurator as e}from"./DataDog/DataDogConfigurator.esm.js";import{GithubConfigurator as
|
|
1
|
+
import t from"react";import{BigQueryConfigurator as i}from"./BigQuery/BigQueryConfigurator.esm.js";import{DataDogConfigurator as e}from"./DataDog/DataDogConfigurator.esm.js";import{GithubConfigurator as m}from"./Github/GithubConfigurator.esm.js";import{GitlabConfigurator as a}from"./Gitlab/GitlabConfigurator.esm.js";import{JiraConfigurator as f}from"./Jira/JiraConfigurator.esm.js";import{KubernetesConfigurator as u}from"./Kubernetes/KubernetesConfigurator.esm.js";import{NewRelicConfigurator as n}from"./NewRelic/NewRelicConfigurator.esm.js";import{PagerDutyConfigurator as g}from"./PagerDuty/PagerDutyConfigurator.esm.js";import{ScmConfigurator as p}from"./SCM/ScmConfigurator.esm.js";import{SonarQubeConfigurator as C}from"./SonarQube/SonarQubeConfigurator.esm.js";const c={github:m,gitlab:a,scm:p,pagerduty:g,datadog:e,kubernetes:u,jira:f,sonarqube:C,newrelic:n,bigquery:i},l=({selectedCollector:r})=>{const o=c[r?.id];return t.createElement(o,{selectedCollector:r})};export{l as Configurator};
|
|
2
2
|
//# sourceMappingURL=Configurator.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asArray as u}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as s}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as d,mapFormIntegrationConfigToBackendConfig as c}from"../Common/utils.esm.js";const l="BranchProtections",f="BranchRules",p="RepositoryDetails",g="RepositoryLanguages",C=
|
|
1
|
+
import{asArray as u}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as s}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as d,mapFormIntegrationConfigToBackendConfig as c}from"../Common/utils.esm.js";const l="BranchProtections",f="BranchRules",p="RepositoryDetails",g="RepositoryLanguages",C=o=>({branchProtections:s(o),branchRules:s(o),repositoryDetails:s(o),repositoryLanguages:s(o)});function T(o){const{branchProtections:a,branchRules:n,repositoryDetails:r,repositoryLanguages:t}=o;if(a.enabled||n.enabled||r.enabled||t.enabled){const e={},i=[];return e.collects=i,a.enabled&&i.push(c({factType:l,configOption:a,additionalParams:{factName:"branch_protections"}})),n.enabled&&i.push(c({factType:f,configOption:n,additionalParams:{factName:"branch_rules"}})),r.enabled&&i.push(c({factType:p,configOption:r,additionalParams:{factName:"repository_details"}})),t.enabled&&i.push(c({factType:g,configOption:t,additionalParams:{factName:"repository_languages"}})),e}return{collects:[]}}function b(o){const a=C(o);if(o){const n=o.collects;if(n)for(const r of u(n)){const t=r.type,e={...d({parentConfig:o,factTypeConfig:r}),enabled:!0};t===l&&(a.branchProtections=e),t===f&&(a.branchRules=e),t===p&&(a.repositoryDetails=e),t===g&&(a.repositoryLanguages=e)}}return a}export{l as BRANCH_PROTECTIONS_COLLECTOR_TYPE,f as BRANCH_RULES_COLLECTOR_TYPE,p as REPOSITORY_DETAILS_COLLECTOR_TYPE,g as REPOSITORY_LANGUAGES_COLLECTOR_TYPE,C as defaultGithubConfig,b as mapConfigToGithubCollectorConfig,T as mapGithubCollectorConfigToConfig};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asArray as g}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as r}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as C,mapFormIntegrationConfigToBackendConfig as i}from"../Common/utils.esm.js";const f="branch_protections",p="project_details",l="project_languages",s=
|
|
1
|
+
import{asArray as g}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as r}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as C,mapFormIntegrationConfigToBackendConfig as i}from"../Common/utils.esm.js";const f="branch_protections",p="project_details",l="project_languages",s=o=>({branchProtections:r(o),projectDetails:r(o),projectLanguages:r(o)});function T(o){const{branchProtections:t,projectDetails:e,projectLanguages:c}=o;if(t.enabled||e.enabled||c.enabled){const a={},n=[];return a.collects=n,t.enabled&&n.push(i({factType:f,configOption:t})),e.enabled&&n.push(i({factType:p,configOption:e})),c.enabled&&n.push(i({factType:l,configOption:c})),a}return{collects:[]}}function b(o){const t=s(o);if(o){const e=o.collects;if(e)for(const c of g(e)){const a=c.type,n={...C({parentConfig:o,factTypeConfig:c}),enabled:!0};a===f&&(t.branchProtections=n),a===p&&(t.projectDetails=n),a===l&&(t.projectLanguages=n)}}return t}export{f as BRANCH_PROTECTIONS_COLLECTOR_TYPE,p as PROJECT_DETAILS_COLLECTOR_TYPE,l as PROJECT_LANGUAGES_COLLECTOR_TYPE,s as defaultGitlabConfig,b as mapConfigToGitlabCollectorConfig,T as mapGitlabCollectorConfigToConfig};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
package/dist/components/CollectorPage/Configurators/Kubernetes/KubernetesConfigurator.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{zodResolver as g}from"@hookform/resolvers/zod";import{makeStyles as b,Paper as E,Divider as S}from"@material-ui/core";import e from"react";import{useForm as v,FormProvider as h}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as F}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as R}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as K}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as w}from"../../../../routes.esm.js";import{FooterButtons as y}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as k}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as s}from"../Common/FactCollectionConfig.esm.js";import{defaultCollectorOption as B}from"../Common/CollectorOption.esm.js";import{collectorHeaderContent as D,confirmationModalContent as L}from"../Common/utils.esm.js";import{KubernetesFactDetails as O}from"./KubernetesFactDetails.esm.js";import{mapConfigToKubernetesCollectorConfig as T,defaultKubernetesConfig as H,K8S_COLLECTOR_FIELDS as M,mapKubernetesCollectorConfigToConfig as N}from"./utils.esm.js";import{customResourceFormSchema as P}from"./validation.esm.js";const x=b(
|
|
1
|
+
import{zodResolver as g}from"@hookform/resolvers/zod";import{makeStyles as b,Paper as E,Divider as S}from"@material-ui/core";import e from"react";import{useForm as v,FormProvider as h}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as F}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as R}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as K}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as w}from"../../../../routes.esm.js";import{FooterButtons as y}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as k}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as s}from"../Common/FactCollectionConfig.esm.js";import{defaultCollectorOption as B}from"../Common/CollectorOption.esm.js";import{collectorHeaderContent as D,confirmationModalContent as L}from"../Common/utils.esm.js";import{KubernetesFactDetails as O}from"./KubernetesFactDetails.esm.js";import{mapConfigToKubernetesCollectorConfig as T,defaultKubernetesConfig as H,K8S_COLLECTOR_FIELDS as M,mapKubernetesCollectorConfigToConfig as N}from"./utils.esm.js";import{customResourceFormSchema as P}from"./validation.esm.js";const x=b(t=>({spacer:{height:t.spacing(8),width:"100%"},section:{marginBottom:t.spacing(2)}})),I=({disabled:t,selectedCollector:o})=>{const r=v({defaultValues:o?T(o.config):H(),mode:"onChange",resolver:g(P)}),a=x(),{mutateAsync:c}=K(),[p,f]=R(w),{isValid:u}=r.formState,{showModal:d}=F(),n=async m=>{if(!await d(L(o)))return;const i=N(m);await c({collectorId:o.id,config:i})&&f()};return k(D(o)),e.createElement(e.Fragment,null,e.createElement(E,{className:a.section},e.createElement(h,{...r},e.createElement("form",{onSubmit:r.handleSubmit(n)},Object.entries(M).map(([m,i],l,C)=>e.createElement("div",{key:l},e.createElement(s,{name:m,label:i.label,description:i.description,disabled:t}),l<C.length-1&&e.createElement(S,null))),e.createElement(s,{name:"customResources",label:"Custom Resources",description:"Collect facts from a kubernetes custom resource associated with an entity.",disabled:t,FactDetailsComponent:O,multipleCollectors:{enable:!0,defaultConfig:B(o.config)}})))),e.createElement("div",{className:a.section},e.createElement(y,{onCancel:p,saveButtonText:"Save",isLoading:!1,onSave:r.handleSubmit(n),disableSave:!u})))};export{I as KubernetesConfigurator};
|
|
2
2
|
//# sourceMappingURL=KubernetesConfigurator.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asArray as g}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as
|
|
1
|
+
import{asArray as g}from"@spotify/backstage-plugin-soundcheck-common";import{defaultCollectorOption as o}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as p,mapFormIntegrationConfigToBackendConfig as d}from"../Common/utils.esm.js";import{K8S_CUSTOM_RESOURCE as f}from"./types.esm.js";const r={pods:{type:"k8s_pods",label:"Pods",description:"Collects details about kubernetes pods associated with an entity."},services:{type:"k8s_services",label:"Services",description:"Collects details about kubernetes services associated with an entity."},deployments:{type:"k8s_deployments",label:"Deployments",description:"Collects details about kubernetes deployments associated with an entity."},hpas:{type:"k8s_hpas",label:"Horizontal Pod Autoscalers",description:"Collects details about kubernetes horizontal pod autoscalers associated with an entity."},statefulSets:{type:"k8s_stateful_sets",label:"Stateful Sets",description:"Collects details about kubernetes stateful sets associated with an entity."},podDisruptionBudgets:{type:"k8s_pod_disruption_budgets",label:"Pod Disruption Budgets",description:"Collects details about kubernetes pod disruption budgets associated with an entity."},ingresses:{type:"k8s_ingresses",label:"Ingresses",description:"Collects details about kubernetes ingresses associated with an entity."}},u=e=>({...o(e),factDetails:{factName:"custom-resource",customResource:{group:"",plural:"",apiVersion:""}}}),m=e=>({pods:o(e),services:o(e),deployments:o(e),hpas:o(e),statefulSets:o(e),podDisruptionBudgets:o(e),ingresses:o(e),customResources:{enabled:!1,collectors:[u(e)]}});function y(e){if(Object.values(e).some(t=>t.enabled)){const t={},a=[];return t.collects=a,Object.entries(e).forEach(([i,n])=>{if(i==="customResources"&&n.enabled){const s=n.collectors?.map(c=>d({factType:f,configOption:c,additionalParams:{factName:c.factDetails.factName,customResource:c.factDetails.customResource}}))??[];a.push(...s)}else n.enabled&&a.push(d({factType:r[i].type,configOption:n}))}),t}return{collects:[]}}function C(e){const t=m(e);if(e){const a=[],i=e.collects;if(i){for(const s of g(i)){const c=s.type;if(s.type===f){const l={...p({parentConfig:e,factTypeConfig:s}),factDetails:{factName:s.factName,customResource:s.customResource},enabled:!0};a.push(l);continue}Object.entries(r).map(([l,b])=>{c===b.type&&(t[l]={...p({parentConfig:e,factTypeConfig:s}),enabled:!0})})}const n=a.length>0;t.customResources={enabled:n,collectors:n?a:[u(e)]}}}return t}export{r as K8S_COLLECTOR_FIELDS,u as defaultCustomResourceOption,m as defaultKubernetesConfig,C as mapConfigToKubernetesCollectorConfig,y as mapKubernetesCollectorConfigToConfig};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as b,Box as S,Typography as o,Grid as
|
|
1
|
+
import{makeStyles as b,Box as S,Typography as o,Grid as l,TextField as f,IconButton as x}from"@material-ui/core";import C from"@material-ui/icons/Add";import F from"@material-ui/icons/Remove";import e from"react";import{useFormContext as v,useFieldArray as I,Controller as h}from"react-hook-form";import{FactDetailsComponent as y}from"./FactDetailsComponent.esm.js";import{DEFAULT_EXISTS_FACT_DATA as D,SCM_COLLECTOR_FIELDS as $}from"./utils.esm.js";const A=b(t=>({labelInput:{marginTop:0,width:"255px"},filePathInput:{marginTop:0,width:"420px"},caption:{margin:t.spacing(2,0)},helperText:{marginLeft:0}})),L=({name:t,disabled:a})=>{const r=A(),{filePath:s,label:p,exists:d}=$.factDetails,{control:i}=v(),{fields:E,insert:u,remove:T}=I({control:i,name:`${t}.data`});return e.createElement(S,null,e.createElement(y,{name:t,control:i,disabled:a}),e.createElement("div",{className:r.caption},e.createElement(o,{variant:"subtitle1"},d.filesSection.name),e.createElement(o,{variant:"caption"},d.filesSection.description)),e.createElement(l,{container:!0,spacing:0,direction:"column"},E.map((g,m)=>e.createElement(l,{item:!0,container:!0,alignItems:"center",spacing:2,key:g.id},e.createElement(l,{item:!0},e.createElement(o,{variant:"subtitle2"},p.name),e.createElement(h,{name:`${t}.data.${m}.name`,control:i,render:({field:c,fieldState:{error:n}})=>e.createElement(f,{...c,type:"text",variant:"outlined",margin:"dense",placeholder:p.placeholder,className:r.labelInput,disabled:a,error:!!n,helperText:n?.message??" ",FormHelperTextProps:{className:r.helperText}})})),e.createElement(l,{item:!0},e.createElement(o,{variant:"subtitle2"},s.name),e.createElement(h,{name:`${t}.data.${m}.path`,control:i,render:({field:c,fieldState:{error:n}})=>e.createElement(f,{...c,type:"text",variant:"outlined",margin:"dense",placeholder:s.placeholder,className:r.filePathInput,disabled:a,error:!!n,helperText:n?.message??" ",FormHelperTextProps:{className:r.helperText}})})),e.createElement(l,{item:!0},e.createElement(x,{onClick:()=>T(m),disabled:a||E.length===1},e.createElement(F,{fontSize:"small"})),e.createElement(x,{onClick:()=>u(m+1,D),disabled:a},e.createElement(C,{fontSize:"small"})))))))};export{L as ExistsFactDetailsComponent};
|
|
2
2
|
//# sourceMappingURL=ExistsFactDetailsComponent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as f,Grid as m,Typography as s,Box as c,TextField as d}from"@material-ui/core";import e from"react";import{Controller as h}from"react-hook-form";import{FormFieldLabel as x}from"../../../FormFieldLabel/FormFieldLabel.esm.js";import{SCM_COLLECTOR_FIELDS as E}from"./utils.esm.js";const T=f(a=>({root:{paddingTop:a.spacing(1),alignItems:"flex-start"},factNameInput:{marginTop:0,width:"255px"},branchInput:{marginTop:0,width:"420px"},branchLabel:{height:"40px"},branchSection:{alignContent:"flex-end"},helperText:{marginLeft:0}})),g=({name:a,disabled:i,control:p})=>{const t=T(),{factName:n,branch:l}=E.factDetails;return e.createElement(m,{container:!0,spacing:2,className:t.root},e.createElement(h,{name:`${a}.factName`,control:p,render:({field:o,fieldState:{error:r}})=>e.createElement(m,{item:!0},e.createElement(x,{title:n.name}),e.createElement(s,{variant:"caption"},n.helperText),e.createElement(c,null,e.createElement(d,{...o,type:"text",variant:"outlined",margin:"dense",placeholder:n.placeholder,className:t.factNameInput,disabled:i,error:!!r,helperText:r?.message??"",FormHelperTextProps:{className:t.helperText}})))}),e.createElement(h,{name:`${a}.branch`,control:p,render:({field:o,fieldState:{error:r}})=>e.createElement(m,{item:!0,className:t.branchSection},e.createElement(c,null,e.createElement(c,null,e.createElement(x,{title:l.name}),e.createElement(s,{variant:"caption"},l.helperText)),e.createElement(d,{...o,type:"text",variant:"outlined",margin:"dense",placeholder:l.placeholder,className:t.branchInput,disabled:i,error:!!r,helperText:r?.message??"",FormHelperTextProps:{className:t.helperText}})))}))};export{g as FactDetailsComponent};
|
|
2
2
|
//# sourceMappingURL=FactDetailsComponent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as v,Box as g,Typography as m,TextField as p,Grid as o,MenuItem as y,IconButton as P}from"@material-ui/core";import I from"@material-ui/icons/Add";import N from"@material-ui/icons/Remove";import e from"react";import{useFormContext as F,useFieldArray as C,Controller as d}from"react-hook-form";import{FactDetailsComponent as $}from"./FactDetailsComponent.esm.js";import{ELEMENT_TYPES as j,ARRAY_ELEMENT_TYPES as L,DEFAULT_JSON_FACT_DATA as _,SCM_COLLECTOR_FIELDS as A}from"./utils.esm.js";const D=v(a=>({filePathInput:{marginTop:0,width:"690px"},labelInput:{marginTop:0,width:"255px"},jsonPathInput:{marginTop:0,width:"300px"},typeInput:{marginTop:0,width:"150px"},helperText:{marginLeft:0},caption:{margin:a.spacing(2,0)},filePathSection:{marginTop:a.spacing(1)}})),k=({name:a,disabled:l})=>{const t=D(),{filePath:E,label:x,type:u,json:s}=A.factDetails,{control:i}=F(),{fields:f,insert:b,remove:S}=C({control:i,name:`${a}.data`});return e.createElement(g,null,e.createElement($,{name:a,control:i,disabled:l}),e.createElement("div",{className:t.filePathSection},e.createElement(g,null,e.createElement(m,{variant:"subtitle2"},E.name),e.createElement(m,{variant:"caption"},E.helperText)),e.createElement(d,{name:`${a}.path`,control:i,render:({field:h,fieldState:{error:r}})=>e.createElement(p,{...h,type:"text",variant:"outlined",margin:"dense",placeholder:E.placeholder,className:t.filePathInput,disabled:l,error:!!r,helperText:r?.message,FormHelperTextProps:{className:t.helperText}})})),e.createElement("div",{className:t.caption},e.createElement(m,{variant:"subtitle1"},s.jsonElementsSection.name),e.createElement(m,{variant:"caption"},s.jsonElementsSection.description)),e.createElement(o,{container:!0,spacing:0,direction:"column"},f.map((h,r)=>e.createElement(o,{item:!0,container:!0,alignItems:"center",spacing:2,key:h.id},e.createElement(o,{item:!0},e.createElement(m,{variant:"subtitle2"},x.name),e.createElement(d,{name:`${a}.data.${r}.name`,control:i,render:({field:c,fieldState:{error:n}})=>e.createElement(p,{...c,type:"text",variant:"outlined",margin:"dense",placeholder:x.placeholder,className:t.labelInput,disabled:l,error:!!n,helperText:n?.message??" ",FormHelperTextProps:{className:t.helperText}})})),e.createElement(o,{item:!0},e.createElement(m,{variant:"subtitle2"},s.jsonPath.name),e.createElement(d,{name:`${a}.data.${r}.jsonPath`,control:i,render:({field:c,fieldState:{error:n}})=>e.createElement(p,{...c,type:"text",variant:"outlined",margin:"dense",placeholder:s.jsonPath.placeholder,className:t.jsonPathInput,disabled:l,error:!!n,helperText:n?.message??" ",FormHelperTextProps:{className:t.helperText}})})),e.createElement(o,{item:!0},e.createElement(m,{variant:"subtitle2"},u.name),e.createElement(d,{name:`${a}.data.${r}.type`,control:i,render:({field:c,fieldState:{error:n}})=>e.createElement(p,{...c,select:!0,type:"text",variant:"outlined",margin:"dense",placeholder:u.placeholder,className:t.typeInput,disabled:l,error:!!n,helperText:n?.message??" ",FormHelperTextProps:{className:t.helperText}},[...j,...L].map(T=>e.createElement(y,{key:T,value:T},T)))})),e.createElement(o,{item:!0},e.createElement(P,{onClick:()=>S(r),disabled:l||f.length===1},e.createElement(N,{fontSize:"small"})),e.createElement(P,{onClick:()=>b(r+1,_),disabled:l},e.createElement(I,{fontSize:"small"})))))))};export{k as JsonFactDetailsComponent};
|
|
2
2
|
//# sourceMappingURL=JsonFactDetailsComponent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{makeStyles as
|
|
1
|
+
import{makeStyles as P,Box as s,Grid as m,Typography as a,TextField as d,RadioGroup as L,FormControlLabel as C,Radio as N,MenuItem as D,IconButton as I}from"@material-ui/core";import _ from"@material-ui/icons/Add";import k from"@material-ui/icons/Remove";import e,{useState as A}from"react";import{useFormContext as H,useFieldArray as R,Controller as E}from"react-hook-form";import{FactDetailsComponent as w}from"./FactDetailsComponent.esm.js";import{ELEMENT_TYPES as z,DEFAULT_REGEX_FACT_DATA as M,SCM_COLLECTOR_FIELDS as B}from"./utils.esm.js";const u="CaptureGroupsMode",x="TrueFalseMode",O=P(n=>({textInput:{marginTop:0,width:"690px"},labelInput:{marginTop:0,width:"255px"},typeInput:{marginTop:0,width:"150px"},helperText:{marginLeft:0},caption:{margin:n.spacing(2,0)},regexSection:{padding:n.spacing(1,0)}})),U=({name:n,disabled:c})=>{const r=O(),{label:f,type:F,filePath:g,regex:l}=B.factDetails,{control:i}=H(),{fields:h,insert:y,remove:S}=R({control:i,name:`${n}.data`}),[T,G]=A(h.length?u:x),$=o=>{const t=o.target.value;G(t),t===u?y(0,M):t===x&&S()};return e.createElement(s,null,e.createElement(w,{name:n,control:i,disabled:c}),e.createElement(m,{container:!0,spacing:1,direction:"column",className:r.regexSection},e.createElement(m,{item:!0},e.createElement(s,null,e.createElement(a,{variant:"subtitle2"},g.name),e.createElement(a,{variant:"caption"},g.helperText)),e.createElement(E,{name:`${n}.path`,control:i,render:({field:o,fieldState:{error:t}})=>e.createElement(d,{...o,type:"text",variant:"outlined",margin:"dense",placeholder:g.placeholder,className:r.textInput,disabled:c,error:!!t,helperText:t?.message??"",FormHelperTextProps:{className:r.helperText}})})),e.createElement(m,{item:!0},e.createElement(s,null,e.createElement(a,{variant:"subtitle2"},l.regex.name),e.createElement(a,{variant:"caption"},l.regex.helperText)),e.createElement(E,{name:`${n}.regex`,control:i,render:({field:o,fieldState:{error:t}})=>e.createElement(d,{...o,type:"text",variant:"outlined",margin:"dense",placeholder:l.regex.placeholder,className:r.textInput,disabled:c,error:!!t,helperText:t?.message??"",FormHelperTextProps:{className:r.helperText}})})),e.createElement(m,{item:!0},e.createElement(s,null,e.createElement(a,{variant:"subtitle2"},l.flags.name),e.createElement(a,{variant:"caption"},l.flags.helperText)),e.createElement(E,{name:`${n}.flags`,control:i,render:({field:o,fieldState:{error:t}})=>e.createElement(d,{...o,type:"text",variant:"outlined",margin:"dense",placeholder:l.flags.placeholder,className:r.textInput,disabled:c,error:!!t,helperText:t?.message??"",FormHelperTextProps:{className:r.helperText}})}))),e.createElement(L,{row:!0,name:"regexMode",value:T,onChange:$},e.createElement(C,{value:x,control:e.createElement(N,null),label:e.createElement(a,{variant:"subtitle2"},l.trueFalseMode.label)}),e.createElement(C,{value:u,control:e.createElement(N,null),label:e.createElement(a,{variant:"subtitle2"},l.captureGroupsMode.label)})),T===x&&e.createElement(a,{variant:"caption"},l.trueFalseMode.description),T===u&&e.createElement(s,null,e.createElement(a,{variant:"caption"},l.captureGroupsMode.description),e.createElement("div",{className:r.caption},e.createElement(a,{variant:"subtitle2"},l.captureGroupsSection.name),e.createElement(a,{variant:"caption"},l.captureGroupsSection.description)),e.createElement(m,{container:!0,spacing:0,direction:"column"},h.map((o,t)=>e.createElement(m,{item:!0,container:!0,alignItems:"center",spacing:2,key:o.id},e.createElement(m,{item:!0},e.createElement(a,{variant:"subtitle2"},f.name),e.createElement(E,{name:`${n}.data.${t}.name`,control:i,render:({field:b,fieldState:{error:p}})=>e.createElement(d,{...b,type:"text",variant:"outlined",margin:"dense",placeholder:f.placeholder,className:r.labelInput,disabled:c,error:!!p,helperText:p?.message??" ",FormHelperTextProps:{className:r.helperText}})})),e.createElement(m,{item:!0},e.createElement(a,{variant:"subtitle2"},F.name),e.createElement(E,{name:`${n}.data.${t}.type`,control:i,render:({field:b,fieldState:{error:p}})=>e.createElement(d,{...b,select:!0,type:"text",variant:"outlined",margin:"dense",placeholder:F.placeholder,className:r.typeInput,disabled:c,error:!!p,helperText:p?.message??" ",FormHelperTextProps:{className:r.helperText}},z.map(v=>e.createElement(D,{key:v,value:v},v)))})),e.createElement(m,{item:!0},e.createElement(I,{onClick:()=>S(t),disabled:c||h.length===1},e.createElement(k,{fontSize:"small"})),e.createElement(I,{onClick:()=>y(t+1,M),disabled:c},e.createElement(_,{fontSize:"small"}))))))))};export{U as RegexFactDetailsComponent};
|
|
2
2
|
//# sourceMappingURL=RegexFactDetailsComponent.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{zodResolver as
|
|
1
|
+
import{zodResolver as v}from"@hookform/resolvers/zod";import{makeStyles as y,Paper as h,Divider as f}from"@material-ui/core";import e,{useCallback as O,useMemo as T}from"react";import{useForm as L,FormProvider as R}from"react-hook-form";import"@backstage/catalog-model";import"@backstage/core-plugin-api";import"@tanstack/react-query";import"../../../../api.esm.js";import"../../../../hooks/graphqlKeys.esm.js";import"@backstage/plugin-catalog-react";import"@spotify/backstage-plugin-soundcheck-common";import"../../../../hooks/useSoundcheckAlert.esm.js";import{useConfirmationModal as D}from"../../../../hooks/useConfirmationModal.esm.js";import{useNavigateBack as M}from"../../../../hooks/useNavigateBack.esm.js";import{useUpdateCollectorConfig as N}from"../../../../hooks/collectors/useUpdateCollectorConfig.esm.js";import{integrationsPageRouteRef as P}from"../../../../routes.esm.js";import{FooterButtons as _}from"../../../FooterButtons/FooterButtons.esm.js";import"../../../SoundcheckHeader/SoundcheckHeader.esm.js";import"../../../SoundcheckHeader/SoundcheckHeaderContext.esm.js";import{useHeader as w}from"../../../SoundcheckHeader/useHeader.esm.js";import{FactCollectionConfig as l}from"../Common/FactCollectionConfig.esm.js";import{collectorHeaderContent as J,confirmationModalContent as Y}from"../Common/utils.esm.js";import{ExistsFactDetailsComponent as j}from"./ExistsFactDetailsComponent.esm.js";import{JsonFactDetailsComponent as B}from"./JsonFactDetailsComponent.esm.js";import{RegexFactDetailsComponent as k}from"./RegexFactDetailsComponent.esm.js";import{mapConfigToScmCollectorConfig as A,defaultScmCollectorConfig as d,EXISTS_COLLECTOR_TYPE as z,REGEX_COLLECTOR_TYPE as H,JSON_COLLECTOR_TYPE as I,mapScmCollectorConfigToConfig as V}from"./utils.esm.js";import{scmCollectorFormSchema as X}from"./validation.esm.js";const G=y(i=>({spacer:{height:i.spacing(8),width:"100%"},section:{marginBottom:i.spacing(2)}})),U=({disabled:i,selectedCollector:t})=>{const C=O(async(o,...n)=>{const a={enabled:!1,collectors:[]},F={exists:o.exists.enabled?o.exists:a,json:o.json.enabled?o.json:a,regex:o.regex.enabled?o.regex:a};return v(X)(F,...n)},[]),s=L({defaultValues:t?A(t.config):d(),mode:"onChange",resolver:C}),r=T(()=>d(t.config),[t]),{formState:{isValid:g},handleSubmit:m}=s,c=G(),u=!g,{mutateAsync:E}=N(),[S,b]=M(P),{showModal:x}=D(),p=async o=>{if(!await x(Y(t)))return;const n=V(o);await E({collectorId:t.id,config:n})&&b()};return w(J(t)),e.createElement(e.Fragment,null,e.createElement(h,{className:c.section},e.createElement(R,{...s},e.createElement("form",{onSubmit:m(p)},e.createElement(l,{name:z,label:"Exists",description:"Collects information on the existence of files within an entity's repository.",disabled:i,multipleCollectors:{enable:!0,defaultConfig:r.exists.collectors[0]},FactDetailsComponent:j}),e.createElement(f,null),e.createElement(l,{name:H,label:"Regex",description:"Executes regular expressions against a specified file in an entity's repository and collects its capture groups.",disabled:i,multipleCollectors:{enable:!0,defaultConfig:r.regex.collectors[0]},FactDetailsComponent:k}),e.createElement(f,null),e.createElement(l,{name:I,label:"JSON / YAML",description:"Collects data from a JSON/YAML file at specified JSON paths in an entity's repository.",disabled:i,multipleCollectors:{enable:!0,defaultConfig:r.json.collectors[0]},FactDetailsComponent:B})))),e.createElement("div",{className:c.section},e.createElement(_,{onCancel:S,saveButtonText:"Save",isLoading:!1,onSave:m(p),disableSave:u,noMargin:!0})))};export{U as ScmConfigurator};
|
|
2
2
|
//# sourceMappingURL=ScmConfigurator.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{asArray as x}from"@spotify/backstage-plugin-soundcheck-common";import{
|
|
1
|
+
import{asArray as x}from"@spotify/backstage-plugin-soundcheck-common";import{sumBy as C}from"lodash";import{defaultBaseCollectorOption as D}from"../Common/CollectorOption.esm.js";import{mapBackendConfigToFormIntegrationConfig as m,mapFormIntegrationConfigToBackendConfig as h}from"../Common/utils.esm.js";const d={name:"",path:""},y={name:"",type:"string"},g={name:"",jsonPath:"",type:"string"},N={factName:"",data:[d]},_={factName:"",path:"",regex:"",data:[]},L={factName:"",path:"",data:[g]},u=(t={})=>{const l=D(t);return{exists:{enabled:!1,collectors:[{factDetails:N,...l}]},regex:{enabled:!1,collectors:[{factDetails:_,...l}]},json:{enabled:!1,collectors:[{factDetails:L,...l}]}}},O={factDetails:{factName:{name:"Fact Name",helperText:"Fact name must be unique",placeholder:"Fact Name"},branch:{name:"Custom Branch (Optional)",helperText:"If omitted collects data from default branch",placeholder:"Example: develop"},filePath:{name:"File Path",helperText:"Path to the file whose content will be searched",placeholder:"Example: /catalog-info.yaml"},label:{name:"Label",placeholder:"Label"},type:{name:"Type",placeholder:"Type"},exists:{filesSection:{name:"Files",description:"List the files whose existence will be checked"}},regex:{regex:{name:"RegEx Pattern",helperText:"RegEx pattern to match",placeholder:"Example: ^apiVersion: backstage.io/(.+)"},flags:{name:"RegEx Flags (Optional)",helperText:"Allowed RegEx flags: g, i, m, s, u, y",placeholder:"Example: mi"},trueFalseMode:{label:"True / False Mode",description:"True / False Mode uses a RegEx to search for a match in the given file."},captureGroupsMode:{label:"Capture Groups Mode",description:"RegEx Capture Groups Mode allows the collector to associate capture groups within a RegEx to named values."},captureGroupsSection:{name:"Capture Groups",description:"Each element must correspond to a capture group in the given RegEx"}},json:{jsonPath:{name:"Json Path",placeholder:"Example: metadata.tags"},jsonElementsSection:{name:"JSON / YAML Elements",description:"List json / yaml paths from which to pull data from the given file"}}}},i="exists",f="regex",r="json",E=["string","number","integer","boolean","object"],T=E.map(b);function P(t){const{exists:l,regex:c,json:o}=t;if(l.collectors.length||c.collectors.length||o.collectors.length){const a={},n=[];return a.collects=n,l.enabled&&l.collectors.forEach(e=>{n.push(h({factType:i,configOption:e,additionalParams:{factName:e.factDetails.factName,branch:e.factDetails.branch?.length?e.factDetails.branch:void 0,data:e.factDetails.data}}))}),c.enabled&&c.collectors.forEach(e=>{n.push(h({factType:f,configOption:e,additionalParams:{factName:e.factDetails.factName,branch:e.factDetails.branch?.length?e.factDetails.branch:void 0,path:e.factDetails.path,regex:e.factDetails.regex,flags:e.factDetails.flags?.length?e.factDetails.flags:void 0,data:e.factDetails.data.length?e.factDetails.data:void 0}}))}),o.enabled&&o.collectors.forEach(e=>{n.push(h({factType:r,configOption:e,additionalParams:{factName:e.factDetails.factName,branch:e.factDetails.branch?.length?e.factDetails.branch:void 0,path:e.factDetails.path,data:e.factDetails.data.map(s=>T.includes(s.type)?{name:s.name,jsonPath:s.jsonPath,type:"array",items:{type:A(s.type)}}:s)}}))}),a}return{collects:[]}}const p=(t,l)=>C(t,({type:c})=>+(c===l));function F(t){const l=u(t),c=t?.collects;if(c&&c.length>0){const o=x(c);return{exists:p(o,i)>0?{collectors:o.filter(a=>a.type===i).map(a=>({...m({factTypeConfig:a,parentConfig:t}),factDetails:{factName:a.factName,branch:a.branch,data:a.data}})),enabled:!0}:l.exists,regex:p(o,f)>0?{collectors:o.filter(a=>a.type===f).map(a=>({...m({factTypeConfig:a,parentConfig:t}),factDetails:{factName:a.factName,branch:a.branch,path:a.path,regex:a.regex,flags:a.flags,data:a.data}})),enabled:!0}:l.regex,json:p(o,r)>0?{collectors:o.filter(a=>a.type===r).map(a=>({...m({factTypeConfig:a,parentConfig:t}),factDetails:{factName:a.factName,branch:a.branch,path:a.path,data:a.data.map(n=>n.type==="array"?{name:n.name,jsonPath:n.jsonPath,type:b(n.items?.type)}:n)}})),enabled:p(o,r)>0}:l.json}}return l}function b(t="object"){return`array[${t}]`}function A(t){const l="array[";return t.substring(t.indexOf(l)+l.length,t.lastIndexOf("]"))}export{T as ARRAY_ELEMENT_TYPES,d as DEFAULT_EXISTS_FACT_DATA,g as DEFAULT_JSON_FACT_DATA,y as DEFAULT_REGEX_FACT_DATA,E as ELEMENT_TYPES,i as EXISTS_COLLECTOR_TYPE,r as JSON_COLLECTOR_TYPE,f as REGEX_COLLECTOR_TYPE,O as SCM_COLLECTOR_FIELDS,u as defaultScmCollectorConfig,F as mapConfigToScmCollectorConfig,P as mapScmCollectorConfigToConfig};
|
|
2
2
|
//# sourceMappingURL=utils.esm.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{validNameRegex as o}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FIELD_IS_REQUIRED_MSG as a
|
|
1
|
+
import{validNameRegex as o}from"@spotify/backstage-plugin-soundcheck-common";import{z as e}from"zod";import{FIELD_IS_REQUIRED_MSG as a}from"../../../../utils/validation.esm.js";import{BaseCollectorSchema as h}from"../Common/CollectorOption.esm.js";const m="Fact name is not unique",r="The field contains forbidden characters",i="Max 100 characters",x="Max 1000 characters",p="Invalid regex flags: at least one of g, i, m, s, u, or y is required.",_=/^[gimsuy]*$/,g=e.object({factName:e.string().min(1,a).max(100,i).regex(o,r),branch:e.string().optional()}),u=g.merge(e.object({data:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(o,r),path:e.string().min(1,a).max(1e3,x)}))})).strict(),I=g.merge(e.object({path:e.string().min(1,a),regex:e.string().min(1,a),flags:e.string().regex(_,p).optional(),data:e.array(e.strictObject({name:e.string().min(1,a).max(100,i).regex(o,r),type:e.string().min(1,a).max(100,i).regex(o,r).optional()})).optional()})).strict(),N=g.merge(e.object({path:e.string().min(1,a),data:e.array(e.strictObject({name:e.string().min(1,a).regex(o,r),jsonPath:e.string().min(1,a),type:e.string().min(1,a)}))})).strict(),f=s=>e.strictObject({enabled:e.boolean().optional(),collectors:e.array(h.extend({factDetails:s}))}),j=e.strictObject({exists:f(u),regex:f(I),json:f(N)}).superRefine((s,l)=>{const d=[...s.exists.collectors.map(t=>t.factDetails.factName),...s.regex.collectors.map(t=>t.factDetails.factName),...s.json.collectors.map(t=>t.factDetails.factName)],n=d.filter((t,c)=>d.indexOf(t)!==c);n.length&&(s.exists.collectors.forEach((t,c)=>{n.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:m,path:["exists","collectors",c,"factDetails","factName"]})}),s.regex.collectors.forEach((t,c)=>{n.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:m,path:["regex","collectors",c,"factDetails","factName"]})}),s.json.collectors.forEach((t,c)=>{n.includes(t.factDetails.factName)&&l.addIssue({code:e.ZodIssueCode.custom,message:m,path:["json","collectors",c,"factDetails","factName"]})}))});export{m as FACT_NAME_IS_NOT_UNIQUE_MSG,r as INVALID_CHARACTERS_MSG,p as INVALID_REGEX_FLAGS_MSG,x as MAX_1000_CHARACTERS_MSG,i as MAX_100_CHARACTERS_MSG,j as scmCollectorFormSchema,_ as validFlagsRegex};
|
|
2
2
|
//# sourceMappingURL=validation.esm.js.map
|