agent-claw: automated task changes
This commit is contained in:
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/conditions.d.ts
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/conditions.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Template } from './template';
|
||||
export declare function findConditions(template: Template, logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export declare function hasCondition(template: Template, logicalId: string, props: any): string | void;
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/conditions.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/conditions.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findConditions=findConditions,exports.hasCondition=hasCondition;var section_1=()=>{var tmp=require("./section");return section_1=()=>tmp,tmp};function findConditions(template,logicalId,props={}){const section=template.Conditions??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);return result.match?result.matches:{}}function hasCondition(template,logicalId,props){const section=template.Conditions??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);if(!result.match)return(0,section_1().formatSectionMatchFailure)(`conditions with logicalId ${logicalId}`,result)}
|
||||
8
cdk/node_modules/aws-cdk-lib/assertions/lib/private/cyclic.d.ts
generated
vendored
Normal file
8
cdk/node_modules/aws-cdk-lib/assertions/lib/private/cyclic.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Template } from './template';
|
||||
/**
|
||||
* Check a template for cyclic dependencies
|
||||
*
|
||||
* This will make sure that we don't happily validate templates
|
||||
* in unit tests that wouldn't deploy to CloudFormation anyway.
|
||||
*/
|
||||
export declare function checkTemplateForCyclicDependencies(template: Template): void;
|
||||
3
cdk/node_modules/aws-cdk-lib/assertions/lib/private/cyclic.js
generated
vendored
Normal file
3
cdk/node_modules/aws-cdk-lib/assertions/lib/private/cyclic.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.checkTemplateForCyclicDependencies=checkTemplateForCyclicDependencies;var error_1=()=>{var tmp=require("./error");return error_1=()=>tmp,tmp};function checkTemplateForCyclicDependencies(template){const logicalIds=new Set(Object.keys(template.Resources??{})),dependencies=new Map;for(const[logicalId,resource]of Object.entries(template.Resources??{}))dependencies.set(logicalId,intersect(findResourceDependencies(resource),logicalIds));for(;dependencies.size>0;){const free=Array.from(dependencies.entries()).filter(([_,deps])=>deps.size===0);if(free.length===0){const cycle=findCycle(dependencies),cycleResources={};for(const logicalId of cycle)cycleResources[logicalId]=template.Resources?.[logicalId];throw new(error_1()).AssertionError(`Template is undeployable, these resources have a dependency cycle: ${cycle.join(" -> ")}:
|
||||
|
||||
${JSON.stringify(cycleResources,void 0,2)}`)}for(const[logicalId,_]of free){for(const deps of dependencies.values())deps.delete(logicalId);dependencies.delete(logicalId)}}}function findResourceDependencies(res){return new Set([...toArray(res.DependsOn??[]),...findExpressionDependencies(res.Properties)])}function toArray(x){return Array.isArray(x)?x:[x]}function findExpressionDependencies(obj){const ret=new Set;return recurse(obj),ret;function recurse(x){if(x&&(Array.isArray(x)&&x.forEach(recurse),typeof x=="object")){const keys=Object.keys(x);if(keys.length===1&&keys[0]==="Ref")ret.add(x[keys[0]]);else if(keys.length===1&&keys[0]==="Fn::GetAtt")ret.add(x[keys[0]][0]);else if(keys.length===1&&keys[0]==="Fn::Sub"){const argument=x[keys[0]],pattern=Array.isArray(argument)?argument[0]:argument;if(typeof pattern=="string")for(const logId of logicalIdsInSubString(pattern))ret.add(logId);const contextDict=Array.isArray(argument)?argument[1]:void 0;contextDict&&typeof contextDict=="object"&&Object.values(contextDict).forEach(recurse)}else Object.values(x).forEach(recurse)}}}function logicalIdsInSubString(x){return analyzeSubPattern(x).flatMap(fragment=>{switch(fragment.type){case"getatt":case"ref":return[fragment.logicalId];case"literal":return[]}})}function analyzeSubPattern(pattern){const ret=[];let start=0,ph0=pattern.indexOf("${",start);for(;ph0>-1;){if(pattern[ph0+2]==="!"){start=ph0+3,ph0=pattern.indexOf("${",start);continue}const ph1=pattern.indexOf("}",ph0+2);if(ph1===-1)break;const placeholder=pattern.substring(ph0+2,ph1);if(ph0>start&&ret.push({type:"literal",content:pattern.substring(start,ph0)}),placeholder.includes(".")){const[logicalId,attr]=placeholder.split(".");ret.push({type:"getatt",logicalId,attr})}else ret.push({type:"ref",logicalId:placeholder});start=ph1+1,ph0=pattern.indexOf("${",start)}return start<pattern.length-1&&ret.push({type:"literal",content:pattern.slice(start)}),ret}function intersect(xs,ys){return new Set(Array.from(xs).filter(x=>ys.has(x)))}function findCycle(deps){for(const node of deps.keys()){const cycle=recurse(node,[node]);if(cycle)return cycle}throw new(error_1()).AssertionError("No cycle found. Assertion failure!");function recurse(node,path){for(const dep of deps.get(node)??[]){if(path.includes(dep))return[...path,dep];const cycle=recurse(dep,[...path,dep]);if(cycle)return cycle}}}
|
||||
19
cdk/node_modules/aws-cdk-lib/assertions/lib/private/error.d.ts
generated
vendored
Normal file
19
cdk/node_modules/aws-cdk-lib/assertions/lib/private/error.d.ts
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* An AssertionError is thrown from the assertions module when an assertion fails.
|
||||
* Assertion errors are directly connected to an assertion a user wrote.
|
||||
*
|
||||
* Not all errors from the assertions module are automatically AssertionErrors.
|
||||
* When a pre-condition is incorrect (e.g. disallowed use of a matcher),
|
||||
* throwing an UnscopedValidationError is more appropriate.
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
export declare class AssertionError extends Error {
|
||||
#private;
|
||||
/**
|
||||
* The time the error was thrown.
|
||||
*/
|
||||
get time(): string;
|
||||
get type(): 'assertion';
|
||||
constructor(msg: string);
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/error.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/error.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AssertionError=void 0;const ASSERTION_ERROR_SYMBOL=Symbol.for("@aws-cdk/assertions.AssertionError");class AssertionError extends Error{#time;get time(){return this.#time}get type(){return"assertion"}constructor(msg){super(msg),Object.setPrototypeOf(this,AssertionError.prototype),Object.defineProperty(this,ASSERTION_ERROR_SYMBOL,{value:!0}),this.name=new.target.name,this.#time=new Date().toISOString()}}exports.AssertionError=AssertionError;
|
||||
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/mappings.d.ts
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/mappings.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Template } from './template';
|
||||
export declare function findMappings(template: Template, logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export declare function hasMapping(template: Template, logicalId: string, props: any): string | void;
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/mappings.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/mappings.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findMappings=findMappings,exports.hasMapping=hasMapping;var section_1=()=>{var tmp=require("./section");return section_1=()=>tmp,tmp};function findMappings(template,logicalId,props={}){const section=template.Mappings??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);return result.match?result.matches:{}}function hasMapping(template,logicalId,props){const section=template.Mappings??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);if(!result.match)return(0,section_1().formatSectionMatchFailure)(`mappings with logicalId ${logicalId}`,result)}
|
||||
6
cdk/node_modules/aws-cdk-lib/assertions/lib/private/matchers/absent.d.ts
generated
vendored
Normal file
6
cdk/node_modules/aws-cdk-lib/assertions/lib/private/matchers/absent.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
import { Matcher, MatchResult } from '../../matcher';
|
||||
export declare class AbsentMatch extends Matcher {
|
||||
readonly name: string;
|
||||
constructor(name: string);
|
||||
test(actual: any): MatchResult;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/matchers/absent.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/matchers/absent.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AbsentMatch=void 0;var matcher_1=()=>{var tmp=require("../../matcher");return matcher_1=()=>tmp,tmp};class AbsentMatch extends matcher_1().Matcher{name;constructor(name){super(),this.name=name}test(actual){const result=new(matcher_1()).MatchResult(actual);return actual!==void 0&&result.recordFailure({matcher:this,path:[],message:`Received ${actual}, but key should be absent`}),result}}exports.AbsentMatch=AbsentMatch;
|
||||
4
cdk/node_modules/aws-cdk-lib/assertions/lib/private/message.d.ts
generated
vendored
Normal file
4
cdk/node_modules/aws-cdk-lib/assertions/lib/private/message.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { SynthesisMessage } from '../../../cx-api';
|
||||
export type Messages = {
|
||||
[key: string]: SynthesisMessage;
|
||||
};
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/message.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/message.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
||||
8
cdk/node_modules/aws-cdk-lib/assertions/lib/private/messages.d.ts
generated
vendored
Normal file
8
cdk/node_modules/aws-cdk-lib/assertions/lib/private/messages.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Messages } from './message';
|
||||
export declare function findMessage(messages: Messages, constructPath: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export declare function hasMessage(messages: Messages, constructPath: string, props: any): string | void;
|
||||
export declare function hasNoMessage(messages: Messages, constructPath: string, props: any): string | void;
|
||||
2
cdk/node_modules/aws-cdk-lib/assertions/lib/private/messages.js
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/assertions/lib/private/messages.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findMessage=findMessage,exports.hasMessage=hasMessage,exports.hasNoMessage=hasNoMessage;var section_1=()=>{var tmp=require("./section");return section_1=()=>tmp,tmp};function findMessage(messages,constructPath,props={}){const section=messages,result=(0,section_1().matchSection)(filterPath(section,constructPath),props);return result.match?result.matches:{}}function hasMessage(messages,constructPath,props){const section=messages,result=(0,section_1().matchSection)(filterPath(section,constructPath),props);if(!result.match){for(const mr of Object.values(result.closestResults))redactTraces(mr.target);return(0,section_1().formatSectionMatchFailure)(`messages at path ${constructPath}`,result,"Stack")}}function hasNoMessage(messages,constructPath,props){const section=messages,result=(0,section_1().matchSection)(filterPath(section,constructPath),props);if(result.match)return[`Expected no matches, but stack has ${Object.keys(result.matches).length} messages as follows:`,(0,section_1().formatAllMatches)(result.matches)].join(`
|
||||
`)}function redactTraces(match,redact=!0){redact&&match.entry?.trace!==void 0&&(match.entry.trace="redacted")}function filterPath(section,path){return path==="*"?section:Object.entries(section??{}).filter(([_,v])=>v.id===path).reduce((agg,[k,v])=>({...agg,[k]:v}),{})}
|
||||
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/outputs.d.ts
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/outputs.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Template } from './template';
|
||||
export declare function findOutputs(template: Template, logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export declare function hasOutput(template: Template, logicalId: string, props: any): string | void;
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/outputs.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/outputs.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findOutputs=findOutputs,exports.hasOutput=hasOutput;var section_1=()=>{var tmp=require("./section");return section_1=()=>tmp,tmp};function findOutputs(template,logicalId,props={}){const section=template.Outputs??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);return result.match?result.matches:{}}function hasOutput(template,logicalId,props){const section=template.Outputs??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);if(!result.match)return(0,section_1().formatSectionMatchFailure)(`outputs named ${logicalId}`,result)}
|
||||
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/parameters.d.ts
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/parameters.d.ts
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { Template } from './template';
|
||||
export declare function findParameters(template: Template, logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export declare function hasParameter(template: Template, logicalId: string, props: any): string | void;
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/parameters.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/parameters.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findParameters=findParameters,exports.hasParameter=hasParameter;var section_1=()=>{var tmp=require("./section");return section_1=()=>tmp,tmp};function findParameters(template,logicalId,props={}){const section=template.Parameters??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);return result.match?result.matches:{}}function hasParameter(template,logicalId,props){const section=template.Parameters??{},result=(0,section_1().matchSection)((0,section_1().filterLogicalId)(section,logicalId),props);if(!result.match)return(0,section_1().formatSectionMatchFailure)(`parameters with logicalId '${logicalId}'`,result)}
|
||||
16
cdk/node_modules/aws-cdk-lib/assertions/lib/private/resources.d.ts
generated
vendored
Normal file
16
cdk/node_modules/aws-cdk-lib/assertions/lib/private/resources.d.ts
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { Template } from './template';
|
||||
export declare function findResources(template: Template, type: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
export declare function getResourceId(template: Template, type: string, props?: any): {
|
||||
resourceId?: string;
|
||||
matchError?: string;
|
||||
};
|
||||
export declare function allResources(template: Template, type: string, props: any): string | void;
|
||||
export declare function allResourcesProperties(template: Template, type: string, props: any): string | void;
|
||||
export declare function hasResource(template: Template, type: string, props: any): string | void;
|
||||
export declare function hasResourceProperties(template: Template, type: string, props: any): string | void;
|
||||
export declare function countResources(template: Template, type: string): number;
|
||||
export declare function countResourcesProperties(template: Template, type: string, props: any): number;
|
||||
4
cdk/node_modules/aws-cdk-lib/assertions/lib/private/resources.js
generated
vendored
Normal file
4
cdk/node_modules/aws-cdk-lib/assertions/lib/private/resources.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findResources=findResources,exports.getResourceId=getResourceId,exports.allResources=allResources,exports.allResourcesProperties=allResourcesProperties,exports.hasResource=hasResource,exports.hasResourceProperties=hasResourceProperties,exports.countResources=countResources,exports.countResourcesProperties=countResourcesProperties;var __1=()=>{var tmp=require("..");return __1=()=>tmp,tmp},absent_1=()=>{var tmp=require("./matchers/absent");return absent_1=()=>tmp,tmp},section_1=()=>{var tmp=require("./section");return section_1=()=>tmp,tmp};function findResources(template,type,props={}){const section=template.Resources??{},result=(0,section_1().matchSection)(filterType(section,type),props);return result.match?result.matches:{}}function getResourceId(template,type,props={}){const section=template.Resources??{},result=(0,section_1().matchSection)(filterType(section,type),props);if(!result.match)return{matchError:(0,section_1().formatSectionMatchFailure)(`resources with type ${type}`,result)};const resourceIds=Object.keys(result.matches);return resourceIds.length!==1?{matchError:[`Template has ${resourceIds.length} matches, expected only one.`,(0,section_1().formatAllMatches)(result.matches)].join(`
|
||||
`)}:{resourceId:resourceIds[0]}}function allResources(template,type,props){const section=template.Resources??{},result=(0,section_1().matchSection)(filterType(section,type),props);if(result.match){const matchCount=Object.keys(result.matches).length;if(result.analyzedCount>matchCount)return[`Template has ${result.analyzedCount} resource(s) with type ${type}, but only ${matchCount} match as expected.`,(0,section_1().formatAllMismatches)(result.analyzed,result.matches)].join(`
|
||||
`)}else return[`Template has ${result.analyzedCount} resource(s) with type ${type}, but none match as expected.`,(0,section_1().formatAllMismatches)(result.analyzed)].join(`
|
||||
`)}function allResourcesProperties(template,type,props){let amended=template;return(!__1().Matcher.isMatcher(props)||!(props instanceof absent_1().AbsentMatch))&&(amended=JSON.parse(JSON.stringify(template)),amended=addEmptyProperties(amended)),allResources(amended,type,__1().Match.objectLike({Properties:props}))}function hasResource(template,type,props){const section=template.Resources??{},result=(0,section_1().matchSection)(filterType(section,type),props);if(!result.match)return(0,section_1().formatSectionMatchFailure)(`resources with type ${type}`,result)}function hasResourceProperties(template,type,props){let amended=template;return(!__1().Matcher.isMatcher(props)||!(props instanceof absent_1().AbsentMatch))&&(amended=JSON.parse(JSON.stringify(template)),amended=addEmptyProperties(amended)),hasResource(amended,type,__1().Match.objectLike({Properties:props}))}function countResources(template,type){const section=template.Resources??{},types=filterType(section,type);return Object.entries(types).length}function countResourcesProperties(template,type,props){let amended=template;(!__1().Matcher.isMatcher(props)||!(props instanceof absent_1().AbsentMatch))&&(amended=JSON.parse(JSON.stringify(template)),amended=addEmptyProperties(amended));const section=amended.Resources??{},result=(0,section_1().matchSection)(filterType(section,type),__1().Match.objectLike({Properties:props}));return result.match?Object.keys(result.matches).length:0}function addEmptyProperties(template){let section=template.Resources??{};return Object.keys(section).map(key=>{section[key].hasOwnProperty("Properties")||(section[key].Properties={})}),template}function filterType(section,type){return Object.entries(section??{}).filter(([_,v])=>v.Type===type).reduce((agg,[k,v])=>({...agg,[k]:v}),{})}
|
||||
35
cdk/node_modules/aws-cdk-lib/assertions/lib/private/section.d.ts
generated
vendored
Normal file
35
cdk/node_modules/aws-cdk-lib/assertions/lib/private/section.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { MatchResult } from '../matcher';
|
||||
export type MatchSuccess = {
|
||||
match: true;
|
||||
matches: {
|
||||
[key: string]: any;
|
||||
};
|
||||
analyzed: {
|
||||
[key: string]: any;
|
||||
};
|
||||
analyzedCount: number;
|
||||
};
|
||||
export type MatchFailure = {
|
||||
match: false;
|
||||
closestResults: Record<string, MatchResult>;
|
||||
analyzed: {
|
||||
[key: string]: any;
|
||||
};
|
||||
analyzedCount: number;
|
||||
};
|
||||
export declare function matchSection(section: any, props: any): MatchSuccess | MatchFailure;
|
||||
export declare function formatAllMatches(matches: {
|
||||
[key: string]: any;
|
||||
}): string;
|
||||
export declare function formatAllMismatches(analyzed: {
|
||||
[key: string]: any;
|
||||
}, matches?: {
|
||||
[key: string]: any;
|
||||
}): string;
|
||||
export declare function formatSectionMatchFailure(qualifier: string, result: MatchFailure, what?: string): string;
|
||||
export declare function formatFailure(closestResults: Record<string, MatchResult>): string;
|
||||
export declare function filterLogicalId(section: {
|
||||
[key: string]: {};
|
||||
}, logicalId: string): {
|
||||
[key: string]: {};
|
||||
};
|
||||
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/section.js
generated
vendored
Normal file
7
cdk/node_modules/aws-cdk-lib/assertions/lib/private/section.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.matchSection=matchSection,exports.formatAllMatches=formatAllMatches,exports.formatAllMismatches=formatAllMismatches,exports.formatSectionMatchFailure=formatSectionMatchFailure,exports.formatFailure=formatFailure,exports.filterLogicalId=filterLogicalId;var sorting_1=()=>{var tmp=require("./sorting");return sorting_1=()=>tmp,tmp},match_1=()=>{var tmp=require("../match");return match_1=()=>tmp,tmp},matcher_1=()=>{var tmp=require("../matcher");return matcher_1=()=>tmp,tmp};function matchSection(section,props){const matcher=matcher_1().Matcher.isMatcher(props)?props:match_1().Match.objectLike(props),matching={},analyzed={},failures=new Array;return eachEntryInSection(section,(logicalId,entry)=>{analyzed[logicalId]=entry;const result=matcher.test(entry);result.finished(),result.hasFailed()?failures.push([logicalId,result]):matching[logicalId]=entry}),Object.keys(matching).length>0?{match:!0,matches:matching,analyzedCount:Object.keys(analyzed).length,analyzed}:(failures.sort((0,sorting_1().sortKeyComparator)(([logicalId,result])=>[result.failCost,logicalId])),{match:!1,closestResults:Object.fromEntries(failures.slice(0,3)),analyzedCount:Object.keys(analyzed).length,analyzed})}function eachEntryInSection(section,cb){for(const logicalId of Object.keys(section??{})){const resource=section[logicalId];cb(logicalId,resource)}}function formatAllMatches(matches){return[leftPad(JSON.stringify(matches,void 0,2))].join(`
|
||||
`)}function formatAllMismatches(analyzed,matches={}){return["The following resources do not match the given definition:",...Object.keys(analyzed).filter(id=>!(id in matches)).map(id=>` ${id}`)].join(`
|
||||
`)}function formatSectionMatchFailure(qualifier,result,what="Template"){return[`${what} has ${result.analyzedCount} ${qualifier}`,result.analyzedCount>0?", but none match as expected":"",`.
|
||||
`,formatFailure(result.closestResults)].join("")}function formatFailure(closestResults){const keys=Object.keys(closestResults);return keys.length===0?"No matches found":[`The ${keys.length} closest matches:`,...keys.map(key=>`${key} :: ${closestResults[key].renderMismatch()}`)].join(`
|
||||
`)}function leftPad(x,indent=2){const pad=" ".repeat(indent);return pad+x.split(`
|
||||
`).join(`
|
||||
${pad}`)}function filterLogicalId(section,logicalId){return logicalId==="*"?section:Object.entries(section??{}).filter(([k,_])=>k===logicalId).reduce((agg,[k,v])=>({...agg,[k]:v}),{})}
|
||||
4
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sorting.d.ts
generated
vendored
Normal file
4
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sorting.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Make a sorting comparator that will sort by a given sort key
|
||||
*/
|
||||
export declare function sortKeyComparator<A>(keyFn: (x: A) => Array<string | number>): (a: A, b: A) => number;
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sorting.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sorting.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.sortKeyComparator=sortKeyComparator;function sortKeyComparator(keyFn){return(a,b)=>{const ak=keyFn(a),bk=keyFn(b);for(let i=0;i<ak.length&&i<bk.length;i++){const av=ak[i],bv=bk[i];let diff=0;if(typeof av=="number"&&typeof bv=="number"?diff=av-bv:typeof av=="string"&&typeof bv=="string"&&(diff=av.localeCompare(bv)),diff!==0)return diff}return bk.length-ak.length}}
|
||||
6
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sparse-matrix.d.ts
generated
vendored
Normal file
6
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sparse-matrix.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare class SparseMatrix<A> {
|
||||
private readonly matrix;
|
||||
get(row: number, col: number): A | undefined;
|
||||
row(row: number): Array<[number, A]>;
|
||||
set(row: number, col: number, value: A): void;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sparse-matrix.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/sparse-matrix.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SparseMatrix=void 0;class SparseMatrix{matrix=new Map;get(row,col){return this.matrix.get(row)?.get(col)}row(row){return Array.from(this.matrix.get(row)?.entries()??[])}set(row,col,value){let r=this.matrix.get(row);r||(r=new Map,this.matrix.set(row,r)),r.set(col,value)}}exports.SparseMatrix=SparseMatrix;
|
||||
38
cdk/node_modules/aws-cdk-lib/assertions/lib/private/template.d.ts
generated
vendored
Normal file
38
cdk/node_modules/aws-cdk-lib/assertions/lib/private/template.d.ts
generated
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
export type Template = {
|
||||
Resources?: {
|
||||
[logicalId: string]: Resource;
|
||||
};
|
||||
Outputs?: {
|
||||
[logicalId: string]: Output;
|
||||
};
|
||||
Mappings?: {
|
||||
[logicalId: string]: Mapping;
|
||||
};
|
||||
Parameters?: {
|
||||
[logicalId: string]: Parameter;
|
||||
};
|
||||
Conditions?: {
|
||||
[logicalId: string]: Condition;
|
||||
};
|
||||
};
|
||||
export type Resource = {
|
||||
Type: string;
|
||||
DependsOn?: string | string[];
|
||||
Properties?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
[key: string]: any;
|
||||
};
|
||||
export type Output = {
|
||||
[key: string]: any;
|
||||
};
|
||||
export type Mapping = {
|
||||
[key: string]: any;
|
||||
};
|
||||
export type Parameter = {
|
||||
Type: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
export type Condition = {
|
||||
[key: string]: any;
|
||||
};
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/template.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/template.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});
|
||||
2
cdk/node_modules/aws-cdk-lib/assertions/lib/private/type.d.ts
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/assertions/lib/private/type.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export type Type = 'string' | 'number' | 'bigint' | 'boolean' | 'symbol' | 'undefined' | 'object' | 'function' | 'array';
|
||||
export declare function getType(obj: any): Type;
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/type.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/private/type.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getType=getType;function getType(obj){return Array.isArray(obj)?"array":typeof obj}
|
||||
Reference in New Issue
Block a user