@bavard/agent-config
Advanced tools
Comparing version 0.0.33 to 0.0.34
{ | ||
"name": "@bavard/agent-config", | ||
"version": "0.0.33", | ||
"version": "0.0.34", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
import { EAgentActionTypes, IAgentAction } from '../types'; | ||
import { IResponseOption, IHyperlinkOption } from '../response-options'; | ||
import { IResponseOption, IHyperlinkOption, EResponseOptionTypes } from '../response-options'; | ||
import { isDeepStrictEqual } from 'util'; | ||
@@ -16,3 +16,3 @@ | ||
addHyperlinkOption(text: string, targetLink: string): void { | ||
const option: IHyperlinkOption = { type: 'HYPERLINK', text, targetLink }; | ||
const option: IHyperlinkOption = { type: EResponseOptionTypes.HYPERLINK, text, targetLink }; | ||
this.options.push(option); | ||
@@ -19,0 +19,0 @@ } |
@@ -1,5 +0,10 @@ | ||
type OptionType = 'TEXT' | 'IMAGE' | 'HYPERLINK' | 'OTHER_OPTIONS'; | ||
export enum EResponseOptionTypes { | ||
TEXT = 'TEXT', | ||
IMAGE = 'IMAGE', | ||
HYPERLINK = 'HYPERLINK', | ||
OTHER_OPTIONS = 'OTHER_OPTIONS' | ||
} | ||
interface IResponseOptionBase { | ||
type: OptionType; | ||
type: EResponseOptionTypes; | ||
intent?: string; | ||
@@ -9,3 +14,3 @@ } | ||
export interface ITextOption extends IResponseOptionBase { | ||
type: 'TEXT'; | ||
type: EResponseOptionTypes.TEXT; | ||
text: string; | ||
@@ -16,3 +21,3 @@ intent: string; | ||
export interface IImageOption extends IResponseOptionBase { | ||
type: 'IMAGE'; | ||
type: EResponseOptionTypes.IMAGE; | ||
intent: string; | ||
@@ -25,3 +30,3 @@ text: string; | ||
export interface IHyperlinkOption extends IResponseOptionBase { | ||
type: 'HYPERLINK'; | ||
type: EResponseOptionTypes.HYPERLINK; | ||
text: string; | ||
@@ -34,6 +39,6 @@ targetLink: string; | ||
export class TextOption implements ITextOption { | ||
public type: 'TEXT'; | ||
public type: EResponseOptionTypes.TEXT; | ||
constructor(public intent: string, public text: string) { | ||
this.type = 'TEXT'; | ||
this.type = EResponseOptionTypes.TEXT; | ||
} | ||
@@ -43,3 +48,3 @@ } | ||
export class ImageOption implements IImageOption { | ||
public type: 'IMAGE'; | ||
public type: EResponseOptionTypes.IMAGE; | ||
@@ -52,3 +57,3 @@ constructor( | ||
) { | ||
this.type = 'IMAGE'; | ||
this.type = EResponseOptionTypes.IMAGE; | ||
} | ||
@@ -58,7 +63,7 @@ } | ||
export class HyperlinkOption implements IHyperlinkOption { | ||
public type: 'HYPERLINK'; | ||
public type: EResponseOptionTypes.HYPERLINK; | ||
constructor(public text: string, public targetLink: string) { | ||
this.type = 'HYPERLINK'; | ||
this.type = EResponseOptionTypes.HYPERLINK; | ||
} | ||
} |
78000
39
2515