MCPcopy Index your code
hub / github.com/simstudioai/sim / getItemBasePath

Function getItemBasePath

apps/sim/tools/microsoft_excel/utils.ts:132–152  ·  view source on GitHub ↗
(spreadsheetId: string, driveId?: string)

Source from the content-addressed store, hash-verified

130 * When driveId is omitted, uses /me/drive/items/{itemId} (personal OneDrive).
131 */
132export function getItemBasePath(spreadsheetId: string, driveId?: string): string {
133 const spreadsheetValidation = validatePathSegment(spreadsheetId, {
134 paramName: 'spreadsheetId',
135 customPattern: GRAPH_ID_PATTERN,
136 })
137 if (!spreadsheetValidation.isValid) {
138 throw new Error(spreadsheetValidation.error)
139 }
140
141 if (driveId) {
142 const driveValidation = validatePathSegment(driveId, {
143 paramName: 'driveId',
144 customPattern: GRAPH_ID_PATTERN,
145 })
146 if (!driveValidation.isValid) {
147 throw new Error(driveValidation.error)
148 }
149 return `https://graph.microsoft.com/v1.0/drives/${driveId}/items/${spreadsheetId}`
150 }
151 return `https://graph.microsoft.com/v1.0/me/drive/items/${spreadsheetId}`
152}
153
154/**
155 * Resolves a worksheet name and cell address from either an explicit sheet name

Callers 11

create_table.tsFile · 0.90
write.tsFile · 0.90
worksheet_add.tsFile · 0.90
table_add.tsFile · 0.90
format_range.tsFile · 0.90
read.tsFile · 0.90
clear_range.tsFile · 0.90
sort_range.tsFile · 0.90
route.tsFile · 0.90
getSpreadsheetWebUrlFunction · 0.85

Calls 1

validatePathSegmentFunction · 0.90

Tested by

no test coverage detected