repository-provider 35.2.11 → 35.2.13
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 +5 -6
- package/package.json +3 -3
- package/src/base-object.mjs +8 -1
- package/src/base-provider.mjs +12 -2
- package/types/base-object.d.mts +13 -3
- package/types/base-provider.d.mts +5 -2
package/README.md
CHANGED
|
@@ -626,9 +626,6 @@ Creates an instance of BaseObject.
|
|
|
626
626
|
### Parameters
|
|
627
627
|
|
|
628
628
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
629
|
-
|
|
630
|
-
* `options.id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
631
|
-
* `options.description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
632
629
|
* `additionalProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
633
630
|
|
|
634
631
|
### Properties
|
|
@@ -642,7 +639,7 @@ Takes values from options.
|
|
|
642
639
|
|
|
643
640
|
#### Parameters
|
|
644
641
|
|
|
645
|
-
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
642
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
646
643
|
* `additionalProperties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** 
|
|
647
644
|
|
|
648
645
|
### update
|
|
@@ -933,9 +930,10 @@ Creates a new provider for a given set of options.
|
|
|
933
930
|
|
|
934
931
|
#### Parameters
|
|
935
932
|
|
|
936
|
-
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** additional options
|
|
933
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** additional options
|
|
937
934
|
|
|
938
935
|
* `options.instanceIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of the provider instance
|
|
936
|
+
* `options.description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
939
937
|
* `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** taken from process.env
|
|
940
938
|
|
|
941
939
|
Returns **([BaseProvider](#baseprovider) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** newly created provider or undefined if options are not sufficient to construct a provider
|
|
@@ -1181,9 +1179,10 @@ Creates a new provider for a given set of options.
|
|
|
1181
1179
|
|
|
1182
1180
|
#### Parameters
|
|
1183
1181
|
|
|
1184
|
-
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** additional options
|
|
1182
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** additional options
|
|
1185
1183
|
|
|
1186
1184
|
* `options.instanceIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of the provider instance
|
|
1185
|
+
* `options.description` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
1187
1186
|
* `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** taken from process.env
|
|
1188
1187
|
|
|
1189
1188
|
Returns **([BaseProvider](#baseprovider) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** newly created provider or undefined if options are not sufficient to construct a provider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "35.2.
|
|
3
|
+
"version": "35.2.13",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"content-entry": "^
|
|
39
|
+
"content-entry": "^9.0.0",
|
|
40
40
|
"matching-iterator": "^2.1.3",
|
|
41
41
|
"pacc": "^3.1.5"
|
|
42
42
|
},
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"browser-ava": "^2.2.0",
|
|
46
46
|
"c8": "^9.1.0",
|
|
47
47
|
"documentation": "^14.0.3",
|
|
48
|
-
"repository-provider-test-support": "^3.1.
|
|
48
|
+
"repository-provider-test-support": "^3.1.3",
|
|
49
49
|
"semantic-release": "^23.0.2",
|
|
50
50
|
"typescript": "^5.3.3"
|
|
51
51
|
},
|
package/src/base-object.mjs
CHANGED
|
@@ -62,13 +62,20 @@ export class BaseObject {
|
|
|
62
62
|
return {};
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Creates an instance of BaseObject.
|
|
67
|
+
* @param {Object} [options]
|
|
68
|
+
* @param {string} [options.id]
|
|
69
|
+
* @param {string} [options.description]
|
|
70
|
+
* @param {Object} [additionalProperties]
|
|
71
|
+
*/
|
|
65
72
|
constructor(options, additionalProperties) {
|
|
66
73
|
this.updateAttributes(options, additionalProperties);
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
/**
|
|
70
77
|
* Takes values from options.
|
|
71
|
-
* @param {Object} options
|
|
78
|
+
* @param {Object} [options]
|
|
72
79
|
* @param {Object} [additionalProperties]
|
|
73
80
|
*/
|
|
74
81
|
updateAttributes(options, additionalProperties) {
|
package/src/base-provider.mjs
CHANGED
|
@@ -147,13 +147,14 @@ export class BaseProvider extends BaseObject {
|
|
|
147
147
|
* Creates a new provider for a given set of options.
|
|
148
148
|
* @param {Object} options additional options
|
|
149
149
|
* @param {string} [options.instanceIdentifier] name of the provider instance
|
|
150
|
+
* @param {string} [options.description]
|
|
150
151
|
* @param {Object} env taken from process.env
|
|
151
152
|
* @return {BaseProvider|undefined} newly created provider or undefined if options are not sufficient to construct a provider
|
|
152
153
|
*/
|
|
153
|
-
static initialize(options
|
|
154
|
+
static initialize(options, env) {
|
|
154
155
|
options = {
|
|
155
156
|
...options,
|
|
156
|
-
...this.optionsFromEnvironment(env, options
|
|
157
|
+
...this.optionsFromEnvironment(env, options?.instanceIdentifier)
|
|
157
158
|
};
|
|
158
159
|
|
|
159
160
|
if (this.areOptionsSufficcient(options)) {
|
|
@@ -315,6 +316,7 @@ export class BaseProvider extends BaseObject {
|
|
|
315
316
|
*
|
|
316
317
|
* @param {string} type name of the method to deliver typed iterator projects,milestones,hooks,repositories,branches,tags
|
|
317
318
|
* @param {string[]|string|undefined} patterns group / repository filter
|
|
319
|
+
* @return {AsyncIterable<Repository|PullRequest|Branch|Tag|Project|Milestone|Hook>} all matching repositories of the providers
|
|
318
320
|
*/
|
|
319
321
|
async *list(type, patterns) {
|
|
320
322
|
if (patterns === undefined) {
|
|
@@ -324,6 +326,7 @@ export class BaseProvider extends BaseObject {
|
|
|
324
326
|
}
|
|
325
327
|
} else {
|
|
326
328
|
for (const pattern of asArray(patterns)) {
|
|
329
|
+
// @ts-ignore
|
|
327
330
|
const [groupPattern, repoPattern] = stripBaseName(
|
|
328
331
|
pattern,
|
|
329
332
|
this.repositoryBases
|
|
@@ -343,6 +346,7 @@ export class BaseProvider extends BaseObject {
|
|
|
343
346
|
* @return {AsyncIterator<Project>} all matching projects of the provider
|
|
344
347
|
*/
|
|
345
348
|
async *projects(patterns) {
|
|
349
|
+
// @ts-ignore
|
|
346
350
|
yield* this.list("projects", patterns);
|
|
347
351
|
}
|
|
348
352
|
|
|
@@ -352,6 +356,7 @@ export class BaseProvider extends BaseObject {
|
|
|
352
356
|
* @return {AsyncIterator<Milestone>} all matching milestones of the provider
|
|
353
357
|
*/
|
|
354
358
|
async *milestones(patterns) {
|
|
359
|
+
// @ts-ignore
|
|
355
360
|
yield* this.list("milestones", patterns);
|
|
356
361
|
}
|
|
357
362
|
|
|
@@ -361,6 +366,7 @@ export class BaseProvider extends BaseObject {
|
|
|
361
366
|
* @return {AsyncIterable<Repository>} all matching repos of the provider
|
|
362
367
|
*/
|
|
363
368
|
async *repositories(patterns) {
|
|
369
|
+
// @ts-ignore
|
|
364
370
|
yield* this.list("repositories", patterns);
|
|
365
371
|
}
|
|
366
372
|
|
|
@@ -370,6 +376,7 @@ export class BaseProvider extends BaseObject {
|
|
|
370
376
|
* @return {AsyncIterable<Branch>} all matching branches of the provider
|
|
371
377
|
*/
|
|
372
378
|
async *branches(patterns) {
|
|
379
|
+
// @ts-ignore
|
|
373
380
|
yield* this.list("branches", patterns);
|
|
374
381
|
}
|
|
375
382
|
|
|
@@ -379,6 +386,7 @@ export class BaseProvider extends BaseObject {
|
|
|
379
386
|
* @return {AsyncIterable<Tag>} all matching tags of the provider
|
|
380
387
|
*/
|
|
381
388
|
async *tags(patterns) {
|
|
389
|
+
// @ts-ignore
|
|
382
390
|
yield* this.list("tags", patterns);
|
|
383
391
|
}
|
|
384
392
|
|
|
@@ -388,6 +396,7 @@ export class BaseProvider extends BaseObject {
|
|
|
388
396
|
* @return {AsyncIterable<Hook>} all matching hooks of the provider
|
|
389
397
|
*/
|
|
390
398
|
async *hooks(patterns) {
|
|
399
|
+
// @ts-ignore
|
|
391
400
|
yield* this.list("hooks", patterns);
|
|
392
401
|
}
|
|
393
402
|
|
|
@@ -397,6 +406,7 @@ export class BaseProvider extends BaseObject {
|
|
|
397
406
|
* @return {AsyncIterable<PullRequest>} all matching pullRequests of the provider
|
|
398
407
|
*/
|
|
399
408
|
async *pullRequests(patterns) {
|
|
409
|
+
// @ts-ignore
|
|
400
410
|
yield* this.list("pullRequests", patterns);
|
|
401
411
|
}
|
|
402
412
|
|
package/types/base-object.d.mts
CHANGED
|
@@ -36,13 +36,23 @@ export class BaseObject {
|
|
|
36
36
|
* @return {Object}
|
|
37
37
|
*/
|
|
38
38
|
static get attributeMapping(): any;
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Creates an instance of BaseObject.
|
|
41
|
+
* @param {Object} [options]
|
|
42
|
+
* @param {string} [options.id]
|
|
43
|
+
* @param {string} [options.description]
|
|
44
|
+
* @param {Object} [additionalProperties]
|
|
45
|
+
*/
|
|
46
|
+
constructor(options?: {
|
|
47
|
+
id?: string;
|
|
48
|
+
description?: string;
|
|
49
|
+
}, additionalProperties?: any);
|
|
40
50
|
/**
|
|
41
51
|
* Takes values from options.
|
|
42
|
-
* @param {Object} options
|
|
52
|
+
* @param {Object} [options]
|
|
43
53
|
* @param {Object} [additionalProperties]
|
|
44
54
|
*/
|
|
45
|
-
updateAttributes(options
|
|
55
|
+
updateAttributes(options?: any, additionalProperties?: any): void;
|
|
46
56
|
/**
|
|
47
57
|
* Save object attributes in the backing store.
|
|
48
58
|
*/
|
|
@@ -83,11 +83,13 @@ export class BaseProvider extends BaseObject {
|
|
|
83
83
|
* Creates a new provider for a given set of options.
|
|
84
84
|
* @param {Object} options additional options
|
|
85
85
|
* @param {string} [options.instanceIdentifier] name of the provider instance
|
|
86
|
+
* @param {string} [options.description]
|
|
86
87
|
* @param {Object} env taken from process.env
|
|
87
88
|
* @return {BaseProvider|undefined} newly created provider or undefined if options are not sufficient to construct a provider
|
|
88
89
|
*/
|
|
89
90
|
static initialize(options: {
|
|
90
91
|
instanceIdentifier?: string;
|
|
92
|
+
description?: string;
|
|
91
93
|
}, env: any): BaseProvider | undefined;
|
|
92
94
|
get priority(): number;
|
|
93
95
|
/**
|
|
@@ -161,8 +163,9 @@ export class BaseProvider extends BaseObject {
|
|
|
161
163
|
*
|
|
162
164
|
* @param {string} type name of the method to deliver typed iterator projects,milestones,hooks,repositories,branches,tags
|
|
163
165
|
* @param {string[]|string|undefined} patterns group / repository filter
|
|
166
|
+
* @return {AsyncIterable<Repository|PullRequest|Branch|Tag|Project|Milestone|Hook>} all matching repositories of the providers
|
|
164
167
|
*/
|
|
165
|
-
list(type: string, patterns: string[] | string | undefined):
|
|
168
|
+
list(type: string, patterns: string[] | string | undefined): AsyncIterable<Repository | PullRequest | Branch | Tag | Project | Milestone | Hook>;
|
|
166
169
|
/**
|
|
167
170
|
* List projects.
|
|
168
171
|
* @param {string[]|string} [patterns]
|
|
@@ -250,9 +253,9 @@ export type MessageDestination = {
|
|
|
250
253
|
};
|
|
251
254
|
import { BaseObject } from "./base-object.mjs";
|
|
252
255
|
import { Repository } from "./repository.mjs";
|
|
256
|
+
import { PullRequest } from "./pull-request.mjs";
|
|
253
257
|
import { Branch } from "./branch.mjs";
|
|
254
258
|
import { Tag } from "./tag.mjs";
|
|
255
259
|
import { Hook } from "./hook.mjs";
|
|
256
|
-
import { PullRequest } from "./pull-request.mjs";
|
|
257
260
|
import { RepositoryGroup } from "./repository-group.mjs";
|
|
258
261
|
import { ContentEntry } from "content-entry";
|