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

@circleci/circleci-config-parser

Package Overview
Dependencies
Maintainers
180
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@circleci/circleci-config-parser - npm Package Compare versions

Comparing version 0.10.0-alpha.2 to 0.10.0-alpha.3

6

dist/index.js.LICENSE.txt

@@ -1,7 +0,1 @@

/*!
* https://github.com/Starcounter-Jack/JSON-Patch
* (c) 2017 Joachim Wester
* MIT license
*/
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */

8

dist/lib/Config/types/Validator.types.d.ts
import * as CircleCI from '@circleci/circleci-config-sdk';
import { SchemaObject } from 'ajv';
import { ErrorObject, SchemaObject } from 'ajv';
import { GenerableSubTypesMap } from './Mapping.types';
export declare type ValidationResult = boolean | string;
export declare type ValidationResult = boolean | {
schema: SchemaObject;
data: unknown;
errors: ErrorObject<string, Record<string, unknown>, unknown>[];
};
export declare type ValidationMap = GenerableSubTypesMap & {

@@ -6,0 +10,0 @@ [key in CircleCI.mapping.GenerableType]: SchemaObject;

{
"name": "@circleci/circleci-config-parser",
"version": "v0.10.0-alpha.2",
"version": "v0.10.0-alpha.3",
"description": "A parsing library for CircleCI configuration files, powered by the CircleCI Config SDK",

@@ -24,6 +24,4 @@ "main": "dist/index.js",

"dependencies": {
"@circleci/circleci-config-sdk": "0.10.0",
"@circleci/circleci-config-sdk": "^0.10.1",
"ajv": "^8.11.0",
"ajv-merge-patch": "^5.0.1",
"better-ajv-errors": "^1.2.0",
"yaml": "2.1.1"

@@ -55,5 +53,5 @@ },

"webpack": "^5.58.2",
"webpack-cli": "^4.9.1",
"webpack-cli": "^4.10.0",
"webpack-node-externals": "^2.5.2"
}
}

@@ -6,25 +6,19 @@ import { SchemaObject } from 'ajv';

type: 'object',
$merge: {
source: {
anyOf: [
{ $ref: '#/executor/DockerExecutor' },
{ $ref: '#/executor/MachineExecutor' },
{ $ref: '#/executor/WindowsExecutor' },
{ $ref: '#/executor/MacOSExecutor' },
],
anyOf: [
{ $ref: '#/executor/DockerExecutor' },
{ $ref: '#/executor/MachineExecutor' },
{ $ref: '#/executor/WindowsExecutor' },
{ $ref: '#/executor/MacOSExecutor' },
],
additionalProperties: {
shell: {
type: 'string',
},
with: {
properties: {
shell: {
type: 'string',
},
working_directory: {
type: 'string',
},
environment: {
type: 'object',
additionalProperties: {
anyOf: [{ type: 'string' }, { type: 'number' }],
},
},
working_directory: {
type: 'string',
},
environment: {
type: 'object',
additionalProperties: {
anyOf: [{ type: 'string' }, { type: 'number' }],
},

@@ -31,0 +25,0 @@ },

@@ -28,15 +28,9 @@ import { SchemaObject } from 'ajv';

type: 'object',
$merge: {
source: {
properties: {
parameters: {
type: 'object',
$ref: '#/parameters/ExecutorParameterList',
},
},
additionalProperties: {
parameters: {
type: 'object',
$ref: '#/parameters/ExecutorParameterList',
},
with: {
$ref: '#/executor/Executor',
},
},
$ref: '#/executor/Executor',
};

@@ -43,0 +37,0 @@

@@ -8,33 +8,26 @@ import { SchemaObject } from 'ajv';

$id: '#/definitions/Job',
$merge: {
source: {
required: ['steps'],
additionalProperties: {
steps: {
$ref: '#/definitions/Steps',
},
parameters: {
type: 'object',
required: ['steps'],
properties: {
steps: {
$ref: '#/definitions/Steps',
},
parameters: {
type: 'object',
$ref: '#/parameters/JobParameterList',
},
parallelism: {
type: 'integer',
minimum: 1,
},
},
$ref: '#/parameters/JobParameterList',
},
with: {
anyOf: [
{
$ref: '#/executor/ReusableExecutorUsage',
},
{
$ref: '#/executor/Executor',
},
],
parallelism: {
type: 'integer',
minimum: 1,
},
},
anyOf: [
{
$ref: '#/executor/ReusableExecutorUsage',
},
{
$ref: '#/executor/Executor',
},
],
};
export default JobSchema;
import Ajv, { ErrorObject, SchemaObject } from 'ajv';
import ajvMergePatch from 'ajv-merge-patch';
import { ValidationMap, ValidationResult } from '../types/Validator.types';
import validationError from 'better-ajv-errors';
import { schemas } from '../../..';

@@ -112,4 +110,2 @@ import { mapping, types } from '@circleci/circleci-config-sdk';

ajvMergePatch(this);
Object.values(schemaRegistry).forEach((source) => {

@@ -172,3 +168,3 @@ if ('$id' in source) {

if (!valid && Array.isArray(this.errors) && data) {
return validationError(schema, data, this.errors as ErrorObject[]);
return { schema, data, errors: this.errors as ErrorObject[] };
}

@@ -175,0 +171,0 @@

import * as CircleCI from '@circleci/circleci-config-sdk';
import { SchemaObject } from 'ajv';
import { ErrorObject, SchemaObject } from 'ajv';
import { GenerableSubTypesMap } from './Mapping.types';
export type ValidationResult = boolean | string;
export type ValidationResult =
| boolean
| {
schema: SchemaObject;
data: unknown;
errors: ErrorObject<string, Record<string, unknown>, unknown>[];
};

@@ -7,0 +13,0 @@ export type ValidationMap = GenerableSubTypesMap & {

@@ -1,1 +0,1 @@

{"version": "v0.10.0-alpha.2"}
{"version": "v0.10.0-alpha.3"}

@@ -11,3 +11,3 @@ import path from 'path';

{
test: (modulePath) => {
test: (modulePath: string): boolean => {
return modulePath.endsWith('.ts') && !modulePath.endsWith('test.ts');

@@ -32,3 +32,3 @@ },

filename: 'index.js',
library: 'CircleCI-Parser',
library: 'CircleCI',
libraryTarget: 'umd',

@@ -35,0 +35,0 @@ globalObject: 'this',

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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