microsoft-graph 3.9.3 → 3.9.4

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.
@@ -20,7 +20,7 @@ export declare const chunkSizeMultiple: number;
20
20
  */
21
21
  export interface CreateDriveItemContentOptions {
22
22
  conflictBehavior?: "fail" | "replace" | "rename";
23
- chunkSize?: number;
23
+ maxChunkSize?: number;
24
24
  progress?: (bytes: number) => void;
25
25
  }
26
26
  /**
@@ -31,8 +31,8 @@ export interface CreateDriveItemContentOptions {
31
31
  * @param contentLength The total size in bytes of the content to be uploaded.
32
32
  * @param options Optional. Additional options for the upload operation.
33
33
  * @param options.conflictBehavior Optional. Specifies how to handle conflicts if the file already exists. Default is 'fail'.
34
- * @param options.chunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
35
- * @param options.progress Optional. A callback function that is called periodically with the upload progress as a percentage.
34
+ * @param options.maxChunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
35
+ * @param options.progress Optional. A callback function that is called with the number of bytes uploaded after each chunk.
36
36
  * @returns The newly created drive item.
37
37
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
38
38
  * @see https://learn.microsoft.com/en-us/graph/api/resources/uploadsession
@@ -1 +1 @@
1
- {"version":3,"file":"createDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/createDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM1F;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAc5C;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAA8B,sBAAsB,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,GAAE,6BAAkC,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,CA+E7P"}
1
+ {"version":3,"file":"createDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/createDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAIlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM1F;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAc5C;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAA8B,sBAAsB,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,GAAE,6BAAkC,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,CAmG7P"}
@@ -10,6 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.chunkSizeMultiple = void 0;
12
12
  exports.default = createDriveItemContent;
13
+ const path_1 = require("path");
13
14
  const InvalidArgumentError_ts_1 = __importDefault(require("../../errors/InvalidArgumentError.js"));
14
15
  const ProtocolError_ts_1 = __importDefault(require("../../errors/ProtocolError.js"));
15
16
  const driveItem_ts_1 = require("../../services/driveItem.js");
@@ -22,7 +23,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
22
23
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
23
24
  */
24
25
  exports.chunkSizeMultiple = 320 * 1024;
25
- const defaultChunkSize = exports.chunkSizeMultiple * 32;
26
+ const defaultMaxChunkSize = exports.chunkSizeMultiple * 32;
26
27
  /**
27
28
  * Creates a new drive item in the specified parent drive or folder using a stream as content.
28
29
  * @param parentRef Reference to the parent drive or folder where the drive item will be created.
@@ -31,21 +32,21 @@ const defaultChunkSize = exports.chunkSizeMultiple * 32;
31
32
  * @param contentLength The total size in bytes of the content to be uploaded.
32
33
  * @param options Optional. Additional options for the upload operation.
33
34
  * @param options.conflictBehavior Optional. Specifies how to handle conflicts if the file already exists. Default is 'fail'.
34
- * @param options.chunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
35
- * @param options.progress Optional. A callback function that is called periodically with the upload progress as a percentage.
35
+ * @param options.maxChunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
36
+ * @param options.progress Optional. A callback function that is called with the number of bytes uploaded after each chunk.
36
37
  * @returns The newly created drive item.
37
38
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
38
39
  * @see https://learn.microsoft.com/en-us/graph/api/resources/uploadsession
39
40
  */
