Skip to content

Commit 0e28386

Browse files
fix: Change authors to be a list of strings
1 parent e2a8020 commit 0e28386

File tree

3 files changed

+20
-62
lines changed

3 files changed

+20
-62
lines changed

utils/lib/Quickstart.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ class Quickstart {
212212
*/
213213
public transformForArtifact(): ArtifactQuickstartConfig {
214214
const {
215-
authors,
216215
description,
217216
title,
218217
slug,
@@ -223,13 +222,13 @@ class Quickstart {
223222
dataSourceIds,
224223
id,
225224
level,
225+
authors = [],
226226
dashboards = [],
227227
alertPolicies = [],
228228
} = this.config;
229229

230230
const metadata = {
231231
quickstartUuid: id,
232-
authors: authors && authors.map((author) => ({ name: author })),
233232
description: description && description.trim(),
234233
displayName: title && title.trim(),
235234
slug: slug && slug.trim(),
@@ -252,8 +251,10 @@ class Quickstart {
252251
dataSourceIds: dataSourceIds,
253252
alertConditions: alertPolicies,
254253
dashboards,
254+
authors,
255255
};
256256

257+
257258
return metadata;
258259
}
259260

utils/schema/artifact.json

+16-59
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,7 @@
6464
"authors": {
6565
"type": "array",
6666
"items": {
67-
"type": "object",
68-
"properties": {
69-
"name": {
70-
"type": "string"
71-
}
72-
}
67+
"type": "string"
7368
}
7469
},
7570
"sourceUrl": {
@@ -90,21 +85,12 @@
9085
"type": "string"
9186
}
9287
},
93-
"required": [
94-
"displayName",
95-
"description",
96-
"url"
97-
],
88+
"required": ["displayName", "description", "url"],
9889
"additionalProperties": false
9990
}
10091
},
10192
"supportLevel": {
102-
"enum": [
103-
"new_relic",
104-
"community",
105-
"verified",
106-
"enterprise"
107-
]
93+
"enum": ["new_relic", "community", "verified", "enterprise"]
10894
},
10995
"iconUrl": {
11096
"type": "string"
@@ -168,9 +154,7 @@
168154
"$ref": "#/definitions/installDirective"
169155
}
170156
},
171-
"required": [
172-
"primary"
173-
],
157+
"required": ["primary"],
174158
"additionalProperties": false
175159
},
176160
"keywords": {
@@ -189,11 +173,7 @@
189173
"type": "string"
190174
}
191175
},
192-
"required": [
193-
"id",
194-
"displayName",
195-
"install"
196-
],
176+
"required": ["id", "displayName", "install"],
197177
"additionalProperties": false
198178
},
199179
"installDirective": {
@@ -206,9 +186,7 @@
206186
"type": "string"
207187
}
208188
},
209-
"required": [
210-
"url"
211-
],
189+
"required": ["url"],
212190
"additionalProperties": false
213191
},
214192
{
@@ -224,10 +202,7 @@
224202
"type": "boolean"
225203
}
226204
},
227-
"required": [
228-
"nerdletId",
229-
"requiresAccount"
230-
],
205+
"required": ["nerdletId", "requiresAccount"],
231206
"additionalProperties": false
232207
}
233208
]
@@ -238,21 +213,15 @@
238213
"type": "object",
239214
"properties": {
240215
"type": {
241-
"enum": [
242-
"baseline",
243-
"static"
244-
],
216+
"enum": ["baseline", "static"],
245217
"type": "string",
246218
"nullable": true
247219
},
248220
"displayName": {
249221
"type": "string"
250222
},
251223
"description": {
252-
"type": [
253-
"string",
254-
"null"
255-
]
224+
"type": ["string", "null"]
256225
},
257226
"rawConfiguration": {
258227
"type": "string"
@@ -269,16 +238,11 @@
269238
"type": "string"
270239
}
271240
},
272-
"required": [
273-
"url"
274-
]
241+
"required": ["url"]
275242
}
276243
}
277244
},
278-
"required": [
279-
"displayName",
280-
"rawConfiguration"
281-
],
245+
"required": ["displayName", "rawConfiguration"],
282246
"additionalProperties": false
283247
}
284248
},
@@ -289,10 +253,7 @@
289253
"type": "string"
290254
},
291255
"description": {
292-
"type": [
293-
"string",
294-
"null"
295-
]
256+
"type": ["string", "null"]
296257
},
297258
"rawConfiguration": {
298259
"type": "string"
@@ -309,16 +270,11 @@
309270
"type": "string"
310271
}
311272
},
312-
"required": [
313-
"url"
314-
]
273+
"required": ["url"]
315274
}
316275
}
317276
},
318-
"required": [
319-
"displayName",
320-
"rawConfiguration"
321-
],
277+
"required": ["displayName", "rawConfiguration"],
322278
"additionalProperties": false
323279
},
324280
"dataSourceIds": {
@@ -660,4 +616,5 @@
660616
]
661617
}
662618
}
663-
}
619+
}
620+

utils/types/Artifact.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface ArtifactQuickstartConfig {
6464
alertConditions?: string[];
6565
dashboards?: string[];
6666
dataSourceIds?: string[];
67-
authors: Array<{ name: string }>;
67+
authors: string[];
6868
};
6969

7070
/* -- Dashboard -- */

0 commit comments

Comments
 (0)