arangojs 7.6.0 → 7.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/aql.d.ts +1 -1
- package/aql.d.ts.map +1 -1
- package/aql.js.map +1 -1
- package/collection.d.ts +7 -7
- package/collection.d.ts.map +1 -1
- package/collection.js.map +1 -1
- package/cursor.d.ts +12 -6
- package/cursor.d.ts.map +1 -1
- package/cursor.js.map +1 -1
- package/database.d.ts +6 -6
- package/database.d.ts.map +1 -1
- package/database.js.map +1 -1
- package/documents.d.ts +5 -5
- package/documents.d.ts.map +1 -1
- package/documents.js.map +1 -1
- package/graph.d.ts +4 -4
- package/graph.d.ts.map +1 -1
- package/graph.js.map +1 -1
- package/package.json +1 -1
- package/view.d.ts +1 -1
- package/view.d.ts.map +1 -1
- package/view.js.map +1 -1
- package/web.js.map +1 -1
package/documents.d.ts
CHANGED
|
@@ -42,19 +42,19 @@ export declare type EdgeMetadata = {
|
|
|
42
42
|
/**
|
|
43
43
|
* Type representing an object that can be stored in a collection.
|
|
44
44
|
*/
|
|
45
|
-
export declare type DocumentData<T extends Record<string,
|
|
45
|
+
export declare type DocumentData<T extends Record<string, any> = any> = T & Partial<DocumentMetadata> & Partial<EdgeMetadata>;
|
|
46
46
|
/**
|
|
47
47
|
* Type representing an object that can be stored in an edge collection.
|
|
48
48
|
*/
|
|
49
|
-
export declare type EdgeData<T extends Record<string,
|
|
49
|
+
export declare type EdgeData<T extends Record<string, any> = any> = T & Partial<DocumentMetadata> & EdgeMetadata;
|
|
50
50
|
/**
|
|
51
51
|
* Type representing a document stored in a collection.
|
|
52
52
|
*/
|
|
53
|
-
export declare type Document<T extends Record<string,
|
|
53
|
+
export declare type Document<T extends Record<string, any> = any> = T & DocumentMetadata & Partial<EdgeMetadata>;
|
|
54
54
|
/**
|
|
55
55
|
* Type representing an edge document stored in an edge collection.
|
|
56
56
|
*/
|
|
57
|
-
export declare type Edge<T extends Record<string,
|
|
57
|
+
export declare type Edge<T extends Record<string, any> = any> = T & DocumentMetadata & EdgeMetadata;
|
|
58
58
|
/**
|
|
59
59
|
* Type representing patch data for a given object type to represent a payload
|
|
60
60
|
* ArangoDB can apply in a document PATCH request (i.e. a partial update).
|
|
@@ -62,7 +62,7 @@ export declare type Edge<T extends Record<string, unknown> = any> = T & Document
|
|
|
62
62
|
* This differs from `Partial` in that it also applies itself to any nested
|
|
63
63
|
* objects recursively.
|
|
64
64
|
*/
|
|
65
|
-
export declare type Patch<T = Record<string,
|
|
65
|
+
export declare type Patch<T = Record<string, any>> = {
|
|
66
66
|
[K in keyof T]?: T[K] | Patch<T[K]>;
|
|
67
67
|
};
|
|
68
68
|
/**
|
package/documents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,oBAAY,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM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AAG,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;AAErE;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,MAAM,EACtB,MAAM,GAAE,OAAc,GACrB,MAAM,CAqBR"}
|
package/documents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAwGH;;;GAGG;AACH,SAAgB,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,IAAI,QAAQ,CAAC,GAAG,EAAE;YAChB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SACtD;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;SACvD;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;KACH;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC1B,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,cAAc,GAAG,CAAC,EAAE;YACxD,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;SACH;QACD,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AAzBD,0CAyBC","sourcesContent":["/**\n * ```ts\n * import type { Document, Edge } from \"arangojs/documents\";\n * ```\n *\n * The \"documents\" module provides document/edge related types for TypeScript.\n *\n * @packageDocumentation\n */\n\n/**\n * Common ArangoDB metadata properties of a document.\n */\nexport type DocumentMetadata = {\n /**\n * Key of the document, which uniquely identifies the document within its\n * collection.\n */\n _key: string;\n /**\n * Unique ID of the document, which is composed of the collection name\n * and the document `_key`.\n */\n _id: string;\n /**\n * Revision of the document data.\n */\n _rev: string;\n};\n\n/**\n * ArangoDB metadata defining the relations of an edge document.\n */\nexport type EdgeMetadata = {\n /**\n * Unique ID of the document that acts as the edge's start vertex.\n */\n _from: string;\n /**\n * Unique ID of the document that acts as the edge's end vertex.\n */\n _to: string;\n};\n\n/**\n * Type representing an object that can be stored in a collection.\n */\nexport type DocumentData<T extends Record<string,
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAwGH;;;GAGG;AACH,SAAgB,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,IAAI,QAAQ,CAAC,GAAG,EAAE;YAChB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SACtD;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;SACvD;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;KACH;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC1B,IAAI,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,cAAc,GAAG,CAAC,EAAE;YACxD,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;SACH;QACD,OAAO,QAAQ,CAAC;KACjB;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AAzBD,0CAyBC","sourcesContent":["/**\n * ```ts\n * import type { Document, Edge } from \"arangojs/documents\";\n * ```\n *\n * The \"documents\" module provides document/edge related types for TypeScript.\n *\n * @packageDocumentation\n */\n\n/**\n * Common ArangoDB metadata properties of a document.\n */\nexport type DocumentMetadata = {\n /**\n * Key of the document, which uniquely identifies the document within its\n * collection.\n */\n _key: string;\n /**\n * Unique ID of the document, which is composed of the collection name\n * and the document `_key`.\n */\n _id: string;\n /**\n * Revision of the document data.\n */\n _rev: string;\n};\n\n/**\n * ArangoDB metadata defining the relations of an edge document.\n */\nexport type EdgeMetadata = {\n /**\n * Unique ID of the document that acts as the edge's start vertex.\n */\n _from: string;\n /**\n * Unique ID of the document that acts as the edge's end vertex.\n */\n _to: string;\n};\n\n/**\n * Type representing an object that can be stored in a collection.\n */\nexport type DocumentData<T extends Record<string, any> = any> = T &\n Partial<DocumentMetadata> &\n Partial<EdgeMetadata>;\n\n/**\n * Type representing an object that can be stored in an edge collection.\n */\nexport type EdgeData<T extends Record<string, any> = any> = T &\n Partial<DocumentMetadata> &\n EdgeMetadata;\n\n/**\n * Type representing a document stored in a collection.\n */\nexport type Document<T extends Record<string, any> = any> = T &\n DocumentMetadata &\n Partial<EdgeMetadata>;\n\n/**\n * Type representing an edge document stored in an edge collection.\n */\nexport type Edge<T extends Record<string, any> = any> = T &\n DocumentMetadata &\n EdgeMetadata;\n\n/**\n * Type representing patch data for a given object type to represent a payload\n * ArangoDB can apply in a document PATCH request (i.e. a partial update).\n *\n * This differs from `Partial` in that it also applies itself to any nested\n * objects recursively.\n */\nexport type Patch<T = Record<string, any>> = {\n [K in keyof T]?: T[K] | Patch<T[K]>;\n};\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithId = {\n [key: string]: any;\n _id: string;\n};\n\n/**\n * An object with an ArangoDB document `_key` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithKey = {\n [key: string]: any;\n _key: string;\n};\n\n/**\n * A value that can be used to identify a document within a collection in\n * arangojs methods, i.e. a partial ArangoDB document or the value of a\n * document's `_key` or `_id`.\n *\n * See {@link DocumentMetadata}.\n */\nexport type DocumentSelector = ObjectWithId | ObjectWithKey | string;\n\n/**\n * @internal\n * @hidden\n */\nexport function _documentHandle(\n selector: DocumentSelector,\n collectionName: string,\n strict: boolean = true\n): string {\n if (typeof selector !== \"string\") {\n if (selector._id) {\n return _documentHandle(selector._id, collectionName);\n }\n if (selector._key) {\n return _documentHandle(selector._key, collectionName);\n }\n throw new Error(\n \"Document handle must be a string or an object with a _key or _id attribute\"\n );\n }\n if (selector.includes(\"/\")) {\n if (strict && !selector.startsWith(`${collectionName}/`)) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`\n );\n }\n return selector;\n }\n return `${collectionName}/${selector}`;\n}\n"]}
|
package/graph.d.ts
CHANGED
|
@@ -317,7 +317,7 @@ export declare type GraphCreateOptions = {
|
|
|
317
317
|
*
|
|
318
318
|
* @param T - Type to use for document data. Defaults to `any`.
|
|
319
319
|
*/
|
|
320
|
-
export declare class GraphVertexCollection<T extends Record<string,
|
|
320
|
+
export declare class GraphVertexCollection<T extends Record<string, any> = any> implements ArangoCollection {
|
|
321
321
|
protected _db: Database;
|
|
322
322
|
protected _name: string;
|
|
323
323
|
protected _graph: Graph;
|
|
@@ -549,7 +549,7 @@ export declare class GraphVertexCollection<T extends Record<string, unknown> = a
|
|
|
549
549
|
*
|
|
550
550
|
* @param T - Type to use for document data. Defaults to `any`.
|
|
551
551
|
*/
|
|
552
|
-
export declare class GraphEdgeCollection<T extends Record<string,
|
|
552
|
+
export declare class GraphEdgeCollection<T extends Record<string, any> = any> implements ArangoCollection {
|
|
553
553
|
protected _db: Database;
|
|
554
554
|
protected _name: string;
|
|
555
555
|
protected _graph: Graph;
|
|
@@ -872,7 +872,7 @@ export declare class Graph {
|
|
|
872
872
|
* @param T - Type to use for document data. Defaults to `any`.
|
|
873
873
|
* @param collection - Name of the vertex collection.
|
|
874
874
|
*/
|
|
875
|
-
vertexCollection<T extends Record<string,
|
|
875
|
+
vertexCollection<T extends Record<string, any> = any>(collection: string | ArangoCollection): GraphVertexCollection<T>;
|
|
876
876
|
/**
|
|
877
877
|
* Fetches all vertex collections of this graph from the database and returns
|
|
878
878
|
* an array of their names.
|
|
@@ -984,7 +984,7 @@ export declare class Graph {
|
|
|
984
984
|
* const edgeCollection = graphEdgeCollection.collection;
|
|
985
985
|
* ```
|
|
986
986
|
*/
|
|
987
|
-
edgeCollection<T extends Record<string,
|
|
987
|
+
edgeCollection<T extends Record<string, any> = any>(collection: string | ArangoCollection): GraphEdgeCollection<T>;
|
|
988
988
|
/**
|
|
989
989
|
* Fetches all edge collections of this graph from the database and returns
|
|
990
990
|
* an array of their names.
|
package/graph.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EACL,gBAAgB,EAEhB,kBAAkB,EAClB,cAAc,EAEd,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,KAAK,EAEN,MAAM,aAAa,CAAC;AAIrB;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,KAAK,CAExD;AA8BD;;GAEG;AACH,oBAAY,0BAA0B,GAAG;IACvC;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;GAEG;AACH,oBAAY,4BA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AE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CACzB,CAAC;IACJ,CAAC;CACF;AA9jBD,sBA8jBC","sourcesContent":["/**\n * ```ts\n * import type {\n * Graph,\n * GraphVertexCollection,\n * GraphEdgeCollection,\n * } from \"arangojs/graph\";\n * ```\n *\n * The \"graph\" module provides graph related types and interfaces\n * for TypeScript.\n *\n * @packageDocumentation\n */\nimport {\n ArangoCollection,\n collectionToString,\n DocumentCollection,\n EdgeCollection,\n isArangoCollection,\n TraversalOptions,\n} from \"./collection\";\nimport { Headers } from \"./connection\";\nimport { Database } from \"./database\";\nimport {\n Document,\n DocumentData,\n DocumentMetadata,\n DocumentSelector,\n Edge,\n EdgeData,\n Patch,\n _documentHandle,\n} from \"./documents\";\nimport { isArangoError } from \"./error\";\nimport { DOCUMENT_NOT_FOUND, GRAPH_NOT_FOUND } from \"./lib/codes\";\n\n/**\n * Indicates whether the given value represents a {@link Graph}.\n *\n * @param graph - A value that might be a Graph.\n */\nexport function isArangoGraph(graph: any): graph is Graph {\n return Boolean(graph && graph.isArangoGraph);\n}\n\n/**\n * @internal\n * @hidden\n */\nfunction mungeGharialResponse(body: any, prop: \"vertex\" | \"edge\" | \"removed\") {\n const { new: newDoc, old: oldDoc, [prop]: doc, ...meta } = body;\n const result = { ...meta, ...doc };\n if (typeof newDoc !== \"undefined\") result.new = newDoc;\n if (typeof oldDoc !== \"undefined\") result.old = oldDoc;\n return result;\n}\n\n/**\n * @internal\n * @hidden\n */\nfunction coerceEdgeDefinition(options: EdgeDefinitionOptions): EdgeDefinition {\n const edgeDefinition = {} as EdgeDefinition;\n edgeDefinition.collection = collectionToString(options.collection);\n edgeDefinition.from = Array.isArray(options.from)\n ? options.from.map(collectionToString)\n : [collectionToString(options.from)];\n edgeDefinition.to = Array.isArray(options.to)\n ? options.to.map(collectionToString)\n : [collectionToString(options.to)];\n return edgeDefinition;\n}\n\n/**\n * Options for retrieving a document from a graph collection.\n */\nexport type GraphCollectionReadOptions = {\n /**\n * If set to a document revision, the document will only be returned if its\n * `_rev` property matches this value.\n *\n * See also {@link DocumentMetadata}.\n */\n rev?: string;\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n *\n * Default: `false`\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n *\n * Default: `false`\n */\n allowDirtyRead?: boolean;\n};\n\n/**\n * Options for inserting a document into a graph collection.\n */\nexport type GraphCollectionInsertOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n};\n\n/**\n * Options for replacing a document in a graph collection.\n */\nexport type GraphCollectionReplaceOptions = {\n /**\n * If set to a document revision, the document will only be modified if its\n * `_rev` property matches this value.\n *\n * See also {@link DocumentMetadata}.\n */\n rev?: string;\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n};\n\n/**\n * Options for removing a document from a graph collection.\n */\nexport type GraphCollectionRemoveOptions = {\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` property matches this value.\n *\n * See also {@link DocumentMetadata}.\n */\n rev?: string;\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n};\n\n/**\n * Definition of a relation in a {@link Graph}.\n */\nexport type EdgeDefinition = {\n /**\n * Name of the collection containing the edges.\n */\n collection: string;\n /**\n * Array of names of collections containing the start vertices.\n */\n from: string[];\n /**\n * Array of names of collections containing the end vertices.\n */\n to: string[];\n};\n\n/**\n * An edge definition used to define a collection of edges in a {@link Graph}.\n */\nexport type EdgeDefinitionOptions = {\n /**\n * Collection containing the edges.\n */\n collection: string | ArangoCollection;\n /**\n * Collection or collections containing the start vertices.\n */\n from: (string | ArangoCollection)[] | string | ArangoCollection;\n /**\n * Collection or collections containing the end vertices.\n */\n to: (string | ArangoCollection)[] | string | ArangoCollection;\n};\n\n/**\n * General information about a graph.\n */\nexport type GraphInfo = {\n /**\n * Key of the document internally representing this graph.\n *\n * See {@link DocumentMetadata}.\n *\n * @internal\n */\n _key: string;\n /**\n * Unique identifier of the document internally representing this graph.\n *\n * See {@link DocumentMetadata}.\n *\n * @internal\n */\n _id: string;\n /**\n * Revision of the document internally representing this graph.\n *\n * See {@link DocumentMetadata}.\n *\n * @internal\n */\n _rev: string;\n /**\n * Name of the graph.\n */\n name: string;\n /**\n * Definitions for the relations of the graph.\n */\n edgeDefinitions: EdgeDefinition[];\n /**\n * Additional vertex collections. Documents within these collections do not\n * have edges within this graph.\n */\n orphanCollections: string[];\n\n /**\n * (Cluster only.) Number of shards that is used for every collection\n * within this graph.\n */\n numberOfShards?: number;\n /**\n * (Cluster only.) Replication factor used when initially creating\n * collections for this graph.\n */\n replicationFactor?: number;\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n */\n writeConcern?: number;\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n *\n * @deprecated Renamed to `writeConcern` in ArangoDB 3.6.\n */\n minReplicationFactor?: number;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph is a\n * SatelliteGraph.\n */\n isSatellite?: boolean;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph has been\n * created as a SmartGraph.\n */\n isSmart?: boolean;\n /**\n * (Enterprise Edition cluster only.) Attribute containing the shard key\n * value to use for smart sharding.\n */\n smartGraphAttribute?: string;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph has been\n * created as a Disjoint SmartGraph.\n */\n isDisjoint?: boolean;\n};\n\n/**\n * Option for creating a graph.\n */\nexport type GraphCreateOptions = {\n /**\n * If set to `true`, the request will wait until all modifications have been\n * synchronized to disk before returning successfully.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * Additional vertex collections. Documents within these collections do not\n * have edges within this graph.\n */\n orphanCollections?: (string | ArangoCollection)[] | string | ArangoCollection;\n\n /**\n * (Cluster only.) Number of shards that is used for every collection\n * within this graph.\n *\n * Has no effect when `replicationFactor` is set to `\"satellite\"`.\n */\n numberOfShards?: number;\n /**\n * (Cluster only.) Replication factor used when initially creating\n * collections for this graph.\n *\n * Default: `1`\n */\n replicationFactor?: number | \"satellite\";\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n *\n * Has no effect when `replicationFactor` is set to `\"satellite\"`.\n */\n writeConcern?: number;\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n *\n * Has no effect when `replicationFactor` is set to `\"satellite\"`.\n *\n * @deprecated Renamed to `writeConcern` in ArangoDB 3.6.\n */\n minReplicationFactor?: number;\n\n // Extra options\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph will be\n * created as a SmartGraph.\n *\n * Default: `false`\n */\n isSmart?: boolean;\n /**\n * (Enterprise Edition cluster only.) Attribute containing the shard key\n * value to use for smart sharding.\n *\n * **Note**: `isSmart` must be set to `true`.\n */\n smartGraphAttribute?: string;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph will be\n * created as a Disjoint SmartGraph.\n *\n * Default: `false`\n */\n isDisjoint?: boolean;\n};\n\n/**\n * Represents a {@link DocumentCollection} of vertices in a {@link Graph}.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n */\nexport class GraphVertexCollection<T extends Record<string, unknown> = any>\n implements ArangoCollection {\n protected _db: Database;\n protected _name: string;\n protected _graph: Graph;\n protected _collection: DocumentCollection<T>;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string, graph: Graph) {\n this._db = db;\n this._name = name;\n this._graph = graph;\n this._collection = db.collection(name);\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB collection.\n */\n get isArangoCollection(): true {\n return true;\n }\n\n /**\n * Name of the collection.\n */\n get name() {\n return this._name;\n }\n\n /**\n * A {@link DocumentCollection} instance for this vertex collection.\n */\n get collection() {\n return this._collection;\n }\n\n /**\n * The {@link Graph} instance this vertex collection is bound to.\n */\n get graph() {\n return this._graph;\n }\n\n /**\n * Checks whether a vertex matching the given key or id exists in this\n * collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const exists = await collection.vertexExists(\"abc123\");\n * if (!exists) {\n * console.log(\"Vertex does not exist\");\n * }\n * ```\n */\n async vertexExists(selector: DocumentSelector): Promise<boolean> {\n try {\n return await this._db.request(\n {\n method: \"HEAD\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n },\n () => true\n );\n } catch (err) {\n if (err.code === 404) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Retrieves the vertex matching the given key or id.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param options - Options for retrieving the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * try {\n * const vertex = await collection.vertex(\"abc123\");\n * console.log(vertex);\n * } catch (e) {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const vertex = await collection.vertex(\"abc123\", { graceful: true });\n * if (vertex) {\n * console.log(vertex);\n * } else {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n */\n async vertex(\n selector: DocumentSelector,\n options?: GraphCollectionReadOptions\n ): Promise<Document<T>>;\n /**\n * Retrieves the vertex matching the given key or id.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param graceful - If set to `true`, `null` is returned instead of an\n * exception being thrown if the vertex does not exist.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * try {\n * const vertex = await collection.vertex(\"abc123\", false);\n * console.log(vertex);\n * } catch (e) {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const vertex = await collection.vertex(\"abc123\", true);\n * if (vertex) {\n * console.log(vertex);\n * } else {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n */\n async vertex(\n selector: DocumentSelector,\n graceful: boolean\n ): Promise<Document<T>>;\n async vertex(\n selector: DocumentSelector,\n options: boolean | GraphCollectionReadOptions = {}\n ): Promise<Document<T> | null> {\n if (typeof options === \"boolean\") {\n options = { graceful: options };\n }\n const {\n allowDirtyRead = undefined,\n graceful = false,\n rev,\n ...qs\n } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n const result = this._db.request(\n {\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n headers,\n qs,\n allowDirtyRead,\n },\n (res) => res.body.vertex\n );\n if (!graceful) return result;\n try {\n return await result;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === DOCUMENT_NOT_FOUND) {\n return null;\n }\n throw err;\n }\n }\n\n /**\n * Inserts a new vertex with the given `data` into the collection.\n *\n * @param data - The contents of the new vertex.\n * @param options - Options for inserting the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"friends\");\n * const result = await collection.save(\n * { _key: \"a\", color: \"blue\", count: 1 },\n * { returnNew: true }\n * );\n * console.log(result.new.color, result.new.count); // \"blue\" 1\n * ```\n */\n save(\n data: DocumentData<T>,\n options?: GraphCollectionInsertOptions\n ): Promise<DocumentMetadata & { new?: Document<T> }>;\n save(data: DocumentData<T>, options?: GraphCollectionInsertOptions) {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this.graph.name}/vertex/${this._name}`,\n body: data,\n qs: options,\n },\n (res) => mungeGharialResponse(res.body, \"vertex\")\n );\n }\n\n /**\n * Replaces an existing vertex in the collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param newData - The contents of the new vertex.\n * @param options - Options for replacing the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.collection(\"vertices\");\n * await collection.save({ _key: \"a\", color: \"blue\", count: 1 });\n * const result = await collection.replace(\n * \"a\",\n * { color: \"red\" },\n * { returnNew: true }\n * );\n * console.log(result.new.color, result.new.count); // \"red\" undefined\n * ```\n */\n replace(\n selector: DocumentSelector,\n newValue: DocumentData<T>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Document<T>; old?: Document<T> }>;\n replace(\n selector: DocumentSelector,\n newValue: DocumentData<T>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"vertex\")\n );\n }\n\n /**\n * Updates an existing vertex in the collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param newData - The data for updating the vertex.\n * @param options - Options for updating the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.collection(\"vertices\");\n * await collection.save({ _key: \"a\", color: \"blue\", count: 1 });\n * const result = await collection.update(\n * \"a\",\n * { count: 2 },\n * { returnNew: true }\n * );\n * console.log(result.new.color, result.new.count); // \"blue\" 2\n * ```\n */\n update(\n selector: DocumentSelector,\n newValue: Patch<DocumentData<T>>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Document<T>; old?: Document<T> }>;\n update(\n selector: DocumentSelector,\n newValue: Patch<DocumentData<T>>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const headers: Headers = {};\n const { rev, ...qs } = options;\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PATCH\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"vertex\")\n );\n }\n\n /**\n * Removes an existing vertex from the collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param options - Options for removing the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * await collection.remove(\"abc123\");\n * // document with key \"abc123\" deleted\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const doc = await collection.vertex(\"abc123\");\n * await collection.remove(doc);\n * // document with key \"abc123\" deleted\n * ```\n */\n remove(\n selector: DocumentSelector,\n options?: GraphCollectionRemoveOptions\n ): Promise<DocumentMetadata & { old?: Document<T> }>;\n remove(\n selector: DocumentSelector,\n options: GraphCollectionRemoveOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const headers: Headers = {};\n const { rev, ...qs } = options;\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"removed\")\n );\n }\n}\n\n/**\n * Represents a {@link EdgeCollection} of edges in a {@link Graph}.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n */\nexport class GraphEdgeCollection<T extends Record<string, unknown> = any>\n implements ArangoCollection {\n protected _db: Database;\n protected _name: string;\n protected _graph: Graph;\n protected _collection: EdgeCollection<T>;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string, graph: Graph) {\n this._db = db;\n this._name = name;\n this._graph = graph;\n this._collection = db.collection(name);\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB collection.\n */\n get isArangoCollection(): true {\n return true;\n }\n\n /**\n * Name of the collection.\n */\n get name() {\n return this._name;\n }\n\n /**\n * A {@link EdgeCollection} instance for this edge collection.\n */\n get collection() {\n return this._collection;\n }\n\n /**\n * The {@link Graph} instance this edge collection is bound to.\n */\n get graph() {\n return this._graph;\n }\n\n /**\n * Checks whether a edge matching the given key or id exists in this\n * collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * const exists = await collection.edgeExists(\"abc123\");\n * if (!exists) {\n * console.log(\"Edge does not exist\");\n * }\n * ```\n */\n async edgeExists(selector: DocumentSelector): Promise<boolean> {\n try {\n return await this._db.request(\n {\n method: \"HEAD\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n },\n () => true\n );\n } catch (err) {\n if (err.code === 404) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Retrieves the edge matching the given key or id.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection, or if the edge does not exist.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param options - Options for retrieving the edge.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * try {\n * const edge = await collection.edge(\"abc123\");\n * console.log(edge);\n * } catch (e) {\n * console.error(\"Could not find edge\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * const edge = await collection.edge(\"abc123\", { graceful: true });\n * if (edge) {\n * console.log(edge);\n * } else {\n * console.error(\"Edge does not exist\");\n * }\n * ```\n */\n async edge(\n selector: DocumentSelector,\n options?: GraphCollectionReadOptions\n ): Promise<Edge<T>>;\n /**\n * Retrieves the edge matching the given key or id.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection, or if the edge does not exist.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param graceful - If set to `true`, `null` is returned instead of an\n * exception being thrown if the edge does not exist.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * try {\n * const edge = await collection.edge(\"abc123\", false);\n * console.log(edge);\n * } catch (e) {\n * console.error(\"Could not find edge\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * const edge = await collection.edge(\"abc123\", true);\n * if (edge) {\n * console.log(edge);\n * } else {\n * console.error(\"Edge does not exist\");\n * }\n * ```\n */\n async edge(selector: DocumentSelector, graceful: boolean): Promise<Edge<T>>;\n async edge(\n selector: DocumentSelector,\n options: boolean | GraphCollectionReadOptions = {}\n ): Promise<Edge<T> | null> {\n if (typeof options === \"boolean\") {\n options = { graceful: options };\n }\n const {\n allowDirtyRead = undefined,\n graceful = false,\n rev,\n ...qs\n } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n const result = this._db.request(\n {\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n qs,\n allowDirtyRead,\n },\n (res) => res.body.edge\n );\n if (!graceful) return result;\n try {\n return await result;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === DOCUMENT_NOT_FOUND) {\n return null;\n }\n throw err;\n }\n }\n\n /**\n * Inserts a new edge with the given `data` into the collection.\n *\n * @param data - The contents of the new edge.\n * @param options - Options for inserting the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * const result = await collection.save(\n * { _from: \"users/rana\", _to: \"users/mudasir\", active: false },\n * { returnNew: true }\n * );\n * ```\n */\n save(\n data: EdgeData<T>,\n options?: GraphCollectionInsertOptions\n ): Promise<DocumentMetadata & { new?: Edge<T> }>;\n save(data: EdgeData<T>, options?: GraphCollectionInsertOptions) {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this.graph.name}/edge/${this._name}`,\n body: data,\n qs: options,\n },\n (res) => mungeGharialResponse(res.body, \"edge\")\n );\n }\n\n /**\n * Replaces an existing edge in the collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param newData - The contents of the new edge.\n * @param options - Options for replacing the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * await collection.save(\n * {\n * _key: \"musadir\",\n * _from: \"users/rana\",\n * _to: \"users/mudasir\",\n * active: true,\n * best: true\n * }\n * );\n * const result = await collection.replace(\n * \"musadir\",\n * { active: false },\n * { returnNew: true }\n * );\n * console.log(result.new.active, result.new.best); // false undefined\n * ```\n */\n replace(\n selector: DocumentSelector,\n newValue: EdgeData<T>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Edge<T>; old?: Edge<T> }>;\n replace(\n selector: DocumentSelector,\n newValue: EdgeData<T>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"edge\")\n );\n }\n\n /**\n * Updates an existing edge in the collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param newData - The data for updating the edge.\n * @param options - Options for updating the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * await collection.save(\n * {\n * _key: \"musadir\",\n * _from: \"users/rana\",\n * _to: \"users/mudasir\",\n * active: true,\n * best: true\n * }\n * );\n * const result = await collection.update(\n * \"musadir\",\n * { active: false },\n * { returnNew: true }\n * );\n * console.log(result.new.active, result.new.best); // false true\n * ```\n */\n update(\n selector: DocumentSelector,\n newValue: Patch<EdgeData<T>>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Edge<T>; old?: Edge<T> }>;\n update(\n selector: DocumentSelector,\n newValue: Patch<EdgeData<T>>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PATCH\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"edge\")\n );\n }\n\n /**\n * Removes an existing edge from the collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param options - Options for removing the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * const doc = await collection.edge(\"musadir\");\n * await collection.remove(doc);\n * // edge with key \"musadir\" deleted\n * ```\n */\n remove(\n selector: DocumentSelector,\n options?: GraphCollectionRemoveOptions\n ): Promise<DocumentMetadata & { old?: Edge<T> }>;\n remove(\n selector: DocumentSelector,\n options: GraphCollectionRemoveOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"removed\")\n );\n }\n}\n\n/**\n * Represents a graph in a {@link Database}.\n */\nexport class Graph {\n protected _name: string;\n\n protected _db: Database;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string) {\n this._name = name;\n this._db = db;\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB Graph.\n */\n get isArangoGraph(): true {\n return true;\n }\n\n /**\n * Name of the graph.\n */\n get name() {\n return this._name;\n }\n\n /**\n * Checks whether the graph exists.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const result = await graph.exists();\n * // result indicates whether the graph exists\n * ```\n */\n async exists(): Promise<boolean> {\n try {\n await this.get();\n return true;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === GRAPH_NOT_FOUND) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Retrieves general information about the graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const data = await graph.get();\n * // data contains general information about the graph\n * ```\n */\n get(): Promise<GraphInfo> {\n return this._db.request(\n { path: `/_api/gharial/${this._name}` },\n (res) => res.body.graph\n );\n }\n\n /**\n * Creates a graph with the given `edgeDefinitions` and `options` for this\n * graph's name.\n *\n * @param edgeDefinitions - Definitions for the relations of the graph.\n * @param options - Options for creating the graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * // graph now exists\n * ```\n */\n create(\n edgeDefinitions: EdgeDefinitionOptions[],\n options?: GraphCreateOptions\n ): Promise<GraphInfo> {\n const { orphanCollections, waitForSync, isSmart, isDisjoint, ...opts } =\n options || {};\n return this._db.request(\n {\n method: \"POST\",\n path: \"/_api/gharial\",\n body: {\n orphanCollections:\n orphanCollections &&\n (Array.isArray(orphanCollections)\n ? orphanCollections.map(collectionToString)\n : [collectionToString(orphanCollections)]),\n edgeDefinitions: edgeDefinitions.map(coerceEdgeDefinition),\n isSmart,\n isDisjoint,\n name: this._name,\n options: opts,\n },\n qs: { waitForSync },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Deletes the graph from the database.\n *\n * @param dropCollections - If set to `true`, the collections associated with\n * the graph will also be deleted.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * await graph.drop();\n * // the graph \"some-graph\" no longer exists\n * ```\n */\n drop(dropCollections: boolean = false): Promise<boolean> {\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this._name}`,\n qs: { dropCollections },\n },\n (res) => res.body.removed\n );\n }\n\n /**\n * Returns a {@link GraphVertexCollection} instance for the given collection\n * name representing the collection in this graph.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n * @param collection - Name of the vertex collection.\n */\n vertexCollection<T extends Record<string, unknown> = any>(\n collection: string | ArangoCollection\n ): GraphVertexCollection<T> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return new GraphVertexCollection<T>(this._db, collection, this);\n }\n\n /**\n * Fetches all vertex collections of this graph from the database and returns\n * an array of their names.\n *\n * See also {@link Graph.vertexCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const vertexCollectionNames = await graph.listVertexCollections();\n * // [\"start-vertices\", \"end-vertices\"]\n * ```\n */\n listVertexCollections(): Promise<string[]> {\n return this._db.request(\n { path: `/_api/gharial/${this._name}/vertex` },\n (res) => res.body.collections\n );\n }\n\n /**\n * Fetches all vertex collections of this graph from the database and returns\n * an array of {@link GraphVertexCollection} instances.\n *\n * See also {@link Graph.listVertexCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const vertexCollections = await graph.vertexCollections();\n * for (const vertexCollection of vertexCollections) {\n * console.log(vertexCollection.name);\n * // \"start-vertices\"\n * // \"end-vertices\"\n * }\n * ```\n */\n async vertexCollections(): Promise<GraphVertexCollection[]> {\n const names = await this.listVertexCollections();\n return names.map((name) => new GraphVertexCollection(this._db, name, this));\n }\n\n /**\n * Adds the given collection to this graph as a vertex collection.\n *\n * @param collection - Collection to add to the graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * await graph.addVertexCollection(\"more-vertices\");\n * // The collection \"more-vertices\" has been added to the graph\n * const extra = db.collection(\"extra-vertices\");\n * await graph.addVertexCollection(extra);\n * // The collection \"extra-vertices\" has been added to the graph\n * ```\n */\n addVertexCollection(\n collection: string | ArangoCollection\n ): Promise<GraphInfo> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this._name}/vertex`,\n body: { collection },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Removes the given collection from this graph as a vertex collection.\n *\n * @param collection - Collection to remove from the graph.\n * @param dropCollection - If set to `true`, the collection will also be\n * deleted from the database.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.removeVertexCollection(\"start-vertices\");\n * // The collection \"start-vertices\" is no longer part of the graph.\n * ```\n */\n removeVertexCollection(\n collection: string | ArangoCollection,\n dropCollection: boolean = false\n ): Promise<GraphInfo> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this._name}/vertex/${collection}`,\n qs: {\n dropCollection,\n },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Returns a {@link GraphEdgeCollection} instance for the given collection\n * name representing the collection in this graph.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n * @param collection - Name of the edge collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const graphEdgeCollection = graph.edgeCollection(\"edges\");\n * // Access the underlying EdgeCollection API:\n * const edgeCollection = graphEdgeCollection.collection;\n * ```\n */\n edgeCollection<T extends Record<string, unknown> = any>(\n collection: string | ArangoCollection\n ): GraphEdgeCollection<T> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return new GraphEdgeCollection<T>(this._db, collection, this);\n }\n\n /**\n * Fetches all edge collections of this graph from the database and returns\n * an array of their names.\n *\n * See also {@link Graph.edgeCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const edgeCollectionNames = await graph.listEdgeCollections();\n * // [\"edges\"]\n * ```\n */\n listEdgeCollections(): Promise<string[]> {\n return this._db.request(\n { path: `/_api/gharial/${this._name}/edge` },\n (res) => res.body.collections\n );\n }\n\n /**\n * Fetches all edge collections of this graph from the database and returns\n * an array of {@link GraphEdgeCollection} instances.\n *\n * See also {@link Graph.listEdgeCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const graphEdgeCollections = await graph.edgeCollections();\n * for (const collection of graphEdgeCollection) {\n * console.log(collection.name);\n * // \"edges\"\n * }\n * ```\n */\n async edgeCollections(): Promise<GraphEdgeCollection[]> {\n const names = await this.listEdgeCollections();\n return names.map((name) => new GraphEdgeCollection(this._db, name, this));\n }\n\n /**\n * Adds an edge definition to this graph.\n *\n * @param edgeDefinition - Definition of a relation in this graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * await graph.addEdgeDefinition({\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * });\n * // The edge definition has been added to the graph\n * ```\n */\n addEdgeDefinition(edgeDefinition: EdgeDefinitionOptions): Promise<GraphInfo> {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this._name}/edge`,\n body: coerceEdgeDefinition(edgeDefinition),\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Replaces an edge definition in this graph. The existing edge definition\n * for the given edge collection will be overwritten.\n *\n * @param edgeDefinition - Definition of a relation in this graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.replaceEdgeDefinition({\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"other-vertices\"],\n * });\n * // The edge definition for \"edges\" has been replaced\n * ```\n */\n replaceEdgeDefinition(\n edgeDefinition: EdgeDefinitionOptions\n ): Promise<GraphInfo>;\n /**\n * Replaces an edge definition in this graph. The existing edge definition\n * for the given edge collection will be overwritten.\n *\n * @param collection - Edge collection for which to replace the definition.\n * @param edgeDefinition - Definition of a relation in this graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.replaceEdgeDefinition(\"edges\", {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"other-vertices\"],\n * });\n * // The edge definition for \"edges\" has been replaced\n * ```\n */\n replaceEdgeDefinition(\n collection: string | ArangoCollection,\n edgeDefinition: EdgeDefinitionOptions\n ): Promise<GraphInfo>;\n replaceEdgeDefinition(\n collection: string | ArangoCollection | EdgeDefinitionOptions,\n edgeDefinition?: EdgeDefinitionOptions\n ) {\n if (!edgeDefinition) {\n edgeDefinition = collection as EdgeDefinitionOptions;\n collection = edgeDefinition.collection;\n }\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/gharial/${this._name}/edge/${collection}`,\n body: coerceEdgeDefinition(edgeDefinition),\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Removes the edge definition for the given edge collection from this graph.\n *\n * @param collection - Edge collection for which to remove the definition.\n * @param dropCollection - If set to `true`, the collection will also be\n * deleted from the database.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.removeEdgeDefinition(\"edges\");\n * // The edge definition for \"edges\" has been replaced\n * ```\n */\n removeEdgeDefinition(\n collection: string | ArangoCollection,\n dropCollection: boolean = false\n ): Promise<GraphInfo> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this._name}/edge/${collection}`,\n qs: {\n dropCollection,\n },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Performs a traversal starting from the given `startVertex` and following\n * edges contained in this graph.\n *\n * See also {@link EdgeCollection.traversal}.\n *\n * @param startVertex - Document `_id` of a vertex in this graph.\n * @param options - Options for performing the traversal.\n *\n * @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be\n * replaced with AQL queries.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"my-graph\");\n * const collection = graph.edgeCollection(\"edges\").collection;\n * await collection.import([\n * [\"_key\", \"_from\", \"_to\"],\n * [\"x\", \"vertices/a\", \"vertices/b\"],\n * [\"y\", \"vertices/b\", \"vertices/c\"],\n * [\"z\", \"vertices/c\", \"vertices/d\"],\n * ]);\n * const result = await graph.traversal(\"vertices/a\", {\n * direction: \"outbound\",\n * init: \"result.vertices = [];\",\n * visitor: \"result.vertices.push(vertex._key);\",\n * });\n * console.log(result.vertices); // [\"a\", \"b\", \"c\", \"d\"]\n * ```\n */\n traversal(startVertex: string, options?: TraversalOptions): Promise<any> {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/traversal`,\n body: {\n ...options,\n startVertex,\n graphName: this._name,\n },\n },\n (res) => res.body.result\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"graph.js","sourceRoot":"","sources":["../src/graph.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;GAaG;AACH,6CAOsB;AAGtB,2CASqB;AACrB,mCAAwC;AACxC,uCAAkE;AAElE;;;;GAIG;AACH,SAAgB,aAAa,CAAC,KAAU;IACtC,OAAO,OAAO,CAAC,KAA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\n * GraphVertexCollection,\n * GraphEdgeCollection,\n * } from \"arangojs/graph\";\n * ```\n *\n * The \"graph\" module provides graph related types and interfaces\n * for TypeScript.\n *\n * @packageDocumentation\n */\nimport {\n ArangoCollection,\n collectionToString,\n DocumentCollection,\n EdgeCollection,\n isArangoCollection,\n TraversalOptions,\n} from \"./collection\";\nimport { Headers } from \"./connection\";\nimport { Database } from \"./database\";\nimport {\n Document,\n DocumentData,\n DocumentMetadata,\n DocumentSelector,\n Edge,\n EdgeData,\n Patch,\n _documentHandle,\n} from \"./documents\";\nimport { isArangoError } from \"./error\";\nimport { DOCUMENT_NOT_FOUND, GRAPH_NOT_FOUND } from \"./lib/codes\";\n\n/**\n * Indicates whether the given value represents a {@link Graph}.\n *\n * @param graph - A value that might be a Graph.\n */\nexport function isArangoGraph(graph: any): graph is Graph {\n return Boolean(graph && graph.isArangoGraph);\n}\n\n/**\n * @internal\n * @hidden\n */\nfunction mungeGharialResponse(body: any, prop: \"vertex\" | \"edge\" | \"removed\") {\n const { new: newDoc, old: oldDoc, [prop]: doc, ...meta } = body;\n const result = { ...meta, ...doc };\n if (typeof newDoc !== \"undefined\") result.new = newDoc;\n if (typeof oldDoc !== \"undefined\") result.old = oldDoc;\n return result;\n}\n\n/**\n * @internal\n * @hidden\n */\nfunction coerceEdgeDefinition(options: EdgeDefinitionOptions): EdgeDefinition {\n const edgeDefinition = {} as EdgeDefinition;\n edgeDefinition.collection = collectionToString(options.collection);\n edgeDefinition.from = Array.isArray(options.from)\n ? options.from.map(collectionToString)\n : [collectionToString(options.from)];\n edgeDefinition.to = Array.isArray(options.to)\n ? options.to.map(collectionToString)\n : [collectionToString(options.to)];\n return edgeDefinition;\n}\n\n/**\n * Options for retrieving a document from a graph collection.\n */\nexport type GraphCollectionReadOptions = {\n /**\n * If set to a document revision, the document will only be returned if its\n * `_rev` property matches this value.\n *\n * See also {@link DocumentMetadata}.\n */\n rev?: string;\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n *\n * Default: `false`\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n *\n * Default: `false`\n */\n allowDirtyRead?: boolean;\n};\n\n/**\n * Options for inserting a document into a graph collection.\n */\nexport type GraphCollectionInsertOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n};\n\n/**\n * Options for replacing a document in a graph collection.\n */\nexport type GraphCollectionReplaceOptions = {\n /**\n * If set to a document revision, the document will only be modified if its\n * `_rev` property matches this value.\n *\n * See also {@link DocumentMetadata}.\n */\n rev?: string;\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n};\n\n/**\n * Options for removing a document from a graph collection.\n */\nexport type GraphCollectionRemoveOptions = {\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` property matches this value.\n *\n * See also {@link DocumentMetadata}.\n */\n rev?: string;\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n};\n\n/**\n * Definition of a relation in a {@link Graph}.\n */\nexport type EdgeDefinition = {\n /**\n * Name of the collection containing the edges.\n */\n collection: string;\n /**\n * Array of names of collections containing the start vertices.\n */\n from: string[];\n /**\n * Array of names of collections containing the end vertices.\n */\n to: string[];\n};\n\n/**\n * An edge definition used to define a collection of edges in a {@link Graph}.\n */\nexport type EdgeDefinitionOptions = {\n /**\n * Collection containing the edges.\n */\n collection: string | ArangoCollection;\n /**\n * Collection or collections containing the start vertices.\n */\n from: (string | ArangoCollection)[] | string | ArangoCollection;\n /**\n * Collection or collections containing the end vertices.\n */\n to: (string | ArangoCollection)[] | string | ArangoCollection;\n};\n\n/**\n * General information about a graph.\n */\nexport type GraphInfo = {\n /**\n * Key of the document internally representing this graph.\n *\n * See {@link DocumentMetadata}.\n *\n * @internal\n */\n _key: string;\n /**\n * Unique identifier of the document internally representing this graph.\n *\n * See {@link DocumentMetadata}.\n *\n * @internal\n */\n _id: string;\n /**\n * Revision of the document internally representing this graph.\n *\n * See {@link DocumentMetadata}.\n *\n * @internal\n */\n _rev: string;\n /**\n * Name of the graph.\n */\n name: string;\n /**\n * Definitions for the relations of the graph.\n */\n edgeDefinitions: EdgeDefinition[];\n /**\n * Additional vertex collections. Documents within these collections do not\n * have edges within this graph.\n */\n orphanCollections: string[];\n\n /**\n * (Cluster only.) Number of shards that is used for every collection\n * within this graph.\n */\n numberOfShards?: number;\n /**\n * (Cluster only.) Replication factor used when initially creating\n * collections for this graph.\n */\n replicationFactor?: number;\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n */\n writeConcern?: number;\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n *\n * @deprecated Renamed to `writeConcern` in ArangoDB 3.6.\n */\n minReplicationFactor?: number;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph is a\n * SatelliteGraph.\n */\n isSatellite?: boolean;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph has been\n * created as a SmartGraph.\n */\n isSmart?: boolean;\n /**\n * (Enterprise Edition cluster only.) Attribute containing the shard key\n * value to use for smart sharding.\n */\n smartGraphAttribute?: string;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph has been\n * created as a Disjoint SmartGraph.\n */\n isDisjoint?: boolean;\n};\n\n/**\n * Option for creating a graph.\n */\nexport type GraphCreateOptions = {\n /**\n * If set to `true`, the request will wait until all modifications have been\n * synchronized to disk before returning successfully.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * Additional vertex collections. Documents within these collections do not\n * have edges within this graph.\n */\n orphanCollections?: (string | ArangoCollection)[] | string | ArangoCollection;\n\n /**\n * (Cluster only.) Number of shards that is used for every collection\n * within this graph.\n *\n * Has no effect when `replicationFactor` is set to `\"satellite\"`.\n */\n numberOfShards?: number;\n /**\n * (Cluster only.) Replication factor used when initially creating\n * collections for this graph.\n *\n * Default: `1`\n */\n replicationFactor?: number | \"satellite\";\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n *\n * Has no effect when `replicationFactor` is set to `\"satellite\"`.\n */\n writeConcern?: number;\n /**\n * (Cluster only.) Write concern for new collections in the graph.\n *\n * Has no effect when `replicationFactor` is set to `\"satellite\"`.\n *\n * @deprecated Renamed to `writeConcern` in ArangoDB 3.6.\n */\n minReplicationFactor?: number;\n\n // Extra options\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph will be\n * created as a SmartGraph.\n *\n * Default: `false`\n */\n isSmart?: boolean;\n /**\n * (Enterprise Edition cluster only.) Attribute containing the shard key\n * value to use for smart sharding.\n *\n * **Note**: `isSmart` must be set to `true`.\n */\n smartGraphAttribute?: string;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, the graph will be\n * created as a Disjoint SmartGraph.\n *\n * Default: `false`\n */\n isDisjoint?: boolean;\n};\n\n/**\n * Represents a {@link DocumentCollection} of vertices in a {@link Graph}.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n */\nexport class GraphVertexCollection<T extends Record<string, any> = any>\n implements ArangoCollection {\n protected _db: Database;\n protected _name: string;\n protected _graph: Graph;\n protected _collection: DocumentCollection<T>;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string, graph: Graph) {\n this._db = db;\n this._name = name;\n this._graph = graph;\n this._collection = db.collection(name);\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB collection.\n */\n get isArangoCollection(): true {\n return true;\n }\n\n /**\n * Name of the collection.\n */\n get name() {\n return this._name;\n }\n\n /**\n * A {@link DocumentCollection} instance for this vertex collection.\n */\n get collection() {\n return this._collection;\n }\n\n /**\n * The {@link Graph} instance this vertex collection is bound to.\n */\n get graph() {\n return this._graph;\n }\n\n /**\n * Checks whether a vertex matching the given key or id exists in this\n * collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const exists = await collection.vertexExists(\"abc123\");\n * if (!exists) {\n * console.log(\"Vertex does not exist\");\n * }\n * ```\n */\n async vertexExists(selector: DocumentSelector): Promise<boolean> {\n try {\n return await this._db.request(\n {\n method: \"HEAD\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n },\n () => true\n );\n } catch (err) {\n if (err.code === 404) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Retrieves the vertex matching the given key or id.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param options - Options for retrieving the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * try {\n * const vertex = await collection.vertex(\"abc123\");\n * console.log(vertex);\n * } catch (e) {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const vertex = await collection.vertex(\"abc123\", { graceful: true });\n * if (vertex) {\n * console.log(vertex);\n * } else {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n */\n async vertex(\n selector: DocumentSelector,\n options?: GraphCollectionReadOptions\n ): Promise<Document<T>>;\n /**\n * Retrieves the vertex matching the given key or id.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param graceful - If set to `true`, `null` is returned instead of an\n * exception being thrown if the vertex does not exist.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * try {\n * const vertex = await collection.vertex(\"abc123\", false);\n * console.log(vertex);\n * } catch (e) {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const vertex = await collection.vertex(\"abc123\", true);\n * if (vertex) {\n * console.log(vertex);\n * } else {\n * console.error(\"Could not find vertex\");\n * }\n * ```\n */\n async vertex(\n selector: DocumentSelector,\n graceful: boolean\n ): Promise<Document<T>>;\n async vertex(\n selector: DocumentSelector,\n options: boolean | GraphCollectionReadOptions = {}\n ): Promise<Document<T> | null> {\n if (typeof options === \"boolean\") {\n options = { graceful: options };\n }\n const {\n allowDirtyRead = undefined,\n graceful = false,\n rev,\n ...qs\n } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n const result = this._db.request(\n {\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n headers,\n qs,\n allowDirtyRead,\n },\n (res) => res.body.vertex\n );\n if (!graceful) return result;\n try {\n return await result;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === DOCUMENT_NOT_FOUND) {\n return null;\n }\n throw err;\n }\n }\n\n /**\n * Inserts a new vertex with the given `data` into the collection.\n *\n * @param data - The contents of the new vertex.\n * @param options - Options for inserting the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"friends\");\n * const result = await collection.save(\n * { _key: \"a\", color: \"blue\", count: 1 },\n * { returnNew: true }\n * );\n * console.log(result.new.color, result.new.count); // \"blue\" 1\n * ```\n */\n save(\n data: DocumentData<T>,\n options?: GraphCollectionInsertOptions\n ): Promise<DocumentMetadata & { new?: Document<T> }>;\n save(data: DocumentData<T>, options?: GraphCollectionInsertOptions) {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this.graph.name}/vertex/${this._name}`,\n body: data,\n qs: options,\n },\n (res) => mungeGharialResponse(res.body, \"vertex\")\n );\n }\n\n /**\n * Replaces an existing vertex in the collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param newData - The contents of the new vertex.\n * @param options - Options for replacing the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.collection(\"vertices\");\n * await collection.save({ _key: \"a\", color: \"blue\", count: 1 });\n * const result = await collection.replace(\n * \"a\",\n * { color: \"red\" },\n * { returnNew: true }\n * );\n * console.log(result.new.color, result.new.count); // \"red\" undefined\n * ```\n */\n replace(\n selector: DocumentSelector,\n newValue: DocumentData<T>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Document<T>; old?: Document<T> }>;\n replace(\n selector: DocumentSelector,\n newValue: DocumentData<T>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"vertex\")\n );\n }\n\n /**\n * Updates an existing vertex in the collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param newData - The data for updating the vertex.\n * @param options - Options for updating the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.collection(\"vertices\");\n * await collection.save({ _key: \"a\", color: \"blue\", count: 1 });\n * const result = await collection.update(\n * \"a\",\n * { count: 2 },\n * { returnNew: true }\n * );\n * console.log(result.new.color, result.new.count); // \"blue\" 2\n * ```\n */\n update(\n selector: DocumentSelector,\n newValue: Patch<DocumentData<T>>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Document<T>; old?: Document<T> }>;\n update(\n selector: DocumentSelector,\n newValue: Patch<DocumentData<T>>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const headers: Headers = {};\n const { rev, ...qs } = options;\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PATCH\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"vertex\")\n );\n }\n\n /**\n * Removes an existing vertex from the collection.\n *\n * Throws an exception when passed a vertex or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a vertex from this collection).\n * @param options - Options for removing the vertex.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * await collection.remove(\"abc123\");\n * // document with key \"abc123\" deleted\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.vertexCollection(\"vertices\");\n * const doc = await collection.vertex(\"abc123\");\n * await collection.remove(doc);\n * // document with key \"abc123\" deleted\n * ```\n */\n remove(\n selector: DocumentSelector,\n options?: GraphCollectionRemoveOptions\n ): Promise<DocumentMetadata & { old?: Document<T> }>;\n remove(\n selector: DocumentSelector,\n options: GraphCollectionRemoveOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const headers: Headers = {};\n const { rev, ...qs } = options;\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this.graph.name}/vertex/${_documentHandle(\n selector,\n this._name\n )}`,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"removed\")\n );\n }\n}\n\n/**\n * Represents a {@link EdgeCollection} of edges in a {@link Graph}.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n */\nexport class GraphEdgeCollection<T extends Record<string, any> = any>\n implements ArangoCollection {\n protected _db: Database;\n protected _name: string;\n protected _graph: Graph;\n protected _collection: EdgeCollection<T>;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string, graph: Graph) {\n this._db = db;\n this._name = name;\n this._graph = graph;\n this._collection = db.collection(name);\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB collection.\n */\n get isArangoCollection(): true {\n return true;\n }\n\n /**\n * Name of the collection.\n */\n get name() {\n return this._name;\n }\n\n /**\n * A {@link EdgeCollection} instance for this edge collection.\n */\n get collection() {\n return this._collection;\n }\n\n /**\n * The {@link Graph} instance this edge collection is bound to.\n */\n get graph() {\n return this._graph;\n }\n\n /**\n * Checks whether a edge matching the given key or id exists in this\n * collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * const exists = await collection.edgeExists(\"abc123\");\n * if (!exists) {\n * console.log(\"Edge does not exist\");\n * }\n * ```\n */\n async edgeExists(selector: DocumentSelector): Promise<boolean> {\n try {\n return await this._db.request(\n {\n method: \"HEAD\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n },\n () => true\n );\n } catch (err) {\n if (err.code === 404) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Retrieves the edge matching the given key or id.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection, or if the edge does not exist.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param options - Options for retrieving the edge.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * try {\n * const edge = await collection.edge(\"abc123\");\n * console.log(edge);\n * } catch (e) {\n * console.error(\"Could not find edge\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * const edge = await collection.edge(\"abc123\", { graceful: true });\n * if (edge) {\n * console.log(edge);\n * } else {\n * console.error(\"Edge does not exist\");\n * }\n * ```\n */\n async edge(\n selector: DocumentSelector,\n options?: GraphCollectionReadOptions\n ): Promise<Edge<T>>;\n /**\n * Retrieves the edge matching the given key or id.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection, or if the edge does not exist.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param graceful - If set to `true`, `null` is returned instead of an\n * exception being thrown if the edge does not exist.\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * try {\n * const edge = await collection.edge(\"abc123\", false);\n * console.log(edge);\n * } catch (e) {\n * console.error(\"Could not find edge\");\n * }\n * ```\n *\n * @example\n * ```js\n * const graph = db.graph(\"some-graph\");\n * const collection = graph.edgeCollection(\"friends\")\n * const edge = await collection.edge(\"abc123\", true);\n * if (edge) {\n * console.log(edge);\n * } else {\n * console.error(\"Edge does not exist\");\n * }\n * ```\n */\n async edge(selector: DocumentSelector, graceful: boolean): Promise<Edge<T>>;\n async edge(\n selector: DocumentSelector,\n options: boolean | GraphCollectionReadOptions = {}\n ): Promise<Edge<T> | null> {\n if (typeof options === \"boolean\") {\n options = { graceful: options };\n }\n const {\n allowDirtyRead = undefined,\n graceful = false,\n rev,\n ...qs\n } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n const result = this._db.request(\n {\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n qs,\n allowDirtyRead,\n },\n (res) => res.body.edge\n );\n if (!graceful) return result;\n try {\n return await result;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === DOCUMENT_NOT_FOUND) {\n return null;\n }\n throw err;\n }\n }\n\n /**\n * Inserts a new edge with the given `data` into the collection.\n *\n * @param data - The contents of the new edge.\n * @param options - Options for inserting the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * const result = await collection.save(\n * { _from: \"users/rana\", _to: \"users/mudasir\", active: false },\n * { returnNew: true }\n * );\n * ```\n */\n save(\n data: EdgeData<T>,\n options?: GraphCollectionInsertOptions\n ): Promise<DocumentMetadata & { new?: Edge<T> }>;\n save(data: EdgeData<T>, options?: GraphCollectionInsertOptions) {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this.graph.name}/edge/${this._name}`,\n body: data,\n qs: options,\n },\n (res) => mungeGharialResponse(res.body, \"edge\")\n );\n }\n\n /**\n * Replaces an existing edge in the collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param newData - The contents of the new edge.\n * @param options - Options for replacing the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * await collection.save(\n * {\n * _key: \"musadir\",\n * _from: \"users/rana\",\n * _to: \"users/mudasir\",\n * active: true,\n * best: true\n * }\n * );\n * const result = await collection.replace(\n * \"musadir\",\n * { active: false },\n * { returnNew: true }\n * );\n * console.log(result.new.active, result.new.best); // false undefined\n * ```\n */\n replace(\n selector: DocumentSelector,\n newValue: EdgeData<T>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Edge<T>; old?: Edge<T> }>;\n replace(\n selector: DocumentSelector,\n newValue: EdgeData<T>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"edge\")\n );\n }\n\n /**\n * Updates an existing edge in the collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param newData - The data for updating the edge.\n * @param options - Options for updating the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * await collection.save(\n * {\n * _key: \"musadir\",\n * _from: \"users/rana\",\n * _to: \"users/mudasir\",\n * active: true,\n * best: true\n * }\n * );\n * const result = await collection.update(\n * \"musadir\",\n * { active: false },\n * { returnNew: true }\n * );\n * console.log(result.new.active, result.new.best); // false true\n * ```\n */\n update(\n selector: DocumentSelector,\n newValue: Patch<EdgeData<T>>,\n options?: GraphCollectionReplaceOptions\n ): Promise<DocumentMetadata & { new?: Edge<T>; old?: Edge<T> }>;\n update(\n selector: DocumentSelector,\n newValue: Patch<EdgeData<T>>,\n options: GraphCollectionReplaceOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"PATCH\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n body: newValue,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"edge\")\n );\n }\n\n /**\n * Removes an existing edge from the collection.\n *\n * Throws an exception when passed a edge or `_id` from a different\n * collection.\n *\n * @param selector - Document `_key`, `_id` or object with either of those\n * properties (e.g. a edge from this collection).\n * @param options - Options for removing the edge.\n *\n * @example\n * ```js\n * const db = new Database();\n * const collection = db.collection(\"friends\");\n * const doc = await collection.edge(\"musadir\");\n * await collection.remove(doc);\n * // edge with key \"musadir\" deleted\n * ```\n */\n remove(\n selector: DocumentSelector,\n options?: GraphCollectionRemoveOptions\n ): Promise<DocumentMetadata & { old?: Edge<T> }>;\n remove(\n selector: DocumentSelector,\n options: GraphCollectionRemoveOptions = {}\n ) {\n if (typeof options === \"string\") {\n options = { rev: options };\n }\n const { rev, ...qs } = options;\n const headers: Headers = {};\n if (rev) headers[\"if-match\"] = rev;\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this.graph.name}/edge/${_documentHandle(\n selector,\n this._name\n )}`,\n qs,\n headers,\n },\n (res) => mungeGharialResponse(res.body, \"removed\")\n );\n }\n}\n\n/**\n * Represents a graph in a {@link Database}.\n */\nexport class Graph {\n protected _name: string;\n\n protected _db: Database;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string) {\n this._name = name;\n this._db = db;\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB Graph.\n */\n get isArangoGraph(): true {\n return true;\n }\n\n /**\n * Name of the graph.\n */\n get name() {\n return this._name;\n }\n\n /**\n * Checks whether the graph exists.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const result = await graph.exists();\n * // result indicates whether the graph exists\n * ```\n */\n async exists(): Promise<boolean> {\n try {\n await this.get();\n return true;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === GRAPH_NOT_FOUND) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Retrieves general information about the graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const data = await graph.get();\n * // data contains general information about the graph\n * ```\n */\n get(): Promise<GraphInfo> {\n return this._db.request(\n { path: `/_api/gharial/${this._name}` },\n (res) => res.body.graph\n );\n }\n\n /**\n * Creates a graph with the given `edgeDefinitions` and `options` for this\n * graph's name.\n *\n * @param edgeDefinitions - Definitions for the relations of the graph.\n * @param options - Options for creating the graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * // graph now exists\n * ```\n */\n create(\n edgeDefinitions: EdgeDefinitionOptions[],\n options?: GraphCreateOptions\n ): Promise<GraphInfo> {\n const { orphanCollections, waitForSync, isSmart, isDisjoint, ...opts } =\n options || {};\n return this._db.request(\n {\n method: \"POST\",\n path: \"/_api/gharial\",\n body: {\n orphanCollections:\n orphanCollections &&\n (Array.isArray(orphanCollections)\n ? orphanCollections.map(collectionToString)\n : [collectionToString(orphanCollections)]),\n edgeDefinitions: edgeDefinitions.map(coerceEdgeDefinition),\n isSmart,\n isDisjoint,\n name: this._name,\n options: opts,\n },\n qs: { waitForSync },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Deletes the graph from the database.\n *\n * @param dropCollections - If set to `true`, the collections associated with\n * the graph will also be deleted.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * await graph.drop();\n * // the graph \"some-graph\" no longer exists\n * ```\n */\n drop(dropCollections: boolean = false): Promise<boolean> {\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this._name}`,\n qs: { dropCollections },\n },\n (res) => res.body.removed\n );\n }\n\n /**\n * Returns a {@link GraphVertexCollection} instance for the given collection\n * name representing the collection in this graph.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n * @param collection - Name of the vertex collection.\n */\n vertexCollection<T extends Record<string, any> = any>(\n collection: string | ArangoCollection\n ): GraphVertexCollection<T> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return new GraphVertexCollection<T>(this._db, collection, this);\n }\n\n /**\n * Fetches all vertex collections of this graph from the database and returns\n * an array of their names.\n *\n * See also {@link Graph.vertexCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const vertexCollectionNames = await graph.listVertexCollections();\n * // [\"start-vertices\", \"end-vertices\"]\n * ```\n */\n listVertexCollections(): Promise<string[]> {\n return this._db.request(\n { path: `/_api/gharial/${this._name}/vertex` },\n (res) => res.body.collections\n );\n }\n\n /**\n * Fetches all vertex collections of this graph from the database and returns\n * an array of {@link GraphVertexCollection} instances.\n *\n * See also {@link Graph.listVertexCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const vertexCollections = await graph.vertexCollections();\n * for (const vertexCollection of vertexCollections) {\n * console.log(vertexCollection.name);\n * // \"start-vertices\"\n * // \"end-vertices\"\n * }\n * ```\n */\n async vertexCollections(): Promise<GraphVertexCollection[]> {\n const names = await this.listVertexCollections();\n return names.map((name) => new GraphVertexCollection(this._db, name, this));\n }\n\n /**\n * Adds the given collection to this graph as a vertex collection.\n *\n * @param collection - Collection to add to the graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * await graph.addVertexCollection(\"more-vertices\");\n * // The collection \"more-vertices\" has been added to the graph\n * const extra = db.collection(\"extra-vertices\");\n * await graph.addVertexCollection(extra);\n * // The collection \"extra-vertices\" has been added to the graph\n * ```\n */\n addVertexCollection(\n collection: string | ArangoCollection\n ): Promise<GraphInfo> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this._name}/vertex`,\n body: { collection },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Removes the given collection from this graph as a vertex collection.\n *\n * @param collection - Collection to remove from the graph.\n * @param dropCollection - If set to `true`, the collection will also be\n * deleted from the database.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.removeVertexCollection(\"start-vertices\");\n * // The collection \"start-vertices\" is no longer part of the graph.\n * ```\n */\n removeVertexCollection(\n collection: string | ArangoCollection,\n dropCollection: boolean = false\n ): Promise<GraphInfo> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this._name}/vertex/${collection}`,\n qs: {\n dropCollection,\n },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Returns a {@link GraphEdgeCollection} instance for the given collection\n * name representing the collection in this graph.\n *\n * @param T - Type to use for document data. Defaults to `any`.\n * @param collection - Name of the edge collection.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const graphEdgeCollection = graph.edgeCollection(\"edges\");\n * // Access the underlying EdgeCollection API:\n * const edgeCollection = graphEdgeCollection.collection;\n * ```\n */\n edgeCollection<T extends Record<string, any> = any>(\n collection: string | ArangoCollection\n ): GraphEdgeCollection<T> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return new GraphEdgeCollection<T>(this._db, collection, this);\n }\n\n /**\n * Fetches all edge collections of this graph from the database and returns\n * an array of their names.\n *\n * See also {@link Graph.edgeCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const edgeCollectionNames = await graph.listEdgeCollections();\n * // [\"edges\"]\n * ```\n */\n listEdgeCollections(): Promise<string[]> {\n return this._db.request(\n { path: `/_api/gharial/${this._name}/edge` },\n (res) => res.body.collections\n );\n }\n\n /**\n * Fetches all edge collections of this graph from the database and returns\n * an array of {@link GraphEdgeCollection} instances.\n *\n * See also {@link Graph.listEdgeCollections}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * const graphEdgeCollections = await graph.edgeCollections();\n * for (const collection of graphEdgeCollection) {\n * console.log(collection.name);\n * // \"edges\"\n * }\n * ```\n */\n async edgeCollections(): Promise<GraphEdgeCollection[]> {\n const names = await this.listEdgeCollections();\n return names.map((name) => new GraphEdgeCollection(this._db, name, this));\n }\n\n /**\n * Adds an edge definition to this graph.\n *\n * @param edgeDefinition - Definition of a relation in this graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * await graph.addEdgeDefinition({\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * });\n * // The edge definition has been added to the graph\n * ```\n */\n addEdgeDefinition(edgeDefinition: EdgeDefinitionOptions): Promise<GraphInfo> {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/gharial/${this._name}/edge`,\n body: coerceEdgeDefinition(edgeDefinition),\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Replaces an edge definition in this graph. The existing edge definition\n * for the given edge collection will be overwritten.\n *\n * @param edgeDefinition - Definition of a relation in this graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.replaceEdgeDefinition({\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"other-vertices\"],\n * });\n * // The edge definition for \"edges\" has been replaced\n * ```\n */\n replaceEdgeDefinition(\n edgeDefinition: EdgeDefinitionOptions\n ): Promise<GraphInfo>;\n /**\n * Replaces an edge definition in this graph. The existing edge definition\n * for the given edge collection will be overwritten.\n *\n * @param collection - Edge collection for which to replace the definition.\n * @param edgeDefinition - Definition of a relation in this graph.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.replaceEdgeDefinition(\"edges\", {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"other-vertices\"],\n * });\n * // The edge definition for \"edges\" has been replaced\n * ```\n */\n replaceEdgeDefinition(\n collection: string | ArangoCollection,\n edgeDefinition: EdgeDefinitionOptions\n ): Promise<GraphInfo>;\n replaceEdgeDefinition(\n collection: string | ArangoCollection | EdgeDefinitionOptions,\n edgeDefinition?: EdgeDefinitionOptions\n ) {\n if (!edgeDefinition) {\n edgeDefinition = collection as EdgeDefinitionOptions;\n collection = edgeDefinition.collection;\n }\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/gharial/${this._name}/edge/${collection}`,\n body: coerceEdgeDefinition(edgeDefinition),\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Removes the edge definition for the given edge collection from this graph.\n *\n * @param collection - Edge collection for which to remove the definition.\n * @param dropCollection - If set to `true`, the collection will also be\n * deleted from the database.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"some-graph\");\n * const info = await graph.create([\n * {\n * collection: \"edges\",\n * from: [\"start-vertices\"],\n * to: [\"end-vertices\"],\n * },\n * ]);\n * await graph.removeEdgeDefinition(\"edges\");\n * // The edge definition for \"edges\" has been replaced\n * ```\n */\n removeEdgeDefinition(\n collection: string | ArangoCollection,\n dropCollection: boolean = false\n ): Promise<GraphInfo> {\n if (isArangoCollection(collection)) {\n collection = collection.name;\n }\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/gharial/${this._name}/edge/${collection}`,\n qs: {\n dropCollection,\n },\n },\n (res) => res.body.graph\n );\n }\n\n /**\n * Performs a traversal starting from the given `startVertex` and following\n * edges contained in this graph.\n *\n * See also {@link EdgeCollection.traversal}.\n *\n * @param startVertex - Document `_id` of a vertex in this graph.\n * @param options - Options for performing the traversal.\n *\n * @deprecated Simple Queries have been deprecated in ArangoDB 3.4 and can be\n * replaced with AQL queries.\n *\n * @example\n * ```js\n * const db = new Database();\n * const graph = db.graph(\"my-graph\");\n * const collection = graph.edgeCollection(\"edges\").collection;\n * await collection.import([\n * [\"_key\", \"_from\", \"_to\"],\n * [\"x\", \"vertices/a\", \"vertices/b\"],\n * [\"y\", \"vertices/b\", \"vertices/c\"],\n * [\"z\", \"vertices/c\", \"vertices/d\"],\n * ]);\n * const result = await graph.traversal(\"vertices/a\", {\n * direction: \"outbound\",\n * init: \"result.vertices = [];\",\n * visitor: \"result.vertices.push(vertex._key);\",\n * });\n * console.log(result.vertices); // [\"a\", \"b\", \"c\", \"d\"]\n * ```\n */\n traversal(startVertex: string, options?: TraversalOptions): Promise<any> {\n return this._db.request(\n {\n method: \"POST\",\n path: `/_api/traversal`,\n body: {\n ...options,\n startVertex,\n graphName: this._name,\n },\n },\n (res) => res.body.result\n );\n }\n}\n"]}
|
package/package.json
CHANGED
package/view.d.ts
CHANGED
|
@@ -314,7 +314,7 @@ export declare type ArangoSearchViewPropertiesOptions = {
|
|
|
314
314
|
* See {@link ArangoSearchView} for the concrete type representing an
|
|
315
315
|
* ArangoSearch View.
|
|
316
316
|
*/
|
|
317
|
-
export declare class View<PropertiesOptions extends Record<string,
|
|
317
|
+
export declare class View<PropertiesOptions extends Record<string, any> = any, Properties extends Record<string, any> = any> {
|
|
318
318
|
protected _name: string;
|
|
319
319
|
protected _db: Database;
|
|
320
320
|
/**
|
package/view.d.ts.map
CHANGED
|
@@ -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AED;;;;;;;;;;;;;;OAcG;IACH,gBAAgB,CACd,UAA8B;QAE9B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACrB;YACE,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,cAAc,IAAI,CAAC,IAAI,aAAa;YAC1C,IAAI,EAAE,UAAU,IAAI,EAAE;SACvB,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAAiB,CACf,UAA8B;QAE9B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACrB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,IAAI,CAAC,IAAI,aAAa;YAC1C,IAAI,EAAE,UAAU,IAAI,EAAE;SACvB,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACrB;YACE,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,cAAc,IAAI,CAAC,IAAI,EAAE;SAChC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CACzB,CAAC;IACJ,CAAC;CACF;AApOD,oBAoOC","sourcesContent":["/**\n * ```ts\n * import type { ArangoSearchView } from \"arangojs/view\";\n * ```\n *\n * The \"view\" module provides View related types and interfaces for TypeScript.\n *\n * @packageDocumentation\n */\nimport { ArangoResponseMetadata, Dict } from \"./connection\";\nimport { Database } from \"./database\";\nimport { isArangoError } from \"./error\";\nimport { VIEW_NOT_FOUND } from \"./lib/codes\";\n\n/**\n * String values indicating the View type.\n */\nexport enum ViewType {\n ARANGOSEARCH_VIEW = \"arangosearch\",\n}\n\n/**\n * Indicates whether the given value represents a {@link View}.\n *\n * @param view - A value that might be a View.\n */\nexport function isArangoView(view: any): view is View {\n return Boolean(view && view.isArangoView);\n}\n\n/**\n * Generic description of a View.\n */\nexport type ViewDescription = {\n /**\n * A globally unique identifier for this View.\n */\n globallyUniqueId: string;\n /**\n * An identifier for this View.\n */\n id: string;\n /**\n * Name of the View.\n */\n name: string;\n /**\n * Type of the View.\n */\n type: ViewType;\n};\n\n/**\n * A link definition for an ArangoSearch View.\n */\nexport type ArangoSearchViewLink = {\n /**\n * A list of names of Analyzers to apply to values of processed document\n * attributes.\n *\n * Default: `[\"identity\"]`\n */\n analyzers?: string[];\n /**\n * An object mapping names of attributes to process for each document to\n * {@link ArangoSearchViewLink} definitions.\n */\n fields?: Dict<ArangoSearchViewLink | undefined>;\n /**\n * If set to `true`, all document attributes will be processed, otherwise\n * only the attributes in `fields` will be processed.\n *\n * Default: `false`\n */\n includeAllFields?: boolean;\n /**\n * If set to `true`, the position of values in array values will be tracked,\n * otherwise all values in an array will be treated as equal alternatives.\n */\n trackListPositions?: boolean;\n /**\n * Controls how the view should keep track of the attribute values.\n *\n * Default: `\"none\"`\n */\n storeValues?: \"none\" | \"id\";\n};\n\n/**\n * Properties of an ArangoSearch View.\n */\nexport type ArangoSearchViewProperties = {\n /**\n * How many commits to wait between removing unused files.\n */\n cleanupIntervalStep: number;\n /**\n * How long to wait between applying the `consolidationPolicy`.\n */\n consolidationIntervalMsec: number;\n /**\n * Maximum number of writers cached in the pool.\n */\n writebufferIdle: number;\n /**\n * Maximum number of concurrent active writers that perform a transaction.\n */\n writebufferActive: number;\n /**\n * Maximum memory byte size per writer before a writer flush is triggered.\n */\n writebufferSizeMax: number;\n /**\n * Consolidation policy to apply for selecting which segments should be\n * merged.\n */\n consolidationPolicy: BytesAccumConsolidationPolicy | TierConsolidationPolicy;\n /**\n * Attribute path (`field`) for the value of each document that is\n * used for sorting.\n */\n primarySort: {\n /**\n * Attribute path for the value of each document used for\n * sorting.\n */\n field: string;\n /**\n * If set to `\"asc\"`, the primary sorting order is ascending.\n * If set to `\"desc\"`, the primary sorting order is descending.\n */\n direction: \"desc\" | \"asc\";\n }[];\n /**\n * Compression to use for the primary sort data.\n *\n * Default: `\"lz4\"`\n */\n primarySortCompression: PrimarySortCompression;\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n storedValues: {\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n fields: string[];\n }[];\n /**\n * An object mapping names of linked collections to\n * {@link ArangoSearchViewLink} definitions.\n */\n links: Dict<ArangoSearchViewLink | undefined>;\n};\n\n/**\n * Policy to consolidate based on segment byte size and live document count as\n * dictated by the customization attributes.\n */\nexport type BytesAccumConsolidationPolicy = {\n /**\n * Type of consolidation policy.\n */\n type: \"bytes_accum\";\n /**\n * Must be in the range of `0.0` to `1.0`.\n */\n threshold?: number;\n};\n\n/**\n * Policy to consolidate if the sum of all candidate segment byte size is less\n * than the total segment byte size multiplied by a given threshold.\n */\nexport type TierConsolidationPolicy = {\n /**\n * Type of consolidation policy.\n */\n type: \"tier\";\n /**\n * Minimum number of segments that will be evaluated as candidates\n * for consolidation.\n *\n * Default: `1`\n */\n segmentsMin?: number;\n /**\n * Maximum number of segments that will be evaluated as candidates\n * for consolidation.\n *\n * Default: `10`\n */\n segmentsMax?: number;\n /**\n * Maximum allowed size of all consolidated segments.\n *\n * Default: `5368709120`, i.e. 5 GiB\n */\n segmentsBytesMax?: number;\n /**\n * Defines the value to treat all smaller segments as equal for\n * consolidation selection.\n *\n * Default: `2097152`, i.e. 2 MiB\n */\n segmentsBytesFloor?: number;\n /**\n * Minimum score.\n */\n minScore?: number;\n};\n\n/**\n * Compression to use for primary sort data of a View.\n *\n * Default: `\"lz4\"`\n */\nexport type PrimarySortCompression = \"lz4\" | \"none\";\n\n/**\n * Properties of an ArangoSearch View.\n */\nexport type ArangoSearchViewPropertiesOptions = {\n /**\n * How many commits to wait between removing unused files.\n *\n * Default: `2`\n */\n cleanupIntervalStep?: number;\n /**\n * How long to wait between applying the `consolidationPolicy`.\n *\n * Default: `10000`\n */\n consolidationIntervalMsec?: number;\n /**\n * How long to wait between commiting View data store changes and making\n * documents visible to queries.\n *\n * Default: `1000`\n */\n commitIntervalMsec?: number;\n /**\n * Maximum number of writers cached in the pool.\n *\n * Default: `64`\n */\n writebufferIdle?: number;\n /**\n * Maximum number of concurrent active writers that perform a transaction.\n *\n * Default: `0`\n */\n writebufferActive?: number;\n /**\n * Maximum memory byte size per writer before a writer flush is triggered.\n *\n * Default: `33554432`, i.e. 32 MiB\n */\n writebufferSizeMax?: number;\n /**\n * Consolidation policy to apply for selecting which segments should be\n * merged.\n */\n consolidationPolicy?: BytesAccumConsolidationPolicy | TierConsolidationPolicy;\n /**\n * Attribute path (`field`) for the value of each document that will be\n * used for sorting.\n *\n * If `direction` is set to `\"asc\"` or `asc` is set to `true`,\n * the primary sorting order will be ascending.\n *\n * If `direction` is set to `\"desc\"` or `asc` is set to `false`,\n * the primary sorting order will be descending.\n */\n primarySort?: (\n | {\n /**\n * Attribute path for the value of each document to use for\n * sorting.\n */\n field: string;\n /**\n * If set to `\"asc\"`, the primary sorting order will be ascending.\n * If set to `\"desc\"`, the primary sorting order will be descending.\n */\n direction: \"desc\" | \"asc\";\n }\n | {\n /**\n * Attribute path for the value of each document to use for\n * sorting.\n */\n field: string;\n /**\n * If set to `true`, the primary sorting order will be ascending.\n * If set to `false`, the primary sorting order will be descending.\n */\n asc: boolean;\n }\n )[];\n /**\n * Compression to use for the primary sort data.\n *\n * Default: `\"lz4\"`\n */\n primarySortCompression?: PrimarySortCompression;\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n storedValues?: {\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n fields: string[];\n }[];\n /**\n * An object mapping names of linked collections to\n * {@link ArangoSearchViewLink} definitions.\n */\n links?: Dict<ArangoSearchViewLink | undefined>;\n};\n\n/**\n * Represents a View in a {@link Database}.\n *\n * See {@link ArangoSearchView} for the concrete type representing an\n * ArangoSearch View.\n */\nexport class View<\n PropertiesOptions extends Record<string, unknown> = any,\n Properties extends Record<string, unknown> = any\n> {\n protected _name: string;\n protected _db: Database;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string) {\n this._db = db;\n this._name = name;\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB View.\n */\n get isArangoView(): true {\n return true;\n }\n\n /**\n * Name of the View.\n */\n get name() {\n return this._name;\n }\n\n /**\n * Retrieves general information about the View.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const data = await view.get();\n * // data contains general information about the View\n * ```\n */\n get(): Promise<ViewDescription & ArangoResponseMetadata> {\n return this._db.request(\n { path: `/_api/view/${this.name}` },\n (res) => res.body\n );\n }\n\n /**\n * Checks whether the View exists.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const exists = await view.exists();\n * console.log(exists); // indicates whether the View exists\n * ```\n */\n async exists(): Promise<boolean> {\n try {\n await this.get();\n return true;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === VIEW_NOT_FOUND) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Creates a View with the given `options` and the instance's name.\n *\n * See also {@link Database.createView}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"potatoes\");\n * await view.create();\n * // the ArangoSearch View \"potatoes\" now exists\n * ```\n */\n create(\n options?: PropertiesOptions & { type: ViewType }\n ): Promise<ViewDescription & Properties> {\n return this._db.request(\n {\n method: \"POST\",\n path: \"/_api/view\",\n body: {\n type: ViewType.ARANGOSEARCH_VIEW,\n ...(options || {}),\n name: this.name,\n },\n },\n (res) => res.body\n );\n }\n\n /**\n * Renames the View and updates the instance's `name` to `newName`.\n *\n * Additionally removes the instance from the {@link Database}'s internal\n * cache.\n *\n * **Note**: Renaming Views may not be supported when ArangoDB is\n * running in a cluster configuration.\n *\n * @param newName - The new name of the View.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view1 = db.view(\"some-view\");\n * await view1.rename(\"other-view\");\n * const view2 = db.view(\"some-view\");\n * const view3 = db.view(\"other-view\");\n * // Note all three View instances are different objects but\n * // view1 and view3 represent the same ArangoDB view!\n * ```\n */\n async rename(\n newName: string\n ): Promise<ViewDescription & ArangoResponseMetadata> {\n const result = this._db.renameView(this._name, newName);\n this._name = newName;\n return result;\n }\n\n /**\n * Retrieves the View's properties.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const data = await view.properties();\n * // data contains the View's properties\n * ```\n */\n properties(): Promise<ViewDescription & Properties & ArangoResponseMetadata> {\n return this._db.request(\n { path: `/_api/view/${this.name}/properties` },\n (res) => res.body\n );\n }\n\n /**\n * Updates the properties of the View.\n *\n * @param properties - Properties of the View to update.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const result = await view.updateProperties({\n * consolidationIntervalMsec: 234\n * });\n * console.log(result.consolidationIntervalMsec); // 234\n * ```\n */\n updateProperties(\n properties?: PropertiesOptions\n ): Promise<ViewDescription & Properties> {\n return this._db.request(\n {\n method: \"PATCH\",\n path: `/_api/view/${this.name}/properties`,\n body: properties || {},\n },\n (res) => res.body\n );\n }\n\n /**\n * Replaces the properties of the View.\n *\n * @param properties - New properties of the View.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const result = await view.replaceProperties({\n * consolidationIntervalMsec: 234\n * });\n * console.log(result.consolidationIntervalMsec); // 234\n * ```\n */\n replaceProperties(\n properties?: PropertiesOptions\n ): Promise<ViewDescription & Properties> {\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/view/${this.name}/properties`,\n body: properties || {},\n },\n (res) => res.body\n );\n }\n\n /**\n * Deletes the View from the database.\n *\n * @example\n *\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * await view.drop();\n * // the View \"some-view\" no longer exists\n * ```\n */\n drop(): Promise<boolean> {\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/view/${this.name}`,\n },\n (res) => res.body.result\n );\n }\n}\n\n/**\n * Represents an ArangoSearch View in a {@link Database}.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ArangoSearchView\n extends View<\n ArangoSearchViewPropertiesOptions,\n ArangoSearchViewProperties & { type: ViewType.ARANGOSEARCH_VIEW }\n > {}\n"]}
|
|
1
|
+
{"version":3,"file":"view.js","sourceRoot":"","sources":["../src/view.ts"],"names":[],"mappings":";;;AAWA,mCAAwC;AACxC,uCAA6C;AAE7C;;GAEG;AACH,IAAY,QAEX;AAFD,WAAY,QAAQ;IAClB,8CAAkC,CAAA;AACpC,CAAC,EAFW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAEnB;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAS;IACpC,OAAO,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;AAC5C,CAAC;AAFD,oCAEC;AA2SD;;;;;GAKG;AACH,MAAa,IAAI;IAOf;;;OAGG;IACH,YAAY,EAAY,EAAE,IAAY;QACpC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;OAIG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;OAEG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACrB,EAAE,IAAI,EAAE,cAAc,IAAI,CAAC,IAAI,EAAE,EAAE,EACnC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,MAAM;QACV,IAAI;YACF,MAAM,IAAI,CAAC,GAAG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I,EAAE,UAAU,IAAI,EAAE;SACvB,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,iBAAiB,CACf,UAA8B;QAE9B,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACrB;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,cAAc,IAAI,CAAC,IAAI,aAAa;YAC1C,IAAI,EAAE,UAAU,IAAI,EAAE;SACvB,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAClB,CAAC;IACJ,CAAC;IAED;;;;;;;;;;;OAWG;IACH,IAAI;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CACrB;YACE,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,cAAc,IAAI,CAAC,IAAI,EAAE;SAChC,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CACzB,CAAC;IACJ,CAAC;CACF;AApOD,oBAoOC","sourcesContent":["/**\n * ```ts\n * import type { ArangoSearchView } from \"arangojs/view\";\n * ```\n *\n * The \"view\" module provides View related types and interfaces for TypeScript.\n *\n * @packageDocumentation\n */\nimport { ArangoResponseMetadata, Dict } from \"./connection\";\nimport { Database } from \"./database\";\nimport { isArangoError } from \"./error\";\nimport { VIEW_NOT_FOUND } from \"./lib/codes\";\n\n/**\n * String values indicating the View type.\n */\nexport enum ViewType {\n ARANGOSEARCH_VIEW = \"arangosearch\",\n}\n\n/**\n * Indicates whether the given value represents a {@link View}.\n *\n * @param view - A value that might be a View.\n */\nexport function isArangoView(view: any): view is View {\n return Boolean(view && view.isArangoView);\n}\n\n/**\n * Generic description of a View.\n */\nexport type ViewDescription = {\n /**\n * A globally unique identifier for this View.\n */\n globallyUniqueId: string;\n /**\n * An identifier for this View.\n */\n id: string;\n /**\n * Name of the View.\n */\n name: string;\n /**\n * Type of the View.\n */\n type: ViewType;\n};\n\n/**\n * A link definition for an ArangoSearch View.\n */\nexport type ArangoSearchViewLink = {\n /**\n * A list of names of Analyzers to apply to values of processed document\n * attributes.\n *\n * Default: `[\"identity\"]`\n */\n analyzers?: string[];\n /**\n * An object mapping names of attributes to process for each document to\n * {@link ArangoSearchViewLink} definitions.\n */\n fields?: Dict<ArangoSearchViewLink | undefined>;\n /**\n * If set to `true`, all document attributes will be processed, otherwise\n * only the attributes in `fields` will be processed.\n *\n * Default: `false`\n */\n includeAllFields?: boolean;\n /**\n * If set to `true`, the position of values in array values will be tracked,\n * otherwise all values in an array will be treated as equal alternatives.\n */\n trackListPositions?: boolean;\n /**\n * Controls how the view should keep track of the attribute values.\n *\n * Default: `\"none\"`\n */\n storeValues?: \"none\" | \"id\";\n};\n\n/**\n * Properties of an ArangoSearch View.\n */\nexport type ArangoSearchViewProperties = {\n /**\n * How many commits to wait between removing unused files.\n */\n cleanupIntervalStep: number;\n /**\n * How long to wait between applying the `consolidationPolicy`.\n */\n consolidationIntervalMsec: number;\n /**\n * Maximum number of writers cached in the pool.\n */\n writebufferIdle: number;\n /**\n * Maximum number of concurrent active writers that perform a transaction.\n */\n writebufferActive: number;\n /**\n * Maximum memory byte size per writer before a writer flush is triggered.\n */\n writebufferSizeMax: number;\n /**\n * Consolidation policy to apply for selecting which segments should be\n * merged.\n */\n consolidationPolicy: BytesAccumConsolidationPolicy | TierConsolidationPolicy;\n /**\n * Attribute path (`field`) for the value of each document that is\n * used for sorting.\n */\n primarySort: {\n /**\n * Attribute path for the value of each document used for\n * sorting.\n */\n field: string;\n /**\n * If set to `\"asc\"`, the primary sorting order is ascending.\n * If set to `\"desc\"`, the primary sorting order is descending.\n */\n direction: \"desc\" | \"asc\";\n }[];\n /**\n * Compression to use for the primary sort data.\n *\n * Default: `\"lz4\"`\n */\n primarySortCompression: PrimarySortCompression;\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n storedValues: {\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n fields: string[];\n }[];\n /**\n * An object mapping names of linked collections to\n * {@link ArangoSearchViewLink} definitions.\n */\n links: Dict<ArangoSearchViewLink | undefined>;\n};\n\n/**\n * Policy to consolidate based on segment byte size and live document count as\n * dictated by the customization attributes.\n */\nexport type BytesAccumConsolidationPolicy = {\n /**\n * Type of consolidation policy.\n */\n type: \"bytes_accum\";\n /**\n * Must be in the range of `0.0` to `1.0`.\n */\n threshold?: number;\n};\n\n/**\n * Policy to consolidate if the sum of all candidate segment byte size is less\n * than the total segment byte size multiplied by a given threshold.\n */\nexport type TierConsolidationPolicy = {\n /**\n * Type of consolidation policy.\n */\n type: \"tier\";\n /**\n * Minimum number of segments that will be evaluated as candidates\n * for consolidation.\n *\n * Default: `1`\n */\n segmentsMin?: number;\n /**\n * Maximum number of segments that will be evaluated as candidates\n * for consolidation.\n *\n * Default: `10`\n */\n segmentsMax?: number;\n /**\n * Maximum allowed size of all consolidated segments.\n *\n * Default: `5368709120`, i.e. 5 GiB\n */\n segmentsBytesMax?: number;\n /**\n * Defines the value to treat all smaller segments as equal for\n * consolidation selection.\n *\n * Default: `2097152`, i.e. 2 MiB\n */\n segmentsBytesFloor?: number;\n /**\n * Minimum score.\n */\n minScore?: number;\n};\n\n/**\n * Compression to use for primary sort data of a View.\n *\n * Default: `\"lz4\"`\n */\nexport type PrimarySortCompression = \"lz4\" | \"none\";\n\n/**\n * Properties of an ArangoSearch View.\n */\nexport type ArangoSearchViewPropertiesOptions = {\n /**\n * How many commits to wait between removing unused files.\n *\n * Default: `2`\n */\n cleanupIntervalStep?: number;\n /**\n * How long to wait between applying the `consolidationPolicy`.\n *\n * Default: `10000`\n */\n consolidationIntervalMsec?: number;\n /**\n * How long to wait between commiting View data store changes and making\n * documents visible to queries.\n *\n * Default: `1000`\n */\n commitIntervalMsec?: number;\n /**\n * Maximum number of writers cached in the pool.\n *\n * Default: `64`\n */\n writebufferIdle?: number;\n /**\n * Maximum number of concurrent active writers that perform a transaction.\n *\n * Default: `0`\n */\n writebufferActive?: number;\n /**\n * Maximum memory byte size per writer before a writer flush is triggered.\n *\n * Default: `33554432`, i.e. 32 MiB\n */\n writebufferSizeMax?: number;\n /**\n * Consolidation policy to apply for selecting which segments should be\n * merged.\n */\n consolidationPolicy?: BytesAccumConsolidationPolicy | TierConsolidationPolicy;\n /**\n * Attribute path (`field`) for the value of each document that will be\n * used for sorting.\n *\n * If `direction` is set to `\"asc\"` or `asc` is set to `true`,\n * the primary sorting order will be ascending.\n *\n * If `direction` is set to `\"desc\"` or `asc` is set to `false`,\n * the primary sorting order will be descending.\n */\n primarySort?: (\n | {\n /**\n * Attribute path for the value of each document to use for\n * sorting.\n */\n field: string;\n /**\n * If set to `\"asc\"`, the primary sorting order will be ascending.\n * If set to `\"desc\"`, the primary sorting order will be descending.\n */\n direction: \"desc\" | \"asc\";\n }\n | {\n /**\n * Attribute path for the value of each document to use for\n * sorting.\n */\n field: string;\n /**\n * If set to `true`, the primary sorting order will be ascending.\n * If set to `false`, the primary sorting order will be descending.\n */\n asc: boolean;\n }\n )[];\n /**\n * Compression to use for the primary sort data.\n *\n * Default: `\"lz4\"`\n */\n primarySortCompression?: PrimarySortCompression;\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n storedValues?: {\n /**\n * Attribute paths for which values should be stored in the view index\n * in addition to those used for sorting via `primarySort`.\n */\n fields: string[];\n }[];\n /**\n * An object mapping names of linked collections to\n * {@link ArangoSearchViewLink} definitions.\n */\n links?: Dict<ArangoSearchViewLink | undefined>;\n};\n\n/**\n * Represents a View in a {@link Database}.\n *\n * See {@link ArangoSearchView} for the concrete type representing an\n * ArangoSearch View.\n */\nexport class View<\n PropertiesOptions extends Record<string, any> = any,\n Properties extends Record<string, any> = any\n> {\n protected _name: string;\n protected _db: Database;\n\n /**\n * @internal\n * @hidden\n */\n constructor(db: Database, name: string) {\n this._db = db;\n this._name = name;\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB View.\n */\n get isArangoView(): true {\n return true;\n }\n\n /**\n * Name of the View.\n */\n get name() {\n return this._name;\n }\n\n /**\n * Retrieves general information about the View.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const data = await view.get();\n * // data contains general information about the View\n * ```\n */\n get(): Promise<ViewDescription & ArangoResponseMetadata> {\n return this._db.request(\n { path: `/_api/view/${this.name}` },\n (res) => res.body\n );\n }\n\n /**\n * Checks whether the View exists.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const exists = await view.exists();\n * console.log(exists); // indicates whether the View exists\n * ```\n */\n async exists(): Promise<boolean> {\n try {\n await this.get();\n return true;\n } catch (err) {\n if (isArangoError(err) && err.errorNum === VIEW_NOT_FOUND) {\n return false;\n }\n throw err;\n }\n }\n\n /**\n * Creates a View with the given `options` and the instance's name.\n *\n * See also {@link Database.createView}.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"potatoes\");\n * await view.create();\n * // the ArangoSearch View \"potatoes\" now exists\n * ```\n */\n create(\n options?: PropertiesOptions & { type: ViewType }\n ): Promise<ViewDescription & Properties> {\n return this._db.request(\n {\n method: \"POST\",\n path: \"/_api/view\",\n body: {\n type: ViewType.ARANGOSEARCH_VIEW,\n ...(options || {}),\n name: this.name,\n },\n },\n (res) => res.body\n );\n }\n\n /**\n * Renames the View and updates the instance's `name` to `newName`.\n *\n * Additionally removes the instance from the {@link Database}'s internal\n * cache.\n *\n * **Note**: Renaming Views may not be supported when ArangoDB is\n * running in a cluster configuration.\n *\n * @param newName - The new name of the View.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view1 = db.view(\"some-view\");\n * await view1.rename(\"other-view\");\n * const view2 = db.view(\"some-view\");\n * const view3 = db.view(\"other-view\");\n * // Note all three View instances are different objects but\n * // view1 and view3 represent the same ArangoDB view!\n * ```\n */\n async rename(\n newName: string\n ): Promise<ViewDescription & ArangoResponseMetadata> {\n const result = this._db.renameView(this._name, newName);\n this._name = newName;\n return result;\n }\n\n /**\n * Retrieves the View's properties.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const data = await view.properties();\n * // data contains the View's properties\n * ```\n */\n properties(): Promise<ViewDescription & Properties & ArangoResponseMetadata> {\n return this._db.request(\n { path: `/_api/view/${this.name}/properties` },\n (res) => res.body\n );\n }\n\n /**\n * Updates the properties of the View.\n *\n * @param properties - Properties of the View to update.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const result = await view.updateProperties({\n * consolidationIntervalMsec: 234\n * });\n * console.log(result.consolidationIntervalMsec); // 234\n * ```\n */\n updateProperties(\n properties?: PropertiesOptions\n ): Promise<ViewDescription & Properties> {\n return this._db.request(\n {\n method: \"PATCH\",\n path: `/_api/view/${this.name}/properties`,\n body: properties || {},\n },\n (res) => res.body\n );\n }\n\n /**\n * Replaces the properties of the View.\n *\n * @param properties - New properties of the View.\n *\n * @example\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * const result = await view.replaceProperties({\n * consolidationIntervalMsec: 234\n * });\n * console.log(result.consolidationIntervalMsec); // 234\n * ```\n */\n replaceProperties(\n properties?: PropertiesOptions\n ): Promise<ViewDescription & Properties> {\n return this._db.request(\n {\n method: \"PUT\",\n path: `/_api/view/${this.name}/properties`,\n body: properties || {},\n },\n (res) => res.body\n );\n }\n\n /**\n * Deletes the View from the database.\n *\n * @example\n *\n * ```js\n * const db = new Database();\n * const view = db.view(\"some-view\");\n * await view.drop();\n * // the View \"some-view\" no longer exists\n * ```\n */\n drop(): Promise<boolean> {\n return this._db.request(\n {\n method: \"DELETE\",\n path: `/_api/view/${this.name}`,\n },\n (res) => res.body.result\n );\n }\n}\n\n/**\n * Represents an ArangoSearch View in a {@link Database}.\n */\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface ArangoSearchView\n extends View<\n ArangoSearchViewPropertiesOptions,\n ArangoSearchViewProperties & { type: ViewType.ARANGOSEARCH_VIEW }\n > {}\n"]}
|