microsoft-graph 2.27.0 → 2.28.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 (102) hide show
  1. package/dist/cjs/models/Border.d.ts +16 -0
  2. package/dist/cjs/models/Border.d.ts.map +1 -0
  3. package/dist/cjs/models/Border.js +2 -0
  4. package/dist/cjs/models/Cell.d.ts +90 -5
  5. package/dist/cjs/models/Cell.d.ts.map +1 -1
  6. package/dist/cjs/models/Color.d.ts +9 -0
  7. package/dist/cjs/models/Color.d.ts.map +1 -0
  8. package/dist/cjs/models/Color.js +2 -0
  9. package/dist/cjs/models/Column.d.ts +5 -0
  10. package/dist/cjs/models/Column.d.ts.map +1 -1
  11. package/dist/cjs/models/Column.js +5 -1
  12. package/dist/cjs/models/DataSource.d.ts +22 -0
  13. package/dist/cjs/models/DataSource.d.ts.map +1 -1
  14. package/dist/cjs/models/DataSource.js +6 -0
  15. package/dist/cjs/models/FontName.d.ts +9 -0
  16. package/dist/cjs/models/FontName.d.ts.map +1 -0
  17. package/dist/cjs/models/FontName.js +2 -0
  18. package/dist/cjs/models/Row.d.ts +3 -0
  19. package/dist/cjs/models/Row.d.ts.map +1 -1
  20. package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.d.ts +6 -1
  21. package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
  22. package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.js +9 -2
  23. package/dist/cjs/operations/workbookRange/listWorkbookRangeBorders.d.ts +16 -0
  24. package/dist/cjs/operations/workbookRange/listWorkbookRangeBorders.d.ts.map +1 -0
  25. package/dist/cjs/operations/workbookRange/listWorkbookRangeBorders.js +33 -0
  26. package/dist/cjs/operations/workbookRange/setWorkbookRangeBorder.d.ts +19 -0
  27. package/dist/cjs/operations/workbookRange/setWorkbookRangeBorder.d.ts.map +1 -0
  28. package/dist/cjs/operations/workbookRange/setWorkbookRangeBorder.js +44 -0
  29. package/dist/cjs/services/dataSource.d.ts +11 -0
  30. package/dist/cjs/services/dataSource.d.ts.map +1 -1
  31. package/dist/cjs/services/dataSource.js +21 -3
  32. package/dist/cjs/services/iteration.d.ts +1 -0
  33. package/dist/cjs/services/iteration.d.ts.map +1 -1
  34. package/dist/cjs/services/iteration.js +1 -0
  35. package/dist/cjs/tasks/iterateRows.d.ts +24 -0
  36. package/dist/cjs/tasks/iterateRows.d.ts.map +1 -0
  37. package/dist/cjs/tasks/iterateRows.js +127 -0
  38. package/dist/cjs/tasks/iterateWorkbookRange.d.ts.map +1 -1
  39. package/dist/cjs/tasks/iterateWorkbookRange.js +7 -0
  40. package/dist/cjs/tasks/readWorkbookRows.d.ts.map +1 -1
  41. package/dist/cjs/tasks/readWorkbookRows.js +8 -0
  42. package/dist/esm/models/Border.d.ts +16 -0
  43. package/dist/esm/models/Border.d.ts.map +1 -0
  44. package/dist/esm/models/Border.js +1 -0
  45. package/dist/esm/models/Cell.d.ts +90 -5
  46. package/dist/esm/models/Cell.d.ts.map +1 -1
  47. package/dist/esm/models/Color.d.ts +9 -0
  48. package/dist/esm/models/Color.d.ts.map +1 -0
  49. package/dist/esm/models/Color.js +1 -0
  50. package/dist/esm/models/Column.d.ts +5 -0
  51. package/dist/esm/models/Column.d.ts.map +1 -1
  52. package/dist/esm/models/Column.js +5 -1
  53. package/dist/esm/models/DataSource.d.ts +22 -0
  54. package/dist/esm/models/DataSource.d.ts.map +1 -1
  55. package/dist/esm/models/DataSource.js +6 -0
  56. package/dist/esm/models/FontName.d.ts +9 -0
  57. package/dist/esm/models/FontName.d.ts.map +1 -0
  58. package/dist/esm/models/FontName.js +1 -0
  59. package/dist/esm/models/Row.d.ts +3 -0
  60. package/dist/esm/models/Row.d.ts.map +1 -1
  61. package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.d.ts +6 -1
  62. package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
  63. package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.js +9 -2
  64. package/dist/esm/operations/workbookRange/listWorkbookRangeBorders.d.ts +16 -0
  65. package/dist/esm/operations/workbookRange/listWorkbookRangeBorders.d.ts.map +1 -0
  66. package/dist/esm/operations/workbookRange/listWorkbookRangeBorders.js +30 -0
  67. package/dist/esm/operations/workbookRange/setWorkbookRangeBorder.d.ts +19 -0
  68. package/dist/esm/operations/workbookRange/setWorkbookRangeBorder.d.ts.map +1 -0
  69. package/dist/esm/operations/workbookRange/setWorkbookRangeBorder.js +41 -0
  70. package/dist/esm/services/dataSource.d.ts +11 -0
  71. package/dist/esm/services/dataSource.d.ts.map +1 -1
  72. package/dist/esm/services/dataSource.js +21 -3
  73. package/dist/esm/services/iteration.d.ts +1 -0
  74. package/dist/esm/services/iteration.d.ts.map +1 -1
  75. package/dist/esm/services/iteration.js +1 -0
  76. package/dist/esm/tasks/iterateRows.d.ts +24 -0
  77. package/dist/esm/tasks/iterateRows.d.ts.map +1 -0
  78. package/dist/esm/tasks/iterateRows.js +121 -0
  79. package/dist/esm/tasks/iterateWorkbookRange.d.ts.map +1 -1
  80. package/dist/esm/tasks/iterateWorkbookRange.js +7 -0
  81. package/dist/esm/tasks/readWorkbookRows.d.ts.map +1 -1
  82. package/dist/esm/tasks/readWorkbookRows.js +8 -0
  83. package/docs/api/Border.md +55 -0
  84. package/docs/api/Cell.md +94 -7
  85. package/docs/api/Color.md +19 -0
  86. package/docs/api/Column.md +12 -2
  87. package/docs/api/DataSource-1.md +191 -0
  88. package/docs/api/FontName.md +19 -0
  89. package/docs/api/Iteration.md +3 -1
  90. package/docs/api/README.md +9 -8
  91. package/docs/api/Row.md +5 -3
  92. package/docs/api/dataSource.md +204 -0
  93. package/docs/api/deleteWorkbookRange.md +1 -1
  94. package/docs/api/getWorkbookWorksheetRange.md +6 -2
  95. package/docs/api/insertWorkbookCells.md +1 -1
  96. package/docs/api/iterateRows.md +43 -0
  97. package/docs/api/listWorkbookRangeBorders.md +31 -0
  98. package/docs/api/readWorkbookRows.md +1 -1
  99. package/docs/api/setWorkbookRangeBorder.md +33 -0
  100. package/package.json +151 -1
  101. package/docs/api/models/DataSource.md +0 -161
  102. package/docs/api/services/dataSource.md +0 -200
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Iterate over the rows in a given worksheet range.
3
+ * @module iterateRows
4
+ * @category Tasks
5
+ * @experimental
6
+ */
7
+ import type { CellScope } from "../models/Cell.ts";
8
+ import type { Row } from "../models/Row.ts";
9
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
10
+ /**
11
+ * Iterate over the rows in a given worksheet range.
12
+ * @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
+ * @param scope Amount of detail to include for each cell.
16
+ * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
17
+ * @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
18
+ * @example
19
+ * for await (const row of iterateRows(rangeRef)) {
20
+ * console.log(row);
21
+ * }
22
+ */
23
+ export declare function iterateRows(rangeRef: WorkbookRangeRef, skip?: number, take?: number, scope?: Partial<CellScope>, maxCellsPerOperation?: number | null): AsyncIterable<Row>;
24
+ //# sourceMappingURL=iterateRows.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ /**
3
+ * Iterate over the rows in a given worksheet range.
4
+ * @module iterateRows
5
+ * @category Tasks
6
+ * @experimental
7
+ */
8
+ var __importDefault = (this && this.__importDefault) || function (mod) {
9
+ return (mod && mod.__esModule) ? mod : { "default": mod };
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.iterateRows = iterateRows;
13
+ const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
14
+ const getWorkbookRangeFill_ts_1 = __importDefault(require("../operations/workbookRange/getWorkbookRangeFill.js"));
15
+ const getWorkbookRangeFont_ts_1 = __importDefault(require("../operations/workbookRange/getWorkbookRangeFont.js"));
16
+ const getWorkbookRangeFormat_ts_1 = __importDefault(require("../operations/workbookRange/getWorkbookRangeFormat.js"));
17
+ const getWorkbookWorksheetRange_ts_1 = __importDefault(require("../operations/workbookRange/getWorkbookWorksheetRange.js"));
18
+ const listWorkbookRangeBorders_ts_1 = __importDefault(require("../operations/workbookRange/listWorkbookRangeBorders.js"));
19
+ const addressManipulation_ts_1 = require("../services/addressManipulation.js");
20
+ const batch_ts_1 = require("../services/batch.js");
21
+ const defaultScope = { values: true, text: true, format: true };
22
+ /**
23
+ * Iterate over the rows in a given worksheet range.
24
+ * @param rangeRef Reference to the workbook range to iterate over.
25
+ * @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).
26
+ * @param take Max number of rows to yield. `POSITIVE_INFINITY` returns all rows.
27
+ * @param scope Amount of detail to include for each cell.
28
+ * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
29
+ * @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
30
+ * @example
31
+ * for await (const row of iterateRows(rangeRef)) {
32
+ * console.log(row);
33
+ * }
34
+ */
35
+ async function* iterateRows(rangeRef, skip = 0, take = Number.POSITIVE_INFINITY, scope = defaultScope, maxCellsPerOperation = null) {
36
+ const totalRangeRef = (0, addressManipulation_ts_1.subRange)(rangeRef, skip, take);
37
+ const totalColumnCount = (0, addressManipulation_ts_1.countAddressColumns)(totalRangeRef.address);
38
+ const totalRowCount = (0, addressManipulation_ts_1.countAddressRows)(totalRangeRef.address);
39
+ const maxRowsPerOperation = calculateMaxRowsPerOperation(totalColumnCount, maxCellsPerOperation);
40
+ const rangeSelect = scopeToRangeSelect(scope);
41
+ for (let operationRowStart = 0; operationRowStart < totalRowCount; operationRowStart += maxRowsPerOperation) {
42
+ const operationRowCount = Math.min(maxRowsPerOperation, totalRowCount - operationRowStart);
43
+ const operationRangeRef = (0, addressManipulation_ts_1.subRange)(totalRangeRef, operationRowStart, operationRowCount);
44
+ const range = rangeSelect ? await (0, getWorkbookWorksheetRange_ts_1.default)(operationRangeRef, rangeSelect) : null;
45
+ for (let rowIndex = 0; rowIndex < operationRowCount; rowIndex++) {
46
+ const row = [];
47
+ for (let columnIndex = 0; columnIndex < totalColumnCount; columnIndex++) {
48
+ const value = (range?.values?.[rowIndex]?.[columnIndex] ?? ""); // The root of these is undefined if that detail isn't in scope
49
+ const text = (range?.text?.[rowIndex]?.[columnIndex] ?? "");
50
+ const format = (range?.numberFormat?.[rowIndex]?.[columnIndex] ?? "");
51
+ const style = await getStyle((0, addressManipulation_ts_1.subRange)(rangeRef, rowIndex, 1, columnIndex, 1), scope); // This line is potentially expensive
52
+ row.push({
53
+ value,
54
+ text,
55
+ format,
56
+ style,
57
+ });
58
+ }
59
+ yield row;
60
+ }
61
+ }
62
+ }
63
+ async function getStyle(rangeRef, scope) {
64
+ const alignment = scope.alignment ? await (0, getWorkbookRangeFormat_ts_1.default)(rangeRef) : null;
65
+ const borders = scope.borders ? await (0, listWorkbookRangeBorders_ts_1.default)(rangeRef) : null;
66
+ const fill = scope.fill ? await (0, getWorkbookRangeFill_ts_1.default)(rangeRef) : null;
67
+ const font = scope.font ? await (0, getWorkbookRangeFont_ts_1.default)(rangeRef) : null;
68
+ return {
69
+ merge: {
70
+ /* Not provided by API */
71
+ },
72
+ alignment: {
73
+ vertical: alignment?.verticalAlignment,
74
+ horizontal: alignment?.horizontalAlignment,
75
+ wrapText: alignment?.wrapText ?? undefined,
76
+ },
77
+ borders: {
78
+ top: extractBorderStyle(borders, "EdgeTop"),
79
+ bottom: extractBorderStyle(borders, "EdgeBottom"),
80
+ left: extractBorderStyle(borders, "EdgeLeft"),
81
+ right: extractBorderStyle(borders, "EdgeRight"),
82
+ insideVertical: extractBorderStyle(borders, "InsideVertical"),
83
+ insideHorizontal: extractBorderStyle(borders, "InsideHorizontal"),
84
+ diagonalDown: extractBorderStyle(borders, "DiagonalDown"),
85
+ diagonalUp: extractBorderStyle(borders, "DiagonalUp"),
86
+ },
87
+ fill: {
88
+ color: fill?.color,
89
+ },
90
+ font: {
91
+ name: font?.name,
92
+ size: font?.size,
93
+ color: font?.color,
94
+ bold: font?.bold,
95
+ italic: font?.italic,
96
+ underline: font?.underline,
97
+ },
98
+ };
99
+ function extractBorderStyle(borders, side) {
100
+ if (!borders) {
101
+ return undefined;
102
+ }
103
+ const border = borders.find((x) => x.sideIndex === side);
104
+ if (!border) {
105
+ return undefined;
106
+ }
107
+ return {
108
+ color: border.color,
109
+ style: border.style,
110
+ weight: border.weight,
111
+ };
112
+ }
113
+ }
114
+ function calculateMaxRowsPerOperation(columnCount, overwriteMaxCellsPerOperation) {
115
+ const maxCellsPerOperation = overwriteMaxCellsPerOperation ?? batch_ts_1.maxCellsPerRequest;
116
+ const maxRowsPerOperation = Math.floor(maxCellsPerOperation / columnCount);
117
+ if (maxRowsPerOperation < 1) {
118
+ throw new InvalidArgumentError_ts_1.default("maxCellsPerOperation must be greater than or equal to the number of columns in the range.");
119
+ }
120
+ return maxRowsPerOperation;
121
+ }
122
+ function scopeToRangeSelect(scope) {
123
+ if (!(scope.values || scope.text || scope.format)) {
124
+ return null;
125
+ }
126
+ return { values: scope.values ?? false, text: scope.text ?? false, numberFormat: scope.format ?? false };
127
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"iterateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;;GAQG;AACH,wBAA+B,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC,CA0DhL"}
1
+ {"version":3,"file":"iterateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;;GAQG;AACH,wBAA+B,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC;IAAE,SAAS,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,GAAG,CAAA;CAAE,CAAC,CAiEhL"}
@@ -58,6 +58,13 @@ async function* iterateWorkbookRange(rangeRef, overwriteRowsPerRequest = null) {
58
58
  text: text[r]?.[c] ?? "",
59
59
  value: values[r]?.[c] ?? "",
60
60
  format: format?.[r]?.[c] ?? "",
61
+ style: {
62
+ merge: {},
63
+ alignment: {},
64
+ borders: {},
65
+ fill: {},
66
+ font: {},
67
+ },
61
68
  }));
