@useoptic/cli-config
Advanced tools
Comparing version 8.4.0 to 8.4.1
@@ -16,4 +16,5 @@ import { parseRule, parseIgnore, IIgnoreRunnable } from './helpers/ignore-parser'; | ||
command?: string; | ||
baseUrl: string; | ||
baseUrl?: string; | ||
proxy?: string; | ||
useTask?: string; | ||
targetUrl?: string; | ||
@@ -55,2 +56,4 @@ } | ||
} | ||
export declare class RunsWithTaskNotFoundError extends Error { | ||
} | ||
export interface IOpticCaptureConfig { | ||
@@ -95,2 +98,5 @@ persistenceEngine: 'fs' | 's3'; | ||
} | ||
export declare function isTestTask(aliasedTask: IOpticTaskAliased): boolean; | ||
export declare function isRecommendedTask(aliasedTask: IOpticTaskAliased): boolean; | ||
export declare function isManualTask(aliasedTask: IOpticTaskAliased): boolean; | ||
export declare function TaskToStartConfig(aliasedTask: IOpticTaskAliased): Promise<IOpticTaskRunnerConfig>; | ||
@@ -118,3 +124,8 @@ export interface IPathMapping { | ||
} | ||
export declare enum Modes { | ||
Recommended = "Recommended", | ||
Manual = "Manual", | ||
Test = "Test" | ||
} | ||
export { parseIgnore, parseRule, IIgnoreRunnable }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -25,3 +25,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseRule = exports.parseIgnore = exports.createFileTree = exports.getPathsRelativeToCwd = exports.pathsFromCwd = exports.getPathsRelativeToConfig = exports.TaskToStartConfig = exports.TaskNotFoundError = exports.TargetPortUnavailableError = exports.CommandExecutionFailure = exports.OpticConfigurationLocationFailure = exports.InvalidOpticConfigurationSyntaxError = exports.readTestingConfig = exports.readApiConfig = void 0; | ||
exports.parseRule = exports.parseIgnore = exports.Modes = exports.createFileTree = exports.getPathsRelativeToCwd = exports.pathsFromCwd = exports.getPathsRelativeToConfig = exports.TaskToStartConfig = exports.isManualTask = exports.isRecommendedTask = exports.isTestTask = exports.RunsWithTaskNotFoundError = exports.TaskNotFoundError = exports.TargetPortUnavailableError = exports.CommandExecutionFailure = exports.OpticConfigurationLocationFailure = exports.InvalidOpticConfigurationSyntaxError = exports.readTestingConfig = exports.readApiConfig = void 0; | ||
const fs_extra_1 = __importDefault(require("fs-extra")); | ||
@@ -72,2 +72,5 @@ const path_1 = __importDefault(require("path")); | ||
exports.TaskNotFoundError = TaskNotFoundError; | ||
class RunsWithTaskNotFoundError extends Error { | ||
} | ||
exports.RunsWithTaskNotFoundError = RunsWithTaskNotFoundError; | ||
function randomLowerBound() { | ||
@@ -78,2 +81,14 @@ const max = 3500; | ||
} | ||
function isTestTask(aliasedTask) { | ||
return Boolean(aliasedTask.useTask && aliasedTask.command); | ||
} | ||
exports.isTestTask = isTestTask; | ||
function isRecommendedTask(aliasedTask) { | ||
return Boolean(aliasedTask.command && (aliasedTask.inboundUrl || aliasedTask.baseUrl)); | ||
} | ||
exports.isRecommendedTask = isRecommendedTask; | ||
function isManualTask(aliasedTask) { | ||
return Boolean((aliasedTask.inboundUrl || aliasedTask.baseUrl) && aliasedTask.targetUrl); | ||
} | ||
exports.isManualTask = isManualTask; | ||
async function TaskToStartConfig(aliasedTask) { | ||
@@ -120,4 +135,7 @@ const task = normalizeTask(aliasedTask); | ||
const baseUrl = aliased.baseUrl || aliased.inboundUrl; | ||
if (!baseUrl) | ||
if (!baseUrl && !aliased.useTask) | ||
throw new Error('Task definition must have baseUrl (aliases: inboundUrl)'); | ||
if (aliased.useTask && (baseUrl || aliased.targetUrl)) { | ||
throw new Error('Task definitions with useTask should not include an inboundUrl or targetUrl '); | ||
} | ||
return Object.assign(Object.assign({}, aliased), { baseUrl }); | ||
@@ -194,1 +212,7 @@ } | ||
exports.createFileTree = createFileTree; | ||
var Modes; | ||
(function (Modes) { | ||
Modes["Recommended"] = "Recommended"; | ||
Modes["Manual"] = "Manual"; | ||
Modes["Test"] = "Test"; | ||
})(Modes = exports.Modes || (exports.Modes = {})); |
{ | ||
"name": "@useoptic/cli-config", | ||
"version": "8.4.0", | ||
"version": "8.4.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "ws:test": "echo config", |
Sorry, the diff of this file is not supported yet
20984
439