40
41
  async function createDriveItemContent(parentRef, itemPath, contentStream, contentLength, options = {}) {
41
- const { conflictBehavior = "fail", chunkSize = defaultChunkSize, progress = () => { } } = options;
42
- if (chunkSize % exports.chunkSizeMultiple !== 0) {
43
- throw new InvalidArgumentError_ts_1.default(`Chunk size (${chunkSize.toLocaleString()}) must be a multiple of ${(exports.chunkSizeMultiple / 1024).toLocaleString()} KiB *${exports.chunkSizeMultiple.toLocaleString()} bytes).`);
42
+ const { conflictBehavior = "fail", maxChunkSize = defaultMaxChunkSize, progress = () => { } } = options;
43
+ if (maxChunkSize % exports.chunkSizeMultiple !== 0) {
44
+ throw new InvalidArgumentError_ts_1.default(`Chunk size (${maxChunkSize.toLocaleString()}) must be a multiple of ${(exports.chunkSizeMultiple / 1024).toLocaleString()} KiB *${exports.chunkSizeMultiple.toLocaleString()} bytes).`);
44
45
  }
45
46
  const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
46
47
  const uploadSessionUrl = `${operationInvoker_ts_1.endpoint}${(0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/${pathSegment}:/${itemPath}:/createUploadSession`, parentRef)}`;
47
48
  const accessToken = await parentRef.context.generateAccessToken();
48
- const fileName = itemPath.split("/").pop();
49
+ const fileName = (0, path_1.basename)(itemPath);
49
50
  const { uploadUrl } = await (0, http_ts_1.execute)({
50
51
  url: uploadSessionUrl,
51
52
  method: "POST",
@@ -65,26 +66,46 @@ async function createDriveItemContent(parentRef, itemPath, contentStream, conten
65
66
  if (!reader) {
66
67
  throw new InvalidArgumentError_ts_1.default("contentStream is not an async iterable");
67
68
  }
68
- const buffer = Buffer.alloc(chunkSize);
69
69
  let contentPosition = 0;
70
70
  let item = null;
71
+ let leftover = null;
71
72
  while (contentPosition < contentLength) {
72
- const used = await read(chunkSize, contentPosition, contentLength, reader, buffer);
73
- const subBuffer = buffer.subarray(0, used);
74
- const start = contentPosition;
75
- const end = contentPosition + subBuffer.length - 1;
76
- const contentRange = `bytes ${start}-${end}/${contentLength}`;
73
+ const chunkSize = Math.min(maxChunkSize, contentLength - contentPosition);
74
+ const buffer = Buffer.alloc(chunkSize);
75
+ let length = 0;
76
+ while (length < chunkSize) {
77
+ let c = null;
78
+ if (leftover) {
79
+ c = leftover;
80
+ leftover = null;
81
+ }
82
+ else {
83
+ const { value, done } = await reader.next();
84
+ if (done)
85
+ break;
86
+ c = Buffer.isBuffer(value) ? value : Buffer.from(value);
87
+ }
88
+ const toCopy = Math.min(c.length, chunkSize - length);
89
+ c.copy(buffer, length, 0, toCopy);
90
+ length += toCopy;
91
+ if (toCopy < c.length) {
92
+ leftover = c.subarray(toCopy);
93
+ }
94
+ }
95
+ const chunkStart = contentPosition;
96
+ const chunkEnd = contentPosition + length - 1;
97
+ const chunk = buffer.subarray(0, length);
77
98
  const response = await (0, http_ts_1.execute)({
78
99
  url: uploadUrl,
79
100
  method: "PUT",
80
101
  headers: {
81
- "Content-Length": subBuffer.length.toString(),
82
- "Content-Range": contentRange,
102
+ "Content-Length": `${length}`,
103
+ "Content-Range": `bytes ${chunkStart}-${chunkEnd}/${contentLength}`,
83
104
  },
84
- data: subBuffer,
105
+ data: chunk,
85
106
  responseType: "json",
86
107
  });
87
- contentPosition += used;
108
+ contentPosition += length;
88
109
  progress(contentPosition);
89
110
  if (isDriveItem(response)) {
90
111
  item = response;
@@ -103,16 +124,3 @@ async function createDriveItemContent(parentRef, itemPath, contentStream, conten
103
124
  return typeof obj === "object" && obj !== null && "id" in obj;
104
125
  }
105
126
  }
106
- async function read(chunkSize, contentPosition, contentLength, reader, buffer) {
107
- let length = 0;
108
- while (length < chunkSize && contentPosition + length < contentLength) {
109
- const { value, done } = await reader.next();
110
- if (done)
111
- break;
112
- const chunk = Buffer.isBuffer(value) ? value : Buffer.from(value);
113
- const toCopy = Math.min(chunk.length, chunkSize - length, contentLength - contentPosition - length);
114
- chunk.copy(buffer, length, 0, toCopy);
115
- length += toCopy;
116
- }
117
- return length;
118
- }
@@ -20,7 +20,7 @@ export declare const chunkSizeMultiple: number;
20
20
  */
21
21
  export interface CreateDriveItemContentOptions {
22
22
  conflictBehavior?: "fail" | "replace" | "rename";
23
- chunkSize?: number;
23
+ maxChunkSize?: number;
24
24
  progress?: (bytes: number) => void;
25
25
  }
26
26
  /**
@@ -31,8 +31,8 @@ export interface CreateDriveItemContentOptions {
31
31
  * @param contentLength The total size in bytes of the content to be uploaded.
32
32
  * @param options Optional. Additional options for the upload operation.
33
33
  * @param options.conflictBehavior Optional. Specifies how to handle conflicts if the file already exists. Default is 'fail'.
34
- * @param options.chunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
35
- * @param options.progress Optional. A callback function that is called periodically with the upload progress as a percentage.
34
+ * @param options.maxChunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
35
+ * @param options.progress Optional. A callback function that is called with the number of bytes uploaded after each chunk.
36
36
  * @returns The newly created drive item.
37
37
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
38
38
  * @see https://learn.microsoft.com/en-us/graph/api/resources/uploadsession
@@ -1 +1 @@
1
- {"version":3,"file":"createDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/createDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM1F;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAc5C;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAA8B,sBAAsB,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,GAAE,6BAAkC,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,CA+E7P"}
1
+ {"version":3,"file":"createDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/createDriveItemContent.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAIlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAe,aAAa,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAM1F;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,QAAa,CAAC;AAc5C;;;;;GAKG;AACH,MAAM,WAAW,6BAA6B;IAC7C,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAC;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAA8B,sBAAsB,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,CAAC,cAAc,EAAE,aAAa,EAAE,MAAM,EAAE,OAAO,GAAE,6BAAkC,GAAG,OAAO,CAAC,SAAS,GAAG,YAAY,CAAC,CAmG7P"}
@@ -3,6 +3,7 @@
3
3
  * @module createDriveItemContent
4
4
  * @category Operations
5
5
  */
6
+ import { basename } from "path";
6
7
  import InvalidArgumentError from "../../errors/InvalidArgumentError.js";
7
8
  import ProtocolError from "../../errors/ProtocolError.js";
8
9
  import { createDriveItemRef } from "../../services/driveItem.js";
@@ -15,7 +16,7 @@ import { generatePath } from "../../services/templatedPaths.js";
15
16
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
16
17
  */
17
18
  export const chunkSizeMultiple = 320 * 1024;
18
- const defaultChunkSize = chunkSizeMultiple * 32;
19
+ const defaultMaxChunkSize = chunkSizeMultiple * 32;
19
20
  /**
20
21
  * Creates a new drive item in the specified parent drive or folder using a stream as content.
21
22
  * @param parentRef Reference to the parent drive or folder where the drive item will be created.
@@ -24,21 +25,21 @@ const defaultChunkSize = chunkSizeMultiple * 32;
24
25
  * @param contentLength The total size in bytes of the content to be uploaded.
25
26
  * @param options Optional. Additional options for the upload operation.
26
27
  * @param options.conflictBehavior Optional. Specifies how to handle conflicts if the file already exists. Default is 'fail'.
27
- * @param options.chunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
28
- * @param options.progress Optional. A callback function that is called periodically with the upload progress as a percentage.
28
+ * @param options.maxChunkSize Optional. The size of each chunk to be uploaded in bytes. Default is 10MB.
29
+ * @param options.progress Optional. A callback function that is called with the number of bytes uploaded after each chunk.
29
30
  * @returns The newly created drive item.
30
31
  * @see https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
31
32
  * @see https://learn.microsoft.com/en-us/graph/api/resources/uploadsession
32
33
  */
33
34
  export default async function createDriveItemContent(parentRef, itemPath, contentStream, contentLength, options = {}) {
34
- const { conflictBehavior = "fail", chunkSize = defaultChunkSize, progress = () => { } } = options;
35
- if (chunkSize % chunkSizeMultiple !== 0) {
36
- throw new InvalidArgumentError(`Chunk size (${chunkSize.toLocaleString()}) must be a multiple of ${(chunkSizeMultiple / 1024).toLocaleString()} KiB *${chunkSizeMultiple.toLocaleString()} bytes).`);
35
+ const { conflictBehavior = "fail", maxChunkSize = defaultMaxChunkSize, progress = () => { } } = options;
36
+ if (maxChunkSize % chunkSizeMultiple !== 0) {
37
+ throw new InvalidArgumentError(`Chunk size (${maxChunkSize.toLocaleString()}) must be a multiple of ${(chunkSizeMultiple / 1024).toLocaleString()} KiB *${chunkSizeMultiple.toLocaleString()} bytes).`);
37
38
  }
38
39
  const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
39
40
  const uploadSessionUrl = `${endpoint}${generatePath(`/sites/{site-id}/drives/{drive-id}/${pathSegment}:/${itemPath}:/createUploadSession`, parentRef)}`;
40
41
  const accessToken = await parentRef.context.generateAccessToken();
41
- const fileName = itemPath.split("/").pop();
42
+ const fileName = basename(itemPath);
42
43
  const { uploadUrl } = await execute({
43
44
  url: uploadSessionUrl,
44
45
  method: "POST",
@@ -58,26 +59,46 @@ export default async function createDriveItemContent(parentRef, itemPath, conten
58
59
  if (!reader) {
59
60
  throw new InvalidArgumentError("contentStream is not an async iterable");
60
61
  }
61
- const buffer = Buffer.alloc(chunkSize);
62
62
  let contentPosition = 0;
63
63
  let item = null;
64
+ let leftover = null;
64
65
  while (contentPosition < contentLength) {
65
- const used = await read(chunkSize, contentPosition, contentLength, reader, buffer);
66
- const subBuffer = buffer.subarray(0, used);
67
- const start = contentPosition;
68
- const end = contentPosition + subBuffer.length - 1;
69
- const contentRange = `bytes ${start}-${end}/${contentLength}`;
66
+ const chunkSize = Math.min(maxChunkSize, contentLength - contentPosition);
67
+ const buffer = Buffer.alloc(chunkSize);
68
+ let length = 0;
69
+ while (length < chunkSize) {
70
+ let c = null;
71
+ if (leftover) {
72
+ c = leftover;
73
+ leftover = null;
74
+ }
75
+ else {
76
+ const { value, done } = await reader.next();
77
+ if (done)
78
+ break;
79
+ c = Buffer.isBuffer(value) ? value : Buffer.from(value);
80
+ }
81
+ const toCopy = Math.min(c.length, chunkSize - length);
82
+ c.copy(buffer, length, 0, toCopy);
83
+ length += toCopy;
84
+ if (toCopy < c.length) {
85
+ leftover = c.subarray(toCopy);
86
+ }
87
+ }
88
+ const chunkStart = contentPosition;
89
+ const chunkEnd = contentPosition + length - 1;
90
+ const chunk = buffer.subarray(0, length);
70
91
  const response = await execute({
71
92
  url: uploadUrl,
72
93
  method: "PUT",
73
94
  headers: {
74
- "Content-Length": subBuffer.length.toString(),
75
- "Content-Range": contentRange,
95
+ "Content-Length": `${length}`,
96
+ "Content-Range": `bytes ${chunkStart}-${chunkEnd}/${contentLength}`,
76
97
  },
77
- data: subBuffer,
98
+ data: chunk,
78
99
  responseType: "json",
79
100
  });
80
- contentPosition += used;
101
+ contentPosition += length;
81
102
  progress(contentPosition);
82
103
  if (isDriveItem(response)) {
83
104
  item = response;
@@ -96,16 +117,3 @@ export default async function createDriveItemContent(parentRef, itemPath, conten
96
117
  return typeof obj === "object" && obj !== null && "id" in obj;
97
118
  }
98
119
  }
99
- async function read(chunkSize, contentPosition, contentLength, reader, buffer) {
100
- let length = 0;
101
- while (length < chunkSize && contentPosition + length < contentLength) {
102
- const { value, done } = await reader.next();
103
- if (done)
104
- break;
105
- const chunk = Buffer.isBuffer(value) ? value : Buffer.from(value);
106
- const toCopy = Math.min(chunk.length, chunkSize - length, contentLength - contentPosition - length);
107
- chunk.copy(buffer, length, 0, toCopy);
108
- length += toCopy;
109
- }
110
- return length;
111
- }
@@ -8,33 +8,31 @@ Creates a new drive item in the specified parent drive or folder using a stream
8
8
 
9
9
  ### CreateDriveItemContentOptions
10
10
 
11
- Defined in: [src/operations/driveItem/createDriveItemContent.ts:42](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L42)
11
+ Defined in: [src/operations/driveItem/createDriveItemContent.ts:43](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L43)
12
12
 
13
13
  Options for creating a drive item with content upload.
14
14
 
15
15
  #### Properties
16
16
 
17
- ##### chunkSize?
17
+ ##### conflictBehavior?
18
18
 
19
- > `optional` **chunkSize**: `number`
19
+ > `optional` **conflictBehavior**: `"replace"` \| `"fail"` \| `"rename"`
20
20
 
21
21
  Defined in: [src/operations/driveItem/createDriveItemContent.ts:44](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L44)
22
22
 
23
- Optional. The size of each upload chunk in bytes. Must be a multiple of 320 KiB (327,680 bytes).
23
+ Optional. Specifies how to handle conflicts if the file already exists. Can be 'fail', 'replace', or 'rename'.
24
24
 
25
- ##### conflictBehavior?
25
+ ##### maxChunkSize?
26
26
 
27
- > `optional` **conflictBehavior**: `"replace"` \| `"fail"` \| `"rename"`
27
+ > `optional` **maxChunkSize**: `number`
28
28
 
29
- Defined in: [src/operations/driveItem/createDriveItemContent.ts:43](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L43)
30
-
31
- Optional. Specifies how to handle conflicts if the file already exists. Can be 'fail', 'replace', or 'rename'.
29
+ Defined in: [src/operations/driveItem/createDriveItemContent.ts:45](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L45)
32
30
 
33
31
  ##### progress()?
34
32
 
35
33
  > `optional` **progress**: (`bytes`) => `void`
36
34
 
37
- Defined in: [src/operations/driveItem/createDriveItemContent.ts:45](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L45)
35
+ Defined in: [src/operations/driveItem/createDriveItemContent.ts:46](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L46)
38
36
 
39
37
  Optional. Callback function called with the number of bytes uploaded after each chunk.
40
38
 
@@ -54,7 +52,7 @@ Optional. Callback function called with the number of bytes uploaded after each
54
52
 
55
53
  > `const` **chunkSizeMultiple**: `number`
56
54
 
57
- Defined in: [src/operations/driveItem/createDriveItemContent.ts:22](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L22)
55
+ Defined in: [src/operations/driveItem/createDriveItemContent.ts:23](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L23)
58
56
 
59
57
  The required chunk size multiple for upload sessions.
60
58
 
@@ -72,7 +70,7 @@ https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession
72
70
 
73
71
  > **createDriveItemContent**(`parentRef`, `itemPath`, `contentStream`, `contentLength`, `options`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`DriveItem` & [`SiteRef`](Site-1.md#siteref) & `object` & `object`\>
74
72
 
75
- Defined in: [src/operations/driveItem/createDriveItemContent.ts:62](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L62)
73
+ Defined in: [src/operations/driveItem/createDriveItemContent.ts:63](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/driveItem/createDriveItemContent.ts#L63)
76
74
 
77
75
  Creates a new drive item in the specified parent drive or folder using a stream as content.
78
76
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "3.9.3",
3
+ "version": "3.9.4",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",