microsoft-graph 2.22.2 → 2.23.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/graphApi.d.ts +0 -2
- package/dist/cjs/graphApi.d.ts.map +1 -1
- package/dist/cjs/graphApi.js +6 -11
- package/dist/cjs/models/AccessTokenGenerator.d.ts +3 -0
- package/dist/cjs/models/AccessTokenGenerator.d.ts.map +1 -0
- package/dist/cjs/models/Context.d.ts +2 -6
- package/dist/cjs/models/Context.d.ts.map +1 -1
- package/dist/cjs/models/ContextRef.d.ts +2 -2
- package/dist/cjs/models/ContextRef.d.ts.map +1 -1
- package/dist/cjs/models/GraphOperation.d.ts +2 -2
- package/dist/cjs/models/GraphOperation.d.ts.map +1 -1
- package/dist/cjs/models/SiteRef.d.ts +3 -2
- package/dist/cjs/models/SiteRef.d.ts.map +1 -1
- package/dist/cjs/operations/drive/createFolder.js +1 -1
- package/dist/cjs/operations/drive/listDrives.js +1 -1
- package/dist/cjs/operations/driveItem/createDriveItem.js +1 -1
- package/dist/cjs/operations/driveItem/deleteDriveItem.js +1 -1
- package/dist/cjs/operations/driveItem/existsDriveItem.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/existsDriveItem.js +1 -4
- package/dist/cjs/operations/driveItem/getDriveItem.js +1 -1
- package/dist/cjs/operations/driveItem/getDriveItemByPath.js +1 -1
- package/dist/cjs/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
- package/dist/cjs/operations/driveItem/getDriveItemContent.js +1 -4
- package/dist/cjs/operations/driveItem/initiateCopyDriveItem.js +1 -1
- package/dist/cjs/operations/driveItem/listDriveItemChildren.js +1 -1
- package/dist/cjs/operations/driveItem/moveDriveItem.js +1 -1
- package/dist/cjs/operations/site/getSite.js +1 -1
- package/dist/cjs/operations/site/getSiteByName.d.ts +1 -1
- package/dist/cjs/operations/site/getSiteByName.js +2 -2
- package/dist/cjs/operations/site/listSites.js +1 -1
- package/dist/cjs/operations/site/searchSites.js +1 -1
- package/dist/cjs/operations/user/userSendMail.d.ts +3 -3
- package/dist/cjs/operations/user/userSendMail.d.ts.map +1 -1
- package/dist/cjs/operations/user/userSendMail.js +3 -3
- package/dist/cjs/operations/workbook/calculateWorkbook.js +1 -1
- package/dist/cjs/operations/workbook/createWorkbook.js +1 -1
- package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js +1 -1
- package/dist/cjs/operations/workbookRange/clearWorkbookRange.js +1 -1
- package/dist/cjs/operations/workbookRange/deleteWorkbookRange.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookNamedRange.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookUsedRange.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookVisibleRange.js +1 -1
- package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.js +1 -1
- package/dist/cjs/operations/workbookRange/insertWorkbookCells.js +1 -1
- package/dist/cjs/operations/workbookRange/mergeWorkbookRange.js +1 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.js +1 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.js +1 -1
- package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js +1 -1
- package/dist/cjs/operations/workbookRange/unmergeWorkbookRange.js +1 -1
- package/dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js +1 -1
- package/dist/cjs/operations/workbookRange/updateWorkbookRange.js +1 -1
- package/dist/cjs/operations/workbookSession/closeWorkbookSession.js +1 -1
- package/dist/cjs/operations/workbookSession/createWorkbookSession.js +1 -1
- package/dist/cjs/operations/workbookSession/refreshWorkbookSession.js +1 -1
- package/dist/cjs/operations/workbookTable/applyWorkbookTableColumnFilter.js +1 -1
- package/dist/cjs/operations/workbookTable/clearWorkbookTableFilters.js +1 -1
- package/dist/cjs/operations/workbookTable/createWorkbookTable.js +1 -1
- package/dist/cjs/operations/workbookTable/deleteWorkbookTable.js +1 -1
- package/dist/cjs/operations/workbookTable/deleteWorkbookTablePreservingValues.js +1 -1
- package/dist/cjs/operations/workbookTable/getWorkbookTable.js +1 -1
- package/dist/cjs/operations/workbookTable/getWorkbookTableBodyRange.js +1 -1
- package/dist/cjs/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts +1 -2
- package/dist/cjs/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts.map +1 -1
- package/dist/cjs/operations/workbookTable/getWorkbookTableBodyVisibleRange.js +4 -7
- package/dist/cjs/operations/workbookTable/getWorkbookTableHeaderRange.js +1 -1
- package/dist/cjs/operations/workbookTable/listWorkbookTableColumns.js +1 -1
- package/dist/cjs/operations/workbookTable/listWorkbookTableRows.js +1 -1
- package/dist/cjs/operations/workbookTable/listWorkbookTables.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/createWorkbookWorksheet.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/deleteWorkbookWorksheet.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRange.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeRef.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedVisibleRange.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/listWorkbookWorksheets.js +1 -1
- package/dist/cjs/operations/workbookWorksheet/updateWorkbookWorksheet.js +1 -1
- package/dist/cjs/services/addressManipulation.d.ts +3 -3
- package/dist/cjs/services/addressManipulation.js +4 -4
- package/dist/cjs/services/context.d.ts +16 -17
- package/dist/cjs/services/context.d.ts.map +1 -1
- package/dist/cjs/services/context.js +40 -47
- package/dist/cjs/services/drive.d.ts +7 -0
- package/dist/cjs/services/drive.d.ts.map +1 -1
- package/dist/cjs/services/drive.js +11 -2
- package/dist/cjs/services/driveItem.js +1 -1
- package/dist/cjs/services/site.js +1 -1
- package/dist/cjs/services/templatedPaths.d.ts +1 -1
- package/dist/cjs/services/templatedPaths.d.ts.map +1 -1
- package/dist/cjs/services/templatedPaths.js +5 -2
- package/dist/cjs/services/workbookRange.d.ts +1 -1
- package/dist/cjs/services/workbookRange.d.ts.map +1 -1
- package/dist/cjs/services/workbookRange.js +11 -2
- package/dist/cjs/services/workbookTable.js +1 -1
- package/dist/cjs/services/workbookTableColumn.js +1 -1
- package/dist/cjs/services/workbookWorksheet.js +1 -1
- package/dist/cjs/tasks/listDriveItems.d.ts.map +1 -1
- package/dist/cjs/tasks/listDriveItems.js +1 -5
- package/dist/esm/graphApi.d.ts +0 -2
- package/dist/esm/graphApi.d.ts.map +1 -1
- package/dist/esm/graphApi.js +5 -10
- package/dist/esm/models/AccessTokenGenerator.d.ts +3 -0
- package/dist/esm/models/AccessTokenGenerator.d.ts.map +1 -0
- package/dist/esm/models/Context.d.ts +2 -6
- package/dist/esm/models/Context.d.ts.map +1 -1
- package/dist/esm/models/ContextRef.d.ts +2 -2
- package/dist/esm/models/ContextRef.d.ts.map +1 -1
- package/dist/esm/models/GraphOperation.d.ts +2 -2
- package/dist/esm/models/GraphOperation.d.ts.map +1 -1
- package/dist/esm/models/SiteRef.d.ts +3 -2
- package/dist/esm/models/SiteRef.d.ts.map +1 -1
- package/dist/esm/operations/drive/createFolder.js +1 -1
- package/dist/esm/operations/drive/listDrives.js +1 -1
- package/dist/esm/operations/driveItem/createDriveItem.js +1 -1
- package/dist/esm/operations/driveItem/deleteDriveItem.js +1 -1
- package/dist/esm/operations/driveItem/existsDriveItem.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/existsDriveItem.js +2 -5
- package/dist/esm/operations/driveItem/getDriveItem.js +1 -1
- package/dist/esm/operations/driveItem/getDriveItemByPath.js +1 -1
- package/dist/esm/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
- package/dist/esm/operations/driveItem/getDriveItemContent.js +2 -5
- package/dist/esm/operations/driveItem/initiateCopyDriveItem.js +1 -1
- package/dist/esm/operations/driveItem/listDriveItemChildren.js +1 -1
- package/dist/esm/operations/driveItem/moveDriveItem.js +1 -1
- package/dist/esm/operations/site/getSite.js +1 -1
- package/dist/esm/operations/site/getSiteByName.d.ts +1 -1
- package/dist/esm/operations/site/getSiteByName.js +2 -2
- package/dist/esm/operations/site/listSites.js +1 -1
- package/dist/esm/operations/site/searchSites.js +1 -1
- package/dist/esm/operations/user/userSendMail.d.ts +3 -3
- package/dist/esm/operations/user/userSendMail.d.ts.map +1 -1
- package/dist/esm/operations/user/userSendMail.js +3 -3
- package/dist/esm/operations/workbook/calculateWorkbook.js +1 -1
- package/dist/esm/operations/workbook/createWorkbook.js +1 -1
- package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js +1 -1
- package/dist/esm/operations/workbookRange/clearWorkbookRange.js +1 -1
- package/dist/esm/operations/workbookRange/deleteWorkbookRange.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookNamedRange.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFill.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFont.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookUsedRange.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookVisibleRange.js +1 -1
- package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.js +1 -1
- package/dist/esm/operations/workbookRange/insertWorkbookCells.js +1 -1
- package/dist/esm/operations/workbookRange/mergeWorkbookRange.js +1 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFill.js +1 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFont.js +1 -1
- package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.js +1 -1
- package/dist/esm/operations/workbookRange/unmergeWorkbookRange.js +1 -1
- package/dist/esm/operations/workbookRange/updateWorkbookNamedRange.js +1 -1
- package/dist/esm/operations/workbookRange/updateWorkbookRange.js +1 -1
- package/dist/esm/operations/workbookSession/closeWorkbookSession.js +1 -1
- package/dist/esm/operations/workbookSession/createWorkbookSession.js +1 -1
- package/dist/esm/operations/workbookSession/refreshWorkbookSession.js +1 -1
- package/dist/esm/operations/workbookTable/applyWorkbookTableColumnFilter.js +1 -1
- package/dist/esm/operations/workbookTable/clearWorkbookTableFilters.js +1 -1
- package/dist/esm/operations/workbookTable/createWorkbookTable.js +1 -1
- package/dist/esm/operations/workbookTable/deleteWorkbookTable.js +1 -1
- package/dist/esm/operations/workbookTable/deleteWorkbookTablePreservingValues.js +1 -1
- package/dist/esm/operations/workbookTable/getWorkbookTable.js +1 -1
- package/dist/esm/operations/workbookTable/getWorkbookTableBodyRange.js +1 -1
- package/dist/esm/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts +1 -2
- package/dist/esm/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts.map +1 -1
- package/dist/esm/operations/workbookTable/getWorkbookTableBodyVisibleRange.js +4 -7
- package/dist/esm/operations/workbookTable/getWorkbookTableHeaderRange.js +1 -1
- package/dist/esm/operations/workbookTable/listWorkbookTableColumns.js +1 -1
- package/dist/esm/operations/workbookTable/listWorkbookTableRows.js +1 -1
- package/dist/esm/operations/workbookTable/listWorkbookTables.js +1 -1
- package/dist/esm/operations/workbookWorksheet/createWorkbookWorksheet.js +1 -1
- package/dist/esm/operations/workbookWorksheet/deleteWorkbookWorksheet.js +1 -1
- package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRange.js +1 -1
- package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeRef.js +1 -1
- package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedVisibleRange.js +1 -1
- package/dist/esm/operations/workbookWorksheet/listWorkbookWorksheets.js +1 -1
- package/dist/esm/operations/workbookWorksheet/updateWorkbookWorksheet.js +1 -1
- package/dist/esm/services/addressManipulation.d.ts +3 -3
- package/dist/esm/services/addressManipulation.js +3 -3
- package/dist/esm/services/context.d.ts +16 -17
- package/dist/esm/services/context.d.ts.map +1 -1
- package/dist/esm/services/context.js +35 -42
- package/dist/esm/services/drive.d.ts +7 -0
- package/dist/esm/services/drive.d.ts.map +1 -1
- package/dist/esm/services/drive.js +11 -3
- package/dist/esm/services/driveItem.js +1 -1
- package/dist/esm/services/site.js +1 -1
- package/dist/esm/services/templatedPaths.d.ts +1 -1
- package/dist/esm/services/templatedPaths.d.ts.map +1 -1
- package/dist/esm/services/templatedPaths.js +5 -2
- package/dist/esm/services/workbookRange.d.ts +1 -1
- package/dist/esm/services/workbookRange.d.ts.map +1 -1
- package/dist/esm/services/workbookRange.js +8 -2
- package/dist/esm/services/workbookTable.js +1 -1
- package/dist/esm/services/workbookTableColumn.js +1 -1
- package/dist/esm/services/workbookWorksheet.js +1 -1
- package/dist/esm/tasks/listDriveItems.d.ts.map +1 -1
- package/dist/esm/tasks/listDriveItems.js +1 -5
- package/package.json +26 -26
- package/dist/cjs/models/ContextId.d.ts +0 -4
- package/dist/cjs/models/ContextId.d.ts.map +0 -1
- package/dist/esm/models/ContextId.d.ts +0 -4
- package/dist/esm/models/ContextId.d.ts.map +0 -1
- /package/dist/cjs/models/{ContextId.js → AccessTokenGenerator.js} +0 -0
- /package/dist/esm/models/{ContextId.js → AccessTokenGenerator.js} +0 -0
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
export default function getWorkbookRangeFormat(rangeRef) {
|
|
12
12
|
const address = normalizeAddress(rangeRef.address, true);
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: rangeRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format`, rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -7,7 +7,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export default function getWorkbookUsedRange(worksheetRef) {
|
|
9
9
|
return operation({
|
|
10
|
-
|
|
10
|
+
context: worksheetRef.context,
|
|
11
11
|
method: "GET",
|
|
12
12
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange", worksheetRef),
|
|
13
13
|
headers: {
|
|
@@ -12,7 +12,7 @@ export default function getWorkbookVisibleRange(rangeRef) {
|
|
|
12
12
|
const address = normalizeAddress(rangeRef.address, true);
|
|
13
13
|
// TODO: Should be a visible ref type?
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: rangeRef.context,
|
|
16
16
|
method: "GET",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/visibleView`, rangeRef),
|
|
18
18
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
export default function getWorkbookWorksheetRange(rangeRef) {
|
|
12
12
|
const address = normalizeAddress(rangeRef.address, true);
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: rangeRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -14,7 +14,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export default function insertWorkbookCells(worksheetRef, address, shift) {
|
|
16
16
|
return operation({
|
|
17
|
-
|
|
17
|
+
context: worksheetRef.context,
|
|
18
18
|
method: "POST",
|
|
19
19
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${normalizeAddress(address)}')/insert`, worksheetRef),
|
|
20
20
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function mergeWorkbookRange(rangeRef, across = false) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: rangeRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${normalizeAddress(rangeRef.address)}')/merge`, rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
export default function setWorkbookRangeFill(rangeRef, format) {
|
|
12
12
|
const address = normalizeAddress(rangeRef.address, true);
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: rangeRef.context,
|
|
15
15
|
method: "PATCH",
|
|
16
16
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/fill`, rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
export default function setWorkbookRangeFont(rangeRef, format) {
|
|
12
12
|
const address = normalizeAddress(rangeRef.address, true);
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: rangeRef.context,
|
|
15
15
|
method: "PATCH",
|
|
16
16
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/font`, rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -13,7 +13,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
13
13
|
export default function setWorkbookRangeFormat(rangeRef, format) {
|
|
14
14
|
const address = normalizeAddress(rangeRef.address, true);
|
|
15
15
|
return operation({
|
|
16
|
-
|
|
16
|
+
context: rangeRef.context,
|
|
17
17
|
method: "PATCH",
|
|
18
18
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format`, rangeRef),
|
|
19
19
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function unmergeWorkbookRange(rangeRef) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: rangeRef.context,
|
|
14
14
|
method: "POST",
|
|
15
15
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${normalizeAddress(rangeRef.address)}')/unmerge`, rangeRef),
|
|
16
16
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function updateWorkbookNamedRange(rangeRef, value) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: rangeRef.context,
|
|
14
14
|
method: "PATCH",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/names/{range-name}/range", rangeRef),
|
|
16
16
|
headers: {
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function updateWorkbookRange(rangeRef, update) {
|
|
13
13
|
const address = normalizeAddress(rangeRef.address, true);
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: rangeRef.context,
|
|
16
16
|
method: "PATCH",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
18
18
|
headers: {
|
|
@@ -14,7 +14,7 @@ export default function closeWorkbookSession(workbookRef) {
|
|
|
14
14
|
throw new InvalidArgumentError("Workbook session ID is required to close a session.");
|
|
15
15
|
}
|
|
16
16
|
return operation({
|
|
17
|
-
|
|
17
|
+
context: workbookRef.context,
|
|
18
18
|
method: "POST",
|
|
19
19
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/closeSession", workbookRef),
|
|
20
20
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createWorkbookSession(itemRef, persistChanges = true) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: itemRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/createSession", itemRef),
|
|
17
17
|
headers: {
|
|
@@ -14,7 +14,7 @@ export default function refreshWorkbookSession(workbookRef) {
|
|
|
14
14
|
throw new InvalidArgumentError("Workbook session ID is required to refresh a session.");
|
|
15
15
|
}
|
|
16
16
|
return operation({
|
|
17
|
-
|
|
17
|
+
context: workbookRef.context,
|
|
18
18
|
method: "POST",
|
|
19
19
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/refreshSession", workbookRef),
|
|
20
20
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function applyWorkbookTableColumnFilter(columnRef, criteria) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: columnRef.context,
|
|
14
14
|
method: "POST",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/columns/{column}/filter/apply", columnRef),
|
|
16
16
|
headers: {
|
|
@@ -8,7 +8,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export default function clearWorkbookTableColumnFilters(tableRef) {
|
|
10
10
|
return operation({
|
|
11
|
-
|
|
11
|
+
context: tableRef.context,
|
|
12
12
|
method: "POST",
|
|
13
13
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/clearFilters", tableRef),
|
|
14
14
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { createWorkbookTableRef } from "../../services/workbookTable.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createWorkbookTable(rangeRef, hasHeaders) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: rangeRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/add", rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function deleteWorkbookTable(tableRef) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: tableRef.context,
|
|
14
14
|
method: "DELETE",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}", tableRef),
|
|
16
16
|
headers: {
|
|
@@ -8,7 +8,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export default function deleteWorkbookTablePreservingValues(tableRef) {
|
|
10
10
|
return operation({
|
|
11
|
-
|
|
11
|
+
context: tableRef.context,
|
|
12
12
|
method: "POST",
|
|
13
13
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/convertToRange", tableRef),
|
|
14
14
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function getWorkbookTable(tableRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: tableRef.context,
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}", tableRef),
|
|
15
15
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function getWorkbookTableBodyRange(tableRef) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: tableRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/dataBodyRange", tableRef),
|
|
17
17
|
headers: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { WorkbookRange } from "@microsoft/microsoft-graph-types";
|
|
2
2
|
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
3
|
-
import type { WorkbookRangeRef } from "../../models/WorkbookRangeRef.ts";
|
|
4
3
|
import type { WorkbookTableRef } from "../../models/WorkbookTableRef.ts";
|
|
5
4
|
/**
|
|
6
5
|
* Retrieve the visible data body range of a table.
|
|
@@ -9,5 +8,5 @@ import type { WorkbookTableRef } from "../../models/WorkbookTableRef.ts";
|
|
|
9
8
|
* @returns The data body range of the specified table, including its metadata and reference information.
|
|
10
9
|
* @see https://learn.microsoft.com/en-us/graph/api/table-databodyrange
|
|
11
10
|
*/
|
|
12
|
-
export default function getWorkbookTableBodyVisibleRange(tableRef: WorkbookTableRef): GraphOperation<WorkbookRange
|
|
11
|
+
export default function getWorkbookTableBodyVisibleRange(tableRef: WorkbookTableRef): GraphOperation<WorkbookRange>;
|
|
13
12
|
//# sourceMappingURL=getWorkbookTableBodyVisibleRange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getWorkbookTableBodyVisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookTable/getWorkbookTableBodyVisibleRange.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"getWorkbookTableBodyVisibleRange.d.ts","sourceRoot":"","sources":["../../../../src/operations/workbookTable/getWorkbookTableBodyVisibleRange.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;AAGzE;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gCAAgC,CAAC,QAAQ,EAAE,gBAAgB,GAAG,cAAc,CAAC,aAAa,CAAC,CAiBlH"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { operation } from "../../graphApi.js";
|
|
2
2
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
3
|
-
import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
4
3
|
/**
|
|
5
4
|
* Retrieve the visible data body range of a table.
|
|
6
5
|
*
|
|
@@ -10,7 +9,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
10
9
|
*/
|
|
11
10
|
export default function getWorkbookTableBodyVisibleRange(tableRef) {
|
|
12
11
|
return operation({
|
|
13
|
-
|
|
12
|
+
context: tableRef.context,
|
|
14
13
|
method: "GET",
|
|
15
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/dataBodyRange/visibleView", tableRef),
|
|
16
15
|
headers: {
|
|
@@ -19,11 +18,9 @@ export default function getWorkbookTableBodyVisibleRange(tableRef) {
|
|
|
19
18
|
body: null,
|
|
20
19
|
responseTransform: (response) => {
|
|
21
20
|
const range = response;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...rangeRef,
|
|
26
|
-
};
|
|
21
|
+
// This API does not appear to return the range address. It is undefined.
|
|
22
|
+
// const rangeRef = createWorkbookRangeRef(tableRef, range.address as CellRangeAddress);
|
|
23
|
+
return range;
|
|
27
24
|
},
|
|
28
25
|
});
|
|
29
26
|
}
|
|
@@ -11,7 +11,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function getWorkbookTableHeaderRange(tableRef) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: tableRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/headerRowRange", tableRef),
|
|
17
17
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function listWorkbookTableColumns(tableRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: tableRef.context,
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/columns", tableRef),
|
|
15
15
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function listWorkbookTableRows(tableRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: tableRef.context,
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/rows", tableRef),
|
|
15
15
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { createWorkbookTableRef } from "../../services/workbookTable.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function listWorkbookTables(worksheetRef) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: worksheetRef.context,
|
|
14
14
|
method: "GET",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables", worksheetRef),
|
|
16
16
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { createWorkbookWorksheetRef } from "../../services/workbookWorksheet.js"
|
|
|
11
11
|
*/
|
|
12
12
|
export default function createWorkbookWorksheet(workbookRef, name) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: workbookRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/add", workbookRef),
|
|
17
17
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function deleteWorkbookWorksheet(worksheetRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: worksheetRef.context,
|
|
13
13
|
method: "DELETE",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}", worksheetRef),
|
|
15
15
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function getWorkbookWorksheetUsedRange(worksheetRef) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: worksheetRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange", worksheetRef),
|
|
17
17
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function getWorkbookWorksheetUsedRangeRef(worksheetRef) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: worksheetRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange?$select=address", worksheetRef),
|
|
17
17
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { createWorkbookRangeRef } from "../../services/workbookRange.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function getWorkbookWorksheetUsedVisibleRange(worksheetRef) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: worksheetRef.context,
|
|
14
14
|
method: "GET",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange/visibleView", worksheetRef),
|
|
16
16
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { createWorkbookWorksheetRef } from "../../services/workbookWorksheet.js"
|
|
|
11
11
|
*/
|
|
12
12
|
export default function listWorkbookWorksheets(workbookRef) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: workbookRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets", workbookRef),
|
|
17
17
|
headers: {
|
|
@@ -13,7 +13,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
13
13
|
*/
|
|
14
14
|
export default function updateWorkbookWorksheet(worksheetRef, updates) {
|
|
15
15
|
return operation({
|
|
16
|
-
|
|
16
|
+
context: worksheetRef.context,
|
|
17
17
|
method: "PATCH",
|
|
18
18
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}", worksheetRef),
|
|
19
19
|
headers: {
|
|
@@ -150,7 +150,7 @@ export declare function countAddressColumns(address: Address): number;
|
|
|
150
150
|
*/
|
|
151
151
|
export declare function cellToRangeAddress(cell: CellAddress, rows: number, cols: number): Address;
|
|
152
152
|
/**
|
|
153
|
-
* Extracts a
|
|
153
|
+
* Extracts a sub-address from a spreadsheet-style A1 range (e.g., "A1:D10"),
|
|
154
154
|
* allowing skip and take semantics on both rows and columns.
|
|
155
155
|
*
|
|
156
156
|
* Supports negative values for `skipRows` and `skipCols` to count from the end.
|
|
@@ -171,7 +171,7 @@ export declare function cellToRangeAddress(cell: CellAddress, rows: number, cols
|
|
|
171
171
|
*/
|
|
172
172
|
export declare function subAddress(address: Address, skipRows?: number, takeRows?: number, skipCols?: number, takeCols?: number): Address;
|
|
173
173
|
/**
|
|
174
|
-
* Extracts a
|
|
174
|
+
* Extracts a sub-range from a WorkbookRangeRef using skip/take semantics.
|
|
175
175
|
* @param rangeRef Range reference to extract the sub-range from.
|
|
176
176
|
* @param skipRows Number of rows to skip. If negative, skips from the end. Default 0.
|
|
177
177
|
* @param takeRows Number of rows to take after skipping. If negative, excludes from the end. Default Infinity.
|
|
@@ -180,5 +180,5 @@ export declare function subAddress(address: Address, skipRows?: number, takeRows
|
|
|
180
180
|
* @returns Extracted sub-range reference.
|
|
181
181
|
* @throws InvalidArgumentError if the requested rows or columns exceed the available range.
|
|
182
182
|
*/
|
|
183
|
-
export declare function
|
|
183
|
+
export declare function subRange(rangeRef: WorkbookRangeRef, skipRows?: number, takeRows?: number, skipCols?: number, takeCols?: number): WorkbookRangeRef;
|
|
184
184
|
//# sourceMappingURL=addressManipulation.d.ts.map
|
|
@@ -316,7 +316,7 @@ export function cellToRangeAddress(cell, rows, cols) {
|
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
318
|
/**
|
|
319
|
-
* Extracts a
|
|
319
|
+
* Extracts a sub-address from a spreadsheet-style A1 range (e.g., "A1:D10"),
|
|
320
320
|
* allowing skip and take semantics on both rows and columns.
|
|
321
321
|
*
|
|
322
322
|
* Supports negative values for `skipRows` and `skipCols` to count from the end.
|
|
@@ -370,7 +370,7 @@ export function subAddress(address, skipRows = 0, takeRows = Number.POSITIVE_INF
|
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
/**
|
|
373
|
-
* Extracts a
|
|
373
|
+
* Extracts a sub-range from a WorkbookRangeRef using skip/take semantics.
|
|
374
374
|
* @param rangeRef Range reference to extract the sub-range from.
|
|
375
375
|
* @param skipRows Number of rows to skip. If negative, skips from the end. Default 0.
|
|
376
376
|
* @param takeRows Number of rows to take after skipping. If negative, excludes from the end. Default Infinity.
|
|
@@ -379,7 +379,7 @@ export function subAddress(address, skipRows = 0, takeRows = Number.POSITIVE_INF
|
|
|
379
379
|
* @returns Extracted sub-range reference.
|
|
380
380
|
* @throws InvalidArgumentError if the requested rows or columns exceed the available range.
|
|
381
381
|
*/
|
|
382
|
-
export function
|
|
382
|
+
export function subRange(rangeRef, skipRows = 0, takeRows = Number.POSITIVE_INFINITY, skipCols = 0, takeCols = Number.POSITIVE_INFINITY) {
|
|
383
383
|
const address = subAddress(rangeRef.address, skipRows, takeRows, skipCols, takeCols);
|
|
384
384
|
return {
|
|
385
385
|
...rangeRef,
|
|
@@ -1,28 +1,27 @@
|
|
|
1
|
+
import type { AccessToken } from "../models/AccessToken.ts";
|
|
2
|
+
import type { AccessTokenGenerator } from "../models/AccessTokenGenerator.ts";
|
|
1
3
|
import type { ClientId } from "../models/ClientId.ts";
|
|
2
4
|
import type { ClientSecret } from "../models/ClientSecret.ts";
|
|
3
|
-
import type { Context } from "../models/Context.ts";
|
|
4
|
-
import type { ContextId } from "../models/ContextId.ts";
|
|
5
5
|
import type { ContextRef } from "../models/ContextRef.ts";
|
|
6
|
+
import type { Scope } from "../models/Scope.ts";
|
|
6
7
|
import type { TenantId } from "../models/TenantId.ts";
|
|
8
|
+
/** Create a context using the client secret credential. */
|
|
9
|
+
export declare function createClientSecretContext(tenantId: TenantId, clientId: ClientId, clientSecret: ClientSecret, scope?: Scope): ContextRef;
|
|
7
10
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @
|
|
10
|
-
* @param clientId - The client ID.
|
|
11
|
-
* @param clientSecret - The client secret.
|
|
12
|
-
* @returns A reference to the registered context.
|
|
11
|
+
* Create a context using a static access token.
|
|
12
|
+
* @remarks You must manually handle renewal of the access token with this approach.
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function createAccessTokenContext(accessToken: AccessToken): ContextRef;
|
|
15
|
+
/** Create a context using a given access token generator. */
|
|
16
|
+
export declare function createContext(accessTokenGenerator: AccessTokenGenerator): ContextRef;
|
|
17
|
+
/** Create a context using the client secret credential using environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET. */
|
|
18
|
+
export declare function createDefaultClientSecretContext(): ContextRef;
|
|
15
19
|
/**
|
|
16
|
-
|
|
17
|
-
* @param contextId - The ID of the context.
|
|
18
|
-
* @returns The context associated with the given ID.
|
|
19
|
-
* @throws ContextNotRegisteredError if the context ID is not registered.
|
|
20
|
+
@obsolete Use `createDefaultClientSecretContext()` instead.
|
|
20
21
|
*/
|
|
21
|
-
export declare function
|
|
22
|
+
export declare function getDefaultContextRef(): ContextRef;
|
|
22
23
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @returns A reference to the default context.
|
|
25
|
-
* @remarks This method is opinionated and not recommended for production use.
|
|
24
|
+
* @obsolete Use `createClientSecretContext()` instead.
|
|
26
25
|
*/
|
|
27
|
-
export declare function
|
|
26
|
+
export declare function register(tenantId: TenantId, clientId: ClientId, clientSecret: ClientSecret): ContextRef;
|
|
28
27
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/services/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/services/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,2DAA2D;AAC3D,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,GAAE,KAAoB,GAAG,UAAU,CAMrJ;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,WAAW,GAAG,UAAU,CAK7E;AAED,6DAA6D;AAC7D,wBAAgB,aAAa,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,UAAU,CAQpF;AAED,gJAAgJ;AAChJ,wBAAgB,gCAAgC,IAAI,UAAU,CAM7D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,CAEjD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,GAAG,UAAU,CAEvG"}
|
|
@@ -1,55 +1,48 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getCurrentAccessToken } from "./accessToken.js";
|
|
2
2
|
import { getEnvironmentVariable } from "./environmentVariable.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
* @param clientId - The client ID.
|
|
9
|
-
* @param clientSecret - The client secret.
|
|
10
|
-
* @returns A reference to the registered context.
|
|
11
|
-
*/
|
|
12
|
-
export function register(tenantId, clientId, clientSecret) {
|
|
13
|
-
const contextId = generateContextId();
|
|
14
|
-
const context = {
|
|
15
|
-
tenantId,
|
|
16
|
-
clientId,
|
|
17
|
-
clientSecret,
|
|
3
|
+
const defaultScope = "https://graph.microsoft.com/.default";
|
|
4
|
+
/** Create a context using the client secret credential. */
|
|
5
|
+
export function createClientSecretContext(tenantId, clientId, clientSecret, scope = defaultScope) {
|
|
6
|
+
const generateAccessToken = async () => {
|
|
7
|
+
return await getCurrentAccessToken(tenantId, clientId, clientSecret, scope);
|
|
18
8
|
};
|
|
19
|
-
|
|
20
|
-
const contextRef = createContextRef(contextId);
|
|
21
|
-
return contextRef;
|
|
9
|
+
return createContext(generateAccessToken);
|
|
22
10
|
}
|
|
23
11
|
/**
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
26
|
-
* @returns The context associated with the given ID.
|
|
27
|
-
* @throws ContextNotRegisteredError if the context ID is not registered.
|
|
12
|
+
* Create a context using a static access token.
|
|
13
|
+
* @remarks You must manually handle renewal of the access token with this approach.
|
|
28
14
|
*/
|
|
29
|
-
export function
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
return context;
|
|
35
|
-
}
|
|
36
|
-
function generateContextId() {
|
|
37
|
-
return generateRandomString(16);
|
|
15
|
+
export function createAccessTokenContext(accessToken) {
|
|
16
|
+
// biome-ignore lint/suspicious/useAwait: Not applicable here, as we are creating a context that returns a static access token.
|
|
17
|
+
return createContext(async () => {
|
|
18
|
+
return accessToken;
|
|
19
|
+
});
|
|
38
20
|
}
|
|
39
|
-
|
|
21
|
+
/** Create a context using a given access token generator. */
|
|
22
|
+
export function createContext(accessTokenGenerator) {
|
|
23
|
+
const context = {
|
|
24
|
+
generateAccessToken: accessTokenGenerator,
|
|
25
|
+
};
|
|
40
26
|
return {
|
|
41
|
-
|
|
27
|
+
context,
|
|
42
28
|
};
|
|
43
29
|
}
|
|
44
|
-
/**
|
|
45
|
-
|
|
46
|
-
* @returns A reference to the default context.
|
|
47
|
-
* @remarks This method is opinionated and not recommended for production use.
|
|
48
|
-
*/
|
|
49
|
-
export function getDefaultContextRef() {
|
|
30
|
+
/** Create a context using the client secret credential using environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET. */
|
|
31
|
+
export function createDefaultClientSecretContext() {
|
|
50
32
|
const tenantId = getEnvironmentVariable("AZURE_TENANT_ID");
|
|
51
33
|
const clientId = getEnvironmentVariable("AZURE_CLIENT_ID");
|
|
52
34
|
const clientSecret = getEnvironmentVariable("AZURE_CLIENT_SECRET");
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
return createClientSecretContext(tenantId, clientId, clientSecret);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
@obsolete Use `createDefaultClientSecretContext()` instead.
|
|
39
|
+
*/
|
|
40
|
+
export function getDefaultContextRef() {
|
|
41
|
+
return createDefaultClientSecretContext();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* @obsolete Use `createClientSecretContext()` instead.
|
|
45
|
+
*/
|
|
46
|
+
export function register(tenantId, clientId, clientSecret) {
|
|
47
|
+
return createClientSecretContext(tenantId, clientId, clientSecret);
|
|
55
48
|
}
|