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

@circleci/circleci-config-sdk

Package Overview
Dependencies
Maintainers
127
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.1.1 to 0.2.2

CONTRIBUTING.md

39

dist/index.d.ts

@@ -1,35 +0,8 @@

import * as Command from "./lib/Components/Commands";
import * as Executor from "./lib/Components/Executor";
import Job from "./lib/Components/Job";
import Workflow from "./lib/Components/Workflow";
import Config from "./lib/Config";
import Pipeline from "./lib/Config/Pipeline/index";
/**
* The CircleCI config SDK. Build your CircleCI configuration with code.
*/
declare const CircleCI: {
Command: typeof Command;
/**
* Executors define the environment in which the steps of a job will be run. {@link https://circleci.com/docs/2.0/configuration-reference/#executors-requires-version-21}
*/
Executor: typeof Executor;
/**
* Jobs define a collection of steps to be run within a given executor, and are orchestrated using Workflows.
*/
Job: typeof Job;
/**
* A workflow is a set of rules for defining a collection of jobs and their run order.
*/
Workflow: typeof Workflow;
/**
* Access information about the Current CircleCI Pipeline
*/
Pipeline: typeof Pipeline;
/**
* A CircleCI configuration
*/
Config: typeof Config;
};
import Command from './lib/Components/Commands';
import Executor from './lib/Components/Executor';
import Job from './lib/Components/Job';
import Workflow from './lib/Components/Workflow';
import Config from './lib/Config';
import Pipeline from './lib/Config/Pipeline/index';
export { Command, Executor, Job, Workflow, Pipeline, Config };
export default CircleCI;
//# sourceMappingURL=index.d.ts.map

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

