antinvestor_api_files 1.51.12 copy "antinvestor_api_files: ^1.51.12" to clipboard
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 #

pub package

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.

0
likes
120
points
325
downloads

Publisher

verified publisherantinvestor.com

Weekly Downloads

Dart client library for Ant Investor Files Service - File upload, download, and media management

Homepage
Repository (GitHub)
View/report issues

Topics

#grpc #protobuf #api-client #files #media

Documentation

API reference

License

unknown (license)

Dependencies

antinvestor_api_common, connectrpc, fixnum, protobuf

More

Packages that depend on antinvestor_api_files