microsoft-graph 2.7.5 → 2.7.7
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/Cartesian.d.ts +9 -0
- package/dist/cjs/models/Cartesian.d.ts.map +1 -0
- package/dist/cjs/models/Cartesian.js +2 -0
- package/dist/cjs/models/ColumnName.d.ts +4 -0
- package/dist/cjs/models/ColumnName.d.ts.map +1 -0
- package/dist/cjs/models/ColumnName.js +2 -0
- package/dist/cjs/models/WorkbookTableColumnRef.d.ts +2 -2
- package/dist/cjs/models/WorkbookTableColumnRef.d.ts.map +1 -1
- package/dist/cjs/services/addressManipulation.js +4 -4
- package/dist/cjs/services/addressOffset.d.ts +4 -0
- package/dist/cjs/services/addressOffset.d.ts.map +1 -1
- package/dist/cjs/services/addressOffset.js +12 -2
- package/dist/cjs/services/cartesianAddress.d.ts +5 -0
- package/dist/cjs/services/cartesianAddress.d.ts.map +1 -0
- package/dist/cjs/services/cartesianAddress.js +27 -0
- package/dist/cjs/services/workbookTableColumn.d.ts +3 -3
- package/dist/cjs/services/workbookTableColumn.d.ts.map +1 -1
- package/dist/cjs/services/workbookTableColumn.js +2 -2
- package/dist/cjs/tasks/iterateWorkbookRangeValues.js +2 -2
- package/dist/esm/models/Cartesian.d.ts +9 -0
- package/dist/esm/models/Cartesian.d.ts.map +1 -0
- package/dist/esm/models/Cartesian.js +1 -0
- package/dist/esm/models/ColumnName.d.ts +4 -0
- package/dist/esm/models/ColumnName.d.ts.map +1 -0
- package/dist/esm/models/ColumnName.js +1 -0
- package/dist/esm/models/WorkbookTableColumnRef.d.ts +2 -2
- package/dist/esm/models/WorkbookTableColumnRef.d.ts.map +1 -1
- package/dist/esm/services/addressManipulation.js +5 -5
- package/dist/esm/services/addressOffset.d.ts +4 -0
- package/dist/esm/services/addressOffset.d.ts.map +1 -1
- package/dist/esm/services/addressOffset.js +10 -2
- package/dist/esm/services/cartesianAddress.d.ts +5 -0
- package/dist/esm/services/cartesianAddress.d.ts.map +1 -0
- package/dist/esm/services/cartesianAddress.js +23 -0
- package/dist/esm/services/workbookTableColumn.d.ts +3 -3
- package/dist/esm/services/workbookTableColumn.d.ts.map +1 -1
- package/dist/esm/services/workbookTableColumn.js +2 -2
- package/dist/esm/tasks/iterateWorkbookRangeValues.js +3 -3
- package/package.json +421 -131
- package/update-exports.ts +5 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColumnOffset } from "../models/ColumnOffset.ts";
|
|
2
|
+
import type { RowOffset } from "../models/RowOffset.ts";
|
|
3
|
+
export type Cartesian = {
|
|
4
|
+
ax: ColumnOffset;
|
|
5
|
+
ay: RowOffset;
|
|
6
|
+
bx: ColumnOffset;
|
|
7
|
+
by: RowOffset;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Cartesian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cartesian.d.ts","sourceRoot":"","sources":["../../../src/models/Cartesian.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG;IACvB,EAAE,EAAE,YAAY,CAAC;IACjB,EAAE,EAAE,SAAS,CAAC;IACd,EAAE,EAAE,YAAY,CAAC;IACjB,EAAE,EAAE,SAAS,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnName.d.ts","sourceRoot":"","sources":["../../../src/models/ColumnName.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;CACtB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColumnName } from "./ColumnName.ts";
|
|
2
2
|
import type { WorkbookTableRef } from "./WorkbookTableRef.ts";
|
|
3
3
|
export type WorkbookTableColumnRef = WorkbookTableRef & {
|
|
4
|
-
column:
|
|
4
|
+
column: ColumnName;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=WorkbookTableColumnRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbookTableColumnRef.d.ts","sourceRoot":"","sources":["../../../src/models/WorkbookTableColumnRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"WorkbookTableColumnRef.d.ts","sourceRoot":"","sources":["../../../src/models/WorkbookTableColumnRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG;IACvD,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC"}
|
|
@@ -174,15 +174,15 @@ function offsetAddress(address, columnOffset, rowOffset) {
|
|
|
174
174
|
if (newStartRowIndex < (0, addressOffset_ts_1.rowAddressToOffset)(firstRow) || newEndRowIndex > (0, addressOffset_ts_1.rowAddressToOffset)(lastRow)) {
|
|
175
175
|
throw new InvalidArgumentError_ts_1.default(`Row offset out of bounds: ${newStartRowIndex + 1} to ${newEndRowIndex + 1}`);
|
|
176
176
|
}
|
|
177
|
-
const newStartRow = (0, addressOffset_ts_1.
|
|
178
|
-
const newEndRow = (0, addressOffset_ts_1.
|
|
177
|
+
const newStartRow = (0, addressOffset_ts_1.rowOffsetToAddress)(newStartRowIndex);
|
|
178
|
+
const newEndRow = (0, addressOffset_ts_1.rowOffsetToAddress)(newEndRowIndex);
|
|
179
179
|
const newStartColumnIndex = (0, addressOffset_ts_1.columnAddressToOffset)(components.startColumn) + columnOffset;
|
|
180
180
|
const newEndColumnIndex = (0, addressOffset_ts_1.columnAddressToOffset)(components.endColumn) + columnOffset;
|
|
181
181
|
if (newStartColumnIndex < (0, addressOffset_ts_1.columnAddressToOffset)(firstColumn) || newEndColumnIndex > (0, addressOffset_ts_1.columnAddressToOffset)(lastColumn)) {
|
|
182
182
|
throw new InvalidArgumentError_ts_1.default(`Column offset out of bounds: ${newStartColumnIndex + 1} to ${newEndColumnIndex + 1}`);
|
|
183
183
|
}
|
|
184
|
-
const newStartColumn = (0, addressOffset_ts_1.
|
|
185
|
-
const newEndColumn = (0, addressOffset_ts_1.
|
|
184
|
+
const newStartColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(newStartColumnIndex);
|
|
185
|
+
const newEndColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(newEndColumnIndex);
|
|
186
186
|
return composeAddress({
|
|
187
187
|
startColumn: newStartColumn,
|
|
188
188
|
endColumn: newEndColumn,
|
|
@@ -12,6 +12,8 @@ export declare function columnAddressToOffset(column: ColumnAddress): ColumnOffs
|
|
|
12
12
|
* @param offset - The zero-based column offset.
|
|
13
13
|
* @returns The column address.
|
|
14
14
|
*/
|
|
15
|
+
export declare function columnOffsetToAddress(offset: ColumnOffset): ColumnAddress;
|
|
16
|
+
/** @deprecated Use columnAddressToOffset instead. */
|
|
15
17
|
export declare function offsetToColumnAddress(offset: ColumnOffset): ColumnAddress;
|
|
16
18
|
/**
|
|
17
19
|
* Converts a row address (e.g., "1") to a zero-based row offset.
|
|
@@ -24,5 +26,7 @@ export declare function rowAddressToOffset(row: RowAddress): RowOffset;
|
|
|
24
26
|
* @param offset - The zero-based row offset.
|
|
25
27
|
* @returns The row address.
|
|
26
28
|
*/
|
|
29
|
+
export declare function rowOffsetToAddress(offset: RowOffset): RowAddress;
|
|
30
|
+
/** @deprecated Use rowOffsetToAddress instead. */
|
|
27
31
|
export declare function offsetToRowAddress(offset: RowOffset): RowAddress;
|
|
28
32
|
//# sourceMappingURL=addressOffset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressOffset.d.ts","sourceRoot":"","sources":["../../../src/services/addressOffset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CASzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE"}
|
|
1
|
+
{"version":3,"file":"addressOffset.d.ts","sourceRoot":"","sources":["../../../src/services/addressOffset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CASzE;AAED,qDAAqD;AACrD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE;AAED,kDAAkD;AAClD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.columnAddressToOffset = columnAddressToOffset;
|
|
4
|
+
exports.columnOffsetToAddress = columnOffsetToAddress;
|
|
4
5
|
exports.offsetToColumnAddress = offsetToColumnAddress;
|
|
5
6
|
exports.rowAddressToOffset = rowAddressToOffset;
|
|
7
|
+
exports.rowOffsetToAddress = rowOffsetToAddress;
|
|
6
8
|
exports.offsetToRowAddress = offsetToRowAddress;
|
|
7
9
|
/**
|
|
8
10
|
* Converts a column address (e.g., "A") to a zero-based column offset.
|
|
@@ -21,7 +23,7 @@ function columnAddressToOffset(column) {
|
|
|
21
23
|
* @param offset - The zero-based column offset.
|
|
22
24
|
* @returns The column address.
|
|
23
25
|
*/
|
|
24
|
-
function
|
|
26
|
+
function columnOffsetToAddress(offset) {
|
|
25
27
|
let result = "";
|
|
26
28
|
let currentOffset = offset + 1;
|
|
27
29
|
while (currentOffset > 0) {
|
|
@@ -31,6 +33,10 @@ function offsetToColumnAddress(offset) {
|
|
|
31
33
|
}
|
|
32
34
|
return result;
|
|
33
35
|
}
|
|
36
|
+
/** @deprecated Use columnAddressToOffset instead. */
|
|
37
|
+
function offsetToColumnAddress(offset) {
|
|
38
|
+
return columnOffsetToAddress(offset);
|
|
39
|
+
}
|
|
34
40
|
/**
|
|
35
41
|
* Converts a row address (e.g., "1") to a zero-based row offset.
|
|
36
42
|
* @param row - The row address.
|
|
@@ -44,6 +50,10 @@ function rowAddressToOffset(row) {
|
|
|
44
50
|
* @param offset - The zero-based row offset.
|
|
45
51
|
* @returns The row address.
|
|
46
52
|
*/
|
|
47
|
-
function
|
|
53
|
+
function rowOffsetToAddress(offset) {
|
|
48
54
|
return (offset + 1).toString();
|
|
49
55
|
}
|
|
56
|
+
/** @deprecated Use rowOffsetToAddress instead. */
|
|
57
|
+
function offsetToRowAddress(offset) {
|
|
58
|
+
return rowOffsetToAddress(offset);
|
|
59
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Address } from "../models/Address.ts";
|
|
2
|
+
import type { Cartesian } from "../models/Cartesian.ts";
|
|
3
|
+
export declare function addressToCartesian(address: Address): Cartesian;
|
|
4
|
+
export declare function cartesianToAddress(cartesian: Cartesian): Address;
|
|
5
|
+
//# sourceMappingURL=cartesianAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU9D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAchE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addressToCartesian = addressToCartesian;
|
|
4
|
+
exports.cartesianToAddress = cartesianToAddress;
|
|
5
|
+
const addressManipulation_ts_1 = require("./addressManipulation.js");
|
|
6
|
+
const addressOffset_ts_1 = require("./addressOffset.js");
|
|
7
|
+
function addressToCartesian(address) {
|
|
8
|
+
const components = (0, addressManipulation_ts_1.decomposeAddress)(address);
|
|
9
|
+
const ax = (0, addressOffset_ts_1.columnAddressToOffset)(components.startColumn);
|
|
10
|
+
const ay = (0, addressOffset_ts_1.rowAddressToOffset)(components.startRow);
|
|
11
|
+
const bx = (0, addressOffset_ts_1.columnAddressToOffset)(components.endColumn);
|
|
12
|
+
const by = (0, addressOffset_ts_1.rowAddressToOffset)(components.endRow);
|
|
13
|
+
return { ax, ay, bx, by };
|
|
14
|
+
}
|
|
15
|
+
function cartesianToAddress(cartesian) {
|
|
16
|
+
const startColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(cartesian.ax);
|
|
17
|
+
const startRow = (0, addressOffset_ts_1.rowOffsetToAddress)(cartesian.ay);
|
|
18
|
+
const endColumn = (0, addressOffset_ts_1.columnOffsetToAddress)(cartesian.bx);
|
|
19
|
+
const endRow = (0, addressOffset_ts_1.rowOffsetToAddress)(cartesian.by);
|
|
20
|
+
const address = (0, addressManipulation_ts_1.composeAddress)({
|
|
21
|
+
startRow,
|
|
22
|
+
startColumn,
|
|
23
|
+
endRow,
|
|
24
|
+
endColumn,
|
|
25
|
+
});
|
|
26
|
+
return address;
|
|
27
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColumnName } from "../models/ColumnName.ts";
|
|
2
2
|
import type { WorkbookTableColumnRef } from "../models/WorkbookTableColumnRef.ts";
|
|
3
3
|
import type { WorkbookTableRef } from "../models/WorkbookTableRef.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a reference to a workbook table column.
|
|
6
6
|
* @param tableRef - The reference to the worksheet containing the table.
|
|
7
|
-
* @param column -
|
|
7
|
+
* @param column - Name of the table column
|
|
8
8
|
* @returns A reference to the workbook table.
|
|
9
9
|
* @throws Error if the table ID is missing.
|
|
10
10
|
*/
|
|
11
|
-
export declare function createWorkbookTableColumnRef(tableRef: WorkbookTableRef, column:
|
|
11
|
+
export declare function createWorkbookTableColumnRef(tableRef: WorkbookTableRef, column: ColumnName | string | undefined): WorkbookTableColumnRef;
|
|
12
12
|
//# sourceMappingURL=workbookTableColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbookTableColumn.d.ts","sourceRoot":"","sources":["../../../src/services/workbookTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"workbookTableColumn.d.ts","sourceRoot":"","sources":["../../../src/services/workbookTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,sBAAsB,CAexI"}
|
|
@@ -4,13 +4,13 @@ exports.createWorkbookTableColumnRef = createWorkbookTableColumnRef;
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates a reference to a workbook table column.
|
|
6
6
|
* @param tableRef - The reference to the worksheet containing the table.
|
|
7
|
-
* @param column -
|
|
7
|
+
* @param column - Name of the table column
|
|
8
8
|
* @returns A reference to the workbook table.
|
|
9
9
|
* @throws Error if the table ID is missing.
|
|
10
10
|
*/
|
|
11
11
|
function createWorkbookTableColumnRef(tableRef, column) {
|
|
12
12
|
if (!column) {
|
|
13
|
-
throw new Error("
|
|
13
|
+
throw new Error("column is missing");
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
16
16
|
contextId: tableRef.contextId,
|
|
@@ -36,8 +36,8 @@ async function* iterateWorkbookRangeValues(rangeRef, overwriteRowsPerRequest = n
|
|
|
36
36
|
for (let chunkRowOffset = rangeStartRowOffset; chunkRowOffset <= rangeEndRowOffset; chunkRowOffset = (chunkRowOffset + rowsPerRequest)) {
|
|
37
37
|
const requestStartRowOffset = chunkRowOffset;
|
|
38
38
|
const requestEndRowOffset = Math.min(chunkRowOffset + rowsPerRequest - 1, rangeEndRowOffset);
|
|
39
|
-
const chunkStartRow = (0, addressOffset_ts_1.
|
|
40
|
-
const chunkEndRow = (0, addressOffset_ts_1.
|
|
39
|
+
const chunkStartRow = (0, addressOffset_ts_1.rowOffsetToAddress)(requestStartRowOffset);
|
|
40
|
+
const chunkEndRow = (0, addressOffset_ts_1.rowOffsetToAddress)(requestEndRowOffset);
|
|
41
41
|
const requestAddress = (0, addressManipulation_ts_1.composeAddress)({
|
|
42
42
|
startRow: chunkStartRow,
|
|
43
43
|
endRow: chunkEndRow,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ColumnOffset } from "../models/ColumnOffset.ts";
|
|
2
|
+
import type { RowOffset } from "../models/RowOffset.ts";
|
|
3
|
+
export type Cartesian = {
|
|
4
|
+
ax: ColumnOffset;
|
|
5
|
+
ay: RowOffset;
|
|
6
|
+
bx: ColumnOffset;
|
|
7
|
+
by: RowOffset;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=Cartesian.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cartesian.d.ts","sourceRoot":"","sources":["../../../src/models/Cartesian.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,SAAS,GAAG;IACvB,EAAE,EAAE,YAAY,CAAC;IACjB,EAAE,EAAE,SAAS,CAAC;IACd,EAAE,EAAE,YAAY,CAAC;IACjB,EAAE,EAAE,SAAS,CAAC;CACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColumnName.d.ts","sourceRoot":"","sources":["../../../src/models/ColumnName.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG;IACjC,OAAO,EAAE,YAAY,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColumnName } from "./ColumnName.ts";
|
|
2
2
|
import type { WorkbookTableRef } from "./WorkbookTableRef.ts";
|
|
3
3
|
export type WorkbookTableColumnRef = WorkbookTableRef & {
|
|
4
|
-
column:
|
|
4
|
+
column: ColumnName;
|
|
5
5
|
};
|
|
6
6
|
//# sourceMappingURL=WorkbookTableColumnRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbookTableColumnRef.d.ts","sourceRoot":"","sources":["../../../src/models/WorkbookTableColumnRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"WorkbookTableColumnRef.d.ts","sourceRoot":"","sources":["../../../src/models/WorkbookTableColumnRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GAAG;IACvD,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import InvalidArgumentError from "../errors/InvalidArgumentError.js";
|
|
2
2
|
import UnsupportedAddressTypeError from "../errors/UnsupportedAddressTypeError.js";
|
|
3
|
-
import { columnAddressToOffset,
|
|
3
|
+
import { columnAddressToOffset, columnOffsetToAddress, rowAddressToOffset, rowOffsetToAddress } from "./addressOffset.js";
|
|
4
4
|
const firstColumn = "A";
|
|
5
5
|
const lastColumn = "XFD";
|
|
6
6
|
const firstRow = "1";
|
|
@@ -151,15 +151,15 @@ export function offsetAddress(address, columnOffset, rowOffset) {
|
|
|
151
151
|
if (newStartRowIndex < rowAddressToOffset(firstRow) || newEndRowIndex > rowAddressToOffset(lastRow)) {
|
|
152
152
|
throw new InvalidArgumentError(`Row offset out of bounds: ${newStartRowIndex + 1} to ${newEndRowIndex + 1}`);
|
|
153
153
|
}
|
|
154
|
-
const newStartRow =
|
|
155
|
-
const newEndRow =
|
|
154
|
+
const newStartRow = rowOffsetToAddress(newStartRowIndex);
|
|
155
|
+
const newEndRow = rowOffsetToAddress(newEndRowIndex);
|
|
156
156
|
const newStartColumnIndex = columnAddressToOffset(components.startColumn) + columnOffset;
|
|
157
157
|
const newEndColumnIndex = columnAddressToOffset(components.endColumn) + columnOffset;
|
|
158
158
|
if (newStartColumnIndex < columnAddressToOffset(firstColumn) || newEndColumnIndex > columnAddressToOffset(lastColumn)) {
|
|
159
159
|
throw new InvalidArgumentError(`Column offset out of bounds: ${newStartColumnIndex + 1} to ${newEndColumnIndex + 1}`);
|
|
160
160
|
}
|
|
161
|
-
const newStartColumn =
|
|
162
|
-
const newEndColumn =
|
|
161
|
+
const newStartColumn = columnOffsetToAddress(newStartColumnIndex);
|
|
162
|
+
const newEndColumn = columnOffsetToAddress(newEndColumnIndex);
|
|
163
163
|
return composeAddress({
|
|
164
164
|
startColumn: newStartColumn,
|
|
165
165
|
endColumn: newEndColumn,
|
|
@@ -12,6 +12,8 @@ export declare function columnAddressToOffset(column: ColumnAddress): ColumnOffs
|
|
|
12
12
|
* @param offset - The zero-based column offset.
|
|
13
13
|
* @returns The column address.
|
|
14
14
|
*/
|
|
15
|
+
export declare function columnOffsetToAddress(offset: ColumnOffset): ColumnAddress;
|
|
16
|
+
/** @deprecated Use columnAddressToOffset instead. */
|
|
15
17
|
export declare function offsetToColumnAddress(offset: ColumnOffset): ColumnAddress;
|
|
16
18
|
/**
|
|
17
19
|
* Converts a row address (e.g., "1") to a zero-based row offset.
|
|
@@ -24,5 +26,7 @@ export declare function rowAddressToOffset(row: RowAddress): RowOffset;
|
|
|
24
26
|
* @param offset - The zero-based row offset.
|
|
25
27
|
* @returns The row address.
|
|
26
28
|
*/
|
|
29
|
+
export declare function rowOffsetToAddress(offset: RowOffset): RowAddress;
|
|
30
|
+
/** @deprecated Use rowOffsetToAddress instead. */
|
|
27
31
|
export declare function offsetToRowAddress(offset: RowOffset): RowAddress;
|
|
28
32
|
//# sourceMappingURL=addressOffset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addressOffset.d.ts","sourceRoot":"","sources":["../../../src/services/addressOffset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CASzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE"}
|
|
1
|
+
{"version":3,"file":"addressOffset.d.ts","sourceRoot":"","sources":["../../../src/services/addressOffset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CASzE;AAED,qDAAqD;AACrD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CAEzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE;AAED,kDAAkD;AAClD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE"}
|
|
@@ -15,7 +15,7 @@ export function columnAddressToOffset(column) {
|
|
|
15
15
|
* @param offset - The zero-based column offset.
|
|
16
16
|
* @returns The column address.
|
|
17
17
|
*/
|
|
18
|
-
export function
|
|
18
|
+
export function columnOffsetToAddress(offset) {
|
|
19
19
|
let result = "";
|
|
20
20
|
let currentOffset = offset + 1;
|
|
21
21
|
while (currentOffset > 0) {
|
|
@@ -25,6 +25,10 @@ export function offsetToColumnAddress(offset) {
|
|
|
25
25
|
}
|
|
26
26
|
return result;
|
|
27
27
|
}
|
|
28
|
+
/** @deprecated Use columnAddressToOffset instead. */
|
|
29
|
+
export function offsetToColumnAddress(offset) {
|
|
30
|
+
return columnOffsetToAddress(offset);
|
|
31
|
+
}
|
|
28
32
|
/**
|
|
29
33
|
* Converts a row address (e.g., "1") to a zero-based row offset.
|
|
30
34
|
* @param row - The row address.
|
|
@@ -38,6 +42,10 @@ export function rowAddressToOffset(row) {
|
|
|
38
42
|
* @param offset - The zero-based row offset.
|
|
39
43
|
* @returns The row address.
|
|
40
44
|
*/
|
|
41
|
-
export function
|
|
45
|
+
export function rowOffsetToAddress(offset) {
|
|
42
46
|
return (offset + 1).toString();
|
|
43
47
|
}
|
|
48
|
+
/** @deprecated Use rowOffsetToAddress instead. */
|
|
49
|
+
export function offsetToRowAddress(offset) {
|
|
50
|
+
return rowOffsetToAddress(offset);
|
|
51
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Address } from "../models/Address.ts";
|
|
2
|
+
import type { Cartesian } from "../models/Cartesian.ts";
|
|
3
|
+
export declare function addressToCartesian(address: Address): Cartesian;
|
|
4
|
+
export declare function cartesianToAddress(cartesian: Cartesian): Address;
|
|
5
|
+
//# sourceMappingURL=cartesianAddress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cartesianAddress.d.ts","sourceRoot":"","sources":["../../../src/services/cartesianAddress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIxD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,GAAG,SAAS,CAU9D;AAED,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAchE"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { composeAddress, decomposeAddress } from "./addressManipulation.js";
|
|
2
|
+
import { columnAddressToOffset, columnOffsetToAddress, rowAddressToOffset, rowOffsetToAddress } from "./addressOffset.js";
|
|
3
|
+
export function addressToCartesian(address) {
|
|
4
|
+
const components = decomposeAddress(address);
|
|
5
|
+
const ax = columnAddressToOffset(components.startColumn);
|
|
6
|
+
const ay = rowAddressToOffset(components.startRow);
|
|
7
|
+
const bx = columnAddressToOffset(components.endColumn);
|
|
8
|
+
const by = rowAddressToOffset(components.endRow);
|
|
9
|
+
return { ax, ay, bx, by };
|
|
10
|
+
}
|
|
11
|
+
export function cartesianToAddress(cartesian) {
|
|
12
|
+
const startColumn = columnOffsetToAddress(cartesian.ax);
|
|
13
|
+
const startRow = rowOffsetToAddress(cartesian.ay);
|
|
14
|
+
const endColumn = columnOffsetToAddress(cartesian.bx);
|
|
15
|
+
const endRow = rowOffsetToAddress(cartesian.by);
|
|
16
|
+
const address = composeAddress({
|
|
17
|
+
startRow,
|
|
18
|
+
startColumn,
|
|
19
|
+
endRow,
|
|
20
|
+
endColumn,
|
|
21
|
+
});
|
|
22
|
+
return address;
|
|
23
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ColumnName } from "../models/ColumnName.ts";
|
|
2
2
|
import type { WorkbookTableColumnRef } from "../models/WorkbookTableColumnRef.ts";
|
|
3
3
|
import type { WorkbookTableRef } from "../models/WorkbookTableRef.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Creates a reference to a workbook table column.
|
|
6
6
|
* @param tableRef - The reference to the worksheet containing the table.
|
|
7
|
-
* @param column -
|
|
7
|
+
* @param column - Name of the table column
|
|
8
8
|
* @returns A reference to the workbook table.
|
|
9
9
|
* @throws Error if the table ID is missing.
|
|
10
10
|
*/
|
|
11
|
-
export declare function createWorkbookTableColumnRef(tableRef: WorkbookTableRef, column:
|
|
11
|
+
export declare function createWorkbookTableColumnRef(tableRef: WorkbookTableRef, column: ColumnName | string | undefined): WorkbookTableColumnRef;
|
|
12
12
|
//# sourceMappingURL=workbookTableColumn.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbookTableColumn.d.ts","sourceRoot":"","sources":["../../../src/services/workbookTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"workbookTableColumn.d.ts","sourceRoot":"","sources":["../../../src/services/workbookTableColumn.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,gBAAgB,EAAE,MAAM,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,sBAAsB,CAexI"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Creates a reference to a workbook table column.
|
|
3
3
|
* @param tableRef - The reference to the worksheet containing the table.
|
|
4
|
-
* @param column -
|
|
4
|
+
* @param column - Name of the table column
|
|
5
5
|
* @returns A reference to the workbook table.
|
|
6
6
|
* @throws Error if the table ID is missing.
|
|
7
7
|
*/
|
|
8
8
|
export function createWorkbookTableColumnRef(tableRef, column) {
|
|
9
9
|
if (!column) {
|
|
10
|
-
throw new Error("
|
|
10
|
+
throw new Error("column is missing");
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
13
|
contextId: tableRef.contextId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import InvalidArgumentError from "../errors/InvalidArgumentError.js";
|
|
2
2
|
import getWorkbookWorksheetRange from "../operations/workbookRange/getWorkbookWorksheetRange.js";
|
|
3
3
|
import { composeAddress, decomposeAddress } from "../services/addressManipulation.js";
|
|
4
|
-
import { columnAddressToOffset,
|
|
4
|
+
import { columnAddressToOffset, rowAddressToOffset, rowOffsetToAddress } from "../services/addressOffset.js";
|
|
5
5
|
import { createWorkbookRangeRef } from "../services/workbookRange.js";
|
|
6
6
|
/**
|
|
7
7
|
* Maximum number of cells that can be retrieved in a single request, unless overwritten.
|
|
@@ -30,8 +30,8 @@ export default async function* iterateWorkbookRangeValues(rangeRef, overwriteRow
|
|
|
30
30
|
for (let chunkRowOffset = rangeStartRowOffset; chunkRowOffset <= rangeEndRowOffset; chunkRowOffset = (chunkRowOffset + rowsPerRequest)) {
|
|
31
31
|
const requestStartRowOffset = chunkRowOffset;
|
|
32
32
|
const requestEndRowOffset = Math.min(chunkRowOffset + rowsPerRequest - 1, rangeEndRowOffset);
|
|
33
|
-
const chunkStartRow =
|
|
34
|
-
const chunkEndRow =
|
|
33
|
+
const chunkStartRow = rowOffsetToAddress(requestStartRowOffset);
|
|
34
|
+
const chunkEndRow = rowOffsetToAddress(requestEndRowOffset);
|
|
35
35
|
const requestAddress = composeAddress({
|
|
36
36
|
startRow: chunkStartRow,
|
|
37
37
|
endRow: chunkEndRow,
|