arangojs 9.0.0-preview.1 → 9.0.0-preview.3

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 (94) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/MIGRATING.md +7 -0
  3. package/README.md +21 -27
  4. package/analyzer.d.ts +950 -0
  5. package/analyzer.d.ts.map +1 -0
  6. package/aql.d.ts +289 -0
  7. package/aql.d.ts.map +1 -0
  8. package/cjs/collection.d.ts +11 -860
  9. package/cjs/collection.d.ts.map +1 -1
  10. package/cjs/collection.js +2 -134
  11. package/cjs/collection.js.map +1 -1
  12. package/cjs/connection.d.ts +1 -1
  13. package/cjs/connection.d.ts.map +1 -1
  14. package/cjs/connection.js +4 -4
  15. package/cjs/connection.js.map +1 -1
  16. package/cjs/cursor.d.ts +1 -1
  17. package/cjs/cursor.d.ts.map +1 -1
  18. package/cjs/cursor.js +3 -3
  19. package/cjs/cursor.js.map +1 -1
  20. package/cjs/graph.d.ts +1 -34
  21. package/cjs/graph.d.ts.map +1 -1
  22. package/cjs/graph.js +0 -43
  23. package/cjs/graph.js.map +1 -1
  24. package/cjs/indexes.d.ts +12 -0
  25. package/cjs/indexes.d.ts.map +1 -1
  26. package/cjs/indexes.js.map +1 -1
  27. package/cjs/lib/linkedList.d.ts +328 -0
  28. package/cjs/lib/linkedList.d.ts.map +1 -0
  29. package/cjs/lib/linkedList.js +604 -0
  30. package/cjs/lib/linkedList.js.map +1 -0
  31. package/collection.d.ts +2479 -0
  32. package/collection.d.ts.map +1 -0
  33. package/connection.d.ts +509 -0
  34. package/connection.d.ts.map +1 -0
  35. package/cursor.d.ts +862 -0
  36. package/cursor.d.ts.map +1 -0
  37. package/database.d.ts +4632 -0
  38. package/database.d.ts.map +1 -0
  39. package/documents.d.ts +98 -0
  40. package/documents.d.ts.map +1 -0
  41. package/error.d.ts +94 -0
  42. package/error.d.ts.map +1 -0
  43. package/esm/collection.d.ts +11 -860
  44. package/esm/collection.d.ts.map +1 -1
  45. package/esm/collection.js +2 -134
  46. package/esm/collection.js.map +1 -1
  47. package/esm/connection.d.ts +1 -1
  48. package/esm/connection.d.ts.map +1 -1
  49. package/esm/connection.js +2 -2
  50. package/esm/connection.js.map +1 -1
  51. package/esm/cursor.d.ts +1 -1
  52. package/esm/cursor.d.ts.map +1 -1
  53. package/esm/cursor.js +1 -1
  54. package/esm/cursor.js.map +1 -1
  55. package/esm/graph.d.ts +1 -34
  56. package/esm/graph.d.ts.map +1 -1
  57. package/esm/graph.js +0 -43
  58. package/esm/graph.js.map +1 -1
  59. package/esm/indexes.d.ts +12 -0
  60. package/esm/indexes.d.ts.map +1 -1
  61. package/esm/indexes.js.map +1 -1
  62. package/esm/lib/linkedList.d.ts +328 -0
  63. package/esm/lib/linkedList.d.ts.map +1 -0
  64. package/esm/lib/linkedList.js +599 -0
  65. package/esm/lib/linkedList.js.map +1 -0
  66. package/foxx-manifest.d.ts +155 -0
  67. package/foxx-manifest.d.ts.map +1 -0
  68. package/graph.d.ts +1137 -0
  69. package/graph.d.ts.map +1 -0
  70. package/index.d.ts +52 -0
  71. package/index.d.ts.map +1 -0
  72. package/indexes.d.ts +666 -0
  73. package/indexes.d.ts.map +1 -0
  74. package/job.d.ts +69 -0
  75. package/job.d.ts.map +1 -0
  76. package/lib/codes.d.ts +18 -0
  77. package/lib/codes.d.ts.map +1 -0
  78. package/lib/joinPath.d.ts +11 -0
  79. package/lib/joinPath.d.ts.map +1 -0
  80. package/lib/linkedList.d.ts +328 -0
  81. package/lib/linkedList.d.ts.map +1 -0
  82. package/lib/mergeHeaders.d.ts +12 -0
  83. package/lib/mergeHeaders.d.ts.map +1 -0
  84. package/lib/normalizeUrl.d.ts +11 -0
  85. package/lib/normalizeUrl.d.ts.map +1 -0
  86. package/lib/request.d.ts +66 -0
  87. package/lib/request.d.ts.map +1 -0
  88. package/package.json +7 -7
  89. package/route.d.ts +273 -0
  90. package/route.d.ts.map +1 -0
  91. package/transaction.d.ts +314 -0
  92. package/transaction.d.ts.map +1 -0
  93. package/view.d.ts +567 -0
  94. package/view.d.ts.map +1 -0
