microsoft-graph 3.10.5 → 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.
@@ -19,6 +19,7 @@ export interface CreateDriveItemOptions {
19
19
  * @param parentRef Reference to the parent drive or folder where the folder will be created.
20
20
  * @param folderName Name of the folder to be created.
21
21
  * @returns The newly created folder.
22
+ * @remarks Parent folder must already exist. Multiple folders cannot be created in a single request
22
23
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-post-children
23
24
  */
24
25
  export default function createFolder(parentRef: DriveRef | DriveItemRef, folderName: string, options?: CreateDriveItemOptions): GraphOperation<DriveItem & DriveItemRef>;
@@ -1 +1 @@
1
- {"version":3,"file":"createFolder.d.ts","sourceRoot":"","sources":["../../../../src/operations/drive/createFolder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,cAAc,CAAC,SAAS,GAAG,YAAY,CAAC,CA0B3K"}
1
+ {"version":3,"file":"createFolder.d.ts","sourceRoot":"","sources":["../../../../src/operations/drive/createFolder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,cAAc,CAAC,SAAS,GAAG,YAAY,CAAC,CA0B3K"}
@@ -14,6 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  * @param parentRef Reference to the parent drive or folder where the folder will be created.
15
15
  * @param folderName Name of the folder to be created.
16
16
  * @returns The newly created folder.
17
+ * @remarks Parent folder must already exist. Multiple folders cannot be created in a single request
17
18
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-post-children
18
19
  */
19
20
  function createFolder(parentRef, folderName, options = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,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,CAsB3G"}
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
- // Note this method doesn't match the standard pattern since the batching library doesn't support non-JSON return types.
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: {
@@ -19,6 +19,7 @@ export interface CreateDriveItemOptions {
19
19
  * @param parentRef Reference to the parent drive or folder where the folder will be created.
20
20
  * @param folderName Name of the folder to be created.
21
21
  * @returns The newly created folder.
22
+ * @remarks Parent folder must already exist. Multiple folders cannot be created in a single request
22
23
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-post-children
23
24
  */
24
25
  export default function createFolder(parentRef: DriveRef | DriveItemRef, folderName: string, options?: CreateDriveItemOptions): GraphOperation<DriveItem & DriveItemRef>;
@@ -1 +1 @@
1
- {"version":3,"file":"createFolder.d.ts","sourceRoot":"","sources":["../../../../src/operations/drive/createFolder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,cAAc,CAAC,SAAS,GAAG,YAAY,CAAC,CA0B3K"}
1
+ {"version":3,"file":"createFolder.d.ts","sourceRoot":"","sources":["../../../../src/operations/drive/createFolder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKrE;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACpC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,cAAc,CAAC,SAAS,GAAG,YAAY,CAAC,CA0B3K"}
@@ -11,6 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
11
11
  * @param parentRef Reference to the parent drive or folder where the folder will be created.
12
12
  * @param folderName Name of the folder to be created.
13
13
  * @returns The newly created folder.
14
+ * @remarks Parent folder must already exist. Multiple folders cannot be created in a single request
14
15
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-post-children
15
16
  */
16
17
  export default function createFolder(parentRef, folderName, options = {}) {
@@ -1 +1 @@
1
- {"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,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,CAsB3G"}
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
- // Note this method doesn't match the standard pattern since the batching library doesn't support non-JSON return types.
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: {
@@ -26,7 +26,7 @@ Defined in: [src/operations/drive/createFolder.ts:20](https://github.com/Future-
26
26
 
27
27
  > **createFolder**(`parentRef`, `folderName`, `options`): [`GraphOperation`](GraphOperation.md#graphoperation)\<`DriveItem` & [`SiteRef`](Site-1.md#siteref) & `object` & `object`\>
28
28
 
29
- Defined in: [src/operations/drive/createFolder.ts:30](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/drive/createFolder.ts#L30)
29
+ Defined in: [src/operations/drive/createFolder.ts:31](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/drive/createFolder.ts#L31)
30
30
 
31
31
  Create a folder in the root of a drive, or in a folder. If it already exists do nothing.
32
32
 
@@ -44,6 +44,10 @@ Create a folder in the root of a drive, or in a folder. If it already exists do
44
44
 
45
45
  The newly created folder.
46
46
 
47
+ #### Remarks
48
+
49
+ Parent folder must already exist. Multiple folders cannot be created in a single request
50
+
47
51
  #### See
48
52
 
49
53
  https://learn.microsoft.com/en-us/graph/api/driveitem-post-children
@@ -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:19](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/existsDriveItem.ts#L19)
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.10.5",
3
+ "version": "3.10.7",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",