microsoft-graph 3.10.6 → 3.10.7
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.
- package/dist/cjs/operations/driveItem/existsDriveItem.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/existsDriveItem.js +8 -1
- package/dist/esm/operations/driveItem/existsDriveItem.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/existsDriveItem.js +5 -1
- package/docs/api/existsDriveItem.md +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D;;;;GAIG;AACH,wBAA8B,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B3G"}
|
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
* @module existsDriveItem
|
|
5
5
|
* @category Operations
|
|
6
6
|
*/
|
|
7
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
8
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
9
|
+
};
|
|
7
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
11
|
exports.default = existsDriveItem;
|
|
12
|
+
const InvalidArgumentError_ts_1 = __importDefault(require("../../errors/InvalidArgumentError.js"));
|
|
9
13
|
const http_ts_1 = require("../../services/http.js");
|
|
10
14
|
const httpStatus_ts_1 = require("../../services/httpStatus.js");
|
|
11
15
|
const operationInvoker_ts_1 = require("../../services/operationInvoker.js");
|
|
@@ -16,10 +20,13 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
16
20
|
* @returns If the drive item exists.
|
|
17
21
|
*/
|
|
18
22
|
async function existsDriveItem(driveRef, itemPath) {
|
|
19
|
-
|
|
23
|
+
if (!itemPath.startsWith("/")) {
|
|
24
|
+
throw new InvalidArgumentError_ts_1.default("itemPath must start with a forward slash (/)");
|
|
25
|
+
}
|
|
20
26
|
const url = `${operationInvoker_ts_1.endpoint}${(0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/root:${itemPath}`, driveRef)}`;
|
|
21
27
|
const accessToken = await driveRef.context.generateAccessToken();
|
|
22
28
|
const response = await (0, http_ts_1.executeRaw)({
|
|
29
|
+
// TODO: This is not supporting retry and needs fixing
|
|
23
30
|
url,
|
|
24
31
|
method: "GET",
|
|
25
32
|
headers: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAM/D;;;;GAIG;AACH,wBAA8B,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CA0B3G"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @module existsDriveItem
|
|
4
4
|
* @category Operations
|
|
5
5
|
*/
|
|
6
|
+
import InvalidArgumentError from "../../errors/InvalidArgumentError.js";
|
|
6
7
|
import { executeRaw } from "../../services/http.js";
|
|
7
8
|
import { isHttpNotFound, isHttpOk } from "../../services/httpStatus.js";
|
|
8
9
|
import { endpoint } from "../../services/operationInvoker.js";
|
|
@@ -13,10 +14,13 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
13
14
|
* @returns If the drive item exists.
|
|
14
15
|
*/
|
|
15
16
|
export default async function existsDriveItem(driveRef, itemPath) {
|
|
16
|
-
|
|
17
|
+
if (!itemPath.startsWith("/")) {
|
|
18
|
+
throw new InvalidArgumentError("itemPath must start with a forward slash (/)");
|
|
19
|
+
}
|
|
17
20
|
const url = `${endpoint}${generatePath(`/sites/{site-id}/drives/{drive-id}/root:${itemPath}`, driveRef)}`;
|
|
18
21
|
const accessToken = await driveRef.context.generateAccessToken();
|
|
19
22
|
const response = await executeRaw({
|
|
23
|
+
// TODO: This is not supporting retry and needs fixing
|
|
20
24
|
url,
|
|
21
25
|
method: "GET",
|
|
22
26
|
headers: {
|
|
@@ -10,7 +10,7 @@ Check if a given drive item exists.
|
|
|
10
10
|
|
|
11
11
|
> **existsDriveItem**(`driveRef`, `itemPath`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`boolean`\>
|
|
12
12
|
|
|
13
|
-
Defined in: [src/operations/driveItem/existsDriveItem.ts:
|
|
13
|
+
Defined in: [src/operations/driveItem/existsDriveItem.ts:20](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/existsDriveItem.ts#L20)
|
|
14
14
|
|
|
15
15
|
Check if a given drive item exists.
|
|
16
16
|
|