mirror of
https://github.com/r-ca/kidshift-skills.git
synced 2024-10-25 17:14:03 +00:00
27 lines
964 B
JavaScript
27 lines
964 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
class AttributeUtils {
|
|
constructor(handlerInput) {
|
|
this.handlerInput = handlerInput;
|
|
}
|
|
async saveAttributes() {
|
|
await this.handlerInput.attributesManager.savePersistentAttributes();
|
|
}
|
|
async setToken(token) {
|
|
return await this.handlerInput.attributesManager.getPersistentAttributes().then((attributes) => {
|
|
attributes.token = token;
|
|
return attributes;
|
|
}).then((attributes) => {
|
|
this.handlerInput.attributesManager.setPersistentAttributes(attributes);
|
|
}).finally(() => {
|
|
return this.saveAttributes();
|
|
});
|
|
}
|
|
async getToken() {
|
|
return await this.handlerInput.attributesManager.getPersistentAttributes().then((attributes) => {
|
|
return attributes.token;
|
|
});
|
|
}
|
|
}
|
|
exports.default = AttributeUtils;
|
|
//# sourceMappingURL=AttributeUtils.js.map
|