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
|
@@ -24,9 +24,12 @@ function generatePath(template, args) {
|
|
|
24
24
|
return template.replace(argumentPattern, (_, match) => {
|
|
25
25
|
const camelCaseKey = (0, stringCaseConversion_ts_1.kebabToCamelCase)(match);
|
|
26
26
|
const value = args[camelCaseKey];
|
|
27
|
-
if (value === undefined) {
|
|
27
|
+
if (value === undefined || value === null) {
|
|
28
28
|
throw new BadTemplateError_ts_1.default(`Path template references argument '${camelCaseKey}' however no such argument provided.`);
|
|
29
29
|
}
|
|
30
|
-
|
|
30
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
31
|
+
throw new BadTemplateError_ts_1.default(`Path template references argument '${camelCaseKey}' which is of type ${typeof value}, but only strings and numbers are allowed.`);
|
|
32
|
+
}
|
|
33
|
+
return encodeURIComponent(value.toString());
|
|
31
34
|
});
|
|
32
35
|
}
|
|
@@ -7,5 +7,5 @@ import type { WorkbookWorksheetRef } from "../models/WorkbookWorksheetRef.ts";
|
|
|
7
7
|
* @param address - The address of the range.
|
|
8
8
|
* @returns A reference to the workbook range.
|
|
9
9
|
*/
|
|
10
|
-
export declare function createWorkbookRangeRef(worksheetRef: WorkbookWorksheetRef, address: Address): WorkbookRangeRef;
|
|
10
|
+
export declare function createWorkbookRangeRef(worksheetRef: WorkbookWorksheetRef, address: Address | undefined): WorkbookRangeRef;
|
|
11
11
|
//# sourceMappingURL=workbookRange.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbookRange.d.ts","sourceRoot":"","sources":["../../../src/services/workbookRange.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workbookRange.d.ts","sourceRoot":"","sources":["../../../src/services/workbookRange.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAG9E;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,oBAAoB,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,gBAAgB,CAgBzH"}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createWorkbookRangeRef = createWorkbookRangeRef;
|
|
7
|
+
const ProtocolError_ts_1 = __importDefault(require("../errors/ProtocolError.js"));
|
|
8
|
+
const addressManipulation_ts_1 = require("./addressManipulation.js");
|
|
4
9
|
/**
|
|
5
10
|
* Creates a reference to a workbook range.
|
|
6
11
|
* @param worksheetRef - The reference to the worksheet containing the range.
|
|
@@ -8,13 +13,17 @@ exports.createWorkbookRangeRef = createWorkbookRangeRef;
|
|
|
8
13
|
* @returns A reference to the workbook range.
|
|
9
14
|
*/
|
|
10
15
|
function createWorkbookRangeRef(worksheetRef, address) {
|
|
16
|
+
if (!address) {
|
|
17
|
+
throw new ProtocolError_ts_1.default("Address missing.");
|
|
18
|
+
}
|
|
19
|
+
const normalizedAddress = (0, addressManipulation_ts_1.normalizeAddress)(address);
|
|
11
20
|
return {
|
|
12
|
-
|
|
21
|
+
context: worksheetRef.context,
|
|
13
22
|
siteId: worksheetRef.siteId,
|
|
14
23
|
driveId: worksheetRef.driveId,
|
|
15
24
|
itemId: worksheetRef.itemId,
|
|
16
25
|
sessionId: worksheetRef.sessionId,
|
|
17
26
|
worksheetId: worksheetRef.worksheetId,
|
|
18
|
-
address:
|
|
27
|
+
address: normalizedAddress,
|
|
19
28
|
};
|
|
20
29
|
}
|
|
@@ -13,7 +13,7 @@ function createWorkbookTableRef(worksheetRef, tableId) {
|
|
|
13
13
|
throw new Error("TableId is missing");
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
16
|
-
|
|
16
|
+
context: worksheetRef.context,
|
|
17
17
|
siteId: worksheetRef.siteId,
|
|
18
18
|
driveId: worksheetRef.driveId,
|
|
19
19
|
itemId: worksheetRef.itemId,
|
|
@@ -13,7 +13,7 @@ function createWorkbookTableColumnRef(tableRef, column) {
|
|
|
13
13
|
throw new Error("column is missing");
|
|
14
14
|
}
|
|
15
15
|
return {
|
|
16
|
-
|
|
16
|
+
context: tableRef.context,
|
|
17
17
|
siteId: tableRef.siteId,
|
|
18
18
|
driveId: tableRef.driveId,
|
|
19
19
|
itemId: tableRef.itemId,
|
|
@@ -19,7 +19,7 @@ function createWorkbookWorksheetRef(workbookRef, worksheetId) {
|
|
|
19
19
|
throw new Error("WorksheetID is missing");
|
|
20
20
|
}
|
|
21
21
|
return {
|
|
22
|
-
|
|
22
|
+
context: workbookRef.context,
|
|
23
23
|
siteId: workbookRef.siteId,
|
|
24
24
|
driveId: workbookRef.driveId,
|
|
25
25
|
itemId: workbookRef.itemId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listDriveItems.d.ts","sourceRoot":"","sources":["../../../src/tasks/listDriveItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"listDriveItems.d.ts","sourceRoot":"","sources":["../../../src/tasks/listDriveItems.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD,wBAA8B,cAAc,CAAC,SAAS,EAAE,QAAQ,GAAG,YAAY,EAAE,QAAQ,SAAO,GAAG,OAAO,CAAC,CAAC,SAAS,GAAG,YAAY,CAAC,EAAE,CAAC,CAgCvI"}
|
|
@@ -4,10 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.default = listDriveItems;
|
|
7
|
-
const graphApi_ts_1 = require("../graphApi.js");
|
|
8
7
|
const listDriveItemChildren_ts_1 = __importDefault(require("../operations/driveItem/listDriveItemChildren.js"));
|
|
9
|
-
const accessToken_ts_1 = require("../services/accessToken.js");
|
|
10
|
-
const context_ts_1 = require("../services/context.js");
|
|
11
8
|
const driveItem_ts_1 = require("../services/driveItem.js");
|
|
12
9
|
const http_ts_1 = require("../services/http.js");
|
|
13
10
|
async function listDriveItems(parentRef, pageSize = 1000) {
|
|
@@ -15,8 +12,7 @@ async function listDriveItems(parentRef, pageSize = 1000) {
|
|
|
15
12
|
let result = await (0, listDriveItemChildren_ts_1.default)(parentRef, pageSize);
|
|
16
13
|
output.push(...result.value);
|
|
17
14
|
while (result["@odata.nextLink"]) {
|
|
18
|
-
const
|
|
19
|
-
const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, graphApi_ts_1.authenticationScope);
|
|
15
|
+
const accessToken = await parentRef.context.generateAccessToken();
|
|
20
16
|
const response = await (0, http_ts_1.executeHttpRequest)({
|
|
21
17
|
url: result["@odata.nextLink"],
|
|
22
18
|
method: "GET",
|
package/dist/esm/graphApi.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { GraphOperation, GraphOperationDefinition } from "./models/GraphOperation.ts";
|
|
2
|
-
import type { Scope } from "./models/Scope.ts";
|
|
3
|
-
export declare const authenticationScope: Scope;
|
|
4
2
|
export declare const endpoint = "https://graph.microsoft.com/v1.0";
|
|
5
3
|
export declare const batchEndpoint = "https://graph.microsoft.com/v1.0/$batch";
|
|
6
4
|
/** Define a operation, which can either be `await`d to execute independently, or passed with other operations ot `parallel` or `sequential` to execute as part of a batch. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graphApi.d.ts","sourceRoot":"","sources":["../../src/graphApi.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAgB,cAAc,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"graphApi.d.ts","sourceRoot":"","sources":["../../src/graphApi.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAgB,cAAc,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAMzG,eAAO,MAAM,QAAQ,qCAAqC,CAAC;AAC3D,eAAO,MAAM,aAAa,4CAAuB,CAAC;AAElD,8KAA8K;AAC9K,wBAAgB,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAQvF;AAED,6LAA6L;AAC7L,wBAAsB,QAAQ,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAInH;AAED,2DAA2D;AAC3D,wBAAsB,UAAU,CAAC,CAAC,SAAS,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAOrH;AAoBD,KAAK,iBAAiB,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,cAAc,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAChE,CAAC"}
|
package/dist/esm/graphApi.js
CHANGED
|
@@ -4,13 +4,10 @@ import InvalidArgumentError from "./errors/InvalidArgumentError.js";
|
|
|
4
4
|
import NeverError from "./errors/NeverError.js";
|
|
5
5
|
import ProtocolError from "./errors/ProtocolError.js";
|
|
6
6
|
import RequestFailedError from "./errors/RequestFailedError.js";
|
|
7
|
-
import { getCurrentAccessToken } from "./services/accessToken.js";
|
|
8
|
-
import { getContext } from "./services/context.js";
|
|
9
7
|
import { executeHttpRequest } from "./services/http.js";
|
|
10
8
|
import { isGatewayTimeout, isHttpSuccess, isHttpTooManyRequests, isLocked, isServiceUnavailable } from "./services/httpStatus.js";
|
|
11
9
|
import { operationIdToIndex, operationIndexToId } from "./services/operationId.js";
|
|
12
10
|
import { sleep } from "./services/sleep.js";
|
|
13
|
-
export const authenticationScope = "https://graph.microsoft.com/.default";
|
|
14
11
|
export const endpoint = "https://graph.microsoft.com/v1.0";
|
|
15
12
|
export const batchEndpoint = `${endpoint}/$batch`;
|
|
16
13
|
/** Define a operation, which can either be `await`d to execute independently, or passed with other operations ot `parallel` or `sequential` to execute as part of a batch. */
|
|
@@ -40,8 +37,7 @@ const maxRetries = 5;
|
|
|
40
37
|
const defaultRetryDelayMilliseconds = 1000;
|
|
41
38
|
const consecutiveRetryDelayMultiplier = 2;
|
|
42
39
|
async function executeSingle(definition) {
|
|
43
|
-
const
|
|
44
|
-
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
40
|
+
const accessToken = await definition.context.generateAccessToken();
|
|
45
41
|
const response = await innerFetch({
|
|
46
42
|
url: `${endpoint}${definition.path}`,
|
|
47
43
|
method: definition.method,
|
|
@@ -62,12 +58,11 @@ async function executeBatch(...ops) {
|
|
|
62
58
|
if (!firstOp) {
|
|
63
59
|
throw new NeverError("First op not found. Should be impossible");
|
|
64
60
|
}
|
|
65
|
-
const
|
|
66
|
-
if (ops.some((op) => op.
|
|
67
|
-
throw new InconsistentContextError("All operations in a batch must share the same
|
|
61
|
+
const context = firstOp.context;
|
|
62
|
+
if (ops.some((op) => op.context !== context)) {
|
|
63
|
+
throw new InconsistentContextError("All operations in a batch must share the same context.");
|
|
68
64
|
}
|
|
69
|
-
const
|
|
70
|
-
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
65
|
+
const accessToken = await context.generateAccessToken();
|
|
71
66
|
const body = await innerFetch({
|
|
72
67
|
url: batchEndpoint,
|
|
73
68
|
method: "POST",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccessTokenGenerator.d.ts","sourceRoot":"","sources":["../../../src/models/AccessTokenGenerator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ClientSecret } from "./ClientSecret.ts";
|
|
3
|
-
import type { TenantId } from "./TenantId.ts";
|
|
1
|
+
import type { AccessTokenGenerator } from "./AccessTokenGenerator.ts";
|
|
4
2
|
export type Context = {
|
|
5
|
-
|
|
6
|
-
clientId: ClientId;
|
|
7
|
-
clientSecret: ClientSecret;
|
|
3
|
+
generateAccessToken: AccessTokenGenerator;
|
|
8
4
|
};
|
|
9
5
|
//# sourceMappingURL=Context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/models/Context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/models/Context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,MAAM,MAAM,OAAO,GAAG;IACrB,mBAAmB,EAAE,oBAAoB,CAAC;CAC1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextRef.d.ts","sourceRoot":"","sources":["../../../src/models/ContextRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"ContextRef.d.ts","sourceRoot":"","sources":["../../../src/models/ContextRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,MAAM,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;CACjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Context } from "./Context.ts";
|
|
2
2
|
import type { WorkbookSessionId } from "./WorkbookSessionId.ts";
|
|
3
3
|
export type GraphMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
4
4
|
export type GraphPath = string & {
|
|
@@ -10,7 +10,7 @@ export type GraphHeaders = {
|
|
|
10
10
|
};
|
|
11
11
|
export type GraphOperationDefinition<T> = {
|
|
12
12
|
/** Context to match the operation to. Used for authentication etc. */
|
|
13
|
-
|
|
13
|
+
context: Context;
|
|
14
14
|
/** HTTP method to be used. */
|
|
15
15
|
method: GraphMethod;
|
|
16
16
|
/** Relative resource URL for the individual request. Ie, if the absolute URL is `https://graph.microsoft.com/v1.0/users`, this path is `/users`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphOperation.d.ts","sourceRoot":"","sources":["../../../src/models/GraphOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"GraphOperation.d.ts","sourceRoot":"","sources":["../../../src/models/GraphOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AACtE,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,YAAY,GAAG;IAC1B,qBAAqB,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACtD,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACpC,CAAC;AAGF,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI;IACzC,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IACjB,8BAA8B;IAC9B,MAAM,EAAE,WAAW,CAAC;IACpB,oJAAoJ;IACpJ,IAAI,EAAE,SAAS,CAAC;IAChB,kGAAkG;IAClG,OAAO,EAAE,YAAY,CAAC;IACtB,6LAA6L;IAC7L,IAAI,EAAE,OAAO,CAAC;IACd,wDAAwD;IACxD,iBAAiB,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG;IAC5C,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC,CAAC;CACxC,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Context } from "./Context.ts";
|
|
2
2
|
import type { SiteId } from "./SiteId.ts";
|
|
3
|
-
export type SiteRef =
|
|
3
|
+
export type SiteRef = {
|
|
4
|
+
context: Context;
|
|
4
5
|
siteId: SiteId;
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=SiteRef.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SiteRef.d.ts","sourceRoot":"","sources":["../../../src/models/SiteRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SiteRef.d.ts","sourceRoot":"","sources":["../../../src/models/SiteRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function createFolder(parentRef, folderName) {
|
|
13
13
|
const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: parentRef.context,
|
|
16
16
|
method: "POST",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/${pathSegment}/children`, parentRef),
|
|
18
18
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function listDrives(siteRef) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: siteRef.context,
|
|
14
14
|
method: "GET",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives", siteRef),
|
|
16
16
|
headers: {},
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function createDriveItem(parentRef, itemPath, contextType, content) {
|
|
13
13
|
const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: parentRef.context,
|
|
16
16
|
method: "PUT",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/${pathSegment}:/${itemPath}:/content`, parentRef),
|
|
18
18
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function deleteDriveItem(itemRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: itemRef.context,
|
|
13
13
|
method: "DELETE",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}", itemRef),
|
|
15
15
|
headers: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"existsDriveItem.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/existsDriveItem.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAKzD;;;;;GAKG;AACH,wBAA8B,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAuB3G"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCurrentAccessToken } from "../../services/accessToken.js";
|
|
3
|
-
import { getContext } from "../../services/context.js";
|
|
1
|
+
import { endpoint } from "../../graphApi.js";
|
|
4
2
|
import { executeHttpRequest } from "../../services/http.js";
|
|
5
3
|
import { isHttpNotFound, isHttpOk } from "../../services/httpStatus.js";
|
|
6
4
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
@@ -13,8 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
13
11
|
export default async function existsDriveItem(driveRef, itemPath) {
|
|
14
12
|
// Note this method doesn't match the standard pattern since the batching library doesn't support non-JSON return types.
|
|
15
13
|
const url = `${endpoint}${generatePath(`/sites/{site-id}/drives/{drive-id}/root:${itemPath}`, driveRef)}`;
|
|
16
|
-
const
|
|
17
|
-
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
14
|
+
const accessToken = await driveRef.context.generateAccessToken();
|
|
18
15
|
const response = await executeHttpRequest({
|
|
19
16
|
url,
|
|
20
17
|
method: "GET",
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function getDriveItem(itemRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: itemRef.context,
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}", itemRef),
|
|
15
15
|
headers: {},
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function getDriveItemByPath(driveRef, itemPath) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: driveRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/root:${itemPath}`, driveRef),
|
|
17
17
|
headers: {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemContent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"getDriveItemContent.d.ts","sourceRoot":"","sources":["../../../../src/operations/driveItem/getDriveItemContent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAKjE;;;;;;;GAOG;AACH,wBAA8B,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA6B7F"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { getCurrentAccessToken } from "../../services/accessToken.js";
|
|
3
|
-
import { getContext } from "../../services/context.js";
|
|
1
|
+
import { endpoint } from "../../graphApi.js";
|
|
4
2
|
import { executeHttpRequest } from "../../services/http.js";
|
|
5
3
|
import { isHttpSuccess } from "../../services/httpStatus.js";
|
|
6
4
|
import { generatePath } from "../../services/templatedPaths.js";
|
|
@@ -15,8 +13,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
15
13
|
export default async function getDriveItemContent(itemRef) {
|
|
16
14
|
// Note this method doesn't match the standard pattern since the batching library doesn't support non-JSON return types, and there appears to be no value in adding support.
|
|
17
15
|
const url = `${endpoint}${generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/content", itemRef)}`;
|
|
18
|
-
const
|
|
19
|
-
const accessToken = await getCurrentAccessToken(context.tenantId, context.clientId, context.clientSecret, authenticationScope);
|
|
16
|
+
const accessToken = await itemRef.context.generateAccessToken();
|
|
20
17
|
const response = await executeHttpRequest({
|
|
21
18
|
url,
|
|
22
19
|
method: "GET",
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function initiateCopyDriveItem(srcFileRef, dstFolderRef, dstFileName) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: srcFileRef.context,
|
|
15
15
|
method: "POST",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/copy", srcFileRef),
|
|
17
17
|
headers: {
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function listDriveItemChildren(parentRef, take = 1000) {
|
|
13
13
|
const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: parentRef.context,
|
|
16
16
|
method: "GET",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/${pathSegment}/children?$top=${take}`, parentRef),
|
|
18
18
|
headers: {},
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function moveDriveItem(srcFileRef, dstFolderRef, dstFileName) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: srcFileRef.context,
|
|
15
15
|
method: "PATCH",
|
|
16
16
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}", srcFileRef),
|
|
17
17
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function getSite(siteRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: siteRef.context,
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: generatePath("/sites/{site-id}", siteRef),
|
|
15
15
|
headers: {},
|
|
@@ -7,7 +7,7 @@ import type { SiteRef } from "../../models/SiteRef.ts";
|
|
|
7
7
|
/**
|
|
8
8
|
* Get a site by its name.
|
|
9
9
|
*
|
|
10
|
-
* @param
|
|
10
|
+
* @param context - A reference to the context.
|
|
11
11
|
* @param hostName - The host name of the site.
|
|
12
12
|
* @param siteName - The name of the site.
|
|
13
13
|
* @returns The specified site, including its metadata and reference information.
|
|
@@ -4,7 +4,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Get a site by its name.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param context - A reference to the context.
|
|
8
8
|
* @param hostName - The host name of the site.
|
|
9
9
|
* @param siteName - The name of the site.
|
|
10
10
|
* @returns The specified site, including its metadata and reference information.
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export default function getSiteByName(contextRef, hostName, siteName) {
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: contextRef.context,
|
|
16
16
|
method: "GET",
|
|
17
17
|
path: generatePath("/sites/{host-name}:/sites/{site-name}", { hostName, siteName }),
|
|
18
18
|
headers: {},
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function listSites(contextRef) {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: contextRef.context,
|
|
14
14
|
method: "GET",
|
|
15
15
|
path: generatePath("/sites", {}),
|
|
16
16
|
headers: {},
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export default function searchSites(contextRef, search) {
|
|
13
13
|
return operation({
|
|
14
|
-
|
|
14
|
+
context: contextRef.context,
|
|
15
15
|
method: "GET",
|
|
16
16
|
path: generatePath("/sites?search={search}", { search }),
|
|
17
17
|
headers: {},
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { Message } from "@microsoft/microsoft-graph-types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Context } from "../../models/Context.ts";
|
|
3
3
|
import type { GraphOperation } from "../../models/GraphOperation.ts";
|
|
4
4
|
/**
|
|
5
5
|
* Send an email.
|
|
6
6
|
*
|
|
7
|
-
* @param
|
|
7
|
+
* @param context - A reference to the context.
|
|
8
8
|
* @param sender - The email address of the sender or NULL for the current user. Must match a valid email address in this tenant.
|
|
9
9
|
* @param message - The email message to be sent.
|
|
10
10
|
* @returns Nothing.
|
|
11
11
|
* @throws InvalidArgumentError if the sender email address does not match the required pattern.
|
|
12
12
|
* @see https://learn.microsoft.com/en-us/graph/api/user-sendmail
|
|
13
13
|
*/
|
|
14
|
-
export default function userSendMail(
|
|
14
|
+
export default function userSendMail(context: Context, sender: string | null, message: Message): GraphOperation<void>;
|
|
15
15
|
//# sourceMappingURL=userSendMail.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"userSendMail.d.ts","sourceRoot":"","sources":["../../../../src/operations/user/userSendMail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"userSendMail.d.ts","sourceRoot":"","sources":["../../../../src/operations/user/userSendMail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAGhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,gCAAgC,CAAC;AAMhF;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAmBpH"}
|
|
@@ -5,20 +5,20 @@ const emailPattern = /^[a-zA-Z0-9._\-@]+$/; // Basic, but intended just to avoid
|
|
|
5
5
|
/**
|
|
6
6
|
* Send an email.
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
8
|
+
* @param context - A reference to the context.
|
|
9
9
|
* @param sender - The email address of the sender or NULL for the current user. Must match a valid email address in this tenant.
|
|
10
10
|
* @param message - The email message to be sent.
|
|
11
11
|
* @returns Nothing.
|
|
12
12
|
* @throws InvalidArgumentError if the sender email address does not match the required pattern.
|
|
13
13
|
* @see https://learn.microsoft.com/en-us/graph/api/user-sendmail
|
|
14
14
|
*/
|
|
15
|
-
export default function userSendMail(
|
|
15
|
+
export default function userSendMail(context, sender, message) {
|
|
16
16
|
if (sender && !emailPattern.test(sender)) {
|
|
17
17
|
throw new InvalidArgumentError(`Invalid email address. Must match pattern '${emailPattern}'`);
|
|
18
18
|
}
|
|
19
19
|
const path = sender ? `/users/${sender}/sendMail` : "/me/sendMail";
|
|
20
20
|
return operation({
|
|
21
|
-
|
|
21
|
+
context,
|
|
22
22
|
method: "POST",
|
|
23
23
|
path: path,
|
|
24
24
|
headers: {
|
|
@@ -10,7 +10,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function calculateWorkbook(workbookRef, calculationType = "Recalculate") {
|
|
12
12
|
return operation({
|
|
13
|
-
|
|
13
|
+
context: workbookRef.context,
|
|
14
14
|
method: "POST",
|
|
15
15
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/application/calculate", workbookRef),
|
|
16
16
|
headers: {
|
|
@@ -17,7 +17,7 @@ export default function createWorkbook(parentRef, itemPath) {
|
|
|
17
17
|
}
|
|
18
18
|
const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
|
|
19
19
|
return operation({
|
|
20
|
-
|
|
20
|
+
context: parentRef.context,
|
|
21
21
|
method: "PUT",
|
|
22
22
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/${pathSegment}:/${itemPath}:/content`, parentRef),
|
|
23
23
|
headers: {
|
|
@@ -11,7 +11,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
11
11
|
export default function autoFitWorkbookRangeColumns(rangeRef) {
|
|
12
12
|
const address = normalizeAddress(rangeRef.address, true);
|
|
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='${address}')/format/autofitcolumns`, rangeRef),
|
|
17
17
|
headers: {
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function clearWorkbookRange(rangeRef, applyTo = "All") {
|
|
13
13
|
const address = normalizeAddress(rangeRef.address, true);
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: rangeRef.context,
|
|
16
16
|
method: "POST",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/clear`, rangeRef),
|
|
18
18
|
headers: {
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function deleteWorkbookRange(rangeRef, shift) {
|
|
13
13
|
const address = normalizeAddress(rangeRef.address, true);
|
|
14
14
|
return operation({
|
|
15
|
-
|
|
15
|
+
context: rangeRef.context,
|
|
16
16
|
method: "POST",
|
|
17
17
|
path: generatePath(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/delete`, rangeRef),
|
|
18
18
|
headers: {
|
|
@@ -9,7 +9,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
9
9
|
*/
|
|
10
10
|
export default function getWorkbookNamedRange(rangeRef) {
|
|
11
11
|
return operation({
|
|
12
|
-
|
|
12
|
+
context: rangeRef.context,
|
|
13
13
|
method: "GET",
|
|
14
14
|
path: generatePath("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/names/{range-name}/range", rangeRef),
|
|
15
15
|
headers: {
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function getWorkbookRangeFill(rangeRef) {
|
|
13
13
|
const address = normalizeAddress(rangeRef.address, true);
|
|
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}')/format/fill`, rangeRef),
|
|
18
18
|
headers: {
|
|
@@ -12,7 +12,7 @@ import { generatePath } from "../../services/templatedPaths.js";
|
|
|
12
12
|
export default function getWorkbookRangeFont(rangeRef) {
|
|
13
13
|
const address = normalizeAddress(rangeRef.address, true);
|
|
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}')/format/font`, rangeRef),
|
|
18
18
|
headers: {
|