repository-provider 35.2.27 → 35.3.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.
package/LICENSE CHANGED
@@ -1,23 +1,12 @@
1
- Copyright (c) 2017-2024 by arlac77
2
- All rights reserved.
3
-
4
- Redistribution and use in source and binary forms, with or without
5
- modification, are permitted provided that the following conditions are met:
6
-
7
- * Redistributions of source code must retain the above copyright notice, this
8
- list of conditions and the following disclaimer.
9
-
10
- * Redistributions in binary form must reproduce the above copyright notice,
11
- this list of conditions and the following disclaimer in the documentation
12
- and/or other materials provided with the distribution.
13
-
14
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1
+ Copyright (C) 2017-2025 by arlac77
2
+
3
+ Permission to use, copy, modify, and/or distribute this software for any
4
+ purpose with or without fee is hereby granted.
5
+
6
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
7
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
8
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
9
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
10
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
11
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
12
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  [![npm](https://img.shields.io/npm/v/repository-provider.svg)](https://www.npmjs.com/package/repository-provider)
2
- [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
2
+ [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
3
3
  [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
4
4
  [![bundlejs](https://deno.bundlejs.com/?q=repository-provider\&badge=detailed)](https://bundlejs.com/?q=repository-provider)
5
5
  [![downloads](http://img.shields.io/npm/dm/repository-provider.svg?style=flat-square)](https://npmjs.org/package/repository-provider)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "35.2.27",
3
+ "version": "35.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -8,8 +8,8 @@
8
8
  "types": "./types/index.d.mts",
9
9
  "exports": {
10
10
  ".": {
11
- "default": "./src/index.mjs",
12
- "types": "./types/index.d.mts"
11
+ "types": "./types/index.d.mts",
12
+ "default": "./src/index.mjs"
13
13
  }
14
14
  },
15
15
  "description": "abstract interface to git repository providers like github, bitbucket and gitlab",
@@ -23,36 +23,35 @@
23
23
  "email": "markus.felten@gmx.de"
24
24
  }
25
25
  ],
26
- "license": "BSD-2-Clause",
26
+ "license": "0BSD",
27
27
  "scripts": {
28
28
  "prepare": "node --run prepare:typescript",
29
- "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
29
+ "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
30
30
  "test": "node --run test:browser-ava && node --run test:ava",
31
31
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
32
32
  "test:browser-ava": "browser-ava --headless --no-keep-open tests/*-ava.mjs tests/*-ava-browser.mjs",
33
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",
34
- "docs": "documentation readme --section=API ./src/**/*.mjs",
34
+ "docs": "documentation readme --section=API ./src**/*.mjs",
35
35
  "lint": "node --run lint:docs && node --run lint:typescript",
36
- "lint:docs": "documentation lint ./src/**/*.mjs",
37
- "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target es2024 --lib es2024 -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
36
+ "lint:docs": "documentation lint ./src**/*.mjs",
37
+ "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
38
38
  },
39
39
  "dependencies": {
40
- "content-entry": "^11.1.2",
40
+ "content-entry": "^13.0.4",
41
41
  "matching-iterator": "^2.1.3",
42
- "pacc": "^3.1.8"
42
+ "pacc": "^3.4.1"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/readable-stream": "^4.0.18",
46
- "ava": "^6.2.0",
47
- "browser-ava": "^2.3.2",
48
- "c8": "^10.1.2",
45
+ "ava": "^6.3.0",
46
+ "browser-ava": "^2.3.24",
47
+ "c8": "^10.1.3",
49
48
  "documentation": "^14.0.3",
50
- "repository-provider-test-support": "^3.1.7",
51
- "semantic-release": "^24.2.0",
52
- "typescript": "^5.7.1-rc"
49
+ "repository-provider-test-support": "^3.1.9",
50
+ "semantic-release": "^24.2.3",
51
+ "typescript": "^5.8.3"
53
52
  },
54
53
  "engines": {
55
- "node": ">=22.10.0"
54
+ "node": ">=22.15.0"
56
55
  },
57
56
  "repository": {
58
57
  "type": "git",
@@ -88,9 +88,7 @@ export class BaseProvider extends BaseObject {
88
88
  ) === envName
89
89
  )
90
90
  ) {
91
- if (options === undefined) {
92
- options = {};
93
- }
91
+ options ??= {};
94
92
 
95
93
  if (options[name] === undefined) {
96
94
  options[name] = value;
@@ -348,9 +346,12 @@ export class BaseProvider extends BaseObject {
348
346
  this.repositoryBases
349
347
  ).split(/\//);
350
348
 
351
- if(repoPattern) {
349
+ if (repoPattern) {
352
350
  // TODO do cleanup in stripBase()
353
- repoPattern = repoPattern.replace(/\.git(#.*)?$/, (all,b) => b || "");
351
+ repoPattern = repoPattern.replace(
352
+ /\.git(#.*)?$/,
353
+ (all, b) => b || ""
354
+ );
354
355
  }
355
356
 
356
357
  // @ts-ignore
package/src/commit.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { Repository } from "./repository.mjs";
2
+
1
3
  /**
2
4
  * @property {string} ref
3
5
  */
@@ -21,7 +23,17 @@ export class User {}
21
23
  export class Commit {
22
24
  repository;
23
25
 
24
- constructor(repository) {
26
+ /**
27
+ *
28
+ * @param {Repository} repository
29
+ * @param {Object} options
30
+ * @param {string} options.sha
31
+ * @param {string} options.message
32
+ * @param {string} options.author
33
+ * @param {string} options.committer
34
+ */
35
+ constructor(repository, options) {
25
36
  this.repository = repository;
37
+ Object.assign(this, options);
26
38
  }
27
39
  }
@@ -19,12 +19,6 @@ import {
19
19
 
20
20
  /**
21
21
  * Abstract repository
22
- * @class Repository
23
- * @param {RepositoryOwner} owner
24
- * @param {string} name (#branch) will be removed
25
- * @param {Object} [options]
26
- * @param {string} [options.description] human readable description
27
- * @param {string} [options.id] internal id
28
22
  *
29
23
  * @property {RepositoryOwner} owner
30
24
  * @property {string} name without (#branch)
@@ -85,8 +79,19 @@ export class Repository extends OwnedObject {
85
79
  /** @type {Map<string,PullRequest>} */ #pullRequests = new Map();
86
80
  #hooks = [];
87
81
 
88
- constructor(owner, name, options) {
89
- super(owner, owner.normalizeRepositoryName(name, false), options);
82
+ /**
83
+ * @param {RepositoryOwner} owner
84
+ * @param {string} name (#branch) will be removed
85
+ * @param {Object} [options]
86
+ * @param {string} [options.description] human readable description
87
+ * @param {string} [options.id] internal id
88
+ * @param {Object} [options]
89
+ * @param {string} [options.id]
90
+ * @param {string} [options.description]
91
+ * @param {Object} [additionalProperties]
92
+ */
93
+ constructor(owner, name, options, additionalProperties) {
94
+ super(owner, owner.normalizeRepositoryName(name, false), options, additionalProperties);
90
95
  }
91
96
 
92
97
  /**
@@ -15,6 +15,21 @@ export class User {
15
15
  * @property {User} committer
16
16
  */
17
17
  export class Commit {
18
- constructor(repository: any);
19
- repository: any;
18
+ /**
19
+ *
20
+ * @param {Repository} repository
21
+ * @param {Object} options
22
+ * @param {string} options.sha
23
+ * @param {string} options.message
24
+ * @param {string} options.author
25
+ * @param {string} options.committer
26
+ */
27
+ constructor(repository: Repository, options: {
28
+ sha: string;
29
+ message: string;
30
+ author: string;
31
+ committer: string;
32
+ });
33
+ repository: Repository;
20
34
  }
35
+ import { Repository } from "./repository.mjs";
@@ -1,11 +1,5 @@
1
1
  /**
2
2
  * Abstract repository
3
- * @class Repository
4
- * @param {RepositoryOwner} owner
5
- * @param {string} name (#branch) will be removed
6
- * @param {Object} [options]
7
- * @param {string} [options.description] human readable description
8
- * @param {string} [options.id] internal id
9
3
  *
10
4
  * @property {RepositoryOwner} owner
11
5
  * @property {string} name without (#branch)
@@ -51,7 +45,21 @@ export class Repository extends OwnedObject {
51
45
  name: import("pacc").AttributeDefinition;
52
46
  description: import("pacc").AttributeDefinition;
53
47
  };
54
- constructor(owner: any, name: any, options: any);
48
+ /**
49
+ * @param {RepositoryOwner} owner
50
+ * @param {string} name (#branch) will be removed
51
+ * @param {Object} [options]
52
+ * @param {string} [options.description] human readable description
53
+ * @param {string} [options.id] internal id
54
+ * @param {Object} [options]
55
+ * @param {string} [options.id]
56
+ * @param {string} [options.description]
57
+ * @param {Object} [additionalProperties]
58
+ */
59
+ constructor(owner: typeof RepositoryOwner, name: string, options?: {
60
+ description?: string;
61
+ id?: string;
62
+ }, additionalProperties?: any);
55
63
  get defaultBranchName(): string;
56
64
  /**
57
65
  * Lookup entries form the head of the default branch.
@@ -263,3 +271,4 @@ import { Hook } from "./hook.mjs";
263
271
  import { Milestone } from "./milestone.mjs";
264
272
  import { Project } from "./project.mjs";
265
273
  import { Application } from "./application.mjs";
274
+ import { RepositoryOwner } from "./repository-owner.mjs";