microsoft-graph 2.7.7 → 2.8.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 (49) hide show
  1. package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts +11 -0
  2. package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts.map +1 -0
  3. package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js +24 -0
  4. package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.d.ts +12 -0
  5. package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.d.ts.map +1 -0
  6. package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.js +31 -0
  7. package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.d.ts +12 -0
  8. package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.d.ts.map +1 -0
  9. package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.js +31 -0
  10. package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.d.ts +12 -0
  11. package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.d.ts.map +1 -0
  12. package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.js +25 -0
  13. package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.d.ts +12 -0
  14. package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.d.ts.map +1 -0
  15. package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.js +25 -0
  16. package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.d.ts +12 -0
  17. package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.d.ts.map +1 -0
  18. package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js +28 -0
  19. package/dist/cjs/services/cartesianAddress.d.ts +12 -0
  20. package/dist/cjs/services/cartesianAddress.d.ts.map +1 -1
  21. package/dist/cjs/services/cartesianAddress.js +12 -0
  22. package/dist/cjs/services/rangeManipulation.d.ts +28 -0
  23. package/dist/cjs/services/rangeManipulation.d.ts.map +1 -0
  24. package/dist/cjs/services/rangeManipulation.js +78 -0
  25. package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts +11 -0
  26. package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts.map +1 -0
  27. package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js +21 -0
  28. package/dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts +12 -0
  29. package/dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts.map +1 -0
  30. package/dist/esm/operations/workbookRange/getWorkbookRangeFill.js +28 -0
  31. package/dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts +12 -0
  32. package/dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts.map +1 -0
  33. package/dist/esm/operations/workbookRange/getWorkbookRangeFont.js +28 -0
  34. package/dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts +12 -0
  35. package/dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts.map +1 -0
  36. package/dist/esm/operations/workbookRange/setWorkbookRangeFill.js +22 -0
  37. package/dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts +12 -0
  38. package/dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts.map +1 -0
  39. package/dist/esm/operations/workbookRange/setWorkbookRangeFont.js +22 -0
  40. package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts +12 -0
  41. package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts.map +1 -0
  42. package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.js +25 -0
  43. package/dist/esm/services/cartesianAddress.d.ts +12 -0
  44. package/dist/esm/services/cartesianAddress.d.ts.map +1 -1
  45. package/dist/esm/services/cartesianAddress.js +12 -0
  46. package/dist/esm/services/rangeManipulation.d.ts +28 -0
  47. package/dist/esm/services/rangeManipulation.d.ts.map +1 -0
  48. package/dist/esm/services/rangeManipulation.js +70 -0
  49. package/package.json +71 -1
