\n\n",
+ "description": "\n\n\nReturns the statistics information. The returned object contains the\nstatistics figures grouped together according to the description returned by\n*_admin/statistics-description*. For instance, to access a figure *userTime*\nfrom the group *system*, you first select the sub-object describing the\ngroup stored in *system* and in that sub-object the value for *userTime* is\nstored in the attribute of the same name.\n\nIn case of a distribution, the returned object contains the total count in\n*count* and the distribution list in *counts*. The sum (or total) of the\nindividual values is returned in *sum*.\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -2754,7 +2754,7 @@
},
"/_api/batch": {
"post": {
- "description": "\nfree style json body\n\n\n\nExecutes a batch request. A batch request can contain any number of\nother requests that can be sent to ArangoDB in isolation. The benefit of\nusing batch requests is that batching requests requires less client/server\nroundtrips than when sending isolated requests.\n\nAll parts of a batch request are executed serially on the server. The\nserver will return the results of all parts in a single response when all\nparts are finished.\n\nTechnically, a batch request is a multipart HTTP request, with\ncontent-type `multipart/form-data`. A batch request consists of an\nenvelope and the individual batch part actions. Batch part actions\nare \"regular\" HTTP requests, including full header and an optional body.\nMultiple batch parts are separated by a boundary identifier. The\nboundary identifier is declared in the batch envelope. The MIME content-type\nfor each individual batch part must be `application/x-arango-batchpart`.\n\nPlease note that when constructing the individual batch parts, you must\nuse CRLF (`\\r\\n`) as the line terminator as in regular HTTP messages.\n\nThe response sent by the server will be an `HTTP 200` response, with an\noptional error summary header `x-arango-errors`. This header contains the\nnumber of batch part operations that failed with an HTTP error code of at\nleast 400. This header is only present in the response if the number of\nerrors is greater than zero.\n\nThe response sent by the server is a multipart response, too. It contains\nthe individual HTTP responses for all batch parts, including the full HTTP\nresult header (with status code and other potential headers) and an\noptional result body. The individual batch parts in the result are\nseperated using the same boundary value as specified in the request.\n\nThe order of batch parts in the response will be the same as in the\noriginal client request. Client can additionally use the `Content-Id`\nMIME header in a batch part to define an individual id for each batch part.\nThe server will return this id is the batch part responses, too.\n\n\nExample: Sending a batch request with five batch parts:\n\n- GET /_api/version\n\n- DELETE /_api/collection/products\n\n- POST /_api/collection/products\n\n- GET /_api/collection/products/figures\n\n- DELETE /_api/collection/products\n\nThe boundary (`SomeBoundaryValue`) is passed to the server in the HTTP\n`Content-Type` HTTP header.\n*Please note the reply is not displayed all accurate.*
\nExample: Sending a batch request, setting the boundary implicitly (the server will\nin this case try to find the boundary at the beginning of the request body).
\n\n",
+ "description": "\nfree style json body\n\n\n\nExecutes a batch request. A batch request can contain any number of\nother requests that can be sent to ArangoDB in isolation. The benefit of\nusing batch requests is that batching requests requires less client/server\nroundtrips than when sending isolated requests.\n\nAll parts of a batch request are executed serially on the server. The\nserver will return the results of all parts in a single response when all\nparts are finished.\n\nTechnically, a batch request is a multipart HTTP request, with\ncontent-type `multipart/form-data`. A batch request consists of an\nenvelope and the individual batch part actions. Batch part actions\nare \"regular\" HTTP requests, including full header and an optional body.\nMultiple batch parts are separated by a boundary identifier. The\nboundary identifier is declared in the batch envelope. The MIME content-type\nfor each individual batch part must be `application/x-arango-batchpart`.\n\nPlease note that when constructing the individual batch parts, you must\nuse CRLF (`\\r\\n`) as the line terminator as in regular HTTP messages.\n\nThe response sent by the server will be an `HTTP 200` response, with an\noptional error summary header `x-arango-errors`. This header contains the\nnumber of batch part operations that failed with an HTTP error code of at\nleast 400. This header is only present in the response if the number of\nerrors is greater than zero.\n\nThe response sent by the server is a multipart response, too. It contains\nthe individual HTTP responses for all batch parts, including the full HTTP\nresult header (with status code and other potential headers) and an\noptional result body. The individual batch parts in the result are\nseperated using the same boundary value as specified in the request.\n\nThe order of batch parts in the response will be the same as in the\noriginal client request. Client can additionally use the `Content-Id`\nMIME header in a batch part to define an individual id for each batch part.\nThe server will return this id is the batch part responses, too.\n\n\nExample: Sending a batch request with five batch parts:\n\n- GET /_api/version\n\n- DELETE /_api/collection/products\n\n- POST /_api/collection/products\n\n- GET /_api/collection/products/figures\n\n- DELETE /_api/collection/products\n\nThe boundary (`SomeBoundaryValue`) is passed to the server in the HTTP\n`Content-Type` HTTP header.\n*Please note the reply is not displayed all accurate.*
\nExample: Sending a batch request, setting the boundary implicitly (the server will\nin this case try to find the boundary at the beginning of the request body).
\n\n",
"parameters": [
{
"description": "The multipart batch request, consisting of the envelope and the individual\nbatch parts.\n\n",
@@ -2789,7 +2789,7 @@
},
"/_api/collection": {
"get": {
- "description": "\n\nReturns an object with an attribute *collections* containing an\narray of all collection descriptions. The same information is also\navailable in the *names* as an object with the collection names\nas keys.\n\nBy providing the optional query parameter *excludeSystem* with a value of\n*true*, all system collections will be excluded from the response.\n\n\nExample: Return information about all collections:
\n\n",
+ "description": "\n\nReturns an object with an attribute *collections* containing an\narray of all collection descriptions. The same information is also\navailable in the *names* as an object with the collection names\nas keys.\n\nBy providing the optional query parameter *excludeSystem* with a value of\n*true*, all system collections will be excluded from the response.\n\n\nExample: Return information about all collections:
\n\n",
"parameters": [
{
"description": "Whether or not system collections should be excluded from the result.\n\n",
@@ -2812,7 +2812,7 @@
"x-filename": "Collections - js/actions/_api/collection/app.js"
},
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **journalSize**: The maximal size of a journal or datafile in bytes. The value \n must be at least `1048576` (1 MiB). (The default is a configuration parameter)\n - **keyOptions**:\n - **allowUserKeys**: if set to *true*, then it is allowed to supply own key values in the\n *_key* attribute of a document. If set to *false*, then the key generator\n will solely be responsible for generating keys and supplying own key values\n in the *_key* attribute of documents is considered an error.\n - **type**: specifies the type of the key generator. The currently available generators are\n *traditional* and *autoincrement*.\n - **increment**: increment value for *autoincrement* key generator. Not used for other key\n generator types.\n - **offset**: Initial offset value for *autoincrement* key generator.\n Not used for other key generator types.\n - **name**: The name of the collection.\n - **waitForSync**: If *true* then the data is synchronized to disk before returning from a\n document create, update, replace or removal operation. (default: false)\n - **doCompact**: whether or not the collection will be compacted (default is *true*)\n - **isVolatile**: If *true* then the collection data is kept in-memory only and not made persistent.\n Unloading the collection will cause the collection data to be discarded. Stopping\n or re-starting the server will also cause full loss of data in the\n collection. Setting this option will make the resulting collection be\n slightly faster than regular collections because ArangoDB does not\n enforce any synchronization to disk and does not calculate any CRC\n checksums for datafiles (as there are no datafiles). This option \n should therefore be used for cache-type collections only, and not \n for data that cannot be re-created otherwise.\n (The default is *false*)\n - **shardKeys**: (The default is *[ \"_key\" ]*): in a cluster, this attribute determines\n which document attributes are used to determine the target shard for documents.\n Documents are sent to shards based on the values of their shard key attributes.\n The values of all shard key attributes in a document are hashed,\n and the hash value is used to determine the target shard.\n **Note**: Values of shard key attributes cannot be changed once set.\n This option is meaningless in a single server setup.\n - **numberOfShards**: (The default is *1*): in a cluster, this value determines the\n number of shards to create for the collection. In a single\n server setup, this option is meaningless.\n - **isSystem**: If *true*, create a system collection. In this case *collection-name*\n should start with an underscore. End users should normally create non-system\n collections only. API implementors may be required to create system\n collections in very special occasions, but normally a regular collection will do.\n (The default is *false*)\n - **type**: (The default is *2*): the type of the collection to create.\n The following values for *type* are valid:\n - *2*: document collection\n - *3*: edges collection\n - **indexBuckets**: The: number of buckets into which indexes using a hash\n table are split. The default is 16 and this number has to be a\n power of 2 and less than or equal to 1024. \n For very large collections one should increase this to avoid long pauses \n when the hash table has to be initially built or resized, since buckets \n are resized individually and can be initially built in parallel. For \n example, 64 might be a sensible value for a collection with 100\n 000 000 documents. Currently, only the edge index respects this\n value, but other index types might follow in future ArangoDB versions. \n Changes (see below) are applied when the collection is loaded the next \n time.\n\n\n\n\nCreates an new collection with a given name. The request must contain an\nobject with the following attributes.\n\n\n\nExample:
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **journalSize**: The maximal size of a journal or datafile in bytes. The value \n must be at least `1048576` (1 MiB). (The default is a configuration parameter)\n - **keyOptions**:\n - **allowUserKeys**: if set to *true*, then it is allowed to supply own key values in the\n *_key* attribute of a document. If set to *false*, then the key generator\n will solely be responsible for generating keys and supplying own key values\n in the *_key* attribute of documents is considered an error.\n - **type**: specifies the type of the key generator. The currently available generators are\n *traditional* and *autoincrement*.\n - **increment**: increment value for *autoincrement* key generator. Not used for other key\n generator types.\n - **offset**: Initial offset value for *autoincrement* key generator.\n Not used for other key generator types.\n - **name**: The name of the collection.\n - **waitForSync**: If *true* then the data is synchronized to disk before returning from a\n document create, update, replace or removal operation. (default: false)\n - **doCompact**: whether or not the collection will be compacted (default is *true*)\n - **isVolatile**: If *true* then the collection data is kept in-memory only and not made persistent.\n Unloading the collection will cause the collection data to be discarded. Stopping\n or re-starting the server will also cause full loss of data in the\n collection. Setting this option will make the resulting collection be\n slightly faster than regular collections because ArangoDB does not\n enforce any synchronization to disk and does not calculate any CRC\n checksums for datafiles (as there are no datafiles). This option \n should therefore be used for cache-type collections only, and not \n for data that cannot be re-created otherwise.\n (The default is *false*)\n - **shardKeys**: (The default is *[ \"_key\" ]*): in a cluster, this attribute determines\n which document attributes are used to determine the target shard for documents.\n Documents are sent to shards based on the values of their shard key attributes.\n The values of all shard key attributes in a document are hashed,\n and the hash value is used to determine the target shard.\n **Note**: Values of shard key attributes cannot be changed once set.\n This option is meaningless in a single server setup.\n - **numberOfShards**: (The default is *1*): in a cluster, this value determines the\n number of shards to create for the collection. In a single\n server setup, this option is meaningless.\n - **isSystem**: If *true*, create a system collection. In this case *collection-name*\n should start with an underscore. End users should normally create non-system\n collections only. API implementors may be required to create system\n collections in very special occasions, but normally a regular collection will do.\n (The default is *false*)\n - **type**: (The default is *2*): the type of the collection to create.\n The following values for *type* are valid:\n - *2*: document collection\n - *3*: edges collection\n - **indexBuckets**: The: number of buckets into which indexes using a hash\n table are split. The default is 16 and this number has to be a\n power of 2 and less than or equal to 1024. \n For very large collections one should increase this to avoid long pauses \n when the hash table has to be initially built or resized, since buckets \n are resized individually and can be initially built in parallel. For \n example, 64 might be a sensible value for a collection with 100\n 000 000 documents. Currently, only the edge index respects this\n value, but other index types might follow in future ArangoDB versions. \n Changes (see below) are applied when the collection is loaded the next \n time.\n\n\n\n\nCreates an new collection with a given name. The request must contain an\nobject with the following attributes.\n\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -2842,7 +2842,7 @@
},
"/_api/collection/{collection-name}": {
"delete": {
- "description": "\n\nDrops the collection identified by *collection-name*.\n\nIf the collection was successfully dropped, an object is returned with\nthe following attributes:\n\n- *error*: *false*\n\n- *id*: The identifier of the dropped collection.\n\n\nExample: Using an identifier:
\n\n",
+ "description": "\n\nDrops the collection identified by *collection-name*.\n\nIf the collection was successfully dropped, an object is returned with\nthe following attributes:\n\n- *error*: *false*\n\n- *id*: The identifier of the dropped collection.\n\n\nExample: Using an identifier:
\n\n",
"parameters": [
{
"description": "The name of the collection to drop.\n\n",
@@ -2895,7 +2895,7 @@
},
"/_api/collection/{collection-name}/checksum": {
"get": {
- "description": "\n\nWill calculate a checksum of the meta-data (keys and optionally revision ids) and\noptionally the document data in the collection.\n\nThe checksum can be used to compare if two collections on different ArangoDB\ninstances contain the same contents. The current revision of the collection is\nreturned too so one can make sure the checksums are calculated for the same\nstate of data.\n\nBy default, the checksum will only be calculated on the *_key* system attribute\nof the documents contained in the collection. For edge collections, the system\nattributes *_from* and *_to* will also be included in the calculation.\n\nBy setting the optional query parameter *withRevisions* to *true*, then revision\nids (*_rev* system attributes) are included in the checksumming.\n\nBy providing the optional query parameter *withData* with a value of *true*,\nthe user-defined document attributes will be included in the calculation too.\n**Note**: Including user-defined attributes will make the checksumming slower.\n\nThe response is a JSON object with the following attributes:\n\n- *checksum*: The calculated checksum as a number.\n\n- *revision*: The collection revision id as a string.\n\n**Note**: this method is not available in a cluster.\n\n\nExample: Retrieving the checksum of a collection:
\n\n",
+ "description": "\n\nWill calculate a checksum of the meta-data (keys and optionally revision ids) and\noptionally the document data in the collection.\n\nThe checksum can be used to compare if two collections on different ArangoDB\ninstances contain the same contents. The current revision of the collection is\nreturned too so one can make sure the checksums are calculated for the same\nstate of data.\n\nBy default, the checksum will only be calculated on the *_key* system attribute\nof the documents contained in the collection. For edge collections, the system\nattributes *_from* and *_to* will also be included in the calculation.\n\nBy setting the optional query parameter *withRevisions* to *true*, then revision\nids (*_rev* system attributes) are included in the checksumming.\n\nBy providing the optional query parameter *withData* with a value of *true*,\nthe user-defined document attributes will be included in the calculation too.\n**Note**: Including user-defined attributes will make the checksumming slower.\n\nThe response is a JSON object with the following attributes:\n\n- *checksum*: The calculated checksum as a number.\n\n- *revision*: The collection revision id as a string.\n\n**Note**: this method is not available in a cluster.\n\n\nExample: Retrieving the checksum of a collection:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -2938,7 +2938,7 @@
},
"/_api/collection/{collection-name}/count": {
"get": {
- "description": "\n\nIn addition to the above, the result also contains the number of documents.\n**Note** that this will always load the collection into memory.\n\n- *count*: The number of documents inside the collection.\n\n\nExample: Requesting the number of documents:
\n\n",
+ "description": "\n\nIn addition to the above, the result also contains the number of documents.\n**Note** that this will always load the collection into memory.\n\n- *count*: The number of documents inside the collection.\n\n\nExample: Requesting the number of documents:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -2967,7 +2967,7 @@
},
"/_api/collection/{collection-name}/figures": {
"get": {
- "description": "\n\nIn addition to the above, the result also contains the number of documents\nand additional statistical information about the collection.\n**Note** : This will always load the collection into memory.\n\n**Note**: collection data that are stored in the write-ahead log only are\nnot reported in the results. When the write-ahead log is collected, documents\nmight be added to journals and datafiles of the collection, which may modify\nthe figures of the collection.\n\nAdditionally, the filesizes of collection and index parameter JSON files are\nnot reported. These files should normally have a size of a few bytes\neach. Please also note that the *fileSize* values are reported in bytes\nand reflect the logical file sizes. Some filesystems may use optimisations\n(e.g. sparse files) so that the actual physical file size is somewhat\ndifferent. Directories and sub-directories may also require space in the\nfile system, but this space is not reported in the *fileSize* results.\n\nThat means that the figures reported do not reflect the actual disk\nusage of the collection with 100% accuracy. The actual disk usage of\na collection is normally slightly higher than the sum of the reported\n*fileSize* values. Still the sum of the *fileSize* values can still be\nused as a lower bound approximation of the disk usage.\n\n**A json document with these Properties is returned:**\n\n##HTTP 200\nReturns information about the collection:\n\n - **count**: The number of documents currently present in the collection.\n - **journalSize**: The maximal size of a journal or datafile in bytes.\n - **figures**:\n - **datafiles**:\n - **count**: The number of datafiles.\n - **fileSize**: The total filesize of datafiles (in bytes).\n - **uncollectedLogfileEntries**: The number of markers in the write-ahead\n log for this collection that have not been transferred to journals or datafiles.\n - **compactionStatus**:\n - **message**: The action that was performed when the compaction was last run for the collection. \n This information can be used for debugging compaction issues.\n - **time**: The point in time the compaction for the collection was last executed. \n This information can be used for debugging compaction issues.\n - **compactors**:\n - **count**: The number of compactor files.\n - **fileSize**: The total filesize of all compactor files (in bytes).\n - **dead**:\n - **count**: The number of dead documents. This includes document\n versions that have been deleted or replaced by a newer version. Documents\n deleted or replaced that are contained the write-ahead log only are not reported\n in this figure.\n - **deletion**: The total number of deletion markers. Deletion markers\n only contained in the write-ahead log are not reporting in this figure.\n - **size**: The total size in bytes used by all dead documents.\n - **indexes**:\n - **count**: The total number of indexes defined for the collection, including the pre-defined\n indexes (e.g. primary index).\n - **size**: The total memory allocated for indexes in bytes.\n - **shapes**:\n - **count**: The total number of shapes used in the collection. This includes shapes\n that are not in use anymore. Shapes that are contained\n in the write-ahead log only are not reported in this figure.\n - **size**: The total size of all shapes (in bytes). This includes\n shapes that are not in use anymore. Shapes that are contained in the\n write-ahead log only are not reported in this figure.\n - **waitingFor**: An optional string value that contains information about which object type is at the \n head of the collection's cleanup queue. This information can be used for debugging \n compaction and unload issues.\n - **alive**:\n - **count**: The number of currently active documents in all datafiles\n and journals of the collection. Documents that are contained in the\n write-ahead log only are not reported in this figure.\n - **size**: The total size in bytes used by all active documents of\n the collection. Documents that are contained in the write-ahead log only are\n not reported in this figure.\n - **documentReferences**: The number of references to documents in datafiles that JavaScript code \n currently holds. This information can be used for debugging compaction and \n unload issues.\n - **attributes**:\n - **count**: The total number of attributes used in the\n collection. Note: the value includes data of attributes that are not in use\n anymore. Attributes that are contained in the write-ahead log only are\n not reported in this figure.\n - **size**: The total size of the attribute data (in bytes).\n Note: the value includes data of attributes that are not in use anymore.\n Attributes that are contained in the write-ahead log only are not\n reported in this figure.\n - **shapefiles**:\n - **count**: The number of shape files. This value is deprecated and kept for compatibility reasons only.\n The value will always be 0 since ArangoDB 2.0 and higher.\n - **fileSize**: The total filesize of the shape files. This value is deprecated and kept\n for compatibility reasons only. The value will always be 0 in ArangoDB 2.0 and higher.\n - **journals**:\n - **count**: The number of journal files.\n - **fileSize**: The total filesize of all journal files (in bytes).\n - **maxTick**: The tick of the last marker that was stored in a journal\n of the collection. This might be 0 if the collection does not yet have\n a journal.\n\n\nExample: Using an identifier and requesting the figures of the collection:
\n\n",
+ "description": "\n\nIn addition to the above, the result also contains the number of documents\nand additional statistical information about the collection.\n**Note** : This will always load the collection into memory.\n\n**Note**: collection data that are stored in the write-ahead log only are\nnot reported in the results. When the write-ahead log is collected, documents\nmight be added to journals and datafiles of the collection, which may modify\nthe figures of the collection.\n\nAdditionally, the filesizes of collection and index parameter JSON files are\nnot reported. These files should normally have a size of a few bytes\neach. Please also note that the *fileSize* values are reported in bytes\nand reflect the logical file sizes. Some filesystems may use optimisations\n(e.g. sparse files) so that the actual physical file size is somewhat\ndifferent. Directories and sub-directories may also require space in the\nfile system, but this space is not reported in the *fileSize* results.\n\nThat means that the figures reported do not reflect the actual disk\nusage of the collection with 100% accuracy. The actual disk usage of\na collection is normally slightly higher than the sum of the reported\n*fileSize* values. Still the sum of the *fileSize* values can still be\nused as a lower bound approximation of the disk usage.\n\n**A json document with these Properties is returned:**\n\n##HTTP 200\nReturns information about the collection:\n\n - **count**: The number of documents currently present in the collection.\n - **journalSize**: The maximal size of a journal or datafile in bytes.\n - **figures**:\n - **datafiles**:\n - **count**: The number of datafiles.\n - **fileSize**: The total filesize of datafiles (in bytes).\n - **uncollectedLogfileEntries**: The number of markers in the write-ahead\n log for this collection that have not been transferred to journals or datafiles.\n - **compactionStatus**:\n - **message**: The action that was performed when the compaction was last run for the collection. \n This information can be used for debugging compaction issues.\n - **time**: The point in time the compaction for the collection was last executed. \n This information can be used for debugging compaction issues.\n - **compactors**:\n - **count**: The number of compactor files.\n - **fileSize**: The total filesize of all compactor files (in bytes).\n - **dead**:\n - **count**: The number of dead documents. This includes document\n versions that have been deleted or replaced by a newer version. Documents\n deleted or replaced that are contained the write-ahead log only are not reported\n in this figure.\n - **deletion**: The total number of deletion markers. Deletion markers\n only contained in the write-ahead log are not reporting in this figure.\n - **size**: The total size in bytes used by all dead documents.\n - **indexes**:\n - **count**: The total number of indexes defined for the collection, including the pre-defined\n indexes (e.g. primary index).\n - **size**: The total memory allocated for indexes in bytes.\n - **shapes**:\n - **count**: The total number of shapes used in the collection. This includes shapes\n that are not in use anymore. Shapes that are contained\n in the write-ahead log only are not reported in this figure.\n - **size**: The total size of all shapes (in bytes). This includes\n shapes that are not in use anymore. Shapes that are contained in the\n write-ahead log only are not reported in this figure.\n - **waitingFor**: An optional string value that contains information about which object type is at the \n head of the collection's cleanup queue. This information can be used for debugging \n compaction and unload issues.\n - **alive**:\n - **count**: The number of currently active documents in all datafiles\n and journals of the collection. Documents that are contained in the\n write-ahead log only are not reported in this figure.\n - **size**: The total size in bytes used by all active documents of\n the collection. Documents that are contained in the write-ahead log only are\n not reported in this figure.\n - **documentReferences**: The number of references to documents in datafiles that JavaScript code \n currently holds. This information can be used for debugging compaction and \n unload issues.\n - **attributes**:\n - **count**: The total number of attributes used in the\n collection. Note: the value includes data of attributes that are not in use\n anymore. Attributes that are contained in the write-ahead log only are\n not reported in this figure.\n - **size**: The total size of the attribute data (in bytes).\n Note: the value includes data of attributes that are not in use anymore.\n Attributes that are contained in the write-ahead log only are not\n reported in this figure.\n - **shapefiles**:\n - **count**: The number of shape files. This value is deprecated and kept for compatibility reasons only.\n The value will always be 0 since ArangoDB 2.0 and higher.\n - **fileSize**: The total filesize of the shape files. This value is deprecated and kept\n for compatibility reasons only. The value will always be 0 in ArangoDB 2.0 and higher.\n - **journals**:\n - **count**: The number of journal files.\n - **fileSize**: The total filesize of all journal files (in bytes).\n - **maxTick**: The tick of the last marker that was stored in a journal\n of the collection. This might be 0 if the collection does not yet have\n a journal.\n\n\nExample: Using an identifier and requesting the figures of the collection:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3006,7 +3006,7 @@
},
"/_api/collection/{collection-name}/load": {
"put": {
- "description": "\n\nLoads a collection into memory. Returns the collection on success.\n\nThe request body object might optionally contain the following attribute:\n\n- *count*: If set, this controls whether the return value should include\n the number of documents in the collection. Setting *count* to\n *false* may speed up loading a collection. The default value for\n *count* is *true*.\n\nOn success an object with the following attributes is returned:\n\n- *id*: The identifier of the collection.\n\n- *name*: The name of the collection.\n\n- *count*: The number of documents inside the collection. This is only\n returned if the *count* input parameters is set to *true* or has\n not been specified.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\n\nExample:
\n\n",
+ "description": "\n\nLoads a collection into memory. Returns the collection on success.\n\nThe request body object might optionally contain the following attribute:\n\n- *count*: If set, this controls whether the return value should include\n the number of documents in the collection. Setting *count* to\n *false* may speed up loading a collection. The default value for\n *count* is *true*.\n\nOn success an object with the following attributes is returned:\n\n- *id*: The identifier of the collection.\n\n- *name*: The name of the collection.\n\n- *count*: The number of documents inside the collection. This is only\n returned if the *count* input parameters is set to *true* or has\n not been specified.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3035,7 +3035,7 @@
},
"/_api/collection/{collection-name}/properties": {
"get": {
- "description": "\n\nIn addition to the above, the result will always contain the\n*waitForSync*, *doCompact*, *journalSize*, and *isVolatile* attributes.\nThis is achieved by forcing a load of the underlying collection.\n\n- *waitForSync*: If *true* then creating, changing or removing\n documents will wait until the data has been synchronized to disk.\n\n- *doCompact*: Whether or not the collection will be compacted.\n\n- *journalSize*: The maximal size setting for journals / datafiles\n in bytes.\n\n- *keyOptions*: JSON object which contains key generation options:\n - *type*: specifies the type of the key generator. The currently\n available generators are *traditional* and *autoincrement*.\n - *allowUserKeys*: if set to *true*, then it is allowed to supply\n own key values in the *_key* attribute of a document. If set to\n *false*, then the key generator is solely responsible for\n generating keys and supplying own key values in the *_key* attribute\n of documents is considered an error.\n\n- *isVolatile*: If *true* then the collection data will be\n kept in memory only and ArangoDB will not write or sync the data\n to disk.\n\nIn a cluster setup, the result will also contain the following attributes:\n- *numberOfShards*: the number of shards of the collection.\n\n- *shardKeys*: contains the names of document attributes that are used to\n determine the target shard for documents.\n\n\nExample: Using an identifier:
\n\n",
+ "description": "\n\nIn addition to the above, the result will always contain the\n*waitForSync*, *doCompact*, *journalSize*, and *isVolatile* attributes.\nThis is achieved by forcing a load of the underlying collection.\n\n- *waitForSync*: If *true* then creating, changing or removing\n documents will wait until the data has been synchronized to disk.\n\n- *doCompact*: Whether or not the collection will be compacted.\n\n- *journalSize*: The maximal size setting for journals / datafiles\n in bytes.\n\n- *keyOptions*: JSON object which contains key generation options:\n - *type*: specifies the type of the key generator. The currently\n available generators are *traditional* and *autoincrement*.\n - *allowUserKeys*: if set to *true*, then it is allowed to supply\n own key values in the *_key* attribute of a document. If set to\n *false*, then the key generator is solely responsible for\n generating keys and supplying own key values in the *_key* attribute\n of documents is considered an error.\n\n- *isVolatile*: If *true* then the collection data will be\n kept in memory only and ArangoDB will not write or sync the data\n to disk.\n\nIn a cluster setup, the result will also contain the following attributes:\n- *numberOfShards*: the number of shards of the collection.\n\n- *shardKeys*: contains the names of document attributes that are used to\n determine the target shard for documents.\n\n\nExample: Using an identifier:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3062,7 +3062,7 @@
"x-filename": "Collections - js/actions/_api/collection/app.js"
},
"put": {
- "description": "\n\nChanges the properties of a collection. Expects an object with the\nattribute(s)\n\n- *waitForSync*: If *true* then creating or changing a\n document will wait until the data has been synchronized to disk.\n\n- *journalSize*: The maximal size of a journal or datafile in bytes. \n The value must be at least `1048576` (1 MB). Note that when\n changing the journalSize value, it will only have an effect for\n additional journals or datafiles that are created. Already\n existing journals or datafiles will not be affected.\n\nOn success an object with the following attributes is returned:\n\n- *id*: The identifier of the collection.\n\n- *name*: The name of the collection.\n\n- *waitForSync*: The new value.\n\n- *journalSize*: The new value.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\n- *isVolatile*: If *true* then the collection data will be\n kept in memory only and ArangoDB will not write or sync the data\n to disk.\n\n- *doCompact*: Whether or not the collection will be compacted.\n\n- *keyOptions*: JSON object which contains key generation options:\n - *type*: specifies the type of the key generator. The currently\n available generators are *traditional* and *autoincrement*.\n - *allowUserKeys*: if set to *true*, then it is allowed to supply\n own key values in the *_key* attribute of a document. If set to\n *false*, then the key generator is solely responsible for\n generating keys and supplying own key values in the *_key* attribute\n of documents is considered an error.\n\n**Note**: some other collection properties, such as *type*, *isVolatile*,\n*numberOfShards* or *shardKeys* cannot be changed once a collection is\ncreated.\n\n\nExample:
\n\n",
+ "description": "\n\nChanges the properties of a collection. Expects an object with the\nattribute(s)\n\n- *waitForSync*: If *true* then creating or changing a\n document will wait until the data has been synchronized to disk.\n\n- *journalSize*: The maximal size of a journal or datafile in bytes. \n The value must be at least `1048576` (1 MB). Note that when\n changing the journalSize value, it will only have an effect for\n additional journals or datafiles that are created. Already\n existing journals or datafiles will not be affected.\n\nOn success an object with the following attributes is returned:\n\n- *id*: The identifier of the collection.\n\n- *name*: The name of the collection.\n\n- *waitForSync*: The new value.\n\n- *journalSize*: The new value.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\n- *isVolatile*: If *true* then the collection data will be\n kept in memory only and ArangoDB will not write or sync the data\n to disk.\n\n- *doCompact*: Whether or not the collection will be compacted.\n\n- *keyOptions*: JSON object which contains key generation options:\n - *type*: specifies the type of the key generator. The currently\n available generators are *traditional* and *autoincrement*.\n - *allowUserKeys*: if set to *true*, then it is allowed to supply\n own key values in the *_key* attribute of a document. If set to\n *false*, then the key generator is solely responsible for\n generating keys and supplying own key values in the *_key* attribute\n of documents is considered an error.\n\n**Note**: some other collection properties, such as *type*, *isVolatile*,\n*numberOfShards* or *shardKeys* cannot be changed once a collection is\ncreated.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3091,7 +3091,7 @@
},
"/_api/collection/{collection-name}/rename": {
"put": {
- "description": "\n\nRenames a collection. Expects an object with the attribute(s)\n\n- *name*: The new name.\n\nIt returns an object with the attributes\n\n- *id*: The identifier of the collection.\n\n- *name*: The new name of the collection.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\nIf renaming the collection succeeds, then the collection is also renamed in \nall graph definitions inside the `_graphs` collection in the current database.\n\n**Note**: this method is not available in a cluster.\n\n\nExample:
\n\n",
+ "description": "\n\nRenames a collection. Expects an object with the attribute(s)\n\n- *name*: The new name.\n\nIt returns an object with the attributes\n\n- *id*: The identifier of the collection.\n\n- *name*: The new name of the collection.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\nIf renaming the collection succeeds, then the collection is also renamed in \nall graph definitions inside the `_graphs` collection in the current database.\n\n**Note**: this method is not available in a cluster.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The name of the collection to rename.\n\n",
@@ -3120,7 +3120,7 @@
},
"/_api/collection/{collection-name}/revision": {
"get": {
- "description": "\n\nIn addition to the above, the result will also contain the\ncollection's revision id. The revision id is a server-generated\nstring that clients can use to check whether data in a collection\nhas changed since the last revision check.\n\n- *revision*: The collection revision id as a string.\n\n\nExample: Retrieving the revision of a collection
\n\n",
+ "description": "\n\nIn addition to the above, the result will also contain the\ncollection's revision id. The revision id is a server-generated\nstring that clients can use to check whether data in a collection\nhas changed since the last revision check.\n\n- *revision*: The collection revision id as a string.\n\n\nExample: Retrieving the revision of a collection
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3178,7 +3178,7 @@
},
"/_api/collection/{collection-name}/truncate": {
"put": {
- "description": "\n\nRemoves all documents from the collection, but leaves the indexes intact.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3207,7 +3207,7 @@
},
"/_api/collection/{collection-name}/unload": {
"put": {
- "description": "\n\nRemoves a collection from memory. This call does not delete any documents.\nYou can use the collection afterwards; in which case it will be loaded into\nmemory, again. On success an object with the following attributes is\nreturned:\n\n- *id*: The identifier of the collection.\n\n- *name*: The name of the collection.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\n\nExample:
\n\n",
+ "description": "\n\nRemoves a collection from memory. This call does not delete any documents.\nYou can use the collection afterwards; in which case it will be loaded into\nmemory, again. On success an object with the following attributes is\nreturned:\n\n- *id*: The identifier of the collection.\n\n- *name*: The name of the collection.\n\n- *status*: The status of the collection as number.\n\n- *type*: The collection type. Valid types are:\n - 2: document collection\n - 3: edges collection\n\n- *isSystem*: If *true* then the collection is a system collection.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "\n",
@@ -3236,7 +3236,7 @@
},
"/_api/cursor": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **count**: indicates whether the number of documents in the result set should be returned in\n the \"count\" attribute of the result.\n Calculating the \"count\" attribute might in the future have a performance\n impact for some queries so this option is turned off by default, and \"count\"\n is only returned when requested.\n - **ttl**: The time-to-live for the cursor (in seconds). The cursor will be\n removed on the server automatically after the specified amount of time. This\n is useful to ensure garbage collection of cursors that are not fully fetched\n by clients. If not set, a server-defined value will be used.\n - **batchSize**: maximum number of result documents to be transferred from\n the server to the client in one roundtrip. If this attribute is\n not set, a server-controlled default value will be used. A *batchSize* value of\n *0* is disallowed.\n - **cache**: flag to determine whether the AQL query cache\n shall be used. If set to *false*, then any query cache lookup will be skipped\n for the query. If set to *true*, it will lead to the query cache being checked\n for the query if the query cache mode is either *on* or *demand*.\n - **bindVars**: list of bind parameter objects. of type object\n - **query**: contains the query string to be executed\n - **options**:\n - **profile**: if set to *true*, then the additional query profiling information\n will be returned in the *extra.stats* return attribute if the query result is not\n served from the query cache.\n - **optimizer.rules**: a list of to-be-included or to-be-excluded optimizer rules\n can be put into this attribute, telling the optimizer to include or exclude\n specific rules. To disable a rule, prefix its name with a `-`, to enable a rule, prefix it\n with a `+`. There is also a pseudo-rule `all`, which will match all optimizer rules. of type string\n - **fullCount**: if set to *true* and the query contains a *LIMIT* clause, then the\n result will contain an extra attribute *extra* with a sub-attribute *fullCount*.\n This sub-attribute will contain the number of documents in the result before the\n last LIMIT in the query was applied. It can be used to count the number of documents that\n match certain filter criteria, but only return a subset of them, in one go.\n It is thus similar to MySQL's *SQL_CALC_FOUND_ROWS* hint. Note that setting the option\n will disable a few LIMIT optimizations and may lead to more documents being processed,\n and thus make queries run longer. Note that the *fullCount* sub-attribute will only\n be present in the result if the query has a LIMIT clause and the LIMIT clause is\n actually used in the query.\n - **maxPlans**: limits the maximum number of plans that are created by the AQL query optimizer.\n\n\n\n\nThe query details include the query string plus optional query options and\nbind parameters. These values need to be passed in a JSON representation in\nthe body of the POST request.\n\n**A json document with these Properties is returned:**\n\n##HTTP 201\nis returned if the result set can be created by the server.\n\n - **count**: the total number of result documents available (only\navailable if the query was executed with the *count* attribute set)\n - **code**: the HTTP status code\n - **extra**: an optional JSON object with extra information about the query result\ncontained in its *stats* sub-attribute. For data-modification queries, the \n*extra.stats* sub-attribute will contain the number of modified documents and \nthe number of documents that could not be modified\ndue to an error (if *ignoreErrors* query option is specified)\n - **cached**: a boolean flag indicating whether the query result was served \nfrom the query cache or not. If the query result is served from the query\ncache, the *extra* return attribute will not contain any *stats* sub-attribute\nand no *profile* sub-attribute.\n - **hasMore**: A boolean indicator whether there are more results\navailable for the cursor on the server\n - **result**: an array of result documents (might be empty if query has no results)anonymous json object\n - **error**: A flag to indicate that an error occurred (*false* in this case)\n - **id**: id of temporary cursor created on the server (optional, see above)\n\n**A json document with these Properties is returned:**\n\n##HTTP 400\nis returned if the JSON representation is malformed or the query specification is\nmissing from the request.\nIf the JSON representation is malformed or the query specification is\nmissing from the request, the server will respond with *HTTP 400*.\nThe body of the response will contain a JSON object with additional error\ndetails. The object has the following attributes:\n\n - **errorMessage**: a descriptive error message\nIf the query specification is complete, the server will process the query. If an\nerror occurs during query processing, the server will respond with *HTTP 400*.\nAgain, the body of the response will contain details about the error.\nA [list of query errors can be found here](../ErrorCodes/README.md).\n - **errorNum**: the server error number\n - **code**: the HTTP status code\n - **error**: boolean flag to indicate that an error occurred (*true* in this case)\n\n\nExample: Execute a query and extract the result in a single go
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor <<EOF\n{ \n \"query\" : \"FOR u IN unknowncoll LIMIT 2 RETURN u\", \n \"count\" : true, \n \"batchSize\" : 2 \n}\nEOF\n\nHTTP/1.1404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection not found (unknowncoll)\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n
\nExample: Bad query - Execute a data-modification query that attempts to remove a non-existing\ndocument
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor <<EOF\n{ \n \"query\" : \"REMOVE 'foo' IN products\" \n}\nEOF\n\nHTTP/1.1404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document not found (while executing)\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n
\n\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **count**: indicates whether the number of documents in the result set should be returned in\n the \"count\" attribute of the result.\n Calculating the \"count\" attribute might in the future have a performance\n impact for some queries so this option is turned off by default, and \"count\"\n is only returned when requested.\n - **ttl**: The time-to-live for the cursor (in seconds). The cursor will be\n removed on the server automatically after the specified amount of time. This\n is useful to ensure garbage collection of cursors that are not fully fetched\n by clients. If not set, a server-defined value will be used.\n - **batchSize**: maximum number of result documents to be transferred from\n the server to the client in one roundtrip. If this attribute is\n not set, a server-controlled default value will be used. A *batchSize* value of\n *0* is disallowed.\n - **cache**: flag to determine whether the AQL query cache\n shall be used. If set to *false*, then any query cache lookup will be skipped\n for the query. If set to *true*, it will lead to the query cache being checked\n for the query if the query cache mode is either *on* or *demand*.\n - **bindVars**: list of bind parameter objects. of type object\n - **query**: contains the query string to be executed\n - **options**:\n - **profile**: if set to *true*, then the additional query profiling information\n will be returned in the *extra.stats* return attribute if the query result is not\n served from the query cache.\n - **optimizer.rules**: a list of to-be-included or to-be-excluded optimizer rules\n can be put into this attribute, telling the optimizer to include or exclude\n specific rules. To disable a rule, prefix its name with a `-`, to enable a rule, prefix it\n with a `+`. There is also a pseudo-rule `all`, which will match all optimizer rules. of type string\n - **fullCount**: if set to *true* and the query contains a *LIMIT* clause, then the\n result will contain an extra attribute *extra* with a sub-attribute *fullCount*.\n This sub-attribute will contain the number of documents in the result before the\n last LIMIT in the query was applied. It can be used to count the number of documents that\n match certain filter criteria, but only return a subset of them, in one go.\n It is thus similar to MySQL's *SQL_CALC_FOUND_ROWS* hint. Note that setting the option\n will disable a few LIMIT optimizations and may lead to more documents being processed,\n and thus make queries run longer. Note that the *fullCount* sub-attribute will only\n be present in the result if the query has a LIMIT clause and the LIMIT clause is\n actually used in the query.\n - **maxPlans**: limits the maximum number of plans that are created by the AQL query optimizer.\n\n\n\n\nThe query details include the query string plus optional query options and\nbind parameters. These values need to be passed in a JSON representation in\nthe body of the POST request.\n\n**A json document with these Properties is returned:**\n\n##HTTP 201\nis returned if the result set can be created by the server.\n\n - **count**: the total number of result documents available (only\navailable if the query was executed with the *count* attribute set)\n - **code**: the HTTP status code\n - **extra**: an optional JSON object with extra information about the query result\ncontained in its *stats* sub-attribute. For data-modification queries, the \n*extra.stats* sub-attribute will contain the number of modified documents and \nthe number of documents that could not be modified\ndue to an error (if *ignoreErrors* query option is specified)\n - **cached**: a boolean flag indicating whether the query result was served \nfrom the query cache or not. If the query result is served from the query\ncache, the *extra* return attribute will not contain any *stats* sub-attribute\nand no *profile* sub-attribute.\n - **hasMore**: A boolean indicator whether there are more results\navailable for the cursor on the server\n - **result**: an array of result documents (might be empty if query has no results)anonymous json object\n - **error**: A flag to indicate that an error occurred (*false* in this case)\n - **id**: id of temporary cursor created on the server (optional, see above)\n\n**A json document with these Properties is returned:**\n\n##HTTP 400\nis returned if the JSON representation is malformed or the query specification is\nmissing from the request.\nIf the JSON representation is malformed or the query specification is\nmissing from the request, the server will respond with *HTTP 400*.\nThe body of the response will contain a JSON object with additional error\ndetails. The object has the following attributes:\n\n - **errorMessage**: a descriptive error message\nIf the query specification is complete, the server will process the query. If an\nerror occurs during query processing, the server will respond with *HTTP 400*.\nAgain, the body of the response will contain details about the error.\nA [list of query errors can be found here](../ErrorCodes/README.md).\n - **errorNum**: the server error number\n - **code**: the HTTP status code\n - **error**: boolean flag to indicate that an error occurred (*true* in this case)\n\n\nExample: Execute a query and extract the result in a single go
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor <<EOF\n{ \n \"query\" : \"FOR u IN unknowncoll LIMIT 2 RETURN u\", \n \"count\" : true, \n \"batchSize\" : 2 \n}\nEOF\n\nHTTP/1.1404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"collection not found (unknowncoll)\", \n \"code\" : 404, \n \"errorNum\" : 1203 \n}\n
\nExample: Bad query - Execute a data-modification query that attempts to remove a non-existing\ndocument
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/cursor <<EOF\n{ \n \"query\" : \"REMOVE 'foo' IN products\" \n}\nEOF\n\nHTTP/1.1404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"document not found (while executing)\", \n \"code\" : 404, \n \"errorNum\" : 1202 \n}\n
\n\n\n",
"parameters": [
{
"in": "body",
@@ -3283,7 +3283,7 @@
},
"/_api/cursor/{cursor-identifier}": {
"delete": {
- "description": "\n\nDeletes the cursor and frees the resources associated with it.\n\nThe cursor will automatically be destroyed on the server when the client has\nretrieved all documents from it. The client can also explicitly destroy the\ncursor at any earlier time using an HTTP DELETE request. The cursor id must\nbe included as part of the URL.\n\nNote: the server will also destroy abandoned cursors automatically after a\ncertain server-controlled timeout to avoid resource leakage.\n\n\nExample:
\n\n",
+ "description": "\n\nDeletes the cursor and frees the resources associated with it.\n\nThe cursor will automatically be destroyed on the server when the client has\nretrieved all documents from it. The client can also explicitly destroy the\ncursor at any earlier time using an HTTP DELETE request. The cursor id must\nbe included as part of the URL.\n\nNote: the server will also destroy abandoned cursors automatically after a\ncertain server-controlled timeout to avoid resource leakage.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The id of the cursor\n\n",
@@ -3310,7 +3310,7 @@
"x-filename": "Cursors - arangod/RestHandler/RestCursorHandler.cpp"
},
"put": {
- "description": "\n\n\nIf the cursor is still alive, returns an object with the following\nattributes:\n\n- *id*: the *cursor-identifier*\n- *result*: a list of documents for the current batch\n- *hasMore*: *false* if this was the last batch\n- *count*: if present the total number of elements\n\nNote that even if *hasMore* returns *true*, the next call might\nstill return no documents. If, however, *hasMore* is *false*, then\nthe cursor is exhausted. Once the *hasMore* attribute has a value of\n*false*, the client can stop.\n\n\nExample: Valid request for next batch
shell> curl -X PUT --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"expecting PUT /_api/cursor/<cursor-id>\", \n \"code\" : 400, \n \"errorNum\" : 400 \n}\n
\nExample: Unknown identifier
shell> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"cursor not found\", \n \"code\" : 404, \n \"errorNum\" : 1600 \n}\n
\n\n",
+ "description": "\n\n\nIf the cursor is still alive, returns an object with the following\nattributes:\n\n- *id*: the *cursor-identifier*\n- *result*: a list of documents for the current batch\n- *hasMore*: *false* if this was the last batch\n- *count*: if present the total number of elements\n\nNote that even if *hasMore* returns *true*, the next call might\nstill return no documents. If, however, *hasMore* is *false*, then\nthe cursor is exhausted. Once the *hasMore* attribute has a value of\n*false*, the client can stop.\n\n\nExample: Valid request for next batch
shell> curl -X PUT --dump - http://localhost:8529/_api/cursor\n\nHTTP/1.1400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"expecting PUT /_api/cursor/<cursor-id>\", \n \"code\" : 400, \n \"errorNum\" : 400 \n}\n
\nExample: Unknown identifier
shell> curl -X PUT --dump - http://localhost:8529/_api/cursor/123123\n\nHTTP/1.1404 Not Found\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"errorMessage\" : \"cursor not found\", \n \"code\" : 404, \n \"errorNum\" : 1600 \n}\n
\n\n",
"parameters": [
{
"description": "The name of the cursor\n\n",
@@ -3399,7 +3399,7 @@
},
"/_api/database/current": {
"get": {
- "description": "\n\nRetrieves information about the current database\n\nThe response is a JSON object with the following attributes:\n\n- *name*: the name of the current database\n\n- *id*: the id of the current database\n\n- *path*: the filesystem path of the current database\n\n- *isSystem*: whether or not the current database is the *_system* database\n\n\nExample:
\n\n",
+ "description": "\n\nRetrieves information about the current database\n\nThe response is a JSON object with the following attributes:\n\n- *name*: the name of the current database\n\n- *id*: the id of the current database\n\n- *path*: the filesystem path of the current database\n\n- *isSystem*: whether or not the current database is the *_system* database\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -3477,7 +3477,7 @@
},
"/_api/document": {
"get": {
- "description": "\n\nReturns an array of all keys, ids, or URI paths for all documents in the \ncollection identified by *collection*. The type of the result array is\ndetermined by the *type* attribute.\n\nNote that the results have no defined order and thus the order should\nnot be relied on.\n\n\nExample: Return all document paths
\n\n",
+ "description": "\n\nReturns an array of all keys, ids, or URI paths for all documents in the \ncollection identified by *collection*. The type of the result array is\ndetermined by the *type* attribute.\n\nNote that the results have no defined order and thus the order should\nnot be relied on.\n\n\nExample: Return all document paths
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3510,7 +3510,7 @@
"x-filename": "Documents - arangod/RestHandler/RestDocumentHandler.cpp"
},
"post": {
- "description": "\nfree style json body\n\n\n\nCreates a new document in the collection named *collection*. A JSON\nrepresentation of the document must be passed as the body of the POST\nrequest.\n\nIf the document was created successfully, then the \"Location\" header\ncontains the path to the newly created document. The \"ETag\" header field\ncontains the revision of the document.\n\nThe body of the response contains a JSON object with the following\nattributes:\n\n- *_id* contains the document handle of the newly created document\n- *_key* contains the document key\n- *_rev* contains the document revision\n\nIf the collection parameter *waitForSync* is *false*, then the call returns\nas soon as the document has been accepted. It will not wait until the\ndocument has been synced to disk.\n\nOptionally, the query parameter *waitForSync* can be used to force\nsynchronization of the document creation operation to disk even in case that\nthe *waitForSync* flag had been disabled for the entire collection. Thus,\nthe *waitForSync* query parameter can be used to force synchronization of just\nthis specific operations. To use this, set the *waitForSync* parameter to\n*true*. If the *waitForSync* parameter is not specified or set to *false*,\nthen the collection's default *waitForSync* behavior is applied. The\n*waitForSync* query parameter cannot be used to disable synchronization for\ncollections that have a default *waitForSync* value of *true*.\n\n\nExample: Create a document in a collection named *products*. Note that the\nrevision identifier might or might not by equal to the auto-generated\nkey.
\n\n",
+ "description": "\nfree style json body\n\n\n\nCreates a new document in the collection named *collection*. A JSON\nrepresentation of the document must be passed as the body of the POST\nrequest.\n\nIf the document was created successfully, then the \"Location\" header\ncontains the path to the newly created document. The \"ETag\" header field\ncontains the revision of the document.\n\nThe body of the response contains a JSON object with the following\nattributes:\n\n- *_id* contains the document handle of the newly created document\n- *_key* contains the document key\n- *_rev* contains the document revision\n\nIf the collection parameter *waitForSync* is *false*, then the call returns\nas soon as the document has been accepted. It will not wait until the\ndocument has been synced to disk.\n\nOptionally, the query parameter *waitForSync* can be used to force\nsynchronization of the document creation operation to disk even in case that\nthe *waitForSync* flag had been disabled for the entire collection. Thus,\nthe *waitForSync* query parameter can be used to force synchronization of just\nthis specific operations. To use this, set the *waitForSync* parameter to\n*true*. If the *waitForSync* parameter is not specified or set to *false*,\nthen the collection's default *waitForSync* behavior is applied. The\n*waitForSync* query parameter cannot be used to disable synchronization for\ncollections that have a default *waitForSync* value of *true*.\n\n\nExample: Create a document in a collection named *products*. Note that the\nrevision identifier might or might not by equal to the auto-generated\nkey.
\n\n",
"parameters": [
{
"description": "A JSON representation of the document.\n\n",
@@ -3569,7 +3569,7 @@
},
"/_api/document/{collection-name}/{document-key}": {
"delete": {
- "description": "\n\nThe body of the response contains a JSON object with the information about\nthe handle and the revision. The attribute *_id* contains the known\n*document-handle* of the removed document, *_key* contains the key which\nuniquely identifies a document in a given collection, and the attribute *_rev*\ncontains the new document revision.\n\nIf the *waitForSync* parameter is not specified or set to\n*false*, then the collection's default *waitForSync* behavior is\napplied. The *waitForSync* query parameter cannot be used to disable\nsynchronization for collections that have a default *waitForSync* value\nof *true*.\n\n\nExample: Using document handle:
\n\n",
+ "description": "\n\nThe body of the response contains a JSON object with the information about\nthe handle and the revision. The attribute *_id* contains the known\n*document-handle* of the removed document, *_key* contains the key which\nuniquely identifies a document in a given collection, and the attribute *_rev*\ncontains the new document revision.\n\nIf the *waitForSync* parameter is not specified or set to\n*false*, then the collection's default *waitForSync* behavior is\napplied. The *waitForSync* query parameter cannot be used to disable\nsynchronization for collections that have a default *waitForSync* value\nof *true*.\n\n\nExample: Using document handle:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3637,7 +3637,7 @@
"x-filename": "Documents - arangod/RestHandler/RestDocumentHandler.cpp"
},
"get": {
- "description": "\n\nReturns the document identified by *document-handle*. The returned\ndocument contains three special attributes: *_id* containing the document\nhandle, *_key* containing key which uniquely identifies a document\nin a given collection and *_rev* containing the revision.\n\n\nExample: Use a document handle:
\n\n",
+ "description": "\n\nReturns the document identified by *document-handle*. The returned\ndocument contains three special attributes: *_id* containing the document\nhandle, *_key* containing key which uniquely identifies a document\nin a given collection and *_rev* containing the revision.\n\n\nExample: Use a document handle:
\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3690,7 +3690,7 @@
"x-filename": "Documents - arangod/RestHandler/RestDocumentHandler.cpp"
},
"head": {
- "description": "\n\nLike *GET*, but only returns the header fields and not the body. You\ncan use this call to get the current revision of a document or check if\nthe document was deleted.\n\n\nExample:
shell> curl -X HEAD --dump - http://localhost:8529/_api/document/products/736471470\n\n
\n\n\n",
+ "description": "\n\nLike *GET*, but only returns the header fields and not the body. You\ncan use this call to get the current revision of a document or check if\nthe document was deleted.\n\n\nExample:
shell> curl -X HEAD --dump - http://localhost:8529/_api/document/products/733197873\n\n
\n\n\n",
"parameters": [
{
"description": "The name of the collection.\n\n",
@@ -3750,7 +3750,7 @@
"x-filename": "Documents - arangod/RestHandler/RestDocumentHandler.cpp"
},
"patch": {
- "description": "\nfree style json body\n\n\n\nPartially updates the document identified by *document-handle*.\nThe body of the request must contain a JSON document with the attributes\nto patch (the patch document). All attributes from the patch document will\nbe added to the existing document if they do not yet exist, and overwritten\nin the existing document if they do exist there.\n\nSetting an attribute value to *null* in the patch document will cause a\nvalue of *null* be saved for the attribute by default.\n\nOptionally, the query parameter *waitForSync* can be used to force\nsynchronization of the document update operation to disk even in case\nthat the *waitForSync* flag had been disabled for the entire collection.\nThus, the *waitForSync* query parameter can be used to force synchronization\nof just specific operations. To use this, set the *waitForSync* parameter\nto *true*. If the *waitForSync* parameter is not specified or set to\n*false*, then the collection's default *waitForSync* behavior is\napplied. The *waitForSync* query parameter cannot be used to disable\nsynchronization for collections that have a default *waitForSync* value\nof *true*.\n\nThe body of the response contains a JSON object with the information about\nthe handle and the revision. The attribute *_id* contains the known\n*document-handle* of the updated document, *_key* contains the key which \nuniquely identifies a document in a given collection, and the attribute *_rev*\ncontains the new document revision.\n\nIf the document does not exist, then a *HTTP 404* is returned and the\nbody of the response contains an error document.\n\nYou can conditionally update a document based on a target revision id by\nusing either the *rev* query parameter or the *if-match* HTTP header.\nTo control the update behavior in case there is a revision mismatch, you\ncan use the *policy* parameter. This is the same as when replacing\ndocuments (see replacing documents for details).\n\n\nExample: patches an existing document with new content.
\n\n",
+ "description": "\nfree style json body\n\n\n\nPartially updates the document identified by *document-handle*.\nThe body of the request must contain a JSON document with the attributes\nto patch (the patch document). All attributes from the patch document will\nbe added to the existing document if they do not yet exist, and overwritten\nin the existing document if they do exist there.\n\nSetting an attribute value to *null* in the patch document will cause a\nvalue of *null* be saved for the attribute by default.\n\nOptionally, the query parameter *waitForSync* can be used to force\nsynchronization of the document update operation to disk even in case\nthat the *waitForSync* flag had been disabled for the entire collection.\nThus, the *waitForSync* query parameter can be used to force synchronization\nof just specific operations. To use this, set the *waitForSync* parameter\nto *true*. If the *waitForSync* parameter is not specified or set to\n*false*, then the collection's default *waitForSync* behavior is\napplied. The *waitForSync* query parameter cannot be used to disable\nsynchronization for collections that have a default *waitForSync* value\nof *true*.\n\nThe body of the response contains a JSON object with the information about\nthe handle and the revision. The attribute *_id* contains the known\n*document-handle* of the updated document, *_key* contains the key which \nuniquely identifies a document in a given collection, and the attribute *_rev*\ncontains the new document revision.\n\nIf the document does not exist, then a *HTTP 404* is returned and the\nbody of the response contains an error document.\n\nYou can conditionally update a document based on a target revision id by\nusing either the *rev* query parameter or the *if-match* HTTP header.\nTo control the update behavior in case there is a revision mismatch, you\ncan use the *policy* parameter. This is the same as when replacing\ndocuments (see replacing documents for details).\n\n\nExample: patches an existing document with new content.
\n\n",
"parameters": [
{
"description": "A JSON representation of the document update.\n\n",
@@ -3846,7 +3846,7 @@
"x-filename": "Documents - arangod/RestHandler/RestDocumentHandler.cpp"
},
"put": {
- "description": "\nfree style json body\n\n\n\nCompletely updates (i.e. replaces) the document identified by *document-handle*.\nIf the document exists and can be updated, then a *HTTP 201* is returned\nand the \"ETag\" header field contains the new revision of the document.\n\nIf the new document passed in the body of the request contains the\n*document-handle* in the attribute *_id* and the revision\nin *_rev*,\nthese attributes will be ignored. Only the URI and the \"ETag\" header are\nrelevant in order to avoid confusion when using proxies.\n\n\nOptionally, the query parameter *waitForSync* can be used to force\nsynchronization of the document replacement operation to disk even in case\nthat the *waitForSync* flag had been disabled for the entire collection.\nThus, the *waitForSync* query parameter can be used to force synchronization\nof just specific operations. To use this, set the *waitForSync* parameter\nto *true*. If the *waitForSync* parameter is not specified or set to\n*false*, then the collection's default *waitForSync* behavior is\napplied. The *waitForSync* query parameter cannot be used to disable\nsynchronization for collections that have a default *waitForSync* value\nof *true*.\n\n\nThe body of the response contains a JSON object with the information about\nthe handle and the revision. The attribute *_id* contains the known\n*document-handle* of the updated document, *_key* contains the key which \nuniquely identifies a document in a given collection, and the attribute *_rev*\ncontains the new document revision.\n\nIf the document does not exist, then a *HTTP 404* is returned and the\nbody of the response contains an error document.\n\nThere are two ways for specifying the targeted document revision id for\nconditional replacements (i.e. replacements that will only be executed if\nthe revision id found in the database matches the document revision id specified\nin the request):\n- specifying the target revision in the *rev* URL query parameter\n- specifying the target revision in the *if-match* HTTP header\n\n\nSpecifying a target revision is optional, however, if done, only one of the\ndescribed mechanisms must be used (either the *rev* query parameter or the\n*if-match* HTTP header).\nRegardless which mechanism is used, the parameter needs to contain the target\ndocument revision id as returned in the *_rev* attribute of a document or\nby an HTTP *etag* header.\n\nFor example, to conditionally replace a document based on a specific revision\nid, you can use the following request:\n\n\n`PUT /_api/document/collection-name/document-key?rev=etag`\n\n\nIf a target revision id is provided in the request (e.g. via the *etag* value\nin the *rev* URL query parameter above), ArangoDB will check that\nthe revision id of the document found in the database is equal to the target\nrevision id provided in the request. If there is a mismatch between the revision\nid, then by default a *HTTP 412* conflict is returned and no replacement is\nperformed.\n\n\nThe conditional update behavior can be overridden with the *policy* URL query parameter:\n\n\n`PUT /_api/document/collection-name/document-key?policy=policy`\n\n\nIf *policy* is set to *error*, then the behavior is as before: replacements\nwill fail if the revision id found in the database does not match the target\nrevision id specified in the request.\n\nIf *policy* is set to *last*, then the replacement will succeed, even if the\nrevision id found in the database does not match the target revision id specified\nin the request. You can use the *last* *policy* to force replacements.\n\n\nExample: Using a document handle
\n\n",
+ "description": "\nfree style json body\n\n\n\nCompletely updates (i.e. replaces) the document identified by *document-handle*.\nIf the document exists and can be updated, then a *HTTP 201* is returned\nand the \"ETag\" header field contains the new revision of the document.\n\nIf the new document passed in the body of the request contains the\n*document-handle* in the attribute *_id* and the revision\nin *_rev*,\nthese attributes will be ignored. Only the URI and the \"ETag\" header are\nrelevant in order to avoid confusion when using proxies.\n\n\nOptionally, the query parameter *waitForSync* can be used to force\nsynchronization of the document replacement operation to disk even in case\nthat the *waitForSync* flag had been disabled for the entire collection.\nThus, the *waitForSync* query parameter can be used to force synchronization\nof just specific operations. To use this, set the *waitForSync* parameter\nto *true*. If the *waitForSync* parameter is not specified or set to\n*false*, then the collection's default *waitForSync* behavior is\napplied. The *waitForSync* query parameter cannot be used to disable\nsynchronization for collections that have a default *waitForSync* value\nof *true*.\n\n\nThe body of the response contains a JSON object with the information about\nthe handle and the revision. The attribute *_id* contains the known\n*document-handle* of the updated document, *_key* contains the key which \nuniquely identifies a document in a given collection, and the attribute *_rev*\ncontains the new document revision.\n\nIf the document does not exist, then a *HTTP 404* is returned and the\nbody of the response contains an error document.\n\nThere are two ways for specifying the targeted document revision id for\nconditional replacements (i.e. replacements that will only be executed if\nthe revision id found in the database matches the document revision id specified\nin the request):\n- specifying the target revision in the *rev* URL query parameter\n- specifying the target revision in the *if-match* HTTP header\n\n\nSpecifying a target revision is optional, however, if done, only one of the\ndescribed mechanisms must be used (either the *rev* query parameter or the\n*if-match* HTTP header).\nRegardless which mechanism is used, the parameter needs to contain the target\ndocument revision id as returned in the *_rev* attribute of a document or\nby an HTTP *etag* header.\n\nFor example, to conditionally replace a document based on a specific revision\nid, you can use the following request:\n\n\n`PUT /_api/document/collection-name/document-key?rev=etag`\n\n\nIf a target revision id is provided in the request (e.g. via the *etag* value\nin the *rev* URL query parameter above), ArangoDB will check that\nthe revision id of the document found in the database is equal to the target\nrevision id provided in the request. If there is a mismatch between the revision\nid, then by default a *HTTP 412* conflict is returned and no replacement is\nperformed.\n\n\nThe conditional update behavior can be overridden with the *policy* URL query parameter:\n\n\n`PUT /_api/document/collection-name/document-key?policy=policy`\n\n\nIf *policy* is set to *error*, then the behavior is as before: replacements\nwill fail if the revision id found in the database does not match the target\nrevision id specified in the request.\n\nIf *policy* is set to *last*, then the replacement will succeed, even if the\nrevision id found in the database does not match the target revision id specified\nin the request. You can use the *last* *policy* to force replacements.\n\n\nExample: Using a document handle
\n\n",
"parameters": [
{
"description": "A JSON representation of the new document.\n\n",
@@ -3956,7 +3956,7 @@
"x-filename": "Graph edges - arangod/RestHandler/RestEdgeHandler.cpp, arangod/RestHandler/RestEdgesHandler.cpp"
},
"post": {
- "description": "\nfree style json body\n\n\n\nCreates a new edge document in the collection named *collection*. A JSON\nrepresentation of the document must be passed as the body of the POST\nrequest.\n\nThe *from* and *to* handles are immutable once the edge has been created.\n\nIn all other respects the method works like *POST /document*.\n\n\nExample: Create an edge and read it back:
\n\n",
+ "description": "\nfree style json body\n\n\n\nCreates a new edge document in the collection named *collection*. A JSON\nrepresentation of the document must be passed as the body of the POST\nrequest.\n\nThe *from* and *to* handles are immutable once the edge has been created.\n\nIn all other respects the method works like *POST /document*.\n\n\nExample: Create an edge and read it back:
\n\n",
"parameters": [
{
"description": "A JSON representation of the edge document must be passed as the body of\nthe POST request. This JSON object may contain the edge's document key in\nthe *_key* attribute if needed.\n\n",
@@ -4390,7 +4390,7 @@
},
"/_api/edges/{collection-id}": {
"get": {
- "description": "\n\nReturns an array of edges starting or ending in the vertex identified by\n*vertex-handle*.\n\n\nExample: Any direction
\n\n",
"parameters": [
{
"description": "The id of the collection.\n\n",
@@ -4436,7 +4436,7 @@
},
"/_api/endpoint": {
"get": {
- "description": "\n\nReturns an array of all configured endpoints the server is listening on. For\neach endpoint, the array of allowed databases is returned too if set.\n\nThe result is a JSON object which has the endpoints as keys, and an array of\nmapped database names as values for each endpoint.\n\nIf an array of mapped databases is empty, it means that all databases can be\naccessed via the endpoint. If an array of mapped databases contains more than\none database name, this means that any of the databases might be accessed\nvia the endpoint, and the first database in the arry will be treated as\nthe default database for the endpoint. The default database will be used\nwhen an incoming request does not specify a database name in the request\nexplicitly.\n\n**Note**: retrieving the array of all endpoints is allowed in the system database\nonly. Calling this action in any other database will make the server return\nan error.\n\n\nExample:
\n\n",
+ "description": "\n\nReturns an array of all configured endpoints the server is listening on. For\neach endpoint, the array of allowed databases is returned too if set.\n\nThe result is a JSON object which has the endpoints as keys, and an array of\nmapped database names as values for each endpoint.\n\nIf an array of mapped databases is empty, it means that all databases can be\naccessed via the endpoint. If an array of mapped databases contains more than\none database name, this means that any of the databases might be accessed\nvia the endpoint, and the first database in the arry will be treated as\nthe default database for the endpoint. The default database will be used\nwhen an incoming request does not specify a database name in the request\nexplicitly.\n\n**Note**: retrieving the array of all endpoints is allowed in the system database\nonly. Calling this action in any other database will make the server return\nan error.\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -4459,7 +4459,7 @@
},
"/_api/explain": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **query**: the query which you want explained; If the query references any bind variables,\n these must also be passed in the attribute *bindVars*. Additional\n options for the query can be passed in the *options* attribute.\n - **options**:\n - **optimizer.rules**: an array of to-be-included or to-be-excluded optimizer rules\n can be put into this attribute, telling the optimizer to include or exclude\n specific rules. To disable a rule, prefix its name with a `-`, to enable a rule, prefix it\n with a `+`. There is also a pseudo-rule `all`, which will match all optimizer rules. of type string\n - **maxNumberOfPlans**: an optional maximum number of plans that the optimizer is \n allowed to generate. Setting this attribute to a low value allows to put a\n cap on the amount of work the optimizer does.\n - **allPlans**: if set to *true*, all possible execution plans will be returned.\n The default is *false*, meaning only the optimal plan will be returned.\n - **bindVars**: key/value pairs representing the bind values of type object\n\n\n\n\n\nTo explain how an AQL query would be executed on the server, the query string\ncan be sent to the server via an HTTP POST request. The server will then validate\nthe query and create an execution plan for it. The execution plan will be\nreturned, but the query will not be executed.\n\nThe execution plan that is returned by the server can be used to estimate the\nprobable performance of the query. Though the actual performance will depend\non many different factors, the execution plan normally can provide some rough\nestimates on the amount of work the server needs to do in order to actually run \nthe query.\n\nBy default, the explain operation will return the optimal plan as chosen by\nthe query optimizer The optimal plan is the plan with the lowest total estimated\ncost. The plan will be returned in the attribute *plan* of the response object.\nIf the option *allPlans* is specified in the request, the result will contain \nall plans created by the optimizer. The plans will then be returned in the \nattribute *plans*.\n\nThe result will also contain an attribute *warnings*, which is an array of \nwarnings that occurred during optimization or execution plan creation. Additionally,\na *stats* attribute is contained in the result with some optimizer statistics.\n\nEach plan in the result is a JSON object with the following attributes:\n- *nodes*: the array of execution nodes of the plan. The array of available node types\n can be found [here](../Aql/Optimizer.md)\n\n- *estimatedCost*: the total estimated cost for the plan. If there are multiple\n plans, the optimizer will choose the plan with the lowest total cost.\n\n- *collections*: an array of collections used in the query\n\n- *rules*: an array of rules the optimizer applied. An overview of the\n available rules can be found [here](../Aql/Optimizer.md)\n\n- *variables*: array of variables used in the query (note: this may contain\n internal variables created by the optimizer)\n\n\nExample: Valid query
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain <<EOF\n{ \n \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n\" \n}\nEOF\n\nHTTP/1.1400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1551, \n \"errorMessage\" : \"no value specified for declared bind parameter 'id' (while parsing)\" \n}\n
\nExample: The data returned in the *plan* attribute of the result contains one\nelement per AQL top-level statement (i.e. *FOR*, *RETURN*,\n*FILTER* etc.). If the query optimizer removed some unnecessary statements,\nthe result might also contain less elements than there were top-level\nstatements in the AQL query.\nThe following example shows a query with a non-sensible filter condition that\nthe optimizer has removed so that there are less top-level statements.
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **query**: the query which you want explained; If the query references any bind variables,\n these must also be passed in the attribute *bindVars*. Additional\n options for the query can be passed in the *options* attribute.\n - **options**:\n - **optimizer.rules**: an array of to-be-included or to-be-excluded optimizer rules\n can be put into this attribute, telling the optimizer to include or exclude\n specific rules. To disable a rule, prefix its name with a `-`, to enable a rule, prefix it\n with a `+`. There is also a pseudo-rule `all`, which will match all optimizer rules. of type string\n - **maxNumberOfPlans**: an optional maximum number of plans that the optimizer is \n allowed to generate. Setting this attribute to a low value allows to put a\n cap on the amount of work the optimizer does.\n - **allPlans**: if set to *true*, all possible execution plans will be returned.\n The default is *false*, meaning only the optimal plan will be returned.\n - **bindVars**: key/value pairs representing the bind values of type object\n\n\n\n\n\nTo explain how an AQL query would be executed on the server, the query string\ncan be sent to the server via an HTTP POST request. The server will then validate\nthe query and create an execution plan for it. The execution plan will be\nreturned, but the query will not be executed.\n\nThe execution plan that is returned by the server can be used to estimate the\nprobable performance of the query. Though the actual performance will depend\non many different factors, the execution plan normally can provide some rough\nestimates on the amount of work the server needs to do in order to actually run \nthe query.\n\nBy default, the explain operation will return the optimal plan as chosen by\nthe query optimizer The optimal plan is the plan with the lowest total estimated\ncost. The plan will be returned in the attribute *plan* of the response object.\nIf the option *allPlans* is specified in the request, the result will contain \nall plans created by the optimizer. The plans will then be returned in the \nattribute *plans*.\n\nThe result will also contain an attribute *warnings*, which is an array of \nwarnings that occurred during optimization or execution plan creation. Additionally,\na *stats* attribute is contained in the result with some optimizer statistics.\n\nEach plan in the result is a JSON object with the following attributes:\n- *nodes*: the array of execution nodes of the plan. The array of available node types\n can be found [here](../Aql/Optimizer.md)\n\n- *estimatedCost*: the total estimated cost for the plan. If there are multiple\n plans, the optimizer will choose the plan with the lowest total cost.\n\n- *collections*: an array of collections used in the query\n\n- *rules*: an array of rules the optimizer applied. An overview of the\n available rules can be found [here](../Aql/Optimizer.md)\n\n- *variables*: array of variables used in the query (note: this may contain\n internal variables created by the optimizer)\n\n\nExample: Valid query
shell> curl -X POST --data-binary @- --dump - http://localhost:8529/_api/explain <<EOF\n{ \n \"query\" : \"FOR p IN products FILTER p.id == @id LIMIT 2 RETURN p.n\" \n}\nEOF\n\nHTTP/1.1400 Bad Request\ncontent-type: application/json; charset=utf-8\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 1551, \n \"errorMessage\" : \"no value specified for declared bind parameter 'id' (while parsing)\" \n}\n
\nExample: The data returned in the *plan* attribute of the result contains one\nelement per AQL top-level statement (i.e. *FOR*, *RETURN*,\n*FILTER* etc.). If the query optimizer removed some unnecessary statements,\nthe result might also contain less elements than there were top-level\nstatements in the AQL query.\nThe following example shows a query with a non-sensible filter condition that\nthe optimizer has removed so that there are less top-level statements.
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -4553,7 +4553,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"post": {
- "description": "\n\nThe creation of a graph requires the name of the graph and a definition of its edges.\n[See also edge definitions](../GeneralGraphs/Management.md#edge-definitions).\n\n**A json post document with these Properties is required:**\n\n - **orphanCollections**: An array of additional vertex collections.\n - **edgeDefinitions**: An array of definitions for the edge\n - **name**: Name of the graph.\n\n\n\nExample:
\n\n",
+ "description": "\n\nThe creation of a graph requires the name of the graph and a definition of its edges.\n[See also edge definitions](../GeneralGraphs/Management.md#edge-definitions).\n\n**A json post document with these Properties is required:**\n\n - **orphanCollections**: An array of additional vertex collections.\n - **edgeDefinitions**: An array of definitions for the edge\n - **name**: Name of the graph.\n\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -4639,7 +4639,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"post": {
- "description": "\n\nAdds an additional edge definition to the graph.\nThis edge definition has to contain a *collection* and an array of each *from* and *to* vertex collections.\nAn edge definition can only be added if this definition is either not used in any other graph, or it is used\nwith exactly the same definition. It is not possible to store a definition \"e\" from \"v1\" to \"v2\" in the one\ngraph, and \"e\" from \"v2\" to \"v1\" in the other graph.\n\n**A json post document with these Properties is required:**\n\n - **to**: One or many edge collections that can contain target vertices. of type string\n - **from**: One or many vertex collections that can contain source vertices. of type string\n - **collection**: The name of the edge collection to be used.\n\n\n\nExample:
\n\n",
+ "description": "\n\nAdds an additional edge definition to the graph.\nThis edge definition has to contain a *collection* and an array of each *from* and *to* vertex collections.\nAn edge definition can only be added if this definition is either not used in any other graph, or it is used\nwith exactly the same definition. It is not possible to store a definition \"e\" from \"v1\" to \"v2\" in the one\ngraph, and \"e\" from \"v2\" to \"v1\" in the other graph.\n\n**A json post document with these Properties is required:**\n\n - **to**: One or many edge collections that can contain target vertices. of type string\n - **from**: One or many vertex collections that can contain source vertices. of type string\n - **collection**: The name of the edge collection to be used.\n\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -4672,7 +4672,7 @@
},
"/_api/gharial/{graph-name}/edge/{collection-name}": {
"post": {
- "description": "\n\nCreates a new edge in the collection.\nWithin the body the has to contain a *\\_from* and *\\_to* value referencing to valid vertices in the graph.\nFurthermore the edge has to be valid in the definition of this\n[edge collection](../Glossary/README.md#edge-collection).\n\n\nfree style json body\n\n\nExample:
\n\n",
+ "description": "\n\nCreates a new edge in the collection.\nWithin the body the has to contain a *\\_from* and *\\_to* value referencing to valid vertices in the graph.\nFurthermore the edge has to be valid in the definition of this\n[edge collection](../Glossary/README.md#edge-collection).\n\n\nfree style json body\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The body has to be the JSON object to be stored.\n\n",
@@ -4731,7 +4731,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"get": {
- "description": "\n\nGets an edge from the given collection.\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -4752,7 +4752,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"patch": {
- "description": "\n\nUpdates the data of the specific edge in the collection.\n\n\nfree style json body\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The body has to be a JSON object containing the attributes to be updated.\n\n",
@@ -4785,7 +4785,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"put": {
- "description": "\n\nReplaces the data of an edge in the collection.\n\n\nfree style json body\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The body has to be the JSON object to be stored.\n\n",
@@ -4823,7 +4823,7 @@
},
"/_api/gharial/{graph-name}/edge/{definition-name}": {
"delete": {
- "description": "\n\nRemove one edge definition from the graph.\nThis will only remove the edge collection, the vertex collections remain untouched and can still be used\nin your queries.\n\n\nExample:
\n\n\n",
+ "description": "\n\nRemove one edge definition from the graph.\nThis will only remove the edge collection, the vertex collections remain untouched and can still be used\nin your queries.\n\n\nExample:
\n\n\n",
"parameters": [],
"responses": {
"200": {
@@ -4844,7 +4844,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"post": {
- "description": "\n\nChange one specific edge definition.\nThis will modify all occurrences of this definition in all graphs known to your database.\n\n**A json post document with these Properties is required:**\n\n - **to**: One or many edge collections that can contain target vertices. of type string\n - **from**: One or many vertex collections that can contain source vertices. of type string\n - **collection**: The name of the edge collection to be used.\n\n\n\nExample:
\n\n",
+ "description": "\n\nChange one specific edge definition.\nThis will modify all occurrences of this definition in all graphs known to your database.\n\n**A json post document with these Properties is required:**\n\n - **to**: One or many edge collections that can contain target vertices. of type string\n - **from**: One or many vertex collections that can contain source vertices. of type string\n - **collection**: The name of the edge collection to be used.\n\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -4895,7 +4895,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"post": {
- "description": "\n\nAdds a vertex collection to the set of collections of the graph. If the\ncollection does not exist, it will be created.\n\n\nExample:
\n\n",
+ "description": "\n\nAdds a vertex collection to the set of collections of the graph. If the\ncollection does not exist, it will be created.\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"201": {
@@ -4915,7 +4915,7 @@
},
"/_api/gharial/{graph-name}/vertex/{collection-name}": {
"delete": {
- "description": "\n\nRemoves a vertex collection from the graph and optionally deletes the collection,\nif it is not used in any other graph.\n\n\nExample: ///\nYou can remove vertex collections that are not used in any edge collection:
\n\n\n",
+ "description": "\n\nRemoves a vertex collection from the graph and optionally deletes the collection,\nif it is not used in any other graph.\n\n\nExample: ///\nYou can remove vertex collections that are not used in any edge collection:
\n\n",
"parameters": [
{
"description": "The body has to be the JSON object to be stored.\n\n",
@@ -4995,7 +4995,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"get": {
- "description": "\n\nGets a vertex from the given collection.\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -5016,7 +5016,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"patch": {
- "description": "\n\nUpdates the data of the specific vertex in the collection.\n\n\nfree style json body\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The body has to contain a JSON object containing exactly the attributes that should be replaced.\n\n",
@@ -5052,7 +5052,7 @@
"x-filename": "Graph - js/apps/system/_api/gharial/APP/gharial.js"
},
"put": {
- "description": "\n\nReplaces the data of a vertex in the collection.\n\n\nfree style json body\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The body has to be the JSON object to be stored.\n\n",
@@ -5297,7 +5297,7 @@
},
"/_api/index": {
"get": {
- "description": "\n\n\nReturns an object with an attribute *indexes* containing an array of all\nindex descriptions for the given collection. The same information is also\navailable in the *identifiers* as an object with the index handles as\nkeys.\n\n\nExample: Return information about all indexes
\n\n",
+ "description": "\n\n\nReturns an object with an attribute *indexes* containing an array of all\nindex descriptions for the given collection. The same information is also\navailable in the *identifiers* as an object with the index handles as\nkeys.\n\n\nExample: Return information about all indexes
\n\n",
"parameters": [
{
"description": "The collection name.\n\n",
@@ -5320,7 +5320,7 @@
"x-filename": "Indexes - js/actions/api-index.js"
},
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **fields**: an array of attribute paths. of type string\n - **unique**: if *true*, then create a unique index.\n - **type**: must be equal to *\"skiplist\"*.\n - **sparse**: if *true*, then create a sparse index.\n\n\n\n\n\nCreates a skip-list index for the collection *collection-name*, if\nit does not already exist. The call expects an object containing the index\ndetails.\n\nIn a sparse index all documents will be excluded from the index that do not \ncontain at least one of the specified index attributes (i.e. *fields*) or that \nhave a value of *null* in any of the specified index attributes. Such documents \nwill not be indexed, and not be taken into account for uniqueness checks if\nthe *unique* flag is set.\n\nIn a non-sparse index, these documents will be indexed (for non-present\nindexed attributes, a value of *null* will be used) and will be taken into\naccount for uniqueness checks if the *unique* flag is set.\n\n**Note**: unique indexes on non-shard keys are not supported in a cluster.\n\n\nExample: Creating a skiplist index
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **fields**: an array of attribute paths. of type string\n - **unique**: if *true*, then create a unique index.\n - **type**: must be equal to *\"skiplist\"*.\n - **sparse**: if *true*, then create a sparse index.\n\n\n\n\n\nCreates a skip-list index for the collection *collection-name*, if\nit does not already exist. The call expects an object containing the index\ndetails.\n\nIn a sparse index all documents will be excluded from the index that do not \ncontain at least one of the specified index attributes (i.e. *fields*) or that \nhave a value of *null* in any of the specified index attributes. Such documents \nwill not be indexed, and not be taken into account for uniqueness checks if\nthe *unique* flag is set.\n\nIn a non-sparse index, these documents will be indexed (for non-present\nindexed attributes, a value of *null* will be used) and will be taken into\naccount for uniqueness checks if the *unique* flag is set.\n\n**Note**: unique indexes on non-shard keys are not supported in a cluster.\n\n\nExample: Creating a skiplist index
\n\n",
"parameters": [
{
"description": "The collection name.\n\n\n",
@@ -5363,7 +5363,7 @@
},
"/_api/index#CapConstraints": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **byteSize**: The maximal size of the active document data in the collection\n (in bytes). If specified, the value must be at least 16384.\n - **type**: must be equal to *\"cap\"*.\n - **size**: The maximal number of documents for the collection. If specified,\n the value must be greater than zero.\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\n\nCreates a cap constraint for the collection *collection-name*,\nif it does not already exist. Expects an object containing the index details.\n\n**Note**: The cap constraint does not index particular attributes of the\ndocuments in a collection, but limits the number of documents in the\ncollection to a maximum value. The cap constraint thus does not support\nattribute names specified in the *fields* attribute nor uniqueness of\nany kind via the *unique* attribute.\n\nIt is allowed to specify either *size* or *byteSize*, or both at\nthe same time. If both are specified, then the automatic document removal\nwill be triggered by the first non-met constraint.\n\n\nExample: Creating a cap constraint
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **byteSize**: The maximal size of the active document data in the collection\n (in bytes). If specified, the value must be at least 16384.\n - **type**: must be equal to *\"cap\"*.\n - **size**: The maximal number of documents for the collection. If specified,\n the value must be greater than zero.\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\n\nCreates a cap constraint for the collection *collection-name*,\nif it does not already exist. Expects an object containing the index details.\n\n**Note**: The cap constraint does not index particular attributes of the\ndocuments in a collection, but limits the number of documents in the\ncollection to a maximum value. The cap constraint thus does not support\nattribute names specified in the *fields* attribute nor uniqueness of\nany kind via the *unique* attribute.\n\nIt is allowed to specify either *size* or *byteSize*, or both at\nthe same time. If both are specified, then the automatic document removal\nwill be triggered by the first non-met constraint.\n\n\nExample: Creating a cap constraint
\n\n",
"parameters": [
{
"description": "The collection name.\n\n",
@@ -5406,7 +5406,7 @@
},
"/_api/index#fulltext": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **fields**: an array of attribute names. Currently, the array is limited\n to exactly one attribute. of type string\n - **type**: must be equal to *\"fulltext\"*.\n - **minLength**: Minimum character length of words to index. Will default\n to a server-defined value if unspecified. It is thus recommended to set\n this value explicitly when creating the index.\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\nCreates a fulltext index for the collection *collection-name*, if\nit does not already exist. The call expects an object containing the index\ndetails.\n\n\nExample: Creating a fulltext index
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **fields**: an array of attribute names. Currently, the array is limited\n to exactly one attribute. of type string\n - **type**: must be equal to *\"fulltext\"*.\n - **minLength**: Minimum character length of words to index. Will default\n to a server-defined value if unspecified. It is thus recommended to set\n this value explicitly when creating the index.\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\nCreates a fulltext index for the collection *collection-name*, if\nit does not already exist. The call expects an object containing the index\ndetails.\n\n\nExample: Creating a fulltext index
\n\n",
"parameters": [
{
"description": "The collection name.\n\n",
@@ -5491,7 +5491,7 @@
},
"/_api/index#geo": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **fields**: An array with one or two attribute paths.\n If it is an array with one attribute path *location*, then a geo-spatial\n index on all documents is created using *location* as path to the\n coordinates. The value of the attribute must be an array with at least two\n double values. The array must contain the latitude (first value) and the\n longitude (second value). All documents, which do not have the attribute\n path or with value that are not suitable, are ignored.\n If it is an array with two attribute paths *latitude* and *longitude*,\n then a geo-spatial index on all documents is created using *latitude*\n and *longitude* as paths the latitude and the longitude. The value of\n the attribute *latitude* and of the attribute *longitude* must a\n double. All documents, which do not have the attribute paths or which\n values are not suitable, are ignored. of type string\n - **type**: must be equal to *\"geo\"*.\n - **geoJson**: If a geo-spatial index on a *location* is constructed\n and *geoJson* is *true*, then the order within the array is longitude\n followed by latitude. This corresponds to the format described in\n http://geojson.org/geojson-spec.html#positions\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\nCreates a geo-spatial index in the collection *collection-name*, if\nit does not already exist. Expects an object containing the index details.\n\nGeo indexes are always sparse, meaning that documents that do not contain\nthe index attributes or have non-numeric values in the index attributes\nwill not be indexed.\n\n\nExample: Creating a geo index with a location attribute
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **fields**: An array with one or two attribute paths.\n If it is an array with one attribute path *location*, then a geo-spatial\n index on all documents is created using *location* as path to the\n coordinates. The value of the attribute must be an array with at least two\n double values. The array must contain the latitude (first value) and the\n longitude (second value). All documents, which do not have the attribute\n path or with value that are not suitable, are ignored.\n If it is an array with two attribute paths *latitude* and *longitude*,\n then a geo-spatial index on all documents is created using *latitude*\n and *longitude* as paths the latitude and the longitude. The value of\n the attribute *latitude* and of the attribute *longitude* must a\n double. All documents, which do not have the attribute paths or which\n values are not suitable, are ignored. of type string\n - **type**: must be equal to *\"geo\"*.\n - **geoJson**: If a geo-spatial index on a *location* is constructed\n and *geoJson* is *true*, then the order within the array is longitude\n followed by latitude. This corresponds to the format described in\n http://geojson.org/geojson-spec.html#positions\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\nCreates a geo-spatial index in the collection *collection-name*, if\nit does not already exist. Expects an object containing the index details.\n\nGeo indexes are always sparse, meaning that documents that do not contain\nthe index attributes or have non-numeric values in the index attributes\nwill not be indexed.\n\n\nExample: Creating a geo index with a location attribute
\n\n",
"parameters": [
{
"description": "The collection name.\n\n\n",
@@ -5531,7 +5531,7 @@
},
"/_api/index#hash": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **fields**: an array of attribute paths. of type string\n - **unique**: if *true*, then create a unique index.\n - **type**: must be equal to *\"hash\"*.\n - **sparse**: if *true*, then create a sparse index.\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\nCreates a hash index for the collection *collection-name* if it\ndoes not already exist. The call expects an object containing the index\ndetails.\n\nIn a sparse index all documents will be excluded from the index that do not \ncontain at least one of the specified index attributes (i.e. *fields*) or that \nhave a value of *null* in any of the specified index attributes. Such documents \nwill not be indexed, and not be taken into account for uniqueness checks if\nthe *unique* flag is set.\n\nIn a non-sparse index, these documents will be indexed (for non-present\nindexed attributes, a value of *null* will be used) and will be taken into\naccount for uniqueness checks if the *unique* flag is set.\n\n**Note**: unique indexes on non-shard keys are not supported in a cluster.\n\n\nExample: Creating an unique constraint
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **fields**: an array of attribute paths. of type string\n - **unique**: if *true*, then create a unique index.\n - **type**: must be equal to *\"hash\"*.\n - **sparse**: if *true*, then create a sparse index.\n\n\n\n\n**NOTE** Swagger examples won't work due to the anchor.\n\n\nCreates a hash index for the collection *collection-name* if it\ndoes not already exist. The call expects an object containing the index\ndetails.\n\nIn a sparse index all documents will be excluded from the index that do not \ncontain at least one of the specified index attributes (i.e. *fields*) or that \nhave a value of *null* in any of the specified index attributes. Such documents \nwill not be indexed, and not be taken into account for uniqueness checks if\nthe *unique* flag is set.\n\nIn a non-sparse index, these documents will be indexed (for non-present\nindexed attributes, a value of *null* will be used) and will be taken into\naccount for uniqueness checks if the *unique* flag is set.\n\n**Note**: unique indexes on non-shard keys are not supported in a cluster.\n\n\nExample: Creating an unique constraint
\n\n",
"parameters": [
{
"description": "The index handle.\n\n",
@@ -5630,7 +5630,7 @@
},
"/_api/job/{job-id}": {
"get": {
- "description": "\n\nReturns the processing status of the specified job. The processing status can be \ndetermined by peeking into the HTTP response code of the response.\n\n\nExample: Querying the status of a done job:
\n\n",
+ "description": "\n\nReturns the processing status of the specified job. The processing status can be \ndetermined by peeking into the HTTP response code of the response.\n\n\nExample: Querying the status of a done job:
\n\n",
"parameters": [
{
"description": "The async job id.\n\n",
@@ -5660,7 +5660,7 @@
"x-filename": "job - arangod/HttpServer/AsyncJobManager.cpp, arangod/RestHandler/RestJobHandler.cpp"
},
"put": {
- "description": "\n\nReturns the result of an async job identified by job-id. If the async job \nresult is present on the server, the result will be removed from the list of\nresult. That means this method can be called for each job-id once.\nThe method will return the original job result's headers and body, plus the \nadditional HTTP header x-arango-async-job-id. If this header is present, then \nthe job was found and the response contains the original job's result. If \nthe header is not present, the job was not found and the response contains \nstatus information from the job manager.\n\n\nExample: Not providing a job-id:
\nExample: Fetching the result of an HTTP POST job that failed:
shell> curl -X PUT --header 'x-arango-async: store' --data-binary @- --dump - http://localhost:8529/_api/collection <<EOF\n{ \n \"name\" : \" this name is invalid \" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 627354030\n\nshell> curl -X PUT --dump - http://localhost:8529/_api/job/627354030\n\nHTTP/1.1400 Bad Request\ncontent-type: application/json; charset=utf-8\nx-arango-async-id: 627354030\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"expected PUT /_api/collection/<collection-name>/<action>\" \n}\n
\n\n",
+ "description": "\n\nReturns the result of an async job identified by job-id. If the async job \nresult is present on the server, the result will be removed from the list of\nresult. That means this method can be called for each job-id once.\nThe method will return the original job result's headers and body, plus the \nadditional HTTP header x-arango-async-job-id. If this header is present, then \nthe job was found and the response contains the original job's result. If \nthe header is not present, the job was not found and the response contains \nstatus information from the job manager.\n\n\nExample: Not providing a job-id:
\nExample: Fetching the result of an HTTP POST job that failed:
shell> curl -X PUT --header 'x-arango-async: store' --data-binary @- --dump - http://localhost:8529/_api/collection <<EOF\n{ \n \"name\" : \" this name is invalid \" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 624277041\n\nshell> curl -X PUT --dump - http://localhost:8529/_api/job/624277041\n\nHTTP/1.1400 Bad Request\ncontent-type: application/json; charset=utf-8\nx-arango-async-id: 624277041\n\n{ \n \"error\" : true, \n \"code\" : 400, \n \"errorNum\" : 400, \n \"errorMessage\" : \"expected PUT /_api/collection/<collection-name>/<action>\" \n}\n
\n\n",
"parameters": [
{
"description": "The async job id.\n\n",
@@ -5692,7 +5692,7 @@
},
"/_api/job/{job-id}/cancel": {
"put": {
- "description": "\n\nCancels the currently running job identified by job-id. Note that it still \nmight take some time to actually cancel the running async job.\n\n\nExample:
shell> curl -X POST --header 'x-arango-async: store' --data-binary @- --dump - http://localhost:8529/_api/cursor <<EOF\n{ \n \"query\" : \"FOR i IN 1..10 FOR j IN 1..10 LET x = sleep(1.0) FILTER i == 5 && j == 5 RETURN 42\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 626960814\n\nshell> curl --dump - http://localhost:8529/_api/job/pending\n\nHTTP/1.1200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n \"626960814\" \n]\nshell> curl -X PUT --dump - http://localhost:8529/_api/job/626960814/cancel\n\nHTTP/1.1200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true \n}\nshell> curl --dump - http://localhost:8529/_api/job/pending\n\nHTTP/1.1200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n \"626960814\" \n]\n
\n\n",
+ "description": "\n\nCancels the currently running job identified by job-id. Note that it still \nmight take some time to actually cancel the running async job.\n\n\nExample:
shell> curl -X POST --header 'x-arango-async: store' --data-binary @- --dump - http://localhost:8529/_api/cursor <<EOF\n{ \n \"query\" : \"FOR i IN 1..10 FOR j IN 1..10 LET x = sleep(1.0) FILTER i == 5 && j == 5 RETURN 42\" \n}\nEOF\n\nHTTP/1.1 202 Accepted\ncontent-type: text/plain; charset=utf-8\nx-arango-async-id: 623883825\n\nshell> curl --dump - http://localhost:8529/_api/job/pending\n\nHTTP/1.1200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n \"623883825\" \n]\nshell> curl -X PUT --dump - http://localhost:8529/_api/job/623883825/cancel\n\nHTTP/1.1200 OK\ncontent-type: application/json; charset=utf-8\n\n{ \n \"result\" : true \n}\nshell> curl --dump - http://localhost:8529/_api/job/pending\n\nHTTP/1.1200 OK\ncontent-type: application/json; charset=utf-8\n\n[ \n \"623883825\" \n]\n
\n\n",
"parameters": [
{
"description": "The async job id.\n\n",
@@ -5724,7 +5724,7 @@
},
"/_api/job/{type}": {
"delete": {
- "description": "\n\nDeletes either all job results, expired job results, or the result of a specific job. \nClients can use this method to perform an eventual garbage collection of job results.\n\n\nExample: Deleting all jobs:
\n\n",
+ "description": "\n\nDeletes either all job results, expired job results, or the result of a specific job. \nClients can use this method to perform an eventual garbage collection of job results.\n\n\nExample: Deleting all jobs:
\n\n",
"parameters": [
{
"description": "The type of jobs to delete. type can be:\n* *all*: Deletes all jobs results. Currently executing or queued async \n jobs will not be stopped by this call.\n* *expired*: Deletes expired results. To determine the expiration status of a \n result, pass the stamp query parameter. stamp needs to be a UNIX timestamp, \n and all async job results created at a lower timestamp will be deleted.\n* *an actual job-id*: In this case, the call will remove the result of the \n specified async job. If the job is currently executing or queued, it will not be aborted.\n\n",
@@ -5754,7 +5754,7 @@
"x-filename": "job - arangod/HttpServer/AsyncJobManager.cpp, arangod/RestHandler/RestJobHandler.cpp"
},
"get": {
- "description": "\n\nReturns the list of ids of async jobs with a specific status (either done or pending). \nThe list can be used by the client to get an overview of the job system status and \nto retrieve completed job results later.\n\n\nExample: Fetching the list of done jobs:
\n\n",
+ "description": "\n\nReturns the list of ids of async jobs with a specific status (either done or pending). \nThe list can be used by the client to get an overview of the job system status and \nto retrieve completed job results later.\n\n\nExample: Fetching the list of done jobs:
\n\n",
"parameters": [
{
"description": "The type of jobs to return. The type can be either done or pending. Setting \nthe type to done will make the method return the ids of already completed async \njobs for which results can be fetched. Setting the type to pending will return \nthe ids of not yet finished async jobs.\n\n",
@@ -6076,7 +6076,7 @@
},
"/_api/replication/applier-start": {
"put": {
- "description": "\n\nStarts the replication applier. This will return immediately if the\nreplication applier is already running.\n\nIf the replication applier is not already running, the applier configuration\nwill be checked, and if it is complete, the applier will be started in a\nbackground thread. This means that even if the applier will encounter any\nerrors while running, they will not be reported in the response to this\nmethod.\n\nTo detect replication applier errors after the applier was started, use the\n*/_api/replication/applier-state* API instead.\n\n\nExample:
\n\n",
+ "description": "\n\nStarts the replication applier. This will return immediately if the\nreplication applier is already running.\n\nIf the replication applier is not already running, the applier configuration\nwill be checked, and if it is complete, the applier will be started in a\nbackground thread. This means that even if the applier will encounter any\nerrors while running, they will not be reported in the response to this\nmethod.\n\nTo detect replication applier errors after the applier was started, use the\n*/_api/replication/applier-state* API instead.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The remote *lastLogTick* value from which to start applying. If not specified,\nthe last saved tick from the previous applier run is used. If there is no\nprevious applier state saved, the applier will start at the beginning of the\nlogger server's log.\n\n",
@@ -6110,7 +6110,7 @@
},
"/_api/replication/applier-state": {
"get": {
- "description": "\n\nReturns the state of the replication applier, regardless of whether the\napplier is currently running or not.\n\nThe response is a JSON object with the following attributes:\n\n- *state*: a JSON object with the following sub-attributes:\n\n - *running*: whether or not the applier is active and running\n\n - *lastAppliedContinuousTick*: the last tick value from the continuous\n replication log the applier has applied.\n\n - *lastProcessedContinuousTick*: the last tick value from the continuous\n replication log the applier has processed.\n\n Regularly, the last applied and last processed tick values should be\n identical. For transactional operations, the replication applier will first\n process incoming log events before applying them, so the processed tick\n value might be higher than the applied tick value. This will be the case\n until the applier encounters the *transaction commit* log event for the\n transaction.\n\n - *lastAvailableContinuousTick*: the last tick value the logger server can\n provide.\n\n - *time*: the time on the applier server.\n\n - *totalRequests*: the total number of requests the applier has made to the\n endpoint.\n\n - *totalFailedConnects*: the total number of failed connection attempts the\n applier has made.\n\n - *totalEvents*: the total number of log events the applier has processed.\n\n - *totalOperationsExcluded*: the total number of log events excluded because\n of *restrictCollections*.\n\n - *progress*: a JSON object with details about the replication applier progress.\n It contains the following sub-attributes if there is progress to report:\n\n - *message*: a textual description of the progress\n\n - *time*: the date and time the progress was logged\n\n - *failedConnects*: the current number of failed connection attempts\n\n - *lastError*: a JSON object with details about the last error that happened on\n the applier. It contains the following sub-attributes if there was an error:\n\n - *errorNum*: a numerical error code\n\n - *errorMessage*: a textual error description\n\n - *time*: the date and time the error occurred\n\n In case no error has occurred, *lastError* will be empty.\n\n- *server*: a JSON object with the following sub-attributes:\n\n - *version*: the applier server's version\n\n - *serverId*: the applier server's id\n\n- *endpoint*: the endpoint the applier is connected to (if applier is\n active) or will connect to (if applier is currently inactive)\n\n- *database*: the name of the database the applier is connected to (if applier is\n active) or will connect to (if applier is currently inactive)\n\n\nExample: Fetching the state of an inactive applier:
\n\n",
+ "description": "\n\nReturns the state of the replication applier, regardless of whether the\napplier is currently running or not.\n\nThe response is a JSON object with the following attributes:\n\n- *state*: a JSON object with the following sub-attributes:\n\n - *running*: whether or not the applier is active and running\n\n - *lastAppliedContinuousTick*: the last tick value from the continuous\n replication log the applier has applied.\n\n - *lastProcessedContinuousTick*: the last tick value from the continuous\n replication log the applier has processed.\n\n Regularly, the last applied and last processed tick values should be\n identical. For transactional operations, the replication applier will first\n process incoming log events before applying them, so the processed tick\n value might be higher than the applied tick value. This will be the case\n until the applier encounters the *transaction commit* log event for the\n transaction.\n\n - *lastAvailableContinuousTick*: the last tick value the logger server can\n provide.\n\n - *time*: the time on the applier server.\n\n - *totalRequests*: the total number of requests the applier has made to the\n endpoint.\n\n - *totalFailedConnects*: the total number of failed connection attempts the\n applier has made.\n\n - *totalEvents*: the total number of log events the applier has processed.\n\n - *totalOperationsExcluded*: the total number of log events excluded because\n of *restrictCollections*.\n\n - *progress*: a JSON object with details about the replication applier progress.\n It contains the following sub-attributes if there is progress to report:\n\n - *message*: a textual description of the progress\n\n - *time*: the date and time the progress was logged\n\n - *failedConnects*: the current number of failed connection attempts\n\n - *lastError*: a JSON object with details about the last error that happened on\n the applier. It contains the following sub-attributes if there was an error:\n\n - *errorNum*: a numerical error code\n\n - *errorMessage*: a textual error description\n\n - *time*: the date and time the error occurred\n\n In case no error has occurred, *lastError* will be empty.\n\n- *server*: a JSON object with the following sub-attributes:\n\n - *version*: the applier server's version\n\n - *serverId*: the applier server's id\n\n- *endpoint*: the endpoint the applier is connected to (if applier is\n active) or will connect to (if applier is currently inactive)\n\n- *database*: the name of the database the applier is connected to (if applier is\n active) or will connect to (if applier is currently inactive)\n\n\nExample: Fetching the state of an inactive applier:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -6291,7 +6291,7 @@
},
"/_api/replication/dump": {
"get": {
- "description": "\n\nReturns the data from the collection for the requested range.\n\nWhen the *from* query parameter is not used, collection events are returned from\nthe beginning. When the *from* parameter is used, the result will only contain\ncollection entries which have higher tick values than the specified *from* value\n(note: the log entry with a tick value equal to *from* will be excluded).\n\nThe *to* query parameter can be used to optionally restrict the upper bound of\nthe result to a certain tick value. If used, the result will only contain\ncollection entries with tick values up to (including) *to*.\n\nThe *chunkSize* query parameter can be used to control the size of the result.\nIt must be specified in bytes. The *chunkSize* value will only be honored\napproximately. Otherwise a too low *chunkSize* value could cause the server\nto not be able to put just one entry into the result and return it.\nTherefore, the *chunkSize* value will only be consulted after an entry has\nbeen written into the result. If the result size is then bigger than\n*chunkSize*, the server will respond with as many entries as there are\nin the response already. If the result size is still smaller than *chunkSize*,\nthe server will try to return more data if there's more data left to return.\n\nIf *chunkSize* is not specified, some server-side default value will be used.\n\nThe *Content-Type* of the result is *application/x-arango-dump*. This is an\neasy-to-process format, with all entries going onto separate lines in the\nresponse body.\n\nEach line itself is a JSON object, with at least the following attributes:\n\n- *tick*: the operation's tick attribute\n\n- *key*: the key of the document/edge or the key used in the deletion operation\n\n- *rev*: the revision id of the document/edge or the deletion operation\n\n- *data*: the actual document/edge data for types 2300 and 2301. The full\n document/edge data will be returned even for updates.\n\n- *type*: the type of entry. Possible values for *type* are:\n\n - 2300: document insertion/update\n\n - 2301: edge insertion/update\n\n - 2302: document/edge deletion\n\n**Note**: there will be no distinction between inserts and updates when calling this method.\n\n\nExample: Empty collection:
\n\n",
+ "description": "\n\nReturns the data from the collection for the requested range.\n\nWhen the *from* query parameter is not used, collection events are returned from\nthe beginning. When the *from* parameter is used, the result will only contain\ncollection entries which have higher tick values than the specified *from* value\n(note: the log entry with a tick value equal to *from* will be excluded).\n\nThe *to* query parameter can be used to optionally restrict the upper bound of\nthe result to a certain tick value. If used, the result will only contain\ncollection entries with tick values up to (including) *to*.\n\nThe *chunkSize* query parameter can be used to control the size of the result.\nIt must be specified in bytes. The *chunkSize* value will only be honored\napproximately. Otherwise a too low *chunkSize* value could cause the server\nto not be able to put just one entry into the result and return it.\nTherefore, the *chunkSize* value will only be consulted after an entry has\nbeen written into the result. If the result size is then bigger than\n*chunkSize*, the server will respond with as many entries as there are\nin the response already. If the result size is still smaller than *chunkSize*,\nthe server will try to return more data if there's more data left to return.\n\nIf *chunkSize* is not specified, some server-side default value will be used.\n\nThe *Content-Type* of the result is *application/x-arango-dump*. This is an\neasy-to-process format, with all entries going onto separate lines in the\nresponse body.\n\nEach line itself is a JSON object, with at least the following attributes:\n\n- *tick*: the operation's tick attribute\n\n- *key*: the key of the document/edge or the key used in the deletion operation\n\n- *rev*: the revision id of the document/edge or the deletion operation\n\n- *data*: the actual document/edge data for types 2300 and 2301. The full\n document/edge data will be returned even for updates.\n\n- *type*: the type of entry. Possible values for *type* are:\n\n - 2300: document insertion/update\n\n - 2301: edge insertion/update\n\n - 2302: document/edge deletion\n\n**Note**: there will be no distinction between inserts and updates when calling this method.\n\n\nExample: Empty collection:
\n\n",
"parameters": [
{
"description": "The name or id of the collection to dump.\n\n",
@@ -6380,7 +6380,7 @@
},
"/_api/replication/inventory": {
"get": {
- "description": "\n\nReturns the array of collections and indexes available on the server. This\narray can be used by replication clients to initiate an initial sync with the\nserver.\n\nThe response will contain a JSON object with the *collection* and *state* and\n*tick* attributes.\n\n*collections* is a array of collections with the following sub-attributes:\n\n- *parameters*: the collection properties\n\n- *indexes*: a array of the indexes of a the collection. Primary indexes and edges indexes\n are not included in this array.\n\nThe *state* attribute contains the current state of the replication logger. It\ncontains the following sub-attributes:\n\n- *running*: whether or not the replication logger is currently active. Note:\n since ArangoDB 2.2, the value will always be *true*\n\n- *lastLogTick*: the value of the last tick the replication logger has written\n\n- *time*: the current time on the server\n\nReplication clients should note the *lastLogTick* value returned. They can then\nfetch collections' data using the dump method up to the value of lastLogTick, and\nquery the continuous replication log for log events after this tick value.\n\nTo create a full copy of the collections on the server, a replication client\ncan execute these steps:\n\n- call the */inventory* API method. This returns the *lastLogTick* value and the\n array of collections and indexes from the server.\n\n- for each collection returned by */inventory*, create the collection locally and\n call */dump* to stream the collection data to the client, up to the value of\n *lastLogTick*.\n After that, the client can create the indexes on the collections as they were\n reported by */inventory*.\n\nIf the clients wants to continuously stream replication log events from the logger\nserver, the following additional steps need to be carried out:\n\n- the client should call */logger-follow* initially to fetch the first batch of\n replication events that were logged after the client's call to */inventory*.\n\n The call to */logger-follow* should use a *from* parameter with the value of the\n *lastLogTick* as reported by */inventory*. The call to */logger-follow* will return the\n *x-arango-replication-lastincluded* which will contain the last tick value included\n in the response.\n\n- the client can then continuously call */logger-follow* to incrementally fetch new\n replication events that occurred after the last transfer.\n\n Calls should use a *from* parameter with the value of the *x-arango-replication-lastincluded*\n header of the previous response. If there are no more replication events, the\n response will be empty and clients can go to sleep for a while and try again\n later.\n\n**Note**: on a coordinator, this request must have the query parameter\n*DBserver* which must be an ID of a DBserver.\nThe very same request is forwarded synchronously to that DBserver.\nIt is an error if this attribute is not bound in the coordinator case.\n\n\nExample:
\n\n",
+ "description": "\n\nReturns the array of collections and indexes available on the server. This\narray can be used by replication clients to initiate an initial sync with the\nserver.\n\nThe response will contain a JSON object with the *collection* and *state* and\n*tick* attributes.\n\n*collections* is a array of collections with the following sub-attributes:\n\n- *parameters*: the collection properties\n\n- *indexes*: a array of the indexes of a the collection. Primary indexes and edges indexes\n are not included in this array.\n\nThe *state* attribute contains the current state of the replication logger. It\ncontains the following sub-attributes:\n\n- *running*: whether or not the replication logger is currently active. Note:\n since ArangoDB 2.2, the value will always be *true*\n\n- *lastLogTick*: the value of the last tick the replication logger has written\n\n- *time*: the current time on the server\n\nReplication clients should note the *lastLogTick* value returned. They can then\nfetch collections' data using the dump method up to the value of lastLogTick, and\nquery the continuous replication log for log events after this tick value.\n\nTo create a full copy of the collections on the server, a replication client\ncan execute these steps:\n\n- call the */inventory* API method. This returns the *lastLogTick* value and the\n array of collections and indexes from the server.\n\n- for each collection returned by */inventory*, create the collection locally and\n call */dump* to stream the collection data to the client, up to the value of\n *lastLogTick*.\n After that, the client can create the indexes on the collections as they were\n reported by */inventory*.\n\nIf the clients wants to continuously stream replication log events from the logger\nserver, the following additional steps need to be carried out:\n\n- the client should call */logger-follow* initially to fetch the first batch of\n replication events that were logged after the client's call to */inventory*.\n\n The call to */logger-follow* should use a *from* parameter with the value of the\n *lastLogTick* as reported by */inventory*. The call to */logger-follow* will return the\n *x-arango-replication-lastincluded* which will contain the last tick value included\n in the response.\n\n- the client can then continuously call */logger-follow* to incrementally fetch new\n replication events that occurred after the last transfer.\n\n Calls should use a *from* parameter with the value of the *x-arango-replication-lastincluded*\n header of the previous response. If there are no more replication events, the\n response will be empty and clients can go to sleep for a while and try again\n later.\n\n**Note**: on a coordinator, this request must have the query parameter\n*DBserver* which must be an ID of a DBserver.\nThe very same request is forwarded synchronously to that DBserver.\nIt is an error if this attribute is not bound in the coordinator case.\n\n\nExample:
\n\n",
"parameters": [
{
"description": "Include system collections in the result. The default value is *true*.\n\n",
@@ -6411,7 +6411,7 @@
},
"/_api/replication/logger-first-tick": {
"get": {
- "description": "\n\nReturns the first available tick value that can be served from the server's\nreplication log. This method can be called by replication clients after to\ndetermine if certain data (identified by a tick value) is still available\nfor replication.\n\nThe result is a JSON object containing the attribute *firstTick*. This\nattribute contains the minimum tick value available in the server's replication\nlog. \n\n**Note**: this method is not supported on a coordinator in a cluster.\n\n\nExample: Returning the first available tick
\n\n",
+ "description": "\n\nReturns the first available tick value that can be served from the server's\nreplication log. This method can be called by replication clients after to\ndetermine if certain data (identified by a tick value) is still available\nfor replication.\n\nThe result is a JSON object containing the attribute *firstTick*. This\nattribute contains the minimum tick value available in the server's replication\nlog. \n\n**Note**: this method is not supported on a coordinator in a cluster.\n\n\nExample: Returning the first available tick
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -6437,7 +6437,7 @@
},
"/_api/replication/logger-follow": {
"get": {
- "description": "\n\nReturns data from the server's replication log. This method can be called\nby replication clients after an initial synchronization of data. The method\nwill return all \"recent\" log entries from the logger server, and the clients\ncan replay and apply these entries locally so they get to the same data\nstate as the logger server.\n\nClients can call this method repeatedly to incrementally fetch all changes\nfrom the logger server. In this case, they should provide the *from* value so\nthey will only get returned the log events since their last fetch.\n\nWhen the *from* query parameter is not used, the logger server will return log\nentries starting at the beginning of its replication log. When the *from*\nparameter is used, the logger server will only return log entries which have\nhigher tick values than the specified *from* value (note: the log entry with a\ntick value equal to *from* will be excluded). Use the *from* value when\nincrementally fetching log data.\n\nThe *to* query parameter can be used to optionally restrict the upper bound of\nthe result to a certain tick value. If used, the result will contain only log events\nwith tick values up to (including) *to*. In incremental fetching, there is no\nneed to use the *to* parameter. It only makes sense in special situations,\nwhen only parts of the change log are required.\n\nThe *chunkSize* query parameter can be used to control the size of the result.\nIt must be specified in bytes. The *chunkSize* value will only be honored\napproximately. Otherwise a too low *chunkSize* value could cause the server\nto not be able to put just one log entry into the result and return it.\nTherefore, the *chunkSize* value will only be consulted after a log entry has\nbeen written into the result. If the result size is then bigger than\n*chunkSize*, the server will respond with as many log entries as there are\nin the response already. If the result size is still smaller than *chunkSize*,\nthe server will try to return more data if there's more data left to return.\n\nIf *chunkSize* is not specified, some server-side default value will be used.\n\nThe *Content-Type* of the result is *application/x-arango-dump*. This is an\neasy-to-process format, with all log events going onto separate lines in the\nresponse body. Each log event itself is a JSON object, with at least the\nfollowing attributes:\n\n- *tick*: the log event tick value\n\n- *type*: the log event type\n\nIndividual log events will also have additional attributes, depending on the\nevent type. A few common attributes which are used for multiple events types\nare:\n\n- *cid*: id of the collection the event was for\n\n- *tid*: id of the transaction the event was contained in\n\n- *key*: document key\n\n- *rev*: document revision id\n\n- *data*: the original document data\n\nA more detailed description of the individual replication event types and their\ndata structures can be found in the manual.\n\nThe response will also contain the following HTTP headers:\n\n- *x-arango-replication-active*: whether or not the logger is active. Clients\n can use this flag as an indication for their polling frequency. If the\n logger is not active and there are no more replication events available, it\n might be sensible for a client to abort, or to go to sleep for a long time\n and try again later to check whether the logger has been activated.\n\n- *x-arango-replication-lastincluded*: the tick value of the last included\n value in the result. In incremental log fetching, this value can be used\n as the *from* value for the following request. **Note** that if the result is\n empty, the value will be *0*. This value should not be used as *from* value\n by clients in the next request (otherwise the server would return the log\n events from the start of the log again).\n\n- *x-arango-replication-lasttick*: the last tick value the logger server has\n logged (not necessarily included in the result). By comparing the the last\n tick and last included tick values, clients have an approximate indication of\n how many events there are still left to fetch.\n\n- *x-arango-replication-checkmore*: whether or not there already exists more\n log data which the client could fetch immediately. If there is more log data\n available, the client could call *logger-follow* again with an adjusted *from*\n value to fetch remaining log entries until there are no more.\n\n If there isn't any more log data to fetch, the client might decide to go\n to sleep for a while before calling the logger again.\n\n**Note**: this method is not supported on a coordinator in a cluster.\n\n\nExample: No log events available
\n\n",
+ "description": "\n\nReturns data from the server's replication log. This method can be called\nby replication clients after an initial synchronization of data. The method\nwill return all \"recent\" log entries from the logger server, and the clients\ncan replay and apply these entries locally so they get to the same data\nstate as the logger server.\n\nClients can call this method repeatedly to incrementally fetch all changes\nfrom the logger server. In this case, they should provide the *from* value so\nthey will only get returned the log events since their last fetch.\n\nWhen the *from* query parameter is not used, the logger server will return log\nentries starting at the beginning of its replication log. When the *from*\nparameter is used, the logger server will only return log entries which have\nhigher tick values than the specified *from* value (note: the log entry with a\ntick value equal to *from* will be excluded). Use the *from* value when\nincrementally fetching log data.\n\nThe *to* query parameter can be used to optionally restrict the upper bound of\nthe result to a certain tick value. If used, the result will contain only log events\nwith tick values up to (including) *to*. In incremental fetching, there is no\nneed to use the *to* parameter. It only makes sense in special situations,\nwhen only parts of the change log are required.\n\nThe *chunkSize* query parameter can be used to control the size of the result.\nIt must be specified in bytes. The *chunkSize* value will only be honored\napproximately. Otherwise a too low *chunkSize* value could cause the server\nto not be able to put just one log entry into the result and return it.\nTherefore, the *chunkSize* value will only be consulted after a log entry has\nbeen written into the result. If the result size is then bigger than\n*chunkSize*, the server will respond with as many log entries as there are\nin the response already. If the result size is still smaller than *chunkSize*,\nthe server will try to return more data if there's more data left to return.\n\nIf *chunkSize* is not specified, some server-side default value will be used.\n\nThe *Content-Type* of the result is *application/x-arango-dump*. This is an\neasy-to-process format, with all log events going onto separate lines in the\nresponse body. Each log event itself is a JSON object, with at least the\nfollowing attributes:\n\n- *tick*: the log event tick value\n\n- *type*: the log event type\n\nIndividual log events will also have additional attributes, depending on the\nevent type. A few common attributes which are used for multiple events types\nare:\n\n- *cid*: id of the collection the event was for\n\n- *tid*: id of the transaction the event was contained in\n\n- *key*: document key\n\n- *rev*: document revision id\n\n- *data*: the original document data\n\nA more detailed description of the individual replication event types and their\ndata structures can be found in the manual.\n\nThe response will also contain the following HTTP headers:\n\n- *x-arango-replication-active*: whether or not the logger is active. Clients\n can use this flag as an indication for their polling frequency. If the\n logger is not active and there are no more replication events available, it\n might be sensible for a client to abort, or to go to sleep for a long time\n and try again later to check whether the logger has been activated.\n\n- *x-arango-replication-lastincluded*: the tick value of the last included\n value in the result. In incremental log fetching, this value can be used\n as the *from* value for the following request. **Note** that if the result is\n empty, the value will be *0*. This value should not be used as *from* value\n by clients in the next request (otherwise the server would return the log\n events from the start of the log again).\n\n- *x-arango-replication-lasttick*: the last tick value the logger server has\n logged (not necessarily included in the result). By comparing the the last\n tick and last included tick values, clients have an approximate indication of\n how many events there are still left to fetch.\n\n- *x-arango-replication-checkmore*: whether or not there already exists more\n log data which the client could fetch immediately. If there is more log data\n available, the client could call *logger-follow* again with an adjusted *from*\n value to fetch remaining log entries until there are no more.\n\n If there isn't any more log data to fetch, the client might decide to go\n to sleep for a while before calling the logger again.\n\n**Note**: this method is not supported on a coordinator in a cluster.\n\n\nExample: No log events available
\n\n",
"parameters": [
{
"description": "Lower bound tick value for results.\n\n",
@@ -6498,7 +6498,7 @@
},
"/_api/replication/logger-state": {
"get": {
- "description": "\n\nReturns the current state of the server's replication logger. The state will\ninclude information about whether the logger is running and about the last\nlogged tick value. This tick value is important for incremental fetching of\ndata.\n\nThe body of the response contains a JSON object with the following\nattributes:\n\n- *state*: the current logger state as a JSON object with the following\n sub-attributes:\n\n - *running*: whether or not the logger is running\n\n - *lastLogTick*: the tick value of the latest tick the logger has logged.\n This value can be used for incremental fetching of log data.\n\n - *totalEvents*: total number of events logged since the server was started.\n The value is not reset between multiple stops and re-starts of the logger.\n\n - *time*: the current date and time on the logger server\n\n- *server*: a JSON object with the following sub-attributes:\n\n - *version*: the logger server's version\n\n - *serverId*: the logger server's id\n\n- *clients*: returns the last fetch status by replication clients connected to\n the logger. Each client is returned as a JSON object with the following attributes:\n\n - *serverId*: server id of client\n\n - *lastServedTick*: last tick value served to this client via the *logger-follow* API\n\n - *time*: date and time when this client last called the *logger-follow* API\n\n\nExample: Returns the state of the replication logger.
\n\n",
+ "description": "\n\nReturns the current state of the server's replication logger. The state will\ninclude information about whether the logger is running and about the last\nlogged tick value. This tick value is important for incremental fetching of\ndata.\n\nThe body of the response contains a JSON object with the following\nattributes:\n\n- *state*: the current logger state as a JSON object with the following\n sub-attributes:\n\n - *running*: whether or not the logger is running\n\n - *lastLogTick*: the tick value of the latest tick the logger has logged.\n This value can be used for incremental fetching of log data.\n\n - *totalEvents*: total number of events logged since the server was started.\n The value is not reset between multiple stops and re-starts of the logger.\n\n - *time*: the current date and time on the logger server\n\n- *server*: a JSON object with the following sub-attributes:\n\n - *version*: the logger server's version\n\n - *serverId*: the logger server's id\n\n- *clients*: returns the last fetch status by replication clients connected to\n the logger. Each client is returned as a JSON object with the following attributes:\n\n - *serverId*: server id of client\n\n - *lastServedTick*: last tick value served to this client via the *logger-follow* API\n\n - *time*: date and time when this client last called the *logger-follow* API\n\n\nExample: Returns the state of the replication logger.
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -6521,7 +6521,7 @@
},
"/_api/replication/logger-tick-ranges": {
"get": {
- "description": "\n\nReturns the currently available ranges of tick values for all currently\navailable WAL logfiles. The tick values can be used to determine if certain\ndata (identified by tick value) are still available for replication.\n\nThe body of the response contains a JSON array. Each array member is an object\nthat describes a single logfile. Each object has the following attributes:\n\n* *datafile*: name of the logfile\n\n* *status*: status of the datafile, in textual form (e.g. \"sealed\", \"open\")\n\n* *tickMin*: minimum tick value contained in logfile\n\n* *tickMax*: maximum tick value contained in logfile\n\n\nExample: Returns the available tick ranges.
\n\n",
+ "description": "\n\nReturns the currently available ranges of tick values for all currently\navailable WAL logfiles. The tick values can be used to determine if certain\ndata (identified by tick value) are still available for replication.\n\nThe body of the response contains a JSON array. Each array member is an object\nthat describes a single logfile. Each object has the following attributes:\n\n* *datafile*: name of the logfile\n\n* *status*: status of the datafile, in textual form (e.g. \"sealed\", \"open\")\n\n* *tickMin*: minimum tick value contained in logfile\n\n* *tickMax*: maximum tick value contained in logfile\n\n\nExample: Returns the available tick ranges.
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -6586,7 +6586,7 @@
},
"/_api/replication/server-id": {
"get": {
- "description": "\n\nReturns the servers id. The id is also returned by other replication API\nmethods, and this method is an easy means of determining a server's id.\n\nThe body of the response is a JSON object with the attribute *serverId*. The\nserver id is returned as a string.\n\n\nExample:
\n\n",
+ "description": "\n\nReturns the servers id. The id is also returned by other replication API\nmethods, and this method is an easy means of determining a server's id.\n\nThe body of the response is a JSON object with the attribute *serverId*. The\nserver id is returned as a string.\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -6648,7 +6648,7 @@
},
"/_api/simple/all": {
"put": {
- "description": "\nfree style json body\n\n\n\n\nReturns all documents of a collections. The call expects a JSON object\nas body with the following attributes:\n\n- *collection*: The name of the collection to query.\n\n- *skip*: The number of documents to skip in the query (optional).\n\n- *limit*: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\n\nExample: Limit the amount of documents using *limit*
\n\n",
+ "description": "\nfree style json body\n\n\n\n\nReturns all documents of a collections. The call expects a JSON object\nas body with the following attributes:\n\n- *collection*: The name of the collection to query.\n\n- *skip*: The number of documents to skip in the query (optional).\n\n- *limit*: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\n\nExample: Limit the amount of documents using *limit*
\n\n",
"parameters": [
{
"description": "Contains the query.\n\n",
@@ -6683,7 +6683,7 @@
},
"/_api/simple/any": {
"put": {
- "description": "\n\n\nReturns a random document from a collection. The call expects a JSON object\nas body with the following attributes:\n\n**A json post document with these Properties is required:**\n\n - **collection**: The identifier or name of the collection to query.\n Returns a JSON object with the document stored in the attribute\n *document* if the collection contains at least one document. If\n the collection is empty, the *document* attrbute contains null.\n\n\n\nExample:
\n\n",
+ "description": "\n\n\nReturns a random document from a collection. The call expects a JSON object\nas body with the following attributes:\n\n**A json post document with these Properties is required:**\n\n - **collection**: The identifier or name of the collection to query.\n Returns a JSON object with the document stored in the attribute\n *document* if the collection contains at least one document. If\n the collection is empty, the *document* attrbute contains null.\n\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -6716,7 +6716,7 @@
},
"/_api/simple/by-example": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **skip**: The number of documents to skip in the query (optional).\n - **limit**: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n - **example**: The example document.\n - **collection**: The name of the collection to query.\n\n\n\n\n\nThis will find all documents matching a given example.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\n\nExample: Matching an attribute
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **skip**: The number of documents to skip in the query (optional).\n - **limit**: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n - **example**: The example document.\n - **collection**: The name of the collection to query.\n\n\n\n\n\nThis will find all documents matching a given example.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\n\nExample: Matching an attribute
\n\n",
"parameters": [
{
"in": "body",
@@ -6749,7 +6749,7 @@
},
"/_api/simple/first": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **count**: the number of documents to return at most. Specifying count is\n optional. If it is not specified, it defaults to 1.\n - **collection**: the name of the collection\n\n\n\n\n\nThis will return the first document(s) from the collection, in the order of\ninsertion/update time. When the *count* argument is supplied, the result\nwill be an array of documents, with the \"oldest\" document being first in the\nresult array.\nIf the *count* argument is not supplied, the result is the \"oldest\" document\nof the collection, or *null* if the collection is empty.\n\nNote: this method is not supported for sharded collections with more than\none shard.\n\n\nExample: Retrieving the first n documents
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **count**: the number of documents to return at most. Specifying count is\n optional. If it is not specified, it defaults to 1.\n - **collection**: the name of the collection\n\n\n\n\n\nThis will return the first document(s) from the collection, in the order of\ninsertion/update time. When the *count* argument is supplied, the result\nwill be an array of documents, with the \"oldest\" document being first in the\nresult array.\nIf the *count* argument is not supplied, the result is the \"oldest\" document\nof the collection, or *null* if the collection is empty.\n\nNote: this method is not supported for sharded collections with more than\none shard.\n\n\nExample: Retrieving the first n documents
\n\n",
"parameters": [
{
"in": "body",
@@ -6782,7 +6782,7 @@
},
"/_api/simple/first-example": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **example**: The example document.\n - **collection**: The name of the collection to query.\n\n\n\n\n\nThis will return the first document matching a given example.\n\nReturns a result containing the document or *HTTP 404* if no\ndocument matched the example.\n\nIf more than one document in the collection matches the specified example, only\none of these documents will be returned, and it is undefined which of the matching\ndocuments is returned.\n\n\nExample: If a matching document was found
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **example**: The example document.\n - **collection**: The name of the collection to query.\n\n\n\n\n\nThis will return the first document matching a given example.\n\nReturns a result containing the document or *HTTP 404* if no\ndocument matched the example.\n\nIf more than one document in the collection matches the specified example, only\none of these documents will be returned, and it is undefined which of the matching\ndocuments is returned.\n\n\nExample: If a matching document was found
\n\n",
"parameters": [
{
"in": "body",
@@ -6815,7 +6815,7 @@
},
"/_api/simple/fulltext": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **index**: The identifier of the fulltext-index to use.\n - **attribute**: The attribute that contains the texts.\n - **collection**: The name of the collection to query.\n - **limit**: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n - **skip**: The number of documents to skip in the query (optional).\n - **query**: The fulltext query. Please refer to [Fulltext queries](../SimpleQueries/FulltextQueries.md)\n for details.\n\n\n\n\n\nThis will find all documents from the collection that match the fulltext\nquery specified in *query*.\n\nIn order to use the *fulltext* operator, a fulltext index must be defined\nfor the collection and the specified attribute.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *fulltext* simple query is **deprecated** as of ArangoDB 2.6. \nThis API may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection using the near operator is\nto issue an AQL query using the *FULLTEXT* [AQL function](../Aql/FulltextFunctions.md) \nas follows:\n\n\n FOR doc IN FULLTEXT(@@collection, @attributeName, @queryString, @limit) \n RETURN doc\n\n\nExample:
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **index**: The identifier of the fulltext-index to use.\n - **attribute**: The attribute that contains the texts.\n - **collection**: The name of the collection to query.\n - **limit**: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n - **skip**: The number of documents to skip in the query (optional).\n - **query**: The fulltext query. Please refer to [Fulltext queries](../SimpleQueries/FulltextQueries.md)\n for details.\n\n\n\n\n\nThis will find all documents from the collection that match the fulltext\nquery specified in *query*.\n\nIn order to use the *fulltext* operator, a fulltext index must be defined\nfor the collection and the specified attribute.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *fulltext* simple query is **deprecated** as of ArangoDB 2.6. \nThis API may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection using the near operator is\nto issue an AQL query using the *FULLTEXT* [AQL function](../Aql/FulltextFunctions.md) \nas follows:\n\n\n FOR doc IN FULLTEXT(@@collection, @attributeName, @queryString, @limit) \n RETURN doc\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -6848,7 +6848,7 @@
},
"/_api/simple/last": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **count**: the number of documents to return at most. Specifying count is\n optional. If it is not specified, it defaults to 1.\n - **collection**: the name of the collection\n\n\n\n\n\nThis will return the last documents from the collection, in the order of\ninsertion/update time. When the *count* argument is supplied, the result\nwill be an array of documents, with the \"latest\" document being first in the\nresult array.\n\nIf the *count* argument is not supplied, the result is the \"latest\" document\nof the collection, or *null* if the collection is empty.\n\nNote: this method is not supported for sharded collections with more than\none shard.\n\n\nExample: Retrieving the last n documents
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **count**: the number of documents to return at most. Specifying count is\n optional. If it is not specified, it defaults to 1.\n - **collection**: the name of the collection\n\n\n\n\n\nThis will return the last documents from the collection, in the order of\ninsertion/update time. When the *count* argument is supplied, the result\nwill be an array of documents, with the \"latest\" document being first in the\nresult array.\n\nIf the *count* argument is not supplied, the result is the \"latest\" document\nof the collection, or *null* if the collection is empty.\n\nNote: this method is not supported for sharded collections with more than\none shard.\n\n\nExample: Retrieving the last n documents
\n\n",
"parameters": [
{
"in": "body",
@@ -6881,7 +6881,7 @@
},
"/_api/simple/lookup-by-keys": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **keys**: array with the _keys of documents to remove. of type string\n - **collection**: The name of the collection to look in for the documents\n\n\n\n\nLooks up the documents in the specified collection using the array of keys\nprovided. All documents for which a matching key was specified in the *keys*\narray and that exist in the collection will be returned. \nKeys for which no document can be found in the underlying collection are ignored, \nand no exception will be thrown for them.\n\nThe body of the response contains a JSON object with a *documents* attribute. The\n*documents* attribute is an array containing the matching documents. The order in\nwhich matching documents are present in the result array is unspecified.\n\n\nExample: Looking up existing documents
\n\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **keys**: array with the _keys of documents to remove. of type string\n - **collection**: The name of the collection to look in for the documents\n\n\n\n\nLooks up the documents in the specified collection using the array of keys\nprovided. All documents for which a matching key was specified in the *keys*\narray and that exist in the collection will be returned. \nKeys for which no document can be found in the underlying collection are ignored, \nand no exception will be thrown for them.\n\nThe body of the response contains a JSON object with a *documents* attribute. The\n*documents* attribute is an array containing the matching documents. The order in\nwhich matching documents are present in the result array is unspecified.\n\n\nExample: Looking up existing documents
\n\n\n",
"parameters": [
{
"in": "body",
@@ -6914,7 +6914,7 @@
},
"/_api/simple/near": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **distance**: If given, the attribute key used to return the distance to\n the given coordinate. (optional). If specified, distances are returned in meters.\n - **skip**: The number of documents to skip in the query. (optional)\n - **longitude**: The longitude of the coordinate.\n - **limit**: The maximal amount of documents to return. The *skip* is\n applied before the *limit* restriction. The default is 100. (optional)\n - **collection**: The name of the collection to query.\n - **latitude**: The latitude of the coordinate.\n - **geo**: If given, the identifier of the geo-index to use. (optional)\n\n\n\n\n\nThe default will find at most 100 documents near the given coordinate. The\nreturned array is sorted according to the distance, with the nearest document\nbeing first in the return array. If there are near documents of equal distance, documents\nare chosen randomly from this set until the limit is reached.\n\nIn order to use the *near* operator, a geo index must be defined for the\ncollection. This index also defines which attribute holds the coordinates\nfor the document. If you have more than one geo-spatial index, you can use\nthe *geo* field to select a particular index.\n\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *near* simple query is **deprecated** as of ArangoDB 2.6. \nThis API may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection using the near operator is\nto issue an [AQL query](../Aql/GeoFunctions.md) using the *NEAR* function as follows: \n\n\n FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit)\n RETURN doc`\n\n\nExample: Without distance
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **distance**: If given, the attribute key used to return the distance to\n the given coordinate. (optional). If specified, distances are returned in meters.\n - **skip**: The number of documents to skip in the query. (optional)\n - **longitude**: The longitude of the coordinate.\n - **limit**: The maximal amount of documents to return. The *skip* is\n applied before the *limit* restriction. The default is 100. (optional)\n - **collection**: The name of the collection to query.\n - **latitude**: The latitude of the coordinate.\n - **geo**: If given, the identifier of the geo-index to use. (optional)\n\n\n\n\n\nThe default will find at most 100 documents near the given coordinate. The\nreturned array is sorted according to the distance, with the nearest document\nbeing first in the return array. If there are near documents of equal distance, documents\nare chosen randomly from this set until the limit is reached.\n\nIn order to use the *near* operator, a geo index must be defined for the\ncollection. This index also defines which attribute holds the coordinates\nfor the document. If you have more than one geo-spatial index, you can use\nthe *geo* field to select a particular index.\n\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *near* simple query is **deprecated** as of ArangoDB 2.6. \nThis API may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection using the near operator is\nto issue an [AQL query](../Aql/GeoFunctions.md) using the *NEAR* function as follows: \n\n\n FOR doc IN NEAR(@@collection, @latitude, @longitude, @limit)\n RETURN doc`\n\n\nExample: Without distance
\n\n",
"parameters": [
{
"in": "body",
@@ -6947,7 +6947,7 @@
},
"/_api/simple/range": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **right**: The upper bound.\n - **attribute**: The attribute path to check.\n - **collection**: The name of the collection to query.\n - **limit**: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n - **closed**: If *true*, use interval including *left* and *right*,\n otherwise exclude *right*, but include *left*.\n - **skip**: The number of documents to skip in the query (optional).\n - **left**: The lower bound.\n\n\n\n\n\nThis will find all documents within a given range. In order to execute a\nrange query, a skip-list index on the queried attribute must be present.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *range* simple query is **deprecated** as of ArangoDB 2.6. \nThe function may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection within a specific range\nis to use an AQL query as follows: \n\n\n FOR doc IN @@collection \n FILTER doc.value >= @left && doc.value < @right \n LIMIT @skip, @limit \n RETURN doc`\n\n\nExample:
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **right**: The upper bound.\n - **attribute**: The attribute path to check.\n - **collection**: The name of the collection to query.\n - **limit**: The maximal amount of documents to return. The *skip*\n is applied before the *limit* restriction. (optional)\n - **closed**: If *true*, use interval including *left* and *right*,\n otherwise exclude *right*, but include *left*.\n - **skip**: The number of documents to skip in the query (optional).\n - **left**: The lower bound.\n\n\n\n\n\nThis will find all documents within a given range. In order to execute a\nrange query, a skip-list index on the queried attribute must be present.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *range* simple query is **deprecated** as of ArangoDB 2.6. \nThe function may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection within a specific range\nis to use an AQL query as follows: \n\n\n FOR doc IN @@collection \n FILTER doc.value >= @left && doc.value < @right \n LIMIT @skip, @limit \n RETURN doc`\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -7112,7 +7112,7 @@
},
"/_api/simple/within": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **distance**: If given, the attribute key used to return the distance to\n the given coordinate. (optional). If specified, distances are returned in meters.\n - **skip**: The number of documents to skip in the query. (optional)\n - **longitude**: The longitude of the coordinate.\n - **radius**: The maximal radius (in meters).\n - **collection**: The name of the collection to query.\n - **latitude**: The latitude of the coordinate.\n - **limit**: The maximal amount of documents to return. The *skip* is\n applied before the *limit* restriction. The default is 100. (optional)\n - **geo**: If given, the identifier of the geo-index to use. (optional)\n\n\n\n\n\nThis will find all documents within a given radius around the coordinate\n(*latitude*, *longitude*). The returned list is sorted by distance.\n\nIn order to use the *within* operator, a geo index must be defined for\nthe collection. This index also defines which attribute holds the\ncoordinates for the document. If you have more than one geo-spatial index,\nyou can use the *geo* field to select a particular index.\n\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *within* simple query is **deprecated** as of ArangoDB 2.6. \nThis API may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection using the near operator is\nto issue an [AQL query](../Aql/GeoFunctions.md) using the *WITHIN* function as follows: \n\n\n FOR doc IN WITHIN(@@collection, @latitude, @longitude, @radius, @distanceAttributeName)\n RETURN doc\n\n\nExample: Without distance
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **distance**: If given, the attribute key used to return the distance to\n the given coordinate. (optional). If specified, distances are returned in meters.\n - **skip**: The number of documents to skip in the query. (optional)\n - **longitude**: The longitude of the coordinate.\n - **radius**: The maximal radius (in meters).\n - **collection**: The name of the collection to query.\n - **latitude**: The latitude of the coordinate.\n - **limit**: The maximal amount of documents to return. The *skip* is\n applied before the *limit* restriction. The default is 100. (optional)\n - **geo**: If given, the identifier of the geo-index to use. (optional)\n\n\n\n\n\nThis will find all documents within a given radius around the coordinate\n(*latitude*, *longitude*). The returned list is sorted by distance.\n\nIn order to use the *within* operator, a geo index must be defined for\nthe collection. This index also defines which attribute holds the\ncoordinates for the document. If you have more than one geo-spatial index,\nyou can use the *geo* field to select a particular index.\n\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\nNote: the *within* simple query is **deprecated** as of ArangoDB 2.6. \nThis API may be removed in future versions of ArangoDB. The preferred\nway for retrieving documents from a collection using the near operator is\nto issue an [AQL query](../Aql/GeoFunctions.md) using the *WITHIN* function as follows: \n\n\n FOR doc IN WITHIN(@@collection, @latitude, @longitude, @radius, @distanceAttributeName)\n RETURN doc\n\n\nExample: Without distance
\n\n",
"parameters": [
{
"in": "body",
@@ -7145,7 +7145,7 @@
},
"/_api/simple/within-rectangle": {
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **latitude1**: The latitude of the first rectangle coordinate.\n - **skip**: The number of documents to skip in the query. (optional)\n - **latitude2**: The latitude of the second rectangle coordinate.\n - **longitude2**: The longitude of the second rectangle coordinate.\n - **longitude1**: The longitude of the first rectangle coordinate.\n - **limit**: The maximal amount of documents to return. The *skip* is\n applied before the *limit* restriction. The default is 100. (optional)\n - **collection**: The name of the collection to query.\n - **geo**: If given, the identifier of the geo-index to use. (optional)\n\n\n\n\n\nThis will find all documents within the specified rectangle (determined by\nthe given coordinates (*latitude1*, *longitude1*, *latitude2*, *longitude2*). \n\nIn order to use the *within-rectangle* query, a geo index must be defined for\nthe collection. This index also defines which attribute holds the\ncoordinates for the document. If you have more than one geo-spatial index,\nyou can use the *geo* field to select a particular index.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\n\nExample:
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **latitude1**: The latitude of the first rectangle coordinate.\n - **skip**: The number of documents to skip in the query. (optional)\n - **latitude2**: The latitude of the second rectangle coordinate.\n - **longitude2**: The longitude of the second rectangle coordinate.\n - **longitude1**: The longitude of the first rectangle coordinate.\n - **limit**: The maximal amount of documents to return. The *skip* is\n applied before the *limit* restriction. The default is 100. (optional)\n - **collection**: The name of the collection to query.\n - **geo**: If given, the identifier of the geo-index to use. (optional)\n\n\n\n\n\nThis will find all documents within the specified rectangle (determined by\nthe given coordinates (*latitude1*, *longitude1*, *latitude2*, *longitude2*). \n\nIn order to use the *within-rectangle* query, a geo index must be defined for\nthe collection. This index also defines which attribute holds the\ncoordinates for the document. If you have more than one geo-spatial index,\nyou can use the *geo* field to select a particular index.\n\nReturns a cursor containing the result, see [Http Cursor](../HttpAqlQueryCursor/README.md) for details.\n\n\nExample:
\n\n",
"parameters": [
{
"in": "body",
@@ -7178,7 +7178,7 @@
},
"/_api/tasks": {
"post": {
- "description": "**A json post document with these Properties is required:**\n\n - **params**: The parameters to be passed into command\n - **offset**: Number of seconds initial delay \n - **command**: The JavaScript code to be executed\n - **name**: The name of the task\n - **period**: number of seconds between the executions\n\n\n\n\ncreates a new task with a generated id\n\n\nExample:
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **params**: The parameters to be passed into command\n - **offset**: Number of seconds initial delay \n - **command**: The JavaScript code to be executed\n - **name**: The name of the task\n - **period**: number of seconds between the executions\n\n\n\n\ncreates a new task with a generated id\n\n\nExample:
\n\n",
"parameters": [],
"responses": {
"200": {
@@ -7246,7 +7246,7 @@
"x-filename": "Administration - js/actions/_admin/app.js, js/actions/_admin/routing/app.js, js/actions/_admin/server/app.js, js/actions/_admin/database/app.js, arangod/RestHandler/RestShutdownHandler.cpp, arangod/RestHandler/RestAdminLogHandler.cpp, js/actions/api-tasks.js, js/actions/api-endpoint.js, arangod/RestHandler/RestVersionHandler.cpp, js/actions/api-system.js"
},
"get": {
- "description": "\n\nfetches one existing tasks on the server specified by *id*\n\n\nExample: Fetching a single task by its id
\n\n",
"parameters": [
{
"description": "The id of the task to fetch.\n\n",
@@ -7270,7 +7270,7 @@
"x-filename": "Administration - js/actions/_admin/app.js, js/actions/_admin/routing/app.js, js/actions/_admin/server/app.js, js/actions/_admin/database/app.js, arangod/RestHandler/RestShutdownHandler.cpp, arangod/RestHandler/RestAdminLogHandler.cpp, js/actions/api-tasks.js, js/actions/api-endpoint.js, arangod/RestHandler/RestVersionHandler.cpp, js/actions/api-system.js"
},
"put": {
- "description": "**A json post document with these Properties is required:**\n\n - **params**: The parameters to be passed into command\n - **offset**: Number of seconds initial delay \n - **command**: The JavaScript code to be executed\n - **name**: The name of the task\n - **period**: number of seconds between the executions\n\n\n\n\nregisters a new task with the specified id\n\n\nExample:
\n\n",
+ "description": "**A json post document with these Properties is required:**\n\n - **params**: The parameters to be passed into command\n - **offset**: Number of seconds initial delay \n - **command**: The JavaScript code to be executed\n - **name**: The name of the task\n - **period**: number of seconds between the executions\n\n\n\n\nregisters a new task with the specified id\n\n\nExample:
\n\n",
"parameters": [
{
"description": "The id of the task to create\n\n",
@@ -7341,7 +7341,7 @@
},
"/_api/traversal": {
"post": {
- "description": "\n\nStarts a traversal starting from a given vertex and following.\nedges contained in a given edgeCollection. The request must\ncontain the following attributes.\n\n**A json post document with these Properties is required:**\n\n - **sort**: body (JavaScript) code of a custom comparison function\n for the edges. The signature of this function is\n *(l, r) -> integer* (where l and r are edges) and must\n return -1 if l is smaller than, +1 if l is greater than,\n and 0 if l and r are equal. The reason for this is the\n following: The order of edges returned for a certain\n vertex is undefined. This is because there is no natural\n order of edges for a vertex with multiple connected edges.\n To explicitly define the order in which edges on the\n vertex are followed, you can specify an edge comparator\n function with this attribute. Note that the value here has\n to be a string to conform to the JSON standard, which in\n turn is parsed as function body on the server side. Furthermore\n note that this attribute is only used for the standard\n expanders. If you use your custom expander you have to\n do the sorting yourself within the expander code.\n - **direction**: direction for traversal\n - *if set*, must be either *\"outbound\"*, *\"inbound\"*, or *\"any\"*\n - *if not set*, the *expander* attribute must be specified\n - **minDepth**: ANDed with any existing filters):\n visits only nodes in at least the given depth\n - **startVertex**: id of the startVertex, e.g. *\"users/foo\"*.\n - **visitor**: body (JavaScript) code of custom visitor function\n function signature: *(config, result, vertex, path, connected) -> void*\n The visitor function can do anything, but its return value is ignored. To\n populate a result, use the *result* variable by reference. Note that the\n *connected* argument is only populated when the *order* attribute is set\n to *\"preorder-expander\"*.\n - **itemOrder**: item iteration order can be *\"forward\"* or *\"backward\"*\n - **strategy**: traversal strategy can be *\"depthfirst\"* or *\"breadthfirst\"*\n - **filter**: default is to include all nodes:\n body (JavaScript code) of custom filter function\n function signature: *(config, vertex, path) -> mixed*\n can return four different string values:\n - *\"exclude\"* -> this vertex will not be visited.\n - *\"prune\"* -> the edges of this vertex will not be followed.\n - *\"\"* or *undefined* -> visit the vertex and follow it's edges.\n - *Array* -> containing any combination of the above.\n If there is at least one *\"exclude\"* or *\"prune\"* respectivly\n is contained, it's effect will occur.\n - **init**: body (JavaScript) code of custom result initialization function\n function signature: *(config, result) -> void*\n initialize any values in result with what is required\n - **maxIterations**: Maximum number of iterations in each traversal. This number can be\n set to prevent endless loops in traversal of cyclic graphs. When a traversal performs\n as many iterations as the *maxIterations* value, the traversal will abort with an\n error. If *maxIterations* is not set, a server-defined value may be used.\n - **maxDepth**: ANDed with any existing filters visits only nodes in at most the given depth\n - **uniqueness**: specifies uniqueness for vertices and edges visited\n if set, must be an object like this:\n *\"uniqueness\": {\"vertices\": \"none\"|\"global\"|\"path\", \"edges\": \"none\"|\"global\"|\"path\"}*\n - **order**: traversal order can be *\"preorder\"*, *\"postorder\"* or *\"preorder-expander\"*\n - **graphName**: name of the graph that contains the edges.\n Either *edgeCollection* or *graphName* has to be given.\n In case both values are set the *graphName* is prefered.\n - **expander**: body (JavaScript) code of custom expander function\n *must* be set if *direction* attribute is **not** set\n function signature: *(config, vertex, path) -> array*\n expander must return an array of the connections for *vertex*\n each connection is an object with the attributes *edge* and *vertex*\n - **edgeCollection**: name of the collection that contains the edges.\n\n\n\n\n\nIf the Traversal is successfully executed *HTTP 200* will be returned.\nAdditionally the *result* object will be returned by the traversal.\n\nFor successful traversals, the returned JSON object has the\nfollowing properties:\n\n- *error*: boolean flag to indicate if an error occurred (*false*\n in this case)\n\n- *code*: the HTTP status code\n\n- *result*: the return value of the traversal\n\nIf the traversal specification is either missing or malformed, the server\nwill respond with *HTTP 400*.\n\nThe body of the response will then contain a JSON object with additional error\ndetails. The object has the following attributes:\n\n- *error*: boolean flag to indicate that an error occurred (*true* in this case)\n\n- *code*: the HTTP status code\n\n- *errorNum*: the server error number\n\n- *errorMessage*: a descriptive error message\n\n\nExample: In the following examples the underlying graph will contain five persons\n*Alice*, *Bob*, *Charlie*, *Dave* and *Eve*.\nWe will have the following directed relations:\n - *Alice* knows *Bob*\n - *Bob* knows *Charlie*\n - *Bob* knows *Dave*\n - *Eve* knows *Alice*\n - *Eve* knows *Bob*\n\nThe starting vertex will always be Alice.\n\nFollow only outbound edges
\nExample: If the underlying graph is cyclic, *maxIterations* should be set\n\nThe underlying graph has two vertices *Alice* and *Bob*.\nWith the directed edges:\n- *Alice* knows *Bob*\n_ *Bob* knows *Alice*
\n\n\n",
+ "description": "\n\nStarts a traversal starting from a given vertex and following.\nedges contained in a given edgeCollection. The request must\ncontain the following attributes.\n\n**A json post document with these Properties is required:**\n\n - **sort**: body (JavaScript) code of a custom comparison function\n for the edges. The signature of this function is\n *(l, r) -> integer* (where l and r are edges) and must\n return -1 if l is smaller than, +1 if l is greater than,\n and 0 if l and r are equal. The reason for this is the\n following: The order of edges returned for a certain\n vertex is undefined. This is because there is no natural\n order of edges for a vertex with multiple connected edges.\n To explicitly define the order in which edges on the\n vertex are followed, you can specify an edge comparator\n function with this attribute. Note that the value here has\n to be a string to conform to the JSON standard, which in\n turn is parsed as function body on the server side. Furthermore\n note that this attribute is only used for the standard\n expanders. If you use your custom expander you have to\n do the sorting yourself within the expander code.\n - **direction**: direction for traversal\n - *if set*, must be either *\"outbound\"*, *\"inbound\"*, or *\"any\"*\n - *if not set*, the *expander* attribute must be specified\n - **minDepth**: ANDed with any existing filters):\n visits only nodes in at least the given depth\n - **startVertex**: id of the startVertex, e.g. *\"users/foo\"*.\n - **visitor**: body (JavaScript) code of custom visitor function\n function signature: *(config, result, vertex, path, connected) -> void*\n The visitor function can do anything, but its return value is ignored. To\n populate a result, use the *result* variable by reference. Note that the\n *connected* argument is only populated when the *order* attribute is set\n to *\"preorder-expander\"*.\n - **itemOrder**: item iteration order can be *\"forward\"* or *\"backward\"*\n - **strategy**: traversal strategy can be *\"depthfirst\"* or *\"breadthfirst\"*\n - **filter**: default is to include all nodes:\n body (JavaScript code) of custom filter function\n function signature: *(config, vertex, path) -> mixed*\n can return four different string values:\n - *\"exclude\"* -> this vertex will not be visited.\n - *\"prune\"* -> the edges of this vertex will not be followed.\n - *\"\"* or *undefined* -> visit the vertex and follow it's edges.\n - *Array* -> containing any combination of the above.\n If there is at least one *\"exclude\"* or *\"prune\"* respectivly\n is contained, it's effect will occur.\n - **init**: body (JavaScript) code of custom result initialization function\n function signature: *(config, result) -> void*\n initialize any values in result with what is required\n - **maxIterations**: Maximum number of iterations in each traversal. This number can be\n set to prevent endless loops in traversal of cyclic graphs. When a traversal performs\n as many iterations as the *maxIterations* value, the traversal will abort with an\n error. If *maxIterations* is not set, a server-defined value may be used.\n - **maxDepth**: ANDed with any existing filters visits only nodes in at most the given depth\n - **uniqueness**: specifies uniqueness for vertices and edges visited\n if set, must be an object like this:\n *\"uniqueness\": {\"vertices\": \"none\"|\"global\"|\"path\", \"edges\": \"none\"|\"global\"|\"path\"}*\n - **order**: traversal order can be *\"preorder\"*, *\"postorder\"* or *\"preorder-expander\"*\n - **graphName**: name of the graph that contains the edges.\n Either *edgeCollection* or *graphName* has to be given.\n In case both values are set the *graphName* is prefered.\n - **expander**: body (JavaScript) code of custom expander function\n *must* be set if *direction* attribute is **not** set\n function signature: *(config, vertex, path) -> array*\n expander must return an array of the connections for *vertex*\n each connection is an object with the attributes *edge* and *vertex*\n - **edgeCollection**: name of the collection that contains the edges.\n\n\n\n\n\nIf the Traversal is successfully executed *HTTP 200* will be returned.\nAdditionally the *result* object will be returned by the traversal.\n\nFor successful traversals, the returned JSON object has the\nfollowing properties:\n\n- *error*: boolean flag to indicate if an error occurred (*false*\n in this case)\n\n- *code*: the HTTP status code\n\n- *result*: the return value of the traversal\n\nIf the traversal specification is either missing or malformed, the server\nwill respond with *HTTP 400*.\n\nThe body of the response will then contain a JSON object with additional error\ndetails. The object has the following attributes:\n\n- *error*: boolean flag to indicate that an error occurred (*true* in this case)\n\n- *code*: the HTTP status code\n\n- *errorNum*: the server error number\n\n- *errorMessage*: a descriptive error message\n\n\nExample: In the following examples the underlying graph will contain five persons\n*Alice*, *Bob*, *Charlie*, *Dave* and *Eve*.\nWe will have the following directed relations:\n - *Alice* knows *Bob*\n - *Bob* knows *Charlie*\n - *Bob* knows *Dave*\n - *Eve* knows *Alice*\n - *Eve* knows *Bob*\n\nThe starting vertex will always be Alice.\n\nFollow only outbound edges
\nExample: If the underlying graph is cyclic, *maxIterations* should be set\n\nThe underlying graph has two vertices *Alice* and *Bob*.\nWith the directed edges:\n- *Alice* knows *Bob*\n_ *Bob* knows *Alice*
\n\n\n",
"parameters": [
{
"in": "body",
@@ -7530,7 +7530,7 @@
},
"/_api/version": {
"get": {
- "description": "\n\nReturns the server name and version number. The response is a JSON object\nwith the following attributes:\n\n**A json document with these Properties is returned:**\n\n##HTTP 200\nis returned in all cases.\n\n - **version**: the server version string. The string has the format\n\"*major*.*minor*.*sub*\". *major* and *minor* will be numeric, and *sub*\nmay contain a number or a textual version.\n - **details**: an optional JSON object with additional details. This is\nreturned only if the *details* query parameter is set to *true* in the\nrequest.\n - **server**: will always contain *arango*\n\n\nExample: Return the version information
\n\n",
+ "description": "\n\nReturns the server name and version number. The response is a JSON object\nwith the following attributes:\n\n**A json document with these Properties is returned:**\n\n##HTTP 200\nis returned in all cases.\n\n - **version**: the server version string. The string has the format\n\"*major*.*minor*.*sub*\". *major* and *minor* will be numeric, and *sub*\nmay contain a number or a textual version.\n - **details**: an optional JSON object with additional details. This is\nreturned only if the *details* query parameter is set to *true* in the\nrequest.\n - **server**: will always contain *arango*\n\n\nExample: Return the version information
\n\n",
"parameters": [
{
"description": "If set to *true*, the response will contain a *details* attribute with\nadditional information about included components and their versions. The\nattribute names and internals of the *details* object may vary depending on\nplatform and ArangoDB version.\n\n",
diff --git a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js
index 6ff7041f01..b5c15a159d 100644
--- a/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js
+++ b/js/apps/system/_admin/aardvark/APP/frontend/build/app.min.js
@@ -1,14 +1,14 @@
function JSONAdapter(a,b,c,d,e,f){"use strict";var g=this,h={},i={},j=new AbstractAdapter(b,c,this,d);h.range=e/2,h.start=e/4,h.getStart=function(){return this.start+Math.random()*this.range},i.range=f/2,i.start=f/4,i.getStart=function(){return this.start+Math.random()*this.range},g.loadNode=function(a,b){g.loadNodeFromTreeById(a,b)},g.loadInitialNode=function(b,c){var d=a+b+".json";j.cleanUp(),d3.json(d,function(a,d){void 0!==a&&null!==a&&console.log(a);var e=j.insertInitialNode(d);g.requestCentralityChildren(b,function(a){e._centrality=a}),_.each(d.children,function(a){var b=j.insertNode(a),c={_from:e._id,_to:b._id,_id:e._id+"-"+b._id};j.insertEdge(c),g.requestCentralityChildren(b._id,function(a){b._centrality=a}),delete b._data.children}),delete e._data.children,c&&c(e)})},g.loadNodeFromTreeById=function(b,c){var d=a+b+".json";d3.json(d,function(a,d){void 0!==a&&null!==a&&console.log(a);var e=j.insertNode(d);g.requestCentralityChildren(b,function(a){e._centrality=a}),_.each(d.children,function(a){var b=j.insertNode(a),c={_from:e._id,_to:b._id,_id:e._id+"-"+b._id};j.insertEdge(c),g.requestCentralityChildren(b._id,function(a){e._centrality=a}),delete b._data.children}),delete e._data.children,c&&c(e)})},g.requestCentralityChildren=function(b,c){var d=a+b+".json";d3.json(d,function(a,b){void 0!==a&&null!==a&&console.log(a),void 0!==c&&c(void 0!==b.children?b.children.length:0)})},g.loadNodeFromTreeByAttributeValue=function(a,b,c){throw"Sorry this adapter is read-only"},g.loadInitialNodeByAttributeValue=function(a,b,c){throw"Sorry this adapter is read-only"},g.createEdge=function(a,b){throw"Sorry this adapter is read-only"},g.deleteEdge=function(a,b){throw"Sorry this adapter is read-only"},g.patchEdge=function(a,b,c){throw"Sorry this adapter is read-only"},g.createNode=function(a,b){throw"Sorry this adapter is read-only"},g.deleteNode=function(a,b){throw"Sorry this adapter is read-only"},g.patchNode=function(a,b,c){throw"Sorry this adapter is read-only"},g.setNodeLimit=function(a,b){},g.setChildLimit=function(a){},g.expandCommunity=function(a,b){},g.setWidth=function(){},g.explore=j.explore}function AbstractAdapter(a,b,c,d,e){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"An inheriting class has to be given.";if(void 0===d)throw"A reference to the graph viewer has to be given.";e=e||{};var f,g,h,i,j,k=this,l=!1,m={},n={},o={},p={},q=0,r={},s={},t=function(a){void 0!==a.prioList&&g.changePrioList(a.prioList||[])},u=function(a){m.range=a/2,m.start=a/4,m.getStart=function(){return this.start+Math.random()*this.range}},v=function(a){n.range=a/2,n.start=a/4,n.getStart=function(){return this.start+Math.random()*this.range}},w=function(b){var c=p[b]||b,d=$.grep(a,function(a){return a._id===c});if(0===d.length)return!1;if(1===d.length)return d[0];throw"Too many nodes with the same ID, should never happen"},x=function(a){var c=$.grep(b,function(b){return b._id===a});if(0===c.length)return!1;if(1===c.length)return c[0];throw"Too many edges with the same ID, should never happen"},y=function(b,c,d){var e={_data:b,_id:b._id},f=w(e._id);return f?f:(e.x=c||m.getStart(),e.y=d||n.getStart(),e.weight=1,a.push(e),e._outboundCounter=0,e._inboundCounter=0,e)},z=function(a){var b=y(a);return b.x=2*m.start,b.y=2*n.start,b.fixed=!0,b},A=function(){a.length=0,b.length=0,p={},o={},d.cleanUp()},B=function(a){var c,d,e,f=!0,g={_data:a,_id:a._id},i=x(g._id);if(i)return i;if(c=w(a._from),d=w(a._to),!c)throw"Unable to insert Edge, source node not existing "+a._from;if(!d)throw"Unable to insert Edge, target node not existing "+a._to;return g.source=c,g.source._isCommunity?(e=o[g.source._id],g.source=e.getNode(a._from),g.source._outboundCounter++,e.insertOutboundEdge(g),f=!1):c._outboundCounter++,g.target=d,g.target._isCommunity?(e=o[g.target._id],g.target=e.getNode(a._to),g.target._inboundCounter++,e.insertInboundEdge(g),f=!1):d._inboundCounter++,b.push(g),f&&h.call("insertEdge",c._id,d._id),g},C=function(b){var c;for(c=0;c0){var c,d=[];for(c=0;cf&&(c?c.collapse():K(b))},M=function(c){var d=c.getDissolveInfo(),e=d.nodes,g=d.edges.both,i=d.edges.inbound,j=d.edges.outbound;C(c),fi){var b=g.bucketNodes(_.values(a),i);_.each(b,function(a){if(a.nodes.length>1){var b=_.map(a.nodes,function(a){return a._id});I(b,a.reason)}})}},P=function(a,b){f=a,L(),void 0!==b&&b()},Q=function(a){i=a},R=function(a,b){a._expanded=!1;var c=b.removeOutboundEdgesFromNode(a);_.each(c,function(a){j(a),E(a,!0)})},S=function(a){a._expanded=!1,p[a._id]&&o[p[a._id]].collapseNode(a);var b=H(a),c=[];_.each(b,function(b){0===q?(r=b,s=a,c.push(b)):void 0!==a&&(a._id===r.target._id?b.target._id===s._id&&c.push(r):c.push(b),r=b,s=a),q++}),_.each(c,j),q=0},T=function(a){var b=a.getDissolveInfo();C(a),_.each(b.nodes,function(a){delete p[a._id]}),_.each(b.edges.outbound,function(a){j(a),E(a,!0)}),delete o[a._id]},U=function(a,b){a._isCommunity?k.expandCommunity(a,b):(a._expanded=!0,c.loadNode(a._id,b))},V=function(a,b){a._expanded?S(a):U(a,b)};j=function(a){var b,c=a.target;return c._isCommunity?(b=a._target,c.removeInboundEdge(a),b._inboundCounter--,0===b._inboundCounter&&(R(b,c),c.removeNode(b),delete p[b._id]),void(0===c._inboundCounter&&T(c))):(c._inboundCounter--,void(0===c._inboundCounter&&(S(c),C(c))))},i=Number.POSITIVE_INFINITY,g=e.prioList?new NodeReducer(e.prioList):new NodeReducer,h=new WebWorkerWrapper(ModularityJoiner,J),m.getStart=function(){return 0},n.getStart=function(){return 0},this.cleanUp=A,this.setWidth=u,this.setHeight=v,this.insertNode=y,this.insertInitialNode=z,this.insertEdge=B,this.removeNode=C,this.removeEdge=E,this.removeEdgesForNode=F,this.expandCommunity=N,this.setNodeLimit=P,this.setChildLimit=Q,this.checkSizeOfInserted=O,this.checkNodeLimit=L,this.explore=V,this.changeTo=t,this.getPrioList=g.getPrioList,this.dissolveCommunity=M}function ArangoAdapter(a,b,c,d){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"A reference to the graph viewer has to be given.";if(void 0===d)throw"A configuration with node- and edgeCollection has to be given.";if(void 0===d.graph){if(void 0===d.nodeCollection)throw"The nodeCollection or a graphname has to be given.";if(void 0===d.edgeCollection)throw"The edgeCollection or a graphname has to be given."}var e,f,g,h,i,j=this,k={},l={},m={},n=function(a){h=a},o=function(a){f=a,l.node=l.base+"document?collection="+f},p=function(a){g=a,l.edge=l.base+"edge?collection="+g},q=function(a){$.ajax({cache:!1,type:"GET",async:!1,url:l.graph+"/"+a,contentType:"application/json",success:function(a){o(a.graph.vertices),p(a.graph.edges)}})},r=function(a){var b=a.baseUrl||"";void 0!==a.width&&e.setWidth(a.width),void 0!==a.height&&e.setHeight(a.height),i=void 0!==a.undirected&&a.undirected===!0?"any":"outbound",l.base=b+"_api/",l.cursor=l.base+"cursor",l.graph=l.base+"graph",l.collection=l.base+"collection/",l.document=l.base+"document/",l.any=l.base+"simple/any",a.graph?(q(a.graph),n(a.graph)):(o(a.nodeCollection),p(a.edgeCollection),n(void 0))},s=function(a,b,c){a!==m.getAllGraphs&&(a!==m.connectedEdges&&(b["@nodes"]=f,a!==m.childrenCentrality&&(b.dir=i)),b["@edges"]=g);var d={query:a,bindVars:b};$.ajax({type:"POST",url:l.cursor,data:JSON.stringify(d),contentType:"application/json",dataType:"json",processData:!1,success:function(a){c(a.result)},error:function(a){try{throw console.log(a.statusText),"["+a.errorNum+"] "+a.errorMessage}catch(b){throw"Undefined ERROR"}}})},t=function(a,b){var c=[],d=0,e=function(d){c.push(d.document||{}),c.length===a&&b(c)};for(d=0;a>d;d++)$.ajax({cache:!1,type:"PUT",url:l.any,data:JSON.stringify({collection:f}),contentType:"application/json",success:e})},u=function(b,c){if(0===b.length)return void(c&&c({errorCode:404}));b=b[0];var d={},f=e.insertNode(b[0].vertex),g=a.length;_.each(b,function(b){var c=e.insertNode(b.vertex),f=b.path;g=2&&$.ajax({cache:!1,type:"GET",url:l.collection,contentType:"application/json",dataType:"json",processData:!1,success:function(b){var c=b.collections,d=[],e=[];_.each(c,function(a){a.name.match(/^_/)||(3===a.type?e.push(a.name):2===a.type&&d.push(a.name))}),a(d,e)},error:function(a){throw a.statusText}})},j.getGraphs=function(a){a&&a.length>=1&&s(m.getAllGraphs,{},a)},j.getAttributeExamples=function(a){a&&a.length>=1&&t(10,function(b){var c=_.sortBy(_.uniq(_.flatten(_.map(b,function(a){return _.keys(a)}))),function(a){return a.toLowerCase()});a(c)})},j.getNodeCollection=function(){return f},j.getEdgeCollection=function(){return g},j.getDirection=function(){return i},j.getGraphName=function(){return h},j.setWidth=e.setWidth,j.changeTo=e.changeTo,j.getPrioList=e.getPrioList}function ColourMapper(){"use strict";var a,b={},c={},d=[],e=this,f=0;d.push({back:"#C8E6C9",front:"black"}),d.push({back:"#8aa249",front:"white"}),d.push({back:"#8BC34A",front:"black"}),d.push({back:"#388E3C",front:"white"}),d.push({back:"#4CAF50",front:"white"}),d.push({back:"#212121",front:"white"}),d.push({back:"#727272",front:"white"}),d.push({back:"#B6B6B6",front:"black"}),d.push({back:"#e5f0a3",front:"black"}),d.push({back:"#6c4313",front:"white"}),d.push({back:"#9d8564",front:"white"}),this.getColour=function(g){return void 0===b[g]&&(b[g]=d[f],void 0===c[d[f].back]&&(c[d[f].back]={front:d[f].front,list:[]}),c[d[f].back].list.push(g),f++,f===d.length&&(f=0)),void 0!==a&&a(e.getList()),b[g].back},this.getCommunityColour=function(){return"#333333"},this.getForegroundColour=function(g){return void 0===b[g]&&(b[g]=d[f],void 0===c[d[f].back]&&(c[d[f].back]={front:d[f].front,list:[]}),c[d[f].back].list.push(g),f++,f===d.length&&(f=0)),void 0!==a&&a(e.getList()),b[g].front},this.getForegroundCommunityColour=function(){return"white"},this.reset=function(){b={},c={},f=0,void 0!==a&&a(e.getList())},this.getList=function(){return c},this.setChangeListener=function(b){a=b},this.reset()}function CommunityNode(a,b){"use strict";if(_.isUndefined(a)||!_.isFunction(a.dissolveCommunity)||!_.isFunction(a.checkNodeLimit))throw"A parent element has to be given.";b=b||[];var c,d,e,f,g,h=this,i={},j=[],k=[],l={},m={},n={},o={},p=function(a){return h._expanded?2*a*Math.sqrt(j.length):a},q=function(a){return h._expanded?4*a*Math.sqrt(j.length):a},r=function(a){var b=h.position,c=a.x*b.z+b.x,d=a.y*b.z+b.y,e=a.z*b.z;return{x:c,y:d,z:e}},s=function(a){return h._expanded?r(a._source.position):h.position},t=function(a){return h._expanded?r(a._target.position):h.position},u=function(){var a=document.getElementById(h._id).getBBox();c.attr("transform","translate("+(a.x-5)+","+(a.y-25)+")"),d.attr("width",a.width+10).attr("height",a.height+30),e.attr("width",a.width+10)},v=function(){if(!f){var a=new DomObserverFactory;f=a.createObserver(function(a){_.any(a,function(a){return"transform"===a.attributeName})&&(u(),f.disconnect())})}return f},w=function(){g.stop(),j.length=0,_.each(i,function(a){j.push(a)}),g.start()},x=function(){g.stop(),k.length=0,_.each(l,function(a){k.push(a)}),g.start()},y=function(a){var b=[];return _.each(a,function(a){b.push(a)}),b},z=function(a){return!!i[a]},A=function(){return j},B=function(a){return i[a]},C=function(a){i[a._id]=a,w(),h._size++},D=function(a){_.each(a,function(a){i[a._id]=a,h._size++}),w()},E=function(a){var b=a._id||a;delete i[b],w(),h._size--},F=function(a){var b;return _.has(a,"_id")?b=a._id:(b=a,a=l[b]||m[b]),a.target=a._target,delete a._target,l[b]?(delete l[b],h._outboundCounter++,n[b]=a,void x()):(delete m[b],void h._inboundCounter--)},G=function(a){var b;return _.has(a,"_id")?b=a._id:(b=a,a=l[b]||n[b]),a.source=a._source,delete a._source,delete o[a.source._id][b],l[b]?(delete l[b],h._inboundCounter++,m[b]=a,void x()):(delete n[b],void h._outboundCounter--)},H=function(a){var b=a._id||a,c=[];return _.each(o[b],function(a){G(a),c.push(a)}),delete o[b],c},I=function(a){return a._target=a.target,a.target=h,n[a._id]?(delete n[a._id],h._outboundCounter--,l[a._id]=a,x(),!0):(m[a._id]=a,h._inboundCounter++,!1)},J=function(a){var b=a.source._id;return a._source=a.source,a.source=h,o[b]=o[b]||{},o[b][a._id]=a,m[a._id]?(delete m[a._id],h._inboundCounter--,l[a._id]=a,x(),!0):(h._outboundCounter++,n[a._id]=a,!1)},K=function(){return{nodes:j,edges:{both:k,inbound:y(m),outbound:y(n)}}},L=function(){this._expanded=!0},M=function(){a.dissolveCommunity(h)},N=function(){this._expanded=!1},O=function(a,b){var c=a.select("rect").attr("width"),d=a.append("text").attr("text-anchor","middle").attr("fill",b.getForegroundCommunityColour()).attr("stroke","none");c*=2,c/=3,h._reason&&h._reason.key&&(d.append("tspan").attr("x","0").attr("dy","-4").text(h._reason.key+":"),d.append("tspan").attr("x","0").attr("dy","16").text(h._reason.value)),d.append("tspan").attr("x",c).attr("y","0").attr("fill",b.getCommunityColour()).text(h._size)},P=function(b,c,d,e){var f=b.append("g").attr("stroke",e.getForegroundCommunityColour()).attr("fill",e.getCommunityColour());c(f,9),c(f,6),c(f,3),c(f),f.on("click",function(){h.expand(),a.checkNodeLimit(h),d()}),O(f,e)},Q=function(a,b){var c=a.selectAll(".node").data(j,function(a){return a._id});c.enter().append("g").attr("class","node").attr("id",function(a){return a._id}),c.exit().remove(),c.selectAll("* > *").remove(),b(c)},R=function(a,b){c=a.append("g"),d=c.append("rect").attr("rx","8").attr("ry","8").attr("fill","none").attr("stroke","black"),e=c.append("rect").attr("rx","8").attr("ry","8").attr("height","20").attr("fill","#686766").attr("stroke","none"),c.append("image").attr("id",h._id+"_dissolve").attr("xlink:href","img/icon_delete.png").attr("width","16").attr("height","16").attr("x","5").attr("y","2").attr("style","cursor:pointer").on("click",function(){h.dissolve(),b()}),c.append("image").attr("id",h._id+"_collapse").attr("xlink:href","img/gv_collapse.png").attr("width","16").attr("height","16").attr("x","25").attr("y","2").attr("style","cursor:pointer").on("click",function(){h.collapse(),b()});var f=c.append("text").attr("x","45").attr("y","15").attr("fill","white").attr("stroke","none").attr("text-anchor","left");h._reason&&f.text(h._reason.text),v().observe(document.getElementById(h._id),{subtree:!0,attributes:!0})},S=function(a){if(h._expanded){var b=a.focus(),c=[b[0]-h.position.x,b[1]-h.position.y];a.focus(c),_.each(j,function(b){b.position=a(b),b.position.x/=h.position.z,b.position.y/=h.position.z,b.position.z/=h.position.z}),a.focus(b)}},T=function(a,b,c,d,e){return a.on("click",null),h._expanded?(R(a,d),void Q(a,c,d,e)):void P(a,b,d,e)},U=function(a,b,c){if(h._expanded){var d=a.selectAll(".link"),e=d.select("line");b(e,d),c(d)}},V=function(a,b){var c,d,e=function(a){return a._id};h._expanded&&(d=a.selectAll(".link").data(k,e),d.enter().append("g").attr("class","link").attr("id",e),d.exit().remove(),d.selectAll("* > *").remove(),c=d.append("line"),b(c,d))},W=function(a){H(a)};g=new ForceLayouter({distance:100,gravity:.1,charge:-500,width:1,height:1,nodes:j,links:k}),this._id="*community_"+Math.floor(1e6*Math.random()),b.length>0?(this.x=b[0].x,this.y=b[0].y):(this.x=0,this.y=0),this._size=0,this._inboundCounter=0,this._outboundCounter=0,this._expanded=!1,this._isCommunity=!0,D(b),this.hasNode=z,this.getNodes=A,this.getNode=B,this.getDistance=p,this.getCharge=q,this.insertNode=C,this.insertInboundEdge=I,this.insertOutboundEdge=J,this.removeNode=E,this.removeInboundEdge=F,this.removeOutboundEdge=G,this.removeOutboundEdgesFromNode=H,this.collapseNode=W,this.dissolve=M,this.getDissolveInfo=K,this.collapse=N,this.expand=L,this.shapeNodes=T,this.shapeInnerEdges=V,this.updateInnerEdges=U,this.addDistortion=S,this.getSourcePosition=s,this.getTargetPosition=t}function DomObserverFactory(){"use strict";var a=window.WebKitMutationObserver||window.MutationObserver;this.createObserver=function(b){if(!a)throw"Observer not supported";return new a(b)}}function EdgeShaper(a,b,c){"use strict";var d,e,f,g=this,h=[],i={},j=new ContextMenu("gv_edge_cm"),k=function(a,b){return _.isArray(a)?b[_.find(a,function(a){return b[a]})]:b[a]},l=function(a){if(void 0===a)return[""];"string"!=typeof a&&(a=String(a));var b=a.match(/[\w\W]{1,10}(\s|$)|\S+?(\s|$)/g);return b[0]=$.trim(b[0]),b[1]=$.trim(b[1]),b[0].length>12&&(b[0]=$.trim(a.substring(0,10))+"-",b[1]=$.trim(a.substring(10)),b[1].length>12&&(b[1]=b[1].split(/\W/)[0],b[1].length>12&&(b[1]=b[1].substring(0,10)+"...")),b.length=2),b.length>2&&(b.length=2,b[1]+="..."),b},m=!0,n={},o=function(a){return a._id},p=function(a,b){},q=new ColourMapper,r=function(){q.reset()},s=p,t=p,u=p,v=p,w=function(){f={click:p,dblclick:p,mousedown:p,mouseup:p,mousemove:p,mouseout:p,mouseover:p}},x=function(a,b){return 180*Math.atan2(b.y-a.y,b.x-a.x)/Math.PI},y=function(a,b){var c,d=Math.sqrt((b.y-a.y)*(b.y-a.y)+(b.x-a.x)*(b.x-a.x));return a.x===b.x?d-=18*b.z:(c=Math.abs((b.y-a.y)/(b.x-a.x)),d-=.4>c?Math.abs(d*b.z*45/(b.x-a.x)):Math.abs(d*b.z*18/(b.y-a.y))),d},z=function(a,b){_.each(f,function(a,c){b.on(c,a)})},A=function(a,b){if("update"===a)s=b;else{if(void 0===f[a])throw"Sorry Unknown Event "+a+" cannot be bound.";f[a]=b}},B=function(a){var b,c,d,e;return d=a.source,e=a.target,d._isCommunity?(i[d._id]=d,b=d.getSourcePosition(a)):b=d.position,e._isCommunity?(i[e._id]=e,c=e.getTargetPosition(a)):c=e.position,{s:b,t:c}},C=function(a,b){i={},b.attr("transform",function(a){var b=B(a);return"translate("+b.s.x+", "+b.s.y+")rotate("+x(b.s,b.t)+")"}),a.attr("x2",function(a){var b=B(a);return y(b.s,b.t)})},D=function(a,b){t(a,b),m&&u(a,b),v(a,b),z(a,b),C(a,b)},E=function(a){void 0!==a&&(h=a);var b,c=g.parent.selectAll(".link").data(h,o);c.enter().append("g").attr("class","link").attr("id",o),c.exit().remove(),c.selectAll("* > *").remove(),b=c.append("line"),D(b,c),_.each(i,function(a){a.shapeInnerEdges(d3.select(this),D)}),j.bindMenu($(".link"))},F=function(){var a=g.parent.selectAll(".link"),b=a.select("line");C(b,a),s(a),_.each(i,function(a){a.updateInnerEdges(d3.select(this),C,s)})},G=function(a){switch($("svg defs marker#arrow").remove(),a.type){case EdgeShaper.shapes.NONE:t=p;break;case EdgeShaper.shapes.ARROW:t=function(a,b){a.attr("marker-end","url(#arrow)")},0===d.selectAll("defs")[0].length&&d.append("defs"),d.select("defs").append("marker").attr("id","arrow").attr("refX","10").attr("refY","5").attr("markerUnits","strokeWidth").attr("markerHeight","10").attr("markerWidth","10").attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z");break;default:throw"Sorry given Shape not known!"}},H=function(a){u=_.isFunction(a)?function(b,c){c.append("text").attr("text-anchor","middle").text(a)}:function(b,c){c.append("text").attr("text-anchor","middle").text(function(b){var c=l(k(a,b._data));return c[0]||""})},s=function(a){a.select("text").attr("transform",function(a){var b=B(a);return"translate("+y(b.s,b.t)/2+", -3)"})}},I=function(a){void 0!==a.reset&&a.reset&&w(),_.each(a,function(a,b){"reset"!==b&&A(b,a)})},J=function(a){switch($("svg defs #gradientEdgeColor").remove(),r(),a.type){case"single":v=function(b,c){b.attr("stroke",a.stroke)};break;case"gradient":0===d.selectAll("defs")[0].length&&d.append("defs");var b=d.select("defs").append("linearGradient").attr("id","gradientEdgeColor");b.append("stop").attr("offset","0").attr("stop-color",a.source),b.append("stop").attr("offset","0.4").attr("stop-color",a.source),b.append("stop").attr("offset","0.6").attr("stop-color",a.target),b.append("stop").attr("offset","1").attr("stop-color",a.target),v=function(a,b){a.attr("stroke","url(#gradientEdgeColor)"),a.attr("y2","0.0000000000000001")};break;case"attribute":v=function(b,c){c.attr("stroke",function(b){return q.getColour(b._data[a.key])})};break;default:throw"Sorry given colour-scheme not known"}},K=function(a){void 0!==a.shape&&G(a.shape),void 0!==a.label&&(H(a.label),g.label=a.label),void 0!==a.actions&&I(a.actions),void 0!==a.color&&J(a.color)};for(g.parent=a,w(),d=a;d[0][0]&&d[0][0].ownerSVGElement;)d=d3.select(d[0][0].ownerSVGElement);void 0===b&&(b={color:{type:"single",stroke:"#686766"}}),void 0===b.color&&(b.color={type:"single",stroke:"#686766"}),K(b),_.isFunction(c)&&(o=c),e=d.append("g"),g.changeTo=function(a){K(a),E(),F()},g.drawEdges=function(a){E(a),F()},g.updateEdges=function(){F()},g.reshapeEdges=function(){E()},g.activateLabel=function(a){m=a?!0:!1,E()},g.addAnEdgeFollowingTheCursor=function(a,b){return n=e.append("line"),n.attr("stroke","black").attr("id","connectionLine").attr("x1",a).attr("y1",b).attr("x2",a).attr("y2",b),function(a,b){n.attr("x2",a).attr("y2",b)}},g.removeCursorFollowingEdge=function(){n.remove&&(n.remove(),n={})},g.addMenuEntry=function(a,b){j.addEntry(a,b)},g.getLabel=function(){return g.label||""},g.resetColourMap=r}function EventDispatcher(a,b,c){"use strict";var d,e,f,g,h=this,i=function(b){if(void 0===b.shaper&&(b.shaper=a),d.checkNodeEditorConfig(b)){var c=new d.InsertNode(b),e=new d.PatchNode(b),f=new d.DeleteNode(b);h.events.CREATENODE=function(a,b,d,e){var f;return f=_.isFunction(a)?a():a,function(){c(f,b,d,e)}},h.events.PATCHNODE=function(a,b,c){if(!_.isFunction(b))throw"Please give a function to extract the new node data";return function(){e(a,b(),c)}},h.events.DELETENODE=function(a){return function(b){f(b,a)}}}},j=function(a){if(void 0===a.shaper&&(a.shaper=b),d.checkEdgeEditorConfig(a)){var c=new d.InsertEdge(a),e=new d.PatchEdge(a),f=new d.DeleteEdge(a),g=null,i=!1;h.events.STARTCREATEEDGE=function(a){return function(b){var c=d3.event||window.event;g=b,i=!1,void 0!==a&&a(b,c),c.stopPropagation()}},h.events.CANCELCREATEEDGE=function(a){return function(){g=null,void 0===a||i||a()}},h.events.FINISHCREATEEDGE=function(a){return function(b){null!==g&&b!==g&&(c(g,b,a),i=!0)}},h.events.PATCHEDGE=function(a,b,c){if(!_.isFunction(b))throw"Please give a function to extract the new node data";return function(){e(a,b(),c)}},h.events.DELETEEDGE=function(a){return function(b){f(b,a)}}}},k=function(){g=g||$("svg"),g.unbind(),_.each(e,function(a,b){g.bind(b,function(c){_.each(a,function(a){a(c)}),f[b]&&f[b](c)})})};if(void 0===a)throw"NodeShaper has to be given.";if(void 0===b)throw"EdgeShaper has to be given.";d=new EventLibrary,e={click:[],dblclick:[],mousedown:[],mouseup:[],mousemove:[],mouseout:[],mouseover:[]},f={},h.events={},void 0!==c&&(void 0!==c.expand&&d.checkExpandConfig(c.expand)&&(h.events.EXPAND=new d.Expand(c.expand),a.setGVStartFunction(function(){c.expand.reshapeNodes(),c.expand.startCallback()})),void 0!==c.drag&&d.checkDragConfig(c.drag)&&(h.events.DRAG=d.Drag(c.drag)),void 0!==c.nodeEditor&&i(c.nodeEditor),void 0!==c.edgeEditor&&j(c.edgeEditor)),Object.freeze(h.events),h.bind=function(c,d,e){if(void 0===e||!_.isFunction(e))throw"You have to give a function that should be bound as a third argument";var g={};switch(c){case"nodes":g[d]=e,a.changeTo({actions:g});break;case"edges":g[d]=e,b.changeTo({actions:g});break;case"svg":f[d]=e,k();break;default:if(void 0===c.bind)throw'Sorry cannot bind to object. Please give either "nodes", "edges" or a jQuery-selected DOM-Element';c.unbind(d),c.bind(d,e)}},h.rebind=function(c,d){switch(d=d||{},d.reset=!0,c){case"nodes":a.changeTo({actions:d});break;case"edges":b.changeTo({actions:d});break;case"svg":f={},_.each(d,function(a,b){"reset"!==b&&(f[b]=a)}),k();break;default:throw'Sorry cannot rebind to object. Please give either "nodes", "edges" or "svg"'}},h.fixSVG=function(a,b){if(void 0===e[a])throw"Sorry unkown event";e[a].push(b),k()},Object.freeze(h.events)}function EventLibrary(){"use strict";var a=this;this.checkExpandConfig=function(a){if(void 0===a.startCallback)throw"A callback to the Start-method has to be defined";if(void 0===a.adapter||void 0===a.adapter.explore)throw"An adapter to load data has to be defined";if(void 0===a.reshapeNodes)throw"A callback to reshape nodes has to be defined";return!0},this.Expand=function(b){a.checkExpandConfig(b);var c=b.startCallback,d=b.adapter.explore,e=b.reshapeNodes;return function(a){d(a,c),e(),c()}},this.checkDragConfig=function(a){if(void 0===a.layouter)throw"A layouter has to be defined";if(void 0===a.layouter.drag||!_.isFunction(a.layouter.drag))throw"The layouter has to offer a drag function";return!0},this.Drag=function(b){return a.checkDragConfig(b),b.layouter.drag},this.checkNodeEditorConfig=function(a){if(void 0===a.adapter)throw"An adapter has to be defined";if(void 0===a.shaper)throw"A node shaper has to be defined";return!0},this.checkEdgeEditorConfig=function(a){if(void 0===a.adapter)throw"An adapter has to be defined";if(void 0===a.shaper)throw"An edge Shaper has to be defined";return!0},this.InsertNode=function(b){a.checkNodeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e,f){var g,h;_.isFunction(a)&&!b?(g=a,h={}):(g=b,h=a),c.createNode(h,function(a){d.reshapeNodes(),g(a)},e,f)}},this.PatchNode=function(b){a.checkNodeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e){c.patchNode(a,b,function(a){d.reshapeNodes(),e(a)})}},this.DeleteNode=function(b){a.checkNodeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b){c.deleteNode(a,function(){d.reshapeNodes(),b()})}},this.SelectNodeCollection=function(b){a.checkNodeEditorConfig(b);var c=b.adapter;if(!_.isFunction(c.useNodeCollection))throw"The adapter has to support collection changes";return function(a,b){c.useNodeCollection(a),b()}},this.InsertEdge=function(b){a.checkEdgeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e){c.createEdge({source:a,target:b},function(a){d.reshapeEdges(),e(a)})}},this.PatchEdge=function(b){a.checkEdgeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b,e){c.patchEdge(a,b,function(a){d.reshapeEdges(),e(a)})}},this.DeleteEdge=function(b){a.checkEdgeEditorConfig(b);var c=b.adapter,d=b.shaper;return function(a,b){c.deleteEdge(a,function(){d.reshapeEdges(),b()})}}}function ForceLayouter(a){"use strict";var b=this,c=d3.layout.force(),d=a.charge||-600,e=a.distance||80,f=a.gravity||.01,g=function(a){
var b=0;return b+=a.source._isCommunity?a.source.getDistance(e):e,b+=a.target._isCommunity?a.target.getDistance(e):e},h=function(a){return a._isCommunity?a.getCharge(d):d},i=a.onUpdate||function(){},j=a.width||880,k=a.height||680,l=function(a){a.distance&&(e=a.distance),a.gravity&&c.gravity(a.gravity),a.charge&&(d=a.charge)};if(void 0===a.nodes)throw"No nodes defined";if(void 0===a.links)throw"No links defined";c.nodes(a.nodes),c.links(a.links),c.size([j,k]),c.linkDistance(g),c.gravity(f),c.charge(h),c.on("tick",function(){}),b.start=function(){c.start()},b.stop=function(){c.stop()},b.drag=c.drag,b.setCombinedUpdateFunction=function(a,d,e){void 0!==e?(i=function(){c.alpha()<.1&&(a.updateNodes(),d.updateEdges(),e(),c.alpha()<.05&&b.stop())},c.on("tick",i)):(i=function(){c.alpha()<.1&&(a.updateNodes(),d.updateEdges(),c.alpha()<.05&&b.stop())},c.on("tick",i))},b.changeTo=function(a){l(a)},b.changeWidth=function(a){j=a,c.size([j,k])}}function FoxxAdapter(a,b,c,d,e){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"The route has to be given.";if(void 0===d)throw"A reference to the graph viewer has to be given.";e=e||{};var f,g=this,h={},i={},j=c,k={cache:!1,contentType:"application/json",dataType:"json",processData:!1,error:function(a){try{throw console.log(a.statusText),"["+a.errorNum+"] "+a.errorMessage}catch(b){throw console.log(b),"Undefined ERROR"}}},l=function(){i.query={get:function(a,b){var c=$.extend(k,{type:"GET",url:j+"/query/"+a,success:b});$.ajax(c)}},i.nodes={post:function(a,b){var c=$.extend(k,{type:"POST",url:j+"/nodes",data:JSON.stringify(a),success:b});$.ajax(c)},put:function(a,b,c){var d=$.extend(k,{type:"PUT",url:j+"/nodes/"+a,data:JSON.stringify(b),success:c});$.ajax(d)},del:function(a,b){var c=$.extend(k,{type:"DELETE",url:j+"/nodes/"+a,success:b});$.ajax(c)}},i.edges={post:function(a,b){var c=$.extend(k,{type:"POST",url:j+"/edges",data:JSON.stringify(a),success:b});$.ajax(c)},put:function(a,b,c){var d=$.extend(k,{type:"PUT",url:j+"/edges/"+a,data:JSON.stringify(b),success:c});$.ajax(d)},del:function(a,b){var c=$.extend(k,{type:"DELETE",url:j+"/edges/"+a,success:b});$.ajax(c)}},i.forNode={del:function(a,b){var c=$.extend(k,{type:"DELETE",url:j+"/edges/forNode/"+a,success:b});$.ajax(c)}}},m=function(a,b,c){i[a].get(b,c)},n=function(a,b,c){i[a].post(b,c)},o=function(a,b,c){i[a].del(b,c)},p=function(a,b,c,d){i[a].put(b,c,d)},q=function(a){void 0!==a.width&&f.setWidth(a.width),void 0!==a.height&&f.setHeight(a.height)},r=function(b,c){var d={},e=b.first,g=a.length;e=f.insertNode(e),_.each(b.nodes,function(b){b=f.insertNode(b),g=l.TOTAL_NODES?$(".infoField").hide():$(".infoField").show());var e=t(l.NODES_TO_DISPLAY,d[c]);if(e.length>0){return _.each(e,function(a){l.randomNodes.push(a)}),void l.loadInitialNode(e[0]._id,a)}}a({errorCode:404})},l.loadInitialNode=function(a,b){e.cleanUp(),l.loadNode(a,v(b))},l.getRandomNodes=function(){var a=[],b=[];l.definedNodes.length>0&&_.each(l.definedNodes,function(a){b.push(a)}),l.randomNodes.length>0&&_.each(l.randomNodes,function(a){b.push(a)});var c=0;return _.each(b,function(b){c0?_.each(d,function(a){s(o.traversal,{example:a.vertex._id},function(a){_.each(a[0][0],function(a){c[0][0].push(a)}),u(c,b)})}):s(o.traversal,{example:a},function(a){u(a,b)})})},l.loadNodeFromTreeByAttributeValue=function(a,b,c){var d={};d[a]=b,s(o.traversal,{example:d},function(a){u(a,c)})},l.getNodeExampleFromTreeByAttributeValue=function(a,b,c){var d={};d[a]=b,s(o.traversal,{example:d},function(d){if(void 0===d[0][0])throw arangoHelper.arangoError("Graph error","no nodes found"),"No suitable nodes have been found.";_.each(d[0][0],function(d){if(d.vertex[a]===b){var f={};f._key=d.vertex._key,f._id=d.vertex._id,f._rev=d.vertex._rev,e.insertNode(f),c(f)}})})},l.loadAdditionalNodeByAttributeValue=function(a,b,c){l.getNodeExampleFromTreeByAttributeValue(a,b,c)},l.loadInitialNodeByAttributeValue=function(a,b,c){e.cleanUp(),l.loadNodeFromTreeByAttributeValue(a,b,v(c))},l.requestCentralityChildren=function(a,b){s(o.childrenCentrality,{id:a},function(a){b(a[0])})},l.createEdge=function(a,b){var c={};c._from=a.source._id,c._to=a.target._id,$.ajax({cache:!1,type:"POST",url:n.edges+i,data:JSON.stringify(c),dataType:"json",contentType:"application/json",processData:!1,success:function(a){if(a.error===!1){var d,f=a.edge;f._from=c._from,f._to=c._to,d=e.insertEdge(f),b(d)}},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.deleteEdge=function(a,b){$.ajax({cache:!1,type:"DELETE",url:n.edges+a._id,contentType:"application/json",dataType:"json",processData:!1,success:function(){e.removeEdge(a),void 0!==b&&_.isFunction(b)&&b()},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.patchEdge=function(a,b,c){$.ajax({cache:!1,type:"PUT",url:n.edges+a._id,data:JSON.stringify(b),dataType:"json",contentType:"application/json",processData:!1,success:function(){a._data=$.extend(a._data,b),c()},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.createNode=function(a,b){$.ajax({cache:!1,type:"POST",url:n.vertices+g,data:JSON.stringify(a),dataType:"json",contentType:"application/json",processData:!1,success:function(c){c.error===!1&&(a._key=c.vertex._key,a._id=c.vertex._id,a._rev=c.vertex._rev,e.insertNode(a),b(a))},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.deleteNode=function(a,b){$.ajax({cache:!1,type:"DELETE",url:n.vertices+a._id,dataType:"json",contentType:"application/json",processData:!1,success:function(){e.removeEdgesForNode(a),e.removeNode(a),void 0!==b&&_.isFunction(b)&&b()},error:function(a){var b="";try{b=JSON.parse(a.responseText).errorMessage+" ("+JSON.parse(a.responseText).errorNum+")",arangoHelper.arangoError(a.statusText,b)}catch(c){throw a.statusText}}})},l.patchNode=function(a,b,c){$.ajax({cache:!1,type:"PUT",url:n.vertices+a._id,data:JSON.stringify(b),dataType:"json",contentType:"application/json",processData:!1,success:function(){a._data=$.extend(a._data,b),c(a)},error:function(a){throw a.statusText}})},l.changeToGraph=function(a,b){e.cleanUp(),q(a),void 0!==b&&(k=b===!0?"any":"outbound")},l.setNodeLimit=function(a,b){e.setNodeLimit(a,b)},l.setChildLimit=function(a){e.setChildLimit(a)},l.expandCommunity=function(a,b){e.expandCommunity(a),void 0!==b&&b()},l.getGraphs=function(a){a&&a.length>=1&&s(o.getAllGraphs,{},a)},l.getAttributeExamples=function(a){if(a&&a.length>=1){var b,c=[],d=_.shuffle(l.getNodeCollections());for(b=0;b0&&(c=c.concat(_.flatten(_.map(e,function(a){return _.keys(a)}))))}var c=_.sortBy(_.uniq(c),function(a){return a.toLowerCase()});a(c)}},l.getEdgeCollections=function(){return h},l.getSelectedEdgeCollection=function(){return i},l.useEdgeCollection=function(a){if(!_.contains(h,a))throw"Collection "+a+" is not available in the graph.";i=a},l.getNodeCollections=function(){return f},l.getSelectedNodeCollection=function(){return g},l.useNodeCollection=function(a){if(!_.contains(f,a))throw"Collection "+a+" is not available in the graph.";g=a},l.getDirection=function(){return k},l.getGraphName=function(){return j},l.setWidth=e.setWidth,l.changeTo=e.changeTo,l.getPrioList=e.getPrioList}function ModularityJoiner(){"use strict";var a={},b=Array.prototype.forEach,c=Object.keys,d=Array.isArray,e=Object.prototype.toString,f=Array.prototype.indexOf,g=Array.prototype.map,h=Array.prototype.some,i={isArray:d||function(a){return"[object Array]"===e.call(a)},isFunction:function(a){return"function"==typeof a},isString:function(a){return"[object String]"===e.call(a)},each:function(c,d,e){if(null!==c&&void 0!==c){var f,g,h;if(b&&c.forEach===b)c.forEach(d,e);else if(c.length===+c.length){for(f=0,g=c.length;g>f;f++)if(d.call(e,c[f],f,c)===a)return}else for(h in c)if(c.hasOwnProperty(h)&&d.call(e,c[h],h,c)===a)return}},keys:c||function(a){if("object"!=typeof a||Array.isArray(a))throw new TypeError("Invalid object");var b,c=[];for(b in a)a.hasOwnProperty(b)&&(c[c.length]=b);return c},min:function(a,b,c){if(!b&&i.isArray(a)&&a[0]===+a[0]&&a.length<65535)return Math.min.apply(Math,a);if(!b&&i.isEmpty(a))return 1/0;var d={computed:1/0,value:1/0};return i.each(a,function(a,e,f){var g=b?b.call(c,a,e,f):a;gc&&(c=a,b=d)}),0>c?void delete q[a]:void(q[a]=b)},t=function(a,b){s(b)},u=function(a,b){return b>a?p[a]&&p[a][b]:p[b]&&p[b][a]},v=function(a,b){return b>a?p[a][b]:p[b][a]},w=function(a,b,c){return b>a?(p[a]=p[a]||{},void(p[a][b]=c)):(p[b]=p[b]||{},void(p[b][a]=c))},x=function(a,b){if(b>a){if(!p[a])return;return delete p[a][b],void(i.isEmpty(p[a])&&delete p[a])}a!==b&&x(b,a)},y=function(a,b){var c,d;return b>a?u(a,b)?(d=v(a,b),q[a]===b?void s(a):u(a,q[a])?(c=v(a,q[a]),void(d>c&&(q[a]=b))):void s(a)):void s(a):void(a!==b&&y(b,a))},z=function(a,b){o[a]._in+=o[b]._in,o[a]._out+=o[b]._out,delete o[b]},A=function(a,b){j[a]=j[a]||{},j[a][b]=(j[a][b]||0)+1,k[b]=k[b]||{},k[b][a]=(k[b][a]||0)+1,l[a]=l[a]||{_in:0,_out:0},l[b]=l[b]||{_in:0,_out:0},l[a]._out++,l[b]._in++,m++,n=Math.pow(m,-1)},B=function(a,b){j[a]&&(j[a][b]--,0===j[a][b]&&delete j[a][b],k[b][a]--,0===k[b][a]&&delete k[b][a],l[a]._out--,l[b]._in--,m--,n=m>0?Math.pow(m,-1):0,i.isEmpty(j[a])&&delete j[a],i.isEmpty(k[b])&&delete k[b],0===l[a]._in&&0===l[a]._out&&delete l[a],0===l[b]._in&&0===l[b]._out&&delete l[b])},C=function(){return o={},i.each(l,function(a,b){o[b]={_in:a._in/m,_out:a._out/m}}),o},D=function(a,b){return o[a]._out*o[b]._in+o[a]._in*o[b]._out},E=function(a){var b=i.keys(j[a]||{}),c=i.keys(k[a]||{});return i.union(b,c)},F=function(){p={},i.each(j,function(a,b){var c=k[b]||{},d=E(b);i.each(d,function(d){var e,f=a[d]||0;f+=c[d]||0,e=f*n-D(b,d),e>0&&w(b,d,e)})})},G=function(){return q={},i.each(p,t),q},H=function(a,b,c){var d;return u(c,a)?(d=v(c,a),u(c,b)?(d+=v(c,b),w(c,a,d),x(c,b),y(c,a),void y(c,b)):(d-=D(c,b),0>d&&x(c,a),void y(c,a))):void(u(c,b)&&(d=v(c,b),d-=D(c,a),d>0&&w(c,a,d),y(c,a),x(c,b),y(c,b)))},I=function(a,b){i.each(p,function(c,d){return d===a||d===b?void i.each(c,function(c,d){return d===b?(x(a,b),void y(a,b)):void H(a,b,d)}):void H(a,b,d)})},J=function(){return j},K=function(){return q},L=function(){return p},M=function(){return o},N=function(){return r},O=function(){var a,b,c=Number.NEGATIVE_INFINITY;return i.each(q,function(d,e){c
=c?null:{sID:b,lID:a,val:c}},P=function(a){var b,c=Number.NEGATIVE_INFINITY;return i.each(a,function(a){a.q>c&&(c=a.q,b=a.nodes)}),b},Q=function(){C(),F(),G(),r={}},R=function(a){var b=a.sID,c=a.lID,d=a.val;r[b]=r[b]||{nodes:[b],q:0},r[c]?(r[b].nodes=r[b].nodes.concat(r[c].nodes),r[b].q+=r[c].q,delete r[c]):r[b].nodes.push(c),r[b].q+=d,I(b,c),z(b,c)},S=function(a,b,c){if(0===c.length)return!0;var d=[];return i.each(c,function(c){a[c]===Number.POSITIVE_INFINITY&&(a[c]=b,d=d.concat(E(c)))}),S(a,b+1,d)},T=function(a){var b={};if(i.each(j,function(a,c){b[c]=Number.POSITIVE_INFINITY}),b[a]=0,S(b,1,E(a)))return b;throw"FAIL!"},U=function(a){return function(b){return a[b]}},V=function(a,b){var c,d={},e=[],f={},g=function(a,b){var c=f[i.min(a,U(f))],e=f[i.min(b,U(f))],g=e-c;return 0===g&&(g=d[b[b.length-1]].q-d[a[a.length-1]].q),g};for(Q(),c=O();null!==c;)R(c),c=O();return d=N(),void 0!==b?(i.each(d,function(a,c){i.contains(a.nodes,b)&&delete d[c]}),e=i.pluck(i.values(d),"nodes"),f=T(b),e.sort(g),e[0]):P(d)};this.insertEdge=A,this.deleteEdge=B,this.getAdjacencyMatrix=J,this.getHeap=K,this.getDQ=L,this.getDegrees=M,this.getCommunities=N,this.getBest=O,this.setup=Q,this.joinCommunity=R,this.getCommunity=V}function NodeReducer(a){"use strict";a=a||[];var b=function(a,b){a.push(b)},c=function(a,b){if(!a.reason.example)return a.reason.example=b,1;var c=b._data||{},d=a.reason.example._data||{},e=_.union(_.keys(d),_.keys(c)),f=0,g=0;return _.each(e,function(a){void 0!==d[a]&&void 0!==c[a]&&(f++,d[a]===c[a]&&(f+=4))}),g=5*e.length,g++,f++,f/g},d=function(){return a},e=function(b){a=b},f=function(b,c){var d={},e=[];return _.each(b,function(b){var c,e,f=b._data,g=0;for(g=0;gd;d++){if(g[d]=g[d]||{reason:{type:"similar",text:"Similar Nodes"},nodes:[]},c(g[d],a)>h)return void b(g[d].nodes,a);i>g[d].nodes.length&&(f=d,i=g[d].nodes.length)}b(g[f].nodes,a)}),g):f(d,e)};this.bucketNodes=g,this.changePrioList=e,this.getPrioList=d}function NodeShaper(a,b,c){"use strict";var d,e,f=this,g=[],h=!0,i=new ContextMenu("gv_node_cm"),j=function(a,b){return _.isArray(a)?b[_.find(a,function(a){return b[a]})]:b[a]},k=function(a){if(void 0===a)return[""];"string"!=typeof a&&(a=String(a));var b=a.match(/[\w\W]{1,10}(\s|$)|\S+?(\s|$)/g);return b[0]=$.trim(b[0]),b[1]=$.trim(b[1]),b[0].length>12&&(b[0]=$.trim(a.substring(0,10)),b[1]=$.trim(a.substring(10)),b[1].length>12&&(b[1]=b[1].split(/\W/)[0],b[1].length>2&&(b[1]=b[1].substring(0,5)+"...")),b.length=2),b.length>2&&(b.length=2,b[1]+="..."),b},l=function(a){},m=l,n=function(a){return{x:a.x,y:a.y,z:1}},o=n,p=function(){_.each(g,function(a){a.position=o(a),a._isCommunity&&a.addDistortion(o)})},q=new ColourMapper,r=function(){q.reset()},s=function(a){return a._id},t=l,u=l,v=l,w=function(){return"black"},x=function(){f.parent.selectAll(".node").on("mousedown.drag",null),d={click:l,dblclick:l,drag:l,mousedown:l,mouseup:l,mousemove:l,mouseout:l,mouseover:l},e=l},y=function(a){_.each(d,function(b,c){"drag"===c?a.call(b):a.on(c,b)})},z=function(a){var b=a.filter(function(a){return a._isCommunity}),c=a.filter(function(a){return!a._isCommunity});u(c),b.each(function(a){a.shapeNodes(d3.select(this),u,z,m,q)}),h&&v(c),t(c),y(c),p()},A=function(a,b){if("update"===a)e=b;else{if(void 0===d[a])throw"Sorry Unknown Event "+a+" cannot be bound.";d[a]=b}},B=function(){var a=f.parent.selectAll(".node");p(),a.attr("transform",function(a){return"translate("+a.position.x+","+a.position.y+")scale("+a.position.z+")"}),e(a)},C=function(a){void 0!==a&&(g=a);var b=f.parent.selectAll(".node").data(g,s);b.enter().append("g").attr("class",function(a){return a._isCommunity?"node communitynode":"node"}).attr("id",s),b.exit().remove(),b.selectAll("* > *").remove(),z(b),B(),i.bindMenu($(".node"))},D=function(a){var b,c,d,e,f,g,h;switch(a.type){case NodeShaper.shapes.NONE:u=l;break;case NodeShaper.shapes.CIRCLE:b=a.radius||25,u=function(a,c){a.append("circle").attr("r",b),c&&a.attr("cx",-c).attr("cy",-c)};break;case NodeShaper.shapes.RECT:c=a.width||90,d=a.height||36,e=_.isFunction(c)?function(a){return-(c(a)/2)}:function(a){return-(c/2)},f=_.isFunction(d)?function(a){return-(d(a)/2)}:function(){return-(d/2)},u=function(a,b){b=b||0,a.append("rect").attr("width",c).attr("height",d).attr("x",function(a){return e(a)-b}).attr("y",function(a){return f(a)-b}).attr("rx","8").attr("ry","8")};break;case NodeShaper.shapes.IMAGE:c=a.width||32,d=a.height||32,g=a.fallback||"",h=a.source||g,e=_.isFunction(c)?function(a){return-(c(a)/2)}:-(c/2),f=_.isFunction(d)?function(a){return-(d(a)/2)}:-(d/2),u=function(a){var b=a.append("image").attr("width",c).attr("height",d).attr("x",e).attr("y",f);_.isFunction(h)?b.attr("xlink:href",h):b.attr("xlink:href",function(a){return a._data[h]?a._data[h]:g})};break;case void 0:break;default:throw"Sorry given Shape not known!"}},E=function(a){var b=[];_.each(a,function(a){b=$(a).find("text"),$(a).css("width","90px"),$(a).css("height","36px"),$(a).textfill({innerTag:"text",maxFontPixels:16,minFontPixels:10,explicitWidth:90,explicitHeight:36})})},F=function(a){v=_.isFunction(a)?function(b){var c=b.append("text").attr("text-anchor","middle").attr("fill",w).attr("stroke","none");c.each(function(b){var c=k(a(b)),d=c[0];2===c.length&&(d+=c[1]),d.length>15&&(d=d.substring(0,13)+"..."),(void 0===d||""===d)&&(d="ATTR NOT SET"),d3.select(this).append("tspan").attr("x","0").attr("dy","5").text(d)}),E(b)}:function(b){var c=b.append("text").attr("text-anchor","middle").attr("fill",w).attr("stroke","none");c.each(function(b){var c=k(j(a,b._data)),d=c[0];2===c.length&&(d+=c[1]),d.length>15&&(d=d.substring(0,13)+"..."),(void 0===d||""===d)&&(d="ATTR NOT SET"),d3.select(this).append("tspan").attr("x","0").attr("dy","5").text(d)}),E(b)}},G=function(a){void 0!==a.reset&&a.reset&&x(),_.each(a,function(a,b){"reset"!==b&&A(b,a)})},H=function(a){switch(r(),a.type){case"single":t=function(b){b.attr("fill",a.fill)},w=function(b){return a.stroke};break;case"expand":t=function(b){b.attr("fill",function(b){return b._expanded?a.expanded:a.collapsed})},w=function(a){return"white"};break;case"attribute":t=function(b){b.attr("fill",function(b){return void 0===b._data?q.getCommunityColour():q.getColour(j(a.key,b._data))}).attr("stroke",function(a){return a._expanded?"#fff":"transparent"}).attr("fill-opacity",function(a){return a._expanded?"1":"0.3"})},w=function(b){return void 0===b._data?q.getForegroundCommunityColour():q.getForegroundColour(j(a.key,b._data))};break;default:throw"Sorry given colour-scheme not known"}},I=function(a){if("reset"===a)o=n;else{if(!_.isFunction(a))throw"Sorry distortion cannot be parsed.";o=a}},J=function(a){void 0!==a.shape&&D(a.shape),void 0!==a.label&&(F(a.label),f.label=a.label),void 0!==a.actions&&G(a.actions),void 0!==a.color&&(H(a.color),f.color=a.color),void 0!==a.distortion&&I(a.distortion)};f.parent=a,x(),void 0===b&&(b={}),void 0===b.shape&&(b.shape={type:NodeShaper.shapes.RECT}),void 0===b.color&&(b.color={type:"single",fill:"#333333",stroke:"white"}),void 0===b.distortion&&(b.distortion="reset"),J(b),_.isFunction(c)&&(s=c),f.changeTo=function(a){J(a),C()},f.drawNodes=function(a){C(a)},f.updateNodes=function(){B()},f.reshapeNodes=function(){C()},f.activateLabel=function(a){h=a?!0:!1,C()},f.getColourMapping=function(){return q.getList()},f.setColourMappingListener=function(a){q.setChangeListener(a)},f.setGVStartFunction=function(a){m=a},f.getLabel=function(){return f.label||""},f.getColor=function(){return f.color.key||""},f.addMenuEntry=function(a,b){i.addEntry(a,b)},f.resetColourMap=r}function PreviewAdapter(a,b,c,d){"use strict";if(void 0===a)throw"The nodes have to be given.";if(void 0===b)throw"The edges have to be given.";if(void 0===c)throw"A reference to the graph viewer has to be given.";var e=this,f=new AbstractAdapter(a,b,this,c),g=function(a){void 0!==a.width&&f.setWidth(a.width),void 0!==a.height&&f.setHeight(a.height)},h=function(a,b){var c={},d=a.first;d=f.insertNode(d),_.each(a.nodes,function(a){a=f.insertNode(a),c[a._id]=a}),_.each(a.edges,function(a){f.insertEdge(a)}),delete c[d._id],void 0!==b&&_.isFunction(b)&&b(d)};d=d||{},g(d),e.loadInitialNode=function(a,b){f.cleanUp();var c=function(a){b(f.insertInitialNode(a))};e.loadNode(a,c)},e.loadNode=function(a,b){var c=[],d=[],e={},f={_id:1,label:"Node 1",image:"img/stored.png"},g={_id:2,label:"Node 2"},i={_id:3,label:"Node 3"},j={_id:4,label:"Node 4"},k={_id:5,label:"Node 5"},l={_id:"1-2",_from:1,_to:2,label:"Edge 1"},m={_id:"1-3",_from:1,_to:3,label:"Edge 2"},n={_id:"1-4",_from:1,_to:4,label:"Edge 3"},o={_id:"1-5",_from:1,_to:5,label:"Edge 4"},p={_id:"2-3",_from:2,_to:3,label:"Edge 5"};c.push(f),c.push(g),c.push(i),c.push(j),c.push(k),d.push(l),d.push(m),d.push(n),d.push(o),d.push(p),e.first=f,e.nodes=c,e.edges=d,h(e,b)},e.explore=f.explore,e.requestCentralityChildren=function(a,b){},e.createEdge=function(a,b){window.alert("Server-side: createEdge was triggered.")},e.deleteEdge=function(a,b){window.alert("Server-side: deleteEdge was triggered.")},e.patchEdge=function(a,b,c){window.alert("Server-side: patchEdge was triggered.")},e.createNode=function(a,b){window.alert("Server-side: createNode was triggered.")},e.deleteNode=function(a,b){window.alert("Server-side: deleteNode was triggered."),window.alert("Server-side: onNodeDelete was triggered.")},e.patchNode=function(a,b,c){window.alert("Server-side: patchNode was triggered.")},e.setNodeLimit=function(a,b){f.setNodeLimit(a,b)},e.setChildLimit=function(a){f.setChildLimit(a)},e.setWidth=f.setWidth,e.expandCommunity=function(a,b){f.expandCommunity(a),void 0!==b&&b()}}function WebWorkerWrapper(a,b){"use strict";if(void 0===a)throw"A class has to be given.";if(void 0===b)throw"A callback has to be given.";var c,d=Array.prototype.slice.call(arguments),e={},f=function(){var c,d=function(a){switch(a.data.cmd){case"construct":try{w=new(Function.prototype.bind.apply(Construct,[null].concat(a.data.args))),w?self.postMessage({cmd:"construct",result:!0}):self.postMessage({cmd:"construct",result:!1})}catch(b){self.postMessage({cmd:"construct",result:!1,error:b.message||b})}break;default:var c,d={cmd:a.data.cmd};if(w&&"function"==typeof w[a.data.cmd])try{c=w[a.data.cmd].apply(w,a.data.args),c&&(d.result=c),self.postMessage(d)}catch(e){d.error=e.message||e,self.postMessage(d)}else d.error="Method not known",self.postMessage(d)}},e=function(a){var b="var w, Construct = "+a.toString()+";self.onmessage = "+d.toString();return new window.Blob(b.split())},f=window.webkitURL||window.URL,g=new e(a);return c=new window.Worker(f.createObjectURL(g)),c.onmessage=b,c},g=function(){return a.apply(this,d)};try{return c=f(),e.call=function(a){var b=Array.prototype.slice.call(arguments);b.shift(),c.postMessage({cmd:a,args:b})},d.shift(),d.shift(),d.unshift("construct"),e.call.apply(this,d),e}catch(h){d.shift(),d.shift(),g.prototype=a.prototype;try{c=new g}catch(i){return void b({data:{cmd:"construct",error:i}})}return e.call=function(a){var d=Array.prototype.slice.call(arguments),e={data:{cmd:a}};if(!_.isFunction(c[a]))return e.data.error="Method not known",void b(e);d.shift();try{e.data.result=c[a].apply(c,d),b(e)}catch(f){e.data.error=f,b(e)}},b({data:{cmd:"construct",result:!0}}),e}}function ZoomManager(a,b,c,d,e,f,g,h){"use strict";if(void 0===a||0>a)throw"A width has to be given.";if(void 0===b||0>b)throw"A height has to be given.";if(void 0===c||void 0===c.node||"svg"!==c.node().tagName.toLowerCase())throw"A svg has to be given.";if(void 0===d||void 0===d.node||"g"!==d.node().tagName.toLowerCase())throw"A group has to be given.";if(void 0===e||void 0===e.activateLabel||void 0===e.changeTo||void 0===e.updateNodes)throw"The Node shaper has to be given.";if(void 0===f||void 0===f.activateLabel||void 0===f.updateEdges)throw"The Edge shaper has to be given.";var i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x=this,y=a*b,z=h||function(){},A=function(){var a,b;return l>=k?(b=i*l,b*=b,a=60*b):(b=j*l,b*=b,a=4*Math.PI*b),Math.floor(y/a)},B=function(){q=s/l-.99999999,r=t/l,p.distortion(q),p.radius(r)},C=function(a,b,c,g){g?null!==a&&(l=a):l=a,null!==b&&(m[0]+=b),null!==c&&(m[1]+=c),o=A(),z(o),e.activateLabel(l>=k),f.activateLabel(l>=k),B();var h="translate("+m+")",i=" scale("+l+")";d._isCommunity?d.attr("transform",h):d.attr("transform",h+i),v&&v.slider("option","value",l)},D=function(a){var b=[];return b[0]=a[0]-n[0],b[1]=a[1]-n[1],n[0]=a[0],n[1]=a[1],b},E=function(a){void 0===a&&(a={});var b=a.maxFont||16,c=a.minFont||6,d=a.maxRadius||25,e=a.minRadius||4;s=a.focusZoom||1,t=a.focusRadius||100,w=e/d,i=b,j=d,k=c/b,l=1,m=[0,0],n=[0,0],B(),o=A(),u=d3.behavior.zoom().scaleExtent([w,1]).on("zoom",function(){var a,b=d3.event.sourceEvent,c=l;"mousewheel"===b.type||"DOMMouseScroll"===b.type?(b.wheelDelta?b.wheelDelta>0?(c+=.01,c>1&&(c=1)):(c-=.01,w>c&&(c=w)):b.detail>0?(c+=.01,c>1&&(c=1)):(c-=.01,w>c&&(c=w)),a=[0,0]):a=D(d3.event.translate),C(c,a[0],a[1])})},F=function(){};p=d3.fisheye.circular(),E(g),c.call(u),e.changeTo({distortion:p}),c.on("mousemove",F),x.translation=function(){return null},x.scaleFactor=function(){return l},x.scaledMouse=function(){return null},x.getDistortion=function(){return q},x.getDistortionRadius=function(){return r},x.getNodeLimit=function(){return o},x.getMinimalZoomFactor=function(){return w},x.registerSlider=function(a){v=a},x.triggerScale=function(a){C(a,null,null,!0)},x.triggerTranslation=function(a,b){C(null,a,b,!0)},x.changeWidth=function(c){y=a*b}}function ArangoAdapterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The ArangoAdapter has to be given.";this.addControlChangeCollections=function(c){var d="control_adapter_collections",e=d+"_";b.getCollections(function(f,g){b.getGraphs(function(h){uiComponentsHelper.createButton(a,"Collections",d,function(){modalDialogHelper.createModalDialog("Switch Collections",e,[{type:"decission",id:"collections",group:"loadtype",text:"Select existing collections",isDefault:void 0===b.getGraphName(),interior:[{type:"list",id:"node_collection",text:"Vertex collection",objects:f,selected:b.getNodeCollection()},{type:"list",id:"edge_collection",text:"Edge collection",objects:g,selected:b.getEdgeCollection()}]},{type:"decission",id:"graphs",group:"loadtype",text:"Select existing graph",isDefault:void 0!==b.getGraphName(),
-interior:[{type:"list",id:"graph",objects:h,selected:b.getGraphName()}]},{type:"checkbox",text:"Start with random vertex",id:"random",selected:!0},{type:"checkbox",id:"undirected",selected:"any"===b.getDirection()}],function(){var a=$("#"+e+"node_collection").children("option").filter(":selected").text(),d=$("#"+e+"edge_collection").children("option").filter(":selected").text(),f=$("#"+e+"graph").children("option").filter(":selected").text(),g=!!$("#"+e+"undirected").prop("checked"),h=!!$("#"+e+"random").prop("checked"),i=$("input[type='radio'][name='loadtype']:checked").prop("id");return i===e+"collections"?b.changeToCollections(a,d,g):b.changeToGraph(f,g),h?void b.loadRandomNode(c):void(_.isFunction(c)&&c())})})})})},this.addControlChangePriority=function(){var c="control_adapter_priority",d=c+"_",e=(b.getPrioList(),"Group vertices");uiComponentsHelper.createButton(a,e,c,function(){modalDialogHelper.createModalChangeDialog(e,d,[{type:"extendable",id:"attribute",objects:b.getPrioList()}],function(){var a=$("input[id^="+d+"attribute_]"),c=[];a.each(function(a,b){var d=$(b).val();""!==d&&c.push(d)}),b.changeTo({prioList:c})})})},this.addAll=function(){this.addControlChangeCollections(),this.addControlChangePriority()}}function ContextMenu(a){"use strict";if(void 0===a)throw"An id has to be given.";var b,c,d="#"+a,e=function(a,d){var e,f;e=document.createElement("div"),e.className="context-menu-item",f=document.createElement("div"),f.className="context-menu-item-inner",f.appendChild(document.createTextNode(a)),f.onclick=function(){d(d3.select(c.target).data()[0])},e.appendChild(f),b.appendChild(e)},f=function(a){c=$.contextMenu.create(d,{shadow:!1}),a.each(function(){$(this).bind("contextmenu",function(a){return c.show(this,a),!1})})},g=function(){return b=document.getElementById(a),b&&b.parentElement.removeChild(b),b=document.createElement("div"),b.className="context-menu context-menu-theme-osx",b.id=a,document.body.appendChild(b),b};g(),this.addEntry=e,this.bindMenu=f}function EdgeShaperControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The EdgeShaper has to be given.";var c=this;this.addControlOpticShapeNone=function(){var c="control_edge_none";uiComponentsHelper.createButton(a,"None",c,function(){b.changeTo({shape:{type:EdgeShaper.shapes.NONE}})})},this.addControlOpticShapeArrow=function(){var c="control_edge_arrow";uiComponentsHelper.createButton(a,"Arrow",c,function(){b.changeTo({shape:{type:EdgeShaper.shapes.ARROW}})})},this.addControlOpticLabel=function(){var c="control_edge_label",d=c+"_";uiComponentsHelper.createButton(a,"Configure Label",c,function(){modalDialogHelper.createModalDialog("Switch Label Attribute",d,[{type:"text",id:"key",text:"Edge label attribute",value:b.getLabel()}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({label:a})})})},this.addControlOpticLabelList=function(){var d="control_edge_label",e=d+"_";uiComponentsHelper.createButton(a,"Configure Label",d,function(){modalDialogHelper.createModalDialog("Change Label Attribute",e,[{type:"extendable",id:"label",text:"Edge label attribute",objects:b.getLabel()}],function(){var a=$("input[id^="+e+"label_]"),d=[];a.each(function(a,b){var c=$(b).val();""!==c&&d.push(c)});var f={label:d};c.applyLocalStorage(f),b.changeTo(f)})})},this.applyLocalStorage=function(a){if("undefined"!==Storage)try{var b=JSON.parse(localStorage.getItem("graphSettings")),c=window.location.hash.split("/")[1];_.each(a,function(a,d){void 0!==d&&(b[c].viewer.hasOwnProperty("edgeShaper")||(b[c].viewer.edgeShaper={}),b[c].viewer.edgeShaper[d]=a)}),localStorage.setItem("graphSettings",JSON.stringify(b))}catch(d){console.log(d)}},this.addControlOpticSingleColour=function(){var c="control_edge_singlecolour",d=c+"_";uiComponentsHelper.createButton(a,"Single Colour",c,function(){modalDialogHelper.createModalDialog("Switch to Colour",d,[{type:"text",id:"stroke"}],function(){var a=$("#"+d+"stroke").attr("value");b.changeTo({color:{type:"single",stroke:a}})})})},this.addControlOpticAttributeColour=function(){var c="control_edge_attributecolour",d=c+"_";uiComponentsHelper.createButton(a,"Colour by Attribute",c,function(){modalDialogHelper.createModalDialog("Display colour by attribute",d,[{type:"text",id:"key"}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({color:{type:"attribute",key:a}})})})},this.addControlOpticGradientColour=function(){var c="control_edge_gradientcolour",d=c+"_";uiComponentsHelper.createButton(a,"Gradient Colour",c,function(){modalDialogHelper.createModalDialog("Change colours for gradient",d,[{type:"text",id:"source"},{type:"text",id:"target"}],function(){var a=$("#"+d+"source").attr("value"),c=$("#"+d+"target").attr("value");b.changeTo({color:{type:"gradient",source:a,target:c}})})})},this.addAllOptics=function(){c.addControlOpticShapeNone(),c.addControlOpticShapeArrow(),c.addControlOpticLabel(),c.addControlOpticSingleColour(),c.addControlOpticAttributeColour(),c.addControlOpticGradientColour()},this.addAllActions=function(){},this.addAll=function(){c.addAllOptics(),c.addAllActions()}}function EventDispatcherControls(a,b,c,d,e){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The NodeShaper has to be given.";if(void 0===c)throw"The EdgeShaper has to be given.";if(void 0===d)throw"The Start callback has to be given.";var f=this,g={expand:{icon:"hand-pointer-o",title:"Expand a node."},add:{icon:"plus-square",title:"Add a node."},trash:{icon:"minus-square",title:"Remove a node/edge."},drag:{icon:"hand-rock-o",title:"Drag a node."},edge:{icon:"external-link-square",title:"Create an edge between two nodes."},edit:{icon:"pencil-square",title:"Edit attributes of a node."},view:{icon:"search",title:"View attributes of a node."}},h=new EventDispatcher(b,c,e),i=e.edgeEditor.adapter,j=!!i&&_.isFunction(i.useNodeCollection)&&_.isFunction(i.useEdgeCollection),k=function(b){a.appendChild(b)},l=function(a,b,c){var d=uiComponentsHelper.createIconButton(a,"control_event_"+b,c);k(d)},m=function(a){h.rebind("nodes",a)},n=function(a){h.rebind("edges",a)},o=function(a){h.rebind("svg",a)},p=function(a){var b=a||window.event,c={};return c.x=b.clientX,c.y=b.clientY,c.x+=document.body.scrollLeft,c.y+=document.body.scrollTop,c},q=function(a){var b,c,d,e=p(a),f=$("svg#graphViewerSVG").offset();return b=d3.select("svg#graphViewerSVG").node(),d=b.getBoundingClientRect(),$("svg#graphViewerSVG").height()<=d.height?{x:e.x-f.left,y:e.y-f.top}:(c=b.getBBox(),{x:e.x-(d.left-c.x),y:e.y-(d.top-c.y)})},r={nodes:{},edges:{},svg:{}},s=function(){var a="control_event_new_node",c=a+"_",e=function(a){var e=q(a);modalDialogHelper.createModalCreateDialog("Create New Node",c,{},function(a){h.events.CREATENODE(a,function(a){$("#"+c+"modal").modal("hide"),b.reshapeNodes(),d()},e.x,e.y)()})};r.nodes.newNode=e},t=function(){var a=function(a){modalDialogHelper.createModalViewDialog("View Node "+a._id,"control_event_node_view_",a._data,function(){modalDialogHelper.createModalEditDialog("Edit Node "+a._id,"control_event_node_edit_",a._data,function(b){h.events.PATCHNODE(a,b,function(){$("#control_event_node_edit_modal").modal("hide")})()})})},b=function(a){modalDialogHelper.createModalViewDialog("View Edge "+a._id,"control_event_edge_view_",a._data,function(){modalDialogHelper.createModalEditDialog("Edit Edge "+a._id,"control_event_edge_edit_",a._data,function(b){h.events.PATCHEDGE(a,b,function(){$("#control_event_edge_edit_modal").modal("hide")})()})})};r.nodes.view=a,r.edges.view=b},u=function(){var a=h.events.STARTCREATEEDGE(function(a,b){var d=q(b),e=c.addAnEdgeFollowingTheCursor(d.x,d.y);h.bind("svg","mousemove",function(a){var b=q(a);e(b.x,b.y)})}),b=h.events.FINISHCREATEEDGE(function(a){c.removeCursorFollowingEdge(),h.bind("svg","mousemove",function(){}),d()}),e=function(){h.events.CANCELCREATEEDGE(),c.removeCursorFollowingEdge(),h.bind("svg","mousemove",function(){})};r.nodes.startEdge=a,r.nodes.endEdge=b,r.svg.cancelEdge=e},v=function(){var a=function(a){arangoHelper.openDocEditor(a._id,"document")},b=function(a){arangoHelper.openDocEditor(a._id,"edge")};r.nodes.edit=a,r.edges.edit=b},w=function(){var a=function(a){modalDialogHelper.createModalDeleteDialog("Delete Node "+a._id,"control_event_node_delete_",a,function(a){h.events.DELETENODE(function(){$("#control_event_node_delete_modal").modal("hide"),b.reshapeNodes(),c.reshapeEdges(),d()})(a)})},e=function(a){modalDialogHelper.createModalDeleteDialog("Delete Edge "+a._id,"control_event_edge_delete_",a,function(a){h.events.DELETEEDGE(function(){$("#control_event_edge_delete_modal").modal("hide"),b.reshapeNodes(),c.reshapeEdges(),d()})(a)})};r.nodes.del=a,r.edges.del=e},x=function(){r.nodes.spot=h.events.EXPAND};s(),t(),u(),v(),w(),x(),this.dragRebinds=function(){return{nodes:{drag:h.events.DRAG}}},this.newNodeRebinds=function(){return{svg:{click:r.nodes.newNode}}},this.viewRebinds=function(){return{nodes:{click:r.nodes.view},edges:{click:r.edges.view}}},this.connectNodesRebinds=function(){return{nodes:{mousedown:r.nodes.startEdge,mouseup:r.nodes.endEdge},svg:{mouseup:r.svg.cancelEdge}}},this.editRebinds=function(){return{nodes:{click:r.nodes.edit},edges:{click:r.edges.edit}}},this.expandRebinds=function(){return{nodes:{click:r.nodes.spot}}},this.deleteRebinds=function(){return{nodes:{click:r.nodes.del},edges:{click:r.edges.del}}},this.rebindAll=function(a){m(a.nodes),n(a.edges),o(a.svg)},b.addMenuEntry("Edit",r.nodes.edit),b.addMenuEntry("Spot",r.nodes.spot),b.addMenuEntry("Trash",r.nodes.del),c.addMenuEntry("Edit",r.edges.edit),c.addMenuEntry("Trash",r.edges.del),this.addControlNewNode=function(){var a=g.add,b="select_node_collection",c=function(){j&&i.getNodeCollections().length>1&&modalDialogHelper.createModalDialog("Select Vertex Collection",b,[{type:"list",id:"vertex",objects:i.getNodeCollections(),text:"Select collection",selected:i.getSelectedNodeCollection()}],function(){var a=$("#"+b+"vertex").children("option").filter(":selected").text();i.useNodeCollection(a)},"Select"),f.rebindAll(f.newNodeRebinds())};l(a,"new_node",c)},this.addControlView=function(){var a=g.view,b=function(){f.rebindAll(f.viewRebinds())};l(a,"view",b)},this.addControlDrag=function(){var a=g.drag,b=function(){f.rebindAll(f.dragRebinds())};l(a,"drag",b)},this.addControlEdit=function(){var a=g.edit,b=function(){f.rebindAll(f.editRebinds())};l(a,"edit",b)},this.addControlExpand=function(){var a=g.expand,b=function(){f.rebindAll(f.expandRebinds())};l(a,"expand",b)},this.addControlDelete=function(){var a=g.trash,b=function(){f.rebindAll(f.deleteRebinds())};l(a,"delete",b)},this.addControlConnect=function(){var a=g.edge,b="select_edge_collection",c=function(){j&&i.getEdgeCollections().length>1&&modalDialogHelper.createModalDialog("Select Edge Collection",b,[{type:"list",id:"edge",objects:i.getEdgeCollections(),text:"Select collection",selected:i.getSelectedEdgeCollection()}],function(){var a=$("#"+b+"edge").children("option").filter(":selected").text();i.useEdgeCollection(a)},"Select"),f.rebindAll(f.connectNodesRebinds())};l(a,"connect",c)},this.addAll=function(){f.addControlExpand(),f.addControlDrag(),f.addControlEdit(),f.addControlConnect(),f.addControlNewNode(),f.addControlDelete()}}function GharialAdapterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The GharialAdapter has to be given.";this.addControlChangeGraph=function(c){var d="control_adapter_graph",e=d+"_";b.getGraphs(function(f){uiComponentsHelper.createButton(a,"Switch Graph",d,function(){modalDialogHelper.createModalDialog("Switch Graph",e,[{type:"list",id:"graph",objects:f,text:"Select graph",selected:b.getGraphName()},{type:"checkbox",text:"Start with random vertex",id:"random",selected:!0}],function(){var a=$("#"+e+"graph").children("option").filter(":selected").text(),d=!!$("#"+e+"undirected").prop("checked"),f=!!$("#"+e+"random").prop("checked");return b.changeToGraph(a,d),f?void b.loadRandomNode(c):void(_.isFunction(c)&&c())})})})},this.addControlChangePriority=function(){var c="control_adapter_priority",d=c+"_",e="Group vertices";uiComponentsHelper.createButton(a,e,c,function(){modalDialogHelper.createModalChangeDialog(e+" by attribute",d,[{type:"extendable",id:"attribute",objects:b.getPrioList()}],function(){var a=$("input[id^="+d+"attribute_]"),c=[];_.each(a,function(a){var b=$(a).val();""!==b&&c.push(b)}),b.changeTo({prioList:c})})})},this.addAll=function(){this.addControlChangeGraph(),this.addControlChangePriority()}}function GraphViewerPreview(a,b){"use strict";var c,d,e,f,g,h,i,j=function(){return d3.select(a).append("svg").attr("id","graphViewerSVG").attr("width",d).attr("height",e).attr("class","graph-viewer").attr("style","width:"+d+"px;height:"+e+";")},k=function(a){var b=0;return _.each(a,function(c,d){c===!1?delete a[d]:b++}),b>0},l=function(a,b){_.each(b,function(b,c){a[c]=a[c]||{},_.each(b,function(b,d){a[c][d]=b})})},m=function(a){if(a){var b={};a.drag&&l(b,i.dragRebinds()),a.create&&(l(b,i.newNodeRebinds()),l(b,i.connectNodesRebinds())),a.remove&&l(b,i.deleteRebinds()),a.expand&&l(b,i.expandRebinds()),a.edit&&l(b,i.editRebinds()),i.rebindAll(b)}},n=function(b){var c=document.createElement("div");i=new EventDispatcherControls(c,f.nodeShaper,f.edgeShaper,f.start,f.dispatcherConfig),c.id="toolbox",c.className="btn-group btn-group-vertical pull-left toolbox",a.appendChild(c),_.each(b,function(a,b){switch(b){case"expand":i.addControlExpand();break;case"create":i.addControlNewNode(),i.addControlConnect();break;case"drag":i.addControlDrag();break;case"edit":i.addControlEdit();break;case"remove":i.addControlDelete()}})},o=function(a){var b=document.createElement("div");i=new EventDispatcherControls(b,f.nodeShaper,f.edgeShaper,f.start,f.dispatcherConfig)},p=function(){b&&(b.nodeShaper&&(b.nodeShaper.label&&(b.nodeShaper.label="label"),b.nodeShaper.shape&&b.nodeShaper.shape.type===NodeShaper.shapes.IMAGE&&b.nodeShaper.shape.source&&(b.nodeShaper.shape.source="image")),b.edgeShaper&&b.edgeShaper.label&&(b.edgeShaper.label="label"))},q=function(){return p(),new GraphViewer(c,d,e,h,b)};d=a.offsetWidth,e=a.offsetHeight,h={type:"preview"},b=b||{},g=k(b.toolbox),g&&(d-=43),c=j(),f=q(),g?n(b.toolbox):o(),f.loadGraph("1"),m(b.actions)}function GraphViewerUI(a,b,c,d,e,f){"use strict";if(void 0===a)throw"A parent element has to be given.";if(!a.id)throw"The parent element needs an unique id.";if(void 0===b)throw"An adapter configuration has to be given";var g,h,i,j,k,l,m,n,o,p=c+20||a.offsetWidth-81+20,q=d||a.offsetHeight,r=document.createElement("ul"),s=document.createElement("div"),t=function(){g.adapter.NODES_TO_DISPLAYGraph too big. A random section is rendered.'),$(".infoField .fa-info-circle").attr("title","You can display additional/other vertices by using the toolbar buttons.").tooltip())},u=function(){var a,b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),i=document.createElement("input"),j=document.createElement("i"),k=document.createElement("span"),l=function(){$(s).css("cursor","progress")},n=function(){$(s).css("cursor","")},o=function(a){return n(),a&&a.errorCode&&404===a.errorCode?void arangoHelper.arangoError("Graph error","could not find a matching node."):void 0},p=function(){l(),""===a.value||void 0===a.value?g.loadGraph(i.value,o):g.loadGraphWithAttributeValue(a.value,i.value,o)};b.id="filterDropdown",b.className="headerDropdown smallDropdown",c.className="dropdownInner",d.className="queryline",a=document.createElement("input"),m=document.createElement("ul"),e.className="pull-left input-append searchByAttribute",a.id="attribute",a.type="text",a.placeholder="Attribute name",f.id="attribute_example_toggle",f.className="button-neutral gv_example_toggle",h.className="caret gv_caret",m.className="gv-dropdown-menu",i.id="value",i.className="searchInput gv_searchInput",i.type="text",i.placeholder="Attribute value",j.id="loadnode",j.className="fa fa-search",k.className="searchEqualsLabel",k.appendChild(document.createTextNode("==")),c.appendChild(d),d.appendChild(e),e.appendChild(a),e.appendChild(f),e.appendChild(m),f.appendChild(h),d.appendChild(k),d.appendChild(i),d.appendChild(j),j.onclick=p,$(i).keypress(function(a){return 13===a.keyCode||13===a.which?(p(),!1):void 0}),f.onclick=function(){$(m).slideToggle(200)};var q=document.createElement("p");return q.className="dropdown-title",q.innerHTML="Filter graph by attribute:",b.appendChild(q),b.appendChild(c),b},v=function(){var a,b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),i=document.createElement("input"),j=document.createElement("i"),k=document.createElement("span"),l=function(){$(s).css("cursor","progress")},m=function(){$(s).css("cursor","")},o=function(a){return m(),a&&a.errorCode&&404===a.errorCode?void arangoHelper.arangoError("Graph error","could not find a matching node."):void 0},p=function(){l(),""!==a.value&&g.loadGraphWithAdditionalNode(a.value,i.value,o)};b.id="nodeDropdown",b.className="headerDropdown smallDropdown",c.className="dropdownInner",d.className="queryline",a=document.createElement("input"),n=document.createElement("ul"),e.className="pull-left input-append searchByAttribute",a.id="attribute",a.type="text",a.placeholder="Attribute name",f.id="attribute_example_toggle2",f.className="button-neutral gv_example_toggle",h.className="caret gv_caret",n.className="gv-dropdown-menu",i.id="value",i.className="searchInput gv_searchInput",i.type="text",i.placeholder="Attribute value",j.id="loadnode",j.className="fa fa-search",k.className="searchEqualsLabel",k.appendChild(document.createTextNode("==")),c.appendChild(d),d.appendChild(e),e.appendChild(a),e.appendChild(f),e.appendChild(n),f.appendChild(h),d.appendChild(k),d.appendChild(i),d.appendChild(j),C(n),j.onclick=p,$(i).keypress(function(a){return 13===a.keyCode||13===a.which?(p(),!1):void 0}),f.onclick=function(){$(n).slideToggle(200)};var q=document.createElement("p");return q.className="dropdown-title",q.innerHTML="Add specific node by attribute:",b.appendChild(q),b.appendChild(c),b},w=function(){var a,b,c,d,e,f,g,h;return a=document.createElement("div"),a.id="configureDropdown",a.className="headerDropdown",b=document.createElement("div"),b.className="dropdownInner",c=document.createElement("ul"),d=document.createElement("li"),d.className="nav-header",d.appendChild(document.createTextNode("Vertices")),g=document.createElement("ul"),h=document.createElement("li"),h.className="nav-header",h.appendChild(document.createTextNode("Edges")),e=document.createElement("ul"),f=document.createElement("li"),f.className="nav-header",f.appendChild(document.createTextNode("Connection")),c.appendChild(d),g.appendChild(h),e.appendChild(f),b.appendChild(c),b.appendChild(g),b.appendChild(e),a.appendChild(b),{configure:a,nodes:c,edges:g,col:e}},x=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;return a.className="headerButtonBar",e=document.createElement("ul"),e.className="headerButtonList",a.appendChild(e),g=document.createElement("li"),g.className="enabled",h=document.createElement("a"),h.id=b,h.className="headerButton",i=document.createElement("span"),i.className="icon_arangodb_settings2",$(i).attr("title","Configure"),e.appendChild(g),g.appendChild(h),h.appendChild(i),j=document.createElement("li"),j.className="enabled",k=document.createElement("a"),k.id=d,k.className="headerButton",l=document.createElement("span"),l.className="fa fa-search-plus",$(l).attr("title","Show additional vertices"),e.appendChild(j),j.appendChild(k),k.appendChild(l),m=document.createElement("li"),m.className="enabled",n=document.createElement("a"),n.id=c,n.className="headerButton",o=document.createElement("span"),o.className="icon_arangodb_filter",$(o).attr("title","Filter"),e.appendChild(m),m.appendChild(n),n.appendChild(o),f=w(),f.filter=u(),f.node=v(),h.onclick=function(){$("#filterdropdown").removeClass("activated"),$("#nodedropdown").removeClass("activated"),$("#configuredropdown").toggleClass("activated"),$(f.configure).slideToggle(200),$(f.filter).hide(),$(f.node).hide()},k.onclick=function(){$("#filterdropdown").removeClass("activated"),$("#configuredropdown").removeClass("activated"),$("#nodedropdown").toggleClass("activated"),$(f.node).slideToggle(200),$(f.filter).hide(),$(f.configure).hide()},n.onclick=function(){$("#configuredropdown").removeClass("activated"),$("#nodedropdown").removeClass("activated"),$("#filterdropdown").toggleClass("activated"),$(f.filter).slideToggle(200),$(f.node).hide(),$(f.configure).hide()},f},y=function(){return d3.select("#"+a.id+" #background").append("svg").attr("id","graphViewerSVG").attr("width",p).attr("height",q).attr("class","graph-viewer").style("width",p+"px").style("height",q+"px")},z=function(){var a=document.createElement("div"),b=document.createElement("div"),c=document.createElement("button"),d=document.createElement("button"),e=document.createElement("button"),f=document.createElement("button");a.className="gv_zoom_widget",b.className="gv_zoom_buttons_bg",c.className="btn btn-icon btn-zoom btn-zoom-top gv-zoom-btn pan-top",d.className="btn btn-icon btn-zoom btn-zoom-left gv-zoom-btn pan-left",e.className="btn btn-icon btn-zoom btn-zoom-right gv-zoom-btn pan-right",f.className="btn btn-icon btn-zoom btn-zoom-bottom gv-zoom-btn pan-bottom",c.onclick=function(){g.zoomManager.triggerTranslation(0,-10)},d.onclick=function(){g.zoomManager.triggerTranslation(-10,0)},e.onclick=function(){g.zoomManager.triggerTranslation(10,0)},f.onclick=function(){g.zoomManager.triggerTranslation(0,10)},b.appendChild(c),b.appendChild(d),b.appendChild(e),b.appendChild(f),l=document.createElement("div"),l.id="gv_zoom_slider",l.className="gv_zoom_slider",s.appendChild(a),s.insertBefore(a,o[0][0]),a.appendChild(b),a.appendChild(l),$("#gv_zoom_slider").slider({orientation:"vertical",min:g.zoomManager.getMinimalZoomFactor(),max:1,value:1,step:.01,slide:function(a,b){g.zoomManager.triggerScale(b.value)}}),g.zoomManager.registerSlider($("#gv_zoom_slider"))},A=function(){var a=document.createElement("div"),b=new EventDispatcherControls(a,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig);a.id="toolbox",a.className="btn-group btn-group-vertical toolbox",s.insertBefore(a,o[0][0]),b.addAll(),$("#control_event_expand").click()},B=function(){var a='';$(".headerBar .headerButtonList").prepend(a)},C=function(a){var b;b=a?$(a):$(m),b.innerHTML="";var c=document.createElement("li"),d=document.createElement("img");$(c).append(d),d.className="gv-throbber",b.append(c),g.adapter.getAttributeExamples(function(a){$(b).html(""),_.each(a,function(a){var c=document.createElement("li"),d=document.createElement("a"),e=document.createElement("label");$(c).append(d),$(d).append(e),$(e).append(document.createTextNode(a)),e.className="gv_dropdown_label",b.append(c),c.onclick=function(){b.value=a,$(b).parent().find("input").val(a),$(b).slideToggle(200)}})})},D=function(){var a=document.createElement("div"),b=document.createElement("div"),c=document.createElement("a"),d=x(b,"configuredropdown","filterdropdown","nodedropdown");i=new NodeShaperControls(d.nodes,g.nodeShaper),j=new EdgeShaperControls(d.edges,g.edgeShaper),k=new GharialAdapterControls(d.col,g.adapter),r.id="menubar",a.className="headerBar",b.id="modifiers",c.appendChild(document.createTextNode("Graph Viewer")),c.className="arangoHeader",r.appendChild(a),r.appendChild(d.configure),r.appendChild(d.filter),r.appendChild(d.node),a.appendChild(b),a.appendChild(c),k.addControlChangeGraph(function(){C(),g.start(!0)}),k.addControlChangePriority(),i.addControlOpticLabelAndColourList(g.adapter),j.addControlOpticLabelList(),C()},E=function(){h=i.createColourMappingList(),h.className="gv-colour-list",s.insertBefore(h,o[0][0])};a.appendChild(r),a.appendChild(s),s.className="contentDiv gv-background ",s.id="background",e=e||{},e.zoom=!0,o=y(),"undefined"!==Storage&&(this.graphSettings={},this.loadLocalStorage=function(){var a=b.graphName;if(null===localStorage.getItem("graphSettings")||"null"===localStorage.getItem("graphSettings")){var c={};c[a]={viewer:e,adapter:b},localStorage.setItem("graphSettings",JSON.stringify(c))}else try{var d=JSON.parse(localStorage.getItem("graphSettings"));this.graphSettings=d,void 0!==d[a].viewer&&(e=d[a].viewer),void 0!==d[a].adapter&&(b=d[a].adapter)}catch(f){console.log("Could not load graph settings, resetting graph settings."),this.graphSettings[a]={viewer:e,adapter:b},localStorage.setItem("graphSettings",JSON.stringify(this.graphSettings))}},this.loadLocalStorage(),this.writeLocalStorage=function(){}),g=new GraphViewer(o,p,q,b,e),A(),z(),D(),E(),t(),B(),$("#graphSize").on("change",function(){var a=$("#graphSize").find(":selected").val();g.loadGraphWithRandomStart(function(a){a&&a.errorCode&&window.alert("Sorry your graph seems to be empty")},a)}),f&&("string"==typeof f?g.loadGraph(f):g.loadGraphWithRandomStart(function(a){a&&a.errorCode&&window.alert("Sorry your graph seems to be empty")})),this.changeWidth=function(a){g.changeWidth(a);var b=a-55;o.attr("width",b).style("width",b+"px")}}function GraphViewerWidget(a,b){"use strict";var c,d,e,f,g,h,i,j,k=function(){return d3.select(d).append("svg").attr("id","graphViewerSVG").attr("width",e).attr("height",f).attr("class","graph-viewer").attr("style","width:"+e+"px;height:"+f+"px;")},l=function(a){var b=0;return _.each(a,function(c,d){c===!1?delete a[d]:b++}),b>0},m=function(a,b){_.each(b,function(b,c){a[c]=a[c]||{},_.each(b,function(b,d){a[c][d]=b})})},n=function(a){if(a){var b={};a.drag&&m(b,j.dragRebinds()),a.create&&(m(b,j.newNodeRebinds()),m(b,j.connectNodesRebinds())),a.remove&&m(b,j.deleteRebinds()),a.expand&&m(b,j.expandRebinds()),a.edit&&m(b,j.editRebinds()),j.rebindAll(b)}},o=function(a){var b=document.createElement("div");j=new EventDispatcherControls(b,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig),b.id="toolbox",b.className="btn-group btn-group-vertical pull-left toolbox",d.appendChild(b),_.each(a,function(a,b){switch(b){case"expand":j.addControlExpand();break;case"create":j.addControlNewNode(),j.addControlConnect();break;case"drag":j.addControlDrag();break;case"edit":j.addControlEdit();break;case"remove":j.addControlDelete()}})},p=function(a){var b=document.createElement("div");j=new EventDispatcherControls(b,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig)},q=function(){return new GraphViewer(c,e,f,i,a)};d=document.body,e=d.offsetWidth,f=d.offsetHeight,i={type:"foxx",route:"."},a=a||{},h=l(a.toolbox),h&&(e-=43),c=k(),g=q(),h?o(a.toolbox):p(),b&&g.loadGraph(b),n(a.actions)}function LayouterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The Layouter has to be given.";var c=this;this.addControlGravity=function(){var c="control_layout_gravity",d=c+"_";uiComponentsHelper.createButton(a,"Gravity",c,function(){modalDialogHelper.createModalDialog("Switch Gravity Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({gravity:a})})})},this.addControlCharge=function(){var c="control_layout_charge",d=c+"_";uiComponentsHelper.createButton(a,"Charge",c,function(){modalDialogHelper.createModalDialog("Switch Charge Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({charge:a})})})},this.addControlDistance=function(){var c="control_layout_distance",d=c+"_";uiComponentsHelper.createButton(a,"Distance",c,function(){modalDialogHelper.createModalDialog("Switch Distance Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({distance:a})})})},this.addAll=function(){c.addControlDistance(),c.addControlGravity(),c.addControlCharge()}}function NodeShaperControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The NodeShaper has to be given.";var c,d=this,e=function(a){for(;c.hasChildNodes();)c.removeChild(c.lastChild);var b=document.createElement("ul");c.appendChild(b),_.each(a,function(a,c){var d=document.createElement("ul"),e=a.list,f=a.front;d.style.backgroundColor=c,d.style.color=f,_.each(e,function(a){var b=document.createElement("li");b.appendChild(document.createTextNode(a)),d.appendChild(b)}),b.appendChild(d)})};this.addControlOpticShapeNone=function(){uiComponentsHelper.createButton(a,"None","control_node_none",function(){b.changeTo({shape:{type:NodeShaper.shapes.NONE}})})},this.applyLocalStorage=function(a){if("undefined"!==Storage)try{var b=JSON.parse(localStorage.getItem("graphSettings")),c=window.location.hash.split("/")[1];_.each(a,function(a,d){void 0!==d&&(b[c].viewer.nodeShaper[d]=a)}),localStorage.setItem("graphSettings",JSON.stringify(b))}catch(d){console.log(d)}},this.addControlOpticShapeCircle=function(){var c="control_node_circle",d=c+"_";uiComponentsHelper.createButton(a,"Circle",c,function(){modalDialogHelper.createModalDialog("Switch to Circle",d,[{type:"text",id:"radius"}],function(){var a=$("#"+d+"radius").attr("value");b.changeTo({shape:{type:NodeShaper.shapes.CIRCLE,radius:a}})})})},this.addControlOpticShapeRect=function(){var c="control_node_rect",d=c+"_";uiComponentsHelper.createButton(a,"Rectangle",c,function(){modalDialogHelper.createModalDialog("Switch to Rectangle","control_node_rect_",[{type:"text",id:"width"},{type:"text",id:"height"}],function(){var a=$("#"+d+"width").attr("value"),c=$("#"+d+"height").attr("value");b.changeTo({shape:{type:NodeShaper.shapes.RECT,width:a,height:c}})})})},this.addControlOpticLabel=function(){var c="control_node_label",e=c+"_";uiComponentsHelper.createButton(a,"Configure Label",c,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",e,[{type:"text",id:"key"}],function(){var a=$("#"+e+"key").attr("value"),c={label:a};d.applyLocalStorage(c),b.changeTo(c)})})},this.addControlOpticSingleColour=function(){var c="control_node_singlecolour",d=c+"_";uiComponentsHelper.createButton(a,"Single Colour",c,function(){modalDialogHelper.createModalDialog("Switch to Colour",d,[{type:"text",id:"fill"},{type:"text",id:"stroke"}],function(){var a=$("#"+d+"fill").attr("value"),c=$("#"+d+"stroke").attr("value");b.changeTo({color:{type:"single",fill:a,stroke:c}})})})},this.addControlOpticAttributeColour=function(){var c="control_node_attributecolour",d=c+"_";uiComponentsHelper.createButton(a,"Colour by Attribute",c,function(){modalDialogHelper.createModalDialog("Display colour by attribute",d,[{type:"text",id:"key"}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({color:{type:"attribute",key:a}})})})},this.addControlOpticExpandColour=function(){var c="control_node_expandcolour",d=c+"_";uiComponentsHelper.createButton(a,"Expansion Colour",c,function(){modalDialogHelper.createModalDialog("Display colours for expansion",d,[{type:"text",id:"expanded"},{type:"text",id:"collapsed"}],function(){var a=$("#"+d+"expanded").attr("value"),c=$("#"+d+"collapsed").attr("value");b.changeTo({color:{type:"expand",expanded:a,collapsed:c}})})})},this.addControlOpticLabelAndColour=function(e){var f="control_node_labelandcolour",g=f+"_";uiComponentsHelper.createButton(a,"Configure Label",f,function(){
-modalDialogHelper.createModalChangeDialog("Change label attribute",g,[{type:"text",id:"label-attribute",text:"Vertex label attribute",value:b.getLabel()||""},{type:"decission",id:"samecolour",group:"colour",text:"Use this attribute for coloring, too",isDefault:b.getLabel()===b.getColor()},{type:"decission",id:"othercolour",group:"colour",text:"Use different attribute for coloring",isDefault:b.getLabel()!==b.getColor(),interior:[{type:"text",id:"colour-attribute",text:"Color attribute",value:b.getColor()||""}]}],function(){var a=$("#"+g+"label-attribute").attr("value"),e=$("#"+g+"colour-attribute").attr("value"),f=$("input[type='radio'][name='colour']:checked").attr("id");f===g+"samecolour"&&(e=a);var h={label:a,color:{type:"attribute",key:e}};d.applyLocalStorage(h),b.changeTo(h),void 0===c&&(c=d.createColourMappingList())})})},this.addControlOpticLabelAndColourList=function(e){var f="control_node_labelandcolourlist",g=f+"_";uiComponentsHelper.createButton(a,"Configure Label",f,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",g,[{type:"extendable",id:"label",text:"Vertex label attribute",objects:b.getLabel()},{type:"decission",id:"samecolour",group:"colour",text:"Use this attribute for coloring, too",isDefault:b.getLabel()===b.getColor()},{type:"decission",id:"othercolour",group:"colour",text:"Use different attribute for coloring",isDefault:b.getLabel()!==b.getColor(),interior:[{type:"extendable",id:"colour",text:"Color attribute",objects:b.getColor()||""}]}],function(){var a=$("input[id^="+g+"label_]"),e=$("input[id^="+g+"colour_]"),f=$("input[type='radio'][name='colour']:checked").attr("id"),h=[],i=[];a.each(function(a,b){var c=$(b).val();""!==c&&h.push(c)}),e.each(function(a,b){var c=$(b).val();""!==c&&i.push(c)}),f===g+"samecolour"&&(i=h);var j={label:h,color:{type:"attribute",key:i}};d.applyLocalStorage(j),b.changeTo(j),void 0===c&&(c=d.createColourMappingList())})})},this.addAllOptics=function(){d.addControlOpticShapeNone(),d.addControlOpticShapeCircle(),d.addControlOpticShapeRect(),d.addControlOpticLabel(),d.addControlOpticSingleColour(),d.addControlOpticAttributeColour(),d.addControlOpticExpandColour()},this.addAllActions=function(){},this.addAll=function(){d.addAllOptics(),d.addAllActions()},this.createColourMappingList=function(){return void 0!==c?c:(c=document.createElement("div"),c.id="node_colour_list",e(b.getColourMapping()),b.setColourMappingListener(e),c)}}function GraphViewer(a,b,c,d,e){"use strict";if($("html").attr("xmlns:xlink","http://www.w3.org/1999/xlink"),void 0===a||void 0===a.append)throw"SVG has to be given and has to be selected using d3.select";if(void 0===b||0>=b)throw"A width greater 0 has to be given";if(void 0===c||0>=c)throw"A height greater 0 has to be given";if(void 0===d||void 0===d.type)throw"An adapter configuration has to be given";var f,g,h,i,j,k,l,m,n=this,o=[],p=[],q=function(a){if(!a)return a={},a.nodes=p,a.links=o,a.width=b,a.height=c,void(i=new ForceLayouter(a));switch(a.type.toLowerCase()){case"force":a.nodes=p,a.links=o,a.width=b,a.height=c,i=new ForceLayouter(a);break;default:throw"Sorry unknown layout type."}},r=function(a){f.setNodeLimit(a,n.start)},s=function(d){d&&(j=new ZoomManager(b,c,a,k,g,h,{},r))},t=function(a){var b=a.edgeShaper||{},c=a.nodeShaper||{},d=c.idfunc||void 0,e=a.zoom||!1;b.shape=b.shape||{type:EdgeShaper.shapes.ARROW},q(a.layouter),m=k.append("g"),h=new EdgeShaper(m,b),l=k.append("g"),g=new NodeShaper(l,c,d),i.setCombinedUpdateFunction(g,h),s(e)};switch(d.type.toLowerCase()){case"arango":d.width=b,d.height=c,f=new ArangoAdapter(p,o,this,d),f.setChildLimit(10);break;case"gharial":d.width=b,d.height=c,f=new GharialAdapter(p,o,this,d),f.setChildLimit(10);break;case"foxx":d.width=b,d.height=c,f=new FoxxAdapter(p,o,d.route,this,d);break;case"json":f=new JSONAdapter(d.path,p,o,this,b,c);break;case"preview":d.width=b,d.height=c,f=new PreviewAdapter(p,o,this,d);break;default:throw"Sorry unknown adapter type."}k=a.append("g"),t(e||{}),this.start=function(a){i.stop(),a&&(""!==$(".infoField").text()?_.each(p,function(a){_.each(f.randomNodes,function(b){a._id===b._id&&(a._expanded=!0)})}):_.each(p,function(a){a._expanded=!0})),g.drawNodes(p),h.drawEdges(o),i.start()},this.loadGraph=function(a,b){f.loadInitialNode(a,function(a){return a.errorCode?void b(a):(a._expanded=!0,n.start(),void(_.isFunction(b)&&b()))})},this.loadGraphWithRandomStart=function(a,b){f.loadRandomNode(function(b){return b.errorCode&&404===b.errorCode?void a(b):(b._expanded=!0,n.start(!0),void(_.isFunction(a)&&a()))},b)},this.loadGraphWithAdditionalNode=function(a,b,c){f.loadAdditionalNodeByAttributeValue(a,b,function(a){return a.errorCode?void c(a):(a._expanded=!0,n.start(),void(_.isFunction(c)&&c()))})},this.loadGraphWithAttributeValue=function(a,b,c){f.randomNodes=[],f.definedNodes=[],f.loadInitialNodeByAttributeValue(a,b,function(a){return a.errorCode?void c(a):(a._expanded=!0,n.start(),void(_.isFunction(c)&&c()))})},this.cleanUp=function(){g.resetColourMap(),h.resetColourMap()},this.changeWidth=function(a){i.changeWidth(a),j.changeWidth(a),f.setWidth(a)},this.dispatcherConfig={expand:{edges:o,nodes:p,startCallback:n.start,adapter:f,reshapeNodes:g.reshapeNodes},drag:{layouter:i},nodeEditor:{nodes:p,adapter:f},edgeEditor:{edges:o,adapter:f}},this.adapter=f,this.nodeShaper=g,this.edgeShaper=h,this.layouter=i,this.zoomManager=j}function Module(a){this.id=a,this.exports={},this.definition=null}function require(a){return global.module.require(a)}function print(){var a=require("internal");a.print.apply(a.print,arguments)}function ArangoConnection(){this._databaseName="_system";var a=global.document.location.pathname;if("/_db/"===a.substr(0,5)){for(var b=5,c=a.length;c>b&&"/"!==a[b];)b++;b>5&&(this._databaseName=a.substring(5,b))}}EdgeShaper.shapes=Object.freeze({NONE:0,ARROW:1}),NodeShaper.shapes=Object.freeze({NONE:0,CIRCLE:1,RECT:2,IMAGE:3});var modalDialogHelper=modalDialogHelper||{};!function(){"use strict";var a,b=function(a){$(document).bind("keypress.key13",function(b){b.which&&13===b.which&&$(a).click()})},c=function(){$(document).unbind("keypress.key13")},d=function(a,b,c,d,e){var f,g,h=function(){e(f)},i=modalDialogHelper.modalDivTemplate(a,b,c,h),j=document.createElement("tr"),k=document.createElement("th"),l=document.createElement("th"),m=document.createElement("th"),n=document.createElement("button"),o=1;f=function(){var a={};return _.each($("#"+c+"table tr:not(#first_row)"),function(b){var c=$(".keyCell input",b).val(),d=$(".valueCell input",b).val();a[c]=d}),a},i.appendChild(j),j.id="first_row",j.appendChild(k),k.className="keyCell",j.appendChild(l),l.className="valueCell",j.appendChild(m),m.className="actionCell",m.appendChild(n),n.id=c+"new",n.className="graphViewer-icon-button gv-icon-small add",g=function(a,b){var d,e,f,g=/^_(id|rev|key|from|to)/,h=document.createElement("tr"),j=document.createElement("th"),k=document.createElement("th"),l=document.createElement("th");g.test(b)||(i.appendChild(h),h.appendChild(k),k.className="keyCell",e=document.createElement("input"),e.type="text",e.id=c+b+"_key",e.value=b,k.appendChild(e),h.appendChild(l),l.className="valueCell",f=document.createElement("input"),f.type="text",f.id=c+b+"_value","object"==typeof a?f.value=JSON.stringify(a):f.value=a,l.appendChild(f),h.appendChild(j),j.className="actionCell",d=document.createElement("button"),d.id=c+b+"_delete",d.className="graphViewer-icon-button gv-icon-small delete",j.appendChild(d),d.onclick=function(){i.removeChild(h)})},n.onclick=function(){g("","new_"+o),o++},_.each(d,g),$("#"+c+"modal").modal("show")},e=function(a,b,c,d,e){var f=modalDialogHelper.modalDivTemplate(a,b,c,e),g=document.createElement("tr"),h=document.createElement("th"),i=document.createElement("pre");f.appendChild(g),g.appendChild(h),h.appendChild(i),i.className="gv-object-view",i.innerHTML=JSON.stringify(d,null,2),$("#"+c+"modal").modal("show")},f=function(a,b){var c=document.createElement("input");return c.type="text",c.id=a,c.value=b,c},g=function(a,b){var c=document.createElement("input");return c.type="checkbox",c.id=a,c.checked=b,c},h=function(a,b,c){var d=document.createElement("select");return d.id=a,_.each(_.sortBy(b,function(a){return a.toLowerCase()}),function(a){var b=document.createElement("option");b.value=a,b.selected=a===c,b.appendChild(document.createTextNode(a)),d.appendChild(b)}),d},i=function(a){var b=$(".decission_"+a),c=$("input[type='radio'][name='"+a+"']:checked").attr("id");b.each(function(){$(this).attr("decider")===c?$(this).css("display",""):$(this).css("display","none")})},j=function(b,c,d,e,f,g,h,j){var k=document.createElement("input"),l=b+c,m=document.createElement("label"),n=document.createElement("tbody");k.id=l,k.type="radio",k.name=d,k.className="gv-radio-button",m.className="radio",h.appendChild(m),m.appendChild(k),m.appendChild(document.createTextNode(e)),j.appendChild(n),$(n).toggleClass("decission_"+d,!0),$(n).attr("decider",l),_.each(g,function(c){a(n,b,c)}),f?k.checked=!0:k.checked=!1,m.onclick=function(a){i(d),a.stopPropagation()},i(d)},k=function(a,b,c,d,e,f){var g,h=[],i=a+b,j=1,k=document.createElement("th"),l=document.createElement("button"),m=document.createElement("input"),n=function(a){j++;var c,d=document.createElement("tr"),g=document.createElement("th"),k=document.createElement("th"),l=document.createElement("th"),m=document.createElement("input"),n=document.createElement("button");m.type="text",m.id=i+"_"+j,m.value=a||"",c=0===h.length?$(f):$(h[h.length-1]),c.after(d),d.appendChild(g),g.className="collectionTh capitalize",g.appendChild(document.createTextNode(b+" "+j+":")),d.appendChild(k),k.className="collectionTh",k.appendChild(m),n.id=i+"_"+j+"_remove",n.className="graphViewer-icon-button gv-icon-small delete",n.onclick=function(){e.removeChild(d),h.splice(h.indexOf(d),1)},l.appendChild(n),d.appendChild(l),h.push(d)};for(m.type="text",m.id=i+"_1",d.appendChild(m),k.appendChild(l),f.appendChild(k),l.onclick=function(){n()},l.id=i+"_addLine",l.className="graphViewer-icon-button gv-icon-small add","string"==typeof c&&c.length>0&&(c=[c]),c.length>0&&(m.value=c[0]),g=1;g'),$(".arangoFrame .outerDiv").click(function(){e.closeDocEditor()}),$(".arangoFrame .innerDiv").click(function(a){a.stopPropagation()}),$(".fa-times").click(function(){e.closeDocEditor()}),$(".arangoFrame").show(),f.customView=!0,f.customDeleteFunction=function(){window.modalView.hide(),$(".arangoFrame").hide()},$(".arangoFrame #deleteDocumentButton").click(function(){f.deleteDocumentModal()}),$(".arangoFrame #saveDocumentButton").click(function(){f.saveDocument()}),$(".arangoFrame #deleteDocumentButton").css("display","none")},closeDocEditor:function(){$(".arangoFrame .outerDiv .fa-times").remove(),$(".arangoFrame").hide()},getRandomToken:function(){return Math.round((new Date).getTime())},isSystemAttribute:function(a){var b=this.systemAttributes();return b[a]},isSystemCollection:function(a){return"_"===a.name.substr(0,1)},setDocumentStore:function(a){this.arangoDocumentStore=a},collectionApiType:function(a,b){return(b||void 0===this.CollectionTypes[a])&&(this.CollectionTypes[a]=this.arangoDocumentStore.getCollectionInfo(a).type),3===this.CollectionTypes[a]?"edge":"document"},collectionType:function(a){if(!a||""===a.name)return"-";var b;return b=2===a.type?"document":3===a.type?"edge":"unknown",this.isSystemCollection(a)&&(b+=" (system)"),b},formatDT:function(a){var b=function(a){return 10>a?"0"+a:a};return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+" "+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())},escapeHtml:function(a){return String(a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}}}(),function(){"use strict";if(!window.hasOwnProperty("TEST_BUILD")){var a=function(){var a={};return a.createTemplate=function(a){var b=$("#"+a.replace(".","\\.")).html();return{render:function(a){return _.template(b,a)}}},a};window.templateEngine=new a}}(),Module.prototype.moduleCache={},Module.prototype.moduleCache["/internal"]=new Module("/internal"),"undefined"==typeof global&&"undefined"!=typeof window&&(global=window),global.module=Module.prototype.moduleCache["/"]=new Module("/"),Module.prototype.normalise=function(a){var b,c,d,e,f;if(""===a)return this.id;for(d=a.split("/"),"."===d[0]||".."===d[0]?(e=this.id.split("/"),e.pop(),e=e.concat(d)):e=d,c=[],b=0;b "+require("internal").browserOutputBuffer,"jssuccess"),require("internal").browserOutputBuffer=""},$(global.document).ajaxSend(function(a,b,c){c.url=require("internal").arango.databasePrefix(c.url)}),global.DEFINE_MODULE=function(a,b){var c=Module.prototype.normalise(a),d=Module.prototype.moduleCache[c];d?Object.keys(d.exports).forEach(function(a){b[a]=d.exports[a]}):(d=new Module(c),Module.prototype.moduleCache[c]=d),d.exports=b}}(),module.define("underscore",function(a,b){(function(){function c(a){function b(b,c,d,e,f,g){for(;f>=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof a?("undefined"!=typeof b&&b.exports&&(a=b.exports=u),a._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=c(1),u.reduceRight=u.foldr=c(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-(1/0),g=-(1/0);if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-(1/0)&&f===-(1/0))&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||e===1/0&&f===1/0)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null!=a?null==b||c?a[0]:u.initial(a,a.length-b):void 0},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null!=a?null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b)):void 0},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])1&&modalDialogHelper.createModalDialog("Select Vertex Collection",b,[{type:"list",id:"vertex",objects:i.getNodeCollections(),text:"Select collection",selected:i.getSelectedNodeCollection()}],function(){var a=$("#"+b+"vertex").children("option").filter(":selected").text();i.useNodeCollection(a)},"Select"),f.rebindAll(f.newNodeRebinds())};l(a,"new_node",c)},this.addControlView=function(){var a=g.view,b=function(){f.rebindAll(f.viewRebinds())};l(a,"view",b)},this.addControlDrag=function(){var a=g.drag,b=function(){f.rebindAll(f.dragRebinds())};l(a,"drag",b)},this.addControlEdit=function(){var a=g.edit,b=function(){f.rebindAll(f.editRebinds())};l(a,"edit",b)},this.addControlExpand=function(){var a=g.expand,b=function(){f.rebindAll(f.expandRebinds())};l(a,"expand",b)},this.addControlDelete=function(){var a=g.trash,b=function(){f.rebindAll(f.deleteRebinds())};l(a,"delete",b)},this.addControlConnect=function(){var a=g.edge,b="select_edge_collection",c=function(){j&&i.getEdgeCollections().length>1&&modalDialogHelper.createModalDialog("Select Edge Collection",b,[{type:"list",id:"edge",objects:i.getEdgeCollections(),text:"Select collection",selected:i.getSelectedEdgeCollection()}],function(){var a=$("#"+b+"edge").children("option").filter(":selected").text();i.useEdgeCollection(a)},"Select"),f.rebindAll(f.connectNodesRebinds())};l(a,"connect",c)},this.addAll=function(){f.addControlExpand(),f.addControlDrag(),f.addControlEdit(),f.addControlConnect(),f.addControlNewNode(),f.addControlDelete()}}function GharialAdapterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The GharialAdapter has to be given.";this.addControlChangeGraph=function(c){var d="control_adapter_graph",e=d+"_";b.getGraphs(function(f){uiComponentsHelper.createButton(a,"Switch Graph",d,function(){modalDialogHelper.createModalDialog("Switch Graph",e,[{type:"list",id:"graph",objects:f,text:"Select graph",selected:b.getGraphName()},{type:"checkbox",text:"Start with random vertex",id:"random",selected:!0}],function(){var a=$("#"+e+"graph").children("option").filter(":selected").text(),d=!!$("#"+e+"undirected").prop("checked"),f=!!$("#"+e+"random").prop("checked");return b.changeToGraph(a,d),f?void b.loadRandomNode(c):void(_.isFunction(c)&&c())})})})},this.addControlChangePriority=function(){var c="control_adapter_priority",d=c+"_",e="Group vertices";uiComponentsHelper.createButton(a,e,c,function(){modalDialogHelper.createModalChangeDialog(e+" by attribute",d,[{type:"extendable",id:"attribute",objects:b.getPrioList()}],function(){var a=$("input[id^="+d+"attribute_]"),c=[];_.each(a,function(a){var b=$(a).val();""!==b&&c.push(b)}),b.changeTo({prioList:c})})})},this.addAll=function(){this.addControlChangeGraph(),this.addControlChangePriority()}}function GraphViewerPreview(a,b){"use strict";var c,d,e,f,g,h,i,j=function(){return d3.select(a).append("svg").attr("id","graphViewerSVG").attr("width",d).attr("height",e).attr("class","graph-viewer").attr("style","width:"+d+"px;height:"+e+";")},k=function(a){var b=0;return _.each(a,function(c,d){c===!1?delete a[d]:b++}),b>0},l=function(a,b){_.each(b,function(b,c){a[c]=a[c]||{},_.each(b,function(b,d){a[c][d]=b})})},m=function(a){if(a){var b={};a.drag&&l(b,i.dragRebinds()),a.create&&(l(b,i.newNodeRebinds()),l(b,i.connectNodesRebinds())),a.remove&&l(b,i.deleteRebinds()),a.expand&&l(b,i.expandRebinds()),a.edit&&l(b,i.editRebinds()),i.rebindAll(b)}},n=function(b){var c=document.createElement("div");i=new EventDispatcherControls(c,f.nodeShaper,f.edgeShaper,f.start,f.dispatcherConfig),c.id="toolbox",c.className="btn-group btn-group-vertical pull-left toolbox",a.appendChild(c),_.each(b,function(a,b){switch(b){case"expand":i.addControlExpand();break;case"create":i.addControlNewNode(),i.addControlConnect();break;case"drag":i.addControlDrag();break;case"edit":i.addControlEdit();break;case"remove":i.addControlDelete()}})},o=function(a){var b=document.createElement("div");i=new EventDispatcherControls(b,f.nodeShaper,f.edgeShaper,f.start,f.dispatcherConfig)},p=function(){b&&(b.nodeShaper&&(b.nodeShaper.label&&(b.nodeShaper.label="label"),b.nodeShaper.shape&&b.nodeShaper.shape.type===NodeShaper.shapes.IMAGE&&b.nodeShaper.shape.source&&(b.nodeShaper.shape.source="image")),b.edgeShaper&&b.edgeShaper.label&&(b.edgeShaper.label="label"))},q=function(){return p(),new GraphViewer(c,d,e,h,b)};d=a.offsetWidth,e=a.offsetHeight,h={type:"preview"},b=b||{},g=k(b.toolbox),g&&(d-=43),c=j(),f=q(),g?n(b.toolbox):o(),f.loadGraph("1"),m(b.actions)}function GraphViewerUI(a,b,c,d,e,f){"use strict";if(void 0===a)throw"A parent element has to be given.";if(!a.id)throw"The parent element needs an unique id.";if(void 0===b)throw"An adapter configuration has to be given";var g,h,i,j,k,l,m,n,o,p=c+20||a.offsetWidth-81+20,q=d||a.offsetHeight,r=document.createElement("ul"),s=document.createElement("div"),t=function(){g.adapter.NODES_TO_DISPLAYGraph too big. A random section is rendered.'),$(".infoField .fa-info-circle").attr("title","You can display additional/other vertices by using the toolbar buttons.").tooltip())},u=function(){var a,b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),i=document.createElement("input"),j=document.createElement("i"),k=document.createElement("span"),l=function(){$(s).css("cursor","progress")},n=function(){$(s).css("cursor","")},o=function(a){return n(),a&&a.errorCode&&404===a.errorCode?void arangoHelper.arangoError("Graph error","could not find a matching node."):void 0},p=function(){l(),""===a.value||void 0===a.value?g.loadGraph(i.value,o):g.loadGraphWithAttributeValue(a.value,i.value,o)};b.id="filterDropdown",b.className="headerDropdown smallDropdown",c.className="dropdownInner",d.className="queryline",a=document.createElement("input"),m=document.createElement("ul"),e.className="pull-left input-append searchByAttribute",a.id="attribute",a.type="text",a.placeholder="Attribute name",f.id="attribute_example_toggle",f.className="button-neutral gv_example_toggle",h.className="caret gv_caret",m.className="gv-dropdown-menu",i.id="value",i.className="searchInput gv_searchInput",i.type="text",i.placeholder="Attribute value",j.id="loadnode",j.className="fa fa-search",k.className="searchEqualsLabel",k.appendChild(document.createTextNode("==")),c.appendChild(d),d.appendChild(e),e.appendChild(a),e.appendChild(f),e.appendChild(m),f.appendChild(h),d.appendChild(k),d.appendChild(i),d.appendChild(j),j.onclick=p,$(i).keypress(function(a){return 13===a.keyCode||13===a.which?(p(),!1):void 0}),f.onclick=function(){$(m).slideToggle(200)};var q=document.createElement("p");return q.className="dropdown-title",q.innerHTML="Filter graph by attribute:",b.appendChild(q),b.appendChild(c),b},v=function(){var a,b=document.createElement("div"),c=document.createElement("div"),d=document.createElement("div"),e=document.createElement("div"),f=document.createElement("button"),h=document.createElement("span"),i=document.createElement("input"),j=document.createElement("i"),k=document.createElement("span"),l=function(){$(s).css("cursor","progress")},m=function(){$(s).css("cursor","")},o=function(a){return m(),a&&a.errorCode&&404===a.errorCode?void arangoHelper.arangoError("Graph error","could not find a matching node."):void 0},p=function(){l(),""!==a.value&&g.loadGraphWithAdditionalNode(a.value,i.value,o)};b.id="nodeDropdown",b.className="headerDropdown smallDropdown",c.className="dropdownInner",d.className="queryline",a=document.createElement("input"),n=document.createElement("ul"),e.className="pull-left input-append searchByAttribute",a.id="attribute",a.type="text",a.placeholder="Attribute name",f.id="attribute_example_toggle2",f.className="button-neutral gv_example_toggle",h.className="caret gv_caret",n.className="gv-dropdown-menu",i.id="value",i.className="searchInput gv_searchInput",i.type="text",i.placeholder="Attribute value",j.id="loadnode",j.className="fa fa-search",k.className="searchEqualsLabel",k.appendChild(document.createTextNode("==")),c.appendChild(d),d.appendChild(e),e.appendChild(a),e.appendChild(f),e.appendChild(n),f.appendChild(h),d.appendChild(k),d.appendChild(i),d.appendChild(j),C(n),j.onclick=p,$(i).keypress(function(a){return 13===a.keyCode||13===a.which?(p(),!1):void 0}),f.onclick=function(){$(n).slideToggle(200)};var q=document.createElement("p");return q.className="dropdown-title",q.innerHTML="Add specific node by attribute:",b.appendChild(q),b.appendChild(c),b},w=function(){var a,b,c,d,e,f,g,h;return a=document.createElement("div"),a.id="configureDropdown",a.className="headerDropdown",b=document.createElement("div"),b.className="dropdownInner",c=document.createElement("ul"),d=document.createElement("li"),d.className="nav-header",d.appendChild(document.createTextNode("Vertices")),g=document.createElement("ul"),h=document.createElement("li"),h.className="nav-header",h.appendChild(document.createTextNode("Edges")),e=document.createElement("ul"),f=document.createElement("li"),f.className="nav-header",f.appendChild(document.createTextNode("Connection")),c.appendChild(d),g.appendChild(h),e.appendChild(f),b.appendChild(c),b.appendChild(g),b.appendChild(e),a.appendChild(b),{configure:a,nodes:c,edges:g,col:e}},x=function(a,b,c,d){var e,f,g,h,i,j,k,l,m,n,o;return a.className="headerButtonBar",e=document.createElement("ul"),e.className="headerButtonList",a.appendChild(e),g=document.createElement("li"),g.className="enabled",h=document.createElement("a"),h.id=b,h.className="headerButton",i=document.createElement("span"),i.className="icon_arangodb_settings2",$(i).attr("title","Configure"),e.appendChild(g),g.appendChild(h),h.appendChild(i),j=document.createElement("li"),j.className="enabled",k=document.createElement("a"),k.id=d,k.className="headerButton",l=document.createElement("span"),l.className="fa fa-search-plus",$(l).attr("title","Show additional vertices"),e.appendChild(j),j.appendChild(k),k.appendChild(l),m=document.createElement("li"),m.className="enabled",n=document.createElement("a"),n.id=c,n.className="headerButton",o=document.createElement("span"),o.className="icon_arangodb_filter",$(o).attr("title","Filter"),e.appendChild(m),m.appendChild(n),n.appendChild(o),f=w(),f.filter=u(),f.node=v(),h.onclick=function(){$("#filterdropdown").removeClass("activated"),$("#nodedropdown").removeClass("activated"),$("#configuredropdown").toggleClass("activated"),$(f.configure).slideToggle(200),$(f.filter).hide(),$(f.node).hide()},k.onclick=function(){$("#filterdropdown").removeClass("activated"),$("#configuredropdown").removeClass("activated"),$("#nodedropdown").toggleClass("activated"),$(f.node).slideToggle(200),$(f.filter).hide(),$(f.configure).hide()},n.onclick=function(){$("#configuredropdown").removeClass("activated"),$("#nodedropdown").removeClass("activated"),$("#filterdropdown").toggleClass("activated"),$(f.filter).slideToggle(200),$(f.node).hide(),$(f.configure).hide()},f},y=function(){return d3.select("#"+a.id+" #background").append("svg").attr("id","graphViewerSVG").attr("width",p).attr("height",q).attr("class","graph-viewer").style("width",p+"px").style("height",q+"px")},z=function(){var a=document.createElement("div"),b=document.createElement("div"),c=document.createElement("button"),d=document.createElement("button"),e=document.createElement("button"),f=document.createElement("button");a.className="gv_zoom_widget",b.className="gv_zoom_buttons_bg",c.className="btn btn-icon btn-zoom btn-zoom-top gv-zoom-btn pan-top",d.className="btn btn-icon btn-zoom btn-zoom-left gv-zoom-btn pan-left",e.className="btn btn-icon btn-zoom btn-zoom-right gv-zoom-btn pan-right",f.className="btn btn-icon btn-zoom btn-zoom-bottom gv-zoom-btn pan-bottom",c.onclick=function(){g.zoomManager.triggerTranslation(0,-10)},d.onclick=function(){g.zoomManager.triggerTranslation(-10,0)},e.onclick=function(){g.zoomManager.triggerTranslation(10,0)},f.onclick=function(){g.zoomManager.triggerTranslation(0,10)},b.appendChild(c),b.appendChild(d),b.appendChild(e),b.appendChild(f),l=document.createElement("div"),l.id="gv_zoom_slider",l.className="gv_zoom_slider",s.appendChild(a),s.insertBefore(a,o[0][0]),a.appendChild(b),a.appendChild(l),$("#gv_zoom_slider").slider({orientation:"vertical",min:g.zoomManager.getMinimalZoomFactor(),max:1,value:1,step:.01,slide:function(a,b){g.zoomManager.triggerScale(b.value)}}),g.zoomManager.registerSlider($("#gv_zoom_slider"))},A=function(){var a=document.createElement("div"),b=new EventDispatcherControls(a,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig);a.id="toolbox",a.className="btn-group btn-group-vertical toolbox",s.insertBefore(a,o[0][0]),b.addAll(),$("#control_event_expand").click()},B=function(){var a='';$(".headerBar .headerButtonList").prepend(a)},C=function(a){var b;b=a?$(a):$(m),b.innerHTML="";var c=document.createElement("li"),d=document.createElement("img");$(c).append(d),d.className="gv-throbber",b.append(c),g.adapter.getAttributeExamples(function(a){$(b).html(""),_.each(a,function(a){var c=document.createElement("li"),d=document.createElement("a"),e=document.createElement("label");$(c).append(d),$(d).append(e),$(e).append(document.createTextNode(a)),e.className="gv_dropdown_label",b.append(c),c.onclick=function(){b.value=a,$(b).parent().find("input").val(a),$(b).slideToggle(200)}})})},D=function(){var a=document.createElement("div"),b=document.createElement("div"),c=document.createElement("a"),d=x(b,"configuredropdown","filterdropdown","nodedropdown");i=new NodeShaperControls(d.nodes,g.nodeShaper),j=new EdgeShaperControls(d.edges,g.edgeShaper),k=new GharialAdapterControls(d.col,g.adapter),r.id="menubar",a.className="headerBar",b.id="modifiers",c.appendChild(document.createTextNode("Graph Viewer")),c.className="arangoHeader",r.appendChild(a),r.appendChild(d.configure),r.appendChild(d.filter),r.appendChild(d.node),a.appendChild(b),a.appendChild(c),k.addControlChangeGraph(function(){C(),g.start(!0)}),k.addControlChangePriority(),i.addControlOpticLabelAndColourList(g.adapter),j.addControlOpticLabelList(),C()},E=function(){h=i.createColourMappingList(),h.className="gv-colour-list",s.insertBefore(h,o[0][0])};a.appendChild(r),a.appendChild(s),s.className="contentDiv gv-background ",s.id="background",e=e||{},e.zoom=!0,o=y(),"undefined"!==Storage&&(this.graphSettings={},this.loadLocalStorage=function(){var a=b.graphName;if(null===localStorage.getItem("graphSettings")||"null"===localStorage.getItem("graphSettings")){var c={};c[a]={viewer:e,adapter:b},localStorage.setItem("graphSettings",JSON.stringify(c))}else try{var d=JSON.parse(localStorage.getItem("graphSettings"));this.graphSettings=d,void 0!==d[a].viewer&&(e=d[a].viewer),void 0!==d[a].adapter&&(b=d[a].adapter)}catch(f){console.log("Could not load graph settings, resetting graph settings."),this.graphSettings[a]={viewer:e,adapter:b},localStorage.setItem("graphSettings",JSON.stringify(this.graphSettings))}},this.loadLocalStorage(),this.writeLocalStorage=function(){}),g=new GraphViewer(o,p,q,b,e),A(),z(),D(),E(),t(),B(),$("#graphSize").on("change",function(){var a=$("#graphSize").find(":selected").val();g.loadGraphWithRandomStart(function(a){a&&a.errorCode&&window.alert("Sorry your graph seems to be empty")},a)}),f&&("string"==typeof f?g.loadGraph(f):g.loadGraphWithRandomStart(function(a){a&&a.errorCode&&window.alert("Sorry your graph seems to be empty")})),this.changeWidth=function(a){g.changeWidth(a);var b=a-55;o.attr("width",b).style("width",b+"px")}}function GraphViewerWidget(a,b){"use strict";var c,d,e,f,g,h,i,j,k=function(){return d3.select(d).append("svg").attr("id","graphViewerSVG").attr("width",e).attr("height",f).attr("class","graph-viewer").attr("style","width:"+e+"px;height:"+f+"px;")},l=function(a){var b=0;return _.each(a,function(c,d){c===!1?delete a[d]:b++}),b>0},m=function(a,b){_.each(b,function(b,c){a[c]=a[c]||{},_.each(b,function(b,d){a[c][d]=b})})},n=function(a){if(a){var b={};a.drag&&m(b,j.dragRebinds()),a.create&&(m(b,j.newNodeRebinds()),m(b,j.connectNodesRebinds())),a.remove&&m(b,j.deleteRebinds()),a.expand&&m(b,j.expandRebinds()),a.edit&&m(b,j.editRebinds()),j.rebindAll(b)}},o=function(a){var b=document.createElement("div");j=new EventDispatcherControls(b,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig),b.id="toolbox",b.className="btn-group btn-group-vertical pull-left toolbox",d.appendChild(b),_.each(a,function(a,b){switch(b){case"expand":j.addControlExpand();break;case"create":j.addControlNewNode(),j.addControlConnect();break;case"drag":j.addControlDrag();break;case"edit":j.addControlEdit();break;case"remove":j.addControlDelete()}})},p=function(a){var b=document.createElement("div");j=new EventDispatcherControls(b,g.nodeShaper,g.edgeShaper,g.start,g.dispatcherConfig)},q=function(){return new GraphViewer(c,e,f,i,a)};d=document.body,e=d.offsetWidth,f=d.offsetHeight,i={type:"foxx",route:"."},a=a||{},h=l(a.toolbox),h&&(e-=43),c=k(),g=q(),h?o(a.toolbox):p(),b&&g.loadGraph(b),n(a.actions)}function LayouterControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The Layouter has to be given.";var c=this;this.addControlGravity=function(){var c="control_layout_gravity",d=c+"_";uiComponentsHelper.createButton(a,"Gravity",c,function(){modalDialogHelper.createModalDialog("Switch Gravity Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({gravity:a})})})},this.addControlCharge=function(){var c="control_layout_charge",d=c+"_";uiComponentsHelper.createButton(a,"Charge",c,function(){modalDialogHelper.createModalDialog("Switch Charge Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({charge:a})})})},this.addControlDistance=function(){var c="control_layout_distance",d=c+"_";uiComponentsHelper.createButton(a,"Distance",c,function(){modalDialogHelper.createModalDialog("Switch Distance Strength",d,[{type:"text",id:"value"}],function(){var a=$("#"+d+"value").attr("value");b.changeTo({distance:a})})})},this.addAll=function(){c.addControlDistance(),c.addControlGravity(),c.addControlCharge()}}function NodeShaperControls(a,b){"use strict";if(void 0===a)throw"A list element has to be given.";if(void 0===b)throw"The NodeShaper has to be given.";var c,d=this,e=function(a){for(;c.hasChildNodes();)c.removeChild(c.lastChild);var b=document.createElement("ul");c.appendChild(b),_.each(a,function(a,c){var d=document.createElement("ul"),e=a.list,f=a.front;d.style.backgroundColor=c,d.style.color=f,_.each(e,function(a){var b=document.createElement("li");b.appendChild(document.createTextNode(a)),d.appendChild(b)}),b.appendChild(d)})};this.addControlOpticShapeNone=function(){uiComponentsHelper.createButton(a,"None","control_node_none",function(){b.changeTo({shape:{type:NodeShaper.shapes.NONE}})})},this.applyLocalStorage=function(a){if("undefined"!==Storage)try{var b=JSON.parse(localStorage.getItem("graphSettings")),c=window.location.hash.split("/")[1];_.each(a,function(a,d){void 0!==d&&(b[c].viewer.nodeShaper[d]=a)}),localStorage.setItem("graphSettings",JSON.stringify(b))}catch(d){console.log(d)}},this.addControlOpticShapeCircle=function(){var c="control_node_circle",d=c+"_";uiComponentsHelper.createButton(a,"Circle",c,function(){modalDialogHelper.createModalDialog("Switch to Circle",d,[{type:"text",id:"radius"}],function(){var a=$("#"+d+"radius").attr("value");b.changeTo({shape:{type:NodeShaper.shapes.CIRCLE,radius:a}})})})},this.addControlOpticShapeRect=function(){var c="control_node_rect",d=c+"_";uiComponentsHelper.createButton(a,"Rectangle",c,function(){modalDialogHelper.createModalDialog("Switch to Rectangle","control_node_rect_",[{type:"text",id:"width"},{type:"text",id:"height"}],function(){var a=$("#"+d+"width").attr("value"),c=$("#"+d+"height").attr("value");b.changeTo({shape:{type:NodeShaper.shapes.RECT,width:a,height:c}})})})},this.addControlOpticLabel=function(){var c="control_node_label",e=c+"_";uiComponentsHelper.createButton(a,"Configure Label",c,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",e,[{type:"text",id:"key"}],function(){var a=$("#"+e+"key").attr("value"),c={label:a};d.applyLocalStorage(c),b.changeTo(c)})})},this.addControlOpticSingleColour=function(){var c="control_node_singlecolour",d=c+"_";uiComponentsHelper.createButton(a,"Single Colour",c,function(){modalDialogHelper.createModalDialog("Switch to Colour",d,[{type:"text",id:"fill"},{type:"text",id:"stroke"}],function(){var a=$("#"+d+"fill").attr("value"),c=$("#"+d+"stroke").attr("value");b.changeTo({color:{type:"single",fill:a,stroke:c}})})})},this.addControlOpticAttributeColour=function(){var c="control_node_attributecolour",d=c+"_";uiComponentsHelper.createButton(a,"Colour by Attribute",c,function(){modalDialogHelper.createModalDialog("Display colour by attribute",d,[{type:"text",id:"key"}],function(){var a=$("#"+d+"key").attr("value");b.changeTo({color:{type:"attribute",key:a}})})})},this.addControlOpticExpandColour=function(){var c="control_node_expandcolour",d=c+"_";uiComponentsHelper.createButton(a,"Expansion Colour",c,function(){modalDialogHelper.createModalDialog("Display colours for expansion",d,[{type:"text",id:"expanded"},{type:"text",id:"collapsed"}],function(){var a=$("#"+d+"expanded").attr("value"),c=$("#"+d+"collapsed").attr("value");b.changeTo({color:{type:"expand",expanded:a,collapsed:c}})})})},this.addControlOpticLabelAndColour=function(e){var f="control_node_labelandcolour",g=f+"_";uiComponentsHelper.createButton(a,"Configure Label",f,function(){
+modalDialogHelper.createModalChangeDialog("Change label attribute",g,[{type:"text",id:"label-attribute",text:"Vertex label attribute",value:b.getLabel()||""},{type:"decission",id:"samecolour",group:"colour",text:"Use this attribute for coloring, too",isDefault:b.getLabel()===b.getColor()},{type:"decission",id:"othercolour",group:"colour",text:"Use different attribute for coloring",isDefault:b.getLabel()!==b.getColor(),interior:[{type:"text",id:"colour-attribute",text:"Color attribute",value:b.getColor()||""}]}],function(){var a=$("#"+g+"label-attribute").attr("value"),e=$("#"+g+"colour-attribute").attr("value"),f=$("input[type='radio'][name='colour']:checked").attr("id");f===g+"samecolour"&&(e=a);var h={label:a,color:{type:"attribute",key:e}};d.applyLocalStorage(h),b.changeTo(h),void 0===c&&(c=d.createColourMappingList())})})},this.addControlOpticLabelAndColourList=function(e){var f="control_node_labelandcolourlist",g=f+"_";uiComponentsHelper.createButton(a,"Configure Label",f,function(){modalDialogHelper.createModalChangeDialog("Change label attribute",g,[{type:"extendable",id:"label",text:"Vertex label attribute",objects:b.getLabel()},{type:"decission",id:"samecolour",group:"colour",text:"Use this attribute for coloring, too",isDefault:b.getLabel()===b.getColor()},{type:"decission",id:"othercolour",group:"colour",text:"Use different attribute for coloring",isDefault:b.getLabel()!==b.getColor(),interior:[{type:"extendable",id:"colour",text:"Color attribute",objects:b.getColor()||""}]}],function(){var a=$("input[id^="+g+"label_]"),e=$("input[id^="+g+"colour_]"),f=$("input[type='radio'][name='colour']:checked").attr("id"),h=[],i=[];a.each(function(a,b){var c=$(b).val();""!==c&&h.push(c)}),e.each(function(a,b){var c=$(b).val();""!==c&&i.push(c)}),f===g+"samecolour"&&(i=h);var j={label:h,color:{type:"attribute",key:i}};d.applyLocalStorage(j),b.changeTo(j),void 0===c&&(c=d.createColourMappingList())})})},this.addAllOptics=function(){d.addControlOpticShapeNone(),d.addControlOpticShapeCircle(),d.addControlOpticShapeRect(),d.addControlOpticLabel(),d.addControlOpticSingleColour(),d.addControlOpticAttributeColour(),d.addControlOpticExpandColour()},this.addAllActions=function(){},this.addAll=function(){d.addAllOptics(),d.addAllActions()},this.createColourMappingList=function(){return void 0!==c?c:(c=document.createElement("div"),c.id="node_colour_list",e(b.getColourMapping()),b.setColourMappingListener(e),c)}}function GraphViewer(a,b,c,d,e){"use strict";if($("html").attr("xmlns:xlink","http://www.w3.org/1999/xlink"),void 0===a||void 0===a.append)throw"SVG has to be given and has to be selected using d3.select";if(void 0===b||0>=b)throw"A width greater 0 has to be given";if(void 0===c||0>=c)throw"A height greater 0 has to be given";if(void 0===d||void 0===d.type)throw"An adapter configuration has to be given";var f,g,h,i,j,k,l,m,n=this,o=[],p=[],q=function(a){if(!a)return a={},a.nodes=p,a.links=o,a.width=b,a.height=c,void(i=new ForceLayouter(a));switch(a.type.toLowerCase()){case"force":a.nodes=p,a.links=o,a.width=b,a.height=c,i=new ForceLayouter(a);break;default:throw"Sorry unknown layout type."}},r=function(a){f.setNodeLimit(a,n.start)},s=function(d){d&&(j=new ZoomManager(b,c,a,k,g,h,{},r))},t=function(a){var b=a.edgeShaper||{},c=a.nodeShaper||{},d=c.idfunc||void 0,e=a.zoom||!1;b.shape=b.shape||{type:EdgeShaper.shapes.ARROW},q(a.layouter),m=k.append("g"),h=new EdgeShaper(m,b),l=k.append("g"),g=new NodeShaper(l,c,d),i.setCombinedUpdateFunction(g,h),s(e)};switch(d.type.toLowerCase()){case"arango":d.width=b,d.height=c,f=new ArangoAdapter(p,o,this,d),f.setChildLimit(10);break;case"gharial":d.width=b,d.height=c,f=new GharialAdapter(p,o,this,d),f.setChildLimit(10);break;case"foxx":d.width=b,d.height=c,f=new FoxxAdapter(p,o,d.route,this,d);break;case"json":f=new JSONAdapter(d.path,p,o,this,b,c);break;case"preview":d.width=b,d.height=c,f=new PreviewAdapter(p,o,this,d);break;default:throw"Sorry unknown adapter type."}k=a.append("g"),t(e||{}),this.start=function(a){i.stop(),a&&(""!==$(".infoField").text()?_.each(p,function(a){_.each(f.randomNodes,function(b){a._id===b._id&&(a._expanded=!0)})}):_.each(p,function(a){a._expanded=!0})),g.drawNodes(p),h.drawEdges(o),i.start()},this.loadGraph=function(a,b){f.loadInitialNode(a,function(a){return a.errorCode?void b(a):(a._expanded=!0,n.start(),void(_.isFunction(b)&&b()))})},this.loadGraphWithRandomStart=function(a,b){f.loadRandomNode(function(b){return b.errorCode&&404===b.errorCode?void a(b):(b._expanded=!0,n.start(!0),void(_.isFunction(a)&&a()))},b)},this.loadGraphWithAdditionalNode=function(a,b,c){f.loadAdditionalNodeByAttributeValue(a,b,function(a){return a.errorCode?void c(a):(a._expanded=!0,n.start(),void(_.isFunction(c)&&c()))})},this.loadGraphWithAttributeValue=function(a,b,c){f.randomNodes=[],f.definedNodes=[],f.loadInitialNodeByAttributeValue(a,b,function(a){return a.errorCode?void c(a):(a._expanded=!0,n.start(),void(_.isFunction(c)&&c()))})},this.cleanUp=function(){g.resetColourMap(),h.resetColourMap()},this.changeWidth=function(a){i.changeWidth(a),j.changeWidth(a),f.setWidth(a)},this.dispatcherConfig={expand:{edges:o,nodes:p,startCallback:n.start,adapter:f,reshapeNodes:g.reshapeNodes},drag:{layouter:i},nodeEditor:{nodes:p,adapter:f},edgeEditor:{edges:o,adapter:f}},this.adapter=f,this.nodeShaper=g,this.edgeShaper=h,this.layouter=i,this.zoomManager=j}function Module(a){this.id=a,this.exports={},this.definition=null}function require(a){return global.module.require(a)}function print(){var a=require("internal");a.print.apply(a.print,arguments)}function ArangoConnection(){this._databaseName="_system";var a=global.document.location.pathname;if("/_db/"===a.substr(0,5)){for(var b=5,c=a.length;c>b&&"/"!==a[b];)b++;b>5&&(this._databaseName=a.substring(5,b))}}EdgeShaper.shapes=Object.freeze({NONE:0,ARROW:1}),NodeShaper.shapes=Object.freeze({NONE:0,CIRCLE:1,RECT:2,IMAGE:3});var modalDialogHelper=modalDialogHelper||{};!function(){"use strict";var a,b=function(a){$(document).bind("keypress.key13",function(b){b.which&&13===b.which&&$(a).click()})},c=function(){$(document).unbind("keypress.key13")},d=function(a,b,c,d,e){var f,g,h=function(){e(f)},i=modalDialogHelper.modalDivTemplate(a,b,c,h),j=document.createElement("tr"),k=document.createElement("th"),l=document.createElement("th"),m=document.createElement("th"),n=document.createElement("button"),o=1;f=function(){var a={};return _.each($("#"+c+"table tr:not(#first_row)"),function(b){var c=$(".keyCell input",b).val(),d=$(".valueCell input",b).val();a[c]=d}),a},i.appendChild(j),j.id="first_row",j.appendChild(k),k.className="keyCell",j.appendChild(l),l.className="valueCell",j.appendChild(m),m.className="actionCell",m.appendChild(n),n.id=c+"new",n.className="graphViewer-icon-button gv-icon-small add",g=function(a,b){var d,e,f,g=/^_(id|rev|key|from|to)/,h=document.createElement("tr"),j=document.createElement("th"),k=document.createElement("th"),l=document.createElement("th");g.test(b)||(i.appendChild(h),h.appendChild(k),k.className="keyCell",e=document.createElement("input"),e.type="text",e.id=c+b+"_key",e.value=b,k.appendChild(e),h.appendChild(l),l.className="valueCell",f=document.createElement("input"),f.type="text",f.id=c+b+"_value","object"==typeof a?f.value=JSON.stringify(a):f.value=a,l.appendChild(f),h.appendChild(j),j.className="actionCell",d=document.createElement("button"),d.id=c+b+"_delete",d.className="graphViewer-icon-button gv-icon-small delete",j.appendChild(d),d.onclick=function(){i.removeChild(h)})},n.onclick=function(){g("","new_"+o),o++},_.each(d,g),$("#"+c+"modal").modal("show")},e=function(a,b,c,d,e){var f=modalDialogHelper.modalDivTemplate(a,b,c,e),g=document.createElement("tr"),h=document.createElement("th"),i=document.createElement("pre");f.appendChild(g),g.appendChild(h),h.appendChild(i),i.className="gv-object-view",i.innerHTML=JSON.stringify(d,null,2),$("#"+c+"modal").modal("show")},f=function(a,b){var c=document.createElement("input");return c.type="text",c.id=a,c.value=b,c},g=function(a,b){var c=document.createElement("input");return c.type="checkbox",c.id=a,c.checked=b,c},h=function(a,b,c){var d=document.createElement("select");return d.id=a,_.each(_.sortBy(b,function(a){return a.toLowerCase()}),function(a){var b=document.createElement("option");b.value=a,b.selected=a===c,b.appendChild(document.createTextNode(a)),d.appendChild(b)}),d},i=function(a){var b=$(".decission_"+a),c=$("input[type='radio'][name='"+a+"']:checked").attr("id");b.each(function(){$(this).attr("decider")===c?$(this).css("display",""):$(this).css("display","none")})},j=function(b,c,d,e,f,g,h,j){var k=document.createElement("input"),l=b+c,m=document.createElement("label"),n=document.createElement("tbody");k.id=l,k.type="radio",k.name=d,k.className="gv-radio-button",m.className="radio",h.appendChild(m),m.appendChild(k),m.appendChild(document.createTextNode(e)),j.appendChild(n),$(n).toggleClass("decission_"+d,!0),$(n).attr("decider",l),_.each(g,function(c){a(n,b,c)}),f?k.checked=!0:k.checked=!1,m.onclick=function(a){i(d),a.stopPropagation()},i(d)},k=function(a,b,c,d,e,f){var g,h=[],i=a+b,j=1,k=document.createElement("th"),l=document.createElement("button"),m=document.createElement("input"),n=function(a){j++;var c,d=document.createElement("tr"),g=document.createElement("th"),k=document.createElement("th"),l=document.createElement("th"),m=document.createElement("input"),n=document.createElement("button");m.type="text",m.id=i+"_"+j,m.value=a||"",c=0===h.length?$(f):$(h[h.length-1]),c.after(d),d.appendChild(g),g.className="collectionTh capitalize",g.appendChild(document.createTextNode(b+" "+j+":")),d.appendChild(k),k.className="collectionTh",k.appendChild(m),n.id=i+"_"+j+"_remove",n.className="graphViewer-icon-button gv-icon-small delete",n.onclick=function(){e.removeChild(d),h.splice(h.indexOf(d),1)},l.appendChild(n),d.appendChild(l),h.push(d)};for(m.type="text",m.id=i+"_1",d.appendChild(m),k.appendChild(l),f.appendChild(k),l.onclick=function(){n()},l.id=i+"_addLine",l.className="graphViewer-icon-button gv-icon-small add","string"==typeof c&&c.length>0&&(c=[c]),c.length>0&&(m.value=c[0]),g=1;g'),$(".arangoFrame .outerDiv").click(function(){e.closeDocEditor()}),$(".arangoFrame .innerDiv").click(function(a){a.stopPropagation()}),$(".fa-times").click(function(){e.closeDocEditor()}),$(".arangoFrame").show(),f.customView=!0,f.customDeleteFunction=function(){window.modalView.hide(),$(".arangoFrame").hide()},$(".arangoFrame #deleteDocumentButton").click(function(){f.deleteDocumentModal()}),$(".arangoFrame #saveDocumentButton").click(function(){f.saveDocument()}),$(".arangoFrame #deleteDocumentButton").css("display","none")},closeDocEditor:function(){$(".arangoFrame .outerDiv .fa-times").remove(),$(".arangoFrame").hide()},getRandomToken:function(){return Math.round((new Date).getTime())},isSystemAttribute:function(a){var b=this.systemAttributes();return b[a]},isSystemCollection:function(a){return"_"===a.name.substr(0,1)},setDocumentStore:function(a){this.arangoDocumentStore=a},collectionApiType:function(a,b){return(b||void 0===this.CollectionTypes[a])&&(this.CollectionTypes[a]=this.arangoDocumentStore.getCollectionInfo(a).type),3===this.CollectionTypes[a]?"edge":"document"},collectionType:function(a){if(!a||""===a.name)return"-";var b;return b=2===a.type?"document":3===a.type?"edge":"unknown",this.isSystemCollection(a)&&(b+=" (system)"),b},formatDT:function(a){var b=function(a){return 10>a?"0"+a:a};return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+" "+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())},escapeHtml:function(a){return String(a).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}}}(),function(){"use strict";if(!window.hasOwnProperty("TEST_BUILD")){var a=function(){var a={};return a.createTemplate=function(a){var b=$("#"+a.replace(".","\\.")).html();return{render:function(a){return _.template(b,a)}}},a};window.templateEngine=new a}}(),Module.prototype.moduleCache={},Module.prototype.moduleCache["/internal"]=new Module("/internal"),"undefined"==typeof global&&"undefined"!=typeof window&&(global=window),global.module=Module.prototype.moduleCache["/"]=new Module("/"),Module.prototype.normalise=function(a){var b,c,d,e,f;if(""===a)return this.id;for(d=a.split("/"),"."===d[0]||".."===d[0]?(e=this.id.split("/"),e.pop(),e=e.concat(d)):e=d,c=[],b=0;b "+require("internal").browserOutputBuffer,"jssuccess"),require("internal").browserOutputBuffer=""},$(global.document).ajaxSend(function(a,b,c){c.url=require("internal").arango.databasePrefix(c.url)}),global.DEFINE_MODULE=function(a,b){var c=Module.prototype.normalise(a),d=Module.prototype.moduleCache[c];d?Object.keys(d.exports).forEach(function(a){b[a]=d.exports[a]}):(d=new Module(c),Module.prototype.moduleCache[c]=d),d.exports=b}}(),module.define("underscore",function(a,b){(function(){function c(a){function b(b,c,d,e,f,g){for(;f>=0&&g>f;f+=a){var h=e?e[f]:f;d=c(d,b[h],h,b)}return d}return function(c,d,e,f){d=v(d,f,4);var g=!C(c)&&u.keys(c),h=(g||c).length,i=a>0?0:h-1;return arguments.length<3&&(e=c[g?g[i]:i],i+=a),b(c,d,e,g,i,h)}}function d(a){return function(b,c,d){c=w(c,d);for(var e=B(b),f=a>0?0:e-1;f>=0&&e>f;f+=a)if(c(b[f],f,b))return f;return-1}}function e(a,b,c){return function(d,e,f){var g=0,h=B(d);if("number"==typeof f)a>0?g=f>=0?f:Math.max(f+h,g):h=f>=0?Math.min(f+1,h):f+h+1;else if(c&&f&&h)return f=c(d,e),d[f]===e?f:-1;if(e!==e)return f=b(m.call(d,g,h),u.isNaN),f>=0?f+g:-1;for(f=a>0?g:h-1;f>=0&&h>f;f+=a)if(d[f]===e)return f;return-1}}function f(a,b){var c=H.length,d=a.constructor,e=u.isFunction(d)&&d.prototype||j,f="constructor";for(u.has(a,f)&&!u.contains(b,f)&&b.push(f);c--;)f=H[c],f in a&&a[f]!==e[f]&&!u.contains(b,f)&&b.push(f)}var g=this,h=g._,i=Array.prototype,j=Object.prototype,k=Function.prototype,l=i.push,m=i.slice,n=j.toString,o=j.hasOwnProperty,p=Array.isArray,q=Object.keys,r=k.bind,s=Object.create,t=function(){},u=function(a){return a instanceof u?a:this instanceof u?void(this._wrapped=a):new u(a)};"undefined"!=typeof a?("undefined"!=typeof b&&b.exports&&(a=b.exports=u),a._=u):g._=u,u.VERSION="1.8.3";var v=function(a,b,c){if(void 0===b)return a;switch(null==c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}},w=function(a,b,c){return null==a?u.identity:u.isFunction(a)?v(a,b,c):u.isObject(a)?u.matcher(a):u.property(a)};u.iteratee=function(a,b){return w(a,b,1/0)};var x=function(a,b){return function(c){var d=arguments.length;if(2>d||null==c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}},y=function(a){if(!u.isObject(a))return{};if(s)return s(a);t.prototype=a;var b=new t;return t.prototype=null,b},z=function(a){return function(b){return null==b?void 0:b[a]}},A=Math.pow(2,53)-1,B=z("length"),C=function(a){var b=B(a);return"number"==typeof b&&b>=0&&A>=b};u.each=u.forEach=function(a,b,c){b=v(b,c);var d,e;if(C(a))for(d=0,e=a.length;e>d;d++)b(a[d],d,a);else{var f=u.keys(a);for(d=0,e=f.length;e>d;d++)b(a[f[d]],f[d],a)}return a},u.map=u.collect=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=Array(e),g=0;e>g;g++){var h=d?d[g]:g;f[g]=b(a[h],h,a)}return f},u.reduce=u.foldl=u.inject=c(1),u.reduceRight=u.foldr=c(-1),u.find=u.detect=function(a,b,c){var d;return d=C(a)?u.findIndex(a,b,c):u.findKey(a,b,c),void 0!==d&&-1!==d?a[d]:void 0},u.filter=u.select=function(a,b,c){var d=[];return b=w(b,c),u.each(a,function(a,c,e){b(a,c,e)&&d.push(a)}),d},u.reject=function(a,b,c){return u.filter(a,u.negate(w(b)),c)},u.every=u.all=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(!b(a[g],g,a))return!1}return!0},u.some=u.any=function(a,b,c){b=w(b,c);for(var d=!C(a)&&u.keys(a),e=(d||a).length,f=0;e>f;f++){var g=d?d[f]:f;if(b(a[g],g,a))return!0}return!1},u.contains=u.includes=u.include=function(a,b,c,d){return C(a)||(a=u.values(a)),("number"!=typeof c||d)&&(c=0),u.indexOf(a,b,c)>=0},u.invoke=function(a,b){var c=m.call(arguments,2),d=u.isFunction(b);return u.map(a,function(a){var e=d?b:a[b];return null==e?e:e.apply(a,c)})},u.pluck=function(a,b){return u.map(a,u.property(b))},u.where=function(a,b){return u.filter(a,u.matcher(b))},u.findWhere=function(a,b){return u.find(a,u.matcher(b))},u.max=function(a,b,c){var d,e,f=-(1/0),g=-(1/0);if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],d>f&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(e>g||e===-(1/0)&&f===-(1/0))&&(f=a,g=e)});return f},u.min=function(a,b,c){var d,e,f=1/0,g=1/0;if(null==b&&null!=a){a=C(a)?a:u.values(a);for(var h=0,i=a.length;i>h;h++)d=a[h],f>d&&(f=d)}else b=w(b,c),u.each(a,function(a,c,d){e=b(a,c,d),(g>e||e===1/0&&f===1/0)&&(f=a,g=e)});return f},u.shuffle=function(a){for(var b,c=C(a)?a:u.values(a),d=c.length,e=Array(d),f=0;d>f;f++)b=u.random(0,f),b!==f&&(e[f]=e[b]),e[b]=c[f];return e},u.sample=function(a,b,c){return null==b||c?(C(a)||(a=u.values(a)),a[u.random(a.length-1)]):u.shuffle(a).slice(0,Math.max(0,b))},u.sortBy=function(a,b,c){return b=w(b,c),u.pluck(u.map(a,function(a,c,d){return{value:a,index:c,criteria:b(a,c,d)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;if(c!==d){if(c>d||void 0===c)return 1;if(d>c||void 0===d)return-1}return a.index-b.index}),"value")};var D=function(a){return function(b,c,d){var e={};return c=w(c,d),u.each(b,function(d,f){var g=c(d,f,b);a(e,d,g)}),e}};u.groupBy=D(function(a,b,c){u.has(a,c)?a[c].push(b):a[c]=[b]}),u.indexBy=D(function(a,b,c){a[c]=b}),u.countBy=D(function(a,b,c){u.has(a,c)?a[c]++:a[c]=1}),u.toArray=function(a){return a?u.isArray(a)?m.call(a):C(a)?u.map(a,u.identity):u.values(a):[]},u.size=function(a){return null==a?0:C(a)?a.length:u.keys(a).length},u.partition=function(a,b,c){b=w(b,c);var d=[],e=[];return u.each(a,function(a,c,f){(b(a,c,f)?d:e).push(a)}),[d,e]},u.first=u.head=u.take=function(a,b,c){return null==a?void 0:null==b||c?a[0]:u.initial(a,a.length-b)},u.initial=function(a,b,c){return m.call(a,0,Math.max(0,a.length-(null==b||c?1:b)))},u.last=function(a,b,c){return null==a?void 0:null==b||c?a[a.length-1]:u.rest(a,Math.max(0,a.length-b))},u.rest=u.tail=u.drop=function(a,b,c){return m.call(a,null==b||c?1:b)},u.compact=function(a){return u.filter(a,u.identity)};var E=function(a,b,c,d){for(var e=[],f=0,g=d||0,h=B(a);h>g;g++){var i=a[g];if(C(i)&&(u.isArray(i)||u.isArguments(i))){b||(i=E(i,b,c));var j=0,k=i.length;for(e.length+=k;k>j;)e[f++]=i[j++]}else c||(e[f++]=i)}return e};u.flatten=function(a,b){return E(a,b,!1)},u.without=function(a){return u.difference(a,m.call(arguments,1))},u.uniq=u.unique=function(a,b,c,d){u.isBoolean(b)||(d=c,c=b,b=!1),null!=c&&(c=w(c,d));for(var e=[],f=[],g=0,h=B(a);h>g;g++){var i=a[g],j=c?c(i,g,a):i;b?(g&&f===j||e.push(i),f=j):c?u.contains(f,j)||(f.push(j),e.push(i)):u.contains(e,i)||e.push(i)}return e},u.union=function(){return u.uniq(E(arguments,!0,!0))},u.intersection=function(a){for(var b=[],c=arguments.length,d=0,e=B(a);e>d;d++){var f=a[d];if(!u.contains(b,f)){for(var g=1;c>g&&u.contains(arguments[g],f);g++);g===c&&b.push(f)}}return b},u.difference=function(a){var b=E(arguments,!0,!0,1);return u.filter(a,function(a){return!u.contains(b,a)})},u.zip=function(){return u.unzip(arguments)},u.unzip=function(a){for(var b=a&&u.max(a,B).length||0,c=Array(b),d=0;b>d;d++)c[d]=u.pluck(a,d);return c},u.object=function(a,b){for(var c={},d=0,e=B(a);e>d;d++)b?c[a[d]]=b[d]:c[a[d][0]]=a[d][1];return c},u.findIndex=d(1),u.findLastIndex=d(-1),u.sortedIndex=function(a,b,c,d){c=w(c,d,1);for(var e=c(b),f=0,g=B(a);g>f;){var h=Math.floor((f+g)/2);c(a[h])f;f++,a+=c)e[f]=a;return e};var F=function(a,b,c,d,e){if(!(d instanceof b))return a.apply(c,e);var f=y(a.prototype),g=a.apply(f,e);return u.isObject(g)?g:f};u.bind=function(a,b){if(r&&a.bind===r)return r.apply(a,m.call(arguments,1));if(!u.isFunction(a))throw new TypeError("Bind must be called on a function");var c=m.call(arguments,2),d=function(){return F(a,d,b,this,c.concat(m.call(arguments)))};return d},u.partial=function(a){var b=m.call(arguments,1),c=function(){for(var d=0,e=b.length,f=Array(e),g=0;e>g;g++)f[g]=b[g]===u?arguments[d++]:b[g];for(;d=d)throw new Error("bindAll must be passed function names");for(b=1;d>b;b++)c=arguments[b],a[c]=u.bind(a[c],a);return a},u.memoize=function(a,b){var c=function(d){var e=c.cache,f=""+(b?b.apply(this,arguments):d);return u.has(e,f)||(e[f]=a.apply(this,arguments)),e[f]};return c.cache={},c},u.delay=function(a,b){var c=m.call(arguments,2);return setTimeout(function(){return a.apply(null,c)},b)},u.defer=u.partial(u.delay,u,1),u.throttle=function(a,b,c){var d,e,f,g=null,h=0;c||(c={});var i=function(){h=c.leading===!1?0:u.now(),g=null,f=a.apply(d,e),g||(d=e=null)};return function(){var j=u.now();h||c.leading!==!1||(h=j);var k=b-(j-h);return d=this,e=arguments,0>=k||k>b?(g&&(clearTimeout(g),g=null),h=j,f=a.apply(d,e),g||(d=e=null)):g||c.trailing===!1||(g=setTimeout(i,k)),f}},u.debounce=function(a,b,c){var d,e,f,g,h,i=function(){var j=u.now()-g;b>j&&j>=0?d=setTimeout(i,b-j):(d=null,c||(h=a.apply(f,e),d||(f=e=null)))};return function(){f=this,e=arguments,g=u.now();var j=c&&!d;return d||(d=setTimeout(i,b)),j&&(h=a.apply(f,e),f=e=null),h}},u.wrap=function(a,b){return u.partial(b,a)},u.negate=function(a){return function(){return!a.apply(this,arguments)}},u.compose=function(){var a=arguments,b=a.length-1;return function(){for(var c=b,d=a[b].apply(this,arguments);c--;)d=a[c].call(this,d);return d}},u.after=function(a,b){return function(){return--a<1?b.apply(this,arguments):void 0}},u.before=function(a,b){var c;return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=null),c}},u.once=u.partial(u.before,2);var G=!{toString:null}.propertyIsEnumerable("toString"),H=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];u.keys=function(a){if(!u.isObject(a))return[];if(q)return q(a);var b=[];for(var c in a)u.has(a,c)&&b.push(c);return G&&f(a,b),b},u.allKeys=function(a){if(!u.isObject(a))return[];var b=[];for(var c in a)b.push(c);return G&&f(a,b),b},u.values=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=a[b[e]];return d},u.mapObject=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=e.length,g={},h=0;f>h;h++)d=e[h],g[d]=b(a[d],d,a);return g},u.pairs=function(a){for(var b=u.keys(a),c=b.length,d=Array(c),e=0;c>e;e++)d[e]=[b[e],a[b[e]]];return d},u.invert=function(a){for(var b={},c=u.keys(a),d=0,e=c.length;e>d;d++)b[a[c[d]]]=c[d];return b},u.functions=u.methods=function(a){var b=[];for(var c in a)u.isFunction(a[c])&&b.push(c);return b.sort()},u.extend=x(u.allKeys),u.extendOwn=u.assign=x(u.keys),u.findKey=function(a,b,c){b=w(b,c);for(var d,e=u.keys(a),f=0,g=e.length;g>f;f++)if(d=e[f],b(a[d],d,a))return d},u.pick=function(a,b,c){var d,e,f={},g=a;if(null==g)return f;u.isFunction(b)?(e=u.allKeys(g),d=v(b,c)):(e=E(arguments,!1,!1,1),d=function(a,b,c){return b in c},g=Object(g));for(var h=0,i=e.length;i>h;h++){var j=e[h],k=g[j];d(k,j,g)&&(f[j]=k)}return f},u.omit=function(a,b,c){if(u.isFunction(b))b=u.negate(b);else{var d=u.map(E(arguments,!1,!1,1),String);b=function(a,b){return!u.contains(d,b)}}return u.pick(a,b,c)},u.defaults=x(u.allKeys,!0),u.create=function(a,b){var c=y(a);return b&&u.extendOwn(c,b),c},u.clone=function(a){return u.isObject(a)?u.isArray(a)?a.slice():u.extend({},a):a},u.tap=function(a,b){return b(a),a},u.isMatch=function(a,b){var c=u.keys(b),d=c.length;if(null==a)return!d;for(var e=Object(a),f=0;d>f;f++){var g=c[f];if(b[g]!==e[g]||!(g in e))return!1}return!0};var I=function(a,b,c,d){if(a===b)return 0!==a||1/a===1/b;if(null==a||null==b)return a===b;a instanceof u&&(a=a._wrapped),b instanceof u&&(b=b._wrapped);var e=n.call(a);if(e!==n.call(b))return!1;switch(e){case"[object RegExp]":case"[object String]":return""+a==""+b;case"[object Number]":return+a!==+a?+b!==+b:0===+a?1/+a===1/b:+a===+b;case"[object Date]":case"[object Boolean]":return+a===+b}var f="[object Array]"===e;if(!f){if("object"!=typeof a||"object"!=typeof b)return!1;var g=a.constructor,h=b.constructor;if(g!==h&&!(u.isFunction(g)&&g instanceof g&&u.isFunction(h)&&h instanceof h)&&"constructor"in a&&"constructor"in b)return!1}c=c||[],d=d||[];for(var i=c.length;i--;)if(c[i]===a)return d[i]===b;if(c.push(a),d.push(b),f){if(i=a.length,i!==b.length)return!1;for(;i--;)if(!I(a[i],b[i],c,d))return!1}else{var j,k=u.keys(a);if(i=k.length,u.keys(b).length!==i)return!1;for(;i--;)if(j=k[i],!u.has(b,j)||!I(a[j],b[j],c,d))return!1}return c.pop(),d.pop(),!0};u.isEqual=function(a,b){return I(a,b)},u.isEmpty=function(a){return null==a?!0:C(a)&&(u.isArray(a)||u.isString(a)||u.isArguments(a))?0===a.length:0===u.keys(a).length},u.isElement=function(a){return!(!a||1!==a.nodeType)},u.isArray=p||function(a){return"[object Array]"===n.call(a)},u.isObject=function(a){var b=typeof a;return"function"===b||"object"===b&&!!a},u.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(a){u["is"+a]=function(b){return n.call(b)==="[object "+a+"]"}}),u.isArguments(arguments)||(u.isArguments=function(a){return u.has(a,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(u.isFunction=function(a){return"function"==typeof a||!1}),u.isFinite=function(a){return isFinite(a)&&!isNaN(parseFloat(a))},u.isNaN=function(a){return u.isNumber(a)&&a!==+a},u.isBoolean=function(a){return a===!0||a===!1||"[object Boolean]"===n.call(a)},u.isNull=function(a){return null===a},u.isUndefined=function(a){return void 0===a},u.has=function(a,b){return null!=a&&o.call(a,b)},u.noConflict=function(){return g._=h,this},u.identity=function(a){return a},u.constant=function(a){return function(){return a}},u.noop=function(){},u.property=z,u.propertyOf=function(a){return null==a?function(){}:function(b){return a[b]}},u.matcher=u.matches=function(a){return a=u.extendOwn({},a),function(b){return u.isMatch(b,a)}},u.times=function(a,b,c){var d=Array(Math.max(0,a));b=v(b,c,1);for(var e=0;a>e;e++)d[e]=b(e);return d},u.random=function(a,b){return null==b&&(b=a,a=0),a+Math.floor(Math.random()*(b-a+1))},u.now=Date.now||function(){return(new Date).getTime()};var J={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},K=u.invert(J),L=function(a){var b=function(b){return a[b]},c="(?:"+u.keys(a).join("|")+")",d=RegExp(c),e=RegExp(c,"g");return function(a){return a=null==a?"":""+a,d.test(a)?a.replace(e,b):a}};u.escape=L(J),u.unescape=L(K),u.result=function(a,b,c){var d=null==a?void 0:a[b];return void 0===d&&(d=c),u.isFunction(d)?d.call(a):d};var M=0;u.uniqueId=function(a){var b=++M+"";return a?a+b:b},u.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var N=/(.)^/,O={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},P=/\\|'|\r|\n|\u2028|\u2029/g,Q=function(a){return"\\"+O[a]};u.template=function(a,b,c){!b&&c&&(b=c),b=u.defaults({},b,u.templateSettings);var d=RegExp([(b.escape||N).source,(b.interpolate||N).source,(b.evaluate||N).source].join("|")+"|$","g"),e=0,f="__p+='";a.replace(d,function(b,c,d,g,h){return f+=a.slice(e,h).replace(P,Q),e=h+b.length,c?f+="'+\n((__t=("+c+"))==null?'':_.escape(__t))+\n'":d?f+="'+\n((__t=("+d+"))==null?'':__t)+\n'":g&&(f+="';\n"+g+"\n__p+='"),b}),f+="';\n",b.variable||(f="with(obj||{}){\n"+f+"}\n"),f="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+f+"return __p;\n";try{var g=new Function(b.variable||"obj","_",f)}catch(h){throw h.source=f,h}var i=function(a){return g.call(this,a,u)},j=b.variable||"obj";return i.source="function("+j+"){\n"+f+"}",i},u.chain=function(a){var b=u(a);return b._chain=!0,b};var R=function(a,b){return a._chain?u(b).chain():b};u.mixin=function(a){u.each(u.functions(a),function(b){var c=u[b]=a[b];u.prototype[b]=function(){var a=[this._wrapped];return l.apply(a,arguments),R(this,c.apply(u,a))}})},u.mixin(u),u.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var b=i[a];u.prototype[a]=function(){var c=this._wrapped;return b.apply(c,arguments),"shift"!==a&&"splice"!==a||0!==c.length||delete c[0],R(this,c)}}),u.each(["concat","join","slice"],function(a){var b=i[a];u.prototype[a]=function(){return R(this,b.apply(this._wrapped,arguments))}}),u.prototype.value=function(){return this._wrapped},u.prototype.valueOf=u.prototype.toJSON=u.prototype.value,u.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return u})}).call(this)}),global.DEFINE_MODULE("internal",function(){"use strict";function a(a){if(i.hasOwnProperty(a))return i[a];var b,c=a.charCodeAt(0);return b=16>c?"\\u000":256>c?"\\u00":4096>c?"\\u0":"\\u",b+=c.toString(16),i[a]=b,b}function b(b){return'"'+b.replace(n,a)+'"'}function c(a){var b,c="";if(a.prettyPrint)for(c+="\n",b=0;b=b.emit&&(h.output(b.output),b.output=""),b.path=i,f=", "}b.level=e-1,b.output+=" ",c(b),d&&(b.output+=j.COLOR_PUNCTUATION),b.output+="]",d&&(b.output+=j.COLOR_RESET)}}function e(a,d){var e=d.useColor,f=" ";e&&(d.output+=j.COLOR_PUNCTUATION),d.output+="{",e&&(d.output+=j.COLOR_RESET);var g=d.level+1;d.level=g;var i;try{i=Object.keys(a)}catch(k){i=[]}for(var l=0,n=i.length;n>l;++l){var o=i[l],p=a[o];e&&(d.output+=j.COLOR_PUNCTUATION),d.output+=f,e&&(d.output+=j.COLOR_RESET),c(d),e&&(d.output+=j.COLOR_INDEX),d.output+=b(o),e&&(d.output+=j.COLOR_RESET),d.output+=" : ";var q=d.path;d.path+="["+o+"]",m(p,d),d.path=q,f=", ",d.emit&&d.output.length>=d.emit&&(h.output(d.output),d.output="")}d.level=g-1,d.output+=" ",c(d),e&&(d.output+=j.COLOR_PUNCTUATION),d.output+="}",e&&(d.output+=j.COLOR_RESET)}function f(){for(var a=0;a0&&a(" "),"string"==typeof arguments[b])a(arguments[b]);else{var c={customInspect:!0,emit:16384,level:0,limitString:80,names:[],output:"",path:"~",prettyPrint:l,seen:[],showFunction:!1,useColor:k,useToString:!0};m(arguments[b],c),a(c.output)}a("\n")}var h={};global.ArangoError?(h.ArangoError=global.ArangoError,delete global.ArangoError):(h.ArangoError=function(a){void 0!==a&&(this.error=a.error,this.code=a.code,this.errorNum=a.errorNum,this.errorMessage=a.errorMessage)},h.ArangoError.prototype=new Error),Object.defineProperty(h.ArangoError.prototype,"message",{configurable:!0,enumerable:!0,get:function(){return this.errorMessage}}),h.ArangoError.prototype.name="ArangoError",h.ArangoError.prototype._PRINT=function(a){a.output+="["+this.toString()+"]"},h.ArangoError.prototype.toString=function(){return this.name+" "+this.errorNum+": "+this.message},global.SleepAndRequeue&&(h.SleepAndRequeue=global.SleepAndRequeue,delete global.SleepAndRequeue,h.SleepAndRequeue.prototype._PRINT=function(a){a.output+=this.toString()},h.SleepAndRequeue.prototype.toString=function(){return"[SleepAndRequeue sleep: "+this.sleep+"]"}),h.threadNumber=0,global.THREAD_NUMBER&&(h.threadNumber=global.THREAD_NUMBER,delete global.THREAD_NUMBER),h.developmentMode=!1,global.LOGFILE_PATH&&(h.logfilePath=global.LOGFILE_PATH,delete global.LOGFILE_PATH),h.quiet=!1,global.ARANGO_QUIET&&(h.quiet=global.ARANGO_QUIET,delete global.ARANGO_QUIET),h.valgrind=!1,global.VALGRIND&&(h.valgrind=global.VALGRIND,delete global.VALGRIND),h.coverage=!1,global.COVERAGE&&(h.coverage=global.COVERAGE,delete global.COVERAGE),h.version="unknown",global.VERSION&&(h.version=global.VERSION,delete global.VERSION),h.platform="unknown",global.SYS_PLATFORM&&(h.platform=global.SYS_PLATFORM,delete global.SYS_PLATFORM),h.bytesSentDistribution=[],global.BYTES_SENT_DISTRIBUTION&&(h.bytesSentDistribution=global.BYTES_SENT_DISTRIBUTION,delete global.BYTES_SENT_DISTRIBUTION),h.bytesReceivedDistribution=[],global.BYTES_RECEIVED_DISTRIBUTION&&(h.bytesReceivedDistribution=global.BYTES_RECEIVED_DISTRIBUTION,delete global.BYTES_RECEIVED_DISTRIBUTION),h.connectionTimeDistribution=[],global.CONNECTION_TIME_DISTRIBUTION&&(h.connectionTimeDistribution=global.CONNECTION_TIME_DISTRIBUTION,delete global.CONNECTION_TIME_DISTRIBUTION),h.requestTimeDistribution=[],global.REQUEST_TIME_DISTRIBUTION&&(h.requestTimeDistribution=global.REQUEST_TIME_DISTRIBUTION,delete global.REQUEST_TIME_DISTRIBUTION),h.startupPath="",global.STARTUP_PATH&&(h.startupPath=global.STARTUP_PATH,delete global.STARTUP_PATH),""===h.startupPath&&(h.startupPath="."),global.CONFIGURE_ENDPOINT&&(h.configureEndpoint=global.CONFIGURE_ENDPOINT,delete global.CONFIGURE_ENDPOINT),global.REMOVE_ENDPOINT&&(h.removeEndpoint=global.REMOVE_ENDPOINT,delete global.REMOVE_ENDPOINT),global.LIST_ENDPOINTS&&(h.listEndpoints=global.LIST_ENDPOINTS,delete global.LIST_ENDPOINTS),global.SYS_BASE64DECODE&&(h.base64Decode=global.SYS_BASE64DECODE,delete global.SYS_BASE64DECODE),global.SYS_BASE64ENCODE&&(h.base64Encode=global.SYS_BASE64ENCODE,delete global.SYS_BASE64ENCODE),global.SYS_DEBUG_SEGFAULT&&(h.debugSegfault=global.SYS_DEBUG_SEGFAULT,delete global.SYS_DEBUG_SEGFAULT),global.SYS_DEBUG_SET_FAILAT&&(h.debugSetFailAt=global.SYS_DEBUG_SET_FAILAT,delete global.SYS_DEBUG_SET_FAILAT),global.SYS_DEBUG_REMOVE_FAILAT&&(h.debugRemoveFailAt=global.SYS_DEBUG_REMOVE_FAILAT,delete global.SYS_DEBUG_REMOVE_FAILAT),global.SYS_DEBUG_CLEAR_FAILAT&&(h.debugClearFailAt=global.SYS_DEBUG_CLEAR_FAILAT,delete global.SYS_DEBUG_CLEAR_FAILAT),global.SYS_DEBUG_CAN_USE_FAILAT&&(h.debugCanUseFailAt=global.SYS_DEBUG_CAN_USE_FAILAT,delete global.SYS_DEBUG_CAN_USE_FAILAT),global.SYS_DOWNLOAD&&(h.download=global.SYS_DOWNLOAD,delete global.SYS_DOWNLOAD),global.SYS_EXECUTE&&(h.executeScript=global.SYS_EXECUTE,delete global.SYS_EXECUTE),global.SYS_GET_CURRENT_REQUEST&&(h.getCurrentRequest=global.SYS_GET_CURRENT_REQUEST,delete global.SYS_GET_CURRENT_REQUEST),global.SYS_GET_CURRENT_RESPONSE&&(h.getCurrentResponse=global.SYS_GET_CURRENT_RESPONSE,delete global.SYS_GET_CURRENT_RESPONSE),h.extend=function(a,b){return Object.getOwnPropertyNames(b).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))}),a},global.SYS_LOAD&&(h.load=global.SYS_LOAD,delete global.SYS_LOAD),global.SYS_LOG_LEVEL&&(h.logLevel=global.SYS_LOG_LEVEL,delete global.SYS_LOG_LEVEL),global.SYS_MD5&&(h.md5=global.SYS_MD5,delete global.SYS_MD5),global.SYS_GEN_RANDOM_NUMBERS&&(h.genRandomNumbers=global.SYS_GEN_RANDOM_NUMBERS,delete global.SYS_GEN_RANDOM_NUMBERS),global.SYS_GEN_RANDOM_ALPHA_NUMBERS&&(h.genRandomAlphaNumbers=global.SYS_GEN_RANDOM_ALPHA_NUMBERS,delete global.SYS_GEN_RANDOM_ALPHA_NUMBERS),global.SYS_GEN_RANDOM_SALT&&(h.genRandomSalt=global.SYS_GEN_RANDOM_SALT,delete global.SYS_GEN_RANDOM_SALT),global.SYS_HMAC&&(h.hmac=global.SYS_HMAC,delete global.SYS_HMAC),global.SYS_PBKDF2&&(h.pbkdf2=global.SYS_PBKDF2,delete global.SYS_PBKDF2),global.SYS_CREATE_NONCE&&(h.createNonce=global.SYS_CREATE_NONCE,delete global.SYS_CREATE_NONCE),global.SYS_CHECK_AND_MARK_NONCE&&(h.checkAndMarkNonce=global.SYS_CHECK_AND_MARK_NONCE,delete global.SYS_CHECK_AND_MARK_NONCE),global.SYS_OUTPUT&&(h.stdOutput=global.SYS_OUTPUT,h.output=h.stdOutput,delete global.SYS_OUTPUT),global.SYS_PARSE&&(h.parse=global.SYS_PARSE,delete global.SYS_PARSE),global.SYS_PARSE_FILE&&(h.parseFile=global.SYS_PARSE_FILE,delete global.SYS_PARSE_FILE),global.SYS_PROCESS_STATISTICS&&(h.processStatistics=global.SYS_PROCESS_STATISTICS,delete global.SYS_PROCESS_STATISTICS),global.SYS_RAND&&(h.rand=global.SYS_RAND,delete global.SYS_RAND),global.SYS_SHA512&&(h.sha512=global.SYS_SHA512,delete global.SYS_SHA512),global.SYS_SHA384&&(h.sha384=global.SYS_SHA384,delete global.SYS_SHA384),global.SYS_SHA256&&(h.sha256=global.SYS_SHA256,delete global.SYS_SHA256),global.SYS_SHA224&&(h.sha224=global.SYS_SHA224,delete global.SYS_SHA224),global.SYS_SHA1&&(h.sha1=global.SYS_SHA1,delete global.SYS_SHA1),global.SYS_SERVER_STATISTICS&&(h.serverStatistics=global.SYS_SERVER_STATISTICS,delete global.SYS_SERVER_STATISTICS),global.SYS_SLEEP&&(h.sleep=global.SYS_SLEEP,delete global.SYS_SLEEP),global.SYS_TIME&&(h.time=global.SYS_TIME,delete global.SYS_TIME),global.SYS_WAIT&&(h.wait=global.SYS_WAIT,delete global.SYS_WAIT),global.SYS_IMPORT_CSV_FILE&&(h.importCsvFile=global.SYS_IMPORT_CSV_FILE,delete global.SYS_IMPORT_CSV_FILE),global.SYS_IMPORT_JSON_FILE&&(h.importJsonFile=global.SYS_IMPORT_JSON_FILE,delete global.SYS_IMPORT_JSON_FILE),global.SYS_PROCESS_CSV_FILE&&(h.processCsvFile=global.SYS_PROCESS_CSV_FILE,delete global.SYS_PROCESS_CSV_FILE),global.SYS_PROCESS_JSON_FILE&&(h.processJsonFile=global.SYS_PROCESS_JSON_FILE,delete global.SYS_PROCESS_JSON_FILE),global.SYS_CLIENT_STATISTICS&&(h.clientStatistics=global.SYS_CLIENT_STATISTICS,delete global.SYS_CLIENT_STATISTICS),global.SYS_HTTP_STATISTICS&&(h.httpStatistics=global.SYS_HTTP_STATISTICS,delete global.SYS_HTTP_STATISTICS),global.SYS_EXECUTE_EXTERNAL&&(h.executeExternal=global.SYS_EXECUTE_EXTERNAL,delete global.SYS_EXECUTE_EXTERNAL),global.SYS_EXECUTE_EXTERNAL_AND_WAIT&&(h.executeExternalAndWait=global.SYS_EXECUTE_EXTERNAL_AND_WAIT,delete global.SYS_EXECUTE_EXTERNAL_AND_WAIT),global.SYS_KILL_EXTERNAL&&(h.killExternal=global.SYS_KILL_EXTERNAL,delete global.SYS_KILL_EXTERNAL),global.SYS_STATUS_EXTERNAL&&(h.statusExternal=global.SYS_STATUS_EXTERNAL,delete global.SYS_STATUS_EXTERNAL),global.SYS_REGISTER_TASK&&(h.registerTask=global.SYS_REGISTER_TASK,delete global.SYS_REGISTER_TASK),global.SYS_UNREGISTER_TASK&&(h.unregisterTask=global.SYS_UNREGISTER_TASK,delete global.SYS_UNREGISTER_TASK),global.SYS_GET_TASK&&(h.getTask=global.SYS_GET_TASK,delete global.SYS_GET_TASK),global.SYS_TEST_PORT&&(h.testPort=global.SYS_TEST_PORT,delete global.SYS_TEST_PORT),global.SYS_IS_IP&&(h.isIP=global.SYS_IS_IP,delete global.SYS_IS_IP),h.unitTests=function(){return global.SYS_UNIT_TESTS},h.setUnitTestsResult=function(a){global.SYS_UNIT_TESTS_RESULT=a},h.toArgv=function(a,b){"undefined"==typeof b&&(b=!1);var c=[];for(var d in a)if(a.hasOwnProperty(d))if("commandSwitches"===d){for(var e="",f=0;f1?c.push(a[d][f]):e+=a[d][f];e.length>0&&c.push(e)}else"flatCommands"===d?c=c.concat(a[d]):b?c.push("--"+d+"="+a[d]):(c.push("--"+d),a[d]!==!1?a[d]!==!0?c.push(a[d]):c.push("true"):c.push("false"));return c},h.parseArgv=function(a,b){function c(b,d,e){if(d.indexOf(":")>0){var f=d.indexOf(":"),h=d.slice(0,f);b.hasOwnProperty(h)||(b[h]={}),c(b[h],d.slice(f+1,d.length),e)}else"true"===a[g+1]?b[d]=!0:"false"===a[g+1]?b[d]=!1:isNaN(a[g+1])?b[d]=a[g+1]:b[d]=parseInt(a[g+1])}function d(a,b){a.hasOwnProperty("commandSwitches")||(a.commandSwitches=[]),a.commandSwitches.push(b)}function e(a,b){for(var c=0;c2&&"--"===j.slice(0,2)){var k=j.slice(2,j.length);a.length>g&&"-"!==a[g+1].slice(0,1)?(c(i,k,a[g+1]),g++):d(i,k)}else"--"===j?h=!0:j.length>1&&"-"===j.slice(0,1)?e(i,j.slice(1,j.length)):f(i,j)}return i},h.COLORS={},global.COLORS?(h.COLORS=global.COLORS,delete global.COLORS):["COLOR_RED","COLOR_BOLD_RED","COLOR_GREEN","COLOR_BOLD_GREEN","COLOR_BLUE","COLOR_BOLD_BLUE","COLOR_YELLOW","COLOR_BOLD_YELLOW","COLOR_WHITE","COLOR_BOLD_WHITE","COLOR_CYAN","COLOR_BOLD_CYAN","COLOR_MAGENTA","COLOR_BOLD_MAGENTA","COLOR_BLACK","COLOR_BOLD_BLACK","COLOR_BLINK","COLOR_BRIGHT","COLOR_RESET"].forEach(function(a){h.COLORS[a]=""}),h.COLORS.COLOR_PUNCTUATION=h.COLORS.COLOR_RESET,h.COLORS.COLOR_STRING=h.COLORS.COLOR_BRIGHT,h.COLORS.COLOR_NUMBER=h.COLORS.COLOR_BRIGHT,h.COLORS.COLOR_INDEX=h.COLORS.COLOR_BRIGHT,h.COLORS.COLOR_TRUE=h.COLORS.COLOR_BRIGHT,h.COLORS.COLOR_FALSE=h.COLORS.COLOR_BRIGHT,h.COLORS.COLOR_NULL=h.COLORS.COLOR_BRIGHT,h.COLORS.COLOR_UNDEFINED=h.COLORS.COLOR_BRIGHT;var i={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},j=h.COLORS,k=!1;global.COLOR_OUTPUT&&(k=global.COLOR_OUTPUT,delete global.COLOR_OUTPUT);var l=!1;global.PRETTY_PRINT&&(l=global.PRETTY_PRINT,delete global.PRETTY_PRINT);var m,n=/[\\\"\x00-\x1f]/g,o=/function ([^\(]*)?\(\) \{ \[native code\] \}/,p=/function ([^\(]*)?\((.*)\) \{/;h.printRecursive=m=function(a,c){var f=c.useColor,g=c.customInspect,i=c.useToString,k=c.limitString,l=c.showFunction;"undefined"==typeof c.seen&&(c.seen=[],c.names=[]);var m=c.seen.indexOf(a);if(m>=0)c.output+=c.names[m];else if(a&&(a instanceof Object||"object"==typeof a&&null===Object.getPrototypeOf(a)))if(c.seen.push(a),c.names.push(c.path),g&&"function"==typeof a._PRINT)a._PRINT(c),c.emit&&c.output.length>=c.emit&&(h.output(c.output),c.output="");else if(a instanceof Array)d(a,c);else if(a.toString===Object.prototype.toString||"object"==typeof a&&null===Object.getPrototypeOf(a)){var n=!1;try{(a instanceof Set||a instanceof Map||a instanceof WeakSet||a instanceof WeakMap||"function"==typeof a[Symbol.iterator])&&(c.output+=a.toString(),n=!0)}catch(q){}n||e(a,c),c.emit&&c.output.length>=c.emit&&(h.output(c.output),c.output="")}else if("function"==typeof a)try{var r=a.toString();if(c.level>0&&!l){var s=r.split("\n"),t=s[0],u=o.exec(t);null!==u?void 0===u[1]?c.output+="function { [native code] }":c.output+="function "+u[1]+" { [native code] }":(u=p.exec(t),null!==u?void 0===u[1]?c.output+="function ("+u[2]+") { ... }":c.output+="function "+u[1]+" ("+u[2]+") { ... }":(t=t.substr(8,t.length-10).trim(),c.output+='[Function "'+t+'" ...]'))}else c.output+=r}catch(v){h.stdOutput(String(v)),c.output+="[Function]"}else if(i&&"function"==typeof a.toString)try{c.output+=a.toString()}catch(w){c.output+="[Object ",e(a,c),c.output+="]"}else c.output+="[Object ",e(a,c),c.output+="]";else void 0===a?(f&&(c.output+=j.COLOR_UNDEFINED),c.output+="undefined",f&&(c.output+=j.COLOR_RESET)):"string"==typeof a?(f&&(c.output+=j.COLOR_STRING),k&&k0&&a(" "),"string"==typeof arguments[c])a(arguments[c]);else{var d={names:[],seen:[],path:"~",level:0,output:"",prettyPrint:!1,useColor:!1,customInspect:!0};b(arguments[c],d),a(d.output)}a("\n")},global.start_pretty_print=function(){require("internal").startPrettyPrint()},global.stop_pretty_print=function(){require("internal").stopPrettyPrint()},global.start_color_print=function(a){require("internal").startColorPrint(a,!1)},global.stop_color_print=function(){require("internal").stopColorPrint()},global.EXPORTS_SLOW_BUFFER&&(Object.keys(global.EXPORTS_SLOW_BUFFER).forEach(function(a){h[a]=global.EXPORTS_SLOW_BUFFER[a]}),delete global.EXPORTS_SLOW_BUFFER),global.APP_PATH&&(h.appPath=global.APP_PATH,delete global.APP_PATH),global.DEV_APP_PATH&&(h.devAppPath=global.APP_PATH,delete global.DEV_APP_PATH),h}()),function(){"use strict";var a=require("internal");a.errors={ERROR_NO_ERROR:{code:0,message:"no error"},ERROR_FAILED:{code:1,message:"failed"},ERROR_SYS_ERROR:{code:2,message:"system error"},ERROR_OUT_OF_MEMORY:{code:3,message:"out of memory"},ERROR_INTERNAL:{code:4,message:"internal error"},ERROR_ILLEGAL_NUMBER:{code:5,message:"illegal number"},ERROR_NUMERIC_OVERFLOW:{code:6,message:"numeric overflow"},ERROR_ILLEGAL_OPTION:{code:7,message:"illegal option"},ERROR_DEAD_PID:{code:8,message:"dead process identifier"},ERROR_NOT_IMPLEMENTED:{code:9,message:"not implemented"},ERROR_BAD_PARAMETER:{code:10,message:"bad parameter"},ERROR_FORBIDDEN:{code:11,message:"forbidden"},ERROR_OUT_OF_MEMORY_MMAP:{code:12,message:"out of memory in mmap"},ERROR_CORRUPTED_CSV:{code:13,message:"csv is corrupt"},ERROR_FILE_NOT_FOUND:{code:14,message:"file not found"},ERROR_CANNOT_WRITE_FILE:{code:15,message:"cannot write file"},ERROR_CANNOT_OVERWRITE_FILE:{code:16,message:"cannot overwrite file"},ERROR_TYPE_ERROR:{code:17,message:"type error"},ERROR_LOCK_TIMEOUT:{code:18,message:"lock timeout"},ERROR_CANNOT_CREATE_DIRECTORY:{code:19,message:"cannot create directory"},ERROR_CANNOT_CREATE_TEMP_FILE:{code:20,message:"cannot create temporary file"},ERROR_REQUEST_CANCELED:{code:21,message:"canceled request"},ERROR_DEBUG:{code:22,message:"intentional debug error"},ERROR_AID_NOT_FOUND:{code:23,message:"internal error with attribute ID in shaper"},ERROR_LEGEND_INCOMPLETE:{code:24,message:"internal error if a legend could not be created"},ERROR_IP_ADDRESS_INVALID:{code:25,message:"IP address is invalid"},ERROR_LEGEND_NOT_IN_WAL_FILE:{code:26,message:"internal error if a legend for a marker does not yet exist in the same WAL file"},ERROR_FILE_EXISTS:{code:27,message:"file exists"},ERROR_LOCKED:{code:28,message:"locked"},ERROR_DEADLOCK:{code:29,message:"deadlock detected"},ERROR_HTTP_BAD_PARAMETER:{code:400,message:"bad parameter"},ERROR_HTTP_UNAUTHORIZED:{code:401,message:"unauthorized"},ERROR_HTTP_FORBIDDEN:{code:403,message:"forbidden"},ERROR_HTTP_NOT_FOUND:{code:404,message:"not found"},ERROR_HTTP_METHOD_NOT_ALLOWED:{code:405,message:"method not supported"},ERROR_HTTP_PRECONDITION_FAILED:{code:412,message:"precondition failed"},ERROR_HTTP_SERVER_ERROR:{code:500,message:"internal server error"},ERROR_HTTP_CORRUPTED_JSON:{code:600,message:"invalid JSON object"},ERROR_HTTP_SUPERFLUOUS_SUFFICES:{code:601,message:"superfluous URL suffices"},ERROR_ARANGO_ILLEGAL_STATE:{code:1e3,message:"illegal state"},ERROR_ARANGO_SHAPER_FAILED:{code:1001,message:"could not shape document"},ERROR_ARANGO_DATAFILE_SEALED:{code:1002,message:"datafile sealed"},ERROR_ARANGO_UNKNOWN_COLLECTION_TYPE:{code:1003,message:"unknown type"},ERROR_ARANGO_READ_ONLY:{code:1004,message:"read only"},ERROR_ARANGO_DUPLICATE_IDENTIFIER:{code:1005,message:"duplicate identifier"},ERROR_ARANGO_DATAFILE_UNREADABLE:{code:1006,message:"datafile unreadable"},ERROR_ARANGO_DATAFILE_EMPTY:{code:1007,message:"datafile empty"},ERROR_ARANGO_RECOVERY:{code:1008,message:"logfile recovery error"},ERROR_ARANGO_CORRUPTED_DATAFILE:{code:1100,message:"corrupted datafile"},ERROR_ARANGO_ILLEGAL_PARAMETER_FILE:{code:1101,message:"illegal or unreadable parameter file"},ERROR_ARANGO_CORRUPTED_COLLECTION:{code:1102,message:"corrupted collection"},ERROR_ARANGO_MMAP_FAILED:{code:1103,message:"mmap failed"},ERROR_ARANGO_FILESYSTEM_FULL:{code:1104,message:"filesystem full"},ERROR_ARANGO_NO_JOURNAL:{code:1105,message:"no journal"},ERROR_ARANGO_DATAFILE_ALREADY_EXISTS:{code:1106,message:"cannot create/rename datafile because it already exists"},ERROR_ARANGO_DATADIR_LOCKED:{code:1107,message:"database directory is locked"},ERROR_ARANGO_COLLECTION_DIRECTORY_ALREADY_EXISTS:{code:1108,message:"cannot create/rename collection because directory already exists"},ERROR_ARANGO_MSYNC_FAILED:{code:1109,message:"msync failed"},ERROR_ARANGO_DATADIR_UNLOCKABLE:{code:1110,message:"cannot lock database directory"},ERROR_ARANGO_SYNC_TIMEOUT:{code:1111,message:"sync timeout"},ERROR_ARANGO_CONFLICT:{code:1200,message:"conflict"},ERROR_ARANGO_DATADIR_INVALID:{code:1201,message:"invalid database directory"},ERROR_ARANGO_DOCUMENT_NOT_FOUND:{code:1202,message:"document not found"},ERROR_ARANGO_COLLECTION_NOT_FOUND:{code:1203,message:"collection not found"},ERROR_ARANGO_COLLECTION_PARAMETER_MISSING:{code:1204,message:"parameter 'collection' not found"},ERROR_ARANGO_DOCUMENT_HANDLE_BAD:{
-code:1205,message:"illegal document handle"},ERROR_ARANGO_MAXIMAL_SIZE_TOO_SMALL:{code:1206,message:"maximal size of journal too small"},ERROR_ARANGO_DUPLICATE_NAME:{code:1207,message:"duplicate name"},ERROR_ARANGO_ILLEGAL_NAME:{code:1208,message:"illegal name"},ERROR_ARANGO_NO_INDEX:{code:1209,message:"no suitable index known"},ERROR_ARANGO_UNIQUE_CONSTRAINT_VIOLATED:{code:1210,message:"unique constraint violated"},ERROR_ARANGO_INDEX_NOT_FOUND:{code:1212,message:"index not found"},ERROR_ARANGO_CROSS_COLLECTION_REQUEST:{code:1213,message:"cross collection request not allowed"},ERROR_ARANGO_INDEX_HANDLE_BAD:{code:1214,message:"illegal index handle"},ERROR_ARANGO_CAP_CONSTRAINT_ALREADY_DEFINED:{code:1215,message:"cap constraint already defined"},ERROR_ARANGO_DOCUMENT_TOO_LARGE:{code:1216,message:"document too large"},ERROR_ARANGO_COLLECTION_NOT_UNLOADED:{code:1217,message:"collection must be unloaded"},ERROR_ARANGO_COLLECTION_TYPE_INVALID:{code:1218,message:"collection type invalid"},ERROR_ARANGO_VALIDATION_FAILED:{code:1219,message:"validator failed"},ERROR_ARANGO_PARSER_FAILED:{code:1220,message:"parsing definition failed"},ERROR_ARANGO_DOCUMENT_KEY_BAD:{code:1221,message:"illegal document key"},ERROR_ARANGO_DOCUMENT_KEY_UNEXPECTED:{code:1222,message:"unexpected document key"},ERROR_ARANGO_DATADIR_NOT_WRITABLE:{code:1224,message:"server database directory not writable"},ERROR_ARANGO_OUT_OF_KEYS:{code:1225,message:"out of keys"},ERROR_ARANGO_DOCUMENT_KEY_MISSING:{code:1226,message:"missing document key"},ERROR_ARANGO_DOCUMENT_TYPE_INVALID:{code:1227,message:"invalid document type"},ERROR_ARANGO_DATABASE_NOT_FOUND:{code:1228,message:"database not found"},ERROR_ARANGO_DATABASE_NAME_INVALID:{code:1229,message:"database name invalid"},ERROR_ARANGO_USE_SYSTEM_DATABASE:{code:1230,message:"operation only allowed in system database"},ERROR_ARANGO_ENDPOINT_NOT_FOUND:{code:1231,message:"endpoint not found"},ERROR_ARANGO_INVALID_KEY_GENERATOR:{code:1232,message:"invalid key generator"},ERROR_ARANGO_INVALID_EDGE_ATTRIBUTE:{code:1233,message:"edge attribute missing"},ERROR_ARANGO_INDEX_DOCUMENT_ATTRIBUTE_MISSING:{code:1234,message:"index insertion warning - attribute missing in document"},ERROR_ARANGO_INDEX_CREATION_FAILED:{code:1235,message:"index creation failed"},ERROR_ARANGO_WRITE_THROTTLE_TIMEOUT:{code:1236,message:"write-throttling timeout"},ERROR_ARANGO_COLLECTION_TYPE_MISMATCH:{code:1237,message:"collection type mismatch"},ERROR_ARANGO_COLLECTION_NOT_LOADED:{code:1238,message:"collection not loaded"},ERROR_ARANGO_DATAFILE_FULL:{code:1300,message:"datafile full"},ERROR_ARANGO_EMPTY_DATADIR:{code:1301,message:"server database directory is empty"},ERROR_REPLICATION_NO_RESPONSE:{code:1400,message:"no response"},ERROR_REPLICATION_INVALID_RESPONSE:{code:1401,message:"invalid response"},ERROR_REPLICATION_MASTER_ERROR:{code:1402,message:"master error"},ERROR_REPLICATION_MASTER_INCOMPATIBLE:{code:1403,message:"master incompatible"},ERROR_REPLICATION_MASTER_CHANGE:{code:1404,message:"master change"},ERROR_REPLICATION_LOOP:{code:1405,message:"loop detected"},ERROR_REPLICATION_UNEXPECTED_MARKER:{code:1406,message:"unexpected marker"},ERROR_REPLICATION_INVALID_APPLIER_STATE:{code:1407,message:"invalid applier state"},ERROR_REPLICATION_UNEXPECTED_TRANSACTION:{code:1408,message:"invalid transaction"},ERROR_REPLICATION_INVALID_APPLIER_CONFIGURATION:{code:1410,message:"invalid replication applier configuration"},ERROR_REPLICATION_RUNNING:{code:1411,message:"cannot perform operation while applier is running"},ERROR_REPLICATION_APPLIER_STOPPED:{code:1412,message:"replication stopped"},ERROR_REPLICATION_NO_START_TICK:{code:1413,message:"no start tick"},ERROR_REPLICATION_START_TICK_NOT_PRESENT:{code:1414,message:"start tick not present"},ERROR_CLUSTER_NO_AGENCY:{code:1450,message:"could not connect to agency"},ERROR_CLUSTER_NO_COORDINATOR_HEADER:{code:1451,message:"missing coordinator header"},ERROR_CLUSTER_COULD_NOT_LOCK_PLAN:{code:1452,message:"could not lock plan in agency"},ERROR_CLUSTER_COLLECTION_ID_EXISTS:{code:1453,message:"collection ID already exists"},ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION_IN_PLAN:{code:1454,message:"could not create collection in plan"},ERROR_CLUSTER_COULD_NOT_READ_CURRENT_VERSION:{code:1455,message:"could not read version in current in agency"},ERROR_CLUSTER_COULD_NOT_CREATE_COLLECTION:{code:1456,message:"could not create collection"},ERROR_CLUSTER_TIMEOUT:{code:1457,message:"timeout in cluster operation"},ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_PLAN:{code:1458,message:"could not remove collection from plan"},ERROR_CLUSTER_COULD_NOT_REMOVE_COLLECTION_IN_CURRENT:{code:1459,message:"could not remove collection from current"},ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE_IN_PLAN:{code:1460,message:"could not create database in plan"},ERROR_CLUSTER_COULD_NOT_CREATE_DATABASE:{code:1461,message:"could not create database"},ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_PLAN:{code:1462,message:"could not remove database from plan"},ERROR_CLUSTER_COULD_NOT_REMOVE_DATABASE_IN_CURRENT:{code:1463,message:"could not remove database from current"},ERROR_CLUSTER_SHARD_GONE:{code:1464,message:"no responsible shard found"},ERROR_CLUSTER_CONNECTION_LOST:{code:1465,message:"cluster internal HTTP connection broken"},ERROR_CLUSTER_MUST_NOT_SPECIFY_KEY:{code:1466,message:"must not specify _key for this collection"},ERROR_CLUSTER_GOT_CONTRADICTING_ANSWERS:{code:1467,message:"got contradicting answers from different shards"},ERROR_CLUSTER_NOT_ALL_SHARDING_ATTRIBUTES_GIVEN:{code:1468,message:"not all sharding attributes given"},ERROR_CLUSTER_MUST_NOT_CHANGE_SHARDING_ATTRIBUTES:{code:1469,message:"must not change the value of a shard key attribute"},ERROR_CLUSTER_UNSUPPORTED:{code:1470,message:"unsupported operation or parameter"},ERROR_CLUSTER_ONLY_ON_COORDINATOR:{code:1471,message:"this operation is only valid on a coordinator in a cluster"},ERROR_CLUSTER_READING_PLAN_AGENCY:{code:1472,message:"error reading Plan in agency"},ERROR_CLUSTER_COULD_NOT_TRUNCATE_COLLECTION:{code:1473,message:"could not truncate collection"},ERROR_CLUSTER_AQL_COMMUNICATION:{code:1474,message:"error in cluster internal communication for AQL"},ERROR_ARANGO_DOCUMENT_NOT_FOUND_OR_SHARDING_ATTRIBUTES_CHANGED:{code:1475,message:"document not found or sharding attributes changed"},ERROR_CLUSTER_COULD_NOT_DETERMINE_ID:{code:1476,message:"could not determine my ID from my local info"},ERROR_QUERY_KILLED:{code:1500,message:"query killed"},ERROR_QUERY_PARSE:{code:1501,message:"%s"},ERROR_QUERY_EMPTY:{code:1502,message:"query is empty"},ERROR_QUERY_SCRIPT:{code:1503,message:"runtime error '%s'"},ERROR_QUERY_NUMBER_OUT_OF_RANGE:{code:1504,message:"number out of range"},ERROR_QUERY_VARIABLE_NAME_INVALID:{code:1510,message:"variable name '%s' has an invalid format"},ERROR_QUERY_VARIABLE_REDECLARED:{code:1511,message:"variable '%s' is assigned multiple times"},ERROR_QUERY_VARIABLE_NAME_UNKNOWN:{code:1512,message:"unknown variable '%s'"},ERROR_QUERY_COLLECTION_LOCK_FAILED:{code:1521,message:"unable to read-lock collection %s"},ERROR_QUERY_TOO_MANY_COLLECTIONS:{code:1522,message:"too many collections"},ERROR_QUERY_DOCUMENT_ATTRIBUTE_REDECLARED:{code:1530,message:"document attribute '%s' is assigned multiple times"},ERROR_QUERY_FUNCTION_NAME_UNKNOWN:{code:1540,message:"usage of unknown function '%s()'"},ERROR_QUERY_FUNCTION_ARGUMENT_NUMBER_MISMATCH:{code:1541,message:"invalid number of arguments for function '%s()', expected number of arguments: minimum: %d, maximum: %d"},ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH:{code:1542,message:"invalid argument type in call to function '%s()'"},ERROR_QUERY_INVALID_REGEX:{code:1543,message:"invalid regex value"},ERROR_QUERY_BIND_PARAMETERS_INVALID:{code:1550,message:"invalid structure of bind parameters"},ERROR_QUERY_BIND_PARAMETER_MISSING:{code:1551,message:"no value specified for declared bind parameter '%s'"},ERROR_QUERY_BIND_PARAMETER_UNDECLARED:{code:1552,message:"bind parameter '%s' was not declared in the query"},ERROR_QUERY_BIND_PARAMETER_TYPE:{code:1553,message:"bind parameter '%s' has an invalid value or type"},ERROR_QUERY_INVALID_LOGICAL_VALUE:{code:1560,message:"invalid logical value"},ERROR_QUERY_INVALID_ARITHMETIC_VALUE:{code:1561,message:"invalid arithmetic value"},ERROR_QUERY_DIVISION_BY_ZERO:{code:1562,message:"division by zero"},ERROR_QUERY_ARRAY_EXPECTED:{code:1563,message:"array expected"},ERROR_QUERY_FAIL_CALLED:{code:1569,message:"FAIL(%s) called"},ERROR_QUERY_GEO_INDEX_MISSING:{code:1570,message:"no suitable geo index found for geo restriction on '%s'"},ERROR_QUERY_FULLTEXT_INDEX_MISSING:{code:1571,message:"no suitable fulltext index found for fulltext query on '%s'"},ERROR_QUERY_INVALID_DATE_VALUE:{code:1572,message:"invalid date value"},ERROR_QUERY_MULTI_MODIFY:{code:1573,message:"multi-modify query"},ERROR_QUERY_INVALID_AGGREGATE_EXPRESSION:{code:1574,message:"invalid aggregate expression"},ERROR_QUERY_COMPILE_TIME_OPTIONS:{code:1575,message:"query options must be readable at query compile time"},ERROR_QUERY_EXCEPTION_OPTIONS:{code:1576,message:"query options expected"},ERROR_QUERY_COLLECTION_USED_IN_EXPRESSION:{code:1577,message:"collection '%s' used as expression operand"},ERROR_QUERY_DISALLOWED_DYNAMIC_CALL:{code:1578,message:"disallowed dynamic call to '%s'"},ERROR_QUERY_ACCESS_AFTER_MODIFICATION:{code:1579,message:"access after data-modification"},ERROR_QUERY_FUNCTION_INVALID_NAME:{code:1580,message:"invalid user function name"},ERROR_QUERY_FUNCTION_INVALID_CODE:{code:1581,message:"invalid user function code"},ERROR_QUERY_FUNCTION_NOT_FOUND:{code:1582,message:"user function '%s()' not found"},ERROR_QUERY_FUNCTION_RUNTIME_ERROR:{code:1583,message:"user function runtime error: %s"},ERROR_QUERY_BAD_JSON_PLAN:{code:1590,message:"bad execution plan JSON"},ERROR_QUERY_NOT_FOUND:{code:1591,message:"query ID not found"},ERROR_QUERY_IN_USE:{code:1592,message:"query with this ID is in use"},ERROR_CURSOR_NOT_FOUND:{code:1600,message:"cursor not found"},ERROR_CURSOR_BUSY:{code:1601,message:"cursor is busy"},ERROR_TRANSACTION_INTERNAL:{code:1650,message:"internal transaction error"},ERROR_TRANSACTION_NESTED:{code:1651,message:"nested transactions detected"},ERROR_TRANSACTION_UNREGISTERED_COLLECTION:{code:1652,message:"unregistered collection used in transaction"},ERROR_TRANSACTION_DISALLOWED_OPERATION:{code:1653,message:"disallowed operation inside transaction"},ERROR_TRANSACTION_ABORTED:{code:1654,message:"transaction aborted"},ERROR_USER_INVALID_NAME:{code:1700,message:"invalid user name"},ERROR_USER_INVALID_PASSWORD:{code:1701,message:"invalid password"},ERROR_USER_DUPLICATE:{code:1702,message:"duplicate user"},ERROR_USER_NOT_FOUND:{code:1703,message:"user not found"},ERROR_USER_CHANGE_PASSWORD:{code:1704,message:"user must change his password"},ERROR_APPLICATION_INVALID_NAME:{code:1750,message:"invalid application name"},ERROR_APPLICATION_INVALID_MOUNT:{code:1751,message:"invalid mount"},ERROR_APPLICATION_DOWNLOAD_FAILED:{code:1752,message:"application download failed"},ERROR_APPLICATION_UPLOAD_FAILED:{code:1753,message:"application upload failed"},ERROR_KEYVALUE_INVALID_KEY:{code:1800,message:"invalid key declaration"},ERROR_KEYVALUE_KEY_EXISTS:{code:1801,message:"key already exists"},ERROR_KEYVALUE_KEY_NOT_FOUND:{code:1802,message:"key not found"},ERROR_KEYVALUE_KEY_NOT_UNIQUE:{code:1803,message:"key is not unique"},ERROR_KEYVALUE_KEY_NOT_CHANGED:{code:1804,message:"key value not changed"},ERROR_KEYVALUE_KEY_NOT_REMOVED:{code:1805,message:"key value not removed"},ERROR_KEYVALUE_NO_VALUE:{code:1806,message:"missing value"},ERROR_TASK_INVALID_ID:{code:1850,message:"invalid task id"},ERROR_TASK_DUPLICATE_ID:{code:1851,message:"duplicate task id"},ERROR_TASK_NOT_FOUND:{code:1852,message:"task not found"},ERROR_GRAPH_INVALID_GRAPH:{code:1901,message:"invalid graph"},ERROR_GRAPH_COULD_NOT_CREATE_GRAPH:{code:1902,message:"could not create graph"},ERROR_GRAPH_INVALID_VERTEX:{code:1903,message:"invalid vertex"},ERROR_GRAPH_COULD_NOT_CREATE_VERTEX:{code:1904,message:"could not create vertex"},ERROR_GRAPH_COULD_NOT_CHANGE_VERTEX:{code:1905,message:"could not change vertex"},ERROR_GRAPH_INVALID_EDGE:{code:1906,message:"invalid edge"},ERROR_GRAPH_COULD_NOT_CREATE_EDGE:{code:1907,message:"could not create edge"},ERROR_GRAPH_COULD_NOT_CHANGE_EDGE:{code:1908,message:"could not change edge"},ERROR_GRAPH_TOO_MANY_ITERATIONS:{code:1909,message:"too many iterations - try increasing the value of 'maxIterations'"},ERROR_GRAPH_INVALID_FILTER_RESULT:{code:1910,message:"invalid filter result"},ERROR_GRAPH_COLLECTION_MULTI_USE:{code:1920,message:"multi use of edge collection in edge def"},ERROR_GRAPH_COLLECTION_USE_IN_MULTI_GRAPHS:{code:1921,message:"edge collection already used in edge def"},ERROR_GRAPH_CREATE_MISSING_NAME:{code:1922,message:"missing graph name"},ERROR_GRAPH_CREATE_MALFORMED_EDGE_DEFINITION:{code:1923,message:"malformed edge definition"},ERROR_GRAPH_NOT_FOUND:{code:1924,message:"graph not found"},ERROR_GRAPH_DUPLICATE:{code:1925,message:"graph already exists"},ERROR_GRAPH_VERTEX_COL_DOES_NOT_EXIST:{code:1926,message:"vertex collection does not exist or is not part of the graph"},ERROR_GRAPH_WRONG_COLLECTION_TYPE_VERTEX:{code:1927,message:"not a vertex collection"},ERROR_GRAPH_NOT_IN_ORPHAN_COLLECTION:{code:1928,message:"not in orphan collection"},ERROR_GRAPH_COLLECTION_USED_IN_EDGE_DEF:{code:1929,message:"collection already used in edge def"},ERROR_GRAPH_EDGE_COLLECTION_NOT_USED:{code:1930,message:"edge collection not used in graph"},ERROR_GRAPH_NOT_AN_ARANGO_COLLECTION:{code:1931,message:" is not an ArangoCollection"},ERROR_GRAPH_NO_GRAPH_COLLECTION:{code:1932,message:"collection _graphs does not exist"},ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT_STRING:{code:1933,message:"Invalid example type. Has to be String, Array or Object"},ERROR_GRAPH_INVALID_EXAMPLE_ARRAY_OBJECT:{code:1934,message:"Invalid example type. Has to be Array or Object"},ERROR_GRAPH_INVALID_NUMBER_OF_ARGUMENTS:{code:1935,message:"Invalid number of arguments. Expected: "},ERROR_GRAPH_INVALID_PARAMETER:{code:1936,message:"Invalid parameter type."},ERROR_GRAPH_INVALID_ID:{code:1937,message:"Invalid id"},ERROR_GRAPH_COLLECTION_USED_IN_ORPHANS:{code:1938,message:"collection used in orphans"},ERROR_GRAPH_EDGE_COL_DOES_NOT_EXIST:{code:1939,message:"edge collection does not exist or is not part of the graph"},ERROR_GRAPH_EMPTY:{code:1940,message:"empty graph"},ERROR_SESSION_UNKNOWN:{code:1950,message:"unknown session"},ERROR_SESSION_EXPIRED:{code:1951,message:"session expired"},SIMPLE_CLIENT_UNKNOWN_ERROR:{code:2e3,message:"unknown client error"},SIMPLE_CLIENT_COULD_NOT_CONNECT:{code:2001,message:"could not connect to server"},SIMPLE_CLIENT_COULD_NOT_WRITE:{code:2002,message:"could not write to server"},SIMPLE_CLIENT_COULD_NOT_READ:{code:2003,message:"could not read from server"},ERROR_MALFORMED_MANIFEST_FILE:{code:3e3,message:"malformed manifest file"},ERROR_INVALID_APPLICATION_MANIFEST:{code:3001,message:"manifest file is invalid"},ERROR_MANIFEST_FILE_ATTRIBUTE_MISSING:{code:3002,message:"missing manifest attribute"},ERROR_CANNOT_EXTRACT_APPLICATION_ROOT:{code:3003,message:"unable to extract app root path"},ERROR_INVALID_FOXX_OPTIONS:{code:3004,message:"invalid foxx options"},ERROR_FAILED_TO_EXECUTE_SCRIPT:{code:3005,message:"failed to execute script"},ERROR_SYNTAX_ERROR_IN_SCRIPT:{code:3006,message:"syntax error in script"},ERROR_INVALID_MOUNTPOINT:{code:3007,message:"mountpoint is invalid"},ERROR_NO_FOXX_FOUND:{code:3008,message:"No foxx found at this location"},ERROR_APP_NOT_FOUND:{code:3009,message:"App not found"},ERROR_APP_NEEDS_CONFIGURATION:{code:3010,message:"App not configured"},ERROR_MODULE_NOT_FOUND:{code:3100,message:"cannot locate module"},ERROR_MODULE_SYNTAX_ERROR:{code:3101,message:"syntax error in module"},ERROR_MODULE_BAD_WRAPPER:{code:3102,message:"failed to wrap module"},ERROR_MODULE_FAILURE:{code:3103,message:"failed to invoke module"},ERROR_MODULE_UNKNOWN_FILE_TYPE:{code:3110,message:"unknown file type"},ERROR_MODULE_PATH_MUST_BE_ABSOLUTE:{code:3111,message:"path must be absolute"},ERROR_MODULE_CAN_NOT_ESCAPE:{code:3112,message:"cannot use '..' to escape top-level-directory"},ERROR_MODULE_DRIVE_LETTER:{code:3113,message:"drive local path is not supported"},ERROR_MODULE_BAD_MODULE_ORIGIN:{code:3120,message:"corrupted module origin"},ERROR_MODULE_BAD_PACKAGE_ORIGIN:{code:3121,message:"corrupted package origin"},ERROR_MODULE_DOCUMENT_IS_EMPTY:{code:3125,message:"no content"},ERROR_MODULE_MAIN_NOT_READABLE:{code:3130,message:"cannot read main file"},ERROR_MODULE_MAIN_NOT_JS:{code:3131,message:"main file is not of type 'js'"},RESULT_ELEMENT_EXISTS:{code:1e4,message:"element not inserted into structure, because it already exists"},RESULT_ELEMENT_NOT_FOUND:{code:10001,message:"element not found in structure"},ERROR_APP_ALREADY_EXISTS:{code:2e4,message:"newest version of app already installed"},ERROR_QUEUE_ALREADY_EXISTS:{code:21e3,message:"named queue already exists"},ERROR_DISPATCHER_IS_STOPPING:{code:21001,message:"dispatcher stopped"},ERROR_QUEUE_UNKNOWN:{code:21002,message:"named queue does not exist"},ERROR_QUEUE_FULL:{code:21003,message:"named queue is full"}}}(),global.DEFINE_MODULE("console",function(){"use strict";function a(a,b){j(a,h+b)}function b(a){var b=require("internal").ShapedJson,c=[];a.length>0&&"string"!=typeof a[0]&&c.push("%s");for(var d=0;d curl ","POST"===e?(i=a.arango.POST_RAW(f,g,h),j+="-X "+e+" "):"PUT"===e?(i=a.arango.PUT_RAW(f,g,h),j+="-X "+e+" "):"GET"===e?i=a.arango.GET_RAW(f,h):"DELETE"===e?(i=a.arango.DELETE_RAW(f,h),j+="-X "+e+" "):"PATCH"===e?(i=a.arango.PATCH_RAW(f,g,h),j+="-X "+e+" "):"HEAD"===e?(i=a.arango.HEAD_RAW(f,h),j+="-X "+e+" "):"OPTION"===e&&(i=a.arango.OPTION_RAW(f,g,h),j+="-X "+e+" "),void 0!==h&&""!==h)for(k in h)h.hasOwnProperty(k)&&(j+="--header '"+k+": "+h[k]+"' ");return void 0!==g&&""!==g&&(j+="--data-binary @- "),j+="--dump - http://localhost:8529"+f,b(j),void 0!==g&&""!==g&&g&&(d(" <<EOF\n"),l?c(g):d(g),d("\nEOF")),d("\n\n"),i}},a.appendRawResponse=function(b,c){return function(d){var e,f=d.headers;b("HTTP/1.1 "+f["http/1.1"]+"\n");for(e in f)f.hasOwnProperty(e)&&"http/1.1"!==e&&"server"!==e&&"connection"!==e&&"content-length"!==e&&b(e+": "+f[e]+"\n");b("\n"),void 0!==d.body&&(c(a.inspect(d.body)),b("\n"))}},a.appendJsonResponse=function(b,c){return function(b){var d=a.appendRawResponse(c,c),e=b.body;b.body=JSON.parse(b.body),d(b),b.body=e}},a.log=function(b,c){a.output(b,": ",c,"\n")};try{"undefined"!=typeof window&&(a.sprintf=function(a){var b=arguments.length;if(0===b)return"";if(1>=b)return String(a);var c,d=[];for(c=1;c col = db.mycoll; \n > col = db._create("mycoll"); \n \nAdministration Functions: \n name() collection name \n status() status of the collection \n type() type of the collection \n truncate() delete all documents \n properties() show collection properties \n drop() delete a collection \n load() load a collection \n unload() unload a collection \n rename() renames a collection \n getIndexes() return defined indexes \n refresh() refreshes the status and name \n _help() this help \n \nDocument Functions: \n count() return number of documents \n save() create document and return handle \n document() get document by handle (_id or _key)\n replace(, , ) overwrite document \n update(, , , partially update document \n ) \n remove() delete document \n exists() checks whether a document exists \n first() first inserted/updated document \n last() last inserted/updated document \n \nAttributes: \n _database database object \n _id collection identifier ';d.prototype._help=function(){e.print(h)},d.prototype.name=function(){return null===this._name&&this.refresh(),this._name},d.prototype.status=function(){var a;return null===this._status&&this.refresh(),a=this._status,this._status===d.STATUS_UNLOADING&&(this._status=null),a},d.prototype.type=function(){return null===this._type&&this.refresh(),this._type},d.prototype.properties=function(a){var b,c,d={doCompact:!0,journalSize:!0,isSystem:!1,isVolatile:!1,waitForSync:!0,shardKeys:!1,numberOfShards:!1,keyOptions:!1,indexBuckets:!0};if(void 0===a)c=this._database._connection.GET(this._baseurl("properties")),f.checkRequestResult(c);else{var e={};for(b in d)d.hasOwnProperty(b)&&d[b]&&a.hasOwnProperty(b)&&(e[b]=a[b]);c=this._database._connection.PUT(this._baseurl("properties"),JSON.stringify(e)),f.checkRequestResult(c)}var g={};for(b in d)d.hasOwnProperty(b)&&c.hasOwnProperty(b)&&void 0!==c[b]&&(g[b]=c[b]);return g},d.prototype.rotate=function(){var a=this._database._connection.PUT(this._baseurl("rotate"),"");return f.checkRequestResult(a),a.result},d.prototype.figures=function(){var a=this._database._connection.GET(this._baseurl("figures"));return f.checkRequestResult(a),a.figures},d.prototype.checksum=function(a,b){var c="";a&&(c+="?withRevisions=true"),b&&(c+=(""===c?"?":"&")+"withData=true");var d=this._database._connection.GET(this._baseurl("checksum")+c);return f.checkRequestResult(d),{checksum:d.checksum,revision:d.revision}},d.prototype.revision=function(){var a=this._database._connection.GET(this._baseurl("revision"));return f.checkRequestResult(a),a.revision},d.prototype.drop=function(){var a=this._database._connection.DELETE(this._baseurl());null!==a&&a.error===!0&&a.errorNum!==e.errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code&&f.checkRequestResult(a),this._status=d.STATUS_DELETED;var b,c=this._database;for(b in c)if(c.hasOwnProperty(b)){var g=c[b];if(g instanceof d&&g.name()===this.name()){delete c[b];break}}},d.prototype.truncate=function(){var a=this._database._connection.PUT(this._baseurl("truncate"),"");f.checkRequestResult(a),this._status=null},d.prototype.load=function(a){var b={count:!0};void 0!==a&&(b.count=a);var c=this._database._connection.PUT(this._baseurl("load"),JSON.stringify(b));f.checkRequestResult(c),this._status=null},d.prototype.unload=function(){var a=this._database._connection.PUT(this._baseurl("unload"),"");f.checkRequestResult(a),this._status=null},d.prototype.rename=function(a){var b={name:a},c=this._database._connection.PUT(this._baseurl("rename"),JSON.stringify(b));f.checkRequestResult(c),delete this._database[this._name],this._database[a]=this,
-this._status=null,this._name=null},d.prototype.refresh=function(){var a=this._database._connection.GET(this._database._collectionurl(this._id)+"?useId=true");f.checkRequestResult(a),this._name=a.name,this._status=a.status,this._type=a.type},d.prototype.getIndexes=function(a){var b=this._database._connection.GET(this._indexurl()+"&withStats="+(a||!1));return f.checkRequestResult(b),b.indexes},d.prototype.index=function(a){a.hasOwnProperty("id")&&(a=a.id);var b=this._database._connection.GET(this._database._indexurl(a,this.name()));return f.checkRequestResult(b),b},d.prototype.dropIndex=function(a){a.hasOwnProperty("id")&&(a=a.id);var b=this._database._connection.DELETE(this._database._indexurl(a,this.name()));return null!==b&&b.error===!0&&b.errorNum===e.errors.ERROR_ARANGO_INDEX_NOT_FOUND.code?!1:(f.checkRequestResult(b),!0)},d.prototype.ensureCapConstraint=function(a,b){var c={type:"cap",size:a||void 0,byteSize:b||void 0},d=this._database._connection.POST(this._indexurl(),JSON.stringify(c));return f.checkRequestResult(d),d},d.prototype.ensureUniqueSkiplist=function(){var a=c({type:"skiplist",unique:!0},arguments),b=this._database._connection.POST(this._indexurl(),JSON.stringify(a));return f.checkRequestResult(b),b},d.prototype.ensureSkiplist=function(){var a=c({type:"skiplist",unique:!1},arguments),b=this._database._connection.POST(this._indexurl(),JSON.stringify(a));return f.checkRequestResult(b),b},d.prototype.ensureFulltextIndex=function(a,b){var c={type:"fulltext",minLength:b||void 0,fields:[a]},d=this._database._connection.POST(this._indexurl(),JSON.stringify(c));return f.checkRequestResult(d),d},d.prototype.ensureUniqueConstraint=function(){var a=c({type:"hash",unique:!0},arguments),b=this._database._connection.POST(this._indexurl(),JSON.stringify(a));return f.checkRequestResult(b),b},d.prototype.ensureHashIndex=function(){var a=c({type:"hash",unique:!1},arguments),b=this._database._connection.POST(this._indexurl(),JSON.stringify(a));return f.checkRequestResult(b),b},d.prototype.ensureGeoIndex=function(a,b){var c;if("string"!=typeof a)throw"usage: ensureGeoIndex(, ) or ensureGeoIndex([, ])";c="boolean"==typeof b?{type:"geo",fields:[a],geoJson:b}:void 0===b?{type:"geo",fields:[a],geoJson:!1}:{type:"geo",fields:[a,b],geoJson:!1};var d=this._database._connection.POST(this._indexurl(),JSON.stringify(c));return f.checkRequestResult(d),d},d.prototype.ensureGeoConstraint=function(a,b){return this.ensureGeoIndex(a,b)},d.prototype.ensureIndex=function(a){if("object"!=typeof a||Array.isArray(a))throw"usage: ensureIndex()";var b=this._database._connection.POST(this._indexurl(),JSON.stringify(a));return f.checkRequestResult(b),b},d.prototype.count=function(){var a=this._database._connection.GET(this._baseurl("count"));return f.checkRequestResult(a),a.count},d.prototype.document=function(a){var b,c=null;if(a.hasOwnProperty("_id")&&(a.hasOwnProperty("_rev")&&(c=a._rev),a=a._id),b=null===c?this._database._connection.GET(this._documenturl(a)):this._database._connection.GET(this._documenturl(a),{"if-match":JSON.stringify(c)}),null!==b&&b.error===!0&&b.errorNum===e.errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code)throw new g(b);return f.checkRequestResult(b),b},d.prototype.exists=function(a){var b,c=null;if(void 0===a||null===a)throw new g({errorNum:e.errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.code,errorMessage:e.errors.ERROR_ARANGO_DOCUMENT_HANDLE_BAD.message});return a.hasOwnProperty("_id")&&(a.hasOwnProperty("_rev")&&(c=a._rev),a=a._id),b=null===c?this._database._connection.HEAD(this._documenturl(a)):this._database._connection.HEAD(this._documenturl(a),{"if-match":JSON.stringify(c)}),null===b||b.error!==!0||b.errorNum!==e.errors.ERROR_ARANGO_COLLECTION_NOT_FOUND.code&&b.errorNum!==e.errors.ERROR_HTTP_NOT_FOUND.code&&b.errorNum!==e.errors.ERROR_HTTP_PRECONDITION_FAILED.code?(f.checkRequestResult(b),!0):!1},d.prototype.any=function(){var a=this._database._connection.PUT(this._prefixurl("/_api/simple/any"),JSON.stringify({collection:this._name}));return f.checkRequestResult(a),a.document},d.prototype.firstExample=function(a){var b,c;if(1===arguments.length)b=a;else for(b={},c=0;c) get collection by identifier/name \n _create(, ) creates a new collection \n _createEdgeCollection() creates a new edge collection \n _drop() delete a collection \n \nDocument Functions: \n _document() get document by handle (_id) \n _replace(, , ) overwrite document \n _update(, , , partially update document \n ) \n _remove() delete document \n _exists() checks whether a document exists \n _truncate() delete all documents \n \nDatabase Management Functions: \n _createDatabase() creates a new database \n _dropDatabase() drops an existing database \n _useDatabase() switches into an existing database\n _drop() delete a collection \n _name() name of the current database \n \nQuery / Transaction Functions: \n _executeTransaction() execute transaction \n _query() execute AQL query \n _createStatement() create and return AQL query ";c.prototype._help=function(){e.print(i)},c.prototype.toString=function(){return'[object ArangoDatabase "'+this._name()+'"]'},c.prototype._collections=function(){var a=this._connection.GET(this._collectionurl());if(f.checkRequestResult(a),void 0!==a.collections){var b,c=a.collections,d=[];for(b=0;b1&&(a={query:a,bindVars:b,options:c}),require("org/arangodb/aql/explainer").explain(a)},c.prototype._createDatabase=function(a,b,c){var d={name:a,options:b||{},users:c||[]},e=this._connection.POST("/_api/database",JSON.stringify(d));if(null!==e&&e.error===!0)throw new g(e);return f.checkRequestResult(e),e.result},c.prototype._dropDatabase=function(a){var b=this._connection.DELETE("/_api/database/"+encodeURIComponent(a));if(null!==b&&b.error===!0)throw new g(b);return f.checkRequestResult(b),b.result},c.prototype._listDatabases=function(){var a=this._connection.GET("/_api/database");if(null!==a&&a.error===!0)throw new g(a);return f.checkRequestResult(a),a.result},c.prototype._useDatabase=function(a){if(e.printBrowser)throw new g({error:!0,code:e.errors.ERROR_NOT_IMPLEMENTED.code,errorNum:e.errors.ERROR_NOT_IMPLEMENTED.code,errorMessage:"_useDatabase() is not supported in the web interface"});var b=this._connection.getDatabaseName();if(a===b)return!0;this._connection.setDatabaseName(a);try{this._queryProperties(!0),this._flushCache()}catch(c){if(this._connection.setDatabaseName(b),c.hasOwnProperty("errorNum"))throw c;throw new g({error:!0,code:e.errors.ERROR_BAD_PARAMETER.code,errorNum:e.errors.ERROR_BAD_PARAMETER.code,errorMessage:"cannot use database '"+a+"'"})}return!0},c.prototype._listEndpoints=function(){var a=this._connection.GET("/_api/endpoint");if(null!==a&&a.error===!0)throw new g(a);return f.checkRequestResult(a),a},c.prototype._executeTransaction=function(a){if(!a||"object"!=typeof a)throw new g({error:!0,code:e.errors.ERROR_HTTP_BAD_PARAMETER.code,errorNum:e.errors.ERROR_BAD_PARAMETER.code,errorMessage:"usage: _executeTransaction(
"))}})}(),function(){"use strict";window.databaseView=Backbone.View.extend({users:null,el:"#content",template:templateEngine.createTemplate("databaseView.ejs"),dropdownVisible:!1,currentDB:"",events:{"click #createDatabase":"createDatabase","click #submitCreateDatabase":"submitCreateDatabase","click .editDatabase":"editDatabase","click .icon":"editDatabase","click #selectDatabase":"updateDatabase","click #submitDeleteDatabase":"submitDeleteDatabase","click .contentRowInactive a":"changeDatabase","keyup #databaseSearchInput":"search","click #databaseSearchSubmit":"search","click #databaseToggle":"toggleSettingsDropdown","click .css-label":"checkBoxes","click #dbSortDesc":"sorting","click .tile":"switchDatabase"},sorting:function(){$("#dbSortDesc").is(":checked")?this.collection.setSortingDesc(!0):this.collection.setSortingDesc(!1),$("#databaseDropdown").is(":visible")?this.dropdownVisible=!0:this.dropdownVisible=!1,this.render()},initialize:function(){this.collection.fetch({async:!1})},checkBoxes:function(a){var b=a.currentTarget.id;$("#"+b).click()},render:function(){return this.currentDatabase(),this.collection.sort(),$(this.el).html(this.template.render({collection:this.collection,searchString:"",currentDB:this.currentDB})),this.dropdownVisible===!0&&($("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").show()),arangoHelper.setCheckboxStatus("#databaseDropdown"),this.replaceSVGs(),this},toggleSettingsDropdown:function(){$("#dbSortDesc").attr("checked",this.collection.sortOptions.desc),$("#databaseToggle").toggleClass("activated"),$("#databaseDropdown2").slideToggle(200)},selectedDatabase:function(){return $("#selectDatabases").val()},handleError:function(a,b,c){return 409===a?void arangoHelper.arangoError("DB","Database "+c+" already exists."):400===a?void arangoHelper.arangoError("DB","Invalid Parameters"):403===a?void arangoHelper.arangoError("DB","Insufficent rights. Execute this from _system database"):void 0},validateDatabaseInfo:function(a,b,c){return""===b?(arangoHelper.arangoError("DB","You have to define an owner for the new database"),!1):""===a?(arangoHelper.arangoError("DB","You have to define a name for the new database"),!1):0===a.indexOf("_")?(arangoHelper.arangoError("DB ","Databasename should not start with _"),!1):a.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)?!0:(arangoHelper.arangoError("DB","Databasename may only contain numbers, letters, _ and -"),!1)},createDatabase:function(a){a.preventDefault(),this.createAddDatabaseModal()},switchDatabase:function(a){if(!$(a.target).parent().hasClass("iconSet")){var b=$(a.currentTarget).find("h5").text();if(""!==b){var c=this.collection.createDatabaseURL(b);window.location.replace(c)}}},submitCreateDatabase:function(){var a,b=this,c=$("#newDatabaseName").val(),d=$("#newUser").val();if(a="true"===$("#useDefaultPassword").val()?"ARANGODB_DEFAULT_ROOT_PASSWORD":$("#newPassword").val(),this.validateDatabaseInfo(c,d,a)){var e={name:c,users:[{username:d,passwd:a,active:!0}]};this.collection.create(e,{wait:!0,error:function(a,d){b.handleError(d.status,d.statusText,c)},success:function(a){b.updateDatabases(),window.modalView.hide(),window.App.naviView.dbSelectionView.render($("#dbSelect"))}})}},submitDeleteDatabase:function(a){var b=this.collection.where({name:a});b[0].destroy({wait:!0,url:"/_api/database/"+a}),this.updateDatabases(),window.App.naviView.dbSelectionView.render($("#dbSelect")),window.modalView.hide()},currentDatabase:function(){this.currentDB=this.collection.getCurrentDatabase()},changeDatabase:function(a){var b=$(a.currentTarget).attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},updateDatabases:function(){var a=this;this.collection.fetch({success:function(){a.render(),window.App.handleSelectDatabase()}})},editDatabase:function(a){var b=this.evaluateDatabaseName($(a.currentTarget).attr("id"),"_edit-database"),c=!0;b===this.currentDB&&(c=!1),this.createEditDatabaseModal(b,c)},search:function(){var a,b,c,d;a=$("#databaseSearchInput"),b=$("#databaseSearchInput").val(),d=this.collection.filter(function(a){return-1!==a.get("name").indexOf(b)}),$(this.el).html(this.template.render({collection:d,searchString:b,currentDB:this.currentDB})),this.replaceSVGs(),a=$("#databaseSearchInput"),c=a.val().length,a.focus(),a[0].setSelectionRange(c,c)},replaceSVGs:function(){$(".svgToReplace").each(function(){var a=$(this),b=a.attr("id"),c=a.attr("src");$.get(c,function(c){var d=$(c).find("svg");d.attr("id",b).attr("class","tile-icon-svg").removeAttr("xmlns:a"),a.replaceWith(d)},"xml")})},evaluateDatabaseName:function(a,b){var c=a.lastIndexOf(b);return a.substring(0,c)},createEditDatabaseModal:function(a,b){var c=[],d=[];d.push(window.modalView.createReadOnlyEntry("id_name","Name",a,"")),b?c.push(window.modalView.createDeleteButton("Delete",this.submitDeleteDatabase.bind(this,a))):c.push(window.modalView.createDisabledButton("Delete")),window.modalView.show("modalTable.ejs","Delete database",c,d)},createAddDatabaseModal:function(){var a=[],b=[];b.push(window.modalView.createTextEntry("newDatabaseName","Name","",!1,"Database Name",!0,[{rule:Joi.string().regex(/^[a-zA-Z]/),msg:"Database name must start with a letter."},{rule:Joi.string().regex(/^[a-zA-Z0-9\-_]*$/),msg:'Only Symbols "_" and "-" are allowed.'},{rule:Joi.string().required(),msg:"No database name given."}])),b.push(window.modalView.createTextEntry("newUser","Username",null!==this.users?this.users.whoAmI():"root","Please define the owner of this database. This will be the only user having initial access to this database if authentication is turned on. Please note that if you specify a username different to your account you will not be able to access the database with your account after having creating it. Specifying a username is mandatory even with authentication turned off. If there is a failure you will be informed.","Database Owner",!0,[{rule:Joi.string().required(),msg:"No username given."}])),b.push(window.modalView.createSelectEntry("useDefaultPassword","Use default password",!0,"Read the password from the environment variable ARANGODB_DEFAULT_ROOT_PASSWORD.",[{value:!1,label:"No"},{value:!0,label:"Yes"}])),b.push(window.modalView.createPasswordEntry("newPassword","Password","",!1,"",!1)),a.push(window.modalView.createSuccessButton("Create",this.submitCreateDatabase.bind(this))),window.modalView.show("modalTable.ejs","Create Database",a,b),$("#useDefaultPassword").change(function(){"true"===$("#useDefaultPassword").val()?$("#row_newPassword").hide():$("#row_newPassword").show()}),$("#row_newPassword").hide()}})}(),function(){"use strict";window.DBSelectionView=Backbone.View.extend({template:templateEngine.createTemplate("dbSelectionView.ejs"),events:{"click .dbSelectionLink":"changeDatabase"},initialize:function(a){this.current=a.current},changeDatabase:function(a){var b=$(a.currentTarget).closest(".dbSelectionLink.tab").attr("id"),c=this.collection.createDatabaseURL(b);window.location.replace(c)},render:function(a){return this.$el=a,this.$el.html(this.template.render({list:this.collection.getDatabasesForUser(),current:this.current.get("name")})),this.delegateEvents(),this.el}})}(),function(){"use strict";var a=function(a){var b=a.split("/");return"collection/"+encodeURIComponent(b[0])+"/"+encodeURIComponent(b[1])};window.DocumentView=Backbone.View.extend({el:"#content",colid:0,docid:0,customView:!1,template:templateEngine.createTemplate("documentView.ejs"),events:{"click #saveDocumentButton":"saveDocument","click #deleteDocumentButton":"deleteDocumentModal","click #confirmDeleteDocument":"deleteDocument","click #document-from":"navigateToDocument","click #document-to":"navigateToDocument","keydown #documentEditor .ace_editor":"keyPress","keyup .jsoneditor .search input":"checkSearchBox"},checkSearchBox:function(a){""===$(a.currentTarget).val()&&this.editor.expandAll()},keyPress:function(a){a.ctrlKey&&13===a.keyCode?(a.preventDefault(),this.saveDocument()):a.metaKey&&13===a.keyCode&&(a.preventDefault(),this.saveDocument())},editor:0,setType:function(a){var b,c;return"edge"===a?(b=this.collection.getEdge(this.colid,this.docid),c="Edge: "):"document"===a&&(b=this.collection.getDocument(this.colid,this.docid),c="Document: "),b===!0?(this.type=a,this.fillInfo(c),this.fillEditor(),!0):void 0},deleteDocumentModal:function(){var a=[],b=[];b.push(window.modalView.createReadOnlyEntry("doc-delete-button","Delete","Delete this "+this.type+"?",void 0,void 0,!1,/[<>&'"]/)),a.push(window.modalView.createDeleteButton("Delete",this.deleteDocument.bind(this))),window.modalView.show("modalTable.ejs","Delete Document",a,b)},deleteDocument:function(){var a;if("document"===this.type){if(a=this.collection.deleteDocument(this.colid,this.docid),a===!1)return void arangoHelper.arangoError("Document error:","Could not delete")}else if("edge"===this.type&&(a=this.collection.deleteEdge(this.colid,this.docid),a===!1))return void arangoHelper.arangoError("Edge error:","Could not delete");if(a===!0)if(this.customView)this.customDeleteFunction();else{var b="collection/"+encodeURIComponent(this.colid)+"/documents/1";window.modalView.hide(),window.App.navigate(b,{trigger:!0})}},navigateToDocument:function(a){var b=$(a.target).attr("documentLink");b&&window.App.navigate(b,{trigger:!0})},fillInfo:function(b){var c=this.collection.first(),d=c.get("_id"),e=c.get("_key"),f=c.get("_rev"),g=c.get("_from"),h=c.get("_to");if($("#document-type").text(b),$("#document-id").text(d),$("#document-key").text(e),$("#document-rev").text(f),g&&h){var i=a(g),j=a(h);$("#document-from").text(g),$("#document-from").attr("documentLink",i),$("#document-to").text(h),$("#document-to").attr("documentLink",j)}else $(".edge-info-container").hide()},fillEditor:function(){var a=this.removeReadonlyKeys(this.collection.first().attributes);this.editor.set(a),$(".ace_content").attr("font-size","11pt")},jsonContentChanged:function(){this.enableSaveButton()},render:function(){$(this.el).html(this.template.render({})),this.disableSaveButton(),this.breadcrumb();var a=this,b=document.getElementById("documentEditor"),c={change:function(){a.jsonContentChanged()},search:!0,mode:"tree",modes:["tree","code"],iconlib:"fontawesome4"};return this.editor=new JSONEditor(b,c),this},removeReadonlyKeys:function(a){return _.omit(a,["_key","_id","_from","_to","_rev"])},saveDocument:function(){var a,b;if(void 0===$("#saveDocumentButton").attr("disabled")){try{a=this.editor.get()}catch(c){return this.errorConfirmation(c),void this.disableSaveButton()}if(a=JSON.stringify(a),"document"===this.type){if(b=this.collection.saveDocument(this.colid,this.docid,a),b===!1)return void arangoHelper.arangoError("Document error:","Could not save")}else if("edge"===this.type&&(b=this.collection.saveEdge(this.colid,this.docid,a),b===!1))return void arangoHelper.arangoError("Edge error:","Could not save");b===!0&&(this.successConfirmation(),this.disableSaveButton())}},successConfirmation:function(){arangoHelper.arangoNotification("Document saved."),$("#documentEditor .tree").animate({backgroundColor:"#C6FFB0"},500),$("#documentEditor .tree").animate({backgroundColor:"#FFFFF"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#C6FFB0"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFFFF"},500)},errorConfirmation:function(a){arangoHelper.arangoError("Document editor: ",a),$("#documentEditor .tree").animate({backgroundColor:"#FFB0B0"},500),$("#documentEditor .tree").animate({backgroundColor:"#FFFFF"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFB0B0"},500),$("#documentEditor .ace_content").animate({backgroundColor:"#FFFFF"},500)},enableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!1),$("#saveDocumentButton").addClass("button-success"),$("#saveDocumentButton").removeClass("button-close")},disableSaveButton:function(){$("#saveDocumentButton").prop("disabled",!0),$("#saveDocumentButton").addClass("button-close"),$("#saveDocumentButton").removeClass("button-success")},breadcrumb:function(){var a=window.location.hash.split("/");$("#transparentHeader").append('