@circleci/circleci-config-sdk
Advanced tools
Comparing version 0.9.0-alpha.20 to 0.9.0-alpha.21
import { GenerableType } from '../../../../Config/exports/Mapping'; | ||
import { Executable } from '../../../Executors/types/ExecutorParameters.types'; | ||
import { StringParameter, EnvironmentParameter, BooleanParameter } from '../../../Parameters/types'; | ||
@@ -43,3 +44,3 @@ import { CommandShape, CommandShorthandShape, CommandParameters } from '../../types/Command.types'; | ||
*/ | ||
export interface RunParameters extends CommandParameters { | ||
export interface RunParameters extends CommandParameters, Executable { | ||
/** | ||
@@ -50,10 +51,2 @@ * Command to run via the shell | ||
/** | ||
* Shell to use for execution command (default: See Default Shell Options) | ||
*/ | ||
shell?: StringParameter; | ||
/** | ||
* Additional environmental variables, locally scoped to command | ||
*/ | ||
environment?: EnvironmentParameter; | ||
/** | ||
* Whether or not this step should run in the background (default: false) | ||
@@ -63,6 +56,2 @@ */ | ||
/** | ||
* In which directory to run this step. Will be interpreted relative to the working_directory of the job). (default: .) | ||
*/ | ||
working_directory?: StringParameter; | ||
/** | ||
* Elapsed time the command can run without output. The string is a decimal with unit suffix, such as “20m”, “1.25h”, “5s” (default: 10 minutes) | ||
@@ -75,4 +64,7 @@ */ | ||
when?: 'always' | 'on_success' | 'on_fail'; | ||
shell?: StringParameter; | ||
environment?: EnvironmentParameter; | ||
working_directory?: StringParameter; | ||
} | ||
export {}; | ||
//# sourceMappingURL=Run.d.ts.map |
import { GenerableType } from '../../../Config/exports/Mapping'; | ||
import { DockerExecutorContentsShape, DockerResourceClass } from '../types/DockerExecutor.types'; | ||
import { ExecutorLiteral } from '../types/Executor.types'; | ||
import { ExecutableParameters } from '../types/ExecutorParameters.types'; | ||
import { DockerImage } from './DockerImage'; | ||
import { DockerImage, DockerImageShape } from './DockerImage'; | ||
import { Executor } from './Executor'; | ||
@@ -22,3 +21,3 @@ /** | ||
serviceImages: DockerImage[]; | ||
constructor(image: string, resource_class?: DockerResourceClass, serviceImages?: DockerImage[], parameters?: ExecutableParameters); | ||
constructor(image: string, resource_class?: DockerResourceClass, properties?: Exclude<DockerImageShape, 'image'>, serviceImages?: DockerImage[]); | ||
/** | ||
@@ -31,3 +30,18 @@ * Generate Docker Executor schema. | ||
get executorLiteral(): ExecutorLiteral; | ||
/** | ||
* Add an environment variable to the Executor. | ||
* This will be set in plain-text via the exported config file. | ||
* Consider using project-level environment variables or a context for sensitive information. | ||
* @see {@link https://circleci.com/docs/env-vars} | ||
* @example | ||
* ``` | ||
* myExecutor.addEnvVar('MY_VAR', 'my value'); | ||
* ``` | ||
*/ | ||
addEnvVar(name: string, value: string): this; | ||
/** | ||
* Add additional images to run along side the primary docker image. | ||
*/ | ||
addServiceImage(image: DockerImage): this; | ||
} | ||
//# sourceMappingURL=DockerExecutor.d.ts.map |
@@ -0,1 +1,2 @@ | ||
import { EnvironmentParameter } from '../../Parameters/types'; | ||
export declare class DockerImage implements DockerImageShape { | ||
@@ -7,6 +8,6 @@ image: string; | ||
user?: string; | ||
environment?: Map<string, string>; | ||
auth?: DockerAuth; | ||
environment?: EnvironmentParameter; | ||
aws_auth?: DockerAuthAWS; | ||
constructor(image: string, name?: string, entrypoint?: string[], command?: string[], user?: string, environment?: Map<string, string>, auth?: DockerAuth, aws_auth?: DockerAuthAWS); | ||
constructor(image: string, name?: string, entrypoint?: string[], command?: string[], user?: string, environment?: EnvironmentParameter, auth?: DockerAuth, aws_auth?: DockerAuthAWS); | ||
} | ||
@@ -16,3 +17,3 @@ /** | ||
*/ | ||
export interface DockerImageShape { | ||
export declare type DockerImageShape = { | ||
name?: string; | ||
@@ -23,10 +24,10 @@ image: string; | ||
user?: string; | ||
environment?: Map<string, string>; | ||
auth?: DockerAuth; | ||
environment?: EnvironmentParameter; | ||
aws_auth?: DockerAuthAWS; | ||
} | ||
}; | ||
/** | ||
* Authentication for registries using standard `docker login` credentials | ||
*/ | ||
export interface DockerAuth { | ||
export declare type DockerAuth = { | ||
username: string; | ||
@@ -37,7 +38,7 @@ /** | ||
password: string; | ||
} | ||
}; | ||
/** | ||
* Authentication for AWS Elastic Container Registry (ECR) | ||
*/ | ||
export interface DockerAuthAWS { | ||
export declare type DockerAuthAWS = { | ||
aws_access_key_id: string; | ||
@@ -48,3 +49,3 @@ /** | ||
aws_secret_access_key: string; | ||
} | ||
}; | ||
//# sourceMappingURL=DockerImage.d.ts.map |
@@ -6,3 +6,2 @@ import { GenerableType } from '../../../Config/exports/Mapping'; | ||
import { AnyResourceClass, ExecutorLiteral, ExecutorShape } from '../types/Executor.types'; | ||
import { ExecutableParameters } from '../types/ExecutorParameters.types'; | ||
import { ReusableExecutor } from './ReusableExecutor'; | ||
@@ -14,3 +13,2 @@ /** | ||
resource_class: ResourceClass; | ||
parameters: ExecutableParameters; | ||
/** | ||
@@ -20,3 +18,3 @@ * @param resource_class - The resource class of the environment | ||
*/ | ||
constructor(resource_class: ResourceClass, parameters?: Exclude<ExecutableParameters, 'resource_class'>); | ||
constructor(resource_class: ResourceClass); | ||
abstract get generableType(): GenerableType; | ||
@@ -28,14 +26,3 @@ abstract get executorLiteral(): ExecutorLiteral; | ||
toReusable(name: string, parameters?: CustomParametersList<ExecutorParameterLiteral>): ReusableExecutor; | ||
/** | ||
* Add an environment variable to the Executor. | ||
* This will be set in plain-text via the exported config file. | ||
* Consider using project-level environment variables or a context for sensitive information. | ||
* @see {@link https://circleci.com/docs/env-vars} | ||
* @example | ||
* ``` | ||
* myExecutor.addEnvVar('MY_VAR', 'my value'); | ||
* ``` | ||
*/ | ||
addEnvVar(name: string, value: string): this; | ||
} | ||
//# sourceMappingURL=Executor.d.ts.map |
import { GenerableType } from '../../../Config/exports/Mapping'; | ||
import { ExecutorLiteral } from '../types/Executor.types'; | ||
import { ExecutableParameters } from '../types/ExecutorParameters.types'; | ||
import { MachineExecutorShape, MachineResourceClass } from '../types/MachineExecutor.types'; | ||
@@ -16,3 +15,3 @@ import { Executor } from './Executor'; | ||
image: string; | ||
constructor(resource_class?: MachineResourceClass, image?: string, parameters?: ExecutableParameters); | ||
constructor(resource_class?: MachineResourceClass, image?: string); | ||
generateContents(): MachineExecutorShape; | ||
@@ -19,0 +18,0 @@ get generableType(): GenerableType; |
import { GenerableType } from '../../../Config/exports/Mapping'; | ||
import { ExecutorLiteral } from '../types/Executor.types'; | ||
import { ExecutableParameters } from '../types/ExecutorParameters.types'; | ||
import { MacOSExecutorShape, MacOSResourceClass } from '../types/MacOSExecutor.types'; | ||
@@ -16,3 +15,3 @@ import { Executor } from './Executor'; | ||
xcode: string; | ||
constructor(xcode: string, resource_class?: MacOSResourceClass, parameters?: ExecutableParameters); | ||
constructor(xcode: string, resource_class?: MacOSResourceClass); | ||
generateContents(): MacOSExecutorShape; | ||
@@ -19,0 +18,0 @@ get generableType(): GenerableType; |
import { GenerableType } from '../../../Config/exports/Mapping'; | ||
import { ExecutorLiteral } from '../types/Executor.types'; | ||
import { ExecutableParameters } from '../types/ExecutorParameters.types'; | ||
import { ExecutorLiteral, ExecutorShape } from '../types/Executor.types'; | ||
import { WindowsExecutorShape, WindowsResourceClass, WindowsResourceClassGenerated } from '../types/WindowsExecutor.types'; | ||
@@ -17,3 +16,4 @@ import { Executor } from './Executor'; | ||
static defaultShell: string; | ||
constructor(resource_class?: WindowsResourceClass, image?: string, parameters?: ExecutableParameters); | ||
constructor(resource_class?: WindowsResourceClass, image?: string); | ||
generate(): ExecutorShape; | ||
generateContents(): WindowsExecutorShape; | ||
@@ -20,0 +20,0 @@ get generableType(): GenerableType; |
import { EnvironmentParameter, StringParameter } from '../../Parameters/types'; | ||
import { ComponentParameter as ComponentParameters, ExecutorParameterTypes } from '../../Parameters/types/ComponentParameters.types'; | ||
export declare type ExecutableProperties = { | ||
description?: StringParameter; | ||
export interface Executable { | ||
/** | ||
* Shell to use for execution command in all steps. | ||
*/ | ||
shell?: StringParameter; | ||
/** | ||
* In which directory to run the steps. Will be interpreted as an absolute path. | ||
*/ | ||
working_directory?: StringParameter; | ||
/** | ||
* A map of environment variable names and values. | ||
*/ | ||
environment?: EnvironmentParameter; | ||
}; | ||
} | ||
export declare type ExecutableProperties = Executable; | ||
export declare type ExecutableParameters = ComponentParameters<ExecutorParameterTypes> & ExecutableProperties & { | ||
@@ -10,0 +19,0 @@ [key: string]: ExecutorParameterTypes | undefined; |
@@ -1,5 +0,6 @@ | ||
import { StringParameter } from '../../Parameters/types'; | ||
import { BooleanParameter, StringParameter } from '../../Parameters/types'; | ||
import { AnyResourceClass } from './Executor.types'; | ||
export declare type MachineExecutorShape = { | ||
image: StringParameter; | ||
docker_layer_caching?: BooleanParameter; | ||
}; | ||
@@ -6,0 +7,0 @@ /** |
import { GenerableType } from '../../Config/exports/Mapping'; | ||
import { Command } from '../Commands/exports/Command'; | ||
import { Executable } from '../Executors/types/ExecutorParameters.types'; | ||
import { Generable } from '../index'; | ||
import { EnvironmentParameter } from '../Parameters/types'; | ||
import { AnyExecutor, JobContentsShape, JobsShape } from './types/Job.types'; | ||
import { EnvironmentParameter, StringParameter } from '../Parameters/types'; | ||
import { AnyExecutor, JobContentsShape, JobExtraProperties, JobsShape } from './types/Job.types'; | ||
/** | ||
* Jobs define a collection of steps to be run within a given executor, and are orchestrated using Workflows. | ||
*/ | ||
export declare class Job implements Generable { | ||
export declare class Job implements Generable, Executable { | ||
/** | ||
* The name of the current Job. | ||
*/ | ||
name: string; | ||
name: StringParameter; | ||
/** | ||
@@ -23,5 +24,8 @@ * The reusable executor to use for this job. The Executor must have already been instantiated and added to the config. | ||
/** | ||
* A map of environment variables local to the job. | ||
* Number of parallel instances of this job to run (default: 1) | ||
*/ | ||
parallelism: number; | ||
environment?: EnvironmentParameter; | ||
shell?: StringParameter; | ||
working_directory?: StringParameter; | ||
/** | ||
@@ -34,3 +38,3 @@ * Instantiate a CircleCI Job | ||
*/ | ||
constructor(name: string, executor: AnyExecutor, steps?: Command[], environment?: EnvironmentParameter); | ||
constructor(name: string, executor: AnyExecutor, steps?: Command[], properties?: JobExtraProperties); | ||
/** | ||
@@ -37,0 +41,0 @@ * Generates the contents of the Job. |
import { Command } from '../../Commands/exports/Command'; | ||
import { Executor } from '../../Executors'; | ||
import { ReusedExecutor } from '../../Executors/exports/ReusedExecutor'; | ||
import { AnyExecutorShape } from '../../Executors/types/Executor.types'; | ||
import { AnyExecutorShape, ExecutableProperties } from '../../Executors/types/Executor.types'; | ||
import { CustomParametersList } from '../../Parameters'; | ||
@@ -27,2 +27,5 @@ import { CustomParametersListShape, EnvironmentParameter } from '../../Parameters/types'; | ||
}; | ||
export declare type JobExtraProperties = { | ||
parallelism?: number; | ||
} & ExecutableProperties; | ||
export declare type UnknownJobShape = { | ||
@@ -29,0 +32,0 @@ [key: string]: unknown; |
import { Generable } from '../..'; | ||
import { GenerableType } from '../../../Config/exports/Mapping'; | ||
import { CustomParameterShape, CustomParameterContentsShape } from '../types'; | ||
import { CustomParameterContentsShape, CustomParameterShape } from '../types'; | ||
import { AnyParameterLiteral } from '../types/CustomParameterLiterals.types'; | ||
@@ -5,0 +5,0 @@ /** |
{ | ||
"name": "@circleci/circleci-config-sdk", | ||
"version": "v0.9.0-alpha.20", | ||
"version": "v0.9.0-alpha.21", | ||
"description": "An SDK for building CircleCI Configuration files with JavaScript.", | ||
@@ -31,3 +31,3 @@ "main": "dist/index.js", | ||
"@commitlint/config-conventional": "^17.0.3", | ||
"@types/jest": "^27.0.2", | ||
"@types/jest": "^27.5.2", | ||
"@types/node": "^14.18.21", | ||
@@ -34,0 +34,0 @@ "@types/webpack": "^5.0.0", |
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
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
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
866505
173
2726