1
0
Fork 0

fix(build): add API visibility notices

This commit is contained in:
Sean Sube 2023-01-01 17:42:42 -06:00
parent c8e2b8dfd5
commit 311651155d
13 changed files with 58 additions and 9 deletions

View File

@ -15,9 +15,9 @@
| 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. |
| [syncProjectLabels(options)](./cautious-journey.syncprojectlabels.md) | |
| [syncProjectLabels(options)](./cautious-journey.syncprojectlabels.md) | TODO |
## Interfaces
@ -25,12 +25,12 @@
| --- | --- |
| [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. |
| [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. |
| [ResolveResult](./cautious-journey.resolveresult.md) | Collected results from a resolver run. |
| [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. |
| [SyncOptions](./cautious-journey.syncoptions.md) | |
| [SyncOptions](./cautious-journey.syncoptions.md) | TODO |
## Type Aliases

View File

@ -4,6 +4,8 @@
## RemoteOptions interface
Options for a new remote instance.
<b>Signature:</b>
```typescript

View File

@ -4,6 +4,8 @@
## resolveProject() function
TODO
<b>Signature:</b>
```typescript

View File

@ -4,6 +4,8 @@
## SyncOptions interface
TODO
<b>Signature:</b>
```typescript

View File

@ -4,6 +4,8 @@
## syncProjectLabels() function
TODO
<b>Signature:</b>
```typescript

View File

@ -106,7 +106,7 @@ export interface Remote {
updateLabel(options: LabelUpdate): Promise<LabelUpdate>;
}
// @public (undocumented)
// @public
export interface RemoteOptions extends BaseOptions {
data: Record<string, string>;
dryrun: boolean;
@ -127,7 +127,7 @@ export interface ResolveInput {
states: Array<StateLabel>;
}
// @public (undocumented)
// @public
export function resolveProject(options: ResolveInput): ResolveResult;
// @public
@ -160,7 +160,7 @@ export interface StateValue extends BaseLabel {
// @public
export function syncIssueLabels(options: SyncOptions): Promise<unknown>;
// @public (undocumented)
// @public
export interface SyncOptions {
// (undocumented)
logger: Logger;
@ -176,7 +176,7 @@ export interface SyncOptions {
remote: Remote;
}
// @public (undocumented)
// @public
export function syncProjectLabels(options: SyncOptions): Promise<unknown>;
// (No @packageDocumentation comment for this package)

View File

@ -42,7 +42,7 @@ export interface ProjectConfig {
/**
* Leave a comment along with any update, explaining the changes that were made.
*
* @default `true`
* Defaults to true.
*/
comment: boolean;
@ -80,6 +80,7 @@ export interface ConfigData {
export const CONFIG_SCHEMA_KEY = 'cautious-journey#/definitions/config';
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);
}

View File

@ -11,6 +11,8 @@ export interface LabelRef {
/**
* A set of labels to add and/or remove.
*
* @public
*/
export interface ChangeSet {
adds: Array<LabelRef>;
@ -49,6 +51,8 @@ export interface BaseLabel extends ChangeSet {
/**
* Individual labels: the equivalent of a checkbox.
*
* @public
*/
export type FlagLabel = BaseLabel;
@ -58,6 +62,8 @@ export interface StateChange extends ChangeSet {
/**
* One of many values for a particular state.
*
* @public
*/
export interface StateValue extends BaseLabel {
/**
@ -68,6 +74,8 @@ export interface StateValue extends BaseLabel {
/**
* Grouped labels: the equivalent of a radio group.
*
* @public
*/
export interface StateLabel extends BaseLabel {
divider: string;

View File

@ -7,6 +7,8 @@ import { BaseRemote } from './base.js';
/**
* Github/Octokit API implementation of the `Remote` contract.
*
* @public
*/
export class GithubRemote extends BaseRemote<Octokit, RemoteOptions> implements Remote {
constructor(options: RemoteOptions) {

View File

@ -14,6 +14,8 @@ export interface GitlabOptions extends BaseOptions {
/**
* Gitlab API implementation of the `Remote` contract.
*
* @public
*/
export class GitlabRemote extends BaseRemote<GitlabType, RemoteOptions> implements Remote {
constructor(options: RemoteOptions) {

View File

@ -33,6 +33,11 @@ export interface LabelUpdate extends LabelQuery {
desc: string;
}
/**
* Options for a new remote instance.
*
* @public
*/
export interface RemoteOptions extends BaseOptions {
/**
* 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.
*
* @public
*/
export interface Remote {
connect(): Promise<boolean>;

View File

@ -42,6 +42,8 @@ export interface ErrorRecord {
/**
* Collected inputs for a resolver run.
*
* @public
*/
export interface ResolveInput {
flags: Array<FlagLabel>;
@ -52,6 +54,8 @@ export interface ResolveInput {
/**
* Collected results from a resolver run.
*
* @public
*/
export interface ResolveResult {
changes: Array<ChangeRecord>;
@ -183,6 +187,11 @@ function resolveState(state: StateLabel, anticipatedResult: ResolveResult, activ
}
}
/**
* TODO
*
* @public
*/
export function resolveProject(options: ResolveInput): ResolveResult {
const result: ResolveResult = {
changes: [],

View File

@ -7,6 +7,11 @@ import { LabelUpdate, Remote } from './remote/index.js';
import { resolveProject } from './resolve.js';
import { compareItems, defaultTo, defaultUntil, RandomGenerator } from './utils.js';
/**
* TODO
*
* @public
*/
export interface SyncOptions {
logger: Logger;
project: ProjectConfig;
@ -17,6 +22,8 @@ export interface SyncOptions {
/**
* goes through and resolves each issue in the project.
* if there are changes and no errors, then updates the issue.
*
* @public
*/
export async function syncIssueLabels(options: SyncOptions): Promise<unknown> {
const { logger, project, remote } = options;
@ -69,6 +76,11 @@ export async function syncIssueLabels(options: SyncOptions): Promise<unknown> {
return undefined;
}
/**
* TODO
*
* @public
*/
/* eslint-disable-next-line sonarjs/cognitive-complexity */
export async function syncProjectLabels(options: SyncOptions): Promise<unknown> {
const { logger, project, remote } = options;