@circleci/circleci-config-parser
Advanced tools
Comparing version 0.10.0-alpha.2 to 0.10.0-alpha.3
@@ -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 */ |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 6 instances in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
2
1
1
1950858
6184
+ Added@circleci/circleci-config-sdk@0.10.1(transitive)
- Removedajv-merge-patch@^5.0.1
- Removedbetter-ajv-errors@^1.2.0
- Removed@babel/code-frame@7.26.2(transitive)
- Removed@babel/helper-validator-identifier@7.25.9(transitive)
- Removed@circleci/circleci-config-sdk@0.10.0(transitive)
- Removed@humanwhocodes/momoa@2.0.4(transitive)
- Removedajv-merge-patch@5.0.1(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedbetter-ajv-errors@1.2.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedfast-deep-equal@2.0.1(transitive)
- Removedfast-json-patch@2.2.1(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedjson-merge-patch@1.0.2(transitive)
- Removedjsonpointer@5.0.1(transitive)
- Removedleven@3.1.0(transitive)
- Removedpicocolors@1.1.1(transitive)
- Removedsupports-color@7.2.0(transitive)