microsoft-graph 2.32.0 → 2.33.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 (61) hide show
  1. package/dist/cjs/models/Cell.d.ts +24 -33
  2. package/dist/cjs/models/Cell.d.ts.map +1 -1
  3. package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
  4. package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js +1 -0
  5. package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
  6. package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.js +1 -5
  7. package/dist/cjs/services/dataSource.js +5 -7
  8. package/dist/cjs/services/stringCaseConversion.d.ts +6 -0
  9. package/dist/cjs/services/stringCaseConversion.d.ts.map +1 -1
  10. package/dist/cjs/services/stringCaseConversion.js +12 -0
  11. package/dist/cjs/tasks/iterateRows.d.ts +0 -1
  12. package/dist/cjs/tasks/iterateRows.d.ts.map +1 -1
  13. package/dist/cjs/tasks/iterateRows.js +57 -37
  14. package/dist/cjs/tasks/iterateWorkbookRange.d.ts.map +1 -1
  15. package/dist/cjs/tasks/iterateWorkbookRange.js +5 -7
  16. package/dist/cjs/tasks/readWorkbookRows.d.ts.map +1 -1
  17. package/dist/cjs/tasks/readWorkbookRows.js +5 -8
  18. package/dist/cjs/tasks/updateFirstRow.d.ts +26 -0
  19. package/dist/cjs/tasks/updateFirstRow.d.ts.map +1 -0
  20. package/dist/cjs/tasks/updateFirstRow.js +33 -0
  21. package/dist/cjs/tasks/updateRows.d.ts +26 -0
  22. package/dist/cjs/tasks/updateRows.d.ts.map +1 -0
  23. package/dist/cjs/tasks/updateRows.js +255 -0
  24. package/dist/cjs/tasks/writeWorkbookRows.js +4 -4
  25. package/dist/esm/models/Cell.d.ts +24 -33
  26. package/dist/esm/models/Cell.d.ts.map +1 -1
  27. package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
  28. package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.js +1 -0
  29. package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
  30. package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.js +1 -5
  31. package/dist/esm/services/dataSource.js +5 -7
  32. package/dist/esm/services/stringCaseConversion.d.ts +6 -0
  33. package/dist/esm/services/stringCaseConversion.d.ts.map +1 -1
  34. package/dist/esm/services/stringCaseConversion.js +11 -0
  35. package/dist/esm/tasks/iterateRows.d.ts +0 -1
  36. package/dist/esm/tasks/iterateRows.d.ts.map +1 -1
  37. package/dist/esm/tasks/iterateRows.js +57 -37
  38. package/dist/esm/tasks/iterateWorkbookRange.d.ts.map +1 -1
  39. package/dist/esm/tasks/iterateWorkbookRange.js +5 -7
  40. package/dist/esm/tasks/readWorkbookRows.d.ts.map +1 -1
  41. package/dist/esm/tasks/readWorkbookRows.js +5 -8
  42. package/dist/esm/tasks/updateFirstRow.d.ts +26 -0
  43. package/dist/esm/tasks/updateFirstRow.d.ts.map +1 -0
  44. package/dist/esm/tasks/updateFirstRow.js +27 -0
  45. package/dist/esm/tasks/updateRows.d.ts +26 -0
  46. package/dist/esm/tasks/updateRows.d.ts.map +1 -0
  47. package/dist/esm/tasks/updateRows.js +249 -0
  48. package/dist/esm/tasks/writeWorkbookRows.js +4 -4
  49. package/docs/api/Cell.md +39 -55
  50. package/docs/api/CellFormat.md +5 -5
  51. package/docs/api/README.md +2 -0
  52. package/docs/api/getWorkbookRangeFormat.md +1 -1
  53. package/docs/api/getWorkbookWorksheetRange.md +1 -1
  54. package/docs/api/iterateRows.md +1 -5
  55. package/docs/api/readFirstRow.md +1 -1
  56. package/docs/api/readRows.md +1 -1
  57. package/docs/api/readWorkbookRows.md +1 -1
  58. package/docs/api/stringCaseConversion.md +22 -0
  59. package/docs/api/updateFirstRow.md +45 -0
  60. package/docs/api/updateRows.md +51 -0
  61. package/package.json +51 -1
