@theholocron/holocron-plugin-github 5.0.0-alpha.501 → 5.0.0-alpha.503

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/dist/index.d.mts CHANGED
@@ -7,7 +7,7 @@
7
7
  * receives plugin-level options from `holocron.config.json` and
8
8
  * returns the bound implementation.
9
9
  */
10
- import { AddedItem, Auth, AuthError, BoardItem, BoardItemInput, BoardState, BoardSummary, BoardTemplate, Ci, CiRun, CiRunFilter, EnsureReport, Environment, Environments, ExportInfo, ImportOptions, ImportResult, Issue, IssueRecord, IssueSearchFilter, IssueSelector, Issues, LabelDef, LifecycleResult, LifecycleSlot, MoveReport, PagesConfig, PluginToken, Projects, PullRequest, RepoRef, RepoSettings, ResolveTokenInput, Ruleset, SecretAccess, SecretScope, Secrets, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, SyncResult, TeamEntry, TeamEntry as TeamEntry$1, TeamPermission, TeamPermission as TeamPermission$1, TrackerDoctorReport, TrackerUser, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess, createFeatureResolver } from "@theholocron/cli";
10
+ import { AddedItem, Auth, AuthError, BoardItem, BoardItemInput, BoardState, BoardSummary, BoardTemplate, Ci, CiRun, CiRunFilter, EnsureReport, Environment, Environments, ExportInfo, ImportOptions, ImportResult, Issue, IssueCreateInput, IssuePatch, IssueRecord, IssueSearchFilter, IssueSelector, IssueUpdateResult, Issues, LabelDef, LifecycleResult, LifecycleSlot, MoveReport, PagesConfig, PluginToken, Projects, PullRequest, PullRequestChecks, PullRequestInput, PullRequestPatch, PullRequestResult, RepoRef, RepoSettings, ResolveTokenInput, Ruleset, SecretAccess, SecretScope, Secrets, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, SyncResult, TeamEntry, TeamEntry as TeamEntry$1, TeamPermission, TeamPermission as TeamPermission$1, TrackerDoctorReport, TrackerUser, VerifyTokenFailure, VerifyTokenResult, VerifyTokenResult as VerifyTokenResult$1, VerifyTokenSuccess, createFeatureResolver } from "@theholocron/cli";
11
11
  import { GitHubClient, GitHubClientOptions, GraphQLClient, createGitHubClient } from "@theholocron/github-client";
12
12
  /** Resolves the token for read-only GitHub access (`HOLOCRON_READ_TOKEN`, keyring key `github.read`). */
13
13
  export declare const resolveReadToken: import("@theholocron/cli").FeatureResolver;
@@ -30,6 +30,11 @@ export declare const resolveDeployToken: import("@theholocron/cli").FeatureResol
30
30
  export declare const resolveUserSyncToken: import("@theholocron/cli").FeatureResolver;
31
31
  /** Resolves the org-level token (`HOLOCRON_ORG_TOKEN`, keyring key `github.org`). */
32
32
  export declare const resolveOrgToken: import("@theholocron/cli").FeatureResolver;
33
+ /** The area declaration the plugin is handed from `repo.labels`. */
34
+ interface AreaConfig {
35
+ areas?: Record<string, string[]>;
36
+ scopes?: Record<string, string>;
37
+ }
33
38
  interface CiOptions {
34
39
  repo: string;
35
40
  }
