microsoft-graph 3.10.4 → 3.10.6

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 = {}) {
@@ -39,4 +39,10 @@ export declare function splitDriveItemPath(filePath: DriveItemPath): {
39
39
  * @returns File extension ie. "txt", "jpg"
40
40
  */
41
41
  export declare function getDriveItemExtension(item: DriveItem): string;
42
+ /**
43
+ * Gets the parent for a drive item. Typically this is the folder of a file.
44
+ * @param item Drive item.
45
+ * @returns Parent drive item.
46
+ */
47
+ export declare function getDriveItemParent(item: DriveItem & DriveItemRef): DriveItemRef;
42
48
  //# sourceMappingURL=driveItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"driveItem.d.ts","sourceRoot":"","sources":["../../../src/services/driveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EA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E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAWpG;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,GAAG;IAAE,UAAU,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAa3G;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,YAAY,CAc/E"}
@@ -13,6 +13,7 @@ exports.driveItemPath = driveItemPath;
13
13
  exports.createDriveItemRef = createDriveItemRef;
14
14
  exports.splitDriveItemPath = splitDriveItemPath;
15
15
  exports.getDriveItemExtension = getDriveItemExtension;
16
+ exports.getDriveItemParent = getDriveItemParent;
16
17
  const node_path_1 = __importDefault(require("node:path"));
17
18
  const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
18
19
  const ProtocolError_ts_1 = __importDefault(require("../errors/ProtocolError.js"));
@@ -98,3 +99,21 @@ function getDriveItemExtension(item) {
98
99
  const ext = node_path_1.default.extname(item.name ?? "").toLowerCase();
99
100
  return ext.startsWith(".") ? ext.slice(1) : ext;
100
101
  }
102
+ /**
103
+ * Gets the parent for a drive item. Typically this is the folder of a file.
104
+ * @param item Drive item.
105
+ * @returns Parent drive item.
106
+ */
107
+ function getDriveItemParent(item) {
108
+ const parentId = item.parentReference?.id;
109
+ if (!parentId) {
110
+ throw new Error("Parent reference not found for the item.");
111
+ }
112
+ const parentRef = {
113
+ context: item.context,
114
+ siteId: item.siteId,
115
+ driveId: item.driveId,
116
+ itemId: parentId,
117
+ };
118
+ return parentRef;
119
+ }
@@ -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 = {}) {
@@ -39,4 +39,10 @@ export declare function splitDriveItemPath(filePath: DriveItemPath): {
39
39
  * @returns File extension ie. "txt", "jpg"
40
40
  */
41
41
  export declare function getDriveItemExtension(item: DriveItem): string;
42
+ /**
43
+ * Gets the parent for a drive item. Typically this is the folder of a file.
44
+ * @param item Drive item.
45
+ * @returns Parent drive item.
46
+ */
47
+ export declare function getDriveItemParent(item: DriveItem & DriveItemRef): DriveItemRef;
42
48
  //# sourceMappingURL=driveItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"driveItem.d.ts","sourceRoot":"","sources":["../../../src/services/driveItem.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAIlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;A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,aAAa,GAAG;IAAE,UAAU,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAa3G;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,YAAY,GAAG,YAAY,CAc/E"}
@@ -88,3 +88,21 @@ export function getDriveItemExtension(item) {
88
88
  const ext = path.extname(item.name ?? "").toLowerCase();
89
89
  return ext.startsWith(".") ? ext.slice(1) : ext;
90
90
  }
91
+ /**
92
+ * Gets the parent for a drive item. Typically this is the folder of a file.
93
+ * @param item Drive item.
94
+ * @returns Parent drive item.
95
+ */
96
+ export function getDriveItemParent(item) {
97
+ const parentId = item.parentReference?.id;
98
+ if (!parentId) {
99
+ throw new Error("Parent reference not found for the item.");
100
+ }
101
+ const parentRef = {
102
+ context: item.context,
103
+ siteId: item.siteId,
104
+ driveId: item.driveId,
105
+ itemId: parentId,
106
+ };
107
+ return parentRef;
108
+ }
@@ -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
@@ -105,6 +105,28 @@ File extension ie. "txt", "jpg"
105
105
 
106
106
  ***
107
107
 
108
+ ### getDriveItemParent()
109
+
110
+ > **getDriveItemParent**(`item`): [`DriveItemRef`](DriveItem-1.md#driveitemref)
111
+
112
+ Defined in: [src/services/driveItem.ts:120](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/driveItem.ts#L120)
113
+
114
+ Gets the parent for a drive item. Typically this is the folder of a file.
115
+
116
+ #### Parameters
117
+
118
+ | Parameter | Type | Description |
119
+ | ------ | ------ | ------ |
120
+ | `item` | `DriveItem` & [`SiteRef`](Site-1.md#siteref) & `object` & `object` | Drive item. |
121
+
122
+ #### Returns
123
+
124
+ [`DriveItemRef`](DriveItem-1.md#driveitemref)
125
+
126
+ Parent drive item.
127
+
128
+ ***
129
+
108
130
  ### splitDriveItemPath()
109
131
 
110
132
  > **splitDriveItemPath**(`filePath`): `object`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.10.4",
3
+ "version": "3.10.6",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",