This repository was archived by the owner on May 28, 2024. It is now read-only.
File tree 3 files changed +44
-0
lines changed
3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -1726,6 +1726,11 @@ export interface GoogleActionsV2Input {
1726
1726
* A list of provided argument values for the input requested by the Action.
1727
1727
*/
1728
1728
arguments ?: GoogleActionsV2Argument [ ]
1729
+ /**
1730
+ * Opaque context set in the interactive canvas web app for all subsequent
1731
+ * intents
1732
+ */
1733
+ canvasState ?: ApiClientObjectMap < any >
1729
1734
/**
1730
1735
* Indicates the user's intent. For the first conversation turn, the intent
1731
1736
* will refer to the triggering intent for the Action. For
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright 2019 Google Inc. All Rights Reserved.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import * as Api from '../api/v2'
18
+ import { JsonObject } from '../../../common'
19
+
20
+ export class Canvas {
21
+ /**
22
+ * Gets the canvas state
23
+ *
24
+ * Accessible using `conv.canvas.state`
25
+ * @public
26
+ */
27
+ state ?: JsonObject
28
+
29
+ /** @hidden */
30
+ constructor ( user : Api . GoogleActionsV2Input ) {
31
+ this . state = user . canvasState
32
+ }
33
+ }
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ import { Input } from './input'
39
39
import { JsonObject } from '../../../common'
40
40
import { ServiceBaseApp , AppOptions } from '../../../assistant'
41
41
import { OAuth2Client } from 'google-auth-library'
42
+ import { Canvas } from './canvas'
42
43
43
44
/** @public */
44
45
export type Intent =
@@ -222,6 +223,9 @@ export class Conversation<TUserStorage> {
222
223
/** @public */
223
224
device : Device
224
225
226
+ /** @public */
227
+ canvas : Canvas
228
+
225
229
/**
226
230
* Gets the unique conversation ID. It's a new ID for the initial query,
227
231
* and stays the same until the end of the conversation.
@@ -328,6 +332,8 @@ export class Conversation<TUserStorage> {
328
332
329
333
this . device = new Device ( this . request . device )
330
334
335
+ this . canvas = new Canvas ( input )
336
+
331
337
this . id = conversation . conversationId !
332
338
333
339
this . type = conversation . type !
You can’t perform that action at this time.
0 commit comments