import { ConfigElement } from "../../Config/Config.types";
import { Run } from "./Native/Run";
import { ConfigElement } from '../../Config/Config.types';
import { Run } from './Native/Run';
export declare abstract class Command extends ConfigElement {

@@ -4,0 +4,0 @@ type: string;

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

import { Command } from "..";
import { Command } from '..';
export declare class Run extends Command {

@@ -39,3 +39,3 @@ parameters: RunParameters;

*/
when?: "always" | "on_success" | "on_fail";
when?: 'always' | 'on_success' | 'on_fail';
}

@@ -1,8 +0,22 @@

import Run from "./Native/Run";
import Checkout from "./Native/Checkout";
import * as Cache from "./Native/Cache";
import * as Workspace from "./Native/Workspace";
import StoreTestResults from "./Native/StoreTestResults";
import StoreArtifacts from "./Native/StoreArtifacts";
export { Run, Checkout, Cache, Workspace, StoreArtifacts, StoreTestResults };
import Run from './Native/Run';
import Checkout from './Native/Checkout';
import * as Cache from './Native/Cache';
import * as Workspace from './Native/Workspace';
import StoreTestResults from './Native/StoreTestResults';
import StoreArtifacts from './Native/StoreArtifacts';
import SetupRemoteDocker from './Native/SetupRemoteDocker';
/**
* All available commands that can be used within jobs.
* Use the Run command to execute scripts.
*/
declare const Command: {
Run: typeof Run;
Checkout: typeof Checkout;
Cache: typeof Cache;
Workspace: typeof Workspace;
StoreArtifacts: typeof StoreArtifacts;
StoreTestResults: typeof StoreTestResults;
SetupRemoteDocker: typeof SetupRemoteDocker;
};
export default Command;
//# sourceMappingURL=index.d.ts.map

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

import { ParameterTypes } from "../../Config/index.types";
import Component from "../index.types";
import { RunCommandSchema } from "./Native/Run";
import { ParameterTypes } from '../../Config/index.types';
import Component from '../index.types';
import { RunCommandSchema } from './Native/Run';
/**

@@ -20,2 +20,2 @@ * Abstract - A generic Command

export declare type CommandSchema = RunCommandSchema;
//# sourceMappingURL=index.types.d.ts.map
//# sourceMappingURL=index.types.d.ts.map

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

import Restore from "./Restore";
import Save from "./Save";
import Restore from './Restore';
import Save from './Save';
export { Restore, Save };
//# sourceMappingURL=index.d.ts.map

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

import { Command, CommandParameters } from "../../index.types";
import { CommandSchema, Command, CommandParameters } from '../../Command';
/**

@@ -21,5 +21,5 @@ * Restores a previously saved cache based on a key. Cache needs to have been saved first for this key using save_cache step. Learn more in the caching documentation.

}
export interface RestoreCacheCommandSchema {
export interface RestoreCacheCommandSchema extends CommandSchema {
restore_cache: RestoreCacheParameters;
}
//# sourceMappingURL=Restore.d.ts.map

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

import { Command, CommandParameters } from "../../index.types";
import { CommandSchema, Command, CommandParameters } from '../../Command';
/**

@@ -27,7 +27,7 @@ * Generates and stores a cache of a file or directory of files such as dependencies or source code in our object storage. Later jobs can restore this cache.

*/
when?: "always" | "on_success" | "on_fail";
when?: 'always' | 'on_success' | 'on_fail';
}
export interface SaveCacheCommandSchema {
export interface SaveCacheCommandSchema extends CommandSchema {
save_cache: SaveCacheParameters;
}
//# sourceMappingURL=Save.d.ts.map

@@ -1,4 +0,5 @@

import { Command, CommandParameters } from "../index.types";
import { Command, CommandParameters, CommandSchema } from '../Command';
/**
* A special step used to check out source code to the configured path (defaults to the working_directory).
* A special step used to check out source code to the configured path.
* (defaults to the working_directory).
* @param parameters - CheckoutParameters

@@ -18,11 +19,12 @@ */

/**
* Checkout directory. Will be interpreted relative to the working_directory of the job).
* Checkout directory.
* Will be interpreted relative to the working_directory of the job.
*/
path?: string;
}
export interface CheckoutCommandSchemaObject {
export interface CheckoutCommandSchemaObject extends CommandSchema {
checkout: CheckoutParameters;
}
export declare type CheckoutCommandSchemaString = "checkout";
export declare type CheckoutCommandSchemaString = 'checkout';
export declare type CheckoutCommandSchema = CheckoutCommandSchemaObject | CheckoutCommandSchemaString;
//# sourceMappingURL=Checkout.d.ts.map

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

import { Command, CommandParameters } from "../index.types";
import { Command, CommandParameters, CommandSchema } from '../Command';
/**

@@ -44,7 +44,7 @@ * The Run command step is used for invoking all command-line programs.

*/
when?: "always" | "on_success" | "on_fail";
when?: 'always' | 'on_success' | 'on_fail';
}
export interface RunCommandSchema {
export interface RunCommandSchema extends CommandSchema {
run: RunParameters;
}
//# sourceMappingURL=Run.d.ts.map

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

import { Command, CommandParameters } from "../index.types";
import { Command, CommandParameters, CommandSchema } from '../Command';
/**

@@ -26,5 +26,5 @@ * A special step used to check out source code to the configured path (defaults to the working_directory).

}
export interface StoreArtifactsCommandSchema {
export interface StoreArtifactsCommandSchema extends CommandSchema {
store_artifacts: StoreArtifactsParameters;
}
//# sourceMappingURL=StoreArtifacts.d.ts.map

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

import { Command, CommandParameters } from "../index.types";
import { Command, CommandParameters, CommandSchema } from '../Command';
/**

@@ -22,5 +22,5 @@ * Special step used to upload and store test results for a build. Test results are visible on the CircleCI web application, under each build’s “Test Summary” section. Storing test results is useful for timing analysis of your test suites.

}
export interface StoreTestResultsCommandSchema {
export interface StoreTestResultsCommandSchema extends CommandSchema {
store_test_results: StoreTestResultsParameters;
}
//# sourceMappingURL=StoreTestResults.d.ts.map

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

import { Command, CommandParameters } from "../../index.types";
import { Command, CommandParameters, CommandSchema } from '../../Command';
/**

@@ -15,3 +15,3 @@ * Special step used to attach the workflow’s workspace to the current container. The full contents of the workspace are downloaded and copied into the directory the workspace is being attached at.

export default Attach;
export interface AttachCommandSchema {
export interface AttachCommandSchema extends CommandSchema {
attach_workspace: AttachParameters;

@@ -18,0 +18,0 @@ }

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

import Attach from "./Attach";
import Persist from "./Persist";
import Attach from './Attach';
import Persist from './Persist';
export { Attach, Persist };
//# sourceMappingURL=index.d.ts.map

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

import { Command, CommandParameters } from "../../index.types";
import { Command, CommandParameters, CommandSchema } from '../../Command';
/**

@@ -15,3 +15,3 @@ * Special step used to Persist the workflow’s workspace to the current container. The full contents of the workspace are downloaded and copied into the directory the workspace is being Persisted at.

export default Persist;
export interface PersistCommandSchema {
export interface PersistCommandSchema extends CommandSchema {
persist_to_workspace: PersistParameters;

@@ -18,0 +18,0 @@ }

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

import Executor from "../../Components/Executor/index.types";
import { DockerImage } from "./DockerImage";
import { DockerExecutorSchema } from "./DockerExecutor.types";
/**
* A Docker based CircleCI executor {@link https://circleci.com/docs/2.0/configuration-reference/?section=configuration#docker}
*/
import Executor from '../../Components/Executor/Executor';
import { DockerExecutorSchema, DockerResourceClass } from './DockerExecutor.types';
import { DockerImage } from './DockerImage';
export declare class DockerExecutor extends Executor {

@@ -21,3 +18,4 @@ /**

*/
constructor(name: string, image: string);
resourceClass: DockerResourceClass;
constructor(name: string, image: string, resourceClass?: DockerResourceClass);
/**

@@ -24,0 +22,0 @@ * Generate Docker Executor schema.

@@ -1,5 +0,6 @@

import { DockerImageSchema } from "./DockerImage.types";
import { DockerImageSchema } from './DockerImage';
export interface DockerExecutorSchema {
[key: string]: {
[name: string]: {
docker: DockerImageSchema[];
resource_class: DockerResourceClass;
};

@@ -10,2 +11,7 @@ }

}
/**
* The available Docker Resource Classes.
* @see {@link https://circleci.com/docs/2.0/configuration-reference/#docker-executor} for specifications of each class.
*/
export declare type DockerResourceClass = 'small' | 'medium' | 'medium+' | 'large' | 'xlarge' | '2xlarge' | '2xlarge+';
//# sourceMappingURL=DockerExecutor.types.d.ts.map

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

import { DockerAuth, DockerAuthAWS, DockerImageSchema } from "./DockerImage.types";
export declare class DockerImage implements DockerImageSchema {

@@ -12,4 +11,33 @@ image: string;

constructor(image: string, name?: string, entrypoint?: string[], command?: string[], user?: string, environment?: Map<string, string>, auth?: DockerAuth, aws_auth?: DockerAuthAWS);
generate(): DockerImageSchema;
}
export interface DockerImageSchema {
name?: string;
image: string;
entrypoint?: string[];
command?: string[];
user?: string;
environment?: Map<string, string>;
auth?: DockerAuth;
aws_auth?: DockerAuthAWS;
}
/**
* Authentication for registries using standard `docker login` credentials
*/
export interface DockerAuth {
username: string;
/**
* Specify an environment variable (e.g. $DOCKER_PASSWORD)
*/
password: string;
}
/**
* Authentication for AWS Elastic Container Registry (ECR)
*/
export interface DockerAuthAWS {
aws_access_key_id: string;
/**
* Specify an environment variable (e.g. $ECR_AWS_SECRET_ACCESS_KEY)
*/
aws_secret_access_key: string;
}
//# sourceMappingURL=DockerImage.d.ts.map

@@ -31,2 +31,2 @@ export interface DockerImageSchema {

}
//# sourceMappingURL=DockerImage.types.d.ts.map
//# sourceMappingURL=DockerImage.types.d.ts.map

@@ -1,2 +0,11 @@

import { DockerExecutor } from "./DockerExecutor";
export declare type ExecutorType = DockerExecutor;
import { DockerExecutor } from './DockerExecutor';
import { DockerExecutorSchema } from './DockerExecutor.types';
import { MachineExecutor } from './MachineExecutor';
import { MachineExecutorSchema } from './MachineExecutor.types';
import { MacOSExecutor } from './MacOSExecutor';
import { MacOSExecutorSchema } from './MacOSExecutor.types';
import { WindowsExecutor } from './WindowsExecutor';
import { WindowsExecutorSchema } from './WindowsExecutor.types';
export declare type ExecutorType = DockerExecutor | MachineExecutor | MacOSExecutor | WindowsExecutor;
export declare type ExecutorSchema = DockerExecutorSchema | MachineExecutorSchema | MacOSExecutorSchema | WindowsExecutorSchema;
//# sourceMappingURL=Executor.types.d.ts.map

@@ -1,10 +0,32 @@

import { DockerExecutor } from "./DockerExecutor";
import { DockerExecutor } from './DockerExecutor';
import { MachineExecutor } from './MachineExecutor';
import { MacOSExecutor } from './MacOSExecutor';
import { WindowsExecutor } from './WindowsExecutor';
/**
* Executors define the environment in which the steps of a job will be run. {@link https://circleci.com/docs/2.0/configuration-reference/#executors-requires-version-21}
* Executors define the environment in which the steps of a job will be run.
* @see {@link https://circleci.com/docs/2.0/configuration-reference/#executors-requires-version-21}
*/
export {
/**
* A Docker based CircleCI executor {@link https://circleci.com/docs/2.0/configuration-reference/?section=configuration#docker}
*/
DockerExecutor, };
declare const Executor: {
/**
* A Docker based CircleCI executor.
* @see {@link https://circleci.com/docs/2.0/configuration-reference/?section=configuration#docker}
*/
DockerExecutor: typeof DockerExecutor;
/**
* The Linux Virtual Machine Executor.
* @see {@link https://circleci.com/docs/2.0/executor-types/#using-machine}
*/
MachineExecutor: typeof MachineExecutor;
/**
* A MacOS Virtual Machine with configurable Xcode version.
* @see {@link https://circleci.com/docs/2.0/executor-types/#using-macos}
*/
MacOSExecutor: typeof MacOSExecutor;
/**
* A Windows Virtual Machine (CircleCI Cloud)
* @see {@link https://circleci.com/docs/2.0/executor-types/#using-the-windows-executor}
*/
WindowsExecutor: typeof WindowsExecutor;
};
export default Executor;
//# sourceMappingURL=index.d.ts.map

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

import Component from "../index.types";
import { DockerExecutor } from "./DockerExecutor";
import { DockerExecutorSchema } from "./DockerExecutor.types";
import Component from '../index.types';
import { DockerExecutor } from './DockerExecutor';
import { DockerExecutorSchema } from './DockerExecutor.types';
/**

@@ -15,2 +15,2 @@ * A generic reusable Executor

export declare type ExectorSchema = DockerExecutorSchema;
//# sourceMappingURL=index.types.d.ts.map
//# sourceMappingURL=index.types.d.ts.map

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

import * as Commands from "./Commands";
import { Executor } from "./Executor";
import { Job } from "./Job";
import { Workflow } from "./Workflow";
export { Commands, Executor, Job, Workflow };
export default abstract class Component {
/**
* Generate the CircleCI YAML equivelant JSON for config compilation
*/
abstract generate(): unknown;
}
//# sourceMappingURL=index.d.ts.map

@@ -7,2 +7,2 @@ export default abstract class Component {

}
//# sourceMappingURL=index.types.d.ts.map
//# sourceMappingURL=index.types.d.ts.map

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

import { ConfigElement } from "../Config/Config.types";
import { Command } from "./Command";
import { DockerExecutor } from "./Executor/DockerExecutor";
import { ExecutorType } from "./Executor/Executor.types";
import { ConfigElement } from '../Config/Config.types';
import { Command } from './Command';
import { DockerExecutor } from './Executor/DockerExecutor';
import { ExecutorType } from './Executor/Executor.types';
/**

@@ -6,0 +6,0 @@ * Jobs define a collection of steps to be run within a given executor, and are orchestrated using Workflows.

@@ -1,5 +0,4 @@

import { Command } from "../Commands/index.types";
import { ExecutorType } from "../Executor/index.types";
import Component from "../index.types";
import { JobSchema } from "./index.types";
import { Command } from '../Commands/Command';
import ExecutorType from '../Executor/Executor';
import Component from '../index';
/**

@@ -41,2 +40,10 @@ * Jobs define a collection of steps to be run within a given executor, and are orchestrated using Workflows.

export default Job;
export interface JobSchema {
[key: string]: {
executor: {
name: string;
};
steps: unknown[];
};
}
//# sourceMappingURL=index.d.ts.map

@@ -9,2 +9,2 @@ export interface JobSchema {

}
//# sourceMappingURL=index.types.d.ts.map
//# sourceMappingURL=index.types.d.ts.map

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

import Job from "../Job";
import { WorkflowJobParameters, WorkflowSchema } from "./index.types";
import { WorkflowJob } from "./WorkflowJob";
import Job from '../Job';
import { WorkflowJobParameters, WorkflowSchema } from './Workflow';
import { WorkflowJob } from './WorkflowJob';
/**

@@ -5,0 +5,0 @@ * A workflow is a set of rules for defining a collection of jobs and their run order.

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

import { ParameterTypes } from "../../Config/index.types";
import { ParameterTypes } from '../../Config/index.types';
export interface WorkflowSchema {

@@ -25,3 +25,3 @@ [workflowName: string]: {

*/
type?: "approval";
type?: 'approval';
[key: string]: ParameterTypes;

@@ -33,3 +33,3 @@ }

