58 lines
1.0 KiB
Rust
58 lines
1.0 KiB
Rust
//! # IMoje File Sync
|
|
//!
|
|
//! Syncs the contents of a Salesforce File to S3
|
|
|
|
use anyhow::Result;
|
|
use clap::Parser;
|
|
|
|
use std::sync::OnceLock;
|
|
|
|
mod aws_s3;
|
|
mod cli;
|
|
mod config;
|
|
mod logger;
|
|
mod salesforce;
|
|
mod terminator;
|
|
|
|
|
|
pub static APP_CONFIG: OnceLock<config::AppConfig> = OnceLock::new();
|
|
|
|
|
|
#[::tokio::main]
|
|
async fn main() {
|
|
cli::run();
|
|
/*
|
|
let args = cli::Args::parse();
|
|
|
|
|
|
|
|
|
|
let salesforce_client = salesforce::connect(&args.sfdx_auth_url).await?;
|
|
let s3_client = aws_s3::connect(
|
|
args.s3_client_id(),
|
|
args.s3_client_secret(),
|
|
args.s3_endpoint(),
|
|
args.s3_region(),
|
|
);
|
|
|
|
|
|
salesforce_client.query(r#"SELECT Id, Title, FileType, FileExtension, Description,
|
|
ContentLocation, Origin, VersionData, ContentDocumentId, FirstPublishLocationId, PathOnClient
|
|
FROM ContentVersion
|
|
WHERE IsMajorVersion = TRUE
|
|
AND ContentLocation = 'S'
|
|
LIMIT 1\
|
|
"#)
|
|
|
|
|
|
|
|
if terminator::CONFIG.is_fired() {
|
|
info!("Received termination signal, exiting...");
|
|
}
|
|
|
|
|
|
|
|
info!("Done.");*/
|
|
|
|
}
|