agent-claw: automated task changes
This commit is contained in:
6203
cdk/node_modules/@aws-cdk/cloud-assembly-schema/.jsii
generated
vendored
Normal file
6203
cdk/node_modules/@aws-cdk/cloud-assembly-schema/.jsii
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
cdk/node_modules/@aws-cdk/cloud-assembly-schema/.jsii.tabl.json
generated
vendored
Normal file
1
cdk/node_modules/@aws-cdk/cloud-assembly-schema/.jsii.tabl.json
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/.yarnrc.yml
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/.yarnrc.yml
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# ~~ Generated by projen. To modify, edit .projenrc.js and run "yarn projen".
|
||||
|
||||
{}
|
||||
66
cdk/node_modules/@aws-cdk/cloud-assembly-schema/CONTRIBUTING.md
generated
vendored
Normal file
66
cdk/node_modules/@aws-cdk/cloud-assembly-schema/CONTRIBUTING.md
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
## Cloud Assembly Schema
|
||||
|
||||
Making changes to this module should only happen when you introduce new cloud assembly capabilities.
|
||||
|
||||
> For example: supporting the `--target` option when building docker containers.
|
||||
|
||||
If you decided these changes are necessary, simply go ahead and make the necessary modifications to
|
||||
the interfaces that describe the schema. Our tests and validation mechanisms will ensure you make those
|
||||
changes correctly.
|
||||
|
||||
### Module Structure
|
||||
|
||||
There are two main things to understand about the files in this module:
|
||||
|
||||
- [`lib/manifest.ts`](./lib/manifest.ts)
|
||||
|
||||
This is the typescript code that defines our schema. It is solely comprised of structs (property only interfaces).
|
||||
It directly maps to the way we want manifest files to be stored on disk. When you want to make changes to the schema,
|
||||
this is the file you should be editing.
|
||||
|
||||
- [`lib/schema`](./schema/)
|
||||
|
||||
This directory contains the generated json [schema](./schema/cloud-assembly.schema.json) from the aforementioned
|
||||
typescript code. It also contains a [version](./schema/cloud-assembly.version.json) file that holds the current version
|
||||
of the schema. These files are **not** intended for manual editing. Keep reading to understand how they change and when.
|
||||
|
||||
### Schema Generation
|
||||
|
||||
The schema can be generated by running `yarn update-schema`. It reads the [`manifest.ts`](./lib/manifest.ts) file and writes
|
||||
an updated json schema to [`cloud-assembly.schema.json`](./schema/cloud-assembly.schema.json). This command is run as part of
|
||||
the build but can also be called separately.
|
||||
|
||||
If changes to the code are performed, without generating a new schema, the tests will fail:
|
||||
|
||||
```console
|
||||
$ yarn test
|
||||
FAIL test/schema.test.js (5.902s)
|
||||
✓ manifest save (7ms)
|
||||
✕ cloud-assembly.json.schema is correct (5304ms)
|
||||
✓ manifest load (4ms)
|
||||
✓ manifest load fails for invalid nested property (5ms)
|
||||
✓ manifest load fails for invalid artifact type (1ms)
|
||||
✓ stack-tags are deserialized properly (1ms)
|
||||
✓ can access random metadata (1ms)
|
||||
|
||||
● cloud-assembly.json.schema is correct
|
||||
|
||||
Whoops, Looks like the schema has changed. Did you forget to run 'yarn update-schema'?
|
||||
```
|
||||
|
||||
### Schema Validation
|
||||
|
||||
Being a **stable** `jsii` module, it undergoes strict API compatibility checks with the help
|
||||
of [`jsii-diff`](https://github.com/aws/jsii/tree/master/packages/jsii-diff).
|
||||
This means that breaking changes will be rejected. These include:
|
||||
|
||||
- Adding a required property. (same as changing from _optional_ to _required_)
|
||||
- Changing the type of the property.
|
||||
|
||||
In addition, the interfaces defined here are programmatically exposed to users, via the `manifest`
|
||||
property of the [`CloudAssembly`](../cx-api/lib/cloud-assembly.ts) class. This means that the following are
|
||||
also considered breaking changes:
|
||||
|
||||
- Changing a property from _required_ to _optional_.
|
||||
- Removing an optional property.
|
||||
- Removing a required property.
|
||||
202
cdk/node_modules/@aws-cdk/cloud-assembly-schema/LICENSE
generated
vendored
Normal file
202
cdk/node_modules/@aws-cdk/cloud-assembly-schema/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
46
cdk/node_modules/@aws-cdk/cloud-assembly-schema/NOTICE
generated
vendored
Normal file
46
cdk/node_modules/@aws-cdk/cloud-assembly-schema/NOTICE
generated
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
AWS Cloud Development Kit (AWS CDK)
|
||||
Copyright 2018-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The AWS CDK includes the following third-party software/licensing:
|
||||
|
||||
** jsonschema - https://www.npmjs.com/package/jsonschema
|
||||
Copyright (C) 2012-2015 Tom de Grunt <tom@degrunt.nl>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
----------------
|
||||
|
||||
** semver - https://www.npmjs.com/package/semver
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
----------------
|
||||
53
cdk/node_modules/@aws-cdk/cloud-assembly-schema/README.md
generated
vendored
Normal file
53
cdk/node_modules/@aws-cdk/cloud-assembly-schema/README.md
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# Cloud Assembly Schema
|
||||
|
||||
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.
|
||||
|
||||
## Cloud Assembly
|
||||
|
||||
The _Cloud Assembly_ is the output of the synthesis operation. It is produced as part of the
|
||||
[`cdk synth`](https://github.com/aws/aws-cdk-cli/tree/main/packages/aws-cdk#cdk-synthesize)
|
||||
command, or the [`app.synth()`](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/core/lib/stage.ts#L219) method invocation.
|
||||
|
||||
Its essentially a set of files and directories, one of which is the `manifest.json` file. It defines the set of instructions that are
|
||||
needed in order to deploy the assembly directory.
|
||||
|
||||
> For example, when `cdk deploy` is executed, the CLI reads this file and performs its instructions:
|
||||
>
|
||||
> - Build container images.
|
||||
> - Upload assets.
|
||||
> - Deploy CloudFormation templates.
|
||||
|
||||
Therefore, the assembly is how the CDK class library and CDK CLI (or any other consumer) communicate. To ensure compatibility
|
||||
between the assembly and its consumers, we treat the manifest file as a well defined, versioned schema.
|
||||
|
||||
## Schema
|
||||
|
||||
This module contains the typescript structs that comprise the `manifest.json` file, as well as the
|
||||
generated [_json-schema_](./schema/cloud-assembly.schema.json).
|
||||
|
||||
## Versioning
|
||||
|
||||
The schema version is specified my the major version of the package release. It follows semantic versioning, but with a small twist.
|
||||
|
||||
When we add instructions to the assembly, they are reflected in the manifest file and the _json-schema_ accordingly.
|
||||
Every such instruction, is crucial for ensuring the correct deployment behavior. This means that to properly deploy a cloud assembly,
|
||||
consumers must be aware of every such instruction modification.
|
||||
|
||||
For this reason, every change to the schema, even though it might not strictly break validation of the _json-schema_ format,
|
||||
is considered `major` version bump. All changes that do not impact the schema are considered a `minor` version bump.
|
||||
|
||||
## How to consume
|
||||
|
||||
If you'd like to consume the [schema file](./schema/cloud-assembly.schema.json) in order to do validations on `manifest.json` files,
|
||||
simply download it from this repo and run it against standard _json-schema_ validators, such as [jsonschema](https://www.npmjs.com/package/jsonschema).
|
||||
|
||||
Consumers must take into account the `major` version of the schema they are consuming. They should reject cloud assemblies
|
||||
with a `major` version that is higher than what they expect. While schema validation might pass on such assemblies, the deployment integrity
|
||||
cannot be guaranteed because some instructions will be ignored.
|
||||
|
||||
> For example, if your consumer was built when the schema version was 2.0.0, you should reject deploying cloud assemblies with a
|
||||
> manifest version of 3.0.0.
|
||||
|
||||
## Contributing
|
||||
|
||||
See [Contribution Guide](./CONTRIBUTING.md)
|
||||
1
cdk/node_modules/@aws-cdk/cloud-assembly-schema/cli-version.json
generated
vendored
Normal file
1
cdk/node_modules/@aws-cdk/cloud-assembly-schema/cli-version.json
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":"2.1120.0"}
|
||||
35
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/aws-destination.d.ts
generated
vendored
Normal file
35
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/aws-destination.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Destination for assets that need to be uploaded to AWS
|
||||
*/
|
||||
export interface AwsDestination {
|
||||
/**
|
||||
* The region where this asset will need to be published
|
||||
*
|
||||
* @default - Current region
|
||||
*/
|
||||
readonly region?: string;
|
||||
/**
|
||||
* The role that needs to be assumed while publishing this asset
|
||||
*
|
||||
* @default - No role will be assumed
|
||||
*/
|
||||
readonly assumeRoleArn?: string;
|
||||
/**
|
||||
* The ExternalId that needs to be supplied while assuming this role
|
||||
*
|
||||
* @default - No ExternalId will be supplied
|
||||
*/
|
||||
readonly assumeRoleExternalId?: string;
|
||||
/**
|
||||
* Additional options to pass to STS when assuming the role.
|
||||
*
|
||||
* - `RoleArn` should not be used. Use the dedicated `assumeRoleArn` property instead.
|
||||
* - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
|
||||
* @default - No additional options.
|
||||
*/
|
||||
readonly assumeRoleAdditionalOptions?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/aws-destination.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/aws-destination.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXdzLWRlc3RpbmF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiYXdzLWRlc3RpbmF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIERlc3RpbmF0aW9uIGZvciBhc3NldHMgdGhhdCBuZWVkIHRvIGJlIHVwbG9hZGVkIHRvIEFXU1xuICovXG5leHBvcnQgaW50ZXJmYWNlIEF3c0Rlc3RpbmF0aW9uIHtcbiAgLyoqXG4gICAqIFRoZSByZWdpb24gd2hlcmUgdGhpcyBhc3NldCB3aWxsIG5lZWQgdG8gYmUgcHVibGlzaGVkXG4gICAqXG4gICAqIEBkZWZhdWx0IC0gQ3VycmVudCByZWdpb25cbiAgICovXG4gIHJlYWRvbmx5IHJlZ2lvbj86IHN0cmluZztcblxuICAvKipcbiAgICogVGhlIHJvbGUgdGhhdCBuZWVkcyB0byBiZSBhc3N1bWVkIHdoaWxlIHB1Ymxpc2hpbmcgdGhpcyBhc3NldFxuICAgKlxuICAgKiBAZGVmYXVsdCAtIE5vIHJvbGUgd2lsbCBiZSBhc3N1bWVkXG4gICAqL1xuICByZWFkb25seSBhc3N1bWVSb2xlQXJuPzogc3RyaW5nO1xuXG4gIC8qKlxuICAgKiBUaGUgRXh0ZXJuYWxJZCB0aGF0IG5lZWRzIHRvIGJlIHN1cHBsaWVkIHdoaWxlIGFzc3VtaW5nIHRoaXMgcm9sZVxuICAgKlxuICAgKiBAZGVmYXVsdCAtIE5vIEV4dGVybmFsSWQgd2lsbCBiZSBzdXBwbGllZFxuICAgKi9cbiAgcmVhZG9ubHkgYXNzdW1lUm9sZUV4dGVybmFsSWQ/OiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIEFkZGl0aW9uYWwgb3B0aW9ucyB0byBwYXNzIHRvIFNUUyB3aGVuIGFzc3VtaW5nIHRoZSByb2xlLlxuICAgKlxuICAgKiAtIGBSb2xlQXJuYCBzaG91bGQgbm90IGJlIHVzZWQuIFVzZSB0aGUgZGVkaWNhdGVkIGBhc3N1bWVSb2xlQXJuYCBwcm9wZXJ0eSBpbnN0ZWFkLlxuICAgKiAtIGBFeHRlcm5hbElkYCBzaG91bGQgbm90IGJlIHVzZWQuIFVzZSB0aGUgZGVkaWNhdGVkIGBhc3N1bWVSb2xlRXh0ZXJuYWxJZGAgaW5zdGVhZC5cbiAgICpcbiAgICogQHNlZSBodHRwczovL2RvY3MuYXdzLmFtYXpvbi5jb20vQVdTSmF2YVNjcmlwdFNESy9sYXRlc3QvQVdTL1NUUy5odG1sI2Fzc3VtZVJvbGUtcHJvcGVydHlcbiAgICogQGRlZmF1bHQgLSBObyBhZGRpdGlvbmFsIG9wdGlvbnMuXG4gICAqL1xuICByZWFkb25seSBhc3N1bWVSb2xlQWRkaXRpb25hbE9wdGlvbnM/OiB7IFtrZXk6IHN0cmluZ106IGFueSB9O1xufVxuIl19
|
||||
181
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/docker-image-asset.d.ts
generated
vendored
Normal file
181
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/docker-image-asset.d.ts
generated
vendored
Normal file
@@ -0,0 +1,181 @@
|
||||
import type { AwsDestination } from './aws-destination';
|
||||
/**
|
||||
* A file asset
|
||||
*/
|
||||
export interface DockerImageAsset {
|
||||
/**
|
||||
* A display name for this asset
|
||||
*
|
||||
* @default - The identifier will be used as the display name
|
||||
*/
|
||||
readonly displayName?: string;
|
||||
/**
|
||||
* Source description for container assets
|
||||
*/
|
||||
readonly source: DockerImageSource;
|
||||
/**
|
||||
* Destinations for this container asset
|
||||
*/
|
||||
readonly destinations: {
|
||||
[id: string]: DockerImageDestination;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Properties for how to produce a Docker image from a source
|
||||
*/
|
||||
export interface DockerImageSource {
|
||||
/**
|
||||
* The directory containing the Docker image build instructions.
|
||||
*
|
||||
* This path is relative to the asset manifest location.
|
||||
*
|
||||
* @default - Exactly one of `directory` and `executable` is required
|
||||
*/
|
||||
readonly directory?: string;
|
||||
/**
|
||||
* A command-line executable that returns the name of a local
|
||||
* Docker image on stdout after being run.
|
||||
*
|
||||
* @default - Exactly one of `directory` and `executable` is required
|
||||
*/
|
||||
readonly executable?: string[];
|
||||
/**
|
||||
* The name of the file with build instructions
|
||||
*
|
||||
* Only allowed when `directory` is set.
|
||||
*
|
||||
* @default "Dockerfile"
|
||||
*/
|
||||
readonly dockerFile?: string;
|
||||
/**
|
||||
* Target build stage in a Dockerfile with multiple build stages
|
||||
*
|
||||
* Only allowed when `directory` is set.
|
||||
*
|
||||
* @default - The last stage in the Dockerfile
|
||||
*/
|
||||
readonly dockerBuildTarget?: string;
|
||||
/**
|
||||
* Additional build arguments
|
||||
*
|
||||
* Only allowed when `directory` is set.
|
||||
*
|
||||
* @default - No additional build arguments
|
||||
*/
|
||||
readonly dockerBuildArgs?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* Additional build contexts
|
||||
*
|
||||
* Only allowed when `directory` is set.
|
||||
*
|
||||
* @default - No additional build contexts
|
||||
*/
|
||||
readonly dockerBuildContexts?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* SSH agent socket or keys
|
||||
*
|
||||
* Requires building with docker buildkit.
|
||||
*
|
||||
* @default - No ssh flag is set
|
||||
*/
|
||||
readonly dockerBuildSsh?: string;
|
||||
/**
|
||||
* Additional build secrets
|
||||
*
|
||||
* Only allowed when `directory` is set.
|
||||
*
|
||||
* @default - No additional build secrets
|
||||
*/
|
||||
readonly dockerBuildSecrets?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* Networking mode for the RUN commands during build. _Requires Docker Engine API v1.25+_.
|
||||
*
|
||||
* Specify this property to build images on a specific networking mode.
|
||||
*
|
||||
* @default - no networking mode specified
|
||||
*/
|
||||
readonly networkMode?: string;
|
||||
/**
|
||||
* Platform to build for. _Requires Docker Buildx_.
|
||||
*
|
||||
* Specify this property to build images on a specific platform/architecture.
|
||||
*
|
||||
* @default - current machine platform
|
||||
*/
|
||||
readonly platform?: string;
|
||||
/**
|
||||
* Outputs
|
||||
*
|
||||
* @default - no outputs are passed to the build command (default outputs are used)
|
||||
* @see https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs
|
||||
*/
|
||||
readonly dockerOutputs?: string[];
|
||||
/**
|
||||
* Cache from options to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no cache from options are passed to the build command
|
||||
* @see https://docs.docker.com/build/cache/backends/
|
||||
*/
|
||||
readonly cacheFrom?: DockerCacheOption[];
|
||||
/**
|
||||
* Cache to options to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no cache to options are passed to the build command
|
||||
* @see https://docs.docker.com/build/cache/backends/
|
||||
*/
|
||||
readonly cacheTo?: DockerCacheOption;
|
||||
/**
|
||||
* Disable the cache and pass `--no-cache` to the `docker build` command.
|
||||
*
|
||||
* @default - cache is used
|
||||
*/
|
||||
readonly cacheDisabled?: boolean;
|
||||
}
|
||||
/**
|
||||
* Where to publish docker images
|
||||
*/
|
||||
export interface DockerImageDestination extends AwsDestination {
|
||||
/**
|
||||
* Name of the ECR repository to publish to
|
||||
*/
|
||||
readonly repositoryName: string;
|
||||
/**
|
||||
* Tag of the image to publish
|
||||
*/
|
||||
readonly imageTag: string;
|
||||
}
|
||||
/**
|
||||
* Options for configuring the Docker cache backend
|
||||
*/
|
||||
export interface DockerCacheOption {
|
||||
/**
|
||||
* The type of cache to use.
|
||||
* Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.
|
||||
* @default - unspecified
|
||||
*
|
||||
* @example 'registry'
|
||||
*/
|
||||
readonly type: string;
|
||||
/**
|
||||
* Any parameters to pass into the docker cache backend configuration.
|
||||
* Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.
|
||||
* @default {} No options provided
|
||||
*
|
||||
* @example
|
||||
* declare const branch: string;
|
||||
*
|
||||
* const params = {
|
||||
* ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
|
||||
* mode: "max",
|
||||
* };
|
||||
*/
|
||||
readonly params?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/docker-image-asset.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/docker-image-asset.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
75
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/file-asset.d.ts
generated
vendored
Normal file
75
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/file-asset.d.ts
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
import type { AwsDestination } from './aws-destination';
|
||||
/**
|
||||
* A file asset
|
||||
*/
|
||||
export interface FileAsset {
|
||||
/**
|
||||
* A display name for this asset
|
||||
*
|
||||
* @default - The identifier will be used as the display name
|
||||
*/
|
||||
readonly displayName?: string;
|
||||
/**
|
||||
* Source description for file assets
|
||||
*/
|
||||
readonly source: FileSource;
|
||||
/**
|
||||
* Destinations for this file asset
|
||||
*/
|
||||
readonly destinations: {
|
||||
[id: string]: FileDestination;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Packaging strategy for file assets
|
||||
*/
|
||||
export declare enum FileAssetPackaging {
|
||||
/**
|
||||
* Upload the given path as a file
|
||||
*/
|
||||
FILE = "file",
|
||||
/**
|
||||
* The given path is a directory, zip it and upload
|
||||
*/
|
||||
ZIP_DIRECTORY = "zip"
|
||||
}
|
||||
/**
|
||||
* Describe the source of a file asset
|
||||
*/
|
||||
export interface FileSource {
|
||||
/**
|
||||
* External command which will produce the file asset to upload.
|
||||
*
|
||||
* @default - Exactly one of `executable` and `path` is required.
|
||||
*/
|
||||
readonly executable?: string[];
|
||||
/**
|
||||
* The filesystem object to upload
|
||||
*
|
||||
* This path is relative to the asset manifest location.
|
||||
*
|
||||
* @default - Exactly one of `executable` and `path` is required.
|
||||
*/
|
||||
readonly path?: string;
|
||||
/**
|
||||
* Packaging method
|
||||
*
|
||||
* Only allowed when `path` is specified.
|
||||
*
|
||||
* @default FILE
|
||||
*/
|
||||
readonly packaging?: FileAssetPackaging;
|
||||
}
|
||||
/**
|
||||
* Where in S3 a file asset needs to be published
|
||||
*/
|
||||
export interface FileDestination extends AwsDestination {
|
||||
/**
|
||||
* The name of the bucket
|
||||
*/
|
||||
readonly bucketName: string;
|
||||
/**
|
||||
* The destination object key
|
||||
*/
|
||||
readonly objectKey: string;
|
||||
}
|
||||
18
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/file-asset.js
generated
vendored
Normal file
18
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/file-asset.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.FileAssetPackaging = void 0;
|
||||
/**
|
||||
* Packaging strategy for file assets
|
||||
*/
|
||||
var FileAssetPackaging;
|
||||
(function (FileAssetPackaging) {
|
||||
/**
|
||||
* Upload the given path as a file
|
||||
*/
|
||||
FileAssetPackaging["FILE"] = "file";
|
||||
/**
|
||||
* The given path is a directory, zip it and upload
|
||||
*/
|
||||
FileAssetPackaging["ZIP_DIRECTORY"] = "zip";
|
||||
})(FileAssetPackaging || (exports.FileAssetPackaging = FileAssetPackaging = {}));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZS1hc3NldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImZpbGUtYXNzZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBd0JBOztHQUVHO0FBQ0gsSUFBWSxrQkFVWDtBQVZELFdBQVksa0JBQWtCO0lBQzVCOztPQUVHO0lBQ0gsbUNBQWEsQ0FBQTtJQUViOztPQUVHO0lBQ0gsMkNBQXFCLENBQUE7QUFDdkIsQ0FBQyxFQVZXLGtCQUFrQixrQ0FBbEIsa0JBQWtCLFFBVTdCIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHR5cGUgeyBBd3NEZXN0aW5hdGlvbiB9IGZyb20gJy4vYXdzLWRlc3RpbmF0aW9uJztcblxuLyoqXG4gKiBBIGZpbGUgYXNzZXRcbiAqL1xuZXhwb3J0IGludGVyZmFjZSBGaWxlQXNzZXQge1xuICAvKipcbiAgICogQSBkaXNwbGF5IG5hbWUgZm9yIHRoaXMgYXNzZXRcbiAgICpcbiAgICogQGRlZmF1bHQgLSBUaGUgaWRlbnRpZmllciB3aWxsIGJlIHVzZWQgYXMgdGhlIGRpc3BsYXkgbmFtZVxuICAgKi9cbiAgcmVhZG9ubHkgZGlzcGxheU5hbWU/OiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIFNvdXJjZSBkZXNjcmlwdGlvbiBmb3IgZmlsZSBhc3NldHNcbiAgICovXG4gIHJlYWRvbmx5IHNvdXJjZTogRmlsZVNvdXJjZTtcblxuICAvKipcbiAgICogRGVzdGluYXRpb25zIGZvciB0aGlzIGZpbGUgYXNzZXRcbiAgICovXG4gIHJlYWRvbmx5IGRlc3RpbmF0aW9uczogeyBbaWQ6IHN0cmluZ106IEZpbGVEZXN0aW5hdGlvbiB9O1xufVxuXG4vKipcbiAqIFBhY2thZ2luZyBzdHJhdGVneSBmb3IgZmlsZSBhc3NldHNcbiAqL1xuZXhwb3J0IGVudW0gRmlsZUFzc2V0UGFja2FnaW5nIHtcbiAgLyoqXG4gICAqIFVwbG9hZCB0aGUgZ2l2ZW4gcGF0aCBhcyBhIGZpbGVcbiAgICovXG4gIEZJTEUgPSAnZmlsZScsXG5cbiAgLyoqXG4gICAqIFRoZSBnaXZlbiBwYXRoIGlzIGEgZGlyZWN0b3J5LCB6aXAgaXQgYW5kIHVwbG9hZFxuICAgKi9cbiAgWklQX0RJUkVDVE9SWSA9ICd6aXAnLFxufVxuXG4vKipcbiAqIERlc2NyaWJlIHRoZSBzb3VyY2Ugb2YgYSBmaWxlIGFzc2V0XG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgRmlsZVNvdXJjZSB7XG4gIC8qKlxuICAgKiBFeHRlcm5hbCBjb21tYW5kIHdoaWNoIHdpbGwgcHJvZHVjZSB0aGUgZmlsZSBhc3NldCB0byB1cGxvYWQuXG4gICAqXG4gICAqIEBkZWZhdWx0IC0gRXhhY3RseSBvbmUgb2YgYGV4ZWN1dGFibGVgIGFuZCBgcGF0aGAgaXMgcmVxdWlyZWQuXG4gICAqL1xuICByZWFkb25seSBleGVjdXRhYmxlPzogc3RyaW5nW107XG5cbiAgLyoqXG4gICAqIFRoZSBmaWxlc3lzdGVtIG9iamVjdCB0byB1cGxvYWRcbiAgICpcbiAgICogVGhpcyBwYXRoIGlzIHJlbGF0aXZlIHRvIHRoZSBhc3NldCBtYW5pZmVzdCBsb2NhdGlvbi5cbiAgICpcbiAgICogQGRlZmF1bHQgLSBFeGFjdGx5IG9uZSBvZiBgZXhlY3V0YWJsZWAgYW5kIGBwYXRoYCBpcyByZXF1aXJlZC5cbiAgICovXG4gIHJlYWRvbmx5IHBhdGg/OiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIFBhY2thZ2luZyBtZXRob2RcbiAgICpcbiAgICogT25seSBhbGxvd2VkIHdoZW4gYHBhdGhgIGlzIHNwZWNpZmllZC5cbiAgICpcbiAgICogQGRlZmF1bHQgRklMRVxuICAgKi9cbiAgcmVhZG9ubHkgcGFja2FnaW5nPzogRmlsZUFzc2V0UGFja2FnaW5nO1xufVxuXG4vKipcbiAqIFdoZXJlIGluIFMzIGEgZmlsZSBhc3NldCBuZWVkcyB0byBiZSBwdWJsaXNoZWRcbiAqL1xuZXhwb3J0IGludGVyZmFjZSBGaWxlRGVzdGluYXRpb24gZXh0ZW5kcyBBd3NEZXN0aW5hdGlvbiB7XG4gIC8qKlxuICAgKiBUaGUgbmFtZSBvZiB0aGUgYnVja2V0XG4gICAqL1xuICByZWFkb25seSBidWNrZXROYW1lOiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIFRoZSBkZXN0aW5hdGlvbiBvYmplY3Qga2V5XG4gICAqL1xuICByZWFkb25seSBvYmplY3RLZXk6IHN0cmluZztcbn1cbiJdfQ==
|
||||
4
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/index.d.ts
generated
vendored
Normal file
4
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './schema';
|
||||
export * from './docker-image-asset';
|
||||
export * from './file-asset';
|
||||
export * from './aws-destination';
|
||||
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/index.js
generated
vendored
Normal file
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./schema"), exports);
|
||||
__exportStar(require("./docker-image-asset"), exports);
|
||||
__exportStar(require("./file-asset"), exports);
|
||||
__exportStar(require("./aws-destination"), exports);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkNBQXlCO0FBQ3pCLHVEQUFxQztBQUNyQywrQ0FBNkI7QUFDN0Isb0RBQWtDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9zY2hlbWEnO1xuZXhwb3J0ICogZnJvbSAnLi9kb2NrZXItaW1hZ2UtYXNzZXQnO1xuZXhwb3J0ICogZnJvbSAnLi9maWxlLWFzc2V0JztcbmV4cG9ydCAqIGZyb20gJy4vYXdzLWRlc3RpbmF0aW9uJztcbiJdfQ==
|
||||
27
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/schema.d.ts
generated
vendored
Normal file
27
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { DockerImageAsset } from './docker-image-asset';
|
||||
import type { FileAsset } from './file-asset';
|
||||
/**
|
||||
* Definitions for the asset manifest
|
||||
*/
|
||||
export interface AssetManifest {
|
||||
/**
|
||||
* Version of the manifest
|
||||
*/
|
||||
readonly version: string;
|
||||
/**
|
||||
* The file assets in this manifest
|
||||
*
|
||||
* @default - No files
|
||||
*/
|
||||
readonly files?: {
|
||||
[id: string]: FileAsset;
|
||||
};
|
||||
/**
|
||||
* The Docker image assets in this manifest
|
||||
*
|
||||
* @default - No Docker images
|
||||
*/
|
||||
readonly dockerImages?: {
|
||||
[id: string]: DockerImageAsset;
|
||||
};
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/schema.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/assets/schema.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2NoZW1hLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IERvY2tlckltYWdlQXNzZXQgfSBmcm9tICcuL2RvY2tlci1pbWFnZS1hc3NldCc7XG5pbXBvcnQgdHlwZSB7IEZpbGVBc3NldCB9IGZyb20gJy4vZmlsZS1hc3NldCc7XG5cbi8qKlxuICogRGVmaW5pdGlvbnMgZm9yIHRoZSBhc3NldCBtYW5pZmVzdFxuICovXG5leHBvcnQgaW50ZXJmYWNlIEFzc2V0TWFuaWZlc3Qge1xuICAvKipcbiAgICogVmVyc2lvbiBvZiB0aGUgbWFuaWZlc3RcbiAgICovXG4gIHJlYWRvbmx5IHZlcnNpb246IHN0cmluZztcblxuICAvKipcbiAgICogVGhlIGZpbGUgYXNzZXRzIGluIHRoaXMgbWFuaWZlc3RcbiAgICpcbiAgICogQGRlZmF1bHQgLSBObyBmaWxlc1xuICAgKi9cbiAgcmVhZG9ubHkgZmlsZXM/OiB7IFtpZDogc3RyaW5nXTogRmlsZUFzc2V0IH07XG5cbiAgLyoqXG4gICAqIFRoZSBEb2NrZXIgaW1hZ2UgYXNzZXRzIGluIHRoaXMgbWFuaWZlc3RcbiAgICpcbiAgICogQGRlZmF1bHQgLSBObyBEb2NrZXIgaW1hZ2VzXG4gICAqL1xuICByZWFkb25seSBkb2NrZXJJbWFnZXM/OiB7IFtpZDogc3RyaW5nXTogRG9ja2VySW1hZ2VBc3NldCB9O1xufVxuIl19
|
||||
301
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.d.ts
generated
vendored
Normal file
301
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,301 @@
|
||||
/**
|
||||
* Information needed to access an IAM role created
|
||||
* as part of the bootstrap process
|
||||
*/
|
||||
export interface BootstrapRole {
|
||||
/**
|
||||
* The ARN of the IAM role created as part of bootrapping
|
||||
* e.g. lookupRoleArn
|
||||
*/
|
||||
readonly arn: string;
|
||||
/**
|
||||
* External ID to use when assuming the bootstrap role
|
||||
*
|
||||
* @default - No external ID
|
||||
*/
|
||||
readonly assumeRoleExternalId?: string;
|
||||
/**
|
||||
* Additional options to pass to STS when assuming the role.
|
||||
*
|
||||
* - `RoleArn` should not be used. Use the dedicated `arn` property instead.
|
||||
* - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
|
||||
* @default - No additional options.
|
||||
*/
|
||||
readonly assumeRoleAdditionalOptions?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* Version of bootstrap stack required to use this role
|
||||
*
|
||||
* @default - No bootstrap stack required
|
||||
*/
|
||||
readonly requiresBootstrapStackVersion?: number;
|
||||
/**
|
||||
* Name of SSM parameter with bootstrap stack version
|
||||
*
|
||||
* @default - Discover SSM parameter by reading stack
|
||||
*/
|
||||
readonly bootstrapStackVersionSsmParameter?: string;
|
||||
}
|
||||
/**
|
||||
* Artifact properties for CloudFormation stacks.
|
||||
*/
|
||||
export interface AwsCloudFormationStackProperties {
|
||||
/**
|
||||
* A file relative to the assembly root which contains the CloudFormation template for this stack.
|
||||
*/
|
||||
readonly templateFile: string;
|
||||
/**
|
||||
* Values for CloudFormation stack parameters that should be passed when the stack is deployed.
|
||||
*
|
||||
* @default - No parameters
|
||||
*/
|
||||
readonly parameters?: {
|
||||
[id: string]: string;
|
||||
};
|
||||
/**
|
||||
* Values for CloudFormation stack tags that should be passed when the stack is deployed.
|
||||
*
|
||||
* N.B.: Tags are also written to stack metadata, under the path of the Stack
|
||||
* construct. Only in CDK CLI v1 are those tags found in metadata used for
|
||||
* actual deployments; in all stable versions of CDK only the stack tags
|
||||
* directly found in the `tags` property of `AwsCloudFormationStack` artifact
|
||||
* (i.e., this property) are used.
|
||||
*
|
||||
* @default - No tags
|
||||
*/
|
||||
readonly tags?: {
|
||||
[id: string]: string;
|
||||
};
|
||||
/**
|
||||
* SNS Notification ARNs that should receive CloudFormation Stack Events.
|
||||
*
|
||||
* @default - No notification arns
|
||||
*/
|
||||
readonly notificationArns?: string[];
|
||||
/**
|
||||
* The name to use for the CloudFormation stack.
|
||||
* @default - name derived from artifact ID
|
||||
*/
|
||||
readonly stackName?: string;
|
||||
/**
|
||||
* Whether to enable termination protection for this stack.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly terminationProtection?: boolean;
|
||||
/**
|
||||
* The role that needs to be assumed to deploy the stack
|
||||
*
|
||||
* @default - No role is assumed (current credentials are used)
|
||||
*/
|
||||
readonly assumeRoleArn?: string;
|
||||
/**
|
||||
* External ID to use when assuming role for cloudformation deployments
|
||||
*
|
||||
* @default - No external ID
|
||||
*/
|
||||
readonly assumeRoleExternalId?: string;
|
||||
/**
|
||||
* Additional options to pass to STS when assuming the role.
|
||||
*
|
||||
* - `RoleArn` should not be used. Use the dedicated `assumeRoleArn` property instead.
|
||||
* - `ExternalId` should not be used. Use the dedicated `assumeRoleExternalId` instead.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
|
||||
* @default - No additional options.
|
||||
*/
|
||||
readonly assumeRoleAdditionalOptions?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* The role that is passed to CloudFormation to execute the change set
|
||||
*
|
||||
* @default - No role is passed (currently assumed role/credentials are used)
|
||||
*/
|
||||
readonly cloudFormationExecutionRoleArn?: string;
|
||||
/**
|
||||
* The role to use to look up values from the target AWS account
|
||||
*
|
||||
* @default - No role is assumed (current credentials are used)
|
||||
*/
|
||||
readonly lookupRole?: BootstrapRole;
|
||||
/**
|
||||
* If the stack template has already been included in the asset manifest, its asset URL
|
||||
*
|
||||
* @default - Not uploaded yet, upload just before deploying
|
||||
*/
|
||||
readonly stackTemplateAssetObjectUrl?: string;
|
||||
/**
|
||||
* Version of bootstrap stack required to deploy this stack
|
||||
*
|
||||
* @default - No bootstrap stack required
|
||||
*/
|
||||
readonly requiresBootstrapStackVersion?: number;
|
||||
/**
|
||||
* SSM parameter where the bootstrap stack version number can be found
|
||||
*
|
||||
* Only used if `requiresBootstrapStackVersion` is set.
|
||||
*
|
||||
* - If this value is not set, the bootstrap stack name must be known at
|
||||
* deployment time so the stack version can be looked up from the stack
|
||||
* outputs.
|
||||
* - If this value is set, the bootstrap stack can have any name because
|
||||
* we won't need to look it up.
|
||||
*
|
||||
* @default - Bootstrap stack version number looked up
|
||||
*/
|
||||
readonly bootstrapStackVersionSsmParameter?: string;
|
||||
/**
|
||||
* Whether this stack should be validated by the CLI after synthesis
|
||||
*
|
||||
* @default - false
|
||||
*/
|
||||
readonly validateOnSynth?: boolean;
|
||||
}
|
||||
/**
|
||||
* Configuration options for the Asset Manifest
|
||||
*/
|
||||
export interface AssetManifestOptions {
|
||||
/**
|
||||
* Version of bootstrap stack required to deploy this stack
|
||||
*
|
||||
* @default - Version 1 (basic modern bootstrap stack)
|
||||
*/
|
||||
readonly requiresBootstrapStackVersion?: number;
|
||||
/**
|
||||
* SSM parameter where the bootstrap stack version number can be found
|
||||
*
|
||||
* - If this value is not set, the bootstrap stack name must be known at
|
||||
* deployment time so the stack version can be looked up from the stack
|
||||
* outputs.
|
||||
* - If this value is set, the bootstrap stack can have any name because
|
||||
* we won't need to look it up.
|
||||
*
|
||||
* @default - Bootstrap stack version number looked up
|
||||
*/
|
||||
readonly bootstrapStackVersionSsmParameter?: string;
|
||||
}
|
||||
/**
|
||||
* Artifact properties for the Asset Manifest
|
||||
*/
|
||||
export interface AssetManifestProperties extends AssetManifestOptions {
|
||||
/**
|
||||
* Filename of the asset manifest
|
||||
*/
|
||||
readonly file: string;
|
||||
}
|
||||
/**
|
||||
* Artifact properties for the Construct Tree Artifact
|
||||
*/
|
||||
export interface TreeArtifactProperties {
|
||||
/**
|
||||
* Filename of the tree artifact
|
||||
*/
|
||||
readonly file: string;
|
||||
}
|
||||
/**
|
||||
* Artifact properties for nested cloud assemblies
|
||||
*/
|
||||
export interface NestedCloudAssemblyProperties {
|
||||
/**
|
||||
* Relative path to the nested cloud assembly
|
||||
*/
|
||||
readonly directoryName: string;
|
||||
/**
|
||||
* Display name for the cloud assembly
|
||||
*
|
||||
* @default - The artifact ID
|
||||
*/
|
||||
readonly displayName?: string;
|
||||
}
|
||||
/**
|
||||
* Artifact properties for a feature flag report
|
||||
*
|
||||
* A feature flag report is small enough that all the properties can be inlined
|
||||
* here, and doesn't need an additional file.
|
||||
*/
|
||||
export interface FeatureFlagReportProperties {
|
||||
/**
|
||||
* The library that this feature flag report applies to.
|
||||
*/
|
||||
readonly module: string;
|
||||
/**
|
||||
* Information about every feature flag supported by this library.
|
||||
*/
|
||||
readonly flags: {
|
||||
[flagName: string]: FeatureFlag;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* A single feature flag
|
||||
*/
|
||||
export interface FeatureFlag {
|
||||
/**
|
||||
* The library-recommended value for this flag, if any
|
||||
*
|
||||
* It is possible that there is no recommended value.
|
||||
*
|
||||
* @default - No recommended value.
|
||||
*/
|
||||
readonly recommendedValue?: any;
|
||||
/**
|
||||
* The value configured by the user
|
||||
*
|
||||
* This is the value configured at the root of the tree. Users may also have
|
||||
* configured values at specific locations in the tree; we don't report on
|
||||
* those.
|
||||
*
|
||||
* @default - Not configured by the user
|
||||
*/
|
||||
readonly userValue?: any;
|
||||
/**
|
||||
* Explanation about the purpose of this flag that can be shown to the user.
|
||||
*
|
||||
* @default - No description
|
||||
*/
|
||||
readonly explanation?: string;
|
||||
/**
|
||||
* The value of the flag that produces the same behavior as when the flag is not configured at all
|
||||
*
|
||||
*The structure of this field is a historical accident. The type of this field
|
||||
*should have been boolean, which should have contained the default value for
|
||||
*the flag appropriate for the *current* version of the CDK library. We are
|
||||
*not rectifying this accident because doing so
|
||||
*
|
||||
* Instead, the canonical way to access this value is by evaluating
|
||||
* `unconfiguredBehavesLike?.v2 ?? false`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly unconfiguredBehavesLike?: UnconfiguredBehavesLike;
|
||||
}
|
||||
export interface UnconfiguredBehavesLike {
|
||||
/**
|
||||
* Historical accident, don't use.
|
||||
*
|
||||
* This value may be present, but it should never be used. The actual value is
|
||||
* in the `v2` field, regardless of the version of the CDK library.
|
||||
*
|
||||
* @default - ignore
|
||||
*/
|
||||
readonly v1?: any;
|
||||
/**
|
||||
* The value of the flag that produces the same behavior as when the flag is not configured at all
|
||||
*
|
||||
* Even though it is called 'v2', this is the official name of this field. In
|
||||
* any future versions of CDK (v3, v4, ...), this field will still be called 'v2'.
|
||||
*
|
||||
* The structure of this field is a historical accident. See the comment on
|
||||
* `unconfiguredBehavesLike` for more information.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly v2?: any;
|
||||
}
|
||||
/**
|
||||
* Properties for manifest artifacts
|
||||
*/
|
||||
export type ArtifactProperties = AwsCloudFormationStackProperties | AssetManifestProperties | TreeArtifactProperties | NestedCloudAssemblyProperties | FeatureFlagReportProperties;
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/artifact-schema.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
462
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.d.ts
generated
vendored
Normal file
462
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.d.ts
generated
vendored
Normal file
@@ -0,0 +1,462 @@
|
||||
import type { Tag } from './metadata-schema';
|
||||
/**
|
||||
* Identifier for the context provider
|
||||
*/
|
||||
export declare enum ContextProvider {
|
||||
/**
|
||||
* AMI provider
|
||||
*/
|
||||
AMI_PROVIDER = "ami",
|
||||
/**
|
||||
* AZ provider
|
||||
*/
|
||||
AVAILABILITY_ZONE_PROVIDER = "availability-zones",
|
||||
/**
|
||||
* Route53 Hosted Zone provider
|
||||
*/
|
||||
HOSTED_ZONE_PROVIDER = "hosted-zone",
|
||||
/**
|
||||
* SSM Parameter Provider
|
||||
*/
|
||||
SSM_PARAMETER_PROVIDER = "ssm",
|
||||
/**
|
||||
* VPC Provider
|
||||
*/
|
||||
VPC_PROVIDER = "vpc-provider",
|
||||
/**
|
||||
* VPC Endpoint Service AZ Provider
|
||||
*/
|
||||
ENDPOINT_SERVICE_AVAILABILITY_ZONE_PROVIDER = "endpoint-service-availability-zones",
|
||||
/**
|
||||
* Load balancer provider
|
||||
*/
|
||||
LOAD_BALANCER_PROVIDER = "load-balancer",
|
||||
/**
|
||||
* Load balancer listener provider
|
||||
*/
|
||||
LOAD_BALANCER_LISTENER_PROVIDER = "load-balancer-listener",
|
||||
/**
|
||||
* Security group provider
|
||||
*/
|
||||
SECURITY_GROUP_PROVIDER = "security-group",
|
||||
/**
|
||||
* KMS Key Provider
|
||||
*/
|
||||
KEY_PROVIDER = "key-provider",
|
||||
/**
|
||||
* CCAPI Provider
|
||||
*/
|
||||
CC_API_PROVIDER = "cc-api-provider",
|
||||
/**
|
||||
* A plugin provider (the actual plugin name will be in the properties)
|
||||
*/
|
||||
PLUGIN = "plugin"
|
||||
}
|
||||
/**
|
||||
* Options for context lookup roles.
|
||||
*/
|
||||
export interface ContextLookupRoleOptions {
|
||||
/**
|
||||
* Query account
|
||||
*/
|
||||
readonly account: string;
|
||||
/**
|
||||
* Query region
|
||||
*/
|
||||
readonly region: string;
|
||||
/**
|
||||
* The ARN of the role that should be used to look up the missing values
|
||||
*
|
||||
* @default - None
|
||||
*/
|
||||
readonly lookupRoleArn?: string;
|
||||
/**
|
||||
* The ExternalId that needs to be supplied while assuming this role
|
||||
*
|
||||
* @default - No ExternalId will be supplied
|
||||
*/
|
||||
readonly lookupRoleExternalId?: string;
|
||||
/**
|
||||
* Additional options to pass to STS when assuming the lookup role.
|
||||
*
|
||||
* - `RoleArn` should not be used. Use the dedicated `lookupRoleArn` property instead.
|
||||
* - `ExternalId` should not be used. Use the dedicated `lookupRoleExternalId` instead.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/STS.html#assumeRole-property
|
||||
* @default - No additional options.
|
||||
*/
|
||||
readonly assumeRoleAdditionalOptions?: {
|
||||
[key: string]: any;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Query to AMI context provider
|
||||
*/
|
||||
export interface AmiContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Owners to DescribeImages call
|
||||
*
|
||||
* @default - All owners
|
||||
*/
|
||||
readonly owners?: string[];
|
||||
/**
|
||||
* Filters to DescribeImages call
|
||||
*/
|
||||
readonly filters: {
|
||||
[key: string]: string[];
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Query to availability zone context provider
|
||||
*/
|
||||
export interface AvailabilityZonesContextQuery extends ContextLookupRoleOptions {
|
||||
}
|
||||
/**
|
||||
* Query to hosted zone context provider
|
||||
*/
|
||||
export interface HostedZoneContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* The domain name e.g. example.com to lookup
|
||||
*/
|
||||
readonly domainName: string;
|
||||
/**
|
||||
* True if the zone you want to find is a private hosted zone
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly privateZone?: boolean;
|
||||
/**
|
||||
* The VPC ID to that the private zone must be associated with
|
||||
*
|
||||
* If you provide VPC ID and privateZone is false, this will return no results
|
||||
* and raise an error.
|
||||
*
|
||||
* @default - Required if privateZone=true
|
||||
*/
|
||||
readonly vpcId?: string;
|
||||
}
|
||||
/**
|
||||
* Query to SSM Parameter Context Provider
|
||||
*/
|
||||
export interface SSMParameterContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Parameter name to query
|
||||
*/
|
||||
readonly parameterName: string;
|
||||
}
|
||||
/**
|
||||
* Query input for looking up a VPC
|
||||
*/
|
||||
export interface VpcContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Filters to apply to the VPC
|
||||
*
|
||||
* Filter parameters are the same as passed to DescribeVpcs.
|
||||
*
|
||||
* @see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html
|
||||
*/
|
||||
readonly filter: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Whether to populate the subnetGroups field of the `VpcContextResponse`,
|
||||
* which contains potentially asymmetric subnet groups.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly returnAsymmetricSubnets?: boolean;
|
||||
/**
|
||||
* Optional tag for subnet group name.
|
||||
* If not provided, we'll look at the aws-cdk:subnet-name tag.
|
||||
* If the subnet does not have the specified tag,
|
||||
* we'll use its type as the name.
|
||||
*
|
||||
* @default 'aws-cdk:subnet-name'
|
||||
*/
|
||||
readonly subnetGroupNameTag?: string;
|
||||
/**
|
||||
* Whether to populate the `vpnGatewayId` field of the `VpcContextResponse`,
|
||||
* which contains the VPN Gateway ID, if one exists. You can explicitly
|
||||
* disable this in order to avoid the lookup if you know the VPC does not have
|
||||
* a VPN Gatway attached.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly returnVpnGateways?: boolean;
|
||||
}
|
||||
/**
|
||||
* Query to endpoint service context provider
|
||||
*/
|
||||
export interface EndpointServiceAvailabilityZonesContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Query service name
|
||||
*/
|
||||
readonly serviceName: string;
|
||||
}
|
||||
/**
|
||||
* Type of load balancer
|
||||
*/
|
||||
export declare enum LoadBalancerType {
|
||||
/**
|
||||
* Network load balancer
|
||||
*/
|
||||
NETWORK = "network",
|
||||
/**
|
||||
* Application load balancer
|
||||
*/
|
||||
APPLICATION = "application"
|
||||
}
|
||||
/**
|
||||
* Filters for selecting load balancers
|
||||
*/
|
||||
export interface LoadBalancerFilter extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Filter load balancers by their type
|
||||
*/
|
||||
readonly loadBalancerType: LoadBalancerType;
|
||||
/**
|
||||
* Find by load balancer's ARN
|
||||
* @default - does not search by load balancer arn
|
||||
*/
|
||||
readonly loadBalancerArn?: string;
|
||||
/**
|
||||
* Match load balancer tags
|
||||
* @default - does not match load balancers by tags
|
||||
*/
|
||||
readonly loadBalancerTags?: Tag[];
|
||||
}
|
||||
/**
|
||||
* Query input for looking up a load balancer
|
||||
*/
|
||||
export interface LoadBalancerContextQuery extends LoadBalancerFilter {
|
||||
}
|
||||
/**
|
||||
* The protocol for connections from clients to the load balancer
|
||||
*/
|
||||
export declare enum LoadBalancerListenerProtocol {
|
||||
/**
|
||||
* HTTP protocol
|
||||
*/
|
||||
HTTP = "HTTP",
|
||||
/**
|
||||
* HTTPS protocol
|
||||
*/
|
||||
HTTPS = "HTTPS",
|
||||
/**
|
||||
* TCP protocol
|
||||
*/
|
||||
TCP = "TCP",
|
||||
/**
|
||||
* TLS protocol
|
||||
*/
|
||||
TLS = "TLS",
|
||||
/**
|
||||
* UDP protocol
|
||||
* */
|
||||
UDP = "UDP",
|
||||
/**
|
||||
* TCP and UDP protocol
|
||||
* */
|
||||
TCP_UDP = "TCP_UDP"
|
||||
}
|
||||
/**
|
||||
* Query input for looking up a load balancer listener
|
||||
*/
|
||||
export interface LoadBalancerListenerContextQuery extends LoadBalancerFilter {
|
||||
/**
|
||||
* Find by listener's arn
|
||||
* @default - does not find by listener arn
|
||||
*/
|
||||
readonly listenerArn?: string;
|
||||
/**
|
||||
* Filter by listener protocol
|
||||
* @default - does not filter by listener protocol
|
||||
*/
|
||||
readonly listenerProtocol?: LoadBalancerListenerProtocol;
|
||||
/**
|
||||
* Filter listeners by listener port
|
||||
* @default - does not filter by a listener port
|
||||
*/
|
||||
readonly listenerPort?: number;
|
||||
}
|
||||
/**
|
||||
* Query input for looking up a security group
|
||||
*/
|
||||
export interface SecurityGroupContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Security group id
|
||||
*
|
||||
* @default - None
|
||||
*/
|
||||
readonly securityGroupId?: string;
|
||||
/**
|
||||
* Security group name
|
||||
*
|
||||
* @default - None
|
||||
*/
|
||||
readonly securityGroupName?: string;
|
||||
/**
|
||||
* VPC ID
|
||||
*
|
||||
* @default - None
|
||||
*/
|
||||
readonly vpcId?: string;
|
||||
}
|
||||
/**
|
||||
* Query input for looking up a KMS Key
|
||||
*/
|
||||
export interface KeyContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* Alias name used to search the Key
|
||||
*/
|
||||
readonly aliasName: string;
|
||||
}
|
||||
/**
|
||||
* Query input for lookup up CloudFormation resources using CC API
|
||||
*
|
||||
* The example below is required to successfully compile CDK (otherwise,
|
||||
* the CDK build will generate a synthetic example for the below, but it
|
||||
* doesn't have enough type information about the literal string union
|
||||
* to generate a validly compiling example).
|
||||
*
|
||||
* @example
|
||||
* import { CcApiContextQuery } from '@aws-cdk/cloud-assembly-schema';
|
||||
*
|
||||
* const x: CcApiContextQuery = {
|
||||
* typeName: 'AWS::Some::Type',
|
||||
* expectedMatchCount: 'exactly-one',
|
||||
* resourceModel: {SomeArn: 'arn:aws:....'},
|
||||
* propertiesToReturn: ['SomeProp'],
|
||||
* account: '11111111111',
|
||||
* region: 'us-east-1',
|
||||
* };
|
||||
*/
|
||||
export interface CcApiContextQuery extends ContextLookupRoleOptions {
|
||||
/**
|
||||
* The CloudFormation resource type.
|
||||
* See https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html
|
||||
*/
|
||||
readonly typeName: string;
|
||||
/**
|
||||
* Identifier of the resource to look up using `GetResource`.
|
||||
*
|
||||
* Specifying exactIdentifier will return exactly one result, or throw an error
|
||||
* unless `ignoreErrorOnMissingContext` is set.
|
||||
*
|
||||
* @default - Either exactIdentifier or propertyMatch should be specified.
|
||||
*/
|
||||
readonly exactIdentifier?: string;
|
||||
/**
|
||||
* The resource model to use to select the resources, using `ListResources`..
|
||||
*
|
||||
* This is needed for sub-resources where the parent Arn is required.
|
||||
*
|
||||
* See https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-list.html#resource-operations-list-containers
|
||||
*
|
||||
* @default - no resource Model is provided
|
||||
*/
|
||||
readonly resourceModel?: Record<string, unknown>;
|
||||
/**
|
||||
* Returns any resources matching these properties, using `ListResources`.
|
||||
*
|
||||
* By default, specifying propertyMatch will successfully return 0 or more
|
||||
* results. To throw an error if the number of results is unexpected (and
|
||||
* prevent the query results from being committed to context), specify
|
||||
* `expectedMatchCount`.
|
||||
*
|
||||
* ## Notes on property completeness
|
||||
*
|
||||
* CloudControl API's `ListResources` may return fewer properties than
|
||||
* `GetResource` would, depending on the resource implementation.
|
||||
*
|
||||
* The resources that `propertyMatch` matches against will *only ever* be the
|
||||
* properties returned by the `ListResources` call.
|
||||
*
|
||||
* @default - Either exactIdentifier or propertyMatch should be specified.
|
||||
*/
|
||||
readonly propertyMatch?: Record<string, unknown>;
|
||||
/**
|
||||
* This is a set of properties returned from CC API that we want to return from ContextQuery.
|
||||
*
|
||||
* If any properties listed here are absent from the target resource, an error will be thrown.
|
||||
*
|
||||
* The returned object will always include the key `Identifier` with the CC-API returned
|
||||
* field `Identifier`.
|
||||
*
|
||||
* ## Notes on property completeness
|
||||
*
|
||||
* CloudControl API's `ListResources` may return fewer properties than
|
||||
* `GetResource` would, depending on the resource implementation.
|
||||
*
|
||||
* The returned properties here are *currently* selected from the response
|
||||
* object that CloudControl API returns to the CDK CLI.
|
||||
*
|
||||
* However, if we find there is need to do so, we may decide to change this
|
||||
* behavior in the future: we might change it to perform an additional
|
||||
* `GetResource` call for resources matched by `propertyMatch`.
|
||||
*/
|
||||
readonly propertiesToReturn: string[];
|
||||
/**
|
||||
* Expected count of results if `propertyMatch` is specified.
|
||||
*
|
||||
* If the expected result count does not match the actual count,
|
||||
* by default an error is produced and the result is not committed to cached
|
||||
* context, and the user can correct the situation and try again without
|
||||
* having to manually clear out the context key using `cdk context --remove`
|
||||
*
|
||||
* If the value of * `ignoreErrorOnMissingContext` is `true`, the value of
|
||||
* `expectedMatchCount` is `at-least-one | exactly-one` and the number
|
||||
* of found resources is 0, `dummyValue` is returned and committed to context
|
||||
* instead.
|
||||
*
|
||||
* @default 'any'
|
||||
*/
|
||||
readonly expectedMatchCount?: 'any' | 'at-least-one' | 'at-most-one' | 'exactly-one';
|
||||
/**
|
||||
* The value to return if the resource was not found and `ignoreErrorOnMissingContext` is true.
|
||||
*
|
||||
* If supplied, `dummyValue` should be an array of objects.
|
||||
*
|
||||
* `dummyValue` does not have to have elements, and it may have objects with
|
||||
* different properties than the properties in `propertiesToReturn`, but it
|
||||
* will be easiest for downstream code if the `dummyValue` conforms to
|
||||
* the expected response shape.
|
||||
*
|
||||
* @default - No dummy value available
|
||||
*/
|
||||
readonly dummyValue?: any;
|
||||
/**
|
||||
* Ignore an error and return the `dummyValue` instead if the resource was not found.
|
||||
*
|
||||
* - In case of an `exactIdentifier` lookup, return the `dummyValue` if the resource with
|
||||
* that identifier was not found.
|
||||
* - In case of a `propertyMatch` lookup, return the `dummyValue` if `expectedMatchCount`
|
||||
* is `at-least-one | exactly-one` and the number of resources found was 0.
|
||||
*
|
||||
* if `ignoreErrorOnMissingContext` is set, `dummyValue` should be set and be an array.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly ignoreErrorOnMissingContext?: boolean;
|
||||
}
|
||||
/**
|
||||
* Query input for plugins
|
||||
*
|
||||
* This alternate branch is necessary because it needs to be able to escape all type checking
|
||||
* we do on on the cloud assembly -- we cannot know the properties that will be used a priori.
|
||||
*/
|
||||
export interface PluginContextQuery {
|
||||
/**
|
||||
* The name of the plugin
|
||||
*/
|
||||
readonly pluginName: string;
|
||||
/**
|
||||
* Arbitrary other arguments for the plugin.
|
||||
*
|
||||
* This index signature is not usable in non-TypeScript/JavaScript languages.
|
||||
*
|
||||
* @jsii ignore
|
||||
*/
|
||||
[key: string]: any;
|
||||
}
|
||||
export type ContextQueryProperties = AmiContextQuery | AvailabilityZonesContextQuery | HostedZoneContextQuery | SSMParameterContextQuery | VpcContextQuery | EndpointServiceAvailabilityZonesContextQuery | LoadBalancerContextQuery | LoadBalancerListenerContextQuery | SecurityGroupContextQuery | KeyContextQuery | CcApiContextQuery | PluginContextQuery;
|
||||
102
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.js
generated
vendored
Normal file
102
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/context-queries.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/index.d.ts
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from './schema';
|
||||
export * from './metadata-schema';
|
||||
export * from './artifact-schema';
|
||||
export * from './context-queries';
|
||||
export * from './interfaces';
|
||||
22
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/index.js
generated
vendored
Normal file
22
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./schema"), exports);
|
||||
__exportStar(require("./metadata-schema"), exports);
|
||||
__exportStar(require("./artifact-schema"), exports);
|
||||
__exportStar(require("./context-queries"), exports);
|
||||
__exportStar(require("./interfaces"), exports);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkNBQXlCO0FBQ3pCLG9EQUFrQztBQUNsQyxvREFBa0M7QUFDbEMsb0RBQWtDO0FBQ2xDLCtDQUE2QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vc2NoZW1hJztcbmV4cG9ydCAqIGZyb20gJy4vbWV0YWRhdGEtc2NoZW1hJztcbmV4cG9ydCAqIGZyb20gJy4vYXJ0aWZhY3Qtc2NoZW1hJztcbmV4cG9ydCAqIGZyb20gJy4vY29udGV4dC1xdWVyaWVzJztcbmV4cG9ydCAqIGZyb20gJy4vaW50ZXJmYWNlcyc7XG4iXX0=
|
||||
23
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/interfaces.d.ts
generated
vendored
Normal file
23
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/interfaces.d.ts
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Interoperable representation of a deployable cloud application.
|
||||
*
|
||||
* The external and interoperable contract for a Cloud Assembly is
|
||||
* a directory containing a valid Cloud Assembly.
|
||||
*
|
||||
* Implementations should use the directory to load the Cloud Assembly from disk.
|
||||
* It is recommended that implementations validate loaded manifest files using
|
||||
* the provided functionality from this package.
|
||||
* Within an implementation, it may be prudent to keep (parts of) the Cloud Assembly
|
||||
* in memory during execution and use an implementation-specific contract.
|
||||
* However when an implementation is providing an external contract,
|
||||
* this interface should be used.
|
||||
*/
|
||||
export interface ICloudAssembly {
|
||||
/**
|
||||
* The directory of the cloud assembly.
|
||||
*
|
||||
* This directory will be used to read the Cloud Assembly from.
|
||||
* Its contents (in particular `manifest.json`) must comply with the schema defined in this package.
|
||||
*/
|
||||
readonly directory: string;
|
||||
}
|
||||
10
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/interfaces.js
generated
vendored
Normal file
10
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/interfaces.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
// The interfaces in this file, mainly exist __here__ because this is a convenient place to put them.
|
||||
// The Assembly Schema package is already a jsii package and a dependency of `aws-cdk-lib`.
|
||||
// It is effectively the only place we can put shared interfaces to be used across the jsii ecosystem.
|
||||
//
|
||||
// Putting a shared interface in here should be a huge exception.
|
||||
// It needs to be justified by great benefits it provides to the ecosystems.
|
||||
// All interfaces should be as minimal as possible.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHFHQUFxRztBQUNyRywyRkFBMkY7QUFDM0Ysc0dBQXNHO0FBQ3RHLEVBQUU7QUFDRixpRUFBaUU7QUFDakUsNEVBQTRFO0FBQzVFLG1EQUFtRCIsInNvdXJjZXNDb250ZW50IjpbIi8vIFRoZSBpbnRlcmZhY2VzIGluIHRoaXMgZmlsZSwgbWFpbmx5IGV4aXN0IF9faGVyZV9fIGJlY2F1c2UgdGhpcyBpcyBhIGNvbnZlbmllbnQgcGxhY2UgdG8gcHV0IHRoZW0uXG4vLyBUaGUgQXNzZW1ibHkgU2NoZW1hIHBhY2thZ2UgaXMgYWxyZWFkeSBhIGpzaWkgcGFja2FnZSBhbmQgYSBkZXBlbmRlbmN5IG9mIGBhd3MtY2RrLWxpYmAuXG4vLyBJdCBpcyBlZmZlY3RpdmVseSB0aGUgb25seSBwbGFjZSB3ZSBjYW4gcHV0IHNoYXJlZCBpbnRlcmZhY2VzIHRvIGJlIHVzZWQgYWNyb3NzIHRoZSBqc2lpIGVjb3N5c3RlbS5cbi8vXG4vLyBQdXR0aW5nIGEgc2hhcmVkIGludGVyZmFjZSBpbiBoZXJlIHNob3VsZCBiZSBhIGh1Z2UgZXhjZXB0aW9uLlxuLy8gSXQgbmVlZHMgdG8gYmUganVzdGlmaWVkIGJ5IGdyZWF0IGJlbmVmaXRzIGl0IHByb3ZpZGVzIHRvIHRoZSBlY29zeXN0ZW1zLlxuLy8gQWxsIGludGVyZmFjZXMgc2hvdWxkIGJlIGFzIG1pbmltYWwgYXMgcG9zc2libGUuXG5cbi8qKlxuICogSW50ZXJvcGVyYWJsZSByZXByZXNlbnRhdGlvbiBvZiBhIGRlcGxveWFibGUgY2xvdWQgYXBwbGljYXRpb24uXG4gKlxuICogVGhlIGV4dGVybmFsIGFuZCBpbnRlcm9wZXJhYmxlIGNvbnRyYWN0IGZvciBhIENsb3VkIEFzc2VtYmx5IGlzXG4gKiBhIGRpcmVjdG9yeSBjb250YWluaW5nIGEgdmFsaWQgQ2xvdWQgQXNzZW1ibHkuXG4gKlxuICogSW1wbGVtZW50YXRpb25zIHNob3VsZCB1c2UgdGhlIGRpcmVjdG9yeSB0byBsb2FkIHRoZSBDbG91ZCBBc3NlbWJseSBmcm9tIGRpc2suXG4gKiBJdCBpcyByZWNvbW1lbmRlZCB0aGF0IGltcGxlbWVudGF0aW9ucyB2YWxpZGF0ZSBsb2FkZWQgbWFuaWZlc3QgZmlsZXMgdXNpbmdcbiAqIHRoZSBwcm92aWRlZCBmdW5jdGlvbmFsaXR5IGZyb20gdGhpcyBwYWNrYWdlLlxuICogV2l0aGluIGFuIGltcGxlbWVudGF0aW9uLCBpdCBtYXkgYmUgcHJ1ZGVudCB0byBrZWVwIChwYXJ0cyBvZikgdGhlIENsb3VkIEFzc2VtYmx5XG4gKiBpbiBtZW1vcnkgZHVyaW5nIGV4ZWN1dGlvbiBhbmQgdXNlIGFuIGltcGxlbWVudGF0aW9uLXNwZWNpZmljIGNvbnRyYWN0LlxuICogSG93ZXZlciB3aGVuIGFuIGltcGxlbWVudGF0aW9uIGlzIHByb3ZpZGluZyBhbiBleHRlcm5hbCBjb250cmFjdCxcbiAqIHRoaXMgaW50ZXJmYWNlIHNob3VsZCBiZSB1c2VkLlxuICovXG5leHBvcnQgaW50ZXJmYWNlIElDbG91ZEFzc2VtYmx5IHtcbiAgLyoqXG4gICAqIFRoZSBkaXJlY3Rvcnkgb2YgdGhlIGNsb3VkIGFzc2VtYmx5LlxuICAgKlxuICAgKiBUaGlzIGRpcmVjdG9yeSB3aWxsIGJlIHVzZWQgdG8gcmVhZCB0aGUgQ2xvdWQgQXNzZW1ibHkgZnJvbS5cbiAgICogSXRzIGNvbnRlbnRzIChpbiBwYXJ0aWN1bGFyIGBtYW5pZmVzdC5qc29uYCkgbXVzdCBjb21wbHkgd2l0aCB0aGUgc2NoZW1hIGRlZmluZWQgaW4gdGhpcyBwYWNrYWdlLlxuICAgKi9cbiAgcmVhZG9ubHkgZGlyZWN0b3J5OiBzdHJpbmc7XG59XG4iXX0=
|
||||
331
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/metadata-schema.d.ts
generated
vendored
Normal file
331
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/metadata-schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,331 @@
|
||||
/**
|
||||
* Common properties for asset metadata.
|
||||
*/
|
||||
interface BaseAssetMetadataEntry {
|
||||
/**
|
||||
* Requested packaging style
|
||||
*/
|
||||
readonly packaging: string;
|
||||
/**
|
||||
* Logical identifier for the asset
|
||||
*/
|
||||
readonly id: string;
|
||||
/**
|
||||
* The hash of the asset source.
|
||||
*/
|
||||
readonly sourceHash: string;
|
||||
/**
|
||||
* Path on disk to the asset
|
||||
*/
|
||||
readonly path: string;
|
||||
}
|
||||
/**
|
||||
* Metadata Entry spec for files.
|
||||
*
|
||||
* @example
|
||||
* const entry = {
|
||||
* packaging: 'file',
|
||||
* s3BucketParameter: 'bucket-parameter',
|
||||
* s3KeyParamenter: 'key-parameter',
|
||||
* artifactHashParameter: 'hash-parameter',
|
||||
* }
|
||||
*/
|
||||
export interface FileAssetMetadataEntry extends BaseAssetMetadataEntry {
|
||||
/**
|
||||
* Requested packaging style
|
||||
*/
|
||||
readonly packaging: 'zip' | 'file';
|
||||
/**
|
||||
* Name of parameter where S3 bucket should be passed in
|
||||
*/
|
||||
readonly s3BucketParameter: string;
|
||||
/**
|
||||
* Name of parameter where S3 key should be passed in
|
||||
*/
|
||||
readonly s3KeyParameter: string;
|
||||
/**
|
||||
* The name of the parameter where the hash of the bundled asset should be passed in.
|
||||
*/
|
||||
readonly artifactHashParameter: string;
|
||||
}
|
||||
/**
|
||||
* Metadata Entry spec for stack tag.
|
||||
*/
|
||||
export interface Tag {
|
||||
/**
|
||||
* Tag key.
|
||||
*
|
||||
* (In the actual file on disk this will be cased as "Key", and the structure is
|
||||
* patched to match this structure upon loading:
|
||||
* https://github.com/aws/aws-cdk/blob/4aadaa779b48f35838cccd4e25107b2338f05547/packages/%40aws-cdk/cloud-assembly-schema/lib/manifest.ts#L137)
|
||||
*/
|
||||
readonly key: string;
|
||||
/**
|
||||
* Tag value.
|
||||
*
|
||||
* (In the actual file on disk this will be cased as "Value", and the structure is
|
||||
* patched to match this structure upon loading:
|
||||
* https://github.com/aws/aws-cdk/blob/4aadaa779b48f35838cccd4e25107b2338f05547/packages/%40aws-cdk/cloud-assembly-schema/lib/manifest.ts#L137)
|
||||
*/
|
||||
readonly value: string;
|
||||
}
|
||||
/**
|
||||
* Options for configuring the Docker cache backend
|
||||
*/
|
||||
export interface ContainerImageAssetCacheOption {
|
||||
/**
|
||||
* The type of cache to use.
|
||||
* Refer to https://docs.docker.com/build/cache/backends/ for full list of backends.
|
||||
* @default - unspecified
|
||||
*
|
||||
* @example 'registry'
|
||||
*/
|
||||
readonly type: string;
|
||||
/**
|
||||
* Any parameters to pass into the docker cache backend configuration.
|
||||
* Refer to https://docs.docker.com/build/cache/backends/ for cache backend configuration.
|
||||
* @default {} No options provided
|
||||
*
|
||||
* @example
|
||||
* declare const branch: string;
|
||||
*
|
||||
* const params = {
|
||||
* ref: `12345678.dkr.ecr.us-west-2.amazonaws.com/cache:${branch}`,
|
||||
* mode: "max",
|
||||
* };
|
||||
*/
|
||||
readonly params?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Metadata Entry spec for container images.
|
||||
*
|
||||
* @example
|
||||
* const entry = {
|
||||
* packaging: 'container-image',
|
||||
* repositoryName: 'repository-name',
|
||||
* imageTag: 'tag',
|
||||
* }
|
||||
*/
|
||||
export interface ContainerImageAssetMetadataEntry extends BaseAssetMetadataEntry {
|
||||
/**
|
||||
* Type of asset
|
||||
*/
|
||||
readonly packaging: 'container-image';
|
||||
/**
|
||||
* ECR Repository name and repo digest (separated by "@sha256:") where this
|
||||
* image is stored.
|
||||
*
|
||||
* @default undefined If not specified, `repositoryName` and `imageTag` are
|
||||
* required because otherwise how will the stack know where to find the asset,
|
||||
* ha?
|
||||
* @deprecated specify `repositoryName` and `imageTag` instead, and then you
|
||||
* know where the image will go.
|
||||
*/
|
||||
readonly imageNameParameter?: string;
|
||||
/**
|
||||
* ECR repository name, if omitted a default name based on the asset's ID is
|
||||
* used instead. Specify this property if you need to statically address the
|
||||
* image, e.g. from a Kubernetes Pod. Note, this is only the repository name,
|
||||
* without the registry and the tag parts.
|
||||
*
|
||||
* @default - this parameter is REQUIRED after 1.21.0
|
||||
*/
|
||||
readonly repositoryName?: string;
|
||||
/**
|
||||
* The docker image tag to use for tagging pushed images. This field is
|
||||
* required if `imageParameterName` is ommited (otherwise, the app won't be
|
||||
* able to find the image).
|
||||
*
|
||||
* @default - this parameter is REQUIRED after 1.21.0
|
||||
*/
|
||||
readonly imageTag?: string;
|
||||
/**
|
||||
* Build args to pass to the `docker build` command
|
||||
*
|
||||
* @default no build args are passed
|
||||
*/
|
||||
readonly buildArgs?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Build contexts to pass to the `docker build` command
|
||||
*
|
||||
* @default no build contexts are passed
|
||||
*/
|
||||
readonly buildContexts?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* SSH agent socket or keys to pass to the `docker build` command
|
||||
*
|
||||
* @default no ssh arg is passed
|
||||
*/
|
||||
readonly buildSsh?: string;
|
||||
/**
|
||||
* Build secrets to pass to the `docker build` command
|
||||
*
|
||||
* @default no build secrets are passed
|
||||
*/
|
||||
readonly buildSecrets?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
/**
|
||||
* Docker target to build to
|
||||
*
|
||||
* @default no build target
|
||||
*/
|
||||
readonly target?: string;
|
||||
/**
|
||||
* Path to the Dockerfile (relative to the directory).
|
||||
*
|
||||
* @default - no file is passed
|
||||
*/
|
||||
readonly file?: string;
|
||||
/**
|
||||
* Networking mode for the RUN commands during build.
|
||||
*
|
||||
* @default - no networking mode specified
|
||||
*/
|
||||
readonly networkMode?: string;
|
||||
/**
|
||||
* Platform to build for. _Requires Docker Buildx_.
|
||||
*
|
||||
* @default - current machine platform
|
||||
*/
|
||||
readonly platform?: string;
|
||||
/**
|
||||
* Outputs to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no outputs are passed to the build command (default outputs are used)
|
||||
* @see https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs
|
||||
*/
|
||||
readonly outputs?: string[];
|
||||
/**
|
||||
* Cache from options to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no cache from options are passed to the build command
|
||||
* @see https://docs.docker.com/build/cache/backends/
|
||||
*/
|
||||
readonly cacheFrom?: ContainerImageAssetCacheOption[];
|
||||
/**
|
||||
* Cache to options to pass to the `docker build` command.
|
||||
*
|
||||
* @default - no cache to options are passed to the build command
|
||||
* @see https://docs.docker.com/build/cache/backends/
|
||||
*/
|
||||
readonly cacheTo?: ContainerImageAssetCacheOption;
|
||||
/**
|
||||
* Disable the cache and pass `--no-cache` to the `docker build` command.
|
||||
*
|
||||
* @default - cache is used
|
||||
*/
|
||||
readonly cacheDisabled?: boolean;
|
||||
}
|
||||
/**
|
||||
* @see ArtifactMetadataEntryType.ASSET
|
||||
*/
|
||||
export type AssetMetadataEntry = FileAssetMetadataEntry | ContainerImageAssetMetadataEntry;
|
||||
/**
|
||||
* @see ArtifactMetadataEntryType.INFO
|
||||
* @see ArtifactMetadataEntryType.WARN
|
||||
* @see ArtifactMetadataEntryType.ERROR
|
||||
*/
|
||||
export type LogMessageMetadataEntry = string;
|
||||
/**
|
||||
* @see ArtifactMetadataEntryType.LOGICAL_ID
|
||||
*/
|
||||
export type LogicalIdMetadataEntry = string;
|
||||
/**
|
||||
* @see ArtifactMetadataEntryType.STACK_TAGS
|
||||
*/
|
||||
export type StackTagsMetadataEntry = Tag[];
|
||||
/**
|
||||
* Any other type of metadata entry
|
||||
*
|
||||
* This could probably be changed to `any`, but it's safer not
|
||||
* to do so right now.
|
||||
* See https://github.com/cdklabs/cloud-assembly-schema/pull/121.
|
||||
*/
|
||||
export type PrimitiveType = boolean | number | string;
|
||||
/**
|
||||
* Metadata type of a PropertyMutation
|
||||
*/
|
||||
export interface PropertyMutationMetadataEntry {
|
||||
/**
|
||||
* Name of the property
|
||||
*/
|
||||
readonly propertyName: string;
|
||||
/**
|
||||
* Stack trace of the mutation
|
||||
*/
|
||||
readonly stackTrace: string[];
|
||||
}
|
||||
/**
|
||||
* Union type for all metadata entries that might exist in the manifest.
|
||||
*/
|
||||
export type MetadataEntryData = AssetMetadataEntry | LogMessageMetadataEntry | LogicalIdMetadataEntry | PrimitiveType | PropertyMutationMetadataEntry | (Tag | string)[];
|
||||
/**
|
||||
* Type of artifact metadata entry.
|
||||
*/
|
||||
export declare enum ArtifactMetadataEntryType {
|
||||
/**
|
||||
* Asset in metadata.
|
||||
*/
|
||||
ASSET = "aws:cdk:asset",
|
||||
/**
|
||||
* Metadata key used to print INFO-level messages by the toolkit when an app is syntheized.
|
||||
*/
|
||||
INFO = "aws:cdk:info",
|
||||
/**
|
||||
* Metadata key used to print WARNING-level messages by the toolkit when an app is syntheized.
|
||||
*/
|
||||
WARN = "aws:cdk:warning",
|
||||
/**
|
||||
* Metadata key used to print ERROR-level messages by the toolkit when an app is syntheized.
|
||||
*/
|
||||
ERROR = "aws:cdk:error",
|
||||
/**
|
||||
* Represents the CloudFormation logical ID of a resource at a certain path.
|
||||
*/
|
||||
LOGICAL_ID = "aws:cdk:logicalId",
|
||||
/**
|
||||
* Represents tags of a stack.
|
||||
*/
|
||||
STACK_TAGS = "aws:cdk:stack-tags",
|
||||
/**
|
||||
* Whether the resource should be excluded during refactoring.
|
||||
*/
|
||||
DO_NOT_REFACTOR = "aws:cdk:do-not-refactor",
|
||||
/**
|
||||
* Creation stack of a construct
|
||||
*/
|
||||
CREATION_STACK = "aws:cdk:creationStack",
|
||||
/**
|
||||
* A property mutation trace
|
||||
*/
|
||||
PROPERTY_ASSIGNMENT = "aws:cdk:propertyAssignment"
|
||||
}
|
||||
/**
|
||||
* A metadata entry in a cloud assembly artifact.
|
||||
*/
|
||||
export interface MetadataEntry {
|
||||
/**
|
||||
* The type of the metadata entry.
|
||||
*/
|
||||
readonly type: string;
|
||||
/**
|
||||
* The data.
|
||||
*
|
||||
* @default - no data.
|
||||
*/
|
||||
readonly data?: MetadataEntryData;
|
||||
/**
|
||||
* A stack trace for when the entry was created.
|
||||
*
|
||||
* @default - no trace.
|
||||
*/
|
||||
readonly trace?: string[];
|
||||
}
|
||||
export {};
|
||||
46
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/metadata-schema.js
generated
vendored
Normal file
46
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/metadata-schema.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
162
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/schema.d.ts
generated
vendored
Normal file
162
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,162 @@
|
||||
import type { ArtifactProperties } from './artifact-schema';
|
||||
import type { ContextProvider, ContextQueryProperties } from './context-queries';
|
||||
import type { MetadataEntry } from './metadata-schema';
|
||||
/**
|
||||
* Type of cloud artifact.
|
||||
*/
|
||||
export declare enum ArtifactType {
|
||||
/**
|
||||
* Stub required because of JSII.
|
||||
*/
|
||||
NONE = "none",// required due to a jsii bug
|
||||
/**
|
||||
* The artifact is an AWS CloudFormation stack.
|
||||
*/
|
||||
AWS_CLOUDFORMATION_STACK = "aws:cloudformation:stack",
|
||||
/**
|
||||
* The artifact contains the CDK application's construct tree.
|
||||
*/
|
||||
CDK_TREE = "cdk:tree",
|
||||
/**
|
||||
* Manifest for all assets in the Cloud Assembly
|
||||
*/
|
||||
ASSET_MANIFEST = "cdk:asset-manifest",
|
||||
/**
|
||||
* Nested Cloud Assembly
|
||||
*/
|
||||
NESTED_CLOUD_ASSEMBLY = "cdk:cloud-assembly",
|
||||
/**
|
||||
* Feature flag report
|
||||
*/
|
||||
FEATURE_FLAG_REPORT = "cdk:feature-flag-report"
|
||||
}
|
||||
/**
|
||||
* Information about the application's runtime components.
|
||||
*/
|
||||
export interface RuntimeInfo {
|
||||
/**
|
||||
* The list of libraries loaded in the application, associated with their versions.
|
||||
*/
|
||||
readonly libraries: {
|
||||
[name: string]: string;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Represents a missing piece of context.
|
||||
*/
|
||||
export interface MissingContext {
|
||||
/**
|
||||
* The missing context key.
|
||||
*/
|
||||
readonly key: string;
|
||||
/**
|
||||
* The provider from which we expect this context key to be obtained.
|
||||
*/
|
||||
readonly provider: ContextProvider;
|
||||
/**
|
||||
* A set of provider-specific options.
|
||||
*/
|
||||
readonly props: ContextQueryProperties;
|
||||
}
|
||||
/**
|
||||
* A manifest for a single artifact within the cloud assembly.
|
||||
*/
|
||||
export interface ArtifactManifest {
|
||||
/**
|
||||
* The type of artifact.
|
||||
*/
|
||||
readonly type: ArtifactType;
|
||||
/**
|
||||
* The environment into which this artifact is deployed.
|
||||
*
|
||||
* @default - no envrionment.
|
||||
*/
|
||||
readonly environment?: string;
|
||||
/**
|
||||
* Associated metadata.
|
||||
*
|
||||
* Metadata can be stored directly in the assembly manifest, as well as in a
|
||||
* separate file (see `additionalMetadataFile`). It should prefer to be stored
|
||||
* in the additional file, as that will reduce the size of the assembly
|
||||
* manifest in cases of a lot of metdata (which CDK does emit by default).
|
||||
*
|
||||
* @default - no metadata.
|
||||
*/
|
||||
readonly metadata?: {
|
||||
[path: string]: MetadataEntry[];
|
||||
};
|
||||
/**
|
||||
* A file with additional metadata entries.
|
||||
*
|
||||
* The schema of this file is exactly the same as the type of the `metadata` field.
|
||||
* In other words, that file contains an object mapping construct paths to arrays
|
||||
* of metadata entries.
|
||||
*
|
||||
* @default - no additional metadata
|
||||
*/
|
||||
readonly additionalMetadataFile?: string;
|
||||
/**
|
||||
* IDs of artifacts that must be deployed before this artifact.
|
||||
*
|
||||
* @default - no dependencies.
|
||||
*/
|
||||
readonly dependencies?: string[];
|
||||
/**
|
||||
* The set of properties for this artifact (depends on type)
|
||||
*
|
||||
* @default - no properties.
|
||||
*/
|
||||
readonly properties?: ArtifactProperties;
|
||||
/**
|
||||
* A string that can be shown to a user to uniquely identify this artifact inside a cloud assembly tree
|
||||
*
|
||||
* Is used by the CLI to present a list of stacks to the user in a way that
|
||||
* makes sense to them. Even though the property name "display name" doesn't
|
||||
* imply it, this field is used to select stacks as well, so all stacks should
|
||||
* have a unique display name.
|
||||
*
|
||||
* @default - no display name
|
||||
*/
|
||||
readonly displayName?: string;
|
||||
}
|
||||
/**
|
||||
* A manifest which describes the cloud assembly.
|
||||
*/
|
||||
export interface AssemblyManifest {
|
||||
/**
|
||||
* Protocol version
|
||||
*/
|
||||
readonly version: string;
|
||||
/**
|
||||
* Required CLI version, if available
|
||||
*
|
||||
* If the manifest producer knows, it can put the minimum version of the CLI
|
||||
* here that supports reading this assembly.
|
||||
*
|
||||
* If set, it can be used to show a more informative error message to users.
|
||||
*
|
||||
* @default - Minimum CLI version unknown
|
||||
*/
|
||||
readonly minimumCliVersion?: string;
|
||||
/**
|
||||
* The set of artifacts in this assembly.
|
||||
*
|
||||
* @default - no artifacts.
|
||||
*/
|
||||
readonly artifacts?: {
|
||||
[id: string]: ArtifactManifest;
|
||||
};
|
||||
/**
|
||||
* Missing context information. If this field has values, it means that the
|
||||
* cloud assembly is not complete and should not be deployed.
|
||||
*
|
||||
* @default - no missing context.
|
||||
*/
|
||||
readonly missing?: MissingContext[];
|
||||
/**
|
||||
* Runtime information.
|
||||
*
|
||||
* @default - no info.
|
||||
*/
|
||||
readonly runtime?: RuntimeInfo;
|
||||
}
|
||||
34
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/schema.js
generated
vendored
Normal file
34
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/cloud-assembly/schema.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/index.d.ts
generated
vendored
Normal file
4
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './cloud-assembly';
|
||||
export * from './assets';
|
||||
export * from './manifest';
|
||||
export * from './integ-tests';
|
||||
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/index.js
generated
vendored
Normal file
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./cloud-assembly"), exports);
|
||||
__exportStar(require("./assets"), exports);
|
||||
__exportStar(require("./manifest"), exports);
|
||||
__exportStar(require("./integ-tests"), exports);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsbURBQWlDO0FBQ2pDLDJDQUF5QjtBQUN6Qiw2Q0FBMkI7QUFDM0IsZ0RBQThCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSAnLi9jbG91ZC1hc3NlbWJseSc7XG5leHBvcnQgKiBmcm9tICcuL2Fzc2V0cyc7XG5leHBvcnQgKiBmcm9tICcuL21hbmlmZXN0JztcbmV4cG9ydCAqIGZyb20gJy4vaW50ZWctdGVzdHMnO1xuIl19
|
||||
178
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/common.d.ts
generated
vendored
Normal file
178
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,178 @@
|
||||
/**
|
||||
* Specify what changes require manual approval.
|
||||
*/
|
||||
export declare enum RequireApproval {
|
||||
/**
|
||||
* Approval is not required
|
||||
*/
|
||||
NEVER = "never",
|
||||
/**
|
||||
* Manual approval required for any change to the stack
|
||||
*/
|
||||
ANYCHANGE = "any-change",
|
||||
/**
|
||||
* Manual approval required if changes involve a broadening of permissions or security group rules
|
||||
*/
|
||||
BROADENING = "broadening"
|
||||
}
|
||||
/**
|
||||
* Default CDK CLI options that apply to all commands
|
||||
*/
|
||||
export interface DefaultCdkOptions {
|
||||
/**
|
||||
* List of stacks to deploy
|
||||
*
|
||||
* Requried if `all` is not set
|
||||
*
|
||||
* @default - []
|
||||
*/
|
||||
readonly stacks?: string[];
|
||||
/**
|
||||
* Deploy all stacks
|
||||
*
|
||||
* Requried if `stacks` is not set
|
||||
*
|
||||
* @default - false
|
||||
*/
|
||||
readonly all?: boolean;
|
||||
/**
|
||||
* command-line for executing your app or a cloud assembly directory
|
||||
* e.g. "node bin/my-app.js"
|
||||
* or
|
||||
* "cdk.out"
|
||||
*
|
||||
* @default - read from cdk.json
|
||||
*/
|
||||
readonly app?: string;
|
||||
/**
|
||||
* Role to pass to CloudFormation for deployment
|
||||
*
|
||||
* @default - use the bootstrap cfn-exec role
|
||||
*/
|
||||
readonly roleArn?: string;
|
||||
/**
|
||||
* Additional context
|
||||
*
|
||||
* @default - no additional context
|
||||
*/
|
||||
readonly context?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* Print trace for stack warnings
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly trace?: boolean;
|
||||
/**
|
||||
* Do not construct stacks with warnings
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly strict?: boolean;
|
||||
/**
|
||||
* Perform context lookups.
|
||||
*
|
||||
* Synthesis fails if this is disabled and context lookups need
|
||||
* to be performed
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly lookups?: boolean;
|
||||
/**
|
||||
* Ignores synthesis errors, which will likely produce an invalid output
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly ignoreErrors?: boolean;
|
||||
/**
|
||||
* Use JSON output instead of YAML when templates are printed
|
||||
* to STDOUT
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly json?: boolean;
|
||||
/**
|
||||
* show debug logs
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly verbose?: boolean;
|
||||
/**
|
||||
* enable emission of additional debugging information, such as creation stack
|
||||
* traces of tokens
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly debug?: boolean;
|
||||
/**
|
||||
* Use the indicated AWS profile as the default environment
|
||||
*
|
||||
* @default - no profile is used
|
||||
*/
|
||||
readonly profile?: string;
|
||||
/**
|
||||
* Use the indicated proxy. Will read from
|
||||
* HTTPS_PROXY environment if specified
|
||||
*
|
||||
* @default - no proxy
|
||||
*/
|
||||
readonly proxy?: string;
|
||||
/**
|
||||
* Path to CA certificate to use when validating HTTPS
|
||||
* requests.
|
||||
*
|
||||
* @default - read from AWS_CA_BUNDLE environment variable
|
||||
*/
|
||||
readonly caBundlePath?: string;
|
||||
/**
|
||||
* Force trying to fetch EC2 instance credentials
|
||||
*
|
||||
* @default - guess EC2 instance status
|
||||
*/
|
||||
readonly ec2Creds?: boolean;
|
||||
/**
|
||||
* Include "AWS::CDK::Metadata" resource in synthesized templates
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly versionReporting?: boolean;
|
||||
/**
|
||||
* Include "aws:cdk:path" CloudFormation metadata for each resource
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly pathMetadata?: boolean;
|
||||
/**
|
||||
* Include "aws:asset:*" CloudFormation metadata for resources that use assets
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly assetMetadata?: boolean;
|
||||
/**
|
||||
* Copy assets to the output directory
|
||||
*
|
||||
* Needed for local debugging the source files with SAM CLI
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly staging?: boolean;
|
||||
/**
|
||||
* Emits the synthesized cloud assembly into a directory
|
||||
*
|
||||
* @default cdk.out
|
||||
*/
|
||||
readonly output?: string;
|
||||
/**
|
||||
* Show relevant notices
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly notices?: boolean;
|
||||
/**
|
||||
* Show colors and other style from console output
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly color?: boolean;
|
||||
}
|
||||
22
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/common.js
generated
vendored
Normal file
22
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/common.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
92
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/deploy.d.ts
generated
vendored
Normal file
92
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/deploy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,92 @@
|
||||
import type { DefaultCdkOptions, RequireApproval } from './common';
|
||||
/**
|
||||
* Options to use with cdk deploy
|
||||
*/
|
||||
export interface DeployOptions extends DefaultCdkOptions {
|
||||
/**
|
||||
* Only perform action on the given stack
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly exclusively?: boolean;
|
||||
/**
|
||||
* Name of the toolkit stack to use/deploy
|
||||
*
|
||||
* @default CDKToolkit
|
||||
*/
|
||||
readonly toolkitStackName?: string;
|
||||
/**
|
||||
* Reuse the assets with the given asset IDs
|
||||
*
|
||||
* @default - do not reuse assets
|
||||
*/
|
||||
readonly reuseAssets?: string[];
|
||||
/**
|
||||
* Optional name to use for the CloudFormation change set.
|
||||
* If not provided, a name will be generated automatically.
|
||||
*
|
||||
* @default - auto generate a name
|
||||
*/
|
||||
readonly changeSetName?: string;
|
||||
/**
|
||||
* Always deploy, even if templates are identical.
|
||||
* @default false
|
||||
*/
|
||||
readonly force?: boolean;
|
||||
/**
|
||||
* Rollback failed deployments
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly rollback?: boolean;
|
||||
/**
|
||||
* ARNs of SNS topics that CloudFormation will notify with stack related events
|
||||
*
|
||||
* @default - no notifications
|
||||
*/
|
||||
readonly notificationArns?: string[];
|
||||
/**
|
||||
* What kind of security changes require approval
|
||||
*
|
||||
* @default RequireApproval.NEVER
|
||||
*/
|
||||
readonly requireApproval?: RequireApproval;
|
||||
/**
|
||||
* Whether to execute the ChangeSet
|
||||
* Not providing `execute` parameter will result in execution of ChangeSet
|
||||
* @default true
|
||||
*/
|
||||
readonly execute?: boolean;
|
||||
/**
|
||||
* Additional parameters for CloudFormation at deploy time
|
||||
* @default {}
|
||||
*/
|
||||
readonly parameters?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* Use previous values for unspecified parameters
|
||||
*
|
||||
* If not set, all parameters must be specified for every deployment.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly usePreviousParameters?: boolean;
|
||||
/**
|
||||
* Path to file where stack outputs will be written after a successful deploy as JSON
|
||||
* @default - Outputs are not written to any file
|
||||
*/
|
||||
readonly outputsFile?: string;
|
||||
/**
|
||||
* Whether we are on a CI system
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly ci?: boolean;
|
||||
/**
|
||||
* Deploy multiple stacks in parallel
|
||||
*
|
||||
* @default 1
|
||||
*/
|
||||
readonly concurrency?: number;
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/deploy.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/deploy.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVwbG95LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiZGVwbG95LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IERlZmF1bHRDZGtPcHRpb25zLCBSZXF1aXJlQXBwcm92YWwgfSBmcm9tICcuL2NvbW1vbic7XG5cbi8qKlxuICogT3B0aW9ucyB0byB1c2Ugd2l0aCBjZGsgZGVwbG95XG4gKi9cbmV4cG9ydCBpbnRlcmZhY2UgRGVwbG95T3B0aW9ucyBleHRlbmRzIERlZmF1bHRDZGtPcHRpb25zIHtcbiAgLyoqXG4gICAqIE9ubHkgcGVyZm9ybSBhY3Rpb24gb24gdGhlIGdpdmVuIHN0YWNrXG4gICAqXG4gICAqIEBkZWZhdWx0IGZhbHNlXG4gICAqL1xuICByZWFkb25seSBleGNsdXNpdmVseT86IGJvb2xlYW47XG5cbiAgLyoqXG4gICAqIE5hbWUgb2YgdGhlIHRvb2xraXQgc3RhY2sgdG8gdXNlL2RlcGxveVxuICAgKlxuICAgKiBAZGVmYXVsdCBDREtUb29sa2l0XG4gICAqL1xuICByZWFkb25seSB0b29sa2l0U3RhY2tOYW1lPzogc3RyaW5nO1xuXG4gIC8qKlxuICAgKiBSZXVzZSB0aGUgYXNzZXRzIHdpdGggdGhlIGdpdmVuIGFzc2V0IElEc1xuICAgKlxuICAgKiBAZGVmYXVsdCAtIGRvIG5vdCByZXVzZSBhc3NldHNcbiAgICovXG4gIHJlYWRvbmx5IHJldXNlQXNzZXRzPzogc3RyaW5nW107XG5cbiAgLyoqXG4gICAqIE9wdGlvbmFsIG5hbWUgdG8gdXNlIGZvciB0aGUgQ2xvdWRGb3JtYXRpb24gY2hhbmdlIHNldC5cbiAgICogSWYgbm90IHByb3ZpZGVkLCBhIG5hbWUgd2lsbCBiZSBnZW5lcmF0ZWQgYXV0b21hdGljYWxseS5cbiAgICpcbiAgICogQGRlZmF1bHQgLSBhdXRvIGdlbmVyYXRlIGEgbmFtZVxuICAgKi9cbiAgcmVhZG9ubHkgY2hhbmdlU2V0TmFtZT86IHN0cmluZztcblxuICAvKipcbiAgICogQWx3YXlzIGRlcGxveSwgZXZlbiBpZiB0ZW1wbGF0ZXMgYXJlIGlkZW50aWNhbC5cbiAgICogQGRlZmF1bHQgZmFsc2VcbiAgICovXG4gIHJlYWRvbmx5IGZvcmNlPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogUm9sbGJhY2sgZmFpbGVkIGRlcGxveW1lbnRzXG4gICAqXG4gICAqIEBkZWZhdWx0IHRydWVcbiAgICovXG4gIHJlYWRvbmx5IHJvbGxiYWNrPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogQVJOcyBvZiBTTlMgdG9waWNzIHRoYXQgQ2xvdWRGb3JtYXRpb24gd2lsbCBub3RpZnkgd2l0aCBzdGFjayByZWxhdGVkIGV2ZW50c1xuICAgKlxuICAgKiBAZGVmYXVsdCAtIG5vIG5vdGlmaWNhdGlvbnNcbiAgICovXG4gIHJlYWRvbmx5IG5vdGlmaWNhdGlvbkFybnM/OiBzdHJpbmdbXTtcblxuICAvKipcbiAgICogV2hhdCBraW5kIG9mIHNlY3VyaXR5IGNoYW5nZXMgcmVxdWlyZSBhcHByb3ZhbFxuICAgKlxuICAgKiBAZGVmYXVsdCBSZXF1aXJlQXBwcm92YWwuTkVWRVJcbiAgICovXG4gIHJlYWRvbmx5IHJlcXVpcmVBcHByb3ZhbD86IFJlcXVpcmVBcHByb3ZhbDtcblxuICAvKipcbiAgICogV2hldGhlciB0byBleGVjdXRlIHRoZSBDaGFuZ2VTZXRcbiAgICogTm90IHByb3ZpZGluZyBgZXhlY3V0ZWAgcGFyYW1ldGVyIHdpbGwgcmVzdWx0IGluIGV4ZWN1dGlvbiBvZiBDaGFuZ2VTZXRcbiAgICogQGRlZmF1bHQgdHJ1ZVxuICAgKi9cbiAgcmVhZG9ubHkgZXhlY3V0ZT86IGJvb2xlYW47XG5cbiAgLyoqXG4gICAqIEFkZGl0aW9uYWwgcGFyYW1ldGVycyBmb3IgQ2xvdWRGb3JtYXRpb24gYXQgZGVwbG95IHRpbWVcbiAgICogQGRlZmF1bHQge31cbiAgICovXG4gIHJlYWRvbmx5IHBhcmFtZXRlcnM/OiB7IFtuYW1lOiBzdHJpbmddOiBzdHJpbmcgfTtcblxuICAvKipcbiAgICogVXNlIHByZXZpb3VzIHZhbHVlcyBmb3IgdW5zcGVjaWZpZWQgcGFyYW1ldGVyc1xuICAgKlxuICAgKiBJZiBub3Qgc2V0LCBhbGwgcGFyYW1ldGVycyBtdXN0IGJlIHNwZWNpZmllZCBmb3IgZXZlcnkgZGVwbG95bWVudC5cbiAgICpcbiAgICogQGRlZmF1bHQgdHJ1ZVxuICAgKi9cbiAgcmVhZG9ubHkgdXNlUHJldmlvdXNQYXJhbWV0ZXJzPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogUGF0aCB0byBmaWxlIHdoZXJlIHN0YWNrIG91dHB1dHMgd2lsbCBiZSB3cml0dGVuIGFmdGVyIGEgc3VjY2Vzc2Z1bCBkZXBsb3kgYXMgSlNPTlxuICAgKiBAZGVmYXVsdCAtIE91dHB1dHMgYXJlIG5vdCB3cml0dGVuIHRvIGFueSBmaWxlXG4gICAqL1xuICByZWFkb25seSBvdXRwdXRzRmlsZT86IHN0cmluZztcblxuICAvKipcbiAgICogV2hldGhlciB3ZSBhcmUgb24gYSBDSSBzeXN0ZW1cbiAgICpcbiAgICogQGRlZmF1bHQgZmFsc2VcbiAgICovXG4gIHJlYWRvbmx5IGNpPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogRGVwbG95IG11bHRpcGxlIHN0YWNrcyBpbiBwYXJhbGxlbFxuICAgKlxuICAgKiBAZGVmYXVsdCAxXG4gICAqL1xuICByZWFkb25seSBjb25jdXJyZW5jeT86IG51bWJlcjtcbn1cbiJdfQ==
|
||||
18
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/destroy.d.ts
generated
vendored
Normal file
18
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/destroy.d.ts
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { DefaultCdkOptions } from './common';
|
||||
/**
|
||||
* Options to use with cdk destroy
|
||||
*/
|
||||
export interface DestroyOptions extends DefaultCdkOptions {
|
||||
/**
|
||||
* Do not ask for permission before destroying stacks
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly force?: boolean;
|
||||
/**
|
||||
* Only destroy the given stack
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly exclusively?: boolean;
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/destroy.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/destroy.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzdHJveS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImRlc3Ryb3kudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgRGVmYXVsdENka09wdGlvbnMgfSBmcm9tICcuL2NvbW1vbic7XG5cbi8qKlxuICogT3B0aW9ucyB0byB1c2Ugd2l0aCBjZGsgZGVzdHJveVxuICovXG5leHBvcnQgaW50ZXJmYWNlIERlc3Ryb3lPcHRpb25zIGV4dGVuZHMgRGVmYXVsdENka09wdGlvbnMge1xuICAvKipcbiAgICogRG8gbm90IGFzayBmb3IgcGVybWlzc2lvbiBiZWZvcmUgZGVzdHJveWluZyBzdGFja3NcbiAgICpcbiAgICogQGRlZmF1bHQgZmFsc2VcbiAgICovXG4gIHJlYWRvbmx5IGZvcmNlPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogT25seSBkZXN0cm95IHRoZSBnaXZlbiBzdGFja1xuICAgKlxuICAgKiBAZGVmYXVsdCBmYWxzZVxuICAgKi9cbiAgcmVhZG9ubHkgZXhjbHVzaXZlbHk/OiBib29sZWFuO1xufVxuIl19
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/index.d.ts
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './common';
|
||||
export * from './deploy';
|
||||
export * from './destroy';
|
||||
20
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/index.js
generated
vendored
Normal file
20
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/commands/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./common"), exports);
|
||||
__exportStar(require("./deploy"), exports);
|
||||
__exportStar(require("./destroy"), exports);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkNBQXlCO0FBQ3pCLDJDQUF5QjtBQUN6Qiw0Q0FBMEIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2NvbW1vbic7XG5leHBvcnQgKiBmcm9tICcuL2RlcGxveSc7XG5leHBvcnQgKiBmcm9tICcuL2Rlc3Ryb3knO1xuIl19
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/index.d.ts
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export * from './schema';
|
||||
export * from './commands';
|
||||
export * from './test-case';
|
||||
20
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/index.js
generated
vendored
Normal file
20
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./schema"), exports);
|
||||
__exportStar(require("./commands"), exports);
|
||||
__exportStar(require("./test-case"), exports);
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsMkNBQXlCO0FBQ3pCLDZDQUEyQjtBQUMzQiw4Q0FBNEIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3NjaGVtYSc7XG5leHBvcnQgKiBmcm9tICcuL2NvbW1hbmRzJztcbmV4cG9ydCAqIGZyb20gJy4vdGVzdC1jYXNlJztcbiJdfQ==
|
||||
35
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/schema.d.ts
generated
vendored
Normal file
35
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/schema.d.ts
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import type { TestCase } from './test-case';
|
||||
/**
|
||||
* Definitions for the integration testing manifest
|
||||
*/
|
||||
export interface IntegManifest {
|
||||
/**
|
||||
* Version of the manifest
|
||||
*/
|
||||
readonly version: string;
|
||||
/**
|
||||
* Enable lookups for this test. If lookups are enabled
|
||||
* then `stackUpdateWorkflow` must be set to false.
|
||||
* Lookups should only be enabled when you are explicitly testing
|
||||
* lookups.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly enableLookups?: boolean;
|
||||
/**
|
||||
* Additional context to use when performing
|
||||
* a synth. Any context provided here will override
|
||||
* any default context
|
||||
*
|
||||
* @default - no additional context
|
||||
*/
|
||||
readonly synthContext?: {
|
||||
[name: string]: string;
|
||||
};
|
||||
/**
|
||||
* test cases
|
||||
*/
|
||||
readonly testCases: {
|
||||
[testName: string]: TestCase;
|
||||
};
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/schema.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/schema.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsic2NoZW1hLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiIiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IFRlc3RDYXNlIH0gZnJvbSAnLi90ZXN0LWNhc2UnO1xuLyoqXG4gKiBEZWZpbml0aW9ucyBmb3IgdGhlIGludGVncmF0aW9uIHRlc3RpbmcgbWFuaWZlc3RcbiAqL1xuZXhwb3J0IGludGVyZmFjZSBJbnRlZ01hbmlmZXN0IHtcbiAgLyoqXG4gICAqIFZlcnNpb24gb2YgdGhlIG1hbmlmZXN0XG4gICAqL1xuICByZWFkb25seSB2ZXJzaW9uOiBzdHJpbmc7XG5cbiAgLyoqXG4gICAqIEVuYWJsZSBsb29rdXBzIGZvciB0aGlzIHRlc3QuIElmIGxvb2t1cHMgYXJlIGVuYWJsZWRcbiAgICogdGhlbiBgc3RhY2tVcGRhdGVXb3JrZmxvd2AgbXVzdCBiZSBzZXQgdG8gZmFsc2UuXG4gICAqIExvb2t1cHMgc2hvdWxkIG9ubHkgYmUgZW5hYmxlZCB3aGVuIHlvdSBhcmUgZXhwbGljaXRseSB0ZXN0aW5nXG4gICAqIGxvb2t1cHMuXG4gICAqXG4gICAqIEBkZWZhdWx0IGZhbHNlXG4gICAqL1xuICByZWFkb25seSBlbmFibGVMb29rdXBzPzogYm9vbGVhbjtcblxuICAvKipcbiAgICogQWRkaXRpb25hbCBjb250ZXh0IHRvIHVzZSB3aGVuIHBlcmZvcm1pbmdcbiAgICogYSBzeW50aC4gQW55IGNvbnRleHQgcHJvdmlkZWQgaGVyZSB3aWxsIG92ZXJyaWRlXG4gICAqIGFueSBkZWZhdWx0IGNvbnRleHRcbiAgICpcbiAgICogQGRlZmF1bHQgLSBubyBhZGRpdGlvbmFsIGNvbnRleHRcbiAgICovXG4gIHJlYWRvbmx5IHN5bnRoQ29udGV4dD86IHsgW25hbWU6IHN0cmluZ106IHN0cmluZyB9O1xuXG4gIC8qKlxuICAgKiB0ZXN0IGNhc2VzXG4gICAqL1xuICByZWFkb25seSB0ZXN0Q2FzZXM6IHsgW3Rlc3ROYW1lOiBzdHJpbmddOiBUZXN0Q2FzZSB9O1xufVxuIl19
|
||||
186
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.d.ts
generated
vendored
Normal file
186
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.d.ts
generated
vendored
Normal file
@@ -0,0 +1,186 @@
|
||||
import type { DeployOptions, DestroyOptions } from './commands';
|
||||
/**
|
||||
* The set of options to control the workflow of the test runner
|
||||
*/
|
||||
export interface TestOptions {
|
||||
/**
|
||||
* Run update workflow on this test case
|
||||
* This should only be set to false to test scenarios
|
||||
* that are not possible to test as part of the update workflow
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly stackUpdateWorkflow?: boolean;
|
||||
/**
|
||||
* Additional options to use for each CDK command
|
||||
*
|
||||
* @default - runner default options
|
||||
*/
|
||||
readonly cdkCommandOptions?: CdkCommands;
|
||||
/**
|
||||
* Additional commands to run at predefined points in the test workflow
|
||||
*
|
||||
* e.g. { postDeploy: ['yarn', 'test'] }
|
||||
*
|
||||
* @default - no hooks
|
||||
*/
|
||||
readonly hooks?: Hooks;
|
||||
/**
|
||||
* Whether or not to include asset hashes in the diff
|
||||
* Asset hashes can introduces a lot of unneccessary noise into tests,
|
||||
* but there are some cases where asset hashes _should_ be included. For example
|
||||
* any tests involving custom resources or bundling
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly diffAssets?: boolean;
|
||||
/**
|
||||
* List of CloudFormation resource types in this stack that can
|
||||
* be destroyed as part of an update without failing the test.
|
||||
*
|
||||
* This list should only include resources that for this specific
|
||||
* integration test we are sure will not cause errors or an outage if
|
||||
* destroyed. For example, maybe we know that a new resource will be created
|
||||
* first before the old resource is destroyed which prevents any outage.
|
||||
*
|
||||
* e.g. ['AWS::IAM::Role']
|
||||
*
|
||||
* @default - do not allow destruction of any resources on update
|
||||
*/
|
||||
readonly allowDestroy?: string[];
|
||||
/**
|
||||
* Limit deployment to these regions
|
||||
*
|
||||
* @default - can run in any region
|
||||
*/
|
||||
readonly regions?: string[];
|
||||
}
|
||||
/**
|
||||
* Represents an integration test case
|
||||
*/
|
||||
export interface TestCase extends TestOptions {
|
||||
/**
|
||||
* Stacks that should be tested as part of this test case
|
||||
* The stackNames will be passed as args to the cdk commands
|
||||
* so dependent stacks will be automatically deployed unless
|
||||
* `exclusively` is passed
|
||||
*/
|
||||
readonly stacks: string[];
|
||||
/**
|
||||
* The node id of the stack that contains assertions.
|
||||
* This is the value that can be used to deploy the stack with the CDK CLI
|
||||
*
|
||||
* @default - no assertion stack
|
||||
*/
|
||||
readonly assertionStack?: string;
|
||||
/**
|
||||
* The name of the stack that contains assertions
|
||||
*
|
||||
* @default - no assertion stack
|
||||
*/
|
||||
readonly assertionStackName?: string;
|
||||
}
|
||||
/**
|
||||
* Commands to run at predefined points during the
|
||||
* integration test workflow
|
||||
*/
|
||||
export interface Hooks {
|
||||
/**
|
||||
* Commands to run prior to deploying the cdk stacks
|
||||
* in the integration test
|
||||
*
|
||||
* @default - no commands
|
||||
*/
|
||||
readonly preDeploy?: string[];
|
||||
/**
|
||||
* Commands to run prior after deploying the cdk stacks
|
||||
* in the integration test
|
||||
*
|
||||
* @default - no commands
|
||||
*/
|
||||
readonly postDeploy?: string[];
|
||||
/**
|
||||
* Commands to run prior to destroying the cdk stacks
|
||||
* in the integration test
|
||||
*
|
||||
* @default - no commands
|
||||
*/
|
||||
readonly preDestroy?: string[];
|
||||
/**
|
||||
* Commands to run after destroying the cdk stacks
|
||||
* in the integration test
|
||||
*
|
||||
* @default - no commands
|
||||
*/
|
||||
readonly postDestroy?: string[];
|
||||
}
|
||||
/**
|
||||
* Represents a cdk command
|
||||
* i.e. `synth`, `deploy`, & `destroy`
|
||||
*/
|
||||
export interface CdkCommand {
|
||||
/**
|
||||
* Whether or not to run this command as part of the workflow
|
||||
* This can be used if you only want to test some of the workflow
|
||||
* for example enable `synth` and disable `deploy` & `destroy` in order
|
||||
* to limit the test to synthesis
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly enabled?: boolean;
|
||||
/**
|
||||
* If the runner should expect this command to fail
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly expectError?: boolean;
|
||||
/**
|
||||
* This can be used in combination with `expectedError`
|
||||
* to validate that a specific message is returned.
|
||||
*
|
||||
* @default - do not validate message
|
||||
*/
|
||||
readonly expectedMessage?: string;
|
||||
}
|
||||
/**
|
||||
* Represents a cdk deploy command
|
||||
*/
|
||||
export interface DeployCommand extends CdkCommand {
|
||||
/**
|
||||
* Additional arguments to pass to the command
|
||||
* This can be used to test specific CLI functionality
|
||||
*
|
||||
* @default - only default args are used
|
||||
*/
|
||||
readonly args?: DeployOptions;
|
||||
}
|
||||
/**
|
||||
* Represents a cdk destroy command
|
||||
*/
|
||||
export interface DestroyCommand extends CdkCommand {
|
||||
/**
|
||||
* Additional arguments to pass to the command
|
||||
* This can be used to test specific CLI functionality
|
||||
*
|
||||
* @default - only default args are used
|
||||
*/
|
||||
readonly args?: DestroyOptions;
|
||||
}
|
||||
/**
|
||||
* Options for specific cdk commands that are run
|
||||
* as part of the integration test workflow
|
||||
*/
|
||||
export interface CdkCommands {
|
||||
/**
|
||||
* Options to for the cdk deploy command
|
||||
*
|
||||
* @default - default deploy options
|
||||
*/
|
||||
readonly deploy?: DeployCommand;
|
||||
/**
|
||||
* Options to for the cdk destroy command
|
||||
*
|
||||
* @default - default destroy options
|
||||
*/
|
||||
readonly destroy?: DestroyCommand;
|
||||
}
|
||||
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.js
generated
vendored
Normal file
3
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/integ-tests/test-case.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
142
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/manifest.d.ts
generated
vendored
Normal file
142
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/manifest.d.ts
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
import type * as assets from './assets';
|
||||
import * as assembly from './cloud-assembly';
|
||||
import type * as integ from './integ-tests';
|
||||
export declare const VERSION_MISMATCH: string;
|
||||
/**
|
||||
* Options for the loadManifest operation
|
||||
*/
|
||||
export interface LoadManifestOptions {
|
||||
/**
|
||||
* Skip the version check
|
||||
*
|
||||
* This means you may read a newer cloud assembly than the CX API is designed
|
||||
* to support, and your application may not be aware of all features that in use
|
||||
* in the Cloud Assembly.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly skipVersionCheck?: boolean;
|
||||
/**
|
||||
* Skip enum checks
|
||||
*
|
||||
* This means you may read enum values you don't know about yet. Make sure to always
|
||||
* check the values of enums you encounter in the manifest.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
readonly skipEnumCheck?: boolean;
|
||||
/**
|
||||
* Topologically sort all artifacts
|
||||
*
|
||||
* This parameter is only respected by the constructor of `CloudAssembly`. The
|
||||
* property lives here for backwards compatibility reasons.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
readonly topoSort?: boolean;
|
||||
/**
|
||||
* Validate the file according to the declared JSON Schema
|
||||
*
|
||||
* Be aware that JSON Schema validation has a significant performance cost
|
||||
* (about 10x over not validating).
|
||||
*
|
||||
* @default false, unless $TESTING_CDK is set to '1'
|
||||
*/
|
||||
readonly validateSchema?: boolean;
|
||||
}
|
||||
/**
|
||||
* Protocol utility class.
|
||||
*/
|
||||
export declare abstract class Manifest {
|
||||
/**
|
||||
* Validates and saves the cloud assembly manifest to file.
|
||||
*
|
||||
* @param manifest - manifest.
|
||||
* @param filePath - output file path.
|
||||
*/
|
||||
static saveAssemblyManifest(manifest: assembly.AssemblyManifest, filePath: string): void;
|
||||
/**
|
||||
* Load and validates the cloud assembly manifest from file.
|
||||
*
|
||||
* @param filePath - path to the manifest file.
|
||||
*/
|
||||
static loadAssemblyManifest(filePath: string, options?: LoadManifestOptions): assembly.AssemblyManifest;
|
||||
/**
|
||||
* Validates and saves the asset manifest to file.
|
||||
*
|
||||
* @param manifest - manifest.
|
||||
* @param filePath - output file path.
|
||||
*/
|
||||
static saveAssetManifest(manifest: assets.AssetManifest, filePath: string): void;
|
||||
/**
|
||||
* Load and validates the asset manifest from file.
|
||||
*
|
||||
* @param filePath - path to the manifest file.
|
||||
*/
|
||||
static loadAssetManifest(filePath: string): assets.AssetManifest;
|
||||
/**
|
||||
* Validates and saves the integ manifest to file.
|
||||
*
|
||||
* @param manifest - manifest.
|
||||
* @param filePath - output file path.
|
||||
*/
|
||||
static saveIntegManifest(manifest: integ.IntegManifest, filePath: string): void;
|
||||
/**
|
||||
* Load and validates the integ manifest from file.
|
||||
*
|
||||
* @param filePath - path to the manifest file.
|
||||
*/
|
||||
static loadIntegManifest(filePath: string): integ.IntegManifest;
|
||||
/**
|
||||
* Fetch the current schema version number.
|
||||
*/
|
||||
static version(): string;
|
||||
/**
|
||||
* Return the CLI version that supports this Cloud Assembly Schema version
|
||||
*/
|
||||
static cliVersion(): string | undefined;
|
||||
/**
|
||||
* Deprecated
|
||||
* @deprecated use `saveAssemblyManifest()`
|
||||
*/
|
||||
static save(manifest: assembly.AssemblyManifest, filePath: string): void;
|
||||
/**
|
||||
* Deprecated
|
||||
* @deprecated use `loadAssemblyManifest()`
|
||||
*/
|
||||
static load(filePath: string): assembly.AssemblyManifest;
|
||||
private static validate;
|
||||
private static saveManifest;
|
||||
private static loadManifest;
|
||||
/**
|
||||
* Fix the casing of stack tags entries
|
||||
*
|
||||
* At the very beginning of the CDK we used to emit stack tags as an object with
|
||||
* `{ Key, Value }` keys; this had the "advantage" that we could stick those
|
||||
* tags directly into the `CreateChangeSet` call.
|
||||
*
|
||||
* Then we later on used jsii on the assembly schema and we were forced to type
|
||||
* the in-memory objects as `{ key, value }` with lowercase letters. Now the
|
||||
* objects have a different on-disk and in-memory format, and we need to convert
|
||||
* between them.
|
||||
*
|
||||
* For backwards compatibility reasons, we used to convert lowercase in-memory
|
||||
* to uppercase on-disk variant until very recently. This is now unnecessary,
|
||||
* since no officially supported CDK tools read the stack tags from the
|
||||
* metadata; the CLI and toolkit library read stack tags from the artifact
|
||||
* properties.
|
||||
*
|
||||
* So although we don't emit uppercase stack tag objects anymore, we might still read
|
||||
* manifests that have them. Because the manifest we read must pass JSON Schema
|
||||
* validation (which expects lowercase tag objects), we have to fix the casing
|
||||
* of these objects after reading from disk and before validating.
|
||||
*
|
||||
* That's what this function does.
|
||||
*/
|
||||
private static patchStackTagsOnRead;
|
||||
/**
|
||||
* Validates that `assumeRoleAdditionalOptions` doesn't contain nor `ExternalId` neither `RoleArn`, as they
|
||||
* should have dedicated properties preceding this (e.g `assumeRoleArn` and `assumeRoleExternalId`).
|
||||
*/
|
||||
private static validateAssumeRoleAdditionalOptions;
|
||||
}
|
||||
265
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/manifest.js
generated
vendored
Normal file
265
cdk/node_modules/@aws-cdk/cloud-assembly-schema/lib/manifest.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/.bin/semver
generated
vendored
Symbolic link
1
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/.bin/semver
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../semver/bin/semver.js
|
||||
10
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/.editorconfig
generated
vendored
Normal file
10
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/.editorconfig
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# editorconfig.org
|
||||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/LICENSE
generated
vendored
Normal file
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
jsonschema is licensed under MIT license.
|
||||
|
||||
Copyright (C) 2012-2015 Tom de Grunt <tom@degrunt.nl>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
421
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/README.md
generated
vendored
Normal file
421
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/README.md
generated
vendored
Normal file
@@ -0,0 +1,421 @@
|
||||
[](http://travis-ci.org/tdegrunt/jsonschema)
|
||||
|
||||
# jsonschema
|
||||
|
||||
[JSON schema](http://json-schema.org/) validator, which is designed to be fast and simple to use. JSON Schema versions through draft-07 are fully supported.
|
||||
|
||||
## Contributing & bugs
|
||||
|
||||
Please fork the repository, make the changes in your fork and include tests. Once you're done making changes, send in a pull request.
|
||||
|
||||
### Bug reports
|
||||
|
||||
Please include a test which shows why the code fails.
|
||||
|
||||
## Usage
|
||||
|
||||
### Simple
|
||||
|
||||
Simple object validation using JSON schemas.
|
||||
|
||||
```javascript
|
||||
var Validator = require('jsonschema').Validator;
|
||||
var v = new Validator();
|
||||
var instance = 4;
|
||||
var schema = {"type": "number"};
|
||||
console.log(v.validate(instance, schema));
|
||||
```
|
||||
|
||||
### Even simpler
|
||||
|
||||
```javascript
|
||||
var validate = require('jsonschema').validate;
|
||||
console.log(validate(4, {"type": "number"}));
|
||||
```
|
||||
|
||||
### Complex example, with split schemas and references
|
||||
|
||||
```javascript
|
||||
var Validator = require('jsonschema').Validator;
|
||||
var v = new Validator();
|
||||
|
||||
// Address, to be embedded on Person
|
||||
var addressSchema = {
|
||||
"id": "/SimpleAddress",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"lines": {
|
||||
"type": "array",
|
||||
"items": {"type": "string"}
|
||||
},
|
||||
"zip": {"type": "string"},
|
||||
"city": {"type": "string"},
|
||||
"country": {"type": "string"}
|
||||
},
|
||||
"required": ["country"]
|
||||
};
|
||||
|
||||
// Person
|
||||
var schema = {
|
||||
"id": "/SimplePerson",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": {"type": "string"},
|
||||
"address": {"$ref": "/SimpleAddress"},
|
||||
"votes": {"type": "integer", "minimum": 1}
|
||||
}
|
||||
};
|
||||
|
||||
var p = {
|
||||
"name": "Barack Obama",
|
||||
"address": {
|
||||
"lines": [ "1600 Pennsylvania Avenue Northwest" ],
|
||||
"zip": "DC 20500",
|
||||
"city": "Washington",
|
||||
"country": "USA"
|
||||
},
|
||||
"votes": "lots"
|
||||
};
|
||||
|
||||
v.addSchema(addressSchema, '/SimpleAddress');
|
||||
console.log(v.validate(p, schema));
|
||||
```
|
||||
### Example for Array schema
|
||||
|
||||
```json
|
||||
var arraySchema = {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"properties": {
|
||||
"name": { "type": "string" },
|
||||
"lastname": { "type": "string" }
|
||||
},
|
||||
"required": ["name", "lastname"]
|
||||
}
|
||||
}
|
||||
```
|
||||
For a comprehensive, annotated example illustrating all possible validation options, see [examples/all.js](./examples/all.js)
|
||||
|
||||
## Features
|
||||
|
||||
### Definitions
|
||||
|
||||
All schema definitions are supported, $schema is ignored.
|
||||
|
||||
### Types
|
||||
|
||||
All types are supported
|
||||
|
||||
### Handling `undefined`
|
||||
|
||||
`undefined` is not a value known to JSON, and by default, the validator treats it as if it is not invalid. i.e., it will return valid.
|
||||
|
||||
```javascript
|
||||
var res = validate(undefined, {type: 'string'});
|
||||
res.valid // true
|
||||
```
|
||||
|
||||
This behavior may be changed with the "required" option:
|
||||
|
||||
```javascript
|
||||
var res = validate(undefined, {type: 'string'}, {required: true});
|
||||
res.valid // false
|
||||
```
|
||||
|
||||
### Formats
|
||||
|
||||
#### Disabling the format keyword.
|
||||
|
||||
You may disable format validation by providing `disableFormat: true` to the validator
|
||||
options.
|
||||
|
||||
#### String Formats
|
||||
|
||||
All formats are supported, phone numbers are expected to follow the [E.123](http://en.wikipedia.org/wiki/E.123) standard.
|
||||
|
||||
#### Custom Formats
|
||||
|
||||
You may add your own custom format functions. Format functions accept the input
|
||||
being validated and return a boolean value. If the returned value is `true`, then
|
||||
validation succeeds. If the returned value is `false`, then validation fails.
|
||||
|
||||
* Formats added to `Validator.prototype.customFormats` do not affect previously instantiated
|
||||
Validators. This is to prevent validator instances from being altered once created.
|
||||
It is conceivable that multiple validators may be created to handle multiple schemas
|
||||
with different formats in a program.
|
||||
* Formats added to `validator.customFormats` affect only that Validator instance.
|
||||
|
||||
Here is an example that uses custom formats:
|
||||
|
||||
```javascript
|
||||
Validator.prototype.customFormats.myFormat = function(input) {
|
||||
return input === 'myFormat';
|
||||
};
|
||||
|
||||
var validator = new Validator();
|
||||
validator.validate('myFormat', {type: 'string', format: 'myFormat'}).valid; // true
|
||||
validator.validate('foo', {type: 'string', format: 'myFormat'}).valid; // false
|
||||
```
|
||||
|
||||
### Results
|
||||
|
||||
By default, results will be returned in a `ValidatorResult` object with the following properties:
|
||||
|
||||
* `instance`: any.
|
||||
* `schema`: Schema.
|
||||
* `errors`: ValidationError[].
|
||||
* `valid`: boolean.
|
||||
|
||||
Each item in `errors` is a `ValidationError` with the following properties:
|
||||
|
||||
* path: array. An array of property keys or array offsets, indicating where inside objects or arrays the instance was found.
|
||||
* property: string. Describes the property path. Starts with `instance`, and is delimited with a dot (`.`).
|
||||
* message: string. A human-readable message for debugging use. Provided in English and subject to change.
|
||||
* schema: object. The schema containing the keyword that failed
|
||||
* instance: any. The instance that failed
|
||||
* name: string. The keyword within the schema that failed.
|
||||
* argument: any. Provides information about the keyword that failed.
|
||||
|
||||
The validator can be configured to throw in the event of a validation error:
|
||||
|
||||
* If the `throwFirst` option is set, the validator will terminate validation at the first encountered error and throw a `ValidatorResultError` object.
|
||||
|
||||
* If the `throwAll` option is set, the validator will throw a `ValidatorResultError` object after the entire instance has been validated.
|
||||
|
||||
* If the `throwError` option is set, it will throw at the first encountered validation error (like `throwFirst`), but the `ValidationError` object itself will be thrown. Note that, despite the name, this does not inherit from Error like `ValidatorResultError` does.
|
||||
|
||||
The `ValidatorResultError` object has the same properties as `ValidatorResult` and additionally inherits from Error.
|
||||
|
||||
#### "nestedErrors" option
|
||||
|
||||
When `oneOf` or `anyOf` validations fail, errors that caused any of the sub-schemas referenced therein to fail are normally suppressed, because it is not necessary to fix all of them. And in the case of `oneOf`, it would itself be an error to fix all of the listed errors.
|
||||
|
||||
This behavior may be configured with `options.nestedErrors`. If truthy, it will emit all the errors from the subschemas. This option may be useful when troubleshooting validation errors in complex schemas:
|
||||
|
||||
```javascript
|
||||
var schema = {
|
||||
oneOf: [
|
||||
{ type: 'string', minLength: 32, maxLength: 32 },
|
||||
{ type: 'string', maxLength: 16 },
|
||||
{ type: 'number' },
|
||||
]
|
||||
};
|
||||
var validator = new Validator();
|
||||
var result = validator.validate('This string is 28 chars long', schema, {nestedErrors: true});
|
||||
|
||||
// result.toString() reads out:
|
||||
// 0: instance does not meet minimum length of 32
|
||||
// 1: instance does not meet maximum length of 16
|
||||
// 2: instance is not of a type(s) number
|
||||
// 3: instance is not exactly one from [subschema 0],[subschema 1],[subschema 2]
|
||||
```
|
||||
|
||||
#### Localizing Error Messages
|
||||
|
||||
To provide localized, human-readable errors, use the `name` string as a translation key. Feel free to open an issue for support relating to localizing error messages. For example:
|
||||
|
||||
```
|
||||
var localized = result.errors.map(function(err){
|
||||
return localeService.translate(err.name);
|
||||
});
|
||||
```
|
||||
|
||||
### Custom keywords
|
||||
|
||||
Specify your own JSON Schema keywords with the validator.attributes property:
|
||||
|
||||
```javascript
|
||||
validator.attributes.contains = function validateContains(instance, schema, options, ctx) {
|
||||
if(typeof instance !== 'string') return;
|
||||
if(typeof schema.contains !== 'string') throw new jsonschema.SchemaError('"contains" expects a string', schema);
|
||||
if(instance.indexOf(schema.contains)<0){
|
||||
return 'does not contain the string ' + JSON.stringify(schema.contains);
|
||||
}
|
||||
}
|
||||
var result = validator.validate("I am an instance", { type:"string", contains: "I am" });
|
||||
// result.valid === true;
|
||||
```
|
||||
|
||||
The instance passes validation if the function returns nothing. A single validation error is produced
|
||||
if the function returns a string. Any number of errors (maybe none at all) may be returned by passing a
|
||||
`ValidatorResult` object, which may be used like so:
|
||||
|
||||
```javascript
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
while(someErrorCondition()){
|
||||
result.addError('fails some validation test');
|
||||
}
|
||||
return result;
|
||||
```
|
||||
|
||||
### Dereferencing schemas
|
||||
|
||||
Sometimes you may want to download schemas from remote sources, like a database, or over HTTP. When importing a schema,
|
||||
unknown references are inserted into the `validator.unresolvedRefs` Array. Asynchronously shift elements off this array and import
|
||||
them:
|
||||
|
||||
```javascript
|
||||
var Validator = require('jsonschema').Validator;
|
||||
var v = new Validator();
|
||||
v.addSchema(initialSchema);
|
||||
function importNextSchema(){
|
||||
var nextSchema = v.unresolvedRefs.shift();
|
||||
if(!nextSchema){ done(); return; }
|
||||
databaseGet(nextSchema, function(schema){
|
||||
v.addSchema(schema);
|
||||
importNextSchema();
|
||||
});
|
||||
}
|
||||
importNextSchema();
|
||||
```
|
||||
|
||||
### Default base URI
|
||||
|
||||
Schemas should typically have an `id` with an absolute, full URI. However if the schema you are using contains only relative URI references, the `base` option will be used to resolve these.
|
||||
|
||||
This following example would throw a `SchemaError` if the `base` option were unset:
|
||||
|
||||
```javascript
|
||||
var result = validate(["Name"], {
|
||||
id: "/schema.json",
|
||||
type: "array",
|
||||
items: { $ref: "http://example.com/schema.json#/definitions/item" },
|
||||
definitions: {
|
||||
item: { type: "string" },
|
||||
},
|
||||
}, { base: 'http://example.com/' });
|
||||
```
|
||||
|
||||
### Rewrite Hook
|
||||
|
||||
The `rewrite` option lets you change the value of an instance after it has successfully been validated. This will mutate the `instance` passed to the validate function. This can be useful for unmarshalling data and parsing it into native instances, such as changing a string to a `Date` instance.
|
||||
|
||||
The `rewrite` option accepts a function with the following arguments:
|
||||
|
||||
* instance: any
|
||||
* schema: object
|
||||
* options: object
|
||||
* ctx: object
|
||||
* return value: any new value for the instance
|
||||
|
||||
The value may be removed by returning `undefined`.
|
||||
If you don't want to change the value, call `return instance`.
|
||||
|
||||
Here is an example that can convert a property expecting a date into a Date instance:
|
||||
|
||||
```javascript
|
||||
const schema = {
|
||||
properties: {
|
||||
date: {id: 'http://example.com/date', type: 'string'},
|
||||
},
|
||||
};
|
||||
|
||||
const value = {
|
||||
date: '2020-09-30T23:39:27.060Z',
|
||||
};
|
||||
|
||||
function unmarshall(instance, schema){
|
||||
if(schema.id === 'http://example.com/date'){
|
||||
return new Date(instance);
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
const v = new Validator();
|
||||
const res = v.validate(value, schema, {rewrite: unmarshall});
|
||||
|
||||
assert(res.instance.date instanceof Date);
|
||||
```
|
||||
|
||||
|
||||
### Pre-Property Validation Hook
|
||||
|
||||
If some processing of properties is required prior to validation a function may be passed via the options parameter of the validate function. For example, say you needed to perform type coercion for some properties:
|
||||
|
||||
```javascript
|
||||
// See examples/coercion.js
|
||||
function preValidateProperty(object, key, schema, options, ctx) {
|
||||
var value = object[key];
|
||||
if (typeof value === 'undefined') return;
|
||||
|
||||
// Test if the schema declares a type, but the type keyword fails validation
|
||||
if (schema.type && validator.attributes.type.call(validator, value, schema, options, ctx.makeChild(schema, key))) {
|
||||
// If the type is "number" but the instance is not a number, cast it
|
||||
if(schema.type==='number' && typeof value!=='number'){
|
||||
object[key] = parseFloat(value);
|
||||
return;
|
||||
}
|
||||
// If the type is "string" but the instance is not a string, cast it
|
||||
if(schema.type==='string' && typeof value!=='string'){
|
||||
object[key] = String(value).toString();
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// And now, to actually perform validation with the coercion hook!
|
||||
v.validate(instance, schema, { preValidateProperty });
|
||||
```
|
||||
|
||||
### Skip validation of certain keywords
|
||||
|
||||
Use the "skipAttributes" option to skip validation of certain keywords. Provide an array of keywords to ignore.
|
||||
|
||||
For skipping the "format" keyword, see the disableFormat option.
|
||||
|
||||
### Fail on unknown keywords
|
||||
|
||||
By default, JSON Schema is supposed to ignore unknown schema keywords.
|
||||
|
||||
You can change this behavior to require that all keywords used in a schema have a defined behavior, by using setting the "allowUnknownAttributes" option to false.
|
||||
|
||||
This example will throw a `SchemaError`:
|
||||
|
||||
```javascript
|
||||
var schema = {
|
||||
type: "string",
|
||||
format: "email",
|
||||
example: "foo",
|
||||
};
|
||||
var result = validate("Name", schema, { allowUnknownAttributes: false });
|
||||
```
|
||||
|
||||
## Tests
|
||||
|
||||
Uses [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) as well as our own tests.
|
||||
You'll need to update and init the git submodules:
|
||||
|
||||
git submodule update --init
|
||||
npm test
|
||||
|
||||
## Contributions
|
||||
|
||||
This library would not be possible without the valuable contributions by:
|
||||
|
||||
- Austin Wright
|
||||
|
||||
... and many others!
|
||||
|
||||
## License
|
||||
|
||||
jsonschema is licensed under MIT license.
|
||||
|
||||
Copyright (C) 2012-2019 Tom de Grunt <tom@degrunt.nl>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
978
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/attribute.js
generated
vendored
Normal file
978
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/attribute.js
generated
vendored
Normal file
@@ -0,0 +1,978 @@
|
||||
'use strict';
|
||||
|
||||
var helpers = require('./helpers');
|
||||
|
||||
/** @type ValidatorResult */
|
||||
var ValidatorResult = helpers.ValidatorResult;
|
||||
/** @type SchemaError */
|
||||
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,
|
||||
};
|
||||
|
||||
/**
|
||||
* @name validators
|
||||
*/
|
||||
var validators = attribute.validators = {};
|
||||
|
||||
/**
|
||||
* Validates whether the instance if of a certain type
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {ValidatorResult|null}
|
||||
*/
|
||||
validators.type = function validateType (instance, schema, options, ctx) {
|
||||
// Ignore undefined instances
|
||||
if (instance === undefined) {
|
||||
return null;
|
||||
}
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var types = Array.isArray(schema.type) ? schema.type : [schema.type];
|
||||
if (!types.some(this.testType.bind(this, instance, schema, options, ctx))) {
|
||||
var list = types.map(function (v) {
|
||||
if(!v) return;
|
||||
var id = v.$id || v.id;
|
||||
return id ? ('<' + id + '>') : (v+'');
|
||||
});
|
||||
result.addError({
|
||||
name: 'type',
|
||||
argument: list,
|
||||
message: "is not of a type(s) " + list,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates whether the instance matches some of the given schemas
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {ValidatorResult|null}
|
||||
*/
|
||||
validators.anyOf = function validateAnyOf (instance, schema, options, ctx) {
|
||||
// Ignore undefined instances
|
||||
if (instance === undefined) {
|
||||
return null;
|
||||
}
|
||||
var result = 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 list = schema.anyOf.map(function (v, i) {
|
||||
var id = v.$id || v.id;
|
||||
if(id) return '<' + id + '>';
|
||||
return(v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';
|
||||
});
|
||||
if (options.nestedErrors) {
|
||||
result.importErrors(inner);
|
||||
}
|
||||
result.addError({
|
||||
name: 'anyOf',
|
||||
argument: list,
|
||||
message: "is not any of " + list.join(','),
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance matches every given schema
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.allOf = function validateAllOf (instance, schema, options, ctx) {
|
||||
// Ignore undefined instances
|
||||
if (instance === undefined) {
|
||||
return null;
|
||||
}
|
||||
if (!Array.isArray(schema.allOf)){
|
||||
throw new SchemaError("allOf must be an array");
|
||||
}
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var self = this;
|
||||
schema.allOf.forEach(function(v, i){
|
||||
var valid = self.validateSchema(instance, v, options, ctx);
|
||||
if(!valid.valid){
|
||||
var id = v.$id || v.id;
|
||||
var msg = id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';
|
||||
result.addError({
|
||||
name: 'allOf',
|
||||
argument: { id: msg, length: valid.errors.length, valid: valid },
|
||||
message: 'does not match allOf schema ' + msg + ' with ' + valid.errors.length + ' error[s]:',
|
||||
});
|
||||
result.importErrors(valid);
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance matches exactly one of the given schemas
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.oneOf = function validateOneOf (instance, schema, options, ctx) {
|
||||
// Ignore undefined instances
|
||||
if (instance === undefined) {
|
||||
return null;
|
||||
}
|
||||
if (!Array.isArray(schema.oneOf)){
|
||||
throw new SchemaError("oneOf must be an array");
|
||||
}
|
||||
var result = 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 list = schema.oneOf.map(function (v, i) {
|
||||
var id = v.$id || v.id;
|
||||
return id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';
|
||||
});
|
||||
if (count!==1) {
|
||||
if (options.nestedErrors) {
|
||||
result.importErrors(inner);
|
||||
}
|
||||
result.addError({
|
||||
name: 'oneOf',
|
||||
argument: list,
|
||||
message: "is not exactly one from " + list.join(','),
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates "then" or "else" depending on the result of validating "if"
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.if = function validateIf (instance, schema, options, ctx) {
|
||||
// Ignore undefined instances
|
||||
if (instance === undefined) 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 result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var res;
|
||||
if(ifValid){
|
||||
if (schema.then === undefined) 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));
|
||||
result.importErrors(res);
|
||||
}else{
|
||||
if (schema.else === undefined) 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));
|
||||
result.importErrors(res);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
function getEnumerableProperty(object, key){
|
||||
// Determine if `key` shows up in `for(var key in object)`
|
||||
// First test Object.hasOwnProperty.call as an optimization: that guarantees it does
|
||||
if(Object.hasOwnProperty.call(object, key)) return object[key];
|
||||
// Test `key in object` as an optimization; false means it won't
|
||||
if(!(key in object)) return;
|
||||
while( (object = Object.getPrototypeOf(object)) ){
|
||||
if(Object.propertyIsEnumerable.call(object, key)) return object[key];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates propertyNames
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null|ValidatorResult}
|
||||
*/
|
||||
validators.propertyNames = function validatePropertyNames (instance, schema, options, ctx) {
|
||||
if(!this.types.object(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var subschema = schema.propertyNames!==undefined ? 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) !== undefined){
|
||||
var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema));
|
||||
result.importErrors(res);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates properties
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null|ValidatorResult}
|
||||
*/
|
||||
validators.properties = function validateProperties (instance, schema, options, ctx) {
|
||||
if(!this.types.object(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var properties = schema.properties || {};
|
||||
for (var property in properties) {
|
||||
var subschema = properties[property];
|
||||
if(subschema===undefined){
|
||||
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 !== result.instance[property]) result.instance[property] = res.instance;
|
||||
result.importErrors(res);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Test a specific property within in instance against the additionalProperties schema attribute
|
||||
* This ignores properties with definitions in the properties schema attribute, but no other attributes.
|
||||
* If too many more types of property-existence tests pop up they may need their own class of tests (like `type` has)
|
||||
* @private
|
||||
* @return {boolean}
|
||||
*/
|
||||
function testAdditionalProperty (instance, schema, options, ctx, property, result) {
|
||||
if(!this.types.object(instance)) return;
|
||||
if (schema.properties && schema.properties[property] !== undefined) {
|
||||
return;
|
||||
}
|
||||
if (schema.additionalProperties === false) {
|
||||
result.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 !== result.instance[property]) result.instance[property] = res.instance;
|
||||
result.importErrors(res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates patternProperties
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null|ValidatorResult}
|
||||
*/
|
||||
validators.patternProperties = function validatePatternProperties (instance, schema, options, ctx) {
|
||||
if(!this.types.object(instance)) return;
|
||||
var result = 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===undefined){
|
||||
continue;
|
||||
}else if(subschema===null){
|
||||
throw new SchemaError('Unexpected null, expected schema in "patternProperties"');
|
||||
}
|
||||
try {
|
||||
var regexp = new RegExp(pattern, 'u');
|
||||
} catch(_e) {
|
||||
// In the event the stricter handling causes an error, fall back on the forgiving handling
|
||||
// DEPRECATED
|
||||
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 !== result.instance[property]) result.instance[property] = res.instance;
|
||||
result.importErrors(res);
|
||||
}
|
||||
if (test) {
|
||||
testAdditionalProperty.call(this, instance, schema, options, ctx, property, result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates additionalProperties
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null|ValidatorResult}
|
||||
*/
|
||||
validators.additionalProperties = function validateAdditionalProperties (instance, schema, options, ctx) {
|
||||
if(!this.types.object(instance)) return;
|
||||
// if patternProperties is defined then we'll test when that one is called instead
|
||||
if (schema.patternProperties) {
|
||||
return null;
|
||||
}
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
for (var property in instance) {
|
||||
testAdditionalProperty.call(this, instance, schema, options, ctx, property, result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is at least of a certain length, when the instance value is a string.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.minProperties = function validateMinProperties (instance, schema, options, ctx) {
|
||||
if (!this.types.object(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var keys = Object.keys(instance);
|
||||
if (!(keys.length >= schema.minProperties)) {
|
||||
result.addError({
|
||||
name: 'minProperties',
|
||||
argument: schema.minProperties,
|
||||
message: "does not meet minimum property length of " + schema.minProperties,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is at most of a certain length, when the instance value is a string.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.maxProperties = function validateMaxProperties (instance, schema, options, ctx) {
|
||||
if (!this.types.object(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var keys = Object.keys(instance);
|
||||
if (!(keys.length <= schema.maxProperties)) {
|
||||
result.addError({
|
||||
name: 'maxProperties',
|
||||
argument: schema.maxProperties,
|
||||
message: "does not meet maximum property length of " + schema.maxProperties,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates items when instance is an array
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null|ValidatorResult}
|
||||
*/
|
||||
validators.items = function validateItems (instance, schema, options, ctx) {
|
||||
var self = this;
|
||||
if (!this.types.array(instance)) return;
|
||||
if (schema.items===undefined) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
instance.every(function (value, i) {
|
||||
if(Array.isArray(schema.items)){
|
||||
var items = schema.items[i]===undefined ? schema.additionalItems : schema.items[i];
|
||||
}else{
|
||||
var items = schema.items;
|
||||
}
|
||||
if (items === undefined) {
|
||||
return true;
|
||||
}
|
||||
if (items === false) {
|
||||
result.addError({
|
||||
name: 'items',
|
||||
message: "additionalItems not permitted",
|
||||
});
|
||||
return false;
|
||||
}
|
||||
var res = self.validateSchema(value, items, options, ctx.makeChild(items, i));
|
||||
if(res.instance !== result.instance[i]) result.instance[i] = res.instance;
|
||||
result.importErrors(res);
|
||||
return true;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates the "contains" keyword
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {String|null|ValidatorResult}
|
||||
*/
|
||||
validators.contains = function validateContains (instance, schema, options, ctx) {
|
||||
var self = this;
|
||||
if (!this.types.array(instance)) return;
|
||||
if (schema.contains===undefined) return;
|
||||
if (!helpers.isSchema(schema.contains)) throw new Error('Expected "contains" keyword to be a schema');
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var count = instance.some(function (value, i) {
|
||||
var res = self.validateSchema(value, schema.contains, options, ctx.makeChild(schema.contains, i));
|
||||
return res.errors.length===0;
|
||||
});
|
||||
if(count===false){
|
||||
result.addError({
|
||||
name: 'contains',
|
||||
argument: schema.contains,
|
||||
message: "must contain an item matching given schema",
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates minimum and exclusiveMinimum when the type of the instance value is a number.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.minimum = function validateMinimum (instance, schema, options, ctx) {
|
||||
if (!this.types.number(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) {
|
||||
if(!(instance > schema.minimum)){
|
||||
result.addError({
|
||||
name: 'minimum',
|
||||
argument: schema.minimum,
|
||||
message: "must be greater than " + schema.minimum,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if(!(instance >= schema.minimum)){
|
||||
result.addError({
|
||||
name: 'minimum',
|
||||
argument: schema.minimum,
|
||||
message: "must be greater than or equal to " + schema.minimum,
|
||||
});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates maximum and exclusiveMaximum when the type of the instance value is a number.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.maximum = function validateMaximum (instance, schema, options, ctx) {
|
||||
if (!this.types.number(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) {
|
||||
if(!(instance < schema.maximum)){
|
||||
result.addError({
|
||||
name: 'maximum',
|
||||
argument: schema.maximum,
|
||||
message: "must be less than " + schema.maximum,
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if(!(instance <= schema.maximum)){
|
||||
result.addError({
|
||||
name: 'maximum',
|
||||
argument: schema.maximum,
|
||||
message: "must be less than or equal to " + schema.maximum,
|
||||
});
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates the number form of exclusiveMinimum when the type of the instance value is a number.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.exclusiveMinimum = function validateExclusiveMinimum (instance, schema, options, ctx) {
|
||||
// Support the boolean form of exclusiveMinimum, which is handled by the "minimum" keyword.
|
||||
if(typeof schema.exclusiveMinimum === 'boolean') return;
|
||||
if (!this.types.number(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var valid = instance > schema.exclusiveMinimum;
|
||||
if (!valid) {
|
||||
result.addError({
|
||||
name: 'exclusiveMinimum',
|
||||
argument: schema.exclusiveMinimum,
|
||||
message: "must be strictly greater than " + schema.exclusiveMinimum,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates the number form of exclusiveMaximum when the type of the instance value is a number.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.exclusiveMaximum = function validateExclusiveMaximum (instance, schema, options, ctx) {
|
||||
// Support the boolean form of exclusiveMaximum, which is handled by the "maximum" keyword.
|
||||
if(typeof schema.exclusiveMaximum === 'boolean') return;
|
||||
if (!this.types.number(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var valid = instance < schema.exclusiveMaximum;
|
||||
if (!valid) {
|
||||
result.addError({
|
||||
name: 'exclusiveMaximum',
|
||||
argument: schema.exclusiveMaximum,
|
||||
message: "must be strictly less than " + schema.exclusiveMaximum,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Perform validation for multipleOf and divisibleBy, which are essentially the same.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param validationType
|
||||
* @param errorMessage
|
||||
* @returns {String|null}
|
||||
*/
|
||||
var validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy (instance, schema, options, ctx, validationType, errorMessage) {
|
||||
if (!this.types.number(instance)) return;
|
||||
|
||||
var validationArgument = schema[validationType];
|
||||
if (validationArgument == 0) {
|
||||
throw new SchemaError(validationType + " cannot be zero");
|
||||
}
|
||||
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
|
||||
var instanceDecimals = helpers.getDecimalPlaces(instance);
|
||||
var divisorDecimals = helpers.getDecimalPlaces(validationArgument);
|
||||
|
||||
var maxDecimals = Math.max(instanceDecimals , divisorDecimals);
|
||||
var multiplier = Math.pow(10, maxDecimals);
|
||||
|
||||
if (Math.round(instance * multiplier) % Math.round(validationArgument * multiplier) !== 0) {
|
||||
result.addError({
|
||||
name: validationType,
|
||||
argument: validationArgument,
|
||||
message: errorMessage + JSON.stringify(validationArgument),
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates divisibleBy when the type of the instance value is a number.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.multipleOf = function validateMultipleOf (instance, schema, options, ctx) {
|
||||
return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "multipleOf", "is not a multiple of (divisible by) ");
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates multipleOf when the type of the instance value is a number.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.divisibleBy = function validateDivisibleBy (instance, schema, options, ctx) {
|
||||
return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, "divisibleBy", "is not divisible by (multiple of) ");
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is present.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.required = function validateRequired (instance, schema, options, ctx) {
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (instance === undefined && schema.required === true) {
|
||||
// A boolean form is implemented for reverse-compatibility with schemas written against older drafts
|
||||
result.addError({
|
||||
name: 'required',
|
||||
message: "is required",
|
||||
});
|
||||
} else if (this.types.object(instance) && Array.isArray(schema.required)) {
|
||||
schema.required.forEach(function(n){
|
||||
if(getEnumerableProperty(instance, n)===undefined){
|
||||
result.addError({
|
||||
name: 'required',
|
||||
argument: n,
|
||||
message: "requires property " + JSON.stringify(n),
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value matches the regular expression, when the instance value is a string.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.pattern = function validatePattern (instance, schema, options, ctx) {
|
||||
if (!this.types.string(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var pattern = schema.pattern;
|
||||
try {
|
||||
var regexp = new RegExp(pattern, 'u');
|
||||
} catch(_e) {
|
||||
// In the event the stricter handling causes an error, fall back on the forgiving handling
|
||||
// DEPRECATED
|
||||
regexp = new RegExp(pattern);
|
||||
}
|
||||
if (!instance.match(regexp)) {
|
||||
result.addError({
|
||||
name: 'pattern',
|
||||
argument: schema.pattern,
|
||||
message: "does not match pattern " + JSON.stringify(schema.pattern.toString()),
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is of a certain defined format or a custom
|
||||
* format.
|
||||
* The following formats are supported for string types:
|
||||
* - date-time
|
||||
* - date
|
||||
* - time
|
||||
* - ip-address
|
||||
* - ipv6
|
||||
* - uri
|
||||
* - color
|
||||
* - host-name
|
||||
* - alpha
|
||||
* - alpha-numeric
|
||||
* - utc-millisec
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param [options]
|
||||
* @param [ctx]
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.format = function validateFormat (instance, schema, options, ctx) {
|
||||
if (instance===undefined) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (!result.disableFormat && !helpers.isFormat(instance, schema.format, this)) {
|
||||
result.addError({
|
||||
name: 'format',
|
||||
argument: schema.format,
|
||||
message: "does not conform to the " + JSON.stringify(schema.format) + " format",
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is at least of a certain length, when the instance value is a string.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.minLength = function validateMinLength (instance, schema, options, ctx) {
|
||||
if (!this.types.string(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var hsp = instance.match(/[\uDC00-\uDFFF]/g);
|
||||
var length = instance.length - (hsp ? hsp.length : 0);
|
||||
if (!(length >= schema.minLength)) {
|
||||
result.addError({
|
||||
name: 'minLength',
|
||||
argument: schema.minLength,
|
||||
message: "does not meet minimum length of " + schema.minLength,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is at most of a certain length, when the instance value is a string.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.maxLength = function validateMaxLength (instance, schema, options, ctx) {
|
||||
if (!this.types.string(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
// TODO if this was already computed in "minLength", use that value instead of re-computing
|
||||
var hsp = instance.match(/[\uDC00-\uDFFF]/g);
|
||||
var length = instance.length - (hsp ? hsp.length : 0);
|
||||
if (!(length <= schema.maxLength)) {
|
||||
result.addError({
|
||||
name: 'maxLength',
|
||||
argument: schema.maxLength,
|
||||
message: "does not meet maximum length of " + schema.maxLength,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether instance contains at least a minimum number of items, when the instance is an Array.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.minItems = function validateMinItems (instance, schema, options, ctx) {
|
||||
if (!this.types.array(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (!(instance.length >= schema.minItems)) {
|
||||
result.addError({
|
||||
name: 'minItems',
|
||||
argument: schema.minItems,
|
||||
message: "does not meet minimum length of " + schema.minItems,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether instance contains no more than a maximum number of items, when the instance is an Array.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.maxItems = function validateMaxItems (instance, schema, options, ctx) {
|
||||
if (!this.types.array(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (!(instance.length <= schema.maxItems)) {
|
||||
result.addError({
|
||||
name: 'maxItems',
|
||||
argument: schema.maxItems,
|
||||
message: "does not meet maximum length of " + schema.maxItems,
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Deep compares arrays for duplicates
|
||||
* @param v
|
||||
* @param i
|
||||
* @param a
|
||||
* @private
|
||||
* @return {boolean}
|
||||
*/
|
||||
function testArrays (v, i, a) {
|
||||
var j, len = a.length;
|
||||
for (j = i + 1, len; j < len; j++) {
|
||||
if (helpers.deepCompareStrict(v, a[j])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates whether there are no duplicates, when the instance is an Array.
|
||||
* @param instance
|
||||
* @return {String|null}
|
||||
*/
|
||||
validators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) {
|
||||
if (schema.uniqueItems!==true) return;
|
||||
if (!this.types.array(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (!instance.every(testArrays)) {
|
||||
result.addError({
|
||||
name: 'uniqueItems',
|
||||
message: "contains duplicate item",
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validate for the presence of dependency properties, if the instance is an object.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {null|ValidatorResult}
|
||||
*/
|
||||
validators.dependencies = function validateDependencies (instance, schema, options, ctx) {
|
||||
if (!this.types.object(instance)) return;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
for (var property in schema.dependencies) {
|
||||
if (instance[property] === undefined) {
|
||||
continue;
|
||||
}
|
||||
var dep = schema.dependencies[property];
|
||||
var childContext = ctx.makeChild(dep, property);
|
||||
if (typeof dep == 'string') {
|
||||
dep = [dep];
|
||||
}
|
||||
if (Array.isArray(dep)) {
|
||||
dep.forEach(function (prop) {
|
||||
if (instance[prop] === undefined) {
|
||||
result.addError({
|
||||
// FIXME there's two different "dependencies" errors here with slightly different outputs
|
||||
// Can we make these the same? Or should we create different error types?
|
||||
name: 'dependencies',
|
||||
argument: childContext.propertyPath,
|
||||
message: "property " + prop + " not found, required by " + childContext.propertyPath,
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
var res = this.validateSchema(instance, dep, options, childContext);
|
||||
if(result.instance !== res.instance) result.instance = res.instance;
|
||||
if (res && res.errors.length) {
|
||||
result.addError({
|
||||
name: 'dependencies',
|
||||
argument: childContext.propertyPath,
|
||||
message: "does not meet dependency required by " + childContext.propertyPath,
|
||||
});
|
||||
result.importErrors(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance value is one of the enumerated values.
|
||||
*
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {ValidatorResult|null}
|
||||
*/
|
||||
validators['enum'] = function validateEnum (instance, schema, options, ctx) {
|
||||
if (instance === undefined) {
|
||||
return null;
|
||||
}
|
||||
if (!Array.isArray(schema['enum'])) {
|
||||
throw new SchemaError("enum expects an array", schema);
|
||||
}
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (!schema['enum'].some(helpers.deepCompareStrict.bind(null, instance))) {
|
||||
result.addError({
|
||||
name: 'enum',
|
||||
argument: schema['enum'],
|
||||
message: "is not one of enum values: " + schema['enum'].map(String).join(','),
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance exactly matches a given value
|
||||
*
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @return {ValidatorResult|null}
|
||||
*/
|
||||
validators['const'] = function validateEnum (instance, schema, options, ctx) {
|
||||
if (instance === undefined) {
|
||||
return null;
|
||||
}
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
if (!helpers.deepCompareStrict(schema['const'], instance)) {
|
||||
result.addError({
|
||||
name: 'const',
|
||||
argument: schema['const'],
|
||||
message: "does not exactly match expected constant: " + schema['const'],
|
||||
});
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates whether the instance if of a prohibited type.
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @return {null|ValidatorResult}
|
||||
*/
|
||||
validators.not = validators.disallow = function validateNot (instance, schema, options, ctx) {
|
||||
var self = this;
|
||||
if(instance===undefined) return null;
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
var notTypes = schema.not || schema.disallow;
|
||||
if(!notTypes) return null;
|
||||
if(!Array.isArray(notTypes)) notTypes=[notTypes];
|
||||
notTypes.forEach(function (type) {
|
||||
if (self.testType(instance, schema, options, ctx, type)) {
|
||||
var id = type && (type.$id || type.id);
|
||||
var schemaId = id || type;
|
||||
result.addError({
|
||||
name: 'not',
|
||||
argument: schemaId,
|
||||
message: "is of prohibited type " + schemaId,
|
||||
});
|
||||
}
|
||||
});
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = attribute;
|
||||
390
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/helpers.js
generated
vendored
Normal file
390
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/helpers.js
generated
vendored
Normal file
@@ -0,0 +1,390 @@
|
||||
'use strict';
|
||||
|
||||
var uri = require('url');
|
||||
|
||||
var ValidationError = exports.ValidationError = function ValidationError (message, instance, schema, path, name, argument) {
|
||||
if(Array.isArray(path)){
|
||||
this.path = path;
|
||||
this.property = path.reduce(function(sum, item){
|
||||
return sum + makeSuffix(item);
|
||||
}, 'instance');
|
||||
}else if(path !== undefined){
|
||||
this.property = path;
|
||||
}
|
||||
if (message) {
|
||||
this.message = message;
|
||||
}
|
||||
if (schema) {
|
||||
var id = schema.$id || schema.id;
|
||||
this.schema = id || schema;
|
||||
}
|
||||
if (instance !== undefined) {
|
||||
this.instance = instance;
|
||||
}
|
||||
this.name = name;
|
||||
this.argument = argument;
|
||||
this.stack = this.toString();
|
||||
};
|
||||
|
||||
ValidationError.prototype.toString = function toString() {
|
||||
return this.property + ' ' + this.message;
|
||||
};
|
||||
|
||||
var ValidatorResult = exports.ValidatorResult = function ValidatorResult(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.prototype.addError = 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;
|
||||
};
|
||||
|
||||
ValidatorResult.prototype.importErrors = 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);
|
||||
}
|
||||
};
|
||||
|
||||
function stringizer (v,i){
|
||||
return i+': '+v.toString()+'\n';
|
||||
}
|
||||
ValidatorResult.prototype.toString = function toString(res) {
|
||||
return this.errors.map(stringizer).join('');
|
||||
};
|
||||
|
||||
Object.defineProperty(ValidatorResult.prototype, "valid", { get: function() {
|
||||
return !this.errors.length;
|
||||
} });
|
||||
|
||||
module.exports.ValidatorResultError = ValidatorResultError;
|
||||
function ValidatorResultError(result) {
|
||||
if(Error.captureStackTrace){
|
||||
Error.captureStackTrace(this, ValidatorResultError);
|
||||
}
|
||||
this.instance = result.instance;
|
||||
this.schema = result.schema;
|
||||
this.options = result.options;
|
||||
this.errors = result.errors;
|
||||
}
|
||||
ValidatorResultError.prototype = new Error();
|
||||
ValidatorResultError.prototype.constructor = ValidatorResultError;
|
||||
ValidatorResultError.prototype.name = "Validation Error";
|
||||
|
||||
/**
|
||||
* Describes a problem with a Schema which prevents validation of an instance
|
||||
* @name SchemaError
|
||||
* @constructor
|
||||
*/
|
||||
var SchemaError = exports.SchemaError = function SchemaError (msg, schema) {
|
||||
this.message = msg;
|
||||
this.schema = schema;
|
||||
Error.call(this, msg);
|
||||
Error.captureStackTrace(this, SchemaError);
|
||||
};
|
||||
SchemaError.prototype = Object.create(Error.prototype,
|
||||
{
|
||||
constructor: {value: SchemaError, enumerable: false},
|
||||
name: {value: 'SchemaError', enumerable: false},
|
||||
});
|
||||
|
||||
var SchemaContext = exports.SchemaContext = function SchemaContext (schema, options, path, base, schemas) {
|
||||
this.schema = schema;
|
||||
this.options = options;
|
||||
if(Array.isArray(path)){
|
||||
this.path = path;
|
||||
this.propertyPath = path.reduce(function(sum, item){
|
||||
return sum + makeSuffix(item);
|
||||
}, 'instance');
|
||||
}else{
|
||||
this.propertyPath = path;
|
||||
}
|
||||
this.base = base;
|
||||
this.schemas = schemas;
|
||||
};
|
||||
|
||||
SchemaContext.prototype.resolve = function resolve (target) {
|
||||
return uri.resolve(this.base, target);
|
||||
};
|
||||
|
||||
SchemaContext.prototype.makeChild = function makeChild(schema, propertyName){
|
||||
var path = (propertyName===undefined) ? 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, path, base, Object.create(this.schemas));
|
||||
if(id && !ctx.schemas[base]){
|
||||
ctx.schemas[base] = schema;
|
||||
}
|
||||
return ctx;
|
||||
};
|
||||
|
||||
var FORMAT_REGEXPS = exports.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]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
|
||||
// FIXME whitespace is invalid
|
||||
'ipv6': /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,
|
||||
|
||||
// 7.3.5. Resource Identifiers
|
||||
// TODO: A more accurate regular expression for "uri" goes:
|
||||
// [A-Za-z][+\-.0-9A-Za-z]*:((/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?)?#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])|/?%[0-9A-Fa-f]{2}|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*(#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|/(/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?)?
|
||||
'uri': /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,
|
||||
'uri-reference': /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,
|
||||
'iri': /^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,
|
||||
'iri-reference': /^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([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}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[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': function (input) {
|
||||
return (typeof input === 'string') && parseFloat(input) === parseInt(input, 10) && !isNaN(input);
|
||||
},
|
||||
|
||||
// 7.3.8. regex
|
||||
'regex': function (input) {
|
||||
var result = true;
|
||||
try {
|
||||
new RegExp(input);
|
||||
} catch (e) {
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
// 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'];
|
||||
|
||||
exports.isFormat = function isFormat (input, format, validator) {
|
||||
if (typeof input === 'string' && FORMAT_REGEXPS[format] !== undefined) {
|
||||
if (FORMAT_REGEXPS[format] instanceof RegExp) {
|
||||
return FORMAT_REGEXPS[format].test(input);
|
||||
}
|
||||
if (typeof FORMAT_REGEXPS[format] === 'function') {
|
||||
return FORMAT_REGEXPS[format](input);
|
||||
}
|
||||
} else if (validator && validator.customFormats &&
|
||||
typeof validator.customFormats[format] === 'function') {
|
||||
return validator.customFormats[format](input);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
var makeSuffix = exports.makeSuffix = function makeSuffix (key) {
|
||||
key = key.toString();
|
||||
// This function could be capable of outputting valid a ECMAScript string, but the
|
||||
// resulting code for testing which form to use would be tens of thousands of characters long
|
||||
// That means this will use the name form for some illegal forms
|
||||
if (!key.match(/[.\s\[\]]/) && !key.match(/^[\d]/)) {
|
||||
return '.' + key;
|
||||
}
|
||||
if (key.match(/^\d+$/)) {
|
||||
return '[' + key + ']';
|
||||
}
|
||||
return '[' + JSON.stringify(key) + ']';
|
||||
};
|
||||
|
||||
exports.deepCompareStrict = function deepCompareStrict (a, b) {
|
||||
if (typeof a !== typeof b) {
|
||||
return false;
|
||||
}
|
||||
if (Array.isArray(a)) {
|
||||
if (!Array.isArray(b)) {
|
||||
return false;
|
||||
}
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
return a.every(function (v, i) {
|
||||
return deepCompareStrict(a[i], b[i]);
|
||||
});
|
||||
}
|
||||
if (typeof a === 'object') {
|
||||
if (!a || !b) {
|
||||
return a === b;
|
||||
}
|
||||
var aKeys = Object.keys(a);
|
||||
var bKeys = Object.keys(b);
|
||||
if (aKeys.length !== bKeys.length) {
|
||||
return false;
|
||||
}
|
||||
return aKeys.every(function (v) {
|
||||
return deepCompareStrict(a[v], b[v]);
|
||||
});
|
||||
}
|
||||
return a === b;
|
||||
};
|
||||
|
||||
function deepMerger (target, dst, e, i) {
|
||||
if (typeof e === 'object') {
|
||||
dst[i] = deepMerge(target[i], e);
|
||||
} else {
|
||||
if (target.indexOf(e) === -1) {
|
||||
dst.push(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function copyist (src, dst, key) {
|
||||
dst[key] = src[key];
|
||||
}
|
||||
|
||||
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] = deepMerge(target[key], src[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function deepMerge (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;
|
||||
}
|
||||
|
||||
module.exports.deepMerge = deepMerge;
|
||||
|
||||
/**
|
||||
* Validates instance against the provided schema
|
||||
* Implements URI+JSON Pointer encoding, e.g. "%7e"="~0"=>"~", "~1"="%2f"=>"/"
|
||||
* @param o
|
||||
* @param s The path to walk o along
|
||||
* @return any
|
||||
*/
|
||||
exports.objectGetPath = function objectGetPath(o, s) {
|
||||
var parts = s.split('/').slice(1);
|
||||
var k;
|
||||
while (typeof (k=parts.shift()) == 'string') {
|
||||
var n = decodeURIComponent(k.replace(/~0/,'~').replace(/~1/g,'/'));
|
||||
if (!(n in o)) return;
|
||||
o = o[n];
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
function pathEncoder (v) {
|
||||
return '/'+encodeURIComponent(v).replace(/~/g,'%7E');
|
||||
}
|
||||
/**
|
||||
* Accept an Array of property names and return a JSON Pointer URI fragment
|
||||
* @param Array a
|
||||
* @return {String}
|
||||
*/
|
||||
exports.encodePath = function encodePointer(a){
|
||||
// ~ must be encoded explicitly because hacks
|
||||
// the slash is encoded by encodeURIComponent
|
||||
return a.map(pathEncoder).join('');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Calculate the number of decimal places a number uses
|
||||
* We need this to get correct results out of multipleOf and divisibleBy
|
||||
* when either figure is has decimal places, due to IEEE-754 float issues.
|
||||
* @param number
|
||||
* @returns {number}
|
||||
*/
|
||||
exports.getDecimalPlaces = 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;
|
||||
};
|
||||
|
||||
exports.isSchema = function isSchema(val){
|
||||
return (typeof val === 'object' && val) || (typeof val === 'boolean');
|
||||
};
|
||||
|
||||
142
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/index.d.ts
generated
vendored
Normal file
142
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
This is type definition for typescript.
|
||||
This is for library users. Thus, properties and methods for internal use is omitted.
|
||||
*/
|
||||
export declare class Validator {
|
||||
constructor();
|
||||
customFormats: {[formatName: string]: CustomFormat};
|
||||
schemas: {[id: string]: Schema};
|
||||
unresolvedRefs: string[];
|
||||
|
||||
attributes: {[property: string]: CustomProperty};
|
||||
|
||||
addSchema(schema?: Schema, uri?: string): Schema|void;
|
||||
validate(instance: any, schema: Schema, options?: Options, ctx?: SchemaContext): ValidatorResult;
|
||||
}
|
||||
|
||||
export declare class ValidatorResult {
|
||||
constructor(instance: any, schema: Schema, options: Options, ctx: SchemaContext)
|
||||
instance: any;
|
||||
schema: Schema;
|
||||
propertyPath: string;
|
||||
errors: ValidationError[];
|
||||
throwError: boolean;
|
||||
disableFormat: boolean;
|
||||
valid: boolean;
|
||||
addError(detail: string|ErrorDetail): ValidationError;
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
export declare class ValidationError {
|
||||
constructor(message?: string, instance?: any, schema?: Schema, propertyPath?: any, name?: string, argument?: any);
|
||||
path: (string|number)[];
|
||||
property: string;
|
||||
message: string;
|
||||
schema: string|Schema;
|
||||
instance: any;
|
||||
name: string;
|
||||
argument: any;
|
||||
toString(): string;
|
||||
stack: string;
|
||||
}
|
||||
|
||||
export declare class SchemaError extends Error{
|
||||
constructor(msg: string, schema: Schema);
|
||||
schema: Schema;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export declare function validate(instance: any, schema: any, options?: Options): ValidatorResult
|
||||
|
||||
export interface Schema {
|
||||
$id?: string
|
||||
id?: string
|
||||
$schema?: string
|
||||
$ref?: string
|
||||
title?: string
|
||||
description?: string
|
||||
multipleOf?: number
|
||||
maximum?: number
|
||||
exclusiveMaximum?: number | boolean
|
||||
minimum?: number
|
||||
exclusiveMinimum?: number | boolean
|
||||
maxLength?: number
|
||||
minLength?: number
|
||||
pattern?: string | RegExp
|
||||
additionalItems?: boolean | Schema
|
||||
items?: Schema | Schema[]
|
||||
maxItems?: number
|
||||
minItems?: number
|
||||
uniqueItems?: boolean
|
||||
maxProperties?: number
|
||||
minProperties?: number
|
||||
required?: string[] | boolean
|
||||
additionalProperties?: boolean | Schema
|
||||
definitions?: {
|
||||
[name: string]: Schema
|
||||
}
|
||||
properties?: {
|
||||
[name: string]: Schema
|
||||
}
|
||||
patternProperties?: {
|
||||
[name: string]: Schema
|
||||
}
|
||||
dependencies?: {
|
||||
[name: string]: Schema | string[]
|
||||
}
|
||||
const?: any
|
||||
'enum'?: any[]
|
||||
type?: string | string[]
|
||||
format?: string
|
||||
allOf?: Schema[]
|
||||
anyOf?: Schema[]
|
||||
oneOf?: Schema[]
|
||||
not?: Schema
|
||||
if?: Schema
|
||||
then?: Schema
|
||||
else?: Schema
|
||||
}
|
||||
|
||||
export interface Options {
|
||||
skipAttributes?: string[];
|
||||
allowUnknownAttributes?: boolean;
|
||||
preValidateProperty?: PreValidatePropertyFunction;
|
||||
rewrite?: RewriteFunction;
|
||||
base?: string;
|
||||
throwError?: boolean;
|
||||
required?: boolean;
|
||||
throwFirst?: boolean;
|
||||
throwAll?: boolean;
|
||||
nestedErrors?: boolean;
|
||||
}
|
||||
|
||||
export interface RewriteFunction {
|
||||
(instance: any, schema: Schema, options: Options, ctx: SchemaContext): any;
|
||||
}
|
||||
|
||||
export interface PreValidatePropertyFunction {
|
||||
(instance: any, key: string, schema: Schema, options: Options, ctx: SchemaContext): any;
|
||||
}
|
||||
|
||||
export interface SchemaContext {
|
||||
schema: Schema;
|
||||
options: Options;
|
||||
propertyPath: string;
|
||||
base: string;
|
||||
schemas: {[base: string]: Schema};
|
||||
makeChild: (schema: Schema, key: string) => SchemaContext;
|
||||
}
|
||||
|
||||
export interface CustomFormat {
|
||||
(input: any): boolean;
|
||||
}
|
||||
|
||||
export interface CustomProperty {
|
||||
(instance: any, schema: Schema, options: Options, ctx: SchemaContext): string|ValidatorResult;
|
||||
}
|
||||
|
||||
export interface ErrorDetail {
|
||||
message: string;
|
||||
name: string;
|
||||
argument: string;
|
||||
}
|
||||
15
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/index.js
generated
vendored
Normal file
15
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/index.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict';
|
||||
|
||||
var Validator = module.exports.Validator = require('./validator');
|
||||
|
||||
module.exports.ValidatorResult = require('./helpers').ValidatorResult;
|
||||
module.exports.ValidatorResultError = require('./helpers').ValidatorResultError;
|
||||
module.exports.ValidationError = require('./helpers').ValidationError;
|
||||
module.exports.SchemaError = require('./helpers').SchemaError;
|
||||
module.exports.SchemaScanResult = require('./scan').SchemaScanResult;
|
||||
module.exports.scan = require('./scan').scan;
|
||||
|
||||
module.exports.validate = function (instance, schema, options) {
|
||||
var v = new Validator();
|
||||
return v.validate(instance, schema, options);
|
||||
};
|
||||
75
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/scan.js
generated
vendored
Normal file
75
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/scan.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
|
||||
var urilib = require('url');
|
||||
var helpers = require('./helpers');
|
||||
|
||||
module.exports.SchemaScanResult = SchemaScanResult;
|
||||
function SchemaScanResult(found, ref){
|
||||
this.id = found;
|
||||
this.ref = ref;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a schema with a certain urn to the Validator instance.
|
||||
* @param string uri
|
||||
* @param object schema
|
||||
* @return {Object}
|
||||
*/
|
||||
module.exports.scan = function scan(base, schema){
|
||||
function scanSchema(baseuri, schema){
|
||||
if(!schema || typeof schema!='object') return;
|
||||
// Mark all referenced schemas so we can tell later which schemas are referred to, but never defined
|
||||
if(schema.$ref){
|
||||
var resolvedUri = urilib.resolve(baseuri, schema.$ref);
|
||||
ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri]+1 : 0;
|
||||
return;
|
||||
}
|
||||
var id = schema.$id || schema.id;
|
||||
var ourBase = id ? urilib.resolve(baseuri, id) : baseuri;
|
||||
if (ourBase) {
|
||||
// If there's no fragment, append an empty one
|
||||
if(ourBase.indexOf('#')<0) ourBase += '#';
|
||||
if(found[ourBase]){
|
||||
if(!helpers.deepCompareStrict(found[ourBase], schema)){
|
||||
throw new Error('Schema <'+ourBase+'> already exists with different definition');
|
||||
}
|
||||
return found[ourBase];
|
||||
}
|
||||
found[ourBase] = schema;
|
||||
// strip trailing fragment
|
||||
if(ourBase[ourBase.length-1]=='#'){
|
||||
found[ourBase.substring(0, ourBase.length-1)] = schema;
|
||||
}
|
||||
}
|
||||
scanArray(ourBase+'/items', (Array.isArray(schema.items)?schema.items:[schema.items]));
|
||||
scanArray(ourBase+'/extends', (Array.isArray(schema.extends)?schema.extends:[schema.extends]));
|
||||
scanSchema(ourBase+'/additionalItems', schema.additionalItems);
|
||||
scanObject(ourBase+'/properties', schema.properties);
|
||||
scanSchema(ourBase+'/additionalProperties', schema.additionalProperties);
|
||||
scanObject(ourBase+'/definitions', schema.definitions);
|
||||
scanObject(ourBase+'/patternProperties', schema.patternProperties);
|
||||
scanObject(ourBase+'/dependencies', schema.dependencies);
|
||||
scanArray(ourBase+'/disallow', schema.disallow);
|
||||
scanArray(ourBase+'/allOf', schema.allOf);
|
||||
scanArray(ourBase+'/anyOf', schema.anyOf);
|
||||
scanArray(ourBase+'/oneOf', schema.oneOf);
|
||||
scanSchema(ourBase+'/not', schema.not);
|
||||
}
|
||||
function scanArray(baseuri, schemas){
|
||||
if(!Array.isArray(schemas)) return;
|
||||
for(var i=0; i<schemas.length; i++){
|
||||
scanSchema(baseuri+'/'+i, schemas[i]);
|
||||
}
|
||||
}
|
||||
function scanObject(baseuri, schemas){
|
||||
if(!schemas || typeof schemas!='object') return;
|
||||
for(var p in schemas){
|
||||
scanSchema(baseuri+'/'+p, schemas[p]);
|
||||
}
|
||||
}
|
||||
|
||||
var found = {};
|
||||
var ref = {};
|
||||
scanSchema(base, schema);
|
||||
return new SchemaScanResult(found, ref);
|
||||
};
|
||||
336
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/validator.js
generated
vendored
Normal file
336
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/lib/validator.js
generated
vendored
Normal file
@@ -0,0 +1,336 @@
|
||||
'use strict';
|
||||
|
||||
var urilib = require('url');
|
||||
|
||||
var attribute = require('./attribute');
|
||||
var helpers = require('./helpers');
|
||||
var scanSchema = require('./scan').scan;
|
||||
var ValidatorResult = helpers.ValidatorResult;
|
||||
var ValidatorResultError = helpers.ValidatorResultError;
|
||||
var SchemaError = helpers.SchemaError;
|
||||
var SchemaContext = helpers.SchemaContext;
|
||||
//var anonymousBase = 'vnd.jsonschema:///';
|
||||
var anonymousBase = '/';
|
||||
|
||||
/**
|
||||
* Creates a new Validator object
|
||||
* @name Validator
|
||||
* @constructor
|
||||
*/
|
||||
var Validator = function Validator () {
|
||||
// Allow a validator instance to override global custom formats or to have their
|
||||
// own custom formats.
|
||||
this.customFormats = Object.create(Validator.prototype.customFormats);
|
||||
this.schemas = {};
|
||||
this.unresolvedRefs = [];
|
||||
|
||||
// Use Object.create to make this extensible without Validator instances stepping on each other's toes.
|
||||
this.types = Object.create(types);
|
||||
this.attributes = Object.create(attribute.validators);
|
||||
};
|
||||
|
||||
// Allow formats to be registered globally.
|
||||
Validator.prototype.customFormats = {};
|
||||
|
||||
// Hint at the presence of a property
|
||||
Validator.prototype.schemas = null;
|
||||
Validator.prototype.types = null;
|
||||
Validator.prototype.attributes = null;
|
||||
Validator.prototype.unresolvedRefs = null;
|
||||
|
||||
/**
|
||||
* Adds a schema with a certain urn to the Validator instance.
|
||||
* @param schema
|
||||
* @param urn
|
||||
* @return {Object}
|
||||
*/
|
||||
Validator.prototype.addSchema = function addSchema (schema, base) {
|
||||
var self = this;
|
||||
if (!schema) {
|
||||
return null;
|
||||
}
|
||||
var scan = scanSchema(base||anonymousBase, schema);
|
||||
var ourUri = base || schema.$id || schema.id;
|
||||
for(var uri in scan.id){
|
||||
this.schemas[uri] = scan.id[uri];
|
||||
}
|
||||
for(var uri in scan.ref){
|
||||
// If this schema is already defined, it will be filtered out by the next step
|
||||
this.unresolvedRefs.push(uri);
|
||||
}
|
||||
// Remove newly defined schemas from unresolvedRefs
|
||||
this.unresolvedRefs = this.unresolvedRefs.filter(function(uri){
|
||||
return typeof self.schemas[uri]==='undefined';
|
||||
});
|
||||
return this.schemas[ourUri];
|
||||
};
|
||||
|
||||
Validator.prototype.addSubSchemaArray = function addSubSchemaArray(baseuri, schemas) {
|
||||
if(!Array.isArray(schemas)) return;
|
||||
for(var i=0; i<schemas.length; i++){
|
||||
this.addSubSchema(baseuri, schemas[i]);
|
||||
}
|
||||
};
|
||||
|
||||
Validator.prototype.addSubSchemaObject = function addSubSchemaArray(baseuri, schemas) {
|
||||
if(!schemas || typeof schemas!='object') return;
|
||||
for(var p in schemas){
|
||||
this.addSubSchema(baseuri, schemas[p]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Sets all the schemas of the Validator instance.
|
||||
* @param schemas
|
||||
*/
|
||||
Validator.prototype.setSchemas = function setSchemas (schemas) {
|
||||
this.schemas = schemas;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns the schema of a certain urn
|
||||
* @param urn
|
||||
*/
|
||||
Validator.prototype.getSchema = function getSchema (urn) {
|
||||
return this.schemas[urn];
|
||||
};
|
||||
|
||||
/**
|
||||
* Validates instance against the provided schema
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param [options]
|
||||
* @param [ctx]
|
||||
* @return {Array}
|
||||
*/
|
||||
Validator.prototype.validate = function validate (instance, schema, options, ctx) {
|
||||
if((typeof schema !== 'boolean' && typeof schema !== 'object') || schema === null){
|
||||
throw new SchemaError('Expected `schema` to be an object or boolean');
|
||||
}
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
// This section indexes subschemas in the provided schema, so they don't need to be added with Validator#addSchema
|
||||
// This will work so long as the function at uri.resolve() will resolve a relative URI to a relative URI
|
||||
var id = schema.$id || schema.id;
|
||||
var base = urilib.resolve(options.base||anonymousBase, id||'');
|
||||
if(!ctx){
|
||||
ctx = new SchemaContext(schema, options, [], base, Object.create(this.schemas));
|
||||
if (!ctx.schemas[base]) {
|
||||
ctx.schemas[base] = schema;
|
||||
}
|
||||
var found = scanSchema(base, schema);
|
||||
for(var n in found.id){
|
||||
var sch = found.id[n];
|
||||
ctx.schemas[n] = sch;
|
||||
}
|
||||
}
|
||||
if(options.required && instance===undefined){
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
result.addError('is required, but is undefined');
|
||||
return result;
|
||||
}
|
||||
var result = this.validateSchema(instance, schema, options, ctx);
|
||||
if (!result) {
|
||||
throw new Error('Result undefined');
|
||||
}else if(options.throwAll && result.errors.length){
|
||||
throw new ValidatorResultError(result);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* @param Object schema
|
||||
* @return mixed schema uri or false
|
||||
*/
|
||||
function shouldResolve(schema) {
|
||||
var ref = (typeof schema === 'string') ? schema : schema.$ref;
|
||||
if (typeof ref=='string') return ref;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an instance against the schema (the actual work horse)
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @private
|
||||
* @return {ValidatorResult}
|
||||
*/
|
||||
Validator.prototype.validateSchema = function validateSchema (instance, schema, options, ctx) {
|
||||
var result = new ValidatorResult(instance, schema, options, ctx);
|
||||
|
||||
// Support for the true/false schemas
|
||||
if(typeof schema==='boolean') {
|
||||
if(schema===true){
|
||||
// `true` is always valid
|
||||
schema = {};
|
||||
}else if(schema===false){
|
||||
// `false` is always invalid
|
||||
schema = {type: []};
|
||||
}
|
||||
}else if(!schema){
|
||||
// This might be a string
|
||||
throw new Error("schema is undefined");
|
||||
}
|
||||
|
||||
if (schema['extends']) {
|
||||
if (Array.isArray(schema['extends'])) {
|
||||
var schemaobj = {schema: schema, ctx: ctx};
|
||||
schema['extends'].forEach(this.schemaTraverser.bind(this, schemaobj));
|
||||
schema = schemaobj.schema;
|
||||
schemaobj.schema = null;
|
||||
schemaobj.ctx = null;
|
||||
schemaobj = null;
|
||||
} else {
|
||||
schema = helpers.deepMerge(schema, this.superResolve(schema['extends'], ctx));
|
||||
}
|
||||
}
|
||||
|
||||
// If passed a string argument, load that schema URI
|
||||
var switchSchema = shouldResolve(schema);
|
||||
if (switchSchema) {
|
||||
var resolved = this.resolve(schema, switchSchema, ctx);
|
||||
var subctx = new SchemaContext(resolved.subschema, options, ctx.path, resolved.switchSchema, ctx.schemas);
|
||||
return this.validateSchema(instance, resolved.subschema, options, subctx);
|
||||
}
|
||||
|
||||
var skipAttributes = options && options.skipAttributes || [];
|
||||
// Validate each schema attribute against the instance
|
||||
for (var key in schema) {
|
||||
if (!attribute.ignoreProperties[key] && skipAttributes.indexOf(key) < 0) {
|
||||
var validatorErr = null;
|
||||
var validator = this.attributes[key];
|
||||
if (validator) {
|
||||
validatorErr = validator.call(this, instance, schema, options, ctx);
|
||||
} else if (options.allowUnknownAttributes === false) {
|
||||
// This represents an error with the schema itself, not an invalid instance
|
||||
throw new SchemaError("Unsupported attribute: " + key, schema);
|
||||
}
|
||||
if (validatorErr) {
|
||||
result.importErrors(validatorErr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof options.rewrite == 'function') {
|
||||
var value = options.rewrite.call(this, instance, schema, options, ctx);
|
||||
result.instance = value;
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param Object schema
|
||||
* @param SchemaContext ctx
|
||||
* @returns Object schema or resolved schema
|
||||
*/
|
||||
Validator.prototype.schemaTraverser = function schemaTraverser (schemaobj, s) {
|
||||
schemaobj.schema = helpers.deepMerge(schemaobj.schema, this.superResolve(s, schemaobj.ctx));
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param Object schema
|
||||
* @param SchemaContext ctx
|
||||
* @returns Object schema or resolved schema
|
||||
*/
|
||||
Validator.prototype.superResolve = function superResolve (schema, ctx) {
|
||||
var ref = shouldResolve(schema);
|
||||
if(ref) {
|
||||
return this.resolve(schema, ref, ctx).subschema;
|
||||
}
|
||||
return schema;
|
||||
};
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @param Object schema
|
||||
* @param Object switchSchema
|
||||
* @param SchemaContext ctx
|
||||
* @return Object resolved schemas {subschema:String, switchSchema: String}
|
||||
* @throws SchemaError
|
||||
*/
|
||||
Validator.prototype.resolve = function resolve (schema, switchSchema, ctx) {
|
||||
switchSchema = ctx.resolve(switchSchema);
|
||||
// First see if the schema exists under the provided URI
|
||||
if (ctx.schemas[switchSchema]) {
|
||||
return {subschema: ctx.schemas[switchSchema], switchSchema: switchSchema};
|
||||
}
|
||||
// Else try walking the property pointer
|
||||
var parsed = urilib.parse(switchSchema);
|
||||
var fragment = parsed && parsed.hash;
|
||||
var document = fragment && fragment.length && switchSchema.substr(0, switchSchema.length - fragment.length);
|
||||
if (!document || !ctx.schemas[document]) {
|
||||
throw new SchemaError("no such schema <" + switchSchema + ">", schema);
|
||||
}
|
||||
var subschema = helpers.objectGetPath(ctx.schemas[document], fragment.substr(1));
|
||||
if(subschema===undefined){
|
||||
throw new SchemaError("no such schema " + fragment + " located in <" + document + ">", schema);
|
||||
}
|
||||
return {subschema: subschema, switchSchema: switchSchema};
|
||||
};
|
||||
|
||||
/**
|
||||
* Tests whether the instance if of a certain type.
|
||||
* @private
|
||||
* @param instance
|
||||
* @param schema
|
||||
* @param options
|
||||
* @param ctx
|
||||
* @param type
|
||||
* @return {boolean}
|
||||
*/
|
||||
Validator.prototype.testType = function validateType (instance, schema, options, ctx, type) {
|
||||
if(type===undefined){
|
||||
return;
|
||||
}else if(type===null){
|
||||
throw new SchemaError('Unexpected null in "type" keyword');
|
||||
}
|
||||
if (typeof this.types[type] == 'function') {
|
||||
return this.types[type].call(this, instance);
|
||||
}
|
||||
if (type && typeof type == 'object') {
|
||||
var res = this.validateSchema(instance, type, options, ctx);
|
||||
return res === undefined || !(res && res.errors.length);
|
||||
}
|
||||
// Undefined or properties not on the list are acceptable, same as not being defined
|
||||
return true;
|
||||
};
|
||||
|
||||
var types = Validator.prototype.types = {};
|
||||
types.string = function testString (instance) {
|
||||
return typeof instance == 'string';
|
||||
};
|
||||
types.number = function testNumber (instance) {
|
||||
// isFinite returns false for NaN, Infinity, and -Infinity
|
||||
return typeof instance == 'number' && isFinite(instance);
|
||||
};
|
||||
types.integer = function testInteger (instance) {
|
||||
return (typeof instance == 'number') && instance % 1 === 0;
|
||||
};
|
||||
types.boolean = function testBoolean (instance) {
|
||||
return typeof instance == 'boolean';
|
||||
};
|
||||
types.array = function testArray (instance) {
|
||||
return Array.isArray(instance);
|
||||
};
|
||||
types['null'] = function testNull (instance) {
|
||||
return instance === null;
|
||||
};
|
||||
types.date = function testDate (instance) {
|
||||
return instance instanceof Date;
|
||||
};
|
||||
types.any = function testAny (instance) {
|
||||
return true;
|
||||
};
|
||||
types.object = function testObject (instance) {
|
||||
// TODO: fix this - see #15
|
||||
return instance && (typeof instance === 'object') && !(Array.isArray(instance)) && !(instance instanceof Date);
|
||||
};
|
||||
|
||||
module.exports = Validator;
|
||||
42
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/package.json
generated
vendored
Normal file
42
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/jsonschema/package.json
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
{
|
||||
"author": "Tom de Grunt <tom@degrunt.nl>",
|
||||
"name": "jsonschema",
|
||||
"version": "1.4.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Austin Wright"
|
||||
}
|
||||
],
|
||||
"main": "./lib/index.js",
|
||||
"typings": "./lib/index.d.ts",
|
||||
"devDependencies": {
|
||||
"@stryker-mutator/core": "^4.0.0",
|
||||
"@stryker-mutator/mocha-runner": "^4.0.0",
|
||||
"chai": "~4.2.0",
|
||||
"eslint": "^7.7.0",
|
||||
"json-metaschema": "^1.2.0",
|
||||
"mocha": "~8.1.1"
|
||||
},
|
||||
"optionalDependencies": {},
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"json",
|
||||
"schema",
|
||||
"jsonschema",
|
||||
"validator",
|
||||
"validation"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/tdegrunt/jsonschema.git"
|
||||
},
|
||||
"description": "A fast and easy to use JSON Schema validator",
|
||||
"scripts": {
|
||||
"stryker": "stryker run",
|
||||
"test": "./node_modules/.bin/mocha -R spec"
|
||||
}
|
||||
}
|
||||
15
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/LICENSE
generated
vendored
Normal file
15
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
665
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/README.md
generated
vendored
Normal file
665
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/README.md
generated
vendored
Normal file
@@ -0,0 +1,665 @@
|
||||
semver(1) -- The semantic versioner for npm
|
||||
===========================================
|
||||
|
||||
## Install
|
||||
|
||||
```bash
|
||||
npm install semver
|
||||
````
|
||||
|
||||
## Usage
|
||||
|
||||
As a node module:
|
||||
|
||||
```js
|
||||
const semver = require('semver')
|
||||
|
||||
semver.valid('1.2.3') // '1.2.3'
|
||||
semver.valid('a.b.c') // null
|
||||
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||
semver.gt('1.2.3', '9.8.7') // false
|
||||
semver.lt('1.2.3', '9.8.7') // true
|
||||
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||
```
|
||||
|
||||
You can also just load the module for the function that you care about if
|
||||
you'd like to minimize your footprint.
|
||||
|
||||
```js
|
||||
// load the whole API at once in a single object
|
||||
const semver = require('semver')
|
||||
|
||||
// or just load the bits you need
|
||||
// all of them listed here, just pick and choose what you want
|
||||
|
||||
// classes
|
||||
const SemVer = require('semver/classes/semver')
|
||||
const Comparator = require('semver/classes/comparator')
|
||||
const Range = require('semver/classes/range')
|
||||
|
||||
// functions for working with versions
|
||||
const semverParse = require('semver/functions/parse')
|
||||
const semverValid = require('semver/functions/valid')
|
||||
const semverClean = require('semver/functions/clean')
|
||||
const semverInc = require('semver/functions/inc')
|
||||
const semverDiff = require('semver/functions/diff')
|
||||
const semverMajor = require('semver/functions/major')
|
||||
const semverMinor = require('semver/functions/minor')
|
||||
const semverPatch = require('semver/functions/patch')
|
||||
const semverPrerelease = require('semver/functions/prerelease')
|
||||
const semverCompare = require('semver/functions/compare')
|
||||
const semverRcompare = require('semver/functions/rcompare')
|
||||
const semverCompareLoose = require('semver/functions/compare-loose')
|
||||
const semverCompareBuild = require('semver/functions/compare-build')
|
||||
const semverSort = require('semver/functions/sort')
|
||||
const semverRsort = require('semver/functions/rsort')
|
||||
|
||||
// low-level comparators between versions
|
||||
const semverGt = require('semver/functions/gt')
|
||||
const semverLt = require('semver/functions/lt')
|
||||
const semverEq = require('semver/functions/eq')
|
||||
const semverNeq = require('semver/functions/neq')
|
||||
const semverGte = require('semver/functions/gte')
|
||||
const semverLte = require('semver/functions/lte')
|
||||
const semverCmp = require('semver/functions/cmp')
|
||||
const semverCoerce = require('semver/functions/coerce')
|
||||
|
||||
// working with ranges
|
||||
const semverSatisfies = require('semver/functions/satisfies')
|
||||
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
||||
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
||||
const semverToComparators = require('semver/ranges/to-comparators')
|
||||
const semverMinVersion = require('semver/ranges/min-version')
|
||||
const semverValidRange = require('semver/ranges/valid')
|
||||
const semverOutside = require('semver/ranges/outside')
|
||||
const semverGtr = require('semver/ranges/gtr')
|
||||
const semverLtr = require('semver/ranges/ltr')
|
||||
const semverIntersects = require('semver/ranges/intersects')
|
||||
const semverSimplifyRange = require('semver/ranges/simplify')
|
||||
const semverRangeSubset = require('semver/ranges/subset')
|
||||
```
|
||||
|
||||
As a command-line utility:
|
||||
|
||||
```
|
||||
$ semver -h
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, prerelease, or release. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-n <0|1|false>
|
||||
Base number for prerelease identifier (default: 0).
|
||||
Use false to omit the number altogether.
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.
|
||||
```
|
||||
|
||||
## Versions
|
||||
|
||||
A "version" is described by the `v2.0.0` specification found at
|
||||
<https://semver.org/>.
|
||||
|
||||
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||
Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer
|
||||
specification but should not be used anymore.
|
||||
|
||||
## Ranges
|
||||
|
||||
A `version range` is a set of `comparators` that specify versions
|
||||
that satisfy the range.
|
||||
|
||||
A `comparator` is composed of an `operator` and a `version`. The set
|
||||
of primitive `operators` is:
|
||||
|
||||
* `<` Less than
|
||||
* `<=` Less than or equal to
|
||||
* `>` Greater than
|
||||
* `>=` Greater than or equal to
|
||||
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||
so this operator is optional but MAY be included.
|
||||
|
||||
For example, the comparator `>=1.2.7` would match the versions
|
||||
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
|
||||
would match the versions `2.0.0` and `3.1.0`, but not the versions
|
||||
`1.0.1` or `1.1.0`.
|
||||
|
||||
Comparators can be joined by whitespace to form a `comparator set`,
|
||||
which is satisfied by the **intersection** of all of the comparators
|
||||
it includes.
|
||||
|
||||
A range is composed of one or more comparator sets, joined by `||`. A
|
||||
version matches a range if and only if every comparator in at least
|
||||
one of the `||`-separated comparator sets is satisfied by the version.
|
||||
|
||||
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||
or `1.1.0`.
|
||||
|
||||
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||
|
||||
### Prerelease Tags
|
||||
|
||||
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||
it will only be allowed to satisfy comparator sets if at least one
|
||||
comparator with the same `[major, minor, patch]` tuple also has a
|
||||
prerelease tag.
|
||||
|
||||
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||
range only accepts prerelease tags on the `1.2.3` version.
|
||||
Version `3.4.5` *would* satisfy the range because it does not have a
|
||||
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||
|
||||
The purpose of this behavior is twofold. First, prerelease versions
|
||||
frequently are updated very quickly, and contain many breaking changes
|
||||
that are (by the author's design) not yet fit for public consumption.
|
||||
Therefore, by default, they are excluded from range-matching
|
||||
semantics.
|
||||
|
||||
Second, a user who has opted into using a prerelease version has
|
||||
indicated the intent to use *that specific* set of
|
||||
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||
the user is indicating that they are aware of the risk. However, it
|
||||
is still not appropriate to assume that they have opted into taking a
|
||||
similar risk on the *next* set of prerelease versions.
|
||||
|
||||
Note that this behavior can be suppressed (treating all prerelease
|
||||
versions as if they were normal versions, for range-matching)
|
||||
by setting the `includePrerelease` flag on the options
|
||||
object to any
|
||||
[functions](https://github.com/npm/node-semver#functions) that do
|
||||
range matching.
|
||||
|
||||
#### Prerelease Identifiers
|
||||
|
||||
The method `.inc` takes an additional `identifier` string argument that
|
||||
will append the value of the string as a prerelease identifier:
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||
// '1.2.4-beta.0'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta
|
||||
1.2.4-beta.0
|
||||
```
|
||||
|
||||
Which then can be used to increment further:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.0 -i prerelease
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
To get out of the prerelease phase, use the `release` option:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.4-beta.1 -i release
|
||||
1.2.4
|
||||
```
|
||||
|
||||
#### Prerelease Identifier Base
|
||||
|
||||
The method `.inc` takes an optional parameter 'identifierBase' string
|
||||
that will let you let your prerelease number as zero-based or one-based.
|
||||
Set to `false` to omit the prerelease number altogether.
|
||||
If you do not specify this parameter, it will default to zero-based.
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta', '1')
|
||||
// '1.2.4-beta.1'
|
||||
```
|
||||
|
||||
```javascript
|
||||
semver.inc('1.2.3', 'prerelease', 'beta', false)
|
||||
// '1.2.4-beta'
|
||||
```
|
||||
|
||||
command-line example:
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta -n 1
|
||||
1.2.4-beta.1
|
||||
```
|
||||
|
||||
```bash
|
||||
$ semver 1.2.3 -i prerelease --preid beta -n false
|
||||
1.2.4-beta
|
||||
```
|
||||
|
||||
### Advanced Range Syntax
|
||||
|
||||
Advanced range syntax desugars to primitive comparators in
|
||||
deterministic ways.
|
||||
|
||||
Advanced ranges may be combined in the same way as primitive
|
||||
comparators using white space or `||`.
|
||||
|
||||
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||
|
||||
Specifies an inclusive set.
|
||||
|
||||
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the first version in the inclusive
|
||||
range, then the missing pieces are replaced with zeroes.
|
||||
|
||||
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||
|
||||
If a partial version is provided as the second version in the
|
||||
inclusive range, then all versions that start with the supplied parts
|
||||
of the tuple are accepted, but nothing that would be greater than the
|
||||
provided tuple parts.
|
||||
|
||||
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
|
||||
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`
|
||||
|
||||
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||
|
||||
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||
numeric values in the `[major, minor, patch]` tuple.
|
||||
|
||||
* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
|
||||
`includePrerelease` is specified, in which case any version at all
|
||||
satisfies)
|
||||
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
|
||||
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)
|
||||
|
||||
A partial version range is treated as an X-Range, so the special
|
||||
character is in fact optional.
|
||||
|
||||
* `""` (empty string) := `*` := `>=0.0.0`
|
||||
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`
|
||||
|
||||
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||
|
||||
Allows patch-level changes if a minor version is specified on the
|
||||
comparator. Allows minor-level changes if not.
|
||||
|
||||
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
|
||||
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
|
||||
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
|
||||
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
|
||||
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
|
||||
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
|
||||
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
|
||||
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||
|
||||
Allows changes that do not modify the left-most non-zero element in the
|
||||
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||
minor updates for versions `1.0.0` and above, patch updates for
|
||||
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||
|
||||
Many authors treat a `0.x` version as if the `x` were the major
|
||||
"breaking-change" indicator.
|
||||
|
||||
Caret ranges are ideal when an author may make breaking changes
|
||||
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||
However, it presumes that there will *not* be breaking changes between
|
||||
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||
additive (but non-breaking), according to commonly observed practices.
|
||||
|
||||
* `^1.2.3` := `>=1.2.3 <2.0.0-0`
|
||||
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
|
||||
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
|
||||
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
|
||||
the `1.2.3` version will be allowed, if they are greater than or
|
||||
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||
different `[major, minor, patch]` tuple.
|
||||
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0` Note that prereleases in the
|
||||
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||
|
||||
When parsing caret ranges, a missing `patch` value desugars to the
|
||||
number `0`, but will allow flexibility within that value, even if the
|
||||
major and minor versions are both `0`.
|
||||
|
||||
* `^1.2.x` := `>=1.2.0 <2.0.0-0`
|
||||
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
|
||||
* `^0.0` := `>=0.0.0 <0.1.0-0`
|
||||
|
||||
A missing `minor` and `patch` values will desugar to zero, but also
|
||||
allow flexibility within those values, even if the major version is
|
||||
zero.
|
||||
|
||||
* `^1.x` := `>=1.0.0 <2.0.0-0`
|
||||
* `^0.x` := `>=0.0.0 <1.0.0-0`
|
||||
|
||||
### Range Grammar
|
||||
|
||||
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||
for the benefit of parser authors:
|
||||
|
||||
```bnf
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
```
|
||||
|
||||
## Functions
|
||||
|
||||
All methods and classes take a final `options` object argument. All
|
||||
options in this object are `false` by default. The options supported
|
||||
are:
|
||||
|
||||
- `loose`: Be more forgiving about not-quite-valid semver strings.
|
||||
(Any resulting output will always be 100% strict compliant, of
|
||||
course.) For backwards compatibility reasons, if the `options`
|
||||
argument is a boolean value instead of an object, it is interpreted
|
||||
to be the `loose` param.
|
||||
- `includePrerelease`: Set to suppress the [default
|
||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||
excluding prerelease tagged versions from ranges unless they are
|
||||
explicitly opted into.
|
||||
|
||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||
strings that they parse.
|
||||
|
||||
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||
* `inc(v, releaseType, options, identifier, identifierBase)`:
|
||||
Return the version incremented by the release
|
||||
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||
`prepatch`, `prerelease`, or `release`), or null if it's not valid
|
||||
* `premajor` in one call will bump the version up to the next major
|
||||
version and down to a prerelease of that major version.
|
||||
`preminor`, and `prepatch` work the same way.
|
||||
* If called from a non-prerelease version, `prerelease` will work the
|
||||
same as `prepatch`. It increments the patch version and then makes a
|
||||
prerelease. If the input version is already a prerelease it simply
|
||||
increments it.
|
||||
* `release` will remove any prerelease part of the version.
|
||||
* `identifier` can be used to prefix `premajor`, `preminor`,
|
||||
`prepatch`, or `prerelease` version increments. `identifierBase`
|
||||
is the base to be used for the `prerelease` identifier.
|
||||
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||
* `major(v)`: Return the major version number.
|
||||
* `minor(v)`: Return the minor version number.
|
||||
* `patch(v)`: Return the patch version number.
|
||||
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||
or comparators intersect.
|
||||
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||
a `SemVer` object or `null`.
|
||||
|
||||
### Comparison
|
||||
|
||||
* `gt(v1, v2)`: `v1 > v2`
|
||||
* `gte(v1, v2)`: `v1 >= v2`
|
||||
* `lt(v1, v2)`: `v1 < v2`
|
||||
* `lte(v1, v2)`: `v1 <= v2`
|
||||
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||
even if they're not the same string. You already know how to
|
||||
compare strings.
|
||||
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||
the corresponding function above. `"==="` and `"!=="` do simple
|
||||
string comparison, but are included for completeness. Throws if an
|
||||
invalid comparison string is provided.
|
||||
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `rcompare(v1, v2)`: The reverse of `compare`. Sorts an array of versions
|
||||
in descending order when passed to `Array.sort()`.
|
||||
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||
* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
|
||||
* `diff(v1, v2)`: Returns the difference between two versions by the release type
|
||||
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||
or null if the versions are the same.
|
||||
|
||||
### Sorting
|
||||
|
||||
* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild`
|
||||
function.
|
||||
* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
|
||||
the `compareBuild` function in descending order.
|
||||
|
||||
### Comparators
|
||||
|
||||
* `intersects(comparator)`: Return true if the comparators intersect
|
||||
|
||||
### Ranges
|
||||
|
||||
* `validRange(range)`: Return the valid range or null if it's not valid.
|
||||
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||
range.
|
||||
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||
that satisfies the range, or `null` if none of them do.
|
||||
* `minVersion(range)`: Return the lowest version that can match
|
||||
the given range.
|
||||
* `gtr(version, range)`: Return `true` if the version is greater than all the
|
||||
versions possible in the range.
|
||||
* `ltr(version, range)`: Return `true` if the version is less than all the
|
||||
versions possible in the range.
|
||||
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||
the bounds of the range in either the high or low direction. The
|
||||
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||
the function called by `gtr` and `ltr`.)
|
||||
* `intersects(range)`: Return true if any of the range comparators intersect.
|
||||
* `simplifyRange(versions, range)`: Return a "simplified" range that
|
||||
matches the same items in the `versions` list as the range specified. Note
|
||||
that it does *not* guarantee that it would match the same versions in all
|
||||
cases, only for the set of versions provided. This is useful when
|
||||
generating ranges by joining together multiple versions with `||`
|
||||
programmatically, to provide the user with something a bit more
|
||||
ergonomic. If the provided range is shorter in string-length than the
|
||||
generated range, then that is returned.
|
||||
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
|
||||
entirely contained by the `superRange` range.
|
||||
|
||||
Note that, since ranges may be non-contiguous, a version might not be
|
||||
greater than a range, less than a range, *or* satisfy a range! For
|
||||
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||
until `2.0.0`, so version `1.2.10` would not be greater than the
|
||||
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||
satisfy the range.
|
||||
|
||||
If you want to know if a version satisfies or does not satisfy a
|
||||
range, use the `satisfies(version, range)` function.
|
||||
|
||||
### Coercion
|
||||
|
||||
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||
|
||||
This aims to provide a very forgiving translation of a non-semver string to
|
||||
semver. It looks for the first digit in a string and consumes all
|
||||
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||
is not valid). The maximum length for any semver component considered for
|
||||
coercion is 16 characters; longer components will be ignored
|
||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||
|
||||
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||
coercible tuple that does not share an ending index with a longer coercible
|
||||
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||
any other overlapping SemVer tuple.
|
||||
|
||||
If the `options.includePrerelease` flag is set, then the `coerce` result will contain
|
||||
prerelease and build parts of a version. For example, `1.2.3.4-rc.1+rev.2`
|
||||
will preserve prerelease `rc.1` and build `rev.2` in the result.
|
||||
|
||||
### Clean
|
||||
|
||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||
|
||||
This will return a cleaned and trimmed semver version. If the provided
|
||||
version is not valid a null will be returned. This does not work for
|
||||
ranges.
|
||||
|
||||
ex.
|
||||
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' =v2.1.5')`: `'2.1.5'`
|
||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||
* `s.clean('~1.0.0')`: `null`
|
||||
|
||||
## Constants
|
||||
|
||||
As a convenience, helper constants are exported to provide information about what `node-semver` supports:
|
||||
|
||||
### `RELEASE_TYPES`
|
||||
|
||||
- major
|
||||
- premajor
|
||||
- minor
|
||||
- preminor
|
||||
- patch
|
||||
- prepatch
|
||||
- prerelease
|
||||
|
||||
```
|
||||
const semver = require('semver');
|
||||
|
||||
if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
|
||||
console.log('This is a valid release type!');
|
||||
} else {
|
||||
console.warn('This is NOT a valid release type!');
|
||||
}
|
||||
```
|
||||
|
||||
### `SEMVER_SPEC_VERSION`
|
||||
|
||||
2.0.0
|
||||
|
||||
```
|
||||
const semver = require('semver');
|
||||
|
||||
console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
|
||||
```
|
||||
|
||||
## Exported Modules
|
||||
|
||||
<!--
|
||||
TODO: Make sure that all of these items are documented (classes aren't,
|
||||
eg), and then pull the module name into the documentation for that specific
|
||||
thing.
|
||||
-->
|
||||
|
||||
You may pull in just the part of this semver utility that you need if you
|
||||
are sensitive to packing and tree-shaking concerns. The main
|
||||
`require('semver')` export uses getter functions to lazily load the parts
|
||||
of the API that are used.
|
||||
|
||||
The following modules are available:
|
||||
|
||||
* `require('semver')`
|
||||
* `require('semver/classes')`
|
||||
* `require('semver/classes/comparator')`
|
||||
* `require('semver/classes/range')`
|
||||
* `require('semver/classes/semver')`
|
||||
* `require('semver/functions/clean')`
|
||||
* `require('semver/functions/cmp')`
|
||||
* `require('semver/functions/coerce')`
|
||||
* `require('semver/functions/compare')`
|
||||
* `require('semver/functions/compare-build')`
|
||||
* `require('semver/functions/compare-loose')`
|
||||
* `require('semver/functions/diff')`
|
||||
* `require('semver/functions/eq')`
|
||||
* `require('semver/functions/gt')`
|
||||
* `require('semver/functions/gte')`
|
||||
* `require('semver/functions/inc')`
|
||||
* `require('semver/functions/lt')`
|
||||
* `require('semver/functions/lte')`
|
||||
* `require('semver/functions/major')`
|
||||
* `require('semver/functions/minor')`
|
||||
* `require('semver/functions/neq')`
|
||||
* `require('semver/functions/parse')`
|
||||
* `require('semver/functions/patch')`
|
||||
* `require('semver/functions/prerelease')`
|
||||
* `require('semver/functions/rcompare')`
|
||||
* `require('semver/functions/rsort')`
|
||||
* `require('semver/functions/satisfies')`
|
||||
* `require('semver/functions/sort')`
|
||||
* `require('semver/functions/valid')`
|
||||
* `require('semver/ranges/gtr')`
|
||||
* `require('semver/ranges/intersects')`
|
||||
* `require('semver/ranges/ltr')`
|
||||
* `require('semver/ranges/max-satisfying')`
|
||||
* `require('semver/ranges/min-satisfying')`
|
||||
* `require('semver/ranges/min-version')`
|
||||
* `require('semver/ranges/outside')`
|
||||
* `require('semver/ranges/simplify')`
|
||||
* `require('semver/ranges/subset')`
|
||||
* `require('semver/ranges/to-comparators')`
|
||||
* `require('semver/ranges/valid')`
|
||||
|
||||
191
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/bin/semver.js
generated
vendored
Executable file
191
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/bin/semver.js
generated
vendored
Executable file
@@ -0,0 +1,191 @@
|
||||
#!/usr/bin/env node
|
||||
// Standalone semver comparison program.
|
||||
// Exits successfully and prints matching version(s) if
|
||||
// any supplied version is valid and passes all tests.
|
||||
|
||||
'use strict'
|
||||
|
||||
const argv = process.argv.slice(2)
|
||||
|
||||
let versions = []
|
||||
|
||||
const range = []
|
||||
|
||||
let inc = null
|
||||
|
||||
const version = require('../package.json').version
|
||||
|
||||
let loose = false
|
||||
|
||||
let includePrerelease = false
|
||||
|
||||
let coerce = false
|
||||
|
||||
let rtl = false
|
||||
|
||||
let identifier
|
||||
|
||||
let identifierBase
|
||||
|
||||
const semver = require('../')
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
|
||||
let reverse = false
|
||||
|
||||
let options = {}
|
||||
|
||||
const main = () => {
|
||||
if (!argv.length) {
|
||||
return help()
|
||||
}
|
||||
while (argv.length) {
|
||||
let a = argv.shift()
|
||||
const indexOfEqualSign = a.indexOf('=')
|
||||
if (indexOfEqualSign !== -1) {
|
||||
const value = a.slice(indexOfEqualSign + 1)
|
||||
a = a.slice(0, indexOfEqualSign)
|
||||
argv.unshift(value)
|
||||
}
|
||||
switch (a) {
|
||||
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||
reverse = true
|
||||
break
|
||||
case '-l': case '--loose':
|
||||
loose = true
|
||||
break
|
||||
case '-p': case '--include-prerelease':
|
||||
includePrerelease = true
|
||||
break
|
||||
case '-v': case '--version':
|
||||
versions.push(argv.shift())
|
||||
break
|
||||
case '-i': case '--inc': case '--increment':
|
||||
switch (argv[0]) {
|
||||
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||
case 'premajor': case 'preminor': case 'prepatch':
|
||||
case 'release':
|
||||
inc = argv.shift()
|
||||
break
|
||||
default:
|
||||
inc = 'patch'
|
||||
break
|
||||
}
|
||||
break
|
||||
case '--preid':
|
||||
identifier = argv.shift()
|
||||
break
|
||||
case '-r': case '--range':
|
||||
range.push(argv.shift())
|
||||
break
|
||||
case '-n':
|
||||
identifierBase = argv.shift()
|
||||
if (identifierBase === 'false') {
|
||||
identifierBase = false
|
||||
}
|
||||
break
|
||||
case '-c': case '--coerce':
|
||||
coerce = true
|
||||
break
|
||||
case '--rtl':
|
||||
rtl = true
|
||||
break
|
||||
case '--ltr':
|
||||
rtl = false
|
||||
break
|
||||
case '-h': case '--help': case '-?':
|
||||
return help()
|
||||
default:
|
||||
versions.push(a)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
options = parseOptions({ loose, includePrerelease, rtl })
|
||||
|
||||
versions = versions.map((v) => {
|
||||
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||
}).filter((v) => {
|
||||
return semver.valid(v, options)
|
||||
})
|
||||
if (!versions.length) {
|
||||
return fail()
|
||||
}
|
||||
if (inc && (versions.length !== 1 || range.length)) {
|
||||
return failInc()
|
||||
}
|
||||
|
||||
for (let i = 0, l = range.length; i < l; i++) {
|
||||
versions = versions.filter((v) => {
|
||||
return semver.satisfies(v, range[i], options)
|
||||
})
|
||||
if (!versions.length) {
|
||||
return fail()
|
||||
}
|
||||
}
|
||||
versions
|
||||
.sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
|
||||
.map(v => semver.clean(v, options))
|
||||
.map(v => inc ? semver.inc(v, inc, options, identifier, identifierBase) : v)
|
||||
.forEach(v => console.log(v))
|
||||
}
|
||||
|
||||
const failInc = () => {
|
||||
console.error('--inc can only be used on a single version with no range')
|
||||
fail()
|
||||
}
|
||||
|
||||
const fail = () => process.exit(1)
|
||||
|
||||
const help = () => console.log(
|
||||
`SemVer ${version}
|
||||
|
||||
A JavaScript implementation of the https://semver.org/ specification
|
||||
Copyright Isaac Z. Schlueter
|
||||
|
||||
Usage: semver [options] <version> [<version> [...]]
|
||||
Prints valid versions sorted by SemVer precedence
|
||||
|
||||
Options:
|
||||
-r --range <range>
|
||||
Print versions that match the specified range.
|
||||
|
||||
-i --increment [<level>]
|
||||
Increment a version by the specified level. Level can
|
||||
be one of: major, minor, patch, premajor, preminor,
|
||||
prepatch, prerelease, or release. Default level is 'patch'.
|
||||
Only one version may be specified.
|
||||
|
||||
--preid <identifier>
|
||||
Identifier to be used to prefix premajor, preminor,
|
||||
prepatch or prerelease version increments.
|
||||
|
||||
-l --loose
|
||||
Interpret versions and ranges loosely
|
||||
|
||||
-p --include-prerelease
|
||||
Always include prerelease versions in range matching
|
||||
|
||||
-c --coerce
|
||||
Coerce a string into SemVer if possible
|
||||
(does not imply --loose)
|
||||
|
||||
--rtl
|
||||
Coerce version strings right to left
|
||||
|
||||
--ltr
|
||||
Coerce version strings left to right (default)
|
||||
|
||||
-n <base>
|
||||
Base number to be used for the prerelease identifier.
|
||||
Can be either 0 or 1, or false to omit the number altogether.
|
||||
Defaults to 0.
|
||||
|
||||
Program exits successfully if any valid version satisfies
|
||||
all supplied ranges, and prints all satisfying versions.
|
||||
|
||||
If no satisfying versions are found, then exits failure.
|
||||
|
||||
Versions are printed in ascending order, so supplying
|
||||
multiple versions to the utility will just sort them.`)
|
||||
|
||||
main()
|
||||
143
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
143
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/comparator.js
generated
vendored
Normal file
@@ -0,0 +1,143 @@
|
||||
'use strict'
|
||||
|
||||
const ANY = Symbol('SemVer ANY')
|
||||
// hoisted class for cyclic dependency
|
||||
class Comparator {
|
||||
static get ANY () {
|
||||
return ANY
|
||||
}
|
||||
|
||||
constructor (comp, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (comp instanceof Comparator) {
|
||||
if (comp.loose === !!options.loose) {
|
||||
return comp
|
||||
} else {
|
||||
comp = comp.value
|
||||
}
|
||||
}
|
||||
|
||||
comp = comp.trim().split(/\s+/).join(' ')
|
||||
debug('comparator', comp, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.parse(comp)
|
||||
|
||||
if (this.semver === ANY) {
|
||||
this.value = ''
|
||||
} else {
|
||||
this.value = this.operator + this.semver.version
|
||||
}
|
||||
|
||||
debug('comp', this)
|
||||
}
|
||||
|
||||
parse (comp) {
|
||||
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||
const m = comp.match(r)
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid comparator: ${comp}`)
|
||||
}
|
||||
|
||||
this.operator = m[1] !== undefined ? m[1] : ''
|
||||
if (this.operator === '=') {
|
||||
this.operator = ''
|
||||
}
|
||||
|
||||
// if it literally is just '>' or '' then allow anything.
|
||||
if (!m[2]) {
|
||||
this.semver = ANY
|
||||
} else {
|
||||
this.semver = new SemVer(m[2], this.options.loose)
|
||||
}
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.value
|
||||
}
|
||||
|
||||
test (version) {
|
||||
debug('Comparator.test', version, this.options.loose)
|
||||
|
||||
if (this.semver === ANY || version === ANY) {
|
||||
return true
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return cmp(version, this.operator, this.semver, this.options)
|
||||
}
|
||||
|
||||
intersects (comp, options) {
|
||||
if (!(comp instanceof Comparator)) {
|
||||
throw new TypeError('a Comparator is required')
|
||||
}
|
||||
|
||||
if (this.operator === '') {
|
||||
if (this.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(comp.value, options).test(this.value)
|
||||
} else if (comp.operator === '') {
|
||||
if (comp.value === '') {
|
||||
return true
|
||||
}
|
||||
return new Range(this.value, options).test(comp.semver)
|
||||
}
|
||||
|
||||
options = parseOptions(options)
|
||||
|
||||
// Special cases where nothing can possibly be lower
|
||||
if (options.includePrerelease &&
|
||||
(this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
|
||||
return false
|
||||
}
|
||||
if (!options.includePrerelease &&
|
||||
(this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
|
||||
return false
|
||||
}
|
||||
|
||||
// Same direction increasing (> or >=)
|
||||
if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
|
||||
return true
|
||||
}
|
||||
// Same direction decreasing (< or <=)
|
||||
if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
|
||||
return true
|
||||
}
|
||||
// same SemVer and both sides are inclusive (<= or >=)
|
||||
if (
|
||||
(this.semver.version === comp.semver.version) &&
|
||||
this.operator.includes('=') && comp.operator.includes('=')) {
|
||||
return true
|
||||
}
|
||||
// opposite directions less than
|
||||
if (cmp(this.semver, '<', comp.semver, options) &&
|
||||
this.operator.startsWith('>') && comp.operator.startsWith('<')) {
|
||||
return true
|
||||
}
|
||||
// opposite directions greater than
|
||||
if (cmp(this.semver, '>', comp.semver, options) &&
|
||||
this.operator.startsWith('<') && comp.operator.startsWith('>')) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Comparator
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
const cmp = require('../functions/cmp')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const Range = require('./range')
|
||||
7
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/index.js
generated
vendored
Normal file
7
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
module.exports = {
|
||||
SemVer: require('./semver.js'),
|
||||
Range: require('./range.js'),
|
||||
Comparator: require('./comparator.js'),
|
||||
}
|
||||
557
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/range.js
generated
vendored
Normal file
557
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/range.js
generated
vendored
Normal file
@@ -0,0 +1,557 @@
|
||||
'use strict'
|
||||
|
||||
const SPACE_CHARACTERS = /\s+/g
|
||||
|
||||
// hoisted class for cyclic dependency
|
||||
class Range {
|
||||
constructor (range, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (range instanceof Range) {
|
||||
if (
|
||||
range.loose === !!options.loose &&
|
||||
range.includePrerelease === !!options.includePrerelease
|
||||
) {
|
||||
return range
|
||||
} else {
|
||||
return new Range(range.raw, options)
|
||||
}
|
||||
}
|
||||
|
||||
if (range instanceof Comparator) {
|
||||
// just put it in the set and return
|
||||
this.raw = range.value
|
||||
this.set = [[range]]
|
||||
this.formatted = undefined
|
||||
return this
|
||||
}
|
||||
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
// First reduce all whitespace as much as possible so we do not have to rely
|
||||
// on potentially slow regexes like \s*. This is then stored and used for
|
||||
// future error messages as well.
|
||||
this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')
|
||||
|
||||
// First, split on ||
|
||||
this.set = this.raw
|
||||
.split('||')
|
||||
// map the range to a 2d array of comparators
|
||||
.map(r => this.parseRange(r.trim()))
|
||||
// throw out any comparator lists that are empty
|
||||
// this generally means that it was not a valid range, which is allowed
|
||||
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||
.filter(c => c.length)
|
||||
|
||||
if (!this.set.length) {
|
||||
throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
|
||||
}
|
||||
|
||||
// if we have any that are not the null set, throw out null sets.
|
||||
if (this.set.length > 1) {
|
||||
// keep the first one, in case they're all null sets
|
||||
const first = this.set[0]
|
||||
this.set = this.set.filter(c => !isNullSet(c[0]))
|
||||
if (this.set.length === 0) {
|
||||
this.set = [first]
|
||||
} else if (this.set.length > 1) {
|
||||
// if we have any that are *, then the range is just *
|
||||
for (const c of this.set) {
|
||||
if (c.length === 1 && isAny(c[0])) {
|
||||
this.set = [c]
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.formatted = undefined
|
||||
}
|
||||
|
||||
get range () {
|
||||
if (this.formatted === undefined) {
|
||||
this.formatted = ''
|
||||
for (let i = 0; i < this.set.length; i++) {
|
||||
if (i > 0) {
|
||||
this.formatted += '||'
|
||||
}
|
||||
const comps = this.set[i]
|
||||
for (let k = 0; k < comps.length; k++) {
|
||||
if (k > 0) {
|
||||
this.formatted += ' '
|
||||
}
|
||||
this.formatted += comps[k].toString().trim()
|
||||
}
|
||||
}
|
||||
}
|
||||
return this.formatted
|
||||
}
|
||||
|
||||
format () {
|
||||
return this.range
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.range
|
||||
}
|
||||
|
||||
parseRange (range) {
|
||||
// memoize range parsing for performance.
|
||||
// this is a very hot path, and fully deterministic.
|
||||
const memoOpts =
|
||||
(this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
|
||||
(this.options.loose && FLAG_LOOSE)
|
||||
const memoKey = memoOpts + ':' + range
|
||||
const cached = cache.get(memoKey)
|
||||
if (cached) {
|
||||
return cached
|
||||
}
|
||||
|
||||
const loose = this.options.loose
|
||||
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
||||
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
||||
debug('hyphen replace', range)
|
||||
|
||||
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
||||
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
||||
debug('comparator trim', range)
|
||||
|
||||
// `~ 1.2.3` => `~1.2.3`
|
||||
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
||||
debug('tilde trim', range)
|
||||
|
||||
// `^ 1.2.3` => `^1.2.3`
|
||||
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
|
||||
debug('caret trim', range)
|
||||
|
||||
// At this point, the range is completely trimmed and
|
||||
// ready to be split into comparators.
|
||||
|
||||
let rangeList = range
|
||||
.split(' ')
|
||||
.map(comp => parseComparator(comp, this.options))
|
||||
.join(' ')
|
||||
.split(/\s+/)
|
||||
// >=0.0.0 is equivalent to *
|
||||
.map(comp => replaceGTE0(comp, this.options))
|
||||
|
||||
if (loose) {
|
||||
// in loose mode, throw out any that are not valid comparators
|
||||
rangeList = rangeList.filter(comp => {
|
||||
debug('loose invalid filter', comp, this.options)
|
||||
return !!comp.match(re[t.COMPARATORLOOSE])
|
||||
})
|
||||
}
|
||||
debug('range list', rangeList)
|
||||
|
||||
// if any comparators are the null set, then replace with JUST null set
|
||||
// if more than one comparator, remove any * comparators
|
||||
// also, don't include the same comparator more than once
|
||||
const rangeMap = new Map()
|
||||
const comparators = rangeList.map(comp => new Comparator(comp, this.options))
|
||||
for (const comp of comparators) {
|
||||
if (isNullSet(comp)) {
|
||||
return [comp]
|
||||
}
|
||||
rangeMap.set(comp.value, comp)
|
||||
}
|
||||
if (rangeMap.size > 1 && rangeMap.has('')) {
|
||||
rangeMap.delete('')
|
||||
}
|
||||
|
||||
const result = [...rangeMap.values()]
|
||||
cache.set(memoKey, result)
|
||||
return result
|
||||
}
|
||||
|
||||
intersects (range, options) {
|
||||
if (!(range instanceof Range)) {
|
||||
throw new TypeError('a Range is required')
|
||||
}
|
||||
|
||||
return this.set.some((thisComparators) => {
|
||||
return (
|
||||
isSatisfiable(thisComparators, options) &&
|
||||
range.set.some((rangeComparators) => {
|
||||
return (
|
||||
isSatisfiable(rangeComparators, options) &&
|
||||
thisComparators.every((thisComparator) => {
|
||||
return rangeComparators.every((rangeComparator) => {
|
||||
return thisComparator.intersects(rangeComparator, options)
|
||||
})
|
||||
})
|
||||
)
|
||||
})
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
// if ANY of the sets match ALL of its comparators, then pass
|
||||
test (version) {
|
||||
if (!version) {
|
||||
return false
|
||||
}
|
||||
|
||||
if (typeof version === 'string') {
|
||||
try {
|
||||
version = new SemVer(version, this.options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < this.set.length; i++) {
|
||||
if (testSet(this.set[i], version, this.options)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Range
|
||||
|
||||
const LRU = require('../internal/lrucache')
|
||||
const cache = new LRU()
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const Comparator = require('./comparator')
|
||||
const debug = require('../internal/debug')
|
||||
const SemVer = require('./semver')
|
||||
const {
|
||||
safeRe: re,
|
||||
t,
|
||||
comparatorTrimReplace,
|
||||
tildeTrimReplace,
|
||||
caretTrimReplace,
|
||||
} = require('../internal/re')
|
||||
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')
|
||||
|
||||
const isNullSet = c => c.value === '<0.0.0-0'
|
||||
const isAny = c => c.value === ''
|
||||
|
||||
// take a set of comparators and determine whether there
|
||||
// exists a version which can satisfy it
|
||||
const isSatisfiable = (comparators, options) => {
|
||||
let result = true
|
||||
const remainingComparators = comparators.slice()
|
||||
let testComparator = remainingComparators.pop()
|
||||
|
||||
while (result && remainingComparators.length) {
|
||||
result = remainingComparators.every((otherComparator) => {
|
||||
return testComparator.intersects(otherComparator, options)
|
||||
})
|
||||
|
||||
testComparator = remainingComparators.pop()
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
||||
// already replaced the hyphen ranges
|
||||
// turn into a set of JUST comparators.
|
||||
const parseComparator = (comp, options) => {
|
||||
comp = comp.replace(re[t.BUILD], '')
|
||||
debug('comp', comp, options)
|
||||
comp = replaceCarets(comp, options)
|
||||
debug('caret', comp)
|
||||
comp = replaceTildes(comp, options)
|
||||
debug('tildes', comp)
|
||||
comp = replaceXRanges(comp, options)
|
||||
debug('xrange', comp)
|
||||
comp = replaceStars(comp, options)
|
||||
debug('stars', comp)
|
||||
return comp
|
||||
}
|
||||
|
||||
const isX = id => !id || id.toLowerCase() === 'x' || id === '*'
|
||||
|
||||
// ~, ~> --> * (any, kinda silly)
|
||||
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
|
||||
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
|
||||
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
|
||||
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
|
||||
// ~0.0.1 --> >=0.0.1 <0.1.0-0
|
||||
const replaceTildes = (comp, options) => {
|
||||
return comp
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.map((c) => replaceTilde(c, options))
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
const replaceTilde = (comp, options) => {
|
||||
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('tilde', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
// ~1.2 == >=1.2.0 <1.3.0-0
|
||||
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`
|
||||
} else if (pr) {
|
||||
debug('replaceTilde pr', pr)
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
// ~1.2.3 == >=1.2.3 <1.3.0-0
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('tilde return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// ^ --> * (any, kinda silly)
|
||||
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
|
||||
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
|
||||
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
|
||||
// ^1.2.3 --> >=1.2.3 <2.0.0-0
|
||||
// ^1.2.0 --> >=1.2.0 <2.0.0-0
|
||||
// ^0.0.1 --> >=0.0.1 <0.0.2-0
|
||||
// ^0.1.0 --> >=0.1.0 <0.2.0-0
|
||||
const replaceCarets = (comp, options) => {
|
||||
return comp
|
||||
.trim()
|
||||
.split(/\s+/)
|
||||
.map((c) => replaceCaret(c, options))
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
const replaceCaret = (comp, options) => {
|
||||
debug('caret', comp, options)
|
||||
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
|
||||
const z = options.includePrerelease ? '-0' : ''
|
||||
return comp.replace(r, (_, M, m, p, pr) => {
|
||||
debug('caret', comp, _, M, m, p, pr)
|
||||
let ret
|
||||
|
||||
if (isX(M)) {
|
||||
ret = ''
|
||||
} else if (isX(m)) {
|
||||
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
|
||||
} else if (isX(p)) {
|
||||
if (M === '0') {
|
||||
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else if (pr) {
|
||||
debug('replaceCaret pr', pr)
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p}-${pr
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
} else {
|
||||
debug('no pr')
|
||||
if (M === '0') {
|
||||
if (m === '0') {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${m}.${+p + 1}-0`
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
}${z} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
} else {
|
||||
ret = `>=${M}.${m}.${p
|
||||
} <${+M + 1}.0.0-0`
|
||||
}
|
||||
}
|
||||
|
||||
debug('caret return', ret)
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
const replaceXRanges = (comp, options) => {
|
||||
debug('replaceXRanges', comp, options)
|
||||
return comp
|
||||
.split(/\s+/)
|
||||
.map((c) => replaceXRange(c, options))
|
||||
.join(' ')
|
||||
}
|
||||
|
||||
const replaceXRange = (comp, options) => {
|
||||
comp = comp.trim()
|
||||
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
|
||||
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
||||
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
||||
const xM = isX(M)
|
||||
const xm = xM || isX(m)
|
||||
const xp = xm || isX(p)
|
||||
const anyX = xp
|
||||
|
||||
if (gtlt === '=' && anyX) {
|
||||
gtlt = ''
|
||||
}
|
||||
|
||||
// if we're including prereleases in the match, then we need
|
||||
// to fix this to -0, the lowest possible prerelease value
|
||||
pr = options.includePrerelease ? '-0' : ''
|
||||
|
||||
if (xM) {
|
||||
if (gtlt === '>' || gtlt === '<') {
|
||||
// nothing is allowed
|
||||
ret = '<0.0.0-0'
|
||||
} else {
|
||||
// nothing is forbidden
|
||||
ret = '*'
|
||||
}
|
||||
} else if (gtlt && anyX) {
|
||||
// we know patch is an x, because we have any x at all.
|
||||
// replace X with 0
|
||||
if (xm) {
|
||||
m = 0
|
||||
}
|
||||
p = 0
|
||||
|
||||
if (gtlt === '>') {
|
||||
// >1 => >=2.0.0
|
||||
// >1.2 => >=1.3.0
|
||||
gtlt = '>='
|
||||
if (xm) {
|
||||
M = +M + 1
|
||||
m = 0
|
||||
p = 0
|
||||
} else {
|
||||
m = +m + 1
|
||||
p = 0
|
||||
}
|
||||
} else if (gtlt === '<=') {
|
||||
// <=0.7.x is actually <0.8.0, since any 0.7.x should
|
||||
// pass. Similarly, <=7.x is actually <8.0.0, etc.
|
||||
gtlt = '<'
|
||||
if (xm) {
|
||||
M = +M + 1
|
||||
} else {
|
||||
m = +m + 1
|
||||
}
|
||||
}
|
||||
|
||||
if (gtlt === '<') {
|
||||
pr = '-0'
|
||||
}
|
||||
|
||||
ret = `${gtlt + M}.${m}.${p}${pr}`
|
||||
} else if (xm) {
|
||||
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
|
||||
} else if (xp) {
|
||||
ret = `>=${M}.${m}.0${pr
|
||||
} <${M}.${+m + 1}.0-0`
|
||||
}
|
||||
|
||||
debug('xRange return', ret)
|
||||
|
||||
return ret
|
||||
})
|
||||
}
|
||||
|
||||
// Because * is AND-ed with everything else in the comparator,
|
||||
// and '' means "any version", just remove the *s entirely.
|
||||
const replaceStars = (comp, options) => {
|
||||
debug('replaceStars', comp, options)
|
||||
// Looseness is ignored here. star is always as loose as it gets!
|
||||
return comp
|
||||
.trim()
|
||||
.replace(re[t.STAR], '')
|
||||
}
|
||||
|
||||
const replaceGTE0 = (comp, options) => {
|
||||
debug('replaceGTE0', comp, options)
|
||||
return comp
|
||||
.trim()
|
||||
.replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
|
||||
}
|
||||
|
||||
// This function is passed to string.replace(re[t.HYPHENRANGE])
|
||||
// M, m, patch, prerelease, build
|
||||
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
||||
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
||||
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
||||
// TODO build?
|
||||
const hyphenReplace = incPr => ($0,
|
||||
from, fM, fm, fp, fpr, fb,
|
||||
to, tM, tm, tp, tpr) => {
|
||||
if (isX(fM)) {
|
||||
from = ''
|
||||
} else if (isX(fm)) {
|
||||
from = `>=${fM}.0.0${incPr ? '-0' : ''}`
|
||||
} else if (isX(fp)) {
|
||||
from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
|
||||
} else if (fpr) {
|
||||
from = `>=${from}`
|
||||
} else {
|
||||
from = `>=${from}${incPr ? '-0' : ''}`
|
||||
}
|
||||
|
||||
if (isX(tM)) {
|
||||
to = ''
|
||||
} else if (isX(tm)) {
|
||||
to = `<${+tM + 1}.0.0-0`
|
||||
} else if (isX(tp)) {
|
||||
to = `<${tM}.${+tm + 1}.0-0`
|
||||
} else if (tpr) {
|
||||
to = `<=${tM}.${tm}.${tp}-${tpr}`
|
||||
} else if (incPr) {
|
||||
to = `<${tM}.${tm}.${+tp + 1}-0`
|
||||
} else {
|
||||
to = `<=${to}`
|
||||
}
|
||||
|
||||
return `${from} ${to}`.trim()
|
||||
}
|
||||
|
||||
const testSet = (set, version, options) => {
|
||||
for (let i = 0; i < set.length; i++) {
|
||||
if (!set[i].test(version)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if (version.prerelease.length && !options.includePrerelease) {
|
||||
// Find the set of versions that are allowed to have prereleases
|
||||
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
||||
// That should allow `1.2.3-pr.2` to pass.
|
||||
// However, `1.2.4-alpha.notready` should NOT be allowed,
|
||||
// even though it's within the range set by the comparators.
|
||||
for (let i = 0; i < set.length; i++) {
|
||||
debug(set[i].semver)
|
||||
if (set[i].semver === Comparator.ANY) {
|
||||
continue
|
||||
}
|
||||
|
||||
if (set[i].semver.prerelease.length > 0) {
|
||||
const allowed = set[i].semver
|
||||
if (allowed.major === version.major &&
|
||||
allowed.minor === version.minor &&
|
||||
allowed.patch === version.patch) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Version has a -pre, but it's not one of the ones we like.
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
333
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/semver.js
generated
vendored
Normal file
333
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/classes/semver.js
generated
vendored
Normal file
@@ -0,0 +1,333 @@
|
||||
'use strict'
|
||||
|
||||
const debug = require('../internal/debug')
|
||||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { compareIdentifiers } = require('../internal/identifiers')
|
||||
class SemVer {
|
||||
constructor (version, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
if (version.loose === !!options.loose &&
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
return version
|
||||
} else {
|
||||
version = version.version
|
||||
}
|
||||
} else if (typeof version !== 'string') {
|
||||
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
|
||||
}
|
||||
|
||||
if (version.length > MAX_LENGTH) {
|
||||
throw new TypeError(
|
||||
`version is longer than ${MAX_LENGTH} characters`
|
||||
)
|
||||
}
|
||||
|
||||
debug('SemVer', version, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
// this isn't actually relevant for versions, but keep it so that we
|
||||
// don't run into trouble passing this.options around.
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid Version: ${version}`)
|
||||
}
|
||||
|
||||
this.raw = version
|
||||
|
||||
// these are actually numbers
|
||||
this.major = +m[1]
|
||||
this.minor = +m[2]
|
||||
this.patch = +m[3]
|
||||
|
||||
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
||||
throw new TypeError('Invalid major version')
|
||||
}
|
||||
|
||||
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
||||
throw new TypeError('Invalid minor version')
|
||||
}
|
||||
|
||||
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
||||
throw new TypeError('Invalid patch version')
|
||||
}
|
||||
|
||||
// numberify any prerelease numeric ids
|
||||
if (!m[4]) {
|
||||
this.prerelease = []
|
||||
} else {
|
||||
this.prerelease = m[4].split('.').map((id) => {
|
||||
if (/^[0-9]+$/.test(id)) {
|
||||
const num = +id
|
||||
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||||
return num
|
||||
}
|
||||
}
|
||||
return id
|
||||
})
|
||||
}
|
||||
|
||||
this.build = m[5] ? m[5].split('.') : []
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||||
if (this.prerelease.length) {
|
||||
this.version += `-${this.prerelease.join('.')}`
|
||||
}
|
||||
return this.version
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.version
|
||||
}
|
||||
|
||||
compare (other) {
|
||||
debug('SemVer.compare', this.version, this.options, other)
|
||||
if (!(other instanceof SemVer)) {
|
||||
if (typeof other === 'string' && other === this.version) {
|
||||
return 0
|
||||
}
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
if (other.version === this.version) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return this.compareMain(other) || this.comparePre(other)
|
||||
}
|
||||
|
||||
compareMain (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
if (this.major < other.major) {
|
||||
return -1
|
||||
}
|
||||
if (this.major > other.major) {
|
||||
return 1
|
||||
}
|
||||
if (this.minor < other.minor) {
|
||||
return -1
|
||||
}
|
||||
if (this.minor > other.minor) {
|
||||
return 1
|
||||
}
|
||||
if (this.patch < other.patch) {
|
||||
return -1
|
||||
}
|
||||
if (this.patch > other.patch) {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
comparePre (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
// NOT having a prerelease is > having one
|
||||
if (this.prerelease.length && !other.prerelease.length) {
|
||||
return -1
|
||||
} else if (!this.prerelease.length && other.prerelease.length) {
|
||||
return 1
|
||||
} else if (!this.prerelease.length && !other.prerelease.length) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.prerelease[i]
|
||||
const b = other.prerelease[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
compareBuild (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.build[i]
|
||||
const b = other.build[i]
|
||||
debug('build compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
// preminor will bump the version up to the next minor release, and immediately
|
||||
// down to pre-release. premajor and prepatch work the same way.
|
||||
inc (release, identifier, identifierBase) {
|
||||
if (release.startsWith('pre')) {
|
||||
if (!identifier && identifierBase === false) {
|
||||
throw new Error('invalid increment argument: identifier is empty')
|
||||
}
|
||||
// Avoid an invalid semver results
|
||||
if (identifier) {
|
||||
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
|
||||
if (!match || match[1] !== identifier) {
|
||||
throw new Error(`invalid identifier: ${identifier}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (release) {
|
||||
case 'premajor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor = 0
|
||||
this.major++
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
case 'preminor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor++
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
case 'prepatch':
|
||||
// If this is already a prerelease, it will bump to the next version
|
||||
// drop any prereleases that might already exist, since they are not
|
||||
// relevant at this point.
|
||||
this.prerelease.length = 0
|
||||
this.inc('patch', identifier, identifierBase)
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
// If the input is a non-prerelease version, this acts the same as
|
||||
// prepatch.
|
||||
case 'prerelease':
|
||||
if (this.prerelease.length === 0) {
|
||||
this.inc('patch', identifier, identifierBase)
|
||||
}
|
||||
this.inc('pre', identifier, identifierBase)
|
||||
break
|
||||
case 'release':
|
||||
if (this.prerelease.length === 0) {
|
||||
throw new Error(`version ${this.raw} is not a prerelease`)
|
||||
}
|
||||
this.prerelease.length = 0
|
||||
break
|
||||
|
||||
case 'major':
|
||||
// If this is a pre-major version, bump up to the same major version.
|
||||
// Otherwise increment major.
|
||||
// 1.0.0-5 bumps to 1.0.0
|
||||
// 1.1.0 bumps to 2.0.0
|
||||
if (
|
||||
this.minor !== 0 ||
|
||||
this.patch !== 0 ||
|
||||
this.prerelease.length === 0
|
||||
) {
|
||||
this.major++
|
||||
}
|
||||
this.minor = 0
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'minor':
|
||||
// If this is a pre-minor version, bump up to the same minor version.
|
||||
// Otherwise increment minor.
|
||||
// 1.2.0-5 bumps to 1.2.0
|
||||
// 1.2.1 bumps to 1.3.0
|
||||
if (this.patch !== 0 || this.prerelease.length === 0) {
|
||||
this.minor++
|
||||
}
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'patch':
|
||||
// If this is not a pre-release version, it will increment the patch.
|
||||
// If it is a pre-release it will bump up to the same patch version.
|
||||
// 1.2.0-5 patches to 1.2.0
|
||||
// 1.2.0 patches to 1.2.1
|
||||
if (this.prerelease.length === 0) {
|
||||
this.patch++
|
||||
}
|
||||
this.prerelease = []
|
||||
break
|
||||
// This probably shouldn't be used publicly.
|
||||
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
||||
case 'pre': {
|
||||
const base = Number(identifierBase) ? 1 : 0
|
||||
|
||||
if (this.prerelease.length === 0) {
|
||||
this.prerelease = [base]
|
||||
} else {
|
||||
let i = this.prerelease.length
|
||||
while (--i >= 0) {
|
||||
if (typeof this.prerelease[i] === 'number') {
|
||||
this.prerelease[i]++
|
||||
i = -2
|
||||
}
|
||||
}
|
||||
if (i === -1) {
|
||||
// didn't increment anything
|
||||
if (identifier === this.prerelease.join('.') && identifierBase === false) {
|
||||
throw new Error('invalid increment argument: identifier already exists')
|
||||
}
|
||||
this.prerelease.push(base)
|
||||
}
|
||||
}
|
||||
if (identifier) {
|
||||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
||||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
||||
let prerelease = [identifier, base]
|
||||
if (identifierBase === false) {
|
||||
prerelease = [identifier]
|
||||
}
|
||||
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
||||
if (isNaN(this.prerelease[1])) {
|
||||
this.prerelease = prerelease
|
||||
}
|
||||
} else {
|
||||
this.prerelease = prerelease
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
default:
|
||||
throw new Error(`invalid increment argument: ${release}`)
|
||||
}
|
||||
this.raw = this.format()
|
||||
if (this.build.length) {
|
||||
this.raw += `+${this.build.join('.')}`
|
||||
}
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SemVer
|
||||
8
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/clean.js
generated
vendored
Normal file
8
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/clean.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse')
|
||||
const clean = (version, options) => {
|
||||
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
|
||||
return s ? s.version : null
|
||||
}
|
||||
module.exports = clean
|
||||
54
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
54
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/cmp.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
'use strict'
|
||||
|
||||
const eq = require('./eq')
|
||||
const neq = require('./neq')
|
||||
const gt = require('./gt')
|
||||
const gte = require('./gte')
|
||||
const lt = require('./lt')
|
||||
const lte = require('./lte')
|
||||
|
||||
const cmp = (a, op, b, loose) => {
|
||||
switch (op) {
|
||||
case '===':
|
||||
if (typeof a === 'object') {
|
||||
a = a.version
|
||||
}
|
||||
if (typeof b === 'object') {
|
||||
b = b.version
|
||||
}
|
||||
return a === b
|
||||
|
||||
case '!==':
|
||||
if (typeof a === 'object') {
|
||||
a = a.version
|
||||
}
|
||||
if (typeof b === 'object') {
|
||||
b = b.version
|
||||
}
|
||||
return a !== b
|
||||
|
||||
case '':
|
||||
case '=':
|
||||
case '==':
|
||||
return eq(a, b, loose)
|
||||
|
||||
case '!=':
|
||||
return neq(a, b, loose)
|
||||
|
||||
case '>':
|
||||
return gt(a, b, loose)
|
||||
|
||||
case '>=':
|
||||
return gte(a, b, loose)
|
||||
|
||||
case '<':
|
||||
return lt(a, b, loose)
|
||||
|
||||
case '<=':
|
||||
return lte(a, b, loose)
|
||||
|
||||
default:
|
||||
throw new TypeError(`Invalid operator: ${op}`)
|
||||
}
|
||||
}
|
||||
module.exports = cmp
|
||||
62
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
62
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/coerce.js
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = require('./parse')
|
||||
const { safeRe: re, t } = require('../internal/re')
|
||||
|
||||
const coerce = (version, options) => {
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
|
||||
if (typeof version === 'number') {
|
||||
version = String(version)
|
||||
}
|
||||
|
||||
if (typeof version !== 'string') {
|
||||
return null
|
||||
}
|
||||
|
||||
options = options || {}
|
||||
|
||||
let match = null
|
||||
if (!options.rtl) {
|
||||
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
|
||||
} else {
|
||||
// Find the right-most coercible string that does not share
|
||||
// a terminus with a more left-ward coercible string.
|
||||
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
|
||||
// With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
|
||||
//
|
||||
// Walk through the string checking with a /g regexp
|
||||
// Manually set the index so as to pick up overlapping matches.
|
||||
// Stop when we get a match that ends at the string end, since no
|
||||
// coercible string can be more right-ward without the same terminus.
|
||||
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
|
||||
let next
|
||||
while ((next = coerceRtlRegex.exec(version)) &&
|
||||
(!match || match.index + match[0].length !== version.length)
|
||||
) {
|
||||
if (!match ||
|
||||
next.index + next[0].length !== match.index + match[0].length) {
|
||||
match = next
|
||||
}
|
||||
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
|
||||
}
|
||||
// leave it in a clean state
|
||||
coerceRtlRegex.lastIndex = -1
|
||||
}
|
||||
|
||||
if (match === null) {
|
||||
return null
|
||||
}
|
||||
|
||||
const major = match[2]
|
||||
const minor = match[3] || '0'
|
||||
const patch = match[4] || '0'
|
||||
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
|
||||
const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''
|
||||
|
||||
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
|
||||
}
|
||||
module.exports = coerce
|
||||
9
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
9
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/compare-build.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const compareBuild = (a, b, loose) => {
|
||||
const versionA = new SemVer(a, loose)
|
||||
const versionB = new SemVer(b, loose)
|
||||
return versionA.compare(versionB) || versionA.compareBuild(versionB)
|
||||
}
|
||||
module.exports = compareBuild
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/compare-loose.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const compareLoose = (a, b) => compare(a, b, true)
|
||||
module.exports = compareLoose
|
||||
7
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/compare.js
generated
vendored
Normal file
7
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/compare.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const compare = (a, b, loose) =>
|
||||
new SemVer(a, loose).compare(new SemVer(b, loose))
|
||||
|
||||
module.exports = compare
|
||||
60
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/diff.js
generated
vendored
Normal file
60
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/diff.js
generated
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse.js')
|
||||
|
||||
const diff = (version1, version2) => {
|
||||
const v1 = parse(version1, null, true)
|
||||
const v2 = parse(version2, null, true)
|
||||
const comparison = v1.compare(v2)
|
||||
|
||||
if (comparison === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
const v1Higher = comparison > 0
|
||||
const highVersion = v1Higher ? v1 : v2
|
||||
const lowVersion = v1Higher ? v2 : v1
|
||||
const highHasPre = !!highVersion.prerelease.length
|
||||
const lowHasPre = !!lowVersion.prerelease.length
|
||||
|
||||
if (lowHasPre && !highHasPre) {
|
||||
// Going from prerelease -> no prerelease requires some special casing
|
||||
|
||||
// If the low version has only a major, then it will always be a major
|
||||
// Some examples:
|
||||
// 1.0.0-1 -> 1.0.0
|
||||
// 1.0.0-1 -> 1.1.1
|
||||
// 1.0.0-1 -> 2.0.0
|
||||
if (!lowVersion.patch && !lowVersion.minor) {
|
||||
return 'major'
|
||||
}
|
||||
|
||||
// If the main part has no difference
|
||||
if (lowVersion.compareMain(highVersion) === 0) {
|
||||
if (lowVersion.minor && !lowVersion.patch) {
|
||||
return 'minor'
|
||||
}
|
||||
return 'patch'
|
||||
}
|
||||
}
|
||||
|
||||
// add the `pre` prefix if we are going to a prerelease version
|
||||
const prefix = highHasPre ? 'pre' : ''
|
||||
|
||||
if (v1.major !== v2.major) {
|
||||
return prefix + 'major'
|
||||
}
|
||||
|
||||
if (v1.minor !== v2.minor) {
|
||||
return prefix + 'minor'
|
||||
}
|
||||
|
||||
if (v1.patch !== v2.patch) {
|
||||
return prefix + 'patch'
|
||||
}
|
||||
|
||||
// high and low are prereleases
|
||||
return 'prerelease'
|
||||
}
|
||||
|
||||
module.exports = diff
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/eq.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/eq.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||
module.exports = eq
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/gt.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/gt.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||
module.exports = gt
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/gte.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/gte.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const gte = (a, b, loose) => compare(a, b, loose) >= 0
|
||||
module.exports = gte
|
||||
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/inc.js
generated
vendored
Normal file
21
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/inc.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const inc = (version, release, options, identifier, identifierBase) => {
|
||||
if (typeof (options) === 'string') {
|
||||
identifierBase = identifier
|
||||
identifier = options
|
||||
options = undefined
|
||||
}
|
||||
|
||||
try {
|
||||
return new SemVer(
|
||||
version instanceof SemVer ? version.version : version,
|
||||
options
|
||||
).inc(release, identifier, identifierBase).version
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = inc
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/lt.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/lt.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const lt = (a, b, loose) => compare(a, b, loose) < 0
|
||||
module.exports = lt
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/lte.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/lte.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const lte = (a, b, loose) => compare(a, b, loose) <= 0
|
||||
module.exports = lte
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/major.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/major.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const major = (a, loose) => new SemVer(a, loose).major
|
||||
module.exports = major
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/minor.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/minor.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const minor = (a, loose) => new SemVer(a, loose).minor
|
||||
module.exports = minor
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/neq.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/neq.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const neq = (a, b, loose) => compare(a, b, loose) !== 0
|
||||
module.exports = neq
|
||||
18
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/parse.js
generated
vendored
Normal file
18
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/parse.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const parse = (version, options, throwErrors = false) => {
|
||||
if (version instanceof SemVer) {
|
||||
return version
|
||||
}
|
||||
try {
|
||||
return new SemVer(version, options)
|
||||
} catch (er) {
|
||||
if (!throwErrors) {
|
||||
return null
|
||||
}
|
||||
throw er
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = parse
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/patch.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/patch.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const SemVer = require('../classes/semver')
|
||||
const patch = (a, loose) => new SemVer(a, loose).patch
|
||||
module.exports = patch
|
||||
8
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
8
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/prerelease.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse')
|
||||
const prerelease = (version, options) => {
|
||||
const parsed = parse(version, options)
|
||||
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
||||
}
|
||||
module.exports = prerelease
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/rcompare.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compare = require('./compare')
|
||||
const rcompare = (a, b, loose) => compare(b, a, loose)
|
||||
module.exports = rcompare
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/rsort.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compareBuild = require('./compare-build')
|
||||
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
|
||||
module.exports = rsort
|
||||
12
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
12
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/satisfies.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict'
|
||||
|
||||
const Range = require('../classes/range')
|
||||
const satisfies = (version, range, options) => {
|
||||
try {
|
||||
range = new Range(range, options)
|
||||
} catch (er) {
|
||||
return false
|
||||
}
|
||||
return range.test(version)
|
||||
}
|
||||
module.exports = satisfies
|
||||
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/sort.js
generated
vendored
Normal file
5
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/sort.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
'use strict'
|
||||
|
||||
const compareBuild = require('./compare-build')
|
||||
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
|
||||
module.exports = sort
|
||||
8
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/valid.js
generated
vendored
Normal file
8
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/functions/valid.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
'use strict'
|
||||
|
||||
const parse = require('./parse')
|
||||
const valid = (version, options) => {
|
||||
const v = parse(version, options)
|
||||
return v ? v.version : null
|
||||
}
|
||||
module.exports = valid
|
||||
91
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/index.js
generated
vendored
Normal file
91
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/index.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
'use strict'
|
||||
|
||||
// just pre-load all the stuff that index.js lazily exports
|
||||
const internalRe = require('./internal/re')
|
||||
const constants = require('./internal/constants')
|
||||
const SemVer = require('./classes/semver')
|
||||
const identifiers = require('./internal/identifiers')
|
||||
const parse = require('./functions/parse')
|
||||
const valid = require('./functions/valid')
|
||||
const clean = require('./functions/clean')
|
||||
const inc = require('./functions/inc')
|
||||
const diff = require('./functions/diff')
|
||||
const major = require('./functions/major')
|
||||
const minor = require('./functions/minor')
|
||||
const patch = require('./functions/patch')
|
||||
const prerelease = require('./functions/prerelease')
|
||||
const compare = require('./functions/compare')
|
||||
const rcompare = require('./functions/rcompare')
|
||||
const compareLoose = require('./functions/compare-loose')
|
||||
const compareBuild = require('./functions/compare-build')
|
||||
const sort = require('./functions/sort')
|
||||
const rsort = require('./functions/rsort')
|
||||
const gt = require('./functions/gt')
|
||||
const lt = require('./functions/lt')
|
||||
const eq = require('./functions/eq')
|
||||
const neq = require('./functions/neq')
|
||||
const gte = require('./functions/gte')
|
||||
const lte = require('./functions/lte')
|
||||
const cmp = require('./functions/cmp')
|
||||
const coerce = require('./functions/coerce')
|
||||
const Comparator = require('./classes/comparator')
|
||||
const Range = require('./classes/range')
|
||||
const satisfies = require('./functions/satisfies')
|
||||
const toComparators = require('./ranges/to-comparators')
|
||||
const maxSatisfying = require('./ranges/max-satisfying')
|
||||
const minSatisfying = require('./ranges/min-satisfying')
|
||||
const minVersion = require('./ranges/min-version')
|
||||
const validRange = require('./ranges/valid')
|
||||
const outside = require('./ranges/outside')
|
||||
const gtr = require('./ranges/gtr')
|
||||
const ltr = require('./ranges/ltr')
|
||||
const intersects = require('./ranges/intersects')
|
||||
const simplifyRange = require('./ranges/simplify')
|
||||
const subset = require('./ranges/subset')
|
||||
module.exports = {
|
||||
parse,
|
||||
valid,
|
||||
clean,
|
||||
inc,
|
||||
diff,
|
||||
major,
|
||||
minor,
|
||||
patch,
|
||||
prerelease,
|
||||
compare,
|
||||
rcompare,
|
||||
compareLoose,
|
||||
compareBuild,
|
||||
sort,
|
||||
rsort,
|
||||
gt,
|
||||
lt,
|
||||
eq,
|
||||
neq,
|
||||
gte,
|
||||
lte,
|
||||
cmp,
|
||||
coerce,
|
||||
Comparator,
|
||||
Range,
|
||||
satisfies,
|
||||
toComparators,
|
||||
maxSatisfying,
|
||||
minSatisfying,
|
||||
minVersion,
|
||||
validRange,
|
||||
outside,
|
||||
gtr,
|
||||
ltr,
|
||||
intersects,
|
||||
simplifyRange,
|
||||
subset,
|
||||
SemVer,
|
||||
re: internalRe.re,
|
||||
src: internalRe.src,
|
||||
tokens: internalRe.t,
|
||||
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
||||
RELEASE_TYPES: constants.RELEASE_TYPES,
|
||||
compareIdentifiers: identifiers.compareIdentifiers,
|
||||
rcompareIdentifiers: identifiers.rcompareIdentifiers,
|
||||
}
|
||||
37
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/constants.js
generated
vendored
Normal file
37
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/constants.js
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
'use strict'
|
||||
|
||||
// Note: this is the semver.org version of the spec that it implements
|
||||
// Not necessarily the package version of this code.
|
||||
const SEMVER_SPEC_VERSION = '2.0.0'
|
||||
|
||||
const MAX_LENGTH = 256
|
||||
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
/* istanbul ignore next */ 9007199254740991
|
||||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
// Max safe length for a build identifier. The max length minus 6 characters for
|
||||
// the shortest version with a build 0.0.0+BUILD.
|
||||
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
||||
|
||||
const RELEASE_TYPES = [
|
||||
'major',
|
||||
'premajor',
|
||||
'minor',
|
||||
'preminor',
|
||||
'patch',
|
||||
'prepatch',
|
||||
'prerelease',
|
||||
]
|
||||
|
||||
module.exports = {
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
RELEASE_TYPES,
|
||||
SEMVER_SPEC_VERSION,
|
||||
FLAG_INCLUDE_PRERELEASE: 0b001,
|
||||
FLAG_LOOSE: 0b010,
|
||||
}
|
||||
11
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/debug.js
generated
vendored
Normal file
11
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/debug.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
'use strict'
|
||||
|
||||
const debug = (
|
||||
typeof process === 'object' &&
|
||||
process.env &&
|
||||
process.env.NODE_DEBUG &&
|
||||
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
||||
) ? (...args) => console.error('SEMVER', ...args)
|
||||
: () => {}
|
||||
|
||||
module.exports = debug
|
||||
29
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
29
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/identifiers.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
'use strict'
|
||||
|
||||
const numeric = /^[0-9]+$/
|
||||
const compareIdentifiers = (a, b) => {
|
||||
if (typeof a === 'number' && typeof b === 'number') {
|
||||
return a === b ? 0 : a < b ? -1 : 1
|
||||
}
|
||||
|
||||
const anum = numeric.test(a)
|
||||
const bnum = numeric.test(b)
|
||||
|
||||
if (anum && bnum) {
|
||||
a = +a
|
||||
b = +b
|
||||
}
|
||||
|
||||
return a === b ? 0
|
||||
: (anum && !bnum) ? -1
|
||||
: (bnum && !anum) ? 1
|
||||
: a < b ? -1
|
||||
: 1
|
||||
}
|
||||
|
||||
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
|
||||
|
||||
module.exports = {
|
||||
compareIdentifiers,
|
||||
rcompareIdentifiers,
|
||||
}
|
||||
42
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/lrucache.js
generated
vendored
Normal file
42
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/lrucache.js
generated
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
'use strict'
|
||||
|
||||
class LRUCache {
|
||||
constructor () {
|
||||
this.max = 1000
|
||||
this.map = new Map()
|
||||
}
|
||||
|
||||
get (key) {
|
||||
const value = this.map.get(key)
|
||||
if (value === undefined) {
|
||||
return undefined
|
||||
} else {
|
||||
// Remove the key from the map and add it to the end
|
||||
this.map.delete(key)
|
||||
this.map.set(key, value)
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
delete (key) {
|
||||
return this.map.delete(key)
|
||||
}
|
||||
|
||||
set (key, value) {
|
||||
const deleted = this.delete(key)
|
||||
|
||||
if (!deleted && value !== undefined) {
|
||||
// If cache is full, delete the least recently used item
|
||||
if (this.map.size >= this.max) {
|
||||
const firstKey = this.map.keys().next().value
|
||||
this.delete(firstKey)
|
||||
}
|
||||
|
||||
this.map.set(key, value)
|
||||
}
|
||||
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = LRUCache
|
||||
17
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
17
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/parse-options.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict'
|
||||
|
||||
// parse out just the options we care about
|
||||
const looseOption = Object.freeze({ loose: true })
|
||||
const emptyOpts = Object.freeze({ })
|
||||
const parseOptions = options => {
|
||||
if (!options) {
|
||||
return emptyOpts
|
||||
}
|
||||
|
||||
if (typeof options !== 'object') {
|
||||
return looseOption
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
module.exports = parseOptions
|
||||
223
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/re.js
generated
vendored
Normal file
223
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/internal/re.js
generated
vendored
Normal file
@@ -0,0 +1,223 @@
|
||||
'use strict'
|
||||
|
||||
const {
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_LENGTH,
|
||||
} = require('./constants')
|
||||
const debug = require('./debug')
|
||||
exports = module.exports = {}
|
||||
|
||||
// The actual regexps go on exports.re
|
||||
const re = exports.re = []
|
||||
const safeRe = exports.safeRe = []
|
||||
const src = exports.src = []
|
||||
const safeSrc = exports.safeSrc = []
|
||||
const t = exports.t = {}
|
||||
let R = 0
|
||||
|
||||
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
||||
|
||||
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
||||
// used internally via the safeRe object since all inputs in this library get
|
||||
// normalized first to trim and collapse all extra whitespace. The original
|
||||
// regexes are exported for userland consumption and lower level usage. A
|
||||
// future breaking change could export the safer regex only with a note that
|
||||
// all input should have extra whitespace removed.
|
||||
const safeRegexReplacements = [
|
||||
['\\s', 1],
|
||||
['\\d', MAX_LENGTH],
|
||||
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
||||
]
|
||||
|
||||
const makeSafeRegex = (value) => {
|
||||
for (const [token, max] of safeRegexReplacements) {
|
||||
value = value
|
||||
.split(`${token}*`).join(`${token}{0,${max}}`)
|
||||
.split(`${token}+`).join(`${token}{1,${max}}`)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
const createToken = (name, value, isGlobal) => {
|
||||
const safe = makeSafeRegex(value)
|
||||
const index = R++
|
||||
debug(name, index, value)
|
||||
t[name] = index
|
||||
src[index] = value
|
||||
safeSrc[index] = safe
|
||||
re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
|
||||
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
|
||||
}
|
||||
|
||||
// The following Regular Expressions can be used for tokenizing,
|
||||
// validating, and parsing SemVer version strings.
|
||||
|
||||
// ## Numeric Identifier
|
||||
// A single `0`, or a non-zero digit followed by zero or more digits.
|
||||
|
||||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
|
||||
|
||||
// ## Non-numeric Identifier
|
||||
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
||||
// more letters, digits, or hyphens.
|
||||
|
||||
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
|
||||
|
||||
// ## Main Version
|
||||
// Three dot-separated numeric identifiers.
|
||||
|
||||
createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
|
||||
`(${src[t.NUMERICIDENTIFIERLOOSE]})`)
|
||||
|
||||
// ## Pre-release Version Identifier
|
||||
// A numeric identifier, or a non-numeric identifier.
|
||||
// Non-numeric identifiers include numeric identifiers but can be longer.
|
||||
// Therefore non-numeric identifiers must go first.
|
||||
|
||||
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
|
||||
}|${src[t.NUMERICIDENTIFIER]})`)
|
||||
|
||||
createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
|
||||
}|${src[t.NUMERICIDENTIFIERLOOSE]})`)
|
||||
|
||||
// ## Pre-release Version
|
||||
// Hyphen, followed by one or more dot-separated pre-release version
|
||||
// identifiers.
|
||||
|
||||
createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)
|
||||
|
||||
createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||||
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)
|
||||
|
||||
// ## Build Metadata Identifier
|
||||
// Any combination of digits, letters, or hyphens.
|
||||
|
||||
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
|
||||
|
||||
// ## Build Metadata
|
||||
// Plus sign, followed by one or more period-separated build metadata
|
||||
// identifiers.
|
||||
|
||||
createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
|
||||
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)
|
||||
|
||||
// ## Full Version String
|
||||
// A main version, followed optionally by a pre-release version and
|
||||
// build metadata.
|
||||
|
||||
// Note that the only major, minor, patch, and pre-release sections of
|
||||
// the version string are capturing groups. The build metadata is not a
|
||||
// capturing group, because it should not ever be used in version
|
||||
// comparison.
|
||||
|
||||
createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
|
||||
}${src[t.PRERELEASE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('FULL', `^${src[t.FULLPLAIN]}$`)
|
||||
|
||||
// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
|
||||
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
|
||||
// common in the npm registry.
|
||||
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
|
||||
}${src[t.PRERELEASELOOSE]}?${
|
||||
src[t.BUILD]}?`)
|
||||
|
||||
createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)
|
||||
|
||||
createToken('GTLT', '((?:<|>)?=?)')
|
||||
|
||||
// Something like "2.*" or "1.2.x".
|
||||
// Note that "x.x" is a valid xRange identifer, meaning "any version"
|
||||
// Only the first item is strictly required.
|
||||
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
|
||||
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)
|
||||
|
||||
createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
|
||||
`(?:${src[t.PRERELEASE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
|
||||
`(?:${src[t.PRERELEASELOOSE]})?${
|
||||
src[t.BUILD]}?` +
|
||||
`)?)?`)
|
||||
|
||||
createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Coercion.
|
||||
// Extract anything that could conceivably be a part of a valid semver
|
||||
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
|
||||
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
|
||||
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
|
||||
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
|
||||
createToken('COERCEFULL', src[t.COERCEPLAIN] +
|
||||
`(?:${src[t.PRERELEASE]})?` +
|
||||
`(?:${src[t.BUILD]})?` +
|
||||
`(?:$|[^\\d])`)
|
||||
createToken('COERCERTL', src[t.COERCE], true)
|
||||
createToken('COERCERTLFULL', src[t.COERCEFULL], true)
|
||||
|
||||
// Tilde ranges.
|
||||
// Meaning is "reasonably at or greater than"
|
||||
createToken('LONETILDE', '(?:~>?)')
|
||||
|
||||
createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
|
||||
exports.tildeTrimReplace = '$1~'
|
||||
|
||||
createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// Caret ranges.
|
||||
// Meaning is "at least and backwards compatible with"
|
||||
createToken('LONECARET', '(?:\\^)')
|
||||
|
||||
createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
|
||||
exports.caretTrimReplace = '$1^'
|
||||
|
||||
createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
|
||||
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)
|
||||
|
||||
// A simple gt/lt/eq thing, or just "" to indicate "any version"
|
||||
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
|
||||
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)
|
||||
|
||||
// An expression to strip any whitespace between the gtlt and the thing
|
||||
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
|
||||
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
|
||||
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
|
||||
exports.comparatorTrimReplace = '$1$2$3'
|
||||
|
||||
// Something like `1.2.3 - 1.2.4`
|
||||
// Note that these all use the loose form, because they'll be
|
||||
// checked against either the strict or loose comparator form
|
||||
// later.
|
||||
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAIN]})` +
|
||||
`\\s*$`)
|
||||
|
||||
createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s+-\\s+` +
|
||||
`(${src[t.XRANGEPLAINLOOSE]})` +
|
||||
`\\s*$`)
|
||||
|
||||
// Star ranges basically just allow anything at all.
|
||||
createToken('STAR', '(<|>)?=?\\s*\\*')
|
||||
// >=0.0.0 is like a star
|
||||
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
|
||||
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
|
||||
78
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/package.json
generated
vendored
Normal file
78
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/package.json
generated
vendored
Normal file
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "semver",
|
||||
"version": "7.7.4",
|
||||
"description": "The semantic version parser used by npm.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "tap",
|
||||
"snap": "tap",
|
||||
"lint": "npm run eslint",
|
||||
"postlint": "template-oss-check",
|
||||
"lintfix": "npm run eslint -- --fix",
|
||||
"posttest": "npm run lint",
|
||||
"template-oss-apply": "template-oss-apply --force",
|
||||
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@npmcli/eslint-config": "^6.0.0",
|
||||
"@npmcli/template-oss": "4.29.0",
|
||||
"benchmark": "^2.1.4",
|
||||
"tap": "^16.0.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/npm/node-semver.git"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"files": [
|
||||
"bin/",
|
||||
"lib/",
|
||||
"classes/",
|
||||
"functions/",
|
||||
"internal/",
|
||||
"ranges/",
|
||||
"index.js",
|
||||
"preload.js",
|
||||
"range.bnf"
|
||||
],
|
||||
"tap": {
|
||||
"timeout": 30,
|
||||
"coverage-map": "map.js",
|
||||
"nyc-arg": [
|
||||
"--exclude",
|
||||
"tap-snapshots/**"
|
||||
]
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"author": "GitHub Inc.",
|
||||
"templateOSS": {
|
||||
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
|
||||
"version": "4.29.0",
|
||||
"engines": ">=10",
|
||||
"distPaths": [
|
||||
"classes/",
|
||||
"functions/",
|
||||
"internal/",
|
||||
"ranges/",
|
||||
"index.js",
|
||||
"preload.js",
|
||||
"range.bnf"
|
||||
],
|
||||
"allowPaths": [
|
||||
"/classes/",
|
||||
"/functions/",
|
||||
"/internal/",
|
||||
"/ranges/",
|
||||
"/index.js",
|
||||
"/preload.js",
|
||||
"/range.bnf",
|
||||
"/benchmarks"
|
||||
],
|
||||
"publish": "true"
|
||||
}
|
||||
}
|
||||
4
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/preload.js
generated
vendored
Normal file
4
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/preload.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict'
|
||||
|
||||
// XXX remove in v8 or beyond
|
||||
module.exports = require('./index.js')
|
||||
16
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/range.bnf
generated
vendored
Normal file
16
cdk/node_modules/@aws-cdk/cloud-assembly-schema/node_modules/semver/range.bnf
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
range-set ::= range ( logical-or range ) *
|
||||
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||
hyphen ::= partial ' - ' partial
|
||||
simple ::= primitive | partial | tilde | caret
|
||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||
xr ::= 'x' | 'X' | '*' | nr
|
||||
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||
tilde ::= '~' partial
|
||||
caret ::= '^' partial
|
||||
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||
pre ::= parts
|
||||
build ::= parts
|
||||
parts ::= part ( '.' part ) *
|
||||
part ::= nr | [-0-9A-Za-z]+
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user