mirror of
https://github.com/r-ca/kidshift-skills.git
synced 2024-10-25 17:14:03 +00:00
rename
This commit is contained in:
parent
8aa9a7717c
commit
653e5cbcb8
46
src/apl/ChildListDirective.ts
Normal file
46
src/apl/ChildListDirective.ts
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
|
||||||
|
import { Directive } from "ask-sdk-model";
|
||||||
|
|
||||||
|
const DOCUMENT_ID = "child_list";
|
||||||
|
|
||||||
|
class ChildListDirective {
|
||||||
|
|
||||||
|
public createDirectivePayload = (dataSources = {}, tokenId = "documentToken"): Directive => {
|
||||||
|
return {
|
||||||
|
type: "Alexa.Presentation.APL.RenderDocument",
|
||||||
|
token: tokenId,
|
||||||
|
document: {
|
||||||
|
type: "Link",
|
||||||
|
src: "doc://alexa/apl/documents/" + DOCUMENT_ID
|
||||||
|
},
|
||||||
|
datasources: dataSources
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public createDataSources = (listItems: string[]) => {
|
||||||
|
const datasource = {
|
||||||
|
"textListData": {
|
||||||
|
"type": "object",
|
||||||
|
"objectId": "textListSample",
|
||||||
|
"backgroundImage": {
|
||||||
|
"contentDescription": null,
|
||||||
|
"smallSourceUrl": null,
|
||||||
|
"largeSourceUrl": null,
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"url": "https://d2o906d8ln7ui1.cloudfront.net/images/templates_v3/textlist/AlexaTextListBackground_Dark.png",
|
||||||
|
"size": "large"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"title": "子供を選択",
|
||||||
|
"listItems": listItems,
|
||||||
|
"logoUrl": "https://d2o906d8ln7ui1.cloudfront.net/images/templates_v3/logo/logo-modern-botanical-white.png"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return datasource;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default new ChildListDirective();
|
Loading…
Reference in New Issue
Block a user