serverless-spy
Version:
CDK-based library for writing elegant integration tests on AWS serverless architecture and an additional web console to monitor events in real time.
55 lines (54 loc) • 1.97 kB
JavaScript
import { BatchWriteItemCommand as __BatchWriteItemCommand } from "@aws-sdk/client-dynamodb";
import { Command as $Command } from "@smithy/smithy-client";
import { DynamoDBDocumentClientCommand } from "../baseCommand/DynamoDBDocumentClientCommand";
import { ALL_VALUES } from "../commands/utils";
export { DynamoDBDocumentClientCommand, $Command };
export class BatchWriteCommand extends DynamoDBDocumentClientCommand {
constructor(input) {
super();
this.input = input;
this.inputKeyNodes = {
RequestItems: {
"*": {
"*": {
PutRequest: {
Item: ALL_VALUES,
},
DeleteRequest: {
Key: ALL_VALUES,
},
},
},
},
};
this.outputKeyNodes = {
UnprocessedItems: {
"*": {
"*": {
PutRequest: {
Item: ALL_VALUES,
},
DeleteRequest: {
Key: ALL_VALUES,
},
},
},
},
ItemCollectionMetrics: {
"*": {
"*": {
ItemCollectionKey: ALL_VALUES,
},
},
},
};
this.clientCommand = new __BatchWriteItemCommand(this.input);
this.middlewareStack = this.clientCommand.middlewareStack;
}
resolveMiddleware(clientStack, configuration, options) {
this.addMarshallingMiddleware(configuration);
const stack = clientStack.concat(this.middlewareStack);
const handler = this.clientCommand.resolveMiddleware(stack, configuration, options);
return async () => handler(this.clientCommand);
}
}