microsoft-graph 2.22.3 → 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.
Files changed (201) hide show
  1. package/dist/cjs/graphApi.d.ts +0 -2
  2. package/dist/cjs/graphApi.d.ts.map +1 -1
  3. package/dist/cjs/graphApi.js +6 -11
  4. package/dist/cjs/models/AccessTokenGenerator.d.ts +3 -0
  5. package/dist/cjs/models/AccessTokenGenerator.d.ts.map +1 -0
  6. package/dist/cjs/models/Context.d.ts +2 -6
  7. package/dist/cjs/models/Context.d.ts.map +1 -1
  8. package/dist/cjs/models/ContextRef.d.ts +2 -2
  9. package/dist/cjs/models/ContextRef.d.ts.map +1 -1
  10. package/dist/cjs/models/GraphOperation.d.ts +2 -2
  11. package/dist/cjs/models/GraphOperation.d.ts.map +1 -1
  12. package/dist/cjs/models/SiteRef.d.ts +3 -2
  13. package/dist/cjs/models/SiteRef.d.ts.map +1 -1
  14. package/dist/cjs/operations/drive/createFolder.js +1 -1
  15. package/dist/cjs/operations/drive/listDrives.js +1 -1
  16. package/dist/cjs/operations/driveItem/createDriveItem.js +1 -1
  17. package/dist/cjs/operations/driveItem/deleteDriveItem.js +1 -1
  18. package/dist/cjs/operations/driveItem/existsDriveItem.d.ts.map +1 -1
  19. package/dist/cjs/operations/driveItem/existsDriveItem.js +1 -4
  20. package/dist/cjs/operations/driveItem/getDriveItem.js +1 -1
  21. package/dist/cjs/operations/driveItem/getDriveItemByPath.js +1 -1
  22. package/dist/cjs/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
  23. package/dist/cjs/operations/driveItem/getDriveItemContent.js +1 -4
  24. package/dist/cjs/operations/driveItem/initiateCopyDriveItem.js +1 -1
  25. package/dist/cjs/operations/driveItem/listDriveItemChildren.js +1 -1
  26. package/dist/cjs/operations/driveItem/moveDriveItem.js +1 -1
  27. package/dist/cjs/operations/site/getSite.js +1 -1
  28. package/dist/cjs/operations/site/getSiteByName.d.ts +1 -1
  29. package/dist/cjs/operations/site/getSiteByName.js +2 -2
  30. package/dist/cjs/operations/site/listSites.js +1 -1
  31. package/dist/cjs/operations/site/searchSites.js +1 -1
  32. package/dist/cjs/operations/user/userSendMail.d.ts +3 -3
  33. package/dist/cjs/operations/user/userSendMail.d.ts.map +1 -1
  34. package/dist/cjs/operations/user/userSendMail.js +3 -3
  35. package/dist/cjs/operations/workbook/calculateWorkbook.js +1 -1
  36. package/dist/cjs/operations/workbook/createWorkbook.js +1 -1
  37. package/dist/cjs/operations/workbookRange/autoFitWorkbookRangeColumns.js +1 -1
  38. package/dist/cjs/operations/workbookRange/clearWorkbookRange.js +1 -1
  39. package/dist/cjs/operations/workbookRange/deleteWorkbookRange.js +1 -1
  40. package/dist/cjs/operations/workbookRange/getWorkbookNamedRange.js +1 -1
  41. package/dist/cjs/operations/workbookRange/getWorkbookRangeFill.js +1 -1
  42. package/dist/cjs/operations/workbookRange/getWorkbookRangeFont.js +1 -1
  43. package/dist/cjs/operations/workbookRange/getWorkbookRangeFormat.js +1 -1
  44. package/dist/cjs/operations/workbookRange/getWorkbookUsedRange.js +1 -1
  45. package/dist/cjs/operations/workbookRange/getWorkbookVisibleRange.js +1 -1
  46. package/dist/cjs/operations/workbookRange/getWorkbookWorksheetRange.js +1 -1
  47. package/dist/cjs/operations/workbookRange/insertWorkbookCells.js +1 -1
  48. package/dist/cjs/operations/workbookRange/mergeWorkbookRange.js +1 -1
  49. package/dist/cjs/operations/workbookRange/setWorkbookRangeFill.js +1 -1
  50. package/dist/cjs/operations/workbookRange/setWorkbookRangeFont.js +1 -1
  51. package/dist/cjs/operations/workbookRange/setWorkbookRangeFormat.js +1 -1
  52. package/dist/cjs/operations/workbookRange/unmergeWorkbookRange.js +1 -1
  53. package/dist/cjs/operations/workbookRange/updateWorkbookNamedRange.js +1 -1
  54. package/dist/cjs/operations/workbookRange/updateWorkbookRange.js +1 -1
  55. package/dist/cjs/operations/workbookSession/closeWorkbookSession.js +1 -1
  56. package/dist/cjs/operations/workbookSession/createWorkbookSession.js +1 -1
  57. package/dist/cjs/operations/workbookSession/refreshWorkbookSession.js +1 -1
  58. package/dist/cjs/operations/workbookTable/applyWorkbookTableColumnFilter.js +1 -1
  59. package/dist/cjs/operations/workbookTable/clearWorkbookTableFilters.js +1 -1
  60. package/dist/cjs/operations/workbookTable/createWorkbookTable.js +1 -1
  61. package/dist/cjs/operations/workbookTable/deleteWorkbookTable.js +1 -1
  62. package/dist/cjs/operations/workbookTable/deleteWorkbookTablePreservingValues.js +1 -1
  63. package/dist/cjs/operations/workbookTable/getWorkbookTable.js +1 -1
  64. package/dist/cjs/operations/workbookTable/getWorkbookTableBodyRange.js +1 -1
  65. package/dist/cjs/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts +1 -2
  66. package/dist/cjs/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts.map +1 -1
  67. package/dist/cjs/operations/workbookTable/getWorkbookTableBodyVisibleRange.js +4 -7
  68. package/dist/cjs/operations/workbookTable/getWorkbookTableHeaderRange.js +1 -1
  69. package/dist/cjs/operations/workbookTable/listWorkbookTableColumns.js +1 -1
  70. package/dist/cjs/operations/workbookTable/listWorkbookTableRows.js +1 -1
  71. package/dist/cjs/operations/workbookTable/listWorkbookTables.js +1 -1
  72. package/dist/cjs/operations/workbookWorksheet/createWorkbookWorksheet.js +1 -1
  73. package/dist/cjs/operations/workbookWorksheet/deleteWorkbookWorksheet.js +1 -1
  74. package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRange.js +1 -1
  75. package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeRef.js +1 -1
  76. package/dist/cjs/operations/workbookWorksheet/getWorkbookWorksheetUsedVisibleRange.js +1 -1
  77. package/dist/cjs/operations/workbookWorksheet/listWorkbookWorksheets.js +1 -1
  78. package/dist/cjs/operations/workbookWorksheet/updateWorkbookWorksheet.js +1 -1
  79. package/dist/cjs/services/context.d.ts +16 -17
  80. package/dist/cjs/services/context.d.ts.map +1 -1
  81. package/dist/cjs/services/context.js +40 -47
  82. package/dist/cjs/services/drive.d.ts +7 -0
  83. package/dist/cjs/services/drive.d.ts.map +1 -1
  84. package/dist/cjs/services/drive.js +11 -2
  85. package/dist/cjs/services/driveItem.js +1 -1
  86. package/dist/cjs/services/site.js +1 -1
  87. package/dist/cjs/services/templatedPaths.d.ts +1 -1
  88. package/dist/cjs/services/templatedPaths.d.ts.map +1 -1
  89. package/dist/cjs/services/templatedPaths.js +5 -2
  90. package/dist/cjs/services/workbookRange.d.ts +1 -1
  91. package/dist/cjs/services/workbookRange.d.ts.map +1 -1
  92. package/dist/cjs/services/workbookRange.js +11 -2
  93. package/dist/cjs/services/workbookTable.js +1 -1
  94. package/dist/cjs/services/workbookTableColumn.js +1 -1
  95. package/dist/cjs/services/workbookWorksheet.js +1 -1
  96. package/dist/cjs/tasks/listDriveItems.d.ts.map +1 -1
  97. package/dist/cjs/tasks/listDriveItems.js +1 -5
  98. package/dist/esm/graphApi.d.ts +0 -2
  99. package/dist/esm/graphApi.d.ts.map +1 -1
  100. package/dist/esm/graphApi.js +5 -10
  101. package/dist/esm/models/AccessTokenGenerator.d.ts +3 -0
  102. package/dist/esm/models/AccessTokenGenerator.d.ts.map +1 -0
  103. package/dist/esm/models/Context.d.ts +2 -6
  104. package/dist/esm/models/Context.d.ts.map +1 -1
  105. package/dist/esm/models/ContextRef.d.ts +2 -2
  106. package/dist/esm/models/ContextRef.d.ts.map +1 -1
  107. package/dist/esm/models/GraphOperation.d.ts +2 -2
  108. package/dist/esm/models/GraphOperation.d.ts.map +1 -1
  109. package/dist/esm/models/SiteRef.d.ts +3 -2
  110. package/dist/esm/models/SiteRef.d.ts.map +1 -1
  111. package/dist/esm/operations/drive/createFolder.js +1 -1
  112. package/dist/esm/operations/drive/listDrives.js +1 -1
  113. package/dist/esm/operations/driveItem/createDriveItem.js +1 -1
  114. package/dist/esm/operations/driveItem/deleteDriveItem.js +1 -1
  115. package/dist/esm/operations/driveItem/existsDriveItem.d.ts.map +1 -1
  116. package/dist/esm/operations/driveItem/existsDriveItem.js +2 -5
  117. package/dist/esm/operations/driveItem/getDriveItem.js +1 -1
  118. package/dist/esm/operations/driveItem/getDriveItemByPath.js +1 -1
  119. package/dist/esm/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
  120. package/dist/esm/operations/driveItem/getDriveItemContent.js +2 -5
  121. package/dist/esm/operations/driveItem/initiateCopyDriveItem.js +1 -1
  122. package/dist/esm/operations/driveItem/listDriveItemChildren.js +1 -1
  123. package/dist/esm/operations/driveItem/moveDriveItem.js +1 -1
  124. package/dist/esm/operations/site/getSite.js +1 -1
  125. package/dist/esm/operations/site/getSiteByName.d.ts +1 -1
  126. package/dist/esm/operations/site/getSiteByName.js +2 -2
  127. package/dist/esm/operations/site/listSites.js +1 -1
  128. package/dist/esm/operations/site/searchSites.js +1 -1
  129. package/dist/esm/operations/user/userSendMail.d.ts +3 -3
  130. package/dist/esm/operations/user/userSendMail.d.ts.map +1 -1
  131. package/dist/esm/operations/user/userSendMail.js +3 -3
  132. package/dist/esm/operations/workbook/calculateWorkbook.js +1 -1
  133. package/dist/esm/operations/workbook/createWorkbook.js +1 -1
  134. package/dist/esm/operations/workbookRange/autoFitWorkbookRangeColumns.js +1 -1
  135. package/dist/esm/operations/workbookRange/clearWorkbookRange.js +1 -1
  136. package/dist/esm/operations/workbookRange/deleteWorkbookRange.js +1 -1
  137. package/dist/esm/operations/workbookRange/getWorkbookNamedRange.js +1 -1
  138. package/dist/esm/operations/workbookRange/getWorkbookRangeFill.js +1 -1
  139. package/dist/esm/operations/workbookRange/getWorkbookRangeFont.js +1 -1
  140. package/dist/esm/operations/workbookRange/getWorkbookRangeFormat.js +1 -1
  141. package/dist/esm/operations/workbookRange/getWorkbookUsedRange.js +1 -1
  142. package/dist/esm/operations/workbookRange/getWorkbookVisibleRange.js +1 -1
  143. package/dist/esm/operations/workbookRange/getWorkbookWorksheetRange.js +1 -1
  144. package/dist/esm/operations/workbookRange/insertWorkbookCells.js +1 -1
  145. package/dist/esm/operations/workbookRange/mergeWorkbookRange.js +1 -1
  146. package/dist/esm/operations/workbookRange/setWorkbookRangeFill.js +1 -1
  147. package/dist/esm/operations/workbookRange/setWorkbookRangeFont.js +1 -1
  148. package/dist/esm/operations/workbookRange/setWorkbookRangeFormat.js +1 -1
  149. package/dist/esm/operations/workbookRange/unmergeWorkbookRange.js +1 -1
  150. package/dist/esm/operations/workbookRange/updateWorkbookNamedRange.js +1 -1
  151. package/dist/esm/operations/workbookRange/updateWorkbookRange.js +1 -1
  152. package/dist/esm/operations/workbookSession/closeWorkbookSession.js +1 -1
  153. package/dist/esm/operations/workbookSession/createWorkbookSession.js +1 -1
  154. package/dist/esm/operations/workbookSession/refreshWorkbookSession.js +1 -1
  155. package/dist/esm/operations/workbookTable/applyWorkbookTableColumnFilter.js +1 -1
  156. package/dist/esm/operations/workbookTable/clearWorkbookTableFilters.js +1 -1
  157. package/dist/esm/operations/workbookTable/createWorkbookTable.js +1 -1
  158. package/dist/esm/operations/workbookTable/deleteWorkbookTable.js +1 -1
  159. package/dist/esm/operations/workbookTable/deleteWorkbookTablePreservingValues.js +1 -1
  160. package/dist/esm/operations/workbookTable/getWorkbookTable.js +1 -1
  161. package/dist/esm/operations/workbookTable/getWorkbookTableBodyRange.js +1 -1
  162. package/dist/esm/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts +1 -2
  163. package/dist/esm/operations/workbookTable/getWorkbookTableBodyVisibleRange.d.ts.map +1 -1
  164. package/dist/esm/operations/workbookTable/getWorkbookTableBodyVisibleRange.js +4 -7
  165. package/dist/esm/operations/workbookTable/getWorkbookTableHeaderRange.js +1 -1
  166. package/dist/esm/operations/workbookTable/listWorkbookTableColumns.js +1 -1
  167. package/dist/esm/operations/workbookTable/listWorkbookTableRows.js +1 -1
  168. package/dist/esm/operations/workbookTable/listWorkbookTables.js +1 -1
  169. package/dist/esm/operations/workbookWorksheet/createWorkbookWorksheet.js +1 -1
  170. package/dist/esm/operations/workbookWorksheet/deleteWorkbookWorksheet.js +1 -1
  171. package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRange.js +1 -1
  172. package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedRangeRef.js +1 -1
  173. package/dist/esm/operations/workbookWorksheet/getWorkbookWorksheetUsedVisibleRange.js +1 -1
  174. package/dist/esm/operations/workbookWorksheet/listWorkbookWorksheets.js +1 -1
  175. package/dist/esm/operations/workbookWorksheet/updateWorkbookWorksheet.js +1 -1
  176. package/dist/esm/services/context.d.ts +16 -17
  177. package/dist/esm/services/context.d.ts.map +1 -1
  178. package/dist/esm/services/context.js +35 -42
  179. package/dist/esm/services/drive.d.ts +7 -0
  180. package/dist/esm/services/drive.d.ts.map +1 -1
  181. package/dist/esm/services/drive.js +11 -3
  182. package/dist/esm/services/driveItem.js +1 -1
  183. package/dist/esm/services/site.js +1 -1
  184. package/dist/esm/services/templatedPaths.d.ts +1 -1
  185. package/dist/esm/services/templatedPaths.d.ts.map +1 -1
  186. package/dist/esm/services/templatedPaths.js +5 -2
  187. package/dist/esm/services/workbookRange.d.ts +1 -1
  188. package/dist/esm/services/workbookRange.d.ts.map +1 -1
  189. package/dist/esm/services/workbookRange.js +8 -2
  190. package/dist/esm/services/workbookTable.js +1 -1
  191. package/dist/esm/services/workbookTableColumn.js +1 -1
  192. package/dist/esm/services/workbookWorksheet.js +1 -1
  193. package/dist/esm/tasks/listDriveItems.d.ts.map +1 -1
  194. package/dist/esm/tasks/listDriveItems.js +1 -5
  195. package/package.json +26 -26
  196. package/dist/cjs/models/ContextId.d.ts +0 -4
  197. package/dist/cjs/models/ContextId.d.ts.map +0 -1
  198. package/dist/esm/models/ContextId.d.ts +0 -4
  199. package/dist/esm/models/ContextId.d.ts.map +0 -1
  200. /package/dist/cjs/models/{ContextId.js → AccessTokenGenerator.js} +0 -0
  201. /package/dist/esm/models/{ContextId.js → AccessTokenGenerator.js} +0 -0
