microsoft-graph 2.31.0 → 2.32.0

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.
Files changed (58) hide show
  1. package/dist/cjs/models/Border.d.ts +2 -2
  2. package/dist/cjs/models/Border.d.ts.map +1 -1
  3. package/dist/cjs/models/Cell.d.ts +7 -7
  4. package/dist/cjs/models/Cell.d.ts.map +1 -1
  5. package/dist/cjs/operations/workbook/createBinaryWorkbook.js +1 -1
  6. package/dist/cjs/services/cell.d.ts +12 -0
  7. package/dist/cjs/services/cell.d.ts.map +1 -0
  8. package/dist/cjs/services/cell.js +25 -0
  9. package/dist/cjs/services/dataSource.js +2 -2
  10. package/dist/cjs/services/drive.d.ts +1 -0
  11. package/dist/cjs/services/drive.d.ts.map +1 -1
  12. package/dist/cjs/services/drive.js +1 -0
  13. package/dist/cjs/tasks/iterateRows.d.ts +18 -6
  14. package/dist/cjs/tasks/iterateRows.d.ts.map +1 -1
  15. package/dist/cjs/tasks/iterateRows.js +24 -18
  16. package/dist/cjs/tasks/readFirstRow.d.ts +18 -0
  17. package/dist/cjs/tasks/readFirstRow.d.ts.map +1 -0
  18. package/dist/cjs/tasks/readFirstRow.js +31 -0
  19. package/dist/cjs/tasks/readRows.d.ts +20 -0
  20. package/dist/cjs/tasks/readRows.d.ts.map +1 -0
  21. package/dist/cjs/tasks/readRows.js +28 -0
  22. package/dist/esm/models/Border.d.ts +2 -2
  23. package/dist/esm/models/Border.d.ts.map +1 -1
  24. package/dist/esm/models/Cell.d.ts +7 -7
  25. package/dist/esm/models/Cell.d.ts.map +1 -1
  26. package/dist/esm/operations/workbook/createBinaryWorkbook.js +1 -1
  27. package/dist/esm/services/cell.d.ts +12 -0
  28. package/dist/esm/services/cell.d.ts.map +1 -0
  29. package/dist/esm/services/cell.js +22 -0
  30. package/dist/esm/services/dataSource.js +1 -1
  31. package/dist/esm/services/drive.d.ts +1 -0
  32. package/dist/esm/services/drive.d.ts.map +1 -1
  33. package/dist/esm/services/drive.js +1 -0
  34. package/dist/esm/tasks/iterateRows.d.ts +18 -6
  35. package/dist/esm/tasks/iterateRows.d.ts.map +1 -1
  36. package/dist/esm/tasks/iterateRows.js +24 -18
  37. package/dist/esm/tasks/readFirstRow.d.ts +18 -0
  38. package/dist/esm/tasks/readFirstRow.d.ts.map +1 -0
  39. package/dist/esm/tasks/readFirstRow.js +25 -0
  40. package/dist/esm/tasks/readRows.d.ts +20 -0
  41. package/dist/esm/tasks/readRows.d.ts.map +1 -0
  42. package/dist/esm/tasks/readRows.js +25 -0
  43. package/docs/api/Border.md +3 -3
  44. package/docs/api/Cell.md +7 -7
  45. package/docs/api/CellFormat.md +8 -32
  46. package/docs/api/README.md +3 -1
  47. package/docs/api/createBinaryWorkbook.md +1 -1
  48. package/docs/api/drive.md +0 -24
  49. package/docs/api/iterateRows.md +26 -7
  50. package/docs/api/readFirstRow.md +40 -0
  51. package/docs/api/readRows.md +40 -0
  52. package/package.json +71 -21
  53. package/dist/cjs/services/cellFormat.d.ts +0 -15
  54. package/dist/cjs/services/cellFormat.d.ts.map +0 -1
  55. package/dist/cjs/services/cellFormat.js +0 -16
  56. package/dist/esm/services/cellFormat.d.ts +0 -15
  57. package/dist/esm/services/cellFormat.d.ts.map +0 -1
  58. package/dist/esm/services/cellFormat.js +0 -13
@@ -14,7 +14,7 @@ import getWorkbookWorksheetUsedRangeRef from "../operations/workbookWorksheet/ge
14
14
  import readWorkbookRows from "../tasks/readWorkbookRows.js";
15
15
  import { countAddressRows, subRange, superRange } from "./addressManipulation.js";