62
69
  yield {
63
70
  rowOffset: offset,
@@ -1 +1 @@
1
- {"version":3,"file":"readWorkbookRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/readWorkbookRows.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAOnE;;;;;;;GAOG;AACH,wBAA+B,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,wBAAwB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAmD9I"}
1
+ {"version":3,"file":"readWorkbookRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/readWorkbookRows.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAenE;;;;;;;GAOG;AACH,wBAA+B,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,wBAAwB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAoD9I"}
@@ -15,6 +15,13 @@ const addressManipulation_ts_1 = require("../services/addressManipulation.js");
15
15
  const addressOffset_ts_1 = require("../services/addressOffset.js");
16
16
  const batch_ts_1 = require("../services/batch.js");
17
17
  const workbookRange_ts_1 = require("../services/workbookRange.js");
18
+ const emptyStyle = {
19
+ merge: {},
20
+ alignment: {},
21
+ borders: {},
22
+ fill: {},
23
+ font: {},
24
+ };
18
25
  /**
19
26
  * Iterates over the rows in a given worksheet range.
20
27
  *
@@ -56,6 +63,7 @@ async function* readWorkbookRows(rangeRef, overwriteMaxRowsPerChunk = null) {
56
63
  text: text[r]?.[c] ?? "",
57
64
  value: values[r]?.[c] ?? "",
58
65
  format: numberFormat?.[r]?.[c] ?? "",
66
+ style: emptyStyle,
59
67
  }));
60
68
  yield row;
61
69
  }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Defining a border that could be on a cell.
3
+ * @experimental
4
+ * @module Border
5
+ * @category Models
6
+ */
7
+ import type { Color } from "./Color.ts";
8
+ export type Border = {
9
+ color: Color;
10
+ style: BorderType;
11
+ weight: BorderWeight;
12
+ };
13
+ export type BorderSide = "EdgeTop" | "EdgeBottom" | "EdgeLeft" | "EdgeRight" | "InsideVertical" | "InsideHorizontal" | "DiagonalDown" | "DiagonalUp";
14
+ export type BorderType = "None" | "Continuous" | "Dash" | "DashDot" | "DashDotDot" | "Dot" | "Double" | "SlantDashDot";
15
+ export type BorderWeight = "Hairline" | "Thin" | "Medium" | "Thick";
16
+ //# sourceMappingURL=Border.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Border.d.ts","sourceRoot":"","sources":["../../../src/models/Border.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,gBAAgB,GAAG,kBAAkB,GAAG,cAAc,GAAG,YAAY,CAAC;AAErJ,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,YAAY,GAAG,KAAK,GAAG,QAAQ,GAAG,cAAc,CAAC;AAEvH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,9 @@
3
3
  * @module Cell
4
4
  * @category Models
5
5
  */
6
+ import type { Border } from "./Border.ts";
7
+ import type { Color } from "./Color.ts";
8
+ import type { FontName } from "./FontName.ts";
6
9
  /**
7
10
  * Cell in a worksheet.
8
11
  * @remarks Contrary to common expectation, while a cell does contain a single value, it also contains a text representation of that value and a number format that often defines that representation.
@@ -21,17 +24,21 @@ export type Cell = {
21
24
  * Formatting that is applied to the value to derive the text representation.
22
25
  */
23
26
  format: CellFormat;
27
+ /**
28
+ * Style applied to the cell to affect its appearance, like color, borders, alignment, etc.
29
+ */
30
+ style: CellStyle;
24
31
  };
