microsoft-graph 3.11.8 → 3.11.10

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.
@@ -22,5 +22,5 @@ async function safeDeleteWorkbook(workbookRef) {
22
22
  if (workbookRef.sessionId) {
23
23
  await (0, closeWorkbookSession_ts_1.default)(workbookRef);
24
24
  }
25
- await (0, deleteDriveItem_ts_1.default)(workbookRef);
25
+ await (0, deleteDriveItem_ts_1.default)(workbookRef, { bypassSharedLock: true, bypassCheckedOut: true });
26
26
  }
@@ -1,14 +1,11 @@
1
- /**
2
- * Attempts to delete a drive item, returning success status.
3
- * @module tryDeleteDriveItem
4
- * @category Tasks
5
- */
6
1
  import type { DriveItemRef } from "../models/DriveItem.ts";
2
+ import { type DeleteDriveItemOptions } from "../operations/driveItem/deleteDriveItem.ts";
7
3
  /**
8
4
  * Attempts to delete a drive item, returning success status.
9
5
  * @param driveItemRef A reference to the DriveItem to delete.
6
+ * @param {DeleteDriveItemOptions} [options] Optional options for deletion.
10
7
  * @returns Boolean indicating whether the DriveItem was successfully deleted.
11
8
  * @remarks No error is thrown.
12
9
  */
13
- export default function tryDeleteDriveItem(driveItemRef: DriveItemRef): Promise<boolean>;
10
+ export default function tryDeleteDriveItem(driveItemRef: DriveItemRef, options?: DeleteDriveItemOptions): Promise<boolean>;
14
11
  //# sourceMappingURL=tryDeleteDriveItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tryDeleteDriveItem.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryDeleteDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;;;GAKG;AACH,wBAA8B,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAO7F"}
1
+ {"version":3,"file":"tryDeleteDriveItem.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryDeleteDriveItem.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAwB,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAE1G;;;;;;GAMG;AACH,wBAA8B,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,CAUnI"}
@@ -4,19 +4,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.default = tryDeleteDriveItem;
7
+ /**
8
+ * Attempts to delete a drive item, returning success status.
9
+ * @module tryDeleteDriveItem
10
+ * @category Tasks
11
+ */
12
+ const NotFoundError_ts_1 = __importDefault(require("../errors/NotFoundError.js"));
7
13
  const deleteDriveItem_ts_1 = __importDefault(require("../operations/driveItem/deleteDriveItem.js"));
8
14
  /**
9
15
  * Attempts to delete a drive item, returning success status.
10
16
  * @param driveItemRef A reference to the DriveItem to delete.
17
+ * @param {DeleteDriveItemOptions} [options] Optional options for deletion.
11
18
  * @returns Boolean indicating whether the DriveItem was successfully deleted.
12
19
  * @remarks No error is thrown.
13
20
  */
