import { BaseSkillFactory , DefaultApiClient , SkillConfiguration } from 'ask-sdk-core' ; import { DynamoDbPersistenceAdapter , PartitionKeyGenerator } from 'ask-sdk-dynamodb-persistence-adapter' ; import { DynamoDB } from 'aws-sdk' ; import { StandardSkillBuilder } from './StandardSkillBuilder' ; /**
 * Provider for  StandardSkillBuilder .
  export class StandardSkillFactory { public static init ( ) { let thisTableName ; let thisAutoCreateTable ; let thisPartitionKeyGenerator ; let thisDynamoDbClient ; const baseSkillBuilder = BaseSkillFactory . init ( ) ; return { ... baseSkillBuilder as StandardSkillBuilder , getSkillConfiguration ( ) { const skillConfiguration = baseSkillBuilder . getSkillConfiguration ( ) ; return { ... skillConfiguration , persistenceAdapter : thisTableName ? new DynamoDbPersistenceAdapter ( { tableName : thisTableName , createTable : thisAutoCreateTable , partitionKeyGenerator : thisPartitionKeyGenerator , dynamoDBClient : thisDynamoDbClient , } ) : undefined , apiClient : new DefaultApiClient ( ) , } ; } , withTableName ( tableName ) { thisTableName = tableName ; return this ; } , withAutoCreateTable ( autoCreateTable ) { thisAutoCreateTable = autoCreateTable ; return this ; } , withPartitionKeyGenerator ( partitionKeyGenerator ) { thisPartitionKeyGenerator = partitionKeyGenerator ; return this ; } , withDynamoDbClient ( dynamoDbClient ) { thisDynamoDbClient = dynamoDbClient ; return this ; } , } ; } }