AWS SDK for JavaScript STS Client for Node.js, Browser and React Native, providing temporary security credentials and role assumption capabilities
92
Evaluation — 92%
↑ 1.05xAgent success when using this tile
{
"context": "This criteria evaluates the engineer's proficiency in implementing union shape validation patterns as used in AWS SDK for JavaScript v3. The focus is on correctly validating discriminated union types, ensuring exactly one union member is present, and properly handling type discrimination in message payloads.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Union member validation",
"description": "Validates that exactly one union member is present in the MessagePayload. The implementation should check that the payload object has exactly one key (TextMessage, BinaryMessage, or ErrorMessage) and reject payloads with zero or multiple keys.",
"max_score": 30
},
{
"name": "Type discrimination logic",
"description": "Correctly identifies which union member is present by checking for the specific property names (TextMessage, BinaryMessage, or ErrorMessage) and uses this information to determine the message type.",
"max_score": 25
},
{
"name": "TextMessage handling",
"description": "Properly handles the TextMessage union variant by accessing the nested structure (payload.TextMessage) and extracts the text and timestamp fields correctly.",
"max_score": 15
},
{
"name": "BinaryMessage handling",
"description": "Properly handles the BinaryMessage union variant by accessing the nested structure (payload.BinaryMessage) and extracts the data and encoding fields correctly.",
"max_score": 15
},
{
"name": "ErrorMessage handling",
"description": "Properly handles the ErrorMessage union variant by accessing the nested structure (payload.ErrorMessage) and extracts the code and message fields correctly.",
"max_score": 15
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-aws-sdk--client-stsdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10