arangojs 9.2.0 → 10.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +395 -0
- package/MIGRATING.md +50 -0
- package/README.md +91 -27
- package/administration.d.ts +346 -0
- package/administration.d.ts.map +1 -0
- package/analyzers.d.ts +711 -0
- package/analyzers.d.ts.map +1 -0
- package/aql.d.ts +5 -5
- package/aql.d.ts.map +1 -1
- package/cjs/administration.d.ts +346 -0
- package/cjs/administration.d.ts.map +1 -0
- package/cjs/administration.js +13 -0
- package/cjs/administration.js.map +1 -0
- package/cjs/analyzers.d.ts +711 -0
- package/cjs/analyzers.d.ts.map +1 -0
- package/cjs/{analyzer.js → analyzers.js} +35 -9
- package/cjs/analyzers.js.map +1 -0
- package/cjs/aql.d.ts +5 -5
- package/cjs/aql.d.ts.map +1 -1
- package/cjs/aql.js +33 -10
- package/cjs/aql.js.map +1 -1
- package/cjs/cluster.d.ts +178 -0
- package/cjs/cluster.d.ts.map +1 -0
- package/cjs/cluster.js +13 -0
- package/cjs/cluster.js.map +1 -0
- package/cjs/{collection.d.ts → collections.d.ts} +395 -865
- package/cjs/collections.d.ts.map +1 -0
- package/cjs/{collection.js → collections.js} +89 -62
- package/cjs/collections.js.map +1 -0
- package/cjs/configuration.d.ts +181 -0
- package/cjs/configuration.d.ts.map +1 -0
- package/cjs/configuration.js +12 -0
- package/cjs/configuration.js.map +1 -0
- package/cjs/connection.d.ts +240 -227
- package/cjs/connection.d.ts.map +1 -1
- package/cjs/connection.js +435 -208
- package/cjs/connection.js.map +1 -1
- package/{esm/cursor.d.ts → cjs/cursors.d.ts} +69 -62
- package/cjs/cursors.d.ts.map +1 -0
- package/cjs/{cursor.js → cursors.js} +57 -48
- package/cjs/cursors.js.map +1 -0
- package/cjs/{database.d.ts → databases.d.ts} +285 -2096
- package/cjs/databases.d.ts.map +1 -0
- package/cjs/{database.js → databases.js} +212 -242
- package/cjs/databases.js.map +1 -0
- package/cjs/documents.d.ts +445 -13
- package/cjs/documents.d.ts.map +1 -1
- package/cjs/documents.js +2 -1
- package/cjs/documents.js.map +1 -1
- package/cjs/errors.d.ts +207 -0
- package/cjs/errors.d.ts.map +1 -0
- package/cjs/errors.js +320 -0
- package/cjs/errors.js.map +1 -0
- package/cjs/foxx-manifest.d.ts +1 -1
- package/cjs/foxx-manifest.d.ts.map +1 -1
- package/cjs/foxx-manifest.js +1 -1
- package/cjs/foxx-manifest.js.map +1 -1
- package/cjs/{graph.d.ts → graphs.d.ts} +125 -112
- package/cjs/graphs.d.ts.map +1 -0
- package/cjs/{graph.js → graphs.js} +110 -81
- package/cjs/graphs.js.map +1 -0
- package/cjs/hot-backups.d.ts +68 -0
- package/cjs/hot-backups.d.ts.map +1 -0
- package/cjs/hot-backups.js +12 -0
- package/cjs/hot-backups.js.map +1 -0
- package/cjs/index.d.ts +9 -9
- package/cjs/index.d.ts.map +1 -1
- package/cjs/index.js +28 -5
- package/cjs/index.js.map +1 -1
- package/cjs/indexes.d.ts +267 -327
- package/cjs/indexes.d.ts.map +1 -1
- package/cjs/indexes.js +2 -1
- package/cjs/indexes.js.map +1 -1
- package/{esm/job.d.ts → cjs/jobs.d.ts} +24 -13
- package/cjs/jobs.d.ts.map +1 -0
- package/cjs/{job.js → jobs.js} +8 -6
- package/cjs/jobs.js.map +1 -0
- package/cjs/lib/util.d.ts +50 -0
- package/cjs/lib/util.d.ts.map +1 -0
- package/cjs/lib/util.js +108 -0
- package/cjs/lib/util.js.map +1 -0
- package/cjs/lib/{linkedList.d.ts → x3-linkedlist.d.ts} +1 -1
- package/cjs/lib/x3-linkedlist.d.ts.map +1 -0
- package/cjs/lib/{linkedList.js → x3-linkedlist.js} +1 -1
- package/cjs/lib/x3-linkedlist.js.map +1 -0
- package/cjs/logs.d.ts +92 -0
- package/cjs/logs.d.ts.map +1 -0
- package/cjs/logs.js +26 -0
- package/cjs/logs.js.map +1 -0
- package/cjs/queries.d.ts +502 -0
- package/cjs/queries.d.ts.map +1 -0
- package/cjs/queries.js +13 -0
- package/cjs/queries.js.map +1 -0
- package/cjs/{route.d.ts → routes.d.ts} +33 -33
- package/cjs/routes.d.ts.map +1 -0
- package/cjs/routes.js +143 -0
- package/cjs/routes.js.map +1 -0
- package/cjs/services.d.ts +514 -0
- package/cjs/services.d.ts.map +1 -0
- package/cjs/services.js +4 -0
- package/cjs/services.js.map +1 -0
- package/{esm/transaction.d.ts → cjs/transactions.d.ts} +118 -15
- package/cjs/transactions.d.ts.map +1 -0
- package/cjs/{transaction.js → transactions.js} +83 -9
- package/cjs/transactions.js.map +1 -0
- package/cjs/users.d.ts +96 -0
- package/cjs/users.d.ts.map +1 -0
- package/cjs/users.js +4 -0
- package/cjs/users.js.map +1 -0
- package/{view.d.ts → cjs/views.d.ts} +209 -202
- package/cjs/views.d.ts.map +1 -0
- package/cjs/{view.js → views.js} +44 -13
- package/cjs/views.js.map +1 -0
- package/cluster.d.ts +178 -0
- package/cluster.d.ts.map +1 -0
- package/{collection.d.ts → collections.d.ts} +395 -865
- package/collections.d.ts.map +1 -0
- package/configuration.d.ts +181 -0
- package/configuration.d.ts.map +1 -0
- package/connection.d.ts +240 -227
- package/connection.d.ts.map +1 -1
- package/{cursor.d.ts → cursors.d.ts} +69 -62
- package/cursors.d.ts.map +1 -0
- package/{database.d.ts → databases.d.ts} +285 -2096
- package/databases.d.ts.map +1 -0
- package/documents.d.ts +445 -13
- package/documents.d.ts.map +1 -1
- package/errors.d.ts +207 -0
- package/errors.d.ts.map +1 -0
- package/esm/administration.d.ts +346 -0
- package/esm/administration.d.ts.map +1 -0
- package/esm/administration.js +12 -0
- package/esm/administration.js.map +1 -0
- package/esm/analyzers.d.ts +711 -0
- package/esm/analyzers.d.ts.map +1 -0
- package/esm/{analyzer.js → analyzers.js} +12 -9
- package/esm/analyzers.js.map +1 -0
- package/esm/aql.d.ts +5 -5
- package/esm/aql.d.ts.map +1 -1
- package/esm/aql.js +10 -10
- package/esm/aql.js.map +1 -1
- package/esm/cluster.d.ts +178 -0
- package/esm/cluster.d.ts.map +1 -0
- package/esm/cluster.js +12 -0
- package/esm/cluster.js.map +1 -0
- package/esm/{collection.d.ts → collections.d.ts} +395 -865
- package/esm/collections.d.ts.map +1 -0
- package/esm/{collection.js → collections.js} +66 -62
- package/esm/collections.js.map +1 -0
- package/esm/configuration.d.ts +181 -0
- package/esm/configuration.d.ts.map +1 -0
- package/esm/configuration.js +8 -0
- package/esm/configuration.js.map +1 -0
- package/esm/connection.d.ts +240 -227
- package/esm/connection.d.ts.map +1 -1
- package/esm/connection.js +406 -205
- package/esm/connection.js.map +1 -1
- package/{cjs/cursor.d.ts → esm/cursors.d.ts} +69 -62
- package/esm/cursors.d.ts.map +1 -0
- package/esm/{cursor.js → cursors.js} +52 -43
- package/esm/cursors.js.map +1 -0
- package/esm/{database.d.ts → databases.d.ts} +285 -2096
- package/esm/databases.d.ts.map +1 -0
- package/esm/{database.js → databases.js} +188 -241
- package/esm/databases.js.map +1 -0
- package/esm/documents.d.ts +445 -13
- package/esm/documents.d.ts.map +1 -1
- package/esm/documents.js +2 -1
- package/esm/documents.js.map +1 -1
- package/esm/errors.d.ts +207 -0
- package/esm/errors.d.ts.map +1 -0
- package/esm/errors.js +283 -0
- package/esm/errors.js.map +1 -0
- package/esm/foxx-manifest.d.ts +1 -1
- package/esm/foxx-manifest.d.ts.map +1 -1
- package/esm/foxx-manifest.js +1 -1
- package/esm/foxx-manifest.js.map +1 -1
- package/esm/{graph.d.ts → graphs.d.ts} +125 -112
- package/esm/graphs.d.ts.map +1 -0
- package/esm/{graph.js → graphs.js} +85 -79
- package/esm/graphs.js.map +1 -0
- package/esm/hot-backups.d.ts +68 -0
- package/esm/hot-backups.d.ts.map +1 -0
- package/esm/hot-backups.js +11 -0
- package/esm/hot-backups.js.map +1 -0
- package/esm/index.d.ts +9 -9
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +4 -4
- package/esm/index.js.map +1 -1
- package/esm/indexes.d.ts +267 -327
- package/esm/indexes.d.ts.map +1 -1
- package/esm/indexes.js +2 -1
- package/esm/indexes.js.map +1 -1
- package/{job.d.ts → esm/jobs.d.ts} +24 -13
- package/esm/jobs.d.ts.map +1 -0
- package/esm/{job.js → jobs.js} +8 -6
- package/esm/jobs.js.map +1 -0
- package/esm/lib/util.d.ts +50 -0
- package/esm/lib/util.d.ts.map +1 -0
- package/esm/lib/util.js +99 -0
- package/esm/lib/util.js.map +1 -0
- package/{lib/linkedList.d.ts → esm/lib/x3-linkedlist.d.ts} +1 -1
- package/esm/lib/x3-linkedlist.d.ts.map +1 -0
- package/esm/lib/{linkedList.js → x3-linkedlist.js} +1 -1
- package/esm/lib/x3-linkedlist.js.map +1 -0
- package/esm/logs.d.ts +92 -0
- package/esm/logs.d.ts.map +1 -0
- package/esm/logs.js +23 -0
- package/esm/logs.js.map +1 -0
- package/esm/queries.d.ts +502 -0
- package/esm/queries.d.ts.map +1 -0
- package/esm/queries.js +12 -0
- package/esm/queries.js.map +1 -0
- package/esm/{route.d.ts → routes.d.ts} +33 -33
- package/esm/routes.d.ts.map +1 -0
- package/esm/routes.js +116 -0
- package/esm/routes.js.map +1 -0
- package/esm/services.d.ts +514 -0
- package/esm/services.d.ts.map +1 -0
- package/esm/services.js +3 -0
- package/esm/services.js.map +1 -0
- package/{transaction.d.ts → esm/transactions.d.ts} +118 -15
- package/esm/transactions.d.ts.map +1 -0
- package/esm/{transaction.js → transactions.js} +58 -8
- package/esm/transactions.js.map +1 -0
- package/esm/users.d.ts +96 -0
- package/esm/users.d.ts.map +1 -0
- package/esm/users.js +3 -0
- package/esm/users.js.map +1 -0
- package/esm/{view.d.ts → views.d.ts} +209 -202
- package/esm/views.d.ts.map +1 -0
- package/esm/{view.js → views.js} +21 -13
- package/esm/views.js.map +1 -0
- package/foxx-manifest.d.ts +1 -1
- package/foxx-manifest.d.ts.map +1 -1
- package/{graph.d.ts → graphs.d.ts} +125 -112
- package/graphs.d.ts.map +1 -0
- package/hot-backups.d.ts +68 -0
- package/hot-backups.d.ts.map +1 -0
- package/index.d.ts +9 -9
- package/index.d.ts.map +1 -1
- package/indexes.d.ts +267 -327
- package/indexes.d.ts.map +1 -1
- package/{cjs/job.d.ts → jobs.d.ts} +24 -13
- package/jobs.d.ts.map +1 -0
- package/lib/util.d.ts +50 -0
- package/lib/util.d.ts.map +1 -0
- package/{esm/lib/linkedList.d.ts → lib/x3-linkedlist.d.ts} +1 -1
- package/lib/x3-linkedlist.d.ts.map +1 -0
- package/logs.d.ts +92 -0
- package/logs.d.ts.map +1 -0
- package/package.json +4 -1
- package/queries.d.ts +502 -0
- package/queries.d.ts.map +1 -0
- package/{route.d.ts → routes.d.ts} +33 -33
- package/routes.d.ts.map +1 -0
- package/services.d.ts +514 -0
- package/services.d.ts.map +1 -0
- package/{cjs/transaction.d.ts → transactions.d.ts} +118 -15
- package/transactions.d.ts.map +1 -0
- package/users.d.ts +96 -0
- package/users.d.ts.map +1 -0
- package/{cjs/view.d.ts → views.d.ts} +209 -202
- package/views.d.ts.map +1 -0
- package/analyzer.d.ts +0 -954
- package/analyzer.d.ts.map +0 -1
- package/cjs/analyzer.d.ts +0 -954
- package/cjs/analyzer.d.ts.map +0 -1
- package/cjs/analyzer.js.map +0 -1
- package/cjs/collection.d.ts.map +0 -1
- package/cjs/collection.js.map +0 -1
- package/cjs/cursor.d.ts.map +0 -1
- package/cjs/cursor.js.map +0 -1
- package/cjs/database.d.ts.map +0 -1
- package/cjs/database.js.map +0 -1
- package/cjs/error.d.ts +0 -94
- package/cjs/error.d.ts.map +0 -1
- package/cjs/error.js +0 -189
- package/cjs/error.js.map +0 -1
- package/cjs/graph.d.ts.map +0 -1
- package/cjs/graph.js.map +0 -1
- package/cjs/job.d.ts.map +0 -1
- package/cjs/job.js.map +0 -1
- package/cjs/lib/joinPath.d.ts +0 -11
- package/cjs/lib/joinPath.d.ts.map +0 -1
- package/cjs/lib/joinPath.js +0 -23
- package/cjs/lib/joinPath.js.map +0 -1
- package/cjs/lib/linkedList.d.ts.map +0 -1
- package/cjs/lib/linkedList.js.map +0 -1
- package/cjs/lib/mergeHeaders.d.ts +0 -12
- package/cjs/lib/mergeHeaders.d.ts.map +0 -1
- package/cjs/lib/mergeHeaders.js +0 -22
- package/cjs/lib/mergeHeaders.js.map +0 -1
- package/cjs/lib/normalizeUrl.d.ts +0 -11
- package/cjs/lib/normalizeUrl.d.ts.map +0 -1
- package/cjs/lib/normalizeUrl.js +0 -23
- package/cjs/lib/normalizeUrl.js.map +0 -1
- package/cjs/lib/request.d.ts +0 -66
- package/cjs/lib/request.d.ts.map +0 -1
- package/cjs/lib/request.js +0 -100
- package/cjs/lib/request.js.map +0 -1
- package/cjs/route.d.ts.map +0 -1
- package/cjs/route.js +0 -128
- package/cjs/route.js.map +0 -1
- package/cjs/transaction.d.ts.map +0 -1
- package/cjs/transaction.js.map +0 -1
- package/cjs/view.d.ts.map +0 -1
- package/cjs/view.js.map +0 -1
- package/collection.d.ts.map +0 -1
- package/cursor.d.ts.map +0 -1
- package/database.d.ts.map +0 -1
- package/error.d.ts +0 -94
- package/error.d.ts.map +0 -1
- package/esm/analyzer.d.ts +0 -954
- package/esm/analyzer.d.ts.map +0 -1
- package/esm/analyzer.js.map +0 -1
- package/esm/collection.d.ts.map +0 -1
- package/esm/collection.js.map +0 -1
- package/esm/cursor.d.ts.map +0 -1
- package/esm/cursor.js.map +0 -1
- package/esm/database.d.ts.map +0 -1
- package/esm/database.js.map +0 -1
- package/esm/error.d.ts +0 -94
- package/esm/error.d.ts.map +0 -1
- package/esm/error.js +0 -181
- package/esm/error.js.map +0 -1
- package/esm/graph.d.ts.map +0 -1
- package/esm/graph.js.map +0 -1
- package/esm/job.d.ts.map +0 -1
- package/esm/job.js.map +0 -1
- package/esm/lib/joinPath.d.ts +0 -11
- package/esm/lib/joinPath.d.ts.map +0 -1
- package/esm/lib/joinPath.js +0 -19
- package/esm/lib/joinPath.js.map +0 -1
- package/esm/lib/linkedList.d.ts.map +0 -1
- package/esm/lib/linkedList.js.map +0 -1
- package/esm/lib/mergeHeaders.d.ts +0 -12
- package/esm/lib/mergeHeaders.d.ts.map +0 -1
- package/esm/lib/mergeHeaders.js +0 -18
- package/esm/lib/mergeHeaders.js.map +0 -1
- package/esm/lib/normalizeUrl.d.ts +0 -11
- package/esm/lib/normalizeUrl.d.ts.map +0 -1
- package/esm/lib/normalizeUrl.js +0 -19
- package/esm/lib/normalizeUrl.js.map +0 -1
- package/esm/lib/request.d.ts +0 -66
- package/esm/lib/request.d.ts.map +0 -1
- package/esm/lib/request.js +0 -96
- package/esm/lib/request.js.map +0 -1
- package/esm/route.d.ts.map +0 -1
- package/esm/route.js +0 -124
- package/esm/route.js.map +0 -1
- package/esm/transaction.d.ts.map +0 -1
- package/esm/transaction.js.map +0 -1
- package/esm/view.d.ts.map +0 -1
- package/esm/view.js.map +0 -1
- package/graph.d.ts.map +0 -1
- package/job.d.ts.map +0 -1
- package/lib/joinPath.d.ts +0 -11
- package/lib/joinPath.d.ts.map +0 -1
- package/lib/linkedList.d.ts.map +0 -1
- package/lib/mergeHeaders.d.ts +0 -12
- package/lib/mergeHeaders.d.ts.map +0 -1
- package/lib/normalizeUrl.d.ts +0 -11
- package/lib/normalizeUrl.d.ts.map +0 -1
- package/lib/request.d.ts +0 -66
- package/lib/request.d.ts.map +0 -1
- package/route.d.ts.map +0 -1
- package/transaction.d.ts.map +0 -1
- package/view.d.ts.map +0 -1
package/cjs/logs.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```ts
|
|
3
|
+
* import type { LogLevel } from "arangojs/logs";
|
|
4
|
+
* ```
|
|
5
|
+
*
|
|
6
|
+
* The "logs" module provides types for ArangoDB logs.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Numeric representation of the logging level of a log entry.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum LogLevel {
|
|
14
|
+
FATAL = 0,
|
|
15
|
+
ERROR = 1,
|
|
16
|
+
WARNING = 2,
|
|
17
|
+
INFO = 3,
|
|
18
|
+
DEBUG = 4
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* String representation of the logging level of a log entry.
|
|
22
|
+
*/
|
|
23
|
+
export type LogLevelLabel = keyof typeof LogLevel;
|
|
24
|
+
/**
|
|
25
|
+
* Logging level setting.
|
|
26
|
+
*/
|
|
27
|
+
export type LogLevelSetting = LogLevelLabel | "DEFAULT";
|
|
28
|
+
/**
|
|
29
|
+
* Log sorting direction, ascending or descending.
|
|
30
|
+
*/
|
|
31
|
+
export type LogSortDirection = "asc" | "desc";
|
|
32
|
+
/**
|
|
33
|
+
* Options for retrieving log entries.
|
|
34
|
+
*/
|
|
35
|
+
export type LogEntriesOptions = {
|
|
36
|
+
/**
|
|
37
|
+
* Maximum log level of the entries to retrieve.
|
|
38
|
+
*
|
|
39
|
+
* Default: `INFO`.
|
|
40
|
+
*/
|
|
41
|
+
upto?: LogLevel | LogLevelLabel | Lowercase<LogLevelLabel>;
|
|
42
|
+
/**
|
|
43
|
+
* If set, only log entries with this log level will be returned.
|
|
44
|
+
*/
|
|
45
|
+
level?: LogLevel | LogLevelLabel | Lowercase<LogLevelLabel>;
|
|
46
|
+
/**
|
|
47
|
+
* If set, only log entries with an `lid` greater than or equal to this value
|
|
48
|
+
* will be returned.
|
|
49
|
+
*/
|
|
50
|
+
start?: number;
|
|
51
|
+
/**
|
|
52
|
+
* If set, only this many entries will be returned.
|
|
53
|
+
*/
|
|
54
|
+
size?: number;
|
|
55
|
+
/**
|
|
56
|
+
* If set, this many log entries will be skipped.
|
|
57
|
+
*/
|
|
58
|
+
offset?: number;
|
|
59
|
+
/**
|
|
60
|
+
* If set, only log entries containing the specified text will be returned.
|
|
61
|
+
*/
|
|
62
|
+
search?: string;
|
|
63
|
+
/**
|
|
64
|
+
* If set to `"desc"`, log entries will be returned in reverse chronological
|
|
65
|
+
* order.
|
|
66
|
+
*
|
|
67
|
+
* Default: `"asc"`.
|
|
68
|
+
*/
|
|
69
|
+
sort?: LogSortDirection;
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* An object representing a single log entry.
|
|
73
|
+
*/
|
|
74
|
+
export type LogMessage = {
|
|
75
|
+
id: number;
|
|
76
|
+
topic: string;
|
|
77
|
+
level: LogLevelLabel;
|
|
78
|
+
date: string;
|
|
79
|
+
message: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* An object representing a list of log entries.
|
|
83
|
+
*/
|
|
84
|
+
export type LogEntries = {
|
|
85
|
+
totalAmount: number;
|
|
86
|
+
lid: number[];
|
|
87
|
+
topic: string[];
|
|
88
|
+
level: LogLevel[];
|
|
89
|
+
timestamp: number[];
|
|
90
|
+
text: string[];
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/logs.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH;;GAEG;AACH,oBAAY,QAAQ;IAClB,KAAK,IAAA;IACL,KAAK,IAAA;IACL,OAAO,IAAA;IACP,IAAI,IAAA;IACJ,KAAK,IAAA;CACN;AAED;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,QAAQ,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,CAAC;AAI9C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;OAIG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;IAC3D;;OAEG;IACH,KAAK,CAAC,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,CAAC,aAAa,CAAC,CAAC;IAC5D;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB,CAAC"}
|
package/cjs/logs.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ```ts
|
|
4
|
+
* import type { LogLevel } from "arangojs/logs";
|
|
5
|
+
* ```
|
|
6
|
+
*
|
|
7
|
+
* The "logs" module provides types for ArangoDB logs.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.LogLevel = void 0;
|
|
13
|
+
//#region Shared types
|
|
14
|
+
/**
|
|
15
|
+
* Numeric representation of the logging level of a log entry.
|
|
16
|
+
*/
|
|
17
|
+
var LogLevel;
|
|
18
|
+
(function (LogLevel) {
|
|
19
|
+
LogLevel[LogLevel["FATAL"] = 0] = "FATAL";
|
|
20
|
+
LogLevel[LogLevel["ERROR"] = 1] = "ERROR";
|
|
21
|
+
LogLevel[LogLevel["WARNING"] = 2] = "WARNING";
|
|
22
|
+
LogLevel[LogLevel["INFO"] = 3] = "INFO";
|
|
23
|
+
LogLevel[LogLevel["DEBUG"] = 4] = "DEBUG";
|
|
24
|
+
})(LogLevel || (exports.LogLevel = LogLevel = {}));
|
|
25
|
+
//#endregion
|
|
26
|
+
//# sourceMappingURL=logs.js.map
|
package/cjs/logs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../src/logs.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAEH,sBAAsB;AACtB;;GAEG;AACH,IAAY,QAMX;AAND,WAAY,QAAQ;IAClB,yCAAK,CAAA;IACL,yCAAK,CAAA;IACL,6CAAO,CAAA;IACP,uCAAI,CAAA;IACJ,yCAAK,CAAA;AACP,CAAC,EANW,QAAQ,wBAAR,QAAQ,QAMnB;AAmFD,YAAY","sourcesContent":["/**\n * ```ts\n * import type { LogLevel } from \"arangojs/logs\";\n * ```\n *\n * The \"logs\" module provides types for ArangoDB logs.\n *\n * @packageDocumentation\n */\n\n//#region Shared types\n/**\n * Numeric representation of the logging level of a log entry.\n */\nexport enum LogLevel {\n FATAL,\n ERROR,\n WARNING,\n INFO,\n DEBUG,\n}\n\n/**\n * String representation of the logging level of a log entry.\n */\nexport type LogLevelLabel = keyof typeof LogLevel;\n\n/**\n * Logging level setting.\n */\nexport type LogLevelSetting = LogLevelLabel | \"DEFAULT\";\n\n/**\n * Log sorting direction, ascending or descending.\n */\nexport type LogSortDirection = \"asc\" | \"desc\";\n//#endregion\n\n//#region Log operation options\n/**\n * Options for retrieving log entries.\n */\nexport type LogEntriesOptions = {\n /**\n * Maximum log level of the entries to retrieve.\n *\n * Default: `INFO`.\n */\n upto?: LogLevel | LogLevelLabel | Lowercase<LogLevelLabel>;\n /**\n * If set, only log entries with this log level will be returned.\n */\n level?: LogLevel | LogLevelLabel | Lowercase<LogLevelLabel>;\n /**\n * If set, only log entries with an `lid` greater than or equal to this value\n * will be returned.\n */\n start?: number;\n /**\n * If set, only this many entries will be returned.\n */\n size?: number;\n /**\n * If set, this many log entries will be skipped.\n */\n offset?: number;\n /**\n * If set, only log entries containing the specified text will be returned.\n */\n search?: string;\n /**\n * If set to `\"desc\"`, log entries will be returned in reverse chronological\n * order.\n *\n * Default: `\"asc\"`.\n */\n sort?: LogSortDirection;\n};\n//#endregion\n\n//#region Log operation results\n/**\n * An object representing a single log entry.\n */\nexport type LogMessage = {\n id: number;\n topic: string;\n level: LogLevelLabel;\n date: string;\n message: string;\n};\n\n/**\n * An object representing a list of log entries.\n */\nexport type LogEntries = {\n totalAmount: number;\n lid: number[];\n topic: string[];\n level: LogLevel[];\n timestamp: number[];\n text: string[];\n};\n//#endregion"]}
|
package/cjs/queries.d.ts
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```ts
|
|
3
|
+
* import type { QueryOptions } from "arangojs/queries";
|
|
4
|
+
* ```
|
|
5
|
+
*
|
|
6
|
+
* The "query" module provides query related types for TypeScript.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Options for executing a query.
|
|
12
|
+
*
|
|
13
|
+
* See {@link databases.Database#query}.
|
|
14
|
+
*/
|
|
15
|
+
export type QueryOptions = {
|
|
16
|
+
/**
|
|
17
|
+
* If set to `true`, the query will be executed with support for dirty reads
|
|
18
|
+
* enabled, permitting ArangoDB to return a potentially dirty or stale result
|
|
19
|
+
* and arangojs will load balance the request without distinguishing between
|
|
20
|
+
* leaders and followers.
|
|
21
|
+
*
|
|
22
|
+
* Note that dirty reads are only supported for read-only queries, not data
|
|
23
|
+
* modification queries (e.g. using `INSERT`, `UPDATE`, `REPLACE` or
|
|
24
|
+
* `REMOVE`) and only when using ArangoDB 3.4 or later.
|
|
25
|
+
*
|
|
26
|
+
* Default: `false`
|
|
27
|
+
*/
|
|
28
|
+
allowDirtyRead?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If set to `true`, cursor results will be stored by ArangoDB in such a way
|
|
31
|
+
* that batch reads can be retried in the case of a communication error.
|
|
32
|
+
*
|
|
33
|
+
* Default: `false`
|
|
34
|
+
*/
|
|
35
|
+
allowRetry?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Maximum time in milliseconds arangojs will wait for a server response.
|
|
38
|
+
* Exceeding this value will result in the request being cancelled.
|
|
39
|
+
*
|
|
40
|
+
* **Note**: Setting a timeout for the client does not guarantee the query
|
|
41
|
+
* will be killed by ArangoDB if it is already being executed. See the
|
|
42
|
+
* `maxRuntime` option for limiting the execution time within ArangoDB.
|
|
43
|
+
*/
|
|
44
|
+
timeout?: number;
|
|
45
|
+
/**
|
|
46
|
+
* If set to a positive number, the query will automatically be retried at
|
|
47
|
+
* most this many times if it results in a write-write conflict.
|
|
48
|
+
*
|
|
49
|
+
* Default: `0`
|
|
50
|
+
*/
|
|
51
|
+
retryOnConflict?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Unless set to `false`, the number of result values in the result set will
|
|
54
|
+
* be returned in the `count` attribute. This may be disabled by default in
|
|
55
|
+
* a future version of ArangoDB if calculating this value has a performance
|
|
56
|
+
* impact for some queries.
|
|
57
|
+
*
|
|
58
|
+
* Default: `true`.
|
|
59
|
+
*/
|
|
60
|
+
count?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Number of result values to be transferred by the server in each
|
|
63
|
+
* network roundtrip (or "batch").
|
|
64
|
+
*
|
|
65
|
+
* Must be greater than zero.
|
|
66
|
+
*/
|
|
67
|
+
batchSize?: number;
|
|
68
|
+
/**
|
|
69
|
+
* If set to `false`, the AQL query results cache lookup will be skipped for
|
|
70
|
+
* this query.
|
|
71
|
+
*
|
|
72
|
+
* Default: `true`
|
|
73
|
+
*/
|
|
74
|
+
cache?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* Maximum memory size in bytes that the query is allowed to use.
|
|
77
|
+
* Exceeding this value will result in the query failing with an error.
|
|
78
|
+
*
|
|
79
|
+
* If set to `0`, the memory limit is disabled.
|
|
80
|
+
*
|
|
81
|
+
* Default: `0`
|
|
82
|
+
*/
|
|
83
|
+
memoryLimit?: number;
|
|
84
|
+
/**
|
|
85
|
+
* Maximum allowed execution time before the query will be killed in seconds.
|
|
86
|
+
*
|
|
87
|
+
* If set to `0`, the query will be allowed to run indefinitely.
|
|
88
|
+
*
|
|
89
|
+
* Default: `0`
|
|
90
|
+
*/
|
|
91
|
+
maxRuntime?: number;
|
|
92
|
+
/**
|
|
93
|
+
* Time-to-live for the cursor in seconds. The cursor results may be
|
|
94
|
+
* garbage collected by ArangoDB after this much time has passed.
|
|
95
|
+
*
|
|
96
|
+
* Default: `30`
|
|
97
|
+
*/
|
|
98
|
+
ttl?: number;
|
|
99
|
+
/**
|
|
100
|
+
* If set to `true`, the query will throw an exception and abort if it would
|
|
101
|
+
otherwise produce a warning.
|
|
102
|
+
*/
|
|
103
|
+
failOnWarning?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* If set to `1` or `true`, additional query profiling information will be
|
|
106
|
+
* returned in the `extra.profile` attribute if the query is not served from
|
|
107
|
+
* the result cache.
|
|
108
|
+
*
|
|
109
|
+
* If set to `2`, the query will return execution stats per query plan node
|
|
110
|
+
* in the `extra.stats.nodes` attribute. Additionally the query plan is
|
|
111
|
+
* returned in `extra.plan`.
|
|
112
|
+
*/
|
|
113
|
+
profile?: boolean | number;
|
|
114
|
+
/**
|
|
115
|
+
* If set to `true`, the query will be executed as a streaming query.
|
|
116
|
+
*/
|
|
117
|
+
stream?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Limits the maximum number of warnings a query will return.
|
|
120
|
+
*/
|
|
121
|
+
maxWarningsCount?: number;
|
|
122
|
+
/**
|
|
123
|
+
* If set to `true` and the query has a `LIMIT` clause, the total number of
|
|
124
|
+
* values matched before the last top-level `LIMIT` in the query was applied
|
|
125
|
+
* will be returned in the `extra.stats.fullCount` attribute.
|
|
126
|
+
*/
|
|
127
|
+
fullCount?: boolean;
|
|
128
|
+
/**
|
|
129
|
+
* If set to `false`, the query data will not be stored in the RocksDB block
|
|
130
|
+
* cache. This can be used to avoid thrashing he block cache when reading a
|
|
131
|
+
* lot of data.
|
|
132
|
+
*/
|
|
133
|
+
fillBlockCache?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* An object with a `rules` property specifying a list of optimizer rules to
|
|
136
|
+
* be included or excluded by the optimizer for this query. Prefix a rule
|
|
137
|
+
* name with `+` to include it, or `-` to exclude it. The name `all` acts as
|
|
138
|
+
* an alias matching all optimizer rules.
|
|
139
|
+
*/
|
|
140
|
+
optimizer?: {
|
|
141
|
+
rules: string[];
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Limits the maximum number of plans that will be created by the AQL query
|
|
145
|
+
* optimizer.
|
|
146
|
+
*/
|
|
147
|
+
maxPlans?: number;
|
|
148
|
+
/**
|
|
149
|
+
* Controls after how many execution nodes in a query a stack split should be
|
|
150
|
+
* performed.
|
|
151
|
+
*
|
|
152
|
+
* Default: `250` (`200` on macOS)
|
|
153
|
+
*/
|
|
154
|
+
maxNodesPerCallstack?: number;
|
|
155
|
+
/**
|
|
156
|
+
* Maximum size of transactions in bytes.
|
|
157
|
+
*/
|
|
158
|
+
maxTransactionSize?: number;
|
|
159
|
+
/**
|
|
160
|
+
* Maximum number of operations after which an intermediate commit is
|
|
161
|
+
* automatically performed.
|
|
162
|
+
*/
|
|
163
|
+
intermediateCommitCount?: number;
|
|
164
|
+
/**
|
|
165
|
+
* Maximum total size of operations in bytes after which an intermediate
|
|
166
|
+
* commit is automatically performed.
|
|
167
|
+
*/
|
|
168
|
+
intermediateCommitSize?: number;
|
|
169
|
+
/**
|
|
170
|
+
* (Enterprise Edition cluster only.) If set to `true`, collections
|
|
171
|
+
* inaccessible to current user will result in an access error instead
|
|
172
|
+
* of being treated as empty.
|
|
173
|
+
*/
|
|
174
|
+
skipInaccessibleCollections?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* (Enterprise Edition cluster only.) Limits the maximum time in seconds a
|
|
177
|
+
* DBServer will wait to bring satellite collections involved in the query
|
|
178
|
+
* into sync. Exceeding this value will result in the query being stopped.
|
|
179
|
+
*
|
|
180
|
+
* Default: `60`
|
|
181
|
+
*/
|
|
182
|
+
satelliteSyncWait?: number;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Options for explaining a query.
|
|
186
|
+
*
|
|
187
|
+
* See {@link Database#explain}.
|
|
188
|
+
*/
|
|
189
|
+
export type ExplainOptions = {
|
|
190
|
+
/**
|
|
191
|
+
* An object with a `rules` property specifying a list of optimizer rules to
|
|
192
|
+
* be included or excluded by the optimizer for this query. Prefix a rule
|
|
193
|
+
* name with `+` to include it, or `-` to exclude it. The name `all` acts as
|
|
194
|
+
* an alias matching all optimizer rules.
|
|
195
|
+
*/
|
|
196
|
+
optimizer?: {
|
|
197
|
+
rules: string[];
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Maximum number of plans that the optimizer is allowed to generate.
|
|
201
|
+
* Setting this to a low value limits the amount of work the optimizer does.
|
|
202
|
+
*/
|
|
203
|
+
maxNumberOfPlans?: number;
|
|
204
|
+
/**
|
|
205
|
+
* If set to true, all possible execution plans will be returned as the
|
|
206
|
+
* `plans` property. Otherwise only the optimal execution plan will be
|
|
207
|
+
* returned as the `plan` property.
|
|
208
|
+
*
|
|
209
|
+
* Default: `false`
|
|
210
|
+
*/
|
|
211
|
+
allPlans?: boolean;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Options for query tracking.
|
|
215
|
+
*
|
|
216
|
+
* See {@link Database#queryTracking}.
|
|
217
|
+
*/
|
|
218
|
+
export type QueryTrackingOptions = {
|
|
219
|
+
/**
|
|
220
|
+
* If set to `false`, neither queries nor slow queries will be tracked.
|
|
221
|
+
*/
|
|
222
|
+
enabled?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Maximum query string length in bytes that will be kept in the list.
|
|
225
|
+
*/
|
|
226
|
+
maxQueryStringLength?: number;
|
|
227
|
+
/**
|
|
228
|
+
* Maximum number of slow queries to be kept in the list.
|
|
229
|
+
*/
|
|
230
|
+
maxSlowQueries?: number;
|
|
231
|
+
/**
|
|
232
|
+
* Threshold execution time in seconds for when a query will be
|
|
233
|
+
* considered slow.
|
|
234
|
+
*/
|
|
235
|
+
slowQueryThreshold?: number;
|
|
236
|
+
/**
|
|
237
|
+
* If set to `true`, bind parameters will be tracked along with queries.
|
|
238
|
+
*/
|
|
239
|
+
trackBindVars?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* If set to `true` and `enabled` is also set to `true`, slow queries will be
|
|
242
|
+
* tracked if their execution time exceeds `slowQueryThreshold`.
|
|
243
|
+
*/
|
|
244
|
+
trackSlowQueries?: boolean;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Result of explaining a query with a single plan.
|
|
248
|
+
*/
|
|
249
|
+
export type SingleExplainResult = {
|
|
250
|
+
/**
|
|
251
|
+
* Query plan.
|
|
252
|
+
*/
|
|
253
|
+
plan: ExplainPlan;
|
|
254
|
+
/**
|
|
255
|
+
* Whether it would be possible to cache the query.
|
|
256
|
+
*/
|
|
257
|
+
cacheable: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Warnings encountered while planning the query execution.
|
|
260
|
+
*/
|
|
261
|
+
warnings: {
|
|
262
|
+
code: number;
|
|
263
|
+
message: string;
|
|
264
|
+
}[];
|
|
265
|
+
/**
|
|
266
|
+
* Optimizer statistics for the explained query.
|
|
267
|
+
*/
|
|
268
|
+
stats: ExplainStats;
|
|
269
|
+
};
|
|
270
|
+
/**
|
|
271
|
+
* Result of explaining a query with multiple plans.
|
|
272
|
+
*/
|
|
273
|
+
export type MultiExplainResult = {
|
|
274
|
+
/**
|
|
275
|
+
* Query plans.
|
|
276
|
+
*/
|
|
277
|
+
plans: ExplainPlan[];
|
|
278
|
+
/**
|
|
279
|
+
* Whether it would be possible to cache the query.
|
|
280
|
+
*/
|
|
281
|
+
cacheable: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Warnings encountered while planning the query execution.
|
|
284
|
+
*/
|
|
285
|
+
warnings: {
|
|
286
|
+
code: number;
|
|
287
|
+
message: string;
|
|
288
|
+
}[];
|
|
289
|
+
/**
|
|
290
|
+
* Optimizer statistics for the explained query.
|
|
291
|
+
*/
|
|
292
|
+
stats: ExplainStats;
|
|
293
|
+
};
|
|
294
|
+
/**
|
|
295
|
+
* Plan explaining query execution.
|
|
296
|
+
*/
|
|
297
|
+
export type ExplainPlan = {
|
|
298
|
+
/**
|
|
299
|
+
* Execution nodes in this plan.
|
|
300
|
+
*/
|
|
301
|
+
nodes: {
|
|
302
|
+
[key: string]: any;
|
|
303
|
+
type: string;
|
|
304
|
+
id: number;
|
|
305
|
+
dependencies: number[];
|
|
306
|
+
estimatedCost: number;
|
|
307
|
+
estimatedNrItems: number;
|
|
308
|
+
}[];
|
|
309
|
+
/**
|
|
310
|
+
* Rules applied by the optimizer.
|
|
311
|
+
*/
|
|
312
|
+
rules: string[];
|
|
313
|
+
/**
|
|
314
|
+
* Information about collections involved in the query.
|
|
315
|
+
*/
|
|
316
|
+
collections: {
|
|
317
|
+
name: string;
|
|
318
|
+
type: "read" | "write";
|
|
319
|
+
}[];
|
|
320
|
+
/**
|
|
321
|
+
* Variables used in the query.
|
|
322
|
+
*/
|
|
323
|
+
variables: {
|
|
324
|
+
id: number;
|
|
325
|
+
name: string;
|
|
326
|
+
}[];
|
|
327
|
+
/**
|
|
328
|
+
* Total estimated cost of the plan.
|
|
329
|
+
*/
|
|
330
|
+
estimatedCost: number;
|
|
331
|
+
/**
|
|
332
|
+
* Estimated number of items returned by the query.
|
|
333
|
+
*/
|
|
334
|
+
estimatedNrItems: number;
|
|
335
|
+
/**
|
|
336
|
+
* Whether the query is a data modification query.
|
|
337
|
+
*/
|
|
338
|
+
isModificationQuery: boolean;
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* Optimizer statistics for an explained query.
|
|
342
|
+
*/
|
|
343
|
+
export type ExplainStats = {
|
|
344
|
+
/**
|
|
345
|
+
* Total number of rules executed for this query.
|
|
346
|
+
*/
|
|
347
|
+
rulesExecuted: number;
|
|
348
|
+
/**
|
|
349
|
+
* Number of rules skipped for this query.
|
|
350
|
+
*/
|
|
351
|
+
rulesSkipped: number;
|
|
352
|
+
/**
|
|
353
|
+
* Total number of plans created.
|
|
354
|
+
*/
|
|
355
|
+
plansCreated: number;
|
|
356
|
+
/**
|
|
357
|
+
* Maximum memory usage in bytes of the query during explain.
|
|
358
|
+
*/
|
|
359
|
+
peakMemoryUsage: number;
|
|
360
|
+
/**
|
|
361
|
+
* Time in seconds needed to explain the query.
|
|
362
|
+
*/
|
|
363
|
+
executionTime: number;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Result of parsing a query.
|
|
367
|
+
*/
|
|
368
|
+
export type ParseResult = {
|
|
369
|
+
/**
|
|
370
|
+
* Whether the query was parsed.
|
|
371
|
+
*/
|
|
372
|
+
parsed: boolean;
|
|
373
|
+
/**
|
|
374
|
+
* Names of all collections involved in the query.
|
|
375
|
+
*/
|
|
376
|
+
collections: string[];
|
|
377
|
+
/**
|
|
378
|
+
* Names of all bind parameters used in the query.
|
|
379
|
+
*/
|
|
380
|
+
bindVars: string[];
|
|
381
|
+
/**
|
|
382
|
+
* Abstract syntax tree (AST) of the query.
|
|
383
|
+
*/
|
|
384
|
+
ast: AstNode[];
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Node in an AQL abstract syntax tree (AST).
|
|
388
|
+
*/
|
|
389
|
+
export type AstNode = {
|
|
390
|
+
[key: string]: any;
|
|
391
|
+
type: string;
|
|
392
|
+
subNodes: AstNode[];
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* Optimizer rule for AQL queries.
|
|
396
|
+
*/
|
|
397
|
+
export type QueryOptimizerRule = {
|
|
398
|
+
name: string;
|
|
399
|
+
flags: {
|
|
400
|
+
hidden: boolean;
|
|
401
|
+
clusterOnly: boolean;
|
|
402
|
+
canBeDisabled: boolean;
|
|
403
|
+
canCreateAdditionalPlans: boolean;
|
|
404
|
+
disabledByDefault: boolean;
|
|
405
|
+
enterpriseOnly: boolean;
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
/**
|
|
409
|
+
* Information about query tracking.
|
|
410
|
+
*/
|
|
411
|
+
export type QueryTrackingInfo = {
|
|
412
|
+
/**
|
|
413
|
+
* Whether query tracking is enabled.
|
|
414
|
+
*/
|
|
415
|
+
enabled: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Maximum query string length in bytes that is kept in the list.
|
|
418
|
+
*/
|
|
419
|
+
maxQueryStringLength: number;
|
|
420
|
+
/**
|
|
421
|
+
* Maximum number of slow queries that is kept in the list.
|
|
422
|
+
*/
|
|
423
|
+
maxSlowQueries: number;
|
|
424
|
+
/**
|
|
425
|
+
* Threshold execution time in seconds for when a query is
|
|
426
|
+
* considered slow.
|
|
427
|
+
*/
|
|
428
|
+
slowQueryThreshold: number;
|
|
429
|
+
/**
|
|
430
|
+
* Whether bind parameters are being tracked along with queries.
|
|
431
|
+
*/
|
|
432
|
+
trackBindVars: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* Whether slow queries are being tracked.
|
|
435
|
+
*/
|
|
436
|
+
trackSlowQueries: boolean;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Object describing a query.
|
|
440
|
+
*/
|
|
441
|
+
export type QueryDescription = {
|
|
442
|
+
/**
|
|
443
|
+
* Unique identifier for this query.
|
|
444
|
+
*/
|
|
445
|
+
id: string;
|
|
446
|
+
/**
|
|
447
|
+
* Name of the database the query runs in.
|
|
448
|
+
*/
|
|
449
|
+
database: string;
|
|
450
|
+
/**
|
|
451
|
+
* Name of the user that started the query.
|
|
452
|
+
*/
|
|
453
|
+
user: string;
|
|
454
|
+
/**
|
|
455
|
+
* Query string (potentially truncated).
|
|
456
|
+
*/
|
|
457
|
+
query: string;
|
|
458
|
+
/**
|
|
459
|
+
* Bind parameters used in the query.
|
|
460
|
+
*/
|
|
461
|
+
bindVars: Record<string, any>;
|
|
462
|
+
/**
|
|
463
|
+
* Date and time the query was started.
|
|
464
|
+
*/
|
|
465
|
+
started: string;
|
|
466
|
+
/**
|
|
467
|
+
* Query's running time in seconds.
|
|
468
|
+
*/
|
|
469
|
+
runTime: number;
|
|
470
|
+
/**
|
|
471
|
+
* Maximum memory usage in bytes of the query.
|
|
472
|
+
*/
|
|
473
|
+
peakMemoryUsage: number;
|
|
474
|
+
/**
|
|
475
|
+
* Query's current execution state.
|
|
476
|
+
*/
|
|
477
|
+
state: "executing" | "finished" | "killed";
|
|
478
|
+
/**
|
|
479
|
+
* Whether the query uses a streaming cursor.
|
|
480
|
+
*/
|
|
481
|
+
stream: boolean;
|
|
482
|
+
};
|
|
483
|
+
/**
|
|
484
|
+
* Definition of an AQL User Function.
|
|
485
|
+
*/
|
|
486
|
+
export type UserFunctionDescription = {
|
|
487
|
+
/**
|
|
488
|
+
* Name of the AQL User Function.
|
|
489
|
+
*/
|
|
490
|
+
name: string;
|
|
491
|
+
/**
|
|
492
|
+
* Implementation of the AQL User Function.
|
|
493
|
+
*/
|
|
494
|
+
code: string;
|
|
495
|
+
/**
|
|
496
|
+
* Whether the function is deterministic.
|
|
497
|
+
*
|
|
498
|
+
* See {@link Database#createFunction}.
|
|
499
|
+
*/
|
|
500
|
+
isDeterministic: boolean;
|
|
501
|
+
};
|
|
502
|
+
//# sourceMappingURL=queries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../src/queries.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH;;;;GAIG;AACH,MAAM,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ChB;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IACxB;;OAEG;IACH,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC3C;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC"}
|
package/cjs/queries.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ```ts
|
|
4
|
+
* import type { QueryOptions } from "arangojs/queries";
|
|
5
|
+
* ```
|
|
6
|
+
*
|
|
7
|
+
* The "query" module provides query related types for TypeScript.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
//#endregion
|
|
13
|
+
//# sourceMappingURL=queries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/queries.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAwfH,YAAY","sourcesContent":["/**\n * ```ts\n * import type { QueryOptions } from \"arangojs/queries\";\n * ```\n *\n * The \"query\" module provides query related types for TypeScript.\n *\n * @packageDocumentation\n */\n\n//#region Query operation options\n/**\n * Options for executing a query.\n *\n * See {@link databases.Database#query}.\n */\nexport type QueryOptions = {\n /**\n * If set to `true`, the query will be executed with support for dirty reads\n * enabled, permitting ArangoDB to return a potentially dirty or stale result\n * and arangojs will load balance the request without distinguishing between\n * leaders and followers.\n *\n * Note that dirty reads are only supported for read-only queries, not data\n * modification queries (e.g. using `INSERT`, `UPDATE`, `REPLACE` or\n * `REMOVE`) and only when using ArangoDB 3.4 or later.\n *\n * Default: `false`\n */\n allowDirtyRead?: boolean;\n /**\n * If set to `true`, cursor results will be stored by ArangoDB in such a way\n * that batch reads can be retried in the case of a communication error.\n *\n * Default: `false`\n */\n allowRetry?: boolean;\n /**\n * Maximum time in milliseconds arangojs will wait for a server response.\n * Exceeding this value will result in the request being cancelled.\n *\n * **Note**: Setting a timeout for the client does not guarantee the query\n * will be killed by ArangoDB if it is already being executed. See the\n * `maxRuntime` option for limiting the execution time within ArangoDB.\n */\n timeout?: number;\n /**\n * If set to a positive number, the query will automatically be retried at\n * most this many times if it results in a write-write conflict.\n *\n * Default: `0`\n */\n retryOnConflict?: number;\n /**\n * Unless set to `false`, the number of result values in the result set will\n * be returned in the `count` attribute. This may be disabled by default in\n * a future version of ArangoDB if calculating this value has a performance\n * impact for some queries.\n *\n * Default: `true`.\n */\n count?: boolean;\n /**\n * Number of result values to be transferred by the server in each\n * network roundtrip (or \"batch\").\n *\n * Must be greater than zero.\n */\n batchSize?: number;\n /**\n * If set to `false`, the AQL query results cache lookup will be skipped for\n * this query.\n *\n * Default: `true`\n */\n cache?: boolean;\n /**\n * Maximum memory size in bytes that the query is allowed to use.\n * Exceeding this value will result in the query failing with an error.\n *\n * If set to `0`, the memory limit is disabled.\n *\n * Default: `0`\n */\n memoryLimit?: number;\n /**\n * Maximum allowed execution time before the query will be killed in seconds.\n *\n * If set to `0`, the query will be allowed to run indefinitely.\n *\n * Default: `0`\n */\n maxRuntime?: number;\n /**\n * Time-to-live for the cursor in seconds. The cursor results may be\n * garbage collected by ArangoDB after this much time has passed.\n *\n * Default: `30`\n */\n ttl?: number;\n /**\n * If set to `true`, the query will throw an exception and abort if it would\n otherwise produce a warning.\n */\n failOnWarning?: boolean;\n /**\n * If set to `1` or `true`, additional query profiling information will be\n * returned in the `extra.profile` attribute if the query is not served from\n * the result cache.\n *\n * If set to `2`, the query will return execution stats per query plan node\n * in the `extra.stats.nodes` attribute. Additionally the query plan is\n * returned in `extra.plan`.\n */\n profile?: boolean | number;\n /**\n * If set to `true`, the query will be executed as a streaming query.\n */\n stream?: boolean;\n /**\n * Limits the maximum number of warnings a query will return.\n */\n maxWarningsCount?: number;\n /**\n * If set to `true` and the query has a `LIMIT` clause, the total number of\n * values matched before the last top-level `LIMIT` in the query was applied\n * will be returned in the `extra.stats.fullCount` attribute.\n */\n fullCount?: boolean;\n /**\n * If set to `false`, the query data will not be stored in the RocksDB block\n * cache. This can be used to avoid thrashing he block cache when reading a\n * lot of data.\n */\n fillBlockCache?: boolean;\n /**\n * An object with a `rules` property specifying a list of optimizer rules to\n * be included or excluded by the optimizer for this query. Prefix a rule\n * name with `+` to include it, or `-` to exclude it. The name `all` acts as\n * an alias matching all optimizer rules.\n */\n optimizer?: { rules: string[] };\n /**\n * Limits the maximum number of plans that will be created by the AQL query\n * optimizer.\n */\n maxPlans?: number;\n /**\n * Controls after how many execution nodes in a query a stack split should be\n * performed.\n *\n * Default: `250` (`200` on macOS)\n */\n maxNodesPerCallstack?: number;\n /**\n * Maximum size of transactions in bytes.\n */\n maxTransactionSize?: number;\n /**\n * Maximum number of operations after which an intermediate commit is\n * automatically performed.\n */\n intermediateCommitCount?: number;\n /**\n * Maximum total size of operations in bytes after which an intermediate\n * commit is automatically performed.\n */\n intermediateCommitSize?: number;\n /**\n * (Enterprise Edition cluster only.) If set to `true`, collections\n * inaccessible to current user will result in an access error instead\n * of being treated as empty.\n */\n skipInaccessibleCollections?: boolean;\n /**\n * (Enterprise Edition cluster only.) Limits the maximum time in seconds a\n * DBServer will wait to bring satellite collections involved in the query\n * into sync. Exceeding this value will result in the query being stopped.\n *\n * Default: `60`\n */\n satelliteSyncWait?: number;\n};\n\n/**\n * Options for explaining a query.\n *\n * See {@link Database#explain}.\n */\nexport type ExplainOptions = {\n /**\n * An object with a `rules` property specifying a list of optimizer rules to\n * be included or excluded by the optimizer for this query. Prefix a rule\n * name with `+` to include it, or `-` to exclude it. The name `all` acts as\n * an alias matching all optimizer rules.\n */\n optimizer?: { rules: string[] };\n /**\n * Maximum number of plans that the optimizer is allowed to generate.\n * Setting this to a low value limits the amount of work the optimizer does.\n */\n maxNumberOfPlans?: number;\n /**\n * If set to true, all possible execution plans will be returned as the\n * `plans` property. Otherwise only the optimal execution plan will be\n * returned as the `plan` property.\n *\n * Default: `false`\n */\n allPlans?: boolean;\n};\n\n/**\n * Options for query tracking.\n *\n * See {@link Database#queryTracking}.\n */\nexport type QueryTrackingOptions = {\n /**\n * If set to `false`, neither queries nor slow queries will be tracked.\n */\n enabled?: boolean;\n /**\n * Maximum query string length in bytes that will be kept in the list.\n */\n maxQueryStringLength?: number;\n /**\n * Maximum number of slow queries to be kept in the list.\n */\n maxSlowQueries?: number;\n /**\n * Threshold execution time in seconds for when a query will be\n * considered slow.\n */\n slowQueryThreshold?: number;\n /**\n * If set to `true`, bind parameters will be tracked along with queries.\n */\n trackBindVars?: boolean;\n /**\n * If set to `true` and `enabled` is also set to `true`, slow queries will be\n * tracked if their execution time exceeds `slowQueryThreshold`.\n */\n trackSlowQueries?: boolean;\n};\n\n//#endregion\n\n//#region Query operation results\n/**\n * Result of explaining a query with a single plan.\n */\nexport type SingleExplainResult = {\n /**\n * Query plan.\n */\n plan: ExplainPlan;\n /**\n * Whether it would be possible to cache the query.\n */\n cacheable: boolean;\n /**\n * Warnings encountered while planning the query execution.\n */\n warnings: { code: number; message: string }[];\n /**\n * Optimizer statistics for the explained query.\n */\n stats: ExplainStats;\n};\n\n/**\n * Result of explaining a query with multiple plans.\n */\nexport type MultiExplainResult = {\n /**\n * Query plans.\n */\n plans: ExplainPlan[];\n /**\n * Whether it would be possible to cache the query.\n */\n cacheable: boolean;\n /**\n * Warnings encountered while planning the query execution.\n */\n warnings: { code: number; message: string }[];\n /**\n * Optimizer statistics for the explained query.\n */\n stats: ExplainStats;\n};\n\n/**\n * Plan explaining query execution.\n */\nexport type ExplainPlan = {\n /**\n * Execution nodes in this plan.\n */\n nodes: {\n [key: string]: any;\n type: string;\n id: number;\n dependencies: number[];\n estimatedCost: number;\n estimatedNrItems: number;\n }[];\n /**\n * Rules applied by the optimizer.\n */\n rules: string[];\n /**\n * Information about collections involved in the query.\n */\n collections: {\n name: string;\n type: \"read\" | \"write\";\n }[];\n /**\n * Variables used in the query.\n */\n variables: {\n id: number;\n name: string;\n }[];\n /**\n * Total estimated cost of the plan.\n */\n estimatedCost: number;\n /**\n * Estimated number of items returned by the query.\n */\n estimatedNrItems: number;\n /**\n * Whether the query is a data modification query.\n */\n isModificationQuery: boolean;\n};\n\n/**\n * Optimizer statistics for an explained query.\n */\nexport type ExplainStats = {\n /**\n * Total number of rules executed for this query.\n */\n rulesExecuted: number;\n /**\n * Number of rules skipped for this query.\n */\n rulesSkipped: number;\n /**\n * Total number of plans created.\n */\n plansCreated: number;\n /**\n * Maximum memory usage in bytes of the query during explain.\n */\n peakMemoryUsage: number;\n /**\n * Time in seconds needed to explain the query.\n */\n executionTime: number;\n};\n\n/**\n * Result of parsing a query.\n */\nexport type ParseResult = {\n /**\n * Whether the query was parsed.\n */\n parsed: boolean;\n /**\n * Names of all collections involved in the query.\n */\n collections: string[];\n /**\n * Names of all bind parameters used in the query.\n */\n bindVars: string[];\n /**\n * Abstract syntax tree (AST) of the query.\n */\n ast: AstNode[];\n};\n\n/**\n * Node in an AQL abstract syntax tree (AST).\n */\nexport type AstNode = {\n [key: string]: any;\n type: string;\n subNodes: AstNode[];\n};\n\n/**\n * Optimizer rule for AQL queries.\n */\nexport type QueryOptimizerRule = {\n name: string;\n flags: {\n hidden: boolean;\n clusterOnly: boolean;\n canBeDisabled: boolean;\n canCreateAdditionalPlans: boolean;\n disabledByDefault: boolean;\n enterpriseOnly: boolean;\n };\n};\n\n/**\n * Information about query tracking.\n */\nexport type QueryTrackingInfo = {\n /**\n * Whether query tracking is enabled.\n */\n enabled: boolean;\n /**\n * Maximum query string length in bytes that is kept in the list.\n */\n maxQueryStringLength: number;\n /**\n * Maximum number of slow queries that is kept in the list.\n */\n maxSlowQueries: number;\n /**\n * Threshold execution time in seconds for when a query is\n * considered slow.\n */\n slowQueryThreshold: number;\n /**\n * Whether bind parameters are being tracked along with queries.\n */\n trackBindVars: boolean;\n /**\n * Whether slow queries are being tracked.\n */\n trackSlowQueries: boolean;\n};\n//#endregion\n\n//#region QueryDescription\n/**\n * Object describing a query.\n */\nexport type QueryDescription = {\n /**\n * Unique identifier for this query.\n */\n id: string;\n /**\n * Name of the database the query runs in.\n */\n database: string;\n /**\n * Name of the user that started the query.\n */\n user: string;\n /**\n * Query string (potentially truncated).\n */\n query: string;\n /**\n * Bind parameters used in the query.\n */\n bindVars: Record<string, any>;\n /**\n * Date and time the query was started.\n */\n started: string;\n /**\n * Query's running time in seconds.\n */\n runTime: number;\n /**\n * Maximum memory usage in bytes of the query.\n */\n peakMemoryUsage: number;\n /**\n * Query's current execution state.\n */\n state: \"executing\" | \"finished\" | \"killed\";\n /**\n * Whether the query uses a streaming cursor.\n */\n stream: boolean;\n};\n//#endregion\n\n//#region UserFunctionDescription\n/**\n * Definition of an AQL User Function.\n */\nexport type UserFunctionDescription = {\n /**\n * Name of the AQL User Function.\n */\n name: string;\n /**\n * Implementation of the AQL User Function.\n */\n code: string;\n /**\n * Whether the function is deterministic.\n *\n * See {@link Database#createFunction}.\n */\n isDeterministic: boolean;\n};\n//#endregion"]}
|