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/database.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  /// <reference types="node" />
2
+ /// <reference types="node" />
2
3
  /**
3
4
  * ```js
4
5
  * import { Database } from "arangojs/database";
@@ -15,15 +16,15 @@ import { Readable } from "stream";
15
16
  import { Analyzer, AnalyzerDescription, CreateAnalyzerOptions } from "./analyzer";
16
17
  import { AqlLiteral, AqlQuery } from "./aql";
17
18
  import { ArangoCollection, Collection, CollectionMetadata, CollectionType, CreateCollectionOptions, DocumentCollection, EdgeCollection } from "./collection";
18
- import { ArangoResponseMetadata, Config, Connection, Dict, Headers, RequestOptions } from "./connection";
19
+ import { ArangoApiResponse, Config, Connection, Headers, RequestOptions } from "./connection";
19
20
  import { ArrayCursor } from "./cursor";
20
21
  import { FoxxManifest } from "./foxx-manifest";
21
- import { EdgeDefinitionOptions, Graph, GraphCreateOptions, GraphInfo } from "./graph";
22
+ import { CreateGraphOptions, EdgeDefinitionOptions, Graph, GraphInfo } from "./graph";
22
23
  import { Blob } from "./lib/blob";
23
24
  import { ArangojsResponse } from "./lib/request";
24
25
  import { Route } from "./route";
25
26
  import { Transaction } from "./transaction";
26
- import { ArangoSearchView, ArangoSearchViewPropertiesOptions, ViewDescription } from "./view";
27
+ import { CreateViewOptions, View, ViewDescription } from "./view";
27
28
  /**
28
29
  * Indicates whether the given value represents a {@link Database}.
29
30
  *
@@ -43,9 +44,6 @@ export declare type TransactionCollections = {
43
44
  /**
44
45
  * An array of collections or a single collection that will be read from or
45
46
  * written to during the transaction.
46
- *
47
- * If ArangoDB is using the MMFiles storage engine, this option behaves
48
- * exactly like `exclusive`, i.e. no other writes will run in parallel.
49
47
  */
50
48
  write?: (string | ArangoCollection)[] | string | ArangoCollection;
51
49
  /**
@@ -66,6 +64,12 @@ export declare type TransactionOptions = {
66
64
  * Default: `true`.
67
65
  */
68
66
  allowImplicit?: boolean;
67
+ /**
68
+ * If set to `true`, the request will explicitly permit ArangoDB to return a
69
+ * potentially dirty or stale result and arangojs will load balance the
70
+ * request without distinguishing between leaders and followers.
71
+ */
72
+ allowDirtyRead?: boolean;
69
73
  /**
70
74
  * Determines whether to force the transaction to write all data to disk
71
75
  * before returning.
@@ -80,25 +84,11 @@ export declare type TransactionOptions = {
80
84
  * (RocksDB only.) Determines the transaction size limit in bytes.
81
85
  */
82
86
  maxTransactionSize?: number;
83
- /**
84
- * (RocksDB only.) Determines the maximum number of operations after which an
85
- * intermediate commit is performed automatically.
86
- *
87
- * @deprecated Removed in ArangoDB 3.4.
88
- */
89
- intermediateCommitCount?: number;
90
- /**
91
- * (RocksDB only.) Determine the maximum total size of operations after which
92
- * an intermediate commit is performed automatically.
93
- *
94
- * @deprecated Removed in ArangoDB 3.4.
95
- */
96
- intermediateCommitSize?: number;
97
87
  };
98
88
  /**
99
89
  * Options for executing a query.
100
90
  *
101
- * See {@link Database.query}.
91
+ * See {@link Database#query}.
102
92
  */
