microsoft-graph 2.3.0 → 2.3.1

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 (213) hide show
  1. package/.vscode/settings.json +2 -1
  2. package/dist/operations/drive/createFolder.d.ts +8 -1
  3. package/dist/operations/drive/createFolder.d.ts.map +1 -1
  4. package/dist/operations/drive/createFolder.js +8 -1
  5. package/dist/operations/drive/listDrives.d.ts +7 -1
  6. package/dist/operations/drive/listDrives.d.ts.map +1 -1
  7. package/dist/operations/drive/listDrives.js +7 -1
  8. package/dist/operations/driveItem/deleteDriveItem.d.ts +7 -1
  9. package/dist/operations/driveItem/deleteDriveItem.d.ts.map +1 -1
  10. package/dist/operations/driveItem/deleteDriveItem.js +7 -1
  11. package/dist/operations/driveItem/getDriveItem.d.ts +7 -1
  12. package/dist/operations/driveItem/getDriveItem.d.ts.map +1 -1
  13. package/dist/operations/driveItem/getDriveItem.js +7 -1
  14. package/dist/operations/driveItem/getDriveItemByPath.d.ts +8 -1
  15. package/dist/operations/driveItem/getDriveItemByPath.d.ts.map +1 -1
  16. package/dist/operations/driveItem/getDriveItemByPath.js +8 -1
  17. package/dist/operations/driveItem/getDriveItemContent.d.ts +8 -1
  18. package/dist/operations/driveItem/getDriveItemContent.d.ts.map +1 -1
  19. package/dist/operations/driveItem/getDriveItemContent.js +8 -1
  20. package/dist/operations/driveItem/initiateCopyDriveItem.d.ts +9 -1
  21. package/dist/operations/driveItem/initiateCopyDriveItem.d.ts.map +1 -1
  22. package/dist/operations/driveItem/initiateCopyDriveItem.js +9 -1
  23. package/dist/operations/driveItem/listDriveItems.d.ts +8 -2
  24. package/dist/operations/driveItem/listDriveItems.d.ts.map +1 -1
  25. package/dist/operations/driveItem/listDriveItems.js +8 -3
  26. package/dist/operations/site/getSite.d.ts +7 -1
  27. package/dist/operations/site/getSite.d.ts.map +1 -1
  28. package/dist/operations/site/getSite.js +7 -1
  29. package/dist/operations/site/getSiteByName.d.ts +9 -1
  30. package/dist/operations/site/getSiteByName.d.ts.map +1 -1
  31. package/dist/operations/site/getSiteByName.js +9 -1
  32. package/dist/operations/site/listSites.d.ts +7 -1
  33. package/dist/operations/site/listSites.d.ts.map +1 -1
  34. package/dist/operations/site/listSites.js +7 -1
  35. package/dist/operations/site/searchSites.d.ts +8 -1
  36. package/dist/operations/site/searchSites.d.ts.map +1 -1
  37. package/dist/operations/site/searchSites.js +8 -1
  38. package/dist/operations/user/userSendMail.d.ts +10 -1
  39. package/dist/operations/user/userSendMail.d.ts.map +1 -1
  40. package/dist/operations/user/userSendMail.js +10 -1
  41. package/dist/operations/workbook/calculateWorkbook.d.ts +14 -2
  42. package/dist/operations/workbook/calculateWorkbook.d.ts.map +1 -1
  43. package/dist/operations/workbook/calculateWorkbook.js +14 -2
  44. package/dist/operations/workbook/createWorkbook.d.ts +9 -1
  45. package/dist/operations/workbook/createWorkbook.d.ts.map +1 -1
  46. package/dist/operations/workbook/createWorkbook.js +9 -1
  47. package/dist/operations/workbook/deleteWorkbook.d.ts +7 -1
  48. package/dist/operations/workbook/deleteWorkbook.d.ts.map +1 -1
  49. package/dist/operations/workbook/deleteWorkbook.js +7 -1
  50. package/dist/operations/workbookRange/clearWorkbookRange.d.ts +8 -1
  51. package/dist/operations/workbookRange/clearWorkbookRange.d.ts.map +1 -1
  52. package/dist/operations/workbookRange/clearWorkbookRange.js +8 -1
  53. package/dist/operations/workbookRange/deleteWorkbookRange.d.ts +8 -1
  54. package/dist/operations/workbookRange/deleteWorkbookRange.d.ts.map +1 -1
  55. package/dist/operations/workbookRange/deleteWorkbookRange.js +8 -1
  56. package/dist/operations/workbookRange/getWorkbookNamedRange.d.ts +7 -1
  57. package/dist/operations/workbookRange/getWorkbookNamedRange.d.ts.map +1 -1
  58. package/dist/operations/workbookRange/getWorkbookNamedRange.js +7 -1
  59. package/dist/operations/workbookRange/getWorkbookRangeFormat.d.ts +7 -1
  60. package/dist/operations/workbookRange/getWorkbookRangeFormat.d.ts.map +1 -1
  61. package/dist/operations/workbookRange/getWorkbookRangeFormat.js +7 -1
  62. package/dist/operations/workbookRange/getWorkbookUsedRange.d.ts +7 -1
  63. package/dist/operations/workbookRange/getWorkbookUsedRange.d.ts.map +1 -1
  64. package/dist/operations/workbookRange/getWorkbookUsedRange.js +7 -1
  65. package/dist/operations/workbookRange/getWorkbookVisibleRange.d.ts +7 -1
  66. package/dist/operations/workbookRange/getWorkbookVisibleRange.d.ts.map +1 -1
  67. package/dist/operations/workbookRange/getWorkbookVisibleRange.js +7 -1
  68. package/dist/operations/workbookRange/getWorkbookWorksheetRange.d.ts +7 -1
  69. package/dist/operations/workbookRange/getWorkbookWorksheetRange.d.ts.map +1 -1
  70. package/dist/operations/workbookRange/getWorkbookWorksheetRange.js +7 -1
  71. package/dist/operations/workbookRange/insertWorkbookCells.d.ts +9 -1
  72. package/dist/operations/workbookRange/insertWorkbookCells.d.ts.map +1 -1
  73. package/dist/operations/workbookRange/insertWorkbookCells.js +9 -1
  74. package/dist/operations/workbookRange/updateWorkbookNamedRange.d.ts +8 -1
  75. package/dist/operations/workbookRange/updateWorkbookNamedRange.d.ts.map +1 -1
  76. package/dist/operations/workbookRange/updateWorkbookNamedRange.js +8 -1
  77. package/dist/operations/workbookRange/updateWorkbookRange.d.ts +8 -1
  78. package/dist/operations/workbookRange/updateWorkbookRange.d.ts.map +1 -1
  79. package/dist/operations/workbookRange/updateWorkbookRange.js +8 -1
  80. package/dist/operations/workbookSession/closeWorkbookSession.d.ts +8 -1
  81. package/dist/operations/workbookSession/closeWorkbookSession.d.ts.map +1 -1
  82. package/dist/operations/workbookSession/closeWorkbookSession.js +8 -1
  83. package/dist/operations/workbookSession/createWorkbookSession.d.ts +9 -1
  84. package/dist/operations/workbookSession/createWorkbookSession.d.ts.map +1 -1
  85. package/dist/operations/workbookSession/createWorkbookSession.js +9 -1
  86. package/dist/operations/workbookSession/refreshWorkbookSession.d.ts +8 -1
  87. package/dist/operations/workbookSession/refreshWorkbookSession.d.ts.map +1 -1
  88. package/dist/operations/workbookSession/refreshWorkbookSession.js +8 -1
  89. package/dist/operations/workbookTable/createWorkbookTable.d.ts +8 -1
  90. package/dist/operations/workbookTable/createWorkbookTable.d.ts.map +1 -1
  91. package/dist/operations/workbookTable/createWorkbookTable.js +8 -1
  92. package/dist/operations/workbookTable/getWorkbookTable.d.ts +7 -1
  93. package/dist/operations/workbookTable/getWorkbookTable.d.ts.map +1 -1
  94. package/dist/operations/workbookTable/getWorkbookTable.js +7 -1
  95. package/dist/operations/workbookTable/getWorkbookTableBodyRange.d.ts +7 -1
  96. package/dist/operations/workbookTable/getWorkbookTableBodyRange.d.ts.map +1 -1
  97. package/dist/operations/workbookTable/getWorkbookTableBodyRange.js +7 -1
  98. package/dist/operations/workbookTable/getWorkbookTableHeaderRange.d.ts +7 -1
  99. package/dist/operations/workbookTable/getWorkbookTableHeaderRange.d.ts.map +1 -1
  100. package/dist/operations/workbookTable/getWorkbookTableHeaderRange.js +7 -1
  101. package/dist/operations/workbookTable/listWorkbookTableColumns.d.ts +7 -1
  102. package/dist/operations/workbookTable/listWorkbookTableColumns.d.ts.map +1 -1
  103. package/dist/operations/workbookTable/listWorkbookTableColumns.js +7 -1
  104. package/dist/operations/workbookTable/listWorkbookTableRows.d.ts +7 -1
  105. package/dist/operations/workbookTable/listWorkbookTableRows.d.ts.map +1 -1
  106. package/dist/operations/workbookTable/listWorkbookTableRows.js +7 -1
  107. package/dist/operations/workbookTable/listWorkbookTables.d.ts +7 -1
  108. package/dist/operations/workbookTable/listWorkbookTables.d.ts.map +1 -1
  109. package/dist/operations/workbookTable/listWorkbookTables.js +7 -1
  110. package/dist/operations/workbookWorksheet/createWorkbookWorksheet.d.ts +8 -1
  111. package/dist/operations/workbookWorksheet/createWorkbookWorksheet.d.ts.map +1 -1
  112. package/dist/operations/workbookWorksheet/createWorkbookWorksheet.js +8 -1
  113. package/dist/operations/workbookWorksheet/deleteWorkbookWorksheet.d.ts +7 -1
  114. package/dist/operations/workbookWorksheet/deleteWorkbookWorksheet.d.ts.map +1 -1
  115. package/dist/operations/workbookWorksheet/deleteWorkbookWorksheet.js +7 -1
  116. package/dist/operations/workbookWorksheet/listWorkbookWorksheets.d.ts +7 -1
  117. package/dist/operations/workbookWorksheet/listWorkbookWorksheets.d.ts.map +1 -1
  118. package/dist/operations/workbookWorksheet/listWorkbookWorksheets.js +7 -1
  119. package/dist/operations/workbookWorksheet/updateWorkbookWorksheet.d.ts +11 -1
  120. package/dist/operations/workbookWorksheet/updateWorkbookWorksheet.d.ts.map +1 -1
  121. package/dist/operations/workbookWorksheet/updateWorkbookWorksheet.js +11 -1
  122. package/dist/services/accessToken.d.ts +9 -1
  123. package/dist/services/accessToken.d.ts.map +1 -1
  124. package/dist/services/accessToken.js +9 -1
  125. package/dist/services/addressManipulation.d.ts +67 -0
  126. package/dist/services/addressManipulation.d.ts.map +1 -1
  127. package/dist/services/addressManipulation.js +67 -0
  128. package/dist/services/addressOffset.d.ts +20 -0
  129. package/dist/services/addressOffset.d.ts.map +1 -1
  130. package/dist/services/addressOffset.js +20 -0
  131. package/dist/services/context.d.ts +19 -2
  132. package/dist/services/context.d.ts.map +1 -1
  133. package/dist/services/context.js +19 -2
  134. package/dist/services/drive.d.ts +12 -1
  135. package/dist/services/drive.d.ts.map +1 -1
  136. package/dist/services/drive.js +12 -1
  137. package/dist/services/driveItem.d.ts +13 -1
  138. package/dist/services/driveItem.d.ts.map +1 -1
  139. package/dist/services/driveItem.js +13 -1
  140. package/dist/services/environmentVariable.d.ts +13 -0
  141. package/dist/services/environmentVariable.d.ts.map +1 -1
  142. package/dist/services/environmentVariable.js +13 -0
  143. package/dist/services/httpAgent.d.ts +5 -0
  144. package/dist/services/httpAgent.d.ts.map +1 -1
  145. package/dist/services/httpAgent.js +5 -0
  146. package/dist/services/httpStatus.d.ts +15 -0
  147. package/dist/services/httpStatus.d.ts.map +1 -1
  148. package/dist/services/httpStatus.js +15 -0
  149. package/dist/services/operationId.d.ts +10 -0
  150. package/dist/services/operationId.d.ts.map +1 -1
  151. package/dist/services/operationId.js +10 -0
  152. package/dist/services/random.d.ts +5 -0
  153. package/dist/services/random.d.ts.map +1 -1
  154. package/dist/services/random.js +5 -0
  155. package/dist/services/sharepointUrl.d.ts +6 -1
  156. package/dist/services/sharepointUrl.d.ts.map +1 -1
  157. package/dist/services/sharepointUrl.js +6 -1
  158. package/dist/services/site.d.ts +12 -1
  159. package/dist/services/site.d.ts.map +1 -1
  160. package/dist/services/site.js +12 -1
  161. package/dist/services/sleep.d.ts +5 -0
  162. package/dist/services/sleep.d.ts.map +1 -1
  163. package/dist/services/sleep.js +5 -0
  164. package/dist/services/stringCaseConversion.d.ts +5 -0
  165. package/dist/services/stringCaseConversion.d.ts.map +1 -1
  166. package/dist/services/stringCaseConversion.js +5 -0
  167. package/dist/services/templatedPaths.d.ts +7 -1
  168. package/dist/services/templatedPaths.d.ts.map +1 -1
  169. package/dist/services/templatedPaths.js +7 -1
  170. package/dist/services/temporaryFiles.d.ts +5 -0
  171. package/dist/services/temporaryFiles.d.ts.map +1 -1
  172. package/dist/services/temporaryFiles.js +5 -0
  173. package/dist/services/workbookRange.d.ts +6 -0
  174. package/dist/services/workbookRange.d.ts.map +1 -1
  175. package/dist/services/workbookRange.js +6 -0
  176. package/dist/services/workbookTable.d.ts +7 -0
  177. package/dist/services/workbookTable.d.ts.map +1 -1
  178. package/dist/services/workbookTable.js +7 -0
  179. package/dist/services/workbookWorksheet.d.ts +12 -0
  180. package/dist/services/workbookWorksheet.d.ts.map +1 -1
  181. package/dist/services/workbookWorksheet.js +12 -0
  182. package/dist/tasks/createWorkbookAndStartSession.d.ts +7 -1
  183. package/dist/tasks/createWorkbookAndStartSession.d.ts.map +1 -1
  184. package/dist/tasks/createWorkbookAndStartSession.js +7 -1
  185. package/dist/tasks/deleteDriveItemWithRetry.d.ts +6 -1
  186. package/dist/tasks/deleteDriveItemWithRetry.d.ts.map +1 -1
  187. package/dist/tasks/deleteDriveItemWithRetry.js +6 -1
  188. package/dist/tasks/downloadDriveItemContent.d.ts +7 -1
  189. package/dist/tasks/downloadDriveItemContent.d.ts.map +1 -1
  190. package/dist/tasks/downloadDriveItemContent.js +7 -1
  191. package/dist/tasks/getRangeLastUsedCell.d.ts +7 -1
  192. package/dist/tasks/getRangeLastUsedCell.d.ts.map +1 -1
  193. package/dist/tasks/getRangeLastUsedCell.js +7 -1
  194. package/dist/tasks/getWorkbookTableVisibleBody.d.ts +6 -1
  195. package/dist/tasks/getWorkbookTableVisibleBody.d.ts.map +1 -1
  196. package/dist/tasks/getWorkbookTableVisibleBody.js +6 -1
  197. package/dist/tasks/getWorkbookWorksheetByName.d.ts +8 -1
  198. package/dist/tasks/getWorkbookWorksheetByName.d.ts.map +1 -1
  199. package/dist/tasks/getWorkbookWorksheetByName.js +8 -1
  200. package/dist/tasks/safeDeleteWorkbook.d.ts +7 -1
  201. package/dist/tasks/safeDeleteWorkbook.d.ts.map +1 -1
  202. package/dist/tasks/safeDeleteWorkbook.js +7 -1
  203. package/dist/tasks/setColumnHidden.d.ts +7 -1
  204. package/dist/tasks/setColumnHidden.d.ts.map +1 -1
  205. package/dist/tasks/setColumnHidden.js +7 -1
  206. package/dist/tasks/setRowHidden.d.ts +7 -1
  207. package/dist/tasks/setRowHidden.d.ts.map +1 -1
  208. package/dist/tasks/setRowHidden.js +7 -1
  209. package/dist/tasks/setWorkbookTableBodyVisibleRows.d.ts +9 -1
  210. package/dist/tasks/setWorkbookTableBodyVisibleRows.d.ts.map +1 -1
  211. package/dist/tasks/setWorkbookTableBodyVisibleRows.js +23 -16
  212. package/dist/tasks/setWorkbookTableBodyVisibleRows.test.js +2 -0
  213. package/package.json +1 -1