@@ -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;AACzG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAQ/C,eAAO,MAAM,mBAAmB,EAA6C,KAAK,CAAC;AACnF,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"}
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"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.batchEndpoint = exports.endpoint = exports.authenticationScope = void 0;
6
+ exports.batchEndpoint = exports.endpoint = void 0;
7
7
  exports.operation = operation;
8
8
  exports.parallel = parallel;
9
9
  exports.sequential = sequential;
@@ -13,13 +13,10 @@ const InvalidArgumentError_ts_1 = __importDefault(require("./errors/InvalidArgum
13
13
  const NeverError_ts_1 = __importDefault(require("./errors/NeverError.js"));
14
14
  const ProtocolError_ts_1 = __importDefault(require("./errors/ProtocolError.js"));
15
15
  const RequestFailedError_ts_1 = __importDefault(require("./errors/RequestFailedError.js"));
16
- const accessToken_ts_1 = require("./services/accessToken.js");
17
- const context_ts_1 = require("./services/context.js");
18
16
  const http_ts_1 = require("./services/http.js");
19
17
  const httpStatus_ts_1 = require("./services/httpStatus.js");
20
18
  const operationId_ts_1 = require("./services/operationId.js");
21
19
  const sleep_ts_1 = require("./services/sleep.js");
22
- exports.authenticationScope = "https://graph.microsoft.com/.default";
23
20
  exports.endpoint = "https://graph.microsoft.com/v1.0";
24
21
  exports.batchEndpoint = `${exports.endpoint}/$batch`;
25
22
  /** 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. */
@@ -49,8 +46,7 @@ const maxRetries = 5;
49
46
  const defaultRetryDelayMilliseconds = 1000;
50
47
  const consecutiveRetryDelayMultiplier = 2;
51
48
  async function executeSingle(definition) {
52
- const context = (0, context_ts_1.getContext)(definition.contextId);
53
- const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, exports.authenticationScope);
49
+ const accessToken = await definition.context.generateAccessToken();
54
50
  const response = await innerFetch({
55
51
  url: `${exports.endpoint}${definition.path}`,
56
52
  method: definition.method,
@@ -71,12 +67,11 @@ async function executeBatch(...ops) {
71
67
  if (!firstOp) {
72
68
  throw new NeverError_ts_1.default("First op not found. Should be impossible");
73
69
  }
74
- const contextId = firstOp.contextId;
75
- if (ops.some((op) => op.contextId !== contextId)) {
76
- throw new InconsistentContextError_ts_1.default("All operations in a batch must share the same contextId.");
70
+ const context = firstOp.context;
71
+ if (ops.some((op) => op.context !== context)) {
72
+ throw new InconsistentContextError_ts_1.default("All operations in a batch must share the same context.");
77
73
  }
78
- const context = (0, context_ts_1.getContext)(contextId);
79
- const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, exports.authenticationScope);
74
+ const accessToken = await context.generateAccessToken();
80
75
  const body = await innerFetch({
81
76
  url: exports.batchEndpoint,
82
77
  method: "POST",
@@ -0,0 +1,3 @@
1
+ import type { AccessToken } from "./AccessToken.ts";
2
+ export type AccessTokenGenerator = () => Promise<AccessToken>;
3
+ //# sourceMappingURL=AccessTokenGenerator.d.ts.map
@@ -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 { ClientId } from "./ClientId.ts";
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
- tenantId: TenantId;
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,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;CAC3B,CAAC"}
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,5 +1,5 @@
1
- import type { ContextId } from "./ContextId.ts";
1
+ import type { Context } from "./Context.ts";
2
2
  export type ContextRef = {
3
- contextId: ContextId;
3
+ context: Context;
4
4
  };
5
5
  //# sourceMappingURL=ContextRef.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextRef.d.ts","sourceRoot":"","sources":["../../../src/models/ContextRef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,MAAM,UAAU,GAAG;IACxB,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC"}
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 { ContextId } from "./ContextId.ts";
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
- contextId: ContextId;
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,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,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,SAAS,EAAE,SAAS,CAAC;IACrB,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
+ {"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 { ContextRef } from "./ContextRef.ts";
1
+ import type { Context } from "./Context.ts";
2
2
  import type { SiteId } from "./SiteId.ts";
3
- export type SiteRef = ContextRef & {
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,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;CACf,CAAC"}
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"}
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function createFolder(parentRef, folderName) {
16
16
  const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: parentRef.contextId,
18
+ context: parentRef.context,
19
19
  method: "POST",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/${pathSegment}/children`, parentRef),
21
21
  headers: {
@@ -13,7 +13,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
13
13
  */
14
14
  function listDrives(siteRef) {
15
15
  return (0, graphApi_ts_1.operation)({
16
- contextId: siteRef.contextId,
16
+ context: siteRef.context,
17
17
  method: "GET",
18
18
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives", siteRef),
19
19
  headers: {},
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function createDriveItem(parentRef, itemPath, contextType, content) {
16
16
  const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: parentRef.contextId,
18
+ context: parentRef.context,
19
19
  method: "PUT",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/${pathSegment}:/${itemPath}:/content`, parentRef),
21
21
  headers: {
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
12
12
  */
13
13
  function deleteDriveItem(itemRef) {
14
14
  return (0, graphApi_ts_1.operation)({
15
- contextId: itemRef.contextId,
15
+ context: itemRef.context,
16
16
  method: "DELETE",
17
17
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}", itemRef),
18
18
  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;AAOzD;;;;;GAKG;AACH,wBAA8B,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,CAwB3G"}
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"}
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = existsDriveItem;
4
4
  const graphApi_ts_1 = require("../../graphApi.js");
5
- const accessToken_ts_1 = require("../../services/accessToken.js");
6
- const context_ts_1 = require("../../services/context.js");
7
5
  const http_ts_1 = require("../../services/http.js");
8
6
  const httpStatus_ts_1 = require("../../services/httpStatus.js");
9
7
  const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
@@ -16,8 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
16
14
  async function existsDriveItem(driveRef, itemPath) {
17
15
  // Note this method doesn't match the standard pattern since the batching library doesn't support non-JSON return types.
18
16
  const url = `${graphApi_ts_1.endpoint}${(0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/root:${itemPath}`, driveRef)}`;
19
- const context = (0, context_ts_1.getContext)(driveRef.contextId);
20
- const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, graphApi_ts_1.authenticationScope);
17
+ const accessToken = await driveRef.context.generateAccessToken();
21
18
  const response = await (0, http_ts_1.executeHttpRequest)({
22
19
  url,
23
20
  method: "GET",
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
12
12
  */
13
13
  function getDriveItem(itemRef) {
14
14
  return (0, graphApi_ts_1.operation)({
15
- contextId: itemRef.contextId,
15
+ context: itemRef.context,
16
16
  method: "GET",
17
17
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}", itemRef),
18
18
  headers: {},
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  */
15
15
  function getDriveItemByPath(driveRef, itemPath) {
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: driveRef.contextId,
17
+ context: driveRef.context,
18
18
  method: "GET",
19
19
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/root:${itemPath}`, driveRef),
20
20
  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;AAOjE;;;;;;;GAOG;AACH,wBAA8B,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CA8B7F"}
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"}
@@ -2,8 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = getDriveItemContent;
4
4
  const graphApi_ts_1 = require("../../graphApi.js");
5
- const accessToken_ts_1 = require("../../services/accessToken.js");
6
- const context_ts_1 = require("../../services/context.js");
7
5
  const http_ts_1 = require("../../services/http.js");
8
6
  const httpStatus_ts_1 = require("../../services/httpStatus.js");
9
7
  const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
@@ -18,8 +16,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
18
16
  async function getDriveItemContent(itemRef) {
19
17
  // 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.
20
18
  const url = `${graphApi_ts_1.endpoint}${(0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/content", itemRef)}`;
21
- const context = (0, context_ts_1.getContext)(itemRef.contextId);
22
- const accessToken = await (0, accessToken_ts_1.getCurrentAccessToken)(context.tenantId, context.clientId, context.clientSecret, graphApi_ts_1.authenticationScope);
19
+ const accessToken = await itemRef.context.generateAccessToken();
23
20
  const response = await (0, http_ts_1.executeHttpRequest)({
24
21
  url,
25
22
  method: "GET",
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  */
15
15
  function initiateCopyDriveItem(srcFileRef, dstFolderRef, dstFileName) {
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: srcFileRef.contextId,
17
+ context: srcFileRef.context,
18
18
  method: "POST",
19
19
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/copy", srcFileRef),
20
20
  headers: {
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function listDriveItemChildren(parentRef, take = 1000) {
16
16
  const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: parentRef.contextId,
18
+ context: parentRef.context,
19
19
  method: "GET",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/${pathSegment}/children?$top=${take}`, parentRef),
21
21
  headers: {},
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  */
15
15
  function moveDriveItem(srcFileRef, dstFolderRef, dstFileName) {
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: srcFileRef.contextId,
17
+ context: srcFileRef.context,
18
18
  method: "PATCH",
19
19
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}", srcFileRef),
20
20
  headers: {
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
12
12
  */
13
13
  function getSite(siteRef) {
14
14
  return (0, graphApi_ts_1.operation)({
15
- contextId: siteRef.contextId,
15
+ context: siteRef.context,
16
16
  method: "GET",
17
17
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}", siteRef),
18
18
  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 contextRef - A reference to the context.
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.
@@ -7,7 +7,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
7
7
  /**
8
8
  * Get a site by its name.
9
9
  *
10
- * @param contextRef - A reference to the context.
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.
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  */
16
16
  function getSiteByName(contextRef, hostName, siteName) {
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: contextRef.contextId,
18
+ context: contextRef.context,
19
19
  method: "GET",
20
20
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{host-name}:/sites/{site-name}", { hostName, siteName }),
21
21
  headers: {},
@@ -13,7 +13,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
13
13
  */
14
14
  function listSites(contextRef) {
15
15
  return (0, graphApi_ts_1.operation)({
16
- contextId: contextRef.contextId,
16
+ context: contextRef.context,
17
17
  method: "GET",
18
18
  path: (0, templatedPaths_ts_1.generatePath)("/sites", {}),
19
19
  headers: {},
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  */
15
15
  function searchSites(contextRef, search) {
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: contextRef.contextId,
17
+ context: contextRef.context,
18
18
  method: "GET",
19
19
  path: (0, templatedPaths_ts_1.generatePath)("/sites?search={search}", { search }),
20
20
  headers: {},
@@ -1,15 +1,15 @@
1
1
  import type { Message } from "@microsoft/microsoft-graph-types";
2
- import type { ContextRef } from "../../models/ContextRef.ts";
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 contextRef - A reference to the context.
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(contextRef: ContextRef, sender: string | null, message: Message): GraphOperation<void>;
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,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAa,MAAM,gCAAgC,CAAC;AAMhF;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,cAAc,CAAC,IAAI,CAAC,CAmB1H"}
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"}
@@ -11,20 +11,20 @@ const emailPattern = /^[a-zA-Z0-9._\-@]+$/; // Basic, but intended just to avoid
11
11
  /**
12
12
  * Send an email.
13
13
  *
14
- * @param contextRef - A reference to the context.
14
+ * @param context - A reference to the context.
15
15
  * @param sender - The email address of the sender or NULL for the current user. Must match a valid email address in this tenant.
16
16
  * @param message - The email message to be sent.
17
17
  * @returns Nothing.
18
18
  * @throws InvalidArgumentError if the sender email address does not match the required pattern.
19
19
  * @see https://learn.microsoft.com/en-us/graph/api/user-sendmail
20
20
  */
21
- function userSendMail(contextRef, sender, message) {
21
+ function userSendMail(context, sender, message) {
22
22
  if (sender && !emailPattern.test(sender)) {
23
23
  throw new InvalidArgumentError_ts_1.default(`Invalid email address. Must match pattern '${emailPattern}'`);
24
24
  }
25
25
  const path = sender ? `/users/${sender}/sendMail` : "/me/sendMail";
26
26
  return (0, graphApi_ts_1.operation)({
27
- contextId: contextRef.contextId,
27
+ context,
28
28
  method: "POST",
29
29
  path: path,
30
30
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  */
15
15
  function calculateWorkbook(workbookRef, calculationType = "Recalculate") {
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: workbookRef.contextId,
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/application/calculate", workbookRef),
20
20
  headers: {
@@ -23,7 +23,7 @@ function createWorkbook(parentRef, itemPath) {
23
23
  }
24
24
  const pathSegment = parentRef.itemId ? "items/{item-id}" : "root";
25
25
  return (0, graphApi_ts_1.operation)({
26
- contextId: parentRef.contextId,
26
+ context: parentRef.context,
27
27
  method: "PUT",
28
28
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/${pathSegment}:/${itemPath}:/content`, parentRef),
29
29
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  function autoFitWorkbookRangeColumns(rangeRef) {
15
15
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: rangeRef.contextId,
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}/range(address='${address}')/format/autofitcolumns`, rangeRef),
20
20
  headers: {
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function clearWorkbookRange(rangeRef, applyTo = "All") {
16
16
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: rangeRef.contextId,
18
+ context: rangeRef.context,
19
19
  method: "POST",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/clear`, rangeRef),
21
21
  headers: {
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function deleteWorkbookRange(rangeRef, shift) {
16
16
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: rangeRef.contextId,
18
+ context: rangeRef.context,
19
19
  method: "POST",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/delete`, rangeRef),
21
21
  headers: {
@@ -12,7 +12,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
12
12
  */
13
13
  function getWorkbookNamedRange(rangeRef) {
14
14
  return (0, graphApi_ts_1.operation)({
15
- contextId: rangeRef.contextId,
15
+ context: rangeRef.context,
16
16
  method: "GET",
17
17
  path: (0, templatedPaths_ts_1.generatePath)("/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/names/{range-name}/range", rangeRef),
18
18
  headers: {
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function getWorkbookRangeFill(rangeRef) {
16
16
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: rangeRef.contextId,
18
+ context: rangeRef.context,
19
19
  method: "GET",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/fill`, rangeRef),
21
21
  headers: {
@@ -15,7 +15,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
15
15
  function getWorkbookRangeFont(rangeRef) {
16
16
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: rangeRef.contextId,
18
+ context: rangeRef.context,
19
19
  method: "GET",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/font`, rangeRef),
21
21
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  function getWorkbookRangeFormat(rangeRef) {
15
15
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: rangeRef.contextId,
17
+ context: rangeRef.context,
18
18
  method: "GET",
19
19
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format`, rangeRef),
20
20
  headers: {
@@ -13,7 +13,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
13
13
  */
14
14
  function getWorkbookUsedRange(worksheetRef) {
15
15
  return (0, graphApi_ts_1.operation)({
16
- contextId: worksheetRef.contextId,
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", worksheetRef),
19
19
  headers: {
@@ -15,7 +15,7 @@ function getWorkbookVisibleRange(rangeRef) {
15
15
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
16
16
  // TODO: Should be a visible ref type?
17
17
  return (0, graphApi_ts_1.operation)({
18
- contextId: rangeRef.contextId,
18
+ context: rangeRef.context,
19
19
  method: "GET",
20
20
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/visibleView`, rangeRef),
21
21
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  function getWorkbookWorksheetRange(rangeRef) {
15
15
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: rangeRef.contextId,
17
+ context: rangeRef.context,
18
18
  method: "GET",
19
19
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')`, rangeRef),
20
20
  headers: {
@@ -20,7 +20,7 @@ const workbookRange_ts_1 = require("../../services/workbookRange.js");
20
20
  */
21
21
  function insertWorkbookCells(worksheetRef, address, shift) {
22
22
  return (0, graphApi_ts_1.operation)({
23
- contextId: worksheetRef.contextId,
23
+ context: worksheetRef.context,
24
24
  method: "POST",
25
25
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${(0, addressManipulation_ts_1.normalizeAddress)(address)}')/insert`, worksheetRef),
26
26
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  */
15
15
  function mergeWorkbookRange(rangeRef, across = false) {
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: rangeRef.contextId,
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}/range(address='${(0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address)}')/merge`, rangeRef),
20
20
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  function setWorkbookRangeFill(rangeRef, format) {
15
15
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: rangeRef.contextId,
17
+ context: rangeRef.context,
18
18
  method: "PATCH",
19
19
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/fill`, rangeRef),
20
20
  headers: {
@@ -14,7 +14,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
14
14
  function setWorkbookRangeFont(rangeRef, format) {
15
15
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
16
16
  return (0, graphApi_ts_1.operation)({
17
- contextId: rangeRef.contextId,
17
+ context: rangeRef.context,
18
18
  method: "PATCH",
19
19
  path: (0, templatedPaths_ts_1.generatePath)(`/sites/{site-id}/drives/{drive-id}/items/{item-id}/workbook/worksheets/{worksheet-id}/range(address='${address}')/format/font`, rangeRef),
20
20
  headers: {
@@ -16,7 +16,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
16
16
  function setWorkbookRangeFormat(rangeRef, format) {
17
17
  const address = (0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address, true);
18
18
  return (0, graphApi_ts_1.operation)({
19
- contextId: rangeRef.contextId,
19
+ context: rangeRef.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}/range(address='${address}')/format`, rangeRef),
22
22
  headers: {
@@ -13,7 +13,7 @@ const templatedPaths_ts_1 = require("../../services/templatedPaths.js");
13
13
  */
14
14
  function unmergeWorkbookRange(rangeRef) {
15
15
  return (0, graphApi_ts_1.operation)({
16
- contextId: rangeRef.contextId,
16
+ context: rangeRef.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}/range(address='${(0, addressManipulation_ts_1.normalizeAddress)(rangeRef.address)}')/unmerge`, rangeRef),
19
19
  headers: {