mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 08:54:55 +08:00
200 lines
10 KiB
Rust
200 lines
10 KiB
Rust
//! # BAT Infrastructure - 基础设施层
|
|
//!
|
|
//! 提供技术实现
|
|
//!
|
|
//! 包含:
|
|
//! - CAS 存储实现
|
|
//! - 下载器
|
|
//! - 解析器
|
|
|
|
#![warn(missing_docs)]
|
|
#![warn(clippy::all)]
|
|
|
|
pub mod cas;
|
|
mod curl_transfer;
|
|
pub mod downloader;
|
|
pub mod glossary;
|
|
pub mod import;
|
|
pub mod localized_patch;
|
|
pub mod official_changes;
|
|
pub mod official_download;
|
|
pub mod official_game_main_config;
|
|
pub mod official_launcher;
|
|
pub mod official_parse;
|
|
pub mod official_pull;
|
|
pub mod official_repository;
|
|
pub mod official_sync;
|
|
pub mod official_textunit_queue;
|
|
pub mod official_update;
|
|
pub mod patch_ops;
|
|
pub mod path_security;
|
|
pub mod release_flow;
|
|
pub mod release_ops;
|
|
pub mod resources;
|
|
pub mod translation_memory;
|
|
pub mod translation_tasks;
|
|
pub mod translation_worker;
|
|
pub mod translation_workflow;
|
|
mod zip_validation;
|
|
|
|
pub use cas::FileSystemCasRepository;
|
|
pub use curl_transfer::{
|
|
redact_proxy_url, resolve_curl_proxy, CurlProxyConfig, CurlProxyMode, ResolvedCurlProxy,
|
|
};
|
|
pub use downloader::{
|
|
DownloadResults, DownloadScheduler, DownloaderBackend, DEFAULT_DOWNLOAD_CONCURRENCY,
|
|
MAX_DOWNLOAD_CONCURRENCY, MIN_DOWNLOAD_CONCURRENCY,
|
|
};
|
|
pub use glossary::{
|
|
SqliteGlossaryRepository, GLOSSARY_REPOSITORY_FILE, GLOSSARY_SCHEMA_COMPONENT,
|
|
GLOSSARY_SCHEMA_VERSION,
|
|
};
|
|
pub use import::{
|
|
BundleSource, ImportedResource, ResourceImportCategory, ResourceImportReport,
|
|
ResourceImportService,
|
|
};
|
|
pub use localized_patch::{
|
|
inspect_localized_release_artifact, inspect_localized_release_artifact_at,
|
|
mark_localized_manual_proofreading, read_localized_patch_manifest_at,
|
|
read_localized_version_state, write_localized_version_state, LocalizedArtifactIntegrityReport,
|
|
LocalizedDistributionEntry, LocalizedDistributionManifest, LocalizedFieldPatch,
|
|
LocalizedPatchConfig, LocalizedPatchFile, LocalizedPatchInput, LocalizedPatchIntegrity,
|
|
LocalizedPatchManifest, LocalizedPatchOperation, LocalizedPatchOperationMetadata,
|
|
LocalizedPatchReport, LocalizedPatchRollbackInfo, LocalizedPatchService,
|
|
LocalizedRollbackReport, LocalizedStringFieldPatch, LocalizedTextAssetPatch,
|
|
LocalizedTranslationWorkflowReport, LocalizedVersionState, LOCALIZED_CURRENT_LINK,
|
|
LOCALIZED_DISTRIBUTION_MANIFEST_FILE, LOCALIZED_PATCH_MANIFEST_FILE,
|
|
LOCALIZED_PATCH_MANIFEST_VERSION, LOCALIZED_STAGING_DIR,
|
|
LOCALIZED_TRANSLATION_STATUS_MANUAL_PROOFREADING,
|
|
LOCALIZED_TRANSLATION_STATUS_MANUAL_PROOFREADING_LABEL, LOCALIZED_VERSIONS_DIR,
|
|
LOCALIZED_VERSION_STATE_FILE, LOCALIZED_VERSION_STATE_VERSION,
|
|
};
|
|
pub use official_changes::{
|
|
read_resource_change_set_at, write_crowdin_translation_handoff_at,
|
|
write_official_resource_change_handoff, write_resource_change_set_at,
|
|
CrowdinTranslationHandoff, OfficialResourceChange, OfficialResourceChangeHandoffReport,
|
|
OfficialResourceChangeKind, OfficialResourceChangeSet, OfficialResourceChangeSummary,
|
|
OfficialResourceDescriptor, TranslationHandoffProvider, TranslationHandoffResource,
|
|
TranslationHandoffStatus, CROWDIN_TRANSLATION_HANDOFF_FILE,
|
|
CROWDIN_TRANSLATION_HANDOFF_VERSION, OFFICIAL_RESOURCE_CHANGES_FILE,
|
|
OFFICIAL_RESOURCE_CHANGES_VERSION,
|
|
};
|
|
pub use official_download::{
|
|
official_distribution_mapping_identity, official_distribution_max_age_for_durations,
|
|
official_distribution_max_age_seconds, read_cas_reuse_reference_manifest_at,
|
|
read_download_manifest_at, release_cas_reuse_references, DownloadError,
|
|
OfficialCasReuseReferenceManifest, OfficialDistributionAttestation, OfficialDownloadManifest,
|
|
OfficialDownloadManifestEntry, OfficialLocalManifestAuditItem,
|
|
OfficialLocalManifestAuditReport, OfficialLocalManifestAuditStatus,
|
|
OfficialLocalVerificationReport, OfficialResourceHashAlgorithm,
|
|
OfficialResourceHashVerification, OfficialResourcePullItem, OfficialResourcePullProgress,
|
|
OfficialResourcePullProgressKind, OfficialResourcePullReport, OfficialResourcePullService,
|
|
OfficialResourcePullStatus, OfficialResourceReuseWarning, OfficialResourceVerification,
|
|
DEFAULT_OFFICIAL_ERROR_RETRY_SECONDS, DEFAULT_OFFICIAL_VERIFICATION_INTERVAL_SECONDS,
|
|
OFFICIAL_CAS_REUSE_REFERENCES_FILE, OFFICIAL_DISTRIBUTION_ATTESTATION_FILE,
|
|
OFFICIAL_DISTRIBUTION_ATTESTATION_VERSION, OFFICIAL_DISTRIBUTION_PUBLICATION_FILE,
|
|
};
|
|
pub use official_game_main_config::OfficialGameMainConfigBootstrapService;
|
|
pub use official_launcher::{
|
|
is_official_launcher_package_url, launcher_api_url, launcher_authorization_header,
|
|
OfficialLauncherBootstrapService, YostarJpLauncherCdnConfig, YostarJpLauncherGameConfig,
|
|
YostarJpLauncherManifestUrl, YostarJpLauncherRemoteManifest,
|
|
};
|
|
pub use official_parse::{
|
|
query_textunit_index_errors, query_textunit_index_units, read_parse_cache_at,
|
|
read_textunit_index_at, write_parse_cache_at, write_textunit_index_at, OfficialParseCache,
|
|
OfficialParseCacheEntry, OfficialParseCacheService, OfficialParseConfig, OfficialParseReport,
|
|
OfficialParseSourceFingerprint, OfficialParseSourceKind, OfficialParseStatus,
|
|
OfficialParseSummary, OfficialTextUnitIndex, OfficialTextUnitIndexError,
|
|
OfficialTextUnitIndexSummary, OfficialTextUnitIndexUnit, OfficialTextUnitQuery,
|
|
OFFICIAL_PARSE_CACHE_FILE, OFFICIAL_PARSE_CACHE_VERSION, OFFICIAL_TEXTUNIT_INDEX_FILE,
|
|
OFFICIAL_TEXTUNIT_INDEX_VERSION,
|
|
};
|
|
pub use official_pull::{
|
|
build_official_pull_plan, build_official_pull_plan_for_platform_inventory,
|
|
build_official_pull_plan_for_platforms, build_official_pull_plan_from_platform_inventory,
|
|
OfficialResourcePullPlan,
|
|
};
|
|
pub use official_repository::{
|
|
OfficialReleaseImportConfig, OfficialReleaseImportReport, OfficialReleaseImportService,
|
|
};
|
|
pub use official_sync::{
|
|
build_official_sync_plan, changed_endpoint_urls, classify_sync_decision,
|
|
default_official_platforms, OfficialSyncDecision, OfficialSyncPlan,
|
|
};
|
|
pub use official_textunit_queue::{
|
|
query_textunit_tasks, read_textunit_task_queue_at, write_crowdin_textunit_queue_at,
|
|
write_official_textunit_queues, write_textunit_task_queue_at, CrowdinTextUnitQueue,
|
|
CrowdinTextUnitQueueItem, OfficialTextUnitQueueReport, OfficialTextUnitTask,
|
|
OfficialTextUnitTaskQuery, OfficialTextUnitTaskQueue, OfficialTextUnitTaskStatus,
|
|
OfficialTextUnitTaskSummary, CROWDIN_TEXTUNIT_QUEUE_FILE, CROWDIN_TEXTUNIT_QUEUE_VERSION,
|
|
OFFICIAL_TEXTUNIT_TASK_QUEUE_FILE, OFFICIAL_TEXTUNIT_TASK_QUEUE_VERSION,
|
|
};
|
|
pub use official_update::{
|
|
cached_game_main_config_for_metadata, diff_extended_snapshot, gc_orphan_staging,
|
|
gc_orphan_staging_with_cas_root, read_bootstrap_cache, read_snapshot, read_version_state,
|
|
verify_and_record_official_distribution_attestation, write_bootstrap_cache, write_snapshot,
|
|
write_version_state, ExtendedSnapshotDelta, GameMainConfigSnapshot, LauncherMetadataSnapshot,
|
|
LocalizedReleaseStatus, OfficialBootstrapCache, OfficialEndpointMarkerRole,
|
|
OfficialEndpointMarkerSnapshot, OfficialFailedVersionRecord, OfficialServerInfoSource,
|
|
OfficialUpdateConfig, OfficialUpdateProgress, OfficialUpdateReport, OfficialUpdateService,
|
|
OfficialUpdateSnapshot, OfficialUpdateStatus, OfficialVerificationSummary,
|
|
OfficialVersionRecord, OfficialVersionState, ResolvedBootstrap,
|
|
};
|
|
pub use patch_ops::{
|
|
apply_patch_file, apply_unityfs_field_patch_file, apply_unityfs_string_field_patch_file,
|
|
apply_unityfs_text_asset_patch_file, PatchApplyKind, PatchApplyParams, PatchApplyReport,
|
|
UnityFsFieldPatchParams, UnityFsPatchReport, UnityFsStringFieldPatchParams,
|
|
UnityFsTextAssetPatchParams,
|
|
};
|
|
pub use path_security::{
|
|
ensure_path_within_root, ensure_safe_directory_path, ensure_safe_file_target, lexical_absolute,
|
|
open_append_file, read_file_no_symlink, set_file_mode, validate_output_root,
|
|
validate_runtime_state_dir, write_file_atomic, PRIVATE_FILE_MODE, STATE_FILE_MODE,
|
|
};
|
|
pub use release_flow::ReleaseFlowStatusCode;
|
|
pub use release_ops::{
|
|
build_official_distribution_attestation, build_release_list, build_release_status,
|
|
cleanup_releases, select_release_distribution, OfficialDistributionAttestationReport,
|
|
ReleaseCleanupParams, ReleaseCleanupReport, ReleaseDistributionEntry, ReleaseDistributionPage,
|
|
ReleaseDistributionParams, ReleaseListParams, ReleaseStatusReport, ReleaseSummary,
|
|
};
|
|
pub use resources::{InMemoryResourceRepository, SqliteResourceRepository};
|
|
pub use translation_memory::{
|
|
translation_memory_context, translation_memory_repository_path,
|
|
SqliteTranslationMemoryRepository, TRANSLATION_MEMORY_REPOSITORY_FILE,
|
|
TRANSLATION_MEMORY_SCHEMA_COMPONENT, TRANSLATION_MEMORY_SCHEMA_VERSION,
|
|
};
|
|
pub use translation_tasks::{
|
|
build_translation_handoff, read_translation_handoff_at, sync_translation_task_repository_at,
|
|
write_translation_handoff_at, PersistedTranslationTask, PersistedTranslationTaskState,
|
|
ProviderRun, ProviderRunStatus, SqliteTranslationTaskRepository, TranslationHandoff,
|
|
TranslationJob, TranslationJobStatus, TranslationTaskFailure, TranslationTaskResultSourceKind,
|
|
TranslationTaskStatus, TranslationTaskSyncReport, TranslationTaskUnitResult, TranslationUnit,
|
|
TranslationUnitStatus, TRANSLATION_HANDOFF_FILE, TRANSLATION_HANDOFF_SCHEMA_VERSION,
|
|
TRANSLATION_TASK_REPOSITORY_FILE, TRANSLATION_TASK_SCHEMA_VERSION,
|
|
};
|
|
pub use translation_worker::{
|
|
run_translation_worker_at, run_translation_worker_at_with_cancellation,
|
|
run_translation_worker_with_provider, CrowdinProvider, MockTranslationProvider,
|
|
TranslationProvider, TranslationProviderFailureClass, TranslationProviderKind,
|
|
TranslationProviderRequest, TranslationProviderResponse, TranslationProviderUnit,
|
|
TranslationProviderUnitResult, TranslationWorkerConfig, TranslationWorkerFailure,
|
|
TranslationWorkerReport, DEFAULT_TRANSLATION_CONCURRENCY, DEFAULT_TRANSLATION_LEASE_SECONDS,
|
|
DEFAULT_TRANSLATION_MAX_ATTEMPTS, DEFAULT_TRANSLATION_RETRY_BACKOFF,
|
|
MAX_TRANSLATION_CONCURRENCY, MIN_TRANSLATION_CONCURRENCY, MOCK_TRANSLATION_FIXTURE_VERSION,
|
|
};
|
|
pub use translation_workflow::{
|
|
completed_worker_translation_workbench, export_completed_worker_translation_workbench,
|
|
export_translation_workbench, get_translation_entry, localized_patch_operations,
|
|
localized_patch_operations_with_glossary_path, localized_text_asset_patches,
|
|
read_translation_workbench, repack_bundle, set_translation, set_translation_checked,
|
|
set_translation_checked_with_glossary_path, unset_translation, validate_translation_workbench,
|
|
validate_translation_workbench_with_glossary_path, write_translation_workbench,
|
|
RepackOperation, RepackReport, RepackSpec, TranslationWorkbench, TranslationWorkbenchEntry,
|
|
TranslationWorkbenchValidationReport, REPACK_SPEC_VERSION, TRANSLATION_WORKBENCH_VERSION,
|
|
};
|
|
|
|
/// Infrastructure 版本号
|
|
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
|