Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@useoptic/cli-config

Package Overview
Dependencies
Maintainers
2
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useoptic/cli-config - npm Package Compare versions

Comparing version 8.0.6 to 8.0.7

23

build/helpers/ignore-parser.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseRule = exports.allowedMethods = exports.parseIgnore = void 0;
const pathToRegexp = require("path-to-regexp");

@@ -10,4 +11,4 @@ function parseIgnore(ignores) {

shouldIgnore: (method, url) => {
return !!rules.find(i => i.shouldIgnore(method, url));
}
return !!rules.find((i) => i.shouldIgnore(method, url));
},
};

@@ -19,3 +20,13 @@ }

}
exports.allowedMethods = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'];
exports.allowedMethods = [
'GET',
'HEAD',
'POST',
'PUT',
'DELETE',
'CONNECT',
'OPTIONS',
'TRACE',
'PATCH',
];
function parseRule(userInput) {

@@ -33,3 +44,5 @@ const array = userInput.split(/[ ,]+/);

else {
methods = methodArray.map(i => i.toUpperCase()).filter(i => exports.allowedMethods.includes(i));
methods = methodArray
.map((i) => i.toUpperCase())
.filter((i) => exports.allowedMethods.includes(i));
}

@@ -42,5 +55,5 @@ const regex = pathToRegexp(pathInput);

regex,
shouldIgnore
shouldIgnore,
};
}
exports.parseRule = parseRule;

@@ -62,6 +62,2 @@ import { parseRule, parseIgnore, IIgnoreRunnable } from './helpers/ignore-parser';

command?: string;
captureId: string;
startTime: Date;
lastUpdateTime: Date;
persistenceEngine: 'fs' | 's3';
serviceConfig: {

@@ -80,3 +76,3 @@ port: number;

}
export declare function TaskToStartConfig(task: IOpticTask, captureId: string): Promise<IOpticTaskRunnerConfig>;
export declare function TaskToStartConfig(task: IOpticTask): Promise<IOpticTaskRunnerConfig>;
export interface IPathMapping {

@@ -83,0 +79,0 @@ cwd: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseRule = exports.parseIgnore = exports.createFileTree = exports.getPathsRelativeToCwd = exports.getPathsRelativeToConfig = exports.TaskToStartConfig = exports.TaskNotFoundError = exports.TargetPortUnavailableError = exports.CommandExecutionFailure = exports.OpticConfigurationLocationFailure = exports.InvalidOpticConfigurationSyntaxError = exports.readApiConfig = void 0;
const fs = require("fs-extra");

@@ -10,4 +11,4 @@ const path = require("path");

const ignore_parser_1 = require("./helpers/ignore-parser");
exports.parseRule = ignore_parser_1.parseRule;
exports.parseIgnore = ignore_parser_1.parseIgnore;
Object.defineProperty(exports, "parseRule", { enumerable: true, get: function () { return ignore_parser_1.parseRule; } });
Object.defineProperty(exports, "parseIgnore", { enumerable: true, get: function () { return ignore_parser_1.parseIgnore; } });
async function readApiConfig(configPath) {

@@ -40,3 +41,3 @@ const rawFile = await fs.readFile(configPath);

exports.TaskNotFoundError = TaskNotFoundError;
async function TaskToStartConfig(task, captureId) {
async function TaskToStartConfig(task) {
const parsedBaseUrl = url.parse(task.baseUrl);

@@ -49,6 +50,2 @@ const randomPort = await getPort({ port: getPort.makeRange(3300, 3900) });

command: task.command,
persistenceEngine: 'fs',
captureId,
startTime: new Date(),
lastUpdateTime: new Date(),
serviceConfig: {

@@ -55,0 +52,0 @@ port: task.proxy ? parseInt(proxyPort, 10) : randomPort,

{
"name": "@useoptic/cli-config",
"version": "8.0.6",
"version": "8.0.7",
"scripts": {
"ws:test": "echo config",
"ws:build": "yarn run tsc -b --verbose"
"ws:build": "yarn run tsc -b --verbose",
"ws:clean": "rm -rf build/*"
},
"repository": {
"type": "git",
"url": "ssh://git@github.com/useoptic/optic-package.git",
"directory": "workspaces/cli-config"
},
"main": "build/index.js",

@@ -13,3 +19,4 @@ "types": "build/index.d.ts",

"get-port": "^5.1.0",
"js-yaml": "^3.13.1"
"js-yaml": "^3.13.1",
"path-to-regexp": "^3.0.0"
},

@@ -16,0 +23,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc