agent-claw: automated task changes
This commit is contained in:
78
cdk/node_modules/aws-cdk-lib/assertions/lib/annotations.d.ts
generated
vendored
Normal file
78
cdk/node_modules/aws-cdk-lib/assertions/lib/annotations.d.ts
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
import type { Stack } from '../../core';
|
||||
import type { SynthesisMessage } from '../../cx-api';
|
||||
/**
|
||||
* Suite of assertions that can be run on a CDK Stack.
|
||||
* Focused on asserting annotations.
|
||||
*/
|
||||
export declare class Annotations {
|
||||
/**
|
||||
* Base your assertions on the messages returned by a synthesized CDK `Stack`.
|
||||
* @param stack the CDK Stack to run assertions on
|
||||
*/
|
||||
static fromStack(stack: Stack): Annotations;
|
||||
private readonly _messages;
|
||||
private constructor();
|
||||
/**
|
||||
* Assert that an error with the given message exists in the synthesized CDK `Stack`.
|
||||
*
|
||||
* @param constructPath the construct path to the error, provide `'*'` to match all errors in the template.
|
||||
* @param message the error message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
hasError(constructPath: string, message: any): void;
|
||||
/**
|
||||
* Assert that an error with the given message does not exist in the synthesized CDK `Stack`.
|
||||
*
|
||||
* @param constructPath the construct path to the error, provide `'*'` to match all errors in the template.
|
||||
* @param message the error message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
hasNoError(constructPath: string, message: any): void;
|
||||
/**
|
||||
* Get the set of matching errors of a given construct path and message.
|
||||
*
|
||||
* @param constructPath the construct path to the error, provide `'*'` to match all errors in the template.
|
||||
* @param message the error message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
findError(constructPath: string, message: any): SynthesisMessage[];
|
||||
/**
|
||||
* Assert that an warning with the given message exists in the synthesized CDK `Stack`.
|
||||
*
|
||||
* @param constructPath the construct path to the warning, provide `'*'` to match all warnings in the template.
|
||||
* @param message the warning message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
hasWarning(constructPath: string, message: any): void;
|
||||
/**
|
||||
* Assert that an warning with the given message does not exist in the synthesized CDK `Stack`.
|
||||
*
|
||||
* @param constructPath the construct path to the warning, provide `'*'` to match all warnings in the template.
|
||||
* @param message the warning message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
hasNoWarning(constructPath: string, message: any): void;
|
||||
/**
|
||||
* Get the set of matching warning of a given construct path and message.
|
||||
*
|
||||
* @param constructPath the construct path to the warning, provide `'*'` to match all warnings in the template.
|
||||
* @param message the warning message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
findWarning(constructPath: string, message: any): SynthesisMessage[];
|
||||
/**
|
||||
* Assert that an info with the given message exists in the synthesized CDK `Stack`.
|
||||
*
|
||||
* @param constructPath the construct path to the info, provide `'*'` to match all info in the template.
|
||||
* @param message the info message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
hasInfo(constructPath: string, message: any): void;
|
||||
/**
|
||||
* Assert that an info with the given message does not exist in the synthesized CDK `Stack`.
|
||||
*
|
||||
* @param constructPath the construct path to the info, provide `'*'` to match all info in the template.
|
||||
* @param message the info message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
hasNoInfo(constructPath: string, message: any): void;
|
||||
/**
|
||||
* Get the set of matching infos of a given construct path and message.
|
||||
*
|
||||
* @param constructPath the construct path to the info, provide `'*'` to match all infos in the template.
|
||||
* @param message the info message as should be expected. This should be a string or Matcher object.
|
||||
*/
|
||||
findInfo(constructPath: string, message: any): SynthesisMessage[];
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/annotations.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/annotations.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Annotations=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var messages_1=()=>{var tmp=require("./private/messages");return messages_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},error_1=()=>{var tmp=require("./private/error");return error_1=()=>tmp,tmp};class Annotations{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.assertions.Annotations",version:"2.252.0"};static fromStack(stack){try{jsiiDeprecationWarnings().aws_cdk_lib_Stack(stack)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromStack),error}return new Annotations(toMessages(stack))}_messages;constructor(messages){this._messages=convertArrayToMessagesType(messages)}hasError(constructPath,message){const matchError=(0,messages_1().hasMessage)(this._messages,constructPath,constructMessage("error",message));if(matchError)throw new(error_1()).AssertionError(matchError)}hasNoError(constructPath,message){const matchError=(0,messages_1().hasNoMessage)(this._messages,constructPath,constructMessage("error",message));if(matchError)throw new(error_1()).AssertionError(matchError)}findError(constructPath,message){return convertMessagesTypeToArray((0,messages_1().findMessage)(this._messages,constructPath,constructMessage("error",message)))}hasWarning(constructPath,message){const matchError=(0,messages_1().hasMessage)(this._messages,constructPath,constructMessage("warning",message));if(matchError)throw new(error_1()).AssertionError(matchError)}hasNoWarning(constructPath,message){const matchError=(0,messages_1().hasNoMessage)(this._messages,constructPath,constructMessage("warning",message));if(matchError)throw new(error_1()).AssertionError(matchError)}findWarning(constructPath,message){return convertMessagesTypeToArray((0,messages_1().findMessage)(this._messages,constructPath,constructMessage("warning",message)))}hasInfo(constructPath,message){const matchError=(0,messages_1().hasMessage)(this._messages,constructPath,constructMessage("info",message));if(matchError)throw new(error_1()).AssertionError(matchError)}hasNoInfo(constructPath,message){const matchError=(0,messages_1().hasNoMessage)(this._messages,constructPath,constructMessage("info",message));if(matchError)throw new(error_1()).AssertionError(matchError)}findInfo(constructPath,message){return convertMessagesTypeToArray((0,messages_1().findMessage)(this._messages,constructPath,constructMessage("info",message)))}}exports.Annotations=Annotations;function constructMessage(type,message){return{level:type,entry:{data:message}}}function convertArrayToMessagesType(messages){return messages.reduce((obj,item,index)=>({...obj,[index]:item}),{})}function convertMessagesTypeToArray(messages){return Object.values(messages)}function toMessages(stack){const root=stack.node.root;if(!core_1().Stage.isStage(root))throw new(error_1()).AssertionError("unexpected: all stacks must be part of a Stage or an App");return root.synth({force:!0}).getStackArtifact(stack.artifactId).messages}
|
||||
54
cdk/node_modules/aws-cdk-lib/assertions/lib/capture.d.ts
generated
vendored
Normal file
54
cdk/node_modules/aws-cdk-lib/assertions/lib/capture.d.ts
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
import { Matcher, MatchResult } from './matcher';
|
||||
/**
|
||||
* Capture values while matching templates.
|
||||
* Using an instance of this class within a Matcher will capture the matching value.
|
||||
* The `as*()` APIs on the instance can be used to get the captured value.
|
||||
*/
|
||||
export declare class Capture extends Matcher {
|
||||
private readonly pattern?;
|
||||
readonly name: string;
|
||||
/** @internal */
|
||||
_captured: any[];
|
||||
private idx;
|
||||
/**
|
||||
* Initialize a new capture
|
||||
* @param pattern a nested pattern or Matcher.
|
||||
* If a nested pattern is provided `objectLike()` matching is applied.
|
||||
*/
|
||||
constructor(pattern?: any | undefined);
|
||||
test(actual: any): MatchResult;
|
||||
/**
|
||||
* When multiple results are captured, move the iterator to the next result.
|
||||
* @returns true if another capture is present, false otherwise
|
||||
*/
|
||||
next(): boolean;
|
||||
/**
|
||||
* Retrieve the captured value as a string.
|
||||
* An error is generated if no value is captured or if the value is not a string.
|
||||
*/
|
||||
asString(): string;
|
||||
/**
|
||||
* Retrieve the captured value as a number.
|
||||
* An error is generated if no value is captured or if the value is not a number.
|
||||
*/
|
||||
asNumber(): number;
|
||||
/**
|
||||
* Retrieve the captured value as a boolean.
|
||||
* An error is generated if no value is captured or if the value is not a boolean.
|
||||
*/
|
||||
asBoolean(): boolean;
|
||||
/**
|
||||
* Retrieve the captured value as an array.
|
||||
* An error is generated if no value is captured or if the value is not an array.
|
||||
*/
|
||||
asArray(): any[];
|
||||
/**
|
||||
* Retrieve the captured value as a JSON object.
|
||||
* An error is generated if no value is captured or if the value is not an object.
|
||||
*/
|
||||
asObject(): {
|
||||
[key: string]: any;
|
||||
};
|
||||
private validate;
|
||||
private reportIncorrectType;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/capture.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/capture.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Capture=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var _1=()=>{var tmp=require(".");return _1=()=>tmp,tmp},matcher_1=()=>{var tmp=require("./matcher");return matcher_1=()=>tmp,tmp},error_1=()=>{var tmp=require("./private/error");return error_1=()=>tmp,tmp},type_1=()=>{var tmp=require("./private/type");return type_1=()=>tmp,tmp};class Capture extends matcher_1().Matcher{pattern;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.assertions.Capture",version:"2.252.0"};name;_captured=[];idx=0;constructor(pattern){super(),this.pattern=pattern,this.name="Capture"}test(actual){const result=new(matcher_1()).MatchResult(actual);if(actual==null)return result.recordFailure({matcher:this,path:[],message:`Can only capture non-nullish values. Found ${actual}`});if(this.pattern!==void 0){const innerResult=(matcher_1().Matcher.isMatcher(this.pattern)?this.pattern:_1().Match.objectLike(this.pattern)).test(actual);if(innerResult.hasFailed())return innerResult}return result.recordCapture({capture:this,value:actual}),result}next(){return this.idx<this._captured.length-1?(this.idx++,!0):!1}asString(){this.validate();const val=this._captured[this.idx];if((0,type_1().getType)(val)==="string")return val;this.reportIncorrectType("string")}asNumber(){this.validate();const val=this._captured[this.idx];if((0,type_1().getType)(val)==="number")return val;this.reportIncorrectType("number")}asBoolean(){this.validate();const val=this._captured[this.idx];if((0,type_1().getType)(val)==="boolean")return val;this.reportIncorrectType("boolean")}asArray(){this.validate();const val=this._captured[this.idx];if((0,type_1().getType)(val)==="array")return val;this.reportIncorrectType("array")}asObject(){this.validate();const val=this._captured[this.idx];if((0,type_1().getType)(val)==="object")return val;this.reportIncorrectType("object")}validate(){if(this._captured.length===0)throw new(error_1()).AssertionError("No value captured")}reportIncorrectType(expected){throw new(error_1()).AssertionError(`Captured value is expected to be ${expected} but found ${(0,type_1().getType)(this._captured[this.idx])}. Value is ${JSON.stringify(this._captured[this.idx],void 0,2)}`)}}exports.Capture=Capture;
|
||||
2
cdk/node_modules/aws-cdk-lib/assertions/lib/helpers-internal/index.d.ts
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/assertions/lib/helpers-internal/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from '../match';
|
||||
export * from '../matcher';
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/helpers-internal/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/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.Match=void 0,Object.defineProperty(exports,_noFold="Match",{enumerable:!0,configurable:!0,get:()=>{var value=require("../match").Match;return Object.defineProperty(exports,_noFold="Match",{enumerable:!0,configurable:!0,value}),value}}),exports.Matcher=void 0,Object.defineProperty(exports,_noFold="Matcher",{enumerable:!0,configurable:!0,get:()=>{var value=require("../matcher").Matcher;return Object.defineProperty(exports,_noFold="Matcher",{enumerable:!0,configurable:!0,value}),value}}),exports.MatchResult=void 0,Object.defineProperty(exports,_noFold="MatchResult",{enumerable:!0,configurable:!0,get:()=>{var value=require("../matcher").MatchResult;return Object.defineProperty(exports,_noFold="MatchResult",{enumerable:!0,configurable:!0,value}),value}});
|
||||
6
cdk/node_modules/aws-cdk-lib/assertions/lib/index.d.ts
generated
vendored
Normal file
6
cdk/node_modules/aws-cdk-lib/assertions/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from './capture';
|
||||
export * from './template';
|
||||
export * from './match';
|
||||
export * from './matcher';
|
||||
export * from './annotations';
|
||||
export * from './tags';
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/index.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/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.Capture=void 0,Object.defineProperty(exports,_noFold="Capture",{enumerable:!0,configurable:!0,get:()=>{var value=require("./capture").Capture;return Object.defineProperty(exports,_noFold="Capture",{enumerable:!0,configurable:!0,value}),value}}),exports.Template=void 0,Object.defineProperty(exports,_noFold="Template",{enumerable:!0,configurable:!0,get:()=>{var value=require("./template").Template;return Object.defineProperty(exports,_noFold="Template",{enumerable:!0,configurable:!0,value}),value}}),exports.Match=void 0,Object.defineProperty(exports,_noFold="Match",{enumerable:!0,configurable:!0,get:()=>{var value=require("./match").Match;return Object.defineProperty(exports,_noFold="Match",{enumerable:!0,configurable:!0,value}),value}}),exports.Matcher=void 0,Object.defineProperty(exports,_noFold="Matcher",{enumerable:!0,configurable:!0,get:()=>{var value=require("./matcher").Matcher;return Object.defineProperty(exports,_noFold="Matcher",{enumerable:!0,configurable:!0,value}),value}}),exports.MatchResult=void 0,Object.defineProperty(exports,_noFold="MatchResult",{enumerable:!0,configurable:!0,get:()=>{var value=require("./matcher").MatchResult;return Object.defineProperty(exports,_noFold="MatchResult",{enumerable:!0,configurable:!0,value}),value}}),exports.Annotations=void 0,Object.defineProperty(exports,_noFold="Annotations",{enumerable:!0,configurable:!0,get:()=>{var value=require("./annotations").Annotations;return Object.defineProperty(exports,_noFold="Annotations",{enumerable:!0,configurable:!0,value}),value}}),exports.Tags=void 0,Object.defineProperty(exports,_noFold="Tags",{enumerable:!0,configurable:!0,get:()=>{var value=require("./tags").Tags;return Object.defineProperty(exports,_noFold="Tags",{enumerable:!0,configurable:!0,value}),value}});
|
||||
61
cdk/node_modules/aws-cdk-lib/assertions/lib/match.d.ts
generated
vendored
Normal file
61
cdk/node_modules/aws-cdk-lib/assertions/lib/match.d.ts
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import { Matcher } from './matcher';
|
||||
/**
|
||||
* Partial and special matching during template assertions.
|
||||
*/
|
||||
export declare abstract class Match {
|
||||
/**
|
||||
* Use this matcher in the place of a field's value, if the field must not be present.
|
||||
*/
|
||||
static absent(): Matcher;
|
||||
/**
|
||||
* Matches the specified pattern with the array found in the same relative path of the target.
|
||||
* The set of elements (or matchers) must be in the same order as would be found.
|
||||
* @param pattern the pattern to match
|
||||
*/
|
||||
static arrayWith(pattern: any[]): Matcher;
|
||||
/**
|
||||
* Matches the specified pattern with the array found in the same relative path of the target.
|
||||
* The set of elements (or matchers) must match exactly and in order.
|
||||
* @param pattern the pattern to match
|
||||
*/
|
||||
static arrayEquals(pattern: any[]): Matcher;
|
||||
/**
|
||||
* Deep exact matching of the specified pattern to the target.
|
||||
* @param pattern the pattern to match
|
||||
*/
|
||||
static exact(pattern: any): Matcher;
|
||||
/**
|
||||
* Matches the specified pattern to an object found in the same relative path of the target.
|
||||
* The keys and their values (or matchers) must be present in the target but the target can be a superset.
|
||||
* @param pattern the pattern to match
|
||||
*/
|
||||
static objectLike(pattern: {
|
||||
[key: string]: any;
|
||||
}): Matcher;
|
||||
/**
|
||||
* Matches the specified pattern to an object found in the same relative path of the target.
|
||||
* The keys and their values (or matchers) must match exactly with the target.
|
||||
* @param pattern the pattern to match
|
||||
*/
|
||||
static objectEquals(pattern: {
|
||||
[key: string]: any;
|
||||
}): Matcher;
|
||||
/**
|
||||
* Matches any target which does NOT follow the specified pattern.
|
||||
* @param pattern the pattern to NOT match
|
||||
*/
|
||||
static not(pattern: any): Matcher;
|
||||
/**
|
||||
* Matches any string-encoded JSON and applies the specified pattern after parsing it.
|
||||
* @param pattern the pattern to match after parsing the encoded JSON.
|
||||
*/
|
||||
static serializedJson(pattern: any): Matcher;
|
||||
/**
|
||||
* Matches any non-null value at the target.
|
||||
*/
|
||||
static anyValue(): Matcher;
|
||||
/**
|
||||
* Matches targets according to a regular expression
|
||||
*/
|
||||
static stringLikeRegexp(pattern: string): Matcher;
|
||||
}
|
||||
1
cdk/node_modules/aws-cdk-lib/assertions/lib/match.js
generated
vendored
Normal file
1
cdk/node_modules/aws-cdk-lib/assertions/lib/match.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
122
cdk/node_modules/aws-cdk-lib/assertions/lib/matcher.d.ts
generated
vendored
Normal file
122
cdk/node_modules/aws-cdk-lib/assertions/lib/matcher.d.ts
generated
vendored
Normal file
@@ -0,0 +1,122 @@
|
||||
import type { Capture } from './capture';
|
||||
/**
|
||||
* Represents a matcher that can perform special data matching
|
||||
* capabilities between a given pattern and a target.
|
||||
*/
|
||||
export declare abstract class Matcher {
|
||||
/**
|
||||
* Check whether the provided object is a subtype of the `IMatcher`.
|
||||
*/
|
||||
static isMatcher(x: any): x is Matcher;
|
||||
/**
|
||||
* A name for the matcher. This is collected as part of the result and may be presented to the user.
|
||||
*/
|
||||
abstract readonly name: string;
|
||||
/**
|
||||
* Test whether a target matches the provided pattern.
|
||||
* Every Matcher must implement this method.
|
||||
* This method will be invoked by the assertions framework. Do not call this method directly.
|
||||
* @param actual the target to match
|
||||
* @return the list of match failures. An empty array denotes a successful match.
|
||||
*/
|
||||
abstract test(actual: any): MatchResult;
|
||||
}
|
||||
/**
|
||||
* Match failure details
|
||||
*/
|
||||
export interface MatchFailure {
|
||||
/**
|
||||
* The matcher that had the failure
|
||||
*/
|
||||
readonly matcher: Matcher;
|
||||
/**
|
||||
* The relative path in the target where the failure occurred.
|
||||
* If the failure occurred at root of the match tree, set the path to an empty list.
|
||||
* If it occurs in the 5th index of an array nested within the 'foo' key of an object,
|
||||
* set the path as `['/foo', '[5]']`.
|
||||
*/
|
||||
readonly path: string[];
|
||||
/**
|
||||
* Failure message
|
||||
*/
|
||||
readonly message: string;
|
||||
/**
|
||||
* The cost of this particular mismatch
|
||||
*
|
||||
* @default 1
|
||||
*/
|
||||
readonly cost?: number;
|
||||
}
|
||||
/**
|
||||
* Information about a value captured during match
|
||||
*/
|
||||
export interface MatchCapture {
|
||||
/**
|
||||
* The instance of Capture class to which this capture is associated with.
|
||||
*/
|
||||
readonly capture: Capture;
|
||||
/**
|
||||
* The value that was captured
|
||||
*/
|
||||
readonly value: any;
|
||||
}
|
||||
/**
|
||||
* The result of `Match.test()`.
|
||||
*/
|
||||
export declare class MatchResult {
|
||||
/**
|
||||
* The target for which this result was generated.
|
||||
*/
|
||||
readonly target: any;
|
||||
private readonly failuresHere;
|
||||
private readonly captures;
|
||||
private finalized;
|
||||
private readonly innerMatchFailures;
|
||||
private _hasFailed;
|
||||
private _failCount;
|
||||
private _cost;
|
||||
constructor(target: any);
|
||||
/**
|
||||
* DEPRECATED
|
||||
* @deprecated use recordFailure()
|
||||
*/
|
||||
push(matcher: Matcher, path: string[], message: string): this;
|
||||
/**
|
||||
* Record a new failure into this result at a specific path.
|
||||
*/
|
||||
recordFailure(failure: MatchFailure): this;
|
||||
/** Whether the match is a success */
|
||||
get isSuccess(): boolean;
|
||||
/** Does the result contain any failures. If not, the result is a success */
|
||||
hasFailed(): boolean;
|
||||
/** The number of failures */
|
||||
get failCount(): number;
|
||||
/** The cost of the failures so far */
|
||||
get failCost(): number;
|
||||
/**
|
||||
* Compose the results of a previous match as a subtree.
|
||||
* @param id the id of the parent tree.
|
||||
*/
|
||||
compose(id: string, inner: MatchResult): this;
|
||||
/**
|
||||
* Prepare the result to be analyzed.
|
||||
* This API *must* be called prior to analyzing these results.
|
||||
*/
|
||||
finished(): this;
|
||||
/**
|
||||
* Render the failed match in a presentable way
|
||||
*
|
||||
* Prefer using `renderMismatch` over this method. It is left for backwards
|
||||
* compatibility for test suites that expect it, but `renderMismatch()` will
|
||||
* produce better output.
|
||||
*/
|
||||
toHumanStrings(): string[];
|
||||
/**
|
||||
* Do a deep render of the match result, showing the structure mismatches in context
|
||||
*/
|
||||
renderMismatch(): string;
|
||||
/**
|
||||
* Record a capture against in this match result.
|
||||
*/
|
||||
recordCapture(options: MatchCapture): void;
|
||||
}
|
||||
10
cdk/node_modules/aws-cdk-lib/assertions/lib/matcher.js
generated
vendored
Normal file
10
cdk/node_modules/aws-cdk-lib/assertions/lib/matcher.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.MatchResult=exports.Matcher=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class Matcher{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.assertions.Matcher",version:"2.252.0"};static isMatcher(x){return x&&x instanceof Matcher}}exports.Matcher=Matcher;class MatchResult{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.assertions.MatchResult",version:"2.252.0"};target;failuresHere=new Map;captures=new Map;finalized=!1;innerMatchFailures=new Map;_hasFailed=!1;_failCount=0;_cost=0;constructor(target){this.target=target}push(matcher,path,message){try{jsiiDeprecationWarnings().print("aws-cdk-lib.assertions.MatchResult#push","use recordFailure()"),jsiiDeprecationWarnings().aws_cdk_lib_assertions_Matcher(matcher)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.push),error}return this.recordFailure({matcher,path,message})}recordFailure(failure){try{jsiiDeprecationWarnings().aws_cdk_lib_assertions_MatchFailure(failure)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.recordFailure),error}const failKey=failure.path.join(".");let list=this.failuresHere.get(failKey);return list||(list=[],this.failuresHere.set(failKey,list)),this._failCount+=1,this._cost+=failure.cost??1,list.push(failure),this._hasFailed=!0,this}get isSuccess(){return!this._hasFailed}hasFailed(){return this._hasFailed}get failCount(){return this._failCount}get failCost(){return this._cost}compose(id,inner){try{jsiiDeprecationWarnings().aws_cdk_lib_assertions_MatchResult(inner)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.compose),error}return inner.hasFailed()&&(this._hasFailed=!0,this._failCount+=inner.failCount,this._cost+=inner._cost,this.innerMatchFailures.set(id,inner)),inner.captures.forEach((vals,capture)=>{vals.forEach(value=>this.recordCapture({capture,value}))}),this}finished(){return this.finalized?this:(this.failCount===0&&this.captures.forEach((vals,cap)=>cap._captured.push(...vals)),this.finalized=!0,this)}toHumanStrings(){const failures=new Array;return recurse(this,[]),failures.map(r=>{const loc=r.path.length===0?"":` at /${r.path.join("/")}`;return""+r.message+loc+` (using ${r.matcher.name} matcher)`});function recurse(x,prefix){for(const fail of Array.from(x.failuresHere.values()).flat())failures.push({matcher:fail.matcher,message:fail.message,path:[...prefix,...fail.path]});for(const[key,inner]of x.innerMatchFailures.entries())recurse(inner,[...prefix,key])}}renderMismatch(){if(!this.hasFailed())return"<match>";const parts=new Array,indents=new Array;return emitFailures(this,""),recurse(this),moveMarkersToFront(parts.join("").trimEnd());function emit(x){if(x===void 0)debugger;parts.push(x.replace(/\n/g,`
|
||||
${indents.join("")}`))}function emitFailures(r,path,scrapSet){for(const fail of r.failuresHere.get(path)??[])emit(`!! ${fail.message}
|
||||
`);scrapSet?.delete(path)}function recurse(r){const remainingFailures=new Set(Array.from(r.failuresHere.keys()).filter(x=>x!==""));if(Array.isArray(r.target)){indents.push(" "),emit(`[
|
||||
`);for(const[first,i]of enumFirst(range(r.target.length))){first||emit(`,
|
||||
`),emitFailures(r,`${i}`,remainingFailures);const innerMatcher=r.innerMatchFailures.get(`${i}`);innerMatcher?(emitFailures(innerMatcher,""),recurseComparingValues(innerMatcher,r.target[i])):emit(renderAbridged(r.target[i]))}emitRemaining(),indents.pop(),emit(`
|
||||
]`);return}if(r.target&&typeof r.target=="object"){indents.push(" "),emit(`{
|
||||
`);const keys=Array.from(new Set([...Object.keys(r.target),...Array.from(remainingFailures)])).sort();for(const[first,key]of enumFirst(keys)){first||emit(`,
|
||||
`),emitFailures(r,key,remainingFailures);const innerMatcher=r.innerMatchFailures.get(key);innerMatcher?(emitFailures(innerMatcher,""),emit(`${jsonify(key)}: `),recurseComparingValues(innerMatcher,r.target[key])):(emit(`${jsonify(key)}: `),emit(renderAbridged(r.target[key])))}emitRemaining(),indents.pop(),emit(`
|
||||
}`);return}emitRemaining(),emit(jsonify(r.target));function emitRemaining(){remainingFailures.size>0&&emit(`
|
||||
`);for(const key of remainingFailures)emitFailures(r,key)}}function recurseComparingValues(inner,actualValue){if(inner.target===actualValue)return recurse(inner);emit(renderAbridged(actualValue)),emit(" <*> "),recurse(inner)}function renderAbridged(x){if(Array.isArray(x))switch(x.length){case 0:return"[]";case 1:return`[ ${renderAbridged(x[0])} ]`;case 2:return x.every(e=>["number","boolean","string"].includes(typeof e))?`[ ${x.map(renderAbridged).join(", ")} ]`:"[ ... ]";default:return"[ ... ]"}if(x&&typeof x=="object"){const keys=Object.keys(x);switch(keys.length){case 0:return"{}";case 1:return`{ ${JSON.stringify(keys[0])}: ${renderAbridged(x[keys[0]])} }`;default:return"{ ... }"}}return jsonify(x)}function jsonify(x){return JSON.stringify(x)??"undefined"}function moveMarkersToFront(x){const re=/^(\s+)!!/gm;return x.replace(re,(_,spaces)=>`!!${spaces.substring(0,spaces.length-2)}`)}}recordCapture(options){try{jsiiDeprecationWarnings().aws_cdk_lib_assertions_MatchCapture(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.recordCapture),error}let values=this.captures.get(options.capture);values===void 0&&(values=[]),values.push(options.value),this.captures.set(options.capture,values)}}exports.MatchResult=MatchResult;function*range(n){for(let i=0;i<n;i++)yield i}function*enumFirst(xs){let first=!0;for(const x of xs)yield[first,x],first=!1}
|
||||
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}
|
||||
45
cdk/node_modules/aws-cdk-lib/assertions/lib/tags.d.ts
generated
vendored
Normal file
45
cdk/node_modules/aws-cdk-lib/assertions/lib/tags.d.ts
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
import type { Stack } from '../../core';
|
||||
type ManifestTags = {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Allows assertions on the tags associated with a synthesized CDK stack's
|
||||
* manifest. Stack tags are not part of the synthesized template, so can only be
|
||||
* checked from the manifest in this manner.
|
||||
*/
|
||||
export declare class Tags {
|
||||
/**
|
||||
* Find tags associated with a synthesized CDK `Stack`.
|
||||
*
|
||||
* @param stack the CDK Stack to find tags on.
|
||||
*/
|
||||
static fromStack(stack: Stack): Tags;
|
||||
private readonly _tags;
|
||||
private constructor();
|
||||
/**
|
||||
* Assert that the given Matcher or object matches the tags associated with
|
||||
* the synthesized CDK Stack's manifest.
|
||||
*
|
||||
* @param tags the expected set of tags. This should be a
|
||||
* string or Matcher object.
|
||||
*/
|
||||
hasValues(tags: any): void;
|
||||
/**
|
||||
* Assert that the there are no tags associated with the synthesized CDK
|
||||
* Stack's manifest.
|
||||
*
|
||||
* This is a convenience method over `hasValues(Match.exact({}))`, and is
|
||||
* present because the more obvious method of detecting no tags
|
||||
* (`Match.absent()`) will not work. Manifests default the tag set to an empty
|
||||
* object.
|
||||
*/
|
||||
hasNone(): void;
|
||||
/**
|
||||
* Get the tags associated with the manifest. This will be an empty object if
|
||||
* no tags were supplied.
|
||||
*
|
||||
* @returns The tags associated with the stack's synthesized manifest.
|
||||
*/
|
||||
all(): ManifestTags;
|
||||
}
|
||||
export {};
|
||||
2
cdk/node_modules/aws-cdk-lib/assertions/lib/tags.js
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/assertions/lib/tags.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Tags=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var match_1=()=>{var tmp=require("./match");return match_1=()=>tmp,tmp},matcher_1=()=>{var tmp=require("./matcher");return matcher_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},error_1=()=>{var tmp=require("./private/error");return error_1=()=>tmp,tmp};class Tags{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.assertions.Tags",version:"2.252.0"};static fromStack(stack){try{jsiiDeprecationWarnings().aws_cdk_lib_Stack(stack)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromStack),error}return new Tags(getManifestTags(stack))}_tags;constructor(tags){this._tags=tags}hasValues(tags){if(matcher_1().Matcher.isMatcher(tags)&&tags.name==="absent")throw new(error_1()).AssertionError('Match.absent() will never match Tags because "{}" is the default value. Use Tags.hasNone() instead.');const result=(matcher_1().Matcher.isMatcher(tags)?tags:match_1().Match.objectLike(tags)).test(this.all());if(result.hasFailed())throw new(error_1()).AssertionError(`Stack tags did not match as expected:
|
||||
`+result.renderMismatch())}hasNone(){this.hasValues(match_1().Match.exact({}))}all(){return this._tags}}exports.Tags=Tags;function getManifestTags(stack){const root=stack.node.root;if(!core_1().Stage.isStage(root))throw new(error_1()).AssertionError("unexpected: all stacks must be part of a Stage or an App");return root.synth().getStackArtifact(stack.artifactId).tags}
|
||||
211
cdk/node_modules/aws-cdk-lib/assertions/lib/template.d.ts
generated
vendored
Normal file
211
cdk/node_modules/aws-cdk-lib/assertions/lib/template.d.ts
generated
vendored
Normal file
@@ -0,0 +1,211 @@
|
||||
import type { Stack } from '../../core';
|
||||
/**
|
||||
* Suite of assertions that can be run on a CDK stack.
|
||||
* Typically used, as part of unit tests, to validate that the rendered
|
||||
* CloudFormation template has expected resources and properties.
|
||||
*/
|
||||
export declare class Template {
|
||||
/**
|
||||
* Base your assertions on the CloudFormation template synthesized by a CDK `Stack`.
|
||||
* @param stack the CDK Stack to run assertions on
|
||||
* @param templateParsingOptions Optional param to configure template parsing behavior, such as disregarding circular
|
||||
* dependencies.
|
||||
*/
|
||||
static fromStack(stack: Stack, templateParsingOptions?: TemplateParsingOptions): Template;
|
||||
/**
|
||||
* Base your assertions from an existing CloudFormation template formatted as an in-memory
|
||||
* JSON object.
|
||||
* @param template the CloudFormation template formatted as a nested set of records
|
||||
* @param templateParsingOptions Optional param to configure template parsing behavior, such as disregarding circular
|
||||
* dependencies.
|
||||
*/
|
||||
static fromJSON(template: {
|
||||
[key: string]: any;
|
||||
}, templateParsingOptions?: TemplateParsingOptions): Template;
|
||||
/**
|
||||
* Base your assertions from an existing CloudFormation template formatted as a
|
||||
* JSON string.
|
||||
* @param template the CloudFormation template in
|
||||
* @param templateParsingOptions Optional param to configure template parsing behavior, such as disregarding circular
|
||||
* dependencies.
|
||||
*/
|
||||
static fromString(template: string, templateParsingOptions?: TemplateParsingOptions): Template;
|
||||
private readonly template;
|
||||
private constructor();
|
||||
/**
|
||||
* The CloudFormation template deserialized into an object.
|
||||
*/
|
||||
toJSON(): {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* Assert that the given number of resources of the given type exist in the
|
||||
* template.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param count number of expected instances
|
||||
*/
|
||||
resourceCountIs(type: string, count: number): void;
|
||||
/**
|
||||
* Assert that the given number of resources of the given type and properties exists in the
|
||||
* CloudFormation template.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param props the 'Properties' section of the resource as should be expected in the template.
|
||||
* @param count number of expected instances
|
||||
*/
|
||||
resourcePropertiesCountIs(type: string, props: any, count: number): void;
|
||||
/**
|
||||
* Assert that a resource of the given type and properties exists in the
|
||||
* CloudFormation template.
|
||||
* By default, performs partial matching on the `Properties` key of the resource, via the
|
||||
* `Match.objectLike()`. To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param props the 'Properties' section of the resource as should be expected in the template.
|
||||
*/
|
||||
hasResourceProperties(type: string, props: any): void;
|
||||
/**
|
||||
* Assert that a resource of the given type and given definition exists in the
|
||||
* CloudFormation template.
|
||||
* By default, performs partial matching on the resource, via the `Match.objectLike()`.
|
||||
* To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param props the entire definition of the resource as should be expected in the template.
|
||||
*/
|
||||
hasResource(type: string, props: any): void;
|
||||
/**
|
||||
* Get the set of matching resources of a given type and properties in the CloudFormation template.
|
||||
* @param type the type to match in the CloudFormation template
|
||||
* @param props by default, matches all resources with the given type.
|
||||
* When a literal is provided, performs a partial match via `Match.objectLike()`.
|
||||
* Use the `Match` APIs to configure a different behaviour.
|
||||
*/
|
||||
findResources(type: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Get the Resource ID of a matching resource, expects only to find one match.
|
||||
* Throws AssertionError if none or multiple resources were found.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param props by default, matches all resources with the given type.
|
||||
* @returns The resource id of the matched resource.
|
||||
* Performs a partial match via `Match.objectLike()`.
|
||||
*/
|
||||
getResourceId(type: string, props?: any): string;
|
||||
/**
|
||||
* Assert that all resources of the given type contain the given definition in the
|
||||
* CloudFormation template.
|
||||
* By default, performs partial matching on the resource, via the `Match.objectLike()`.
|
||||
* To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param props the entire definition of the resources as they should be expected in the template.
|
||||
*/
|
||||
allResources(type: string, props: any): void;
|
||||
/**
|
||||
* Assert that all resources of the given type contain the given properties
|
||||
* CloudFormation template.
|
||||
* By default, performs partial matching on the `Properties` key of the resource, via the
|
||||
* `Match.objectLike()`. To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param type the resource type; ex: `AWS::S3::Bucket`
|
||||
* @param props the 'Properties' section of the resource as should be expected in the template.
|
||||
*/
|
||||
allResourcesProperties(type: string, props: any): void;
|
||||
/**
|
||||
* Assert that a Parameter with the given properties exists in the CloudFormation template.
|
||||
* By default, performs partial matching on the parameter, via the `Match.objectLike()`.
|
||||
* To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param logicalId the name of the parameter, provide `'*'` to match all parameters in the template.
|
||||
* @param props the parameter as should be expected in the template.
|
||||
*/
|
||||
hasParameter(logicalId: string, props: any): void;
|
||||
/**
|
||||
* Get the set of matching Parameters that match the given properties in the CloudFormation template.
|
||||
* @param logicalId the name of the parameter, provide `'*'` to match all parameters in the template.
|
||||
* @param props by default, matches all Parameters in the template.
|
||||
* When a literal object is provided, performs a partial match via `Match.objectLike()`.
|
||||
* Use the `Match` APIs to configure a different behaviour.
|
||||
*/
|
||||
findParameters(logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Assert that an Output with the given properties exists in the CloudFormation template.
|
||||
* By default, performs partial matching on the resource, via the `Match.objectLike()`.
|
||||
* To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param logicalId the name of the output, provide `'*'` to match all outputs in the template.
|
||||
* @param props the output as should be expected in the template.
|
||||
*/
|
||||
hasOutput(logicalId: string, props: any): void;
|
||||
/**
|
||||
* Get the set of matching Outputs that match the given properties in the CloudFormation template.
|
||||
* @param logicalId the name of the output, provide `'*'` to match all outputs in the template.
|
||||
* @param props by default, matches all Outputs in the template.
|
||||
* When a literal object is provided, performs a partial match via `Match.objectLike()`.
|
||||
* Use the `Match` APIs to configure a different behaviour.
|
||||
*/
|
||||
findOutputs(logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Assert that a Mapping with the given properties exists in the CloudFormation template.
|
||||
* By default, performs partial matching on the resource, via the `Match.objectLike()`.
|
||||
* To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param logicalId the name of the mapping, provide `'*'` to match all mappings in the template.
|
||||
* @param props the output as should be expected in the template.
|
||||
*/
|
||||
hasMapping(logicalId: string, props: any): void;
|
||||
/**
|
||||
* Get the set of matching Mappings that match the given properties in the CloudFormation template.
|
||||
* @param logicalId the name of the mapping, provide `'*'` to match all mappings in the template.
|
||||
* @param props by default, matches all Mappings in the template.
|
||||
* When a literal object is provided, performs a partial match via `Match.objectLike()`.
|
||||
* Use the `Match` APIs to configure a different behaviour.
|
||||
*/
|
||||
findMappings(logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Assert that a Condition with the given properties exists in the CloudFormation template.
|
||||
* By default, performs partial matching on the resource, via the `Match.objectLike()`.
|
||||
* To configure different behavior, use other matchers in the `Match` class.
|
||||
* @param logicalId the name of the mapping, provide `'*'` to match all conditions in the template.
|
||||
* @param props the output as should be expected in the template.
|
||||
*/
|
||||
hasCondition(logicalId: string, props: any): void;
|
||||
/**
|
||||
* Get the set of matching Conditions that match the given properties in the CloudFormation template.
|
||||
* @param logicalId the name of the condition, provide `'*'` to match all conditions in the template.
|
||||
* @param props by default, matches all Conditions in the template.
|
||||
* When a literal object is provided, performs a partial match via `Match.objectLike()`.
|
||||
* Use the `Match` APIs to configure a different behaviour.
|
||||
*/
|
||||
findConditions(logicalId: string, props?: any): {
|
||||
[key: string]: {
|
||||
[key: string]: any;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Assert that the CloudFormation template matches the given value
|
||||
* @param expected the expected CloudFormation template as key-value pairs.
|
||||
*/
|
||||
templateMatches(expected: any): void;
|
||||
}
|
||||
/**
|
||||
* Options to configure template parsing behavior, such as disregarding circular
|
||||
* dependencies.
|
||||
*/
|
||||
export interface TemplateParsingOptions {
|
||||
/**
|
||||
* If set to true, will skip checking for cyclical / circular dependencies. Should be set to false other than for
|
||||
* templates that are valid despite containing cycles, such as unprocessed transform stacks.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly skipCyclicalDependenciesCheck?: boolean;
|
||||
}
|
||||
2
cdk/node_modules/aws-cdk-lib/assertions/lib/template.js
generated
vendored
Normal file
2
cdk/node_modules/aws-cdk-lib/assertions/lib/template.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user