16
16
  import { addressToCartesian } from "./cartesianAddress.js";
17
- import { generalCellFormat } from "./cellFormat.js";
17
+ import { generalCellFormat } from "./cell.js";
18
18
  /**
19
19
  * Define a datasource from an entire worksheet.
20
20
  * @template T Type of the record, extending RecordBase.
@@ -21,6 +21,7 @@ export declare function createClientSecretContextWithDriveRef(tenantId: AzureTen
21
21
  * @returns A reference to the default drive.
22
22
  * @remarks This method is opinionated and not recommended for production use.
23
23
  * @deprecated Use `createClientSecretContextWithDriveRef()` instead.
24
+ * @hidden
24
25
  */
25
26
  export declare function getDefaultDriveRef(): DriveRef;
26
27
  //# sourceMappingURL=drive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/services/drive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAChH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED,qDAAqD;AACrD,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAKnL;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAY7C"}
1
+ {"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/services/drive.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAC;AAChH,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKzD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED,qDAAqD;AACrD,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAKnL;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAY7C"}
@@ -36,6 +36,7 @@ export function createClientSecretContextWithDriveRef(tenantId, clientId, client
36
36
  * @returns A reference to the default drive.
37
37
  * @remarks This method is opinionated and not recommended for production use.
38
38
  * @deprecated Use `createClientSecretContextWithDriveRef()` instead.
39
+ * @hidden
39
40
  */
40
41
  export function getDefaultDriveRef() {
41
42
  const tenantId = getEnvironmentVariable("AZURE_TENANT_ID");
@@ -4,21 +4,33 @@
4
4
  * @category Tasks
5
5
  * @experimental
6
6
  */
7
- import type { CellScope } from "../models/Cell.ts";
8
- import type { Row } from "../models/Row.ts";
7
+ import type { Cell, CellScope } from "../models/Cell.ts";
8
+ import type { RowOffset } from "../models/Row.ts";
9
9
  import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
10
+ /**
11
+ * Represents a row yielded by the {@link iterateRows} generator.
12
+ * @property {Cell[]} cells Array of cells in the row, each containing value, text, format, and optionally style information depending on the scope.
13
+ * @property {RowOffset} offset Zero-based offset of the row within the original range.
14
+ * @property {boolean} isFirst If this is the first row in the iteration.
15
+ * @property {boolean} isLast If this is the last row in the iteration.
16
+ */
17
+ export type IteratedRow = {
18
+ cells: Cell[];
19
+ offset: RowOffset;
20
+ isFirst: boolean;
21
+ isLast: boolean;
22
+ };
10
23
  /**
11
24
  * Iterate over the rows in a given worksheet range.
12
25
  * @param rangeRef Reference to the workbook range to iterate over.
13
- * @param skip Number of rows to skip before starting to yield rows. Can be negative to get last rows (e.g., -1 for the last row).
14
- * @param take Max number of rows to yield. `POSITIVE_INFINITY` returns all rows.
15
26
  * @param scope Amount of detail to include for each cell.
16
27
  * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
17
28
  * @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
29
+ * @experimental
18
30
  * @example
19
- * for await (const row of iterateRows(rangeRef)) {
31
+ * for await (const { row } of iterateRows(rangeRef)) {
20
32
  * console.log(row);
21
33
  * }
22
34
  */
23
- export declare function iterateRows(rangeRef: WorkbookRangeRef, skip?: number, take?: number, scope?: Partial<CellScope>, maxCellsPerOperation?: number | null): AsyncIterable<Row>;
35
+ export declare function iterateRows(rangeRef: WorkbookRangeRef, scope?: Partial<CellScope>, maxCellsPerOperation?: number | null): AsyncIterable<IteratedRow>;
24
36
  //# sourceMappingURL=iterateRows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"iterateRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAA6C,SAAS,EAAwE,MAAM,mBAAmB,CAAC;AAGpK,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAWnE;;;;;;;;;;;;GAYG;AACH,wBAAuB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,SAAI,EAAE,IAAI,GAAE,MAAiC,EAAE,KAAK,GAAE,OAAO,CAAC,SAAS,CAAgB,EAAE,oBAAoB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAiC1N"}
1
+ {"version":3,"file":"iterateRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAAwE,MAAM,mBAAmB,CAAC;AAIpK,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAUnE;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAuB,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,GAAE,OAAO,CAAC,SAAS,CAAoB,EAAE,oBAAoB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,WAAW,CAAC,CAwCnL"}
@@ -12,45 +12,51 @@ import getWorkbookWorksheetRange from "../operations/workbookRange/getWorkbookWo
12
12
  import listWorkbookRangeBorders from "../operations/workbookRange/listWorkbookRangeBorders.js";
13
13
  import { countAddressColumns, countAddressRows, subRange } from "../services/addressManipulation.js";
14
14
  import { maxCellsPerRequest } from "../services/batch.js";
15
- const defaultScope = { values: true, text: true, format: true };
15
+ import { defaultCellScope } from "../services/cell.js";
16
16
  /**
17
17
  * Iterate over the rows in a given worksheet range.
18
18
  * @param rangeRef Reference to the workbook range to iterate over.
19
- * @param skip Number of rows to skip before starting to yield rows. Can be negative to get last rows (e.g., -1 for the last row).
20
- * @param take Max number of rows to yield. `POSITIVE_INFINITY` returns all rows.
21
19
  * @param scope Amount of detail to include for each cell.
22
20
  * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
23
21
  * @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
22
+ * @experimental
24
23
  * @example
25
- * for await (const row of iterateRows(rangeRef)) {
24
+ * for await (const { row } of iterateRows(rangeRef)) {
26
25
  * console.log(row);
27
26
  * }
28
27
  */
29
- export async function* iterateRows(rangeRef, skip = 0, take = Number.POSITIVE_INFINITY, scope = defaultScope, maxCellsPerOperation = null) {
30
- const totalRangeRef = subRange(rangeRef, skip, take);
31
- const totalColumnCount = countAddressColumns(totalRangeRef.address);
32
- const totalRowCount = countAddressRows(totalRangeRef.address);
28
+ export async function* iterateRows(rangeRef, scope = defaultCellScope, maxCellsPerOperation = null) {
29
+ const totalColumnCount = countAddressColumns(rangeRef.address);
30
+ const totalRowCount = countAddressRows(rangeRef.address);
33
31
  const maxRowsPerOperation = calculateMaxRowsPerOperation(totalColumnCount, maxCellsPerOperation);
34
32
  const rangeSelect = scopeToRangeSelect(scope);
35
33
  for (let operationRowStart = 0; operationRowStart < totalRowCount; operationRowStart += maxRowsPerOperation) {
36
34
  const operationRowCount = Math.min(maxRowsPerOperation, totalRowCount - operationRowStart);
37
- const operationRangeRef = subRange(totalRangeRef, operationRowStart, operationRowCount);
35
+ const operationRangeRef = subRange(rangeRef, operationRowStart, operationRowCount);
38
36
  const range = rangeSelect ? await getWorkbookWorksheetRange(operationRangeRef, rangeSelect) : null;
39
- for (let rowIndex = 0; rowIndex < operationRowCount; rowIndex++) {
40
- const row = [];
41
- for (let columnIndex = 0; columnIndex < totalColumnCount; columnIndex++) {
42
- const value = (range?.values?.[rowIndex]?.[columnIndex] ?? ""); // The root of these is undefined if that detail isn't in scope
43
- const text = (range?.text?.[rowIndex]?.[columnIndex] ?? "");
44
- const format = (range?.numberFormat?.[rowIndex]?.[columnIndex] ?? "");
45
- const style = await getStyle(subRange(rangeRef, rowIndex, 1, columnIndex, 1), scope); // This line is potentially expensive
46
- row.push({
37
+ for (let operationRowOffset = 0; operationRowOffset < operationRowCount; operationRowOffset++) {
38
+ const cells = [];
39
+ for (let columnOffset = 0; columnOffset < totalColumnCount; columnOffset++) {
40
+ const value = (range?.values?.[operationRowOffset]?.[columnOffset] ?? ""); // The root of these is undefined if that detail isn't in scope
41
+ const text = (range?.text?.[operationRowOffset]?.[columnOffset] ?? "");
42
+ const format = (range?.numberFormat?.[operationRowOffset]?.[columnOffset] ?? "");
43
+ const style = await getStyle(subRange(rangeRef, operationRowOffset, 1, columnOffset, 1), scope); // This line is potentially expensive
44
+ cells.push({
47
45
  value,
48
46
  text,
49
47
  format,
50
48
  style,
51
49
  });
52
50
  }
53
- yield row;
51
+ const offset = (operationRowStart + operationRowOffset);
52
+ const isFirst = offset === 0;
53
+ const isLast = offset === totalRowCount - 1;
54
+ yield {
55
+ cells,
56
+ offset,
57
+ isFirst,
58
+ isLast,
59
+ };
54
60
  }
55
61
  }
56
62
  }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Read the first row from a given workbook range.
3
+ * @module readFirstRow
4
+ * @category Tasks
5
+ * @experimental
6
+ */
7
+ import type { Cell } from "../models/Cell.ts";
8
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
9
+ /** * Read the first row from a given workbook range.
10
+ * @param rangeRef Reference to the workbook range to read.
11
+ * @param scope Amount of detail to include for each cell.
12
+ * @returns A promise that resolves to an array of cells in the first row.
13
+ * @remarks Particularly useful for reading header rows.
14
+ * @example
15
+ * const firstRow = await readFirstRow(rangeRef);
16
+ */
17
+ export default function readFirstRow(rangeRef: WorkbookRangeRef, scope?: import("../models/Cell.ts").CellScope): Promise<Cell[]>;
18
+ //# sourceMappingURL=readFirstRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readFirstRow.d.ts","sourceRoot":"","sources":["../../../src/tasks/readFirstRow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAKnE;;;;;;;GAOG;AACH,wBAA8B,YAAY,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,wCAAmB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAQhH"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Read the first row from a given workbook range.
3
+ * @module readFirstRow
4
+ * @category Tasks
5
+ * @experimental
6
+ */
7
+ import InvalidArgumentError from "../errors/InvalidArgumentError.js";
8
+ import { subRange } from "../services/addressManipulation.js";
9
+ import { defaultCellScope } from "../services/cell.js";
10
+ import { iterateRows } from "./iterateRows.js";
11
+ /** * Read the first row from a given workbook range.
12
+ * @param rangeRef Reference to the workbook range to read.
13
+ * @param scope Amount of detail to include for each cell.
14
+ * @returns A promise that resolves to an array of cells in the first row.
15
+ * @remarks Particularly useful for reading header rows.
16
+ * @example
17
+ * const firstRow = await readFirstRow(rangeRef);
18
+ */
19
+ export default async function readFirstRow(rangeRef, scope = defaultCellScope) {
20
+ const firstRowRef = subRange(rangeRef, 0, 1);
21
+ for await (const { cells } of iterateRows(firstRowRef, scope)) {
22
+ return cells;
23
+ }
24
+ throw new InvalidArgumentError("No rows in the specified range.");
25
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Read all rows from a given workbook range.
3
+ * @module readRows
4
+ * @category Tasks
5
+ * @experimental
6
+ */
7
+ import type { Cell } from "../models/Cell.ts";
8
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
9
+ /**
10
+ * Read all rows from a given workbook range.
11
+ * @param rangeRef Reference to the workbook range to read.
12
+ * @param scope Amount of detail to include for each cell.
13
+ * @returns A promise that resolves to an array of rows, each containing an array of cells.
14
+ * @remarks Where practical, prefer using {@link iterateRows} for more efficient memory usage.
15
+ * @experimental
16
+ * @example
17
+ * const rows = await readRows(rangeRef);
18
+ */
19
+ export default function readRows(rangeRef: WorkbookRangeRef, scope?: import("../models/Cell.ts").CellScope): Promise<Cell[][]>;
20
+ //# sourceMappingURL=readRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"readRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/readRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAInE;;;;;;;;;GASG;AACH,wBAA8B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,wCAAmB,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAO9G"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Read all rows from a given workbook range.
3
+ * @module readRows
4
+ * @category Tasks
5
+ * @experimental
6
+ */
7
+ import { defaultCellScope } from "../services/cell.js";
8
+ import { iterateRows } from "./iterateRows.js";
9
+ /**
10
+ * Read all rows from a given workbook range.
11
+ * @param rangeRef Reference to the workbook range to read.
12
+ * @param scope Amount of detail to include for each cell.
13
+ * @returns A promise that resolves to an array of rows, each containing an array of cells.
14
+ * @remarks Where practical, prefer using {@link iterateRows} for more efficient memory usage.
15
+ * @experimental
16
+ * @example
17
+ * const rows = await readRows(rangeRef);
18
+ */
19
+ export default async function readRows(rangeRef, scope = defaultCellScope) {
20
+ const rows = [];
21
+ for await (const { cells } of iterateRows(rangeRef, scope)) {
22
+ rows.push(cells);
23
+ }
24
+ return rows;
25
+ }
@@ -21,7 +21,7 @@ Defined in: [src/models/Border.ts:9](https://github.com/Future-Secure-AI/microso
21
21
  | Property | Type | Defined in |
22
22
  | ------ | ------ | ------ |
23
23
  | <a id="color"></a> `color` | [`Color`](Color.md#color) | [src/models/Border.ts:10](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Border.ts#L10) |
24
- | <a id="style"></a> `style` | [`BorderType`](#bordertype) | [src/models/Border.ts:11](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Border.ts#L11) |
24
+ | <a id="style"></a> `style` | [`BorderStyle`](#borderstyle-1) | [src/models/Border.ts:11](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Border.ts#L11) |
25
25
  | <a id="weight"></a> `weight` | [`BorderWeight`](#borderweight-1) | [src/models/Border.ts:12](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Border.ts#L12) |
26
26
 
27
27
  ***
@@ -36,9 +36,9 @@ Defined in: [src/models/Border.ts:15](https://github.com/Future-Secure-AI/micros
36
36
 
37
37
  ***
38
38
 
39
- ### BorderType
39
+ ### BorderStyle
40
40
 
41
- > **BorderType** = `"None"` \| `"Continuous"` \| `"Dash"` \| `"DashDot"` \| `"DashDotDot"` \| `"Dot"` \| `"Double"` \| `"SlantDashDot"`
41
+ > **BorderStyle** = `"None"` \| `"Continuous"` \| `"Dash"` \| `"DashDot"` \| `"DashDotDot"` \| `"Dot"` \| `"Double"` \| `"SlantDashDot"`
42
42
 
43
43
  Defined in: [src/models/Border.ts:17](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Border.ts#L17)
44
44
 
package/docs/api/Cell.md CHANGED
@@ -69,13 +69,13 @@ The amount of detail that we're reading from a cell.
69
69
 
70
70
  | Property | Type | Description | Defined in |
71
71
  | ------ | ------ | ------ | ------ |
72
- | <a id="alignment"></a> `alignment` | `boolean` | Content position with the cell. Expensive to read/write (1 op per cell) | [src/models/Cell.ts:138](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L138) |
73
- | <a id="borders"></a> `borders` | `boolean` | Cell borders. Expensive to read/write (1 op per cell) | [src/models/Cell.ts:141](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L141) |
74
- | <a id="fill"></a> `fill` | `boolean` | Background fill style. Expensive to read/write (1 op per cell) | [src/models/Cell.ts:144](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L144) |
75
- | <a id="font"></a> `font` | `boolean` | Text style. Expensive to read/write (1 op per cell) | [src/models/Cell.ts:147](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L147) |
76
- | <a id="format-1"></a> `format` | `boolean` | Logic used to format values to text. Cheap to read/write (1 op per ~10K cells for values, text & format) | [src/models/Cell.ts:135](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L135) |
77
- | <a id="text-1"></a> `text` | `boolean` | Formatted value, as presented to the user. Cheap to read/write (1 op per ~10K cells for values, text & format) | [src/models/Cell.ts:132](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L132) |
78
- | <a id="values"></a> `values` | `boolean` | Raw underlying value. Cheap to read/write (1 op per ~10K cells for values, text & format) | [src/models/Cell.ts:129](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L129) |
72
+ | <a id="alignment"></a> `alignment` | `boolean` | Content position with the cell. VERY EXPENSIVE (+1 op per cell) | [src/models/Cell.ts:138](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L138) |
73
+ | <a id="borders"></a> `borders` | `boolean` | Cell borders. VERY EXPENSIVE (+1 op per cell) | [src/models/Cell.ts:141](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L141) |
74
+ | <a id="fill"></a> `fill` | `boolean` | Background fill style. VERY EXPENSIVE (+1 op per cell) | [src/models/Cell.ts:144](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L144) |
75
+ | <a id="font"></a> `font` | `boolean` | Text style. VERY EXPENSIVE (+1 op per cell) | [src/models/Cell.ts:147](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L147) |
76
+ | <a id="format-1"></a> `format` | `boolean` | Logic used to format values to text. CHEAP (~1 op per 10K cells, no additional call op `values` or `text`) | [src/models/Cell.ts:135](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L135) |
77
+ | <a id="text-1"></a> `text` | `boolean` | Formatted value, as presented to the user. CHEAP (~1 op per 10K cells, no additional call op `values` or `format`) | [src/models/Cell.ts:132](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L132) |
78
+ | <a id="values"></a> `values` | `boolean` | Raw cell value. CHEAP (~1 op per 10K cells, no additional op with `text` or `format`) | [src/models/Cell.ts:129](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/models/Cell.ts#L129) |
79
79
 
80
80
  ***
81
81
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # CellFormat
4
4
 
5
- Spreadsheet number format constants for Microsoft Graph API.
5
+ Cell utilities.
6
6
 
7
7
  ## Variables
8
8
 
@@ -10,23 +10,15 @@ Spreadsheet number format constants for Microsoft Graph API.
10
10
 
11
11
  > `const` **accountingCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
12
12
 
13
- Defined in: [src/services/cellFormat.ts:12](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L12)
13
+ Defined in: src/services/cell.ts:12
14
14
 
15
15
  ***
16
16
 
17
- ### currencyCellFormat
17
+ ### defaultCellScope
18
18
 
19
- > `const` **currencyCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
19
+ > `const` **defaultCellScope**: [`CellScope`](Cell.md#cellscope)
20
20
 
21
- Defined in: [src/services/cellFormat.ts:11](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L11)
22
-
23
- ***
24
-
25
- ### dateShortCellFormat
26
-
27
- > `const` **dateShortCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
28
-
29
- Defined in: [src/services/cellFormat.ts:14](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L14)
21
+ Defined in: src/services/cell.ts:18
30
22
 
31
23
  ***
32
24
 
@@ -34,7 +26,7 @@ Defined in: [src/services/cellFormat.ts:14](https://github.com/Future-Secure-AI/
34
26
 
35
27
  > `const` **generalCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
36
28
 
37
- Defined in: [src/services/cellFormat.ts:9](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L9)
29
+ Defined in: src/services/cell.ts:9
38
30
 
39
31
  ***
40
32
 
@@ -42,15 +34,7 @@ Defined in: [src/services/cellFormat.ts:9](https://github.com/Future-Secure-AI/m
42
34
 
43
35
  > `const` **numberCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
44
36
 
45
- Defined in: [src/services/cellFormat.ts:10](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L10)
46
-
47
- ***
48
-
49
- ### percentageCellFormat
50
-
51
- > `const` **percentageCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
52
-
53
- Defined in: [src/services/cellFormat.ts:13](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L13)
37
+ Defined in: src/services/cell.ts:11
54
38
 
55
39
  ***
56
40
 
@@ -58,12 +42,4 @@ Defined in: [src/services/cellFormat.ts:13](https://github.com/Future-Secure-AI/
58
42
 
59
43
  > `const` **textCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
60
44
 
61
- Defined in: [src/services/cellFormat.ts:16](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L16)
62
-
63
- ***
64
-
65
- ### timeCellFormat
66
-
67
- > `const` **timeCellFormat**: [`CellFormat`](Cell.md#cellformat-1)
68
-
69
- Defined in: [src/services/cellFormat.ts:15](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/cellFormat.ts#L15)
45
+ Defined in: src/services/cell.ts:10
@@ -124,7 +124,7 @@
124
124
  | [azureApplicationCredentials](azureApplicationCredentials.md) | Azure application credential helpers for authentication and token management. |
125
125
  | [batch](batch.md) | Constants and helpers for batching Microsoft Graph API requests. |
126
126
  | [cartesianAddress](cartesianAddress.md) | Utilities for converting between A1 addresses and Cartesian coordinates. |
127
- | [CellFormat](CellFormat.md) | Spreadsheet number format constants for Microsoft Graph API. |
127
+ | [CellFormat](CellFormat.md) | Cell utilities. |
128
128
  | [context](context.md) | Context creation and management utilities for Microsoft Graph API authentication. |
129
129
  | [dataSource](dataSource.md) | Tooling for easily creating, updating, and deleting items in a worksheet or range. |
130
130
  | [drive](drive.md) | Utilities for working with Microsoft Graph Drive references and operations. |
@@ -158,6 +158,8 @@
158
158
  | [getWorkbookWorksheetByName](getWorkbookWorksheetByName-1.md) | Get a worksheet by its name. |
159
159
  | [iterateRows](iterateRows.md) | Iterate over the rows in a given worksheet range. |
160
160
  | [listDriveItems](listDriveItems.md) | List drive items in a drive or a drive item. |
161
+ | [readFirstRow](readFirstRow.md) | Read the first row from a given workbook range. |
162
+ | [readRows](readRows.md) | Read all rows from a given workbook range. |
161
163
  | [readWorkbookRows](readWorkbookRows.md) | Iterates over the rows in a given worksheet range. |
162
164
  | [safeDeleteWorkbook](safeDeleteWorkbook.md) | Safely delete a workbook by first closing any open sessions and then deleting it. |
163
165
  | [setColumnHidden](setColumnHidden.md) | Set one or more columns visibility. |
@@ -10,7 +10,7 @@ Create a new blank binary workbook (XLSB).
10
10
 
11
11
  > **createBinaryWorkbook**(`parentRef`, `itemPath`): [`GraphOperation`](GraphOperation.md#graphoperation)\<`DriveItem` & [`SiteRef`](Site-1.md#siteref) & `object` & `object` & `object`\>
12
12
 
13
- Defined in: src/operations/workbook/createBinaryWorkbook.ts:28
13
+ Defined in: [src/operations/workbook/createBinaryWorkbook.ts:28](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/operations/workbook/createBinaryWorkbook.ts#L28)
14
14
 
15
15
  Create a new blank binary workbook (XLSB).
16
16
 
package/docs/api/drive.md CHANGED
@@ -54,27 +54,3 @@ A reference to the drive.
54
54
  #### Throws
55
55
 
56
56
  ProtocolError if the drive ID is missing.
57
-
58
- ***
59
-
60
- ### ~~getDefaultDriveRef()~~
61
-
62
- > **getDefaultDriveRef**(): [`DriveRef`](Drive-1.md#driveref)
63
-
64
- Defined in: [src/services/drive.ts:48](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/services/drive.ts#L48)
65
-
66
- Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
67
-
68
- #### Returns
69
-
70
- [`DriveRef`](Drive-1.md#driveref)
71
-
72
- A reference to the default drive.
73
-
74
- #### Remarks
75
-
76
- This method is opinionated and not recommended for production use.
77
-
78
- #### Deprecated
79
-
80
- Use `createClientSecretContextWithDriveRef()` instead.
@@ -6,13 +6,34 @@
6
6
 
7
7
  Iterate over the rows in a given worksheet range.
8
8
 
9
+ ## Type Aliases
10
+
11
+ ### IteratedRow
12
+
13
+ > **IteratedRow** = `object`
14
+
15
+ Defined in: [src/tasks/iterateRows.ts:33](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L33)
16
+
17
+ **`Experimental`**
18
+
19
+ Represents a row yielded by the [iterateRows](#iteraterows) generator.
20
+
21
+ #### Properties
22
+
23
+ | Property | Type | Description | Defined in |
24
+ | ------ | ------ | ------ | ------ |
25
+ | <a id="cells"></a> `cells` | [`Cell`](Cell.md#cell)[] | Array of cells in the row, each containing value, text, format, and optionally style information depending on the scope. | [src/tasks/iterateRows.ts:34](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L34) |
26
+ | <a id="isfirst"></a> `isFirst` | `boolean` | If this is the first row in the iteration. | [src/tasks/iterateRows.ts:36](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L36) |
27
+ | <a id="islast"></a> `isLast` | `boolean` | If this is the last row in the iteration. | [src/tasks/iterateRows.ts:37](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L37) |
28
+ | <a id="offset"></a> `offset` | [`RowOffset`](Row.md#rowoffset) | Zero-based offset of the row within the original range. | [src/tasks/iterateRows.ts:35](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L35) |
29
+
9
30
  ## Functions
10
31
 
11
32
  ### iterateRows()
12
33
 
13
- > **iterateRows**(`rangeRef`, `skip`, `take`, `scope`, `maxCellsPerOperation`): `AsyncIterable`\<[`Row`](Row.md#row)\>
34
+ > **iterateRows**(`rangeRef`, `scope`, `maxCellsPerOperation`): `AsyncIterable`\<[`IteratedRow`](#iteratedrow)\>
14
35
 
15
- Defined in: [src/tasks/iterateRows.ts:39](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L39)
36
+ Defined in: [src/tasks/iterateRows.ts:52](https://github.com/Future-Secure-AI/microsoft-graph/blob/main/src/tasks/iterateRows.ts#L52)
16
37
 
17
38
  **`Experimental`**
18
39
 
@@ -21,14 +42,12 @@ Defined in: [src/tasks/iterateRows.ts:39](https://github.com/Future-Secure-AI/mi
21
42
  | Parameter | Type | Default value | Description |
22
43
  | ------ | ------ | ------ | ------ |
23
44
  | `rangeRef` | [`WorkbookRangeRef`](WorkbookRange-1.md#workbookrangeref) | `undefined` | Reference to the workbook range to iterate over. |
24
- | `skip` | `number` | `0` | Number of rows to skip before starting to yield rows. Can be negative to get last rows (e.g., -1 for the last row). |
25
- | `take` | `number` | `Number.POSITIVE_INFINITY` | Max number of rows to yield. `POSITIVE_INFINITY` returns all rows. |
26
- | `scope` | [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`CellScope`](Cell.md#cellscope)\> | `defaultScope` | Amount of detail to include for each cell. |
45
+ | `scope` | [`Partial`](https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype)\<[`CellScope`](Cell.md#cellscope)\> | `defaultCellScope` | Amount of detail to include for each cell. |
27
46
  | `maxCellsPerOperation` | `null` \| `number` | `null` | Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING. |
28
47
 
29
48
  #### Returns
30
49
 
31
- `AsyncIterable`\<[`Row`](Row.md#row)\>
50
+ `AsyncIterable`\<[`IteratedRow`](#iteratedrow)\>
32
51
 
33
52
  #### Remarks
34
53
 
@@ -37,7 +56,7 @@ Including `style` in the scope requires over three operations for each and every
37
56
  #### Example
38
57
 
39
58
  ```ts
40
- for await (const row of iterateRows(rangeRef)) {
59
+ for await (const { row } of iterateRows(rangeRef)) {
41
60
  console.log(row);
42
61
  }
43
62
  ```
@@ -0,0 +1,40 @@
1
+ [Microsoft Graph SDK](README.md) / readFirstRow
2
+
3
+ # readFirstRow
4
+
5
+ **`Experimental`**
6
+
7
+ Read the first row from a given workbook range.
8
+
9
+ ## Functions
10
+
11
+ ### readFirstRow()
12
+
13
+ > **readFirstRow**(`rangeRef`, `scope`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Cell`](Cell.md#cell)[]\>
14
+
15
+ Defined in: src/tasks/readFirstRow.ts:23
16
+
17
+ **`Experimental`**
18
+
19
+ #### Parameters
20
+
21
+ | Parameter | Type | Default value | Description |
22
+ | ------ | ------ | ------ | ------ |
23
+ | `rangeRef` | [`WorkbookRangeRef`](WorkbookRange-1.md#workbookrangeref) | `undefined` | Reference to the workbook range to read. |
24
+ | `scope` | [`CellScope`](Cell.md#cellscope) | `defaultCellScope` | Amount of detail to include for each cell. |
25
+
26
+ #### Returns
27
+
28
+ [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Cell`](Cell.md#cell)[]\>
29
+
30
+ A promise that resolves to an array of cells in the first row.
31
+
32
+ #### Remarks
33
+
34
+ Particularly useful for reading header rows.
35
+
36
+ #### Example
37
+
38
+ ```ts
39
+ const firstRow = await readFirstRow(rangeRef);
40
+ ```
@@ -0,0 +1,40 @@
1
+ [Microsoft Graph SDK](README.md) / readRows
2
+
3
+ # readRows
4
+
5
+ **`Experimental`**
6
+
7
+ Read all rows from a given workbook range.
8
+
9
+ ## Functions
10
+
11
+ ### readRows()
12
+
13
+ > **readRows**(`rangeRef`, `scope`): [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Cell`](Cell.md#cell)[][]\>
14
+
15
+ Defined in: src/tasks/readRows.ts:23
16
+
17
+ **`Experimental`**
18
+
19
+ #### Parameters
20
+
21
+ | Parameter | Type | Default value | Description |
22
+ | ------ | ------ | ------ | ------ |
23
+ | `rangeRef` | [`WorkbookRangeRef`](WorkbookRange-1.md#workbookrangeref) | `undefined` | Reference to the workbook range to read. |
24
+ | `scope` | [`CellScope`](Cell.md#cellscope) | `defaultCellScope` | Amount of detail to include for each cell. |
25
+
26
+ #### Returns
27
+
28
+ [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<[`Cell`](Cell.md#cell)[][]\>
29
+
30
+ A promise that resolves to an array of rows, each containing an array of cells.
31
+
32
+ #### Remarks
33
+
34
+ Where practical, prefer using [iterateRows](iterateRows.md#iteraterows) for more efficient memory usage.
35
+
36
+ #### Example
37
+
38
+ ```ts
39
+ const rows = await readRows(rangeRef);
40
+ ```