fix(build): add API visibility notices
This commit is contained in:
parent
c8e2b8dfd5
commit
311651155d
|
@ -15,9 +15,9 @@
|
||||||
|
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [resolveProject(options)](./cautious-journey.resolveproject.md) | |
|
| [resolveProject(options)](./cautious-journey.resolveproject.md) | TODO |
|
||||||
| [syncIssueLabels(options)](./cautious-journey.syncissuelabels.md) | goes through and resolves each issue in the project. if there are changes and no errors, then updates the issue. |
|
| [syncIssueLabels(options)](./cautious-journey.syncissuelabels.md) | goes through and resolves each issue in the project. if there are changes and no errors, then updates the issue. |
|
||||||
| [syncProjectLabels(options)](./cautious-journey.syncprojectlabels.md) | |
|
| [syncProjectLabels(options)](./cautious-journey.syncprojectlabels.md) | TODO |
|
||||||
|
|
||||||
## Interfaces
|
## Interfaces
|
||||||
|
|
||||||
|
@ -25,12 +25,12 @@
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [ChangeSet](./cautious-journey.changeset.md) | A set of labels to add and/or remove. |
|
| [ChangeSet](./cautious-journey.changeset.md) | A set of labels to add and/or remove. |
|
||||||
| [Remote](./cautious-journey.remote.md) | Basic functions which every remote API must provide. |
|
| [Remote](./cautious-journey.remote.md) | Basic functions which every remote API must provide. |
|
||||||
| [RemoteOptions](./cautious-journey.remoteoptions.md) | |
|
| [RemoteOptions](./cautious-journey.remoteoptions.md) | Options for a new remote instance. |
|
||||||
| [ResolveInput](./cautious-journey.resolveinput.md) | Collected inputs for a resolver run. |
|
| [ResolveInput](./cautious-journey.resolveinput.md) | Collected inputs for a resolver run. |
|
||||||
| [ResolveResult](./cautious-journey.resolveresult.md) | Collected results from a resolver run. |
|
| [ResolveResult](./cautious-journey.resolveresult.md) | Collected results from a resolver run. |
|
||||||
| [StateLabel](./cautious-journey.statelabel.md) | Grouped labels: the equivalent of a radio group. |
|
| [StateLabel](./cautious-journey.statelabel.md) | Grouped labels: the equivalent of a radio group. |
|
||||||
| [StateValue](./cautious-journey.statevalue.md) | One of many values for a particular state. |
|
| [StateValue](./cautious-journey.statevalue.md) | One of many values for a particular state. |
|
||||||
| [SyncOptions](./cautious-journey.syncoptions.md) | |
|
| [SyncOptions](./cautious-journey.syncoptions.md) | TODO |
|
||||||
|
|
||||||
## Type Aliases
|
## Type Aliases
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
## RemoteOptions interface
|
## RemoteOptions interface
|
||||||
|
|
||||||
|
Options for a new remote instance.
|
||||||
|
|
||||||
<b>Signature:</b>
|
<b>Signature:</b>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
## resolveProject() function
|
## resolveProject() function
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
<b>Signature:</b>
|
<b>Signature:</b>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
## SyncOptions interface
|
## SyncOptions interface
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
<b>Signature:</b>
|
<b>Signature:</b>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
## syncProjectLabels() function
|
## syncProjectLabels() function
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
<b>Signature:</b>
|
<b>Signature:</b>
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
|
|
@ -106,7 +106,7 @@ export interface Remote {
|
||||||
updateLabel(options: LabelUpdate): Promise<LabelUpdate>;
|
updateLabel(options: LabelUpdate): Promise<LabelUpdate>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @public (undocumented)
|
// @public
|
||||||
export interface RemoteOptions extends BaseOptions {
|
export interface RemoteOptions extends BaseOptions {
|
||||||
data: Record<string, string>;
|
data: Record<string, string>;
|
||||||
dryrun: boolean;
|
dryrun: boolean;
|
||||||
|
@ -127,7 +127,7 @@ export interface ResolveInput {
|
||||||
states: Array<StateLabel>;
|
states: Array<StateLabel>;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @public (undocumented)
|
// @public
|
||||||
export function resolveProject(options: ResolveInput): ResolveResult;
|
export function resolveProject(options: ResolveInput): ResolveResult;
|
||||||
|
|
||||||
// @public
|
// @public
|
||||||
|
@ -160,7 +160,7 @@ export interface StateValue extends BaseLabel {
|
||||||
// @public
|
// @public
|
||||||
export function syncIssueLabels(options: SyncOptions): Promise<unknown>;
|
export function syncIssueLabels(options: SyncOptions): Promise<unknown>;
|
||||||
|
|
||||||
// @public (undocumented)
|
// @public
|
||||||
export interface SyncOptions {
|
export interface SyncOptions {
|
||||||
// (undocumented)
|
// (undocumented)
|
||||||
logger: Logger;
|
logger: Logger;
|
||||||
|
@ -176,7 +176,7 @@ export interface SyncOptions {
|
||||||
remote: Remote;
|
remote: Remote;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @public (undocumented)
|
// @public
|
||||||
export function syncProjectLabels(options: SyncOptions): Promise<unknown>;
|
export function syncProjectLabels(options: SyncOptions): Promise<unknown>;
|
||||||
|
|
||||||
// (No @packageDocumentation comment for this package)
|
// (No @packageDocumentation comment for this package)
|
||||||
|
|
|
@ -42,7 +42,7 @@ export interface ProjectConfig {
|
||||||
/**
|
/**
|
||||||
* Leave a comment along with any update, explaining the changes that were made.
|
* Leave a comment along with any update, explaining the changes that were made.
|
||||||
*
|
*
|
||||||
* @default `true`
|
* Defaults to true.
|
||||||
*/
|
*/
|
||||||
comment: boolean;
|
comment: boolean;
|
||||||
|
|
||||||
|
@ -80,6 +80,7 @@ export interface ConfigData {
|
||||||
export const CONFIG_SCHEMA_KEY = 'cautious-journey#/definitions/config';
|
export const CONFIG_SCHEMA_KEY = 'cautious-journey#/definitions/config';
|
||||||
|
|
||||||
export function configSchemaPath(): URL {
|
export function configSchemaPath(): URL {
|
||||||
|
// TODO: do something for bundled version, where import.meta.url is empty
|
||||||
return new URL(join('.', 'schema.yml'), import.meta.url);
|
return new URL(join('.', 'schema.yml'), import.meta.url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,8 @@ export interface LabelRef {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A set of labels to add and/or remove.
|
* A set of labels to add and/or remove.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface ChangeSet {
|
export interface ChangeSet {
|
||||||
adds: Array<LabelRef>;
|
adds: Array<LabelRef>;
|
||||||
|
@ -49,6 +51,8 @@ export interface BaseLabel extends ChangeSet {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Individual labels: the equivalent of a checkbox.
|
* Individual labels: the equivalent of a checkbox.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export type FlagLabel = BaseLabel;
|
export type FlagLabel = BaseLabel;
|
||||||
|
|
||||||
|
@ -58,6 +62,8 @@ export interface StateChange extends ChangeSet {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One of many values for a particular state.
|
* One of many values for a particular state.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface StateValue extends BaseLabel {
|
export interface StateValue extends BaseLabel {
|
||||||
/**
|
/**
|
||||||
|
@ -68,6 +74,8 @@ export interface StateValue extends BaseLabel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Grouped labels: the equivalent of a radio group.
|
* Grouped labels: the equivalent of a radio group.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface StateLabel extends BaseLabel {
|
export interface StateLabel extends BaseLabel {
|
||||||
divider: string;
|
divider: string;
|
||||||
|
|
|
@ -7,6 +7,8 @@ import { BaseRemote } from './base.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Github/Octokit API implementation of the `Remote` contract.
|
* Github/Octokit API implementation of the `Remote` contract.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export class GithubRemote extends BaseRemote<Octokit, RemoteOptions> implements Remote {
|
export class GithubRemote extends BaseRemote<Octokit, RemoteOptions> implements Remote {
|
||||||
constructor(options: RemoteOptions) {
|
constructor(options: RemoteOptions) {
|
||||||
|
|
|
@ -14,6 +14,8 @@ export interface GitlabOptions extends BaseOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gitlab API implementation of the `Remote` contract.
|
* Gitlab API implementation of the `Remote` contract.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export class GitlabRemote extends BaseRemote<GitlabType, RemoteOptions> implements Remote {
|
export class GitlabRemote extends BaseRemote<GitlabType, RemoteOptions> implements Remote {
|
||||||
constructor(options: RemoteOptions) {
|
constructor(options: RemoteOptions) {
|
||||||
|
|
|
@ -33,6 +33,11 @@ export interface LabelUpdate extends LabelQuery {
|
||||||
desc: string;
|
desc: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Options for a new remote instance.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export interface RemoteOptions extends BaseOptions {
|
export interface RemoteOptions extends BaseOptions {
|
||||||
/**
|
/**
|
||||||
* Arbitrary key-value data for this remote, usually credentials and base URLs.
|
* Arbitrary key-value data for this remote, usually credentials and base URLs.
|
||||||
|
@ -54,6 +59,8 @@ export interface RemoteOptions extends BaseOptions {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic functions which every remote API must provide.
|
* Basic functions which every remote API must provide.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface Remote {
|
export interface Remote {
|
||||||
connect(): Promise<boolean>;
|
connect(): Promise<boolean>;
|
||||||
|
|
|
@ -42,6 +42,8 @@ export interface ErrorRecord {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collected inputs for a resolver run.
|
* Collected inputs for a resolver run.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface ResolveInput {
|
export interface ResolveInput {
|
||||||
flags: Array<FlagLabel>;
|
flags: Array<FlagLabel>;
|
||||||
|
@ -52,6 +54,8 @@ export interface ResolveInput {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collected results from a resolver run.
|
* Collected results from a resolver run.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export interface ResolveResult {
|
export interface ResolveResult {
|
||||||
changes: Array<ChangeRecord>;
|
changes: Array<ChangeRecord>;
|
||||||
|
@ -183,6 +187,11 @@ function resolveState(state: StateLabel, anticipatedResult: ResolveResult, activ
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export function resolveProject(options: ResolveInput): ResolveResult {
|
export function resolveProject(options: ResolveInput): ResolveResult {
|
||||||
const result: ResolveResult = {
|
const result: ResolveResult = {
|
||||||
changes: [],
|
changes: [],
|
||||||
|
|
12
src/sync.ts
12
src/sync.ts
|
@ -7,6 +7,11 @@ import { LabelUpdate, Remote } from './remote/index.js';
|
||||||
import { resolveProject } from './resolve.js';
|
import { resolveProject } from './resolve.js';
|
||||||
import { compareItems, defaultTo, defaultUntil, RandomGenerator } from './utils.js';
|
import { compareItems, defaultTo, defaultUntil, RandomGenerator } from './utils.js';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
export interface SyncOptions {
|
export interface SyncOptions {
|
||||||
logger: Logger;
|
logger: Logger;
|
||||||
project: ProjectConfig;
|
project: ProjectConfig;
|
||||||
|
@ -17,6 +22,8 @@ export interface SyncOptions {
|
||||||
/**
|
/**
|
||||||
* goes through and resolves each issue in the project.
|
* goes through and resolves each issue in the project.
|
||||||
* if there are changes and no errors, then updates the issue.
|
* if there are changes and no errors, then updates the issue.
|
||||||
|
*
|
||||||
|
* @public
|
||||||
*/
|
*/
|
||||||
export async function syncIssueLabels(options: SyncOptions): Promise<unknown> {
|
export async function syncIssueLabels(options: SyncOptions): Promise<unknown> {
|
||||||
const { logger, project, remote } = options;
|
const { logger, project, remote } = options;
|
||||||
|
@ -69,6 +76,11 @@ export async function syncIssueLabels(options: SyncOptions): Promise<unknown> {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
*
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
/* eslint-disable-next-line sonarjs/cognitive-complexity */
|
/* eslint-disable-next-line sonarjs/cognitive-complexity */
|
||||||
export async function syncProjectLabels(options: SyncOptions): Promise<unknown> {
|
export async function syncProjectLabels(options: SyncOptions): Promise<unknown> {
|
||||||
const { logger, project, remote } = options;
|
const { logger, project, remote } = options;
|
||||||
|
|
Loading…
Reference in New Issue