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
|
@@ -13,7 +13,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
13
13
|
*/
|
|
14
14
|
function updateWorkbookNamedRange(rangeRef, value) {
|
|
15
15
|
return (0, graphApi_ts_1.operation)({
|
|
16
|
-
|
|
16
|
+
context: rangeRef.context,
|
|
17
17
|
method: "PATCH",
|
|
18
18
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/names/{range-name}/range", rangeRef),
|
|
19
19
|
headers: {
|
|
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
15
15
|
function updateWorkbookRange(rangeRef, update) {
|
|
16
16
|
const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
|
|
17
17
|
return (0, graphApi_ts_1.operation)({
|
|
18
|
-
|
|
18
|
+
context: rangeRef.context,
|
|
19
19
|
method: "PATCH",
|
|
20
20
|
path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
|
|
21
21
|
headers: {
|
|
@@ -20,7 +20,7 @@ function closeWorkbookSession(workbookRef) {
|
|
|
20
20
|
throw new InvalidArgumentError_ts_1.default("Workbook session ID is required to close a session.");
|
|
21
21
|
}
|
|
22
22
|
return (0, graphApi_ts_1.operation)({
|
|
23
|
-
|
|
23
|
+
context: workbookRef.context,
|
|
24
24
|
method: "POST",
|
|
25
25
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/closeSession", workbookRef),
|
|
26
26
|
headers: {
|
|
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
14
14
|
*/
|
|
15
15
|
function createWorkbookSession(itemRef, persistChanges = true) {
|
|
16
16
|
return (0, graphApi_ts_1.operation)({
|
|
17
|
-
|
|
17
|
+
context: itemRef.context,
|
|
18
18
|
method: "POST",
|
|
19
19
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/createSession", itemRef),
|
|
20
20
|
headers: {
|
|
@@ -20,7 +20,7 @@ function refreshWorkbookSession(workbookRef) {
|
|
|
20
20
|
throw new InvalidArgumentError_ts_1.default("Workbook session ID is required to refresh a session.");
|
|
21
21
|
}
|
|
22
22
|
return (0, graphApi_ts_1.operation)({
|
|
23
|
-
|
|
23
|
+
context: workbookRef.context,
|
|
24
24
|
method: "POST",
|
|
25
25
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/refreshSession", workbookRef),
|
|
26
26
|
headers: {
|
|
@@ -13,7 +13,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
13
13
|
*/
|
|
14
14
|
function applyWorkbookTableColumnFilter(columnRef, criteria) {
|
|
15
15
|
return (0, graphApi_ts_1.operation)({
|
|
16
|
-
|
|
16
|
+
context: columnRef.context,
|
|
17
17
|
method: "POST",
|
|
18
18
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/columns/{column}/filter/apply", columnRef),
|
|
19
19
|
headers: {
|
|
@@ -11,7 +11,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
11
|
*/
|
|
12
12
|
function clearWorkbookTableColumnFilters(tableRef) {
|
|
13
13
|
return (0, graphApi_ts_1.operation)({
|
|
14
|
-
|
|
14
|
+
context: tableRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/clearFilters", tableRef),
|
|
17
17
|
headers: {
|
|
@@ -14,7 +14,7 @@ const workbookTable_ts_1 = require("../../services/workbookTable.js");
|
|
|
14
14
|
*/
|
|
15
15
|
function createWorkbookTable(rangeRef, hasHeaders) {
|
|
16
16
|
return (0, graphApi_ts_1.operation)({
|
|
17
|
-
|
|
17
|
+
context: rangeRef.context,
|
|
18
18
|
method: "POST",
|
|
19
19
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/add", rangeRef),
|
|
20
20
|
headers: {
|
|
@@ -13,7 +13,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
13
13
|
*/
|
|
14
14
|
function deleteWorkbookTable(tableRef) {
|
|
15
15
|
return (0, graphApi_ts_1.operation)({
|
|
16
|
-
|
|
16
|
+
context: tableRef.context,
|
|
17
17
|
method: "DELETE",
|
|
18
18
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}", tableRef),
|
|
19
19
|
headers: {
|
|
@@ -11,7 +11,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
11
11
|
*/
|
|
12
12
|
function deleteWorkbookTablePreservingValues(tableRef) {
|
|
13
13
|
return (0, graphApi_ts_1.operation)({
|
|
14
|
-
|
|
14
|
+
context: tableRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/convertToRange", tableRef),
|
|
17
17
|
headers: {
|
|
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
12
|
*/
|
|
13
13
|
function getWorkbookTable(tableRef) {
|
|
14
14
|
return (0, graphApi_ts_1.operation)({
|
|
15
|
-
|
|
15
|
+
context: tableRef.context,
|
|
16
16
|
method: "GET",
|
|
17
17
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}", tableRef),
|
|
18
18
|
headers: {
|
|
@@ -17,7 +17,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
|
17
17
|
*/
|
|
18
18
|
function getWorkbookTableBodyRange(tableRef) {
|
|
19
19
|
return (0, graphApi_ts_1.operation)({
|
|
20
|
-
|
|
20
|
+
context: tableRef.context,
|
|
21
21
|
method: "GET",
|
|
22
22
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/dataBodyRange", tableRef),
|
|
23
23
|
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"}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = getWorkbookTableBodyVisibleRange;
|
|
4
4
|
const graphApi_ts_1 = require("../../graphApi.js");
|
|
5
5
|
const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
6
|
-
const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
7
6
|
/**
|
|
8
7
|
* Retrieve the visible data body range of a table.
|
|
9
8
|
*
|
|
@@ -13,7 +12,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
|
13
12
|
*/
|
|
14
13
|
function getWorkbookTableBodyVisibleRange(tableRef) {
|
|
15
14
|
return (0, graphApi_ts_1.operation)({
|
|
16
|
-
|
|
15
|
+
context: tableRef.context,
|
|
17
16
|
method: "GET",
|
|
18
17
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/dataBodyRange/visibleView", tableRef),
|
|
19
18
|
headers: {
|
|
@@ -22,11 +21,9 @@ function getWorkbookTableBodyVisibleRange(tableRef) {
|
|
|
22
21
|
body: null,
|
|
23
22
|
responseTransform: (response) => {
|
|
24
23
|
const range = response;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...rangeRef,
|
|
29
|
-
};
|
|
24
|
+
// This API does not appear to return the range address. It is undefined.
|
|
25
|
+
// const rangeRef = createWorkbookRangeRef(tableRef, range.address as CellRangeAddress);
|
|
26
|
+
return range;
|
|
30
27
|
},
|
|
31
28
|
});
|
|
32
29
|
}
|
|
@@ -17,7 +17,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
|
17
17
|
*/
|
|
18
18
|
function getWorkbookTableHeaderRange(tableRef) {
|
|
19
19
|
return (0, graphApi_ts_1.operation)({
|
|
20
|
-
|
|
20
|
+
context: tableRef.context,
|
|
21
21
|
method: "GET",
|
|
22
22
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables/{table-id}/headerRowRange", tableRef),
|
|
23
23
|
headers: {
|
|
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
12
|
*/
|
|
13
13
|
function listWorkbookTableColumns(tableRef) {
|
|
14
14
|
return (0, graphApi_ts_1.operation)({
|
|
15
|
-
|
|
15
|
+
context: tableRef.context,
|
|
16
16
|
method: "GET",
|
|
17
17
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/columns", tableRef),
|
|
18
18
|
headers: {
|
|
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
12
|
*/
|
|
13
13
|
function listWorkbookTableRows(tableRef) {
|
|
14
14
|
return (0, graphApi_ts_1.operation)({
|
|
15
|
-
|
|
15
|
+
context: tableRef.context,
|
|
16
16
|
method: "GET",
|
|
17
17
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/tables/{table-id}/rows", tableRef),
|
|
18
18
|
headers: {
|
|
@@ -13,7 +13,7 @@ const workbookTable_ts_1 = require("../../services/workbookTable.js");
|
|
|
13
13
|
*/
|
|
14
14
|
function listWorkbookTables(worksheetRef) {
|
|
15
15
|
return (0, graphApi_ts_1.operation)({
|
|
16
|
-
|
|
16
|
+
context: worksheetRef.context,
|
|
17
17
|
method: "GET",
|
|
18
18
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/tables", worksheetRef),
|
|
19
19
|
headers: {
|
|
@@ -14,7 +14,7 @@ const workbookWorksheet_ts_1 = require("../../services/workbookWorksheet.js");
|
|
|
14
14
|
*/
|
|
15
15
|
function createWorkbookWorksheet(workbookRef, name) {
|
|
16
16
|
return (0, graphApi_ts_1.operation)({
|
|
17
|
-
|
|
17
|
+
context: workbookRef.context,
|
|
18
18
|
method: "POST",
|
|
19
19
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/add", workbookRef),
|
|
20
20
|
headers: {
|
|
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
12
12
|
*/
|
|
13
13
|
function deleteWorkbookWorksheet(worksheetRef) {
|
|
14
14
|
return (0, graphApi_ts_1.operation)({
|
|
15
|
-
|
|
15
|
+
context: worksheetRef.context,
|
|
16
16
|
method: "DELETE",
|
|
17
17
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}", worksheetRef),
|
|
18
18
|
headers: {
|
|
@@ -17,7 +17,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
|
17
17
|
*/
|
|
18
18
|
function getWorkbookWorksheetUsedRange(worksheetRef) {
|
|
19
19
|
return (0, graphApi_ts_1.operation)({
|
|
20
|
-
|
|
20
|
+
context: worksheetRef.context,
|
|
21
21
|
method: "GET",
|
|
22
22
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange", worksheetRef),
|
|
23
23
|
headers: {
|
|
@@ -17,7 +17,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
|
17
17
|
*/
|
|
18
18
|
function getWorkbookWorksheetUsedRangeRef(worksheetRef) {
|
|
19
19
|
return (0, graphApi_ts_1.operation)({
|
|
20
|
-
|
|
20
|
+
context: worksheetRef.context,
|
|
21
21
|
method: "GET",
|
|
22
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
23
|
headers: {
|
|
@@ -13,7 +13,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
|
|
|
13
13
|
*/
|
|
14
14
|
function getWorkbookWorksheetUsedVisibleRange(worksheetRef) {
|
|
15
15
|
return (0, graphApi_ts_1.operation)({
|
|
16
|
-
|
|
16
|
+
context: worksheetRef.context,
|
|
17
17
|
method: "GET",
|
|
18
18
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range/usedRange/visibleView", worksheetRef),
|
|
19
19
|
headers: {
|
|
@@ -17,7 +17,7 @@ const workbookWorksheet_ts_1 = require("../../services/workbookWorksheet.js");
|
|
|
17
17
|
*/
|
|
18
18
|
function listWorkbookWorksheets(workbookRef) {
|
|
19
19
|
return (0, graphApi_ts_1.operation)({
|
|
20
|
-
|
|
20
|
+
context: workbookRef.context,
|
|
21
21
|
method: "GET",
|
|
22
22
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets", workbookRef),
|
|
23
23
|
headers: {
|
|
@@ -16,7 +16,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
|
|
|
16
16
|
*/
|
|
17
17
|
function updateWorkbookWorksheet(worksheetRef, updates) {
|
|
18
18
|
return (0, graphApi_ts_1.operation)({
|
|
19
|
-
|
|
19
|
+
context: worksheetRef.context,
|
|
20
20
|
method: "PATCH",
|
|
21
21
|
path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}", worksheetRef),
|
|
22
22
|
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
|
|
@@ -24,7 +24,7 @@ exports.countAddressRows = countAddressRows;
|
|
|
24
24
|
exports.countAddressColumns = countAddressColumns;
|
|
25
25
|
exports.cellToRangeAddress = cellToRangeAddress;
|
|
26
26
|
exports.subAddress = subAddress;
|
|
27
|
-
exports.
|
|
27
|
+
exports.subRange = subRange;
|
|
28
28
|
const InvalidArgumentError_ts_1 = __importDefault(require("../errors/InvalidArgumentError.js"));
|
|
29
29
|
const UnsupportedAddressTypeError_ts_1 = __importDefault(require("../errors/UnsupportedAddressTypeError.js"));
|
|
30
30
|
const addressOffset_ts_1 = require("./addressOffset.js");
|
|
@@ -343,7 +343,7 @@ function cellToRangeAddress(cell, rows, cols) {
|
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
/**
|
|
346
|
-
* Extracts a
|
|
346
|
+
* Extracts a sub-address from a spreadsheet-style A1 range (e.g., "A1:D10"),
|
|
347
347
|
* allowing skip and take semantics on both rows and columns.
|
|
348
348
|
*
|
|
349
349
|
* Supports negative values for `skipRows` and `skipCols` to count from the end.
|
|
@@ -397,7 +397,7 @@ function subAddress(address, skipRows = 0, takeRows = Number.POSITIVE_INFINITY,
|
|
|
397
397
|
}
|
|
398
398
|
}
|
|
399
399
|
/**
|
|
400
|
-
* Extracts a
|
|
400
|
+
* Extracts a sub-range from a WorkbookRangeRef using skip/take semantics.
|
|
401
401
|
* @param rangeRef Range reference to extract the sub-range from.
|
|
402
402
|
* @param skipRows Number of rows to skip. If negative, skips from the end. Default 0.
|
|
403
403
|
* @param takeRows Number of rows to take after skipping. If negative, excludes from the end. Default Infinity.
|
|
@@ -406,7 +406,7 @@ function subAddress(address, skipRows = 0, takeRows = Number.POSITIVE_INFINITY,
|
|
|
406
406
|
* @returns Extracted sub-range reference.
|
|
407
407
|
* @throws InvalidArgumentError if the requested rows or columns exceed the available range.
|
|
408
408
|
*/
|
|
409
|
-
function
|
|
409
|
+
function subRange(rangeRef, skipRows = 0, takeRows = Number.POSITIVE_INFINITY, skipCols = 0, takeCols = Number.POSITIVE_INFINITY) {
|
|
410
410
|
const address = subAddress(rangeRef.address, skipRows, takeRows, skipCols, takeCols);
|
|
411
411
|
return {
|
|
412
412
|
...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,63 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
exports.
|
|
3
|
+
exports.createClientSecretContext = createClientSecretContext;
|
|
4
|
+
exports.createAccessTokenContext = createAccessTokenContext;
|
|
5
|
+
exports.createContext = createContext;
|
|
6
|
+
exports.createDefaultClientSecretContext = createDefaultClientSecretContext;
|
|
8
7
|
exports.getDefaultContextRef = getDefaultContextRef;
|
|
9
|
-
|
|
8
|
+
exports.register = register;
|
|
9
|
+
const accessToken_ts_1 = require("./accessToken.js");
|
|
10
10
|
const environmentVariable_ts_1 = require("./environmentVariable.js");
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
* @param clientId - The client ID.
|
|
17
|
-
* @param clientSecret - The client secret.
|
|
18
|
-
* @returns A reference to the registered context.
|
|
19
|
-
*/
|
|
20
|
-
function register(tenantId, clientId, clientSecret) {
|
|
21
|
-
const contextId = generateContextId();
|
|
22
|
-
const context = {
|
|
23
|
-
tenantId,
|
|
24
|
-
clientId,
|
|
25
|
-
clientSecret,
|
|
11
|
+
const defaultScope = "https://graph.microsoft.com/.default";
|
|
12
|
+
/** Create a context using the client secret credential. */
|
|
13
|
+
function createClientSecretContext(tenantId, clientId, clientSecret, scope = defaultScope) {
|
|
14
|
+
const generateAccessToken = async () => {
|
|
15
|
+
return await (0, accessToken_ts_1.getCurrentAccessToken)(tenantId, clientId, clientSecret, scope);
|
|
26
16
|
};
|
|
27
|
-
|
|
28
|
-
const contextRef = createContextRef(contextId);
|
|
29
|
-
return contextRef;
|
|
17
|
+
return createContext(generateAccessToken);
|
|
30
18
|
}
|
|
31
19
|
/**
|
|
32
|
-
*
|
|
33
|
-
* @
|
|
34
|
-
* @returns The context associated with the given ID.
|
|
35
|
-
* @throws ContextNotRegisteredError if the context ID is not registered.
|
|
20
|
+
* Create a context using a static access token.
|
|
21
|
+
* @remarks You must manually handle renewal of the access token with this approach.
|
|
36
22
|
*/
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
return context;
|
|
43
|
-
}
|
|
44
|
-
function generateContextId() {
|
|
45
|
-
return (0, random_ts_1.generateRandomString)(16);
|
|
23
|
+
function createAccessTokenContext(accessToken) {
|
|
24
|
+
// biome-ignore lint/suspicious/useAwait: Not applicable here, as we are creating a context that returns a static access token.
|
|
25
|
+
return createContext(async () => {
|
|
26
|
+
return accessToken;
|
|
27
|
+
});
|
|
46
28
|
}
|
|
47
|
-
|
|
29
|
+
/** Create a context using a given access token generator. */
|
|
30
|
+
function createContext(accessTokenGenerator) {
|
|
31
|
+
const context = {
|
|
32
|
+
generateAccessToken: accessTokenGenerator,
|
|
33
|
+
};
|
|
48
34
|
return {
|
|
49
|
-
|
|
35
|
+
context,
|
|
50
36
|
};
|
|
51
37
|
}
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
* @returns A reference to the default context.
|
|
55
|
-
* @remarks This method is opinionated and not recommended for production use.
|
|
56
|
-
*/
|
|
57
|
-
function getDefaultContextRef() {
|
|
38
|
+
/** Create a context using the client secret credential using environment variables AZURE_TENANT_ID, AZURE_CLIENT_ID and AZURE_CLIENT_SECRET. */
|
|
39
|
+
function createDefaultClientSecretContext() {
|
|
58
40
|
const tenantId = (0, environmentVariable_ts_1.getEnvironmentVariable)("AZURE_TENANT_ID");
|
|
59
41
|
const clientId = (0, environmentVariable_ts_1.getEnvironmentVariable)("AZURE_CLIENT_ID");
|
|
60
42
|
const clientSecret = (0, environmentVariable_ts_1.getEnvironmentVariable)("AZURE_CLIENT_SECRET");
|
|
61
|
-
|
|
62
|
-
|
|
43
|
+
return createClientSecretContext(tenantId, clientId, clientSecret);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
@obsolete Use `createDefaultClientSecretContext()` instead.
|
|
47
|
+
*/
|
|
48
|
+
function getDefaultContextRef() {
|
|
49
|
+
return createDefaultClientSecretContext();
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* @obsolete Use `createClientSecretContext()` instead.
|
|
53
|
+
*/
|
|
54
|
+
function register(tenantId, clientId, clientSecret) {
|
|
55
|
+
return createClientSecretContext(tenantId, clientId, clientSecret);
|
|
63
56
|
}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
import type { ClientId } from "../models/ClientId.ts";
|
|
2
|
+
import type { ClientSecret } from "../models/ClientSecret.ts";
|
|
1
3
|
import type { DriveId } from "../models/DriveId.ts";
|
|
2
4
|
import type { DriveRef } from "../models/DriveRef.ts";
|
|
5
|
+
import type { SiteId } from "../models/SiteId.ts";
|
|
3
6
|
import type { SiteRef } from "../models/SiteRef.ts";
|
|
7
|
+
import type { TenantId } from "../models/TenantId.ts";
|
|
4
8
|
/**
|
|
5
9
|
* Creates a reference to a drive.
|
|
6
10
|
* @param siteRef - The reference to the site.
|
|
@@ -9,10 +13,13 @@ import type { SiteRef } from "../models/SiteRef.ts";
|
|
|
9
13
|
* @throws ProtocolError if the drive ID is missing.
|
|
10
14
|
*/
|
|
11
15
|
export declare function createDriveRef(siteRef: SiteRef, driveId: DriveId | undefined): DriveRef;
|
|
16
|
+
/** Creates a context with a reference to a drive. */
|
|
17
|
+
export declare function createClientSecretContextWithDriveRef(tenantId: TenantId, clientId: ClientId, clientSecret: ClientSecret, siteId: SiteId, driveId: DriveId): DriveRef;
|
|
12
18
|
/**
|
|
13
19
|
* Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
|
|
14
20
|
* @returns A reference to the default drive.
|
|
15
21
|
* @remarks This method is opinionated and not recommended for production use.
|
|
22
|
+
* @obsolete Use `createClientSecretContextWithDriveRef()` instead.
|
|
16
23
|
*/
|
|
17
24
|
export declare function getDefaultDriveRef(): DriveRef;
|
|
18
25
|
//# sourceMappingURL=drive.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/services/drive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../src/services/drive.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED,qDAAqD;AACrD,wBAAgB,qCAAqC,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAKpK;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAY7C"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createDriveRef = createDriveRef;
|
|
7
|
+
exports.createClientSecretContextWithDriveRef = createClientSecretContextWithDriveRef;
|
|
7
8
|
exports.getDefaultDriveRef = getDefaultDriveRef;
|
|
8
9
|
const ProtocolError_ts_1 = __importDefault(require("../errors/ProtocolError.js"));
|
|
9
10
|
const context_ts_1 = require("./context.js");
|
|
@@ -18,18 +19,26 @@ const site_ts_1 = require("./site.js");
|
|
|
18
19
|
*/
|
|
19
20
|
function createDriveRef(siteRef, driveId) {
|
|
20
21
|
if (!driveId) {
|
|
21
|
-
throw new ProtocolError_ts_1.default("
|
|
22
|
+
throw new ProtocolError_ts_1.default("DriveId is missing");
|
|
22
23
|
}
|
|
23
24
|
return {
|
|
24
|
-
|
|
25
|
+
context: siteRef.context,
|
|
25
26
|
siteId: siteRef.siteId,
|
|
26
27
|
driveId,
|
|
27
28
|
};
|
|
28
29
|
}
|
|
30
|
+
/** Creates a context with a reference to a drive. */
|
|
31
|
+
function createClientSecretContextWithDriveRef(tenantId, clientId, clientSecret, siteId, driveId) {
|
|
32
|
+
const context = (0, context_ts_1.createClientSecretContext)(tenantId, clientId, clientSecret);
|
|
33
|
+
const siteRef = (0, site_ts_1.createSiteRef)(context, siteId);
|
|
34
|
+
const driveRef = createDriveRef(siteRef, driveId);
|
|
35
|
+
return driveRef;
|
|
36
|
+
}
|
|
29
37
|
/**
|
|
30
38
|
* Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
|
|
31
39
|
* @returns A reference to the default drive.
|
|
32
40
|
* @remarks This method is opinionated and not recommended for production use.
|
|
41
|
+
* @obsolete Use `createClientSecretContextWithDriveRef()` instead.
|
|
33
42
|
*/
|
|
34
43
|
function getDefaultDriveRef() {
|
|
35
44
|
const tenantId = (0, environmentVariable_ts_1.getEnvironmentVariable)("AZURE_TENANT_ID");
|
|
@@ -6,5 +6,5 @@ import type { GraphPath } from "../models/GraphOperation.ts";
|
|
|
6
6
|
* @returns The generated Graph API path.
|
|
7
7
|
* @throws BadTemplateError if the template is invalid or required arguments are missing.
|
|
8
8
|
*/
|
|
9
|
-
export declare function generatePath(template: string, args: Record<string,
|
|
9
|
+
export declare function generatePath(template: string, args: Record<string, unknown>): GraphPath;
|
|
10
10
|
//# sourceMappingURL=templatedPaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templatedPaths.d.ts","sourceRoot":"","sources":["../../../src/services/templatedPaths.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAK7D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"templatedPaths.d.ts","sourceRoot":"","sources":["../../../src/services/templatedPaths.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAK7D;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAmBvF"}
|