@redocly/cli 1.34.3 → 2.0.0-next.0
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 +34 -3
- package/bin/cli.js +1 -1
- package/lib/auth/device-flow.d.ts +1 -0
- package/lib/auth/device-flow.d.ts.map +1 -0
- package/lib/auth/device-flow.js +15 -17
- package/lib/auth/device-flow.js.map +1 -0
- package/lib/auth/oauth-client.d.ts +1 -0
- package/lib/auth/oauth-client.d.ts.map +1 -0
- package/lib/auth/oauth-client.js +21 -23
- package/lib/auth/oauth-client.js.map +1 -0
- package/lib/commands/auth.d.ts +3 -5
- package/lib/commands/auth.d.ts.map +1 -0
- package/lib/commands/auth.js +19 -44
- package/lib/commands/auth.js.map +1 -0
- package/lib/commands/build-docs/index.d.ts +4 -3
- package/lib/commands/build-docs/index.d.ts.map +1 -0
- package/lib/commands/build-docs/index.js +23 -24
- package/lib/commands/build-docs/index.js.map +1 -0
- package/lib/commands/build-docs/types.d.ts +2 -1
- package/lib/commands/build-docs/types.d.ts.map +1 -0
- package/lib/commands/build-docs/types.js +2 -2
- package/lib/commands/build-docs/types.js.map +1 -0
- package/lib/commands/build-docs/utils.d.ts +3 -2
- package/lib/commands/build-docs/utils.d.ts.map +1 -0
- package/lib/commands/build-docs/utils.js +35 -37
- package/lib/commands/build-docs/utils.js.map +1 -0
- package/lib/commands/bundle.d.ts +6 -3
- package/lib/commands/bundle.d.ts.map +1 -0
- package/lib/commands/bundle.js +34 -38
- package/lib/commands/bundle.js.map +1 -0
- package/lib/commands/eject.d.ts +3 -2
- package/lib/commands/eject.d.ts.map +1 -0
- package/lib/commands/eject.js +11 -13
- package/lib/commands/eject.js.map +1 -0
- package/lib/commands/join.d.ts +4 -3
- package/lib/commands/join.d.ts.map +1 -0
- package/lib/commands/join.js +79 -81
- package/lib/commands/join.js.map +1 -0
- package/lib/commands/lint.d.ts +8 -6
- package/lib/commands/lint.d.ts.map +1 -0
- package/lib/commands/lint.js +53 -62
- package/lib/commands/lint.js.map +1 -0
- package/lib/commands/preview-project/constants.d.ts +2 -1
- package/lib/commands/preview-project/constants.d.ts.map +1 -0
- package/lib/commands/preview-project/constants.js +4 -6
- package/lib/commands/preview-project/constants.js.map +1 -0
- package/lib/commands/preview-project/index.d.ts +3 -2
- package/lib/commands/preview-project/index.d.ts.map +1 -0
- package/lib/commands/preview-project/index.js +21 -23
- package/lib/commands/preview-project/index.js.map +1 -0
- package/lib/commands/preview-project/types.d.ts +3 -2
- package/lib/commands/preview-project/types.d.ts.map +1 -0
- package/lib/commands/preview-project/types.js +2 -2
- package/lib/commands/preview-project/types.js.map +1 -0
- package/lib/commands/split/index.d.ts +4 -3
- package/lib/commands/split/index.d.ts.map +1 -0
- package/lib/commands/split/index.js +53 -57
- package/lib/commands/split/index.js.map +1 -0
- package/lib/commands/split/types.d.ts +2 -2
- package/lib/commands/split/types.d.ts.map +1 -0
- package/lib/commands/split/types.js +11 -13
- package/lib/commands/split/types.js.map +1 -0
- package/lib/commands/stats.d.ts +3 -2
- package/lib/commands/stats.d.ts.map +1 -0
- package/lib/commands/stats.js +21 -24
- package/lib/commands/stats.js.map +1 -0
- package/lib/commands/translations.d.ts +3 -2
- package/lib/commands/translations.d.ts.map +1 -0
- package/lib/commands/translations.js +11 -13
- package/lib/commands/translations.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +109 -239
- package/lib/index.js.map +1 -0
- package/lib/otel.d.ts +2 -1
- package/lib/otel.d.ts.map +1 -0
- package/lib/otel.js +22 -23
- package/lib/otel.js.map +1 -0
- package/lib/reunite/api/api-client.d.ts +4 -3
- package/lib/reunite/api/api-client.d.ts.map +1 -0
- package/lib/reunite/api/api-client.js +14 -20
- package/lib/reunite/api/api-client.js.map +1 -0
- package/lib/reunite/api/api-keys.d.ts +2 -1
- package/lib/reunite/api/api-keys.d.ts.map +1 -0
- package/lib/reunite/api/api-keys.js +4 -20
- package/lib/reunite/api/api-keys.js.map +1 -0
- package/lib/reunite/api/domains.d.ts +5 -2
- package/lib/reunite/api/domains.d.ts.map +1 -0
- package/lib/reunite/api/domains.js +6 -15
- package/lib/reunite/api/domains.js.map +1 -0
- package/lib/reunite/api/index.d.ts +4 -3
- package/lib/reunite/api/index.d.ts.map +1 -0
- package/lib/reunite/api/index.js +4 -19
- package/lib/reunite/api/index.js.map +1 -0
- package/lib/reunite/api/types.d.ts +1 -0
- package/lib/reunite/api/types.d.ts.map +1 -0
- package/lib/reunite/api/types.js +2 -2
- package/lib/reunite/api/types.js.map +1 -0
- package/lib/reunite/commands/push-status.d.ts +6 -5
- package/lib/reunite/commands/push-status.d.ts.map +1 -0
- package/lib/reunite/commands/push-status.js +31 -37
- package/lib/reunite/commands/push-status.js.map +1 -0
- package/lib/reunite/commands/push.d.ts +6 -6
- package/lib/reunite/commands/push.d.ts.map +1 -0
- package/lib/reunite/commands/push.js +31 -40
- package/lib/reunite/commands/push.js.map +1 -0
- package/lib/reunite/commands/utils.d.ts +4 -3
- package/lib/reunite/commands/utils.d.ts.map +1 -0
- package/lib/reunite/commands/utils.js +9 -12
- package/lib/reunite/commands/utils.js.map +1 -0
- package/lib/reunite/utils.d.ts +1 -0
- package/lib/reunite/utils.d.ts.map +1 -0
- package/lib/reunite/utils.js +2 -5
- package/lib/reunite/utils.js.map +1 -0
- package/lib/types.d.ts +15 -27
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +2 -5
- package/lib/types.js.map +1 -0
- package/lib/utils/assert-node-version.d.ts +1 -0
- package/lib/utils/assert-node-version.d.ts.map +1 -0
- package/lib/utils/assert-node-version.js +8 -10
- package/lib/utils/assert-node-version.js.map +1 -0
- package/lib/utils/error.d.ts +4 -0
- package/lib/utils/error.d.ts.map +1 -0
- package/lib/utils/error.js +8 -0
- package/lib/utils/error.js.map +1 -0
- package/lib/utils/fetch-with-timeout.d.ts +1 -0
- package/lib/utils/fetch-with-timeout.d.ts.map +1 -0
- package/lib/utils/fetch-with-timeout.js +6 -8
- package/lib/utils/fetch-with-timeout.js.map +1 -0
- package/lib/utils/{getCommandNameFromArgs.d.ts → get-command-name-from-args.d.ts} +1 -0
- package/lib/utils/get-command-name-from-args.d.ts.map +1 -0
- package/lib/utils/get-command-name-from-args.js +4 -0
- package/lib/utils/get-command-name-from-args.js.map +1 -0
- package/lib/utils/js-utils.d.ts +1 -0
- package/lib/utils/js-utils.d.ts.map +1 -0
- package/lib/utils/js-utils.js +8 -12
- package/lib/utils/js-utils.js.map +1 -0
- package/lib/utils/miscellaneous.d.ts +9 -48
- package/lib/utils/miscellaneous.d.ts.map +1 -0
- package/lib/utils/miscellaneous.js +131 -269
- package/lib/utils/miscellaneous.js.map +1 -0
- package/lib/utils/package.d.ts +2 -0
- package/lib/utils/package.d.ts.map +1 -0
- package/lib/utils/package.js +4 -0
- package/lib/utils/package.js.map +1 -0
- package/lib/utils/platform.d.ts +1 -0
- package/lib/utils/platform.d.ts.map +1 -0
- package/lib/utils/platform.js +5 -9
- package/lib/utils/platform.js.map +1 -0
- package/lib/utils/proxy-agent.d.ts +3 -0
- package/lib/utils/proxy-agent.d.ts.map +1 -0
- package/lib/utils/proxy-agent.js +6 -0
- package/lib/utils/proxy-agent.js.map +1 -0
- package/lib/utils/spinner.d.ts +1 -0
- package/lib/utils/spinner.d.ts.map +1 -0
- package/lib/utils/spinner.js +8 -10
- package/lib/utils/spinner.js.map +1 -0
- package/lib/utils/telemetry.d.ts +40 -0
- package/lib/utils/telemetry.d.ts.map +1 -0
- package/lib/utils/telemetry.js +138 -0
- package/lib/utils/telemetry.js.map +1 -0
- package/lib/utils/update-version-notifier.d.ts +1 -1
- package/lib/utils/update-version-notifier.d.ts.map +1 -0
- package/lib/utils/update-version-notifier.js +35 -38
- package/lib/utils/update-version-notifier.js.map +1 -0
- package/lib/utils/validate-positive-number.d.ts +2 -0
- package/lib/utils/validate-positive-number.d.ts.map +1 -0
- package/lib/utils/validate-positive-number.js +13 -0
- package/lib/utils/validate-positive-number.js.map +1 -0
- package/lib/wrapper.d.ts +3 -3
- package/lib/wrapper.d.ts.map +1 -0
- package/lib/wrapper.js +39 -26
- package/lib/wrapper.js.map +1 -0
- package/package.json +15 -16
- package/CHANGELOG.md +0 -770
- package/lib/__mocks__/@redocly/openapi-core.d.ts +0 -99
- package/lib/__mocks__/@redocly/openapi-core.js +0 -84
- package/lib/__mocks__/documents.d.ts +0 -150
- package/lib/__mocks__/documents.js +0 -123
- package/lib/__mocks__/fs.d.ts +0 -8
- package/lib/__mocks__/fs.js +0 -9
- package/lib/__mocks__/perf_hooks.d.ts +0 -3
- package/lib/__mocks__/perf_hooks.js +0 -6
- package/lib/__mocks__/redoc.d.ts +0 -6
- package/lib/__mocks__/redoc.js +0 -5
- package/lib/__tests__/commands/build-docs.test.d.ts +0 -1
- package/lib/__tests__/commands/build-docs.test.js +0 -54
- package/lib/__tests__/commands/bundle.test.d.ts +0 -1
- package/lib/__tests__/commands/bundle.test.js +0 -235
- package/lib/__tests__/commands/join.test.d.ts +0 -1
- package/lib/__tests__/commands/join.test.js +0 -274
- package/lib/__tests__/commands/lint.test.d.ts +0 -1
- package/lib/__tests__/commands/lint.test.js +0 -149
- package/lib/__tests__/commands/push-region.test.d.ts +0 -1
- package/lib/__tests__/commands/push-region.test.js +0 -90
- package/lib/__tests__/commands/push.test.d.ts +0 -1
- package/lib/__tests__/commands/push.test.js +0 -496
- package/lib/__tests__/fetch-with-timeout.test.d.ts +0 -1
- package/lib/__tests__/fetch-with-timeout.test.js +0 -64
- package/lib/__tests__/fixtures/config.d.ts +0 -21
- package/lib/__tests__/fixtures/config.js +0 -24
- package/lib/__tests__/spinner.test.d.ts +0 -1
- package/lib/__tests__/spinner.test.js +0 -43
- package/lib/__tests__/utils.test.d.ts +0 -1
- package/lib/__tests__/utils.test.js +0 -651
- package/lib/__tests__/wrapper.test.d.ts +0 -1
- package/lib/__tests__/wrapper.test.js +0 -76
- package/lib/auth/__tests__/device-flow.test.d.ts +0 -1
- package/lib/auth/__tests__/device-flow.test.js +0 -62
- package/lib/auth/__tests__/oauth-client.test.d.ts +0 -1
- package/lib/auth/__tests__/oauth-client.test.js +0 -93
- package/lib/commands/preview-docs/index.d.ts +0 -12
- package/lib/commands/preview-docs/index.js +0 -127
- package/lib/commands/preview-docs/preview-server/default.hbs +0 -24
- package/lib/commands/preview-docs/preview-server/hot.js +0 -59
- package/lib/commands/preview-docs/preview-server/oauth2-redirect.html +0 -21
- package/lib/commands/preview-docs/preview-server/preview-server.d.ts +0 -5
- package/lib/commands/preview-docs/preview-server/preview-server.js +0 -113
- package/lib/commands/preview-docs/preview-server/server.d.ts +0 -22
- package/lib/commands/preview-docs/preview-server/server.js +0 -85
- package/lib/commands/push.d.ts +0 -44
- package/lib/commands/push.js +0 -301
- package/lib/commands/split/__tests__/index.test.d.ts +0 -1
- package/lib/commands/split/__tests__/index.test.js +0 -91
- package/lib/reunite/api/__tests__/api-keys.test.d.ts +0 -1
- package/lib/reunite/api/__tests__/api-keys.test.js +0 -26
- package/lib/reunite/api/__tests__/api.client.test.d.ts +0 -1
- package/lib/reunite/api/__tests__/api.client.test.js +0 -337
- package/lib/reunite/api/__tests__/domains.test.d.ts +0 -1
- package/lib/reunite/api/__tests__/domains.test.js +0 -32
- package/lib/reunite/commands/__tests__/push-status.test.d.ts +0 -1
- package/lib/reunite/commands/__tests__/push-status.test.js +0 -563
- package/lib/reunite/commands/__tests__/push.test.d.ts +0 -1
- package/lib/reunite/commands/__tests__/push.test.js +0 -315
- package/lib/reunite/commands/__tests__/utils.test.d.ts +0 -1
- package/lib/reunite/commands/__tests__/utils.test.js +0 -51
- package/lib/utils/__mocks__/miscellaneous.d.ts +0 -43
- package/lib/utils/__mocks__/miscellaneous.js +0 -24
- package/lib/utils/getCommandNameFromArgs.js +0 -6
- package/src/__mocks__/@redocly/openapi-core.ts +0 -88
- package/src/__mocks__/documents.ts +0 -124
- package/src/__mocks__/fs.ts +0 -6
- package/src/__mocks__/perf_hooks.ts +0 -3
- package/src/__mocks__/redoc.ts +0 -2
- package/src/__tests__/commands/build-docs.test.ts +0 -59
- package/src/__tests__/commands/bundle.test.ts +0 -285
- package/src/__tests__/commands/join.test.ts +0 -334
- package/src/__tests__/commands/lint.test.ts +0 -190
- package/src/__tests__/commands/push-region.test.ts +0 -104
- package/src/__tests__/commands/push.test.ts +0 -553
- package/src/__tests__/fetch-with-timeout.test.ts +0 -81
- package/src/__tests__/fixtures/config.ts +0 -21
- package/src/__tests__/fixtures/openapi.json +0 -0
- package/src/__tests__/fixtures/openapi.yaml +0 -0
- package/src/__tests__/fixtures/redocly.yaml +0 -0
- package/src/__tests__/spinner.test.ts +0 -51
- package/src/__tests__/utils.test.ts +0 -781
- package/src/__tests__/wrapper.test.ts +0 -91
- package/src/auth/__tests__/device-flow.test.ts +0 -73
- package/src/auth/__tests__/oauth-client.test.ts +0 -117
- package/src/auth/device-flow.ts +0 -175
- package/src/auth/oauth-client.ts +0 -111
- package/src/commands/auth.ts +0 -66
- package/src/commands/build-docs/index.ts +0 -55
- package/src/commands/build-docs/template.hbs +0 -23
- package/src/commands/build-docs/types.ts +0 -25
- package/src/commands/build-docs/utils.ts +0 -110
- package/src/commands/bundle.ts +0 -154
- package/src/commands/eject.ts +0 -42
- package/src/commands/join.ts +0 -794
- package/src/commands/lint.ts +0 -169
- package/src/commands/preview-docs/index.ts +0 -183
- package/src/commands/preview-docs/preview-server/default.hbs +0 -24
- package/src/commands/preview-docs/preview-server/hot.js +0 -59
- package/src/commands/preview-docs/preview-server/oauth2-redirect.html +0 -21
- package/src/commands/preview-docs/preview-server/preview-server.ts +0 -159
- package/src/commands/preview-docs/preview-server/server.ts +0 -92
- package/src/commands/preview-project/constants.ts +0 -23
- package/src/commands/preview-project/index.ts +0 -71
- package/src/commands/preview-project/types.ts +0 -12
- package/src/commands/push.ts +0 -470
- package/src/commands/split/__tests__/fixtures/samples.json +0 -61
- package/src/commands/split/__tests__/fixtures/spec.json +0 -70
- package/src/commands/split/__tests__/fixtures/webhooks.json +0 -85
- package/src/commands/split/__tests__/index.test.ts +0 -156
- package/src/commands/split/index.ts +0 -397
- package/src/commands/split/types.ts +0 -60
- package/src/commands/stats.ts +0 -140
- package/src/commands/translations.ts +0 -32
- package/src/custom.d.ts +0 -1
- package/src/index.ts +0 -970
- package/src/otel.ts +0 -59
- package/src/reunite/api/__tests__/api-keys.test.ts +0 -37
- package/src/reunite/api/__tests__/api.client.test.ts +0 -452
- package/src/reunite/api/__tests__/domains.test.ts +0 -41
- package/src/reunite/api/api-client.ts +0 -381
- package/src/reunite/api/api-keys.ts +0 -26
- package/src/reunite/api/domains.ts +0 -23
- package/src/reunite/api/index.ts +0 -3
- package/src/reunite/api/types.ts +0 -108
- package/src/reunite/commands/__tests__/push-status.test.ts +0 -653
- package/src/reunite/commands/__tests__/push.test.ts +0 -385
- package/src/reunite/commands/__tests__/utils.test.ts +0 -62
- package/src/reunite/commands/push-status.ts +0 -325
- package/src/reunite/commands/push.ts +0 -235
- package/src/reunite/commands/utils.ts +0 -66
- package/src/reunite/utils.ts +0 -1
- package/src/types.ts +0 -64
- package/src/utils/__mocks__/miscellaneous.ts +0 -24
- package/src/utils/assert-node-version.ts +0 -19
- package/src/utils/fetch-with-timeout.ts +0 -30
- package/src/utils/getCommandNameFromArgs.ts +0 -5
- package/src/utils/js-utils.ts +0 -24
- package/src/utils/miscellaneous.ts +0 -729
- package/src/utils/platform.ts +0 -31
- package/src/utils/spinner.ts +0 -50
- package/src/utils/update-version-notifier.ts +0 -115
- package/src/wrapper.ts +0 -77
- package/tsconfig.json +0 -9
- package/tsconfig.tsbuildinfo +0 -1
|
@@ -1,47 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const api_1 = require("../api");
|
|
12
|
-
const utils_2 = require("./utils");
|
|
13
|
-
async function handlePush({ argv, config, version, }) {
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { slash, pluralize, logger } from '@redocly/openapi-core';
|
|
4
|
+
import { green } from 'colorette';
|
|
5
|
+
import { printExecutionTime } from '../../utils/miscellaneous.js';
|
|
6
|
+
import { exitWithError } from '../../utils/error.js';
|
|
7
|
+
import { handlePushStatus } from './push-status.js';
|
|
8
|
+
import { ReuniteApi, getDomain, getApiKeys } from '../api/index.js';
|
|
9
|
+
import { handleReuniteError } from './utils.js';
|
|
10
|
+
export async function handlePush({ argv, config, version, }) {
|
|
14
11
|
const startedAt = performance.now(); // for printing execution time
|
|
15
12
|
const startTime = Date.now(); // for push-status command
|
|
16
13
|
const { organization, project: projectId, 'mount-path': mountPath, verbose } = argv;
|
|
17
|
-
const
|
|
18
|
-
if (!argv.message || !argv.author || !argv.branch) {
|
|
19
|
-
(0, miscellaneous_1.exitWithError)('Error: message, author and branch are required for push to the Reunite.');
|
|
20
|
-
}
|
|
21
|
-
if (!orgId) {
|
|
22
|
-
return (0, miscellaneous_1.exitWithError)(`No organization provided, please use --organization option or specify the 'organization' field in the config file.`);
|
|
23
|
-
}
|
|
24
|
-
const domain = argv.domain || (0, api_1.getDomain)();
|
|
14
|
+
const domain = argv.domain || getDomain();
|
|
25
15
|
if (!domain) {
|
|
26
|
-
return
|
|
16
|
+
return exitWithError(`No domain provided, please use --domain option or environment variable REDOCLY_AUTHORIZATION.`);
|
|
27
17
|
}
|
|
28
18
|
try {
|
|
29
19
|
const { 'commit-sha': commitSha, 'commit-url': commitUrl, 'default-branch': defaultBranch, 'wait-for-deployment': waitForDeployment, 'max-execution-time': maxExecutionTime, } = argv;
|
|
30
20
|
const author = parseCommitAuthor(argv.author);
|
|
31
|
-
const apiKey =
|
|
32
|
-
const filesToUpload = collectFilesToPush(argv.files
|
|
21
|
+
const apiKey = getApiKeys();
|
|
22
|
+
const filesToUpload = collectFilesToPush(argv.files);
|
|
33
23
|
const commandName = 'push';
|
|
34
24
|
if (!filesToUpload.length) {
|
|
35
|
-
return
|
|
25
|
+
return printExecutionTime(commandName, startedAt, `No files to upload`);
|
|
36
26
|
}
|
|
37
|
-
const client = new
|
|
38
|
-
const projectDefaultBranch = await client.remotes.getDefaultBranch(
|
|
39
|
-
const remote = await client.remotes.upsert(
|
|
27
|
+
const client = new ReuniteApi({ domain, apiKey, version, command: commandName });
|
|
28
|
+
const projectDefaultBranch = await client.remotes.getDefaultBranch(organization, projectId);
|
|
29
|
+
const remote = await client.remotes.upsert(organization, projectId, {
|
|
40
30
|
mountBranchName: projectDefaultBranch,
|
|
41
31
|
mountPath,
|
|
42
32
|
});
|
|
43
|
-
|
|
44
|
-
const { id } = await client.remotes.push(
|
|
33
|
+
logger.info(`Uploading to ${remote.mountPath} ${filesToUpload.length} ${pluralize('file', filesToUpload.length)}:\n`);
|
|
34
|
+
const { id } = await client.remotes.push(organization, projectId, {
|
|
45
35
|
remoteId: remote.id,
|
|
46
36
|
commit: {
|
|
47
37
|
message: argv.message,
|
|
@@ -54,17 +44,17 @@ async function handlePush({ argv, config, version, }) {
|
|
|
54
44
|
author,
|
|
55
45
|
},
|
|
56
46
|
isMainBranch: defaultBranch === argv.branch,
|
|
57
|
-
}, filesToUpload.map((f) => ({ path:
|
|
47
|
+
}, filesToUpload.map((f) => ({ path: slash(f.name), stream: fs.createReadStream(f.path) })));
|
|
58
48
|
filesToUpload.forEach((f) => {
|
|
59
|
-
|
|
49
|
+
logger.info(green(`✓ ${f.name}\n`));
|
|
60
50
|
});
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
logger.info('\n');
|
|
52
|
+
logger.info(`Push ID: ${id}\n`);
|
|
63
53
|
if (waitForDeployment) {
|
|
64
|
-
|
|
65
|
-
await
|
|
54
|
+
logger.info('\n');
|
|
55
|
+
await handlePushStatus({
|
|
66
56
|
argv: {
|
|
67
|
-
organization
|
|
57
|
+
organization,
|
|
68
58
|
project: projectId,
|
|
69
59
|
pushId: id,
|
|
70
60
|
wait: true,
|
|
@@ -78,14 +68,14 @@ async function handlePush({ argv, config, version, }) {
|
|
|
78
68
|
});
|
|
79
69
|
}
|
|
80
70
|
verbose &&
|
|
81
|
-
|
|
71
|
+
printExecutionTime(commandName, startedAt, `${pluralize('file', filesToUpload.length)} uploaded to organization ${organization}, project ${projectId}. Push ID: ${id}.`);
|
|
82
72
|
client.reportSunsetWarnings();
|
|
83
73
|
return {
|
|
84
74
|
pushId: id,
|
|
85
75
|
};
|
|
86
76
|
}
|
|
87
77
|
catch (err) {
|
|
88
|
-
|
|
78
|
+
handleReuniteError('✗ File upload failed.', err);
|
|
89
79
|
}
|
|
90
80
|
}
|
|
91
81
|
function parseCommitAuthor(author) {
|
|
@@ -115,7 +105,7 @@ function collectFilesToPush(files) {
|
|
|
115
105
|
function addFile(filePath, fileDir) {
|
|
116
106
|
const fileName = path.relative(fileDir, filePath);
|
|
117
107
|
if (collectedFiles[fileName]) {
|
|
118
|
-
|
|
108
|
+
logger.warn(`File ${collectedFiles[fileName]} is overwritten by ${filePath}\n`);
|
|
119
109
|
}
|
|
120
110
|
collectedFiles[fileName] = filePath;
|
|
121
111
|
}
|
|
@@ -140,3 +130,4 @@ function getFilesList(dir, files) {
|
|
|
140
130
|
}
|
|
141
131
|
return files;
|
|
142
132
|
}
|
|
133
|
+
//# sourceMappingURL=push.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push.js","sourceRoot":"","sources":["../../../src/reunite/commands/push.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,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AC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AAChG,CAAC;AAED,SAAS,YAAY,CAAC,IAAY,EAAE,QAAgB;IAClD,OAAO;QACL,IAAI;QACJ,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,GAAW,EAAE,KAAe;IAChD,MAAM,YAAY,GAAG,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEzC,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEzC,IAAI,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC3C,KAAK,GAAG,YAAY,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QAC3C,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DeploymentError } from '../utils';
|
|
2
|
-
import type { ReuniteApiError } from '../api';
|
|
1
|
+
import { DeploymentError } from '../utils.js';
|
|
2
|
+
import type { ReuniteApiError } from '../api/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* This function retries an operation until a condition is met or a timeout is exceeded.
|
|
5
5
|
* If the condition is not met within the timeout, an error is thrown.
|
|
@@ -22,4 +22,5 @@ retryIntervalMs, }: {
|
|
|
22
22
|
retryTimeoutMs?: number;
|
|
23
23
|
retryIntervalMs?: number;
|
|
24
24
|
}): Promise<T>;
|
|
25
|
-
export declare function handleReuniteError(message: string, error: ReuniteApiError | DeploymentError | Error):
|
|
25
|
+
export declare function handleReuniteError(message: string, error: ReuniteApiError | DeploymentError | Error): never;
|
|
26
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/reunite/commands/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD;;;;;;;;;;;GAWG;AACH,wBAAsB,sBAAsB,CAAC,CAAC,EAAE,EAC9C,SAAS,EACT,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,SAAsB,EACtB,cAAuB,EAAE,SAAS;AAClC,eAAsB,GACvB,EAAE;IACD,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5C,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,OAAO,CAAC,CAAC,CAAC,CAqBb;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GAAG,eAAe,GAAG,KAAK,SAMjD"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.handleReuniteError = handleReuniteError;
|
|
5
|
-
const openapi_core_1 = require("@redocly/openapi-core");
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
const miscellaneous_1 = require("../../utils/miscellaneous");
|
|
1
|
+
import { pause } from '@redocly/openapi-core';
|
|
2
|
+
import { DeploymentError } from '../utils.js';
|
|
3
|
+
import { exitWithError } from '../../utils/error.js';
|
|
8
4
|
/**
|
|
9
5
|
* This function retries an operation until a condition is met or a timeout is exceeded.
|
|
10
6
|
* If the condition is not met within the timeout, an error is thrown.
|
|
@@ -17,7 +13,7 @@ const miscellaneous_1 = require("../../utils/miscellaneous");
|
|
|
17
13
|
* @param retryTimeoutMs The maximum time to retry the operation. Default is 10 minutes.
|
|
18
14
|
* @param retryIntervalMs The interval between retries. Default is 5 seconds.
|
|
19
15
|
*/
|
|
20
|
-
async function retryUntilConditionMet({ operation, condition, onConditionNotMet, onRetry, startTime = Date.now(), retryTimeoutMs = 600000, // 10 min
|
|
16
|
+
export async function retryUntilConditionMet({ operation, condition, onConditionNotMet, onRetry, startTime = Date.now(), retryTimeoutMs = 600000, // 10 min
|
|
21
17
|
retryIntervalMs = 5000, // 5 sec
|
|
22
18
|
}) {
|
|
23
19
|
async function attempt() {
|
|
@@ -33,14 +29,15 @@ retryIntervalMs = 5000, // 5 sec
|
|
|
33
29
|
}
|
|
34
30
|
else {
|
|
35
31
|
onConditionNotMet?.(result);
|
|
36
|
-
await
|
|
32
|
+
await pause(retryIntervalMs);
|
|
37
33
|
await onRetry?.(result);
|
|
38
34
|
return attempt();
|
|
39
35
|
}
|
|
40
36
|
}
|
|
41
37
|
return attempt();
|
|
42
38
|
}
|
|
43
|
-
function handleReuniteError(message, error) {
|
|
44
|
-
const errorMessage = error instanceof
|
|
45
|
-
return
|
|
39
|
+
export function handleReuniteError(message, error) {
|
|
40
|
+
const errorMessage = error instanceof DeploymentError ? error.message : `${message} Reason: ${error.message}\n`;
|
|
41
|
+
return exitWithError(errorMessage);
|
|
46
42
|
}
|
|
43
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/reunite/commands/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAA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ils.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/reunite/utils.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;CAAG"}
|
package/lib/reunite/utils.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeploymentError = void 0;
|
|
4
|
-
class DeploymentError extends Error {
|
|
1
|
+
export class DeploymentError extends Error {
|
|
5
2
|
}
|
|
6
|
-
|
|
3
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/reunite/utils.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,eAAgB,SAAQ,KAAK;CAAG"}
|
package/lib/types.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import type { BundleOutputFormat,
|
|
1
|
+
import type { BundleOutputFormat, RuleSeverity } from '@redocly/openapi-core';
|
|
2
2
|
import type { RespectOptions, GenerateArazzoFileOptions } from '@redocly/respect-core';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
15
|
-
import type { PreviewProjectOptions } from './commands/preview-project/types';
|
|
16
|
-
import type { TranslationsOptions } from './commands/translations';
|
|
17
|
-
import type { EjectOptions } from './commands/eject';
|
|
3
|
+
import type { LintOptions } from './commands/lint.js';
|
|
4
|
+
import type { BundleOptions } from './commands/bundle.js';
|
|
5
|
+
import type { JoinOptions } from './commands/join.js';
|
|
6
|
+
import type { LoginOptions, LogoutOptions } from './commands/auth.js';
|
|
7
|
+
import type { StatsOptions } from './commands/stats.js';
|
|
8
|
+
import type { SplitOptions } from './commands/split/index.js';
|
|
9
|
+
import type { BuildDocsArgv } from './commands/build-docs/types.js';
|
|
10
|
+
import type { PushOptions } from './reunite/commands/push.js';
|
|
11
|
+
import type { PushStatusOptions } from './reunite/commands/push-status.js';
|
|
12
|
+
import type { PreviewProjectOptions } from './commands/preview-project/types.js';
|
|
13
|
+
import type { TranslationsOptions } from './commands/translations.js';
|
|
14
|
+
import type { EjectOptions } from './commands/eject.js';
|
|
18
15
|
export type Totals = {
|
|
19
16
|
errors: number;
|
|
20
17
|
warnings: number;
|
|
@@ -27,18 +24,9 @@ export type Entrypoint = {
|
|
|
27
24
|
};
|
|
28
25
|
export declare const outputExtensions: ReadonlyArray<BundleOutputFormat>;
|
|
29
26
|
export type OutputExtensions = 'json' | 'yaml' | 'yml' | undefined;
|
|
30
|
-
export
|
|
31
|
-
export type CommandOptions = StatsOptions | SplitOptions | JoinOptions | PushOptions | CMSPushOptions | LintOptions | BundleOptions | LoginOptions | LogoutOptions | PreviewDocsOptions | BuildDocsArgv | PushStatusOptions | PreviewProjectOptions | TranslationsOptions | EjectOptions | RespectOptions | GenerateArazzoFileOptions;
|
|
27
|
+
export type CommandOptions = StatsOptions | SplitOptions | JoinOptions | LintOptions | BundleOptions | LoginOptions | LogoutOptions | BuildDocsArgv | PushOptions | PushStatusOptions | PreviewProjectOptions | TranslationsOptions | EjectOptions | RespectOptions | GenerateArazzoFileOptions;
|
|
32
28
|
export type VerifyConfigOptions = {
|
|
33
29
|
config?: string;
|
|
34
30
|
'lint-config'?: RuleSeverity;
|
|
35
31
|
};
|
|
36
|
-
|
|
37
|
-
'skip-rule'?: string[];
|
|
38
|
-
'skip-decorator'?: string[];
|
|
39
|
-
'skip-preprocessor'?: string[];
|
|
40
|
-
};
|
|
41
|
-
export type ConfigApis = Pick<Config, 'apis' | 'configFile'>;
|
|
42
|
-
export type PushArguments = ArgumentsCamelCase<PushOptions & CMSPushOptions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,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,eAAO,MAAM,gBAAgB,EAA8B,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAC7F,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,CAAC;AACnE,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,YAAY,GACZ,WAAW,GACX,WAAW,GACX,aAAa,GACb,YAAY,GACZ,aAAa,GACb,aAAa,GACb,WAAW,GACX,iBAAiB,GACjB,qBAAqB,GACrB,mBAAmB,GACnB,YAAY,GACZ,cAAc,GACd,yBAAyB,CAAC;AAE9B,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,YAAY,CAAC;CAC9B,CAAC"}
|
package/lib/types.js
CHANGED
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.regionChoices = exports.outputExtensions = void 0;
|
|
4
|
-
exports.outputExtensions = ['json', 'yaml', 'yml'];
|
|
5
|
-
exports.regionChoices = ['us', 'eu'];
|
|
1
|
+
export const outputExtensions = ['json', 'yaml', 'yml']; // FIXME: use one source of truth (2.0)
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAsC,CAAC,CAAC,uCAAuC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-node-version.d.ts","sourceRoot":"","sources":["../../src/utils/assert-node-version.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const process = require("process");
|
|
6
|
-
const colorette_1 = require("colorette");
|
|
1
|
+
import * as process from 'node:process';
|
|
2
|
+
import * as semver from 'semver';
|
|
3
|
+
import { logger } from '@redocly/openapi-core';
|
|
4
|
+
import { engines } from './package.js';
|
|
7
5
|
try {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
process.stderr.write((0, colorette_1.yellow)(`\n⚠️ Warning: failed to satisfy expected node version. Expected: "${version}", Current "${process.version}"\n\n`));
|
|
6
|
+
const range = engines?.node;
|
|
7
|
+
if (typeof range === 'string' && !semver.satisfies(process.version, range)) {
|
|
8
|
+
logger.warn(`\n⚠️ Warning: failed to satisfy expected node version. Expected: "${range}", Current "${process.version}"\n\n`);
|
|
12
9
|
}
|
|
13
10
|
}
|
|
14
11
|
catch (e) {
|
|
15
12
|
// Do nothing
|
|
16
13
|
}
|
|
14
|
+
//# sourceMappingURL=assert-node-version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-node-version.js","sourceRoot":"","sources":["../../src/utils/assert-node-version.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,IAAI,CAAC;IACH,MAAM,KAAK,GAAG,OAAO,EAAE,IAAI,CAAC;IAE5B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;QAC3E,MAAM,CAAC,IAAI,CACT,qEAAqE,KAAK,eAAe,OAAO,CAAC,OAAO,OAAO,CAChH,CAAC;IACJ,CAAC;AACH,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACX,aAAa;AACf,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAGA,qBAAa,cAAe,SAAQ,KAAK;CAAG;AAE5C,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAEpD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HandledError } from '@redocly/openapi-core';
|
|
2
|
+
// Is used to abort the flow of execution - will be catched in the command execution wrapper
|
|
3
|
+
export class AbortFlowError extends Error {
|
|
4
|
+
}
|
|
5
|
+
export function exitWithError(message) {
|
|
6
|
+
throw new HandledError(message);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/utils/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,4FAA4F;AAC5F,MAAM,OAAO,cAAe,SAAQ,KAAK;CAAG;AAE5C,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-with-timeout.d.ts","sourceRoot":"","sources":["../../src/utils/fetch-with-timeout.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;8BAEyB,MAAM,4BAA2B,uBAAuB;AAAnF,wBAqBE"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const openapi_core_1 = require("@redocly/openapi-core");
|
|
5
|
-
exports.DEFAULT_FETCH_TIMEOUT = 3000;
|
|
6
|
-
exports.default = async (url, { timeout, ...options } = {}) => {
|
|
1
|
+
import { getProxyAgent } from './proxy-agent.js';
|
|
2
|
+
export const DEFAULT_FETCH_TIMEOUT = 3000;
|
|
3
|
+
export default async (url, { timeout, ...options } = {}) => {
|
|
7
4
|
if (!timeout) {
|
|
8
5
|
return fetch(url, {
|
|
9
6
|
...options,
|
|
10
|
-
dispatcher:
|
|
7
|
+
dispatcher: getProxyAgent(),
|
|
11
8
|
});
|
|
12
9
|
}
|
|
13
10
|
const controller = new globalThis.AbortController();
|
|
@@ -17,8 +14,9 @@ exports.default = async (url, { timeout, ...options } = {}) => {
|
|
|
17
14
|
const res = await fetch(url, {
|
|
18
15
|
signal: controller.signal,
|
|
19
16
|
...options,
|
|
20
|
-
dispatcher:
|
|
17
|
+
dispatcher: getProxyAgent(),
|
|
21
18
|
});
|
|
22
19
|
clearTimeout(timeoutId);
|
|
23
20
|
return res;
|
|
24
21
|
};
|
|
22
|
+
//# sourceMappingURL=fetch-with-timeout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-with-timeout.js","sourceRoot":"","sources":["../../src/utils/fetch-with-timeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAM1C,eAAe,KAAK,EAAE,GAAW,EAAE,EAAE,OAAO,EAAE,GAAG,OAAO,KAA8B,EAAE,EAAE,EAAE;IAC1F,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,KAAK,CAAC,GAAG,EAAE;YAChB,GAAG,OAAO;YACV,UAAU,EAAE,aAAa,EAAE;SACb,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,eAAe,EAAE,CAAC;IACpD,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;QAChC,UAAU,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC,EAAE,OAAO,CAAC,CAAC;IAEZ,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAC3B,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,GAAG,OAAO;QACV,UAAU,EAAE,aAAa,EAAE;KACb,CAAC,CAAC;IAElB,YAAY,CAAC,SAAS,CAAC,CAAC;IACxB,OAAO,GAAG,CAAC;AACb,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-command-name-from-args.d.ts","sourceRoot":"","sources":["../../src/utils/get-command-name-from-args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAEnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-command-name-from-args.js","sourceRoot":"","sources":["../../src/utils/get-command-name-from-args.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,IAA2B;IAChE,OAAO,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5B,CAAC"}
|
package/lib/utils/js-utils.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-utils.d.ts","sourceRoot":"","sources":["../../src/utils/js-utils.ts"],"names":[],"mappings":"AACA,wBAAgB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGrE;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,WAEnC;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,eAG/B;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,UAKnC"}
|
package/lib/utils/js-utils.js
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.isObject = isObject;
|
|
4
|
-
exports.isEmptyObject = isEmptyObject;
|
|
5
|
-
exports.isString = isString;
|
|
6
|
-
exports.keysOf = keysOf;
|
|
7
|
-
exports.capitalize = capitalize;
|
|
8
|
-
function isObject(obj) {
|
|
1
|
+
// FIXME: investigate if it can be removed (2.0)
|
|
2
|
+
export function isObject(obj) {
|
|
9
3
|
const type = typeof obj;
|
|
10
4
|
return type === 'function' || (type === 'object' && !!obj);
|
|
11
5
|
}
|
|
12
|
-
|
|
6
|
+
// FIXME: investigate if it can be removed (2.0)
|
|
7
|
+
export function isEmptyObject(obj) {
|
|
13
8
|
return !!obj && Object.keys(obj).length === 0;
|
|
14
9
|
}
|
|
15
|
-
function isString(str) {
|
|
10
|
+
export function isString(str) {
|
|
16
11
|
return Object.prototype.toString.call(str) === '[object String]';
|
|
17
12
|
}
|
|
18
|
-
function keysOf(obj) {
|
|
13
|
+
export function keysOf(obj) {
|
|
19
14
|
if (!obj)
|
|
20
15
|
return [];
|
|
21
16
|
return Object.keys(obj);
|
|
22
17
|
}
|
|
23
|
-
function capitalize(s) {
|
|
18
|
+
export function capitalize(s) {
|
|
24
19
|
if (s?.length > 0) {
|
|
25
20
|
return s[0].toUpperCase() + s.slice(1);
|
|
26
21
|
}
|
|
27
22
|
return s;
|
|
28
23
|
}
|
|
24
|
+
//# sourceMappingURL=js-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"js-utils.js","sourceRoot":"","sources":["../../src/utils/js-utils.ts"],"names":[],"mappings":"AAAA,gDAAgD;AAChD,MAAM,UAAU,QAAQ,CAAC,GAAY;IACnC,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC;IACxB,OAAO,IAAI,KAAK,UAAU,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED,gDAAgD;AAChD,MAAM,UAAU,aAAa,CAAC,GAAQ;IACpC,OAAO,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,iBAAiB,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,MAAM,CAAI,GAAM;IAC9B,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,CAAgB,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,CAAS;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,CAAC;QAClB,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function getFallbackApisOrExit(argsApis: string[] | undefined, config: ConfigApis): Promise<Entrypoint[]>;
|
|
1
|
+
import type { Config, BundleOutputFormat, Oas3Definition, Oas2Definition, Exact } from '@redocly/openapi-core';
|
|
2
|
+
import type { Totals, Entrypoint, OutputExtensions, CommandOptions } from '../types.js';
|
|
3
|
+
export type ExitCode = 0 | 1 | 2;
|
|
4
|
+
export declare function getFallbackApisOrExit(argsApis: string[] | undefined, config: Config): Promise<Entrypoint[]>;
|
|
6
5
|
export declare function getExecutionTime(startedAt: number): string;
|
|
7
6
|
export declare function printExecutionTime(commandName: string, startedAt: number, api: string): void;
|
|
8
7
|
export declare function pathToFilename(path: string, pathSeparator: string): string;
|
|
@@ -20,9 +19,7 @@ export declare function writeToFileByExtension(data: unknown, filePath: string,
|
|
|
20
19
|
export declare function writeYaml(data: any, filename: string, noRefs?: boolean): void;
|
|
21
20
|
export declare function writeJson(data: unknown, filename: string): void;
|
|
22
21
|
export declare function getAndValidateFileExtension(fileName: string): NonNullable<OutputExtensions>;
|
|
23
|
-
export declare function handleError(e: Error, ref: string):
|
|
24
|
-
export declare class HandledError extends Error {
|
|
25
|
-
}
|
|
22
|
+
export declare function handleError(e: Error, ref: string): never;
|
|
26
23
|
export declare function printLintTotals(totals: Totals, definitionsCount: number): void;
|
|
27
24
|
export declare function printConfigLintTotals(totals: Totals, command?: string | number): void;
|
|
28
25
|
export declare function getOutputFileName({ entrypoint, output, argvOutput, ext, entries, }: {
|
|
@@ -38,47 +35,11 @@ export declare function getOutputFileName({ entrypoint, output, argvOutput, ext,
|
|
|
38
35
|
outputFile: string;
|
|
39
36
|
ext: BundleOutputFormat;
|
|
40
37
|
};
|
|
41
|
-
export declare function printUnusedWarnings(config:
|
|
42
|
-
export declare function
|
|
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>;
|
|
38
|
+
export declare function printUnusedWarnings(config: Config): void;
|
|
39
|
+
export declare function loadConfigAndHandleErrors(argv: Exact<CommandOptions>, version: string): Promise<Config>;
|
|
54
40
|
export declare function sortTopLevelKeysForOas(document: Oas3Definition | Oas2Definition): Oas3Definition | Oas2Definition;
|
|
55
|
-
export declare function checkIfRulesetExist(rules: typeof
|
|
41
|
+
export declare function checkIfRulesetExist(rules: typeof Config.prototype.rules): void;
|
|
56
42
|
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: 'yes' | 'no';
|
|
63
|
-
command: string;
|
|
64
|
-
arguments: string;
|
|
65
|
-
node_version: string;
|
|
66
|
-
npm_version: string;
|
|
67
|
-
os_platform: string;
|
|
68
|
-
version: string;
|
|
69
|
-
exit_code: ExitCode;
|
|
70
|
-
environment?: string;
|
|
71
|
-
environment_ci?: string;
|
|
72
|
-
raw_input: string;
|
|
73
|
-
has_config?: 'yes' | 'no';
|
|
74
|
-
spec_version?: string;
|
|
75
|
-
spec_keyword?: string;
|
|
76
|
-
spec_full_version?: string;
|
|
77
|
-
};
|
|
78
|
-
export declare function cleanArgs(parsedArgs: CommandOptions, rawArgv: string[]): {
|
|
79
|
-
arguments: string;
|
|
80
|
-
raw_input: string;
|
|
81
|
-
};
|
|
82
|
-
export declare function checkForDeprecatedOptions<T>(argv: T, deprecatedOptions: Array<keyof T>): void;
|
|
83
43
|
export declare function notifyAboutIncompatibleConfigOptions(themeOpenapiOptions: Record<string, unknown> | undefined): void;
|
|
84
44
|
export declare function formatPath(path: string): string;
|
|
45
|
+
//# sourceMappingURL=miscellaneous.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"miscellaneous.d.ts","sourceRoot":"","sources":["../../src/utils/miscellaneous.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,KAAK,EACN,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,cA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