microsoft-graph 2.18.2 → 2.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js +3 -1
- package/dist/cjs/operations/workbookRange/clearWorkbookRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/clearWorkbookRange.js +3 -1
- package/dist/cjs/operations/workbookRange/deleteWorkbookRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/deleteWorkbookRange.js +3 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.js +3 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.js +3 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js +3 -1
- package/dist/cjs/operations/workbookRange/getWorkbookVisibleRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookVisibleRange.js +3 -1
- package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.js +3 -1
- package/dist/cjs/operations/workbookRange/insertWorkbookCells.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/insertWorkbookCells.js +2 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.js +3 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.js +3 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js +3 -1
- package/dist/cjs/operations/workbookRange/updateWorkbookRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookRange/updateWorkbookRange.js +3 -1
- package/dist/cjs/services/addressManipulation.d.ts +9 -1
- package/dist/cjs/services/addressManipulation.d.ts.map +1 -1
- package/dist/cjs/services/addressManipulation.js +14 -3
- package/dist/cjs/services/workbookRange.d.ts.map +1 -1
- package/dist/cjs/services/workbookRange.js +1 -3
- package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js +3 -1
- package/dist/esm/operations/workbookRange/clearWorkbookRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/clearWorkbookRange.js +3 -1
- package/dist/esm/operations/workbookRange/deleteWorkbookRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/deleteWorkbookRange.js +3 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFill.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFill.js +3 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFont.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFont.js +3 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.js +3 -1
- package/dist/esm/operations/workbookRange/getWorkbookVisibleRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookVisibleRange.js +3 -1
- package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.js +3 -1
- package/dist/esm/operations/workbookRange/insertWorkbookCells.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/insertWorkbookCells.js +2 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFill.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFill.js +3 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFont.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFont.js +3 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.js +3 -1
- package/dist/esm/operations/workbookRange/updateWorkbookRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookRange/updateWorkbookRange.js +3 -1
- package/dist/esm/services/addressManipulation.d.ts +9 -1
- package/dist/esm/services/addressManipulation.d.ts.map +1 -1
- package/dist/esm/services/addressManipulation.js +13 -3
- package/dist/esm/services/workbookRange.d.ts.map +1 -1
- package/dist/esm/services/workbookRange.js +1 -3
- package/package.json +1 -1
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAapG"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = autoFitWorkbookRangeColumns;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Auto-fit the columns in a range.
|
|
@@ -11,10 +12,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
12
|
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
|
|
12
13
|
*/
|
|
13
14
|
function autoFitWorkbookRangeColumns(rangeRef) {
|
|
15
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
14
16
|
return (0, graphApi_ts_1.operation)({
|
|
15
17
|
contextId: rangeRef.contextId,
|
|
16
18
|
method: "POST",
|
|
17
|
-
path: (0, templatedPaths_ts_1.generatePath)(
|
|
19
|
+
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
20
|
headers: {
|
|
19
21
|
"workbook-session-id": rangeRef.sessionId,
|
|
20
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/clearWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"clearWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/clearWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,GAAE,KAAK,GAAG,SAAS,GAAG,UAAkB,GAAG,cAAc,CAAC,IAAI,CAAC,CAgB5I"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = clearWorkbookRange;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Clear a range - content, formatting, or both.
|
|
@@ -12,10 +13,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
13
|
* @see https://learn.microsoft.com/en-us/graph/api/range-delete
|
|
13
14
|
*/
|
|
14
15
|
function clearWorkbookRange(rangeRef, applyTo = "All") {
|
|
16
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
15
17
|
return (0, graphApi_ts_1.operation)({
|
|
16
18
|
contextId: rangeRef.contextId,
|
|
17
19
|
method: "POST",
|
|
18
|
-
path: (0, templatedPaths_ts_1.generatePath)(
|
|
20
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/clear`, rangeRef),
|
|
19
21
|
headers: {
|
|
20
22
|
"workbook-session-id": rangeRef.sessionId,
|
|
21
23
|
"content-type": "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/deleteWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"deleteWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/deleteWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAgBlH"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = deleteWorkbookRange;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Delete a range.
|
|
@@ -12,10 +13,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
13
|
* @see https://learn.microsoft.com/en-us/graph/api/range-clear
|
|
13
14
|
*/
|
|
14
15
|
function deleteWorkbookRange(rangeRef, shift) {
|
|
16
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
15
17
|
return (0, graphApi_ts_1.operation)({
|
|
16
18
|
contextId: rangeRef.contextId,
|
|
17
19
|
method: "POST",
|
|
18
|
-
path: (0, templatedPaths_ts_1.generatePath)(
|
|
20
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/delete`, rangeRef),
|
|
19
21
|
headers: {
|
|
20
22
|
"workbook-session-id": rangeRef.sessionId,
|
|
21
23
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAmB7H"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.default = getWorkbookRangeFill;
|
|
5
5
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
6
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
6
7
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
7
8
|
/**
|
|
8
9
|
* Retrieve the fill format of a workbook range.
|
|
@@ -12,10 +13,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
13
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
13
14
|
*/
|
|
14
15
|
function getWorkbookRangeFill(rangeRef) {
|
|
16
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
15
17
|
return (0, graphApi_ts_1.operation)({
|
|
16
18
|
contextId: rangeRef.contextId,
|
|
17
19
|
method: "GET",
|
|
18
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
20
|
+
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),
|
|
19
21
|
headers: {
|
|
20
22
|
"workbook-session-id": rangeRef.sessionId,
|
|
21
23
|
},
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAmB7H"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.default = getWorkbookRangeFont;
|
|
5
5
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
6
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
6
7
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
7
8
|
/**
|
|
8
9
|
* Retrieve the font format of a workbook range.
|
|
@@ -12,10 +13,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
13
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
13
14
|
*/
|
|
14
15
|
function getWorkbookRangeFont(rangeRef) {
|
|
16
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
15
17
|
return (0, graphApi_ts_1.operation)({
|
|
16
18
|
contextId: rangeRef.contextId,
|
|
17
19
|
method: "GET",
|
|
18
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
20
|
+
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),
|
|
19
21
|
headers: {
|
|
20
22
|
"workbook-session-id": rangeRef.sessionId,
|
|
21
23
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"AAAA,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;
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"AAAA,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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAmBjI"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = getWorkbookRangeFormat;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Retrieve the format of a workbook range.
|
|
@@ -11,10 +12,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
12
|
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-get
|
|
12
13
|
*/
|
|
13
14
|
function getWorkbookRangeFormat(rangeRef) {
|
|
15
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
14
16
|
return (0, graphApi_ts_1.operation)({
|
|
15
17
|
contextId: rangeRef.contextId,
|
|
16
18
|
method: "GET",
|
|
17
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
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),
|
|
18
20
|
headers: {
|
|
19
21
|
"workbook-session-id": rangeRef.sessionId,
|
|
20
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookVisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookVisibleRange.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;
|
|
1
|
+
{"version":3,"file":"getWorkbookVisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookVisibleRange.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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAqBhI"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = getWorkbookVisibleRange;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Retrieve the visible view of a range.
|
|
@@ -11,11 +12,12 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
12
|
* @see https://learn.microsoft.com/en-us/graph/api/workbookrange-visibleview
|
|
12
13
|
*/
|
|
13
14
|
function getWorkbookVisibleRange(rangeRef) {
|
|
15
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
14
16
|
// TODO: Should be a visible ref type?
|
|
15
17
|
return (0, graphApi_ts_1.operation)({
|
|
16
18
|
contextId: rangeRef.contextId,
|
|
17
19
|
method: "GET",
|
|
18
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
20
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/visibleView`, rangeRef),
|
|
19
21
|
headers: {
|
|
20
22
|
"workbook-session-id": rangeRef.sessionId,
|
|
21
23
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAoB9H"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = getWorkbookWorksheetRange;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Fetch a range, including values and formatting.
|
|
@@ -11,10 +12,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
12
|
* @see https://learn.microsoft.com/en-us/graph/api/range-get
|
|
12
13
|
*/
|
|
13
14
|
function getWorkbookWorksheetRange(rangeRef) {
|
|
15
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
14
16
|
return (0, graphApi_ts_1.operation)({
|
|
15
17
|
contextId: rangeRef.contextId,
|
|
16
18
|
method: "GET",
|
|
17
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
19
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
18
20
|
headers: {
|
|
19
21
|
"workbook-session-id": rangeRef.sessionId,
|
|
20
22
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertWorkbookCells.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/insertWorkbookCells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"insertWorkbookCells.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/insertWorkbookCells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAKjF;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAwB3K"}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.default = insertWorkbookCells;
|
|
7
7
|
const ProtocolError_ts_1 = __importDefault(require("../../errors/ProtocolError.js"));
|
|
8
8
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
9
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
9
10
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
10
11
|
const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
11
12
|
/**
|
|
@@ -21,7 +22,7 @@ function insertWorkbookCells(worksheetRef, address, shift) {
|
|
|
21
22
|
return (0, graphApi_ts_1.operation)({
|
|
22
23
|
contextId: worksheetRef.contextId,
|
|
23
24
|
method: "POST",
|
|
24
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/insert`, worksheetRef),
|
|
25
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${(0, addressManipulation_ts_1.normalizeAddress)(address)}')/insert`, worksheetRef),
|
|
25
26
|
headers: {
|
|
26
27
|
"workbook-session-id": worksheetRef.sessionId,
|
|
27
28
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAcxH"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = setWorkbookRangeFill;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Update the fill format of a workbook range.
|
|
@@ -11,10 +12,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
12
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
|
|
12
13
|
*/
|
|
13
14
|
function setWorkbookRangeFill(rangeRef, format) {
|
|
15
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
14
16
|
return (0, graphApi_ts_1.operation)({
|
|
15
17
|
contextId: rangeRef.contextId,
|
|
16
18
|
method: "PATCH",
|
|
17
|
-
path: (0, templatedPaths_ts_1.generatePath)(
|
|
19
|
+
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
20
|
headers: {
|
|
19
21
|
"workbook-session-id": rangeRef.sessionId,
|
|
20
22
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAcxH"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = setWorkbookRangeFont;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Update the font format of a workbook range.
|
|
@@ -11,10 +12,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
12
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
|
|
12
13
|
*/
|
|
13
14
|
function setWorkbookRangeFont(rangeRef, format) {
|
|
15
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
14
16
|
return (0, graphApi_ts_1.operation)({
|
|
15
17
|
contextId: rangeRef.contextId,
|
|
16
18
|
method: "PATCH",
|
|
17
|
-
path: (0, templatedPaths_ts_1.generatePath)(
|
|
19
|
+
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
20
|
headers: {
|
|
19
21
|
"workbook-session-id": rangeRef.sessionId,
|
|
20
22
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,IAAI,CAAC,CAc5H"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.default = setWorkbookRangeFormat;
|
|
6
6
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
7
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
7
8
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
8
9
|
/**
|
|
9
10
|
* Update the general format of a workbook range.
|
|
@@ -13,10 +14,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
13
14
|
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
14
15
|
*/
|
|
15
16
|
function setWorkbookRangeFormat(rangeRef, format) {
|
|
17
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
16
18
|
return (0, graphApi_ts_1.operation)({
|
|
17
19
|
contextId: rangeRef.contextId,
|
|
18
20
|
method: "PATCH",
|
|
19
|
-
path: (0, templatedPaths_ts_1.generatePath)(
|
|
21
|
+
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
22
|
headers: {
|
|
21
23
|
"workbook-session-id": rangeRef.sessionId,
|
|
22
24
|
"content-type": "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/updateWorkbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"updateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/updateWorkbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAqB/I"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = updateWorkbookRange;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
5
6
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
7
|
/**
|
|
7
8
|
* Update a range, including values and formatting. Properties that aren't included in the request maintain their previous values or are recalculated based on changes to other property values.
|
|
@@ -12,10 +13,11 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
13
|
* @see https://learn.microsoft.com/en-us/graph/api/range-update
|
|
13
14
|
*/
|
|
14
15
|
function updateWorkbookRange(rangeRef, update) {
|
|
16
|
+
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
15
17
|
return (0, graphApi_ts_1.operation)({
|
|
16
18
|
contextId: rangeRef.contextId,
|
|
17
19
|
method: "PATCH",
|
|
18
|
-
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
20
|
+
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
19
21
|
headers: {
|
|
20
22
|
"workbook-session-id": rangeRef.sessionId,
|
|
21
23
|
"content-type": "application/json",
|
|
@@ -5,6 +5,13 @@ export type AddressComponents = {
|
|
|
5
5
|
startRow: RowAddress;
|
|
6
6
|
endRow: RowAddress;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Fixes address, removing an optional sheet prefix and ensuring it is a valid range.
|
|
10
|
+
* @param address - The address to normalize.
|
|
11
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. This is useful to workaround API quirks.
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeAddress(address: Address, forceRange?: boolean): Address;
|
|
8
15
|
/**
|
|
9
16
|
* Decomposes an address into its components (start and end columns/rows).
|
|
10
17
|
* @param address - The address to decompose.
|
|
@@ -15,10 +22,11 @@ export declare function decomposeAddress(address: Address): AddressComponents;
|
|
|
15
22
|
/**
|
|
16
23
|
* Composes an address from its components.
|
|
17
24
|
* @param components - The address components.
|
|
25
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. Used to workaround API quirks
|
|
18
26
|
* @returns The composed address.
|
|
19
27
|
* @throws InvalidArgumentError if the components are invalid.
|
|
20
28
|
*/
|
|
21
|
-
export declare function composeAddress(components: AddressComponents): Address;
|
|
29
|
+
export declare function composeAddress(components: AddressComponents, forceRange?: boolean): Address;
|
|
22
30
|
/**
|
|
23
31
|
* Gets the first cell address from a given address.
|
|
24
32
|
* @param address - The address to analyze.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/addressManipulation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAoB,aAAa,EAAsB,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AAmBnJ,MAAM,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"addressManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/addressManipulation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAoB,aAAa,EAAsB,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AAmBnJ,MAAM,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,UAAQ,GAAG,OAAO,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAcpE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,UAAU,UAAQ,GAAG,OAAO,CAsBzF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAGjE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAGhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS3D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS/D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAqChG;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAKlF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG/D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAGzD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAG5D"}
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.normalizeAddress = normalizeAddress;
|
|
6
7
|
exports.decomposeAddress = decomposeAddress;
|
|
7
8
|
exports.composeAddress = composeAddress;
|
|
8
9
|
exports.getFirstCellAddress = getFirstCellAddress;
|
|
@@ -29,6 +30,15 @@ const lastColumn = "XFD";
|
|
|
29
30
|
const firstRow = "1";
|
|
30
31
|
const lastRow = "1048576";
|
|
31
32
|
const addressPattern = /^(?<sheet>(?:'[^']+'|[A-Za-z0-9_]+)!)?(?:(?<startColumn>[A-Z]+)?(?<startRow>\d+)?(?::(?<endColumn>[A-Z]+)?(?<endRow>\d+)?)?)$/;
|
|
33
|
+
/**
|
|
34
|
+
* Fixes address, removing an optional sheet prefix and ensuring it is a valid range.
|
|
35
|
+
* @param address - The address to normalize.
|
|
36
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. This is useful to workaround API quirks.
|
|
37
|
+
* @returns
|
|
38
|
+
*/
|
|
39
|
+
function normalizeAddress(address, forceRange = false) {
|
|
40
|
+
return composeAddress(decomposeAddress(address), forceRange);
|
|
41
|
+
}
|
|
32
42
|
/**
|
|
33
43
|
* Decomposes an address into its components (start and end columns/rows).
|
|
34
44
|
* @param address - The address to decompose.
|
|
@@ -51,14 +61,15 @@ function decomposeAddress(address) {
|
|
|
51
61
|
/**
|
|
52
62
|
* Composes an address from its components.
|
|
53
63
|
* @param components - The address components.
|
|
64
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. Used to workaround API quirks
|
|
54
65
|
* @returns The composed address.
|
|
55
66
|
* @throws InvalidArgumentError if the components are invalid.
|
|
56
67
|
*/
|
|
57
|
-
function composeAddress(components) {
|
|
58
|
-
if (isSingleColumn(components) && isAllRows(components)) {
|
|
68
|
+
function composeAddress(components, forceRange = false) {
|
|
69
|
+
if (!forceRange && isSingleColumn(components) && isAllRows(components)) {
|
|
59
70
|
return composeColumnAddress(components.startColumn);
|
|
60
71
|
}
|
|
61
|
-
if (isSingleRow(components) && isAllColumns(components)) {
|
|
72
|
+
if (!forceRange && isSingleRow(components) && isAllColumns(components)) {
|
|
62
73
|
return composeRowAddress(components.startRow);
|
|
63
74
|
}
|
|
64
75
|
if (isAllRows(components)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbookRange.d.ts","sourceRoot":"","sources":["../../../src/services/workbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"workbookRange.d.ts","sourceRoot":"","sources":["../../../src/services/workbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAU7G"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createWorkbookRangeRef = createWorkbookRangeRef;
|
|
4
|
-
const addressManipulation_ts_1 = require("./addressManipulation.js");
|
|
5
4
|
/**
|
|
6
5
|
* Creates a reference to a workbook range.
|
|
7
6
|
* @param worksheetRef - The reference to the worksheet containing the range.
|
|
@@ -9,7 +8,6 @@ const addressManipulation_ts_1 = require("./addressManipulation.js");
|
|
|
9
8
|
* @returns A reference to the workbook range.
|
|
10
9
|
*/
|
|
11
10
|
function createWorkbookRangeRef(worksheetRef, address) {
|
|
12
|
-
const addressNormalized = (0, addressManipulation_ts_1.composeAddress)((0, addressManipulation_ts_1.decomposeAddress)(address)); // Strip any unexpected prefix (e.g., "Sheet1!") from the address
|
|
13
11
|
return {
|
|
14
12
|
contextId: worksheetRef.contextId,
|
|
15
13
|
siteId: worksheetRef.siteId,
|
|
@@ -17,6 +15,6 @@ function createWorkbookRangeRef(worksheetRef, address) {
|
|
|
17
15
|
itemId: worksheetRef.itemId,
|
|
18
16
|
sessionId: worksheetRef.sessionId,
|
|
19
17
|
worksheetId: worksheetRef.worksheetId,
|
|
20
|
-
address:
|
|
18
|
+
address: address,
|
|
21
19
|
};
|
|
22
20
|
}
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,IAAI,CAAC,CAapG"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Auto-fit the columns in a range.
|
|
@@ -8,10 +9,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
9
|
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-autofitcolumns
|
|
9
10
|
*/
|
|
10
11
|
export default function autoFitWorkbookRangeColumns(rangeRef) {
|
|
12
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
11
13
|
return operation({
|
|
12
14
|
contextId: rangeRef.contextId,
|
|
13
15
|
method: "POST",
|
|
14
|
-
path: generatePath(
|
|
16
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/autofitcolumns`, rangeRef),
|
|
15
17
|
headers: {
|
|
16
18
|
"workbook-session-id": rangeRef.sessionId,
|
|
17
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clearWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/clearWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"clearWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/clearWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,OAAO,GAAE,KAAK,GAAG,SAAS,GAAG,UAAkB,GAAG,cAAc,CAAC,IAAI,CAAC,CAgB5I"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Clear a range - content, formatting, or both.
|
|
@@ -9,10 +10,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
10
|
* @see https://learn.microsoft.com/en-us/graph/api/range-delete
|
|
10
11
|
*/
|
|
11
12
|
export default function clearWorkbookRange(rangeRef, applyTo = "All") {
|
|
13
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
12
14
|
return operation({
|
|
13
15
|
contextId: rangeRef.contextId,
|
|
14
16
|
method: "POST",
|
|
15
|
-
path: generatePath(
|
|
17
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/clear`, rangeRef),
|
|
16
18
|
headers: {
|
|
17
19
|
"workbook-session-id": rangeRef.sessionId,
|
|
18
20
|
"content-type": "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/deleteWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"deleteWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/deleteWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,cAAc,CAAC,IAAI,CAAC,CAgBlH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Delete a range.
|
|
@@ -9,10 +10,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
10
|
* @see https://learn.microsoft.com/en-us/graph/api/range-clear
|
|
10
11
|
*/
|
|
11
12
|
export default function deleteWorkbookRange(rangeRef, shift) {
|
|
13
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
12
14
|
return operation({
|
|
13
15
|
contextId: rangeRef.contextId,
|
|
14
16
|
method: "POST",
|
|
15
|
-
path: generatePath(
|
|
17
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/delete`, rangeRef),
|
|
16
18
|
headers: {
|
|
17
19
|
"workbook-session-id": rangeRef.sessionId,
|
|
18
20
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAmB7H"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
2
2
|
import { operation } from "../../graphApi.js";
|
|
3
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
3
4
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
4
5
|
/**
|
|
5
6
|
* Retrieve the fill format of a workbook range.
|
|
@@ -9,10 +10,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
10
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-get
|
|
10
11
|
*/
|
|
11
12
|
export default function getWorkbookRangeFill(rangeRef) {
|
|
13
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
12
14
|
return operation({
|
|
13
15
|
contextId: rangeRef.contextId,
|
|
14
16
|
method: "GET",
|
|
15
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
17
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/fill`, rangeRef),
|
|
16
18
|
headers: {
|
|
17
19
|
"workbook-session-id": rangeRef.sessionId,
|
|
18
20
|
},
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAmB7H"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
2
2
|
import { operation } from "../../graphApi.js";
|
|
3
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
3
4
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
4
5
|
/**
|
|
5
6
|
* Retrieve the font format of a workbook range.
|
|
@@ -9,10 +10,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
10
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-get
|
|
10
11
|
*/
|
|
11
12
|
export default function getWorkbookRangeFont(rangeRef) {
|
|
13
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
12
14
|
return operation({
|
|
13
15
|
contextId: rangeRef.contextId,
|
|
14
16
|
method: "GET",
|
|
15
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
17
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/font`, rangeRef),
|
|
16
18
|
headers: {
|
|
17
19
|
"workbook-session-id": rangeRef.sessionId,
|
|
18
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"AAAA,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;
|
|
1
|
+
{"version":3,"file":"getWorkbookRangeFormat.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookRangeFormat.ts"],"names":[],"mappings":"AAAA,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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAmBjI"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Retrieve the format of a workbook range.
|
|
@@ -8,10 +9,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
9
|
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-get
|
|
9
10
|
*/
|
|
10
11
|
export default function getWorkbookRangeFormat(rangeRef) {
|
|
12
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
11
13
|
return operation({
|
|
12
14
|
contextId: rangeRef.contextId,
|
|
13
15
|
method: "GET",
|
|
14
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
16
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format`, rangeRef),
|
|
15
17
|
headers: {
|
|
16
18
|
"workbook-session-id": rangeRef.sessionId,
|
|
17
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookVisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookVisibleRange.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;
|
|
1
|
+
{"version":3,"file":"getWorkbookVisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookVisibleRange.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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAqBhI"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Retrieve the visible view of a range.
|
|
@@ -8,11 +9,12 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
9
|
* @see https://learn.microsoft.com/en-us/graph/api/workbookrange-visibleview
|
|
9
10
|
*/
|
|
10
11
|
export default function getWorkbookVisibleRange(rangeRef) {
|
|
12
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
11
13
|
// TODO: Should be a visible ref type?
|
|
12
14
|
return operation({
|
|
13
15
|
contextId: rangeRef.contextId,
|
|
14
16
|
method: "GET",
|
|
15
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
17
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/visibleView`, rangeRef),
|
|
16
18
|
headers: {
|
|
17
19
|
"workbook-session-id": rangeRef.sessionId,
|
|
18
20
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"getWorkbookWorksheetRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/getWorkbookWorksheetRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAoB9H"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Fetch a range, including values and formatting.
|
|
@@ -8,10 +9,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
9
|
* @see https://learn.microsoft.com/en-us/graph/api/range-get
|
|
9
10
|
*/
|
|
10
11
|
export default function getWorkbookWorksheetRange(rangeRef) {
|
|
12
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
11
13
|
return operation({
|
|
12
14
|
contextId: rangeRef.contextId,
|
|
13
15
|
method: "GET",
|
|
14
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
16
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
15
17
|
headers: {
|
|
16
18
|
"workbook-session-id": rangeRef.sessionId,
|
|
17
19
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertWorkbookCells.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/insertWorkbookCells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"insertWorkbookCells.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/insertWorkbookCells.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAGtE,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAKjF;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAwB3K"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import ProtocolError from "../../errors/ProtocolError.js";
|
|
2
2
|
import { operation } from "../../graphApi.js";
|
|
3
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
3
4
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
4
5
|
import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
5
6
|
/**
|
|
@@ -15,7 +16,7 @@ export default function insertWorkbookCells(worksheetRef, address, shift) {
|
|
|
15
16
|
return operation({
|
|
16
17
|
contextId: worksheetRef.contextId,
|
|
17
18
|
method: "POST",
|
|
18
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/insert`, worksheetRef),
|
|
19
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${normalizeAddress(address)}')/insert`, worksheetRef),
|
|
19
20
|
headers: {
|
|
20
21
|
"workbook-session-id": worksheetRef.sessionId,
|
|
21
22
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAcxH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Update the fill format of a workbook range.
|
|
@@ -8,10 +9,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
9
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefill-update
|
|
9
10
|
*/
|
|
10
11
|
export default function setWorkbookRangeFill(rangeRef, format) {
|
|
12
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
11
13
|
return operation({
|
|
12
14
|
contextId: rangeRef.contextId,
|
|
13
15
|
method: "PATCH",
|
|
14
|
-
path: generatePath(
|
|
16
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/fill`, rangeRef),
|
|
15
17
|
headers: {
|
|
16
18
|
"workbook-session-id": rangeRef.sessionId,
|
|
17
19
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,GAAG,cAAc,CAAC,IAAI,CAAC,CAcxH"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Update the font format of a workbook range.
|
|
@@ -8,10 +9,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
9
|
* @see https://learn.microsoft.com/en-us/graph/api/rangefont-update
|
|
9
10
|
*/
|
|
10
11
|
export default function setWorkbookRangeFont(rangeRef, format) {
|
|
12
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
11
13
|
return operation({
|
|
12
14
|
contextId: rangeRef.contextId,
|
|
13
15
|
method: "PATCH",
|
|
14
|
-
path: generatePath(
|
|
16
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/font`, rangeRef),
|
|
15
17
|
headers: {
|
|
16
18
|
"workbook-session-id": rangeRef.sessionId,
|
|
17
19
|
"content-type": "application/json",
|
|
@@ -1 +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;
|
|
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;AAIzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,mBAAmB,GAAG,cAAc,CAAC,IAAI,CAAC,CAc5H"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// PATCH /sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='{address}')/format
|
|
2
2
|
// https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
3
3
|
import { operation } from "../../graphApi.js";
|
|
4
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
4
5
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
5
6
|
/**
|
|
6
7
|
* Update the general format of a workbook range.
|
|
@@ -10,10 +11,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
11
|
* @see https://learn.microsoft.com/en-us/graph/api/rangeformat-update
|
|
11
12
|
*/
|
|
12
13
|
export default function setWorkbookRangeFormat(rangeRef, format) {
|
|
14
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
13
15
|
return operation({
|
|
14
16
|
contextId: rangeRef.contextId,
|
|
15
17
|
method: "PATCH",
|
|
16
|
-
path: generatePath(
|
|
18
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format`, rangeRef),
|
|
17
19
|
headers: {
|
|
18
20
|
"workbook-session-id": rangeRef.sessionId,
|
|
19
21
|
"content-type": "application/json",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/updateWorkbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"updateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookRange/updateWorkbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAIzE;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,GAAG,cAAc,CAAC,aAAa,GAAG,gBAAgB,CAAC,CAqB/I"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
|
+
import { normalizeAddress } from "../../services/addressManipulation.js";
|
|
2
3
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
4
|
/**
|
|
4
5
|
* Update a range, including values and formatting. Properties that aren't included in the request maintain their previous values or are recalculated based on changes to other property values.
|
|
@@ -9,10 +10,11 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
10
|
* @see https://learn.microsoft.com/en-us/graph/api/range-update
|
|
10
11
|
*/
|
|
11
12
|
export default function updateWorkbookRange(rangeRef, update) {
|
|
13
|
+
const address = normalizeAddress(rangeRef.address, true);
|
|
12
14
|
return operation({
|
|
13
15
|
contextId: rangeRef.contextId,
|
|
14
16
|
method: "PATCH",
|
|
15
|
-
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${
|
|
17
|
+
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
16
18
|
headers: {
|
|
17
19
|
"workbook-session-id": rangeRef.sessionId,
|
|
18
20
|
"content-type": "application/json",
|
|
@@ -5,6 +5,13 @@ export type AddressComponents = {
|
|
|
5
5
|
startRow: RowAddress;
|
|
6
6
|
endRow: RowAddress;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* Fixes address, removing an optional sheet prefix and ensuring it is a valid range.
|
|
10
|
+
* @param address - The address to normalize.
|
|
11
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. This is useful to workaround API quirks.
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizeAddress(address: Address, forceRange?: boolean): Address;
|
|
8
15
|
/**
|
|
9
16
|
* Decomposes an address into its components (start and end columns/rows).
|
|
10
17
|
* @param address - The address to decompose.
|
|
@@ -15,10 +22,11 @@ export declare function decomposeAddress(address: Address): AddressComponents;
|
|
|
15
22
|
/**
|
|
16
23
|
* Composes an address from its components.
|
|
17
24
|
* @param components - The address components.
|
|
25
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. Used to workaround API quirks
|
|
18
26
|
* @returns The composed address.
|
|
19
27
|
* @throws InvalidArgumentError if the components are invalid.
|
|
20
28
|
*/
|
|
21
|
-
export declare function composeAddress(components: AddressComponents): Address;
|
|
29
|
+
export declare function composeAddress(components: AddressComponents, forceRange?: boolean): Address;
|
|
22
30
|
/**
|
|
23
31
|
* Gets the first cell address from a given address.
|
|
24
32
|
* @param address - The address to analyze.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/addressManipulation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAoB,aAAa,EAAsB,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AAmBnJ,MAAM,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"addressManipulation.d.ts","sourceRoot":"","sources":["../../../src/services/addressManipulation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAoB,aAAa,EAAsB,UAAU,EAAmB,MAAM,sBAAsB,CAAC;AAmBnJ,MAAM,MAAM,iBAAiB,GAAG;IAC/B,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,aAAa,CAAC;IACzB,QAAQ,EAAE,UAAU,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,UAAQ,GAAG,OAAO,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,iBAAiB,CAcpE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,EAAE,UAAU,UAAQ,GAAG,OAAO,CAsBzF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAGjE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAGhE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS3D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS/D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAS9D;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAqChG;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAKlF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG/D;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG7D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAG1D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAGzD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAG5D"}
|
|
@@ -6,6 +6,15 @@ const lastColumn = "XFD";
|
|
|
6
6
|
const firstRow = "1";
|
|
7
7
|
const lastRow = "1048576";
|
|
8
8
|
const addressPattern = /^(?<sheet>(?:'[^']+'|[A-Za-z0-9_]+)!)?(?:(?<startColumn>[A-Z]+)?(?<startRow>\d+)?(?::(?<endColumn>[A-Z]+)?(?<endRow>\d+)?)?)$/;
|
|
9
|
+
/**
|
|
10
|
+
* Fixes address, removing an optional sheet prefix and ensuring it is a valid range.
|
|
11
|
+
* @param address - The address to normalize.
|
|
12
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. This is useful to workaround API quirks.
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
export function normalizeAddress(address, forceRange = false) {
|
|
16
|
+
return composeAddress(decomposeAddress(address), forceRange);
|
|
17
|
+
}
|
|
9
18
|
/**
|
|
10
19
|
* Decomposes an address into its components (start and end columns/rows).
|
|
11
20
|
* @param address - The address to decompose.
|
|
@@ -28,14 +37,15 @@ export function decomposeAddress(address) {
|
|
|
28
37
|
/**
|
|
29
38
|
* Composes an address from its components.
|
|
30
39
|
* @param components - The address components.
|
|
40
|
+
* @param forceRange - If true, forces the address to be a range even if it represents a single cell or row/column. Used to workaround API quirks
|
|
31
41
|
* @returns The composed address.
|
|
32
42
|
* @throws InvalidArgumentError if the components are invalid.
|
|
33
43
|
*/
|
|
34
|
-
export function composeAddress(components) {
|
|
35
|
-
if (isSingleColumn(components) && isAllRows(components)) {
|
|
44
|
+
export function composeAddress(components, forceRange = false) {
|
|
45
|
+
if (!forceRange && isSingleColumn(components) && isAllRows(components)) {
|
|
36
46
|
return composeColumnAddress(components.startColumn);
|
|
37
47
|
}
|
|
38
|
-
if (isSingleRow(components) && isAllColumns(components)) {
|
|
48
|
+
if (!forceRange && isSingleRow(components) && isAllColumns(components)) {
|
|
39
49
|
return composeRowAddress(components.startRow);
|
|
40
50
|
}
|
|
41
51
|
if (isAllRows(components)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbookRange.d.ts","sourceRoot":"","sources":["../../../src/services/workbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"workbookRange.d.ts","sourceRoot":"","sources":["../../../src/services/workbookRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,GAAG,gBAAgB,CAU7G"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { composeAddress, decomposeAddress } from "./addressManipulation.js";
|
|
2
1
|
/**
|
|
3
2
|
* Creates a reference to a workbook range.
|
|
4
3
|
* @param worksheetRef - The reference to the worksheet containing the range.
|
|
@@ -6,7 +5,6 @@ import { composeAddress, decomposeAddress } from "./addressManipulation.js";
|
|
|
6
5
|
* @returns A reference to the workbook range.
|
|
7
6
|
*/
|
|
8
7
|
export function createWorkbookRangeRef(worksheetRef, address) {
|
|
9
|
-
const addressNormalized = composeAddress(decomposeAddress(address)); // Strip any unexpected prefix (e.g., "Sheet1!") from the address
|
|
10
8
|
return {
|
|
11
9
|
contextId: worksheetRef.contextId,
|
|
12
10
|
siteId: worksheetRef.siteId,
|
|
@@ -14,6 +12,6 @@ export function createWorkbookRangeRef(worksheetRef, address) {
|
|
|
14
12
|
itemId: worksheetRef.itemId,
|
|
15
13
|
sessionId: worksheetRef.sessionId,
|
|
16
14
|
worksheetId: worksheetRef.worksheetId,
|
|
17
|
-
address:
|
|
15
|
+
address: address,
|
|
18
16
|
};
|
|
19
17
|
}
|