UNPKG

clwoz-models

Version:
257 lines 12.3 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); /** * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. */ var ReplayErrorType; (function (ReplayErrorType) { /* Action does not exist in the model */ ReplayErrorType["ActionUndefined"] = "ActionUndefined"; /* Action has not been created for this imported utterance */ ReplayErrorType["ActionStub"] = "ActionStub"; /* Entity does not exist in the model */ ReplayErrorType["EntityUndefined"] = "EntityUndefined"; /* API bad Card */ ReplayErrorType["APIBadCard"] = "APIBadCard"; /* API returns logicValue but has no Render function */ ReplayErrorType["APIMalformed"] = "APIMalformed"; /* API is placeholder */ ReplayErrorType["APIPlaceholder"] = "APIPlaceholder"; /* API does not exist on the Bot */ ReplayErrorType["APIUndefined"] = "APIUndefined"; /* Bot API threw and exception */ ReplayErrorType["APIException"] = "APIException"; /* Entity used in Action but has not value */ ReplayErrorType["EntityEmpty"] = "EntityEmpty"; /* Non-multi value has multiple values */ ReplayErrorType["EntityUnexpectedMultivalue"] = "EntityUnexpectedMultivalue"; /* Selected Action is not available with given constraints */ ReplayErrorType["ActionUnavailable"] = "ActionUnavailable"; /* Action in Score Rounds after Wait action */ ReplayErrorType["ActionAfterWait"] = "ActionAfterWait"; /* Two consecutive user inputs */ ReplayErrorType["TwoUserInputs"] = "TwoUserInputs"; /* User input after non-wait */ ReplayErrorType["InputAfterNonWait"] = "InputAfterNonWait"; /* Exception */ ReplayErrorType["Exception"] = "Exception"; ReplayErrorType["EntityDiscrepancy"] = "EntityDiscrepancy"; ReplayErrorType["SetEntityException"] = "SetEntityException"; ReplayErrorType["DispatchException"] = "DispatchException"; ReplayErrorType["ChangeModelException"] = "ChangeModelException"; // Transcript failed to replay as expected during test ReplayErrorType["TranscriptValidationError"] = "TranscriptValidationError"; })(ReplayErrorType = exports.ReplayErrorType || (exports.ReplayErrorType = {})); var ReplayErrorLevel; (function (ReplayErrorLevel) { // TrainDialog can still be used in training ReplayErrorLevel["WARNING"] = "WARNING"; // TrainDialog will be disabled ReplayErrorLevel["ERROR"] = "ERROR"; //TrainDialog will be disabled and can't be edited / replayed ReplayErrorLevel["BLOCKING"] = "BLOCKING"; })(ReplayErrorLevel = exports.ReplayErrorLevel || (exports.ReplayErrorLevel = {})); var ReplayError = /** @class */ (function () { function ReplayError(type, errorLevel) { this.type = type; this.errorLevel = errorLevel; } return ReplayError; }()); exports.ReplayError = ReplayError; var ReplayErrorActionUndefined = /** @class */ (function (_super) { __extends(ReplayErrorActionUndefined, _super); function ReplayErrorActionUndefined(lastUserInput) { var _this = _super.call(this, ReplayErrorType.ActionUndefined, ReplayErrorLevel.BLOCKING) || this; _this.lastUserInput = lastUserInput; return _this; } return ReplayErrorActionUndefined; }(ReplayError)); exports.ReplayErrorActionUndefined = ReplayErrorActionUndefined; var ReplayErrorActionStub = /** @class */ (function (_super) { __extends(ReplayErrorActionStub, _super); function ReplayErrorActionStub(lastUserInput) { var _this = _super.call(this, ReplayErrorType.ActionStub, ReplayErrorLevel.BLOCKING) || this; _this.lastUserInput = lastUserInput; return _this; } return ReplayErrorActionStub; }(ReplayError)); exports.ReplayErrorActionStub = ReplayErrorActionStub; var ReplayErrorEntityUndefined = /** @class */ (function (_super) { __extends(ReplayErrorEntityUndefined, _super); function ReplayErrorEntityUndefined(value) { var _this = _super.call(this, ReplayErrorType.EntityUndefined, ReplayErrorLevel.WARNING) || this; _this.value = value; return _this; } return ReplayErrorEntityUndefined; }(ReplayError)); exports.ReplayErrorEntityUndefined = ReplayErrorEntityUndefined; var ReplayErrorAPIBadCard = /** @class */ (function (_super) { __extends(ReplayErrorAPIBadCard, _super); function ReplayErrorAPIBadCard() { return _super.call(this, ReplayErrorType.APIBadCard, ReplayErrorLevel.ERROR) || this; } return ReplayErrorAPIBadCard; }(ReplayError)); exports.ReplayErrorAPIBadCard = ReplayErrorAPIBadCard; var ReplayErrorAPIMalformed = /** @class */ (function (_super) { __extends(ReplayErrorAPIMalformed, _super); function ReplayErrorAPIMalformed() { return _super.call(this, ReplayErrorType.APIMalformed, ReplayErrorLevel.ERROR) || this; } return ReplayErrorAPIMalformed; }(ReplayError)); exports.ReplayErrorAPIMalformed = ReplayErrorAPIMalformed; var ReplayErrorAPIPlaceholder = /** @class */ (function (_super) { __extends(ReplayErrorAPIPlaceholder, _super); function ReplayErrorAPIPlaceholder() { return _super.call(this, ReplayErrorType.APIPlaceholder, ReplayErrorLevel.WARNING) || this; } return ReplayErrorAPIPlaceholder; }(ReplayError)); exports.ReplayErrorAPIPlaceholder = ReplayErrorAPIPlaceholder; var ReplayErrorAPIUndefined = /** @class */ (function (_super) { __extends(ReplayErrorAPIUndefined, _super); function ReplayErrorAPIUndefined(value) { var _this = _super.call(this, ReplayErrorType.APIUndefined, ReplayErrorLevel.ERROR) || this; _this.value = value; return _this; } return ReplayErrorAPIUndefined; }(ReplayError)); exports.ReplayErrorAPIUndefined = ReplayErrorAPIUndefined; var ReplayErrorAPIException = /** @class */ (function (_super) { __extends(ReplayErrorAPIException, _super); function ReplayErrorAPIException() { return _super.call(this, ReplayErrorType.APIException, ReplayErrorLevel.ERROR) || this; } return ReplayErrorAPIException; }(ReplayError)); exports.ReplayErrorAPIException = ReplayErrorAPIException; var ReplayErrorEntityEmpty = /** @class */ (function (_super) { __extends(ReplayErrorEntityEmpty, _super); function ReplayErrorEntityEmpty(values) { var _this = _super.call(this, ReplayErrorType.EntityEmpty, ReplayErrorLevel.ERROR) || this; _this.values = values; return _this; } return ReplayErrorEntityEmpty; }(ReplayError)); exports.ReplayErrorEntityEmpty = ReplayErrorEntityEmpty; var EntityUnexpectedMultivalue = /** @class */ (function (_super) { __extends(EntityUnexpectedMultivalue, _super); function EntityUnexpectedMultivalue(entityName) { var _this = _super.call(this, ReplayErrorType.EntityUnexpectedMultivalue, ReplayErrorLevel.WARNING) || this; _this.entityName = entityName; return _this; } return EntityUnexpectedMultivalue; }(ReplayError)); exports.EntityUnexpectedMultivalue = EntityUnexpectedMultivalue; var ReplayErrorActionUnavailable = /** @class */ (function (_super) { __extends(ReplayErrorActionUnavailable, _super); function ReplayErrorActionUnavailable(lastUserInput) { var _this = _super.call(this, ReplayErrorType.ActionUnavailable, ReplayErrorLevel.ERROR) || this; _this.lastUserInput = lastUserInput; return _this; } return ReplayErrorActionUnavailable; }(ReplayError)); exports.ReplayErrorActionUnavailable = ReplayErrorActionUnavailable; var ReplayErrorEntityDiscrepancy = /** @class */ (function (_super) { __extends(ReplayErrorEntityDiscrepancy, _super); function ReplayErrorEntityDiscrepancy(lastUserInput, originalEntities, newEntities) { var _this = _super.call(this, ReplayErrorType.EntityDiscrepancy, ReplayErrorLevel.ERROR) || this; _this.lastUserInput = lastUserInput; _this.originalEntities = originalEntities; _this.newEntities = newEntities; return _this; } return ReplayErrorEntityDiscrepancy; }(ReplayError)); exports.ReplayErrorEntityDiscrepancy = ReplayErrorEntityDiscrepancy; var ReplayErrorActionAfterWait = /** @class */ (function (_super) { __extends(ReplayErrorActionAfterWait, _super); function ReplayErrorActionAfterWait() { return _super.call(this, ReplayErrorType.ActionAfterWait, ReplayErrorLevel.ERROR) || this; } return ReplayErrorActionAfterWait; }(ReplayError)); exports.ReplayErrorActionAfterWait = ReplayErrorActionAfterWait; var ReplayErrorTwoUserInputs = /** @class */ (function (_super) { __extends(ReplayErrorTwoUserInputs, _super); function ReplayErrorTwoUserInputs() { return _super.call(this, ReplayErrorType.TwoUserInputs, ReplayErrorLevel.ERROR) || this; } return ReplayErrorTwoUserInputs; }(ReplayError)); exports.ReplayErrorTwoUserInputs = ReplayErrorTwoUserInputs; var ReplayErrorInputAfterNonWait = /** @class */ (function (_super) { __extends(ReplayErrorInputAfterNonWait, _super); function ReplayErrorInputAfterNonWait() { return _super.call(this, ReplayErrorType.InputAfterNonWait, ReplayErrorLevel.ERROR) || this; } return ReplayErrorInputAfterNonWait; }(ReplayError)); exports.ReplayErrorInputAfterNonWait = ReplayErrorInputAfterNonWait; var ReplayErrorException = /** @class */ (function (_super) { __extends(ReplayErrorException, _super); function ReplayErrorException() { return _super.call(this, ReplayErrorType.Exception, ReplayErrorLevel.BLOCKING) || this; } return ReplayErrorException; }(ReplayError)); exports.ReplayErrorException = ReplayErrorException; var ReplayErrorTranscriptValidation = /** @class */ (function (_super) { __extends(ReplayErrorTranscriptValidation, _super); function ReplayErrorTranscriptValidation() { return _super.call(this, ReplayErrorType.TranscriptValidationError, ReplayErrorLevel.ERROR) || this; } return ReplayErrorTranscriptValidation; }(ReplayError)); exports.ReplayErrorTranscriptValidation = ReplayErrorTranscriptValidation; // TODO: Why do we have two types for the same errors? // This makes it possible for them to be mismatched. // E.g. API exception error could be a InputAfterNoWait error which should be impossible var ReplaySetEntityException = /** @class */ (function (_super) { __extends(ReplaySetEntityException, _super); function ReplaySetEntityException() { return _super.call(this, ReplayErrorType.SetEntityException, ReplayErrorLevel.ERROR) || this; } return ReplaySetEntityException; }(ReplayError)); exports.ReplaySetEntityException = ReplaySetEntityException; var ReplayDispatchException = /** @class */ (function (_super) { __extends(ReplayDispatchException, _super); function ReplayDispatchException() { return _super.call(this, ReplayErrorType.DispatchException, ReplayErrorLevel.ERROR) || this; } return ReplayDispatchException; }(ReplayError)); exports.ReplayDispatchException = ReplayDispatchException; var ReplayChangeModelException = /** @class */ (function (_super) { __extends(ReplayChangeModelException, _super); function ReplayChangeModelException() { return _super.call(this, ReplayErrorType.ChangeModelException, ReplayErrorLevel.ERROR) || this; } return ReplayChangeModelException; }(ReplayError)); exports.ReplayChangeModelException = ReplayChangeModelException; //# sourceMappingURL=ReplayError.js.map