repo-util 1.13.11 → 1.14.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repo-util",
3
- "version": "1.13.11",
3
+ "version": "1.14.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,13 +23,13 @@
23
23
  "dependencies": {
24
24
  "aggregation-repository-provider": "^4.0.46",
25
25
  "bitbucket-repository-provider": "^3.10.22",
26
- "commander": "^9.1.0",
27
- "gitea-repository-provider": "^2.1.18",
28
- "github-repository-provider": "^7.26.0",
26
+ "commander": "^9.2.0",
27
+ "gitea-repository-provider": "^2.1.20",
28
+ "github-repository-provider": "^7.26.6",
29
29
  "local-repository-provider": "^8.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "ava": "^4.1.0",
32
+ "ava": "^4.2.0",
33
33
  "c8": "^7.11.0",
34
34
  "execa": "^6.1.0",
35
35
  "semantic-release": "^19.0.2"
@@ -15,18 +15,6 @@ const { version, description } = JSON.parse(
15
15
 
16
16
  const properties = {};
17
17
 
18
- async function prepareProvider() {
19
- const provider = await AggregationProvider.initialize([], properties, process.env);
20
-
21
- provider.messageDestination = {
22
- info : () => {},
23
- warn : console.warn,
24
- error: console.error
25
- };
26
-
27
- return provider;
28
- }
29
-
30
18
  program
31
19
  .description(description)
32
20
  .version(version)
@@ -43,7 +31,12 @@ for (const o of [
43
31
  ["branch", "branches", ["fullName"]],
44
32
  ["project", "projects", ["fullName"]],
45
33
  ["milestone", "milestones", ["fullName"]],
46
- ["hook", "hooks", ["url"]],
34
+ [
35
+ "hook",
36
+ "hooks",
37
+ ["url", "events", "active"],
38
+ { create: { description: "create a hook", execute: () => {} } }
39
+ ],
47
40
  [
48
41
  "pull-request",
49
42
  "pullRequests",
@@ -55,6 +48,7 @@ for (const o of [
55
48
 
56
49
  command
57
50
  .option("--json", "output as json")
51
+ .option("--no-identifier", "do not output identifier attributes only")
58
52
  .option("-a, --attribute <attributes>", "list attribute", a =>
59
53
  a.split(",")
60
54
  );
@@ -116,7 +110,18 @@ async function list(provider, names, options, slot, attributes, actions) {
116
110
  json.push(object);
117
111
  } else {
118
112
  for (const a of attributes) {
119
- console.log(object.fullName + ":", object[a]);
113
+ let value = object[a];
114
+ if (Array.isArray(value)) {
115
+ value = value.join(" ");
116
+ } else if (value instanceof Set) {
117
+ value = [...value].join(" ");
118
+ }
119
+
120
+ if (options.identifier === false) {
121
+ console.log(value);
122
+ } else {
123
+ console.log(object.fullName + ":", value);
124
+ }
120
125
  }
121
126
  }
122
127
  }
@@ -126,3 +131,19 @@ async function list(provider, names, options, slot, attributes, actions) {
126
131
  console.log(JSON.stringify(json));
127
132
  }
128
133
  }
134
+
135
+ async function prepareProvider(options) {
136
+ const provider = await AggregationProvider.initialize(
137
+ [],
138
+ properties,
139
+ process.env
140
+ );
141
+
142
+ provider.messageDestination = {
143
+ info: () => {},
144
+ warn: console.warn,
145
+ error: console.error
146
+ };
147
+
148
+ return provider;
149
+ }