microsoft-graph 3.4.6 → 3.6.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,13 @@
1
+ /**
2
+ * Utilities for handling errors
3
+ * @module error
4
+ * @category Services
5
+ */
6
+ /**
7
+ * Determines if the error has a specific name.
8
+ * @param error Error to check.
9
+ * @param name Name to compare against.
10
+ * @returns True if the error has the specified name, false otherwise.
11
+ */
12
+ export declare function isErrorWithName(error: unknown, name: string): boolean;
13
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/services/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAErE"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /**
3
+ * Utilities for handling errors
4
+ * @module error
5
+ * @category Services
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.isErrorWithName = isErrorWithName;
9
+ /**
10
+ * Determines if the error has a specific name.
11
+ * @param error Error to check.
12
+ * @param name Name to compare against.
13
+ * @returns True if the error has the specified name, false otherwise.
14
+ */
15
+ function isErrorWithName(error, name) {
16
+ return !!error && typeof error === "object" && "name" in error && error.name === name;
17
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Attempts to retrieve the metadata for an item in a drive by file path, returning null if the item does not exist.
3
+ * @module tryGetDriveItemByPath
4
+ * @category Tasks
5
+ */
6
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
7
+ import type { DriveRef } from "../models/Drive.ts";
8
+ import type { DriveItemPath, DriveItemRef } from "../models/DriveItem.ts";
9
+ /**
10
+ * Attempts to retrieve the metadata for an item in a drive by file path.
11
+ * Returns null if the item does not exist (NotFoundError).
12
+ * @param driveRef Reference to the drive containing the item.
13
+ * @param itemPath Path of the item within the drive.
14
+ * @returns The metadata of the specified drive item, or null if not found.
15
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get
16
+ */
17
+ export default function tryGetDriveItemByPath(driveRef: DriveRef, itemPath: DriveItemPath): Promise<(DriveItem & DriveItemRef) | null>;
18
+ //# sourceMappingURL=tryGetDriveItemByPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tryGetDriveItemByPath.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryGetDriveItemByPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI1E;;;;;;;GAOG;AACH,wBAA8B,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,SAAS,GAAG,YAAY,CAAC,GAAG,IAAI,CAAC,CAS3I"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = tryGetDriveItemByPath;
7
+ const getDriveItemByPath_ts_1 = __importDefault(require("../operations/driveItem/getDriveItemByPath.js"));
8
+ const error_ts_1 = require("../services/error.js");
9
+ /**
10
+ * Attempts to retrieve the metadata for an item in a drive by file path.
11
+ * Returns null if the item does not exist (NotFoundError).
12
+ * @param driveRef Reference to the drive containing the item.
13
+ * @param itemPath Path of the item within the drive.
14
+ * @returns The metadata of the specified drive item, or null if not found.
15
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get
16
+ */
17
+ async function tryGetDriveItemByPath(driveRef, itemPath) {
18
+ try {
19
+ return await (0, getDriveItemByPath_ts_1.default)(driveRef, itemPath);
20
+ }
21
+ catch (error) {
22
+ if ((0, error_ts_1.isErrorWithName)(error, "NotFoundError")) {
23
+ return null;
24
+ }
25
+ throw error;
26
+ }
27
+ }
@@ -0,0 +1,4 @@
1
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
2
+ import type { WorkbookWorksheetRef } from "../models/WorkbookWorksheet.ts";
3
+ export default function tryGetWorkbookWorksheetUsedRangeRef(worksheetRef: WorkbookWorksheetRef): Promise<WorkbookRangeRef | null>;
4
+ //# sourceMappingURL=tryGetWorkbookWorksheetUsedRangeRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tryGetWorkbookWorksheetUsedRangeRef.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryGetWorkbookWorksheetUsedRangeRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAI3E,wBAA8B,mCAAmC,CAAC,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAStI"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = tryGetWorkbookWorksheetUsedRangeRef;
7
+ const getWorkbookWorksheetUsedRangeRef_ts_1 = __importDefault(require("../operations/workbookWorksheet/getWorkbookWorksheetUsedRangeRef.js"));
8
+ const error_ts_1 = require("../services/error.js");
9
+ async function tryGetWorkbookWorksheetUsedRangeRef(worksheetRef) {
10
+ try {
11
+ return await (0, getWorkbookWorksheetUsedRangeRef_ts_1.default)(worksheetRef);
12
+ }
13
+ catch (error) {
14
+ if ((0, error_ts_1.isErrorWithName)(error, "NotFoundError")) {
15
+ return null;
16
+ }
17
+ throw error;
18
+ }
19
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Utilities for handling errors
3
+ * @module error
4
+ * @category Services
5
+ */
6
+ /**
7
+ * Determines if the error has a specific name.
8
+ * @param error Error to check.
9
+ * @param name Name to compare against.
10
+ * @returns True if the error has the specified name, false otherwise.
11
+ */
12
+ export declare function isErrorWithName(error: unknown, name: string): boolean;
13
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/services/error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAErE"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Utilities for handling errors
3
+ * @module error
4
+ * @category Services
5
+ */
6
+ /**
7
+ * Determines if the error has a specific name.
8
+ * @param error Error to check.
9
+ * @param name Name to compare against.
10
+ * @returns True if the error has the specified name, false otherwise.
11
+ */
12
+ export function isErrorWithName(error, name) {
13
+ return !!error && typeof error === "object" && "name" in error && error.name === name;
14
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Attempts to retrieve the metadata for an item in a drive by file path, returning null if the item does not exist.
3
+ * @module tryGetDriveItemByPath
4
+ * @category Tasks
5
+ */
6
+ import type { DriveItem } from "@microsoft/microsoft-graph-types";
7
+ import type { DriveRef } from "../models/Drive.ts";
8
+ import type { DriveItemPath, DriveItemRef } from "../models/DriveItem.ts";
9
+ /**
10
+ * Attempts to retrieve the metadata for an item in a drive by file path.
11
+ * Returns null if the item does not exist (NotFoundError).
12
+ * @param driveRef Reference to the drive containing the item.
13
+ * @param itemPath Path of the item within the drive.
14
+ * @returns The metadata of the specified drive item, or null if not found.
15
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get
16
+ */
17
+ export default function tryGetDriveItemByPath(driveRef: DriveRef, itemPath: DriveItemPath): Promise<(DriveItem & DriveItemRef) | null>;
18
+ //# sourceMappingURL=tryGetDriveItemByPath.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tryGetDriveItemByPath.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryGetDriveItemByPath.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI1E;;;;;;;GAOG;AACH,wBAA8B,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,SAAS,GAAG,YAAY,CAAC,GAAG,IAAI,CAAC,CAS3I"}
@@ -0,0 +1,21 @@
1
+ import getDriveItemByPath from "../operations/driveItem/getDriveItemByPath.js";
2
+ import { isErrorWithName } from "../services/error.js";
3
+ /**
4
+ * Attempts to retrieve the metadata for an item in a drive by file path.
5
+ * Returns null if the item does not exist (NotFoundError).
6
+ * @param driveRef Reference to the drive containing the item.
7
+ * @param itemPath Path of the item within the drive.
8
+ * @returns The metadata of the specified drive item, or null if not found.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/driveitem-get
10
+ */
11
+ export default async function tryGetDriveItemByPath(driveRef, itemPath) {
12
+ try {
13
+ return await getDriveItemByPath(driveRef, itemPath);
14
+ }
15
+ catch (error) {
16
+ if (isErrorWithName(error, "NotFoundError")) {
17
+ return null;
18
+ }
19
+ throw error;
20
+ }
21
+ }
@@ -0,0 +1,4 @@
1
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
2
+ import type { WorkbookWorksheetRef } from "../models/WorkbookWorksheet.ts";
3
+ export default function tryGetWorkbookWorksheetUsedRangeRef(worksheetRef: WorkbookWorksheetRef): Promise<WorkbookRangeRef | null>;
4
+ //# sourceMappingURL=tryGetWorkbookWorksheetUsedRangeRef.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tryGetWorkbookWorksheetUsedRangeRef.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryGetWorkbookWorksheetUsedRangeRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAI3E,wBAA8B,mCAAmC,CAAC,YAAY,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAStI"}
@@ -0,0 +1,13 @@
1
+ import getWorkbookWorksheetUsedRangeRef from "../operations/workbookWorksheet/getWorkbookWorksheetUsedRangeRef.js";
2
+ import { isErrorWithName } from "../services/error.js";
3
+ export default async function tryGetWorkbookWorksheetUsedRangeRef(worksheetRef) {
4
+ try {
5
+ return await getWorkbookWorksheetUsedRangeRef(worksheetRef);
6
+ }
7
+ catch (error) {
8
+ if (isErrorWithName(error, "NotFoundError")) {
9
+ return null;
10
+ }
11
+ throw error;
12
+ }
13
+ }
@@ -145,6 +145,7 @@
145
145
  | ------ | ------ |
146
146
  | [services/sharepointUrl](services/sharepointUrl.md) | - |
147
147
  | [tasks/getSiteByUrl](tasks/getSiteByUrl.md) | - |
148
+ | [tasks/tryGetWorkbookWorksheetUsedRangeRef](tasks/tryGetWorkbookWorksheetUsedRangeRef.md) | - |
148
149
 
149
150
  ## Services
150
151
 
@@ -160,6 +161,7 @@
160
161
  | [drive](drive.md) | Utilities for working with Microsoft Graph Drive references and operations. |
161
162
  | [driveItem](driveItem.md) | Utilities for working with Microsoft Graph Drive Items (files and folders). |
162
163
  | [environmentVariable](environmentVariable.md) | Utilities for accessing environment variables with error handling and fallbacks. |
164
+ | [error](error.md) | Utilities for handling errors |
163
165
  | [http](http.md) | HTTP request utilities for Microsoft Graph API, with proxy support. |
164
166
  | [httpStatus](httpStatus.md) | Utilities for analyzing HTTP status codes for Microsoft Graph API responses. |
165
167
  | [Iteration](Iteration.md) | Utilities for iterating over AsyncIterables. |
@@ -202,6 +204,7 @@
202
204
  | [setWorkbookTableBodyVisibleRows](setWorkbookTableBodyVisibleRows.md) | Set visible rows of a workbook table with the provided 2D array of values, ignoring hidden rows and inserting new rows at the end if needed. |
203
205
  | [tryCloseWorkbookSession](tryCloseWorkbookSession.md) | Try and close a workbook session. |
204
206
  | [tryDeleteDriveItem](tryDeleteDriveItem.md) | Attempts to delete a drive item, returning success status. |
207
+ | [tryGetDriveItemByPath](tryGetDriveItemByPath.md) | Attempts to retrieve the metadata for an item in a drive by file path, returning null if the item does not exist. |
205
208
  | [updateWorkbookRangeFirstRow](updateWorkbookRangeFirstRow.md) | Update first row in a given workbook range. |
206
209
  | [updateWorkbookRangeRows](updateWorkbookRangeRows.md) | Update rows in a given workbook range. |
207
210
  | [writeWorkbookRows](writeWorkbookRows.md) | Write rows to a workbook range. |
@@ -0,0 +1,28 @@
1
+ [Microsoft Graph SDK](README.md) / error
2
+
3
+ # error
4
+
5
+ Utilities for handling errors
6
+
7
+ ## Functions
8
+
9
+ ### isErrorWithName()
10
+
11
+ > **isErrorWithName**(`error`, `name`): `boolean`
12
+
13
+ Defined in: [src/services/error.ts:13](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/error.ts#L13)
14
+
15
+ Determines if the error has a specific name.
16
+
17
+ #### Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ | ------ | ------ | ------ |
21
+ | `error` | `unknown` | Error to check. |
22
+ | `name` | `string` | Name to compare against. |
23
+
24
+ #### Returns
25
+
26
+ `boolean`
27
+
28
+ True if the error has the specified name, false otherwise.
@@ -0,0 +1,21 @@
1
+ [Microsoft Graph SDK](../README.md) / tasks/tryGetWorkbookWorksheetUsedRangeRef
2
+
3
+ # tasks/tryGetWorkbookWorksheetUsedRangeRef
4
+
5
+ ## Functions
6
+
7
+ ### tryGetWorkbookWorksheetUsedRangeRef()
8
+
9
+ > **tryGetWorkbookWorksheetUsedRangeRef**(`worksheetRef`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`WorkbookRangeRef`](../WorkbookRange-1.md#workbookrangeref)\>
10
+
11
+ Defined in: [src/tasks/tryGetWorkbookWorksheetUsedRangeRef.ts:6](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/tryGetWorkbookWorksheetUsedRangeRef.ts#L6)
12
+
13
+ #### Parameters
14
+
15
+ | Parameter | Type |
16
+ | ------ | ------ |
17
+ | `worksheetRef` | [`WorkbookWorksheetRef`](../WorkbookWorksheet-1.md#workbookworksheetref) |
18
+
19
+ #### Returns
20
+
21
+ [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| [`WorkbookRangeRef`](../WorkbookRange-1.md#workbookrangeref)\>
@@ -0,0 +1,33 @@
1
+ [Microsoft Graph SDK](README.md) / tryGetDriveItemByPath
2
+
3
+ # tryGetDriveItemByPath
4
+
5
+ Attempts to retrieve the metadata for an item in a drive by file path, returning null if the item does not exist.
6
+
7
+ ## Functions
8
+
9
+ ### tryGetDriveItemByPath()
10
+
11
+ > **tryGetDriveItemByPath**(`driveRef`, `itemPath`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| `DriveItem` & [`SiteRef`](Site-1.md#siteref) & `object` & `object`\>
12
+
13
+ Defined in: [src/tasks/tryGetDriveItemByPath.ts:20](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/tryGetDriveItemByPath.ts#L20)
14
+
15
+ Attempts to retrieve the metadata for an item in a drive by file path.
16
+ Returns null if the item does not exist (NotFoundError).
17
+
18
+ #### Parameters
19
+
20
+ | Parameter | Type | Description |
21
+ | ------ | ------ | ------ |
22
+ | `driveRef` | [`DriveRef`](Drive-1.md#driveref) | Reference to the drive containing the item. |
23
+ | `itemPath` | [`DriveItemPath`](DriveItem-1.md#driveitempath) | Path of the item within the drive. |
24
+
25
+ #### Returns
26
+
27
+ [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`null` \| `DriveItem` & [`SiteRef`](Site-1.md#siteref) & `object` & `object`\>
28
+
29
+ The metadata of the specified drive item, or null if not found.
30
+
31
+ #### See
32
+
33
+ https://learn.microsoft.com/en-us/graph/api/driveitem-get
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.4.6",
3
+ "version": "3.6.0",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -1417,6 +1417,16 @@
1417
1417
  "require": "./dist/cjs/services/environmentVariable.js",
1418
1418
  "types": "./dist/esm/services/environmentVariable.d.ts"
1419
1419
  },
1420
+ "./error": {
1421
+ "import": "./dist/esm/services/error.js",
1422
+ "require": "./dist/cjs/services/error.js",
1423
+ "types": "./dist/esm/services/error.d.ts"
1424
+ },
1425
+ "./dist/cjs/services/error": {
1426
+ "import": "./dist/esm/services/error.js",
1427
+ "require": "./dist/cjs/services/error.js",
1428
+ "types": "./dist/esm/services/error.d.ts"
1429
+ },
1420
1430
  "./http": {
1421
1431
  "import": "./dist/esm/services/http.js",
1422
1432
  "require": "./dist/cjs/services/http.js",
@@ -1872,6 +1882,26 @@
1872
1882
  "require": "./dist/cjs/tasks/tryDeleteDriveItem.js",
1873
1883
  "types": "./dist/esm/tasks/tryDeleteDriveItem.d.ts"
1874
1884
  },
1885
+ "./tryGetDriveItemByPath": {
1886
+ "import": "./dist/esm/tasks/tryGetDriveItemByPath.js",
1887
+ "require": "./dist/cjs/tasks/tryGetDriveItemByPath.js",
1888
+ "types": "./dist/esm/tasks/tryGetDriveItemByPath.d.ts"
1889
+ },
1890
+ "./dist/cjs/tasks/tryGetDriveItemByPath": {
1891
+ "import": "./dist/esm/tasks/tryGetDriveItemByPath.js",
1892
+ "require": "./dist/cjs/tasks/tryGetDriveItemByPath.js",
1893
+ "types": "./dist/esm/tasks/tryGetDriveItemByPath.d.ts"
1894
+ },
1895
+ "./tryGetWorkbookWorksheetUsedRangeRef": {
1896
+ "import": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1897
+ "require": "./dist/cjs/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1898
+ "types": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.d.ts"
1899
+ },
1900
+ "./dist/cjs/tasks/tryGetWorkbookWorksheetUsedRangeRef": {
1901
+ "import": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1902
+ "require": "./dist/cjs/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1903
+ "types": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.d.ts"
1904
+ },
1875
1905
  "./updateWorkbookRangeFirstRow": {
1876
1906
  "import": "./dist/esm/tasks/updateWorkbookRangeFirstRow.js",
1877
1907
  "require": "./dist/cjs/tasks/updateWorkbookRangeFirstRow.js",