Skip to content

Instantly share code, notes, and snippets.

View dileephell's full-sized avatar
🎯
Focusing

Dileep Singh dileephell

🎯
Focusing
View GitHub Profile
@dileephell
dileephell / lambda.js
Created March 16, 2018 12:28
Undefined
Response:
{
"errorMessage": "Cannot read property 'isValid' of undefined",
"errorType": "TypeError",
"stackTrace": [
"getWeatherUpdate (/var/task/index.js:117:29)",
"exports.handler.err (/var/task/index.js:148:2)"
]
}
@dileephell
dileephell / lambda.js
Created March 21, 2018 11:17
Lambda api
function elicitSlot(sessionAttributes, intentName, slots, slotToElicit, message, responseCard) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitSlot',
intentName,
slots,
slotToElicit,
message,
@dileephell
dileephell / lambda.js
Created March 28, 2018 08:27
dataApi.js
function elicitSlot(sessionAttributes, intentName, slots, slotToElicit, message, responseCard) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitSlot',
intentName,
slots,
slotToElicit,
message,
@dileephell
dileephell / lambda.js
Last active April 5, 2018 15:40
weatherApi.js
function elicitSlot(sessionAttributes, intentName, slots, slotToElicit, message, responseCard) {
return {
sessionAttributes,
dialogAction: {
type: 'ElicitSlot',
intentName,
slots,
slotToElicit,
message,
@dileephell
dileephell / wirt.js
Last active April 16, 2018 16:06
wit
var express = require('express');
var app = express();
var path = require('path');
var chatflow = require('./chatflow.js');
const fs = require('fs');
const request = require('request');
const url = require('url');
@dileephell
dileephell / chatflow.js
Last active April 18, 2018 11:20
chatflow.js
var DataTable = {
source: [],
setEntry: function(i,j,e) {
var o ;
if( !!! ( o = this.source[i] ) ) o = this.source[i] = [] ;
o[j] = e ;
return this ;
},
getEntry: function(i,j) {
var o, e = null ;
@dileephell
dileephell / app.js
Last active April 18, 2018 13:02
app.js
var express = require('express');
var app = express();
var path = require('path');
require('./chatflow.js').DataTable;
var path = require("path");
const fs = require('fs');
const request = require('request');
@dileephell
dileephell / index.html
Created April 18, 2018 13:03
index.html
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" media="all" href="index.css">
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
</head>
function getNextMsgId(intent) {
console.log("Inside getNextMsgId method " + prevMsg );
for (var c in chatFlow.DataTableArray) {
console.log("1: "+String(chatFlow.DataTableArray[0][1])+" 2: "+String(prevMsg));
if (String(prevMsg) in String(chatFlow.DataTableArray.indexOf([0][1]) !== 1)) {
console.log("Inside For In Loop " + prevMsg );
console.log("Inside For In Loop" + chatFlow.DataTableArray.indexOf([0][1]));
console.log("Inside For In Loop" + chatFlow.DataTableArray[2]);
chatFlow.DataTableArray[0][4]=msg;
var express = require('express');
var app = express();
var path = require('path');
//require('./chatflow.js').DataTable;
var chatFlow=require('./chatflow.js');
const fs = require('fs');
const request = require('request');
const url = require('url');
const https = require('https');