@@ -0,0 +1,11 @@
1
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
2
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
3
+ /**
4
+ * Autofit the columns in a range.
5
+ *
6
+ * @param rangeRef - A reference to the range, optionally including session information.
7
+ * @returns Nothing.
8
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
9
+ */
10
+ export default function autoFitWorkbookRangeColumns(rangeRef: WorkbookRangeRef): GraphOperation<void>;
11
+ //# sourceMappingURL=autoFitWorkbookRangeColumns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoFitWorkbookRangeColumns.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/autoFitWorkbookRangeColumns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAWpG"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = autoFitWorkbookRangeColumns;
4
+ const graphApi_ts_1 = require("../../graphApi.js");
5
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
6
+ /**
7
+ * Autofit the columns in a range.
8
+ *
9
+ * @param rangeRef - A reference to the range, optionally including session information.
10
+ * @returns Nothing.
11
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
12
+ */
13
+ function autoFitWorkbookRangeColumns(rangeRef) {
14
+ return (0, graphApi_ts_1.operation)({
15
+ contextId: rangeRef.contextId,
16
+ method: "POST",
17
+ path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/autofitcolumns", rangeRef),
18
+ headers: {
19
+ "workbook-session-id": rangeRef.sessionId,
20
+ },
21
+ body: null,
22
+ responseTransform: () => undefined,
23
+ });
24
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Retrieve the fill format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range, optionally including session information.
8
+ * @returns The fill format of the specified range, including its metadata and reference information.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
10
+ */
11
+ export default function getWorkbookRangeFill(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFill & WorkbookRangeRef>;
12
+ //# sourceMappingURL=getWorkbookRangeFill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFill.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // https://learn.microsoft.com/en-us/graph/api/rangefill-get
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.default = getWorkbookRangeFill;
5
+ const graphApi_ts_1 = require("../../graphApi.js");
6
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
7
+ /**
8
+ * Retrieve the fill format of a workbook range.
9
+ *
10
+ * @param rangeRef - A reference to the range, optionally including session information.
11
+ * @returns The fill format of the specified range, including its metadata and reference information.
12
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
13
+ */
14
+ function getWorkbookRangeFill(rangeRef) {
15
+ return (0, graphApi_ts_1.operation)({
16
+ contextId: rangeRef.contextId,
17
+ method: "GET",
18
+ path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/fill`, rangeRef),
19
+ headers: {
20
+ "workbook-session-id": rangeRef.sessionId,
21
+ },
22
+ body: null,
23
+ responseTransform: (response) => {
24
+ const fill = response;
25
+ return {
26
+ ...fill,
27
+ ...rangeRef,
28
+ };
29
+ },
30
+ });
31
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Retrieve the font format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range, optionally including session information.
8
+ * @returns The font format of the specified range, including its metadata and reference information.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
10
+ */
11
+ export default function getWorkbookRangeFont(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFont & WorkbookRangeRef>;
12
+ //# sourceMappingURL=getWorkbookRangeFont.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFont.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // https://learn.microsoft.com/en-us/graph/api/rangefont-get
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.default = getWorkbookRangeFont;
5
+ const graphApi_ts_1 = require("../../graphApi.js");
6
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
7
+ /**
8
+ * Retrieve the font format of a workbook range.
9
+ *
10
+ * @param rangeRef - A reference to the range, optionally including session information.
11
+ * @returns The font format of the specified range, including its metadata and reference information.
12
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
13
+ */
14
+ function getWorkbookRangeFont(rangeRef) {
15
+ return (0, graphApi_ts_1.operation)({
16
+ contextId: rangeRef.contextId,
17
+ method: "GET",
18
+ path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/font`, rangeRef),
19
+ headers: {
20
+ "workbook-session-id": rangeRef.sessionId,
21
+ },
22
+ body: null,
23
+ responseTransform: (response) => {
24
+ const font = response;
25
+ return {
26
+ ...font,
27
+ ...rangeRef,
28
+ };
29
+ },
30
+ });
31
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Update the fill format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
8
+ * @param format - The fill format properties to apply to the range.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
10
+ */
11
+ export default function setWorkbookRangeFill(rangeRef: WorkbookRangeRef, format: WorkbookRangeFill): GraphOperation<void>;
12
+ //# sourceMappingURL=setWorkbookRangeFill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = setWorkbookRangeFill;
4
+ const graphApi_ts_1 = require("../../graphApi.js");
5
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
6
+ /**
7
+ * Update the fill format of a workbook range.
8
+ *
9
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
10
+ * @param format - The fill format properties to apply to the range.
11
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
12
+ */
13
+ function setWorkbookRangeFill(rangeRef, format) {
14
+ return (0, graphApi_ts_1.operation)({
15
+ contextId: rangeRef.contextId,
16
+ method: "PATCH",
17
+ path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/fill", rangeRef),
18
+ headers: {
19
+ "workbook-session-id": rangeRef.sessionId,
20
+ "content-type": "application/json",
21
+ },
22
+ body: format,
23
+ responseTransform: () => undefined,
24
+ });
25
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Update the font format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
8
+ * @param format - The font format properties to apply to the range.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
10
+ */
11
+ export default function setWorkbookRangeFont(rangeRef: WorkbookRangeRef, format: WorkbookRangeFont): GraphOperation<void>;
12
+ //# sourceMappingURL=setWorkbookRangeFont.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFont.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = setWorkbookRangeFont;
4
+ const graphApi_ts_1 = require("../../graphApi.js");
5
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
6
+ /**
7
+ * Update the font format of a workbook range.
8
+ *
9
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
10
+ * @param format - The font format properties to apply to the range.
11
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
12
+ */
13
+ function setWorkbookRangeFont(rangeRef, format) {
14
+ return (0, graphApi_ts_1.operation)({
15
+ contextId: rangeRef.contextId,
16
+ method: "PATCH",
17
+ path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/font", rangeRef),
18
+ headers: {
19
+ "workbook-session-id": rangeRef.sessionId,
20
+ "content-type": "application/json",
21
+ },
22
+ body: format,
23
+ responseTransform: () => undefined,
24
+ });
25
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFormat } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Update the general format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
8
+ * @param format - The general format properties to apply to the range.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
10
+ */
11
+ export default function setWorkbookRangeFormat(rangeRef: WorkbookRangeRef, format: WorkbookRangeFormat): GraphOperation<void>;
12
+ //# sourceMappingURL=setWorkbookRangeFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFormat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,IAAI,CAAC,CAY5H"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // PATCH /sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format
3
+ // https://learn.microsoft.com/en-us/graph/api/rangeformat-update
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = setWorkbookRangeFormat;
6
+ const graphApi_ts_1 = require("../../graphApi.js");
7
+ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
8
+ /**
9
+ * Update the general format of a workbook range.
10
+ *
11
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
12
+ * @param format - The general format properties to apply to the range.
13
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
14
+ */
15
+ function setWorkbookRangeFormat(rangeRef, format) {
16
+ return (0, graphApi_ts_1.operation)({
17
+ contextId: rangeRef.contextId,
18
+ method: "PATCH",
19
+ path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format", rangeRef),
20
+ headers: {
21
+ "workbook-session-id": rangeRef.sessionId,
22
+ "content-type": "application/json",
23
+ },
24
+ body: format,
25
+ responseTransform: () => undefined,
26
+ });
27
+ }
28
+ // /format/font > WorkbookChartFont
@@ -1,5 +1,17 @@
1
1
  import type { Address } from "../models/Address.ts";
2
2
  import type { Cartesian } from "../models/Cartesian.ts";
3
+ /**
4
+ * Converts a cell range address to Cartesian coordinates.
5
+ *
6
+ * @param {Address} address - The cell range address (e.g., "A1:C3").
7
+ * @returns {Cartesian} The Cartesian representation of the address, with start and end coordinates.
8
+ */
3
9
  export declare function addressToCartesian(address: Address): Cartesian;
10
+ /**
11
+ * Converts Cartesian coordinates to a cell range address.
12
+ *
13
+ * @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
14
+ * @returns {Address} The cell range address (e.g., "A1:C3").
15
+ */
4
16
  export declare function cartesianToAddress(cartesian: Cartesian): Address;
5
17
  //# sourceMappingURL=cartesianAddress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU9D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAchE"}
1
+ {"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU9D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAchE"}
@@ -4,6 +4,12 @@ exports.addressToCartesian = addressToCartesian;
4
4
  exports.cartesianToAddress = cartesianToAddress;
5
5
  const addressManipulation_ts_1 = require("./addressManipulation.js");
6
6
  const addressOffset_ts_1 = require("./addressOffset.js");
7
+ /**
8
+ * Converts a cell range address to Cartesian coordinates.
9
+ *
10
+ * @param {Address} address - The cell range address (e.g., "A1:C3").
11
+ * @returns {Cartesian} The Cartesian representation of the address, with start and end coordinates.
12
+ */
7
13
  function addressToCartesian(address) {
8
14
  const components = (0, addressManipulation_ts_1.decomposeAddress)(address);
9
15
  const ax = (0, addressOffset_ts_1.columnAddressToOffset)(components.startColumn);
@@ -12,6 +18,12 @@ function addressToCartesian(address) {
12
18
  const by = (0, addressOffset_ts_1.rowAddressToOffset)(components.endRow);
13
19
  return { ax, ay, bx, by };
14
20
  }
21
+ /**
22
+ * Converts Cartesian coordinates to a cell range address.
23
+ *
24
+ * @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
25
+ * @returns {Address} The cell range address (e.g., "A1:C3").
26
+ */
15
27
  function cartesianToAddress(cartesian) {
16
28
  const startColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(cartesian.ax);
17
29
  const startRow = (0, addressOffset_ts_1.rowOffsetToAddress)(cartesian.ay);
@@ -0,0 +1,28 @@
1
+ import type { Address } from "../models/Address.ts";
2
+ import type { CellRangeValues } from "../models/CellRangeValues.ts";
3
+ /**
4
+ * Converts a 2D array of cell values into range address in the upper left.
5
+ *
6
+ * @param {CellRangeValues} values - A 2D array representing cell values.
7
+ * @returns {Address} The default cell range address (e.g., "A1:C3").
8
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts.
9
+ */
10
+ export declare function inferRangeAddress(values: CellRangeValues): Address;
11
+ /**
12
+ * Converts a 2D array of cell values into an array of objects.
13
+ * Assumes the first row is a header and uses it as keys for the objects.
14
+ *
15
+ * @param {CellRangeValues} values - A 2D array representing cell values.
16
+ * @returns {unknown[]} An array of objects where each object represents a row.
17
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts or no header row is present.
18
+ */
19
+ export declare function inferRangeObject(values: CellRangeValues): unknown[];
20
+ /**
21
+ * Converts an array of objects into a 2D array of cell values.
22
+ * The first row of the 2D array contains the keys as headers.
23
+ *
24
+ * @param {unknown[]} objs - An array of objects to convert.
25
+ * @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
26
+ */
27
+ export declare function inferObjectRange(objs: unknown[]): CellRangeValues;
28
+ //# sourceMappingURL=rangeManipulation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rangeManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/rangeManipulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAMpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA4BlE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoBnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,eAAe,CASjE"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.inferRangeAddress = inferRangeAddress;
7
+ exports.inferRangeObject = inferRangeObject;
8
+ exports.inferObjectRange = inferObjectRange;
9
+ const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
10
+ const cartesianAddress_ts_1 = require("./cartesianAddress.js");
11
+ /**
12
+ * Converts a 2D array of cell values into range address in the upper left.
13
+ *
14
+ * @param {CellRangeValues} values - A 2D array representing cell values.
15
+ * @returns {Address} The default cell range address (e.g., "A1:C3").
16
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts.
17
+ */
18
+ function inferRangeAddress(values) {
19
+ const first = values[0];
20
+ if (!first) {
21
+ return "A1";
22
+ }
23
+ for (const row of values) {
24
+ if (row.length !== first.length) {
25
+ throw new InvalidArgumentError_ts_1.default("All rows must have the same number of columns");
26
+ }
27
+ }
28
+ const rowCount = values.length;
29
+ const columnCount = first.length;
30
+ const startRow = 0;
31
+ const startColumn = 0;
32
+ const endRow = (rowCount - 1);
33
+ const endColumn = (columnCount - 1);
34
+ return (0, cartesianAddress_ts_1.cartesianToAddress)({
35
+ ax: startColumn,
36
+ ay: startRow,
37
+ bx: endColumn,
38
+ by: endRow,
39
+ });
40
+ }
41
+ /**
42
+ * Converts a 2D array of cell values into an array of objects.
43
+ * Assumes the first row is a header and uses it as keys for the objects.
44
+ *
45
+ * @param {CellRangeValues} values - A 2D array representing cell values.
46
+ * @returns {unknown[]} An array of objects where each object represents a row.
47
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts or no header row is present.
48
+ */
49
+ function inferRangeObject(values) {
50
+ const [header, ...rows] = values;
51
+ if (!header) {
52
+ throw new InvalidArgumentError_ts_1.default("Does not contain a header row");
53
+ }
54
+ return rows.map((row, index) => {
55
+ if (row.length !== header.length) {
56
+ throw new InvalidArgumentError_ts_1.default(`Row ${index} length must match header length`);
57
+ }
58
+ return header.reduce((obj, key, index) => {
59
+ obj[key.toString()] = row[index];
60
+ return obj;
61
+ }, {});
62
+ });
63
+ }
64
+ /**
65
+ * Converts an array of objects into a 2D array of cell values.
66
+ * The first row of the 2D array contains the keys as headers.
67
+ *
68
+ * @param {unknown[]} objs - An array of objects to convert.
69
+ * @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
70
+ */
71
+ function inferObjectRange(objs) {
72
+ if (objs.length === 0) {
73
+ return [];
74
+ }
75
+ const header = Array.from(new Set(objs.flatMap((obj) => Object.keys(obj))));
76
+ const rows = objs.map((obj) => header.map((key) => obj[key]));
77
+ return [header, ...rows];
78
+ }
@@ -0,0 +1,11 @@
1
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
2
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
3
+ /**
4
+ * Autofit the columns in a range.
5
+ *
6
+ * @param rangeRef - A reference to the range, optionally including session information.
7
+ * @returns Nothing.
8
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
9
+ */
10
+ export default function autoFitWorkbookRangeColumns(rangeRef: WorkbookRangeRef): GraphOperation<void>;
11
+ //# sourceMappingURL=autoFitWorkbookRangeColumns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"autoFitWorkbookRangeColumns.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/autoFitWorkbookRangeColumns.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAWpG"}
@@ -0,0 +1,21 @@
1
+ import { operation } from "../../graphApi.js";
2
+ import { generatePath } from "../../services/templatedPaths.js";
3
+ /**
4
+ * Autofit the columns in a range.
5
+ *
6
+ * @param rangeRef - A reference to the range, optionally including session information.
7
+ * @returns Nothing.
8
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
9
+ */
10
+ export default function autoFitWorkbookRangeColumns(rangeRef) {
11
+ return operation({
12
+ contextId: rangeRef.contextId,
13
+ method: "POST",
14
+ path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/autofitcolumns", rangeRef),
15
+ headers: {
16
+ "workbook-session-id": rangeRef.sessionId,
17
+ },
18
+ body: null,
19
+ responseTransform: () => undefined,
20
+ });
21
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Retrieve the fill format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range, optionally including session information.
8
+ * @returns The fill format of the specified range, including its metadata and reference information.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
10
+ */
11
+ export default function getWorkbookRangeFill(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFill & WorkbookRangeRef>;
12
+ //# sourceMappingURL=getWorkbookRangeFill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFill.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
@@ -0,0 +1,28 @@
1
+ // https://learn.microsoft.com/en-us/graph/api/rangefill-get
2
+ import { operation } from "../../graphApi.js";
3
+ import { generatePath } from "../../services/templatedPaths.js";
4
+ /**
5
+ * Retrieve the fill format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range, optionally including session information.
8
+ * @returns The fill format of the specified range, including its metadata and reference information.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
10
+ */
11
+ export default function getWorkbookRangeFill(rangeRef) {
12
+ return operation({
13
+ contextId: rangeRef.contextId,
14
+ method: "GET",
15
+ path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/fill`, rangeRef),
16
+ headers: {
17
+ "workbook-session-id": rangeRef.sessionId,
18
+ },
19
+ body: null,
20
+ responseTransform: (response) => {
21
+ const fill = response;
22
+ return {
23
+ ...fill,
24
+ ...rangeRef,
25
+ };
26
+ },
27
+ });
28
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Retrieve the font format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range, optionally including session information.
8
+ * @returns The font format of the specified range, including its metadata and reference information.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
10
+ */
11
+ export default function getWorkbookRangeFont(rangeRef: WorkbookRangeRef): GraphOperation<WorkbookRangeFont & WorkbookRangeRef>;
12
+ //# sourceMappingURL=getWorkbookRangeFont.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFont.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAiB7H"}
@@ -0,0 +1,28 @@
1
+ // https://learn.microsoft.com/en-us/graph/api/rangefont-get
2
+ import { operation } from "../../graphApi.js";
3
+ import { generatePath } from "../../services/templatedPaths.js";
4
+ /**
5
+ * Retrieve the font format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range, optionally including session information.
8
+ * @returns The font format of the specified range, including its metadata and reference information.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
10
+ */
11
+ export default function getWorkbookRangeFont(rangeRef) {
12
+ return operation({
13
+ contextId: rangeRef.contextId,
14
+ method: "GET",
15
+ path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${rangeRef.address}')/format/font`, rangeRef),
16
+ headers: {
17
+ "workbook-session-id": rangeRef.sessionId,
18
+ },
19
+ body: null,
20
+ responseTransform: (response) => {
21
+ const font = response;
22
+ return {
23
+ ...font,
24
+ ...rangeRef,
25
+ };
26
+ },
27
+ });
28
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFill } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Update the fill format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
8
+ * @param format - The fill format properties to apply to the range.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
10
+ */
11
+ export default function setWorkbookRangeFill(rangeRef: WorkbookRangeRef, format: WorkbookRangeFill): GraphOperation<void>;
12
+ //# sourceMappingURL=setWorkbookRangeFill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeFill.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFill.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
@@ -0,0 +1,22 @@
1
+ import { operation } from "../../graphApi.js";
2
+ import { generatePath } from "../../services/templatedPaths.js";
3
+ /**
4
+ * Update the fill format of a workbook range.
5
+ *
6
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
7
+ * @param format - The fill format properties to apply to the range.
8
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
9
+ */
10
+ export default function setWorkbookRangeFill(rangeRef, format) {
11
+ return operation({
12
+ contextId: rangeRef.contextId,
13
+ method: "PATCH",
14
+ path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/fill", rangeRef),
15
+ headers: {
16
+ "workbook-session-id": rangeRef.sessionId,
17
+ "content-type": "application/json",
18
+ },
19
+ body: format,
20
+ responseTransform: () => undefined,
21
+ });
22
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFont } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Update the font format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
8
+ * @param format - The font format properties to apply to the range.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
10
+ */
11
+ export default function setWorkbookRangeFont(rangeRef: WorkbookRangeRef, format: WorkbookRangeFont): GraphOperation<void>;
12
+ //# sourceMappingURL=setWorkbookRangeFont.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeFont.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFont.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAYxH"}
@@ -0,0 +1,22 @@
1
+ import { operation } from "../../graphApi.js";
2
+ import { generatePath } from "../../services/templatedPaths.js";
3
+ /**
4
+ * Update the font format of a workbook range.
5
+ *
6
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
7
+ * @param format - The font format properties to apply to the range.
8
+ * @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
9
+ */
10
+ export default function setWorkbookRangeFont(rangeRef, format) {
11
+ return operation({
12
+ contextId: rangeRef.contextId,
13
+ method: "PATCH",
14
+ path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format/font", rangeRef),
15
+ headers: {
16
+ "workbook-session-id": rangeRef.sessionId,
17
+ "content-type": "application/json",
18
+ },
19
+ body: format,
20
+ responseTransform: () => undefined,
21
+ });
22
+ }
@@ -0,0 +1,12 @@
1
+ import type { WorkbookRangeFormat } from "@microsoft/microsoft-graph-types";
2
+ import type { GraphOperation } from "../../models/GraphOperation.ts";
3
+ import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
4
+ /**
5
+ * Update the general format of a workbook range.
6
+ *
7
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
8
+ * @param format - The general format properties to apply to the range.
9
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
10
+ */
11
+ export default function setWorkbookRangeFormat(rangeRef: WorkbookRangeRef, format: WorkbookRangeFormat): GraphOperation<void>;
12
+ //# sourceMappingURL=setWorkbookRangeFormat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/setWorkbookRangeFormat.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAE5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,IAAI,CAAC,CAY5H"}
@@ -0,0 +1,25 @@
1
+ // PATCH /sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format
2
+ // https://learn.microsoft.com/en-us/graph/api/rangeformat-update
3
+ import { operation } from "../../graphApi.js";
4
+ import { generatePath } from "../../services/templatedPaths.js";
5
+ /**
6
+ * Update the general format of a workbook range.
7
+ *
8
+ * @param rangeRef - A reference to the range to be formatted, optionally including session information.
9
+ * @param format - The general format properties to apply to the range.
10
+ * @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
11
+ */
12
+ export default function setWorkbookRangeFormat(rangeRef, format) {
13
+ return operation({
14
+ contextId: rangeRef.contextId,
15
+ method: "PATCH",
16
+ path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format", rangeRef),
17
+ headers: {
18
+ "workbook-session-id": rangeRef.sessionId,
19
+ "content-type": "application/json",
20
+ },
21
+ body: format,
22
+ responseTransform: () => undefined,
23
+ });
24
+ }
25
+ // /format/font > WorkbookChartFont
@@ -1,5 +1,17 @@
1
1
  import type { Address } from "../models/Address.ts";
2
2
  import type { Cartesian } from "../models/Cartesian.ts";
3
+ /**
4
+ * Converts a cell range address to Cartesian coordinates.
5
+ *
6
+ * @param {Address} address - The cell range address (e.g., "A1:C3").
7
+ * @returns {Cartesian} The Cartesian representation of the address, with start and end coordinates.
8
+ */
3
9
  export declare function addressToCartesian(address: Address): Cartesian;
10
+ /**
11
+ * Converts Cartesian coordinates to a cell range address.
12
+ *
13
+ * @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
14
+ * @returns {Address} The cell range address (e.g., "A1:C3").
15
+ */
4
16
  export declare function cartesianToAddress(cartesian: Cartesian): Address;
5
17
  //# sourceMappingURL=cartesianAddress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU9D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAchE"}
1
+ {"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU9D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAchE"}
@@ -1,5 +1,11 @@
1
1
  import { composeAddress, decomposeAddress } from "./addressManipulation.js";
2
2
  import { columnAddressToOffset, columnOffsetToAddress, rowAddressToOffset, rowOffsetToAddress } from "./addressOffset.js";
3
+ /**
4
+ * Converts a cell range address to Cartesian coordinates.
5
+ *
6
+ * @param {Address} address - The cell range address (e.g., "A1:C3").
7
+ * @returns {Cartesian} The Cartesian representation of the address, with start and end coordinates.
8
+ */
3
9
  export function addressToCartesian(address) {
4
10
  const components = decomposeAddress(address);
5
11
  const ax = columnAddressToOffset(components.startColumn);
@@ -8,6 +14,12 @@ export function addressToCartesian(address) {
8
14
  const by = rowAddressToOffset(components.endRow);
9
15
  return { ax, ay, bx, by };
10
16
  }
17
+ /**
18
+ * Converts Cartesian coordinates to a cell range address.
19
+ *
20
+ * @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
21
+ * @returns {Address} The cell range address (e.g., "A1:C3").
22
+ */
11
23
  export function cartesianToAddress(cartesian) {
12
24
  const startColumn = columnOffsetToAddress(cartesian.ax);
13
25
  const startRow = rowOffsetToAddress(cartesian.ay);
@@ -0,0 +1,28 @@
1
+ import type { Address } from "../models/Address.ts";
2
+ import type { CellRangeValues } from "../models/CellRangeValues.ts";
3
+ /**
4
+ * Converts a 2D array of cell values into range address in the upper left.
5
+ *
6
+ * @param {CellRangeValues} values - A 2D array representing cell values.
7
+ * @returns {Address} The default cell range address (e.g., "A1:C3").
8
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts.
9
+ */
10
+ export declare function inferRangeAddress(values: CellRangeValues): Address;
11
+ /**
12
+ * Converts a 2D array of cell values into an array of objects.
13
+ * Assumes the first row is a header and uses it as keys for the objects.
14
+ *
15
+ * @param {CellRangeValues} values - A 2D array representing cell values.
16
+ * @returns {unknown[]} An array of objects where each object represents a row.
17
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts or no header row is present.
18
+ */
19
+ export declare function inferRangeObject(values: CellRangeValues): unknown[];
20
+ /**
21
+ * Converts an array of objects into a 2D array of cell values.
22
+ * The first row of the 2D array contains the keys as headers.
23
+ *
24
+ * @param {unknown[]} objs - An array of objects to convert.
25
+ * @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
26
+ */
27
+ export declare function inferObjectRange(objs: unknown[]): CellRangeValues;
28
+ //# sourceMappingURL=rangeManipulation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rangeManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/rangeManipulation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAMpE;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CA4BlE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,EAAE,CAoBnE;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,eAAe,CASjE"}
@@ -0,0 +1,70 @@
1
+ import InvalidArgumentError from "../errors/InvalidArgumentError.js";
2
+ import { cartesianToAddress } from "./cartesianAddress.js";
3
+ /**
4
+ * Converts a 2D array of cell values into range address in the upper left.
5
+ *
6
+ * @param {CellRangeValues} values - A 2D array representing cell values.
7
+ * @returns {Address} The default cell range address (e.g., "A1:C3").
8
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts.
9
+ */
10
+ export function inferRangeAddress(values) {
11
+ const first = values[0];
12
+ if (!first) {
13
+ return "A1";
14
+ }
15
+ for (const row of values) {
16
+ if (row.length !== first.length) {
17
+ throw new InvalidArgumentError("All rows must have the same number of columns");
18
+ }
19
+ }
20
+ const rowCount = values.length;
21
+ const columnCount = first.length;
22
+ const startRow = 0;
23
+ const startColumn = 0;
24
+ const endRow = (rowCount - 1);
25
+ const endColumn = (columnCount - 1);
26
+ return cartesianToAddress({
27
+ ax: startColumn,
28
+ ay: startRow,
29
+ bx: endColumn,
30
+ by: endRow,
31
+ });
32
+ }
33
+ /**
34
+ * Converts a 2D array of cell values into an array of objects.
35
+ * Assumes the first row is a header and uses it as keys for the objects.
36
+ *
37
+ * @param {CellRangeValues} values - A 2D array representing cell values.
38
+ * @returns {unknown[]} An array of objects where each object represents a row.
39
+ * @throws {InvalidArgumentError} If rows have inconsistent column counts or no header row is present.
40
+ */
41
+ export function inferRangeObject(values) {
42
+ const [header, ...rows] = values;
43
+ if (!header) {
44
+ throw new InvalidArgumentError("Does not contain a header row");
45
+ }
46
+ return rows.map((row, index) => {
47
+ if (row.length !== header.length) {
48
+ throw new InvalidArgumentError(`Row ${index} length must match header length`);
49
+ }
50
+ return header.reduce((obj, key, index) => {
51
+ obj[key.toString()] = row[index];
52
+ return obj;
53
+ }, {});
54
+ });
55
+ }
56
+ /**
57
+ * Converts an array of objects into a 2D array of cell values.
58
+ * The first row of the 2D array contains the keys as headers.
59
+ *
60
+ * @param {unknown[]} objs - An array of objects to convert.
61
+ * @returns {CellRangeValues} A 2D array where the first row is the header and subsequent rows are the object values.
62
+ */
63
+ export function inferObjectRange(objs) {
64
+ if (objs.length === 0) {
65
+ return [];
66
+ }
67
+ const header = Array.from(new Set(objs.flatMap((obj) => Object.keys(obj))));
68
+ const rows = objs.map((obj) => header.map((key) => obj[key]));
69
+ return [header, ...rows];
70
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microsoft-graph",
3
- "version": "2.7.7",
3
+ "version": "2.8.0",
4
4
  "description": "Microsoft GraphAPI SDK for NodeJS",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",
@@ -382,6 +382,11 @@
382
382
  "require": "./dist/cjs/operations/workbook/deleteWorkbook.js",
383
383
  "types": "./dist/esm/operations/workbook/deleteWorkbook.d.ts"
384
384
  },
385
+ "./operations/workbookRange/autoFitWorkbookRangeColumns": {
386
+ "import": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js",
387
+ "require": "./dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js",
388
+ "types": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts"
389
+ },
385
390
  "./operations/workbookRange/clearWorkbookRange": {
386
391
  "import": "./dist/esm/operations/workbookRange/clearWorkbookRange.js",
387
392
  "require": "./dist/cjs/operations/workbookRange/clearWorkbookRange.js",
@@ -397,6 +402,16 @@
397
402
  "require": "./dist/cjs/operations/workbookRange/getWorkbookNamedRange.js",
398
403
  "types": "./dist/esm/operations/workbookRange/getWorkbookNamedRange.d.ts"
399
404
  },
405
+ "./operations/workbookRange/getWorkbookRangeFill": {
406
+ "import": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.js",
407
+ "require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFill.js",
408
+ "types": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts"
409
+ },
410
+ "./operations/workbookRange/getWorkbookRangeFont": {
411
+ "import": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.js",
412
+ "require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFont.js",
413
+ "types": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts"
414
+ },
400
415
  "./operations/workbookRange/getWorkbookRangeFormat": {
401
416
  "import": "./dist/esm/operations/workbookRange/getWorkbookRangeFormat.js",
402
417
  "require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js",
@@ -422,6 +437,21 @@
422
437
  "require": "./dist/cjs/operations/workbookRange/insertWorkbookCells.js",
423
438
  "types": "./dist/esm/operations/workbookRange/insertWorkbookCells.d.ts"
424
439
  },
440
+ "./operations/workbookRange/setWorkbookRangeFill": {
441
+ "import": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.js",
442
+ "require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFill.js",
443
+ "types": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts"
444
+ },
445
+ "./operations/workbookRange/setWorkbookRangeFont": {
446
+ "import": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.js",
447
+ "require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFont.js",
448
+ "types": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts"
449
+ },
450
+ "./operations/workbookRange/setWorkbookRangeFormat": {
451
+ "import": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.js",
452
+ "require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js",
453
+ "types": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts"
454
+ },
425
455
  "./operations/workbookRange/updateWorkbookNamedRange": {
426
456
  "import": "./dist/esm/operations/workbookRange/updateWorkbookNamedRange.js",
427
457
  "require": "./dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js",
@@ -597,6 +627,11 @@
597
627
  "require": "./dist/cjs/services/random.js",
598
628
  "types": "./dist/esm/services/random.d.ts"
599
629
  },
630
+ "./services/rangeManipulation": {
631
+ "import": "./dist/esm/services/rangeManipulation.js",
632
+ "require": "./dist/cjs/services/rangeManipulation.js",
633
+ "types": "./dist/esm/services/rangeManipulation.d.ts"
634
+ },
600
635
  "./services/sharepointUrl": {
601
636
  "import": "./dist/esm/services/sharepointUrl.js",
602
637
  "require": "./dist/cjs/services/sharepointUrl.js",
@@ -1047,6 +1082,11 @@
1047
1082
  "import": "./dist/esm/operations/workbook/deleteWorkbook.js",
1048
1083
  "types": "./dist/esm/operations/workbook/deleteWorkbook.d.ts"
1049
1084
  },
1085
+ "./dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js": {
1086
+ "require": "./dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js",
1087
+ "import": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js",
1088
+ "types": "./dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts"
1089
+ },
1050
1090
  "./dist/cjs/operations/workbookRange/clearWorkbookRange.js": {
1051
1091
  "require": "./dist/cjs/operations/workbookRange/clearWorkbookRange.js",
1052
1092
  "import": "./dist/esm/operations/workbookRange/clearWorkbookRange.js",
@@ -1062,6 +1102,16 @@
1062
1102
  "import": "./dist/esm/operations/workbookRange/getWorkbookNamedRange.js",
1063
1103
  "types": "./dist/esm/operations/workbookRange/getWorkbookNamedRange.d.ts"
1064
1104
  },
1105
+ "./dist/cjs/operations/workbookRange/getWorkbookRangeFill.js": {
1106
+ "require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFill.js",
1107
+ "import": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.js",
1108
+ "types": "./dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts"
1109
+ },
1110
+ "./dist/cjs/operations/workbookRange/getWorkbookRangeFont.js": {
1111
+ "require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFont.js",
1112
+ "import": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.js",
1113
+ "types": "./dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts"
1114
+ },
1065
1115
  "./dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js": {
1066
1116
  "require": "./dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js",
1067
1117
  "import": "./dist/esm/operations/workbookRange/getWorkbookRangeFormat.js",
@@ -1087,6 +1137,21 @@
1087
1137
  "import": "./dist/esm/operations/workbookRange/insertWorkbookCells.js",
1088
1138
  "types": "./dist/esm/operations/workbookRange/insertWorkbookCells.d.ts"
1089
1139
  },
1140
+ "./dist/cjs/operations/workbookRange/setWorkbookRangeFill.js": {
1141
+ "require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFill.js",
1142
+ "import": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.js",
1143
+ "types": "./dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts"
1144
+ },
1145
+ "./dist/cjs/operations/workbookRange/setWorkbookRangeFont.js": {
1146
+ "require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFont.js",
1147
+ "import": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.js",
1148
+ "types": "./dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts"
1149
+ },
1150
+ "./dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js": {
1151
+ "require": "./dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js",
1152
+ "import": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.js",
1153
+ "types": "./dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts"
1154
+ },
1090
1155
  "./dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js": {
1091
1156
  "require": "./dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js",
1092
1157
  "import": "./dist/esm/operations/workbookRange/updateWorkbookNamedRange.js",
@@ -1262,6 +1327,11 @@
1262
1327
  "import": "./dist/esm/services/random.js",
1263
1328
  "types": "./dist/esm/services/random.d.ts"
1264
1329
  },
1330
+ "./dist/cjs/services/rangeManipulation.js": {
1331
+ "require": "./dist/cjs/services/rangeManipulation.js",
1332
+ "import": "./dist/esm/services/rangeManipulation.js",
1333
+ "types": "./dist/esm/services/rangeManipulation.d.ts"
1334
+ },
1265
1335
  "./dist/cjs/services/sharepointUrl.js": {
1266
1336
  "require": "./dist/cjs/services/sharepointUrl.js",
1267
1337
  "import": "./dist/esm/services/sharepointUrl.js",