repository-provider 35.2.14 → 35.2.16
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 +22 -14
- package/package.json +13 -12
- package/src/base-provider.mjs +7 -6
- package/src/util.mjs +2 -2
- package/types/base-provider.d.mts +15 -12
- package/types/util.d.mts +4 -4
package/README.md
CHANGED
|
@@ -183,6 +183,7 @@ console.log(await readme.string);
|
|
|
183
183
|
* [Properties](#properties-2)
|
|
184
184
|
* [name](#name-2)
|
|
185
185
|
* [messageDestination](#messagedestination-1)
|
|
186
|
+
* [parsedName](#parsedname)
|
|
186
187
|
* [Branch](#branch)
|
|
187
188
|
* [Parameters](#parameters-43)
|
|
188
189
|
* [Properties](#properties-3)
|
|
@@ -747,7 +748,7 @@ Like .git suffix or #branch names.
|
|
|
747
748
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
748
749
|
* `forLookup` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
749
750
|
|
|
750
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** normalized name
|
|
751
|
+
Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** normalized name
|
|
751
752
|
|
|
752
753
|
### normalizeGroupName
|
|
753
754
|
|
|
@@ -759,7 +760,7 @@ Like .git suffix or #branch names.
|
|
|
759
760
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
760
761
|
* `forLookup` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
761
762
|
|
|
762
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** normalized name
|
|
763
|
+
Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** normalized name
|
|
763
764
|
|
|
764
765
|
### areRepositoryNamesCaseSensitive
|
|
765
766
|
|
|
@@ -785,8 +786,6 @@ base, group, repository and branch.
|
|
|
785
786
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
786
787
|
* `focus` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** where lies the focus if only one path component is given (optional, default `"repository"`)
|
|
787
788
|
|
|
788
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** with separated attributes
|
|
789
|
-
|
|
790
789
|
### createRepository
|
|
791
790
|
|
|
792
791
|
Create a repository.
|
|
@@ -807,6 +806,8 @@ List provider objects of a given type.
|
|
|
807
806
|
* `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the method to deliver typed iterator projects,milestones,hooks,repositories,branches,tags
|
|
808
807
|
* `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** group / repository filter
|
|
809
808
|
|
|
809
|
+
Returns **AsyncIterable<([Repository](#repository) | [PullRequest](#pullrequest) | [Branch](#branch) | [Tag](#tag) | [Project](#project) | [Milestone](#milestone) | [Hook](#hook))>** all matching repositories of the providers
|
|
810
|
+
|
|
810
811
|
### projects
|
|
811
812
|
|
|
812
813
|
List projects.
|
|
@@ -815,7 +816,7 @@ List projects.
|
|
|
815
816
|
|
|
816
817
|
* `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** 
|
|
817
818
|
|
|
818
|
-
Returns **
|
|
819
|
+
Returns **AsyncIterable<[Project](#project)>** all matching projects of the provider
|
|
819
820
|
|
|
820
821
|
### milestones
|
|
821
822
|
|
|
@@ -825,7 +826,7 @@ List milestones.
|
|
|
825
826
|
|
|
826
827
|
* `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** 
|
|
827
828
|
|
|
828
|
-
Returns **
|
|
829
|
+
Returns **AsyncIterable<[Milestone](#milestone)>** all matching milestones of the provider
|
|
829
830
|
|
|
830
831
|
### repositories
|
|
831
832
|
|
|
@@ -892,7 +893,8 @@ Returns **[BaseProvider](#baseprovider)** this
|
|
|
892
893
|
### toJSON
|
|
893
894
|
|
|
894
895
|
List all defined entries from attributes.
|
|
895
|
-
|
|
896
|
+
|
|
897
|
+
Returns **{name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}** 
|
|
896
898
|
|
|
897
899
|
### instanceIdentifier
|
|
898
900
|
|
|
@@ -953,6 +955,7 @@ Returns **([BaseProvider](#baseprovider) | [undefined](https://developer.mozilla
|
|
|
953
955
|
|
|
954
956
|
* `messageDestination` **[MessageDestination](#messagedestination)** 
|
|
955
957
|
* `url` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
958
|
+
* `api` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
956
959
|
|
|
957
960
|
### equals
|
|
958
961
|
|
|
@@ -996,7 +999,7 @@ Like .git suffix or #branch names.
|
|
|
996
999
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
997
1000
|
* `forLookup` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
998
1001
|
|
|
999
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** normalized name
|
|
1002
|
+
Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** normalized name
|
|
1000
1003
|
|
|
1001
1004
|
### normalizeGroupName
|
|
1002
1005
|
|
|
@@ -1008,7 +1011,7 @@ Like .git suffix or #branch names.
|
|
|
1008
1011
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1009
1012
|
* `forLookup` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** 
|
|
1010
1013
|
|
|
1011
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** normalized name
|
|
1014
|
+
Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** normalized name
|
|
1012
1015
|
|
|
1013
1016
|
### areRepositoryNamesCaseSensitive
|
|
1014
1017
|
|
|
@@ -1034,8 +1037,6 @@ base, group, repository and branch.
|
|
|
1034
1037
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** 
|
|
1035
1038
|
* `focus` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** where lies the focus if only one path component is given (optional, default `"repository"`)
|
|
1036
1039
|
|
|
1037
|
-
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** with separated attributes
|
|
1038
|
-
|
|
1039
1040
|
### createRepository
|
|
1040
1041
|
|
|
1041
1042
|
Create a repository.
|
|
@@ -1056,6 +1057,8 @@ List provider objects of a given type.
|
|
|
1056
1057
|
* `type` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name of the method to deliver typed iterator projects,milestones,hooks,repositories,branches,tags
|
|
1057
1058
|
* `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** group / repository filter
|
|
1058
1059
|
|
|
1060
|
+
Returns **AsyncIterable<([Repository](#repository) | [PullRequest](#pullrequest) | [Branch](#branch) | [Tag](#tag) | [Project](#project) | [Milestone](#milestone) | [Hook](#hook))>** all matching repositories of the providers
|
|
1061
|
+
|
|
1059
1062
|
### projects
|
|
1060
1063
|
|
|
1061
1064
|
List projects.
|
|
@@ -1064,7 +1067,7 @@ List projects.
|
|
|
1064
1067
|
|
|
1065
1068
|
* `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** 
|
|
1066
1069
|
|
|
1067
|
-
Returns **
|
|
1070
|
+
Returns **AsyncIterable<[Project](#project)>** all matching projects of the provider
|
|
1068
1071
|
|
|
1069
1072
|
### milestones
|
|
1070
1073
|
|
|
@@ -1074,7 +1077,7 @@ List milestones.
|
|
|
1074
1077
|
|
|
1075
1078
|
* `patterns` **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String))?** 
|
|
1076
1079
|
|
|
1077
|
-
Returns **
|
|
1080
|
+
Returns **AsyncIterable<[Milestone](#milestone)>** all matching milestones of the provider
|
|
1078
1081
|
|
|
1079
1082
|
### repositories
|
|
1080
1083
|
|
|
@@ -1141,7 +1144,8 @@ Returns **[BaseProvider](#baseprovider)** this
|
|
|
1141
1144
|
### toJSON
|
|
1142
1145
|
|
|
1143
1146
|
List all defined entries from attributes.
|
|
1144
|
-
|
|
1147
|
+
|
|
1148
|
+
Returns **{name: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)}** 
|
|
1145
1149
|
|
|
1146
1150
|
### instanceIdentifier
|
|
1147
1151
|
|
|
@@ -1207,6 +1211,10 @@ Name of the provider.
|
|
|
1207
1211
|
|
|
1208
1212
|
To forward info/warn and error messages to
|
|
1209
1213
|
|
|
1214
|
+
## parsedName
|
|
1215
|
+
|
|
1216
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
1217
|
+
|
|
1210
1218
|
## Branch
|
|
1211
1219
|
|
|
1212
1220
|
* **See**: [Repository#\_addBranch](Repository#_addBranch)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "35.2.
|
|
3
|
+
"version": "35.2.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
@@ -25,32 +25,33 @@
|
|
|
25
25
|
],
|
|
26
26
|
"license": "BSD-2-Clause",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"prepare": "
|
|
28
|
+
"prepare": "npm run prepare:typescript",
|
|
29
|
+
"prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
|
|
29
30
|
"test": "npm run test:browser-ava && npm run test:ava",
|
|
30
31
|
"test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
|
|
31
32
|
"test:browser-ava": "browser-ava --headless --no-keep-open tests/*-ava.mjs tests/*-ava-browser.mjs",
|
|
32
33
|
"cover": "c8 -x 'tests/**/*' --temp-directory build/tmp ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs && c8 report -r lcov -o build/coverage --temp-directory build/tmp",
|
|
33
34
|
"docs": "documentation readme --section=API ./src/**/*.mjs",
|
|
34
|
-
"lint": "npm run lint:docs && npm run lint:
|
|
35
|
+
"lint": "npm run lint:docs && npm run lint:typescript",
|
|
35
36
|
"lint:docs": "documentation lint ./src/**/*.mjs",
|
|
36
|
-
"lint:
|
|
37
|
+
"lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule -t esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
|
|
37
38
|
},
|
|
38
39
|
"dependencies": {
|
|
39
|
-
"content-entry": "^
|
|
40
|
+
"content-entry": "^11.0.0",
|
|
40
41
|
"matching-iterator": "^2.1.3",
|
|
41
|
-
"pacc": "^3.1.
|
|
42
|
+
"pacc": "^3.1.7"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
44
|
-
"ava": "^6.1.
|
|
45
|
-
"browser-ava": "^2.2.
|
|
45
|
+
"ava": "^6.1.3",
|
|
46
|
+
"browser-ava": "^2.2.14",
|
|
46
47
|
"c8": "^9.1.0",
|
|
47
48
|
"documentation": "^14.0.3",
|
|
48
|
-
"repository-provider-test-support": "^3.1.
|
|
49
|
-
"semantic-release": "^23.
|
|
50
|
-
"typescript": "^5.
|
|
49
|
+
"repository-provider-test-support": "^3.1.4",
|
|
50
|
+
"semantic-release": "^23.1.1",
|
|
51
|
+
"typescript": "^5.4.5"
|
|
51
52
|
},
|
|
52
53
|
"engines": {
|
|
53
|
-
"node": ">=20.
|
|
54
|
+
"node": ">=20.12.2"
|
|
54
55
|
},
|
|
55
56
|
"repository": {
|
|
56
57
|
"type": "git",
|
package/src/base-provider.mjs
CHANGED
|
@@ -23,11 +23,11 @@ import {
|
|
|
23
23
|
/**
|
|
24
24
|
* @typedef {Object} MessageDestination
|
|
25
25
|
* Endpoint to deliver log messages to.
|
|
26
|
-
* @property {
|
|
27
|
-
* @property {
|
|
28
|
-
* @property {
|
|
29
|
-
* @property {
|
|
30
|
-
* @property {
|
|
26
|
+
* @property {function(string):void} info
|
|
27
|
+
* @property {function(string):void} debug
|
|
28
|
+
* @property {function(string):void} warn
|
|
29
|
+
* @property {function(string):void} error
|
|
30
|
+
* @property {function(string):void} trace
|
|
31
31
|
*/
|
|
32
32
|
|
|
33
33
|
/**
|
|
@@ -36,6 +36,7 @@ import {
|
|
|
36
36
|
* @param {MessageDestination} [options.messageDestination]
|
|
37
37
|
* @property {MessageDestination} messageDestination
|
|
38
38
|
* @property {string} url
|
|
39
|
+
* @property {string} api
|
|
39
40
|
*/
|
|
40
41
|
export class BaseProvider extends BaseObject {
|
|
41
42
|
static get type() {
|
|
@@ -435,7 +436,7 @@ export class BaseProvider extends BaseObject {
|
|
|
435
436
|
|
|
436
437
|
/**
|
|
437
438
|
* List all defined entries from attributes.
|
|
438
|
-
* @return {
|
|
439
|
+
* @return {{name: string}}
|
|
439
440
|
*/
|
|
440
441
|
toJSON() {
|
|
441
442
|
const json = { name: this.name };
|
package/src/util.mjs
CHANGED
|
@@ -15,7 +15,7 @@ export function asArray(value) {
|
|
|
15
15
|
* A URL auth component will be removed to.
|
|
16
16
|
* @param {string|undefined} name
|
|
17
17
|
* @param {string[]} repositoryBases all possible bases
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {function(string):void} [whenFound] to be called with the found base name
|
|
19
19
|
* @return {string|undefined} name without base
|
|
20
20
|
*/
|
|
21
21
|
export function stripBaseName(name, repositoryBases, whenFound) {
|
|
@@ -39,7 +39,7 @@ export function stripBaseName(name, repositoryBases, whenFound) {
|
|
|
39
39
|
* Loops over names and executes stripBaseName.
|
|
40
40
|
* @param {string[]|string|undefined} names
|
|
41
41
|
* @param {string[]} repositoryBases all possible bases
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {function(string):void} [whenFound] to be called with the found base name
|
|
43
43
|
* @return {string[]|string|undefined} names without base
|
|
44
44
|
*/
|
|
45
45
|
export function stripBaseNames(names, repositoryBases, whenFound) {
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {Object} MessageDestination
|
|
7
7
|
* Endpoint to deliver log messages to.
|
|
8
|
-
* @property {
|
|
9
|
-
* @property {
|
|
10
|
-
* @property {
|
|
11
|
-
* @property {
|
|
12
|
-
* @property {
|
|
8
|
+
* @property {function(string):void} info
|
|
9
|
+
* @property {function(string):void} debug
|
|
10
|
+
* @property {function(string):void} warn
|
|
11
|
+
* @property {function(string):void} error
|
|
12
|
+
* @property {function(string):void} trace
|
|
13
13
|
*/
|
|
14
14
|
/**
|
|
15
15
|
* @param {Object} [options]
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* @param {MessageDestination} [options.messageDestination]
|
|
18
18
|
* @property {MessageDestination} messageDestination
|
|
19
19
|
* @property {string} url
|
|
20
|
+
* @property {string} api
|
|
20
21
|
*/
|
|
21
22
|
export class BaseProvider extends BaseObject {
|
|
22
23
|
/**
|
|
@@ -229,9 +230,11 @@ export class BaseProvider extends BaseObject {
|
|
|
229
230
|
get provider(): BaseProvider;
|
|
230
231
|
/**
|
|
231
232
|
* List all defined entries from attributes.
|
|
232
|
-
* @return {
|
|
233
|
+
* @return {{name: string}}
|
|
233
234
|
*/
|
|
234
|
-
toJSON():
|
|
235
|
+
toJSON(): {
|
|
236
|
+
name: string;
|
|
237
|
+
};
|
|
235
238
|
initializeRepositories(): void;
|
|
236
239
|
trace(...args: any[]): any;
|
|
237
240
|
debug(...args: any[]): any;
|
|
@@ -252,11 +255,11 @@ export type Milestone = import('./milestone.mjs').Milestone;
|
|
|
252
255
|
* Endpoint to deliver log messages to.
|
|
253
256
|
*/
|
|
254
257
|
export type MessageDestination = {
|
|
255
|
-
info:
|
|
256
|
-
debug:
|
|
257
|
-
warn:
|
|
258
|
-
error:
|
|
259
|
-
trace:
|
|
258
|
+
info: (arg0: string) => void;
|
|
259
|
+
debug: (arg0: string) => void;
|
|
260
|
+
warn: (arg0: string) => void;
|
|
261
|
+
error: (arg0: string) => void;
|
|
262
|
+
trace: (arg0: string) => void;
|
|
260
263
|
};
|
|
261
264
|
import { BaseObject } from "./base-object.mjs";
|
|
262
265
|
import { Repository } from "./repository.mjs";
|
package/types/util.d.mts
CHANGED
|
@@ -10,18 +10,18 @@ export function asArray(value: any[] | any): any[];
|
|
|
10
10
|
* A URL auth component will be removed to.
|
|
11
11
|
* @param {string|undefined} name
|
|
12
12
|
* @param {string[]} repositoryBases all possible bases
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {function(string):void} [whenFound] to be called with the found base name
|
|
14
14
|
* @return {string|undefined} name without base
|
|
15
15
|
*/
|
|
16
|
-
export function stripBaseName(name: string | undefined, repositoryBases: string[], whenFound?:
|
|
16
|
+
export function stripBaseName(name: string | undefined, repositoryBases: string[], whenFound?: (arg0: string) => void): string | undefined;
|
|
17
17
|
/**
|
|
18
18
|
* Loops over names and executes stripBaseName.
|
|
19
19
|
* @param {string[]|string|undefined} names
|
|
20
20
|
* @param {string[]} repositoryBases all possible bases
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {function(string):void} [whenFound] to be called with the found base name
|
|
22
22
|
* @return {string[]|string|undefined} names without base
|
|
23
23
|
*/
|
|
24
|
-
export function stripBaseNames(names: string[] | string | undefined, repositoryBases: string[], whenFound?:
|
|
24
|
+
export function stripBaseNames(names: string[] | string | undefined, repositoryBases: string[], whenFound?: (arg0: string) => void): string[] | string | undefined;
|
|
25
25
|
/**
|
|
26
26
|
* Find a new branch name for a given pattern.
|
|
27
27
|
* '*' will be replaced by a number.
|