mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2025-12-11 20:15:30 +01:00
parent
d0f8e01839
commit
d47b5925d9
8
Cargo.lock
generated
8
Cargo.lock
generated
@ -5497,7 +5497,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "prisma-client-rust"
|
||||
version = "0.6.8"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=3c846422055032ca9b2c8ce969ab9c8d18fde013#3c846422055032ca9b2c8ce969ab9c8d18fde013"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47#4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47"
|
||||
dependencies = [
|
||||
"base64 0.13.1",
|
||||
"bigdecimal",
|
||||
@ -5530,7 +5530,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "prisma-client-rust-cli"
|
||||
version = "0.6.8"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=3c846422055032ca9b2c8ce969ab9c8d18fde013#3c846422055032ca9b2c8ce969ab9c8d18fde013"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47#4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47"
|
||||
dependencies = [
|
||||
"directories",
|
||||
"flate2",
|
||||
@ -5550,7 +5550,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "prisma-client-rust-macros"
|
||||
version = "0.6.8"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=3c846422055032ca9b2c8ce969ab9c8d18fde013#3c846422055032ca9b2c8ce969ab9c8d18fde013"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47#4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47"
|
||||
dependencies = [
|
||||
"convert_case 0.6.0",
|
||||
"proc-macro2",
|
||||
@ -5562,7 +5562,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "prisma-client-rust-sdk"
|
||||
version = "0.6.8"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=3c846422055032ca9b2c8ce969ab9c8d18fde013#3c846422055032ca9b2c8ce969ab9c8d18fde013"
|
||||
source = "git+https://github.com/Brendonovich/prisma-client-rust?rev=4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47#4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47"
|
||||
dependencies = [
|
||||
"convert_case 0.5.0",
|
||||
"dmmf",
|
||||
|
||||
@ -13,19 +13,19 @@ members = [
|
||||
]
|
||||
|
||||
[workspace.dependencies]
|
||||
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "3c846422055032ca9b2c8ce969ab9c8d18fde013", features = [
|
||||
prisma-client-rust = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47", features = [
|
||||
"rspc",
|
||||
"sqlite-create-many",
|
||||
"migrations",
|
||||
"sqlite",
|
||||
] }
|
||||
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "3c846422055032ca9b2c8ce969ab9c8d18fde013", features = [
|
||||
prisma-client-rust-cli = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47", features = [
|
||||
"rspc",
|
||||
"sqlite-create-many",
|
||||
"migrations",
|
||||
"sqlite",
|
||||
] }
|
||||
prisma-client-rust-sdk = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "3c846422055032ca9b2c8ce969ab9c8d18fde013", features = [
|
||||
prisma-client-rust-sdk = { git = "https://github.com/Brendonovich/prisma-client-rust", rev = "4eba61cafa31b5ac3638fee9e0d7e7d8304d6e47", features = [
|
||||
"sqlite",
|
||||
] }
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
|
||||
.key()
|
||||
.update(
|
||||
key::uuid::equals(args.uuid.to_string()),
|
||||
vec![key::SetParam::SetAutomount(args.status)],
|
||||
vec![key::automount::set(args.status)],
|
||||
)
|
||||
.exec()
|
||||
.await?;
|
||||
@ -255,7 +255,7 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
|
||||
.key()
|
||||
.update_many(
|
||||
vec![key::default::equals(true)],
|
||||
vec![key::SetParam::SetDefault(false)],
|
||||
vec![key::default::set(false)],
|
||||
)
|
||||
.exec()
|
||||
.await?;
|
||||
@ -265,7 +265,7 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
|
||||
.key()
|
||||
.update(
|
||||
key::uuid::equals(key_uuid.to_string()),
|
||||
vec![key::SetParam::SetDefault(true)],
|
||||
vec![key::default::set(true)],
|
||||
)
|
||||
.exec()
|
||||
.await?;
|
||||
@ -322,7 +322,7 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
|
||||
.key()
|
||||
.update(
|
||||
key::uuid::equals(uuid.to_string()),
|
||||
vec![key::SetParam::SetAutomount(true)],
|
||||
vec![key::automount::set(true)],
|
||||
)
|
||||
.exec()
|
||||
.await?;
|
||||
|
||||
@ -79,7 +79,7 @@ pub(crate) fn mount() -> AlphaRouter<Ctx> {
|
||||
.statistics()
|
||||
.upsert(
|
||||
statistics::id::equals(1), // Each library is a database so only one of these ever exists
|
||||
params.clone(),
|
||||
statistics::create(params.clone()),
|
||||
params,
|
||||
)
|
||||
.exec()
|
||||
|
||||
@ -346,7 +346,7 @@ impl LibraryManager {
|
||||
.node()
|
||||
.upsert(
|
||||
node::pub_id::equals(uuid_vec.clone()),
|
||||
(
|
||||
node::create(
|
||||
uuid_vec,
|
||||
node_config.name.clone(),
|
||||
vec![node::platform::set(platform as i32)],
|
||||
|
||||
@ -179,7 +179,7 @@ impl IndexerRule {
|
||||
.indexer_rule()
|
||||
.upsert(
|
||||
indexer_rule::id::equals(id),
|
||||
(
|
||||
indexer_rule::create(
|
||||
self.kind as i32,
|
||||
self.name,
|
||||
self.parameters.serialize()?,
|
||||
|
||||
@ -227,7 +227,7 @@ pub(super) async fn create_file(
|
||||
db.file_path()
|
||||
.update(
|
||||
file_path::pub_id::equals(created_file.pub_id),
|
||||
vec![file_path::object_id::set(Some(object.id))],
|
||||
vec![file_path::object::connect(object::id::equals(object.id))],
|
||||
)
|
||||
.exec()
|
||||
.await?;
|
||||
|
||||
@ -325,7 +325,7 @@ impl LocationUpdateArgs {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn find_location(library: &Library, location_id: i32) -> location::FindUnique {
|
||||
pub fn find_location(library: &Library, location_id: i32) -> location::FindUniqueQuery {
|
||||
library
|
||||
.db
|
||||
.location()
|
||||
|
||||
@ -304,7 +304,7 @@ fn file_path_object_connect_ops<'db>(
|
||||
object_id: Uuid,
|
||||
sync: &SyncManager,
|
||||
db: &'db PrismaClient,
|
||||
) -> (CRDTOperation, file_path::Update<'db>) {
|
||||
) -> (CRDTOperation, file_path::UpdateQuery<'db>) {
|
||||
info!("Connecting <FilePath id={file_path_id}> to <Object pub_id={object_id}'>");
|
||||
|
||||
let vec_id = object_id.as_bytes().to_vec();
|
||||
|
||||
@ -190,7 +190,7 @@ impl SyncManager {
|
||||
db.node()
|
||||
.upsert(
|
||||
node::pub_id::equals(op.node.as_bytes().to_vec()),
|
||||
node::create_unchecked(op.node.as_bytes().to_vec(), "TEMP".to_string(), vec![]),
|
||||
node::create(op.node.as_bytes().to_vec(), "TEMP".to_string(), vec![]),
|
||||
vec![],
|
||||
)
|
||||
.exec()
|
||||
@ -276,7 +276,7 @@ impl SyncManager {
|
||||
db.object()
|
||||
.upsert(
|
||||
object::pub_id::equals(id.pub_id.clone()),
|
||||
(id.pub_id, vec![]),
|
||||
object::create(id.pub_id, vec![]),
|
||||
vec![],
|
||||
)
|
||||
.exec()
|
||||
|
||||
@ -1,4 +1,7 @@
|
||||
use crate::{library::Library, prisma::volume::*};
|
||||
use crate::{
|
||||
library::Library,
|
||||
prisma::volume::{self, *},
|
||||
};
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_with::{serde_as, DisplayFromStr};
|
||||
@ -52,7 +55,7 @@ pub async fn save_volume(library: &Library) -> Result<(), VolumeError> {
|
||||
volume.mount_point.to_string(),
|
||||
volume.name.to_string(),
|
||||
),
|
||||
(
|
||||
volume::create(
|
||||
library.node_local_id,
|
||||
volume.name,
|
||||
volume.mount_point,
|
||||
|
||||
@ -150,8 +150,8 @@ impl PrismaGenerator for SDSyncGenerator {
|
||||
let field_name_snake = snake_ident(field.name());
|
||||
|
||||
match field.refine() {
|
||||
RefinedFieldWalker::Scalar(_) => {
|
||||
Some(quote! {
|
||||
RefinedFieldWalker::Scalar(scalar_field) => {
|
||||
(!scalar_field.is_in_required_relation()).then(|| quote! {
|
||||
#model_name_snake::#field_name_snake::set(::serde_json::from_value(val).unwrap()),
|
||||
})
|
||||
},
|
||||
|
||||
@ -139,18 +139,12 @@ export type Params = "Standard" | "Hardened" | "Paranoid"
|
||||
*/
|
||||
export type LocationUpdateArgs = { id: number; name: string | null; generate_preview_media: boolean | null; sync_preview_media: boolean | null; hidden: boolean | null; indexer_rules_ids: number[] }
|
||||
|
||||
export type RenameFileArgs = { location_id: number; file_name: string; new_file_name: string }
|
||||
|
||||
export type IndexerRule = { id: number; kind: number; name: string; default: boolean; parameters: number[]; date_created: string; date_modified: string }
|
||||
|
||||
/**
|
||||
* Represents the operating system which the remote peer is running.
|
||||
* This is not used internally and predominantly is designed to be used for display purposes by the embedding application.
|
||||
*/
|
||||
export type OperatingSystem = "Windows" | "Linux" | "MacOS" | "Ios" | "Android" | { Other: string }
|
||||
|
||||
export type MediaData = { id: number; pixel_width: number | null; pixel_height: number | null; longitude: number | null; latitude: number | null; fps: number | null; capture_device_make: string | null; capture_device_model: string | null; capture_device_software: string | null; duration_seconds: number | null; codecs: string | null; streams: number | null }
|
||||
|
||||
/**
|
||||
* This is a stored key, and can be freely written to the database.
|
||||
*
|
||||
@ -160,6 +154,8 @@ export type StoredKey = { uuid: string; version: StoredKeyVersion; key_type: Sto
|
||||
|
||||
export type OnboardingConfig = { password: Protected<string>; algorithm: Algorithm; hashing_algorithm: HashingAlgorithm }
|
||||
|
||||
export type Volume = { name: string; mount_point: string; total_capacity: string; available_capacity: string; is_removable: boolean; disk_type: string | null; file_system: string | null; is_root_filesystem: boolean }
|
||||
|
||||
/**
|
||||
* `IndexerRuleCreateArgs` is the argument received from the client using rspc to create a new indexer rule.
|
||||
* Note that `parameters` field **MUST** be a JSON object serialized to bytes.
|
||||
@ -185,10 +181,14 @@ export type Nonce = { XChaCha20Poly1305: number[] } | { Aes256Gcm: number[] }
|
||||
|
||||
export type UnlockKeyManagerArgs = { password: Protected<string>; secret_key: Protected<string> }
|
||||
|
||||
export type SetNoteArgs = { id: number; note: string | null }
|
||||
|
||||
export type FileEncryptorJobInit = { location_id: number; path_id: number; key_uuid: string; algorithm: Algorithm; metadata: boolean; preview_media: boolean; output_path: string | null }
|
||||
|
||||
export type InvalidateOperationEvent = { key: string; arg: any; result: any | null }
|
||||
|
||||
export type Location = { id: number; pub_id: number[]; node_id: number; name: string; path: string; total_capacity: number | null; available_capacity: number | null; is_archived: boolean; generate_preview_media: boolean; sync_preview_media: boolean; hidden: boolean; date_created: string }
|
||||
|
||||
export type CRDTOperation = { node: string; timestamp: number; id: string; typ: CRDTOperationType }
|
||||
|
||||
/**
|
||||
@ -204,8 +204,6 @@ export type GetArgs = { id: number }
|
||||
|
||||
export type FileCutterJobInit = { source_location_id: number; source_path_id: number; target_location_id: number; target_path: string }
|
||||
|
||||
export type FilePath = { id: number; pub_id: number[]; is_dir: boolean; cas_id: string | null; integrity_checksum: string | null; location_id: number; materialized_path: string; name: string; extension: string; size_in_bytes: string; inode: number[]; device: number[]; object_id: number | null; parent_id: number[] | null; key_id: number | null; date_created: string; date_modified: string; date_indexed: string }
|
||||
|
||||
export type ExplorerItem = { type: "Path"; has_thumbnail: boolean; item: FilePathWithObject } | { type: "Object"; has_thumbnail: boolean; item: ObjectWithFilePaths }
|
||||
|
||||
export type JobStatus = "Queued" | "Running" | "Completed" | "Canceled" | "Failed" | "Paused"
|
||||
@ -214,14 +212,14 @@ export type ObjectValidatorArgs = { id: number; path: string }
|
||||
|
||||
export type FileEraserJobInit = { location_id: number; path_id: number; passes: string }
|
||||
|
||||
export type Node = { id: number; pub_id: number[]; name: string; platform: number; version: string | null; last_seen: string; timezone: string | null; date_created: string }
|
||||
export type SetFavoriteArgs = { id: number; favorite: boolean }
|
||||
|
||||
export type Tag = { id: number; pub_id: number[]; name: string | null; color: string | null; total_objects: number | null; redundancy_goal: number | null; date_created: string; date_modified: string }
|
||||
|
||||
export type Volume = { name: string; mount_point: string; total_capacity: string; available_capacity: string; is_removable: boolean; disk_type: string | null; file_system: string | null; is_root_filesystem: boolean }
|
||||
export type RenameFileArgs = { location_id: number; file_name: string; new_file_name: string }
|
||||
|
||||
export type FileDeleterJobInit = { location_id: number; path_id: number }
|
||||
|
||||
export type FilePath = { id: number; pub_id: number[]; is_dir: boolean; cas_id: string | null; integrity_checksum: string | null; location_id: number; materialized_path: string; name: string; extension: string; size_in_bytes: string; inode: number[]; device: number[]; object_id: number | null; parent_id: number[] | null; key_id: number | null; date_created: string; date_modified: string; date_indexed: string }
|
||||
|
||||
/**
|
||||
* These are all possible algorithms that can be used for encryption and decryption
|
||||
*/
|
||||
@ -229,14 +227,10 @@ export type Algorithm = "XChaCha20Poly1305" | "Aes256Gcm"
|
||||
|
||||
export type LocationExplorerArgs = { location_id: number; path: string | null; limit: number; cursor: string | null; kind: number[] | null }
|
||||
|
||||
export type Statistics = { id: number; date_captured: string; total_object_count: number; library_db_size: string; total_bytes_used: string; total_bytes_capacity: string; total_unique_bytes: string; total_bytes_free: string; preview_media_bytes: string }
|
||||
|
||||
export type JobReport = { id: string; name: string; action: string | null; data: number[] | null; metadata: any | null; is_background: boolean; created_at: string | null; started_at: string | null; completed_at: string | null; parent_id: string | null; status: JobStatus; task_count: number; completed_task_count: number; message: string }
|
||||
|
||||
export type OwnedOperationItem = { id: any; data: OwnedOperationData }
|
||||
|
||||
export type SetFavoriteArgs = { id: number; favorite: boolean }
|
||||
|
||||
export type CRDTOperationType = SharedOperation | RelationOperation | OwnedOperation
|
||||
|
||||
/**
|
||||
@ -258,6 +252,8 @@ export type SharedOperation = { record_id: any; model: string; data: SharedOpera
|
||||
|
||||
export type RelationOperationData = "Create" | { Update: { field: string; value: any } } | "Delete"
|
||||
|
||||
export type Node = { id: number; pub_id: number[]; name: string; platform: number; version: string | null; last_seen: string; timezone: string | null; date_created: string }
|
||||
|
||||
export type SharedOperationCreateData = { u: { [key: string]: any } } | "a"
|
||||
|
||||
export type KeyAddArgs = { algorithm: Algorithm; hashing_algorithm: HashingAlgorithm; key: Protected<string>; library_sync: boolean; automount: boolean }
|
||||
@ -284,12 +280,16 @@ export type OwnedOperationData = { Create: { [key: string]: any } } | { CreateMa
|
||||
|
||||
export type SharedOperationData = SharedOperationCreateData | { field: string; value: any } | null
|
||||
|
||||
export type Object = { id: number; pub_id: number[]; kind: number; key_id: number | null; hidden: boolean; favorite: boolean; important: boolean; has_thumbnail: boolean; has_thumbstrip: boolean; has_video_preview: boolean; ipfs_id: string | null; note: string | null; date_created: string }
|
||||
export type MediaData = { id: number; pixel_width: number | null; pixel_height: number | null; longitude: number | null; latitude: number | null; fps: number | null; capture_device_make: string | null; capture_device_model: string | null; capture_device_software: string | null; duration_seconds: number | null; codecs: string | null; streams: number | null }
|
||||
|
||||
export type IndexerRule = { id: number; kind: number; name: string; default: boolean; parameters: number[]; date_created: string; date_modified: string }
|
||||
|
||||
export type FileCopierJobInit = { source_location_id: number; source_path_id: number; target_location_id: number; target_path: string; target_file_name_suffix: string | null }
|
||||
|
||||
export type ChangeNodeNameArgs = { name: string }
|
||||
|
||||
export type Object = { id: number; pub_id: number[]; kind: number; key_id: number | null; hidden: boolean; favorite: boolean; important: boolean; has_thumbnail: boolean; has_thumbstrip: boolean; has_video_preview: boolean; ipfs_id: string | null; note: string | null; date_created: string }
|
||||
|
||||
/**
|
||||
* This defines all available password hashing algorithms.
|
||||
*/
|
||||
@ -297,8 +297,6 @@ export type HashingAlgorithm = { name: "Argon2id"; params: Params } | { name: "B
|
||||
|
||||
export type ExplorerData = { context: ExplorerContext; items: ExplorerItem[] }
|
||||
|
||||
export type SetNoteArgs = { id: number; note: string | null }
|
||||
|
||||
export type LocationWithIndexerRules = { id: number; pub_id: number[]; node_id: number; name: string; path: string; total_capacity: number | null; available_capacity: number | null; is_archived: boolean; generate_preview_media: boolean; sync_preview_media: boolean; hidden: boolean; date_created: string; indexer_rules: ({ indexer_rule: IndexerRule })[] }
|
||||
|
||||
/**
|
||||
@ -312,14 +310,16 @@ export type FileDecryptorJobInit = { location_id: number; path_id: number; mount
|
||||
|
||||
export type AutomountUpdateArgs = { uuid: string; status: boolean }
|
||||
|
||||
export type Location = { id: number; pub_id: number[]; node_id: number; name: string; path: string; total_capacity: number | null; available_capacity: number | null; is_archived: boolean; generate_preview_media: boolean; sync_preview_media: boolean; hidden: boolean; date_created: string }
|
||||
|
||||
export type Protected<T> = T
|
||||
|
||||
export type Statistics = { id: number; date_captured: string; total_object_count: number; library_db_size: string; total_bytes_used: string; total_bytes_capacity: string; total_unique_bytes: string; total_bytes_free: string; preview_media_bytes: string }
|
||||
|
||||
export type ObjectWithFilePaths = { id: number; pub_id: number[]; kind: number; key_id: number | null; hidden: boolean; favorite: boolean; important: boolean; has_thumbnail: boolean; has_thumbstrip: boolean; has_video_preview: boolean; ipfs_id: string | null; note: string | null; date_created: string; file_paths: FilePath[] }
|
||||
|
||||
export type RestoreBackupArgs = { password: Protected<string>; secret_key: Protected<string>; path: string }
|
||||
|
||||
export type Tag = { id: number; pub_id: number[]; name: string | null; color: string | null; total_objects: number | null; redundancy_goal: number | null; date_created: string; date_modified: string }
|
||||
|
||||
export type RelationOperation = { relation_item: string; relation_group: string; relation: string; data: RelationOperationData }
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user