@@ -109,17 +114,17 @@ export declare class GitHubIssues implements Issues {
109
114
  private searchText;
110
115
  /** Fetches one issue by its key. */
111
116
  get(key: string): Promise<Issue>;
112
- /** Creates an issue and returns its key as `#<number>`; the milestone is resolved from its title. */
113
- create(input: {
114
- summary: string;
115
- body?: string;
116
- labels?: string[];
117
- milestone?: string;
118
- assignees?: string[];
119
- }): Promise<{
117
+ /**
118
+ * Creates an issue and returns its key as `#<number>`; the milestone is resolved from its title. Type, Priority,
119
+ * Effort, the dates, the parent and the blockers are set after the issue exists; what GitHub refuses of them comes
120
+ * back in `dropped`, never as a failure, because the issue is made by then and its key must not be lost.
121
+ */
122
+ create(input: IssueCreateInput): Promise<{
120
123
  key: string;
121
124
  dropped?: string[];
122
125
  }>;
126
+ /** Changes an issue; see {@link updateGitHubIssue}. */
127
+ update(key: string, patch: IssuePatch): Promise<IssueUpdateResult>;
123
128
  transition(key: string, slot: LifecycleSlot): Promise<LifecycleResult>;
124
129
  /** Adds a comment to the issue with the given key. */
125
130
  comment(key: string, body: string): Promise<void>;
@@ -131,6 +136,9 @@ export declare class GitHubIssues implements Issues {
131
136
  import(records: IssueRecord[], options?: ImportOptions): Promise<ImportResult[]>;
132
137
  /** Like `import`, and it also updates what an earlier import or sync made, for `holocron sync issues`. */
133
138
  sync(records: IssueRecord[], options?: ImportOptions): Promise<SyncResult[]>;
139
+ private fieldSetter;
140
+ /** What the field writers need; the setter is shared so the organization's field list is read once. */
141
+ private fieldContext;
134
142
  private resolveMilestone;
135
143
  private removeStatusLabels;
136
144
  private mapIssue;
@@ -330,6 +338,7 @@ export declare class GitHubSource implements Source {
330
338
  removeWorkflowFile(name: string): Promise<void>;
331
339
  writeRepoFile(path: string, contents: string): Promise<void>;
332
340
  syncLabels(canonical: ReadonlyArray<LabelDef>, stale: ReadonlyArray<string>): Promise<string>;
341
+ ensureLabels(labels: ReadonlyArray<LabelDef>): Promise<string>;
333
342
  syncProperties(values: Record<string, string | string[]>): Promise<string>;
334
343
  getOrgPropertyValues(name: string): Promise<string[] | undefined>;
335
344
  addOrgPropertyValues(name: string, values: string[]): Promise<string[]>;
@@ -375,6 +384,11 @@ export declare class GitHubSource implements Source {
375
384
  listBranches(repo?: string): Promise<SourceBranch[]>;
376
385
  deleteBranch(name: string, repo?: string): Promise<void>;
377
386
  listPullRequestCommits(number: number, repo?: string): Promise<string[]>;
387
+ listPullRequestFiles(number: number, repo?: string): Promise<string[]>;
388
+ createPullRequest(input: PullRequestInput, repo?: string): Promise<PullRequestResult>;
389
+ updatePullRequest(number: number, patch: PullRequestPatch, repo?: string): Promise<PullRequestResult>;
390
+ markReady(number: number, repo?: string): Promise<boolean>;
391
+ getPullRequestChecks(number: number, repo?: string): Promise<PullRequestChecks>;
378
392
  configurePages(config: PagesConfig, token: string): Promise<void>;
379
393
  }
380
394
  /** A team entry with the permission spelled out. */
@@ -422,6 +436,8 @@ export interface GitHubPluginOptions extends ResolveTokenInput {
422
436
  /** Label that marks an issue as in review. */
423
437
  inReview: string;
424
438
  };
439
+ /** `repo.labels` (the area map), handed in by the loader for the `issue-types` probe. */
440
+ areaLabels?: AreaConfig;
425
441
  /** Override base URL for tests. Defaults to https://api.github.com. */
426
442
  baseUrl?: string;
427
443
  /** Override `fetch` for tests. Defaults to global `fetch`. */
@@ -455,6 +471,7 @@ export declare function createPlugin(options: GitHubPluginOptions): {
455
471
  name: string;
456
472
  probes: {
457
473
  token: import("@theholocron/cli").Probe;
474
+ "issue-types": import("@theholocron/cli").Probe;
458
475
  connection: import("@theholocron/cli").Probe;
459
476
  };
460
477
  capabilities: {