14
- async function tryDeleteDriveItem(driveItemRef) {
21
+ async function tryDeleteDriveItem(driveItemRef, options = {}) {
15
22
  try {
16
- await (0, deleteDriveItem_ts_1.default)(driveItemRef);
23
+ await (0, deleteDriveItem_ts_1.default)(driveItemRef, options);
17
24
  return true;
18
25
  }
19
- catch (_) {
20
- return false;
26
+ catch (err) {
27
+ if (err instanceof NotFoundError_ts_1.default) {
28
+ return false;
29
+ }
30
+ throw err;
21
31
  }
22
32
  }
@@ -16,5 +16,5 @@ export default async function safeDeleteWorkbook(workbookRef) {
16
16
  if (workbookRef.sessionId) {
17
17
  await closeWorkbookSession(workbookRef);
18
18
  }
19
- await deleteDriveItem(workbookRef);
19
+ await deleteDriveItem(workbookRef, { bypassSharedLock: true, bypassCheckedOut: true });
20
20
  }
@@ -1,14 +1,11 @@
1
- /**
2
- * Attempts to delete a drive item, returning success status.
3
- * @module tryDeleteDriveItem
4
- * @category Tasks
5
- */
6
1
  import type { DriveItemRef } from "../models/DriveItem.ts";
2
+ import { type DeleteDriveItemOptions } from "../operations/driveItem/deleteDriveItem.ts";
7
3
  /**
8
4
  * Attempts to delete a drive item, returning success status.
9
5
  * @param driveItemRef A reference to the DriveItem to delete.
6
+ * @param {DeleteDriveItemOptions} [options] Optional options for deletion.
10
7
  * @returns Boolean indicating whether the DriveItem was successfully deleted.
11
8
  * @remarks No error is thrown.
12
9
  */
13
- export default function tryDeleteDriveItem(driveItemRef: DriveItemRef): Promise<boolean>;
10
+ export default function tryDeleteDriveItem(driveItemRef: DriveItemRef, options?: DeleteDriveItemOptions): Promise<boolean>;
14
11
  //# sourceMappingURL=tryDeleteDriveItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tryDeleteDriveItem.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryDeleteDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D;;;;;GAKG;AACH,wBAA8B,kBAAkB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAO7F"}
1
+ {"version":3,"file":"tryDeleteDriveItem.d.ts","sourceRoot":"","sources":["../../../src/tasks/tryDeleteDriveItem.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAwB,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAE1G;;;;;;GAMG;AACH,wBAA8B,kBAAkB,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,OAAO,CAAC,CAUnI"}
@@ -1,16 +1,26 @@
1
+ /**
2
+ * Attempts to delete a drive item, returning success status.
3
+ * @module tryDeleteDriveItem
4
+ * @category Tasks
5
+ */
6
+ import NotFoundError from "../errors/NotFoundError.js";
1
7
  import deleteDriveItem from "../operations/driveItem/deleteDriveItem.js";
2
8
  /**
3
9
  * Attempts to delete a drive item, returning success status.
4
10
  * @param driveItemRef A reference to the DriveItem to delete.
11
+ * @param {DeleteDriveItemOptions} [options] Optional options for deletion.
5
12
  * @returns Boolean indicating whether the DriveItem was successfully deleted.
6
13
  * @remarks No error is thrown.
7
14
  */
8
- export default async function tryDeleteDriveItem(driveItemRef) {
15
+ export default async function tryDeleteDriveItem(driveItemRef, options = {}) {
9
16
  try {
10
- await deleteDriveItem(driveItemRef);
17
+ await deleteDriveItem(driveItemRef, options);
11
18
  return true;
12
19
  }
13
- catch (_) {
14
- return false;
20
+ catch (err) {
21
+ if (err instanceof NotFoundError) {
22
+ return false;
23
+ }
24
+ throw err;
15
25
  }
16
26
  }
@@ -8,9 +8,9 @@ Attempts to delete a drive item, returning success status.
8
8
 
9
9
  ### tryDeleteDriveItem()
10
10
 
11
- > **tryDeleteDriveItem**(`driveItemRef`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>
11
+ > **tryDeleteDriveItem**(`driveItemRef`, `options?`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>
12
12
 
13
- Defined in: [src/tasks/tryDeleteDriveItem.ts:15](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/tryDeleteDriveItem.ts#L15)
13
+ Defined in: [src/tasks/tryDeleteDriveItem.ts:17](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/tryDeleteDriveItem.ts#L17)
14
14
 
15
15
  Attempts to delete a drive item, returning success status.
16
16
 
@@ -19,6 +19,7 @@ Attempts to delete a drive item, returning success status.
19
19
  | Parameter | Type | Description |
20
20
  | ------ | ------ | ------ |
21
21
  | `driveItemRef` | [`DriveItemRef`](DriveItem-1.md#driveitemref) | A reference to the DriveItem to delete. |
22
+ | `options?` | [`DeleteDriveItemOptions`](deleteDriveItem.md#deletedriveitemoptions) | Optional options for deletion. |
22
23
 
23
24
  #### Returns
24
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.11.8",
3
+ "version": "3.11.10",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",