github-repository-provider 9.2.29 → 9.2.31

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 CHANGED
@@ -1,6 +1,5 @@
1
1
  [![npm](https://img.shields.io/npm/v/github-repository-provider.svg)](https://www.npmjs.com/package/github-repository-provider)
2
2
  [![License](https://img.shields.io/badge/License-0BSD-blue.svg)](https://spdx.org/licenses/0BSD.html)
3
- [![Typed with TypeScript](https://flat.badgen.net/badge/icon/Typed?icon=typescript\&label\&labelColor=blue\&color=555555)](https://typescriptlang.org)
4
3
  [![bundlejs](https://deno.bundlejs.com/?q=github-repository-provider\&badge=detailed)](https://bundlejs.com/?q=github-repository-provider)
5
4
  [![downloads](http://img.shields.io/npm/dm/github-repository-provider.svg?style=flat-square)](https://npmjs.org/package/github-repository-provider)
6
5
  [![GitHub Issues](https://img.shields.io/github/issues/arlac77/github-repository-provider.svg?style=flat-square)](https://github.com/arlac77/github-repository-provider/issues)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "github-repository-provider",
3
- "version": "9.2.29",
3
+ "version": "9.2.31",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "provenance": true
@@ -24,38 +24,34 @@
24
24
  ],
25
25
  "license": "0BSD",
26
26
  "scripts": {
27
- "prepare": "node --run prepare:typescript",
28
- "prepare:typescript": "tsc --allowJs --declaration --emitDeclarationOnly --declarationDir types --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext --rootDir src ./src**/*.mjs",
29
27
  "test": "node --run test:ava",
30
28
  "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
31
29
  "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",
32
30
  "docs": "documentation readme --section=API ./src**/*.mjs",
33
- "lint": "node --run lint:docs && node --run lint:typescript",
34
- "lint:docs": "documentation lint ./src**/*.mjs",
35
- "lint:typescript": "tsc --allowJs --checkJs --noEmit --resolveJsonModule --target esnext -m esnext --module nodenext --moduleResolution nodenext ./src**/*.mjs"
31
+ "lint": "node --run lint:docs",
32
+ "lint:docs": "documentation lint ./src**/*.mjs"
36
33
  },
37
34
  "dependencies": {
38
- "content-entry": "^14.2.3",
35
+ "content-entry": "^14.2.4",
39
36
  "fetch-link-util": "^1.1.3",
40
37
  "fetch-rate-limit-util": "^4.5.4",
41
38
  "matching-iterator": "^2.1.4",
42
39
  "one-time-execution-method": "^3.1.3",
43
- "repository-provider": "^35.5.10"
40
+ "repository-provider": "^35.5.14"
44
41
  },
45
42
  "devDependencies": {
46
- "@types/node": "^24.1.0",
43
+ "@types/node": "^24.3.0",
47
44
  "ava": "^6.4.1",
48
45
  "c8": "^10.1.3",
49
46
  "documentation": "^14.0.3",
50
47
  "etag-cache-leveldb": "^2.1.15",
51
48
  "leveldown": "^6.1.1",
52
49
  "levelup": "^5.1.1",
53
- "repository-provider-test-support": "^3.1.51",
54
- "semantic-release": "^24.2.7",
55
- "typescript": "^5.8.3"
50
+ "repository-provider-test-support": "^3.1.52",
51
+ "semantic-release": "^24.2.7"
56
52
  },
57
53
  "engines": {
58
- "node": ">=22.17.1"
54
+ "node": ">=22.18.0"
59
55
  },
60
56
  "repository": {
61
57
  "type": "git",
@@ -68,8 +64,7 @@
68
64
  "template": {
69
65
  "inheritFrom": [
70
66
  "arlac77/template-arlac77-github",
71
- "arlac77/template-javascript-component",
72
- "arlac77/template-typescript"
67
+ "arlac77/template-javascript-component"
73
68
  ]
74
69
  }
75
70
  }
@@ -4,7 +4,7 @@ import {
4
4
  url_attribute,
5
5
  size_attribute,
6
6
  language_attribute,
7
- default_attribute
7
+ string_attribute_writable
8
8
  } from "pacc";
9
9
  import {
10
10
  Repository,
@@ -46,18 +46,18 @@ export class GithubRepository extends Repository {
46
46
  auto_init: boolean_attribute,
47
47
  size: size_attribute,
48
48
  language: language_attribute,
49
- gitignore_template: default_attribute,
50
- license_template: default_attribute,
49
+ gitignore_template: string_attribute_writable,
50
+ license_template: string_attribute_writable,
51
51
  allow_squash_merge: boolean_attribute,
52
52
  allow_merge_commit: boolean_attribute,
53
53
  allow_rebase_merge: boolean_attribute,
54
54
  allow_auto_merge: boolean_attribute,
55
55
  delete_branch_on_merge: boolean_attribute,
56
56
  issuesURL: url_attribute,
57
- squash_merge_commit_title: default_attribute,
58
- squash_merge_commit_message: default_attribute,
59
- merge_commit_title: default_attribute,
60
- merge_commit_message: default_attribute
57
+ squash_merge_commit_title: string_attribute_writable,
58
+ squash_merge_commit_message: string_attribute_writable,
59
+ merge_commit_title: string_attribute_writable,
60
+ merge_commit_message: string_attribute_writable
61
61
  //custom_properties: default_attribute
62
62
  };
63
63
 
@@ -1,36 +0,0 @@
1
- /**
2
- * Branch on GitHub.
3
- */
4
- export class GithubBranch extends Branch {
5
- constructor(owner: any, name: any, options: any);
6
- /**
7
- * Writes content into the branch
8
- * {@link https://developer.github.com/v3/git/blobs/#get-a-blob}
9
- * @param {ContentEntry} entry
10
- * @return {Promise<ContentEntry>} written content with sha values set
11
- */
12
- writeEntry(entry: ContentEntry): Promise<ContentEntry>;
13
- /**
14
- * {@link https://developer.github.com/v3/git/trees/#create-a-tree}
15
- * {@link https://developer.github.com/v3/git/commits/#create-a-commit}
16
- * {@link https://developer.github.com/v3/git/refs/#update-a-reference}
17
- * @param {string} message
18
- * @param {ContentEntry[]} entries
19
- * @param {Object} [options]
20
- */
21
- commit(message: string, entries: ContentEntry[], options?: any): Promise<any>;
22
- /**
23
- * {@link https://developer.github.com/v3/repos/contents/#get-repository-content}
24
- * @param {string} name
25
- */
26
- entry(name: string): Promise<any>;
27
- /**
28
- *
29
- * @param {string[]|string} patterns
30
- * @return {AsyncGenerator<ContentEntry>} all matching entries in the branch
31
- */
32
- entries(patterns: string[] | string): AsyncGenerator<ContentEntry>;
33
- #private;
34
- }
35
- import { Branch } from "repository-provider";
36
- import { ContentEntry } from "content-entry";
@@ -1,15 +0,0 @@
1
- /**
2
- * Represents github repo owner either
3
- * - users
4
- * - organization
5
- */
6
- export class GithubOwner extends RepositoryGroup {
7
- /**
8
- * Map attributes between external and internal representation.
9
- */
10
- static get attributeMapping(): {
11
- site_admin: string;
12
- };
13
- get api(): string;
14
- }
15
- import { RepositoryGroup } from "repository-provider";
@@ -1,156 +0,0 @@
1
- /**
2
- * <!-- skip-example -->
3
- * GitHub provider.
4
- * Lookup a repository.
5
- * known environment variables
6
- * - GITHUB_TOKEN or GH_TOKEN api token
7
- * @example
8
- * import GithubProvider from 'github-repository-provider';
9
- *
10
- * const ghp = new GithubProvider();
11
- * const r1 = ghp.repository('git@github.com:arlac77/github-repository-provider.git');
12
- * const r2 = ghp.repository('git://github.com/arlac77/github-repository-provider.git');
13
- * const r3 = ghp.repository('git+ssh://github.com/arlac77/github-repository-provider.git');
14
- * const r4 = ghp.repository('https://github.com/arlac77/github-repository-provider.git#master');
15
- * const r5 = ghp.repository('git+https://github.com/arlac77/github-repository-provider.git#master');
16
- * const r6 = ghp.repository('arlac77/github-repository-provider');
17
- * // different ways to address the same repository
18
- */
19
- export class GithubProvider extends MultiGroupProvider {
20
- static attributes: {
21
- host: {
22
- env: string[];
23
- default: string;
24
- type: string;
25
- isKey: boolean;
26
- writable: boolean;
27
- mandatory: boolean;
28
- collection: boolean;
29
- private?: boolean;
30
- depends?: string;
31
- description?: string;
32
- set?: Function;
33
- get?: Function;
34
- };
35
- ssh: {
36
- default: string;
37
- type: string;
38
- isKey: boolean;
39
- writable: boolean;
40
- mandatory: boolean;
41
- collection: boolean;
42
- private?: boolean;
43
- depends?: string;
44
- description?: string;
45
- set?: Function;
46
- get?: Function;
47
- env?: string[] | string;
48
- };
49
- url: {
50
- env: string;
51
- set: (value: any) => any;
52
- default: string;
53
- depends: string;
54
- type: string;
55
- isKey: boolean;
56
- writable: boolean;
57
- mandatory: boolean;
58
- collection: boolean;
59
- private?: boolean;
60
- description?: string;
61
- get?: Function;
62
- };
63
- api: {
64
- env: string;
65
- set: (value: any) => any;
66
- depends: string;
67
- default: string;
68
- type: string;
69
- isKey: boolean;
70
- writable: boolean;
71
- mandatory: boolean;
72
- collection: boolean;
73
- private?: boolean;
74
- description?: string;
75
- get?: Function;
76
- };
77
- "authentication.token": {
78
- env: string[];
79
- additionalAttributes: {
80
- "authentication.type": string;
81
- };
82
- mandatory: boolean;
83
- type: string;
84
- isKey: boolean;
85
- writable: boolean;
86
- collection: boolean;
87
- private?: boolean;
88
- depends?: string;
89
- description?: string;
90
- default?: any;
91
- set?: Function;
92
- get?: Function;
93
- };
94
- priority: {
95
- default: number;
96
- type: string;
97
- isKey: boolean;
98
- writable: boolean;
99
- mandatory: boolean;
100
- collection: boolean;
101
- private?: boolean;
102
- depends?: string;
103
- description?: string;
104
- set?: Function;
105
- get?: Function;
106
- env?: string[] | string;
107
- };
108
- name: {
109
- env: string;
110
- type: string;
111
- isKey: boolean;
112
- writable: boolean;
113
- mandatory: boolean;
114
- collection: boolean;
115
- private?: boolean;
116
- depends?: string;
117
- description?: string;
118
- default?: any;
119
- set?: Function;
120
- get?: Function;
121
- };
122
- messageDestination: {
123
- type: string;
124
- default: Console;
125
- writable: boolean;
126
- private: boolean;
127
- isKey: boolean;
128
- mandatory: boolean;
129
- collection: boolean;
130
- depends?: string;
131
- description?: string;
132
- set?: Function;
133
- get?: Function;
134
- env?: string[] | string;
135
- };
136
- id: import("pacc").AttributeDefinition;
137
- description: import("pacc").AttributeDefinition;
138
- };
139
- fetch(url: any, options?: {}): Promise<Response>;
140
- fetchJSON(url: any, options?: {}): Promise<Response>;
141
- /**
142
- * {@link https://developer.github.com/v3/repos/#list-repositories-for-the-authenticated-user}
143
- */
144
- initializeRepositories(): Promise<void>;
145
- get pullRequestClass(): typeof GithubPullRequest;
146
- get repositoryClass(): typeof GithubRepository;
147
- get branchClass(): typeof GithubBranch;
148
- get repositoryGroupClass(): typeof GithubOwner;
149
- }
150
- export default GithubProvider;
151
- import { GithubRepository } from "./github-repository.mjs";
152
- import { GithubBranch } from "./github-branch.mjs";
153
- import { GithubOwner } from "./github-owner.mjs";
154
- import { GithubPullRequest } from "./github-pull-request.mjs";
155
- import { MultiGroupProvider } from "repository-provider";
156
- export { GithubRepository, GithubBranch, GithubOwner, GithubPullRequest };
@@ -1,62 +0,0 @@
1
- /**
2
- * Github pull request.
3
- */
4
- export class GithubPullRequest extends PullRequest {
5
- /**
6
- * All valid merge methods.
7
- * @return {Set<string>} valid merge methods
8
- */
9
- static validMergeMethods: Set<string>;
10
- static get attributeMapping(): {
11
- url: string;
12
- };
13
- static attributes: {
14
- maintainer_can_modify: import("pacc").AttributeDefinition;
15
- body: import("pacc").AttributeDefinition;
16
- title: import("pacc").AttributeDefinition;
17
- url: import("pacc").AttributeDefinition;
18
- state: {
19
- default: string;
20
- values: Set<string>;
21
- type: string;
22
- isKey: boolean;
23
- writable: boolean;
24
- mandatory: boolean;
25
- collection: boolean;
26
- private?: boolean;
27
- depends?: string;
28
- description?: string;
29
- set?: Function;
30
- get?: Function;
31
- env?: string[] | string;
32
- };
33
- locked: import("pacc").AttributeDefinition;
34
- merged: import("pacc").AttributeDefinition;
35
- draft: import("pacc").AttributeDefinition;
36
- dry: import("pacc").AttributeDefinition;
37
- empty: import("pacc").AttributeDefinition;
38
- name: import("pacc").AttributeDefinition;
39
- id: import("pacc").AttributeDefinition;
40
- description: import("pacc").AttributeDefinition;
41
- };
42
- /**
43
- * {@link https://developer.github.com/v3/pulls/#list-pull-requests}
44
- * @param {Repository} repository
45
- * @param {Object} filter
46
- */
47
- static list(repository: Repository, filter?: any): AsyncGenerator<GithubPullRequest, void, unknown>;
48
- /**
49
- * {@link https://developer.github.com/v3/pulls/#create-a-pull-request}
50
- * @param {Branch} source
51
- * @param {Branch} destination
52
- * @param {Object} [options]
53
- */
54
- static open(source: Branch, destination: Branch, options?: any): Promise<GithubPullRequest>;
55
- /**
56
- * {@link https://developer.github.com/v3/pulls/#merge-a-pull-request}
57
- */
58
- _merge(method?: string): Promise<void>;
59
- }
60
- import { PullRequest } from "repository-provider";
61
- import { Repository } from "repository-provider";
62
- import { Branch } from "repository-provider";
@@ -1,122 +0,0 @@
1
- /**
2
- * Repository on GitHub.
3
- */
4
- export class GithubRepository extends Repository {
5
- static get attributeMapping(): {
6
- disabled: string;
7
- archived: string;
8
- is_template: string;
9
- private: string;
10
- fork: string;
11
- default_branch: string;
12
- url: string;
13
- };
14
- static attributes: {
15
- auto_init: import("pacc").AttributeDefinition;
16
- size: import("pacc").AttributeDefinition;
17
- language: import("pacc").AttributeDefinition;
18
- gitignore_template: import("pacc").AttributeDefinition;
19
- license_template: import("pacc").AttributeDefinition;
20
- allow_squash_merge: import("pacc").AttributeDefinition;
21
- allow_merge_commit: import("pacc").AttributeDefinition;
22
- allow_rebase_merge: import("pacc").AttributeDefinition;
23
- allow_auto_merge: import("pacc").AttributeDefinition;
24
- delete_branch_on_merge: import("pacc").AttributeDefinition;
25
- issuesURL: import("pacc").AttributeDefinition;
26
- squash_merge_commit_title: import("pacc").AttributeDefinition;
27
- squash_merge_commit_message: import("pacc").AttributeDefinition;
28
- merge_commit_title: import("pacc").AttributeDefinition;
29
- merge_commit_message: import("pacc").AttributeDefinition;
30
- url: import("pacc").AttributeDefinition;
31
- defaultBranchName: {
32
- default: string;
33
- type: string;
34
- isKey: boolean;
35
- writable: boolean;
36
- mandatory: boolean;
37
- collection: boolean;
38
- private?: boolean;
39
- depends?: string;
40
- description?: string;
41
- set?: Function;
42
- get?: Function;
43
- env?: string[] | string;
44
- };
45
- cloneURL: import("pacc").AttributeDefinition;
46
- isArchived: import("pacc").AttributeDefinition;
47
- isLocked: import("pacc").AttributeDefinition;
48
- isDisabled: import("pacc").AttributeDefinition;
49
- isTemplate: import("pacc").AttributeDefinition;
50
- isFork: import("pacc").AttributeDefinition;
51
- name: import("pacc").AttributeDefinition;
52
- id: import("pacc").AttributeDefinition;
53
- description: import("pacc").AttributeDefinition;
54
- };
55
- /**
56
- * {@link https://docs.github.com/en/rest/reference/commits#list-commits}
57
- * @param {Object} options
58
- * @returns {AsyncIterable<Commit>}
59
- */
60
- commits(options: any): AsyncIterable<Commit>;
61
- addCommit(tree: any, parents: any, message: any): Promise<any>;
62
- /**
63
- * {@link https://developer.github.com/v3/git/commits/#get-a-commit}
64
- * @param {string} sha
65
- * @return {Promise<Object>} response
66
- */
67
- commitForSha(sha: string): Promise<any>;
68
- /**
69
- * @see https://developer.github.com/v3/git/trees/
70
- * @param {string} sha
71
- * @return {Promise<Object[]>}
72
- */
73
- tree(sha: string): Promise<any[]>;
74
- /**
75
- * @see https://developer.github.com/v3/git/trees/
76
- * @param {Object[]} updates
77
- * @param {string} base base tree sha
78
- * @returns {Promise<Object>} newly created tree
79
- */
80
- addTree(updates: any[], base: string): Promise<any>;
81
- /**
82
- * {@link https://developer.github.com/v3/repos/branches/#list-branches}
83
- */
84
- initializeBranches(): Promise<void>;
85
- /**
86
- * {@link https://docs.github.com/en/rest/reference/repos#list-repository-tags}
87
- */
88
- initializeTags(): Promise<void>;
89
- /**
90
- * {@link https://docs.github.com/de/rest/repos/repos?apiVersion=2022-11-28#update-a-repository}
91
- */
92
- update(): Promise<any>;
93
- /**
94
- * @param {string} ref
95
- * @param {string} sha
96
- */
97
- _setRefId(ref: string, sha: string): void;
98
- /**
99
- * {@link https://docs.github.com/en/github-ae@latest/rest/git/refs#update-a-reference}
100
- * @param {string} ref
101
- * @param {string} sha
102
- * @param {Object} options
103
- * @returns {Promise<Object>}
104
- *
105
- */
106
- setRefId(ref: string, sha: string, options: any): Promise<any>;
107
- createBranch(name: any, from: any, options: any): Promise<import("repository-provider").Branch>;
108
- deleteBranch(name: any): Promise<any>;
109
- /**
110
- * {@link https://developer.github.com/v3/pulls/#update-a-pull-request}
111
- *
112
- * @param {string} name
113
- */
114
- deletePullRequest(name: string): Promise<void>;
115
- /**
116
- * {@link https://developer.github.com/v3/repos/hooks/}
117
- */
118
- initializeHooks(): Promise<void>;
119
- #private;
120
- }
121
- import { Repository } from "repository-provider";
122
- import { Commit } from "repository-provider";