arangojs 7.8.0 → 8.0.0

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.
Files changed (138) hide show
  1. package/CHANGELOG.md +264 -3
  2. package/CONTRIBUTING.md +1 -1
  3. package/MIGRATING.md +126 -2
  4. package/README.md +7 -13
  5. package/analyzer.d.ts +531 -253
  6. package/analyzer.d.ts.map +1 -1
  7. package/analyzer.js +9 -8
  8. package/analyzer.js.map +1 -1
  9. package/aql.d.ts +122 -139
  10. package/aql.d.ts.map +1 -1
  11. package/aql.js +146 -148
  12. package/aql.js.map +1 -1
  13. package/collection.d.ts +311 -310
  14. package/collection.d.ts.map +1 -1
  15. package/collection.js +163 -96
  16. package/collection.js.map +1 -1
  17. package/connection.d.ts +65 -52
  18. package/connection.d.ts.map +1 -1
  19. package/connection.js +142 -140
  20. package/connection.js.map +1 -1
  21. package/cursor.d.ts +108 -26
  22. package/cursor.d.ts.map +1 -1
  23. package/cursor.js +24 -23
  24. package/cursor.js.map +1 -1
  25. package/database.d.ts +298 -330
  26. package/database.d.ts.map +1 -1
  27. package/database.js +178 -252
  28. package/database.js.map +1 -1
  29. package/documents.d.ts +3 -4
  30. package/documents.d.ts.map +1 -1
  31. package/documents.js +0 -1
  32. package/documents.js.map +1 -1
  33. package/error.d.ts +3 -6
  34. package/error.d.ts.map +1 -1
  35. package/error.js +5 -7
  36. package/error.js.map +1 -1
  37. package/foxx-manifest.d.ts +7 -8
  38. package/foxx-manifest.d.ts.map +1 -1
  39. package/foxx-manifest.js +1 -1
  40. package/foxx-manifest.js.map +1 -1
  41. package/graph.d.ts +38 -56
  42. package/graph.d.ts.map +1 -1
  43. package/graph.js +59 -63
  44. package/graph.js.map +1 -1
  45. package/index.d.ts +6 -8
  46. package/index.d.ts.map +1 -1
  47. package/index.js +1 -6
  48. package/index.js.map +1 -1
  49. package/indexes.d.ts +348 -127
  50. package/indexes.d.ts.map +1 -1
  51. package/indexes.js +1 -3
  52. package/indexes.js.map +1 -1
  53. package/lib/blob.d.ts +0 -2
  54. package/lib/blob.d.ts.map +1 -1
  55. package/lib/blob.js +0 -1
  56. package/lib/blob.js.map +1 -1
  57. package/lib/btoa.d.ts +1 -3
  58. package/lib/btoa.d.ts.map +1 -1
  59. package/lib/btoa.js +3 -5
  60. package/lib/btoa.js.map +1 -1
  61. package/lib/btoa.web.d.ts +1 -3
  62. package/lib/btoa.web.d.ts.map +1 -1
  63. package/lib/btoa.web.js +4 -6
  64. package/lib/btoa.web.js.map +1 -1
  65. package/lib/codes.d.ts +2 -2
  66. package/lib/codes.d.ts.map +1 -1
  67. package/lib/codes.js +3 -3
  68. package/lib/codes.js.map +1 -1
  69. package/lib/errback.d.ts +0 -2
  70. package/lib/errback.d.ts.map +1 -1
  71. package/lib/errback.js.map +1 -1
  72. package/lib/joinPath.d.ts +0 -2
  73. package/lib/joinPath.d.ts.map +1 -1
  74. package/lib/joinPath.js +0 -2
  75. package/lib/joinPath.js.map +1 -1
  76. package/lib/joinPath.web.d.ts +1 -3
  77. package/lib/joinPath.web.d.ts.map +1 -1
  78. package/lib/joinPath.web.js +7 -4
  79. package/lib/joinPath.web.js.map +1 -1
  80. package/lib/multipart.d.ts +0 -4
  81. package/lib/multipart.d.ts.map +1 -1
  82. package/lib/multipart.js +16 -37
  83. package/lib/multipart.js.map +1 -1
  84. package/lib/multipart.web.d.ts +0 -2
  85. package/lib/multipart.web.d.ts.map +1 -1
  86. package/lib/multipart.web.js +0 -2
  87. package/lib/multipart.web.js.map +1 -1
  88. package/lib/normalizeUrl.d.ts +0 -2
  89. package/lib/normalizeUrl.d.ts.map +1 -1
  90. package/lib/normalizeUrl.js +0 -2
  91. package/lib/normalizeUrl.js.map +1 -1
  92. package/lib/omit.d.ts +1 -3
  93. package/lib/omit.d.ts.map +1 -1
  94. package/lib/omit.js +1 -2
  95. package/lib/omit.js.map +1 -1
  96. package/lib/querystringify.d.ts +4 -0
  97. package/lib/querystringify.d.ts.map +1 -0
  98. package/lib/querystringify.js +20 -0
  99. package/lib/querystringify.js.map +1 -0
  100. package/lib/querystringify.web.d.ts +2 -0
  101. package/lib/querystringify.web.d.ts.map +1 -0
  102. package/lib/querystringify.web.js +30 -0
  103. package/lib/querystringify.web.js.map +1 -0
  104. package/lib/request.d.ts +0 -1
  105. package/lib/request.d.ts.map +1 -1
  106. package/lib/request.js +6 -3
  107. package/lib/request.js.map +1 -1
  108. package/lib/request.node.d.ts +2 -8
  109. package/lib/request.node.d.ts.map +1 -1
  110. package/lib/request.node.js +16 -7
  111. package/lib/request.node.js.map +1 -1
  112. package/lib/request.web.d.ts +2 -3
  113. package/lib/request.web.d.ts.map +1 -1
  114. package/lib/request.web.js +26 -29
  115. package/lib/request.web.js.map +1 -1
  116. package/lib/xhr.d.ts +1 -3
  117. package/lib/xhr.d.ts.map +1 -1
  118. package/lib/xhr.js +0 -2
  119. package/lib/xhr.js.map +1 -1
  120. package/package.json +5 -6
  121. package/route.d.ts +1 -2
  122. package/route.d.ts.map +1 -1
  123. package/route.js +1 -2
  124. package/route.js.map +1 -1
  125. package/transaction.d.ts +31 -6
  126. package/transaction.d.ts.map +1 -1
  127. package/transaction.js +13 -6
  128. package/transaction.js.map +1 -1
  129. package/view.d.ts +237 -181
  130. package/view.d.ts.map +1 -1
  131. package/view.js +17 -25
  132. package/view.js.map +1 -1
  133. package/web.js +1 -1
  134. package/web.js.map +1 -1
  135. package/lib/error.d.ts +0 -18
  136. package/lib/error.d.ts.map +0 -1
  137. package/lib/error.js +0 -18
  138. package/lib/error.js.map +0 -1