@@ -6,6 +6,12 @@ const lastColumn = "XFD";
6
6
  const firstRow = "1";
7
7
  const lastRow = "1048576";
8
8
  const addressPattern = /^(?<sheet>[A-Za-z0-9_]+!)?(?:(?<startColumn>[A-Z]+)?(?<startRow>\d+)?(?::(?<endColumn>[A-Z]+)?(?<endRow>\d+)?)?)$/;
9
+ /**
10
+ * Decomposes an address into its components (start and end columns/rows).
11
+ * @param address - The address to decompose.
12
+ * @returns The decomposed address components.
13
+ * @throws InvalidArgumentError if the address format is invalid.
14
+ */
9
15
  export function decomposeAddress(address) {
10
16
  const match = address.match(addressPattern);
11
17
  if (!match?.groups) {
@@ -19,6 +25,12 @@ export function decomposeAddress(address) {
19
25
  endRow: groups.endRow ?? groups.startRow ?? lastRow,
20
26
  };
21
27
  }
28
+ /**
29
+ * Composes an address from its components.
30
+ * @param components - The address components.
31
+ * @returns The composed address.
32
+ * @throws InvalidArgumentError if the components are invalid.
33
+ */
22
34
  export function composeAddress(components) {
23
35
  if (isSingleColumn(components) && isMaxRows(components)) {
24
36
  return composeColumnAddress(components.startColumn);
@@ -43,14 +55,29 @@ export function composeAddress(components) {
43
55
  }
44
56
  return composeCellRangeAddress(components.startColumn, components.startRow, components.endColumn, components.endRow);
45
57
  }
58
+ /**
59
+ * Gets the first cell address from a given address.
60
+ * @param address - The address to analyze.
61
+ * @returns The first cell address.
62
+ */
46
63
  export function getFirstCellAddress(address) {
47
64
  const components = decomposeAddress(address);
48
65
  return composeCellAddress(components.startColumn, components.startRow);
49
66
  }
67
+ /**
68
+ * Gets the last cell address from a given address.
69
+ * @param address - The address to analyze.
70
+ * @returns The last cell address.
71
+ */
50
72
  export function getLastCellAddress(address) {
51
73
  const components = decomposeAddress(address);
52
74
  return composeCellAddress(components.endColumn, components.endRow);
53
75
  }
76
+ /**
77
+ * Gets the first row address from a given address.
78
+ * @param address - The address to analyze.
79
+ * @returns The first row address.
80
+ */
54
81
  export function getFirstRowAddress(address) {
55
82
  const components = decomposeAddress(address);
56
83
  return composeAddress({
@@ -60,6 +87,11 @@ export function getFirstRowAddress(address) {
60
87
  endRow: components.startRow,
61
88
  });
62
89
  }
90
+ /**
91
+ * Gets the last row address from a given address.
92
+ * @param address - The address to analyze.
93
+ * @returns The last row address.
94
+ */
63
95
  export function getLastRowAddress(address) {
64
96
  const components = decomposeAddress(address);
65
97
  return composeAddress({
@@ -69,6 +101,11 @@ export function getLastRowAddress(address) {
69
101
  endRow: components.endRow,
70
102
  });
71
103
  }
104
+ /**
105
+ * Gets the first column address from a given address.
106
+ * @param address - The address to analyze.
107
+ * @returns The first column address.
108
+ */
72
109
  export function getFirstColumnAddress(address) {
73
110
  const components = decomposeAddress(address);
74
111
  return composeAddress({
@@ -78,6 +115,11 @@ export function getFirstColumnAddress(address) {
78
115
  endRow: components.endRow,
79
116
  });
80
117
  }
118
+ /**
119
+ * Gets the last column address from a given address.
120
+ * @param address - The address to analyze.
121
+ * @returns The last column address.
122
+ */
81
123
  export function getLastColumnAddress(address) {
82
124
  const components = decomposeAddress(address);
83
125
  return composeAddress({
@@ -87,6 +129,15 @@ export function getLastColumnAddress(address) {
87
129
  endRow: components.endRow,
88
130
  });
89
131
  }
132
+ /**
133
+ * Offsets an address by the specified column and row offsets.
134
+ * @param address - The address to offset.
135
+ * @param columnOffset - The column offset.
136
+ * @param rowOffset - The row offset.
137
+ * @returns The offset address.
138
+ * @throws UnsupportedAddressTypeError if the address cannot be offset.
139
+ * @throws InvalidArgumentError if the offset is out of bounds.
140
+ */
90
141
  export function offsetAddress(address, columnOffset, rowOffset) {
91
142
  const components = decomposeAddress(address);
92
143
  if (isMaxRows(components) && rowOffset !== 0) {
@@ -116,12 +167,28 @@ export function offsetAddress(address, columnOffset, rowOffset) {
116
167
  endRow: newEndRow,
117
168
  });
118
169
  }
170
+ /**
171
+ * Increments the row address by one.
172
+ * @param address - The address to increment.
173
+ * @returns The incremented address.
174
+ */
119
175
  export function incrementRowAddress(address) {
120
176
  return offsetAddress(address, 0, +1);
121
177
  }
178
+ /**
179
+ * Decrements the row address by one.
180
+ * @param address - The address to decrement.
181
+ * @returns The decremented address.
182
+ */
122
183
  export function decrementRowAddress(address) {
123
184
  return offsetAddress(address, 0, -1);
124
185
  }
186
+ /**
187
+ * Checks if two addresses overlap.
188
+ * @param address1 - The first address.
189
+ * @param address2 - The second address.
190
+ * @returns True if the addresses overlap, otherwise false.
191
+ */
125
192
  export function isAddressOverlapping(address1, address2) {
126
193
  const components1 = decomposeAddress(address1);
127
194
  const components2 = decomposeAddress(address2);
@@ -1,8 +1,28 @@
1
1
  import type { ColumnAddress, RowAddress } from "../models/Address.ts";
2
2
  import type { ColumnOffset } from "../models/ColumnOffset.ts";
3
3
  import type { RowOffset } from "../models/RowOffset.ts";
4
+ /**
5
+ * Converts a column address (e.g., "A") to a zero-based column offset.
6
+ * @param column - The column address.
7
+ * @returns The zero-based column offset.
8
+ */
4
9
  export declare function columnAddressToOffset(column: ColumnAddress): ColumnOffset;
10
+ /**
11
+ * Converts a zero-based column offset to a column address (e.g., "A").
12
+ * @param offset - The zero-based column offset.
13
+ * @returns The column address.
14
+ */
5
15
  export declare function offsetToColumnAddress(offset: ColumnOffset): ColumnAddress;
16
+ /**
17
+ * Converts a row address (e.g., "1") to a zero-based row offset.
18
+ * @param row - The row address.
19
+ * @returns The zero-based row offset.
20
+ */
6
21
  export declare function rowAddressToOffset(row: RowAddress): RowOffset;
22
+ /**
23
+ * Converts a zero-based row offset to a row address (e.g., "1").
24
+ * @param offset - The zero-based row offset.
25
+ * @returns The row address.
26
+ */
7
27
  export declare function offsetToRowAddress(offset: RowOffset): RowAddress;
8
28
  //# sourceMappingURL=addressOffset.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addressOffset.d.ts","sourceRoot":"","sources":["../../src/services/addressOffset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAMzE;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CASzE;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAE7D;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE"}
1
+ {"version":3,"file":"addressOffset.d.ts","sourceRoot":"","sources":["../../src/services/addressOffset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,YAAY,CAMzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,YAAY,GAAG,aAAa,CASzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,UAAU,GAAG,SAAS,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,CAEhE"}
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Converts a column address (e.g., "A") to a zero-based column offset.
3
+ * @param column - The column address.
4
+ * @returns The zero-based column offset.
5
+ */
1
6
  export function columnAddressToOffset(column) {
2
7
  let offset = 0;
3
8
  for (let i = 0; i < column.length; i++) {
@@ -5,6 +10,11 @@ export function columnAddressToOffset(column) {
5
10
  }
6
11
  return (offset - 1);
7
12
  }
13
+ /**
14
+ * Converts a zero-based column offset to a column address (e.g., "A").
15
+ * @param offset - The zero-based column offset.
16
+ * @returns The column address.
17
+ */
8
18
  export function offsetToColumnAddress(offset) {
9
19
  let result = "";
10
20
  let currentOffset = offset + 1;
@@ -15,9 +25,19 @@ export function offsetToColumnAddress(offset) {
15
25
  }
16
26
  return result;
17
27
  }
28
+ /**
29
+ * Converts a row address (e.g., "1") to a zero-based row offset.
30
+ * @param row - The row address.
31
+ * @returns The zero-based row offset.
32
+ */
18
33
  export function rowAddressToOffset(row) {
19
34
  return (Number.parseInt(row, 10) - 1);
20
35
  }
36
+ /**
37
+ * Converts a zero-based row offset to a row address (e.g., "1").
38
+ * @param offset - The zero-based row offset.
39
+ * @returns The row address.
40
+ */
21
41
  export function offsetToRowAddress(offset) {
22
42
  return (offset + 1).toString();
23
43
  }
@@ -5,9 +5,26 @@ import type { ContextId } from "../models/ContextId.ts";
5
5
  import type { ContextRef } from "../models/ContextRef.ts";
6
6
  import type { HttpProxy } from "../models/HttpProxy.ts";
7
7
  import type { TenantId } from "../models/TenantId.ts";
8
- /** Register a tenant/client so that it's secret can be used latter. */
8
+ /**
9
+ * Registers a tenant+client so that its secret can be used later.
10
+ * @param tenantId - The tenant ID.
11
+ * @param clientId - The client ID.
12
+ * @param clientSecret - The client secret.
13
+ * @param httpProxy - Optional HTTP proxy configuration.
14
+ * @returns A reference to the registered context.
15
+ */
9
16
  export declare function register(tenantId: TenantId, clientId: ClientId, clientSecret: ClientSecret, httpProxy?: HttpProxy | undefined): ContextRef;
17
+ /**
18
+ * Retrieves the context for a given context ID.
19
+ * @param contextId - The ID of the context.
20
+ * @returns The context associated with the given ID.
21
+ * @throws ContextNotRegisteredError if the context ID is not registered.
22
+ */
10
23
  export declare function getContext(contextId: ContextId): Context;
11
- /** Opinionated method of getting default context reference. Not recommended for production use. */
24
+ /**
25
+ * Retrieves the opinionated default context reference. NOT RECOMMENDED FOR PRODUCTION USE.
26
+ * @returns A reference to the default context.
27
+ * @remarks This method is opinionated and not recommended for production use.
28
+ */
12
29
  export declare function getDefaultContextRef(): ContextRef;
13
30
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/services/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,uEAAuE;AACvE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAe1I;AAED,wBAAgB,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAMxD;AAYD,mGAAmG;AACnG,wBAAgB,oBAAoB,IAAI,UAAU,CASjD"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/services/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,UAAU,CAe1I;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAMxD;AAYD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,CASjD"}
@@ -2,7 +2,14 @@ import ContextNotRegisteredError from "../errors/ContextNotRegisteredError.js";
2
2
  import { getEnvironmentVariable } from "./environmentVariable.js";
3
3
  import { generateRandomString } from "./random.js";
4
4
  const contexts = {};
5
- /** Register a tenant/client so that it's secret can be used latter. */
5
+ /**
6
+ * Registers a tenant+client so that its secret can be used later.
7
+ * @param tenantId - The tenant ID.
8
+ * @param clientId - The client ID.
9
+ * @param clientSecret - The client secret.
10
+ * @param httpProxy - Optional HTTP proxy configuration.
11
+ * @returns A reference to the registered context.
12
+ */
6
13
  export function register(tenantId, clientId, clientSecret, httpProxy) {
7
14
  const contextId = generateContextId();
8
15
  const context = {
@@ -15,6 +22,12 @@ export function register(tenantId, clientId, clientSecret, httpProxy) {
15
22
  const contextRef = createContextRef(contextId);
16
23
  return contextRef;
17
24
  }
25
+ /**
26
+ * Retrieves the context for a given context ID.
27
+ * @param contextId - The ID of the context.
28
+ * @returns The context associated with the given ID.
29
+ * @throws ContextNotRegisteredError if the context ID is not registered.
30
+ */
18
31
  export function getContext(contextId) {
19
32
  const context = contexts[contextId];
20
33
  if (!context) {
@@ -30,7 +43,11 @@ function createContextRef(contextId) {
30
43
  contextId,
31
44
  };
32
45
  }
33
- /** Opinionated method of getting default context reference. Not recommended for production use. */
46
+ /**
47
+ * Retrieves the opinionated default context reference. NOT RECOMMENDED FOR PRODUCTION USE.
48
+ * @returns A reference to the default context.
49
+ * @remarks This method is opinionated and not recommended for production use.
50
+ */
34
51
  export function getDefaultContextRef() {
35
52
  const tenantId = getEnvironmentVariable("AZURE_TENANT_ID");
36
53
  const clientId = getEnvironmentVariable("AZURE_CLIENT_ID");
@@ -1,7 +1,18 @@
1
1
  import type { DriveId } from "../models/DriveId.ts";
2
2
  import type { DriveRef } from "../models/DriveRef.ts";
3
3
  import type { SiteRef } from "../models/SiteRef.ts";
4
+ /**
5
+ * Creates a reference to a drive.
6
+ * @param siteRef - The reference to the site.
7
+ * @param driveId - The ID of the drive.
8
+ * @returns A reference to the drive.
9
+ * @throws ProtocolError if the drive ID is missing.
10
+ */
4
11
  export declare function createDriveRef(siteRef: SiteRef, driveId: DriveId | undefined): DriveRef;
5
- /** Opinionated method of getting default drive reference. Not recommended for production use. */
12
+ /**
13
+ * Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
14
+ * @returns A reference to the default drive.
15
+ * @remarks This method is opinionated and not recommended for production use.
16
+ */
6
17
  export declare function getDefaultDriveRef(): DriveRef;
7
18
  //# sourceMappingURL=drive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../src/services/drive.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAMpD,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED,iGAAiG;AACjG,wBAAgB,kBAAkB,IAAI,QAAQ,CAa7C"}
1
+ {"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../src/services/drive.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAMpD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,CAUvF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,QAAQ,CAa7C"}
@@ -2,6 +2,13 @@ import ProtocolError from "../errors/ProtocolError.js";
2
2
  import { register } from "./context.js";
3
3
  import { getEnvironmentVariable } from "./environmentVariable.js";
4
4
  import { createSiteRef } from "./site.js";
5
+ /**
6
+ * Creates a reference to a drive.
7
+ * @param siteRef - The reference to the site.
8
+ * @param driveId - The ID of the drive.
9
+ * @returns A reference to the drive.
10
+ * @throws ProtocolError if the drive ID is missing.
11
+ */
5
12
  export function createDriveRef(siteRef, driveId) {
6
13
  if (!driveId) {
7
14
  throw new ProtocolError("DriveID is missing");
@@ -12,7 +19,11 @@ export function createDriveRef(siteRef, driveId) {
12
19
  driveId,
13
20
  };
14
21
  }
15
- /** Opinionated method of getting default drive reference. Not recommended for production use. */
22
+ /**
23
+ * Retrieves the opinionated default drive reference. NOT RECOMMENDED FOR PRODUCTION USE.
24
+ * @returns A reference to the default drive.
25
+ * @remarks This method is opinionated and not recommended for production use.
26
+ */
16
27
  export function getDefaultDriveRef() {
17
28
  const tenantId = getEnvironmentVariable("AZURE_TENANT_ID");
18
29
  const clientId = getEnvironmentVariable("AZURE_CLIENT_ID");
@@ -4,7 +4,19 @@ import type { DriveItemRef } from "../models/DriveItemRef.ts";
4
4
  import type { DriveRef } from "../models/DriveRef.ts";
5
5
  export declare const workbookFileExtension = "xlsx";
6
6
  export declare const rootDriveItemPath: DriveItemPath;
7
- /** Create a drive item path from a given set of segments. Ie ["a","b"] => "/a/b" */
7
+ /**
8
+ * Creates a drive item path from a given set of segments.
9
+ * @param segments - The segments of the path.
10
+ * @returns The constructed drive item path.
11
+ * @throws InvalidArgumentError if a segment is invalid or the path exceeds 400 characters.
12
+ */
8
13
  export declare function driveItemPath(...segments: string[]): DriveItemPath;
14
+ /**
15
+ * Creates a reference to a drive item.
16
+ * @param driveRef - The reference to the drive.
17
+ * @param itemId - The ID of the drive item.
18
+ * @returns A reference to the drive item.
19
+ * @throws ProtocolError if the item ID is missing.
20
+ */
9
21
  export declare function createDriveItemRef(driveRef: DriveRef, itemId: DriveItemId | undefined): DriveItemRef;
10
22
  //# sourceMappingURL=driveItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"driveItem.d.ts","sourceRoot":"","sources":["../../src/services/driveItem.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,eAAO,MAAM,iBAAiB,eAAqB,CAAC;AAEpD,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,aAAa,CAkClE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAWpG"}
1
+ {"version":3,"file":"driveItem.d.ts","sourceRoot":"","sources":["../../src/services/driveItem.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAMtD,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,eAAO,MAAM,iBAAiB,eAAqB,CAAC;AAEpD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,aAAa,CAkClE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,CAWpG"}
@@ -4,7 +4,12 @@ const segmentPattern = /^[^"*:<>?\\|#]{1,256}$/;
4
4
  const reservedNames = ["CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"];
5
5
  export const workbookFileExtension = "xlsx";
6
6
  export const rootDriveItemPath = driveItemPath("/");
7
- /** Create a drive item path from a given set of segments. Ie ["a","b"] => "/a/b" */
7
+ /**
8
+ * Creates a drive item path from a given set of segments.
9
+ * @param segments - The segments of the path.
10
+ * @returns The constructed drive item path.
11
+ * @throws InvalidArgumentError if a segment is invalid or the path exceeds 400 characters.
12
+ */
8
13
  export function driveItemPath(...segments) {
9
14
  for (const segment of segments) {
10
15
  if (segment === "") {
@@ -32,6 +37,13 @@ export function driveItemPath(...segments) {
32
37
  }
33
38
  return path;
34
39
  }
40
+ /**
41
+ * Creates a reference to a drive item.
42
+ * @param driveRef - The reference to the drive.
43
+ * @param itemId - The ID of the drive item.
44
+ * @returns A reference to the drive item.
45
+ * @throws ProtocolError if the item ID is missing.
46
+ */
35
47
  export function createDriveItemRef(driveRef, itemId) {
36
48
  if (!itemId) {
37
49
  throw new ProtocolError("ItemID is missing");
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Retrieves the value of an environment variable.
3
+ * @param env - The name of the environment variable.
4
+ * @param fallbackValue - The fallback value to use if the environment variable is not set. Defaults to null.
5
+ * @returns The value of the environment variable or the fallback value.
6
+ * @throws EnvironmentVariableMissingError if the environment variable is not set and no fallback value is provided.
7
+ */
1
8
  export declare function getEnvironmentVariable(env: string, fallbackValue?: string | null): unknown;
9
+ /**
10
+ * Binds an environment variable to a function that retrieves its value.
11
+ * @param env - The name of the environment variable.
12
+ * @param fallbackValue - The fallback value to use if the environment variable is not set. Defaults to null.
13
+ * @returns A function that retrieves the value of the environment variable or the fallback value.
14
+ */
2
15
  export declare function bindEnvironmentVariable(env: string, fallbackValue?: string | null): () => unknown;
3
16
  //# sourceMappingURL=environmentVariable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"environmentVariable.d.ts","sourceRoot":"","sources":["../../src/services/environmentVariable.ts"],"names":[],"mappings":"AAEA,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAWhG;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,GAAG,IAAW,GAAG,MAAM,OAAO,CAEvG"}
1
+ {"version":3,"file":"environmentVariable.d.ts","sourceRoot":"","sources":["../../src/services/environmentVariable.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,GAAG,IAAW,GAAG,OAAO,CAWhG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,GAAE,MAAM,GAAG,IAAW,GAAG,MAAM,OAAO,CAEvG"}
@@ -1,4 +1,11 @@
1
1
  import EnvironmentVariableMissingError from "../errors/EnvironmentVariableMissingError.js";
2
+ /**
3
+ * Retrieves the value of an environment variable.
4
+ * @param env - The name of the environment variable.
5
+ * @param fallbackValue - The fallback value to use if the environment variable is not set. Defaults to null.
6
+ * @returns The value of the environment variable or the fallback value.
7
+ * @throws EnvironmentVariableMissingError if the environment variable is not set and no fallback value is provided.
8
+ */
2
9
  export function getEnvironmentVariable(env, fallbackValue = null) {
3
10
  const value = process.env[env]?.trim() ?? "";
4
11
  if (value === "") {
@@ -9,6 +16,12 @@ export function getEnvironmentVariable(env, fallbackValue = null) {
9
16
  }
10
17
  return value;
11
18
  }
19
+ /**
20
+ * Binds an environment variable to a function that retrieves its value.
21
+ * @param env - The name of the environment variable.
22
+ * @param fallbackValue - The fallback value to use if the environment variable is not set. Defaults to null.
23
+ * @returns A function that retrieves the value of the environment variable or the fallback value.
24
+ */
12
25
  export function bindEnvironmentVariable(env, fallbackValue = null) {
13
26
  return () => getEnvironmentVariable(env, fallbackValue);
14
27
  }
@@ -1,4 +1,9 @@
1
1
  import { HttpsProxyAgent } from "https-proxy-agent";
2
2
  import type { HttpProxy } from "../models/HttpProxy.ts";
3
+ /**
4
+ * Attempts to create an HTTP agent for a given proxy configuration.
5
+ * @param httpProxy - The HTTP proxy configuration.
6
+ * @returns An instance of HttpsProxyAgent if the proxy is defined, otherwise undefined.
7
+ */
3
8
  export declare function tryGetHttpAgent(httpProxy: HttpProxy | undefined): HttpsProxyAgent<string> | undefined;
4
9
  //# sourceMappingURL=httpAgent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"httpAgent.d.ts","sourceRoot":"","sources":["../../src/services/httpAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,SAAS,CAKrG"}
1
+ {"version":3,"file":"httpAgent.d.ts","sourceRoot":"","sources":["../../src/services/httpAgent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,GAAG,eAAe,CAAC,MAAM,CAAC,GAAG,SAAS,CAKrG"}
@@ -1,4 +1,9 @@
1
1
  import { HttpsProxyAgent } from "https-proxy-agent";
2
+ /**
3
+ * Attempts to create an HTTP agent for a given proxy configuration.
4
+ * @param httpProxy - The HTTP proxy configuration.
5
+ * @returns An instance of HttpsProxyAgent if the proxy is defined, otherwise undefined.
6
+ */
2
7
  export function tryGetHttpAgent(httpProxy) {
3
8
  if (!httpProxy) {
4
9
  return undefined;
@@ -1,4 +1,19 @@
1
+ /**
2
+ * Checks if the HTTP status code indicates a successful response.
3
+ * @param status - The HTTP status code.
4
+ * @returns True if the status code is in the range 200-299, otherwise false.
5
+ */
1
6
  export declare function isHttpOk(status: number): boolean;
7
+ /**
8
+ * Checks if the HTTP status code indicates too many requests (rate limiting).
9
+ * @param status - The HTTP status code.
10
+ * @returns True if the status code is 429, otherwise false.
11
+ */
2
12
  export declare function isHttpTooManyRequests(status: number): boolean;
13
+ /**
14
+ * Checks if the HTTP status code indicates the service is unavailable.
15
+ * @param status - The HTTP status code.
16
+ * @returns True if the status code is 503, otherwise false.
17
+ */
3
18
  export declare function isServiceUnavailable(status: number): boolean;
4
19
  //# sourceMappingURL=httpStatus.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"httpStatus.d.ts","sourceRoot":"","sources":["../../src/services/httpStatus.ts"],"names":[],"mappings":"AAAA,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D"}
1
+ {"version":3,"file":"httpStatus.d.ts","sourceRoot":"","sources":["../../src/services/httpStatus.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEhD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE5D"}
@@ -1,9 +1,24 @@
1
+ /**
2
+ * Checks if the HTTP status code indicates a successful response.
3
+ * @param status - The HTTP status code.
4
+ * @returns True if the status code is in the range 200-299, otherwise false.
5
+ */
1
6
  export function isHttpOk(status) {
2
7
  return status >= 200 && status < 300;
3
8
  }
9
+ /**
10
+ * Checks if the HTTP status code indicates too many requests (rate limiting).
11
+ * @param status - The HTTP status code.
12
+ * @returns True if the status code is 429, otherwise false.
13
+ */
4
14
  export function isHttpTooManyRequests(status) {
5
15
  return status === 429;
6
16
  }
17
+ /**
18
+ * Checks if the HTTP status code indicates the service is unavailable.
19
+ * @param status - The HTTP status code.
20
+ * @returns True if the status code is 503, otherwise false.
21
+ */
7
22
  export function isServiceUnavailable(status) {
8
23
  return status === 503;
9
24
  }
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Converts an operation index to an operation ID.
3
+ * @param index - The operation index.
4
+ * @returns The operation ID as a string.
5
+ */
1
6
  export declare function operationIndexToId(index: number): string;
7
+ /**
8
+ * Converts an operation ID to an operation index.
9
+ * @param id - The operation ID as a string.
10
+ * @returns The operation index as a number.
11
+ */
2
12
  export declare function operationIdToIndex(id: string): number;
3
13
  //# sourceMappingURL=operationId.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operationId.d.ts","sourceRoot":"","sources":["../../src/services/operationId.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAErD"}
1
+ {"version":3,"file":"operationId.d.ts","sourceRoot":"","sources":["../../src/services/operationId.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAErD"}
@@ -1,6 +1,16 @@
1
+ /**
2
+ * Converts an operation index to an operation ID.
3
+ * @param index - The operation index.
4
+ * @returns The operation ID as a string.
5
+ */
1
6
  export function operationIndexToId(index) {
2
7
  return index.toString();
3
8
  }
9
+ /**
10
+ * Converts an operation ID to an operation index.
11
+ * @param id - The operation ID as a string.
12
+ * @returns The operation index as a number.
13
+ */
4
14
  export function operationIdToIndex(id) {
5
15
  return Number.parseInt(id, 10);
6
16
  }
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Generates a random alphanumeric string of the specified length.
3
+ * @param length - The length of the string to generate. Defaults to 16.
4
+ * @returns A random alphanumeric string.
5
+ */
1
6
  export declare function generateRandomString(length?: number): string;
2
7
  //# sourceMappingURL=random.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/services/random.ts"],"names":[],"mappings":"AAIA,wBAAgB,oBAAoB,CAAC,MAAM,SAAK,GAAG,MAAM,CAQxD"}
1
+ {"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/services/random.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,SAAK,GAAG,MAAM,CAQxD"}
@@ -1,5 +1,10 @@
1
1
  import { randomInt } from "node:crypto";
2
2
  const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3
+ /**
4
+ * Generates a random alphanumeric string of the specified length.
5
+ * @param length - The length of the string to generate. Defaults to 16.
6
+ * @returns A random alphanumeric string.
7
+ */
3
8
  export function generateRandomString(length = 16) {
4
9
  let result = "";
5
10
  for (let i = 0; i < length; i++) {
@@ -1,7 +1,12 @@
1
1
  import type { DriveItemId } from "../models/DriveItemId.ts";
2
2
  import type { HostName } from "../models/HostName.ts";
3
3
  import type { SiteName } from "../models/SiteName.ts";
4
- /** Get the site name and item path from a given SharePoint document URL. (ie https://msftfuturesecureai.sharepoint.com/sites/FSAI-MQG/_layouts/15/doc.aspx?sourcedoc={500ff055-1e0f-4c2e-8b32-d167fba4778b} */
4
+ /**
5
+ * Parses a SharePoint document URL to extract the site name, host name, and item ID.
6
+ * @param url - The SharePoint document URL.
7
+ * @returns An object containing the host name, site name, and item ID.
8
+ * @throws InvalidArgumentError if the URL is invalid or required components are missing.
9
+ */
5
10
  export declare function parseSharepointUrl(url: URL): {
6
11
  hostName: HostName;
7
12
  siteName: SiteName;
@@ -1 +1 @@
1
- {"version":3,"file":"sharepointUrl.d.ts","sourceRoot":"","sources":["../../src/services/sharepointUrl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,+MAA+M;AAC/M,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAyB5G"}
1
+ {"version":3,"file":"sharepointUrl.d.ts","sourceRoot":"","sources":["../../src/services/sharepointUrl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,GAAG,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAyB5G"}
@@ -1,5 +1,10 @@
1
1
  import InvalidArgumentError from "../errors/InvalidArgumentError.js";
2
- /** Get the site name and item path from a given SharePoint document URL. (ie https://msftfuturesecureai.sharepoint.com/sites/FSAI-MQG/_layouts/15/doc.aspx?sourcedoc={500ff055-1e0f-4c2e-8b32-d167fba4778b} */
2
+ /**
3
+ * Parses a SharePoint document URL to extract the site name, host name, and item ID.
4
+ * @param url - The SharePoint document URL.
5
+ * @returns An object containing the host name, site name, and item ID.
6
+ * @throws InvalidArgumentError if the URL is invalid or required components are missing.
7
+ */
3
8
  export function parseSharepointUrl(url) {
4
9
  if (!url.hostname.endsWith(".sharepoint.com")) {
5
10
  throw new InvalidArgumentError("Invalid SharePoint URL. Hostname must end with '.sharepoint.com'.");
@@ -1,7 +1,18 @@
1
1
  import type { ContextRef } from "../models/ContextRef.ts";
2
2
  import type { SiteId } from "../models/SiteId.ts";
3
3
  import type { SiteRef } from "../models/SiteRef.ts";
4
+ /**
5
+ * Creates a reference to a site.
6
+ * @param contextRef - The reference to the context.
7
+ * @param siteId - The ID of the site.
8
+ * @returns A reference to the site.
9
+ * @throws ProtocolError if the site ID is missing.
10
+ */
4
11
  export declare function createSiteRef(contextRef: ContextRef, siteId: SiteId | undefined): SiteRef;
5
- /** Opinionated method of getting default site reference. Not recommended for production use. */
12
+ /**
13
+ * Retrieves the opinionated default site reference. NOT RECOMMENDED FOR PRODUCTION USE
14
+ * @returns A reference to the default site.
15
+ * @remarks This method is opinionated and not recommended for production use.
16
+ */
6
17
  export declare function getDefaultSiteRef(): SiteRef;
7
18
  //# sourceMappingURL=site.d.ts.map