UNPKG

aws-cdk

Version:

AWS CDK CLI, the command line tool for CDK apps

1,099 lines (1,078 loc) 14.3 MB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : /* @__PURE__ */ Symbol.for("Symbol." + name); var __typeError = (msg) => { throw TypeError(msg); }; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __decorateClass = (decorators, target, key, kind) => { var result2 = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target; for (var i6 = decorators.length - 1, decorator; i6 >= 0; i6--) if (decorator = decorators[i6]) result2 = (kind ? decorator(target, key, result2) : decorator(result2)) || result2; if (kind && result2) __defProp(target, key, result2); return result2; }; var __using = (stack, value, async) => { if (value != null) { if (typeof value !== "object" && typeof value !== "function") __typeError("Object expected"); var dispose, inner; if (async) dispose = value[__knownSymbol("asyncDispose")]; if (dispose === void 0) { dispose = value[__knownSymbol("dispose")]; if (async) inner = dispose; } if (typeof dispose !== "function") __typeError("Object not disposable"); if (inner) dispose = function() { try { inner.call(this); } catch (e6) { return Promise.reject(e6); } }; stack.push([async, dispose, value]); } else if (async) { stack.push([async]); } return value; }; var __callDispose = (stack, error5, hasError) => { var E4 = typeof SuppressedError === "function" ? SuppressedError : function(e6, s6, m6, _2) { return _2 = Error(m6), _2.name = "SuppressedError", _2.error = e6, _2.suppressed = s6, _2; }; var fail = (e6) => error5 = hasError ? new E4(e6, error5, "An error was suppressed during disposal") : (hasError = true, e6); var next = (it) => { while (it = stack.pop()) { try { var result2 = it[1] && it[1].call(it[2]); if (it[0]) return Promise.resolve(result2).then(next, (e6) => (fail(e6), next())); } catch (e6) { fail(e6); } } if (hasError) throw error5; }; return next(); }; // ../@aws-cdk/cloud-assembly-api/lib/context/vpc.ts var vpc_exports = {}; __export(vpc_exports, { VpcSubnetGroupType: () => VpcSubnetGroupType }); var VpcSubnetGroupType; var init_vpc = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/vpc.ts"() { "use strict"; VpcSubnetGroupType = /* @__PURE__ */ ((VpcSubnetGroupType3) => { VpcSubnetGroupType3["PUBLIC"] = "Public"; VpcSubnetGroupType3["PRIVATE"] = "Private"; VpcSubnetGroupType3["ISOLATED"] = "Isolated"; return VpcSubnetGroupType3; })(VpcSubnetGroupType || {}); } }); // ../@aws-cdk/cloud-assembly-api/lib/context/ami.ts var ami_exports = {}; var init_ami = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/ami.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-api/lib/context/load-balancer.ts var load_balancer_exports = {}; __export(load_balancer_exports, { LoadBalancerIpAddressType: () => LoadBalancerIpAddressType }); var LoadBalancerIpAddressType; var init_load_balancer = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/load-balancer.ts"() { "use strict"; LoadBalancerIpAddressType = /* @__PURE__ */ ((LoadBalancerIpAddressType3) => { LoadBalancerIpAddressType3["IPV4"] = "ipv4"; LoadBalancerIpAddressType3["DUAL_STACK"] = "dualstack"; LoadBalancerIpAddressType3["DUAL_STACK_WITHOUT_PUBLIC_IPV4"] = "dualstack-without-public-ipv4"; return LoadBalancerIpAddressType3; })(LoadBalancerIpAddressType || {}); } }); // ../@aws-cdk/cloud-assembly-api/lib/context/availability-zones.ts var availability_zones_exports = {}; __export(availability_zones_exports, { AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY: () => AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY }); var AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY; var init_availability_zones = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/availability-zones.ts"() { "use strict"; AVAILABILITY_ZONE_FALLBACK_CONTEXT_KEY = "aws:cdk:availability-zones:fallback"; } }); // ../@aws-cdk/cloud-assembly-api/lib/context/endpoint-service-availability-zones.ts var endpoint_service_availability_zones_exports = {}; __export(endpoint_service_availability_zones_exports, { ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER: () => ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER }); var ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER; var init_endpoint_service_availability_zones = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/endpoint-service-availability-zones.ts"() { "use strict"; ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER = "endpoint-service-availability-zones"; } }); // ../@aws-cdk/cloud-assembly-api/lib/context/security-group.ts var security_group_exports = {}; var init_security_group = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/security-group.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-api/lib/context/key.ts var key_exports = {}; var init_key = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/key.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-api/lib/context/generic.ts var generic_exports = {}; __export(generic_exports, { PROVIDER_ERROR_KEY: () => PROVIDER_ERROR_KEY }); var PROVIDER_ERROR_KEY; var init_generic = __esm({ "../@aws-cdk/cloud-assembly-api/lib/context/generic.ts"() { "use strict"; PROVIDER_ERROR_KEY = "$providerError"; } }); // ../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/schema.ts var ArtifactType; var init_schema = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/schema.ts"() { "use strict"; ArtifactType = /* @__PURE__ */ ((ArtifactType6) => { ArtifactType6["NONE"] = "none"; ArtifactType6["AWS_CLOUDFORMATION_STACK"] = "aws:cloudformation:stack"; ArtifactType6["CDK_TREE"] = "cdk:tree"; ArtifactType6["ASSET_MANIFEST"] = "cdk:asset-manifest"; ArtifactType6["NESTED_CLOUD_ASSEMBLY"] = "cdk:cloud-assembly"; ArtifactType6["FEATURE_FLAG_REPORT"] = "cdk:feature-flag-report"; return ArtifactType6; })(ArtifactType || {}); } }); // ../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/metadata-schema.ts var ArtifactMetadataEntryType; var init_metadata_schema = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/metadata-schema.ts"() { "use strict"; ArtifactMetadataEntryType = /* @__PURE__ */ ((ArtifactMetadataEntryType7) => { ArtifactMetadataEntryType7["ASSET"] = "aws:cdk:asset"; ArtifactMetadataEntryType7["INFO"] = "aws:cdk:info"; ArtifactMetadataEntryType7["WARN"] = "aws:cdk:warning"; ArtifactMetadataEntryType7["ERROR"] = "aws:cdk:error"; ArtifactMetadataEntryType7["LOGICAL_ID"] = "aws:cdk:logicalId"; ArtifactMetadataEntryType7["STACK_TAGS"] = "aws:cdk:stack-tags"; ArtifactMetadataEntryType7["DO_NOT_REFACTOR"] = "aws:cdk:do-not-refactor"; return ArtifactMetadataEntryType7; })(ArtifactMetadataEntryType || {}); } }); // ../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.ts var init_artifact_schema = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.ts var ContextProvider, LoadBalancerType, LoadBalancerListenerProtocol; var init_context_queries = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.ts"() { "use strict"; ContextProvider = /* @__PURE__ */ ((ContextProvider3) => { ContextProvider3["AMI_PROVIDER"] = "ami"; ContextProvider3["AVAILABILITY_ZONE_PROVIDER"] = "availability-zones"; ContextProvider3["HOSTED_ZONE_PROVIDER"] = "hosted-zone"; ContextProvider3["SSM_PARAMETER_PROVIDER"] = "ssm"; ContextProvider3["VPC_PROVIDER"] = "vpc-provider"; ContextProvider3["ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER"] = "endpoint-service-availability-zones"; ContextProvider3["LOAD_BALANCER_PROVIDER"] = "load-balancer"; ContextProvider3["LOAD_BALANCER_LISTENER_PROVIDER"] = "load-balancer-listener"; ContextProvider3["SECURITY_GROUP_PROVIDER"] = "security-group"; ContextProvider3["KEY_PROVIDER"] = "key-provider"; ContextProvider3["CC_API_PROVIDER"] = "cc-api-provider"; ContextProvider3["PLUGIN"] = "plugin"; return ContextProvider3; })(ContextProvider || {}); LoadBalancerType = /* @__PURE__ */ ((LoadBalancerType2) => { LoadBalancerType2["NETWORK"] = "network"; LoadBalancerType2["APPLICATION"] = "application"; return LoadBalancerType2; })(LoadBalancerType || {}); LoadBalancerListenerProtocol = /* @__PURE__ */ ((LoadBalancerListenerProtocol2) => { LoadBalancerListenerProtocol2["HTTP"] = "HTTP"; LoadBalancerListenerProtocol2["HTTPS"] = "HTTPS"; LoadBalancerListenerProtocol2["TCP"] = "TCP"; LoadBalancerListenerProtocol2["TLS"] = "TLS"; LoadBalancerListenerProtocol2["UDP"] = "UDP"; LoadBalancerListenerProtocol2["TCP_UDP"] = "TCP_UDP"; return LoadBalancerListenerProtocol2; })(LoadBalancerListenerProtocol || {}); } }); // ../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/interfaces.ts var init_interfaces = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/interfaces.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/index.ts var cloud_assembly_exports = {}; __export(cloud_assembly_exports, { ArtifactMetadataEntryType: () => ArtifactMetadataEntryType, ArtifactType: () => ArtifactType, ContextProvider: () => ContextProvider, LoadBalancerListenerProtocol: () => LoadBalancerListenerProtocol, LoadBalancerType: () => LoadBalancerType }); var init_cloud_assembly = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/index.ts"() { "use strict"; init_schema(); init_metadata_schema(); init_artifact_schema(); init_context_queries(); init_interfaces(); } }); // ../@aws-cdk/cloud-assembly-schema/lib/assets/schema.ts var init_schema2 = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/assets/schema.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-schema/lib/assets/docker-image-asset.ts var init_docker_image_asset = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/assets/docker-image-asset.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-schema/lib/assets/file-asset.ts var FileAssetPackaging; var init_file_asset = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/assets/file-asset.ts"() { "use strict"; FileAssetPackaging = /* @__PURE__ */ ((FileAssetPackaging4) => { FileAssetPackaging4["FILE"] = "file"; FileAssetPackaging4["ZIP_DIRECTORY"] = "zip"; return FileAssetPackaging4; })(FileAssetPackaging || {}); } }); // ../@aws-cdk/cloud-assembly-schema/lib/assets/aws-destination.ts var init_aws_destination = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/assets/aws-destination.ts"() { "use strict"; } }); // ../@aws-cdk/cloud-assembly-schema/lib/assets/index.ts var assets_exports = {}; __export(assets_exports, { FileAssetPackaging: () => FileAssetPackaging }); var init_assets = __esm({ "../@aws-cdk/cloud-assembly-schema/lib/assets/index.ts"() { "use strict"; init_schema2(); init_docker_image_asset(); init_file_asset(); init_aws_destination(); } }); // ../@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/helpers.js var require_helpers = __commonJS({ "../@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/helpers.js"(exports2, module2) { "use strict"; var uri = require("url"); var ValidationError = exports2.ValidationError = /* @__PURE__ */ __name(function ValidationError2(message2, instance, schema, path43, name, argument) { if (Array.isArray(path43)) { this.path = path43; this.property = path43.reduce(function(sum3, item) { return sum3 + makeSuffix(item); }, "instance"); } else if (path43 !== void 0) { this.property = path43; } if (message2) { this.message = message2; } if (schema) { var id = schema.$id || schema.id; this.schema = id || schema; } if (instance !== void 0) { this.instance = instance; } this.name = name; this.argument = argument; this.stack = this.toString(); }, "ValidationError"); ValidationError.prototype.toString = /* @__PURE__ */ __name(function toString() { return this.property + " " + this.message; }, "toString"); var ValidatorResult = exports2.ValidatorResult = /* @__PURE__ */ __name(function ValidatorResult2(instance, schema, options, ctx) { this.instance = instance; this.schema = schema; this.options = options; this.path = ctx.path; this.propertyPath = ctx.propertyPath; this.errors = []; this.throwError = options && options.throwError; this.throwFirst = options && options.throwFirst; this.throwAll = options && options.throwAll; this.disableFormat = options && options.disableFormat === true; }, "ValidatorResult"); ValidatorResult.prototype.addError = /* @__PURE__ */ __name(function addError(detail) { var err; if (typeof detail == "string") { err = new ValidationError(detail, this.instance, this.schema, this.path); } else { if (!detail) throw new Error("Missing error detail"); if (!detail.message) throw new Error("Missing error message"); if (!detail.name) throw new Error("Missing validator type"); err = new ValidationError(detail.message, this.instance, this.schema, this.path, detail.name, detail.argument); } this.errors.push(err); if (this.throwFirst) { throw new ValidatorResultError(this); } else if (this.throwError) { throw err; } return err; }, "addError"); ValidatorResult.prototype.importErrors = /* @__PURE__ */ __name(function importErrors(res) { if (typeof res == "string" || res && res.validatorType) { this.addError(res); } else if (res && res.errors) { this.errors = this.errors.concat(res.errors); } }, "importErrors"); function stringizer(v6, i6) { return i6 + ": " + v6.toString() + "\n"; } __name(stringizer, "stringizer"); ValidatorResult.prototype.toString = /* @__PURE__ */ __name(function toString(res) { return this.errors.map(stringizer).join(""); }, "toString"); Object.defineProperty(ValidatorResult.prototype, "valid", { get: /* @__PURE__ */ __name(function() { return !this.errors.length; }, "get") }); module2.exports.ValidatorResultError = ValidatorResultError; function ValidatorResultError(result2) { if (Error.captureStackTrace) { Error.captureStackTrace(this, ValidatorResultError); } this.instance = result2.instance; this.schema = result2.schema; this.options = result2.options; this.errors = result2.errors; } __name(ValidatorResultError, "ValidatorResultError"); ValidatorResultError.prototype = new Error(); ValidatorResultError.prototype.constructor = ValidatorResultError; ValidatorResultError.prototype.name = "Validation Error"; var SchemaError = exports2.SchemaError = /* @__PURE__ */ __name(function SchemaError2(msg, schema) { this.message = msg; this.schema = schema; Error.call(this, msg); Error.captureStackTrace(this, SchemaError2); }, "SchemaError"); SchemaError.prototype = Object.create( Error.prototype, { constructor: { value: SchemaError, enumerable: false }, name: { value: "SchemaError", enumerable: false } } ); var SchemaContext = exports2.SchemaContext = /* @__PURE__ */ __name(function SchemaContext2(schema, options, path43, base, schemas) { this.schema = schema; this.options = options; if (Array.isArray(path43)) { this.path = path43; this.propertyPath = path43.reduce(function(sum3, item) { return sum3 + makeSuffix(item); }, "instance"); } else { this.propertyPath = path43; } this.base = base; this.schemas = schemas; }, "SchemaContext"); SchemaContext.prototype.resolve = /* @__PURE__ */ __name(function resolve16(target) { return uri.resolve(this.base, target); }, "resolve"); SchemaContext.prototype.makeChild = /* @__PURE__ */ __name(function makeChild(schema, propertyName) { var path43 = propertyName === void 0 ? this.path : this.path.concat([propertyName]); var id = schema.$id || schema.id; var base = uri.resolve(this.base, id || ""); var ctx = new SchemaContext(schema, this.options, path43, base, Object.create(this.schemas)); if (id && !ctx.schemas[base]) { ctx.schemas[base] = schema; } return ctx; }, "makeChild"); var FORMAT_REGEXPS = exports2.FORMAT_REGEXPS = { // 7.3.1. Dates, Times, and Duration "date-time": /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/, "date": /^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/, "time": /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/, "duration": /P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i, // 7.3.2. Email Addresses // TODO: fix the email production "email": /^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/, "idn-email": /^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u, // 7.3.3. Hostnames // 7.3.4. IP Addresses "ip-address": /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]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[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u, "uuid": /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i, // 7.3.6. uri-template "uri-template": /(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu, // 7.3.7. JSON Pointers "json-pointer": /^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu, "relative-json-pointer": /^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu, // hostname regex from: http://stackoverflow.com/a/1420225/5628 "hostname": /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, "host-name": /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/, "utc-millisec": /* @__PURE__ */ __name(function(input) { return typeof input === "string" && parseFloat(input) === parseInt(input, 10) && !isNaN(input); }, "utc-millisec"), // 7.3.8. regex "regex": /* @__PURE__ */ __name(function(input) { var result2 = true; try { new RegExp(input); } catch (e6) { result2 = false; } return result2; }, "regex"), // Other definitions // "style" was removed from JSON Schema in draft-4 and is deprecated "style": /[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/, // "color" was removed from JSON Schema in draft-4 and is deprecated "color": /^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/, "phone": /^\+(?:[0-9] ?){6,14}[0-9]$/, "alpha": /^[a-zA-Z]+$/, "alphanumeric": /^[a-zA-Z0-9]+$/ }; FORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex; FORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex; FORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS["ip-address"]; exports2.isFormat = /* @__PURE__ */ __name(function isFormat(input, format28, validator) { if (typeof input === "string" && FORMAT_REGEXPS[format28] !== void 0) { if (FORMAT_REGEXPS[format28] instanceof RegExp) { return FORMAT_REGEXPS[format28].test(input); } if (typeof FORMAT_REGEXPS[format28] === "function") { return FORMAT_REGEXPS[format28](input); } } else if (validator && validator.customFormats && typeof validator.customFormats[format28] === "function") { return validator.customFormats[format28](input); } return true; }, "isFormat"); var makeSuffix = exports2.makeSuffix = /* @__PURE__ */ __name(function makeSuffix2(key) { key = key.toString(); if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) { return "." + key; } if (key.match(/^\d+$/)) { return "[" + key + "]"; } return "[" + JSON.stringify(key) + "]"; }, "makeSuffix"); exports2.deepCompareStrict = /* @__PURE__ */ __name(function deepCompareStrict(a6, b6) { if (typeof a6 !== typeof b6) { return false; } if (Array.isArray(a6)) { if (!Array.isArray(b6)) { return false; } if (a6.length !== b6.length) { return false; } return a6.every(function(v6, i6) { return deepCompareStrict(a6[i6], b6[i6]); }); } if (typeof a6 === "object") { if (!a6 || !b6) { return a6 === b6; } var aKeys = Object.keys(a6); var bKeys = Object.keys(b6); if (aKeys.length !== bKeys.length) { return false; } return aKeys.every(function(v6) { return deepCompareStrict(a6[v6], b6[v6]); }); } return a6 === b6; }, "deepCompareStrict"); function deepMerger(target, dst, e6, i6) { if (typeof e6 === "object") { dst[i6] = deepMerge2(target[i6], e6); } else { if (target.indexOf(e6) === -1) { dst.push(e6); } } } __name(deepMerger, "deepMerger"); function copyist(src, dst, key) { dst[key] = src[key]; } __name(copyist, "copyist"); function copyistWithDeepMerge(target, src, dst, key) { if (typeof src[key] !== "object" || !src[key]) { dst[key] = src[key]; } else { if (!target[key]) { dst[key] = src[key]; } else { dst[key] = deepMerge2(target[key], src[key]); } } } __name(copyistWithDeepMerge, "copyistWithDeepMerge"); function deepMerge2(target, src) { var array = Array.isArray(src); var dst = array && [] || {}; if (array) { target = target || []; dst = dst.concat(target); src.forEach(deepMerger.bind(null, target, dst)); } else { if (target && typeof target === "object") { Object.keys(target).forEach(copyist.bind(null, target, dst)); } Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst)); } return dst; } __name(deepMerge2, "deepMerge"); module2.exports.deepMerge = deepMerge2; exports2.objectGetPath = /* @__PURE__ */ __name(function objectGetPath(o6, s6) { var parts = s6.split("/").slice(1); var k6; while (typeof (k6 = parts.shift()) == "string") { var n6 = decodeURIComponent(k6.replace(/~0/, "~").replace(/~1/g, "/")); if (!(n6 in o6)) return; o6 = o6[n6]; } return o6; }, "objectGetPath"); function pathEncoder(v6) { return "/" + encodeURIComponent(v6).replace(/~/g, "%7E"); } __name(pathEncoder, "pathEncoder"); exports2.encodePath = /* @__PURE__ */ __name(function encodePointer(a6) { return a6.map(pathEncoder).join(""); }, "encodePointer"); exports2.getDecimalPlaces = /* @__PURE__ */ __name(function getDecimalPlaces(number) { var decimalPlaces = 0; if (isNaN(number)) return decimalPlaces; if (typeof number !== "number") { number = Number(number); } var parts = number.toString().split("e"); if (parts.length === 2) { if (parts[1][0] !== "-") { return decimalPlaces; } else { decimalPlaces = Number(parts[1].slice(1)); } } var decimalParts = parts[0].split("."); if (decimalParts.length === 2) { decimalPlaces += decimalParts[1].length; } return decimalPlaces; }, "getDecimalPlaces"); exports2.isSchema = /* @__PURE__ */ __name(function isSchema(val) { return typeof val === "object" && val || typeof val === "boolean"; }, "isSchema"); } }); // ../@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/attribute.js var require_attribute = __commonJS({ "../@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/attribute.js"(exports2, module2) { "use strict"; var helpers = require_helpers(); var ValidatorResult = helpers.ValidatorResult; var SchemaError = helpers.SchemaError; var attribute = {}; attribute.ignoreProperties = { // informative properties "id": true, "default": true, "description": true, "title": true, // arguments to other properties "additionalItems": true, "then": true, "else": true, // special-handled properties "$schema": true, "$ref": true, "extends": true }; var validators = attribute.validators = {}; validators.type = /* @__PURE__ */ __name(function validateType(instance, schema, options, ctx) { if (instance === void 0) { return null; } var result2 = new ValidatorResult(instance, schema, options, ctx); var types2 = Array.isArray(schema.type) ? schema.type : [schema.type]; if (!types2.some(this.testType.bind(this, instance, schema, options, ctx))) { var list2 = types2.map(function(v6) { if (!v6) return; var id = v6.$id || v6.id; return id ? "<" + id + ">" : v6 + ""; }); result2.addError({ name: "type", argument: list2, message: "is not of a type(s) " + list2 }); } return result2; }, "validateType"); function testSchemaNoThrow(instance, options, ctx, callback, schema) { var throwError = options.throwError; var throwAll = options.throwAll; options.throwError = false; options.throwAll = false; var res = this.validateSchema(instance, schema, options, ctx); options.throwError = throwError; options.throwAll = throwAll; if (!res.valid && callback instanceof Function) { callback(res); } return res.valid; } __name(testSchemaNoThrow, "testSchemaNoThrow"); validators.anyOf = /* @__PURE__ */ __name(function validateAnyOf(instance, schema, options, ctx) { if (instance === void 0) { return null; } var result2 = new ValidatorResult(instance, schema, options, ctx); var inner = new ValidatorResult(instance, schema, options, ctx); if (!Array.isArray(schema.anyOf)) { throw new SchemaError("anyOf must be an array"); } if (!schema.anyOf.some( testSchemaNoThrow.bind( this, instance, options, ctx, function(res) { inner.importErrors(res); } ) )) { var list2 = schema.anyOf.map(function(v6, i6) { var id = v6.$id || v6.id; if (id) return "<" + id + ">"; return v6.title && JSON.stringify(v6.title) || v6["$ref"] && "<" + v6["$ref"] + ">" || "[subschema " + i6 + "]"; }); if (options.nestedErrors) { result2.importErrors(inner); } result2.addError({ name: "anyOf", argument: list2, message: "is not any of " + list2.join(",") }); } return result2; }, "validateAnyOf"); validators.allOf = /* @__PURE__ */ __name(function validateAllOf(instance, schema, options, ctx) { if (instance === void 0) { return null; } if (!Array.isArray(schema.allOf)) { throw new SchemaError("allOf must be an array"); } var result2 = new ValidatorResult(instance, schema, options, ctx); var self2 = this; schema.allOf.forEach(function(v6, i6) { var valid3 = self2.validateSchema(instance, v6, options, ctx); if (!valid3.valid) { var id = v6.$id || v6.id; var msg = id || v6.title && JSON.stringify(v6.title) || v6["$ref"] && "<" + v6["$ref"] + ">" || "[subschema " + i6 + "]"; result2.addError({ name: "allOf", argument: { id: msg, length: valid3.errors.length, valid: valid3 }, message: "does not match allOf schema " + msg + " with " + valid3.errors.length + " error[s]:" }); result2.importErrors(valid3); } }); return result2; }, "validateAllOf"); validators.oneOf = /* @__PURE__ */ __name(function validateOneOf(instance, schema, options, ctx) { if (instance === void 0) { return null; } if (!Array.isArray(schema.oneOf)) { throw new SchemaError("oneOf must be an array"); } var result2 = new ValidatorResult(instance, schema, options, ctx); var inner = new ValidatorResult(instance, schema, options, ctx); var count = schema.oneOf.filter( testSchemaNoThrow.bind( this, instance, options, ctx, function(res) { inner.importErrors(res); } ) ).length; var list2 = schema.oneOf.map(function(v6, i6) { var id = v6.$id || v6.id; return id || v6.title && JSON.stringify(v6.title) || v6["$ref"] && "<" + v6["$ref"] + ">" || "[subschema " + i6 + "]"; }); if (count !== 1) { if (options.nestedErrors) { result2.importErrors(inner); } result2.addError({ name: "oneOf", argument: list2, message: "is not exactly one from " + list2.join(",") }); } return result2; }, "validateOneOf"); validators.if = /* @__PURE__ */ __name(function validateIf(instance, schema, options, ctx) { if (instance === void 0) return null; if (!helpers.isSchema(schema.if)) throw new Error('Expected "if" keyword to be a schema'); var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema.if); var result2 = new ValidatorResult(instance, schema, options, ctx); var res; if (ifValid) { if (schema.then === void 0) return; if (!helpers.isSchema(schema.then)) throw new Error('Expected "then" keyword to be a schema'); res = this.validateSchema(instance, schema.then, options, ctx.makeChild(schema.then)); result2.importErrors(res); } else { if (schema.else === void 0) return; if (!helpers.isSchema(schema.else)) throw new Error('Expected "else" keyword to be a schema'); res = this.validateSchema(instance, schema.else, options, ctx.makeChild(schema.else)); result2.importErrors(res); } return result2; }, "validateIf"); function getEnumerableProperty(object, key) { if (Object.hasOwnProperty.call(object, key)) return object[key]; if (!(key in object)) return; while (object = Object.getPrototypeOf(object)) { if (Object.propertyIsEnumerable.call(object, key)) return object[key]; } } __name(getEnumerableProperty, "getEnumerableProperty"); validators.propertyNames = /* @__PURE__ */ __name(function validatePropertyNames(instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var subschema = schema.propertyNames !== void 0 ? schema.propertyNames : {}; if (!helpers.isSchema(subschema)) throw new SchemaError('Expected "propertyNames" to be a schema (object or boolean)'); for (var property in instance) { if (getEnumerableProperty(instance, property) !== void 0) { var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema)); result2.importErrors(res); } } return result2; }, "validatePropertyNames"); validators.properties = /* @__PURE__ */ __name(function validateProperties(instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var properties = schema.properties || {}; for (var property in properties) { var subschema = properties[property]; if (subschema === void 0) { continue; } else if (subschema === null) { throw new SchemaError('Unexpected null, expected schema in "properties"'); } if (typeof options.preValidateProperty == "function") { options.preValidateProperty(instance, property, subschema, options, ctx); } var prop = getEnumerableProperty(instance, property); var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property)); if (res.instance !== result2.instance[property]) result2.instance[property] = res.instance; result2.importErrors(res); } return result2; }, "validateProperties"); function testAdditionalProperty(instance, schema, options, ctx, property, result2) { if (!this.types.object(instance)) return; if (schema.properties && schema.properties[property] !== void 0) { return; } if (schema.additionalProperties === false) { result2.addError({ name: "additionalProperties", argument: property, message: "is not allowed to have the additional property " + JSON.stringify(property) }); } else { var additionalProperties = schema.additionalProperties || {}; if (typeof options.preValidateProperty == "function") { options.preValidateProperty(instance, property, additionalProperties, options, ctx); } var res = this.validateSchema(instance[property], additionalProperties, options, ctx.makeChild(additionalProperties, property)); if (res.instance !== result2.instance[property]) result2.instance[property] = res.instance; result2.importErrors(res); } } __name(testAdditionalProperty, "testAdditionalProperty"); validators.patternProperties = /* @__PURE__ */ __name(function validatePatternProperties(instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var patternProperties = schema.patternProperties || {}; for (var property in instance) { var test = true; for (var pattern in patternProperties) { var subschema = patternProperties[pattern]; if (subschema === void 0) { continue; } else if (subschema === null) { throw new SchemaError('Unexpected null, expected schema in "patternProperties"'); } try { var regexp = new RegExp(pattern, "u"); } catch (_e6) { regexp = new RegExp(pattern); } if (!regexp.test(property)) { continue; } test = false; if (typeof options.preValidateProperty == "function") { options.preValidateProperty(instance, property, subschema, options, ctx); } var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property)); if (res.instance !== result2.instance[property]) result2.instance[property] = res.instance; result2.importErrors(res); } if (test) { testAdditionalProperty.call(this, instance, schema, options, ctx, property, result2); } } return result2; }, "validatePatternProperties"); validators.additionalProperties = /* @__PURE__ */ __name(function validateAdditionalProperties(instance, schema, options, ctx) { if (!this.types.object(instance)) return; if (schema.patternProperties) { return null; } var result2 = new ValidatorResult(instance, schema, options, ctx); for (var property in instance) { testAdditionalProperty.call(this, instance, schema, options, ctx, property, result2); } return result2; }, "validateAdditionalProperties"); validators.minProperties = /* @__PURE__ */ __name(function validateMinProperties(instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var keys = Object.keys(instance); if (!(keys.length >= schema.minProperties)) { result2.addError({ name: "minProperties", argument: schema.minProperties, message: "does not meet minimum property length of " + schema.minProperties }); } return result2; }, "validateMinProperties"); validators.maxProperties = /* @__PURE__ */ __name(function validateMaxProperties(instance, schema, options, ctx) { if (!this.types.object(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var keys = Object.keys(instance); if (!(keys.length <= schema.maxProperties)) { result2.addError({ name: "maxProperties", argument: schema.maxProperties, message: "does not meet maximum property length of " + schema.maxProperties }); } return result2; }, "validateMaxProperties"); validators.items = /* @__PURE__ */ __name(function validateItems(instance, schema, options, ctx) { var self2 = this; if (!this.types.array(instance)) return; if (schema.items === void 0) return; var result2 = new ValidatorResult(instance, schema, options, ctx); instance.every(function(value, i6) { if (Array.isArray(schema.items)) { var items = schema.items[i6] === void 0 ? schema.additionalItems : schema.items[i6]; } else { var items = schema.items; } if (items === void 0) { return true; } if (items === false) { result2.addError({ name: "items", message: "additionalItems not permitted" }); return false; } var res = self2.validateSchema(value, items, options, ctx.makeChild(items, i6)); if (res.instance !== result2.instance[i6]) result2.instance[i6] = res.instance; result2.importErrors(res); return true; }); return result2; }, "validateItems"); validators.contains = /* @__PURE__ */ __name(function validateContains(instance, schema, options, ctx) { var self2 = this; if (!this.types.array(instance)) return; if (schema.contains === void 0) return; if (!helpers.isSchema(schema.contains)) throw new Error('Expected "contains" keyword to be a schema'); var result2 = new ValidatorResult(instance, schema, options, ctx); var count = instance.some(function(value, i6) { var res = self2.validateSchema(value, schema.contains, options, ctx.makeChild(schema.contains, i6)); return res.errors.length === 0; }); if (count === false) { result2.addError({ name: "contains", argument: schema.contains, message: "must contain an item matching given schema" }); } return result2; }, "validateContains"); validators.minimum = /* @__PURE__ */ __name(function validateMinimum(instance, schema, options, ctx) { if (!this.types.number(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) { if (!(instance > schema.minimum)) { result2.addError({ name: "minimum", argument: schema.minimum, message: "must be greater than " + schema.minimum }); } } else { if (!(instance >= schema.minimum)) { result2.addError({ name: "minimum", argument: schema.minimum, message: "must be greater than or equal to " + schema.minimum }); } } return result2; }, "validateMinimum"); validators.maximum = /* @__PURE__ */ __name(function validateMaximum(instance, schema, options, ctx) { if (!this.types.number(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) { if (!(instance < schema.maximum)) { result2.addError({ name: "maximum", argument: schema.maximum, message: "must be less than " + schema.maximum }); } } else { if (!(instance <= schema.maximum)) { result2.addError({ name: "maximum", argument: schema.maximum, message: "must be less than or equal to " + schema.maximum }); } } return result2; }, "validateMaximum"); validators.exclusiveMinimum = /* @__PURE__ */ __name(function validateExclusiveMinimum(instance, schema, options, ctx) { if (typeof schema.exclusiveMinimum === "boolean") return; if (!this.types.number(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var valid3 = instance > schema.exclusiveMinimum; if (!valid3) { result2.addError({ name: "exclusiveMinimum", argument: schema.exclusiveMinimum, message: "must be strictly greater than " + schema.exclusiveMinimum }); } return result2; }, "validateExclusiveMinimum"); validators.exclusiveMaximum = /* @__PURE__ */ __name(function validateExclusiveMaximum(instance, schema, options, ctx) { if (typeof schema.exclusiveMaximum === "boolean") return; if (!this.types.number(instance)) return; var result2 = new ValidatorResult(instance, schema, options, ctx); var valid3 = instance < schema.exclusiveMaximum; if (!valid3) { result2.addError({ name: "exclusiveMaximum", argument: schema.exclusiveMaximum, message: "must be strictly less than " + schema.exclusiveMaximum }); } return result2; }, "validateExclusiveMaximum"); var val