antinvestor_api_files 1.51.12
antinvestor_api_files: ^1.51.12 copied to clipboard
Dart client library for Ant Investor Files Service - File upload, download, and media management
Ant Investor Files API - Dart Client #
Dart client library for the Ant Investor Files Service. File upload, download, thumbnail generation, and media management.
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
antinvestor_api_files: ^1.0.0
Then run:
dart pub get
Usage #
import 'package:antinvestor_api_files/antinvestor_api_files.dart';
import 'package:connectrpc/connect.dart';
void main() async {
// Create a client with token management
final client = await FilesClient.create(
tokenManager: tokenManager,
onTokenRefresh: (refreshToken) async {
return await authClient.refresh(refreshToken);
},
createTransport: (baseUrl, interceptors) =>
createHttpTransport(baseUrl: baseUrl, interceptors: interceptors),
);
// Upload content
final uploadResponse = await client.client.uploadContent(request);
print('Uploaded: ${uploadResponse.contentUri}');
}
Features #
- File Upload - Upload files with metadata
- File Download - Download content by MXC URI
- Thumbnails - Generate thumbnails with configurable dimensions
- URL Preview - Get OpenGraph metadata for URLs
- Search - Search uploaded media files
Authentication #
All API calls require JWT authentication:
final client = await FilesClient.create(
tokenManager: tokenManager,
onTokenRefresh: (refreshToken) async {
return await authClient.refresh(refreshToken);
},
createTransport: yourTransportFactory,
);
API Reference #
For detailed API documentation, see the generated documentation.
Contributing #
Contributions are welcome! Please see the main repository for guidelines.
License #
Copyright 2023-2024 Ant Investor Ltd
Licensed under the Apache License, Version 2.0. See LICENSE for details.