Skip to content

Commit

Permalink
fix: export UserAgentManager from core (#659)
Browse files Browse the repository at this point in the history
Co-authored-by: Shen Chen <shench@amazon.com>
  • Loading branch information
ShenChen93 and Shen Chen committed Oct 9, 2020
1 parent c1d833e commit b99d08d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 15 deletions.
11 changes: 11 additions & 0 deletions ask-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.10.1](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.9.0...v2.10.0) (2020-10-09)


### Features

* export UserAgentManager class in SDK core





# [2.10.0](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.9.0...v2.10.0) (2020-10-08)


Expand Down
3 changes: 2 additions & 1 deletion ask-sdk-core/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,6 @@ export {

export {
createAskSdkError,
createAskSdkUserAgent
createAskSdkUserAgent,
UserAgentManager
} from 'ask-sdk-runtime';
4 changes: 2 additions & 2 deletions ask-sdk-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ask-sdk-core",
"version": "2.10.0",
"version": "2.10.1",
"description": "Core package for Alexa Skills Kit SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -29,7 +29,7 @@
"SDK"
],
"dependencies": {
"ask-sdk-runtime": "^2.10.0"
"ask-sdk-runtime": "^2.10.1"
},
"peerDependencies": {
"ask-sdk-model": "^1.29.0"
Expand Down
3 changes: 2 additions & 1 deletion ask-sdk-core/tst/skill/CustomSkill.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { MockAlwaysFalseRequestHandler } from '../mocks/request/MockAlwaysFalseR
import { MockAlwaysTrueRequestHandler } from '../mocks/request/MockAlwaysTrueRequestHandler';

beforeEach(function() {
UserAgentManager.clear();
UserAgentManager['components'].clear();
UserAgentManager['userAgent'] = '';
});

describe('CustomSkill', () => {
Expand Down
12 changes: 12 additions & 0 deletions ask-sdk-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [2.10.1](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.9.0...v2.10.0) (2020-10-09)


### Bug Fixes

* remove the clear function in UserAgentManager






# [2.10.0](https://github.com/alexa/alexa-skills-kit-sdk-for-nodejs/compare/v2.9.0...v2.10.0) (2020-10-08)


Expand Down
9 changes: 0 additions & 9 deletions ask-sdk-runtime/lib/util/UserAgentManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,4 @@ export class UserAgentManager {
this.userAgent = updatedUserAgent;
}
}

/**
* Clears any existing components from the user agent and resets it to empty.
*/
static clear() {
this.components.clear();
this.userAgent = '';
}

}
2 changes: 1 addition & 1 deletion ask-sdk-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ask-sdk-runtime",
"version": "2.10.0",
"version": "2.10.1",
"description": "Base runtime package for Alexa Skills Kit SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 2 additions & 1 deletion ask-sdk-runtime/tst/util/UserAgentManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ describe('UserAgentManager', () => {
it('should clear components', () => {
UserAgentManager.registerComponent('foo');
UserAgentManager.registerComponent('bar');
UserAgentManager.clear();
UserAgentManager['components'].clear();
UserAgentManager['userAgent'] = '';
expect(UserAgentManager.getUserAgent()).equal('');
});
});

0 comments on commit b99d08d

Please sign in to comment.