repository-provider 35.0.3 → 35.1.0

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.
@@ -77,7 +77,7 @@ export class PullRequest extends OwnedObject {
77
77
  * @param {Branch?} [filter.source]
78
78
  * @param {Branch?} [filter.destination]
79
79
  * @param {Set<string>} [filter.states]
80
- * @return {AsyncIterator<PullRequest>}
80
+ * @return {AsyncIterable<PullRequest>}
81
81
  */
82
82
  static async *list(repository, filter) {}
83
83
 
@@ -228,7 +228,7 @@ export class PullRequest extends OwnedObject {
228
228
  async decline() {}
229
229
 
230
230
  /**
231
- * @return {AsyncIterator<Review>}
231
+ * @return {AsyncIterable<Review>}
232
232
  */
233
233
  async *reviews() {}
234
234
 
package/src/ref.mjs CHANGED
@@ -10,6 +10,7 @@ import { name_attribute, boolean_attribute } from "./attributes.mjs";
10
10
  /**
11
11
  * Base for Branch and Tag
12
12
  */
13
+ // @ts-ignore
13
14
  export class Ref extends OwnedObject {
14
15
  /**
15
16
  * options
@@ -55,13 +56,13 @@ export class Ref extends OwnedObject {
55
56
  /**
56
57
  * List entries of the branch.
57
58
  * @param {string[]|string} [matchingPatterns]
58
- * @return {AsyncIterator<ContentEntry>} all matching entries in the branch
59
+ * @return {AsyncGenerator<ContentEntry>} all matching entries in the branch
59
60
  */
60
61
  async *entries(matchingPatterns) {}
61
62
 
62
63
  /**
63
64
  * List all entries of the branch.
64
- * @return {AsyncIterator<ContentEntry>} all entries in the branch
65
+ * @return {AsyncGenerator<ContentEntry>} all entries in the branch
65
66
  */
66
67
  async *[Symbol.asyncIterator]() {
67
68
  return yield* this.entries();
@@ -1,7 +1,7 @@
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
+ import { OwnedObject } from "./owned-object.mjs";
5
5
  import { asArray, stripBaseName, stripBaseNames } from "./util.mjs";
6
6
 
7
7
  /**
@@ -54,7 +54,7 @@ export function RepositoryOwner(base) {
54
54
  /**
55
55
  * List repositories for the owner.
56
56
  * @param {string[]|string} [patterns]
57
- * @return {AsyncIterator<Repository>} all matching repositories of the owner
57
+ * @return {AsyncIterable<Repository>} all matching repositories of the owner
58
58
  */
59
59
  async *repositories(patterns) {
60
60
  patterns = asArray(patterns);
@@ -87,7 +87,7 @@ export function RepositoryOwner(base) {
87
87
  * @param {string} [name]
88
88
  * @param {function} [split]
89
89
  * @param {Object} [defaultItem]
90
- * @returns {Promise<NamedObject|undefined>} from a repository
90
+ * @returns {Promise<OwnedObject|undefined>} from a repository
91
91
  */
92
92
  async lookup(type, name, split, defaultItem) {
93
93
  if (name !== undefined) {
@@ -114,7 +114,7 @@ export function RepositoryOwner(base) {
114
114
  * @param {string[]|string} [patterns]
115
115
  * @param {function} [split]
116
116
  * @param {Object} [defaultItem]
117
- * @return {AsyncIterator<NamedObject>} matching type and pattern
117
+ * @return {AsyncIterable<OwnedObject>} matching type and pattern
118
118
  */
119
119
  async *list(type, patterns, split, defaultItem) {
120
120
  await this.initializeRepositories();
@@ -206,7 +206,7 @@ export function RepositoryOwner(base) {
206
206
  /**
207
207
  * List branches for the owner.
208
208
  * @param {string[]|string} [patterns]
209
- * @return {AsyncIterator<Branch>} all matching branches of the owner
209
+ * @return {AsyncIterable<Branch>} all matching branches of the owner
210
210
  */
211
211
  async *branches(patterns) {
212
212
  yield* this.list(
@@ -78,12 +78,12 @@ export class Repository extends OwnedObject {
78
78
  };
79
79
  }
80
80
 
81
- #branches = new Map();
82
- #tags = new Map();
81
+ /** @type {Map<string,Branch>} */ #branches = new Map();
82
+ /** @type {Map<string,Tag>} */ #tags = new Map();
83
83
  #projects = new Map();
84
84
  #applications = new Map();
85
85
  #milestones = new Map();
86
- #pullRequests = new Map();
86
+ /** @type {Map<string,PullRequest>} */ #pullRequests = new Map();
87
87
  #hooks = [];
88
88
 
89
89
  constructor(owner, name, options) {
@@ -118,7 +118,7 @@ export class Repository extends OwnedObject {
118
118
  /**
119
119
  * List entries of the default branch.
120
120
  * @param {string[]|string} [patterns]
121
- * @return {AsyncIterator<ContentEntry>} all matching entries in the branch
121
+ * @return {AsyncIterable<ContentEntry>} all matching entries in the branch
122
122
  */
123
123
  async *entries(patterns) {
124
124
  yield* (await this.defaultBranch).entries(patterns);
@@ -136,7 +136,7 @@ export class Repository extends OwnedObject {
136
136
  /**
137
137
  * List commits of the default branch.
138
138
  * @param {Object} [options]
139
- * @return {AsyncIterator<Commit>} all matching commits in the repository
139
+ * @return {AsyncIterable<Commit>} all matching commits in the repository
140
140
  */
141
141
  async *commits(options) {}
142
142
 
@@ -145,12 +145,12 @@ export class Repository extends OwnedObject {
145
145
  * @return {string}
146
146
  */
147
147
  get cloneURL() {
148
- return this.url;
148
+ return `git+${this.url}.git`;
149
149
  }
150
150
 
151
151
  /**
152
152
  * The url of issue tracking system.
153
- * @return {string}
153
+ * @return {string|undefined}
154
154
  */
155
155
  get issuesURL() {
156
156
  return undefined;
@@ -158,7 +158,7 @@ export class Repository extends OwnedObject {
158
158
 
159
159
  /**
160
160
  * The url of home page.
161
- * @return {string}
161
+ * @return {string|undefined}
162
162
  */
163
163
  get homePageURL() {
164
164
  return undefined;
@@ -236,7 +236,7 @@ export class Repository extends OwnedObject {
236
236
 
237
237
  /**
238
238
  * @param {string[]|string} [patterns]
239
- * @return {AsyncIterator<Branch>} of all branches
239
+ * @return {AsyncGenerator<Branch>} of all branches
240
240
  */
241
241
  async *branches(patterns) {
242
242
  await this.initializeBranches();
@@ -262,7 +262,7 @@ export class Repository extends OwnedObject {
262
262
  * Internal branch creation does not call repository.initialize()
263
263
  * @param {string} name of the new branch
264
264
  * @param {Object} [options] to be passed to the branch
265
- * @return {Branch} newly created branch
265
+ * @return {Branch} newly created branch or already present one for the given name
266
266
  */
267
267
  addBranch(name, options) {
268
268
  const branch = this.#branches.get(name);
@@ -299,7 +299,7 @@ export class Repository extends OwnedObject {
299
299
 
300
300
  /**
301
301
  * @param {string[]|string} [patterns]
302
- * @return {AsyncIterator<Tag>} of all tags
302
+ * @return {AsyncGenerator<Tag>} of all tags
303
303
  */
304
304
  async *tags(patterns) {
305
305
  await this.initializeTags();
@@ -358,7 +358,7 @@ export class Repository extends OwnedObject {
358
358
 
359
359
  /**
360
360
  * Deliver all {@link PullRequest}s.
361
- * @return {AsyncIterator<PullRequest>} of all pull requests
361
+ * @return {AsyncGenerator<PullRequest>} of all pull requests
362
362
  */
363
363
  async *pullRequests() {
364
364
  await this.initializePullRequests();
@@ -414,7 +414,7 @@ export class Repository extends OwnedObject {
414
414
 
415
415
  /**
416
416
  * List hooks.
417
- * @return {AsyncIterator<Hook>} all hooks of the repository
417
+ * @return {AsyncGenerator<Hook>} all hooks of the repository
418
418
  */
419
419
  async *hooks() {
420
420
  await this.initializeHooks();
@@ -36,7 +36,7 @@ export class SingleGroupProvider extends RepositoryOwner(BaseProvider) {
36
36
  /**
37
37
  * List groups.
38
38
  * @param {string[]|string|undefined} patterns
39
- * @return {AsyncIterator<RepositoryGroup>} always deliver the one and only present group
39
+ * @return {AsyncIterable<RepositoryGroup>} always deliver the one and only present group
40
40
  */
41
41
  async *repositoryGroups(patterns) {
42
42
  let found;
@@ -0,0 +1,6 @@
1
+ /**
2
+ *
3
+ */
4
+ export class Application extends OwnedObject {
5
+ }
6
+ import { OwnedObject } from "./owned-object.mjs";
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Create properties from options and default options.
3
+ * Already present properties (direct) are skipped.
4
+ * The attribute list from the class will be applied to the
5
+ * options and merged with the given set of properties.
6
+ * ```js
7
+ * class aClass {
8
+ * static get attributes() {
9
+ * return { with_default: { default: 77 }};
10
+ * }
11
+ * }
12
+ *
13
+ * definePropertiesFromOptions(new aClass());
14
+ * // equivalent to
15
+ * Object.definedProperties(new aClass(),{ with_default: { value: 77 }})
16
+ * ```
17
+ * @see Object.definedProperties()
18
+ * @see Object.getOwnPropertyDescriptor()
19
+ * @param {Object} object target object
20
+ * @param {Object} options as passed to object constructor
21
+ * @param {Object} properties object properties
22
+ * @param {Object} [attributes] attribute meta info
23
+ */
24
+ export function definePropertiesFromOptions(object: any, options?: any, properties?: any, attributes?: any): void;
25
+ /**
26
+ * Get default values.
27
+ * @param {Object} attributes
28
+ * @param {Object} object
29
+ * @return {Object} filled with default values
30
+ */
31
+ export function defaultValues(attributes: any, object: any): any;
32
+ /**
33
+ * Create json based on present options.
34
+ * In other words only produce key value pairs if value is defined.
35
+ * @param {Object} object
36
+ * @param {Object} initial
37
+ * @param {Object} attributes to operator on
38
+ * @return {Object} initial + defined values
39
+ */
40
+ export function optionJSON(object: any, initial?: any, attributes?: any): any;
41
+ /**
42
+ * Rename attributes.
43
+ * Filters out null, undefined and empty strings.
44
+ * ```js
45
+ * mapAttributes({a:1},{a:"a'"}) // {"a'": 1}
46
+ * ```
47
+ * @param {Object} object
48
+ * @param {Object} mapping
49
+ * @return {Object} keys renamed after mapping
50
+ */
51
+ export function mapAttributes(object: any, mapping: any): any;
52
+ /**
53
+ * Same as mapAttributes but with the inverse mapping.
54
+ * Filters out null, undefined and empty strings
55
+ * @param {Object} object
56
+ * @param {Object} [mapping]
57
+ * @return {Object} keys renamed after mapping
58
+ */
59
+ export function mapAttributesInverse(object: any, mapping?: any): any;
@@ -0,0 +1,99 @@
1
+ export namespace default_attribute {
2
+ export let type: string;
3
+ export let writable: boolean;
4
+ export let mandatory: boolean;
5
+ let _private: boolean;
6
+ export { _private as private };
7
+ export let isKey: boolean;
8
+ export let additionalAttributes: any[];
9
+ export let env: any[];
10
+ }
11
+ export namespace boolean_attribute {
12
+ let writable_1: boolean;
13
+ export { writable_1 as writable };
14
+ let _default: boolean;
15
+ export { _default as default };
16
+ let type_1: string;
17
+ export { type_1 as type };
18
+ }
19
+ export namespace boolean_read_only_attribute {
20
+ let type_2: string;
21
+ export { type_2 as type };
22
+ let _default_1: boolean;
23
+ export { _default_1 as default };
24
+ }
25
+ export namespace uuid_attribute {
26
+ let isKey_1: boolean;
27
+ export { isKey_1 as isKey };
28
+ }
29
+ export namespace empty_attiribute {
30
+ let type_3: string;
31
+ export { type_3 as type };
32
+ }
33
+ export namespace secret_attribute {
34
+ let _private_1: boolean;
35
+ export { _private_1 as private };
36
+ let writable_2: boolean;
37
+ export { writable_2 as writable };
38
+ }
39
+ export namespace count_attribute {
40
+ let type_4: string;
41
+ export { type_4 as type };
42
+ }
43
+ export namespace size_attribute {
44
+ let type_5: string;
45
+ export { type_5 as type };
46
+ }
47
+ export namespace name_attribute {
48
+ let isKey_2: boolean;
49
+ export { isKey_2 as isKey };
50
+ }
51
+ export namespace url_attribute {
52
+ export let description: string;
53
+ let type_6: string;
54
+ export { type_6 as type };
55
+ }
56
+ export namespace description_attribute {
57
+ let description_1: string;
58
+ export { description_1 as description };
59
+ let writable_3: boolean;
60
+ export { writable_3 as writable };
61
+ }
62
+ export namespace id_attribute {
63
+ let isKey_3: boolean;
64
+ export { isKey_3 as isKey };
65
+ let description_2: string;
66
+ export { description_2 as description };
67
+ }
68
+ export namespace state_attribute {
69
+ let writable_4: boolean;
70
+ export { writable_4 as writable };
71
+ }
72
+ export namespace body_attribute {
73
+ let writable_5: boolean;
74
+ export { writable_5 as writable };
75
+ }
76
+ export namespace title_attribute {
77
+ let description_3: string;
78
+ export { description_3 as description };
79
+ let writable_6: boolean;
80
+ export { writable_6 as writable };
81
+ }
82
+ export namespace priority_attribute {
83
+ let type_7: string;
84
+ export { type_7 as type };
85
+ let _default_2: number;
86
+ export { _default_2 as default };
87
+ let writable_7: boolean;
88
+ export { writable_7 as writable };
89
+ }
90
+ export namespace active_attribute {
91
+ let type_8: string;
92
+ export { type_8 as type };
93
+ let _default_3: boolean;
94
+ export { _default_3 as default };
95
+ let writable_8: boolean;
96
+ export { writable_8 as writable };
97
+ }
98
+ export namespace language_attribute { }
99
+ export namespace type_attribute { }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Creates an instance of BaseObject.
3
+ * @param {Object} options
4
+ * @param {Object} [additionalProperties]
5
+ *
6
+ * @property {string?} id
7
+ * @property {string?} description
8
+ */
9
+ export class BaseObject {
10
+ /**
11
+ * @return {string} type we represent
12
+ */
13
+ static get type(): string;
14
+ /**
15
+ * ```
16
+ * Tag -> tags
17
+ * Repository -> repositories
18
+ * ```
19
+ * @return {string} name of the collection holding us in the owner
20
+ */
21
+ static get collectionName(): string;
22
+ /**
23
+ * Attributes definitions.
24
+ * @return {Object}
25
+ */
26
+ static get attributes(): any;
27
+ /**
28
+ * User modifyable attributes.
29
+ * @return {Object} writable attributes
30
+ */
31
+ static get writableAttributes(): any;
32
+ /**
33
+ * Map attributes between external and internal representation.
34
+ * @return {Object}
35
+ */
36
+ static get attributeMapping(): any;
37
+ constructor(options: any, additionalProperties: any);
38
+ /**
39
+ * Takes values from options.
40
+ * @param {Object} options
41
+ * @param {Object} [additionalProperties]
42
+ */
43
+ updateAttributes(options: any, additionalProperties?: any): void;
44
+ /**
45
+ * Save object attributes in the backing store.
46
+ */
47
+ update(): Promise<void>;
48
+ /**
49
+ * @return {string} fullName
50
+ */
51
+ toString(): string;
52
+ /**
53
+ * Complete name in the hierachy.
54
+ * @return {string}
55
+ */
56
+ get fullName(): string;
57
+ get identifier(): string;
58
+ /**
59
+ * By default cannot be written to.
60
+ * @return {boolean} false
61
+ */
62
+ get isWritable(): boolean;
63
+ /**
64
+ * Check for equality
65
+ * @param {BaseObject|undefined} other
66
+ * @return {boolean} true if other is present
67
+ */
68
+ equals(other: BaseObject | undefined): boolean;
69
+ }