mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-02 08:53:32 +00:00
designed some data structures
This commit is contained in:
parent
48358c26b0
commit
d31690e0c9
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"cSpell.words": [
|
||||
"ipfs",
|
||||
"nexusapp",
|
||||
"tailwindcss"
|
||||
]
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
"@types/babel-core": "^6.25.7",
|
||||
"@types/react": "^17.0.18",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/tailwindcss": "^2.2.1",
|
||||
"concurrently": "^6.2.1",
|
||||
"prettier": "^2.3.2",
|
||||
"typescript": "^4.3.5"
|
||||
|
|
5
src/types/devices.ts
Normal file
5
src/types/devices.ts
Normal file
|
@ -0,0 +1,5 @@
|
|||
export interface ClientDevice {
|
||||
id: string;
|
||||
}
|
||||
export interface StorageDevice {}
|
||||
export interface CaptureDevice {}
|
58
src/types/filesystem.ts
Normal file
58
src/types/filesystem.ts
Normal file
|
@ -0,0 +1,58 @@
|
|||
import { Encryption } from './library';
|
||||
import { ImageMeta, VideoMeta } from './media';
|
||||
|
||||
export interface Object {
|
||||
id?: number;
|
||||
checksum: string;
|
||||
type: ObjectType;
|
||||
|
||||
uri: string;
|
||||
file_name: string;
|
||||
extension: string;
|
||||
size: number;
|
||||
mime: string;
|
||||
encryption?: Encryption;
|
||||
|
||||
date_created: Date;
|
||||
date_modified: Date;
|
||||
date_indexed: Date;
|
||||
geolocation: string;
|
||||
|
||||
directory_id: string;
|
||||
storage_device_id: string;
|
||||
capture_device_id: string;
|
||||
parent_object_id: string;
|
||||
user_id: string;
|
||||
|
||||
extra_data: null | ImageMeta | VideoMeta;
|
||||
ipfs_id: string;
|
||||
}
|
||||
|
||||
export interface Directory {
|
||||
id: string;
|
||||
name: string;
|
||||
|
||||
calculated_size: string;
|
||||
calculated_object_count: number;
|
||||
storage_device_id: string;
|
||||
parent_directory_id: string;
|
||||
user_id: string;
|
||||
|
||||
date_created: Date;
|
||||
date_modified: Date;
|
||||
date_indexed: Date;
|
||||
}
|
||||
|
||||
export interface Tag {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface TagObject {
|
||||
object_id: string;
|
||||
tag_id: string;
|
||||
}
|
||||
|
||||
export enum ObjectType {
|
||||
FILE,
|
||||
LINK
|
||||
}
|
4
src/types/index.ts
Normal file
4
src/types/index.ts
Normal file
|
@ -0,0 +1,4 @@
|
|||
export * from './library';
|
||||
export * from './filesystem';
|
||||
export * from './job';
|
||||
export * from './media';
|
22
src/types/job.ts
Normal file
22
src/types/job.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
export interface Job {
|
||||
// A job is used to define a task for the software to complete
|
||||
// These are intended to be stored in memory, or not persisted permanently
|
||||
object_ids: string[]; // array of object ids that concern this job
|
||||
type: JobType;
|
||||
created_at: Date;
|
||||
completed_at: Date;
|
||||
canceled_at: Date;
|
||||
parent_job_id: string;
|
||||
}
|
||||
|
||||
export enum JobType {
|
||||
SCAN,
|
||||
IMPORT,
|
||||
ENCRYPT,
|
||||
DECRYPT,
|
||||
COPY,
|
||||
MOVE,
|
||||
DELETE,
|
||||
RENDER_VIDEO,
|
||||
RENDER_IMAGE
|
||||
}
|
37
src/types/library.ts
Normal file
37
src/types/library.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
|
||||
google_access_token: string;
|
||||
google_refresh_token: string;
|
||||
}
|
||||
|
||||
export interface Library {
|
||||
id: string;
|
||||
name: string;
|
||||
object_count: number;
|
||||
total_size: number;
|
||||
encryption: Encryption;
|
||||
|
||||
public: boolean;
|
||||
date_created: Date;
|
||||
}
|
||||
|
||||
export interface UserLibrary {
|
||||
library_id: string;
|
||||
user_id: string;
|
||||
date_joined: Date;
|
||||
role: UserLibraryRole;
|
||||
}
|
||||
|
||||
export enum Encryption {
|
||||
NONE,
|
||||
'128-AES',
|
||||
'192-AES',
|
||||
'256-AES'
|
||||
}
|
||||
|
||||
export enum UserLibraryRole {
|
||||
OWNER,
|
||||
READ_ONLY
|
||||
}
|
30
src/types/media.ts
Normal file
30
src/types/media.ts
Normal file
|
@ -0,0 +1,30 @@
|
|||
export interface ImageMeta {
|
||||
type: 'image';
|
||||
dimensions: {
|
||||
width: string;
|
||||
height: string;
|
||||
};
|
||||
color_space: string;
|
||||
aperture: number;
|
||||
exposure_mode: number;
|
||||
exposure_program: number;
|
||||
f_number: number;
|
||||
flash: boolean;
|
||||
focal_length: number;
|
||||
has_alpha_channel: boolean;
|
||||
iso_speed: number;
|
||||
orientation: number;
|
||||
metering_mode: number;
|
||||
}
|
||||
|
||||
export interface VideoMeta {
|
||||
type: 'video';
|
||||
codecs: Array<string>;
|
||||
bitrate: {
|
||||
video: string;
|
||||
audio: string;
|
||||
};
|
||||
duration_seconds: number;
|
||||
}
|
||||
|
||||
export interface AudioMeta {}
|
|
@ -1,4 +1,5 @@
|
|||
const colors = require('tailwindcss/colors');
|
||||
const plugin = require('tailwindcss/plugin');
|
||||
|
||||
module.exports = {
|
||||
purge: [
|
||||
|
@ -22,5 +23,13 @@ module.exports = {
|
|||
variants: {
|
||||
extend: {}
|
||||
},
|
||||
plugins: [require('@tailwindcss/forms'), require('@vechaiui/core')]
|
||||
plugins: [
|
||||
require('@tailwindcss/forms'),
|
||||
require('@vechaiui/core'),
|
||||
plugin(function ({ addUtilities }) {
|
||||
addUtilities({
|
||||
'.bg-transparent': ''
|
||||
});
|
||||
})
|
||||
]
|
||||
};
|
||||
|
|
|
@ -613,6 +613,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39"
|
||||
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==
|
||||
|
||||
"@types/tailwindcss@^2.2.1":
|
||||
version "2.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/tailwindcss/-/tailwindcss-2.2.1.tgz#891349cc71b5a85208ca5796938d91dd48cc0417"
|
||||
integrity sha512-raLwtQF+uul9lsvs7+GUizeNrpxRqbnckIu/va5hzPPwZsImZunkyLFAS/1rwEHhhvFMNiMJmTiP5PPGa0oNJA==
|
||||
|
||||
"@types/zen-observable@0.8.3":
|
||||
version "0.8.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.3.tgz#781d360c282436494b32fe7d9f7f8e64b3118aa3"
|
||||
|
|
Loading…
Reference in a new issue