microsoft-graph 3.4.6 → 3.5.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,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,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. |
@@ -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
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
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)\>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.4.6",
3
+ "version": "3.5.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,16 @@
1872
1882
  "require": "./dist/cjs/tasks/tryDeleteDriveItem.js",
1873
1883
  "types": "./dist/esm/tasks/tryDeleteDriveItem.d.ts"
1874
1884
  },
1885
+ "./tryGetWorkbookWorksheetUsedRangeRef": {
1886
+ "import": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1887
+ "require": "./dist/cjs/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1888
+ "types": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.d.ts"
1889
+ },
1890
+ "./dist/cjs/tasks/tryGetWorkbookWorksheetUsedRangeRef": {
1891
+ "import": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1892
+ "require": "./dist/cjs/tasks/tryGetWorkbookWorksheetUsedRangeRef.js",
1893
+ "types": "./dist/esm/tasks/tryGetWorkbookWorksheetUsedRangeRef.d.ts"
1894
+ },
1875
1895
  "./updateWorkbookRangeFirstRow": {
1876
1896
  "import": "./dist/esm/tasks/updateWorkbookRangeFirstRow.js",
1877
1897
  "require": "./dist/cjs/tasks/updateWorkbookRangeFirstRow.js",