25
- /**
26
- * Text content of a cell in a worksheet.
27
- * @remarks This is a string that represents the text displayed in the cell, which may differ from the actual value of the cell (e.g., due to formatting).
28
- */
29
- export type CellText = string;
30
32
  /**
31
33
  * CellValue represents the value of a cell in a spreadsheet.
32
34
  * @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
33
35
  */
34
36
  export type CellValue = string | number | boolean;
37
+ /**
38
+ * Text content of a cell in a worksheet.
39
+ * @remarks This is a string that represents the text displayed in the cell, which may differ from the actual value of the cell (e.g., due to formatting).
40
+ */
41
+ export type CellText = string;
35
42
  /**
36
43
  * Format to be applied to a cell value to convert it to text to display to the user.
37
44
  * @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
@@ -39,4 +46,82 @@ export type CellValue = string | number | boolean;
39
46
  export type CellFormat = string & {
40
47
  __brand: "CellFormat";
41
48
  };
49
+ /**
50
+ * Style applied to the cell to affect its appearance, like color, borders, alignment, etc.
51
+ */
52
+ export type CellStyle = {
53
+ /**
54
+ * Number of cell merges (WRITE ONLY).
55
+ * @remarks Due to API limitations, this value is never populated when reading a cell, but it can be set when writing a cell.
56
+ * @experimental
57
+ */
58
+ merge: {
59
+ right?: number;
60
+ down?: number;
61
+ };
62
+ /**
63
+ * Alignment of cell contents.
64
+ * @experimental
65
+ */
66
+ alignment: {
67
+ horizontal?: CellHorizontalAlignment;
68
+ vertical?: CellVerticalAlignment;
69
+ wrapText?: boolean | undefined;
70
+ };
71
+ /**
72
+ * Borders around the cell.
73
+ * @experimental
74
+ */
75
+ borders: {
76
+ top?: Border | undefined;
77
+ bottom?: Border | undefined;
78
+ left?: Border | undefined;
79
+ right?: Border | undefined;
80
+ insideVertical?: Border | undefined;
81
+ insideHorizontal?: Border | undefined;
82
+ diagonalDown?: Border | undefined;
83
+ diagonalUp?: Border | undefined;
84
+ };
85
+ /**
86
+ * Fill color of the cell.
87
+ * @experimental
88
+ */
89
+ fill: {
90
+ color?: Color;
91
+ };
92
+ /**
93
+ * Font settings for the cell.
94
+ * @experimental
95
+ */
96
+ font: {
97
+ name?: FontName;
98
+ size?: number;
99
+ color?: Color;
100
+ bold?: boolean;
101
+ italic?: boolean;
102
+ underline?: CellUnderline;
103
+ };
104
+ };
105
+ /**
106
+ * The amount of detail that we're reading from a cell.
107
+ */
108
+ export type CellScope = {
109
+ /** Raw underlying value. Cheap to read/write (1 op per ~10K cells for values, text & format) */
110
+ values: boolean;
111
+ /** Formatted value, as presented to the user. Cheap to read/write (1 op per ~10K cells for values, text & format) */
112
+ text: boolean;
113
+ /** Logic used to format values to text. Cheap to read/write (1 op per ~10K cells for values, text & format) */
114
+ format: boolean;
115
+ /** Content position with the cell. Expensive to read/write (1 op per cell) */
116
+ alignment: boolean;
117
+ /** Cell borders. Expensive to read/write (1 op per cell) */
118
+ borders: boolean;
119
+ /** Background fill style. Expensive to read/write (1 op per cell) */
120
+ fill: boolean;
121
+ /** Text style. Expensive to read/write (1 op per cell) */
122
+ font: boolean;
123
+ };
124
+ export type CellHorizontalAlignment = "General" | "Left" | "Center" | "Right" | "Fill" | "Justify" | "CenterAcrossSelection" | "Distributed";
125
+ export type CellVerticalAlignment = "Top" | "Center" | "Bottom" | "Justify" | "Distributed";
126
+ export type CellUnderline = "None" | "Single" | "Double" | "SingleAccountant" | "DoubleAccountant";
42
127
  //# sourceMappingURL=Cell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,MAAM,MAAM,IAAI,GAAG;IAClB;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC;IAEf;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Color has a hexadecimal representation (ie #ffffff").