package/CHANGELOG.md CHANGED
@@ -14,6 +14,38 @@ This driver uses semantic versioning:
14
14
  - A change in the major version (e.g. 1.Y.Z -> 2.0.0) indicates _breaking_
15
15
  changes that require changes in your code to upgrade.
16
16
 
17
+ ## [9.0.0-preview.3]
18
+
19
+ ### Removed
20
+
21
+ - Removed `Collection` methods for simple queries: `list`, `all`, `any`,
22
+ `byExample`, `firstExample`, `removeByExample`, `replaceByExample`,
23
+ `updateByExample`, `lookupByKeys`, `removeByKeys`, `fulltext`
24
+
25
+ Simple queries were deprecated in ArangoDB 3.4 and can be replicated with AQL.
26
+
27
+ ### Added
28
+
29
+ - Added support for `withStats` option in `collection.indexes`
30
+
31
+ This method now takes an object with `withStats` and `withHidden` options
32
+ instead of a boolean flag.
33
+
34
+ ## [9.0.0-preview.2]
35
+
36
+ ### Changed
37
+
38
+ - Inlined `x3-linkedlist` dependency
39
+
40
+ Inlining this dependency should help make arangojs more portable.
41
+
42
+ ### Added
43
+
44
+ - Added support for `withHidden` option in `collection.indexes`
45
+
46
+ This option was introduced in ArangoDB 3.10.13 and 3.11.7 and allows
47
+ fetching the progress information of indexes that are in the building phase.
48
+
17
49
  ## [9.0.0-preview.1]
18
50
 
19
51
  This is a major release and breaks backwards compatibility.
@@ -1864,6 +1896,8 @@ For a detailed list of changes between pre-release versions of v7 see the
1864
1896
 
1865
1897
  Graph methods now only return the relevant part of the response body.
1866
1898
 
1899
+ [9.0.0-preview.3]: https://github.com/arangodb/arangojs/compare/v9.0.0-preview.2...v9.0.0-preview.3
1900
+ [9.0.0-preview.2]: https://github.com/arangodb/arangojs/compare/v9.0.0-preview.1...v9.0.0-preview.2
1867
1901
  [9.0.0-preview.1]: https://github.com/arangodb/arangojs/compare/v8.8.1...v9.0.0-preview.1
1868
1902
  [8.8.1]: https://github.com/arangodb/arangojs/compare/v8.8.0...v8.8.1
1869
1903
  [8.8.0]: https://github.com/arangodb/arangojs/compare/v8.7.0...v8.8.0
package/MIGRATING.md CHANGED
@@ -21,6 +21,13 @@ Note that ArangoDB may reject non-normalized unicode names and identifiers.
21
21
  This change is intended to make it easier to recognize normalization issues in
22
22
  code interacting with ArangoDB that were previously masked by arangojs.
23
23
 
24
+ ### Simple queries
25
+
26
+ Simple queries like the `removeByExample` and `firstExample` methods have been
27
+ removed from the collections API. These methods were deprecated in ArangoDB 3.4
28
+ and can be replaced with AQL queries. For examples for replicating each
29
+ method's behavior in AQL, see the documentation for these methods in ArangoJS 8.
30
+
24
31
  ### Request and Response changes
25
32
 
26
33
  Version 9 now uses native `fetch` in all environments. This means that the
package/README.md CHANGED
@@ -9,7 +9,7 @@ The official ArangoDB JavaScript client for Node.js and the browser.
9
9
 
10
10
  ## Links
11
11
 
