diff --git a/.vscode/settings.json b/.vscode/settings.json index e0016bfb2..a5f0ea70c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "cSpell.words": [ + "ipfs", "nexusapp", "tailwindcss" ] diff --git a/package.json b/package.json index 8a4814097..5848a62b2 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/src/types/devices.ts b/src/types/devices.ts new file mode 100644 index 000000000..ec7afaaeb --- /dev/null +++ b/src/types/devices.ts @@ -0,0 +1,5 @@ +export interface ClientDevice { + id: string; +} +export interface StorageDevice {} +export interface CaptureDevice {} diff --git a/src/types/filesystem.ts b/src/types/filesystem.ts new file mode 100644 index 000000000..82c0ecf09 --- /dev/null +++ b/src/types/filesystem.ts @@ -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 +} diff --git a/src/types/index.ts b/src/types/index.ts new file mode 100644 index 000000000..7a38fdee0 --- /dev/null +++ b/src/types/index.ts @@ -0,0 +1,4 @@ +export * from './library'; +export * from './filesystem'; +export * from './job'; +export * from './media'; diff --git a/src/types/job.ts b/src/types/job.ts new file mode 100644 index 000000000..1167b77db --- /dev/null +++ b/src/types/job.ts @@ -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 +} diff --git a/src/types/library.ts b/src/types/library.ts new file mode 100644 index 000000000..a45089c1b --- /dev/null +++ b/src/types/library.ts @@ -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 +} diff --git a/src/types/media.ts b/src/types/media.ts new file mode 100644 index 000000000..851e36387 --- /dev/null +++ b/src/types/media.ts @@ -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; + bitrate: { + video: string; + audio: string; + }; + duration_seconds: number; +} + +export interface AudioMeta {} diff --git a/tailwind.config.js b/tailwind.config.js index d9b5b3ebc..64df493b0 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -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': '' + }); + }) + ] }; diff --git a/yarn.lock b/yarn.lock index 27ac53a3a..5dca7b9df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"