Categories:
Migrate a use case to Evanescence 9.0.0 release
Evanescence 9.0.0 includes key modifications in aura-bot in order to keep Aura Platform up to date and improve its operation. For this reason, use cases dialogs created in previous releases must be migrated to be compatible with this version.
This document includes the guidelines for the migration of local use cases.
Introduction
Evanescence 9.0.0 release includes certain modifications and upgrades in botBuilder, nodejs version, Aura channels configuration, repos and libraries, etc. Due to these changes, use cases must be adapted in order to be aligned with the Aura Platform changes through the execution of mandatory and recommended modifications.
The modifications in aura-bot are summarized below, together with the required changes to execute in local use cases, which are fully detailed in succeeding sections:
- Update of Node.js to version 20.0.0, to keep Aura platform up to date.
- Update of Bot Framework version to version 4.22.1, to keep Aura platform up to date.
- Update Aura channel data model (information about channels stored in the platform) to eliminate the extra effort of maintaining the platform internal components using different channel data models.
- Reduction of the number of internal libraries to improve and streamline the platform release generation process:
- Update to eslint2024, Typescript, dependencies
Mandatory modifications
1. Change package.json file
Update the package.json file content as shown below:
{
"name": "@my-registry/my-library",
"version": "1.0.0",
"main": "lib/index.js",
"engines": {
"node": ">=18.0.0"
},
"license": "UNLICENSED",
"plugin": {
"provides": [
"my-service"
]
},
"dependencies": {
"@telefonica/aura-bot-utilities": "^1.0.0",
"@telefonica/aura-clients": "^1.0.0",
"@telefonica/aura-utilities": "^1.0.0",
"botbuilder": "~4.22.1",
"botbuilder-dialogs": "~4.22.1",
"joi": "^17.6.0",
"moment": "^2.29.3"
},
"devDependencies": {
"@types/jest": "^29.2.5",
"@types/node": "^14.17.5",
"@types/uuid": "^8.3.0",
"jest": "^29.3.1",
"jest-junit": "^15.0.0",
"shx": "^0.3.3",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "~5.0.0"
},
"scripts": {
"build": "npm run clean && npm run compile",
"clean": "cross-env shx rm -fR ./lib",
"compile": "tsc"
},
"repository": {
"type": "git",
"url": "git@github.com:Telefonica/my-repository.git",
"directory": "packages/my-library"
}
}
2. Change use case dialog code
2.1 Due to Node.js update
- No necessary changes have been identified and the current code should run correctly on Node.js version 20.0.0.
- Some unit tests that make use of error messages generated by Node.js may need to be adapted.
2.2 Due to Bot Framework update
- No necessary code changes have been identified and the current code should run correctly with BotFramework 4.22.1.
- In any case, as shown in Section 1, Botbuilder dependencies must be updated in the
package.jsonof all libraries:
"dependencies": {
"botbuilder": "~4.22.1",
"botbuilder-dialogs": "~4.22.1"
}
2.3 Due to the use of the current channel model
Update use cases dialogs to replace the references to the old data model with the new one:
-
All the imports of
import {AuraChannel} from '@telefonica/aura-bot-common'should be changed toimport { ChannelConfiguration } from '@telefonica/aura-clients/lib/aura-configuration-api-client'. -
Also, all channel models imported from
channel-models.tsin @telefonica/aura-bot-common should be imported from@telefonica/aura-clients/lib/aura-configuration-api-client. -
user.channelwill change its model fromAuraChanneltoChannelConfiguration.- With this change, certain accesses to properties should be changed:
| Deprecated channel model field | Current channel model field |
|---|---|
| channel.scopes | channel.security?.authScopes |
| channel.purposes | channel.security?.authPurposes |
| channel.outputMessageFormat | channel.responseOptions?.outputMessageFormat |
| channel.fpaAuthIntegratedConfiguration.logoutCallback.channel_communication_query_params | channel.security.federatedAuthentication.logoutCallback.queryParams |
| channel.fpaAuthIntegratedConfiguration.logoutCallback.channel_communication_endpoint | channel.security.federatedAuthentication.logoutCallback.endpoint |
| channel.fpaAuthIntegratedConfiguration.logoutCallback | channel.security.federatedAuthentication.logoutCallback |
| channel.fpaAuthIntegratedConfiguration.channelUserSeparator | channel.security.federatedAuthentication.auraIdSeparator |
| channel.fpaAuthIntegratedConfiguration.channelCallback.channel_communication_query_params | channel.security.federatedAuthentication.loginCallback.queryParams |
| channel.fpaAuthIntegratedConfiguration.channelCallback.channel_communication_endpoint | channel.security.federatedAuthentication.loginCallback.endpoint |
| channel.fpaAuthIntegratedConfiguration.channelCallback | channel.security.federatedAuthentication.loginCallback |
| channel.fpaAuthIntegratedConfiguration.accountLinkingUrl | channel.security.federatedAuthentication.loginUrl |
| channel.fpaAuthIntegrated | channel.security?.federatedAuthentication |
| channel.dialogs | channel.dialogLibraries |
| channel.authentication?.anonymous | channel.security?.anonymous |
| channel.alwaysSpeak | channel.responseOptions?.sendSpeak |
| channel.allowUserProfile | channel.security?.allowUserProfile |
2.4 Due to Aura libraries grouping
As Aura libraries have been grouped, it is required to update the imports in the use cases dialogs code:
| Old imports | New imports |
|---|---|
Imports from @telefonica/aura-bot-common |
import * from @telefonica/aura-bot-utilities/lib/aura-bot-common |
Imports from @telefonica/aura-bot-library-util |
import * from @telefonica/aura-bot-utilities/lib/aura-bot-library-util |
| If using any of the Aura’s published API clients | import * from @telefonica/aura-clients/lib/the-client-used Check the current list of API clients in the document Aura API clients |
| If using any of the Aura’s published utilities | import * from @telefonica/aura-utilities/lib/the-utility-used Check the current list of utilities in the document: Aura utilities |
Recommended modifications
In addition to the mandatory changes outlined in the previous sections, we highly recommend implementing the following additional adjustments:
Update to eslint 2024
eslint version is updated to 8.57.0. It is recommended to upgrade this component.
Update Typescript
- Changes in
tsconfig:- Remove unnecessary libraries defined in
libfield (DOM, etc.) - The
targetfield should be set toes2022to make use of the latest capabilities of Nodejs 20.0.0 - The
libfield should be set toes2023(Typescript >= 5.2.2 is required)
- Remove unnecessary libraries defined in
{
"compilerOptions": {
"lib": [
"ES2023" // Typescript >= 5.2.2 is required
],
"target": "2022",
// ...
}
// ...
}
References:
Dependencies updates
| Dependency | Version |
|---|---|
| superagent | superagent@8.1.2 |
| UUID | uuid@9.0.1 |
Deprecations
-
Aura old channel model is deprecated. Access here the current channel model.
-
The use of request and request-promise is deprecated. The recommended dependency to use is superagent, but also got and axios are validated.
Further information: Making HTTP/HTTPS requests. -
The use of zlib as a external library is deprecated.
The recommendation is to use the one included in node.js directly.
AuraLogger
Some releases ago, the version of AuraLogger was updated and, although the old version has been maintained until Dire Straits release, it will be removed in Evanescence release.
Please, follow the instructions for the new logger:
-
How to use aura-logging utility in Aura for controlling the login processes: aura-logging utility.
-
Migration from the old library
@telefonica/aura-loggingto the new one: AuraLogging.