12
- - [API Documentation](https://arangodb.github.io/arangojs/latest/modules/_index_.html)
12
+ - [API Documentation](https://arangodb.github.io/arangojs/latest/modules/index.html)
13
13
 
14
14
  - [Changelog](https://arangodb.github.io/arangojs/CHANGELOG)
15
15
 
@@ -30,38 +30,29 @@ yarn add arangojs
30
30
  When using modern JavaScript tooling with a bundler and compiler (e.g. Babel),
31
31
  arangojs can be installed using `npm` or `yarn` like any other dependency.
32
32
 
33
- For use without a compiler, the npm release comes with a precompiled browser
34
- build for evergreen browsers:
35
-
36
- ```js
37
- var arangojs = require("arangojs/web");
38
- ```
39
-
40
- You can also use [unpkg](https://unpkg.com) during development:
33
+ You can also use [jsDelivr CDN](https://www.jsdelivr.com) during development:
41
34
 
42
35
  ```html
43
- < !-- note the path includes the version number (e.g. 8.0.0) -- >
44
- <script src="https://unpkg.com/arangojs@8.0.0/web.js"></script>
45
- <script>
46
- var db = new arangojs.Database();
36
+ <script type="importmap">
37
+ {
38
+ "imports": {
39
+ "arangojs": "https://cdn.jsdelivr.net/npm/arangojs@9.0.0-preview.1/esm/index.js?+esm"
40
+ }
41
+ }
42
+ </script>
43
+ <script type="module">
44
+ import { Database } from "arangojs";
45
+ const db = new Database();
47
46
  // ...
48
47
  </script>
49
48
  ```
50
49
 
51
- When loading the browser build with a script tag make sure to load the polyfill first:
52
-
53
- ```html
54
- <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.26.0/polyfill.js"></script>
55
- <script src="https://unpkg.com/arangojs@8.0.0/web.js"></script>
56
- ```
57
-
58
50
  ## Basic usage example
59
51
 
60
- Modern JavaScript/TypeScript with async/await:
52
+ Modern JavaScript/TypeScript with async/await and ES Modules:
61
53
 
62
54
  ```js
63
- // TS: import { Database, aql } from "arangojs";
64
- const { Database, aql } = require("arangojs");
55
+ import { Database, aql } from "arangojs";
65
56
 
66
57
  const db = new Database();
67
58
  const Pokemons = db.collection("my-pokemons");
@@ -73,7 +64,7 @@ async function main() {
73
64
  FILTER pokemon.type == "fire"
74
65
  RETURN pokemon
75
66
  `);
76
- console.log("My pokemons, let me show you them:");
67
+ console.log("My pokemans, let me show you them:");
77
68
  for await (const pokemon of pokemons) {
78
69
  console.log(pokemon.name);
79
70
  }
@@ -98,7 +89,7 @@ const db = new Database({
98
89
  db.useBasicAuth("admin", "maplesyrup");
99
90
  ```
100
91
 
101
- Old-school JavaScript with promises:
92
+ Old-school JavaScript with promises and CommonJS:
102
93
 
103
94
  ```js
104
95
  var arangojs = require("arangojs");
@@ -291,7 +282,7 @@ internally, you can override the global agent by adding `undici` as a
291
282
  dependency to your project and using its `setGlobalDispatcher` as follows:
292
283
 
293
284
  ```js
294
- const { Agent, setGlobalDispatcher } = require("undici");
285
+ import { Agent, setGlobalDispatcher } from "undici";
295
286
 
296
287
  setGlobalDispatcher(
297
288
  new Agent({
@@ -308,7 +299,7 @@ HTTPS certificate validation entirely, but note this has
308
299
  **extremely dangerous** security implications:
309
300
 
310
301
  ```js
311
- const { Agent, setGlobalDispatcher } = require("undici");
302
+ import { Agent, setGlobalDispatcher } from "undici";
312
303
 
313
304
  setGlobalDispatcher(
314
305
  new Agent({
@@ -364,3 +355,6 @@ to support larger numbers of concurrent transactions on the server side.
364
355
 
365
356
  The Apache License, Version 2.0. For more information, see the accompanying
366
357
  LICENSE file.
358
+
359
+ Includes code from [x3-linkedlist](https://github.com/x3cion/x3-linkedlist)
360
+ used under the MIT license.