@redocly/cli 0.0.0-snapshot.1737554067
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 +114 -0
- package/bin/cli.js +3 -0
- package/lib/__mocks__/@redocly/openapi-core.d.ts +99 -0
- package/lib/__mocks__/@redocly/openapi-core.js +84 -0
- package/lib/__mocks__/documents.d.ts +150 -0
- package/lib/__mocks__/documents.js +123 -0
- package/lib/__mocks__/fs.d.ts +8 -0
- package/lib/__mocks__/fs.js +9 -0
- package/lib/__mocks__/perf_hooks.d.ts +3 -0
- package/lib/__mocks__/perf_hooks.js +6 -0
- package/lib/__mocks__/redoc.d.ts +6 -0
- package/lib/__mocks__/redoc.js +5 -0
- package/lib/__tests__/commands/build-docs.test.d.ts +1 -0
- package/lib/__tests__/commands/build-docs.test.js +54 -0
- package/lib/__tests__/commands/bundle.test.d.ts +1 -0
- package/lib/__tests__/commands/bundle.test.js +235 -0
- package/lib/__tests__/commands/join.test.d.ts +1 -0
- package/lib/__tests__/commands/join.test.js +274 -0
- package/lib/__tests__/commands/lint.test.d.ts +1 -0
- package/lib/__tests__/commands/lint.test.js +149 -0
- package/lib/__tests__/commands/push-region.test.d.ts +1 -0
- package/lib/__tests__/commands/push-region.test.js +55 -0
- package/lib/__tests__/commands/push.test.d.ts +1 -0
- package/lib/__tests__/commands/push.test.js +463 -0
- package/lib/__tests__/fetch-with-timeout.test.d.ts +1 -0
- package/lib/__tests__/fetch-with-timeout.test.js +44 -0
- package/lib/__tests__/fixtures/config.d.ts +21 -0
- package/lib/__tests__/fixtures/config.js +24 -0
- package/lib/__tests__/spinner.test.d.ts +1 -0
- package/lib/__tests__/spinner.test.js +43 -0
- package/lib/__tests__/utils.test.d.ts +1 -0
- package/lib/__tests__/utils.test.js +593 -0
- package/lib/__tests__/wrapper.test.d.ts +1 -0
- package/lib/__tests__/wrapper.test.js +68 -0
- package/lib/cms/api/__tests__/api-keys.test.d.ts +1 -0
- package/lib/cms/api/__tests__/api-keys.test.js +26 -0
- package/lib/cms/api/__tests__/api.client.test.d.ts +1 -0
- package/lib/cms/api/__tests__/api.client.test.js +333 -0
- package/lib/cms/api/__tests__/domains.test.d.ts +1 -0
- package/lib/cms/api/__tests__/domains.test.js +13 -0
- package/lib/cms/api/api-client.d.ts +75 -0
- package/lib/cms/api/api-client.js +225 -0
- package/lib/cms/api/api-keys.d.ts +1 -0
- package/lib/cms/api/api-keys.js +23 -0
- package/lib/cms/api/domains.d.ts +1 -0
- package/lib/cms/api/domains.js +11 -0
- package/lib/cms/api/index.d.ts +3 -0
- package/lib/cms/api/index.js +19 -0
- package/lib/cms/api/types.d.ts +102 -0
- package/lib/cms/api/types.js +2 -0
- package/lib/cms/commands/__tests__/push-status.test.d.ts +1 -0
- package/lib/cms/commands/__tests__/push-status.test.js +563 -0
- package/lib/cms/commands/__tests__/push.test.d.ts +1 -0
- package/lib/cms/commands/__tests__/push.test.js +315 -0
- package/lib/cms/commands/__tests__/utils.test.d.ts +1 -0
- package/lib/cms/commands/__tests__/utils.test.js +51 -0
- package/lib/cms/commands/push-status.d.ts +23 -0
- package/lib/cms/commands/push-status.js +206 -0
- package/lib/cms/commands/push.d.ts +28 -0
- package/lib/cms/commands/push.js +142 -0
- package/lib/cms/commands/utils.d.ts +25 -0
- package/lib/cms/commands/utils.js +46 -0
- package/lib/cms/utils.d.ts +2 -0
- package/lib/cms/utils.js +6 -0
- package/lib/commands/build-docs/index.d.ts +3 -0
- package/lib/commands/build-docs/index.js +39 -0
- package/lib/commands/build-docs/template.hbs +23 -0
- package/lib/commands/build-docs/types.d.ts +23 -0
- package/lib/commands/build-docs/types.js +2 -0
- package/lib/commands/build-docs/utils.d.ts +7 -0
- package/lib/commands/build-docs/utils.js +87 -0
- package/lib/commands/bundle.d.ts +14 -0
- package/lib/commands/bundle.js +91 -0
- package/lib/commands/eject.d.ts +9 -0
- package/lib/commands/eject.js +28 -0
- package/lib/commands/join.d.ts +11 -0
- package/lib/commands/join.js +565 -0
- package/lib/commands/lint.d.ts +13 -0
- package/lib/commands/lint.js +108 -0
- package/lib/commands/login.d.ts +9 -0
- package/lib/commands/login.js +23 -0
- package/lib/commands/preview-docs/index.d.ts +12 -0
- package/lib/commands/preview-docs/index.js +127 -0
- package/lib/commands/preview-docs/preview-server/default.hbs +24 -0
- package/lib/commands/preview-docs/preview-server/hot.js +59 -0
- package/lib/commands/preview-docs/preview-server/oauth2-redirect.html +21 -0
- package/lib/commands/preview-docs/preview-server/preview-server.d.ts +5 -0
- package/lib/commands/preview-docs/preview-server/preview-server.js +113 -0
- package/lib/commands/preview-docs/preview-server/server.d.ts +22 -0
- package/lib/commands/preview-docs/preview-server/server.js +85 -0
- package/lib/commands/preview-project/constants.d.ts +14 -0
- package/lib/commands/preview-project/constants.js +22 -0
- package/lib/commands/preview-project/index.d.ts +3 -0
- package/lib/commands/preview-project/index.js +56 -0
- package/lib/commands/preview-project/types.d.ts +10 -0
- package/lib/commands/preview-project/types.js +2 -0
- package/lib/commands/push.d.ts +44 -0
- package/lib/commands/push.js +295 -0
- package/lib/commands/split/__tests__/index.test.d.ts +1 -0
- package/lib/commands/split/__tests__/index.test.js +91 -0
- package/lib/commands/split/index.d.ts +13 -0
- package/lib/commands/split/index.js +259 -0
- package/lib/commands/split/types.d.ts +36 -0
- package/lib/commands/split/types.js +51 -0
- package/lib/commands/stats.d.ts +8 -0
- package/lib/commands/stats.js +96 -0
- package/lib/commands/translations.d.ts +7 -0
- package/lib/commands/translations.js +20 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +733 -0
- package/lib/types.d.ts +43 -0
- package/lib/types.js +5 -0
- package/lib/utils/__mocks__/miscellaneous.d.ts +43 -0
- package/lib/utils/__mocks__/miscellaneous.js +24 -0
- package/lib/utils/assert-node-version.d.ts +1 -0
- package/lib/utils/assert-node-version.js +16 -0
- package/lib/utils/fetch-with-timeout.d.ts +7 -0
- package/lib/utils/fetch-with-timeout.js +26 -0
- package/lib/utils/getCommandNameFromArgs.d.ts +2 -0
- package/lib/utils/getCommandNameFromArgs.js +6 -0
- package/lib/utils/js-utils.d.ts +5 -0
- package/lib/utils/js-utils.js +28 -0
- package/lib/utils/miscellaneous.d.ts +81 -0
- package/lib/utils/miscellaneous.js +551 -0
- package/lib/utils/platform.d.ts +16 -0
- package/lib/utils/platform.js +34 -0
- package/lib/utils/spinner.d.ts +10 -0
- package/lib/utils/spinner.js +42 -0
- package/lib/utils/update-version-notifier.d.ts +3 -0
- package/lib/utils/update-version-notifier.js +102 -0
- package/lib/wrapper.d.ts +11 -0
- package/lib/wrapper.js +65 -0
- package/package.json +69 -0
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BundleOutputFormat, Region, Config, RuleSeverity } from '@redocly/openapi-core';
|
|
2
|
+
import type { ArgumentsCamelCase } from 'yargs';
|
|
3
|
+
import type { LintOptions } from './commands/lint';
|
|
4
|
+
import type { BundleOptions } from './commands/bundle';
|
|
5
|
+
import type { JoinOptions } from './commands/join';
|
|
6
|
+
import type { LoginOptions } from './commands/login';
|
|
7
|
+
import type { PushOptions } from './commands/push';
|
|
8
|
+
import type { StatsOptions } from './commands/stats';
|
|
9
|
+
import type { SplitOptions } from './commands/split';
|
|
10
|
+
import type { PreviewDocsOptions } from './commands/preview-docs';
|
|
11
|
+
import type { BuildDocsArgv } from './commands/build-docs/types';
|
|
12
|
+
import type { PushOptions as CMSPushOptions } from './cms/commands/push';
|
|
13
|
+
import type { PushStatusOptions } from './cms/commands/push-status';
|
|
14
|
+
import type { PreviewProjectOptions } from './commands/preview-project/types';
|
|
15
|
+
import type { TranslationsOptions } from './commands/translations';
|
|
16
|
+
import type { EjectOptions } from './commands/eject';
|
|
17
|
+
export type Totals = {
|
|
18
|
+
errors: number;
|
|
19
|
+
warnings: number;
|
|
20
|
+
ignored: number;
|
|
21
|
+
};
|
|
22
|
+
export type Entrypoint = {
|
|
23
|
+
path: string;
|
|
24
|
+
alias?: string;
|
|
25
|
+
output?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const outputExtensions: ReadonlyArray<BundleOutputFormat>;
|
|
28
|
+
export type OutputExtensions = 'json' | 'yaml' | 'yml' | undefined;
|
|
29
|
+
export declare const regionChoices: ReadonlyArray<Region>;
|
|
30
|
+
export type CommandOptions = StatsOptions | SplitOptions | JoinOptions | PushOptions | CMSPushOptions | LintOptions | BundleOptions | LoginOptions | PreviewDocsOptions | BuildDocsArgv | PushStatusOptions | PreviewProjectOptions | TranslationsOptions | EjectOptions;
|
|
31
|
+
export type VerifyConfigOptions = {
|
|
32
|
+
config?: string;
|
|
33
|
+
'lint-config'?: RuleSeverity;
|
|
34
|
+
};
|
|
35
|
+
export type Skips = {
|
|
36
|
+
'skip-rule'?: string[];
|
|
37
|
+
'skip-decorator'?: string[];
|
|
38
|
+
'skip-preprocessor'?: string[];
|
|
39
|
+
};
|
|
40
|
+
export type ConfigApis = Pick<Config, 'apis' | 'configFile'>;
|
|
41
|
+
export type PushArguments = ArgumentsCamelCase<PushOptions & CMSPushOptions & {
|
|
42
|
+
apis: string[];
|
|
43
|
+
}>;
|
package/lib/types.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const getFallbackApisOrExit: jest.Mock<any, [entrypoints: any]>;
|
|
2
|
+
export declare const dumpBundle: jest.Mock<string, []>;
|
|
3
|
+
export declare const slash: jest.Mock<any, any>;
|
|
4
|
+
export declare const pluralize: jest.Mock<any, any>;
|
|
5
|
+
export declare const getExecutionTime: jest.Mock<any, any>;
|
|
6
|
+
export declare const printExecutionTime: jest.Mock<any, any>;
|
|
7
|
+
export declare const printUnusedWarnings: jest.Mock<any, any>;
|
|
8
|
+
export declare const printLintTotals: jest.Mock<any, any>;
|
|
9
|
+
export declare const getOutputFileName: jest.Mock<{
|
|
10
|
+
outputFile: string;
|
|
11
|
+
ext: string;
|
|
12
|
+
}, []>;
|
|
13
|
+
export declare const handleError: jest.Mock<any, any>;
|
|
14
|
+
export declare const exitWithError: jest.Mock<any, any>;
|
|
15
|
+
export declare const writeYaml: jest.Mock<any, any>;
|
|
16
|
+
export declare const loadConfigAndHandleErrors: jest.Mock<{
|
|
17
|
+
configFile: null;
|
|
18
|
+
styleguide: {
|
|
19
|
+
addIgnore: jest.Mock<any, any>;
|
|
20
|
+
skipRules: jest.Mock<any, any>;
|
|
21
|
+
skipPreprocessors: jest.Mock<any, any>;
|
|
22
|
+
saveIgnore: jest.Mock<any, any>;
|
|
23
|
+
skipDecorators: jest.Mock<any, any>;
|
|
24
|
+
ignore: null;
|
|
25
|
+
decorators: {
|
|
26
|
+
oas2: {};
|
|
27
|
+
oas3_0: {};
|
|
28
|
+
oas3_1: {};
|
|
29
|
+
};
|
|
30
|
+
preprocessors: {
|
|
31
|
+
oas2: {};
|
|
32
|
+
oas3_0: {};
|
|
33
|
+
oas3_1: {};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
}, []>;
|
|
37
|
+
export declare const checkIfRulesetExist: jest.Mock<any, any>;
|
|
38
|
+
export declare const sortTopLevelKeysForOas: jest.Mock<any, [document: any]>;
|
|
39
|
+
export declare const getAndValidateFileExtension: jest.Mock<string | undefined, [fileName: string]>;
|
|
40
|
+
export declare const writeToFileByExtension: jest.Mock<any, any>;
|
|
41
|
+
export declare const checkForDeprecatedOptions: jest.Mock<any, any>;
|
|
42
|
+
export declare const saveBundle: jest.Mock<any, any>;
|
|
43
|
+
export declare const formatPath: jest.Mock<string, [path: string]>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatPath = exports.saveBundle = exports.checkForDeprecatedOptions = exports.writeToFileByExtension = exports.getAndValidateFileExtension = exports.sortTopLevelKeysForOas = exports.checkIfRulesetExist = exports.loadConfigAndHandleErrors = exports.writeYaml = exports.exitWithError = exports.handleError = exports.getOutputFileName = exports.printLintTotals = exports.printUnusedWarnings = exports.printExecutionTime = exports.getExecutionTime = exports.pluralize = exports.slash = exports.dumpBundle = exports.getFallbackApisOrExit = void 0;
|
|
4
|
+
const config_1 = require("../../__tests__/fixtures/config");
|
|
5
|
+
exports.getFallbackApisOrExit = jest.fn((entrypoints) => entrypoints.map((path) => ({ path })));
|
|
6
|
+
exports.dumpBundle = jest.fn(() => '');
|
|
7
|
+
exports.slash = jest.fn();
|
|
8
|
+
exports.pluralize = jest.fn();
|
|
9
|
+
exports.getExecutionTime = jest.fn();
|
|
10
|
+
exports.printExecutionTime = jest.fn();
|
|
11
|
+
exports.printUnusedWarnings = jest.fn();
|
|
12
|
+
exports.printLintTotals = jest.fn();
|
|
13
|
+
exports.getOutputFileName = jest.fn(() => ({ outputFile: 'test.yaml', ext: 'yaml' }));
|
|
14
|
+
exports.handleError = jest.fn();
|
|
15
|
+
exports.exitWithError = jest.fn();
|
|
16
|
+
exports.writeYaml = jest.fn();
|
|
17
|
+
exports.loadConfigAndHandleErrors = jest.fn(() => config_1.ConfigFixture);
|
|
18
|
+
exports.checkIfRulesetExist = jest.fn();
|
|
19
|
+
exports.sortTopLevelKeysForOas = jest.fn((document) => document);
|
|
20
|
+
exports.getAndValidateFileExtension = jest.fn((fileName) => fileName.split('.').pop());
|
|
21
|
+
exports.writeToFileByExtension = jest.fn();
|
|
22
|
+
exports.checkForDeprecatedOptions = jest.fn();
|
|
23
|
+
exports.saveBundle = jest.fn();
|
|
24
|
+
exports.formatPath = jest.fn((path) => path);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const semver = require("semver");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const process = require("process");
|
|
6
|
+
const colorette_1 = require("colorette");
|
|
7
|
+
try {
|
|
8
|
+
const { engines } = require(path.join(__dirname, '../package.json'));
|
|
9
|
+
const version = engines.node;
|
|
10
|
+
if (!semver.satisfies(process.version, version)) {
|
|
11
|
+
process.stderr.write((0, colorette_1.yellow)(`\n⚠️ Warning: failed to satisfy expected node version. Expected: "${version}", Current "${process.version}"\n\n`));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
// Do nothing
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RequestInit } from 'node-fetch';
|
|
2
|
+
export declare const DEFAULT_FETCH_TIMEOUT = 3000;
|
|
3
|
+
export type FetchWithTimeoutOptions = RequestInit & {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: (url: string, { timeout, ...options }?: FetchWithTimeoutOptions) => Promise<import("node-fetch").Response>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_FETCH_TIMEOUT = void 0;
|
|
4
|
+
const node_fetch_1 = require("node-fetch");
|
|
5
|
+
const abort_controller_1 = require("abort-controller");
|
|
6
|
+
const openapi_core_1 = require("@redocly/openapi-core");
|
|
7
|
+
exports.DEFAULT_FETCH_TIMEOUT = 3000;
|
|
8
|
+
exports.default = async (url, { timeout, ...options } = {}) => {
|
|
9
|
+
if (!timeout) {
|
|
10
|
+
return (0, node_fetch_1.default)(url, {
|
|
11
|
+
...options,
|
|
12
|
+
agent: (0, openapi_core_1.getProxyAgent)(),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const controller = new abort_controller_1.default();
|
|
16
|
+
const timeoutId = setTimeout(() => {
|
|
17
|
+
controller.abort();
|
|
18
|
+
}, timeout);
|
|
19
|
+
const res = await (0, node_fetch_1.default)(url, {
|
|
20
|
+
signal: controller.signal,
|
|
21
|
+
...options,
|
|
22
|
+
agent: (0, openapi_core_1.getProxyAgent)(),
|
|
23
|
+
});
|
|
24
|
+
clearTimeout(timeoutId);
|
|
25
|
+
return res;
|
|
26
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function isObject(obj: unknown): obj is Record<string, unknown>;
|
|
2
|
+
export declare function isEmptyObject(obj: any): boolean;
|
|
3
|
+
export declare function isString(str: string): boolean;
|
|
4
|
+
export declare function keysOf<T>(obj: T): (keyof T)[];
|
|
5
|
+
export declare function capitalize(s: string): string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isObject = isObject;
|
|
4
|
+
exports.isEmptyObject = isEmptyObject;
|
|
5
|
+
exports.isString = isString;
|
|
6
|
+
exports.keysOf = keysOf;
|
|
7
|
+
exports.capitalize = capitalize;
|
|
8
|
+
function isObject(obj) {
|
|
9
|
+
const type = typeof obj;
|
|
10
|
+
return type === 'function' || (type === 'object' && !!obj);
|
|
11
|
+
}
|
|
12
|
+
function isEmptyObject(obj) {
|
|
13
|
+
return !!obj && Object.keys(obj).length === 0;
|
|
14
|
+
}
|
|
15
|
+
function isString(str) {
|
|
16
|
+
return Object.prototype.toString.call(str) === '[object String]';
|
|
17
|
+
}
|
|
18
|
+
function keysOf(obj) {
|
|
19
|
+
if (!obj)
|
|
20
|
+
return [];
|
|
21
|
+
return Object.keys(obj);
|
|
22
|
+
}
|
|
23
|
+
function capitalize(s) {
|
|
24
|
+
if (s?.length > 0) {
|
|
25
|
+
return s[0].toUpperCase() + s.slice(1);
|
|
26
|
+
}
|
|
27
|
+
return s;
|
|
28
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Arguments } from 'yargs';
|
|
2
|
+
import type { BundleOutputFormat, StyleguideConfig, Region, Config, Oas3Definition, Oas2Definition } from '@redocly/openapi-core';
|
|
3
|
+
import type { RawConfigProcessor } from '@redocly/openapi-core/lib/config';
|
|
4
|
+
import type { Totals, Entrypoint, ConfigApis, CommandOptions, OutputExtensions } from '../types';
|
|
5
|
+
export declare function getFallbackApisOrExit(argsApis: string[] | undefined, config: ConfigApis): Promise<Entrypoint[]>;
|
|
6
|
+
export declare function getExecutionTime(startedAt: number): string;
|
|
7
|
+
export declare function printExecutionTime(commandName: string, startedAt: number, api: string): void;
|
|
8
|
+
export declare function pathToFilename(path: string, pathSeparator: string): string;
|
|
9
|
+
export declare function escapeLanguageName(lang: string): string;
|
|
10
|
+
export declare function langToExt(lang: string): any;
|
|
11
|
+
export declare class CircularJSONNotSupportedError extends Error {
|
|
12
|
+
originalError: Error;
|
|
13
|
+
constructor(originalError: Error);
|
|
14
|
+
}
|
|
15
|
+
export declare function dumpBundle(obj: any, format: BundleOutputFormat, dereference?: boolean): string;
|
|
16
|
+
export declare function saveBundle(filename: string, output: string): void;
|
|
17
|
+
export declare function promptUser(query: string, hideUserInput?: boolean): Promise<string>;
|
|
18
|
+
export declare function readYaml(filename: string): unknown;
|
|
19
|
+
export declare function writeToFileByExtension(data: unknown, filePath: string, noRefs?: boolean): void;
|
|
20
|
+
export declare function writeYaml(data: any, filename: string, noRefs?: boolean): void;
|
|
21
|
+
export declare function writeJson(data: unknown, filename: string): void;
|
|
22
|
+
export declare function getAndValidateFileExtension(fileName: string): NonNullable<OutputExtensions>;
|
|
23
|
+
export declare function handleError(e: Error, ref: string): void;
|
|
24
|
+
export declare class HandledError extends Error {
|
|
25
|
+
}
|
|
26
|
+
export declare function printLintTotals(totals: Totals, definitionsCount: number): void;
|
|
27
|
+
export declare function printConfigLintTotals(totals: Totals, command?: string | number): void;
|
|
28
|
+
export declare function getOutputFileName({ entrypoint, output, argvOutput, ext, entries, }: {
|
|
29
|
+
entrypoint: string;
|
|
30
|
+
output?: string;
|
|
31
|
+
argvOutput?: string;
|
|
32
|
+
ext?: BundleOutputFormat;
|
|
33
|
+
entries: number;
|
|
34
|
+
}): {
|
|
35
|
+
ext: BundleOutputFormat;
|
|
36
|
+
outputFile?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
outputFile: string;
|
|
39
|
+
ext: BundleOutputFormat;
|
|
40
|
+
};
|
|
41
|
+
export declare function printUnusedWarnings(config: StyleguideConfig): void;
|
|
42
|
+
export declare function exitWithError(message: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Checks if dir is subdir of parent
|
|
45
|
+
*/
|
|
46
|
+
export declare function isSubdir(parent: string, dir: string): boolean;
|
|
47
|
+
export declare function loadConfigAndHandleErrors(options?: {
|
|
48
|
+
configPath?: string;
|
|
49
|
+
customExtends?: string[];
|
|
50
|
+
processRawConfig?: RawConfigProcessor;
|
|
51
|
+
files?: string[];
|
|
52
|
+
region?: Region;
|
|
53
|
+
}): Promise<Config | void>;
|
|
54
|
+
export declare function sortTopLevelKeysForOas(document: Oas3Definition | Oas2Definition): Oas3Definition | Oas2Definition;
|
|
55
|
+
export declare function checkIfRulesetExist(rules: typeof StyleguideConfig.prototype.rules): void;
|
|
56
|
+
export declare function cleanColors(input: string): string;
|
|
57
|
+
export declare function sendTelemetry(argv: Arguments | undefined, exit_code: ExitCode, has_config: boolean | undefined, spec_version: string | undefined, spec_keyword: string | undefined, spec_full_version: string | undefined): Promise<void>;
|
|
58
|
+
export type ExitCode = 0 | 1 | 2;
|
|
59
|
+
export type Analytics = {
|
|
60
|
+
event: string;
|
|
61
|
+
event_time: string;
|
|
62
|
+
logged_in: boolean;
|
|
63
|
+
command: string | number;
|
|
64
|
+
arguments: Record<string, unknown>;
|
|
65
|
+
node_version: string;
|
|
66
|
+
npm_version: string;
|
|
67
|
+
version: string;
|
|
68
|
+
exit_code: ExitCode;
|
|
69
|
+
environment?: string;
|
|
70
|
+
environment_ci?: string;
|
|
71
|
+
raw_input: string;
|
|
72
|
+
has_config?: boolean;
|
|
73
|
+
spec_version?: string;
|
|
74
|
+
spec_keyword?: string;
|
|
75
|
+
spec_full_version?: string;
|
|
76
|
+
};
|
|
77
|
+
export declare function cleanArgs(args: CommandOptions): Record<string, unknown>;
|
|
78
|
+
export declare function cleanRawInput(argv: string[]): string;
|
|
79
|
+
export declare function checkForDeprecatedOptions<T>(argv: T, deprecatedOptions: Array<keyof T>): void;
|
|
80
|
+
export declare function notifyAboutIncompatibleConfigOptions(themeOpenapiOptions: Record<string, unknown> | undefined): void;
|
|
81
|
+
export declare function formatPath(path: string): string;
|