1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | import { ApiClientObjectMap, JsonObject } from '../../../common';
|
17 | import * as ActionsApi from '../../actionssdk/api/v2';
|
18 | export interface DialogflowV1OriginalRequest {
|
19 | source?: string;
|
20 | version?: string;
|
21 | data?: ActionsApi.GoogleActionsV2AppRequest;
|
22 | }
|
23 | export interface DialogflowV1Parameters {
|
24 | [parameter: string]: string | Object | undefined;
|
25 | }
|
26 | export interface DialogflowV1Context {
|
27 | name?: string;
|
28 | parameters?: DialogflowV1Parameters;
|
29 | lifespan?: number;
|
30 | }
|
31 | export interface DialogflowV1Metadata {
|
32 | intentId?: string;
|
33 | webhookUsed?: string;
|
34 | webhookForSlotFillingUsed?: string;
|
35 | nluResponseTime?: number;
|
36 | intentName?: string;
|
37 | }
|
38 | export interface DialogflowV1Button {
|
39 | text?: string;
|
40 | postback?: string;
|
41 | }
|
42 | export interface DialogflowV1BaseMessage<TType extends number> {
|
43 | platform?: 'facebook' | 'kik' | 'line' | 'skype' | 'slack' | 'telegram' | 'viber';
|
44 | type?: TType;
|
45 | }
|
46 | export interface DialogflowV1MessageText extends DialogflowV1BaseMessage<0> {
|
47 | speech?: string;
|
48 | }
|
49 | export interface DialogflowV1MessageImage extends DialogflowV1BaseMessage<3> {
|
50 | imageUrl?: string;
|
51 | }
|
52 | export interface DialogflowV1MessageCard extends DialogflowV1BaseMessage<1> {
|
53 | buttons?: DialogflowV1Button[];
|
54 | imageUrl?: string;
|
55 | subtitle?: string;
|
56 | title?: string;
|
57 | }
|
58 | export interface DialogflowV1MessageQuickReplies extends DialogflowV1BaseMessage<2> {
|
59 | replies?: string[];
|
60 | title?: string;
|
61 | }
|
62 | export interface DialogflowV1MessageCustomPayload extends DialogflowV1BaseMessage<4> {
|
63 | payload?: JsonObject;
|
64 | }
|
65 | export interface DialogflowV1BaseGoogleMessage<TType extends string> {
|
66 | platform: 'google';
|
67 | type?: TType;
|
68 | }
|
69 | export interface DialogflowV1MessageSimpleResponse extends DialogflowV1BaseGoogleMessage<'simple_response'> {
|
70 | displayText?: string;
|
71 | textToSpeech?: string;
|
72 | }
|
73 | export interface DialogflowV1MessageBasicCardButtonAction {
|
74 | url?: string;
|
75 | }
|
76 | export interface DialogflowV1MessageBasicCardButton {
|
77 | openUrlAction?: DialogflowV1MessageBasicCardButtonAction;
|
78 | title?: string;
|
79 | }
|
80 | export interface DialogflowV1MessageImage {
|
81 | url?: string;
|
82 | }
|
83 | export interface DialogflowV1MessageBasicCard extends DialogflowV1BaseGoogleMessage<'basic_card'> {
|
84 | buttons?: DialogflowV1MessageBasicCardButton[];
|
85 | formattedText?: string;
|
86 | image?: DialogflowV1MessageImage;
|
87 | subtitle?: string;
|
88 | title?: string;
|
89 | }
|
90 | export interface DialogflowV1MessageOptionInfo {
|
91 | key?: string;
|
92 | synonyms?: string[];
|
93 | }
|
94 | export interface DialogflowV1MessageOptionItem {
|
95 | description?: string;
|
96 | image?: DialogflowV1MessageImage;
|
97 | optionInfo?: DialogflowV1MessageOptionInfo;
|
98 | title?: string;
|
99 | }
|
100 | export interface DialogflowV1MessageList extends DialogflowV1BaseGoogleMessage<'list_card'> {
|
101 | items?: DialogflowV1MessageOptionItem[];
|
102 | title?: string;
|
103 | }
|
104 | export interface DialogflowV1MessageSuggestion {
|
105 | title?: string;
|
106 | }
|
107 | export interface DialogflowV1MessageSuggestions extends DialogflowV1BaseGoogleMessage<'suggestion_chips'> {
|
108 | suggestions?: DialogflowV1MessageSuggestion[];
|
109 | }
|
110 | export interface DialogflowV1MessageCarousel extends DialogflowV1BaseGoogleMessage<'carousel_card'> {
|
111 | items?: DialogflowV1MessageOptionItem[];
|
112 | }
|
113 | export interface DialogflowV1MessageLinkOut extends DialogflowV1BaseGoogleMessage<'link_out_chip'> {
|
114 | destinationName?: string;
|
115 | url?: string;
|
116 | }
|
117 | export interface DialogflowV1MessageGooglePayload extends DialogflowV1BaseGoogleMessage<'custom_payload'> {
|
118 | payload?: ApiClientObjectMap<any>;
|
119 | }
|
120 | export declare type DialogflowV1Message = DialogflowV1MessageText | DialogflowV1MessageImage | DialogflowV1MessageCard | DialogflowV1MessageQuickReplies | DialogflowV1MessageCustomPayload | DialogflowV1MessageSimpleResponse | DialogflowV1MessageBasicCard | DialogflowV1MessageList | DialogflowV1MessageSuggestions | DialogflowV1MessageCarousel | DialogflowV1MessageLinkOut | DialogflowV1MessageGooglePayload;
|
121 | export interface DialogflowV1Fulfillment {
|
122 | speech?: string;
|
123 | messages?: DialogflowV1Message[];
|
124 | }
|
125 | export interface DialogflowV1Result {
|
126 | source?: string;
|
127 | resolvedQuery?: string;
|
128 | speech?: string;
|
129 | action?: string;
|
130 | actionIncomplete?: boolean;
|
131 | parameters?: DialogflowV1Parameters;
|
132 | contexts?: DialogflowV1Context[];
|
133 | metadata?: DialogflowV1Metadata;
|
134 | fulfillment?: DialogflowV1Fulfillment;
|
135 | score?: number;
|
136 | }
|
137 | export interface DialogflowV1Status {
|
138 | code?: number;
|
139 | errorType?: string;
|
140 | webhookTimedOut?: boolean;
|
141 | }
|
142 | export interface DialogflowV1WebhookRequest {
|
143 | originalRequest?: DialogflowV1OriginalRequest;
|
144 | id?: string;
|
145 | sessionId?: string;
|
146 | timestamp?: string;
|
147 | timezone?: string;
|
148 | lang?: string;
|
149 | result?: DialogflowV1Result;
|
150 | status?: DialogflowV1Status;
|
151 | }
|
152 | export interface DialogflowV1FollowupEvent {
|
153 | name?: string;
|
154 | data?: DialogflowV1Parameters;
|
155 | }
|
156 | export interface DialogflowV1WebhookResponse {
|
157 | speech?: string;
|
158 | displayText?: string;
|
159 | messages?: DialogflowV1Message[];
|
160 | data?: ApiClientObjectMap<any>;
|
161 | contextOut?: DialogflowV1Context[];
|
162 | source?: string;
|
163 | followupEvent?: DialogflowV1FollowupEvent;
|
164 | }
|