@backstage/plugin-scaffolder-common 1.5.6 → 1.5.7
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 +20 -0
- package/dist/Template.v1beta3.schema.json.cjs.js +358 -0
- package/dist/Template.v1beta3.schema.json.cjs.js.map +1 -0
- package/dist/TemplateEntityV1beta3.cjs.js +17 -0
- package/dist/TemplateEntityV1beta3.cjs.js.map +1 -0
- package/dist/TemplateEntityV1beta3.esm.js.map +1 -1
- package/dist/alpha.cjs.js +15 -65
- package/dist/alpha.cjs.js.map +1 -1
- package/dist/alpha.d.ts +7 -1
- package/dist/alpha.esm.js +1 -1
- package/dist/index.cjs.js +3 -357
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/permissions.cjs.js +76 -0
- package/dist/permissions.cjs.js.map +1 -0
- package/dist/permissions.esm.js +7 -2
- package/dist/permissions.esm.js.map +1 -1
- package/package.json +16 -7
- package/alpha/package.json +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-common
|
|
2
2
|
|
|
3
|
+
## 1.5.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f61d4cc: Add scaffolder permission `scaffolder.template.management` for accessing the template management features
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/types@1.2.0
|
|
10
|
+
- @backstage/plugin-permission-common@0.8.2
|
|
11
|
+
- @backstage/catalog-model@1.7.1
|
|
12
|
+
|
|
13
|
+
## 1.5.7-next.0
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- f61d4cc: Add scaffolder permission `scaffolder.template.management` for accessing the template management features
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
- @backstage/catalog-model@1.7.0
|
|
20
|
+
- @backstage/types@1.1.1
|
|
21
|
+
- @backstage/plugin-permission-common@0.8.1
|
|
22
|
+
|
|
3
23
|
## 1.5.6
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var $schema = "http://json-schema.org/draft-07/schema";
|
|
6
|
+
var $id = "TemplateV1beta3";
|
|
7
|
+
var description = "A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.";
|
|
8
|
+
var examples = [
|
|
9
|
+
{
|
|
10
|
+
apiVersion: "scaffolder.backstage.io/v1beta3",
|
|
11
|
+
kind: "Template",
|
|
12
|
+
metadata: {
|
|
13
|
+
name: "react-ssr-template",
|
|
14
|
+
title: "React SSR Template",
|
|
15
|
+
description: "Next.js application skeleton for creating isomorphic web applications.",
|
|
16
|
+
tags: [
|
|
17
|
+
"recommended",
|
|
18
|
+
"react"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
spec: {
|
|
22
|
+
owner: "artist-relations-team",
|
|
23
|
+
type: "website",
|
|
24
|
+
parameters: {
|
|
25
|
+
required: [
|
|
26
|
+
"name",
|
|
27
|
+
"description",
|
|
28
|
+
"repoUrl"
|
|
29
|
+
],
|
|
30
|
+
"backstage:permissions": {
|
|
31
|
+
tags: [
|
|
32
|
+
"one",
|
|
33
|
+
"two"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
properties: {
|
|
37
|
+
name: {
|
|
38
|
+
title: "Name",
|
|
39
|
+
type: "string",
|
|
40
|
+
description: "Unique name of the component"
|
|
41
|
+
},
|
|
42
|
+
description: {
|
|
43
|
+
title: "Description",
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "Description of the component"
|
|
46
|
+
},
|
|
47
|
+
repoUrl: {
|
|
48
|
+
title: "Pick a repository",
|
|
49
|
+
type: "string",
|
|
50
|
+
"ui:field": "RepoUrlPicker"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
steps: [
|
|
55
|
+
{
|
|
56
|
+
id: "fetch",
|
|
57
|
+
name: "Fetch",
|
|
58
|
+
action: "fetch:plain",
|
|
59
|
+
parameters: {
|
|
60
|
+
url: "./template"
|
|
61
|
+
},
|
|
62
|
+
"backstage:permissions": {
|
|
63
|
+
tags: [
|
|
64
|
+
"one",
|
|
65
|
+
"two"
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: "publish",
|
|
71
|
+
name: "Publish to GitHub",
|
|
72
|
+
action: "publish:github",
|
|
73
|
+
parameters: {
|
|
74
|
+
repoUrl: "${{ parameters.repoUrl }}"
|
|
75
|
+
},
|
|
76
|
+
"if": "${{ parameters.repoUrl }}"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
output: {
|
|
80
|
+
catalogInfoUrl: "${{ steps.publish.output.catalogInfoUrl }}"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
];
|
|
85
|
+
var allOf = [
|
|
86
|
+
{
|
|
87
|
+
$ref: "Entity"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "object",
|
|
91
|
+
required: [
|
|
92
|
+
"spec"
|
|
93
|
+
],
|
|
94
|
+
properties: {
|
|
95
|
+
apiVersion: {
|
|
96
|
+
"enum": [
|
|
97
|
+
"scaffolder.backstage.io/v1beta3"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
kind: {
|
|
101
|
+
"enum": [
|
|
102
|
+
"Template"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
spec: {
|
|
106
|
+
type: "object",
|
|
107
|
+
required: [
|
|
108
|
+
"type",
|
|
109
|
+
"steps"
|
|
110
|
+
],
|
|
111
|
+
properties: {
|
|
112
|
+
type: {
|
|
113
|
+
type: "string",
|
|
114
|
+
description: "The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.",
|
|
115
|
+
examples: [
|
|
116
|
+
"service",
|
|
117
|
+
"website",
|
|
118
|
+
"library"
|
|
119
|
+
],
|
|
120
|
+
minLength: 1
|
|
121
|
+
},
|
|
122
|
+
owner: {
|
|
123
|
+
type: "string",
|
|
124
|
+
description: "The user (or group) owner of the template",
|
|
125
|
+
minLength: 1
|
|
126
|
+
},
|
|
127
|
+
parameters: {
|
|
128
|
+
oneOf: [
|
|
129
|
+
{
|
|
130
|
+
type: "object",
|
|
131
|
+
description: "The JSONSchema describing the inputs for the template.",
|
|
132
|
+
properties: {
|
|
133
|
+
"backstage:permissions": {
|
|
134
|
+
type: "object",
|
|
135
|
+
description: "Object used for authorizing the parameter",
|
|
136
|
+
properties: {
|
|
137
|
+
tags: {
|
|
138
|
+
type: "array",
|
|
139
|
+
items: {
|
|
140
|
+
type: "string"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
type: "array",
|
|
149
|
+
description: "A list of separate forms to collect parameters.",
|
|
150
|
+
items: {
|
|
151
|
+
type: "object",
|
|
152
|
+
description: "The JSONSchema describing the inputs for the template.",
|
|
153
|
+
properties: {
|
|
154
|
+
"backstage:permissions": {
|
|
155
|
+
type: "object",
|
|
156
|
+
description: "Object used for authorizing the parameter",
|
|
157
|
+
properties: {
|
|
158
|
+
tags: {
|
|
159
|
+
type: "array",
|
|
160
|
+
items: {
|
|
161
|
+
type: "string"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
presentation: {
|
|
172
|
+
type: "object",
|
|
173
|
+
description: "A way to redefine the presentation of the scaffolder.",
|
|
174
|
+
properties: {
|
|
175
|
+
buttonLabels: {
|
|
176
|
+
type: "object",
|
|
177
|
+
description: "A way to redefine the labels for actionable buttons.",
|
|
178
|
+
properties: {
|
|
179
|
+
backButtonText: {
|
|
180
|
+
type: "string",
|
|
181
|
+
description: "A button which return the user to one step back."
|
|
182
|
+
},
|
|
183
|
+
createButtonText: {
|
|
184
|
+
type: "string",
|
|
185
|
+
description: "A button which start the execution of the template."
|
|
186
|
+
},
|
|
187
|
+
reviewButtonText: {
|
|
188
|
+
type: "string",
|
|
189
|
+
description: "A button which open the review step to verify the input prior to start the execution."
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
EXPERIMENTAL_recovery: {
|
|
196
|
+
type: "object",
|
|
197
|
+
description: "A task recovery section.",
|
|
198
|
+
properties: {
|
|
199
|
+
EXPERIMENTAL_strategy: {
|
|
200
|
+
type: "string",
|
|
201
|
+
description: "Recovery strategy for your task (none or startOver). By default none"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
steps: {
|
|
206
|
+
type: "array",
|
|
207
|
+
description: "A list of steps to execute.",
|
|
208
|
+
items: {
|
|
209
|
+
type: "object",
|
|
210
|
+
description: "A description of the step to execute.",
|
|
211
|
+
required: [
|
|
212
|
+
"action"
|
|
213
|
+
],
|
|
214
|
+
properties: {
|
|
215
|
+
id: {
|
|
216
|
+
type: "string",
|
|
217
|
+
description: "The ID of the step, which can be used to refer to its outputs."
|
|
218
|
+
},
|
|
219
|
+
name: {
|
|
220
|
+
type: "string",
|
|
221
|
+
description: "The name of the step, which will be displayed in the UI during the scaffolding process."
|
|
222
|
+
},
|
|
223
|
+
action: {
|
|
224
|
+
type: "string",
|
|
225
|
+
description: "The name of the action to execute."
|
|
226
|
+
},
|
|
227
|
+
input: {
|
|
228
|
+
type: "object",
|
|
229
|
+
description: "A templated object describing the inputs to the action."
|
|
230
|
+
},
|
|
231
|
+
"if": {
|
|
232
|
+
type: [
|
|
233
|
+
"string",
|
|
234
|
+
"boolean"
|
|
235
|
+
],
|
|
236
|
+
description: "A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\"\"`, `0`, or `[]`."
|
|
237
|
+
},
|
|
238
|
+
"backstage:permissions": {
|
|
239
|
+
type: "object",
|
|
240
|
+
description: "Object used for authorizing the step",
|
|
241
|
+
properties: {
|
|
242
|
+
tags: {
|
|
243
|
+
type: "array",
|
|
244
|
+
items: {
|
|
245
|
+
type: "string"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
output: {
|
|
254
|
+
type: "object",
|
|
255
|
+
description: "A templated object describing the outputs of the scaffolding task.",
|
|
256
|
+
properties: {
|
|
257
|
+
links: {
|
|
258
|
+
type: "array",
|
|
259
|
+
description: "A list of external hyperlinks, typically pointing to resources created or updated by the template",
|
|
260
|
+
items: {
|
|
261
|
+
type: "object",
|
|
262
|
+
required: [
|
|
263
|
+
],
|
|
264
|
+
properties: {
|
|
265
|
+
url: {
|
|
266
|
+
type: "string",
|
|
267
|
+
description: "A url in a standard uri format.",
|
|
268
|
+
examples: [
|
|
269
|
+
"https://github.com/my-org/my-new-repo"
|
|
270
|
+
],
|
|
271
|
+
minLength: 1
|
|
272
|
+
},
|
|
273
|
+
entityRef: {
|
|
274
|
+
type: "string",
|
|
275
|
+
description: "An entity reference to an entity in the catalog.",
|
|
276
|
+
examples: [
|
|
277
|
+
"Component:default/my-app"
|
|
278
|
+
],
|
|
279
|
+
minLength: 1
|
|
280
|
+
},
|
|
281
|
+
title: {
|
|
282
|
+
type: "string",
|
|
283
|
+
description: "A user friendly display name for the link.",
|
|
284
|
+
examples: [
|
|
285
|
+
"View new repo"
|
|
286
|
+
],
|
|
287
|
+
minLength: 1
|
|
288
|
+
},
|
|
289
|
+
icon: {
|
|
290
|
+
type: "string",
|
|
291
|
+
description: "A key representing a visual icon to be displayed in the UI.",
|
|
292
|
+
examples: [
|
|
293
|
+
"dashboard"
|
|
294
|
+
],
|
|
295
|
+
minLength: 1
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
text: {
|
|
301
|
+
type: "array",
|
|
302
|
+
description: "A list of Markdown text blobs, like output data from the template.",
|
|
303
|
+
items: {
|
|
304
|
+
type: "object",
|
|
305
|
+
required: [
|
|
306
|
+
],
|
|
307
|
+
properties: {
|
|
308
|
+
title: {
|
|
309
|
+
type: "string",
|
|
310
|
+
description: "A user friendly display name for the text.",
|
|
311
|
+
examples: [
|
|
312
|
+
"Output Content"
|
|
313
|
+
],
|
|
314
|
+
minLength: 1
|
|
315
|
+
},
|
|
316
|
+
icon: {
|
|
317
|
+
type: "string",
|
|
318
|
+
description: "A key representing a visual icon to be displayed in the UI.",
|
|
319
|
+
examples: [
|
|
320
|
+
"dashboard"
|
|
321
|
+
],
|
|
322
|
+
minLength: 1
|
|
323
|
+
},
|
|
324
|
+
content: {
|
|
325
|
+
type: "string",
|
|
326
|
+
description: "The text blob to display in the UI, rendered as Markdown.",
|
|
327
|
+
examples: [
|
|
328
|
+
"**hey** _I'm_ Markdown"
|
|
329
|
+
]
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
additionalProperties: {
|
|
336
|
+
type: "string"
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
];
|
|
344
|
+
var schema = {
|
|
345
|
+
$schema: $schema,
|
|
346
|
+
$id: $id,
|
|
347
|
+
description: description,
|
|
348
|
+
examples: examples,
|
|
349
|
+
allOf: allOf
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
exports.$id = $id;
|
|
353
|
+
exports.$schema = $schema;
|
|
354
|
+
exports.allOf = allOf;
|
|
355
|
+
exports.default = schema;
|
|
356
|
+
exports.description = description;
|
|
357
|
+
exports.examples = examples;
|
|
358
|
+
//# sourceMappingURL=Template.v1beta3.schema.json.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Template.v1beta3.schema.json.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var catalogModel = require('@backstage/catalog-model');
|
|
4
|
+
var Template_v1beta3_schema = require('./Template.v1beta3.schema.json.cjs.js');
|
|
5
|
+
|
|
6
|
+
const validator = catalogModel.entityKindSchemaValidator(Template_v1beta3_schema.default);
|
|
7
|
+
const templateEntityV1beta3Validator = {
|
|
8
|
+
// TODO(freben): Emulate the old KindValidator until we fix that type
|
|
9
|
+
async check(data) {
|
|
10
|
+
return validator(data) === data;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const isTemplateEntityV1beta3 = (entity) => entity.apiVersion === "scaffolder.backstage.io/v1beta3" && entity.kind === "Template";
|
|
14
|
+
|
|
15
|
+
exports.isTemplateEntityV1beta3 = isTemplateEntityV1beta3;
|
|
16
|
+
exports.templateEntityV1beta3Validator = templateEntityV1beta3Validator;
|
|
17
|
+
//# sourceMappingURL=TemplateEntityV1beta3.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TemplateEntityV1beta3.cjs.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":["entityKindSchemaValidator","schema"],"mappings":";;;;;AAyJA,MAAM,SAAA,GAAYA,uCAA0BC,+BAAM,CAAA;AAO3C,MAAM,8BAAgD,GAAA;AAAA;AAAA,EAE3D,MAAM,MAAM,IAAc,EAAA;AACxB,IAAO,OAAA,SAAA,CAAU,IAAI,CAAM,KAAA,IAAA;AAAA;AAE/B;AAMO,MAAM,0BAA0B,CACrC,MAAA,KAEA,OAAO,UAAe,KAAA,iCAAA,IACtB,OAAO,IAAS,KAAA;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplateEntityV1beta3.esm.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":[],"mappings":";;;AAyJA,MAAM,SAAA,GAAY,0BAA0B,MAAM,CAAA
|
|
1
|
+
{"version":3,"file":"TemplateEntityV1beta3.esm.js","sources":["../src/TemplateEntityV1beta3.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":[],"mappings":";;;AAyJA,MAAM,SAAA,GAAY,0BAA0B,MAAM,CAAA;AAO3C,MAAM,8BAAgD,GAAA;AAAA;AAAA,EAE3D,MAAM,MAAM,IAAc,EAAA;AACxB,IAAO,OAAA,SAAA,CAAU,IAAI,CAAM,KAAA,IAAA;AAAA;AAE/B;AAMO,MAAM,0BAA0B,CACrC,MAAA,KAEA,OAAO,UAAe,KAAA,iCAAA,IACtB,OAAO,IAAS,KAAA;;;;"}
|
package/dist/alpha.cjs.js
CHANGED
|
@@ -1,70 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var permissions = require('./permissions.cjs.js');
|
|
4
4
|
|
|
5
|
-
const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = "scaffolder-template";
|
|
6
|
-
const RESOURCE_TYPE_SCAFFOLDER_ACTION = "scaffolder-action";
|
|
7
|
-
const actionExecutePermission = pluginPermissionCommon.createPermission({
|
|
8
|
-
name: "scaffolder.action.execute",
|
|
9
|
-
attributes: {},
|
|
10
|
-
resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION
|
|
11
|
-
});
|
|
12
|
-
const templateParameterReadPermission = pluginPermissionCommon.createPermission({
|
|
13
|
-
name: "scaffolder.template.parameter.read",
|
|
14
|
-
attributes: {
|
|
15
|
-
action: "read"
|
|
16
|
-
},
|
|
17
|
-
resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
|
|
18
|
-
});
|
|
19
|
-
const templateStepReadPermission = pluginPermissionCommon.createPermission({
|
|
20
|
-
name: "scaffolder.template.step.read",
|
|
21
|
-
attributes: {
|
|
22
|
-
action: "read"
|
|
23
|
-
},
|
|
24
|
-
resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
|
|
25
|
-
});
|
|
26
|
-
const taskReadPermission = pluginPermissionCommon.createPermission({
|
|
27
|
-
name: "scaffolder.task.read",
|
|
28
|
-
attributes: {
|
|
29
|
-
action: "read"
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const taskCreatePermission = pluginPermissionCommon.createPermission({
|
|
33
|
-
name: "scaffolder.task.create",
|
|
34
|
-
attributes: {
|
|
35
|
-
action: "create"
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const taskCancelPermission = pluginPermissionCommon.createPermission({
|
|
39
|
-
name: "scaffolder.task.cancel",
|
|
40
|
-
attributes: {}
|
|
41
|
-
});
|
|
42
|
-
const scaffolderTemplatePermissions = [
|
|
43
|
-
templateParameterReadPermission,
|
|
44
|
-
templateStepReadPermission
|
|
45
|
-
];
|
|
46
|
-
const scaffolderActionPermissions = [actionExecutePermission];
|
|
47
|
-
const scaffolderTaskPermissions = [
|
|
48
|
-
taskCancelPermission,
|
|
49
|
-
taskCreatePermission,
|
|
50
|
-
taskReadPermission
|
|
51
|
-
];
|
|
52
|
-
const scaffolderPermissions = [
|
|
53
|
-
...scaffolderTemplatePermissions,
|
|
54
|
-
...scaffolderActionPermissions,
|
|
55
|
-
...scaffolderTaskPermissions
|
|
56
|
-
];
|
|
57
5
|
|
|
58
|
-
|
|
59
|
-
exports.
|
|
60
|
-
exports.
|
|
61
|
-
exports.
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
64
|
-
exports.
|
|
65
|
-
exports.
|
|
66
|
-
exports.
|
|
67
|
-
exports.
|
|
68
|
-
exports.
|
|
69
|
-
exports.
|
|
6
|
+
|
|
7
|
+
exports.RESOURCE_TYPE_SCAFFOLDER_ACTION = permissions.RESOURCE_TYPE_SCAFFOLDER_ACTION;
|
|
8
|
+
exports.RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = permissions.RESOURCE_TYPE_SCAFFOLDER_TEMPLATE;
|
|
9
|
+
exports.actionExecutePermission = permissions.actionExecutePermission;
|
|
10
|
+
exports.scaffolderActionPermissions = permissions.scaffolderActionPermissions;
|
|
11
|
+
exports.scaffolderPermissions = permissions.scaffolderPermissions;
|
|
12
|
+
exports.scaffolderTaskPermissions = permissions.scaffolderTaskPermissions;
|
|
13
|
+
exports.scaffolderTemplatePermissions = permissions.scaffolderTemplatePermissions;
|
|
14
|
+
exports.taskCancelPermission = permissions.taskCancelPermission;
|
|
15
|
+
exports.taskCreatePermission = permissions.taskCreatePermission;
|
|
16
|
+
exports.taskReadPermission = permissions.taskReadPermission;
|
|
17
|
+
exports.templateManagementPermission = permissions.templateManagementPermission;
|
|
18
|
+
exports.templateParameterReadPermission = permissions.templateParameterReadPermission;
|
|
19
|
+
exports.templateStepReadPermission = permissions.templateStepReadPermission;
|
|
70
20
|
//# sourceMappingURL=alpha.cjs.js.map
|
package/dist/alpha.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alpha.cjs.js","sources":[
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
package/dist/alpha.d.ts
CHANGED
|
@@ -60,6 +60,12 @@ declare const taskCreatePermission: _backstage_plugin_permission_common.BasicPer
|
|
|
60
60
|
* @alpha
|
|
61
61
|
*/
|
|
62
62
|
declare const taskCancelPermission: _backstage_plugin_permission_common.BasicPermission;
|
|
63
|
+
/**
|
|
64
|
+
* This permission is used to authorize template management features.
|
|
65
|
+
*
|
|
66
|
+
* @alpha
|
|
67
|
+
*/
|
|
68
|
+
declare const templateManagementPermission: _backstage_plugin_permission_common.BasicPermission;
|
|
63
69
|
/**
|
|
64
70
|
* List of the scaffolder permissions that are associated with template steps and parameters.
|
|
65
71
|
* @alpha
|
|
@@ -81,4 +87,4 @@ declare const scaffolderTaskPermissions: _backstage_plugin_permission_common.Bas
|
|
|
81
87
|
*/
|
|
82
88
|
declare const scaffolderPermissions: (_backstage_plugin_permission_common.BasicPermission | _backstage_plugin_permission_common.ResourcePermission<"scaffolder-action"> | _backstage_plugin_permission_common.ResourcePermission<"scaffolder-template">)[];
|
|
83
89
|
|
|
84
|
-
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateParameterReadPermission, templateStepReadPermission };
|
|
90
|
+
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateManagementPermission, templateParameterReadPermission, templateStepReadPermission };
|
package/dist/alpha.esm.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateParameterReadPermission, templateStepReadPermission } from './permissions.esm.js';
|
|
1
|
+
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateManagementPermission, templateParameterReadPermission, templateStepReadPermission } from './permissions.esm.js';
|
|
2
2
|
//# sourceMappingURL=alpha.esm.js.map
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,363 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var TemplateEntityV1beta3 = require('./TemplateEntityV1beta3.cjs.js');
|
|
4
4
|
|
|
5
|
-
var $schema = "http://json-schema.org/draft-07/schema";
|
|
6
|
-
var $id = "TemplateV1beta3";
|
|
7
|
-
var description = "A Template describes a scaffolding task for use with the Scaffolder. It describes the required parameters as well as a series of steps that will be taken to execute the scaffolding task.";
|
|
8
|
-
var examples = [
|
|
9
|
-
{
|
|
10
|
-
apiVersion: "scaffolder.backstage.io/v1beta3",
|
|
11
|
-
kind: "Template",
|
|
12
|
-
metadata: {
|
|
13
|
-
name: "react-ssr-template",
|
|
14
|
-
title: "React SSR Template",
|
|
15
|
-
description: "Next.js application skeleton for creating isomorphic web applications.",
|
|
16
|
-
tags: [
|
|
17
|
-
"recommended",
|
|
18
|
-
"react"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
spec: {
|
|
22
|
-
owner: "artist-relations-team",
|
|
23
|
-
type: "website",
|
|
24
|
-
parameters: {
|
|
25
|
-
required: [
|
|
26
|
-
"name",
|
|
27
|
-
"description",
|
|
28
|
-
"repoUrl"
|
|
29
|
-
],
|
|
30
|
-
"backstage:permissions": {
|
|
31
|
-
tags: [
|
|
32
|
-
"one",
|
|
33
|
-
"two"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
properties: {
|
|
37
|
-
name: {
|
|
38
|
-
title: "Name",
|
|
39
|
-
type: "string",
|
|
40
|
-
description: "Unique name of the component"
|
|
41
|
-
},
|
|
42
|
-
description: {
|
|
43
|
-
title: "Description",
|
|
44
|
-
type: "string",
|
|
45
|
-
description: "Description of the component"
|
|
46
|
-
},
|
|
47
|
-
repoUrl: {
|
|
48
|
-
title: "Pick a repository",
|
|
49
|
-
type: "string",
|
|
50
|
-
"ui:field": "RepoUrlPicker"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
steps: [
|
|
55
|
-
{
|
|
56
|
-
id: "fetch",
|
|
57
|
-
name: "Fetch",
|
|
58
|
-
action: "fetch:plain",
|
|
59
|
-
parameters: {
|
|
60
|
-
url: "./template"
|
|
61
|
-
},
|
|
62
|
-
"backstage:permissions": {
|
|
63
|
-
tags: [
|
|
64
|
-
"one",
|
|
65
|
-
"two"
|
|
66
|
-
]
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
id: "publish",
|
|
71
|
-
name: "Publish to GitHub",
|
|
72
|
-
action: "publish:github",
|
|
73
|
-
parameters: {
|
|
74
|
-
repoUrl: "${{ parameters.repoUrl }}"
|
|
75
|
-
},
|
|
76
|
-
"if": "${{ parameters.repoUrl }}"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
output: {
|
|
80
|
-
catalogInfoUrl: "${{ steps.publish.output.catalogInfoUrl }}"
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
];
|
|
85
|
-
var allOf = [
|
|
86
|
-
{
|
|
87
|
-
$ref: "Entity"
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
type: "object",
|
|
91
|
-
required: [
|
|
92
|
-
"spec"
|
|
93
|
-
],
|
|
94
|
-
properties: {
|
|
95
|
-
apiVersion: {
|
|
96
|
-
"enum": [
|
|
97
|
-
"scaffolder.backstage.io/v1beta3"
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
kind: {
|
|
101
|
-
"enum": [
|
|
102
|
-
"Template"
|
|
103
|
-
]
|
|
104
|
-
},
|
|
105
|
-
spec: {
|
|
106
|
-
type: "object",
|
|
107
|
-
required: [
|
|
108
|
-
"type",
|
|
109
|
-
"steps"
|
|
110
|
-
],
|
|
111
|
-
properties: {
|
|
112
|
-
type: {
|
|
113
|
-
type: "string",
|
|
114
|
-
description: "The type of component created by the template. The software catalog accepts any type value, but an organization should take great care to establish a proper taxonomy for these. Tools including Backstage itself may read this field and behave differently depending on its value. For example, a website type component may present tooling in the Backstage interface that is specific to just websites.",
|
|
115
|
-
examples: [
|
|
116
|
-
"service",
|
|
117
|
-
"website",
|
|
118
|
-
"library"
|
|
119
|
-
],
|
|
120
|
-
minLength: 1
|
|
121
|
-
},
|
|
122
|
-
owner: {
|
|
123
|
-
type: "string",
|
|
124
|
-
description: "The user (or group) owner of the template",
|
|
125
|
-
minLength: 1
|
|
126
|
-
},
|
|
127
|
-
parameters: {
|
|
128
|
-
oneOf: [
|
|
129
|
-
{
|
|
130
|
-
type: "object",
|
|
131
|
-
description: "The JSONSchema describing the inputs for the template.",
|
|
132
|
-
properties: {
|
|
133
|
-
"backstage:permissions": {
|
|
134
|
-
type: "object",
|
|
135
|
-
description: "Object used for authorizing the parameter",
|
|
136
|
-
properties: {
|
|
137
|
-
tags: {
|
|
138
|
-
type: "array",
|
|
139
|
-
items: {
|
|
140
|
-
type: "string"
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
type: "array",
|
|
149
|
-
description: "A list of separate forms to collect parameters.",
|
|
150
|
-
items: {
|
|
151
|
-
type: "object",
|
|
152
|
-
description: "The JSONSchema describing the inputs for the template.",
|
|
153
|
-
properties: {
|
|
154
|
-
"backstage:permissions": {
|
|
155
|
-
type: "object",
|
|
156
|
-
description: "Object used for authorizing the parameter",
|
|
157
|
-
properties: {
|
|
158
|
-
tags: {
|
|
159
|
-
type: "array",
|
|
160
|
-
items: {
|
|
161
|
-
type: "string"
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
]
|
|
170
|
-
},
|
|
171
|
-
presentation: {
|
|
172
|
-
type: "object",
|
|
173
|
-
description: "A way to redefine the presentation of the scaffolder.",
|
|
174
|
-
properties: {
|
|
175
|
-
buttonLabels: {
|
|
176
|
-
type: "object",
|
|
177
|
-
description: "A way to redefine the labels for actionable buttons.",
|
|
178
|
-
properties: {
|
|
179
|
-
backButtonText: {
|
|
180
|
-
type: "string",
|
|
181
|
-
description: "A button which return the user to one step back."
|
|
182
|
-
},
|
|
183
|
-
createButtonText: {
|
|
184
|
-
type: "string",
|
|
185
|
-
description: "A button which start the execution of the template."
|
|
186
|
-
},
|
|
187
|
-
reviewButtonText: {
|
|
188
|
-
type: "string",
|
|
189
|
-
description: "A button which open the review step to verify the input prior to start the execution."
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
EXPERIMENTAL_recovery: {
|
|
196
|
-
type: "object",
|
|
197
|
-
description: "A task recovery section.",
|
|
198
|
-
properties: {
|
|
199
|
-
EXPERIMENTAL_strategy: {
|
|
200
|
-
type: "string",
|
|
201
|
-
description: "Recovery strategy for your task (none or startOver). By default none"
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
steps: {
|
|
206
|
-
type: "array",
|
|
207
|
-
description: "A list of steps to execute.",
|
|
208
|
-
items: {
|
|
209
|
-
type: "object",
|
|
210
|
-
description: "A description of the step to execute.",
|
|
211
|
-
required: [
|
|
212
|
-
"action"
|
|
213
|
-
],
|
|
214
|
-
properties: {
|
|
215
|
-
id: {
|
|
216
|
-
type: "string",
|
|
217
|
-
description: "The ID of the step, which can be used to refer to its outputs."
|
|
218
|
-
},
|
|
219
|
-
name: {
|
|
220
|
-
type: "string",
|
|
221
|
-
description: "The name of the step, which will be displayed in the UI during the scaffolding process."
|
|
222
|
-
},
|
|
223
|
-
action: {
|
|
224
|
-
type: "string",
|
|
225
|
-
description: "The name of the action to execute."
|
|
226
|
-
},
|
|
227
|
-
input: {
|
|
228
|
-
type: "object",
|
|
229
|
-
description: "A templated object describing the inputs to the action."
|
|
230
|
-
},
|
|
231
|
-
"if": {
|
|
232
|
-
type: [
|
|
233
|
-
"string",
|
|
234
|
-
"boolean"
|
|
235
|
-
],
|
|
236
|
-
description: "A templated condition that skips the step when evaluated to false. If the condition is true or not defined, the step is executed. The condition is true, if the input is not `false`, `undefined`, `null`, `\"\"`, `0`, or `[]`."
|
|
237
|
-
},
|
|
238
|
-
"backstage:permissions": {
|
|
239
|
-
type: "object",
|
|
240
|
-
description: "Object used for authorizing the step",
|
|
241
|
-
properties: {
|
|
242
|
-
tags: {
|
|
243
|
-
type: "array",
|
|
244
|
-
items: {
|
|
245
|
-
type: "string"
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
output: {
|
|
254
|
-
type: "object",
|
|
255
|
-
description: "A templated object describing the outputs of the scaffolding task.",
|
|
256
|
-
properties: {
|
|
257
|
-
links: {
|
|
258
|
-
type: "array",
|
|
259
|
-
description: "A list of external hyperlinks, typically pointing to resources created or updated by the template",
|
|
260
|
-
items: {
|
|
261
|
-
type: "object",
|
|
262
|
-
required: [
|
|
263
|
-
],
|
|
264
|
-
properties: {
|
|
265
|
-
url: {
|
|
266
|
-
type: "string",
|
|
267
|
-
description: "A url in a standard uri format.",
|
|
268
|
-
examples: [
|
|
269
|
-
"https://github.com/my-org/my-new-repo"
|
|
270
|
-
],
|
|
271
|
-
minLength: 1
|
|
272
|
-
},
|
|
273
|
-
entityRef: {
|
|
274
|
-
type: "string",
|
|
275
|
-
description: "An entity reference to an entity in the catalog.",
|
|
276
|
-
examples: [
|
|
277
|
-
"Component:default/my-app"
|
|
278
|
-
],
|
|
279
|
-
minLength: 1
|
|
280
|
-
},
|
|
281
|
-
title: {
|
|
282
|
-
type: "string",
|
|
283
|
-
description: "A user friendly display name for the link.",
|
|
284
|
-
examples: [
|
|
285
|
-
"View new repo"
|
|
286
|
-
],
|
|
287
|
-
minLength: 1
|
|
288
|
-
},
|
|
289
|
-
icon: {
|
|
290
|
-
type: "string",
|
|
291
|
-
description: "A key representing a visual icon to be displayed in the UI.",
|
|
292
|
-
examples: [
|
|
293
|
-
"dashboard"
|
|
294
|
-
],
|
|
295
|
-
minLength: 1
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
text: {
|
|
301
|
-
type: "array",
|
|
302
|
-
description: "A list of Markdown text blobs, like output data from the template.",
|
|
303
|
-
items: {
|
|
304
|
-
type: "object",
|
|
305
|
-
required: [
|
|
306
|
-
],
|
|
307
|
-
properties: {
|
|
308
|
-
title: {
|
|
309
|
-
type: "string",
|
|
310
|
-
description: "A user friendly display name for the text.",
|
|
311
|
-
examples: [
|
|
312
|
-
"Output Content"
|
|
313
|
-
],
|
|
314
|
-
minLength: 1
|
|
315
|
-
},
|
|
316
|
-
icon: {
|
|
317
|
-
type: "string",
|
|
318
|
-
description: "A key representing a visual icon to be displayed in the UI.",
|
|
319
|
-
examples: [
|
|
320
|
-
"dashboard"
|
|
321
|
-
],
|
|
322
|
-
minLength: 1
|
|
323
|
-
},
|
|
324
|
-
content: {
|
|
325
|
-
type: "string",
|
|
326
|
-
description: "The text blob to display in the UI, rendered as Markdown.",
|
|
327
|
-
examples: [
|
|
328
|
-
"**hey** _I'm_ Markdown"
|
|
329
|
-
]
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
additionalProperties: {
|
|
336
|
-
type: "string"
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
];
|
|
344
|
-
var schema = {
|
|
345
|
-
$schema: $schema,
|
|
346
|
-
$id: $id,
|
|
347
|
-
description: description,
|
|
348
|
-
examples: examples,
|
|
349
|
-
allOf: allOf
|
|
350
|
-
};
|
|
351
5
|
|
|
352
|
-
const validator = catalogModel.entityKindSchemaValidator(schema);
|
|
353
|
-
const templateEntityV1beta3Validator = {
|
|
354
|
-
// TODO(freben): Emulate the old KindValidator until we fix that type
|
|
355
|
-
async check(data) {
|
|
356
|
-
return validator(data) === data;
|
|
357
|
-
}
|
|
358
|
-
};
|
|
359
|
-
const isTemplateEntityV1beta3 = (entity) => entity.apiVersion === "scaffolder.backstage.io/v1beta3" && entity.kind === "Template";
|
|
360
6
|
|
|
361
|
-
exports.isTemplateEntityV1beta3 = isTemplateEntityV1beta3;
|
|
362
|
-
exports.templateEntityV1beta3Validator = templateEntityV1beta3Validator;
|
|
7
|
+
exports.isTemplateEntityV1beta3 = TemplateEntityV1beta3.isTemplateEntityV1beta3;
|
|
8
|
+
exports.templateEntityV1beta3Validator = TemplateEntityV1beta3.templateEntityV1beta3Validator;
|
|
363
9
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pluginPermissionCommon = require('@backstage/plugin-permission-common');
|
|
4
|
+
|
|
5
|
+
const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = "scaffolder-template";
|
|
6
|
+
const RESOURCE_TYPE_SCAFFOLDER_ACTION = "scaffolder-action";
|
|
7
|
+
const actionExecutePermission = pluginPermissionCommon.createPermission({
|
|
8
|
+
name: "scaffolder.action.execute",
|
|
9
|
+
attributes: {},
|
|
10
|
+
resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION
|
|
11
|
+
});
|
|
12
|
+
const templateParameterReadPermission = pluginPermissionCommon.createPermission({
|
|
13
|
+
name: "scaffolder.template.parameter.read",
|
|
14
|
+
attributes: {
|
|
15
|
+
action: "read"
|
|
16
|
+
},
|
|
17
|
+
resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
|
|
18
|
+
});
|
|
19
|
+
const templateStepReadPermission = pluginPermissionCommon.createPermission({
|
|
20
|
+
name: "scaffolder.template.step.read",
|
|
21
|
+
attributes: {
|
|
22
|
+
action: "read"
|
|
23
|
+
},
|
|
24
|
+
resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE
|
|
25
|
+
});
|
|
26
|
+
const taskReadPermission = pluginPermissionCommon.createPermission({
|
|
27
|
+
name: "scaffolder.task.read",
|
|
28
|
+
attributes: {
|
|
29
|
+
action: "read"
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const taskCreatePermission = pluginPermissionCommon.createPermission({
|
|
33
|
+
name: "scaffolder.task.create",
|
|
34
|
+
attributes: {
|
|
35
|
+
action: "create"
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
const taskCancelPermission = pluginPermissionCommon.createPermission({
|
|
39
|
+
name: "scaffolder.task.cancel",
|
|
40
|
+
attributes: {}
|
|
41
|
+
});
|
|
42
|
+
const templateManagementPermission = pluginPermissionCommon.createPermission({
|
|
43
|
+
name: "scaffolder.template.management",
|
|
44
|
+
attributes: {}
|
|
45
|
+
});
|
|
46
|
+
const scaffolderTemplatePermissions = [
|
|
47
|
+
templateParameterReadPermission,
|
|
48
|
+
templateStepReadPermission
|
|
49
|
+
];
|
|
50
|
+
const scaffolderActionPermissions = [actionExecutePermission];
|
|
51
|
+
const scaffolderTaskPermissions = [
|
|
52
|
+
taskCancelPermission,
|
|
53
|
+
taskCreatePermission,
|
|
54
|
+
taskReadPermission
|
|
55
|
+
];
|
|
56
|
+
const scaffolderPermissions = [
|
|
57
|
+
...scaffolderTemplatePermissions,
|
|
58
|
+
...scaffolderActionPermissions,
|
|
59
|
+
...scaffolderTaskPermissions,
|
|
60
|
+
templateManagementPermission
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
exports.RESOURCE_TYPE_SCAFFOLDER_ACTION = RESOURCE_TYPE_SCAFFOLDER_ACTION;
|
|
64
|
+
exports.RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = RESOURCE_TYPE_SCAFFOLDER_TEMPLATE;
|
|
65
|
+
exports.actionExecutePermission = actionExecutePermission;
|
|
66
|
+
exports.scaffolderActionPermissions = scaffolderActionPermissions;
|
|
67
|
+
exports.scaffolderPermissions = scaffolderPermissions;
|
|
68
|
+
exports.scaffolderTaskPermissions = scaffolderTaskPermissions;
|
|
69
|
+
exports.scaffolderTemplatePermissions = scaffolderTemplatePermissions;
|
|
70
|
+
exports.taskCancelPermission = taskCancelPermission;
|
|
71
|
+
exports.taskCreatePermission = taskCreatePermission;
|
|
72
|
+
exports.taskReadPermission = taskReadPermission;
|
|
73
|
+
exports.templateManagementPermission = templateManagementPermission;
|
|
74
|
+
exports.templateParameterReadPermission = templateParameterReadPermission;
|
|
75
|
+
exports.templateStepReadPermission = templateStepReadPermission;
|
|
76
|
+
//# sourceMappingURL=permissions.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"permissions.cjs.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * Permission resource type which corresponds to a scaffolder action.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_ACTION = 'scaffolder-action';\n\n/**\n * This permission is used to authorize actions that involve executing\n * an action from a template.\n *\n * @alpha\n */\nexport const actionExecutePermission = createPermission({\n name: 'scaffolder.action.execute',\n attributes: {},\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,\n * and reading logs of tasks\n *\n * @alpha\n */\nexport const taskReadPermission = createPermission({\n name: 'scaffolder.task.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the creation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCreatePermission = createPermission({\n name: 'scaffolder.task.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCancelPermission = createPermission({\n name: 'scaffolder.task.cancel',\n attributes: {},\n});\n\n/**\n * This permission is used to authorize template management features.\n *\n * @alpha\n */\nexport const templateManagementPermission = createPermission({\n name: 'scaffolder.template.management',\n attributes: {},\n});\n\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder tasks.\n * @alpha\n */\nexport const scaffolderTaskPermissions = [\n taskCancelPermission,\n taskCreatePermission,\n taskReadPermission,\n];\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n ...scaffolderTemplatePermissions,\n ...scaffolderActionPermissions,\n ...scaffolderTaskPermissions,\n templateManagementPermission,\n];\n"],"names":["createPermission"],"mappings":";;;;AAuBO,MAAM,iCAAoC,GAAA;AAO1C,MAAM,+BAAkC,GAAA;AAQxC,MAAM,0BAA0BA,uCAAiB,CAAA;AAAA,EACtD,IAAM,EAAA,2BAAA;AAAA,EACN,YAAY,EAAC;AAAA,EACb,YAAc,EAAA;AAChB,CAAC;AAYM,MAAM,kCAAkCA,uCAAiB,CAAA;AAAA,EAC9D,IAAM,EAAA,oCAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA;AAChB,CAAC;AAYM,MAAM,6BAA6BA,uCAAiB,CAAA;AAAA,EACzD,IAAM,EAAA,+BAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA;AAChB,CAAC;AAQM,MAAM,qBAAqBA,uCAAiB,CAAA;AAAA,EACjD,IAAM,EAAA,sBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA;AAEZ,CAAC;AAOM,MAAM,uBAAuBA,uCAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA;AAEZ,CAAC;AAOM,MAAM,uBAAuBA,uCAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,YAAY;AACd,CAAC;AAOM,MAAM,+BAA+BA,uCAAiB,CAAA;AAAA,EAC3D,IAAM,EAAA,gCAAA;AAAA,EACN,YAAY;AACd,CAAC;AAMM,MAAM,6BAAgC,GAAA;AAAA,EAC3C,+BAAA;AAAA,EACA;AACF;AAMa,MAAA,2BAAA,GAA8B,CAAC,uBAAuB;AAM5D,MAAM,yBAA4B,GAAA;AAAA,EACvC,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF;AAMO,MAAM,qBAAwB,GAAA;AAAA,EACnC,GAAG,6BAAA;AAAA,EACH,GAAG,2BAAA;AAAA,EACH,GAAG,yBAAA;AAAA,EACH;AACF;;;;;;;;;;;;;;;;"}
|
package/dist/permissions.esm.js
CHANGED
|
@@ -37,6 +37,10 @@ const taskCancelPermission = createPermission({
|
|
|
37
37
|
name: "scaffolder.task.cancel",
|
|
38
38
|
attributes: {}
|
|
39
39
|
});
|
|
40
|
+
const templateManagementPermission = createPermission({
|
|
41
|
+
name: "scaffolder.template.management",
|
|
42
|
+
attributes: {}
|
|
43
|
+
});
|
|
40
44
|
const scaffolderTemplatePermissions = [
|
|
41
45
|
templateParameterReadPermission,
|
|
42
46
|
templateStepReadPermission
|
|
@@ -50,8 +54,9 @@ const scaffolderTaskPermissions = [
|
|
|
50
54
|
const scaffolderPermissions = [
|
|
51
55
|
...scaffolderTemplatePermissions,
|
|
52
56
|
...scaffolderActionPermissions,
|
|
53
|
-
...scaffolderTaskPermissions
|
|
57
|
+
...scaffolderTaskPermissions,
|
|
58
|
+
templateManagementPermission
|
|
54
59
|
];
|
|
55
60
|
|
|
56
|
-
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateParameterReadPermission, templateStepReadPermission };
|
|
61
|
+
export { RESOURCE_TYPE_SCAFFOLDER_ACTION, RESOURCE_TYPE_SCAFFOLDER_TEMPLATE, actionExecutePermission, scaffolderActionPermissions, scaffolderPermissions, scaffolderTaskPermissions, scaffolderTemplatePermissions, taskCancelPermission, taskCreatePermission, taskReadPermission, templateManagementPermission, templateParameterReadPermission, templateStepReadPermission };
|
|
57
62
|
//# sourceMappingURL=permissions.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.esm.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * Permission resource type which corresponds to a scaffolder action.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_ACTION = 'scaffolder-action';\n\n/**\n * This permission is used to authorize actions that involve executing\n * an action from a template.\n *\n * @alpha\n */\nexport const actionExecutePermission = createPermission({\n name: 'scaffolder.action.execute',\n attributes: {},\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,\n * and reading logs of tasks\n *\n * @alpha\n */\nexport const taskReadPermission = createPermission({\n name: 'scaffolder.task.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the creation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCreatePermission = createPermission({\n name: 'scaffolder.task.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCancelPermission = createPermission({\n name: 'scaffolder.task.cancel',\n attributes: {},\n});\n\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder tasks.\n * @alpha\n */\nexport const scaffolderTaskPermissions = [\n taskCancelPermission,\n taskCreatePermission,\n taskReadPermission,\n];\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n ...scaffolderTemplatePermissions,\n ...scaffolderActionPermissions,\n ...scaffolderTaskPermissions,\n];\n"],"names":[],"mappings":";;AAuBO,MAAM,iCAAoC,GAAA
|
|
1
|
+
{"version":3,"file":"permissions.esm.js","sources":["../src/permissions.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createPermission } from '@backstage/plugin-permission-common';\n\n/**\n * Permission resource type which corresponds to a scaffolder templates.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_TEMPLATE = 'scaffolder-template';\n\n/**\n * Permission resource type which corresponds to a scaffolder action.\n *\n * @alpha\n */\nexport const RESOURCE_TYPE_SCAFFOLDER_ACTION = 'scaffolder-action';\n\n/**\n * This permission is used to authorize actions that involve executing\n * an action from a template.\n *\n * @alpha\n */\nexport const actionExecutePermission = createPermission({\n name: 'scaffolder.action.execute',\n attributes: {},\n resourceType: RESOURCE_TYPE_SCAFFOLDER_ACTION,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more parameters from a template.\n *\n * If this permission is not authorized, it will appear that the\n * parameter does not exist in the template — both in the frontend\n * and in API responses.\n *\n * @alpha\n */\nexport const templateParameterReadPermission = createPermission({\n name: 'scaffolder.template.parameter.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading\n * one or more steps from a template.\n *\n * If this permission is not authorized, it will appear that the\n * step does not exist in the template — both in the frontend\n * and in API responses. Steps will also not be executed.\n *\n * @alpha\n */\nexport const templateStepReadPermission = createPermission({\n name: 'scaffolder.template.step.read',\n attributes: {\n action: 'read',\n },\n resourceType: RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,\n});\n\n/**\n * This permission is used to authorize actions that involve reading one or more tasks in the scaffolder,\n * and reading logs of tasks\n *\n * @alpha\n */\nexport const taskReadPermission = createPermission({\n name: 'scaffolder.task.read',\n attributes: {\n action: 'read',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the creation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCreatePermission = createPermission({\n name: 'scaffolder.task.create',\n attributes: {\n action: 'create',\n },\n});\n\n/**\n * This permission is used to authorize actions that involve the cancellation of tasks in the scaffolder.\n *\n * @alpha\n */\nexport const taskCancelPermission = createPermission({\n name: 'scaffolder.task.cancel',\n attributes: {},\n});\n\n/**\n * This permission is used to authorize template management features.\n *\n * @alpha\n */\nexport const templateManagementPermission = createPermission({\n name: 'scaffolder.template.management',\n attributes: {},\n});\n\n/**\n * List of the scaffolder permissions that are associated with template steps and parameters.\n * @alpha\n */\nexport const scaffolderTemplatePermissions = [\n templateParameterReadPermission,\n templateStepReadPermission,\n];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder actions.\n * @alpha\n */\nexport const scaffolderActionPermissions = [actionExecutePermission];\n\n/**\n * List of the scaffolder permissions that are associated with scaffolder tasks.\n * @alpha\n */\nexport const scaffolderTaskPermissions = [\n taskCancelPermission,\n taskCreatePermission,\n taskReadPermission,\n];\n\n/**\n * List of all the scaffolder permissions\n * @alpha\n */\nexport const scaffolderPermissions = [\n ...scaffolderTemplatePermissions,\n ...scaffolderActionPermissions,\n ...scaffolderTaskPermissions,\n templateManagementPermission,\n];\n"],"names":[],"mappings":";;AAuBO,MAAM,iCAAoC,GAAA;AAO1C,MAAM,+BAAkC,GAAA;AAQxC,MAAM,0BAA0B,gBAAiB,CAAA;AAAA,EACtD,IAAM,EAAA,2BAAA;AAAA,EACN,YAAY,EAAC;AAAA,EACb,YAAc,EAAA;AAChB,CAAC;AAYM,MAAM,kCAAkC,gBAAiB,CAAA;AAAA,EAC9D,IAAM,EAAA,oCAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA;AAChB,CAAC;AAYM,MAAM,6BAA6B,gBAAiB,CAAA;AAAA,EACzD,IAAM,EAAA,+BAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA,GACV;AAAA,EACA,YAAc,EAAA;AAChB,CAAC;AAQM,MAAM,qBAAqB,gBAAiB,CAAA;AAAA,EACjD,IAAM,EAAA,sBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA;AAEZ,CAAC;AAOM,MAAM,uBAAuB,gBAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,UAAY,EAAA;AAAA,IACV,MAAQ,EAAA;AAAA;AAEZ,CAAC;AAOM,MAAM,uBAAuB,gBAAiB,CAAA;AAAA,EACnD,IAAM,EAAA,wBAAA;AAAA,EACN,YAAY;AACd,CAAC;AAOM,MAAM,+BAA+B,gBAAiB,CAAA;AAAA,EAC3D,IAAM,EAAA,gCAAA;AAAA,EACN,YAAY;AACd,CAAC;AAMM,MAAM,6BAAgC,GAAA;AAAA,EAC3C,+BAAA;AAAA,EACA;AACF;AAMa,MAAA,2BAAA,GAA8B,CAAC,uBAAuB;AAM5D,MAAM,yBAA4B,GAAA;AAAA,EACvC,oBAAA;AAAA,EACA,oBAAA;AAAA,EACA;AACF;AAMO,MAAM,qBAAwB,GAAA;AAAA,EACnC,GAAG,6BAAA;AAAA,EACH,GAAG,2BAAA;AAAA,EACH,GAAG,yBAAA;AAAA,EACH;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-common",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.7",
|
|
4
4
|
"description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "common-library",
|
|
@@ -48,9 +48,18 @@
|
|
|
48
48
|
},
|
|
49
49
|
"main": "./dist/index.cjs.js",
|
|
50
50
|
"types": "./dist/index.d.ts",
|
|
51
|
+
"typesVersions": {
|
|
52
|
+
"*": {
|
|
53
|
+
"index": [
|
|
54
|
+
"dist/index.d.ts"
|
|
55
|
+
],
|
|
56
|
+
"alpha": [
|
|
57
|
+
"dist/alpha.d.ts"
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
51
61
|
"files": [
|
|
52
|
-
"dist"
|
|
53
|
-
"alpha"
|
|
62
|
+
"dist"
|
|
54
63
|
],
|
|
55
64
|
"scripts": {
|
|
56
65
|
"build": "backstage-cli package build",
|
|
@@ -61,12 +70,12 @@
|
|
|
61
70
|
"test": "backstage-cli package test"
|
|
62
71
|
},
|
|
63
72
|
"dependencies": {
|
|
64
|
-
"@backstage/catalog-model": "^1.7.
|
|
65
|
-
"@backstage/plugin-permission-common": "^0.8.
|
|
66
|
-
"@backstage/types": "^1.
|
|
73
|
+
"@backstage/catalog-model": "^1.7.1",
|
|
74
|
+
"@backstage/plugin-permission-common": "^0.8.2",
|
|
75
|
+
"@backstage/types": "^1.2.0"
|
|
67
76
|
},
|
|
68
77
|
"devDependencies": {
|
|
69
|
-
"@backstage/cli": "^0.
|
|
78
|
+
"@backstage/cli": "^0.29.0"
|
|
70
79
|
},
|
|
71
80
|
"module": "./dist/index.esm.js"
|
|
72
81
|
}
|