3.11.0 • Published 4 years ago

ask-utils v3.11.0

Weekly downloads
218
License
MIT
Repository
github
Last release
4 years ago

ASK-Utils - Utility functions for ask-sdk

NPM
npm version License: MIT Maintainability Test Coverage Build Status

logo

https://ask-utils.dev

Getting started

$ npm i -S ask-utils

Packages

namenpm urlRepositorySummary
@ask-utils/corehttps://www.npmjs.com/package/@ask-utils/corehttps://github.com/ask-utils/ask-utils/tree/master/packages/coreCore utilities
@ask-utils/proactive-eventhttps://www.npmjs.com/package/@ask-utils/proactive-eventhttps://github.com/ask-utils/ask-utils/tree/master/packages/proactive-eventProactive Event parameter builder and request client
@ask-utils/isphttps://www.npmjs.com/package/@ask-utils/isphttps://github.com/ask-utils/ask-utils/tree/master/packages/ispISP helpers
@ask-utils/handlershttps://www.npmjs.com/package/@ask-utils/handlershttps://github.com/ask-utils/ask-utils/tree/master/packages/handlersUtility handler and interceptors
@ask-utils/error-handlershttps://www.npmjs.com/package/@ask-utils/error-handlershttps://github.com/ask-utils/ask-utils/tree/master/packages/error-handlersError handler helpers
@ask-utils/service-clienthttps://www.npmjs.com/package/@ask-utils/service-clienthttps://github.com/ask-utils/ask-utils/tree/master/packages/serviceClient sServiceClient alternative

Skill Builder (Beta)

We can easy to create your own skill builder

import {
  createSkill,
  SkillHandlersFactory
} from 'ask-utils'

// can get skill constancts by request attributes
const ExampleHandler = {
  canHandle: () => true,
  handle: handlerInput => {
    const { CONSTANTS } = handlerInput.attributesManager.getRequestAttributes()
    return handlerInput.responseBuilder
      .speak(`Welcome to the ${CONSTANTS.SKILL_NAME}!`)
      .getResponse()
  }
}

const handlers = SkillHandlersFactory.create()
  .addRequestHandlers(
    LaunchRequest,
    NextIntent,
    AnswerIntent,
    YesNextIntent,
    HelpIntent,
    ResumeIntent,
    StopIntent,
    NoIntent,
    CancelIntent,
    FallBackIntent
  )
  .addRequestInterceptors(
    MyRequestInterceptor1,
    MyRequestInterceptor2,
  )
  .addResponseInterceptors(
    MyResponseInterceptor1,
    MyResponseInterceptor2,
  )
  .addErrorHandlers(
    MyErrorHandler1,
    MyErrorHandler2,
  )

export const handler = createSkill({
    persistanceType: 'S3',
    bucketName: process.env.BUCKET_NAME as string,
    bucketPathPrefix: process.env.PATH_PREFIX as string,
    isISP: true,
    constants: {
      SKILL_NAME: 'My Awesome Skill'
    }
  }, handlers.getHandlers())
  .lambda()

development

$ git clone git@github.com:hideokamoto/ask-utils.git
$ cd ask-utils
$ yarn
$ yarn bootstrap

test

$ npm test

Lint

$ npm run lint

or

$ npm run lint -- --fix

History

-> Release Note

Contributors

NameVersion
@ArtskydJv0.13.0
3.11.0

4 years ago

3.9.0

4 years ago

3.8.0

4 years ago

3.6.0

4 years ago

3.5.0

4 years ago

3.4.0

4 years ago

3.3.5

4 years ago

3.3.4

4 years ago

3.3.3

4 years ago

3.3.2

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.0.8

5 years ago

2.3.2

5 years ago

2.3.1

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.6.0

5 years ago

1.5.1

5 years ago

1.5.0

5 years ago

1.4.1

5 years ago

1.4.0

5 years ago

1.3.0

5 years ago

1.2.0

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.15.0

5 years ago

0.14.0

5 years ago

0.13.0

5 years ago

0.12.5

5 years ago

0.12.4

6 years ago

0.12.3

6 years ago

0.12.2

6 years ago

0.12.1

6 years ago

0.12.0

6 years ago

0.11.1

6 years ago

0.11.0

6 years ago

0.10.0

6 years ago

0.9.1

6 years ago

0.8.0

6 years ago

0.7.0

6 years ago

0.6.0

6 years ago

0.5.1

6 years ago

0.4.2

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago