repo-util 1.19.0 → 1.19.1
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/package.json +6 -6
- package/src/repo-util-cli.mjs +64 -96
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repo-util",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 2m tests/*.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"aggregation-repository-provider": "^5.2.
|
|
25
|
-
"bitbucket-repository-provider": "^4.1.
|
|
24
|
+
"aggregation-repository-provider": "^5.2.25",
|
|
25
|
+
"bitbucket-repository-provider": "^4.1.23",
|
|
26
26
|
"commander": "^9.2.0",
|
|
27
|
-
"gitea-repository-provider": "^2.1.
|
|
28
|
-
"github-repository-provider": "^7.
|
|
29
|
-
"local-repository-provider": "^8.0.
|
|
27
|
+
"gitea-repository-provider": "^2.1.55",
|
|
28
|
+
"github-repository-provider": "^7.29.1",
|
|
29
|
+
"local-repository-provider": "^8.0.10"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"ava": "^4.2.0",
|
package/src/repo-util-cli.mjs
CHANGED
|
@@ -38,110 +38,69 @@ program
|
|
|
38
38
|
);
|
|
39
39
|
|
|
40
40
|
for (const o of [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
{
|
|
46
|
-
update: {
|
|
47
|
-
description: "update provider attributes",
|
|
48
|
-
executeInstance: async provider => provider.update(properties)
|
|
49
|
-
}
|
|
41
|
+
type(MultiGroupProvider, {
|
|
42
|
+
update: {
|
|
43
|
+
description: "update provider attributes",
|
|
44
|
+
executeInstance: async provider => provider.update(properties)
|
|
50
45
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
update: {
|
|
58
|
-
description: "update group attributes",
|
|
59
|
-
executeInstance: async group => group.update(properties)
|
|
60
|
-
}
|
|
46
|
+
}),
|
|
47
|
+
type(RepositoryGroup, {
|
|
48
|
+
update: {
|
|
49
|
+
description: "update group attributes",
|
|
50
|
+
executeInstance: async group => group.update(properties)
|
|
61
51
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
description: "create repositories",
|
|
75
|
-
execute: async (provider, names, options) => {
|
|
76
|
-
for (const name of names) {
|
|
77
|
-
await provider.createRepository(name, properties);
|
|
78
|
-
}
|
|
52
|
+
}),
|
|
53
|
+
type(Repository, {
|
|
54
|
+
update: {
|
|
55
|
+
description: "update repository attributes",
|
|
56
|
+
executeInstance: async repository => repository.update(properties)
|
|
57
|
+
},
|
|
58
|
+
create: {
|
|
59
|
+
suffix: "<names>",
|
|
60
|
+
description: "create repositories",
|
|
61
|
+
execute: async (provider, names, options) => {
|
|
62
|
+
for (const name of names) {
|
|
63
|
+
await provider.createRepository(name, properties);
|
|
79
64
|
}
|
|
80
65
|
}
|
|
81
66
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
[
|
|
95
|
-
"milestone",
|
|
96
|
-
"milestones",
|
|
97
|
-
["fullName", ...Object.keys(visibleAttributes(Milestone))]
|
|
98
|
-
],
|
|
99
|
-
[
|
|
100
|
-
"application",
|
|
101
|
-
"applications",
|
|
102
|
-
["fullName", ...Object.keys(visibleAttributes(Application))]
|
|
103
|
-
],
|
|
104
|
-
[
|
|
105
|
-
"hook",
|
|
106
|
-
"hooks",
|
|
107
|
-
["url", ...Object.keys(visibleAttributes(Hook))],
|
|
108
|
-
{
|
|
109
|
-
create: {
|
|
110
|
-
suffix: "<name>",
|
|
111
|
-
description: "create a hook",
|
|
112
|
-
execute: () => {
|
|
113
|
-
console.log("create a hook");
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
update: {
|
|
117
|
-
description: "update hook attributes",
|
|
118
|
-
executeInstance: hook => hook.update(properties)
|
|
119
|
-
},
|
|
120
|
-
delete: {
|
|
121
|
-
description: "delete a hook",
|
|
122
|
-
executeInstance: hook => hook.delete()
|
|
67
|
+
}),
|
|
68
|
+
type(Branch),
|
|
69
|
+
type(Tag),
|
|
70
|
+
type(Project),
|
|
71
|
+
type(Milestone),
|
|
72
|
+
type(Application),
|
|
73
|
+
type(Hook, {
|
|
74
|
+
create: {
|
|
75
|
+
suffix: "<name>",
|
|
76
|
+
description: "create a hook",
|
|
77
|
+
execute: () => {
|
|
78
|
+
console.log("create a hook");
|
|
123
79
|
}
|
|
80
|
+
},
|
|
81
|
+
update: {
|
|
82
|
+
description: "update hook attributes",
|
|
83
|
+
executeInstance: hook => hook.update(properties)
|
|
84
|
+
},
|
|
85
|
+
delete: {
|
|
86
|
+
description: "delete a hook",
|
|
87
|
+
executeInstance: hook => hook.delete()
|
|
124
88
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
decline: {
|
|
140
|
-
description: "decline the pr",
|
|
141
|
-
executeInstance: pr => pr.decline()
|
|
142
|
-
}
|
|
89
|
+
}),
|
|
90
|
+
type(PullRequest, {
|
|
91
|
+
update: {
|
|
92
|
+
description: "update pr attributes",
|
|
93
|
+
executeInstance: pr => pr.update(properties)
|
|
94
|
+
},
|
|
95
|
+
merge: {
|
|
96
|
+
description: "merge the pr",
|
|
97
|
+
executeInstance: pr => pr.merge()
|
|
98
|
+
},
|
|
99
|
+
decline: {
|
|
100
|
+
description: "decline the pr",
|
|
101
|
+
executeInstance: pr => pr.decline()
|
|
143
102
|
}
|
|
144
|
-
|
|
103
|
+
})
|
|
145
104
|
]) {
|
|
146
105
|
const command = program.command(`${o[0]} [name...]`);
|
|
147
106
|
command
|
|
@@ -266,3 +225,12 @@ function visibleAttributes(object) {
|
|
|
266
225
|
)
|
|
267
226
|
);
|
|
268
227
|
}
|
|
228
|
+
|
|
229
|
+
function type(clazz, extra) {
|
|
230
|
+
return [
|
|
231
|
+
clazz.type,
|
|
232
|
+
clazz.collectionName,
|
|
233
|
+
["fullName", ...Object.keys(visibleAttributes(clazz))],
|
|
234
|
+
extra
|
|
235
|
+
];
|
|
236
|
+
}
|