-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecates metadata: allow connecting deprecated type in place of new…
… type
- Loading branch information
1 parent
80661f4
commit 9eb7500
Showing
2 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,20 @@ const transforms = { | |
resourceType.implementations = [] | ||
} | ||
|
||
/* | ||
* see also getValidEnvironmentConnections and availableResourceTypesForRequirement | ||
* if a resource type specifies deprecates, its extends will be searched along with the extends of every type that it 'deprecates' | ||
* if a resource type is marked as deprecated by another type, it cannot be 'created' if its deprecating type is an option to create | ||
* if a resource type is marked as deprecated by another type, it can be 'connected' when its deprecating type would be connectable | ||
* this ultimately affects how both types will be available to connect or create | ||
* e.g. Route53DNSZone has deprecates: [email protected]/onecommons/unfurl-types:dns-services | ||
* this has the following consequences (assuming Route53DNSZone has the correct implementations): | ||
- Route53DNSZone can always be created when [email protected]/onecommons/unfurl-types:dns-services is also a valid option to create | ||
- [email protected]/onecommons/unfurl-types:dns-services cannot be created when Route53DNSZone is a valid option to create | ||
- Route53DNSZone can always be connected when [email protected]/onecommons/unfurl-types:dns-services is also a valid option to connect | ||
- inversely, [email protected]/onecommons/unfurl-types:dns-services can always be connected when Route53DNSZone is also a valid option to connect | ||
*/ | ||
if(resourceType.metadata.deprecates) { | ||
const deprecates = resourceType.metadata.deprecates | ||
if(!Array.isArray(deprecates)) { | ||
|