microsoft-graph 2.15.1 → 2.16.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.
- package/dist/cjs/models/Cell.d.ts +8 -0
- package/dist/cjs/models/Cell.d.ts.map +1 -0
- package/dist/cjs/models/Cell.js +2 -0
- package/dist/cjs/models/NumberFormat.d.ts +4 -0
- package/dist/cjs/models/NumberFormat.d.ts.map +1 -0
- package/dist/cjs/models/NumberFormat.js +2 -0
- package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts +12 -0
- package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts.map +1 -0
- package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js +36 -0
- package/dist/cjs/services/addressManipulation.d.ts.map +1 -1
- package/dist/cjs/services/addressManipulation.js +0 -6
- package/dist/cjs/services/cartesianAddress.d.ts +1 -1
- package/dist/cjs/services/cartesianAddress.d.ts.map +1 -1
- package/dist/cjs/services/cartesianAddress.js +15 -5
- package/dist/cjs/tasks/iterateWorkbookRange.d.ts +11 -0
- package/dist/cjs/tasks/iterateWorkbookRange.d.ts.map +1 -0
- package/dist/cjs/tasks/iterateWorkbookRange.js +62 -0
- package/dist/cjs/tasks/iterateWorkbookRangeValues.d.ts +1 -0
- package/dist/cjs/tasks/iterateWorkbookRangeValues.d.ts.map +1 -1
- package/dist/cjs/tasks/iterateWorkbookRangeValues.js +1 -0
- package/dist/esm/models/Cell.d.ts +8 -0
- package/dist/esm/models/Cell.d.ts.map +1 -0
- package/dist/esm/models/Cell.js +1 -0
- package/dist/esm/models/NumberFormat.d.ts +4 -0
- package/dist/esm/models/NumberFormat.d.ts.map +1 -0
- package/dist/esm/models/NumberFormat.js +1 -0
- package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts +12 -0
- package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts.map +1 -0
- package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js +30 -0
- package/dist/esm/services/addressManipulation.d.ts.map +1 -1
- package/dist/esm/services/addressManipulation.js +0 -6
- package/dist/esm/services/cartesianAddress.d.ts +1 -1
- package/dist/esm/services/cartesianAddress.d.ts.map +1 -1
- package/dist/esm/services/cartesianAddress.js +12 -5
- package/dist/esm/tasks/iterateWorkbookRange.d.ts +11 -0
- package/dist/esm/tasks/iterateWorkbookRange.d.ts.map +1 -0
- package/dist/esm/tasks/iterateWorkbookRange.js +56 -0
- package/dist/esm/tasks/iterateWorkbookRangeValues.d.ts +1 -0
- package/dist/esm/tasks/iterateWorkbookRangeValues.d.ts.map +1 -1
- package/dist/esm/tasks/iterateWorkbookRangeValues.js +1 -0
- package/package.json +101 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberFormat.d.ts","sourceRoot":"","sources":["../../../src/models/NumberFormat.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IACnC,OAAO,EAAE,cAAc,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Address } from "../../models/Address.ts";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookWorksheetRef } from "../../models/WorkbookWorksheetRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the address of the used range in a worksheet, ignoring trailing rows and columns that are blank.
|
|
6
|
+
*
|
|
7
|
+
* @param worksheetRef - A reference to the worksheet, optionally including session information.
|
|
8
|
+
* @returns Address of the used range of the worksheet.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/range-usedrange
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookWorksheetUsedRangeAddress(worksheetRef: WorkbookWorksheetRef): GraphOperation<Address>;
|
|
12
|
+
//# sourceMappingURL=getWorkbookWorksheetUsedRangeAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWorkbookWorksheetUsedRangeAddress.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAIjF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oCAAoC,CAAC,YAAY,EAAE,oBAAoB,GAAG,cAAc,CAAC,OAAO,CAAC,CAmBxH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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.default = getWorkbookWorksheetUsedRangeAddress;
|
|
7
|
+
const ProtocolError_ts_1 = __importDefault(require("../../errors/ProtocolError.js"));
|
|
8
|
+
const graphApi_ts_1 = require("../../graphApi.js");
|
|
9
|
+
const addressManipulation_ts_1 = require("../../services/addressManipulation.js");
|
|
10
|
+
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
11
|
+
/**
|
|
12
|
+
* Retrieve the address of the used range in a worksheet, ignoring trailing rows and columns that are blank.
|
|
13
|
+
*
|
|
14
|
+
* @param worksheetRef - A reference to the worksheet, optionally including session information.
|
|
15
|
+
* @returns Address of the used range of the worksheet.
|
|
16
|
+
* @see https://learn.microsoft.com/en-us/graph/api/range-usedrange
|
|
17
|
+
*/
|
|
18
|
+
function getWorkbookWorksheetUsedRangeAddress(worksheetRef) {
|
|
19
|
+
return (0, graphApi_ts_1.operation)({
|
|
20
|
+
contextId: worksheetRef.contextId,
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange?$select=address", worksheetRef),
|
|
23
|
+
headers: {
|
|
24
|
+
"workbook-session-id": worksheetRef.sessionId,
|
|
25
|
+
},
|
|
26
|
+
body: null,
|
|
27
|
+
responseTransform: (response) => {
|
|
28
|
+
const range = response;
|
|
29
|
+
if (!range.address) {
|
|
30
|
+
throw new ProtocolError_ts_1.default("Invalid response: address is missing");
|
|
31
|
+
}
|
|
32
|
+
const address = (0, addressManipulation_ts_1.composeAddress)((0, addressManipulation_ts_1.decomposeAddress)(range.address)); // Strip any prefixed sheet name
|
|
33
|
+
return address;
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
@@ -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,iBAAiB,CAcpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,
|
|
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,iBAAiB,CAcpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAsBrE;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"}
|
|
@@ -70,12 +70,6 @@ function composeAddress(components) {
|
|
|
70
70
|
if (isSingleColumn(components) && isSingleRow(components)) {
|
|
71
71
|
return composeCellAddress(components.startColumn, components.startRow);
|
|
72
72
|
}
|
|
73
|
-
if (components.startColumn > components.endColumn) {
|
|
74
|
-
throw new InvalidArgumentError_ts_1.default("Invalid address. End column is before start column.");
|
|
75
|
-
}
|
|
76
|
-
if (components.startRow > components.endRow) {
|
|
77
|
-
throw new InvalidArgumentError_ts_1.default("Invalid address. End row is before start row.");
|
|
78
|
-
}
|
|
79
73
|
return composeCellRangeAddress(components.startColumn, components.startRow, components.endColumn, components.endRow);
|
|
80
74
|
}
|
|
81
75
|
/**
|
|
@@ -13,5 +13,5 @@ export declare function addressToCartesian(address: Address): Cartesian;
|
|
|
13
13
|
* @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
|
|
14
14
|
* @returns {Address} The cell range address (e.g., "A1:C3").
|
|
15
15
|
*/
|
|
16
|
-
export declare function cartesianToAddress(
|
|
16
|
+
export declare function cartesianToAddress({ ax, ay, bx, by }: Cartesian): Address;
|
|
17
17
|
//# sourceMappingURL=cartesianAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AACA,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,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAqBzE"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.addressToCartesian = addressToCartesian;
|
|
4
7
|
exports.cartesianToAddress = cartesianToAddress;
|
|
8
|
+
const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
|
|
5
9
|
const addressManipulation_ts_1 = require("./addressManipulation.js");
|
|
6
10
|
const addressOffset_ts_1 = require("./addressOffset.js");
|
|
7
11
|
/**
|
|
@@ -24,11 +28,17 @@ function addressToCartesian(address) {
|
|
|
24
28
|
* @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
|
|
25
29
|
* @returns {Address} The cell range address (e.g., "A1:C3").
|
|
26
30
|
*/
|
|
27
|
-
function cartesianToAddress(
|
|
28
|
-
const startColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(
|
|
29
|
-
const startRow = (0, addressOffset_ts_1.rowOffsetToAddress)(
|
|
30
|
-
const endColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(
|
|
31
|
-
const endRow = (0, addressOffset_ts_1.rowOffsetToAddress)(
|
|
31
|
+
function cartesianToAddress({ ax, ay, bx, by }) {
|
|
32
|
+
const startColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(ax);
|
|
33
|
+
const startRow = (0, addressOffset_ts_1.rowOffsetToAddress)(ay);
|
|
34
|
+
const endColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(bx);
|
|
35
|
+
const endRow = (0, addressOffset_ts_1.rowOffsetToAddress)(by);
|
|
36
|
+
if (ax > bx) {
|
|
37
|
+
throw new InvalidArgumentError_ts_1.default("Invalid address. End column is before start column.");
|
|
38
|
+
}
|
|
39
|
+
if (ay > by) {
|
|
40
|
+
throw new InvalidArgumentError_ts_1.default("Invalid address. End row is before start row.");
|
|
41
|
+
}
|
|
32
42
|
const address = (0, addressManipulation_ts_1.composeAddress)({
|
|
33
43
|
startRow,
|
|
34
44
|
startColumn,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Cell } from "../models/Cell.ts";
|
|
2
|
+
import type { WorkbookRangeRef } from "../models/WorkbookRangeRef.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Iterates over the values of a workbook range in chunks, fetching data in manageable sizes.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
7
|
+
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
8
|
+
* @returns An async iterable that yields rows of range values.
|
|
9
|
+
*/
|
|
10
|
+
export default function iterateWorkbookRange(rangeRef: WorkbookRangeRef, overwriteRowsPerRequest?: number | null): AsyncIterable<Cell[]>;
|
|
11
|
+
//# sourceMappingURL=iterateWorkbookRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AActE;;;;;;GAMG;AACH,wBAA+B,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,CA6CpJ"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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.default = iterateWorkbookRange;
|
|
7
|
+
const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
|
|
8
|
+
const getWorkbookWorksheetRange_ts_1 = __importDefault(require("../operations/workbookRange/getWorkbookWorksheetRange.js"));
|
|
9
|
+
const addressManipulation_ts_1 = require("../services/addressManipulation.js");
|
|
10
|
+
const addressOffset_ts_1 = require("../services/addressOffset.js");
|
|
11
|
+
const workbookRange_ts_1 = require("../services/workbookRange.js");
|
|
12
|
+
/**
|
|
13
|
+
* Maximum number of cells that can be retrieved in a single request, unless overwritten.
|
|
14
|
+
* @remarks The Microsoft Graph API documentation does not specify a fixed maximum number of cells that can be retrieved in a single request.
|
|
15
|
+
* However, it mentions that large ranges may result in errors due to resource constraints. Additionally, discussions in developer
|
|
16
|
+
* communities suggest that requests exceeding 10,000 cells may encounter issues.
|
|
17
|
+
*/
|
|
18
|
+
const maxCellsPerRequest = 10_000;
|
|
19
|
+
/**
|
|
20
|
+
* Iterates over the values of a workbook range in chunks, fetching data in manageable sizes.
|
|
21
|
+
*
|
|
22
|
+
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
23
|
+
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
24
|
+
* @returns An async iterable that yields rows of range values.
|
|
25
|
+
*/
|
|
26
|
+
async function* iterateWorkbookRange(rangeRef, overwriteRowsPerRequest = null) {
|
|
27
|
+
const address = rangeRef.address;
|
|
28
|
+
const components = (0, addressManipulation_ts_1.decomposeAddress)(address);
|
|
29
|
+
const columnsPerRow = (0, addressOffset_ts_1.columnAddressToOffset)(components.endColumn) - (0, addressOffset_ts_1.columnAddressToOffset)(components.startColumn) + 1;
|
|
30
|
+
if (overwriteRowsPerRequest !== null && overwriteRowsPerRequest < 1) {
|
|
31
|
+
throw new InvalidArgumentError_ts_1.default("overwriteRowsPerRequest must be greater than 0");
|
|
32
|
+
}
|
|
33
|
+
const columnCount = (0, addressManipulation_ts_1.countAddressColumns)(address);
|
|
34
|
+
const rowsPerRequest = overwriteRowsPerRequest ?? Math.floor(maxCellsPerRequest / columnsPerRow);
|
|
35
|
+
const rangeStartRowOffset = (0, addressOffset_ts_1.rowAddressToOffset)(components.startRow);
|
|
36
|
+
const rangeEndRowOffset = (0, addressOffset_ts_1.rowAddressToOffset)(components.endRow);
|
|
37
|
+
for (let chunkRowOffset = rangeStartRowOffset; chunkRowOffset <= rangeEndRowOffset; chunkRowOffset = (chunkRowOffset + rowsPerRequest)) {
|
|
38
|
+
const requestStartRowOffset = chunkRowOffset;
|
|
39
|
+
const requestEndRowOffset = Math.min(chunkRowOffset + rowsPerRequest - 1, rangeEndRowOffset);
|
|
40
|
+
const chunkStartRow = (0, addressOffset_ts_1.rowOffsetToAddress)(requestStartRowOffset);
|
|
41
|
+
const chunkEndRow = (0, addressOffset_ts_1.rowOffsetToAddress)(requestEndRowOffset);
|
|
42
|
+
const requestAddress = (0, addressManipulation_ts_1.composeAddress)({
|
|
43
|
+
startRow: chunkStartRow,
|
|
44
|
+
endRow: chunkEndRow,
|
|
45
|
+
startColumn: components.startColumn,
|
|
46
|
+
endColumn: components.endColumn,
|
|
47
|
+
});
|
|
48
|
+
const requestRef = (0, workbookRange_ts_1.createWorkbookRangeRef)(rangeRef, requestAddress);
|
|
49
|
+
const range = await (0, getWorkbookWorksheetRange_ts_1.default)(requestRef);
|
|
50
|
+
const values = range.values;
|
|
51
|
+
const text = range.text;
|
|
52
|
+
const numberFormat = range.numberFormat;
|
|
53
|
+
const rowCount = values.length;
|
|
54
|
+
for (let r = 0; r < rowCount; r++) {
|
|
55
|
+
yield Array.from({ length: columnCount }, (_, c) => ({
|
|
56
|
+
text: text[r]?.[c] ?? "",
|
|
57
|
+
value: values[r]?.[c] ?? "",
|
|
58
|
+
numberFormat: numberFormat?.[r]?.[c] ?? "",
|
|
59
|
+
}));
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -6,6 +6,7 @@ import type { WorkbookRangeRef } from "../models/WorkbookRangeRef.ts";
|
|
|
6
6
|
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
7
7
|
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
8
8
|
* @returns An async iterable that yields rows of range values.
|
|
9
|
+
* @deprecated Use `iterateWorkbookRange` instead.
|
|
9
10
|
*/
|
|
10
11
|
export default function iterateWorkbookRangeValues(rangeRef: WorkbookRangeRef, overwriteRowsPerRequest?: number | null): AsyncIterable<RowRangeValues>;
|
|
11
12
|
//# sourceMappingURL=iterateWorkbookRangeValues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterateWorkbookRangeValues.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRangeValues.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AActE
|
|
1
|
+
{"version":3,"file":"iterateWorkbookRangeValues.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRangeValues.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AActE;;;;;;;GAOG;AACH,wBAA+B,0BAA0B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,cAAc,CAAC,CAoClK"}
|
|
@@ -22,6 +22,7 @@ const maxCellsPerRequest = 10_000;
|
|
|
22
22
|
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
23
23
|
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
24
24
|
* @returns An async iterable that yields rows of range values.
|
|
25
|
+
* @deprecated Use `iterateWorkbookRange` instead.
|
|
25
26
|
*/
|
|
26
27
|
async function* iterateWorkbookRangeValues(rangeRef, overwriteRowsPerRequest = null) {
|
|
27
28
|
const address = rangeRef.address;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cell.d.ts","sourceRoot":"","sources":["../../../src/models/Cell.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,YAAY,EAAE,YAAY,CAAC;CAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberFormat.d.ts","sourceRoot":"","sources":["../../../src/models/NumberFormat.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG;IACnC,OAAO,EAAE,cAAc,CAAC;CACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Address } from "../../models/Address.ts";
|
|
2
|
+
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
+
import type { WorkbookWorksheetRef } from "../../models/WorkbookWorksheetRef.ts";
|
|
4
|
+
/**
|
|
5
|
+
* Retrieve the address of the used range in a worksheet, ignoring trailing rows and columns that are blank.
|
|
6
|
+
*
|
|
7
|
+
* @param worksheetRef - A reference to the worksheet, optionally including session information.
|
|
8
|
+
* @returns Address of the used range of the worksheet.
|
|
9
|
+
* @see https://learn.microsoft.com/en-us/graph/api/range-usedrange
|
|
10
|
+
*/
|
|
11
|
+
export default function getWorkbookWorksheetUsedRangeAddress(worksheetRef: WorkbookWorksheetRef): GraphOperation<Address>;
|
|
12
|
+
//# sourceMappingURL=getWorkbookWorksheetUsedRangeAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getWorkbookWorksheetUsedRangeAddress.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAoB,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAIjF;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,oCAAoC,CAAC,YAAY,EAAE,oBAAoB,GAAG,cAAc,CAAC,OAAO,CAAC,CAmBxH"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import ProtocolError from "../../errors/ProtocolError.js";
|
|
2
|
+
import { operation } from "../../graphApi.js";
|
|
3
|
+
import { composeAddress, decomposeAddress } from "../../services/addressManipulation.js";
|
|
4
|
+
import { generatePath } from "../../services/templatedPaths.js";
|
|
5
|
+
/**
|
|
6
|
+
* Retrieve the address of the used range in a worksheet, ignoring trailing rows and columns that are blank.
|
|
7
|
+
*
|
|
8
|
+
* @param worksheetRef - A reference to the worksheet, optionally including session information.
|
|
9
|
+
* @returns Address of the used range of the worksheet.
|
|
10
|
+
* @see https://learn.microsoft.com/en-us/graph/api/range-usedrange
|
|
11
|
+
*/
|
|
12
|
+
export default function getWorkbookWorksheetUsedRangeAddress(worksheetRef) {
|
|
13
|
+
return operation({
|
|
14
|
+
contextId: worksheetRef.contextId,
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange?$select=address", worksheetRef),
|
|
17
|
+
headers: {
|
|
18
|
+
"workbook-session-id": worksheetRef.sessionId,
|
|
19
|
+
},
|
|
20
|
+
body: null,
|
|
21
|
+
responseTransform: (response) => {
|
|
22
|
+
const range = response;
|
|
23
|
+
if (!range.address) {
|
|
24
|
+
throw new ProtocolError("Invalid response: address is missing");
|
|
25
|
+
}
|
|
26
|
+
const address = composeAddress(decomposeAddress(range.address)); // Strip any prefixed sheet name
|
|
27
|
+
return address;
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -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,iBAAiB,CAcpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,
|
|
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,iBAAiB,CAcpE;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,GAAG,OAAO,CAsBrE;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"}
|
|
@@ -47,12 +47,6 @@ export function composeAddress(components) {
|
|
|
47
47
|
if (isSingleColumn(components) && isSingleRow(components)) {
|
|
48
48
|
return composeCellAddress(components.startColumn, components.startRow);
|
|
49
49
|
}
|
|
50
|
-
if (components.startColumn > components.endColumn) {
|
|
51
|
-
throw new InvalidArgumentError("Invalid address. End column is before start column.");
|
|
52
|
-
}
|
|
53
|
-
if (components.startRow > components.endRow) {
|
|
54
|
-
throw new InvalidArgumentError("Invalid address. End row is before start row.");
|
|
55
|
-
}
|
|
56
50
|
return composeCellRangeAddress(components.startColumn, components.startRow, components.endColumn, components.endRow);
|
|
57
51
|
}
|
|
58
52
|
/**
|
|
@@ -13,5 +13,5 @@ export declare function addressToCartesian(address: Address): Cartesian;
|
|
|
13
13
|
* @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
|
|
14
14
|
* @returns {Address} The cell range address (e.g., "A1:C3").
|
|
15
15
|
*/
|
|
16
|
-
export declare function cartesianToAddress(
|
|
16
|
+
export declare function cartesianToAddress({ ax, ay, bx, by }: Cartesian): Address;
|
|
17
17
|
//# sourceMappingURL=cartesianAddress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AACA,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,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAqBzE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import InvalidArgumentError from "../errors/InvalidArgumentError.js";
|
|
1
2
|
import { composeAddress, decomposeAddress } from "./addressManipulation.js";
|
|
2
3
|
import { columnAddressToOffset, columnOffsetToAddress, rowAddressToOffset, rowOffsetToAddress } from "./addressOffset.js";
|
|
3
4
|
/**
|
|
@@ -20,11 +21,17 @@ export function addressToCartesian(address) {
|
|
|
20
21
|
* @param {Cartesian} cartesian - The Cartesian coordinates, including start (ax, ay) and end (bx, by).
|
|
21
22
|
* @returns {Address} The cell range address (e.g., "A1:C3").
|
|
22
23
|
*/
|
|
23
|
-
export function cartesianToAddress(
|
|
24
|
-
const startColumn = columnOffsetToAddress(
|
|
25
|
-
const startRow = rowOffsetToAddress(
|
|
26
|
-
const endColumn = columnOffsetToAddress(
|
|
27
|
-
const endRow = rowOffsetToAddress(
|
|
24
|
+
export function cartesianToAddress({ ax, ay, bx, by }) {
|
|
25
|
+
const startColumn = columnOffsetToAddress(ax);
|
|
26
|
+
const startRow = rowOffsetToAddress(ay);
|
|
27
|
+
const endColumn = columnOffsetToAddress(bx);
|
|
28
|
+
const endRow = rowOffsetToAddress(by);
|
|
29
|
+
if (ax > bx) {
|
|
30
|
+
throw new InvalidArgumentError("Invalid address. End column is before start column.");
|
|
31
|
+
}
|
|
32
|
+
if (ay > by) {
|
|
33
|
+
throw new InvalidArgumentError("Invalid address. End row is before start row.");
|
|
34
|
+
}
|
|
28
35
|
const address = composeAddress({
|
|
29
36
|
startRow,
|
|
30
37
|
startColumn,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Cell } from "../models/Cell.ts";
|
|
2
|
+
import type { WorkbookRangeRef } from "../models/WorkbookRangeRef.ts";
|
|
3
|
+
/**
|
|
4
|
+
* Iterates over the values of a workbook range in chunks, fetching data in manageable sizes.
|
|
5
|
+
*
|
|
6
|
+
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
7
|
+
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
8
|
+
* @returns An async iterable that yields rows of range values.
|
|
9
|
+
*/
|
|
10
|
+
export default function iterateWorkbookRange(rangeRef: WorkbookRangeRef, overwriteRowsPerRequest?: number | null): AsyncIterable<Cell[]>;
|
|
11
|
+
//# sourceMappingURL=iterateWorkbookRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iterateWorkbookRange.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAI9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AActE;;;;;;GAMG;AACH,wBAA+B,oBAAoB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,IAAI,EAAE,CAAC,CA6CpJ"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import InvalidArgumentError from "../errors/InvalidArgumentError.js";
|
|
2
|
+
import getWorkbookWorksheetRange from "../operations/workbookRange/getWorkbookWorksheetRange.js";
|
|
3
|
+
import { composeAddress, countAddressColumns, decomposeAddress } from "../services/addressManipulation.js";
|
|
4
|
+
import { columnAddressToOffset, rowAddressToOffset, rowOffsetToAddress } from "../services/addressOffset.js";
|
|
5
|
+
import { createWorkbookRangeRef } from "../services/workbookRange.js";
|
|
6
|
+
/**
|
|
7
|
+
* Maximum number of cells that can be retrieved in a single request, unless overwritten.
|
|
8
|
+
* @remarks The Microsoft Graph API documentation does not specify a fixed maximum number of cells that can be retrieved in a single request.
|
|
9
|
+
* However, it mentions that large ranges may result in errors due to resource constraints. Additionally, discussions in developer
|
|
10
|
+
* communities suggest that requests exceeding 10,000 cells may encounter issues.
|
|
11
|
+
*/
|
|
12
|
+
const maxCellsPerRequest = 10_000;
|
|
13
|
+
/**
|
|
14
|
+
* Iterates over the values of a workbook range in chunks, fetching data in manageable sizes.
|
|
15
|
+
*
|
|
16
|
+
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
17
|
+
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
18
|
+
* @returns An async iterable that yields rows of range values.
|
|
19
|
+
*/
|
|
20
|
+
export default async function* iterateWorkbookRange(rangeRef, overwriteRowsPerRequest = null) {
|
|
21
|
+
const address = rangeRef.address;
|
|
22
|
+
const components = decomposeAddress(address);
|
|
23
|
+
const columnsPerRow = columnAddressToOffset(components.endColumn) - columnAddressToOffset(components.startColumn) + 1;
|
|
24
|
+
if (overwriteRowsPerRequest !== null && overwriteRowsPerRequest < 1) {
|
|
25
|
+
throw new InvalidArgumentError("overwriteRowsPerRequest must be greater than 0");
|
|
26
|
+
}
|
|
27
|
+
const columnCount = countAddressColumns(address);
|
|
28
|
+
const rowsPerRequest = overwriteRowsPerRequest ?? Math.floor(maxCellsPerRequest / columnsPerRow);
|
|
29
|
+
const rangeStartRowOffset = rowAddressToOffset(components.startRow);
|
|
30
|
+
const rangeEndRowOffset = rowAddressToOffset(components.endRow);
|
|
31
|
+
for (let chunkRowOffset = rangeStartRowOffset; chunkRowOffset <= rangeEndRowOffset; chunkRowOffset = (chunkRowOffset + rowsPerRequest)) {
|
|
32
|
+
const requestStartRowOffset = chunkRowOffset;
|
|
33
|
+
const requestEndRowOffset = Math.min(chunkRowOffset + rowsPerRequest - 1, rangeEndRowOffset);
|
|
34
|
+
const chunkStartRow = rowOffsetToAddress(requestStartRowOffset);
|
|
35
|
+
const chunkEndRow = rowOffsetToAddress(requestEndRowOffset);
|
|
36
|
+
const requestAddress = composeAddress({
|
|
37
|
+
startRow: chunkStartRow,
|
|
38
|
+
endRow: chunkEndRow,
|
|
39
|
+
startColumn: components.startColumn,
|
|
40
|
+
endColumn: components.endColumn,
|
|
41
|
+
});
|
|
42
|
+
const requestRef = createWorkbookRangeRef(rangeRef, requestAddress);
|
|
43
|
+
const range = await getWorkbookWorksheetRange(requestRef);
|
|
44
|
+
const values = range.values;
|
|
45
|
+
const text = range.text;
|
|
46
|
+
const numberFormat = range.numberFormat;
|
|
47
|
+
const rowCount = values.length;
|
|
48
|
+
for (let r = 0; r < rowCount; r++) {
|
|
49
|
+
yield Array.from({ length: columnCount }, (_, c) => ({
|
|
50
|
+
text: text[r]?.[c] ?? "",
|
|
51
|
+
value: values[r]?.[c] ?? "",
|
|
52
|
+
numberFormat: numberFormat?.[r]?.[c] ?? "",
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -6,6 +6,7 @@ import type { WorkbookRangeRef } from "../models/WorkbookRangeRef.ts";
|
|
|
6
6
|
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
7
7
|
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
8
8
|
* @returns An async iterable that yields rows of range values.
|
|
9
|
+
* @deprecated Use `iterateWorkbookRange` instead.
|
|
9
10
|
*/
|
|
10
11
|
export default function iterateWorkbookRangeValues(rangeRef: WorkbookRangeRef, overwriteRowsPerRequest?: number | null): AsyncIterable<RowRangeValues>;
|
|
11
12
|
//# sourceMappingURL=iterateWorkbookRangeValues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iterateWorkbookRangeValues.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRangeValues.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AActE
|
|
1
|
+
{"version":3,"file":"iterateWorkbookRangeValues.d.ts","sourceRoot":"","sources":["../../../src/tasks/iterateWorkbookRangeValues.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AActE;;;;;;;GAOG;AACH,wBAA+B,0BAA0B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,uBAAuB,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAAC,cAAc,CAAC,CAoClK"}
|
|
@@ -16,6 +16,7 @@ const maxCellsPerRequest = 10_000;
|
|
|
16
16
|
* @param rangeRef - A reference to the workbook range to iterate over.
|
|
17
17
|
* @param overwriteRowsPerRequest - Optional. The number of rows to fetch per request. If omitted, it is automatically calculated.
|
|
18
18
|
* @returns An async iterable that yields rows of range values.
|
|
19
|
+
* @deprecated Use `iterateWorkbookRange` instead.
|
|
19
20
|
*/
|
|
20
21
|
export default async function* iterateWorkbookRangeValues(rangeRef, overwriteRowsPerRequest = null) {
|
|
21
22
|
const address = rangeRef.address;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "microsoft-graph",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
4
4
|
"description": "Microsoft GraphAPI SDK for NodeJS",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -442,6 +442,31 @@
|
|
|
442
442
|
"require": "./dist/cjs/models/Cartesian.js",
|
|
443
443
|
"types": "./dist/esm/models/Cartesian.d.ts"
|
|
444
444
|
},
|
|
445
|
+
"./Cell": {
|
|
446
|
+
"import": "./dist/esm/models/Cell.js",
|
|
447
|
+
"require": "./dist/cjs/models/Cell.js",
|
|
448
|
+
"types": "./dist/esm/models/Cell.d.ts"
|
|
449
|
+
},
|
|
450
|
+
"./dist/cjs/models/Cell.js": {
|
|
451
|
+
"import": "./dist/esm/models/Cell.js",
|
|
452
|
+
"require": "./dist/cjs/models/Cell.js",
|
|
453
|
+
"types": "./dist/esm/models/Cell.d.ts"
|
|
454
|
+
},
|
|
455
|
+
"./dist/cjs/models/Cell": {
|
|
456
|
+
"import": "./dist/esm/models/Cell.js",
|
|
457
|
+
"require": "./dist/cjs/models/Cell.js",
|
|
458
|
+
"types": "./dist/esm/models/Cell.d.ts"
|
|
459
|
+
},
|
|
460
|
+
"./models/Cell": {
|
|
461
|
+
"import": "./dist/esm/models/Cell.js",
|
|
462
|
+
"require": "./dist/cjs/models/Cell.js",
|
|
463
|
+
"types": "./dist/esm/models/Cell.d.ts"
|
|
464
|
+
},
|
|
465
|
+
"./models/Cell.js": {
|
|
466
|
+
"import": "./dist/esm/models/Cell.js",
|
|
467
|
+
"require": "./dist/cjs/models/Cell.js",
|
|
468
|
+
"types": "./dist/esm/models/Cell.d.ts"
|
|
469
|
+
},
|
|
445
470
|
"./CellRangeValues": {
|
|
446
471
|
"import": "./dist/esm/models/CellRangeValues.js",
|
|
447
472
|
"require": "./dist/cjs/models/CellRangeValues.js",
|
|
@@ -892,6 +917,31 @@
|
|
|
892
917
|
"require": "./dist/cjs/models/HttpProxy.js",
|
|
893
918
|
"types": "./dist/esm/models/HttpProxy.d.ts"
|
|
894
919
|
},
|
|
920
|
+
"./NumberFormat": {
|
|
921
|
+
"import": "./dist/esm/models/NumberFormat.js",
|
|
922
|
+
"require": "./dist/cjs/models/NumberFormat.js",
|
|
923
|
+
"types": "./dist/esm/models/NumberFormat.d.ts"
|
|
924
|
+
},
|
|
925
|
+
"./dist/cjs/models/NumberFormat.js": {
|
|
926
|
+
"import": "./dist/esm/models/NumberFormat.js",
|
|
927
|
+
"require": "./dist/cjs/models/NumberFormat.js",
|
|
928
|
+
"types": "./dist/esm/models/NumberFormat.d.ts"
|
|
929
|
+
},
|
|
930
|
+
"./dist/cjs/models/NumberFormat": {
|
|
931
|
+
"import": "./dist/esm/models/NumberFormat.js",
|
|
932
|
+
"require": "./dist/cjs/models/NumberFormat.js",
|
|
933
|
+
"types": "./dist/esm/models/NumberFormat.d.ts"
|
|
934
|
+
},
|
|
935
|
+
"./models/NumberFormat": {
|
|
936
|
+
"import": "./dist/esm/models/NumberFormat.js",
|
|
937
|
+
"require": "./dist/cjs/models/NumberFormat.js",
|
|
938
|
+
"types": "./dist/esm/models/NumberFormat.d.ts"
|
|
939
|
+
},
|
|
940
|
+
"./models/NumberFormat.js": {
|
|
941
|
+
"import": "./dist/esm/models/NumberFormat.js",
|
|
942
|
+
"require": "./dist/cjs/models/NumberFormat.js",
|
|
943
|
+
"types": "./dist/esm/models/NumberFormat.d.ts"
|
|
944
|
+
},
|
|
895
945
|
"./RowOffset": {
|
|
896
946
|
"import": "./dist/esm/models/RowOffset.js",
|
|
897
947
|
"require": "./dist/cjs/models/RowOffset.js",
|
|
@@ -2667,6 +2717,31 @@
|
|
|
2667
2717
|
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRange.js",
|
|
2668
2718
|
"types": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRange.d.ts"
|
|
2669
2719
|
},
|
|
2720
|
+
"./getWorkbookWorksheetUsedRangeAddress": {
|
|
2721
|
+
"import": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2722
|
+
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2723
|
+
"types": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts"
|
|
2724
|
+
},
|
|
2725
|
+
"./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js": {
|
|
2726
|
+
"import": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2727
|
+
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2728
|
+
"types": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts"
|
|
2729
|
+
},
|
|
2730
|
+
"./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress": {
|
|
2731
|
+
"import": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2732
|
+
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2733
|
+
"types": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts"
|
|
2734
|
+
},
|
|
2735
|
+
"./operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress": {
|
|
2736
|
+
"import": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2737
|
+
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2738
|
+
"types": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts"
|
|
2739
|
+
},
|
|
2740
|
+
"./operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js": {
|
|
2741
|
+
"import": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2742
|
+
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.js",
|
|
2743
|
+
"types": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeAddress.d.ts"
|
|
2744
|
+
},
|
|
2670
2745
|
"./getWorkbookWorksheetUsedVisibleRange": {
|
|
2671
2746
|
"import": "./dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedVisibleRange.js",
|
|
2672
2747
|
"require": "./dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedVisibleRange.js",
|
|
@@ -3492,6 +3567,31 @@
|
|
|
3492
3567
|
"require": "./dist/cjs/tasks/getWorkbookWorksheetByName.js",
|
|
3493
3568
|
"types": "./dist/esm/tasks/getWorkbookWorksheetByName.d.ts"
|
|
3494
3569
|
},
|
|
3570
|
+
"./iterateWorkbookRange": {
|
|
3571
|
+
"import": "./dist/esm/tasks/iterateWorkbookRange.js",
|
|
3572
|
+
"require": "./dist/cjs/tasks/iterateWorkbookRange.js",
|
|
3573
|
+
"types": "./dist/esm/tasks/iterateWorkbookRange.d.ts"
|
|
3574
|
+
},
|
|
3575
|
+
"./dist/cjs/tasks/iterateWorkbookRange.js": {
|
|
3576
|
+
"import": "./dist/esm/tasks/iterateWorkbookRange.js",
|
|
3577
|
+
"require": "./dist/cjs/tasks/iterateWorkbookRange.js",
|
|
3578
|
+
"types": "./dist/esm/tasks/iterateWorkbookRange.d.ts"
|
|
3579
|
+
},
|
|
3580
|
+
"./dist/cjs/tasks/iterateWorkbookRange": {
|
|
3581
|
+
"import": "./dist/esm/tasks/iterateWorkbookRange.js",
|
|
3582
|
+
"require": "./dist/cjs/tasks/iterateWorkbookRange.js",
|
|
3583
|
+
"types": "./dist/esm/tasks/iterateWorkbookRange.d.ts"
|
|
3584
|
+
},
|
|
3585
|
+
"./tasks/iterateWorkbookRange": {
|
|
3586
|
+
"import": "./dist/esm/tasks/iterateWorkbookRange.js",
|
|
3587
|
+
"require": "./dist/cjs/tasks/iterateWorkbookRange.js",
|
|
3588
|
+
"types": "./dist/esm/tasks/iterateWorkbookRange.d.ts"
|
|
3589
|
+
},
|
|
3590
|
+
"./tasks/iterateWorkbookRange.js": {
|
|
3591
|
+
"import": "./dist/esm/tasks/iterateWorkbookRange.js",
|
|
3592
|
+
"require": "./dist/cjs/tasks/iterateWorkbookRange.js",
|
|
3593
|
+
"types": "./dist/esm/tasks/iterateWorkbookRange.d.ts"
|
|
3594
|
+
},
|
|
3495
3595
|
"./iterateWorkbookRangeValues": {
|
|
3496
3596
|
"import": "./dist/esm/tasks/iterateWorkbookRangeValues.js",
|
|
3497
3597
|
"require": "./dist/cjs/tasks/iterateWorkbookRangeValues.js",
|