agent-claw: automated task changes
This commit is contained in:
145
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/graph.d.ts
generated
vendored
Normal file
145
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/graph.d.ts
generated
vendored
Normal file
@@ -0,0 +1,145 @@
|
||||
export interface GraphNodeProps<A> {
|
||||
readonly displayName?: string;
|
||||
readonly data?: A;
|
||||
}
|
||||
export declare class GraphNode<A> {
|
||||
readonly id: string;
|
||||
static of<A>(id: string, data: A, displayName?: string): GraphNode<A>;
|
||||
readonly dependencies: GraphNode<A>[];
|
||||
readonly data?: A;
|
||||
readonly displayName?: string;
|
||||
private _parentGraph?;
|
||||
constructor(id: string, props?: GraphNodeProps<A>);
|
||||
/**
|
||||
* A graph-wide unique identifier for this node. Rendered by joining the IDs
|
||||
* of all ancestors with hyphens.
|
||||
*/
|
||||
get uniqueId(): string;
|
||||
/**
|
||||
* The union of all dependencies of this node and the dependencies of all
|
||||
* parent graphs.
|
||||
*/
|
||||
get allDeps(): GraphNode<A>[];
|
||||
dependOn(...dependencies: Array<GraphNode<A> | undefined>): void;
|
||||
ancestorPath(upTo: GraphNode<A>): GraphNode<A>[];
|
||||
rootPath(): GraphNode<A>[];
|
||||
get root(): GraphNode<A>;
|
||||
get rootGraph(): Graph<A>;
|
||||
get parentGraph(): Graph<A> | undefined;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
_setParentGraph(parentGraph: Graph<A>): void;
|
||||
toString(): string;
|
||||
}
|
||||
/**
|
||||
* A dependency set that is constructed over time
|
||||
*
|
||||
* It doesn't matter in what order sources and targets for the dependency
|
||||
* relationship(s) get added. This class can serve as a synchronization
|
||||
* point if the order in which graph nodes get added to the graph is not
|
||||
* well-defined.
|
||||
*
|
||||
* You can think of a DependencyBuilder as a vertex that doesn't actually exist in the tree:
|
||||
*
|
||||
* ┌────┐ ┌────┐
|
||||
* │ P1 │◀─┐ ┌──│ S1 │
|
||||
* └────┘ │ .─. │ └────┘
|
||||
* ├──( B )◀─┤
|
||||
* ┌────┐ │ `─' │ ┌────┐
|
||||
* │ P2 │◀─┘ └──│ S2 │
|
||||
* └────┘ └────┘
|
||||
*
|
||||
* Ultimately leads to: { S1 -> P1, S1 -> P2, S2 -> P1, S2 -> P2 }.
|
||||
*/
|
||||
export declare class DependencyBuilder<A> {
|
||||
private readonly _producers;
|
||||
private readonly _consumers;
|
||||
/**
|
||||
* Add a producer: make all nodes added by 'dependBy' depend on these
|
||||
*/
|
||||
dependOn(...targets: GraphNode<A>[]): this;
|
||||
/**
|
||||
* Add a consumer: make these nodes depend on all nodes added by 'dependOn'.
|
||||
*/
|
||||
dependBy(...sources: GraphNode<A>[]): this;
|
||||
/**
|
||||
* Whether there are any consumers (nodes added by 'dependBy') but no producers (nodes added by 'dependOn')
|
||||
*/
|
||||
get hasUnsatisfiedConsumers(): boolean;
|
||||
get consumers(): ReadonlyArray<GraphNode<A>>;
|
||||
consumersAsString(): string;
|
||||
}
|
||||
/**
|
||||
* A set of dependency builders identified by a given key.
|
||||
*/
|
||||
export declare class DependencyBuilders<K, A = any> {
|
||||
private readonly builders;
|
||||
for(key: K): DependencyBuilder<A>;
|
||||
/**
|
||||
* @deprecated Use 'for'
|
||||
*/
|
||||
get(key: K): DependencyBuilder<A>;
|
||||
unsatisfiedBuilders(): [K, DependencyBuilder<A>][];
|
||||
}
|
||||
export interface GraphProps<A> extends GraphNodeProps<A> {
|
||||
/**
|
||||
* Initial nodes in the workflow
|
||||
*/
|
||||
readonly nodes?: GraphNode<A>[];
|
||||
}
|
||||
export declare class Graph<A> extends GraphNode<A> {
|
||||
/**
|
||||
* The 3rd parameter looks weird because it has to be structurally compatible with `GraphNode.of()`,
|
||||
* but we want to add `displayName` at the end, really.
|
||||
*/
|
||||
static of<A, B>(id: string, data: A, displayNameOrNodes?: string | GraphNode<B>[], displayName?: string): Graph<A | B>;
|
||||
private readonly children;
|
||||
constructor(name: string, props?: GraphProps<A>);
|
||||
get nodes(): Set<GraphNode<A>>;
|
||||
tryGetChild(name: string): GraphNode<A> | undefined;
|
||||
containsId(id: string): boolean;
|
||||
contains(node: GraphNode<A>): boolean;
|
||||
add(...nodes: Array<GraphNode<A>>): void;
|
||||
absorb(other: Graph<A>): void;
|
||||
/**
|
||||
* Return topologically sorted tranches of nodes at this graph level
|
||||
*/
|
||||
sortedChildren(fail?: boolean): GraphNode<A>[][];
|
||||
/**
|
||||
* Return a topologically sorted list of non-Graph nodes in the entire subgraph
|
||||
*/
|
||||
sortedLeaves(): GraphNode<A>[][];
|
||||
render(): string;
|
||||
renderDot(): string;
|
||||
consoleLog(_indent?: number): void;
|
||||
/**
|
||||
* Return the union of all dependencies of the descendants of this graph
|
||||
*/
|
||||
private deepDependencies;
|
||||
/**
|
||||
* Return all non-Graph nodes
|
||||
*/
|
||||
allLeaves(): GraphNodeCollection<A>;
|
||||
}
|
||||
/**
|
||||
* A collection of graph nodes
|
||||
*/
|
||||
export declare class GraphNodeCollection<A> {
|
||||
readonly nodes: GraphNode<A>[];
|
||||
constructor(nodes: Iterable<GraphNode<A>>);
|
||||
/**
|
||||
* Add one or more dependencies to all nodes in the collection
|
||||
*/
|
||||
dependOn(...dependencies: Array<GraphNode<A> | undefined>): void;
|
||||
/**
|
||||
* Return the topographically first node in the collection
|
||||
*/
|
||||
first(): GraphNode<A>;
|
||||
/**
|
||||
* Returns the graph node that's shared between these nodes
|
||||
*/
|
||||
commonAncestor(): GraphNode<A>;
|
||||
toString(): string;
|
||||
}
|
||||
export declare function isGraph<A>(x: GraphNode<A>): x is Graph<A>;
|
||||
4
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/graph.js
generated
vendored
Normal file
4
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/graph.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.GraphNodeCollection=exports.Graph=exports.DependencyBuilders=exports.DependencyBuilder=exports.GraphNode=void 0,exports.isGraph=isGraph;var toposort_1=()=>{var tmp=require("./toposort");return toposort_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},javascript_1=()=>{var tmp=require("../private/javascript");return javascript_1=()=>tmp,tmp};class GraphNode{id;static of(id,data,displayName){return new GraphNode(id,{data,displayName})}dependencies=[];data;displayName;_parentGraph;constructor(id,props={}){this.id=id,this.displayName=props.displayName,this.data=props.data}get uniqueId(){return this.ancestorPath(this.root).map(x=>x.id).join("-")}get allDeps(){const fromParent=this.parentGraph?.allDeps??[];return Array.from(new Set([...this.dependencies,...fromParent]))}dependOn(...dependencies){if(dependencies.includes(this))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotAddDependencySelf`,`Cannot add dependency on self: ${this}`);this.dependencies.push(...dependencies.filter(javascript_1().isDefined))}ancestorPath(upTo){let x=this;const ret=[x];for(;x.parentGraph&&x.parentGraph!==upTo;)x=x.parentGraph,ret.unshift(x);return ret}rootPath(){let x=this;const ret=[x];for(;x.parentGraph;)x=x.parentGraph,ret.unshift(x);return ret}get root(){let x=this;for(;x.parentGraph;)x=x.parentGraph;return x}get rootGraph(){const root=this.root;if(!(root instanceof Graph))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ExpectingGraphRoot`,`Expecting a graph as root, got: ${root}`);return root}get parentGraph(){return this._parentGraph}_setParentGraph(parentGraph){if(this._parentGraph)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`NodeAlreadyParent`,"Node already has a parent");this._parentGraph=parentGraph}toString(){return`${this.constructor.name}(${this.id})`}}exports.GraphNode=GraphNode;class DependencyBuilder{_producers=[];_consumers=[];dependOn(...targets){for(const target of targets){for(const source of this._consumers)source.dependOn(target);this._producers.push(target)}return this}dependBy(...sources){for(const source of sources){for(const target of this._producers)source.dependOn(target);this._consumers.push(source)}return this}get hasUnsatisfiedConsumers(){return this._consumers.length>0&&this._producers.length===0}get consumers(){return this._consumers}consumersAsString(){return this.consumers.map(c=>`${c}`).join(",")}}exports.DependencyBuilder=DependencyBuilder;class DependencyBuilders{builders=new Map;for(key){const b=this.builders.get(key);if(b)return b;const ret=new DependencyBuilder;return this.builders.set(key,ret),ret}get(key){return this.for(key)}unsatisfiedBuilders(){const ret=new Array;for(const[k,builder]of this.builders.entries())builder.hasUnsatisfiedConsumers&&ret.push([k,builder]);return ret}}exports.DependencyBuilders=DependencyBuilders;class Graph extends GraphNode{static of(id,data,displayNameOrNodes,displayName){const nodes=Array.isArray(displayNameOrNodes)?displayNameOrNodes:void 0,displayName_=Array.isArray(displayNameOrNodes)?displayName:displayNameOrNodes;return new Graph(id,{data,nodes,displayName:displayName_})}children=new Map;constructor(name,props={}){super(name,props),props.nodes&&this.add(...props.nodes)}get nodes(){return new Set(this.children.values())}tryGetChild(name){return this.children.get(name)}containsId(id){return this.tryGetChild(id)!==void 0}contains(node){return this.nodes.has(node)}add(...nodes){for(const node of nodes){if(this.children.has(node.id))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`NodeDuplicate`,`Node with duplicate id: ${node.id}`);node._setParentGraph(this),this.children.set(node.id,node)}}absorb(other){this.add(...other.nodes)}sortedChildren(fail=!0){const nodes=this.nodes,projectedDependencies=projectDependencies(this.deepDependencies(),node=>{for(;!nodes.has(node)&&node.parentGraph;)node=node.parentGraph;return nodes.has(node)?[node]:[]});return(0,toposort_1().topoSort)(nodes,projectedDependencies,fail)}sortedLeaves(){const descendantsMap=new Map;findDescendants(this);function findDescendants(node){const ret=[];if(node instanceof Graph)for(const child of node.nodes)ret.push(...findDescendants(child));else ret.push(node);return descendantsMap.set(node,ret),ret}const projectedDependencies=projectDependencies(this.deepDependencies(),node=>descendantsMap.get(node)??[]);return(0,toposort_1().topoSort)(new Set(projectedDependencies.keys()),projectedDependencies)}render(){const lines=new Array;return recurse(this,"",!0),lines.join(`
|
||||
`);function recurse(x,indent,last){const bullet=last?"\u2514\u2500":"\u251C\u2500",follow=last?" ":"\u2502 ";if(lines.push(`${indent} ${bullet} ${x}${depString(x)}`),x instanceof Graph){let i=0;const sortedNodes=Array.prototype.concat.call([],...x.sortedChildren(!1));for(const child of sortedNodes)recurse(child,`${indent} ${follow} `,i++==x.nodes.size-1)}}function depString(node){return node.dependencies.length>0?` -> ${Array.from(node.dependencies).join(", ")}`:""}}renderDot(){const lines=new Array;lines.push("digraph G {"),lines.push(' # Arrows represent an "unlocks" relationship (opposite of dependency). So chosen'),lines.push(" # because the layout looks more natural that way."),lines.push(" # To represent subgraph dependencies, subgraphs are represented by BEGIN/END nodes."),lines.push(" # To render: `dot -Tsvg input.dot > graph.svg`, open in a browser."),lines.push(' node [shape="box"];');for(const child of this.nodes)recurse(child);return lines.push("}"),lines.join(`
|
||||
`);function recurse(node){let dependencySource;node instanceof Graph?(lines.push(`${graphBegin(node)} [shape="cds", style="filled", fillcolor="#b7deff"];`),lines.push(`${graphEnd(node)} [shape="cds", style="filled", fillcolor="#b7deff"];`),dependencySource=graphBegin(node)):(dependencySource=nodeLabel(node),lines.push(`${nodeLabel(node)};`));for(const dep of node.dependencies){const dst=dep instanceof Graph?graphEnd(dep):nodeLabel(dep);lines.push(`${dst} -> ${dependencySource};`)}if(node instanceof Graph&&node.nodes.size>0){for(const child of node.nodes)recurse(child);const sortedChildren=node.sortedChildren(!1);for(const first of sortedChildren[0]){const src=first instanceof Graph?graphBegin(first):nodeLabel(first);lines.push(`${graphBegin(node)} -> ${src};`)}for(const last of sortedChildren[sortedChildren.length-1]){const dst=last instanceof Graph?graphEnd(last):nodeLabel(last);lines.push(`${dst} -> ${graphEnd(node)};`)}}}function id(node){return node.rootPath().slice(1).map(n=>n.id).join(".")}function nodeLabel(node){return`"${id(node)}"`}function graphBegin(node){return`"BEGIN ${id(node)}"`}function graphEnd(node){return`"END ${id(node)}"`}}consoleLog(_indent=0){process.stdout.write(this.render()+`
|
||||
`)}deepDependencies(){const ret=new Map;for(const node of this.nodes)recurse(node);return ret;function recurse(node){let deps=ret.get(node);deps||ret.set(node,deps=new Set);for(let dep of node.dependencies)deps.add(dep);if(node instanceof Graph)for(const child of node.nodes)recurse(child)}}allLeaves(){const ret=[];return recurse(this),new GraphNodeCollection(ret);function recurse(node){if(node instanceof Graph)for(const child of node.nodes)recurse(child);else ret.push(node)}}}exports.Graph=Graph;class GraphNodeCollection{nodes;constructor(nodes){this.nodes=Array.from(nodes)}dependOn(...dependencies){for(const node of this.nodes)node.dependOn(...dependencies.filter(javascript_1().isDefined))}first(){const nodes=new Set(this.nodes),sorted=this.nodes[0].rootGraph.sortedLeaves();for(const tranche of sorted)for(const node of tranche)if(nodes.has(node))return node;throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CouldCalculateFirstNode`,`Could not calculate first node between ${this}`)}commonAncestor(){const paths=new Array;for(const x of this.nodes)paths.push(x.rootPath());if(paths.length===0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotFindCommonAncestorEmpty`,"Cannot find common ancestor between an empty set of nodes");if(paths.length===1){const path=paths[0];if(path.length<2)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotFindAncestorNodeWithout`,`Cannot find ancestor of node without ancestor: ${path[0]}`);return path[path.length-2]}const originalPaths=[...paths];for(;paths.every(path=>paths[0].length>=2&&path.length>=2&&path[1]===paths[0][1]);)for(const path of paths)path.shift();if(paths.some(path=>path.length<2))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CouldDetermineSharedParent`,`Could not determine a shared parent between nodes: ${originalPaths.map(nodes=>nodes.map(n=>n.id).join("/"))}`);return paths[0][0]}toString(){return this.nodes.map(n=>`${n}`).join(", ")}}exports.GraphNodeCollection=GraphNodeCollection;function projectDependencies(dependencies,project){for(const node of dependencies.keys()){const projectedNodes=project(node);if(projectedNodes.length===1&&projectedNodes[0]===node)continue;const deps=(0,javascript_1().extract)(dependencies,node);for(const projectedNode of projectedNodes)(0,javascript_1().addAll)(dependencies.get(projectedNode),deps)}for(const[node,deps]of dependencies.entries()){const depset=new Set((0,javascript_1().flatMap)(deps,project));depset.delete(node),dependencies.set(node,depset)}return dependencies}function isGraph(x){return x instanceof Graph}
|
||||
3
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/index.d.ts
generated
vendored
Normal file
3
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './pipeline-graph';
|
||||
export * from './graph';
|
||||
export * from './step-output';
|
||||
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/index.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";var __createBinding=exports&&exports.__createBinding||(Object.create?(function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc)}):(function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k]})),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p)};Object.defineProperty(exports,"__esModule",{value:!0});var _noFold;exports.PipelineGraph=void 0,Object.defineProperty(exports,_noFold="PipelineGraph",{enumerable:!0,configurable:!0,get:()=>{var value=require("./pipeline-graph").PipelineGraph;return Object.defineProperty(exports,_noFold="PipelineGraph",{enumerable:!0,configurable:!0,value}),value}}),exports.GraphNode=void 0,Object.defineProperty(exports,_noFold="GraphNode",{enumerable:!0,configurable:!0,get:()=>{var value=require("./graph").GraphNode;return Object.defineProperty(exports,_noFold="GraphNode",{enumerable:!0,configurable:!0,value}),value}}),exports.DependencyBuilder=void 0,Object.defineProperty(exports,_noFold="DependencyBuilder",{enumerable:!0,configurable:!0,get:()=>{var value=require("./graph").DependencyBuilder;return Object.defineProperty(exports,_noFold="DependencyBuilder",{enumerable:!0,configurable:!0,value}),value}}),exports.DependencyBuilders=void 0,Object.defineProperty(exports,_noFold="DependencyBuilders",{enumerable:!0,configurable:!0,get:()=>{var value=require("./graph").DependencyBuilders;return Object.defineProperty(exports,_noFold="DependencyBuilders",{enumerable:!0,configurable:!0,value}),value}}),exports.Graph=void 0,Object.defineProperty(exports,_noFold="Graph",{enumerable:!0,configurable:!0,get:()=>{var value=require("./graph").Graph;return Object.defineProperty(exports,_noFold="Graph",{enumerable:!0,configurable:!0,value}),value}}),exports.GraphNodeCollection=void 0,Object.defineProperty(exports,_noFold="GraphNodeCollection",{enumerable:!0,configurable:!0,get:()=>{var value=require("./graph").GraphNodeCollection;return Object.defineProperty(exports,_noFold="GraphNodeCollection",{enumerable:!0,configurable:!0,value}),value}}),exports.isGraph=void 0,Object.defineProperty(exports,_noFold="isGraph",{enumerable:!0,configurable:!0,get:()=>{var value=require("./graph").isGraph;return Object.defineProperty(exports,_noFold="isGraph",{enumerable:!0,configurable:!0,value}),value}}),exports.StepOutput=void 0,Object.defineProperty(exports,_noFold="StepOutput",{enumerable:!0,configurable:!0,get:()=>{var value=require("./step-output").StepOutput;return Object.defineProperty(exports,_noFold="StepOutput",{enumerable:!0,configurable:!0,value}),value}});
|
||||
130
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-graph.d.ts
generated
vendored
Normal file
130
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-graph.d.ts
generated
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
import { Graph, GraphNode } from './graph';
|
||||
import { PipelineQueries } from './pipeline-queries';
|
||||
import type { FileSet, StackAsset, StackDeployment } from '../blueprint';
|
||||
import { Step } from '../blueprint';
|
||||
import type { PipelineBase } from '../main/pipeline-base';
|
||||
export interface PipelineGraphProps {
|
||||
/**
|
||||
* Add a self-mutation step.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly selfMutation?: boolean;
|
||||
/**
|
||||
* Publishes the template asset to S3.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly publishTemplate?: boolean;
|
||||
/**
|
||||
* Whether to combine asset publishers for the same type into one step
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly singlePublisherPerAssetType?: boolean;
|
||||
/**
|
||||
* Add a "prepare" step for each stack which can be used to create the change
|
||||
* set. If this is disabled, only the "execute" step will be included.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly prepareStep?: boolean;
|
||||
}
|
||||
/**
|
||||
* Logic to turn the deployment blueprint into a graph
|
||||
*
|
||||
* This code makes all the decisions on how to lay out the CodePipeline
|
||||
*/
|
||||
export declare class PipelineGraph {
|
||||
readonly pipeline: PipelineBase;
|
||||
/**
|
||||
* A Step object that may be used as the producer of FileSets that should not be represented in the graph
|
||||
*/
|
||||
static readonly NO_STEP: Step;
|
||||
readonly graph: AGraph;
|
||||
readonly cloudAssemblyFileSet: FileSet;
|
||||
readonly queries: PipelineQueries;
|
||||
private readonly added;
|
||||
private readonly assetNodes;
|
||||
private readonly assetNodesByType;
|
||||
private readonly synthNode?;
|
||||
private readonly selfMutateNode?;
|
||||
private readonly stackOutputDependencies;
|
||||
/** Mapping steps to depbuilders, satisfied by the step itself */
|
||||
private readonly nodeDependencies;
|
||||
private readonly publishTemplate;
|
||||
private readonly prepareStep;
|
||||
private readonly singlePublisher;
|
||||
private lastPreparationNode?;
|
||||
private _fileAssetCtr;
|
||||
private _dockerAssetCtr;
|
||||
constructor(pipeline: PipelineBase, props?: PipelineGraphProps);
|
||||
isSynthNode(node: AGraphNode): boolean;
|
||||
private addBuildStep;
|
||||
private addWave;
|
||||
private addStage;
|
||||
private addChangeSetNode;
|
||||
private addPrePost;
|
||||
private topLevelGraph;
|
||||
/**
|
||||
* Add a Node to a Graph for a given Step
|
||||
*
|
||||
* Adds all dependencies for that Node to the same Step as well.
|
||||
*/
|
||||
private addStepNode;
|
||||
/**
|
||||
* Add dependencies that aren't in the pipeline yet
|
||||
*
|
||||
* Build steps reference as many sources (or other builds) as they want, which will be added
|
||||
* automatically. Do that here. We couldn't do it earlier, because if there were dependencies
|
||||
* between steps we didn't want to reparent those unnecessarily.
|
||||
*/
|
||||
private addMissingDependencyNodes;
|
||||
private publishAsset;
|
||||
/**
|
||||
* Simplify the stack name by removing the `Stage-` prefix if it exists.
|
||||
*/
|
||||
private simpleStackName;
|
||||
}
|
||||
type GraphAnnotation = {
|
||||
readonly type: 'group';
|
||||
} | {
|
||||
readonly type: 'stack-group';
|
||||
readonly stack: StackDeployment;
|
||||
} | {
|
||||
readonly type: 'publish-assets';
|
||||
readonly assets: StackAsset[];
|
||||
} | {
|
||||
readonly type: 'step';
|
||||
readonly step: Step;
|
||||
isBuildStep?: boolean;
|
||||
} | {
|
||||
readonly type: 'self-update';
|
||||
} | {
|
||||
readonly type: 'prepare';
|
||||
readonly stack: StackDeployment;
|
||||
} | ExecuteAnnotation | {
|
||||
readonly type: {
|
||||
error: 'you must add a default case to your switch';
|
||||
};
|
||||
};
|
||||
interface ExecuteAnnotation {
|
||||
readonly type: 'execute';
|
||||
/**
|
||||
* The stack to deploy
|
||||
*/
|
||||
readonly stack: StackDeployment;
|
||||
/**
|
||||
* Whether or not outputs should be captured
|
||||
*/
|
||||
readonly captureOutputs: boolean;
|
||||
/**
|
||||
* If this is executing a change set, or should do a direct deployment
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly withoutChangeSet?: boolean;
|
||||
}
|
||||
export type AGraphNode = GraphNode<GraphAnnotation>;
|
||||
export type AGraph = Graph<GraphAnnotation>;
|
||||
export {};
|
||||
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-graph.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-graph.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
21
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-queries.d.ts
generated
vendored
Normal file
21
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-queries.d.ts
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { StackOutputReference, StackDeployment, StackAsset, StageDeployment } from '../blueprint';
|
||||
import type { PipelineBase } from '../main/pipeline-base';
|
||||
/**
|
||||
* Answer some questions about a pipeline blueprint
|
||||
*/
|
||||
export declare class PipelineQueries {
|
||||
private readonly pipeline;
|
||||
constructor(pipeline: PipelineBase);
|
||||
/**
|
||||
* Return the names of all outputs for the given stack that are referenced in this blueprint
|
||||
*/
|
||||
stackOutputsReferenced(stack: StackDeployment): string[];
|
||||
/**
|
||||
* Find the stack deployment that is producing the given reference
|
||||
*/
|
||||
producingStack(outputReference: StackOutputReference): StackDeployment;
|
||||
/**
|
||||
* All assets referenced in all the Stacks of a StageDeployment
|
||||
*/
|
||||
assetsInStage(stage: StageDeployment): StackAsset[];
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-queries.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/pipeline-queries.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.PipelineQueries=void 0;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class PipelineQueries{pipeline;constructor(pipeline){this.pipeline=pipeline}stackOutputsReferenced(stack){const steps=new Array;for(const wave of this.pipeline.waves){steps.push(...wave.pre,...wave.post);for(const stage of wave.stages){steps.push(...stage.pre,...stage.post);for(const stackDeployment of stage.stacks)steps.push(...stackDeployment.pre,...stackDeployment.changeSet,...stackDeployment.post)}}const ret=new Array;for(const step of steps)for(const outputRef of step.consumedStackOutputs)outputRef.isProducedBy(stack)&&ret.push(outputRef.outputName);return ret}producingStack(outputReference){for(const wave of this.pipeline.waves)for(const stage of wave.stages)for(const stack of stage.stacks)if(outputReference.isProducedBy(stack))return stack;throw new(core_1()).ValidationError((0,literal_string_1().lit)`StackProducingOutputPipeline`,`Stack '${outputReference.stackDescription}' (producing output '${outputReference.outputName}') is not in the pipeline; call 'addStage()' to add the stack's Stage to the pipeline`,this.pipeline)}assetsInStage(stage){const assets=new Map;for(const stack of stage.stacks)for(const asset of stack.assets)assets.set(asset.assetSelector,asset);return Array.from(assets.values())}}exports.PipelineQueries=PipelineQueries;
|
||||
67
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/step-output.d.ts
generated
vendored
Normal file
67
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/step-output.d.ts
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
import type { IResolvable, IResolveContext } from '../../../core';
|
||||
import type { Step } from '../blueprint/step';
|
||||
/**
|
||||
* A symbolic reference to a value produced by another step
|
||||
*
|
||||
* Generating and consuming outputs is engine-specific. Many engines will be
|
||||
* able to support a feature like "outputs", but it's not guaranteed that
|
||||
* all of them will.
|
||||
*
|
||||
* Outputs can only be generated by engine-specific steps (CodeBuildStep instead
|
||||
* of ShellStep, etc), but can (currently) be consumed anywhere(*). When
|
||||
* an engine-specific step generates an Output, it should put a well-known
|
||||
* string and arbitrary data that is useful to the engine into the engine-specific
|
||||
* fields on the StepOutput.
|
||||
*
|
||||
* The graph blueprint will take care of dependencies and ordering, the engine
|
||||
* is responsible interpreting and rendering StepOutputs. The engine should call
|
||||
* `defineResolution()` on all outputs.
|
||||
*
|
||||
* StepOutputs currently purposely aren't part of the public API because users
|
||||
* shouldn't see the innards poking out. So, instead of keeping state on `Step`,
|
||||
* we keep side-state here in a WeakMap which can be accessed via static members
|
||||
* on `StepOutput`.
|
||||
*
|
||||
* (*) If we need to restrict this, we add the checking and erroring in the engine.
|
||||
*/
|
||||
export declare class StepOutput implements IResolvable {
|
||||
/**
|
||||
* Return true if the given IResolvable is a StepOutput
|
||||
*/
|
||||
static isStepOutput(resolvable: IResolvable): resolvable is StepOutput;
|
||||
/**
|
||||
* Find all StepOutputs referenced in the given structure
|
||||
*/
|
||||
static findAll(structure: any): StepOutput[];
|
||||
/**
|
||||
* Return the produced outputs for the given step
|
||||
*/
|
||||
static producedStepOutputs(step: Step): StepOutput[];
|
||||
/**
|
||||
* Add produced outputs for the given step
|
||||
*/
|
||||
static recordProducer(...outputs: StepOutput[]): void;
|
||||
/**
|
||||
* The step that produces this output
|
||||
*/
|
||||
readonly step: Step;
|
||||
/**
|
||||
* Name of the engine for which this output is intended
|
||||
*/
|
||||
readonly engineName: string;
|
||||
/**
|
||||
* Additional data on the output, to be interpreted by the engine
|
||||
*/
|
||||
readonly engineSpecificInformation: any;
|
||||
readonly creationStack: string[];
|
||||
private resolution;
|
||||
constructor(step: Step, engineName: string, engineSpecificInformation: any);
|
||||
/**
|
||||
* Define the resolved value for this StepOutput.
|
||||
*
|
||||
* Should be called by the engine.
|
||||
*/
|
||||
defineResolution(value: any): void;
|
||||
resolve(context: IResolveContext): any;
|
||||
toString(): string;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/step-output.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/step-output.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StepOutput=void 0;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};const STEP_OUTPUT_SYM=Symbol.for("@aws-cdk/pipelines.StepOutput"),PRODUCED_OUTPUTS_SYM=Symbol.for("@aws-cdk/pipelines.outputs");class StepOutput{static isStepOutput(resolvable){return!!resolvable[STEP_OUTPUT_SYM]}static findAll(structure){return findAllStepOutputs(structure)}static producedStepOutputs(step){return step[PRODUCED_OUTPUTS_SYM]??[]}static recordProducer(...outputs){for(const output of outputs){const step=output.step;let list=step[PRODUCED_OUTPUTS_SYM];list||(list=[],step[PRODUCED_OUTPUTS_SYM]=list),list.push(...outputs)}}step;engineName;engineSpecificInformation;creationStack=[];resolution=void 0;constructor(step,engineName,engineSpecificInformation){this.step=step,this.engineName=engineName,this.engineSpecificInformation=engineSpecificInformation,Object.defineProperty(this,STEP_OUTPUT_SYM,{value:!0})}defineResolution(value){this.resolution=value}resolve(context){if(this.resolution===void 0)throw new(core_1()).ValidationError((0,literal_string_1().lit)`OutputStepConfigured`,`Output for step ${this.step} not configured. Either the step is not in the pipeline, the step implementation did not call 'this.discoverReferencedOutputs()', or this engine does not support Outputs for this step.`,context.scope);return this.resolution}toString(){return core_1().Token.asString(this)}}exports.StepOutput=StepOutput;function findAllStepOutputs(structure){const ret=new Set;return recurse(structure),Array.from(ret);function checkToken(x){return x&&StepOutput.isStepOutput(x)?(ret.add(x),!0):x!==void 0}function recurse(x){if(x){if(core_1().Tokenization.isResolvable(x)){checkToken(x);return}if(Array.isArray(x)){checkToken(core_1().Tokenization.reverseList(x))||x.forEach(recurse);return}if(typeof x=="number"){checkToken(core_1().Tokenization.reverseNumber(x));return}if(typeof x=="string"){core_1().Tokenization.reverseString(x).tokens.forEach(checkToken);return}if(typeof x=="object")for(const[k,v]of Object.entries(x))recurse(k),recurse(v)}}}
|
||||
3
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.d.ts
generated
vendored
Normal file
3
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
import type { GraphNode } from './graph';
|
||||
export declare function printDependencyMap<A>(dependencies: Map<GraphNode<A>, Set<GraphNode<A>>>): void;
|
||||
export declare function topoSort<A>(nodes: Set<GraphNode<A>>, dependencies: Map<GraphNode<A>, Set<GraphNode<A>>>, fail?: boolean): GraphNode<A>[][];
|
||||
2
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.js
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/pipelines/lib/helpers-internal/toposort.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.printDependencyMap=printDependencyMap,exports.topoSort=topoSort;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};function printDependencyMap(dependencies){const lines=["---"];for(const[k,vs]of dependencies.entries())lines.push(`${k} -> ${Array.from(vs)}`);console.log(lines.join(`
|
||||
`))}function topoSort(nodes,dependencies,fail=!0){const remaining=new Set(nodes),ret=[];for(;remaining.size>0;){const selectable=Array.from(remaining.values()).filter(e=>{if(!dependencies.has(e))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ValidationError`,`No key for ${e}`);return dependencies.get(e).size===0});if(selectable.sort((a,b)=>a.id<b.id?-1:b.id<a.id?1:0),selectable.length===0){const cycle=findCycle(dependencies);if(fail)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`DependencyCycleGraph`,`Dependency cycle in graph: ${cycle.map(n=>n.id).join(" => ")}`);selectable.push(cycle[0])}ret.push(selectable);for(const selected of selectable){remaining.delete(selected);for(const depSet of dependencies.values())depSet.delete(selected)}}return ret}function findCycle(deps){for(const node of deps.keys()){const cycle=recurse(node,[node]);if(cycle)return cycle}throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CycleFound`,"No cycle found. Assertion failure!");function recurse(node,path){for(const dep of deps.get(node)??[]){if(dep===path[0])return[...path,dep];const cycle=recurse(dep,[...path,dep]);if(cycle)return cycle}}}
|
||||
Reference in New Issue
Block a user