repository-provider 32.7.8 → 32.7.10
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/README.md +1 -1
- package/package.json +1 -1
- package/src/attribute-extras.mjs +5 -4
- package/src/base-object.mjs +7 -11
- package/src/base-provider.mjs +4 -3
- package/src/branch.mjs +1 -1
- package/src/ref.mjs +1 -1
- package/src/repository-owner.mjs +4 -3
- package/src/repository.mjs +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://www.npmjs.com/package/repository-provider)
|
|
2
2
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
3
|
-
[](https://bundlejs.com/?q=repository-provider)
|
|
4
4
|
[](https://npmjs.org/package/repository-provider)
|
|
5
5
|
[](https://github.com/arlac77/repository-provider/issues)
|
|
6
6
|
[](https://actions-badge.atrox.dev/arlac77/repository-provider/goto)
|
package/package.json
CHANGED
package/src/attribute-extras.mjs
CHANGED
|
@@ -32,10 +32,6 @@ export function definePropertiesFromOptions(
|
|
|
32
32
|
const applyLater = {};
|
|
33
33
|
|
|
34
34
|
Object.entries(attributes).forEach(([name, attribute]) => {
|
|
35
|
-
const path = name.split(/\./);
|
|
36
|
-
const first = path.shift();
|
|
37
|
-
const property = properties[first];
|
|
38
|
-
|
|
39
35
|
let value = getAttribute(options, name);
|
|
40
36
|
|
|
41
37
|
if (value === undefined) {
|
|
@@ -67,8 +63,13 @@ export function definePropertiesFromOptions(
|
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
65
|
|
|
66
|
+
const path = name.split(/\./);
|
|
67
|
+
const first = path.shift();
|
|
68
|
+
const property = properties[first];
|
|
69
|
+
|
|
70
70
|
if (path.length) {
|
|
71
71
|
const remaining = path.join(".");
|
|
72
|
+
|
|
72
73
|
if (property) {
|
|
73
74
|
setAttribute(property.value, remaining, value);
|
|
74
75
|
} else {
|
package/src/base-object.mjs
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
} from "./attribute-extras.mjs";
|
|
5
5
|
import { description_attribute, id_attribute } from "./attributes.mjs";
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Creates an instance of BaseObject.
|
|
9
|
+
* @param {Object|undefined} options
|
|
10
|
+
* @param {Object|undefined} additionalProperties
|
|
11
|
+
*/
|
|
12
|
+
export class BaseObject {
|
|
12
13
|
/**
|
|
13
14
|
* @return {string} type we represent
|
|
14
15
|
*/
|
|
@@ -56,18 +57,13 @@ export class BaseObject {
|
|
|
56
57
|
return {};
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
/**
|
|
60
|
-
* Creates an instance of BaseObject.
|
|
61
|
-
* @param {Object} options
|
|
62
|
-
* @param {Object} additionalProperties
|
|
63
|
-
*/
|
|
64
60
|
constructor(options, additionalProperties) {
|
|
65
61
|
this.updateAttributes(options, additionalProperties);
|
|
66
62
|
}
|
|
67
63
|
|
|
68
64
|
/**
|
|
69
65
|
* Takes values from options.
|
|
70
|
-
* @param {Object} options
|
|
66
|
+
* @param {Object|undefined} options
|
|
71
67
|
*/
|
|
72
68
|
updateAttributes(options, additionalProperties) {
|
|
73
69
|
definePropertiesFromOptions(
|
package/src/base-provider.mjs
CHANGED
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
url_attribute,
|
|
13
13
|
name_attribute,
|
|
14
14
|
description_attribute,
|
|
15
|
-
priority_attribute
|
|
15
|
+
priority_attribute,
|
|
16
|
+
default_attribute
|
|
16
17
|
} from "./attributes.mjs";
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -119,9 +120,9 @@ export class BaseProvider extends BaseObject {
|
|
|
119
120
|
* To forward info/warn and error messages to
|
|
120
121
|
*/
|
|
121
122
|
messageDestination: {
|
|
123
|
+
...default_attribute,
|
|
122
124
|
type: "object",
|
|
123
125
|
default: console,
|
|
124
|
-
mandatory: false,
|
|
125
126
|
writable: true,
|
|
126
127
|
private: true
|
|
127
128
|
}
|
|
@@ -300,7 +301,7 @@ export class BaseProvider extends BaseObject {
|
|
|
300
301
|
* List provider objects of a given type.
|
|
301
302
|
*
|
|
302
303
|
* @param {string} type name of the method to deliver typed iterator projects,milestones,hooks,repositories,branches,tags
|
|
303
|
-
* @param {string|string
|
|
304
|
+
* @param {string[]|string} patterns group / repository filter
|
|
304
305
|
*/
|
|
305
306
|
async *list(type, patterns) {
|
|
306
307
|
if (patterns === undefined) {
|
package/src/branch.mjs
CHANGED
|
@@ -201,7 +201,7 @@ export class Branch extends Ref {
|
|
|
201
201
|
* Create a new {@link Branch} by cloning a given source branch.
|
|
202
202
|
* Simply calls Repository.createBranch() with the receiver as source branch
|
|
203
203
|
* @param {string} name the new branch
|
|
204
|
-
* @param {Object|undefined} options
|
|
204
|
+
* @param {Object|undefined} options passed through
|
|
205
205
|
* @return {Promise<Branch>} newly created branch (or already present old one with the same name)
|
|
206
206
|
*/
|
|
207
207
|
async createBranch(name, options) {
|
package/src/ref.mjs
CHANGED
|
@@ -54,7 +54,7 @@ export class Ref extends OwnedObject {
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* List entries of the branch.
|
|
57
|
-
* @param {string[]} [matchingPatterns]
|
|
57
|
+
* @param {string|string[]} [matchingPatterns]
|
|
58
58
|
* @return {AsyncIterator<ContentEntry>} all matching entries in the branch
|
|
59
59
|
*/
|
|
60
60
|
async *entries(matchingPatterns) {}
|
package/src/repository-owner.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { matcher } from "matching-iterator";
|
|
2
2
|
import { Branch } from "./branch.mjs";
|
|
3
3
|
import { Repository } from "./repository.mjs";
|
|
4
|
+
import { NamedObject } from "./named-object.mjs";
|
|
4
5
|
import { asArray, stripBaseName, stripBaseNames } from "./util.mjs";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Mixin to define a class able to handle a collection of repositories.
|
|
8
|
-
* @param {
|
|
9
|
+
* @param {Object} base to be extendet
|
|
9
10
|
*/
|
|
10
11
|
export function RepositoryOwner(base) {
|
|
11
12
|
return class RepositoryOwner extends base {
|
|
@@ -39,7 +40,7 @@ export function RepositoryOwner(base) {
|
|
|
39
40
|
/**
|
|
40
41
|
* Lookup a repository.
|
|
41
42
|
* @param {string} name of the repository may contain a #branch
|
|
42
|
-
* @return {Promise<Repository>}
|
|
43
|
+
* @return {Promise<Repository|undefined>}
|
|
43
44
|
*/
|
|
44
45
|
async repository(name) {
|
|
45
46
|
if (name !== undefined) {
|
|
@@ -108,7 +109,7 @@ export function RepositoryOwner(base) {
|
|
|
108
109
|
/**
|
|
109
110
|
* List entities for a given type and pattern.
|
|
110
111
|
* @param {string} type
|
|
111
|
-
* @param {string|string
|
|
112
|
+
* @param {string[]|string} patterns
|
|
112
113
|
* @param {function} [split]
|
|
113
114
|
* @param {Object} [defaultItem]
|
|
114
115
|
* @return {AsyncIterator<NamedObject>} matching type and pattern
|
package/src/repository.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
* @class Repository
|
|
24
24
|
* @param {RepositoryOwner} owner
|
|
25
25
|
* @param {string} name (#branch) will be removed
|
|
26
|
-
* @param {Object} options
|
|
26
|
+
* @param {Object|undefined} options
|
|
27
27
|
* @param {string} [options.description] human readable description
|
|
28
28
|
* @param {string} [options.id] internal id
|
|
29
29
|
*
|
|
@@ -362,7 +362,7 @@ export class Repository extends OwnedObject {
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
/**
|
|
365
|
-
* The @{link PullRequest} for a given name.
|
|
365
|
+
* The @see {@link PullRequest} for a given name.
|
|
366
366
|
* @param {string} name
|
|
367
367
|
* @return {Promise<PullRequest>}
|
|
368
368
|
*/
|
|
@@ -465,7 +465,7 @@ export class Repository extends OwnedObject {
|
|
|
465
465
|
/**
|
|
466
466
|
* Get sha of a ref.
|
|
467
467
|
* @param {string} ref
|
|
468
|
-
* @return {Promise<string>} sha of the ref
|
|
468
|
+
* @return {Promise<string|undefined>} sha of the ref
|
|
469
469
|
*/
|
|
470
470
|
async refId(ref) {}
|
|
471
471
|
|