repository-provider 35.2.13 → 35.2.14

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": "repository-provider",
3
- "version": "35.2.13",
3
+ "version": "35.2.14",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -15,10 +15,10 @@ import {
15
15
  default_attribute
16
16
  } from "./attributes.mjs";
17
17
 
18
- /**
19
- * @typedef {import('./project.mjs').Project} Project
20
- * @typedef {import('./milestone.mjs').Milestone} Milestone
21
- */
18
+ /**
19
+ * @typedef {import('./project.mjs').Project} Project
20
+ * @typedef {import('./milestone.mjs').Milestone} Milestone
21
+ */
22
22
 
23
23
  /**
24
24
  * @typedef {Object} MessageDestination
@@ -143,6 +143,11 @@ export class BaseProvider extends BaseObject {
143
143
  return 0;
144
144
  }
145
145
 
146
+ /**
147
+ * @typedef {Object} parsedName
148
+ *
149
+ */
150
+
146
151
  /**
147
152
  * Creates a new provider for a given set of options.
148
153
  * @param {Object} options additional options
@@ -163,7 +168,7 @@ export class BaseProvider extends BaseObject {
163
168
  }
164
169
 
165
170
  /**
166
- * @param {any} other
171
+ * @param {any} other
167
172
  * @return {boolean} true if other provider is the same as the receiver
168
173
  */