package/graph.js CHANGED
@@ -20,7 +20,7 @@ const documents_1 = require("./documents");
20
20
  const error_1 = require("./error");
21
21
  const codes_1 = require("./lib/codes");
22
22
  /**
23
- * Indicates whether the given value represents a {@link Graph}.
23
+ * Indicates whether the given value represents a {@link graph.Graph}.
24
24
  *
25
25
  * @param graph - A value that might be a Graph.
26
26
  */
@@ -30,7 +30,6 @@ function isArangoGraph(graph) {
30
30
  exports.isArangoGraph = isArangoGraph;
31
31
  /**
32
32
  * @internal
33
- * @hidden
34
33
  */
35
34
  function mungeGharialResponse(body, prop) {
36
35
  const { new: newDoc, old: oldDoc, [prop]: doc, ...meta } = body;
@@ -43,28 +42,26 @@ function mungeGharialResponse(body, prop) {
43
42
  }
44
43
  /**
45
44
  * @internal
46
- * @hidden
47
45
  */
48
46
  function coerceEdgeDefinition(options) {
49
47
  const edgeDefinition = {};
50
- edgeDefinition.collection = collection_1.collectionToString(options.collection);
48
+ edgeDefinition.collection = (0, collection_1.collectionToString)(options.collection);
51
49
  edgeDefinition.from = Array.isArray(options.from)
52
50
  ? options.from.map(collection_1.collectionToString)
53
- : [collection_1.collectionToString(options.from)];
51
+ : [(0, collection_1.collectionToString)(options.from)];
54
52
  edgeDefinition.to = Array.isArray(options.to)
55
53
  ? options.to.map(collection_1.collectionToString)
56
- : [collection_1.collectionToString(options.to)];
54
+ : [(0, collection_1.collectionToString)(options.to)];
57
55
  return edgeDefinition;
58
56
  }
59
57
  /**
60
- * Represents a {@link DocumentCollection} of vertices in a {@link Graph}.
58
+ * Represents a {@link collection.DocumentCollection} of vertices in a {@link graph.Graph}.
61
59
  *
62
60
  * @param T - Type to use for document data. Defaults to `any`.
63
61
  */
64
62
  class GraphVertexCollection {
65
63
  /**
66
64
  * @internal
67
- * @hidden
68
65
  */
69
66
  constructor(db, name, graph) {
70
67
  this._db = db;
@@ -87,13 +84,13 @@ class GraphVertexCollection {
87
84
  return this._name;
88
85
  }
89
86
  /**
90
- * A {@link DocumentCollection} instance for this vertex collection.
87
+ * A {@link collection.DocumentCollection} instance for this vertex collection.
91
88
  */
92
89
  get collection() {
93
90
  return this._collection;
94
91
  }
95
92
  /**
96
- * The {@link Graph} instance this vertex collection is bound to.
93
+ * The {@link graph.Graph} instance this vertex collection is bound to.
97
94
  */
98
95
  get graph() {
99
96
  return this._graph;
@@ -122,7 +119,7 @@ class GraphVertexCollection {
122
119
  try {
123
120
  return await this._db.request({
124
121
  method: "HEAD",
125
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
122
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
126
123
  }, () => true);
127
124
  }
128
125
  catch (err) {
@@ -141,7 +138,7 @@ class GraphVertexCollection {
141
138
  if (rev)
142
139
  headers["if-match"] = rev;
143
140
  const result = this._db.request({
144
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
141
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
145
142
  headers,
146
143
  qs,
147
144
  allowDirtyRead,
@@ -152,7 +149,7 @@ class GraphVertexCollection {
152
149
  return await result;
153
150
  }
154
151
  catch (err) {
155
- if (error_1.isArangoError(err) && err.errorNum === codes_1.DOCUMENT_NOT_FOUND) {
152
+ if ((0, error_1.isArangoError)(err) && err.errorNum === codes_1.DOCUMENT_NOT_FOUND) {
156
153
  return null;
157
154
  }
158
155
  throw err;
@@ -176,7 +173,7 @@ class GraphVertexCollection {
176
173
  headers["if-match"] = rev;
177
174
  return this._db.request({
178
175
  method: "PUT",
179
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
176
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
180
177
  body: newValue,
181
178
  qs,
182
179
  headers,
@@ -192,7 +189,7 @@ class GraphVertexCollection {
192
189
  headers["if-match"] = rev;
193
190
  return this._db.request({
194
191
  method: "PATCH",
195
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
192
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
196
193
  body: newValue,
197
194
  qs,
198
195
  headers,
@@ -208,7 +205,7 @@ class GraphVertexCollection {
208
205
  headers["if-match"] = rev;
209
206
  return this._db.request({
210
207
  method: "DELETE",
211
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
208
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/vertex/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
212
209
  qs,
213
210
  headers,
214
211
  }, (res) => mungeGharialResponse(res.body, "removed"));
@@ -216,14 +213,13 @@ class GraphVertexCollection {
216
213
  }
217
214
  exports.GraphVertexCollection = GraphVertexCollection;
218
215
  /**
219
- * Represents a {@link EdgeCollection} of edges in a {@link Graph}.
216
+ * Represents a {@link collection.EdgeCollection} of edges in a {@link graph.Graph}.
220
217
  *
221
218
  * @param T - Type to use for document data. Defaults to `any`.
222
219
  */
223
220
  class GraphEdgeCollection {
224
221
  /**
225
222
  * @internal
226
- * @hidden
227
223
  */
228
224
  constructor(db, name, graph) {
229
225
  this._db = db;
@@ -246,13 +242,13 @@ class GraphEdgeCollection {
246
242
  return this._name;
247
243
  }
248
244
  /**
249
- * A {@link EdgeCollection} instance for this edge collection.
245
+ * A {@link collection.EdgeCollection} instance for this edge collection.
250
246
  */
251
247
  get collection() {
252
248
  return this._collection;
253
249
  }
254
250
  /**
255
- * The {@link Graph} instance this edge collection is bound to.
251
+ * The {@link graph.Graph} instance this edge collection is bound to.
256
252
  */
257
253
  get graph() {
258
254
  return this._graph;
@@ -281,7 +277,7 @@ class GraphEdgeCollection {
281
277
  try {
282
278
  return await this._db.request({
283
279
  method: "HEAD",
284
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
280
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
285
281
  }, () => true);
286
282
  }
287
283
  catch (err) {
@@ -300,7 +296,7 @@ class GraphEdgeCollection {
300
296
  if (rev)
301
297
  headers["if-match"] = rev;
302
298
  const result = this._db.request({
303
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
299
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
304
300
  qs,
305
301
  allowDirtyRead,
306
302
  }, (res) => res.body.edge);
@@ -310,7 +306,7 @@ class GraphEdgeCollection {
310
306
  return await result;
311
307
  }
312
308
  catch (err) {
313
- if (error_1.isArangoError(err) && err.errorNum === codes_1.DOCUMENT_NOT_FOUND) {
309
+ if ((0, error_1.isArangoError)(err) && err.errorNum === codes_1.DOCUMENT_NOT_FOUND) {
314
310
  return null;
315
311
  }
316
312
  throw err;
@@ -334,7 +330,7 @@ class GraphEdgeCollection {
334
330
  headers["if-match"] = rev;
335
331
  return this._db.request({
336
332
  method: "PUT",
337
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
333
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
338
334
  body: newValue,
339
335
  qs,
340
336
  headers,
@@ -350,7 +346,7 @@ class GraphEdgeCollection {
350
346
  headers["if-match"] = rev;
351
347
  return this._db.request({
352
348
  method: "PATCH",
353
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
349
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
354
350
  body: newValue,
355
351
  qs,
356
352
  headers,
@@ -366,7 +362,7 @@ class GraphEdgeCollection {
366
362
  headers["if-match"] = rev;
367
363
  return this._db.request({
368
364
  method: "DELETE",
369
- path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI(documents_1._documentHandle(selector, this._name))}`,
365
+ path: `/_api/gharial/${encodeURIComponent(this.graph.name)}/edge/${encodeURI((0, documents_1._documentHandle)(selector, this._name))}`,
370
366
  qs,
371
367
  headers,
372
368
  }, (res) => mungeGharialResponse(res.body, "removed"));
@@ -374,12 +370,11 @@ class GraphEdgeCollection {
374
370
  }
375
371
  exports.GraphEdgeCollection = GraphEdgeCollection;
376
372
  /**
377
- * Represents a graph in a {@link Database}.
373
+ * Represents a graph in a {@link database.Database}.
378
374
  */
379
375
  class Graph {
380
376
  /**
381
377
  * @internal
382
- * @hidden
383
378
  */
384
379
  constructor(db, name) {
385
380
  this._name = name.normalize("NFC");
@@ -416,7 +411,7 @@ class Graph {
416
411
  return true;
417
412
  }
418
413
  catch (err) {
419
- if (error_1.isArangoError(err) && err.errorNum === codes_1.GRAPH_NOT_FOUND) {
414
+ if ((0, error_1.isArangoError)(err) && err.errorNum === codes_1.GRAPH_NOT_FOUND) {
420
415
  return false;
421
416
  }
422
417
  throw err;
@@ -457,8 +452,8 @@ class Graph {
457
452
  * // graph now exists
458
453
  * ```
459
454
  */
460
- create(edgeDefinitions, options) {
461
- const { orphanCollections, satellites, waitForSync, isSmart, isDisjoint, ...opts } = options !== null && options !== void 0 ? options : {};
455
+ create(edgeDefinitions, options = {}) {
456
+ const { orphanCollections, satellites, waitForSync, isSmart, isDisjoint, ...opts } = options;
462
457
  return this._db.request({
463
458
  method: "POST",
464
459
  path: "/_api/gharial",
@@ -466,12 +461,12 @@ class Graph {
466
461
  orphanCollections: orphanCollections &&
467
462
  (Array.isArray(orphanCollections)
468
463
  ? orphanCollections.map(collection_1.collectionToString)
469
- : [collection_1.collectionToString(orphanCollections)]),
464
+ : [(0, collection_1.collectionToString)(orphanCollections)]),
470
465
  edgeDefinitions: edgeDefinitions.map(coerceEdgeDefinition),
471
466
  isSmart,
472
467
  isDisjoint,
473
468
  name: this._name,
474
- options: { ...opts, satellites: satellites === null || satellites === void 0 ? void 0 : satellites.map(collection_1.collectionToString) },
469
+ options: { ...opts, satellites: satellites?.map(collection_1.collectionToString) },
475
470
  },
476
471
  qs: { waitForSync },
477
472
  }, (res) => res.body.graph);
@@ -498,20 +493,20 @@ class Graph {
498
493
  }, (res) => res.body.removed);
499
494
  }
500
495
  /**
501
- * Returns a {@link GraphVertexCollection} instance for the given collection
496
+ * Returns a {@link graph.GraphVertexCollection} instance for the given collection
502
497
  * name representing the collection in this graph.
503
498
  *
504
499
  * @param T - Type to use for document data. Defaults to `any`.
505
500
  * @param collection - Name of the vertex collection.
506
501
  */
507
502
  vertexCollection(collection) {
508
- return new GraphVertexCollection(this._db, collection_1.collectionToString(collection), this);
503
+ return new GraphVertexCollection(this._db, (0, collection_1.collectionToString)(collection), this);
509
504
  }
510
505
  /**
511
506
  * Fetches all vertex collections of this graph from the database and returns
512
507
  * an array of their names.
513
508
  *
514
- * See also {@link Graph.vertexCollections}.
509
+ * See also {@link graph.Graph#vertexCollections}.
515
510
  *
516
511
  * @example
517
512
  * ```js
@@ -533,9 +528,9 @@ class Graph {
533
528
  }
534
529
  /**
535
530
  * Fetches all vertex collections of this graph from the database and returns
536
- * an array of {@link GraphVertexCollection} instances.
531
+ * an array of {@link graph.GraphVertexCollection} instances.
537
532
  *
538
- * See also {@link Graph.listVertexCollections}.
533
+ * See also {@link graph.Graph#listVertexCollections}.
539
534
  *
540
535
  * @example
541
536
  * ```js
@@ -576,14 +571,14 @@ class Graph {
576
571
  * // The collection "extra-vertices" has been added to the graph
577
572
  * ```
578
573
  */
579
- addVertexCollection(collection, options) {
580
- const { satellites, ...opts } = options !== null && options !== void 0 ? options : {};
574
+ addVertexCollection(collection, options = {}) {
575
+ const { satellites, ...opts } = options;
581
576
  return this._db.request({
582
577
  method: "POST",
583
578
  path: `/_api/gharial/${encodeURIComponent(this._name)}/vertex`,
584
579
  body: {
585
- collection: collection_1.collectionToString(collection),
586
- options: { ...opts, satellites: satellites === null || satellites === void 0 ? void 0 : satellites.map(collection_1.collectionToString) },
580
+ collection: (0, collection_1.collectionToString)(collection),
581
+ options: { ...opts, satellites: satellites?.map(collection_1.collectionToString) },
587
582
  },
588
583
  }, (res) => res.body.graph);
589
584
  }
@@ -612,14 +607,14 @@ class Graph {
612
607
  removeVertexCollection(collection, dropCollection = false) {
613
608
  return this._db.request({
614
609
  method: "DELETE",
615
- path: `/_api/gharial/${encodeURIComponent(this._name)}/vertex/${encodeURIComponent(collection_1.collectionToString(collection))}`,
610
+ path: `/_api/gharial/${encodeURIComponent(this._name)}/vertex/${encodeURIComponent((0, collection_1.collectionToString)(collection))}`,
616
611
  qs: {
617
612
  dropCollection,
618
613
  },
619
614
  }, (res) => res.body.graph);
620
615
  }
621
616
  /**
622
- * Returns a {@link GraphEdgeCollection} instance for the given collection
617
+ * Returns a {@link graph.GraphEdgeCollection} instance for the given collection
623
618
  * name representing the collection in this graph.
624
619
  *
625
620
  * @param T - Type to use for document data. Defaults to `any`.
@@ -642,13 +637,13 @@ class Graph {
642
637
  * ```
643
638
  */
644
639
  edgeCollection(collection) {
645
- return new GraphEdgeCollection(this._db, collection_1.collectionToString(collection), this);
640
+ return new GraphEdgeCollection(this._db, (0, collection_1.collectionToString)(collection), this);
646
641
  }
647
642
  /**
648
643
  * Fetches all edge collections of this graph from the database and returns
649
644
  * an array of their names.
650
645
  *
651
- * See also {@link Graph.edgeCollections}.
646
+ * See also {@link graph.Graph#edgeCollections}.
652
647
  *
653
648
  * @example
654
649
  * ```js
@@ -670,9 +665,9 @@ class Graph {
670
665
  }
671
666
  /**
672
667
  * Fetches all edge collections of this graph from the database and returns
673
- * an array of {@link GraphEdgeCollection} instances.
668
+ * an array of {@link graph.GraphEdgeCollection} instances.
674
669
  *
675
- * See also {@link Graph.listEdgeCollections}.
670
+ * See also {@link graph.Graph#listEdgeCollections}.
676
671
  *
677
672
  * @example
678
673
  * ```js
@@ -713,18 +708,18 @@ class Graph {
713
708
  * // The edge definition has been added to the graph
714
709
  * ```
715
710
  */
716
- addEdgeDefinition(edgeDefinition, options) {
717
- const { satellites, ...opts } = options !== null && options !== void 0 ? options : {};
711
+ addEdgeDefinition(edgeDefinition, options = {}) {
712
+ const { satellites, ...opts } = options;
718
713
  return this._db.request({
719
714
  method: "POST",
720
715
  path: `/_api/gharial/${encodeURIComponent(this._name)}/edge`,
721
716
  body: {
722
717
  ...coerceEdgeDefinition(edgeDefinition),
723
- options: { ...opts, satellites: satellites === null || satellites === void 0 ? void 0 : satellites.map(collection_1.collectionToString) },
718
+ options: { ...opts, satellites: satellites?.map(collection_1.collectionToString) },
724
719
  },
725
720
  }, (res) => res.body.graph);
726
721
  }
727
- replaceEdgeDefinition(collectionOrEdgeDefinitionOptions, edgeDefinitionOrOptions, options) {
722
+ replaceEdgeDefinition(collectionOrEdgeDefinitionOptions, edgeDefinitionOrOptions, options = {}) {
728
723
  let collection = collectionOrEdgeDefinitionOptions;
729
724
  let edgeDefinition = edgeDefinitionOrOptions;
730
725
  if (edgeDefinitionOrOptions &&
@@ -737,13 +732,13 @@ class Graph {
737
732
  collectionOrEdgeDefinitionOptions;
738
733
  collection = edgeDefinition.collection;
739
734
  }
740
- const { satellites, ...opts } = options !== null && options !== void 0 ? options : {};
735
+ const { satellites, ...opts } = options;
741
736
  return this._db.request({
742
737
  method: "PUT",
743
- path: `/_api/gharial/${encodeURIComponent(this._name)}/edge/${encodeURIComponent(collection_1.collectionToString(collection))}`,
738
+ path: `/_api/gharial/${encodeURIComponent(this._name)}/edge/${encodeURIComponent((0, collection_1.collectionToString)(collection))}`,
744
739
  body: {
745
740
  ...coerceEdgeDefinition(edgeDefinition),
746
- options: { ...opts, satellites: satellites === null || satellites === void 0 ? void 0 : satellites.map(collection_1.collectionToString) },
741
+ options: { ...opts, satellites: satellites?.map(collection_1.collectionToString) },
747
742
  },
748
743
  }, (res) => res.body.graph);
749
744
  }
@@ -772,7 +767,7 @@ class Graph {
772
767
  removeEdgeDefinition(collection, dropCollection = false) {
773
768
  return this._db.request({
774
769
  method: "DELETE",
775
- path: `/_api/gharial/${encodeURIComponent(this._name)}/edge/${encodeURIComponent(collection_1.collectionToString(collection))}`,
770
+ path: `/_api/gharial/${encodeURIComponent(this._name)}/edge/${encodeURIComponent((0, collection_1.collectionToString)(collection))}`,
776
771
  qs: {
777
772
  dropCollection,
778
773
  },
@@ -782,7 +777,7 @@ class Graph {
782
777
  * Performs a traversal starting from the given `startVertex` and following
783
778
  * edges contained in this graph.
784
779
  *
785
- * See also {@link EdgeCollection.traversal}.
780
+ * See also {@link collection.EdgeCollection#traversal}.
786
781
  *
787
782
  * @param startVertex - Document `_id` of a vertex in this graph.
788
783
  * @param options - Options for performing the traversal.
@@ -801,12 +796,13 @@ class Graph {
801
796
  * ["y", "vertices/b", "vertices/c"],
802
797
  * ["z", "vertices/c", "vertices/d"],
803
798
  * ]);
804
- * const result = await graph.traversal("vertices/a", {
805
- * direction: "outbound",
806
- * init: "result.vertices = [];",
807
- * visitor: "result.vertices.push(vertex._key);",
808
- * });
809
- * console.log(result.vertices); // ["a", "b", "c", "d"]
799
+ * const startVertex = "vertices/a";
800
+ * const cursor = await db.query(aql`
801
+ * FOR vertex IN OUTBOUND ${startVertex} GRAPH ${graph}
802
+ * RETURN vertex._key
803
+ * `);
804
+ * const result = await cursor.all();
805
+ * console.log(result); // ["a", "b", "c", "d"]
810
806
  * ```
811
807
  */
812
808
  traversal(startVertex, options) {