3
+ * @category Models
4
+ * @module Color
5
+ */
6
+ export type Color = string & {
7
+ __brand: "Color";
8
+ };
9
+ //# sourceMappingURL=Color.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../src/models/Color.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG;IAC5B,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -3,6 +3,11 @@
3
3
  * @module Column
4
4
  * @category Models
5
5
  */
6
+ import type { Cell } from "./Cell.ts";
7
+ /**
8
+ * Vertical linear sequence of cells in a worksheet.
9
+ */
10
+ export type Column = Cell[];
6
11
  /**
7
12
  * Zero-based index representing the position of a column in a range.
8
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../src/models/Column.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IACnC,OAAO,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"Column.d.ts","sourceRoot":"","sources":["../../../src/models/Column.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IACnC,OAAO,EAAE,cAAc,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;CACtB,CAAC"}
@@ -1,2 +1,6 @@
1
- // biome-ignore lint/style/useFilenamingConvention: Appropriate in this context
1
+ /**
2
+ * Column pointers.
3
+ * @module Column
4
+ * @category Models
5
+ */
2
6
  export {};
@@ -1,7 +1,17 @@
1
+ /**
2
+ * Tooling for easily creating, updating, and deleting items in a worksheet or range.
3
+ * @module DataSource
4
+ * @category Models
5
+ * @experimental
6
+ */
1
7
  import type { Cell, CellValue } from "./Cell.ts";
