microsoft-graph 2.29.0 → 2.30.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,16 @@
1
+ /**
2
+ * Stream the content of a drive item as a Node.js readable stream.
3
+ * @module streamDriveItemContent
4
+ * @category Operations
5
+ */
6
+ import type { DriveItemRef } from "../../models/DriveItem.ts";
7
+ /**
8
+ * Stream the content of a drive item.
9
+ *
10
+ * @param itemRef Reference to the drive item to be streamed.
11
+ * @returns A Node.js readable stream of the drive item content.
12
+ * @throws Error if the download fails or the response is not a stream.
13
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get-content
14
+ */
15
+ export default function streamDriveItemContent(itemRef: DriveItemRef): Promise<NodeJS.ReadableStream>;
16
+ //# sourceMappingURL=streamDriveItemContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/streamDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D;;;;;;;GAOG;AACH,wBAA8B,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAkB1G"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * Stream the content of a drive item as a Node.js readable stream.
4
+ * @module streamDriveItemContent
5
+ * @category Operations
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.default = streamDriveItemContent;
9
+ const http_ts_1 = require("../../services/http.js");
10
+ const operationInvoker_ts_1 = require("../../services/operationInvoker.js");
11
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
12
+ /**
13
+ * Stream the content of a drive item.
14
+ *
15
+ * @param itemRef Reference to the drive item to be streamed.
16
+ * @returns A Node.js readable stream of the drive item content.
17
+ * @throws Error if the download fails or the response is not a stream.
18
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get-content
19
+ */
20
+ async function streamDriveItemContent(itemRef) {
21
+ const url = `${operationInvoker_ts_1.endpoint}${(0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/content", itemRef)}`;
22
+ const accessToken = await itemRef.context.generateAccessToken();
23
+ const response = await (0, http_ts_1.executeHttpRequest)({
24
+ url,
25
+ method: "GET",
26
+ headers: {
27
+ authorization: `Bearer ${accessToken}`,
28
+ },
29
+ responseType: "stream",
30
+ });
31
+ if (!response || typeof response.data?.pipe !== "function") {
32
+ throw new Error("Failed to get a streamable response");
33
+ }
34
+ return response.data;
35
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Stream the content of a drive item as a Node.js readable stream.
3
+ * @module streamDriveItemContent
4
+ * @category Operations
5
+ */
6
+ import type { DriveItemRef } from "../../models/DriveItem.ts";
7
+ /**
8
+ * Stream the content of a drive item.
9
+ *
10
+ * @param itemRef Reference to the drive item to be streamed.
11
+ * @returns A Node.js readable stream of the drive item content.
12
+ * @throws Error if the download fails or the response is not a stream.
13
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get-content
14
+ */
15
+ export default function streamDriveItemContent(itemRef: DriveItemRef): Promise<NodeJS.ReadableStream>;
16
+ //# sourceMappingURL=streamDriveItemContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streamDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/streamDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK9D;;;;;;;GAOG;AACH,wBAA8B,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAkB1G"}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Stream the content of a drive item as a Node.js readable stream.
3
+ * @module streamDriveItemContent
4
+ * @category Operations
5
+ */
6
+ import { executeHttpRequest } from "../../services/http.js";
7
+ import { endpoint } from "../../services/operationInvoker.js";
8
+ import { generatePath } from "../../services/templatedPaths.js";
9
+ /**
10
+ * Stream the content of a drive item.
11
+ *
12
+ * @param itemRef Reference to the drive item to be streamed.
13
+ * @returns A Node.js readable stream of the drive item content.
14
+ * @throws Error if the download fails or the response is not a stream.
15
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get-content
16
+ */
17
+ export default async function streamDriveItemContent(itemRef) {
18
+ const url = `${endpoint}${generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/content", itemRef)}`;
19
+ const accessToken = await itemRef.context.generateAccessToken();
20
+ const response = await executeHttpRequest({
21
+ url,
22
+ method: "GET",
23
+ headers: {
24
+ authorization: `Bearer ${accessToken}`,
25
+ },
26
+ responseType: "stream",
27
+ });
28
+ if (!response || typeof response.data?.pipe !== "function") {
29
+ throw new Error("Failed to get a streamable response");
30
+ }
31
+ return response.data;
32
+ }
@@ -108,6 +108,7 @@
108
108
  | [setWorkbookRangeFill](setWorkbookRangeFill.md) | Update the fill format of a workbook range. |
109
109
  | [setWorkbookRangeFont](setWorkbookRangeFont.md) | Update the font format of a workbook range. |
110
110
  | [setWorkbookRangeFormat](setWorkbookRangeFormat.md) | Update the general format of a workbook range. |
111
+ | [streamDriveItemContent](streamDriveItemContent.md) | Stream the content of a drive item as a Node.js readable stream. |
111
112
  | [unmergeWorkbookRange](unmergeWorkbookRange.md) | Unmerge a merged range of cells in a worksheet. |
112
113
  | [updateWorkbookNamedRange](updateWorkbookNamedRange.md) | Update a named range. |
113
114
  | [updateWorkbookRange](updateWorkbookRange.md) | Update a range, including values and formatting. |
@@ -10,7 +10,7 @@ List sites in all company geographies.
10
10
 
11
11
  > **listSitesAllGeographies**(`contextRef`): [`GraphOperation`](GraphOperation.md#graphoperation)\<`Site` & [`SiteRef`](Site-1.md#siteref)[]\>
12
12
 
13
- Defined in: src/operations/site/listSitesAllGeographies.ts:21
13
+ Defined in: [src/operations/site/listSitesAllGeographies.ts:21](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/site/listSitesAllGeographies.ts#L21)
14
14
 
15
15
  List sites in all company geographies.
16
16
 
@@ -0,0 +1,35 @@
1
+ [Microsoft Graph SDK](README.md) / streamDriveItemContent
2
+
3
+ # streamDriveItemContent
4
+
5
+ Stream the content of a drive item as a Node.js readable stream.
6
+
7
+ ## Functions
8
+
9
+ ### streamDriveItemContent()
10
+
11
+ > **streamDriveItemContent**(`itemRef`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ReadableStream`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4771e16937e188c0e0eca9749d208676f85fefb9/types/node/globals.d.ts#L201)\>
12
+
13
+ Defined in: src/operations/driveItem/streamDriveItemContent.ts:20
14
+
15
+ Stream the content of a drive item.
16
+
17
+ #### Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ | ------ | ------ | ------ |
21
+ | `itemRef` | [`DriveItemRef`](DriveItem-1.md#driveitemref) | Reference to the drive item to be streamed. |
22
+
23
+ #### Returns
24
+
25
+ [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`ReadableStream`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/4771e16937e188c0e0eca9749d208676f85fefb9/types/node/globals.d.ts#L201)\>
26
+
27
+ A Node.js readable stream of the drive item content.
28
+
29
+ #### Throws
30
+
31
+ Error if the download fails or the response is not a stream.
32
+
33
+ #### See
34
+
35
+ https://learn.microsoft.com/en-us/graph/api/driveitem-get-content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "2.29.0",
3
+ "version": "2.30.0",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -30,8 +30,10 @@
30
30
  "devDependencies": {
31
31
  "@biomejs/biome": "^1.9.4",
32
32
  "@microsoft/microsoft-graph-types": "^2.40.0",
33
+ "@types/csv-parse": "^1.1.12",
33
34
  "@types/lodash": "^4.17.17",
34
35
  "@types/node": "^22.15.21",
36
+ "csv-parse": "^5.6.0",
35
37
  "globals": "^16.2.0",
36
38
  "npm-check-updates": "^18.0.1",
37
39
  "tsx": "^4.19.4",
@@ -1257,6 +1259,31 @@
1257
1259
  "require": "./dist/cjs/operations/driveItem/moveDriveItem.js",
1258
1260
  "types": "./dist/esm/operations/driveItem/moveDriveItem.d.ts"
1259
1261
  },
1262
+ "./streamDriveItemContent": {
1263
+ "import": "./dist/esm/operations/driveItem/streamDriveItemContent.js",
1264
+ "require": "./dist/cjs/operations/driveItem/streamDriveItemContent.js",
1265
+ "types": "./dist/esm/operations/driveItem/streamDriveItemContent.d.ts"
1266
+ },
1267
+ "./dist/cjs/operations/driveItem/streamDriveItemContent.js": {
1268
+ "import": "./dist/esm/operations/driveItem/streamDriveItemContent.js",
1269
+ "require": "./dist/cjs/operations/driveItem/streamDriveItemContent.js",
1270
+ "types": "./dist/esm/operations/driveItem/streamDriveItemContent.d.ts"
1271
+ },
1272
+ "./dist/cjs/operations/driveItem/streamDriveItemContent": {
1273
+ "import": "./dist/esm/operations/driveItem/streamDriveItemContent.js",
1274
+ "require": "./dist/cjs/operations/driveItem/streamDriveItemContent.js",
1275
+ "types": "./dist/esm/operations/driveItem/streamDriveItemContent.d.ts"
1276
+ },
1277
+ "./operations/driveItem/streamDriveItemContent": {
1278
+ "import": "./dist/esm/operations/driveItem/streamDriveItemContent.js",
1279
+ "require": "./dist/cjs/operations/driveItem/streamDriveItemContent.js",
1280
+ "types": "./dist/esm/operations/driveItem/streamDriveItemContent.d.ts"
1281
+ },
1282
+ "./operations/driveItem/streamDriveItemContent.js": {
1283
+ "import": "./dist/esm/operations/driveItem/streamDriveItemContent.js",
1284
+ "require": "./dist/cjs/operations/driveItem/streamDriveItemContent.js",
1285
+ "types": "./dist/esm/operations/driveItem/streamDriveItemContent.d.ts"
1286
+ },
1260
1287
  "./getSite": {
1261
1288
  "import": "./dist/esm/operations/site/getSite.js",
1262
1289
  "require": "./dist/cjs/operations/site/getSite.js",