@@ -24,32 +24,6 @@ export type Cell = {
24
24
  * Formatting that is applied to the value to derive the text representation.
25
25
  */
26
26
  format: CellFormat;
27
- /**
28
- * Style applied to the cell to affect its appearance, like color, borders, alignment, etc.
29
- */
30
- style: CellStyle;
31
- };
32
- /**
33
- * CellValue represents the value of a cell in a spreadsheet.
34
- * @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
35
- */
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;
42
- /**
43
- * Format to be applied to a cell value to convert it to text to display to the user.
44
- * @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
45
- */
46
- export type CellFormat = string & {
47
- __brand: "CellFormat";
48
- };
49
- /**
50
- * Style applied to the cell to affect its appearance, like color, borders, alignment, etc.
51
- */
52
- export type CellStyle = {
53
27
  /**
54
28
  * Number of cell merges (WRITE ONLY).
55
29
  * @remarks Due to API limitations, this value is never populated when reading a cell, but it can be set when writing a cell.
@@ -73,10 +47,10 @@ export type CellStyle = {
73
47
  * @experimental
74
48
  */
75
49
  borders: {
76
- top?: Border | undefined;
77
- bottom?: Border | undefined;
78
- left?: Border | undefined;
79
- right?: Border | undefined;
50
+ edgeTop?: Border | undefined;
51
+ edgeBottom?: Border | undefined;
52
+ edgeLeft?: Border | undefined;
53
+ edgeRight?: Border | undefined;
80
54
  insideVertical?: Border | undefined;
81
55
  insideHorizontal?: Border | undefined;
82
56
  diagonalDown?: Border | undefined;
@@ -102,15 +76,32 @@ export type CellStyle = {
102
76
  underline?: CellUnderline;
103
77
  };
104
78
  };
79
+ /**
80
+ * CellValue represents the value of a cell in a spreadsheet.
81
+ * @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
82
+ */
83
+ export type CellValue = string | number | boolean;
84
+ /**
85
+ * Text content of a cell in a worksheet.
86
+ * @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).
87
+ */
88
+ export type CellText = string;
89
+ /**
90
+ * Format to be applied to a cell value to convert it to text to display to the user.
91
+ * @see {@link Cell} for a more comprehensive representation of a cell, which includes text and formatting.
92
+ */
93
+ export type CellFormat = string & {
94
+ __brand: "CellFormat";
95
+ };
105
96
  /**
106
97
  * The amount of detail that we're reading from a cell.
107
98
  */
108
99
  export type CellScope = {
109
- /** Raw cell value. CHEAP (~1 op per 10K cells, no additional op with `text` or `format`) */
100
+ /** Raw cell value. CHEAP (+1 op per 10K cells, no additional op with `text` or `format`) */
110
101
  values: boolean;
111
- /** Formatted value, as presented to the user. CHEAP (~1 op per 10K cells, no additional call op `values` or `format`) */
102
+ /** Formatted value, as presented to the user. CHEAP (+1 op per 10K cells, no additional call op `values` or `format`) */
112
103
  text: boolean;
113
- /** Logic used to format values to text. CHEAP (~1 op per 10K cells, no additional call op `values` or `text`) */
104
+ /** Logic used to format values to text. CHEAP (+1 op per 10K cells, no additional call op `values` or `text`) */
114
105
  format: boolean;
115
106
  /** Content position with the cell. VERY EXPENSIVE (+1 op per cell) */
116
107
  alignment: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;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;IAEnB;;OAEG;IACH,KAAK,EAAE,SAAS,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GA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AAC;CACtB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,4FAA4F;IAC5F,MAAM,EAAE,OAAO,CAAC;IAEhB,yHAAyH;IACzH,IAAI,EAAE,OAAO,CAAC;IAEd,iHAAiH;IACjH,MAAM,EAAE,OAAO,CAAC;IAEhB,sEAAsE;IACtE,SAAS,EAAE,OAAO,CAAC;IAEnB,qDAAqD;IACrD,OAAO,EAAE,OAAO,CAAC;IAEjB,8DAA8D;IAC9D,IAAI,EAAE,OAAO,CAAC;IAEd,kDAAkD;IAClD,IAAI,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,GAAG,uBAAuB,GAAG,aAAa,CAAC;AAE7I,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,aAAa,CAAC;AAE5F,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,kBAAkB,GAAG,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.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,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAmBjI"}
1
+ {"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"AACA;;;;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,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAmBjI"}
@@ -1,4 +1,5 @@
1
1
  "use strict";
2
+ // TODO: Rename to getWorkbookRangeAlignment
2
3
  /**
3
4
  * Retrieve the format of a workbook range.
4
5
  * @module getWorkbookRangeFormat
@@ -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;;;;;;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"}
1
+ {"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAEA;;;;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"}
@@ -1,9 +1,5 @@
1
1
  "use strict";
2
- /**
3
- * Fetch a range.
4
- * @module getWorkbookWorksheetRange
5
- * @category Operations
6
- */
2
+ // TODO: Rename to getWorkbookRangeValueTextFormat
7
3
  Object.defineProperty(exports, "__esModule", { value: true });
8
4
  exports.default = getWorkbookWorksheetRange;
9
5
  const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
@@ -174,13 +174,11 @@ function recordToRow(record, source) {
174
174
  value: cell.value ?? "",
175
175
  text: cell.text ?? (cell.value ?? "").toString(),
176
176
  format: cell.format ?? cell_ts_1.generalCellFormat,
177
- style: {
178
- merge: {},
179
- alignment: {},
180
- borders: {},
181
- fill: {},
182
- font: {},
183
- },
177
+ merge: {},
178
+ alignment: {},
179
+ borders: {},
180
+ fill: {},
181
+ font: {},
184
182
  };
185
183
  });
186
184
  return row;
@@ -9,4 +9,10 @@
9
9
  * @returns The camelCase string.
10
10
  */
11
11
  export declare function kebabToCamelCase(str: string): string;
12
+ /**
13
+ * Converts a camelCase string to PascalCase.
14
+ * @param str - The camelCase string.
15
+ * @returns The PascalCase string.
16
+ */
17
+ export declare function camelCaseToPascalCase(str: string): string;
12
18
  //# sourceMappingURL=stringCaseConversion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stringCaseConversion.d.ts","sourceRoot":"","sources":["../../../src/services/stringCaseConversion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIpD"}
1
+ {"version":3,"file":"stringCaseConversion.d.ts","sourceRoot":"","sources":["../../../src/services/stringCaseConversion.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAIpD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKzD"}
@@ -6,6 +6,7 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.kebabToCamelCase = kebabToCamelCase;
9
+ exports.camelCaseToPascalCase = camelCaseToPascalCase;
9
10
  /**
10
11
  * Converts a kebab-case string to camelCase.
11
12
  * @param str - The kebab-case string.
@@ -16,3 +17,14 @@ function kebabToCamelCase(str) {
16
17
  .replace(/^-+|-+$/g, "") // Remove leading and trailing dashes
17
18
  .replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
18
19
  }
20
+ /**
21
+ * Converts a camelCase string to PascalCase.
22
+ * @param str - The camelCase string.
23
+ * @returns The PascalCase string.
24
+ */
25
+ function camelCaseToPascalCase(str) {
26
+ if (!str) {
27
+ return str;
28
+ }
29
+ return str.charAt(0).toUpperCase() + str.slice(1);
30
+ }
@@ -25,7 +25,6 @@ export type IteratedRow = {
25
25
  * @param rangeRef Reference to the workbook range to iterate over.
26
26
  * @param scope Amount of detail to include for each cell.
27
27
  * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
28
- * @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
29
28
  * @experimental
30
29
  * @example
31
30
  * for await (const { row } of iterateRows(rangeRef)) {
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"iterateRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateRows.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,IAAI,EAAuC,SAAS,EAA6D,MAAM,mBAAmB,CAAC;AAIzJ,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;;;;;;;;;;GAUG;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,CAgDnL"}
@@ -24,7 +24,6 @@ const cell_ts_1 = require("../services/cell.js");
24
24
  * @param rangeRef Reference to the workbook range to iterate over.
25
25
  * @param scope Amount of detail to include for each cell.
26
26
  * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
27
- * @remarks Including `style` in the scope requires over three operations for each and every cell. Use this sparingly!
28
27
  * @experimental
29
28
  * @example
30
29
  * for await (const { row } of iterateRows(rangeRef)) {
@@ -46,12 +45,20 @@ async function* iterateRows(rangeRef, scope = cell_ts_1.defaultCellScope, maxCel
46
45
  const value = (range?.values?.[operationRowOffset]?.[columnOffset] ?? ""); // The root of these is undefined if that detail isn't in scope
47
46
  const text = (range?.text?.[operationRowOffset]?.[columnOffset] ?? "");
48
47
  const format = (range?.numberFormat?.[operationRowOffset]?.[columnOffset] ?? "");
49
- const style = await getStyle((0, addressManipulation_ts_1.subRange)(rangeRef, operationRowOffset, 1, columnOffset, 1), scope); // This line is potentially expensive
48
+ const merge = {}; // No API available to retrieve merge information
49
+ const alignment = await getAlignment(rangeRef, scope);
50
+ const borders = await getBorders(rangeRef, scope);
51
+ const fill = await getFill(rangeRef, scope);
52
+ const font = await getFont(rangeRef, scope);
50
53
  cells.push({
51
54
  value,
52
55
  text,
53
56
  format,
54
- style,
57
+ merge,
58
+ alignment,
59
+ borders,
60
+ fill,
61
+ font,
55
62
  });
56
63
  }
57
64
  const offset = (operationRowStart + operationRowOffset);
@@ -66,41 +73,43 @@ async function* iterateRows(rangeRef, scope = cell_ts_1.defaultCellScope, maxCel
66
73
  }
67
74
  }
68
75
  }
69
- async function getStyle(rangeRef, scope) {
70
- const alignment = scope.alignment ? await (0, getWorkbookRangeFormat_ts_1.default)(rangeRef) : null;
71
- const borders = scope.borders ? await (0, listWorkbookRangeBorders_ts_1.default)(rangeRef) : null;
72
- const fill = scope.fill ? await (0, getWorkbookRangeFill_ts_1.default)(rangeRef) : null;
73
- const font = scope.font ? await (0, getWorkbookRangeFont_ts_1.default)(rangeRef) : null;
76
+ async function getFont(rangeRef, scope) {
77
+ if (!scope.font) {
78
+ return {};
79
+ }
80
+ const response = await (0, getWorkbookRangeFont_ts_1.default)(rangeRef);
74
81
  return {
75
- merge: {
76
- /* Not provided by API */
77
- },
78
- alignment: {
79
- vertical: alignment?.verticalAlignment,
80
- horizontal: alignment?.horizontalAlignment,
81
- wrapText: alignment?.wrapText ?? undefined,
82
- },
83
- borders: {
84
- top: extractBorderStyle(borders, "EdgeTop"),
85
- bottom: extractBorderStyle(borders, "EdgeBottom"),
86
- left: extractBorderStyle(borders, "EdgeLeft"),
87
- right: extractBorderStyle(borders, "EdgeRight"),
88
- insideVertical: extractBorderStyle(borders, "InsideVertical"),
89
- insideHorizontal: extractBorderStyle(borders, "InsideHorizontal"),
90
- diagonalDown: extractBorderStyle(borders, "DiagonalDown"),
91
- diagonalUp: extractBorderStyle(borders, "DiagonalUp"),
92
- },
93
- fill: {
94
- color: fill?.color,
95
- },
96
- font: {
97
- name: font?.name,
98
- size: font?.size,
99
- color: font?.color,
100
- bold: font?.bold,
101
- italic: font?.italic,
102
- underline: font?.underline,
103
- },
82
+ name: response?.name,
83
+ size: response?.size,
84
+ color: response?.color,
85
+ bold: response?.bold,
86
+ italic: response?.italic,
87
+ underline: response?.underline,
88
+ };
89
+ }
90
+ async function getFill(rangeRef, scope) {
91
+ if (!scope.fill) {
92
+ return {};
93
+ }
94
+ const response = await (0, getWorkbookRangeFill_ts_1.default)(rangeRef);
95
+ return {
96
+ color: response?.color,
97
+ };
98
+ }
99
+ async function getBorders(rangeRef, scope) {
100
+ if (!scope.borders) {
101
+ return {};
102
+ }
103
+ const response = await (0, listWorkbookRangeBorders_ts_1.default)(rangeRef);
104
+ return {
105
+ edgeTop: extractBorderStyle(response, "EdgeTop"),
106
+ edgeBottom: extractBorderStyle(response, "EdgeBottom"),
107
+ edgeLeft: extractBorderStyle(response, "EdgeLeft"),
108
+ edgeRight: extractBorderStyle(response, "EdgeRight"),
109
+ insideVertical: extractBorderStyle(response, "InsideVertical"),
110
+ insideHorizontal: extractBorderStyle(response, "InsideHorizontal"),
111
+ diagonalDown: extractBorderStyle(response, "DiagonalDown"),
112
+ diagonalUp: extractBorderStyle(response, "DiagonalUp"),
104
113
  };
105
114
  function extractBorderStyle(borders, side) {
106
115
  if (!borders) {
@@ -117,6 +126,17 @@ async function getStyle(rangeRef, scope) {
117
126
  };
118
127
  }
119
128
  }
129
+ async function getAlignment(rangeRef, scope) {
130
+ if (!scope.alignment) {
131
+ return {};
132
+ }
133
+ const response = await (0, getWorkbookRangeFormat_ts_1.default)(rangeRef);
134
+ return {
135
+ vertical: response?.verticalAlignment,
136
+ horizontal: response?.horizontalAlignment,
137
+ wrapText: response?.wrapText ?? undefined,
138
+ };
139
+ }
120
140
  function calculateMaxRowsPerOperation(columnCount, overwriteMaxCellsPerOperation) {
121
141
  const maxCellsPerOperation = overwriteMaxCellsPerOperation ?? batch_ts_1.maxCellsPerRequest;
122
142
  const maxRowsPerOperation = Math.floor(maxCellsPerOperation / columnCount);
@@ -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,CAiEhL"}
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,CA+DhL"}
@@ -58,13 +58,11 @@ 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
+ merge: {},
62
+ alignment: {},
63
+ borders: {},
64
+ fill: {},
65
+ font: {},
68
66
  }));
69
67
  yield {
70
68
  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;AAenE;;;;;;;GAOG;AACH,wBAA+B,gBAAgB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,wBAAwB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,GAAG,CAAC,CAoD9I"}
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,CAwD9I"}
@@ -15,13 +15,6 @@ 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
- };
25
18
  /**
26
19
  * Iterates over the rows in a given worksheet range.
27
20
  *
@@ -63,7 +56,11 @@ async function* readWorkbookRows(rangeRef, overwriteMaxRowsPerChunk = null) {
63
56
  text: text[r]?.[c] ?? "",
64
57
  value: values[r]?.[c] ?? "",
65
58
  format: numberFormat?.[r]?.[c] ?? "",
66
- style: emptyStyle,
59
+ merge: {},
60
+ alignment: {},
61
+ borders: {},
62
+ fill: {},
63
+ font: {},
67
64
  }));
68
65
  yield row;
69
66
  }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Update first row in a given workbook range.
3
+ * @module updateFirstRow
4
+ * @category Tasks
5
+ * @experimental
6
+ */
7
+ import type { Cell } from "../models/Cell.ts";
8
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
9
+ /**
10
+ * Update first row in a given workbook range.
11
+ * @param originRef Reference to the workbook range to update. Only the upper-left cell is used as an origin point.
12
+ * @param cells Array of arrays of cells to update in the specified range.
13
+ * @remarks `undefined` values are left unchanged. Applying styling to cells is slow, use sparingly.
14
+ * @experimental
15
+ * @example
16
+ * // Basic example:
17
+ * await updateFirstRow(rangeRef, [{ value: 1 }, { value: 2 }]);
18
+ *
19
+ * // Advanced example with cell formatting:
20
+ * await updateRows(rangeRef, [
21
+ * { value: "Column A", style: { alignment: { horizontal: "Right" }, font: { bold: true } } },
22
+ * { value: "Column B", style: { alignment: { horizontal: "Right" }, font: { bold: true } } }
23
+ * ]);
24
+ */
25
+ export default function updateFirstRow(originRef: WorkbookRangeRef, cells: Partial<Cell>[]): Promise<void>;
26
+ //# sourceMappingURL=updateFirstRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateFirstRow.d.ts","sourceRoot":"","sources":["../../../src/tasks/updateFirstRow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAGnE;;;;;;;;;;;;;;;GAeG;AACH,wBAA8B,cAAc,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/G"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * Update first row in a given workbook range.
4
+ * @module updateFirstRow
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.default = updateFirstRow;
13
+ const updateRows_ts_1 = __importDefault(require("./updateRows.js"));
14
+ /**
15
+ * Update first row in a given workbook range.
16
+ * @param originRef Reference to the workbook range to update. Only the upper-left cell is used as an origin point.
17
+ * @param cells Array of arrays of cells to update in the specified range.
18
+ * @remarks `undefined` values are left unchanged. Applying styling to cells is slow, use sparingly.
19
+ * @experimental
20
+ * @example
21
+ * // Basic example:
22
+ * await updateFirstRow(rangeRef, [{ value: 1 }, { value: 2 }]);
23
+ *
24
+ * // Advanced example with cell formatting:
25
+ * await updateRows(rangeRef, [
26
+ * { value: "Column A", style: { alignment: { horizontal: "Right" }, font: { bold: true } } },
27
+ * { value: "Column B", style: { alignment: { horizontal: "Right" }, font: { bold: true } } }
28
+ * ]);
29
+ */
30
+ async function updateFirstRow(originRef, cells) {
31
+ const rows = [cells];
32
+ await (0, updateRows_ts_1.default)(originRef, rows);
33
+ }
@@ -0,0 +1,26 @@
1
+ import type { Cell } from "../models/Cell.ts";
2
+ import type { WorkbookRangeRef } from "../models/WorkbookRange.ts";
3
+ /**
4
+ * Update rows in a given workbook range.
5
+ * @param originRef Reference to the workbook range to update. Only the upper-left cell is used as an origin point.
6
+ * @param cells Array of arrays of cells to update in the specified range.
7
+ * @param maxCellsPerOperation Prescribe max cells to retrieve per operation. `null` automatically determines value. DO NOT SET EXCEPT FOR ADVANCED TUNING.
8
+ * @remarks `undefined` values are left unchanged. Applying styling to cells is slow, use sparingly.
9
+ * @experimental
10
+ * @example
11
+ * // Basic example:
12
+ * await updateRows(rangeRef, [
13
+ * [{ value: 1 }, { value: 2 }],
14
+ * [{ value: 3 }, { value: 4 }],
15
+ * [{ value: 5 }, { value: 6 }],
16
+ * ]);
17
+ *
18
+ * // Advanced example with cell formatting:
19
+ * await updateRows(rangeRef, [
20
+ * [{ value: "Column A", style: { alignment: { horizontal: "Right" }, font: { bold: true } } }, { value: "Column B", style: { alignment: { horizontal: "Right" }, font: { bold: true } } }],
21
+ * [{ value: 1, format: accountingCellFormat }, { value: "A" }],
22
+ * [{ value: 2, format: accountingCellFormat }, { value: "B" }],
23
+ * ]);
24
+ */
25
+ export default function updateRows(originRef: WorkbookRangeRef, cells: Iterable<Partial<Cell>[]> | AsyncIterable<Partial<Cell>[]>, maxCellsPerOperation?: number | null): Promise<void>;
26
+ //# sourceMappingURL=updateRows.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateRows.d.ts","sourceRoot":"","sources":["../../../src/tasks/updateRows.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAWnE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAA8B,UAAU,CAAC,SAAS,EAAE,gBAAgB,EAAE,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,oBAAoB,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAwBlM"}