@repository-settings/app 4.1.2 → 4.1.4
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/lib/plugins/rulesets.js +11 -5
- package/package.json +4 -4
package/lib/plugins/rulesets.js
CHANGED
|
@@ -4,9 +4,13 @@ import Diffable from './diffable.js'
|
|
|
4
4
|
|
|
5
5
|
export default class Rulesets extends Diffable {
|
|
6
6
|
async find () {
|
|
7
|
-
const { data: rulesets } = await this.github.repos.getRepoRulesets(this.repo)
|
|
7
|
+
const { data: rulesets } = await this.github.repos.getRepoRulesets({ ...this.repo, includes_parents: false })
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
const expandedRulesetsData = await Promise.all(
|
|
10
|
+
rulesets.map(({ id }) => this.github.repos.getRepoRuleset({ ...this.repo, ruleset_id: id }))
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
return expandedRulesetsData.map(({ data }) => data)
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
comparator (existing, attrs) {
|
|
@@ -14,15 +18,17 @@ export default class Rulesets extends Diffable {
|
|
|
14
18
|
}
|
|
15
19
|
|
|
16
20
|
changed (existing, attrs) {
|
|
17
|
-
|
|
21
|
+
const { id, ...existingAttrs } = existing
|
|
22
|
+
|
|
23
|
+
return !deepEqual(existingAttrs, attrs)
|
|
18
24
|
}
|
|
19
25
|
|
|
20
26
|
update (existing, attrs) {
|
|
21
|
-
return this.github.repos.updateRepoRuleset({ ...this.repo, ruleset_id: existing.
|
|
27
|
+
return this.github.repos.updateRepoRuleset({ ...this.repo, ruleset_id: existing.id, ...attrs })
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
remove (existing) {
|
|
25
|
-
return this.github.repos.deleteRepoRuleset({ ...this.repo, ruleset_id: existing.
|
|
31
|
+
return this.github.repos.deleteRepoRuleset({ ...this.repo, ruleset_id: existing.id })
|
|
26
32
|
}
|
|
27
33
|
|
|
28
34
|
async add (attrs) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repository-settings/app",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.4",
|
|
4
4
|
"description": "Pull Requests for GitHub repository settings",
|
|
5
5
|
"repository": "github:repository-settings/app",
|
|
6
6
|
"type": "module",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"jest-when": "3.6.0",
|
|
44
44
|
"lockfile-lint": "4.14.0",
|
|
45
45
|
"ls-engines": "0.9.3",
|
|
46
|
-
"msw": "2.4.
|
|
47
|
-
"nodemon": "3.1.
|
|
46
|
+
"msw": "2.4.9",
|
|
47
|
+
"nodemon": "3.1.7",
|
|
48
48
|
"npm-run-all2": "6.2.3",
|
|
49
49
|
"prettier-standard": "16.4.1",
|
|
50
50
|
"publint": "0.2.11",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"access": "public",
|
|
78
78
|
"provenance": true
|
|
79
79
|
},
|
|
80
|
-
"packageManager": "npm@10.
|
|
80
|
+
"packageManager": "npm@10.9.0"
|
|
81
81
|
}
|