@backstage/plugin-scaffolder-common 0.2.0 → 0.2.3
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 +30 -0
- package/dist/index.d.ts +151 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @backstage/plugin-scaffolder-common
|
|
2
2
|
|
|
3
|
+
## 0.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/catalog-model@0.12.0
|
|
9
|
+
|
|
10
|
+
## 0.2.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- a4d53fe18e: **DEPRECATED** - The `TaskSpec.metadata` and `TaskSpec.baseUrl` has been deprecated in favour of the new `TaskSpec.templateInfo`.
|
|
15
|
+
The `baseUrl` is now found on the `templateInfo` object, and the name can be inferred from the `templateInfo.entityRef` property.
|
|
16
|
+
|
|
17
|
+
Usages of `TaskSpec.metadata.name` or `ctx.metadata.name` in Actions should migrate to using `parseEntityRef(taskSpec.templateInfo.entityRef)` to get the parsed entity triplet.
|
|
18
|
+
|
|
19
|
+
Usages of `ctx.baseUrl` in Actions should migrate to using `ctx.templateInfo.baseUrl` instead.
|
|
20
|
+
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
- @backstage/catalog-model@0.11.0
|
|
23
|
+
|
|
24
|
+
## 0.2.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Fix for the previous release with missing type declarations.
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
- @backstage/catalog-model@0.10.1
|
|
31
|
+
- @backstage/types@0.1.3
|
|
32
|
+
|
|
3
33
|
## 0.2.0
|
|
4
34
|
|
|
5
35
|
### Minor Changes
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { JsonObject, JsonValue } from '@backstage/types';
|
|
2
|
+
import { Entity, KindValidator } from '@backstage/catalog-model';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Metadata about the Template that was the originator of a scaffolder task, as
|
|
6
|
+
* stored in the database.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
* @deprecated use templateInfo on the spec instead
|
|
10
|
+
*/
|
|
11
|
+
declare type TemplateMetadata = {
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Information about a template that is stored on a task specification.
|
|
16
|
+
* Includes a stringified entityRef, and the baseUrl which is usually the relative path of the template definition
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
declare type TemplateInfo = {
|
|
21
|
+
entityRef: string;
|
|
22
|
+
baseUrl?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* An individual step of a scaffolder task, as stored in the database.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
interface TaskStep {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
action: string;
|
|
33
|
+
input?: JsonObject;
|
|
34
|
+
if?: string | boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A scaffolder task as stored in the database, generated from a v1beta2
|
|
38
|
+
* apiVersion Template.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
* @deprecated Please convert your templates to TaskSpecV1beta3 on apiVersion
|
|
42
|
+
* scaffolder.backstage.io/v1beta3
|
|
43
|
+
*/
|
|
44
|
+
interface TaskSpecV1beta2 {
|
|
45
|
+
apiVersion: 'backstage.io/v1beta2';
|
|
46
|
+
/** @deprecated use templateInfo.baseUrl instead */
|
|
47
|
+
baseUrl?: string;
|
|
48
|
+
values: JsonObject;
|
|
49
|
+
steps: TaskStep[];
|
|
50
|
+
output: {
|
|
51
|
+
[name: string]: string;
|
|
52
|
+
};
|
|
53
|
+
/** @deprecated use templateInfo instead */
|
|
54
|
+
metadata?: TemplateMetadata;
|
|
55
|
+
templateInfo?: TemplateInfo;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A scaffolder task as stored in the database, generated from a v1beta3
|
|
59
|
+
* apiVersion Template.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
interface TaskSpecV1beta3 {
|
|
64
|
+
apiVersion: 'scaffolder.backstage.io/v1beta3';
|
|
65
|
+
/** @deprecated use templateInfo.baseUrl instead */
|
|
66
|
+
baseUrl?: string;
|
|
67
|
+
parameters: JsonObject;
|
|
68
|
+
steps: TaskStep[];
|
|
69
|
+
output: {
|
|
70
|
+
[name: string]: JsonValue;
|
|
71
|
+
};
|
|
72
|
+
/** @deprecated use templateInfo instead */
|
|
73
|
+
metadata?: TemplateMetadata;
|
|
74
|
+
templateInfo?: TemplateInfo;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A scaffolder task as stored in the database, generated from a Template.
|
|
78
|
+
*
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
declare type TaskSpec = TaskSpecV1beta2 | TaskSpecV1beta3;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Backstage catalog Template kind Entity. Templates are used by the Scaffolder
|
|
85
|
+
* plugin to create new entities, such as Components.
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
* @deprecated Please convert your templates to TemplateEntityV1beta3 on
|
|
89
|
+
* apiVersion scaffolder.backstage.io/v1beta3
|
|
90
|
+
*/
|
|
91
|
+
interface TemplateEntityV1beta2 extends Entity {
|
|
92
|
+
apiVersion: 'backstage.io/v1beta2';
|
|
93
|
+
kind: 'Template';
|
|
94
|
+
spec: {
|
|
95
|
+
type: string;
|
|
96
|
+
parameters?: JsonObject | JsonObject[];
|
|
97
|
+
steps: Array<{
|
|
98
|
+
id?: string;
|
|
99
|
+
name?: string;
|
|
100
|
+
action: string;
|
|
101
|
+
input?: JsonObject;
|
|
102
|
+
if?: string | boolean;
|
|
103
|
+
}>;
|
|
104
|
+
output?: {
|
|
105
|
+
[name: string]: string;
|
|
106
|
+
};
|
|
107
|
+
owner?: string;
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Entity data validator for {@link TemplateEntityV1beta2}.
|
|
112
|
+
*
|
|
113
|
+
* @public
|
|
114
|
+
* @deprecated Please convert your templates to TemplateEntityV1beta3 on
|
|
115
|
+
* apiVersion scaffolder.backstage.io/v1beta3
|
|
116
|
+
*/
|
|
117
|
+
declare const templateEntityV1beta2Validator: KindValidator;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Backstage catalog Template kind Entity. Templates are used by the Scaffolder
|
|
121
|
+
* plugin to create new entities, such as Components.
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
interface TemplateEntityV1beta3 extends Entity {
|
|
126
|
+
apiVersion: 'scaffolder.backstage.io/v1beta3';
|
|
127
|
+
kind: 'Template';
|
|
128
|
+
spec: {
|
|
129
|
+
type: string;
|
|
130
|
+
parameters?: JsonObject | JsonObject[];
|
|
131
|
+
steps: Array<{
|
|
132
|
+
id?: string;
|
|
133
|
+
name?: string;
|
|
134
|
+
action: string;
|
|
135
|
+
input?: JsonObject;
|
|
136
|
+
if?: string | boolean;
|
|
137
|
+
}>;
|
|
138
|
+
output?: {
|
|
139
|
+
[name: string]: string;
|
|
140
|
+
};
|
|
141
|
+
owner?: string;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Entity data validator for {@link TemplateEntityV1beta3}.
|
|
146
|
+
*
|
|
147
|
+
* @public
|
|
148
|
+
*/
|
|
149
|
+
declare const templateEntityV1beta3Validator: KindValidator;
|
|
150
|
+
|
|
151
|
+
export { TaskSpec, TaskSpecV1beta2, TaskSpecV1beta3, TaskStep, TemplateEntityV1beta2, TemplateEntityV1beta3, TemplateInfo, TemplateMetadata, templateEntityV1beta2Validator, templateEntityV1beta3Validator };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-scaffolder-common",
|
|
3
3
|
"description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"url": "https://github.com/backstage/backstage/issues"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@backstage/catalog-model": "^0.
|
|
43
|
-
"@backstage/types": "^0.1.
|
|
42
|
+
"@backstage/catalog-model": "^0.12.0",
|
|
43
|
+
"@backstage/types": "^0.1.3"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@backstage/cli": "^0.
|
|
46
|
+
"@backstage/cli": "^0.15.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "04bb0dd824b78f6b57dac62c3015e681f094045c",
|
|
49
49
|
"module": "dist/index.esm.js"
|
|
50
50
|
}
|