This repository has been archived by the owner on Oct 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send details of deprecated properties in events
- Loading branch information
1 parent
d730b51
commit 52b8437
Showing
13 changed files
with
132 additions
and
102 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
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
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
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
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
38 changes: 0 additions & 38 deletions
38
packages/tc-api-rest-handlers/lib/relationships/properties.js
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const invertDirection = direction => | ||
direction === 'incoming' ? 'outgoing' : 'incoming'; | ||
|
||
const findPropertyNamesFromPropertyDef = function({ | ||
rootType, | ||
direction, | ||
relationship, | ||
destinationType, | ||
}) { | ||
return Object.entries(this.getType(rootType).properties) | ||
.filter( | ||
([, def]) => | ||
def.type === destinationType && | ||
def.relationship === relationship && | ||
def.direction === direction, | ||
) | ||
.map(([propName]) => propName) | ||
.sort(); | ||
}; | ||
|
||
const findInversePropertyNames = function(rootType, propName) { | ||
const { type, relationship, direction } = this.getType(rootType).properties[ | ||
propName | ||
]; | ||
return this.findPropertyNamesFromPropertyDef({ | ||
rootType: type, | ||
direction: invertDirection(direction), | ||
relationship, | ||
destinationType: rootType, | ||
}); | ||
}; | ||
|
||
const findPropertyNames = function(rootType, propName) { | ||
const { type, relationship, direction } = this.getType(rootType).properties[ | ||
propName | ||
]; | ||
|
||
if (!relationship) { | ||
return [propName]; | ||
} | ||
|
||
return this.findPropertyNamesFromPropertyDef({ | ||
rootType, | ||
direction, | ||
relationship, | ||
destinationType: type, | ||
}); | ||
}; | ||
|
||
module.exports = { | ||
invertDirection, | ||
findPropertyNames, | ||
findInversePropertyNames, | ||
findPropertyNamesFromPropertyDef, | ||
}; |
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