context?: string[];
type?: "approval";
type?: 'approval';
filters?: WorkflowFilterSchema;

@@ -75,2 +75,2 @@ matrix?: WorkflowMatrixSchema;

}
//# sourceMappingURL=index.types.d.ts.map
//# sourceMappingURL=index.types.d.ts.map

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

import Component from "../index.types";
import Job from "../Job";
import { WorkflowJobParameters, WorkflowJobSchema } from "./index.types";
import Component from '../index';
import Job from '../Job';
import { WorkflowJobParameters, WorkflowJobSchema } from './Workflow';
/**

@@ -11,5 +11,4 @@ * Assign Parameters and Filters to a Job within a Workflow

constructor(job: Job, parameters?: WorkflowJobParameters);
requiresJob(workflowJob: WorkflowJob): this;
generate(): WorkflowJobSchema;
}
//# sourceMappingURL=WorkflowJob.d.ts.map

@@ -1,11 +0,13 @@

import { Command } from "../Components/Commands/index.types";
import Job from "../Components/Job";
import Workflow from "../Components/Workflow";
import { CircleCIConfigObject, ConfigVersion } from "./index.types";
import Executor from "../Components/Executor/index.types";
import Pipeline from "./Pipeline";
import { Command, CommandSchema } from '../Components/Commands/Command';
import Job from '../Components/Job';
import { JobSchema } from '../Components/Job/index';
import { Workflow } from '../Components/Workflow';
import { WorkflowSchema } from '../Components/Workflow/Workflow';
import Executor from '../Components/Executor/Executor';
import Pipeline from './Pipeline';
import { ExecutorSchema } from '../Components/Executor/Executor.types';
/**
* A CircleCI configuration. Instantiate a new config and add CircleCI config elements.
*/
export declare class Config implements CircleCIConfigObject {
export default class Config implements CircleCIConfigObject {
/**

@@ -36,2 +38,6 @@ * The version field is intended to be used in order to issue warnings for deprecation or breaking changes.

/**
* Designates the config.yaml for use of CircleCI’s dynamic configuration feature.
*/
setup: boolean;
/**
* Instantiate a new CircleCI config. Build up your config by adding components.

@@ -43,3 +49,3 @@ * @param jobs - Instantiate with pre-defined Jobs.

*/
constructor(jobs?: Job[], workflows?: Workflow[], executors?: Executor[], commands?: Command[]);
constructor(setup?: boolean, jobs?: Job[], workflows?: Workflow[], executors?: Executor[], commands?: Command[]);
/**

@@ -65,3 +71,23 @@ * Add a Workflow to the current Config. Chainable

}
export default Config;
export declare type ConfigVersion = 2 | 2.1;
export interface ConfigOrbImport {
orbAlias: string;
orbImport: string;
}
export interface CircleCIConfigObject {
version: ConfigVersion;
jobs?: Job[];
executors?: Executor[];
commands?: Command[];
workflows?: Workflow[];
}
export interface CircleCIConfigSchema {
version: ConfigVersion;
setup: boolean;
orbs?: ConfigOrbImport[];
jobs: JobSchema;
executors?: ExecutorSchema;
commands?: CommandSchema;
workflows: WorkflowSchema;
}
//# sourceMappingURL=index.d.ts.map

@@ -1,8 +0,15 @@

import { Command, CommandSchema } from "../Components/Commands/index.types";
import Job from "../Components/Job";
import Workflow from "../Components/Workflow";
import Executor from "../Components/Executor/index.types";
import { ExecutorType, ExectorSchema } from "../Components/Executor/index.types";
import { JobSchema } from "../Components/Job/index.types";
import { WorkflowFilterSchema, WorkflowMatrixSchema, WorkflowSchema } from "../Components/Workflow/index.types";
import { Command, CommandSchema } from '../Components/Commands/index.types';
import Job from '../Components/Job';
import Workflow from '../Components/Workflow';
import Executor from '../Components/Executor/index.types';
import {
ExecutorType,
ExectorSchema,
} from '../Components/Executor/index.types';
import { JobSchema } from '../Components/Job/index.types';
import {
WorkflowFilterSchema,
WorkflowMatrixSchema,
WorkflowSchema,
} from '../Components/Workflow/index.types';
export declare type ConfigVersion = 2 | 2.1;

@@ -29,3 +36,14 @@ export interface ConfigOrbImport {

export declare type EnumParameter = string[];
export declare type ParameterTypes = string | string[] | boolean | number | ExecutorType | Command[] | EnumParameter | Map<string, string> | WorkflowMatrixSchema | WorkflowFilterSchema | undefined;
//# sourceMappingURL=index.types.d.ts.map
export declare type ParameterTypes =
| string
| string[]
| boolean
| number
| ExecutorType
| Command[]
| EnumParameter
| Map<string, string>
| WorkflowMatrixSchema
| WorkflowFilterSchema
| undefined;
//# sourceMappingURL=index.types.d.ts.map

@@ -1,5 +0,8 @@

import { Project } from "./Project";
import { Git } from "./Git";
import { PipelineParameter } from "./Parameters";
import { ParameterTypes } from "../index.types";
import { Project } from './Project';
import { Git } from './Git';
import { PipelineParameter } from './Parameters';
import { ParameterTypes } from '../Parameters';
/**
* Access Pipeline variables from within CircleCI Cloud.
*/
export default class Pipeline {

@@ -28,9 +31,9 @@ /**

*/
project: Project;
project(): Project;
/**
* Git metadata
*/
git: Git;
git(): Git;
}
export { PipelineParameter };
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,6 @@

export declare type ParameterTypeLiteral = "string" | "number" | "boolean" | "enum";
export declare type ParameterTypeLiteral =
| 'string'
| 'number'
| 'boolean'
| 'enum';
export interface PipelineParameterSchema {

@@ -10,2 +14,2 @@ [parameterName: string]: {

export declare type PipelineParameterValueTypes = string | number | boolean;
//# sourceMappingURL=index.types.d.ts.map
//# sourceMappingURL=index.types.d.ts.map

@@ -1,3 +0,2 @@

import { EnumParameter } from "../index.types";
import { ParameterTypeLiteral, PipelineParameterSchema, PipelineParameterValueTypes } from "./index.types";
import { EnumParameter } from '../Parameters';
export declare class PipelineParameter<ParameterType> {

@@ -13,2 +12,11 @@ name: string;

}
export declare type ParameterTypeLiteral = 'string' | 'number' | 'boolean' | 'enum';
export interface PipelineParameterSchema {
[parameterName: string]: {
type: ParameterTypeLiteral;
default: string | number | boolean;
enum?: string[];
};
}
export declare type PipelineParameterValueTypes = string | number | boolean;
//# sourceMappingURL=Parameters.d.ts.map

@@ -11,4 +11,4 @@ export declare class Project {

*/
get type(): "bitbucket" | "github" | "local";
get type(): 'bitbucket' | 'github' | 'local';
}
//# sourceMappingURL=Project.d.ts.map
{
"name": "@circleci/circleci-config-sdk",
"version": "0.1.1",
"version": "0.2.2",
"description": "An SDK for building CircleCI Configuration files with JavaScript.",

@@ -8,6 +8,10 @@ "main": "dist/index.js",

"scripts": {
"test": "jest",
"lint": "npx eslint --fix --ext .js,.jsx,.ts,.tsx .",
"build": "npm run lint && npx webpack --mode production && npm run build:docs",
"build:docs": "typedoc"
"test": "jest && npm run build:docs",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx --max-warnings 0",
"prettier": "prettier --write .",
"prettier:ci": "prettier --check .",
"lint:ci": "npm run prettier:ci && npm run lint",
"build": "npx webpack --mode production",
"build:docs": "typedoc",
"prepare": "husky install"
},

@@ -25,3 +29,3 @@ "repository": {

"devDependencies": {
"@types/jest": "^26.0.22",
"@types/jest": "^26.0.23",
"@types/node": "^14.14.37",

@@ -33,5 +37,9 @@ "@types/webpack": "^5.0.0",

"eslint": "^7.23.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-security": "^1.4.0",
"eslint-plugin-tsdoc": "^0.2.11",
"husky": "^6.0.0",
"jest": "^26.6.3",
"lint-staged": "^11.0.0",
"prettier": "^2.3.1",
"ts-jest": "^26.5.4",

@@ -55,3 +63,9 @@ "ts-loader": "^8.0.18",

"circleci"
]
],
"lint-staged": {
"*.{js,jsx,ts,tsx}": [
"npm run prettier",
"npm run lint"
]
}
}

@@ -1,2 +0,4 @@

![CircleCI Status](https://circleci.com/gh/CircleCI-Public/circleci-config-sdk-ts.svg?style=shield) [![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/circleci-public/circleci-config-sdk-ts/blob/main/LICENSE)
[![CircleCI Build Status](https://circleci.com/gh/CircleCI-Public/circleci-config-sdk-ts.svg?style=shield 'CircleCI Build Status')](https://circleci.com/gh/CircleCI-Public/circleci-config-sdk-ts)
[![codecov](https://codecov.io/gh/CircleCI-Public/circleci-config-sdk-ts/branch/main/graph/badge.svg?token=Z4C4RXABS7)](https://codecov.io/gh/CircleCI-Public/circleci-config-sdk-ts)
[![GitHub License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/circleci-public/circleci-config-sdk-ts/blob/main/LICENSE)

@@ -20,3 +22,3 @@ # CircleCI Config SDK (TypeScript)

```typescript
import CircleCI from "@circleci/circleci-config-sdk"
import * as CircleCI from '@circleci/circleci-config-sdk';
```

@@ -32,34 +34,43 @@

Generate a CircleCI config using TypeScript/Javascript, properly typed for full IntelliSense support.
Generate a CircleCI config using TypeScript/Javascript, properly typed for full
IntelliSense support.
```typescript
// Instantiate new Config
const myConfig = new CircleCI.Config()
const myConfig = new CircleCI.Config();
// Create new Workflow
const myWorkflow = new CircleCI.Workflow("myWorkflow")
myConfig.addWorkflow(myWorkflow)
const myWorkflow = new CircleCI.Workflow('myWorkflow');
myConfig.addWorkflow(myWorkflow);
// Create an executor. Reusable.
const nodeExecutor = new CircleCI.Executor.DockerExecutor("node-executor", "cimg/node:lts")
myConfig.addExecutor(nodeExecutor)
const nodeExecutor = new CircleCI.Executor.DockerExecutor(
'node-executor',
'cimg/node:lts',
);
myConfig.addExecutor(nodeExecutor);
// Create Job
const nodeTestJob = new CircleCI.Job("node-test", nodeExecutor)
myConfig.addJob(nodeTestJob)
const nodeTestJob = new CircleCI.Job('node-test', nodeExecutor);
myConfig.addJob(nodeTestJob);
// Add steps to job
nodeTestJob
.addStep(new CircleCI.Command.Run({
command: "npm install",
name: "NPM Install"}))
.addStep(new CircleCI.Command.Run({
command: "npm run test",
name: "Run tests"}))
.addStep(
new CircleCI.Command.Run({
command: 'npm install',
name: 'NPM Install',
}),
)
.addStep(
new CircleCI.Command.Run({
command: 'npm run test',
name: 'Run tests',
}),
);
// Add Jobs to Workflow
myWorkflow.addJob(nodeTestJob)
myWorkflow.addJob(nodeTestJob);
// The `stringify()` function on `CircleCI.Config` will return the CircleCI YAML equivalent.
const MyYamlConfig = myConfig.stringify()
const MyYamlConfig = myConfig.stringify();
```

@@ -72,20 +83,20 @@

executors:
node-executor:
docker:
- image: cimg/node:lts
node-executor:
docker:
- image: cimg/node:lts
jobs:
node-test:
executor:
name: node-executor
steps:
- run:
command: npm install
name: NPM Install
- run:
command: npm run test
name: Run tests
node-test:
executor:
name: node-executor
steps:
- run:
command: npm install
name: NPM Install
- run:
command: npm run test
name: Run tests
workflows:
myWorkflow:
jobs:
- node-test: {}
```
myWorkflow:
jobs:
- node-test: {}
```

Sorry, the diff of this file is not supported yet

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

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

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