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/documents.d.ts CHANGED
@@ -68,7 +68,7 @@ export declare type Patch<T = Record<string, any>> = {
68
68
  /**
69
69
  * An object with an ArangoDB document `_id` property.
70
70
  *
71
- * See {@link DocumentMetadata}.
71
+ * See {@link documents.DocumentMetadata}.
72
72
  */
73
73
  export declare type ObjectWithId = {
74
74
  [key: string]: any;
@@ -77,7 +77,7 @@ export declare type ObjectWithId = {
77
77
  /**
78
78
  * An object with an ArangoDB document `_key` property.
79
79
  *
80
- * See {@link DocumentMetadata}.
80
+ * See {@link documents.DocumentMetadata}.
81
81
  */
82
82
  export declare type ObjectWithKey = {
83
83
  [key: string]: any;
@@ -88,12 +88,11 @@ export declare type ObjectWithKey = {
88
88
  * arangojs methods, i.e. a partial ArangoDB document or the value of a
89
89
  * document's `_key` or `_id`.
90
90
  *
91
- * See {@link DocumentMetadata}.
91
+ * See {@link documents.DocumentMetadata}.
92
92
  */
93
93
  export declare type DocumentSelector = ObjectWithId | ObjectWithKey | string;
94
94
  /**
95
95
  * @internal
96
- * @hidden
97
96
  */
98
97
  export declare function _documentHandle(selector: DocumentSelector, collectionName: string, strict?: boolean): string;
99
98
  //# sourceMappingURL=documents.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;GAEG;AACH,oBAAY,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAC/D,OAAO,CAAC,gBAAgB,CAAC,GACzB,OAAO,CAAC,YAAY,CAAC,CAAC;AAExB;;GAEG;AACH,oBAAY,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAC3D,OAAO,CAAC,gBAAgB,CAAC,GACzB,YAAY,CAAC;AAEf;;GAEG;AACH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GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;;;;;GAMG;AACH,oBAAY,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,CAAC;AAErE;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,MAAM,EACtB,MAAM,GAAE,OAAc,GACrB,MAAM,CAuBR"}
package/documents.js CHANGED
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports._documentHandle = void 0;
13
13
  /**
14
14
  * @internal
15
- * @hidden
16
15
  */
17
16
  function _documentHandle(selector, collectionName, strict = true) {
18
17
  if (typeof selector !== "string") {
package/documents.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAwGH;;;GAGG;AACH,SAAgB,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,IAAI,QAAQ,CAAC,GAAG,EAAE;YAChB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SACtD;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;SACvD;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;KACH;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC1B,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,MAAM,IAAI,cAAc,KAAK,cAAc,EAAE;YAC/C,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;SACH;QACD,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5C;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AA3BD,0CA2BC","sourcesContent":["/**\n * ```ts\n * import type { Document, Edge } from \"arangojs/documents\";\n * ```\n *\n * The \"documents\" module provides document/edge related types for TypeScript.\n *\n * @packageDocumentation\n */\n\n/**\n * Common ArangoDB metadata properties of a document.\n */\nexport type DocumentMetadata = {\n /**\n * Key of the document, which uniquely identifies the document within its\n * collection.\n */\n _key: string;\n /**\n * Unique ID of the document, which is composed of the collection name\n * and the document `_key`.\n */\n _id: string;\n /**\n * Revision of the document data.\n */\n _rev: string;\n};\n\n/**\n * ArangoDB metadata defining the relations of an edge document.\n */\nexport type EdgeMetadata = {\n /**\n * Unique ID of the document that acts as the edge's start vertex.\n */\n _from: string;\n /**\n * Unique ID of the document that acts as the edge's end vertex.\n */\n _to: string;\n};\n\n/**\n * Type representing an object that can be stored in a collection.\n */\nexport type DocumentData<T extends Record<string, any> = any> = T &\n Partial<DocumentMetadata> &\n Partial<EdgeMetadata>;\n\n/**\n * Type representing an object that can be stored in an edge collection.\n */\nexport type EdgeData<T extends Record<string, any> = any> = T &\n Partial<DocumentMetadata> &\n EdgeMetadata;\n\n/**\n * Type representing a document stored in a collection.\n */\nexport type Document<T extends Record<string, any> = any> = T &\n DocumentMetadata &\n Partial<EdgeMetadata>;\n\n/**\n * Type representing an edge document stored in an edge collection.\n */\nexport type Edge<T extends Record<string, any> = any> = T &\n DocumentMetadata &\n EdgeMetadata;\n\n/**\n * Type representing patch data for a given object type to represent a payload\n * ArangoDB can apply in a document PATCH request (i.e. a partial update).\n *\n * This differs from `Partial` in that it also applies itself to any nested\n * objects recursively.\n */\nexport type Patch<T = Record<string, any>> = {\n [K in keyof T]?: T[K] | Patch<T[K]>;\n};\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithId = {\n [key: string]: any;\n _id: string;\n};\n\n/**\n * An object with an ArangoDB document `_key` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithKey = {\n [key: string]: any;\n _key: string;\n};\n\n/**\n * A value that can be used to identify a document within a collection in\n * arangojs methods, i.e. a partial ArangoDB document or the value of a\n * document's `_key` or `_id`.\n *\n * See {@link DocumentMetadata}.\n */\nexport type DocumentSelector = ObjectWithId | ObjectWithKey | string;\n\n/**\n * @internal\n * @hidden\n */\nexport function _documentHandle(\n selector: DocumentSelector,\n collectionName: string,\n strict: boolean = true\n): string {\n if (typeof selector !== \"string\") {\n if (selector._id) {\n return _documentHandle(selector._id, collectionName);\n }\n if (selector._key) {\n return _documentHandle(selector._key, collectionName);\n }\n throw new Error(\n \"Document handle must be a string or an object with a _key or _id attribute\"\n );\n }\n if (selector.includes(\"/\")) {\n const [head, ...tail] = selector.split(\"/\");\n const normalizedHead = head.normalize(\"NFC\");\n if (strict && normalizedHead !== collectionName) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`\n );\n }\n return [normalizedHead, ...tail].join(\"/\");\n }\n return `${collectionName}/${selector}`;\n}\n"]}
1
+ {"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAwGH;;GAEG;AACH,SAAgB,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;QAChC,IAAI,QAAQ,CAAC,GAAG,EAAE;YAChB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;SACtD;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;SACvD;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;KACH;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC1B,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC5C,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,MAAM,IAAI,cAAc,KAAK,cAAc,EAAE;YAC/C,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;SACH;QACD,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5C;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AA3BD,0CA2BC","sourcesContent":["/**\n * ```ts\n * import type { Document, Edge } from \"arangojs/documents\";\n * ```\n *\n * The \"documents\" module provides document/edge related types for TypeScript.\n *\n * @packageDocumentation\n */\n\n/**\n * Common ArangoDB metadata properties of a document.\n */\nexport type DocumentMetadata = {\n /**\n * Key of the document, which uniquely identifies the document within its\n * collection.\n */\n _key: string;\n /**\n * Unique ID of the document, which is composed of the collection name\n * and the document `_key`.\n */\n _id: string;\n /**\n * Revision of the document data.\n */\n _rev: string;\n};\n\n/**\n * ArangoDB metadata defining the relations of an edge document.\n */\nexport type EdgeMetadata = {\n /**\n * Unique ID of the document that acts as the edge's start vertex.\n */\n _from: string;\n /**\n * Unique ID of the document that acts as the edge's end vertex.\n */\n _to: string;\n};\n\n/**\n * Type representing an object that can be stored in a collection.\n */\nexport type DocumentData<T extends Record<string, any> = any> = T &\n Partial<DocumentMetadata> &\n Partial<EdgeMetadata>;\n\n/**\n * Type representing an object that can be stored in an edge collection.\n */\nexport type EdgeData<T extends Record<string, any> = any> = T &\n Partial<DocumentMetadata> &\n EdgeMetadata;\n\n/**\n * Type representing a document stored in a collection.\n */\nexport type Document<T extends Record<string, any> = any> = T &\n DocumentMetadata &\n Partial<EdgeMetadata>;\n\n/**\n * Type representing an edge document stored in an edge collection.\n */\nexport type Edge<T extends Record<string, any> = any> = T &\n DocumentMetadata &\n EdgeMetadata;\n\n/**\n * Type representing patch data for a given object type to represent a payload\n * ArangoDB can apply in a document PATCH request (i.e. a partial update).\n *\n * This differs from `Partial` in that it also applies itself to any nested\n * objects recursively.\n */\nexport type Patch<T = Record<string, any>> = {\n [K in keyof T]?: T[K] | Patch<T[K]>;\n};\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link documents.DocumentMetadata}.\n */\nexport type ObjectWithId = {\n [key: string]: any;\n _id: string;\n};\n\n/**\n * An object with an ArangoDB document `_key` property.\n *\n * See {@link documents.DocumentMetadata}.\n */\nexport type ObjectWithKey = {\n [key: string]: any;\n _key: string;\n};\n\n/**\n * A value that can be used to identify a document within a collection in\n * arangojs methods, i.e. a partial ArangoDB document or the value of a\n * document's `_key` or `_id`.\n *\n * See {@link documents.DocumentMetadata}.\n */\nexport type DocumentSelector = ObjectWithId | ObjectWithKey | string;\n\n/**\n * @internal\n */\nexport function _documentHandle(\n selector: DocumentSelector,\n collectionName: string,\n strict: boolean = true\n): string {\n if (typeof selector !== \"string\") {\n if (selector._id) {\n return _documentHandle(selector._id, collectionName);\n }\n if (selector._key) {\n return _documentHandle(selector._key, collectionName);\n }\n throw new Error(\n \"Document handle must be a string or an object with a _key or _id attribute\"\n );\n }\n if (selector.includes(\"/\")) {\n const [head, ...tail] = selector.split(\"/\");\n const normalizedHead = head.normalize(\"NFC\");\n if (strict && normalizedHead !== collectionName) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`\n );\n }\n return [normalizedHead, ...tail].join(\"/\");\n }\n return `${collectionName}/${selector}`;\n}\n"]}
package/error.d.ts CHANGED
@@ -8,7 +8,6 @@
8
8
  *
9
9
  * @packageDocumentation
10
10
  */
11
- import { ExtendableError } from "./lib/error";
12
11
  /**
13
12
  * Indicates whether the given value represents an {@link ArangoError}.
14
13
  *
@@ -36,12 +35,12 @@ export interface SystemError extends Error {
36
35
  /**
37
36
  * Represents an error returned by ArangoDB.
38
37
  */
39
- export declare class ArangoError extends ExtendableError {
38
+ export declare class ArangoError extends Error {
40
39
  name: string;
41
40
  /**
42
41
  * ArangoDB error code.
43
42
  *
44
- * See {@link https://www.arangodb.com/docs/stable/appendix-error-codes.html | ArangoDB error documentation}.
43
+ * See [ArangoDB error documentation](https://www.arangodb.com/docs/stable/appendix-error-codes.html).
45
44
  */
46
45
  errorNum: number;
47
46
  /**
@@ -54,7 +53,6 @@ export declare class ArangoError extends ExtendableError {
54
53
  response: any;
55
54
  /**
56
55
  * @internal
57
- * @hidden
58
56
  */
59
57
  constructor(response: any);
60
58
  /**
@@ -73,7 +71,7 @@ export declare class ArangoError extends ExtendableError {
73
71
  /**
74
72
  * Represents a plain HTTP error response.
75
73
  */
76
- export declare class HttpError extends ExtendableError {
74
+ export declare class HttpError extends Error {
77
75
  name: string;
78
76
  /**
79
77
  * Server response object.
@@ -85,7 +83,6 @@ export declare class HttpError extends ExtendableError {
85
83
  code: number;
86
84
  /**
87
85
  * @internal
88
- * @hidden
89
86
  */
90
87
  constructor(response: any);
91
88
  toJSON(): {
package/error.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyD9C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,WAAW,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO,CAQxD;AAED;;GAEG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AM,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,SAAiB;IACrB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC;IAEd;;OAEG;gBACS,QAAQ,EAAE,GAAG;IAazB;;;;OAIG;IACH,IAAI,aAAa,IAAI,IAAI,CAExB;IAED,MAAM;;;;;;CAQP;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;IAClC,IAAI,SAAe;IACnB;;OAEG;IACH,QAAQ,EAAE,GAAG,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;gBACS,QAAQ,EAAE,GAAG;IAYzB,MAAM;;;;CAMP"}
package/error.js CHANGED
@@ -1,6 +1,4 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HttpError = exports.ArangoError = exports.isSystemError = exports.isArangoErrorResponse = exports.isArangoError = void 0;
4
2
  /**
5
3
  * ```ts
6
4
  * import type { ArangoError, HttpError } from "arangojs/error";
@@ -11,9 +9,11 @@ exports.HttpError = exports.ArangoError = exports.isSystemError = exports.isAran
11
9
  *
12
10
  * @packageDocumentation
13
11
  */
14
- const error_1 = require("./lib/error");
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.HttpError = exports.ArangoError = exports.isSystemError = exports.isArangoErrorResponse = exports.isArangoError = void 0;
15
14
  const messages = {
16
15
  0: "Network Error",
16
+ 304: "Not Modified",
17
17
  400: "Bad Request",
18
18
  401: "Unauthorized",
19
19
  402: "Payment Required",
@@ -100,10 +100,9 @@ exports.isSystemError = isSystemError;
100
100
  /**
101
101
  * Represents an error returned by ArangoDB.
102
102
  */
103
- class ArangoError extends error_1.ExtendableError {
103
+ class ArangoError extends Error {
104
104
  /**
105
105
  * @internal
106
- * @hidden
107
106
  */
108
107
  constructor(response) {
109
108
  super();
@@ -140,10 +139,9 @@ exports.ArangoError = ArangoError;
140
139
  /**
141
140
  * Represents a plain HTTP error response.
142
141
  */
143
- class HttpError extends error_1.ExtendableError {
142
+ class HttpError extends Error {
144
143
  /**
145
144
  * @internal
146
- * @hidden
147
145
  */
148
146
  constructor(response) {
149
147
  super();
package/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,uCAA8C;AAE9C,MAAM,QAAQ,GAA8B;IAC1C,CAAC,EAAE,eAAe;IAClB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,oCAAoC;IACzC,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,uBAAuB;IAC5B,GAAG,EAAE,iBAAiB;IACtB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AAG,IAAI,CAAC,IAAI,CAAC;QACrB,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAE,CAAC;SACrC;IACH,CAAC;IAED,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;CACF;AAjCD,8BAiCC","sourcesContent":["/**\n * ```ts\n * import type { ArangoError, HttpError } from \"arangojs/error\";\n * ```\n *\n * The \"error\" module provides types and interfaces for TypeScript related\n * to arangojs error handling.\n *\n * @packageDocumentation\n */\nimport { ExtendableError } from \"./lib/error\";\n\nconst messages: { [key: number]: string } = {\n 0: \"Network Error\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"Request-URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Requested Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 444: \"Connection Closed Without Response\",\n 451: \"Unavailable For Legal Reasons\",\n 499: \"Client Closed Request\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\",\n 599: \"Network Connect Timeout Error\",\n};\n\nconst nativeErrorKeys = [\n \"fileName\",\n \"lineNumber\",\n \"columnNumber\",\n \"stack\",\n \"description\",\n \"number\",\n] as (keyof Error)[];\n\n/**\n * Indicates whether the given value represents an {@link ArangoError}.\n *\n * @param error - A value that might be an `ArangoError`.\n */\nexport function isArangoError(error: any): error is ArangoError {\n return Boolean(error && error.isArangoError);\n}\n\n/**\n * Indicates whether the given value represents an ArangoDB error response.\n *\n * @internal\n */\nexport function isArangoErrorResponse(body: any): boolean {\n return (\n body &&\n body.hasOwnProperty(\"error\") &&\n body.hasOwnProperty(\"code\") &&\n body.hasOwnProperty(\"errorMessage\") &&\n body.hasOwnProperty(\"errorNum\")\n );\n}\n\n/**\n * Indicates whether the given value represents a Node.js `SystemError`.\n */\nexport function isSystemError(err: any): err is SystemError {\n return (\n Object.getPrototypeOf(err) === Error.prototype &&\n err.hasOwnProperty(\"code\") &&\n err.hasOwnProperty(\"errno\") &&\n err.hasOwnProperty(\"syscall\")\n );\n}\n\n/**\n * Interface representing a Node.js `SystemError`.\n */\nexport interface SystemError extends Error {\n code: string;\n errno: number | string;\n syscall: string;\n}\n\n/**\n * Represents an error returned by ArangoDB.\n */\nexport class ArangoError extends ExtendableError {\n name = \"ArangoError\";\n /**\n * ArangoDB error code.\n *\n * See {@link https://www.arangodb.com/docs/stable/appendix-error-codes.html | ArangoDB error documentation}.\n */\n errorNum: number;\n /**\n * HTTP status code included in the server error response object.\n */\n code: number;\n /**\n * Server response object.\n */\n response: any;\n\n /**\n * @internal\n * @hidden\n */\n constructor(response: any) {\n super();\n this.response = response;\n this.message = response.body.errorMessage;\n this.errorNum = response.body.errorNum;\n this.code = response.body.code;\n const err = new Error(this.message);\n err.name = this.name;\n for (const key of nativeErrorKeys) {\n if (err[key]) this[key] = err[key]!;\n }\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB error.\n */\n get isArangoError(): true {\n return true;\n }\n\n toJSON() {\n return {\n error: true,\n errorMessage: this.message,\n errorNum: this.errorNum,\n code: this.code,\n };\n }\n}\n\n/**\n * Represents a plain HTTP error response.\n */\nexport class HttpError extends ExtendableError {\n name = \"HttpError\";\n /**\n * Server response object.\n */\n response: any;\n /**\n * HTTP status code of the server response.\n */\n code: number;\n\n /**\n * @internal\n * @hidden\n */\n constructor(response: any) {\n super();\n this.response = response;\n this.code = response.statusCode || 500;\n this.message = messages[this.code] || messages[500];\n const err = new Error(this.message);\n err.name = this.name;\n for (const key of nativeErrorKeys) {\n if (err[key]) this[key] = err[key]!;\n }\n }\n\n toJSON() {\n return {\n error: true,\n code: this.code,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AAEH,MAAM,QAAQ,GAA8B;IAC1C,CAAC,EAAE,eAAe;IAClB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,aAAa;IAClB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,kBAAkB;IACvB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,+BAA+B;IACpC,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,wBAAwB;IAC7B,GAAG,EAAE,iCAAiC;IACtC,GAAG,EAAE,oBAAoB;IACzB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,qBAAqB;IAC1B,GAAG,EAAE,sBAAsB;IAC3B,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,mBAAm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G,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC;QACvC,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,CAAC;QACpD,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACpC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACrB,KAAK,MAAM,GAAG,IAAI,eAAe,EAAE;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAE,CAAC;SACrC;IACH,CAAC;IAED,MAAM;QACJ,OAAO;YACL,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;IACJ,CAAC;CACF;AAhCD,8BAgCC","sourcesContent":["/**\n * ```ts\n * import type { ArangoError, HttpError } from \"arangojs/error\";\n * ```\n *\n * The \"error\" module provides types and interfaces for TypeScript related\n * to arangojs error handling.\n *\n * @packageDocumentation\n */\n\nconst messages: { [key: number]: string } = {\n 0: \"Network Error\",\n 304: \"Not Modified\",\n 400: \"Bad Request\",\n 401: \"Unauthorized\",\n 402: \"Payment Required\",\n 403: \"Forbidden\",\n 404: \"Not Found\",\n 405: \"Method Not Allowed\",\n 406: \"Not Acceptable\",\n 407: \"Proxy Authentication Required\",\n 408: \"Request Timeout\",\n 409: \"Conflict\",\n 410: \"Gone\",\n 411: \"Length Required\",\n 412: \"Precondition Failed\",\n 413: \"Payload Too Large\",\n 414: \"Request-URI Too Long\",\n 415: \"Unsupported Media Type\",\n 416: \"Requested Range Not Satisfiable\",\n 417: \"Expectation Failed\",\n 418: \"I'm a teapot\",\n 421: \"Misdirected Request\",\n 422: \"Unprocessable Entity\",\n 423: \"Locked\",\n 424: \"Failed Dependency\",\n 426: \"Upgrade Required\",\n 428: \"Precondition Required\",\n 429: \"Too Many Requests\",\n 431: \"Request Header Fields Too Large\",\n 444: \"Connection Closed Without Response\",\n 451: \"Unavailable For Legal Reasons\",\n 499: \"Client Closed Request\",\n 500: \"Internal Server Error\",\n 501: \"Not Implemented\",\n 502: \"Bad Gateway\",\n 503: \"Service Unavailable\",\n 504: \"Gateway Timeout\",\n 505: \"HTTP Version Not Supported\",\n 506: \"Variant Also Negotiates\",\n 507: \"Insufficient Storage\",\n 508: \"Loop Detected\",\n 510: \"Not Extended\",\n 511: \"Network Authentication Required\",\n 599: \"Network Connect Timeout Error\",\n};\n\nconst nativeErrorKeys = [\n \"fileName\",\n \"lineNumber\",\n \"columnNumber\",\n \"stack\",\n \"description\",\n \"number\",\n] as (keyof Error)[];\n\n/**\n * Indicates whether the given value represents an {@link ArangoError}.\n *\n * @param error - A value that might be an `ArangoError`.\n */\nexport function isArangoError(error: any): error is ArangoError {\n return Boolean(error && error.isArangoError);\n}\n\n/**\n * Indicates whether the given value represents an ArangoDB error response.\n *\n * @internal\n */\nexport function isArangoErrorResponse(body: any): boolean {\n return (\n body &&\n body.hasOwnProperty(\"error\") &&\n body.hasOwnProperty(\"code\") &&\n body.hasOwnProperty(\"errorMessage\") &&\n body.hasOwnProperty(\"errorNum\")\n );\n}\n\n/**\n * Indicates whether the given value represents a Node.js `SystemError`.\n */\nexport function isSystemError(err: any): err is SystemError {\n return (\n Object.getPrototypeOf(err) === Error.prototype &&\n err.hasOwnProperty(\"code\") &&\n err.hasOwnProperty(\"errno\") &&\n err.hasOwnProperty(\"syscall\")\n );\n}\n\n/**\n * Interface representing a Node.js `SystemError`.\n */\nexport interface SystemError extends Error {\n code: string;\n errno: number | string;\n syscall: string;\n}\n\n/**\n * Represents an error returned by ArangoDB.\n */\nexport class ArangoError extends Error {\n name = \"ArangoError\";\n /**\n * ArangoDB error code.\n *\n * See [ArangoDB error documentation](https://www.arangodb.com/docs/stable/appendix-error-codes.html).\n */\n errorNum: number;\n /**\n * HTTP status code included in the server error response object.\n */\n code: number;\n /**\n * Server response object.\n */\n response: any;\n\n /**\n * @internal\n */\n constructor(response: any) {\n super();\n this.response = response;\n this.message = response.body.errorMessage;\n this.errorNum = response.body.errorNum;\n this.code = response.body.code;\n const err = new Error(this.message);\n err.name = this.name;\n for (const key of nativeErrorKeys) {\n if (err[key]) this[key] = err[key]!;\n }\n }\n\n /**\n * @internal\n *\n * Indicates that this object represents an ArangoDB error.\n */\n get isArangoError(): true {\n return true;\n }\n\n toJSON() {\n return {\n error: true,\n errorMessage: this.message,\n errorNum: this.errorNum,\n code: this.code,\n };\n }\n}\n\n/**\n * Represents a plain HTTP error response.\n */\nexport class HttpError extends Error {\n name = \"HttpError\";\n /**\n * Server response object.\n */\n response: any;\n /**\n * HTTP status code of the server response.\n */\n code: number;\n\n /**\n * @internal\n */\n constructor(response: any) {\n super();\n this.response = response;\n this.code = response.statusCode || 500;\n this.message = messages[this.code] || messages[500];\n const err = new Error(this.message);\n err.name = this.name;\n for (const key of nativeErrorKeys) {\n if (err[key]) this[key] = err[key]!;\n }\n }\n\n toJSON() {\n return {\n error: true,\n code: this.code,\n };\n }\n}\n"]}
@@ -5,12 +5,11 @@
5
5
  *
6
6
  * The "foxx-manifest" module provides the Foxx manifest type for TypeScript.
7
7
  *
8
- * Generated from {@link http://json.schemastore.org/foxx-manifest | JSON Schema}
8
+ * Generated from [JSON Schema](http://json.schemastore.org/foxx-manifest)
9
9
  * using `json-schema-to-typescript`.
10
10
  *
11
11
  * @packageDocumentation
12
12
  */
13
- import { Dict } from "./connection";
14
13
  /**
15
14
  * Schema for ArangoDB Foxx service manifests.
16
15
  */
@@ -18,7 +17,7 @@ export declare type FoxxManifest = {
18
17
  /**
19
18
  * An object defining the configuration options this service requires.
20
19
  */
21
- configuration?: Dict<Configuration>;
20
+ configuration?: Record<string, Configuration>;
22
21
  /**
23
22
  * If specified, the / (root) route of the service will automatically redirect to the given relative path, e.g. "index.html".
24
23
  */
@@ -26,21 +25,21 @@ export declare type FoxxManifest = {
26
25
  /**
27
26
  * The dependencies this service uses, i.e. which APIs its dependencies need to be compatible with.
28
27
  */
29
- dependencies?: Dict<string | Dependency>;
28
+ dependencies?: Record<string, string | Dependency>;
30
29
  /**
31
30
  * The dependencies this provides, i.e. which APIs it claims to be compatible with.
32
31
  */
33
- provides?: Dict<string>;
32
+ provides?: Record<string, string>;
34
33
  /**
35
34
  * An object indicating the semantic version ranges of ArangoDB (or compatible environments) the service will be compatible with.
36
35
  */
37
- engines?: Dict<string> & {
36
+ engines?: Record<string, string> & {
38
37
  arangodb?: string;
39
38
  };
40
39
  /**
41
40
  * An object defining file assets served by this service.
42
41
  */
43
- files?: Dict<string | File>;
42
+ files?: Record<string, string | File>;
44
43
  /**
45
44
  * The relative path to the Foxx JavaScript files in the service, e.g. "lib". Defaults to the folder containing this manifest.
46
45
  */
@@ -52,7 +51,7 @@ export declare type FoxxManifest = {
52
51
  /**
53
52
  * An object defining named scripts provided by this service, which can either be used directly or as queued jobs by other services.
54
53
  */
55
- scripts?: Dict<string>;
54
+ scripts?: Record<string, string>;
56
55
  /**
57
56
  * A path/pattern or list of paths/patterns of JavaScript tests provided for this service.
58
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"foxx-manifest.d.ts","sourceRoot":"","sources":["../src/foxx-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC;;GAEG;AACH,oBAAY,YAAY,GAAG;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,CAAC;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG;QAC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7
  * The "foxx-manifest" module provides the Foxx manifest type for TypeScript.
8
8
  *
9
- * Generated from {@link http://json.schemastore.org/foxx-manifest | JSON Schema}
9
+ * Generated from [JSON Schema](http://json.schemastore.org/foxx-manifest)
10
10
  * using `json-schema-to-typescript`.
11
11
  *
12
12
  * @packageDocumentation
@@ -1 +1 @@
1
- {"version":3,"file":"foxx-manifest.js","sourceRoot":"","sources":["../src/foxx-manifest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG","sourcesContent":["/**\n * ```ts\n * import type { FoxxManifest } from \"arangojs/foxx-manifest\";\n * ```\n *\n * The \"foxx-manifest\" module provides the Foxx manifest type for TypeScript.\n *\n * Generated from {@link http://json.schemastore.org/foxx-manifest | JSON Schema}\n * using `json-schema-to-typescript`.\n *\n * @packageDocumentation\n */\n\nimport { Dict } from \"./connection\";\n\n/**\n * Schema for ArangoDB Foxx service manifests.\n */\nexport type FoxxManifest = {\n /**\n * An object defining the configuration options this service requires.\n */\n configuration?: Dict<Configuration>;\n /**\n * If specified, the / (root) route of the service will automatically redirect to the given relative path, e.g. \"index.html\".\n */\n defaultDocument?: string;\n /**\n * The dependencies this service uses, i.e. which APIs its dependencies need to be compatible with.\n */\n dependencies?: Dict<string | Dependency>;\n /**\n * The dependencies this provides, i.e. which APIs it claims to be compatible with.\n */\n provides?: Dict<string>;\n /**\n * An object indicating the semantic version ranges of ArangoDB (or compatible environments) the service will be compatible with.\n */\n engines?: Dict<string> & {\n arangodb?: string;\n };\n /**\n * An object defining file assets served by this service.\n */\n files?: Dict<string | File>;\n /**\n * The relative path to the Foxx JavaScript files in the service, e.g. \"lib\". Defaults to the folder containing this manifest.\n */\n lib?: string;\n /**\n * The relative path to the main entry point of this service (relative to lib), e.g. \"index.js\".\n */\n main?: string;\n /**\n * An object defining named scripts provided by this service, which can either be used directly or as queued jobs by other services.\n */\n scripts?: Dict<string>;\n /**\n * A path/pattern or list of paths/patterns of JavaScript tests provided for this service.\n */\n tests?: string | string[];\n /**\n * The full name of the author of the service (i.e. you). This will be shown in the web interface.\n */\n author?: string;\n /**\n * A list of names of people that have contributed to the development of the service in some way. This will be shown in the web interface.\n */\n contributors?: string[];\n /**\n * A human-readable description of the service. This will be shown in the web interface.\n */\n description?: string;\n /**\n * A list of keywords that help categorize this service. This is used by the Foxx Store installers to organize services.\n */\n keywords?: string[];\n /**\n * A string identifying the license under which the service is published, ideally in the form of an SPDX license identifier. This will be shown in the web interface.\n */\n license?: string;\n /**\n * The name of the Foxx service. This will be shown in the web interface.\n */\n name?: string;\n /**\n * The filename of a thumbnail that will be used alongside the service in the web interface. This should be a JPEG or PNG image that looks good at sizes 50x50 and 160x160.\n */\n thumbnail?: string;\n /**\n * The version number of the Foxx service. The version number must follow the semantic versioning format. This will be shown in the web interface.\n */\n version?: string;\n};\n\n/**\n * A configuration option.\n */\nexport type Configuration = {\n /**\n * A human-readable description of the option.\n */\n description?: string;\n /**\n * The type of value expected for this option.\n */\n type:\n | \"integer\"\n | \"boolean\"\n | \"number\"\n | \"string\"\n | \"json\"\n | \"password\"\n | \"int\"\n | \"bool\";\n /**\n * The default value for this option in plain JSON. Can be omitted to provide no default value.\n */\n default?: any;\n /**\n * Whether the service can not function without this option. Defaults to true unless a default value is provided.\n */\n required?: boolean;\n};\n\n/**\n * A service dependency.\n */\nexport type Dependency = {\n /**\n * Name of the API the service expects.\n */\n name?: string;\n /**\n * The semantic version ranges of the API the service expects.\n */\n version?: string;\n /**\n * A description of how the API is used or why it is needed.\n */\n description?: string;\n /**\n * Whether the service can not function without this dependency.\n */\n required?: boolean;\n /**\n * Whether the dependency can be specified more than once.\n */\n multiple?: boolean;\n};\n\n/**\n * A service file asset.\n */\nexport type File = {\n /**\n * Relative path of the file or folder within the service.\n */\n path: string;\n /**\n * If set to true the file will be served with gzip-encoding if supported by the client. This can be useful when serving text files like client-side JavaScript, CSS or HTML.\n */\n gzip?: boolean;\n /**\n * The MIME content type of the file. Defaults to an intelligent guess based on the filename's extension.\n */\n type?: string;\n};\n"]}
1
+ {"version":3,"file":"foxx-manifest.js","sourceRoot":"","sources":["../src/foxx-manifest.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG","sourcesContent":["/**\n * ```ts\n * import type { FoxxManifest } from \"arangojs/foxx-manifest\";\n * ```\n *\n * The \"foxx-manifest\" module provides the Foxx manifest type for TypeScript.\n *\n * Generated from [JSON Schema](http://json.schemastore.org/foxx-manifest)\n * using `json-schema-to-typescript`.\n *\n * @packageDocumentation\n */\n\n/**\n * Schema for ArangoDB Foxx service manifests.\n */\nexport type FoxxManifest = {\n /**\n * An object defining the configuration options this service requires.\n */\n configuration?: Record<string, Configuration>;\n /**\n * If specified, the / (root) route of the service will automatically redirect to the given relative path, e.g. \"index.html\".\n */\n defaultDocument?: string;\n /**\n * The dependencies this service uses, i.e. which APIs its dependencies need to be compatible with.\n */\n dependencies?: Record<string, string | Dependency>;\n /**\n * The dependencies this provides, i.e. which APIs it claims to be compatible with.\n */\n provides?: Record<string, string>;\n /**\n * An object indicating the semantic version ranges of ArangoDB (or compatible environments) the service will be compatible with.\n */\n engines?: Record<string, string> & {\n arangodb?: string;\n };\n /**\n * An object defining file assets served by this service.\n */\n files?: Record<string, string | File>;\n /**\n * The relative path to the Foxx JavaScript files in the service, e.g. \"lib\". Defaults to the folder containing this manifest.\n */\n lib?: string;\n /**\n * The relative path to the main entry point of this service (relative to lib), e.g. \"index.js\".\n */\n main?: string;\n /**\n * An object defining named scripts provided by this service, which can either be used directly or as queued jobs by other services.\n */\n scripts?: Record<string, string>;\n /**\n * A path/pattern or list of paths/patterns of JavaScript tests provided for this service.\n */\n tests?: string | string[];\n /**\n * The full name of the author of the service (i.e. you). This will be shown in the web interface.\n */\n author?: string;\n /**\n * A list of names of people that have contributed to the development of the service in some way. This will be shown in the web interface.\n */\n contributors?: string[];\n /**\n * A human-readable description of the service. This will be shown in the web interface.\n */\n description?: string;\n /**\n * A list of keywords that help categorize this service. This is used by the Foxx Store installers to organize services.\n */\n keywords?: string[];\n /**\n * A string identifying the license under which the service is published, ideally in the form of an SPDX license identifier. This will be shown in the web interface.\n */\n license?: string;\n /**\n * The name of the Foxx service. This will be shown in the web interface.\n */\n name?: string;\n /**\n * The filename of a thumbnail that will be used alongside the service in the web interface. This should be a JPEG or PNG image that looks good at sizes 50x50 and 160x160.\n */\n thumbnail?: string;\n /**\n * The version number of the Foxx service. The version number must follow the semantic versioning format. This will be shown in the web interface.\n */\n version?: string;\n};\n\n/**\n * A configuration option.\n */\nexport type Configuration = {\n /**\n * A human-readable description of the option.\n */\n description?: string;\n /**\n * The type of value expected for this option.\n */\n type:\n | \"integer\"\n | \"boolean\"\n | \"number\"\n | \"string\"\n | \"json\"\n | \"password\"\n | \"int\"\n | \"bool\";\n /**\n * The default value for this option in plain JSON. Can be omitted to provide no default value.\n */\n default?: any;\n /**\n * Whether the service can not function without this option. Defaults to true unless a default value is provided.\n */\n required?: boolean;\n};\n\n/**\n * A service dependency.\n */\nexport type Dependency = {\n /**\n * Name of the API the service expects.\n */\n name?: string;\n /**\n * The semantic version ranges of the API the service expects.\n */\n version?: string;\n /**\n * A description of how the API is used or why it is needed.\n */\n description?: string;\n /**\n * Whether the service can not function without this dependency.\n */\n required?: boolean;\n /**\n * Whether the dependency can be specified more than once.\n */\n multiple?: boolean;\n};\n\n/**\n * A service file asset.\n */\nexport type File = {\n /**\n * Relative path of the file or folder within the service.\n */\n path: string;\n /**\n * If set to true the file will be served with gzip-encoding if supported by the client. This can be useful when serving text files like client-side JavaScript, CSS or HTML.\n */\n gzip?: boolean;\n /**\n * The MIME content type of the file. Defaults to an intelligent guess based on the filename's extension.\n */\n type?: string;\n};\n"]}