169
174
  equals(other) {
@@ -199,11 +204,11 @@ export class BaseProvider extends BaseObject {
199
204
  * Like .git suffix or #branch names.
200
205
  * @param {string} name
201
206
  * @param {boolean} forLookup
202
- * @return {string} normalized name
207
+ * @return {string|undefined} normalized name
203
208
  */
204
209
  normalizeRepositoryName(name, forLookup) {
205
210
  const { repository } = this.parseName(name);
206
- return forLookup && !this.areRepositoryNamesCaseSensitive
211
+ return repository && forLookup && !this.areRepositoryNamesCaseSensitive
207
212
  ? repository.toLowerCase()
208
213
  : repository;
209
214
  }
@@ -213,7 +218,7 @@ export class BaseProvider extends BaseObject {
213
218
  * Like .git suffix or #branch names.
214
219
  * @param {string} name
215
220
  * @param {boolean} forLookup
216
- * @return {string} normalized name
221
+ * @return {string|undefined} normalized name
217
222
  */
218
223
  normalizeGroupName(name, forLookup) {
219
224
  const { group } = this.parseName(name, "group");
@@ -245,12 +250,13 @@ export class BaseProvider extends BaseObject {
245
250
  * base, group, repository and branch.
246
251
  * @param {string} [name]
247
252
  * @param {string} focus where lies the focus if only one path component is given
248
- * @return {Object} with separated attributes
253
+ * @return {{base: string|undefined, group: string|undefined, repository: string|undefined, branch: string|undefined}} with separated attributes
249
254
  */
250
255
  parseName(name, focus = "repository") {
251
256
  const result = {};
252
257
 
253
258
  if (name === undefined) {
259
+ // @ts-ignore
254
260
  return result;
255
261
  }
256
262
 
@@ -295,6 +301,7 @@ export class BaseProvider extends BaseObject {
295
301
  }
296
302
  }
297
303
 
304
+ // @ts-ignore
298
305
  return result;
299
306
  }
300
307
 
@@ -310,7 +317,7 @@ export class BaseProvider extends BaseObject {
310
317
  const rg = await this.repositoryGroup(group);
311
318
  return rg.createRepository(repository, options);
312
319
  }
313
-
320
+
314
321
  /**
315
322
  * List provider objects of a given type.
316
323
  *
@@ -343,7 +350,7 @@ export class BaseProvider extends BaseObject {
343
350
  /**
344
351
  * List projects.
345
352
  * @param {string[]|string} [patterns]
346
- * @return {AsyncIterator<Project>} all matching projects of the provider
353
+ * @return {AsyncIterable<Project>} all matching projects of the provider
347
354
  */
348
355
  async *projects(patterns) {
349
356
  // @ts-ignore
@@ -353,7 +360,7 @@ export class BaseProvider extends BaseObject {
353
360
  /**
354
361
  * List milestones.
355
362
  * @param {string[]|string} [patterns]
356
- * @return {AsyncIterator<Milestone>} all matching milestones of the provider
363
+ * @return {AsyncIterable<Milestone>} all matching milestones of the provider
357
364
  */
358
365
  async *milestones(patterns) {
359
366
  // @ts-ignore
@@ -428,7 +435,7 @@ export class BaseProvider extends BaseObject {
428
435
 
429
436
  /**
430
437
  * List all defined entries from attributes.
431
- * return {object}
438
+ * @return {object}
432
439
  */
433
440
  toJSON() {
434
441
  const json = { name: this.name };
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @typedef {import('./project.mjs').Project} Project
3
- * @typedef {import('./milestone.mjs').Milestone} Milestone
4
- */
2
+ * @typedef {import('./project.mjs').Project} Project
3
+ * @typedef {import('./milestone.mjs').Milestone} Milestone
4
+ */
5
5
  /**
6
6
  * @typedef {Object} MessageDestination
7
7
  * Endpoint to deliver log messages to.
@@ -79,6 +79,10 @@ export class BaseProvider extends BaseObject {
79
79
  env?: string | string[];
80
80
  };
81
81
  };
82
+ /**
83
+ * @typedef {Object} parsedName
84
+ *
85
+ */
82
86
  /**
83
87
  * Creates a new provider for a given set of options.
84
88
  * @param {Object} options additional options
@@ -120,17 +124,17 @@ export class BaseProvider extends BaseObject {
120
124
  * Like .git suffix or #branch names.
121
125
  * @param {string} name
122
126
  * @param {boolean} forLookup
123
- * @return {string} normalized name
127
+ * @return {string|undefined} normalized name
124
128
  */
125
- normalizeRepositoryName(name: string, forLookup: boolean): string;
129
+ normalizeRepositoryName(name: string, forLookup: boolean): string | undefined;
126
130
  /**
127
131
  * Bring a group name into its normal form by removing any clutter.
128
132
  * Like .git suffix or #branch names.
129
133
  * @param {string} name
130
134
  * @param {boolean} forLookup
131
- * @return {string} normalized name
135
+ * @return {string|undefined} normalized name
132
136
  */
133
- normalizeGroupName(name: string, forLookup: boolean): string;
137
+ normalizeGroupName(name: string, forLookup: boolean): string | undefined;
134
138
  /**
135
139
  * Are repository names case sensitive.
136
140
  * Overwrite and return false if you want to have case insensitive repository lookup.
@@ -148,9 +152,14 @@ export class BaseProvider extends BaseObject {
148
152
  * base, group, repository and branch.
149
153
  * @param {string} [name]
150
154
  * @param {string} focus where lies the focus if only one path component is given
151
- * @return {Object} with separated attributes
155
+ * @return {{base: string|undefined, group: string|undefined, repository: string|undefined, branch: string|undefined}} with separated attributes
152
156
  */
153
- parseName(name?: string, focus?: string): any;
157
+ parseName(name?: string, focus?: string): {
158
+ base: string | undefined;
159
+ group: string | undefined;
160
+ repository: string | undefined;
161
+ branch: string | undefined;
162
+ };
154
163
  /**
155
164
  * Create a repository.
156
165
  * @param {string} name of group and repository
@@ -169,15 +178,15 @@ export class BaseProvider extends BaseObject {
169
178
  /**
170
179
  * List projects.
171
180
  * @param {string[]|string} [patterns]
172
- * @return {AsyncIterator<Project>} all matching projects of the provider
181
+ * @return {AsyncIterable<Project>} all matching projects of the provider
173
182
  */
174
- projects(patterns?: string[] | string): AsyncIterator<Project>;
183
+ projects(patterns?: string[] | string): AsyncIterable<Project>;
175
184
  /**
176
185
  * List milestones.
177
186
  * @param {string[]|string} [patterns]
178
- * @return {AsyncIterator<Milestone>} all matching milestones of the provider
187
+ * @return {AsyncIterable<Milestone>} all matching milestones of the provider
179
188
  */
180
- milestones(patterns?: string[] | string): AsyncIterator<Milestone>;
189
+ milestones(patterns?: string[] | string): AsyncIterable<Milestone>;
181
190
  /**
182
191
  * List repositories.
183
192
  * @param {string[]|string} [patterns]
@@ -220,11 +229,9 @@ export class BaseProvider extends BaseObject {
220
229
  get provider(): BaseProvider;
221
230
  /**
222
231
  * List all defined entries from attributes.
223
- * return {object}
232
+ * @return {object}
224
233
  */
225
- toJSON(): {
226
- name: string;
227
- };
234
+ toJSON(): object;
228
235
  initializeRepositories(): void;
229
236
  trace(...args: any[]): any;
230
237
  debug(...args: any[]): any;