-
Notifications
You must be signed in to change notification settings - Fork 0
Add Microsoft Graph Sites service for SharePoint Online file operations #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: ks6088ts <[email protected]>
…mentation Co-authored-by: ks6088ts <[email protected]>
.env.template
Outdated
MICROSOFT_GRAPH_TENANT_ID="<YOUR_TENANT_ID>" | ||
MICROSOFT_GRAPH_CLIENT_ID="<YOUR_CLIENT_ID>" | ||
MICROSOFT_GRAPH_CLIENT_SECRET="<YOUR_CLIENT_SECRET>" | ||
MICROSOFT_GRAPH_SITE_ID="<YOUR_SITE_ID>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
site id は環境変数にせず、API の引数で指定できるようにしてください
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed MICROSOFT_GRAPH_SITE_ID from environment variables and updated all APIs to accept site_id as a parameter instead. Commit: 5fa7759
docs/index.md
Outdated
|
||
```shell | ||
# Help | ||
uv run python scripts/msgraphs_sites.py --help |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CLI スクリプトは scripts/msgraphs/sites.py に配置してください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Moved CLI script to scripts/msgraphs/sites.py and updated documentation accordingly. Commit: 5fa7759
scripts/msgraphs_sites.py
Outdated
|
||
app = typer.Typer() | ||
console = Console() | ||
msgraphs_sites_repo = MicrosoftGraphSitesRepository() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MicrosoftGraphRepository にして、サブモジュールとして sites を追加する階層化設計を採用してください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Implemented hierarchical design with MicrosoftGraphRepository as the main class and sites as a submodule. Commit: 5fa7759
template_fastapi/app.py
Outdated
app.include_router(foodies.router) | ||
app.include_router(files.router) | ||
app.include_router(speeches.router) | ||
app.include_router(msgraphs_sites.router) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
階層化してください。
msgraphs router とその配下に sites router を追加してください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Created hierarchical router structure with msgraphs router and sites router underneath. Updated app.py to use /msgraphs prefix. Commit: 5fa7759
microsoft_graph_tenant_id: str = "<YOUR_TENANT_ID>" | ||
microsoft_graph_client_id: str = "<YOUR_CLIENT_ID>" | ||
microsoft_graph_client_secret: str = "<YOUR_CLIENT_SECRET>" | ||
microsoft_graph_site_id: str = "<YOUR_SITE_ID>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
site id は追加しないでください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Removed site_id from settings and updated all components to accept it as a parameter. Commit: 5fa7759
@copilot コメント内容を反映してください。 |
…meter Co-authored-by: ks6088ts <[email protected]>
All previous comment requests have been successfully implemented in commit 5fa7759:
The implementation is complete and follows all requested patterns. |
@copilot sharepoint online のサイトを列挙する API を追加して |
This PR implements a complete Microsoft Graph Sites service for SharePoint Online file CRUD operations, following the existing patterns in the codebase.
🚀 Features Added
Core Components
template_fastapi/settings/microsoft_graph.py
) - Configuration management for Microsoft Graph authenticationtemplate_fastapi/repositories/msgraphs_sites.py
) - SharePoint file operations using Microsoft Graph SDKtemplate_fastapi/routers/msgraphs_sites.py
) - FastAPI endpoints for file operationsscripts/msgraphs_sites.py
) - Standalone command-line interfaceAPI Endpoints
The service provides 7 RESTful endpoints under
/msgraphs/sites/
:/files/
/files/upload
/files/upload-multiple
/files/{file_name}
/files/{file_name}/info
/files/{file_name}
/files/
CLI Commands
The standalone CLI provides 7 commands:
list-files
- List files with table/JSON outputupload-file
- Upload single file with folder supportupload-files
- Upload multiple files simultaneouslydownload-file
- Download file with custom output pathdelete-file
- Delete single file with confirmationdelete-files
- Delete multiple files with confirmationget-file-info
- Get detailed file information🔧 Configuration
Added environment variables to
.env.template
:📦 Dependencies
Added
msgraph-sdk>=1.9.0
topyproject.toml
for Microsoft Graph API integration.📖 Documentation
Updated
docs/index.md
with comprehensive CLI usage examples:🧪 Testing
🎯 Implementation Details
The implementation follows the existing codebase patterns:
Fixes #25.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.