@documentdb-js/shell-api-types 0.8.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.
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Shell API method entry describing a single method available on a
3
+ * DocumentDB shell object (database, collection, or cursor).
4
+ */
5
+ export interface ShellMethodEntry {
6
+ /** The method name as it appears in code (e.g., 'find', 'insertOne'). */
7
+ readonly name: string;
8
+ /** The shell object this method belongs to. */
9
+ readonly target: 'database' | 'collection' | 'findCursor' | 'aggregationCursor' | 'global';
10
+ /** The underlying server command(s) this method maps to. */
11
+ readonly serverCommands: readonly string[];
12
+ /**
13
+ * Whether this method is shell-only (no direct server command).
14
+ * Shell-only methods are utility functions that don't send a command
15
+ * to the server (e.g., cursor iteration helpers, display functions).
16
+ */
17
+ readonly shellOnly: boolean;
18
+ /** Brief description of what the method does. */
19
+ readonly description: string;
20
+ }
21
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,yEAAyE;IACzE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,YAAY,GAAG,mBAAmB,GAAG,QAAQ,CAAC;IAC3F,4DAA4D;IAC5D,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,iDAAiD;IACjD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAChC"}
package/dist/types.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Microsoft Corporation. All rights reserved.
4
+ * Licensed under the MIT License. See License.txt in the project root for license information.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;gGAGgG"}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@documentdb-js/shell-api-types",
3
+ "version": "0.8.0",
4
+ "description": "TypeScript type definitions and method-to-command registry for the DocumentDB shell API",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": [
8
+ "dist",
9
+ "typeDefs"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc -p . && tsc -p tsconfig.scripts.json --noEmit",
13
+ "clean": "rimraf dist tsconfig.tsbuildinfo",
14
+ "test": "jest --config jest.config.js",
15
+ "prettier-fix": "prettier -w \"(scripts|src)/**/*.@(js|ts|jsx|tsx|json|md)\" \"./*.@(js|ts|jsx|tsx|json|md)\"",
16
+ "verify": "ts-node scripts/verify-compatibility.ts"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/microsoft/vscode-documentdb",
21
+ "directory": "packages/documentdb-js-shell-api-types"
22
+ },
23
+ "license": "MIT"
24
+ }
@@ -0,0 +1,62 @@
1
+ # DocumentDB Shell API Type Definitions
2
+
3
+ ## About this file
4
+
5
+ `documentdb-shell-api.d.ts` provides TypeScript type definitions for the
6
+ DocumentDB query playground IntelliSense experience. It declares the shell API surface
7
+ available in `.documentdb.js` query playground files, enabling autocompletion, hover
8
+ documentation, and signature help via VS Code's built-in TypeScript language
9
+ service.
10
+
11
+ ## How the API surface was determined
12
+
13
+ DocumentDB uses the MongoDB wire protocol for compatibility. As stated in the
14
+ [official compatibility documentation](https://learn.microsoft.com/en-us/azure/documentdb/compatibility-query-language):
15
+
16
+ > "Client-side wrapper functions, such as `deleteMany()` and `updateMany()`,
17
+ > internally invoke the corresponding server commands (`delete()` and
18
+ > `update()`). Any function that relies on supported server commands is
19
+ > compatible with Azure DocumentDB."
20
+
21
+ The methods included in this file were **manually selected** to provide a
22
+ productive query playground editing experience. The selection criteria:
23
+
24
+ 1. **Server command support**: Each method maps to a server-side command listed
25
+ as supported (✅) in the DocumentDB compatibility matrix. For example,
26
+ `collection.find()` maps to the `find` command, `collection.insertOne()` maps
27
+ to `insert`, `collection.updateOne()` maps to `update`, etc.
28
+
29
+ 2. **Common usage patterns**: Methods were chosen based on the most common
30
+ operations users perform in the query playground environment — querying,
31
+ inserting, updating, deleting, indexing, and aggregation.
32
+
33
+ 3. **Deliberately excluded**: Methods that map to unsupported or not-applicable
34
+ server commands were omitted. For instance, `mapReduce()` (deprecated),
35
+ replication commands, and certain sharding operations that are managed by the
36
+ Azure platform are not included.
37
+
38
+ ## Reference documentation
39
+
40
+ The following DocumentDB compatibility pages were used as the source of
41
+ truth for determining supported operations:
42
+
43
+ - **MQL compatibility (operators, commands, indexes)**:
44
+ https://learn.microsoft.com/en-us/azure/documentdb/compatibility-query-language
45
+ - **Feature compatibility**:
46
+ https://learn.microsoft.com/en-us/azure/documentdb/compatibility-features
47
+ - **MQL commands reference**:
48
+ https://learn.microsoft.com/en-us/azure/documentdb/commands/
49
+ - **MQL operators reference**:
50
+ https://learn.microsoft.com/en-us/azure/documentdb/operators/
51
+
52
+ ## JSDoc content
53
+
54
+ All JSDoc descriptions in the `.d.ts` file are **original writing** authored for
55
+ this extension. They describe the same operations using our own wording and
56
+ DocumentDB terminology.
57
+
58
+ ## Maintenance
59
+
60
+ When DocumentDB adds support for new operations or deprecates existing
61
+ ones, this file should be updated to match. Refer to the compatibility pages
62
+ listed above for the current support matrix.