103
93
  export declare type QueryOptions = {
104
94
  /**
@@ -265,7 +255,7 @@ export declare type QueryOptions = {
265
255
  /**
266
256
  * Options for explaining a query.
267
257
  *
268
- * See {@link Database.explain}.
258
+ * See {@link Database#explain}.
269
259
  */
270
260
  export declare type ExplainOptions = {
271
261
  /**
@@ -294,7 +284,7 @@ export declare type ExplainOptions = {
294
284
  /**
295
285
  * Details for a transaction.
296
286
  *
297
- * See also {@link TransactionStatus}.
287
+ * See also {@link transaction.TransactionStatus}.
298
288
  */
299
289
  export declare type TransactionDetails = {
300
290
  /**
@@ -455,6 +445,20 @@ export declare type ParseResult = {
455
445
  */
456
446
  ast: AstNode[];
457
447
  };
448
+ /**
449
+ * Optimizer rule for AQL queries.
450
+ */
451
+ export declare type QueryOptimizerRule = {
452
+ name: string;
453
+ flags: {
454
+ hidden: boolean;
455
+ clusterOnly: boolean;
456
+ canBeDisabled: boolean;
457
+ canCreateAdditionalPlans: boolean;
458
+ disabledByDefault: boolean;
459
+ enterpriseOnly: boolean;
460
+ };
461
+ };
458
462
  /**
459
463
  * Information about query tracking.
460
464
  */
@@ -488,7 +492,7 @@ export declare type QueryTracking = {
488
492
  /**
489
493
  * Options for query tracking.
490
494
  *
491
- * See {@link Database.queryTracking}.
495
+ * See {@link Database#queryTracking}.
492
496
  */
493
497
  export declare type QueryTrackingOptions = {
494
498
  /**
@@ -533,7 +537,7 @@ export declare type QueryInfo = {
533
537
  /**
534
538
  * Bind parameters used in the query.
535
539
  */
536
- bindVars: Dict<any>;
540
+ bindVars: Record<string, any>;
537
541
  /**
538
542
  * Query's running time in seconds.
539
543
  */
@@ -574,12 +578,12 @@ export declare type CreateDatabaseUser = {
574
578
  /**
575
579
  * Additional data to store with the user object.
576
580
  */
577
- extra?: Dict<any>;
581
+ extra?: Record<string, any>;
578
582
  };
579
583
  /**
580
584
  * Options for creating a database.
581
585
  *
582
- * See {@link Database.createDatabase}.
586
+ * See {@link Database#createDatabase}.
583
587
  */
584
588
  export declare type CreateDatabaseOptions = {
585
589
  /**
@@ -604,18 +608,11 @@ export declare type CreateDatabaseOptions = {
604
608
  * database.
605
609
  */
606
610
  writeConcern?: number;
607
- /**
608
- * (Cluster only.) Default write concern for new collections created in this
609
- * database.
610
- *
611
- * @deprecated Renamed to `writeConcern` in ArangoDB 3.6.
612
- */
613
- minReplicationFactor?: number;
614
611
  };
615
612
  /**
616
613
  * Object describing a database.
617
614
  *
618
- * See {@link Database.get}.
615
+ * See {@link Database#get}.
619
616
  */
620
617
  export declare type DatabaseInfo = {
621
618
  /**
@@ -649,13 +646,6 @@ export declare type DatabaseInfo = {
649
646
  * database.
650
647
  */
651
648
  writeConcern?: number;
652
- /**
653
- * (Cluster only.) Default write concern for new collections created in this
654
- * database.
655
- *
656
- * @deprecated Renamed to `writeConcern` in ArangoDB 3.6.
657
- */
658
- minReplicationFactor?: number;
659
649
  };
660
650
  /**
661
651
  * Result of retrieving database version information.
@@ -695,32 +685,32 @@ export declare type AqlUserFunction = {
695
685
  /**
696
686
  * Whether the function is deterministic.
697
687
  *
698
- * See {@link Database.createFunction}.
688
+ * See {@link Database#createFunction}.
699
689
  */
700
690
  isDeterministic: boolean;
701
691
  };
702
692
  /**
703
693
  * Options for installing the service.
704
694
  *
705
- * See {@link Database.installService}.
695
+ * See {@link Database#installService}.
706
696
  */
707
697
  export declare type InstallServiceOptions = {
708
698
  /**
709
699
  * An object mapping configuration option names to values.
710
700
  *
711
- * See also {@link Database.getServiceConfiguration}.
701
+ * See also {@link Database#getServiceConfiguration}.
712
702
  */
713
- configuration?: Dict<any>;
703
+ configuration?: Record<string, any>;
714
704
  /**
715
705
  * An object mapping dependency aliases to mount points.
716
706
  *
717
- * See also {@link Database.getServiceDependencies}.
707
+ * See also {@link Database#getServiceDependencies}.
718
708
  */
719
- dependencies?: Dict<string>;
709
+ dependencies?: Record<string, string>;
720
710
  /**
721
711
  * Whether the service should be installed in development mode.
722
712
  *
723
- * See also {@link Database.setServiceDevelopmentMode}.
713
+ * See also {@link Database#setServiceDevelopmentMode}.
724
714
  *
725
715
  * Default: `false`
726
716
  */
@@ -743,25 +733,25 @@ export declare type InstallServiceOptions = {
743
733
  /**
744
734
  * Options for replacing a service.
745
735
  *
746
- * See {@link Database.replaceService}.
736
+ * See {@link Database#replaceService}.
747
737
  */
748
738
  export declare type ReplaceServiceOptions = {
749
739
  /**
750
740
  * An object mapping configuration option names to values.
751
741
  *
752
- * See also {@link Database.getServiceConfiguration}.
742
+ * See also {@link Database#getServiceConfiguration}.
753
743
  */
754
- configuration?: Dict<any>;
744
+ configuration?: Record<string, any>;
755
745
  /**
756
746
  * An object mapping dependency aliases to mount points.
757
747
  *
758
- * See also {@link Database.getServiceDependencies}.
748
+ * See also {@link Database#getServiceDependencies}.
759
749
  */
760
- dependencies?: Dict<string>;
750
+ dependencies?: Record<string, string>;
761
751
  /**
762
752
  * Whether the service should be installed in development mode.
763
753
  *
764
- * See also {@link Database.setServiceDevelopmentMode}.
754
+ * See also {@link Database#setServiceDevelopmentMode}.
765
755
  *
766
756
  * Default: `false`
767
757
  */
@@ -798,25 +788,25 @@ export declare type ReplaceServiceOptions = {
798
788
  /**
799
789
  * Options for upgrading a service.
800
790
  *
801
- * See {@link Database.upgradeService}.
791
+ * See {@link Database#upgradeService}.
802
792
  */
803
793
  export declare type UpgradeServiceOptions = {
804
794
  /**
805
795
  * An object mapping configuration option names to values.
806
796
  *
807
- * See also {@link Database.getServiceConfiguration}.
797
+ * See also {@link Database#getServiceConfiguration}.
808
798
  */
809
- configuration?: Dict<any>;
799
+ configuration?: Record<string, any>;
810
800
  /**
811
801
  * An object mapping dependency aliases to mount points.
812
802
  *
813
- * See also {@link Database.getServiceDependencies}.
803
+ * See also {@link Database#getServiceDependencies}.
814
804
  */
815
- dependencies?: Dict<string>;
805
+ dependencies?: Record<string, string>;
816
806
  /**
817
807
  * Whether the service should be installed in development mode.
818
808
  *
819
- * See also {@link Database.setServiceDevelopmentMode}.
809
+ * See also {@link Database#setServiceDevelopmentMode}.
820
810
  *
821
811
  * Default: `false`
822
812
  */
@@ -853,7 +843,7 @@ export declare type UpgradeServiceOptions = {
853
843
  /**
854
844
  * Options for uninstalling a service.
855
845
  *
856
- * See {@link Database.uninstallService}.
846
+ * See {@link Database#uninstallService}.
857
847
  */
858
848
  export declare type UninstallServiceOptions = {
859
849
  /**
@@ -891,7 +881,7 @@ export declare type ServiceSummary = {
891
881
  * Service dependencies the service expects to be able to match as a mapping
892
882
  * from dependency names to versions the service is compatible with.
893
883
  */
894
- provides: Dict<string>;
884
+ provides: Record<string, string>;
895
885
  /**
896
886
  * Whether development mode is enabled for this service.
897
887
  */
@@ -944,11 +934,11 @@ export declare type ServiceInfo = {
944
934
  /**
945
935
  * Configuration values set for this service.
946
936
  */
947
- configuration: Dict<any>;
937
+ configuration: Record<string, any>;
948
938
  /**
949
939
  * Service dependency configuration of this service.
950
940
  */
951
- dependencies: Dict<string>;
941
+ dependencies: Record<string, string>;
952
942
  };
953
943
  };
954
944
  /**
@@ -1132,26 +1122,38 @@ export declare type ServiceTestXunitTest = ["testcase", {
1132
1122
  classname: string;
1133
1123
  name: string;
1134
1124
  time: number;
1135
- }] | ["testcase", {
1136
- classname: string;
1137
- name: string;
1138
- time: number;
1139
- }, ["failure", {
1140
- message: string;
1141
- type: string;
1142
- }, string]];
1125
+ }] | [
1126
+ "testcase",
1127
+ {
1128
+ classname: string;
1129
+ name: string;
1130
+ time: number;
1131
+ },
1132
+ [
1133
+ "failure",
1134
+ {
1135
+ message: string;
1136
+ type: string;
1137
+ },
1138
+ string
1139
+ ]
1140
+ ];
1143
1141
  /**
1144
1142
  * Test results for a Foxx service's tests in XUnit format using the JSONML
1145
1143
  * representation.
1146
1144
  */
1147
- export declare type ServiceTestXunitReport = ["testsuite", {
1148
- timestamp: number;
1149
- tests: number;
1150
- errors: number;
1151
- failures: number;
1152
- skip: number;
1153
- time: number;
1154
- }, ...ServiceTestXunitTest[]];
1145
+ export declare type ServiceTestXunitReport = [
1146
+ "testsuite",
1147
+ {
1148
+ timestamp: number;
1149
+ tests: number;
1150
+ errors: number;
1151
+ failures: number;
1152
+ skip: number;
1153
+ time: number;
1154
+ },
1155
+ ...ServiceTestXunitTest[]
1156
+ ];
1155
1157
  /**
1156
1158
  * Test results for a Foxx service's tests in TAP format.
1157
1159
  */
@@ -1305,18 +1307,18 @@ export declare class Database {
1305
1307
  protected _analyzers: Map<string, Analyzer>;
1306
1308
  protected _collections: Map<string, Collection<any>>;
1307
1309
  protected _graphs: Map<string, Graph>;
1308
- protected _views: Map<string, ArangoSearchView>;
1310
+ protected _views: Map<string, View>;
1309
1311
  /**
1310
1312
  * Creates a new `Database` instance with its own connection pool.
1311
1313
  *
1312
- * See also {@link Database.database}.
1314
+ * See also {@link Database#database}.
1313
1315
  *
1314
1316
  * @param config - An object with configuration options.
1315
1317
  *
1316
1318
  * @example
1317
1319
  * ```js
1318
1320
  * const db = new Database({
1319
- * url: "http://localhost:8529",
1321
+ * url: "http://127.0.0.1:8529",
1320
1322
  * databaseName: "my_database",
1321
1323
  * auth: { username: "admin", password: "hunter2" },
1322
1324
  * });
@@ -1326,18 +1328,22 @@ export declare class Database {
1326
1328
  /**
1327
1329
  * Creates a new `Database` instance with its own connection pool.
1328
1330
  *
1329
- * See also {@link Database.database}.
1331
+ * See also {@link Database#database}.
1330
1332
  *
1331
1333
  * @param url - Base URL of the ArangoDB server or list of server URLs.
1332
- * Equivalent to the `url` option in {@link Config}.
1334
+ * Equivalent to the `url` option in {@link connection.Config}.
1333
1335
  *
1334
1336
  * @example
1335
1337
  * ```js
1336
- * const db = new Database("http://localhost:8529", "my_database");
1338
+ * const db = new Database("http://127.0.0.1:8529", "my_database");
1337
1339
  * db.useBasicAuth("admin", "hunter2");
1338
1340
  * ```
1339
1341
  */
1340
1342
  constructor(url: string | string[], name?: string);
1343
+ /**
1344
+ * @internal
1345
+ */
1346
+ constructor(database: Database, name?: string);
1341
1347
  /**
1342
1348
  * @internal
1343
1349
  *
@@ -1366,7 +1372,7 @@ export declare class Database {
1366
1372
  */
1367
1373
  version(details?: boolean): Promise<VersionInfo>;
1368
1374
  /**
1369
- * Returns a new {@link Route} instance for the given path (relative to the
1375
+ * Returns a new {@link route.Route} instance for the given path (relative to the
1370
1376
  * database) that can be used to perform arbitrary HTTP requests.
1371
1377
  *
1372
1378
  * @param path - The database-relative URL of the route. Defaults to the
@@ -1401,19 +1407,22 @@ export declare class Database {
1401
1407
  * @param transform - An optional function to transform the low-level
1402
1408
  * response object to a more useful return value.
1403
1409
  */
1404
- request<T = ArangojsResponse>(options: RequestOptions & {
1410
+ request<T = any>(options: RequestOptions & {
1405
1411
  absolutePath?: boolean;
1406
- }, transform?: (res: ArangojsResponse) => T): Promise<T>;
1412
+ }, transform?: false | ((res: ArangojsResponse) => T)): Promise<T>;
1407
1413
  /**
1408
1414
  * Updates the URL list by requesting a list of all coordinators in the
1409
1415
  * cluster and adding any endpoints not initially specified in the
1410
- * {@link Config}.
1416
+ * {@link connection.Config}.
1411
1417
  *
1412
1418
  * For long-running processes communicating with an ArangoDB cluster it is
1413
1419
  * recommended to run this method periodically (e.g. once per hour) to make
1414
1420
  * sure new coordinators are picked up correctly and can be used for
1415
1421
  * fail-over or load balancing.
1416
1422
  *
1423
+ * @param overwrite - If set to `true`, the existing host list will be
1424
+ * replaced instead of extended.
1425
+ *
1417
1426
  * @example
1418
1427
  * ```js
1419
1428
  * const db = new Database();
@@ -1424,10 +1433,10 @@ export declare class Database {
1424
1433
  *
1425
1434
  * // later
1426
1435
  * clearInterval(interval);
1427
- * db.close();
1436
+ * system.close();
1428
1437
  * ```
1429
1438
  */
1430
- acquireHostList(): Promise<void>;
1439
+ acquireHostList(overwrite?: boolean): Promise<void>;
1431
1440
  /**
1432
1441
  * Closes all active connections of this database instance.
1433
1442
  *
@@ -1449,7 +1458,7 @@ export declare class Database {
1449
1458
  * REMOVE session IN ${sessions}
1450
1459
  * `);
1451
1460
  * // Making sure to close the connections because they're no longer used
1452
- * db.close();
1461
+ * system.close();
1453
1462
  * }, 1000 * 60 * 60);
1454
1463
  * ```
1455
1464
  */
@@ -1466,7 +1475,7 @@ export declare class Database {
1466
1475
  * @example
1467
1476
  * ```js
1468
1477
  * const db = new Database({ loadBalancingStrategy: "ROUND_ROBIN" });
1469
- * await db.acquireHostList();
1478
+ * await system.acquireHostList();
1470
1479
  * const analyzer = db.analyzer("my-analyzer");
1471
1480
  * await analyzer.create();
1472
1481
  * await db.waitForPropagation(
@@ -1488,33 +1497,13 @@ export declare class Database {
1488
1497
  /**
1489
1498
  * Sets the limit for the number of values of the most recently received
1490
1499
  * server-reported queue times that can be accessed using
1491
- * {@link Database.queueTime}.
1500
+ * {@link Database#queueTime}.
1492
1501
  *
1493
1502
  * @param responseQueueTimeSamples - Number of values to maintain.
1494
1503
  */
1495
1504
  setResponseQueueTimeSamples(responseQueueTimeSamples: number): void;
1496
1505
  /**
1497
- * Updates the `Database` instance and its connection string to use the given
1498
- * `databaseName`, then returns itself.
1499
- *
1500
- * **Note**: This also affects all collections, cursors and other arangojs
1501
- * objects originating from this database object, which may cause unexpected
1502
- * results.
1503
- *
1504
- * @param databaseName - Name of the database to use.
1505
- *
1506
- * @deprecated Use {@link Database.database} instead.
1507
- *
1508
- * @example
1509
- * ```js
1510
- * const systemDb = new Database();
1511
- * // systemDb.useDatabase("my_database"); // deprecated
1512
- * const myDb = systemDb.database("my_database");
1513
- * ```
1514
- */
1515
- useDatabase(databaseName: string): this;
1516
- /**
1517
- * Updates the `Database` instance's `authorization` header to use Basic
1506
+ * Updates the underlying connection's `authorization` header to use Basic
1518
1507
  * authentication with the given `username` and `password`, then returns
1519
1508
  * itself.
1520
1509
  *
@@ -1524,15 +1513,13 @@ export declare class Database {
1524
1513
  * @example
1525
1514
  * ```js
1526
1515
  * const db = new Database();
1527
- * db.useDatabase("test");
1528
1516
  * db.useBasicAuth("admin", "hunter2");
1529
- * // The database instance now uses the database "test"
1530
1517
  * // with the username "admin" and password "hunter2".
1531
1518
  * ```
1532
1519
  */
1533
1520
  useBasicAuth(username?: string, password?: string): this;
1534
1521
  /**
1535
- * Updates the `Database` instance's `authorization` header to use Bearer
1522
+ * Updates the underlying connection's `authorization` header to use Bearer
1536
1523
  * authentication with the given authentication `token`, then returns itself.
1537
1524
  *
1538
1525
  * @param token - The token to authenticate with.
@@ -1556,9 +1543,7 @@ export declare class Database {
1556
1543
  * @example
1557
1544
  * ```js
1558
1545
  * const db = new Database();
1559
- * db.useDatabase("test");
1560
1546
  * await db.login("admin", "hunter2");
1561
- * // The database instance now uses the database "test"
1562
1547
  * // with an authentication token for the "admin" user.
1563
1548
  * ```
1564
1549
  */
@@ -1567,7 +1552,7 @@ export declare class Database {
1567
1552
  * Creates a new `Database` instance for the given `databaseName` that
1568
1553
  * shares this database's connection pool.
1569
1554
  *
1570
- * See also {@link Database.constructor}.
1555
+ * See also {@link Database:constructor}.
1571
1556
  *
1572
1557
  * @param databaseName - Name of the database.
1573
1558
  *
@@ -1614,8 +1599,6 @@ export declare class Database {
1614
1599
  * users: [{ username: "root" }]
1615
1600
  * });
1616
1601
  * // the database has been created
1617
- * db.useDatabase("mydb");
1618
- * db.useBasicAuth("root", "");
1619
1602
  * ```
1620
1603
  */
1621
1604
  createDatabase(databaseName: string, options?: CreateDatabaseOptions): Promise<Database>;
@@ -1631,16 +1614,14 @@ export declare class Database {
1631
1614
  * const db = new Database();
1632
1615
  * const info = await db.createDatabase("mydb", [{ username: "root" }]);
1633
1616
  * // the database has been created
1634
- * db.useDatabase("mydb");
1635
- * db.useBasicAuth("root", "");
1636
1617
  * ```
1637
1618
  */
1638
1619
  createDatabase(databaseName: string, users: CreateDatabaseUser[]): Promise<Database>;
1639
1620
  /**
1640
1621
  * Fetches all databases from the server and returns an array of their names.
1641
1622
  *
1642
- * See also {@link Database.databases} and
1643
- * {@link Database.listUserDatabases}.
1623
+ * See also {@link Database#databases} and
1624
+ * {@link Database#listUserDatabases}.
1644
1625
  *
1645
1626
  * @example
1646
1627
  * ```js
@@ -1654,8 +1635,8 @@ export declare class Database {
1654
1635
  * Fetches all databases accessible to the active user from the server and
1655
1636
  * returns an array of their names.
1656
1637
  *
1657
- * See also {@link Database.userDatabases} and
1658
- * {@link Database.listDatabases}.
1638
+ * See also {@link Database#userDatabases} and
1639
+ * {@link Database#listDatabases}.
1659
1640
  *
1660
1641
  * @example
1661
1642
  * ```js
@@ -1669,8 +1650,8 @@ export declare class Database {
1669
1650
  * Fetches all databases from the server and returns an array of `Database`
1670
1651
  * instances for those databases.
1671
1652
  *
1672
- * See also {@link Database.listDatabases} and
1673
- * {@link Database.userDatabases}.
1653
+ * See also {@link Database#listDatabases} and
1654
+ * {@link Database#userDatabases}.
1674
1655
  *
1675
1656
  * @example
1676
1657
  * ```js
@@ -1684,8 +1665,8 @@ export declare class Database {
1684
1665
  * Fetches all databases accessible to the active user from the server and
1685
1666
  * returns an array of `Database` instances for those databases.
1686
1667
  *
1687
- * See also {@link Database.listUserDatabases} and
1688
- * {@link Database.databases}.
1668
+ * See also {@link Database#listUserDatabases} and
1669
+ * {@link Database#databases}.
1689
1670
  *
1690
1671
  * @example
1691
1672
  * ```js
@@ -1712,8 +1693,8 @@ export declare class Database {
1712
1693
  * Returns a `Collection` instance for the given collection name.
1713
1694
  *
1714
1695
  * In TypeScript the collection implements both the
1715
- * {@link DocumentCollection} and {@link EdgeCollection} interfaces and can
1716
- * be cast to either type to enforce a stricter API.
1696
+ * {@link collection.DocumentCollection} and {@link collection.EdgeCollection}
1697
+ * interfaces and can be cast to either type to enforce a stricter API.
1717
1698
  *
1718
1699
  * @param T - Type to use for document data. Defaults to `any`.
1719
1700
  * @param collectionName - Name of the edge collection.
@@ -1750,7 +1731,7 @@ export declare class Database {
1750
1731
  collection<T extends Record<string, any> = any>(collectionName: string): DocumentCollection<T> & EdgeCollection<T>;
1751
1732
  /**
1752
1733
  * Creates a new collection with the given `collectionName` and `options`,
1753
- * then returns a {@link DocumentCollection} instance for the new collection.
1734
+ * then returns a {@link collection.DocumentCollection} instance for the new collection.
1754
1735
  *
1755
1736
  * @param T - Type to use for document data. Defaults to `any`.
1756
1737
  * @param collectionName - Name of the new collection.
@@ -1776,7 +1757,7 @@ export declare class Database {
1776
1757
  }): Promise<DocumentCollection<T>>;
1777
1758
  /**
1778
1759
  * Creates a new edge collection with the given `collectionName` and
1779
- * `options`, then returns an {@link EdgeCollection} instance for the new
1760
+ * `options`, then returns an {@link collection.EdgeCollection} instance for the new
1780
1761
  * edge collection.
1781
1762
  *
1782
1763
  * @param T - Type to use for edge document data. Defaults to `any`.
@@ -1808,10 +1789,10 @@ export declare class Database {
1808
1789
  }): Promise<EdgeCollection<T>>;
1809
1790
  /**
1810
1791
  * Creates a new edge collection with the given `collectionName` and
1811
- * `options`, then returns an {@link EdgeCollection} instance for the new
1792
+ * `options`, then returns an {@link collection.EdgeCollection} instance for the new
1812
1793
  * edge collection.
1813
1794
  *
1814
- * This is a convenience method for calling {@link Database.createCollection}
1795
+ * This is a convenience method for calling {@link Database#createCollection}
1815
1796
  * with `options.type` set to `EDGE_COLLECTION`.
1816
1797
  *
1817
1798
  * @param T - Type to use for edge document data. Defaults to `any`.
@@ -1847,12 +1828,12 @@ export declare class Database {
1847
1828
  * @param collectionName - Current name of the collection.
1848
1829
  * @param newName - The new name of the collection.
1849
1830
  */
1850
- renameCollection(collectionName: string, newName: string): Promise<ArangoResponseMetadata & CollectionMetadata>;
1831
+ renameCollection(collectionName: string, newName: string): Promise<ArangoApiResponse<CollectionMetadata>>;
1851
1832
  /**
1852
1833
  * Fetches all collections from the database and returns an array of
1853
1834
  * collection descriptions.
1854
1835
  *
1855
- * See also {@link Database.collections}.
1836
+ * See also {@link Database#collections}.
1856
1837
  *
1857
1838
  * @param excludeSystem - Whether system collections should be excluded.
1858
1839
  *
@@ -1878,10 +1859,10 @@ export declare class Database {
1878
1859
  * `Collection` instances.
1879
1860
  *
1880
1861
  * In TypeScript these instances implement both the
1881
- * {@link DocumentCollection} and {@link EdgeCollection} interfaces and can
1882
- * be cast to either type to enforce a stricter API.
1862
+ * {@link collection.DocumentCollection} and {@link collection.EdgeCollection}
1863
+ * interfaces and can be cast to either type to enforce a stricter API.
1883
1864
  *
1884
- * See also {@link Database.listCollections}.
1865
+ * See also {@link Database#listCollections}.
1885
1866
  *
1886
1867
  * @param excludeSystem - Whether system collections should be excluded.
1887
1868
  *
@@ -1889,23 +1870,21 @@ export declare class Database {
1889
1870
  * ```js
1890
1871
  * const db = new Database();
1891
1872
  * const collections = await db.collections();
1892
- * // collections is an array of DocumentCollection
1893
- * // and EdgeCollection instances
1894
- * // not including system collections
1873
+ * // collections is an array of DocumentCollection and EdgeCollection
1874
+ * // instances not including system collections
1895
1875
  * ```
1896
1876
  *
1897
1877
  * @example
1898
1878
  * ```js
1899
1879
  * const db = new Database();
1900
1880
  * const collections = await db.collections(false);
1901
- * // collections is an array of DocumentCollection
1902
- * // and EdgeCollection instances
1903
- * // including system collections
1881
+ * // collections is an array of DocumentCollection and EdgeCollection
1882
+ * // instances including system collections
1904
1883
  * ```
1905
1884
  */
1906
1885
  collections(excludeSystem?: boolean): Promise<Array<DocumentCollection & EdgeCollection>>;
1907
1886
  /**
1908
- * Returns a {@link Graph} instance representing the graph with the given
1887
+ * Returns a {@link graph.Graph} instance representing the graph with the given
1909
1888
  * `graphName`.
1910
1889
  *
1911
1890
  * @param graphName - Name of the graph.
@@ -1919,18 +1898,18 @@ export declare class Database {
1919
1898
  graph(graphName: string): Graph;
1920
1899
  /**
1921
1900
  * Creates a graph with the given `graphName` and `edgeDefinitions`, then
1922
- * returns a {@link Graph} instance for the new graph.
1901
+ * returns a {@link graph.Graph} instance for the new graph.
1923
1902
  *
1924
1903
  * @param graphName - Name of the graph to be created.
1925
1904
  * @param edgeDefinitions - An array of edge definitions.
1926
1905
  * @param options - An object defining the properties of the graph.
1927
1906
  */
1928
- createGraph(graphName: string, edgeDefinitions: EdgeDefinitionOptions[], options?: GraphCreateOptions): Promise<Graph>;
1907
+ createGraph(graphName: string, edgeDefinitions: EdgeDefinitionOptions[], options?: CreateGraphOptions): Promise<Graph>;
1929
1908
  /**
1930
1909
  * Fetches all graphs from the database and returns an array of graph
1931
1910
  * descriptions.
1932
1911
  *
1933
- * See also {@link Database.graphs}.
1912
+ * See also {@link Database#graphs}.
1934
1913
  *
1935
1914
  * @example
1936
1915
  * ```js
@@ -1941,10 +1920,10 @@ export declare class Database {
1941
1920
  */
1942
1921
  listGraphs(): Promise<GraphInfo[]>;
1943
1922
  /**
1944
- * Fetches all graphs from the database and returns an array of {@link Graph}
1923
+ * Fetches all graphs from the database and returns an array of {@link graph.Graph}
1945
1924
  * instances for those graphs.
1946
1925
  *
1947
- * See also {@link Database.listGraphs}.
1926
+ * See also {@link Database#listGraphs}.
1948
1927
  *
1949
1928
  * @example
1950
1929
  * ```js
@@ -1955,9 +1934,9 @@ export declare class Database {
1955
1934
  */
1956
1935
  graphs(): Promise<Graph[]>;
1957
1936
  /**
1958
- * Returns an {@link ArangoSearchView} instance for the given `viewName`.
1937
+ * Returns a {@link view.View} instance for the given `viewName`.
1959
1938
  *
1960
- * @param viewName - Name of the ArangoSearch View.
1939
+ * @param viewName - Name of the ArangoSearch or SearchAlias View.
1961
1940
  *
1962
1941
  * @example
1963
1942
  * ```js
@@ -1965,26 +1944,26 @@ export declare class Database {
1965
1944
  * const view = db.view("potatoes");
1966
1945
  * ```
1967
1946
  */
1968
- view(viewName: string): ArangoSearchView;
1947
+ view(viewName: string): View;
1969
1948
  /**
1970
- * Creates a new ArangoSearch View with the given `viewName` and `options`
1971
- * and returns an {@link ArangoSearchView} instance for the created View.
1949
+ * Creates a new View with the given `viewName` and `options`, then returns a
1950
+ * {@link view.View} instance for the new View.
1972
1951
  *
1973
- * @param viewName - Name of the ArangoSearch View.
1952
+ * @param viewName - Name of the View.
1974
1953
  * @param options - An object defining the properties of the View.
1975
1954
  *
1976
1955
  * @example
1977
1956
  * ```js
1978
1957
  * const db = new Database();
1979
- * const view = await db.createView("potatoes");
1958
+ * const view = await db.createView("potatoes", { type: "arangosearch" });
1980
1959
  * // the ArangoSearch View "potatoes" now exists
1981
1960
  * ```
1982
1961
  */
1983
- createView(viewName: string, options?: ArangoSearchViewPropertiesOptions): Promise<ArangoSearchView>;
1962
+ createView(viewName: string, options: CreateViewOptions): Promise<View>;
1984
1963
  /**
1985
1964
  * Renames the view `viewName` to `newName`.
1986
1965
  *
1987
- * Additionally removes any stored {@link View} instance for `viewName` from
1966
+ * Additionally removes any stored {@link view.View} instance for `viewName` from
1988
1967
  * the `Database` instance's internal cache.
1989
1968
  *
1990
1969
  * **Note**: Renaming views may not be supported when ArangoDB is running in
@@ -1993,12 +1972,12 @@ export declare class Database {
1993
1972
  * @param viewName - Current name of the view.
1994
1973
  * @param newName - The new name of the view.
1995
1974
  */
1996
- renameView(viewName: string, newName: string): Promise<ArangoResponseMetadata & ViewDescription>;
1975
+ renameView(viewName: string, newName: string): Promise<ArangoApiResponse<ViewDescription>>;
1997
1976
  /**
1998
1977
  * Fetches all Views from the database and returns an array of View
1999
1978
  * descriptions.
2000
1979
  *
2001
- * See also {@link Database.views}.
1980
+ * See also {@link Database#views}.
2002
1981
  *
2003
1982
  * @example
2004
1983
  * ```js
@@ -2011,9 +1990,10 @@ export declare class Database {
2011
1990
  listViews(): Promise<ViewDescription[]>;
2012
1991
  /**
2013
1992
  * Fetches all Views from the database and returns an array of
2014
- * {@link ArangoSearchView} instances for the Views.
1993
+ * {@link view.View} instances
1994
+ * for the Views.
2015
1995
  *
2016
- * See also {@link Database.listViews}.
1996
+ * See also {@link Database#listViews}.
2017
1997
  *
2018
1998
  * @example
2019
1999
  * ```js
@@ -2022,9 +2002,9 @@ export declare class Database {
2022
2002
  * // views is an array of ArangoSearch View instances
2023
2003
  * ```
2024
2004
  */
2025
- views(): Promise<ArangoSearchView[]>;
2005
+ views(): Promise<View[]>;
2026
2006
  /**
2027
- * Returns an {@link Analyzer} instance representing the Analyzer with the
2007
+ * Returns an {@link analyzer.Analyzer} instance representing the Analyzer with the
2028
2008
  * given `analyzerName`.
2029
2009
  *
2030
2010
  * @example
@@ -2037,7 +2017,7 @@ export declare class Database {
2037
2017
  analyzer(analyzerName: string): Analyzer;
2038
2018
  /**
2039
2019
  * Creates a new Analyzer with the given `analyzerName` and `options`, then
2040
- * returns an {@link Analyzer} instance for the new Analyzer.
2020
+ * returns an {@link analyzer.Analyzer} instance for the new Analyzer.
2041
2021
  *
2042
2022
  * @param analyzerName - Name of the Analyzer.
2043
2023
  * @param options - An object defining the properties of the Analyzer.
@@ -2054,7 +2034,7 @@ export declare class Database {
2054
2034
  * Fetches all Analyzers visible in the database and returns an array of
2055
2035
  * Analyzer descriptions.
2056
2036
  *
2057
- * See also {@link Database.analyzers}.
2037
+ * See also {@link Database#analyzers}.
2058
2038
  *
2059
2039
  * @example
2060
2040
  * ```js
@@ -2066,9 +2046,9 @@ export declare class Database {
2066
2046
  listAnalyzers(): Promise<AnalyzerDescription[]>;
2067
2047
  /**
2068
2048
  * Fetches all Analyzers visible in the database and returns an array of
2069
- * {@link Analyzer} instances for those Analyzers.
2049
+ * {@link analyzer.Analyzer} instances for those Analyzers.
2070
2050
  *
2071
- * See also {@link Database.listAnalyzers}.
2051
+ * See also {@link Database#listAnalyzers}.
2072
2052
  *
2073
2053
  * @example
2074
2054
  * ```js
@@ -2102,7 +2082,7 @@ export declare class Database {
2102
2082
  * // user is the user object for the user named "steve"
2103
2083
  * ```
2104
2084
  */
2105
- getUser(username: string): Promise<ArangoUser & ArangoResponseMetadata>;
2085
+ getUser(username: string): Promise<ArangoApiResponse<ArangoUser>>;
2106
2086
  /**
2107
2087
  * Creates a new ArangoDB user with the given password.
2108
2088
  *
@@ -2116,7 +2096,7 @@ export declare class Database {
2116
2096
  * // The user "steve" has been created
2117
2097
  * ```
2118
2098
  */
2119
- createUser(username: string, passwd: string): Promise<ArangoUser & ArangoResponseMetadata>;
2099
+ createUser(username: string, passwd: string): Promise<ArangoApiResponse<ArangoUser>>;
2120
2100
  /**
2121
2101
  * Creates a new ArangoDB user with the given options.
2122
2102
  *
@@ -2130,7 +2110,7 @@ export declare class Database {
2130
2110
  * // The user "steve" has been created
2131
2111
  * ```
2132
2112
  */
2133
- createUser(username: string, options: UserOptions): Promise<ArangoUser & ArangoResponseMetadata>;
2113
+ createUser(username: string, options: UserOptions): Promise<ArangoApiResponse<ArangoUser>>;
2134
2114
  /**
2135
2115
  * Sets the password of a given ArangoDB user to the new value.
2136
2116
  *
@@ -2144,7 +2124,7 @@ export declare class Database {
2144
2124
  * // The user "steve" has received a new password
2145
2125
  * ```
2146
2126
  */
2147
- updateUser(username: string, passwd: string): Promise<ArangoUser & ArangoResponseMetadata>;
2127
+ updateUser(username: string, passwd: string): Promise<ArangoApiResponse<ArangoUser>>;
2148
2128
  /**
2149
2129
  * Updates the ArangoDB user with the new options.
2150
2130
  *
@@ -2158,7 +2138,7 @@ export declare class Database {
2158
2138
  * // The user "steve" has been set to inactive
2159
2139
  * ```
2160
2140
  */
2161
- updateUser(username: string, options: Partial<UserOptions>): Promise<ArangoUser & ArangoResponseMetadata>;
2141
+ updateUser(username: string, options: Partial<UserOptions>): Promise<ArangoApiResponse<ArangoUser>>;
2162
2142
  /**
2163
2143
  * Replaces the ArangoDB user's option with the new options.
2164
2144
  *
@@ -2172,7 +2152,7 @@ export declare class Database {
2172
2152
  * // The user "steve" has been set to inactive with an empty password
2173
2153
  * ```
2174
2154
  */
2175
- replaceUser(username: string, options: UserOptions): Promise<ArangoUser & ArangoResponseMetadata>;
2155
+ replaceUser(username: string, options: UserOptions): Promise<ArangoApiResponse<ArangoUser>>;
2176
2156
  /**
2177
2157
  * Removes the ArangoDB user with the given username from the server.
2178
2158
  *
@@ -2185,7 +2165,7 @@ export declare class Database {
2185
2165
  * // The user "steve" has been removed
2186
2166
  * ```
2187
2167
  */
2188
- removeUser(username: string): Promise<ArangoResponseMetadata>;
2168
+ removeUser(username: string): Promise<ArangoApiResponse<Record<string, never>>>;
2189
2169
  /**
2190
2170
  * Fetches the given ArangoDB user's access level for the database, or the
2191
2171
  * given collection in the given database.
@@ -2330,7 +2310,7 @@ export declare class Database {
2330
2310
  */
2331
2311
  setUserAccessLevel(username: string, { database, collection, grant, }: UserAccessLevelOptions & {
2332
2312
  grant: AccessLevel;
2333
- }): Promise<Record<string, AccessLevel> & ArangoResponseMetadata>;
2313
+ }): Promise<ArangoApiResponse<Record<string, AccessLevel>>>;
2334
2314
  /**
2335
2315
  * Clears the given ArangoDB user's access level for the database, or the
2336
2316
  * given collection in the given database.
@@ -2394,7 +2374,7 @@ export declare class Database {
2394
2374
  * // "pokemons" collection in database "staging".
2395
2375
  * ```
2396
2376
  */
2397
- clearUserAccessLevel(username: string, { database, collection }: UserAccessLevelOptions): Promise<Record<string, AccessLevel> & ArangoResponseMetadata>;
2377
+ clearUserAccessLevel(username: string, { database, collection }: UserAccessLevelOptions): Promise<ArangoApiResponse<Record<string, AccessLevel>>>;
2398
2378
  /**
2399
2379
  * Fetches an object mapping names of databases to the access level of the
2400
2380
  * given ArangoDB user for those databases.
@@ -2441,16 +2421,16 @@ export declare class Database {
2441
2421
  * value.
2442
2422
  *
2443
2423
  * Collections can be specified as collection names (strings) or objects
2444
- * implementing the {@link ArangoCollection} interface: `Collection`,
2445
- * {@link GraphVertexCollection}, {@link GraphEdgeCollection} as well as
2446
- * (in TypeScript) {@link DocumentCollection} and {@link EdgeCollection}.
2424
+ * implementing the {@link collection.ArangoCollection} interface: `Collection`,
2425
+ * {@link graph.GraphVertexCollection}, {@link graph.GraphEdgeCollection} as well as
2426
+ * (in TypeScript) {@link collection.DocumentCollection} and {@link collection.EdgeCollection}.
2447
2427
  *
2448
2428
  * **Note**: The `action` function will be evaluated and executed on the
2449
2429
  * server inside ArangoDB's embedded JavaScript environment and can not
2450
2430
  * access any values other than those passed via the `params` option.
2451
2431
  *
2452
2432
  * See the official ArangoDB documentation for
2453
- * {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
2433
+ * [the JavaScript `@arangodb` module](https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html)
2454
2434
  * for information about accessing the database from within ArangoDB's
2455
2435
  * server-side JavaScript environment.
2456
2436
  *
@@ -2494,15 +2474,15 @@ export declare class Database {
2494
2474
  * Performs a server-side transaction and returns its return value.
2495
2475
  *
2496
2476
  * Collections can be specified as collection names (strings) or objects
2497
- * implementing the {@link ArangoCollection} interface: `Collection`,
2498
- * {@link GraphVertexCollection}, {@link GraphEdgeCollection} as well as
2499
- * (in TypeScript) {@link DocumentCollection} and {@link EdgeCollection}.
2477
+ * implementing the {@link collection.ArangoCollection} interface: `Collection`,
2478
+ * {@link graph.GraphVertexCollection}, {@link graph.GraphEdgeCollection} as well as
2479
+ * (in TypeScript) {@link collection.DocumentCollection} and {@link collection.EdgeCollection}.
2500
2480
  *
2501
2481
  * **Note**: The `action` function will be evaluated and executed on the
2502
2482
  * server inside ArangoDB's embedded JavaScript environment and can not
2503
2483
  * access any values other than those passed via the `params` option.
2504
2484
  * See the official ArangoDB documentation for
2505
- * {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
2485
+ * [the JavaScript `@arangodb` module](https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html)
2506
2486
  * for information about accessing the database from within ArangoDB's
2507
2487
  * server-side JavaScript environment.
2508
2488
  *
@@ -2541,15 +2521,15 @@ export declare class Database {
2541
2521
  * Performs a server-side transaction and returns its return value.
2542
2522
  *
2543
2523
  * The Collection can be specified as a collection name (string) or an object
2544
- * implementing the {@link ArangoCollection} interface: `Collection`,
2545
- * {@link GraphVertexCollection}, {@link GraphEdgeCollection} as well as
2546
- * (in TypeScript) {@link DocumentCollection} and {@link EdgeCollection}.
2524
+ * implementing the {@link collection.ArangoCollection} interface: `Collection`,
2525
+ * {@link graph.GraphVertexCollection}, {@link graph.GraphEdgeCollection} as well as
2526
+ * (in TypeScript) {@link collection.DocumentCollection} and {@link collection.EdgeCollection}.
2547
2527
  *
2548
2528
  * **Note**: The `action` function will be evaluated and executed on the
2549
2529
  * server inside ArangoDB's embedded JavaScript environment and can not
2550
2530
  * access any values other than those passed via the `params` option.
2551
2531
  * See the official ArangoDB documentation for
2552
- * {@link https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html | the JavaScript `@arangodb` module}
2532
+ * [the JavaScript `@arangodb` module](https://www.arangodb.com/docs/stable/appendix-java-script-modules-arango-db.html)
2553
2533
  * for information about accessing the database from within ArangoDB's
2554
2534
  * server-side JavaScript environment.
2555
2535
  *
@@ -2585,10 +2565,10 @@ export declare class Database {
2585
2565
  params?: any;
2586
2566
  }): Promise<any>;
2587
2567
  /**
2588
- * Returns a {@link Transaction} instance for an existing streaming
2568
+ * Returns a {@link transaction.Transaction} instance for an existing streaming
2589
2569
  * transaction with the given `id`.
2590
2570
  *
2591
- * See also {@link Database.beginTransaction}.
2571
+ * See also {@link Database#beginTransaction}.
2592
2572
  *
2593
2573
  * @param id - The `id` of an existing stream transaction.
2594
2574
  *
@@ -2604,12 +2584,13 @@ export declare class Database {
2604
2584
  transaction(transactionId: string): Transaction;
2605
2585
  /**
2606
2586
  * Begins a new streaming transaction for the given collections, then returns
2607
- * a {@link Transaction} instance for the transaction.
2587
+ * a {@link transaction.Transaction} instance for the transaction.
2608
2588
  *
2609
2589
  * Collections can be specified as collection names (strings) or objects
2610
- * implementing the {@link ArangoCollection} interface: `Collection`,
2611
- * {@link GraphVertexCollection}, {@link GraphEdgeCollection} as well as
2612
- * (in TypeScript) {@link DocumentCollection} and {@link EdgeCollection}.
2590
+ * implementing the {@link collection.ArangoCollection} interface: `Collection`,
2591
+ * {@link graph.GraphVertexCollection}, {@link graph.GraphEdgeCollection} as
2592
+ * well as (in TypeScript) {@link collection.DocumentCollection} and
2593
+ * {@link collection.EdgeCollection}.
2613
2594
  *
2614
2595
  * @param collections - Collections involved in the transaction.
2615
2596
  * @param options - Options for the transaction.
@@ -2631,12 +2612,12 @@ export declare class Database {
2631
2612
  beginTransaction(collections: TransactionCollections, options?: TransactionOptions): Promise<Transaction>;
2632
2613
  /**
2633
2614
  * Begins a new streaming transaction for the given collections, then returns
2634
- * a {@link Transaction} instance for the transaction.
2615
+ * a {@link transaction.Transaction} instance for the transaction.
2635
2616
  *
2636
2617
  * Collections can be specified as collection names (strings) or objects
2637
- * implementing the {@link ArangoCollection} interface: `Collection`,
2638
- * {@link GraphVertexCollection}, {@link GraphEdgeCollection} as well as
2639
- * (in TypeScript) {@link DocumentCollection} and {@link EdgeCollection}.
2618
+ * implementing the {@link collection.ArangoCollection} interface: `Collection`,
2619
+ * {@link graph.GraphVertexCollection}, {@link graph.GraphEdgeCollection} as well as
2620
+ * (in TypeScript) {@link collection.DocumentCollection} and {@link collection.EdgeCollection}.
2640
2621
  *
2641
2622
  * @param collections - Collections that can be read from and written to
2642
2623
  * during the transaction.
@@ -2659,12 +2640,12 @@ export declare class Database {
2659
2640
  beginTransaction(collections: (string | ArangoCollection)[], options?: TransactionOptions): Promise<Transaction>;
2660
2641
  /**
2661
2642
  * Begins a new streaming transaction for the given collections, then returns
2662
- * a {@link Transaction} instance for the transaction.
2643
+ * a {@link transaction.Transaction} instance for the transaction.
2663
2644
  *
2664
2645
  * The Collection can be specified as a collection name (string) or an object
2665
- * implementing the {@link ArangoCollection} interface: `Collection`,
2666
- * {@link GraphVertexCollection}, {@link GraphEdgeCollection} as well as
2667
- * (in TypeScript) {@link DocumentCollection} and {@link EdgeCollection}.
2646
+ * implementing the {@link collection.ArangoCollection} interface: `Collection`,
2647
+ * {@link graph.GraphVertexCollection}, {@link graph.GraphEdgeCollection} as well as
2648
+ * (in TypeScript) {@link collection.DocumentCollection} and {@link collection.EdgeCollection}.
2668
2649
  *
2669
2650
  * @param collections - A collection that can be read from and written to
2670
2651
  * during the transaction.
@@ -2688,7 +2669,7 @@ export declare class Database {
2688
2669
  * Fetches all active transactions from the database and returns an array of
2689
2670
  * transaction descriptions.
2690
2671
  *
2691
- * See also {@link Database.transactions}.
2672
+ * See also {@link Database#transactions}.
2692
2673
  *
2693
2674
  * @example
2694
2675
  * ```js
@@ -2700,9 +2681,9 @@ export declare class Database {
2700
2681
  listTransactions(): Promise<TransactionDetails[]>;
2701
2682
  /**
2702
2683
  * Fetches all active transactions from the database and returns an array of
2703
- * {@link Transaction} instances for those transactions.
2684
+ * {@link transaction.Transaction} instances for those transactions.
2704
2685
  *
2705
- * See also {@link Database.listTransactions}.
2686
+ * See also {@link Database#listTransactions}.
2706
2687
  *
2707
2688
  * @example
2708
2689
  * ```js
@@ -2714,24 +2695,27 @@ export declare class Database {
2714
2695
  transactions(): Promise<Transaction[]>;
2715
2696
  /**
2716
2697
  * Performs a database query using the given `query`, then returns a new
2717
- * {@link ArrayCursor} instance for the result set.
2698
+ * {@link cursor.ArrayCursor} instance for the result set.
2718
2699
  *
2719
- * See the {@link aql} template string handler for information about how
2700
+ * See the {@link aql!aql} template string handler for information about how
2720
2701
  * to create a query string without manually defining bind parameters nor
2721
2702
  * having to worry about escaping variables.
2722
2703
  *
2723
2704
  * @param query - An object containing an AQL query string and bind
2724
- * parameters, e.g. the object returned from an {@link aql} template string.
2705
+ * parameters, e.g. the object returned from an {@link aql!aql} template string.
2725
2706
  * @param options - Options for the query execution.
2726
2707
  *
2727
2708
  * @example
2728
2709
  * ```js
2729
2710
  * const db = new Database();
2730
2711
  * const active = true;
2712
+ * const Users = db.collection("_users");
2731
2713
  *
2732
- * // Using an aql template string
2714
+ * // Using an aql template string:
2715
+ * // Bind parameters are automatically extracted and arangojs collections
2716
+ * // are automatically passed as collection bind parameters.
2733
2717
  * const cursor = await db.query(aql`
2734
- * FOR u IN _users
2718
+ * FOR u IN ${Users}
2735
2719
  * FILTER u.authData.active == ${active}
2736
2720
  * RETURN u.user
2737
2721
  * `);
@@ -2742,24 +2726,25 @@ export declare class Database {
2742
2726
  * ```js
2743
2727
  * const db = new Database();
2744
2728
  * const active = true;
2729
+ * const Users = db.collection("_users");
2745
2730
  *
2746
2731
  * // Using an object with a regular multi-line string
2747
2732
  * const cursor = await db.query({
2748
2733
  * query: `
2749
- * FOR u IN _users
2734
+ * FOR u IN @@users
2750
2735
  * FILTER u.authData.active == @active
2751
2736
  * RETURN u.user
2752
2737
  * `,
2753
- * bindVars: { active: active }
2738
+ * bindVars: { active: active, "@users": Users.name }
2754
2739
  * });
2755
2740
  * ```
2756
2741
  */
2757
- query(query: AqlQuery, options?: QueryOptions): Promise<ArrayCursor>;
2742
+ query<T = any>(query: AqlQuery, options?: QueryOptions): Promise<ArrayCursor<T>>;
2758
2743
  /**
2759
2744
  * Performs a database query using the given `query` and `bindVars`, then
2760
- * returns a new {@link ArrayCursor} instance for the result set.
2745
+ * returns a new {@link cursor.ArrayCursor} instance for the result set.
2761
2746
  *
2762
- * See the {@link aql} template string handler for a safer and easier
2747
+ * See the {@link aql!aql} template string handler for a safer and easier
2763
2748
  * alternative to passing strings directly.
2764
2749
  *
2765
2750
  * @param query - An AQL query string.
@@ -2770,15 +2755,16 @@ export declare class Database {
2770
2755
  * ```js
2771
2756
  * const db = new Database();
2772
2757
  * const active = true;
2758
+ * const Users = db.collection("_users");
2773
2759
  *
2774
2760
  * const cursor = await db.query(
2775
2761
  * // A normal multi-line string
2776
2762
  * `
2777
- * FOR u IN _users
2763
+ * FOR u IN @@users
2778
2764
  * FILTER u.authData.active == @active
2779
2765
  * RETURN u.user
2780
2766
  * `,
2781
- * { active: active }
2767
+ * { active: active, "@users": Users.name }
2782
2768
  * );
2783
2769
  * ```
2784
2770
  *
@@ -2786,28 +2772,29 @@ export declare class Database {
2786
2772
  * ```js
2787
2773
  * const db = new Database();
2788
2774
  * const active = true;
2775
+ * const Users = db.collection("_users");
2789
2776
  *
2790
2777
  * const cursor = await db.query(
2791
2778
  * // An AQL literal created from a normal multi-line string
2792
2779
  * aql.literal(`
2793
- * FOR u IN _users
2780
+ * FOR u IN @@users
2794
2781
  * FILTER u.authData.active == @active
2795
2782
  * RETURN u.user
2796
2783
  * `),
2797
- * { active: active }
2784
+ * { active: active, "@users": Users.name }
2798
2785
  * );
2799
2786
  * ```
2800
2787
  */
2801
- query(query: string | AqlLiteral, bindVars?: Dict<any>, options?: QueryOptions): Promise<ArrayCursor>;
2788
+ query<T = any>(query: string | AqlLiteral, bindVars?: Record<string, any>, options?: QueryOptions): Promise<ArrayCursor<T>>;
2802
2789
  /**
2803
2790
  * Explains a database query using the given `query`.
2804
2791
  *
2805
- * See the {@link aql} template string handler for information about how
2792
+ * See the {@link aql!aql} template string handler for information about how
2806
2793
  * to create a query string without manually defining bind parameters nor
2807
2794
  * having to worry about escaping variables.
2808
2795
  *
2809
2796
  * @param query - An object containing an AQL query string and bind
2810
- * parameters, e.g. the object returned from an {@link aql} template string.
2797
+ * parameters, e.g. the object returned from an {@link aql!aql} template string.
2811
2798
  * @param options - Options for explaining the query.
2812
2799
  *
2813
2800
  * @example
@@ -2823,16 +2810,16 @@ export declare class Database {
2823
2810
  */
2824
2811
  explain(query: AqlQuery, options?: ExplainOptions & {
2825
2812
  allPlans?: false;
2826
- }): Promise<ArangoResponseMetadata & SingleExplainResult>;
2813
+ }): Promise<ArangoApiResponse<SingleExplainResult>>;
2827
2814
  /**
2828
2815
  * Explains a database query using the given `query`.
2829
2816
  *
2830
- * See the {@link aql} template string handler for information about how
2817
+ * See the {@link aql!aql} template string handler for information about how
2831
2818
  * to create a query string without manually defining bind parameters nor
2832
2819
  * having to worry about escaping variables.
2833
2820
  *
2834
2821
  * @param query - An object containing an AQL query string and bind
2835
- * parameters, e.g. the object returned from an {@link aql} template string.
2822
+ * parameters, e.g. the object returned from an {@link aql!aql} template string.
2836
2823
  * @param options - Options for explaining the query.
2837
2824
  *
2838
2825
  * @example
@@ -2851,11 +2838,11 @@ export declare class Database {
2851
2838
  */
2852
2839
  explain(query: AqlQuery, options?: ExplainOptions & {
2853
2840
  allPlans: true;
2854
- }): Promise<ArangoResponseMetadata & MultiExplainResult>;
2841
+ }): Promise<ArangoApiResponse<MultiExplainResult>>;
2855
2842
  /**
2856
2843
  * Explains a database query using the given `query` and `bindVars`.
2857
2844
  *
2858
- * See the {@link aql} template string handler for a safer and easier
2845
+ * See the {@link aql!aql} template string handler for a safer and easier
2859
2846
  * alternative to passing strings directly.
2860
2847
  *
2861
2848
  * @param query - An AQL query string.
@@ -2876,13 +2863,13 @@ export declare class Database {
2876
2863
  * );
2877
2864
  * ```
2878
2865
  */
2879
- explain(query: string | AqlLiteral, bindVars?: Dict<any>, options?: ExplainOptions & {
2866
+ explain(query: string | AqlLiteral, bindVars?: Record<string, any>, options?: ExplainOptions & {
2880
2867
  allPlans?: false;
2881
- }): Promise<ArangoResponseMetadata & SingleExplainResult>;
2868
+ }): Promise<ArangoApiResponse<SingleExplainResult>>;
2882
2869
  /**
2883
2870
  * Explains a database query using the given `query` and `bindVars`.
2884
2871
  *
2885
- * See the {@link aql} template string handler for a safer and easier
2872
+ * See the {@link aql!aql} template string handler for a safer and easier
2886
2873
  * alternative to passing strings directly.
2887
2874
  *
2888
2875
  * @param query - An AQL query string.
@@ -2904,18 +2891,18 @@ export declare class Database {
2904
2891
  * );
2905
2892
  * ```
2906
2893
  */
2907
- explain(query: string | AqlLiteral, bindVars?: Dict<any>, options?: ExplainOptions & {
2894
+ explain(query: string | AqlLiteral, bindVars?: Record<string, any>, options?: ExplainOptions & {
2908
2895
  allPlans: true;
2909
- }): Promise<ArangoResponseMetadata & MultiExplainResult>;
2896
+ }): Promise<ArangoApiResponse<MultiExplainResult>>;
2910
2897
  /**
2911
2898
  * Parses the given query and returns the result.
2912
2899
  *
2913
- * See the {@link aql} template string handler for information about how
2900
+ * See the {@link aql!aql} template string handler for information about how
2914
2901
  * to create a query string without manually defining bind parameters nor
2915
2902
  * having to worry about escaping variables.
2916
2903
  *
2917
2904
  * @param query - An AQL query string or an object containing an AQL query
2918
- * string and bind parameters, e.g. the object returned from an {@link aql}
2905
+ * string and bind parameters, e.g. the object returned from an {@link aql!aql}
2919
2906
  * template string.
2920
2907
  *
2921
2908
  * @example
@@ -2930,6 +2917,19 @@ export declare class Database {
2930
2917
  * ```
2931
2918
  */
2932
2919
  parse(query: string | AqlQuery | AqlLiteral): Promise<ParseResult>;
2920
+ /**
2921
+ * Fetches the available optimizer rules.
2922
+ *
2923
+ * @example
2924
+ * ```js
2925
+ * const db = new Database();
2926
+ * const rules = await db.queryRules();
2927
+ * for (const rule of rules) {
2928
+ * console.log(rule.name);
2929
+ * }
2930
+ * ```
2931
+ */
2932
+ queryRules(): Promise<QueryOptimizerRule[]>;
2933
2933
  /**
2934
2934
  * Fetches the query tracking properties.
2935
2935
  *
@@ -2962,7 +2962,7 @@ export declare class Database {
2962
2962
  /**
2963
2963
  * Fetches a list of information for all currently running queries.
2964
2964
  *
2965
- * See also {@link Database.listSlowQueries} and {@link Database.killQuery}.
2965
+ * See also {@link Database#listSlowQueries} and {@link Database#killQuery}.
2966
2966
  *
2967
2967
  * @example
2968
2968
  * ```js
@@ -2974,8 +2974,8 @@ export declare class Database {
2974
2974
  /**
2975
2975
  * Fetches a list of information for all recent slow queries.
2976
2976
  *
2977
- * See also {@link Database.listRunningQueries} and
2978
- * {@link Database.clearSlowQueries}.
2977
+ * See also {@link Database#listRunningQueries} and
2978
+ * {@link Database#clearSlowQueries}.
2979
2979
  *
2980
2980
  * @example
2981
2981
  * ```js
@@ -2988,7 +2988,7 @@ export declare class Database {
2988
2988
  /**
2989
2989
  * Clears the list of recent slow queries.
2990
2990
  *
2991
- * See also {@link Database.listSlowQueries}.
2991
+ * See also {@link Database#listSlowQueries}.
2992
2992
  *
2993
2993
  * @example
2994
2994
  * ```js
@@ -3001,7 +3001,7 @@ export declare class Database {
3001
3001
  /**
3002
3002
  * Kills a running query with the given `queryId`.
3003
3003
  *
3004
- * See also {@link Database.listRunningQueries}.
3004
+ * See also {@link Database#listRunningQueries}.
3005
3005
  *
3006
3006
  * @param queryId - The ID of a currently running query.
3007
3007
  *
@@ -3061,9 +3061,9 @@ export declare class Database {
3061
3061
  * // cursor is a cursor for the query result
3062
3062
  * ```
3063
3063
  */
3064
- createFunction(name: string, code: string, isDeterministic?: boolean): Promise<ArangoResponseMetadata & {
3064
+ createFunction(name: string, code: string, isDeterministic?: boolean): Promise<ArangoApiResponse<{
3065
3065
  isNewlyCreated: boolean;
3066
- }>;
3066
+ }>>;
3067
3067
  /**
3068
3068
  * Deletes the AQL user function with the given name from the database.
3069
3069
  *
@@ -3079,9 +3079,9 @@ export declare class Database {
3079
3079
  * // the function no longer exists
3080
3080
  * ```
3081
3081
  */
3082
- dropFunction(name: string, group?: boolean): Promise<ArangoResponseMetadata & {
3082
+ dropFunction(name: string, group?: boolean): Promise<ArangoApiResponse<{
3083
3083
  deletedCount: number;
3084
- }>;
3084
+ }>>;
3085
3085
  /**
3086
3086
  * Fetches a list of all installed service.
3087
3087
  *
@@ -3231,8 +3231,8 @@ export declare class Database {
3231
3231
  * Retrieves information about the service's configuration options and their
3232
3232
  * current values.
3233
3233
  *
3234
- * See also {@link Database.replaceServiceConfiguration} and
3235
- * {@link Database.updateServiceConfiguration}.
3234
+ * See also {@link Database#replaceServiceConfiguration} and
3235
+ * {@link Database#updateServiceConfiguration}.
3236
3236
  *
3237
3237
  * @param mount - The service's mount point, relative to the database.
3238
3238
  * @param minimal - If set to `true`, the result will only include each
@@ -3248,13 +3248,13 @@ export declare class Database {
3248
3248
  * }
3249
3249
  * ```
3250
3250
  */
3251
- getServiceConfiguration(mount: string, minimal?: false): Promise<Dict<ServiceConfiguration>>;
3251
+ getServiceConfiguration(mount: string, minimal?: false): Promise<Record<string, ServiceConfiguration>>;
3252
3252
  /**
3253
3253
  * Retrieves information about the service's configuration options and their
3254
3254
  * current values.
3255
3255
  *
3256
- * See also {@link Database.replaceServiceConfiguration} and
3257
- * {@link Database.updateServiceConfiguration}.
3256
+ * See also {@link Database#replaceServiceConfiguration} and
3257
+ * {@link Database#updateServiceConfiguration}.
3258
3258
  *
3259
3259
  * @param mount - The service's mount point, relative to the database.
3260
3260
  * @param minimal - If set to `true`, the result will only include each
@@ -3270,13 +3270,13 @@ export declare class Database {
3270
3270
  * }
3271
3271
  * ```
3272
3272
  */
3273
- getServiceConfiguration(mount: string, minimal: true): Promise<Dict<any>>;
3273
+ getServiceConfiguration(mount: string, minimal: true): Promise<Record<string, any>>;
3274
3274
  /**
3275
3275
  * Replaces the configuration of the given service, discarding any existing
3276
3276
  * values for options not specified.
3277
3277
  *
3278
- * See also {@link Database.updateServiceConfiguration} and
3279
- * {@link Database.getServiceConfiguration}.
3278
+ * See also {@link Database#updateServiceConfiguration} and
3279
+ * {@link Database#getServiceConfiguration}.
3280
3280
  *
3281
3281
  * @param mount - The service's mount point, relative to the database.
3282
3282
  * @param cfg - An object mapping configuration option names to values.
@@ -3284,10 +3284,6 @@ export declare class Database {
3284
3284
  * configuration option's current value and warning (if any).
3285
3285
  * Otherwise it will include the full definition for each option.
3286
3286
  *
3287
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3288
- * to `true` avoids triggering a second request to fetch the full
3289
- * configuration definitions.
3290
- *
3291
3287
  * @example
3292
3288
  * ```js
3293
3289
  * const db = new Database();
@@ -3299,15 +3295,15 @@ export declare class Database {
3299
3295
  * }
3300
3296
  * ```
3301
3297
  */
3302
- replaceServiceConfiguration(mount: string, cfg: Dict<any>, minimal?: false): Promise<Dict<ServiceConfiguration & {
3298
+ replaceServiceConfiguration(mount: string, cfg: Record<string, any>, minimal?: false): Promise<Record<string, ServiceConfiguration & {
3303
3299
  warning?: string;
3304
3300
  }>>;
3305
3301
  /**
3306
3302
  * Replaces the configuration of the given service, discarding any existing
3307
3303
  * values for options not specified.
3308
3304
  *
3309
- * See also {@link Database.updateServiceConfiguration} and
3310
- * {@link Database.getServiceConfiguration}.
3305
+ * See also {@link Database#updateServiceConfiguration} and
3306
+ * {@link Database#getServiceConfiguration}.
3311
3307
  *
3312
3308
  * @param mount - The service's mount point, relative to the database.
3313
3309
  * @param cfg - An object mapping configuration option names to values.
@@ -3315,10 +3311,6 @@ export declare class Database {
3315
3311
  * configuration option's current value and warning (if any).
3316
3312
  * Otherwise it will include the full definition for each option.
3317
3313
  *
3318
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3319
- * to `true` avoids triggering a second request to fetch the full
3320
- * configuration definitions.
3321
- *
3322
3314
  * @example
3323
3315
  * ```js
3324
3316
  * const db = new Database();
@@ -3330,16 +3322,16 @@ export declare class Database {
3330
3322
  * }
3331
3323
  * ```
3332
3324
  */
3333
- replaceServiceConfiguration(mount: string, cfg: Dict<any>, minimal: true): Promise<{
3334
- values: Dict<any>;
3335
- warnings: Dict<string | undefined>;
3325
+ replaceServiceConfiguration(mount: string, cfg: Record<string, any>, minimal: true): Promise<{
3326
+ values: Record<string, any>;
3327
+ warnings: Record<string, string>;
3336
3328
  }>;
3337
3329
  /**
3338
3330
  * Updates the configuration of the given service while maintaining any
3339
3331
  * existing values for options not specified.
3340
3332
  *
3341
- * See also {@link Database.replaceServiceConfiguration} and
3342
- * {@link Database.getServiceConfiguration}.
3333
+ * See also {@link Database#replaceServiceConfiguration} and
3334
+ * {@link Database#getServiceConfiguration}.
3343
3335
  *
3344
3336
  * @param mount - The service's mount point, relative to the database.
3345
3337
  * @param cfg - An object mapping configuration option names to values.
@@ -3347,10 +3339,6 @@ export declare class Database {
3347
3339
  * configuration option's current value and warning (if any).
3348
3340
  * Otherwise it will include the full definition for each option.
3349
3341
  *
3350
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3351
- * to `true` avoids triggering a second request to fetch the full
3352
- * configuration definitions.
3353
- *
3354
3342
  * @example
3355
3343
  * ```js
3356
3344
  * const db = new Database();
@@ -3362,15 +3350,15 @@ export declare class Database {
3362
3350
  * }
3363
3351
  * ```
3364
3352
  */
3365
- updateServiceConfiguration(mount: string, cfg: Dict<any>, minimal?: false): Promise<Dict<ServiceConfiguration & {
3353
+ updateServiceConfiguration(mount: string, cfg: Record<string, any>, minimal?: false): Promise<Record<string, ServiceConfiguration & {
3366
3354
  warning?: string;
3367
3355
  }>>;
3368
3356
  /**
3369
3357
  * Updates the configuration of the given service while maintaining any
3370
3358
  * existing values for options not specified.
3371
3359
  *
3372
- * See also {@link Database.replaceServiceConfiguration} and
3373
- * {@link Database.getServiceConfiguration}.
3360
+ * See also {@link Database#replaceServiceConfiguration} and
3361
+ * {@link Database#getServiceConfiguration}.
3374
3362
  *
3375
3363
  * @param mount - The service's mount point, relative to the database.
3376
3364
  * @param cfg - An object mapping configuration option names to values.
@@ -3378,10 +3366,6 @@ export declare class Database {
3378
3366
  * configuration option's current value and warning (if any).
3379
3367
  * Otherwise it will include the full definition for each option.
3380
3368
  *
3381
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3382
- * to `true` avoids triggering a second request to fetch the full
3383
- * configuration definitions.
3384
- *
3385
3369
  * @example
3386
3370
  * ```js
3387
3371
  * const db = new Database();
@@ -3393,16 +3377,16 @@ export declare class Database {
3393
3377
  * }
3394
3378
  * ```
3395
3379
  */
3396
- updateServiceConfiguration(mount: string, cfg: Dict<any>, minimal: true): Promise<{
3397
- values: Dict<any>;
3398
- warnings: Dict<string | undefined>;
3380
+ updateServiceConfiguration(mount: string, cfg: Record<string, any>, minimal: true): Promise<{
3381
+ values: Record<string, any>;
3382
+ warnings: Record<string, string>;
3399
3383
  }>;
3400
3384
  /**
3401
3385
  * Retrieves information about the service's dependencies and their current
3402
3386
  * mount points.
3403
3387
  *
3404
- * See also {@link Database.replaceServiceDependencies} and
3405
- * {@link Database.updateServiceDependencies}.
3388
+ * See also {@link Database#replaceServiceDependencies} and
3389
+ * {@link Database#updateServiceDependencies}.
3406
3390
  *
3407
3391
  * @param mount - The service's mount point, relative to the database.
3408
3392
  * @param minimal - If set to `true`, the result will only include each
@@ -3418,13 +3402,13 @@ export declare class Database {
3418
3402
  * }
3419
3403
  * ```
3420
3404
  */
3421
- getServiceDependencies(mount: string, minimal?: false): Promise<Dict<SingleServiceDependency | MultiServiceDependency>>;
3405
+ getServiceDependencies(mount: string, minimal?: false): Promise<Record<string, SingleServiceDependency | MultiServiceDependency>>;
3422
3406
  /**
3423
3407
  * Retrieves information about the service's dependencies and their current
3424
3408
  * mount points.
3425
3409
  *
3426
- * See also {@link Database.replaceServiceDependencies} and
3427
- * {@link Database.updateServiceDependencies}.
3410
+ * See also {@link Database#replaceServiceDependencies} and
3411
+ * {@link Database#updateServiceDependencies}.
3428
3412
  *
3429
3413
  * @param mount - The service's mount point, relative to the database.
3430
3414
  * @param minimal - If set to `true`, the result will only include each
@@ -3440,13 +3424,13 @@ export declare class Database {
3440
3424
  * }
3441
3425
  * ```
3442
3426
  */
3443
- getServiceDependencies(mount: string, minimal: true): Promise<Dict<string | string[] | undefined>>;
3427
+ getServiceDependencies(mount: string, minimal: true): Promise<Record<string, string | string[]>>;
3444
3428
  /**
3445
3429
  * Replaces the dependencies of the given service, discarding any existing
3446
3430
  * mount points for dependencies not specified.
3447
3431
  *
3448
- * See also {@link Database.updateServiceDependencies} and
3449
- * {@link Database.getServiceDependencies}.
3432
+ * See also {@link Database#updateServiceDependencies} and
3433
+ * {@link Database#getServiceDependencies}.
3450
3434
  *
3451
3435
  * @param mount - The service's mount point, relative to the database.
3452
3436
  * @param cfg - An object mapping dependency aliases to mount points.
@@ -3454,10 +3438,6 @@ export declare class Database {
3454
3438
  * dependency's current mount point. Otherwise it will include the full
3455
3439
  * definition for each dependency.
3456
3440
  *
3457
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3458
- * to `true` avoids triggering a second request to fetch the full
3459
- * dependency definitions.
3460
- *
3461
3441
  * @example
3462
3442
  * ```js
3463
3443
  * const db = new Database();
@@ -3469,15 +3449,15 @@ export declare class Database {
3469
3449
  * }
3470
3450
  * ```
3471
3451
  */
3472
- replaceServiceDependencies(mount: string, deps: Dict<string>, minimal?: false): Promise<Dict<(SingleServiceDependency | MultiServiceDependency) & {
3452
+ replaceServiceDependencies(mount: string, deps: Record<string, string>, minimal?: false): Promise<Record<string, (SingleServiceDependency | MultiServiceDependency) & {
3473
3453
  warning?: string;
3474
3454
  }>>;
3475
3455
  /**
3476
3456
  * Replaces the dependencies of the given service, discarding any existing
3477
3457
  * mount points for dependencies not specified.
3478
3458
  *
3479
- * See also {@link Database.updateServiceDependencies} and
3480
- * {@link Database.getServiceDependencies}.
3459
+ * See also {@link Database#updateServiceDependencies} and
3460
+ * {@link Database#getServiceDependencies}.
3481
3461
  *
3482
3462
  * @param mount - The service's mount point, relative to the database.
3483
3463
  * @param cfg - An object mapping dependency aliases to mount points.
@@ -3485,10 +3465,6 @@ export declare class Database {
3485
3465
  * dependency's current mount point. Otherwise it will include the full
3486
3466
  * definition for each dependency.
3487
3467
  *
3488
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3489
- * to `true` avoids triggering a second request to fetch the full
3490
- * dependency definitions.
3491
- *
3492
3468
  * @example
3493
3469
  * ```js
3494
3470
  * const db = new Database();
@@ -3504,16 +3480,16 @@ export declare class Database {
3504
3480
  * }
3505
3481
  * ```
3506
3482
  */
3507
- replaceServiceDependencies(mount: string, deps: Dict<string>, minimal: true): Promise<{
3508
- values: Dict<string>;
3509
- warnings: Dict<string | undefined>;
3483
+ replaceServiceDependencies(mount: string, deps: Record<string, string>, minimal: true): Promise<{
3484
+ values: Record<string, string>;
3485
+ warnings: Record<string, string>;
3510
3486
  }>;
3511
3487
  /**
3512
3488
  * Updates the dependencies of the given service while maintaining any
3513
3489
  * existing mount points for dependencies not specified.
3514
3490
  *
3515
- * See also {@link Database.replaceServiceDependencies} and
3516
- * {@link Database.getServiceDependencies}.
3491
+ * See also {@link Database#replaceServiceDependencies} and
3492
+ * {@link Database#getServiceDependencies}.
3517
3493
  *
3518
3494
  * @param mount - The service's mount point, relative to the database.
3519
3495
  * @param cfg - An object mapping dependency aliases to mount points.
@@ -3521,10 +3497,6 @@ export declare class Database {
3521
3497
  * dependency's current mount point. Otherwise it will include the full
3522
3498
  * definition for each dependency.
3523
3499
  *
3524
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3525
- * to `true` avoids triggering a second request to fetch the full
3526
- * dependency definitions.
3527
- *
3528
3500
  * @example
3529
3501
  * ```js
3530
3502
  * const db = new Database();
@@ -3536,15 +3508,15 @@ export declare class Database {
3536
3508
  * }
3537
3509
  * ```
3538
3510
  */
3539
- updateServiceDependencies(mount: string, deps: Dict<string>, minimal?: false): Promise<Dict<(SingleServiceDependency | MultiServiceDependency) & {
3511
+ updateServiceDependencies(mount: string, deps: Record<string, string>, minimal?: false): Promise<Record<string, (SingleServiceDependency | MultiServiceDependency) & {
3540
3512
  warning?: string;
3541
3513
  }>>;
3542
3514
  /**
3543
3515
  * Updates the dependencies of the given service while maintaining any
3544
3516
  * existing mount points for dependencies not specified.
3545
3517
  *
3546
- * See also {@link Database.replaceServiceDependencies} and
3547
- * {@link Database.getServiceDependencies}.
3518
+ * See also {@link Database#replaceServiceDependencies} and
3519
+ * {@link Database#getServiceDependencies}.
3548
3520
  *
3549
3521
  * @param mount - The service's mount point, relative to the database.
3550
3522
  * @param cfg - An object mapping dependency aliases to mount points.
@@ -3552,10 +3524,6 @@ export declare class Database {
3552
3524
  * dependency's current mount point. Otherwise it will include the full
3553
3525
  * definition for each dependency.
3554
3526
  *
3555
- * **Note**: When using ArangoDB 3.2.8 or older, setting the `minimal` option
3556
- * to `true` avoids triggering a second request to fetch the full
3557
- * dependency definitions.
3558
- *
3559
3527
  * @example
3560
3528
  * ```js
3561
3529
  * const db = new Database();
@@ -3571,9 +3539,9 @@ export declare class Database {
3571
3539
  * }
3572
3540
  * ```
3573
3541
  */
3574
- updateServiceDependencies(mount: string, deps: Dict<string>, minimal: true): Promise<{
3575
- values: Dict<string>;
3576
- warnings: Dict<string | undefined>;
3542
+ updateServiceDependencies(mount: string, deps: Record<string, string>, minimal: true): Promise<{
3543
+ values: Record<string, string>;
3544
+ warnings: Record<string, string>;
3577
3545
  }>;
3578
3546
  /**
3579
3547
  * Enables or disables development mode for the given service.
@@ -3606,7 +3574,7 @@ export declare class Database {
3606
3574
  * }
3607
3575
  * ```
3608
3576
  */
3609
- listServiceScripts(mount: string): Promise<Dict<string>>;
3577
+ listServiceScripts(mount: string): Promise<Record<string, string>>;
3610
3578
  /**
3611
3579
  * Executes a service script and retrieves its result exposed as
3612
3580
  * `module.exports` (if any).