Bug 425447 - Provider additional indexes for content assist - redis and mysql
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/indexFiles/mysqlIndex.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/indexFiles/mysqlIndex.js
new file mode 100644
index 0000000..5033560
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/indexFiles/mysqlIndex.js
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2013 IBM Corporation.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ ******************************************************************************/
+ /*global define */
+define('javascript/contentAssist/indexFiles/mysqlIndex', [], 
+function () {
+	return {
+		"!name": "node-mysql",
+  		"!define": {
+    		"!node": {
+		  		"Connection" : {
+		    		"createQuery": "fn(sql: String, values: Object, cb: fn()) -> Query",
+		    		"prototype": {
+		      			"connect": "fn(cb: fn())",
+				      	"changeUser": "fn(options: Object, cb: fn())",
+				      	"beginTransaction": "fn(cb: fn()) -> String",
+				      	"commit": "fn(cb: fn()) -> String",
+				      	"rollback": "fn(cb: fn()) -> String",
+				      	"query": "fn(sql: Object, values: ?, cb: ?)",
+				      	"ping": "fn(cb: fn())",
+				      	"statistics": "fn(cb: fn())",
+				      	"end": "fn(cb: fn())",
+				      	"destroy": "fn()",
+				      	"pause": "fn()",
+				      	"resume": "fn()",
+				      	"escape": "fn(value: String) -> String",
+				      	"format": "fn(sql: Object, values: [String])",
+				      	"_handleNetworkError": "fn(err: Error)",
+				      	"_handleProtocolError": "fn(err: Error)",
+				      	"_handleProtocolDrain": "fn()",
+				      	"_handleProtocolConnect": "fn()",
+				      	"_handleProtocolHandshake": "fn()",
+				      	"_handleProtocolEnd": "fn(err: Error)",
+				      	"_implyConnect": "fn()"
+		    		},
+		  		},
+		  		"Connection_obj" : {
+		  			"!type": "fn(options: Object)",
+		  		},
+      			"Pool": {
+        			"prototype": {
+          				"getConnection": "fn(cb: fn(err: Error, conn: Connection))",
+          				"releaseConnection": "fn(connection: Connection)",
+          				"end": "fn(cb: fn(err: Error)) -> Object",
+          				"query": "fn(sql: String, values: Object, cb: fn())",
+          				"_removeConnection": {
+            				"!type": "fn(connection: Connection)",
+          				},
+          				"escape": "fn(value: String) -> String"
+        			}
+     			},
+     			"Pool_obj" : {
+     				"!type": "fn(options: Object)"
+     			},
+      			"PoolConfig": {
+      				"!type" : "fn(options: Object)"
+      			},
+      			"ConnectionConfig": {
+        			"mergeFlags": "fn(default_flags: Object, user_flags: [String]) -> Number",
+        			"getDefaultFlags": {
+          				"!type": "fn(options: Object) -> [String]",
+        			},
+        			"getCharsetNumber": "fn(charset: String)",
+        			"parseUrl": {
+		          		"!type": "fn(url: String) -> Object",
+        			}
+      			},
+      			"ConnectionConfig_obj" : {
+      				"!type": "fn(options: Object)",
+      				"host": "String",
+				    "port": "String",
+				    "database": "String",
+				    "user": "String",
+				    "password": "String"
+      			},
+      			"PoolCluster": {
+        			"prototype": {
+		          		"of": {
+			            	"!type": "fn(pattern: String, selector: String) -> Object",
+			        	},
+		          		"add": "fn(id: String, config: String)",
+		          		"getConnection": "fn(pattern: String, selector: String, cb: String)",
+		          		"end": "fn()",
+		          		"_findNodeIds": {
+		            		"!type": "fn(pattern: String) -> Object",
+		          		},
+		          		"_getNode": {
+		            		"!type": "fn(id: String) -> Object",
+		          		},
+		          		"_increaseErrorCount": {
+		            		"!type": "fn(node: Object)",
+		          		},
+		          		"_decreaseErrorCount": {
+		            		"!type": "fn(node: Object)",
+		          		},
+		          		"_getConnection": {
+		            		"!type": "fn(node: Object, cb: fn(err: +Error, connection: String))",
+		          		},
+		          		"_clearFindCaches": "fn()"
+		        	},
+		        	"_canRetry": "Boolean",
+		        	"_removeNodeErrorCount": "Number",
+		        	"_defaultSelector": "String",
+		        	"_closed": "Boolean",
+		        	"_lastId": "Number",
+		        	"_nodes": "Object",
+		        	"_serviceableNodeIds": "[String]",
+		        	"_namespaces": "Object",
+		        	"_findCaches": "Object"
+		      	},
+		      	"PoolCluster_obj" : {
+		      		"!type": "fn(config: Object)"
+		      	},
+      			"PoolConnection": {
+			    	"prototype": {
+			        	"release": "fn()",
+			          	"_realEnd": {
+			            	"!type": "fn(cb: fn(err: Error))",
+			            	"!doc": "TODO: Remove this when we are removing PoolConnection#end"
+			          	},
+			          	"end": "fn()",
+			          	"destroy": "fn()",
+			          	"_removeFromPool": "fn(connection:PoolConnection)"
+			        }
+			    },
+			    "PoolConnection_obj" : {
+			    	"!type": "fn(pool: Pool, options: Object)"
+			    },
+      			"MySQL_obj": {
+        			"createConnection": "fn(config: Object) -> Connection",
+        			"createPool": "fn(config: Object) -> Pool",
+        			"createPoolCluster": "fn(config: Object) -> PoolCluster",
+        			"createQuery": "fn(sql: String, values: Object, cb: Object) -> !0",
+        			"Types": "Types",
+        			"escape": "fn(val: String, stringifyObjects: Boolean, timeZone: String) -> String",
+        			"escapeId": "fn(val: String, forbidQualified: Boolean) -> String",
+        			"format": "fn(sql: String, values: [String], stringifyObjects: Boolean, timeZone: String)"
+      			},
+      			"Types": {
+			        "DECIMAL": "Number",
+			        "TINY": "Number",
+			        "SHORT": "Number",
+			        "LONG": "Number",
+			        "FLOAT": "Number",
+			        "DOUBLE": "Number",
+			        "NULL": "Number",
+			        "TIMESTAMP": "Number",
+			        "LONGLONG": "Number",
+			        "INT24": "Number",
+			        "DATE": "Number",
+			        "TIME": "Number",
+			        "DATETIME": "Number",
+			        "YEAR": "Number",
+			        "NEWDATE": "Number",
+			        "VARCHAR": "Number",
+			        "BIT": "Number",
+			        "NEWDECIMAL": "Number",
+			        "ENUM": "Number",
+			        "SET": "Number",
+			        "TINY_BLOB": "Number",
+			        "MEDIUM_BLOB": "Number",
+			        "LONG_BLOB": "Number",
+			        "BLOB": "Number",
+			        "VAR_STRING": "Number",
+			        "STRING": "Number",
+			        "GEOMETRY": "Number"
+			    },
+			    "Query": {
+        			"prototype": {
+          				"start": "fn()",
+          				"determinePacket": "fn(firstByte: Number, parser: Object)",
+          				"OkPacket": "fn(packet: Object)",
+          				"ErrorPacket": "fn(packet: Object)",
+          				"ResultSetHeaderPacket": "fn(packet: Object)",
+          				"FieldPacket": "fn(packet: Object)",
+          				"EofPacket": "fn(packet: Object)",
+          				"_handleFinalResultPacket": "fn(packet: Object)",
+          				"RowDataPacket": "fn(packet: Object, parser: ?, connection: Connection)",
+          				"_sendLocalDataFile": "fn(path: String)",
+          				"stream": "fn(options: Object) -> Object"
+        			}
+        		},
+        		"Query_obj" : {
+        			"!type": "fn(options: Object, callback: fn())"
+        		},
+			    "SqlString": {
+			      	"escapeId": "fn(val: Object, forbidQualified: Boolean) -> String",
+			      	"escape": "fn(val: String, stringifyObjects: Boolean, timeZone: String) -> String",
+			      	"arrayToList": "fn(array: String, timeZone: String)",
+			      	"format": "fn(sql: String, values: [Object], stringifyObjects: Object, timeZone: String)",
+			      	"dateToString": "fn(date: String, timeZone: String) -> String",
+			      	"bufferToString": "fn(buffer: String) -> String",
+			      	"objectToValues": "fn(object: String, timeZone: String) -> String"
+			    }
+    		},
+  		}
+}});
\ No newline at end of file
diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/indexFiles/redisIndex.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/indexFiles/redisIndex.js
new file mode 100644
index 0000000..1e13f8f
--- /dev/null
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/contentAssist/indexFiles/redisIndex.js
@@ -0,0 +1,332 @@
+/*******************************************************************************
+ * @license
+ * Copyright (c) 2013 IBM Corporation.
+ * All rights reserved. This program and the accompanying materials are made
+ * available under the terms of the Eclipse Public License v1.0
+ * (http://www.eclipse.org/legal/epl-v10.html), and the Eclipse Distribution
+ * License v1.0 (http://www.eclipse.org/org/documents/edl-v10.html).
+ *
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ ******************************************************************************/
+ /*global define */
+define('javascript/contentAssist/indexFiles/redisIndex', [], 
+function () {
+	return {
+		"!name": "redis",
+		"this": "<top>",
+		"global": "<top>",
+		"RedisClient" : "redis.RedisClient",
+		"!define": {
+			"!node": {
+				"redis": {
+	        		"debug_mode": {
+	          			"!type": "Boolean",
+	          			"!doc": "can set this to true to enable for all connections"
+	      			},
+	        		"createClient": {
+			        	"!type": "fn(port_arg: Number, host_arg: String, options: Object) -> RedisClient",
+			        },
+	        		"print": "fn(err: Error, reply: Object)",
+	        		"RedisClient": {
+	          			"prototype": {
+	            			"initialize_retry_vars": "fn()",
+	            			"unref": "fn()",
+	            			"flush_and_error": {
+	              				"!type": "fn(message: String)",
+	              				"!doc": "flush offline_queue and command_queue, erroring any items with a callback first"
+	            			},
+		            		"on_error": "fn(msg: String)",
+		            		"do_auth": "fn()",
+				            "on_connect": "fn()",
+				            "init_parser": "fn()",
+				            "on_ready": "fn()",
+				            "on_info_cmd": "fn(err: Error, res: Object)",
+				            "ready_check": "fn()",
+				            "send_offline_queue": "fn()",
+				            "connection_gone": "fn(why: String)",
+				            "on_data": "fn(data: Object)",
+				            "return_error": "fn(err: Error)",
+				            "return_reply": "fn(reply: Object)",
+				            "send_command": "fn(command: String, args: Object, callback: fn()) -> Object",
+				            "pub_sub_command": "fn(command_obj: Object)",
+				            "end": "fn()",
+				            "select": {
+				            	"!type": "fn(db: Object, callback: fn())",
+				            	"!doc": "store db in this.select_db to restore it on reconnect"
+				            },
+				            "auth": {
+				            	"!type": "fn()",
+				            	"!doc": "Stash auth for connect and reconnect."
+				            },
+				            "hmget": "fn(arg1: Object, arg2: Object, arg3: Object)",
+				            "hmset": "fn(args: Object, callback: fn())",
+				            "multi": "fn(args: Object) -> Multi",
+				            "MULTI": {
+				              "!type": "fn(args: Object) -> Multi",
+				            },
+				            "EVAL": "fn()",
+				            "SELECT": "fn()",
+				            "AUTH": "fn()",
+				            "HMGET": "fn()",
+				            "HMSET": "fn()",
+				            "eval": "fn()"
+	          			},
+				        "stream": "Object",
+				        "options": {
+				        	"socket_nodelay": "Boolean"
+				        },
+				        "connection_id": "Number",
+				        "connected": "Boolean",
+				        "ready": "Boolean",
+				        "connections": "Number",
+				        "should_buffer": "Boolean",
+				        "command_queue_high_water": "Number",
+				        "command_queue_low_water": "Number",
+				        "max_attempts": "Number",
+				        "command_queue": "Queue",
+				        "commands_sent": "Number",
+				        "enable_offline_queue": "Boolean",
+				        "pub_sub_mode": "Boolean",
+				        "subscription_set": "Object",
+				        "monitoring": "Boolean",
+				        "closing": "Boolean",
+				        "server_info": {
+				        	"versions": "[Number]",
+				            "!doc": "expose info key/vals to users"
+				        },
+		        		"auth_pass": "Number",
+		        		"parser_module": {
+		          			"debug_mode": "Boolean"
+		        		},
+				        "old_state": {
+				        	"monitoring": "Boolean",
+				            "pub_sub_mode": "Boolean"
+				        },
+				        "retry_timer": "Object",
+				        "retry_totaltime": "Number",
+				        "retry_delay": "Number",
+				        "retry_backoff": "Number",
+				        "attempts": "Number",
+				        "send_anyway": "Boolean",
+				        "auth_callback": "Number",
+				        "emitted_end": "Boolean",
+				        "reply_parser": {
+				        	"!doc": "return_buffers sends back Buffers from parser to callback."
+				        },
+				        "port": "Number",
+				        "host": "String",
+				       	"offline_queue": "Queue"
+			      	},
+			      	"RedisClient_obj" : {
+			      		"!type": "fn(stream: Object, options: Object)",	
+			      	},
+				    "Multi": {
+				    	"prototype": {
+				            "hmset": {
+				              "!type": "fn() -> Multi",
+				            },
+			            	"exec": "fn(callback: fn()) -> fn(err: Error, replies: Object)",
+			            	"HMSET": "fn()",
+			            	"EXEC": "fn()"
+			        	},
+	          			"_client": "RedisClient",
+	          			"queue": "[[MULTI]]",
+	        		},
+	        		"Multi_obj" : {
+	        			"!type" : "fn(client: RedisClient, args: Object)"
+	        		},
+	      		},
+		      	"Queue": {
+		        	"prototype": {
+			        	"shift": "fn() -> Object",
+			        	"push": "fn(item: Object) -> Number",
+			        	"forEach": "fn(fn: fn(), thisv: Object)",
+			        	"getLength": "fn() -> Number"
+			        }
+		      	},
+		      	"Queue_obj" : {
+		      		"!type": "fn()"	
+		      	},
+		      	"Commands": {
+				    "append" : "String",
+				    "auth" : "String",
+				    "bgrewriteaof" : "String",
+				    "bgsave" : "String",
+				    "bitcount" : "String",
+				    "bitop" : "String",
+				    "blpop" : "String",
+				    "brpop" : "String",
+				    "brpoplpush" : "String",
+				    "client kill" : "String",
+				    "client list" : "String",
+				    "client getname" : "String",
+				    "client setname" : "String",
+				    "config get" : "String",
+				    "config rewrite" : "String",
+				    "config set" : "String",
+				    "config resetstat" : "String",
+				    "dbsize" : "String",
+				    "debug object" : "String",
+				    "debug segfault" : "String",
+				    "decr" : "String",
+				    "decrby" : "String",
+				    "del" : "String",
+				    "discard" : "String",
+				    "dump" : "String",
+				    "echo" : "String",
+				    "eval" : "String",
+				    "evalsha" : "String",
+				    "exec" : "String",
+				    "exists" : "String",
+				    "expire" : "String",
+				    "expireat" : "String",
+				    "flushall" : "String",
+				    "flushdb" : "String",
+				    "get" : "String",
+				    "getbit" : "String",
+				    "getrange" : "String",
+				    "getset" : "String",
+				    "hdel" : "String",
+				    "hexists" : "String",
+				    "hget" : "String",
+				    "hgetall" : "String",
+				    "hincrby" : "String",
+				    "hincrbyfloat" : "String",
+				    "hkeys" : "String",
+				    "hlen" : "String",
+				    "hmget" : "String",
+				    "hmset" : "String",
+				    "hset" : "String",
+				    "hsetnx" : "String",
+				    "hvals" : "String",
+				    "incr" : "String",
+				    "incrby" : "String",
+				    "incrbyfloat" : "String",
+				    "info" : "String",
+				    "keys" : "String",
+				    "lastsave" : "String",
+				    "lindex" : "String",
+				    "linsert" : "String",
+				    "llen" : "String",
+				    "lpop" : "String",
+				    "lpush" : "String",
+				    "lpushx" : "String",
+				    "lrange" : "String",
+				    "lrem" : "String",
+				    "lset" : "String",
+				    "ltrim" : "String",
+				    "mget" : "String",
+				    "migrate" : "String",
+				    "monitor" : "String",
+				    "move" : "String",
+				    "mset" : "String",
+				    "msetnx" : "String",
+				    "multi" : "String",
+				    "object" : "String",
+				    "persist" : "String",
+				    "pexpire" : "String",
+				    "pexpireat" : "String",
+				    "ping" : "String",
+				    "psetex" : "String",
+				    "psubscribe" : "String",
+				    "pubsub" : "String",
+				    "pttl" : "String",
+				    "publish" : "String",
+				    "punsubscribe" : "String",
+				    "quit" : "String",
+				    "randomkey" : "String",
+				    "rename" : "String",
+				    "renamenx" : "String",
+				    "restore" : "String",
+				    "rpop" : "String",
+				    "rpoplpush" : "String",
+				    "rpush" : "String",
+				    "rpushx" : "String",
+				    "sadd" : "String",
+				    "save" : "String",
+				    "scard" : "String",
+				    "script exists" : "String",
+				    "script flush" : "String",
+				    "script kill" : "String",
+				    "script load" : "String",
+				    "sdiff" : "String",
+				    "sdiffstore" : "String",
+				    "select" : "String",
+				    "set" : "String",
+				    "setbit" : "String",
+				    "setex" : "String",
+				    "setnx" : "String",
+				    "setrange" : "String",
+				    "shutdown" : "String",
+				    "sinter" : "String",
+				    "sinterstore" : "String",
+				    "sismember" : "String",
+				    "slaveof" : "String",
+				    "slowlog" : "String",
+				    "smembers" : "String",
+				    "smove" : "String",
+				    "sort" : "String",
+				    "spop" : "String",
+				    "srandmember" : "String",
+				    "srem" : "String",
+				    "strlen" : "String",
+				    "subscribe" : "String",
+				    "sunion" : "String",
+				    "sunionstore" : "String",
+				    "sync" : "String",
+				    "time" : "String",
+				    "ttl" : "String",
+				    "type" : "String",
+				    "unsubscribe" : "String",
+				    "unwatch" : "String",
+				    "watch" : "String",
+				    "zadd" : "String",
+				    "zcard" : "String",
+				    "zcount" : "String",
+				    "zincrby" : "String",
+				    "zinterstore" : "String",
+				    "zrange" : "String",
+				    "zrangebyscore" : "String",
+				    "zrank" : "String",
+				    "zrem" : "String",
+				    "zremrangebyrank" : "String",
+				    "zremrangebyscore" : "String",
+				    "zrevrange" : "String",
+				    "zrevrangebyscore" : "String",
+				    "zrevrank" : "String",
+				    "zscore" : "String",
+				    "zunionstore" : "String",
+				    "scan" : "String",
+				    "sscan" : "String",
+				    "hscan" : "String",
+				    "zscan" : "String"
+		      	},
+		      	"HiredisReplyParser": {
+		        	"debug_mode": "Boolean",
+		        	"name": "String",
+	          		"prototype": {
+	            		"reset": "fn()",
+	            		"execute": "fn(data: Object)"
+	            	}
+		        }
+		    },
+	        "Parser": {
+	        	"name": "String",
+	        	"debug_mode": "Boolean",
+          		"prototype": {
+            		"_parseResult": "fn(type: String)",
+            		"execute": "fn(buffer: String)",
+		            "append": "fn(newBuffer: String)",
+		            "parseHeader": "fn() -> String",
+		            "_packetEndOffset": "fn() -> Number",
+		            "_bytesRemaining": "fn() -> Number",
+		            "parser_error": "fn(message: String)",
+		            "send_error": "fn(reply: Object)",
+		            "send_reply": "fn(reply: Object)"
+          		},
+          		"!type": "fn(options: Object)"
+	        }
+  		}
+  	}
+});
\ No newline at end of file