botbuilder-dialogs-adaptive
Version:
Rule system for the Microsoft BotBuilder dialog system.
36 lines • 1.35 kB
JavaScript
;
/**
* @module botbuilder-dialogs-adaptive
*/
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.DynamicBeginDialog = void 0;
const adaptive_expressions_1 = require("adaptive-expressions");
const beginDialog_1 = require("./beginDialog");
/**
* Internal `BeginDialog` action which dynamically binds x.schema/x.dialog to invoke the x.dialog resource with properties as the options.
*/
class DynamicBeginDialog extends beginDialog_1.BeginDialog {
/**
* @protected
* Evaluates expressions in options.
* @param dc The [DialogContext](xref:botbuilder-dialogs.DialogContext) for the current turn of conversation.
* @param _options The options to bind.
* @returns An object with the binded options
*/
bindOptions(dc, _options) {
const options = {};
for (const key of Object.getOwnPropertyNames(this)) {
if (!(this[key] instanceof adaptive_expressions_1.ExpressionProperty)) {
options[key] = this[key];
}
}
return super.bindOptions(dc, options);
}
}
exports.DynamicBeginDialog = DynamicBeginDialog;
DynamicBeginDialog.$kind = 'Microsoft.DynamicBeginDialog';
//# sourceMappingURL=dynamicBeginDialog.js.map