2
8
  import type { ColumnName } from "./Column.ts";
3
9
  import type { RowNumber, RowOffset } from "./Row.ts";
4
10
  import type { WorkbookRangeRef } from "./WorkbookRange.ts";
11
+ /**
12
+ * Defines a data source for a worksheet or range.
13
+ * @template T Type of the record, extending RecordBase.
14
+ */
5
15
  export type DataSource<T extends RecordBase> = {
6
16
  bodyRef: WorkbookRangeRef;
7
17
  bodyOffset: RowOffset;
@@ -11,11 +21,23 @@ export type DataSource<T extends RecordBase> = {
11
21
  encode: RowEncoder<T> | null;
12
22
  };
13
23
  } & AsyncIterable<Item<T>>;
24
+ /**
25
+ * Method to decode row into a record.
26
+ */
14
27
  export type RowDecoder<T extends RecordBase> = (row: DataSourceRow) => T;
28
+ /**
29
+ * Method to encode a record into a row.
30
+ */
15
31
  export type RowEncoder<T extends RecordBase> = (record: T) => DataSourceRow;
32
+ /**
33
+ * Item's position within a data source.
34
+ */
16
35
  export type ItemIndex = number & {
17
36
  __brand: "ItemIndex";
18
37
  };
38
+ /**
39
+ * Item within a data source.
40
+ */
19
41
  export type Item<T extends RecordBase> = {
20
42
  index: ItemIndex;
21
43
  rowNumber: RowNumber;
@@ -1 +1 @@
1
- {"version":3,"file":"DataSource.d.ts","sourceRoot":"","sources":["../../../src/models/DataSource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI;IAC9C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,UAAU,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,EAAE;QACP,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;KAC7B,CAAC;CACF,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3B,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,GAAG,EAAE,aAAa,KAAK,CAAC,CAAC;AACzE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC;AAE5E,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,UAAU,IAAI;IACxC,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC"}
1
+ {"version":3,"file":"DataSource.d.ts","sourceRoot":"","sources":["../../../src/models/DataSource.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI;IAC9C,OAAO,EAAE,gBAAgB,CAAC;IAC1B,UAAU,EAAE,SAAS,CAAC;IACtB,IAAI,EAAE,UAAU,EAAE,CAAC;IACnB,MAAM,EAAE;QACP,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;KAC7B,CAAC;CACF,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AAE3B;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,GAAG,EAAE,aAAa,KAAK,CAAC,CAAC;AAEzE;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,MAAM,EAAE,CAAC,KAAK,aAAa,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,IAAI,CAAC,CAAC,SAAS,UAAU,IAAI;IACxC,KAAK,EAAE,SAAS,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,CAAC,CAAC;CACV,CAAC;AAGF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AACnD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9D,MAAM,MAAM,sBAAsB,GAAG,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -1 +1,7 @@
1
+ /**
2
+ * Tooling for easily creating, updating, and deleting items in a worksheet or range.
3
+ * @module DataSource
4
+ * @category Models
5
+ * @experimental
6
+ */
1
7
  export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Name of a font.
3
+ * @category Models
4
+ * @module FontName
5
+ */
6
+ export type FontName = string & {
7
+ __brand: "FontName";
8
+ };
9
+ //# sourceMappingURL=FontName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FontName.d.ts","sourceRoot":"","sources":["../../../src/models/FontName.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC/B,OAAO,EAAE,UAAU,CAAC;CACpB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -4,6 +4,9 @@
4
4
  * @category Models
5
5
  */
6
6
  import type { Cell } from "./Cell.ts";
7
+ /**
8
+ * Horizontal linear sequence of cells in a worksheet.
9
+ */
7
10
  export type Row = Cell[];
8
11
  /**
9
12
  * Row number as it appears in Excel.
@@ -1 +1 @@
1
- {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/models/Row.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC;AAEzB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC"}
1
+ {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/models/Row.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEtC;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC;AAEzB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAChC,OAAO,EAAE,WAAW,CAAC;CACrB,CAAC"}
@@ -9,8 +9,13 @@ import type { WorkbookRangeRef } from "../../models/WorkbookRange.ts";
9
9
  /**
10
10
  * Fetch a range.
11
11
  * @param rangeRef Reference to the range to be fetched.
12
+ * @param select Optional parameters to select specific properties of the range.
12
13
  * @returns The fetched range, including values and formatting
13
14
  * @see https://learn.microsoft.com/en-us/graph/api/range-get
14
15
  */
15
- export default function getWorkbookWorksheetRange(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRange & WorkbookRangeRef>;
16
+ export default function getWorkbookWorksheetRange(rangeRef: WorkbookRangeRef, select?: {
17
+ values?: boolean;
18
+ text?: boolean;
19
+ numberFormat?: boolean;
20
+ }): GraphOperation<WorkbookRange & WorkbookRangeRef>;
16
21
  //# sourceMappingURL=getWorkbookWorksheetRange.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAoB9H"}
1
+ {"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CA2BrM"}
@@ -9,15 +9,22 @@ import { generatePath } from "../../services/templatedPaths.js";
9
9
  /**
10
10
  * Fetch a range.
11
11
  * @param rangeRef Reference to the range to be fetched.
12
+ * @param select Optional parameters to select specific properties of the range.
12
13
  * @returns The fetched range, including values and formatting
13
14
  * @see https://learn.microsoft.com/en-us/graph/api/range-get
14
15
  */
15
- export default function getWorkbookWorksheetRange(rangeRef) {
16
+ export default function getWorkbookWorksheetRange(rangeRef, select) {
16
17
  const address = normalizeAddress(rangeRef.address, true);
18
+ const selectString = select
19
+ ? Object.entries(select)
20
+ .map(([k, v]) => (v ? k : undefined))
21
+ .filter((v) => !!v)
22
+ .join(",")
23
+ : null;
17
24
  return operation({
18
25
  context: rangeRef.context,
19
26
  method: "GET",
20
- path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
27
+ path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')?$select=${selectString}`, rangeRef),
21
28
  headers: {
22
29
  "workbook-session-id": rangeRef.sessionId,
23
30
  },
@@ -0,0 +1,16 @@
1
+ /**
2
+ * List the borders of a range.
3
+ * @module listWorkbookRangeBorders
4
+ * @category Operations
5
+ */
6
+ import type { WorkbookRangeBorder } from "@microsoft/microsoft-graph-types";
7
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
8
+ import type { WorkbookRangeRef } from "../../models/WorkbookRange.ts";
9
+ /**
10
+ * List the borders of a range.
11
+ * @param rangeRef Reference to the range whose borders will be listed.
12
+ * @returns Array of borders for the specified range.
13
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeborder-list
14
+ */
15
+ export default function listWorkbookRangeBorders(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeBorder[]>;
16
+ //# sourceMappingURL=listWorkbookRangeBorders.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listWorkbookRangeBorders.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/listWorkbookRangeBorders.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,mBAAmB,EAAE,CAAC,CAelH"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * List the borders of a range.
3
+ * @module listWorkbookRangeBorders
4
+ * @category Operations
5
+ */
6
+ import { normalizeAddress } from "../../services/addressManipulation.js";
7
+ import { operation } from "../../services/operationInvoker.js";
8
+ import { generatePath } from "../../services/templatedPaths.js";
9
+ /**
10
+ * List the borders of a range.
11
+ * @param rangeRef Reference to the range whose borders will be listed.
12
+ * @returns Array of borders for the specified range.
13
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeborder-list
14
+ */
15
+ export default function listWorkbookRangeBorders(rangeRef) {
16
+ const address = normalizeAddress(rangeRef.address, true);
17
+ return operation({
18
+ context: rangeRef.context,
19
+ method: "GET",
20
+ path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/borders`, rangeRef),
21
+ headers: {
22
+ "workbook-session-id": rangeRef.sessionId,
23
+ },
24
+ body: null,
25
+ responseTransform: (response) => {
26
+ const typed = response;
27
+ return typed.value;
28
+ },
29
+ });
30
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Update a specific border of a workbook range.
3
+ * @module setWorkbookRangeBorder
4
+ * @category Operations
5
+ */
6
+ import type { WorkbookRangeBorder } from "@microsoft/microsoft-graph-types";
7
+ import type { Border, BorderSide } from "../../models/Border.ts";
8
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
9
+ import type { WorkbookRangeRef } from "../../models/WorkbookRange.ts";
10
+ /**
11
+ * Update a specific border of a workbook range.
12
+ * @param rangeRef Reference to the range whose border will be updated.
13
+ * @param side The border side to update (e.g., "EdgeTop", "EdgeBottom", "EdgeLeft", "EdgeRight", "InsideHorizontal", "InsideVertical").
14
+ * @param values Partial border object to update (color, style, weight, etc.).
15
+ * @returns The updated border for the specified range and side.
16
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeborder-update
17
+ */
18
+ export default function setWorkbookRangeBorder(rangeRef: WorkbookRangeRef, side: BorderSide, values: Partial<Border>): GraphOperation<WorkbookRangeBorder & WorkbookRangeRef>;
19
+ //# sourceMappingURL=setWorkbookRangeBorder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeBorder.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeBorder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAKtE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAwB5K"}