import type { Application, Dashboard, Database, DateTimeFormatOptions, GithubInstallations } from 'src/global'; import { writable, derived, readable, Writable } from 'svelte/store'; export const dashboard = writable({ databases: { deployed: [] }, applications: { deployed: [] }, services: { deployed: [] } }); export const dateOptions: DateTimeFormatOptions = { year: 'numeric', month: 'short', day: '2-digit', hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: false }; export const githubRepositories = writable([]); export const githubInstallations = writable([]); export const application = writable({ github: { installation: { id: null }, app: { id: null } }, repository: { id: null, organization: 'new', name: 'start', branch: null }, general: { deployId: null, nickname: null, workdir: null }, build: { pack: 'static', directory: null, command: { build: null, installation: null }, container: { name: null, tag: null, baseSHA: null } }, publish: { directory: null, domain: null, path: '/', port: null, secrets: [] } }); export const initConf = writable({}); export const initialApplication: Application = { github: { installation: { id: null }, app: { id: null } }, repository: { id: null, organization: null, name: null, branch: null }, general: { deployId: null, nickname: null, workdir: null }, build: { pack: 'static', directory: null, command: { build: null, installation: null }, container: { name: null, tag: null, baseSHA: null } }, publish: { directory: null, domain: null, path: '/', port: null, secrets: [] } }; export const initialDatabase: Database = { config: { general: { workdir: null, deployId: null, nickname: null, type: null }, database: { username: null, passwords: [], defaultDatabaseName: null }, deploy: { name: null } }, envs: {} }; export const database = writable({ config: {}, envs: [] }); export const newService = writable({ email: null, userName: 'admin', userPassword: null, userPasswordAgain: null, baseURL: null }); export const initialNewService = { email: null, userName: 'admin', userPassword: null, userPasswordAgain: null, baseURL: null };