arangojs 10.0.0 → 10.1.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.
- package/CHANGELOG.md +9 -0
- package/cjs/connection.js +1 -1
- package/cjs/documents.d.ts +7 -0
- package/cjs/documents.d.ts.map +1 -1
- package/cjs/documents.js.map +1 -1
- package/documents.d.ts +7 -0
- package/documents.d.ts.map +1 -1
- package/esm/connection.js +1 -1
- package/esm/documents.d.ts +7 -0
- package/esm/documents.d.ts.map +1 -1
- package/esm/documents.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,14 @@ 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
|
+
## [10.1.0] - 2025-01-13
|
|
18
|
+
|
|
19
|
+
### Added
|
|
20
|
+
|
|
21
|
+
- Added `ignoreRevs` option to `RemoveDocumentOptions` type (DE-947)
|
|
22
|
+
|
|
23
|
+
This affects the `collection.remove` and `collection.removeAll` methods.
|
|
24
|
+
|
|
17
25
|
## [10.0.0] - 2025-01-06
|
|
18
26
|
|
|
19
27
|
This is a major release and breaks backwards compatibility.
|
|
@@ -2452,6 +2460,7 @@ For a detailed list of changes between pre-release versions of v7 see the
|
|
|
2452
2460
|
|
|
2453
2461
|
Graph methods now only return the relevant part of the response body.
|
|
2454
2462
|
|
|
2463
|
+
[10.1.0]: https://github.com/arangodb/arangojs/compare/v10.0.0...v10.1.0
|
|
2455
2464
|
[10.0.0]: https://github.com/arangodb/arangojs/compare/v9.3.0...v10.0.0
|
|
2456
2465
|
[9.3.0]: https://github.com/arangodb/arangojs/compare/v9.2.0...v9.3.0
|
|
2457
2466
|
[9.2.0]: https://github.com/arangodb/arangojs/compare/v9.1.0...v9.2.0
|
package/cjs/connection.js
CHANGED
|
@@ -351,7 +351,7 @@ class Connection {
|
|
|
351
351
|
...commonFetchOptions,
|
|
352
352
|
};
|
|
353
353
|
this._commonFetchOptions.headers.set("x-arango-version", String(arangoVersion));
|
|
354
|
-
this._commonFetchOptions.headers.set("x-arango-driver", `arangojs/10.
|
|
354
|
+
this._commonFetchOptions.headers.set("x-arango-driver", `arangojs/10.1.0 (cloud)`);
|
|
355
355
|
this.addToHostList(URLS);
|
|
356
356
|
if (auth) {
|
|
357
357
|
if (configuration.isBearerAuth(auth)) {
|
package/cjs/documents.d.ts
CHANGED
|
@@ -345,6 +345,13 @@ export type RemoveDocumentOptions = {
|
|
|
345
345
|
* Default: `false`
|
|
346
346
|
*/
|
|
347
347
|
waitForSync?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* If set to `false`, the existing document will only be modified if its
|
|
350
|
+
* `_rev` property matches the same property on the new data.
|
|
351
|
+
*
|
|
352
|
+
* Default: `true`
|
|
353
|
+
*/
|
|
354
|
+
ignoreRevs?: boolean;
|
|
348
355
|
/**
|
|
349
356
|
* If set to `true`, the complete old document will be returned as the `old`
|
|
350
357
|
* property on the result object. Has no effect if `silent` is set to `true`.
|
package/cjs/documents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH;;GAEG;AACH,MAAM,MAAM,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,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,G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AAM,GAAG,GAAG,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,MAAM,EACtB,MAAM,GAAE,OAAc,GACrB,MAAM,CAsBR"}
|
package/cjs/documents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAijBH;;GAEG;AACH,SAAgB,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,MAAM,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AA1BD,0CA0BC;AACD,YAAY","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//#region Shared types\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//#endregion\n\n//#region Document types\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//#endregion\n\n//#region Document operation options\n/**\n * Options for checking whether a document exists in a collection.\n */\nexport type DocumentExistsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * does not match the given revision.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving a document from a collection.\n */\nexport type ReadDocumentOptions = {\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists but its `_rev` does not match the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists and its `_rev` matches the given revision. Note that an\n * `HttpError` with code 304 will be thrown instead of an `ArangoError`.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving multiple documents from a collection.\n */\nexport type BulkReadDocumentsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n};\n\n/**\n * Options for inserting a new document into a collection.\n */\nexport type InsertDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n * This option is only available when `overwriteMode` is set to `\"update\"` or\n * `\"replace\"`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * Defines what should happen if a document with the same `_key` or `_id`\n * already exists, instead of throwing an exception.\n *\n * Default: `\"conflict\"\n */\n overwriteMode?: \"ignore\" | \"update\" | \"replace\" | \"conflict\";\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged when an existing document\n * with the same `_key` or `_id` is updated. This does not affect arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to `true`, new entries will be added to in-memory index caches if\n * document insertions affect the edge index or cache-enabled persistent\n * indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for replacing an existing document in a collection.\n */\nexport type ReplaceDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to a document revision, the document will only be replaced if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document replacements affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for updating a document in a collection.\n */\nexport type UpdateDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged. This does not affect\n * arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to a document revision, the document will only be updated if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document updates affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for removing a document from a collection.\n */\nexport type RemoveDocumentOptions = {\n /**\n * If set to `true`, changes will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * deleted if document removals affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n};\n\n/**\n * Options for bulk importing documents into a collection.\n */\nexport type ImportDocumentsOptions = {\n /**\n * (Edge collections only.) Prefix to prepend to `_from` attribute values.\n */\n fromPrefix?: string;\n /**\n * (Edge collections only.) Prefix to prepend to `_to` attribute values.\n */\n toPrefix?: string;\n /**\n * If set to `true`, the collection is truncated before the data is imported.\n *\n * Default: `false`\n */\n overwrite?: boolean;\n /**\n * Whether to wait for the documents to have been synced to disk.\n */\n waitForSync?: boolean;\n /**\n * Controls behavior when a unique constraint is violated on the document key.\n *\n * * `\"error\"`: the document will not be imported.\n * * `\"update`: the document will be merged into the existing document.\n * * `\"replace\"`: the document will replace the existing document.\n * * `\"ignore\"`: the document will not be imported and the unique constraint\n * error will be ignored.\n *\n * Default: `\"error\"`\n */\n onDuplicate?: \"error\" | \"update\" | \"replace\" | \"ignore\";\n /**\n * If set to `true`, the import will abort if any error occurs.\n */\n complete?: boolean;\n /**\n * Whether the response should contain additional details about documents\n * that could not be imported.\n */\n details?: boolean;\n};\n\n/**\n * Options for retrieving a document's edges from a collection.\n */\nexport type DocumentEdgesOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n};\n//#endregion\n\n//#region Document operation results\n/**\n * Represents a bulk operation failure for an individual document.\n */\nexport type DocumentOperationFailure = {\n /**\n * Indicates that the operation failed.\n */\n error: true;\n /**\n * Human-readable description of the failure.\n */\n errorMessage: string;\n /**\n * Numeric representation of the failure.\n */\n errorNum: number;\n};\n\n/**\n * Metadata returned by a document operation.\n */\nexport type DocumentOperationMetadata = DocumentMetadata & {\n /**\n * Revision of the document that was updated or replaced by this operation.\n */\n _oldRev?: string;\n};\n\n/**\n * Result of a collection bulk import.\n */\nexport type ImportDocumentsResult = {\n /**\n * Whether the import failed.\n */\n error: false;\n /**\n * Number of new documents imported.\n */\n created: number;\n /**\n * Number of documents that failed with an error.\n */\n errors: number;\n /**\n * Number of empty documents.\n */\n empty: number;\n /**\n * Number of documents updated.\n */\n updated: number;\n /**\n * Number of documents that failed with an error that is ignored.\n */\n ignored: number;\n /**\n * Additional details about any errors encountered during the import.\n */\n details?: string[];\n};\n\n/**\n * Result of retrieving edges in a collection.\n */\nexport type DocumentEdgesResult<T extends Record<string, any> = any> = {\n edges: Edge<T>[];\n stats: {\n scannedIndex: number;\n filtered: number;\n };\n};\n//#endregion\n\n//#region Document selectors\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 =\n | ObjectWithDocumentId\n | ObjectWithDocumentKey\n | string;\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithDocumentId = {\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 ObjectWithDocumentKey = {\n [key: string]: any;\n _key: string;\n};\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] = selector.split(\"/\");\n if (strict && head !== collectionName) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`,\n );\n }\n return selector;\n }\n return `${collectionName}/${selector}`;\n}\n//#endregion\n"]}
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/documents.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AAwjBH;;GAEG;AACH,SAAgB,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,MAAM,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AA1BD,0CA0BC;AACD,YAAY","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//#region Shared types\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//#endregion\n\n//#region Document types\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//#endregion\n\n//#region Document operation options\n/**\n * Options for checking whether a document exists in a collection.\n */\nexport type DocumentExistsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * does not match the given revision.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving a document from a collection.\n */\nexport type ReadDocumentOptions = {\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists but its `_rev` does not match the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists and its `_rev` matches the given revision. Note that an\n * `HttpError` with code 304 will be thrown instead of an `ArangoError`.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving multiple documents from a collection.\n */\nexport type BulkReadDocumentsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n};\n\n/**\n * Options for inserting a new document into a collection.\n */\nexport type InsertDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n * This option is only available when `overwriteMode` is set to `\"update\"` or\n * `\"replace\"`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * Defines what should happen if a document with the same `_key` or `_id`\n * already exists, instead of throwing an exception.\n *\n * Default: `\"conflict\"\n */\n overwriteMode?: \"ignore\" | \"update\" | \"replace\" | \"conflict\";\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged when an existing document\n * with the same `_key` or `_id` is updated. This does not affect arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to `true`, new entries will be added to in-memory index caches if\n * document insertions affect the edge index or cache-enabled persistent\n * indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for replacing an existing document in a collection.\n */\nexport type ReplaceDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to a document revision, the document will only be replaced if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document replacements affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for updating a document in a collection.\n */\nexport type UpdateDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged. This does not affect\n * arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to a document revision, the document will only be updated if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document updates affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for removing a document from a collection.\n */\nexport type RemoveDocumentOptions = {\n /**\n * If set to `true`, changes will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * deleted if document removals affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n};\n\n/**\n * Options for bulk importing documents into a collection.\n */\nexport type ImportDocumentsOptions = {\n /**\n * (Edge collections only.) Prefix to prepend to `_from` attribute values.\n */\n fromPrefix?: string;\n /**\n * (Edge collections only.) Prefix to prepend to `_to` attribute values.\n */\n toPrefix?: string;\n /**\n * If set to `true`, the collection is truncated before the data is imported.\n *\n * Default: `false`\n */\n overwrite?: boolean;\n /**\n * Whether to wait for the documents to have been synced to disk.\n */\n waitForSync?: boolean;\n /**\n * Controls behavior when a unique constraint is violated on the document key.\n *\n * * `\"error\"`: the document will not be imported.\n * * `\"update`: the document will be merged into the existing document.\n * * `\"replace\"`: the document will replace the existing document.\n * * `\"ignore\"`: the document will not be imported and the unique constraint\n * error will be ignored.\n *\n * Default: `\"error\"`\n */\n onDuplicate?: \"error\" | \"update\" | \"replace\" | \"ignore\";\n /**\n * If set to `true`, the import will abort if any error occurs.\n */\n complete?: boolean;\n /**\n * Whether the response should contain additional details about documents\n * that could not be imported.\n */\n details?: boolean;\n};\n\n/**\n * Options for retrieving a document's edges from a collection.\n */\nexport type DocumentEdgesOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n};\n//#endregion\n\n//#region Document operation results\n/**\n * Represents a bulk operation failure for an individual document.\n */\nexport type DocumentOperationFailure = {\n /**\n * Indicates that the operation failed.\n */\n error: true;\n /**\n * Human-readable description of the failure.\n */\n errorMessage: string;\n /**\n * Numeric representation of the failure.\n */\n errorNum: number;\n};\n\n/**\n * Metadata returned by a document operation.\n */\nexport type DocumentOperationMetadata = DocumentMetadata & {\n /**\n * Revision of the document that was updated or replaced by this operation.\n */\n _oldRev?: string;\n};\n\n/**\n * Result of a collection bulk import.\n */\nexport type ImportDocumentsResult = {\n /**\n * Whether the import failed.\n */\n error: false;\n /**\n * Number of new documents imported.\n */\n created: number;\n /**\n * Number of documents that failed with an error.\n */\n errors: number;\n /**\n * Number of empty documents.\n */\n empty: number;\n /**\n * Number of documents updated.\n */\n updated: number;\n /**\n * Number of documents that failed with an error that is ignored.\n */\n ignored: number;\n /**\n * Additional details about any errors encountered during the import.\n */\n details?: string[];\n};\n\n/**\n * Result of retrieving edges in a collection.\n */\nexport type DocumentEdgesResult<T extends Record<string, any> = any> = {\n edges: Edge<T>[];\n stats: {\n scannedIndex: number;\n filtered: number;\n };\n};\n//#endregion\n\n//#region Document selectors\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 =\n | ObjectWithDocumentId\n | ObjectWithDocumentKey\n | string;\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithDocumentId = {\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 ObjectWithDocumentKey = {\n [key: string]: any;\n _key: string;\n};\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] = selector.split(\"/\");\n if (strict && head !== collectionName) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`\n );\n }\n return selector;\n }\n return `${collectionName}/${selector}`;\n}\n//#endregion\n"]}
|
package/documents.d.ts
CHANGED
|
@@ -345,6 +345,13 @@ export type RemoveDocumentOptions = {
|
|
|
345
345
|
* Default: `false`
|
|
346
346
|
*/
|
|
347
347
|
waitForSync?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* If set to `false`, the existing document will only be modified if its
|
|
350
|
+
* `_rev` property matches the same property on the new data.
|
|
351
|
+
*
|
|
352
|
+
* Default: `true`
|
|
353
|
+
*/
|
|
354
|
+
ignoreRevs?: boolean;
|
|
348
355
|
/**
|
|
349
356
|
* If set to `true`, the complete old document will be returned as the `old`
|
|
350
357
|
* property on the result object. Has no effect if `silent` is set to `true`.
|
package/documents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH;;GAEG;AACH,MAAM,MAAM,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,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,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,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAC3D,OAAO,CAAC,gBAAgB,CAAC,GACzB,YAAY,CAAC;AAEf;;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323
323
|
};
|
|
324
324
|
this._commonFetchOptions.headers.set("x-arango-version", String(arangoVersion));
|
|
325
|
-
this._commonFetchOptions.headers.set("x-arango-driver", `arangojs/10.
|
|
325
|
+
this._commonFetchOptions.headers.set("x-arango-driver", `arangojs/10.1.0 (cloud)`);
|
|
326
326
|
this.addToHostList(URLS);
|
|
327
327
|
if (auth) {
|
|
328
328
|
if (configuration.isBearerAuth(auth)) {
|
package/esm/documents.d.ts
CHANGED
|
@@ -345,6 +345,13 @@ export type RemoveDocumentOptions = {
|
|
|
345
345
|
* Default: `false`
|
|
346
346
|
*/
|
|
347
347
|
waitForSync?: boolean;
|
|
348
|
+
/**
|
|
349
|
+
* If set to `false`, the existing document will only be modified if its
|
|
350
|
+
* `_rev` property matches the same property on the new data.
|
|
351
|
+
*
|
|
352
|
+
* Default: `true`
|
|
353
|
+
*/
|
|
354
|
+
ignoreRevs?: boolean;
|
|
348
355
|
/**
|
|
349
356
|
* If set to `true`, the complete old document will be returned as the `old`
|
|
350
357
|
* property on the result object. Has no effect if `silent` is set to `true`.
|
package/esm/documents.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.d.ts","sourceRoot":"","sources":["../../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH;;GAEG;AACH,MAAM,MAAM,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,MAAM,MAAM,YAAY,GAAG;IACzB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAIF;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,IAAI,CA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AI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,gBAAgB,EAC1B,cAAc,EAAE,MAAM,EACtB,MAAM,GAAE,OAAc,GACrB,MAAM,CAsBR"}
|
package/esm/documents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAijBH;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,MAAM,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AACD,YAAY","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//#region Shared types\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//#endregion\n\n//#region Document types\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//#endregion\n\n//#region Document operation options\n/**\n * Options for checking whether a document exists in a collection.\n */\nexport type DocumentExistsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * does not match the given revision.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving a document from a collection.\n */\nexport type ReadDocumentOptions = {\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists but its `_rev` does not match the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists and its `_rev` matches the given revision. Note that an\n * `HttpError` with code 304 will be thrown instead of an `ArangoError`.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving multiple documents from a collection.\n */\nexport type BulkReadDocumentsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n};\n\n/**\n * Options for inserting a new document into a collection.\n */\nexport type InsertDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n * This option is only available when `overwriteMode` is set to `\"update\"` or\n * `\"replace\"`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * Defines what should happen if a document with the same `_key` or `_id`\n * already exists, instead of throwing an exception.\n *\n * Default: `\"conflict\"\n */\n overwriteMode?: \"ignore\" | \"update\" | \"replace\" | \"conflict\";\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged when an existing document\n * with the same `_key` or `_id` is updated. This does not affect arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to `true`, new entries will be added to in-memory index caches if\n * document insertions affect the edge index or cache-enabled persistent\n * indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for replacing an existing document in a collection.\n */\nexport type ReplaceDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to a document revision, the document will only be replaced if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document replacements affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for updating a document in a collection.\n */\nexport type UpdateDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged. This does not affect\n * arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to a document revision, the document will only be updated if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document updates affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for removing a document from a collection.\n */\nexport type RemoveDocumentOptions = {\n /**\n * If set to `true`, changes will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * deleted if document removals affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n};\n\n/**\n * Options for bulk importing documents into a collection.\n */\nexport type ImportDocumentsOptions = {\n /**\n * (Edge collections only.) Prefix to prepend to `_from` attribute values.\n */\n fromPrefix?: string;\n /**\n * (Edge collections only.) Prefix to prepend to `_to` attribute values.\n */\n toPrefix?: string;\n /**\n * If set to `true`, the collection is truncated before the data is imported.\n *\n * Default: `false`\n */\n overwrite?: boolean;\n /**\n * Whether to wait for the documents to have been synced to disk.\n */\n waitForSync?: boolean;\n /**\n * Controls behavior when a unique constraint is violated on the document key.\n *\n * * `\"error\"`: the document will not be imported.\n * * `\"update`: the document will be merged into the existing document.\n * * `\"replace\"`: the document will replace the existing document.\n * * `\"ignore\"`: the document will not be imported and the unique constraint\n * error will be ignored.\n *\n * Default: `\"error\"`\n */\n onDuplicate?: \"error\" | \"update\" | \"replace\" | \"ignore\";\n /**\n * If set to `true`, the import will abort if any error occurs.\n */\n complete?: boolean;\n /**\n * Whether the response should contain additional details about documents\n * that could not be imported.\n */\n details?: boolean;\n};\n\n/**\n * Options for retrieving a document's edges from a collection.\n */\nexport type DocumentEdgesOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n};\n//#endregion\n\n//#region Document operation results\n/**\n * Represents a bulk operation failure for an individual document.\n */\nexport type DocumentOperationFailure = {\n /**\n * Indicates that the operation failed.\n */\n error: true;\n /**\n * Human-readable description of the failure.\n */\n errorMessage: string;\n /**\n * Numeric representation of the failure.\n */\n errorNum: number;\n};\n\n/**\n * Metadata returned by a document operation.\n */\nexport type DocumentOperationMetadata = DocumentMetadata & {\n /**\n * Revision of the document that was updated or replaced by this operation.\n */\n _oldRev?: string;\n};\n\n/**\n * Result of a collection bulk import.\n */\nexport type ImportDocumentsResult = {\n /**\n * Whether the import failed.\n */\n error: false;\n /**\n * Number of new documents imported.\n */\n created: number;\n /**\n * Number of documents that failed with an error.\n */\n errors: number;\n /**\n * Number of empty documents.\n */\n empty: number;\n /**\n * Number of documents updated.\n */\n updated: number;\n /**\n * Number of documents that failed with an error that is ignored.\n */\n ignored: number;\n /**\n * Additional details about any errors encountered during the import.\n */\n details?: string[];\n};\n\n/**\n * Result of retrieving edges in a collection.\n */\nexport type DocumentEdgesResult<T extends Record<string, any> = any> = {\n edges: Edge<T>[];\n stats: {\n scannedIndex: number;\n filtered: number;\n };\n};\n//#endregion\n\n//#region Document selectors\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 =\n | ObjectWithDocumentId\n | ObjectWithDocumentKey\n | string;\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithDocumentId = {\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 ObjectWithDocumentKey = {\n [key: string]: any;\n _key: string;\n};\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] = selector.split(\"/\");\n if (strict && head !== collectionName) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`,\n );\n }\n return selector;\n }\n return `${collectionName}/${selector}`;\n}\n//#endregion\n"]}
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../../src/documents.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAwjBH;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,QAA0B,EAC1B,cAAsB,EACtB,SAAkB,IAAI;IAEtB,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,GAAG,EAAE,CAAC;YACjB,OAAO,eAAe,CAAC,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QACvD,CAAC;QACD,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;YAClB,OAAO,eAAe,CAAC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnC,IAAI,MAAM,IAAI,IAAI,KAAK,cAAc,EAAE,CAAC;YACtC,MAAM,IAAI,KAAK,CACb,gBAAgB,QAAQ,qCAAqC,cAAc,GAAG,CAC/E,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,cAAc,IAAI,QAAQ,EAAE,CAAC;AACzC,CAAC;AACD,YAAY","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//#region Shared types\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//#endregion\n\n//#region Document types\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//#endregion\n\n//#region Document operation options\n/**\n * Options for checking whether a document exists in a collection.\n */\nexport type DocumentExistsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the document will only match if its `_rev`\n * does not match the given revision.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving a document from a collection.\n */\nexport type ReadDocumentOptions = {\n /**\n * If set to `true`, `null` is returned instead of an exception being thrown\n * if the document does not exist.\n */\n graceful?: boolean;\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists but its `_rev` does not match the given revision.\n */\n ifMatch?: string;\n /**\n * If set to a document revision, the request will fail with an error if the\n * document exists and its `_rev` matches the given revision. Note that an\n * `HttpError` with code 304 will be thrown instead of an `ArangoError`.\n */\n ifNoneMatch?: string;\n};\n\n/**\n * Options for retrieving multiple documents from a collection.\n */\nexport type BulkReadDocumentsOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n};\n\n/**\n * Options for inserting a new document into a collection.\n */\nexport type InsertDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n * This option is only available when `overwriteMode` is set to `\"update\"` or\n * `\"replace\"`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * Defines what should happen if a document with the same `_key` or `_id`\n * already exists, instead of throwing an exception.\n *\n * Default: `\"conflict\"\n */\n overwriteMode?: \"ignore\" | \"update\" | \"replace\" | \"conflict\";\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged when an existing document\n * with the same `_key` or `_id` is updated. This does not affect arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to `true`, new entries will be added to in-memory index caches if\n * document insertions affect the edge index or cache-enabled persistent\n * indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for replacing an existing document in a collection.\n */\nexport type ReplaceDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to a document revision, the document will only be replaced if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document replacements affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for updating a document in a collection.\n */\nexport type UpdateDocumentOptions = {\n /**\n * If set to `true`, data will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to `true`, the complete new document will be returned as the `new`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnNew?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `false`, properties with a value of `null` will be removed from\n * the new document.\n *\n * Default: `true`\n */\n keepNull?: boolean;\n /**\n * If set to `false`, object properties that already exist in the old\n * document will be overwritten rather than merged. This does not affect\n * arrays.\n *\n * Default: `true`\n */\n mergeObjects?: boolean;\n /**\n * If set to a document revision, the document will only be updated if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * updated if document updates affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n /**\n * If set, the attribute with the name specified by the option is looked up\n * in the stored document and the attribute value is compared numerically to\n * the value of the versioning attribute in the supplied document that is\n * supposed to update/replace it.\n */\n versionAttribute?: string;\n};\n\n/**\n * Options for removing a document from a collection.\n */\nexport type RemoveDocumentOptions = {\n /**\n * If set to `true`, changes will be synchronized to disk before returning.\n *\n * Default: `false`\n */\n waitForSync?: boolean;\n /**\n * If set to `false`, the existing document will only be modified if its\n * `_rev` property matches the same property on the new data.\n *\n * Default: `true`\n */\n ignoreRevs?: boolean;\n /**\n * If set to `true`, the complete old document will be returned as the `old`\n * property on the result object. Has no effect if `silent` is set to `true`.\n *\n * Default: `false`\n */\n returnOld?: boolean;\n /**\n * If set to `true`, no data will be returned by the server. This option can\n * be used to reduce network traffic.\n *\n * Default: `false`\n */\n silent?: boolean;\n /**\n * If set to a document revision, the document will only be removed if its\n * `_rev` matches the given revision.\n */\n ifMatch?: string;\n /**\n * If set to `true`, existing entries in in-memory index caches will be\n * deleted if document removals affect the edge index or cache-enabled\n * persistent indexes.\n *\n * Default: `false`\n */\n refillIndexCaches?: boolean;\n};\n\n/**\n * Options for bulk importing documents into a collection.\n */\nexport type ImportDocumentsOptions = {\n /**\n * (Edge collections only.) Prefix to prepend to `_from` attribute values.\n */\n fromPrefix?: string;\n /**\n * (Edge collections only.) Prefix to prepend to `_to` attribute values.\n */\n toPrefix?: string;\n /**\n * If set to `true`, the collection is truncated before the data is imported.\n *\n * Default: `false`\n */\n overwrite?: boolean;\n /**\n * Whether to wait for the documents to have been synced to disk.\n */\n waitForSync?: boolean;\n /**\n * Controls behavior when a unique constraint is violated on the document key.\n *\n * * `\"error\"`: the document will not be imported.\n * * `\"update`: the document will be merged into the existing document.\n * * `\"replace\"`: the document will replace the existing document.\n * * `\"ignore\"`: the document will not be imported and the unique constraint\n * error will be ignored.\n *\n * Default: `\"error\"`\n */\n onDuplicate?: \"error\" | \"update\" | \"replace\" | \"ignore\";\n /**\n * If set to `true`, the import will abort if any error occurs.\n */\n complete?: boolean;\n /**\n * Whether the response should contain additional details about documents\n * that could not be imported.\n */\n details?: boolean;\n};\n\n/**\n * Options for retrieving a document's edges from a collection.\n */\nexport type DocumentEdgesOptions = {\n /**\n * If set to `true`, the request will explicitly permit ArangoDB to return a\n * potentially dirty or stale result and arangojs will load balance the\n * request without distinguishing between leaders and followers.\n */\n allowDirtyRead?: boolean;\n};\n//#endregion\n\n//#region Document operation results\n/**\n * Represents a bulk operation failure for an individual document.\n */\nexport type DocumentOperationFailure = {\n /**\n * Indicates that the operation failed.\n */\n error: true;\n /**\n * Human-readable description of the failure.\n */\n errorMessage: string;\n /**\n * Numeric representation of the failure.\n */\n errorNum: number;\n};\n\n/**\n * Metadata returned by a document operation.\n */\nexport type DocumentOperationMetadata = DocumentMetadata & {\n /**\n * Revision of the document that was updated or replaced by this operation.\n */\n _oldRev?: string;\n};\n\n/**\n * Result of a collection bulk import.\n */\nexport type ImportDocumentsResult = {\n /**\n * Whether the import failed.\n */\n error: false;\n /**\n * Number of new documents imported.\n */\n created: number;\n /**\n * Number of documents that failed with an error.\n */\n errors: number;\n /**\n * Number of empty documents.\n */\n empty: number;\n /**\n * Number of documents updated.\n */\n updated: number;\n /**\n * Number of documents that failed with an error that is ignored.\n */\n ignored: number;\n /**\n * Additional details about any errors encountered during the import.\n */\n details?: string[];\n};\n\n/**\n * Result of retrieving edges in a collection.\n */\nexport type DocumentEdgesResult<T extends Record<string, any> = any> = {\n edges: Edge<T>[];\n stats: {\n scannedIndex: number;\n filtered: number;\n };\n};\n//#endregion\n\n//#region Document selectors\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 =\n | ObjectWithDocumentId\n | ObjectWithDocumentKey\n | string;\n\n/**\n * An object with an ArangoDB document `_id` property.\n *\n * See {@link DocumentMetadata}.\n */\nexport type ObjectWithDocumentId = {\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 ObjectWithDocumentKey = {\n [key: string]: any;\n _key: string;\n};\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] = selector.split(\"/\");\n if (strict && head !== collectionName) {\n throw new Error(\n `Document ID \"${selector}\" does not match collection name \"${collectionName}\"`\n );\n }\n return selector;\n }\n return `${collectionName}/${selector}`;\n}\n//#endregion\n"]}
|