0.8.10 • Published 2 years ago

@leight-core/server v0.8.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Server

Server-side helper stuff.

Schema

model Token {
  id    String    @id @default(cuid())
  name  String    @unique
  until DateTime?

  UserToken UserToken[]
}

model UserToken {
  id      String @id @default(cuid())
  userId  String
  user    User   @relation(fields: [userId], references: [id], onDelete: Cascade)
  tokenId String
  token   Token  @relation(fields: [tokenId], references: [id], onDelete: Cascade)

  @@unique([userId, tokenId])
}

model Translation {
  id       String @id @default(cuid())
  language String @db.VarChar(32)
  label    String @db.Text
  text     String @db.Text
  hash     String @db.VarChar(128)

  @@unique([language, hash])
}

model File {
  id       String    @id @default(cuid())
  path     String
  name     String
  mime     String
  size     Int
  location String
  ttl      Int?
  created  DateTime
  updated  DateTime?
  userId   String
  user     User      @relation(fields: [userId], references: [id], onDelete: Cascade)
}

model Job {
  id           String    @id @default(cuid())
  name         String
  status       JobStatus @default(NEW)
  total        Int       @default(0)
  progress     Decimal   @default(0) @db.Decimal(5, 2)
  success      Int?
  successRatio Decimal?  @db.Decimal(5, 2)
  failure      Int?
  failureRatio Decimal?  @db.Decimal(5, 2)
  skip         Int?
  skipRatio    Decimal?  @db.Decimal(5, 2)
  created      DateTime
  started      DateTime?
  finished     DateTime?
  logs         JobLog[]
  userId       String?
  user         User?     @relation(fields: [userId], references: [id], onDelete: Cascade)
  params       String?
}

model JobLog {
  id      String @id @default(cuid())
  jobId   String
  job     Job    @relation(fields: [jobId], references: [id], onDelete: Cascade)
  message String @db.Text
}

enum JobStatus {
  // Just created, nobody cares about the job yet
  NEW
  // Job has been picked up and is in progress.
  RUNNING
  // Job has been successfully done; waiting for "commit".
  SUCCESS
  // Job has failed hard (usually outside of boundaris of the job handler)
  FAILURE
  //  Job has been processed, but there are some failed items
  REVIEW
  //  When everything is OK, it's done: goes from review->done and failure->done
  DONE
}

model Metric {
  id        String   @id @default(cuid())
  reference String
  name      String
  start     Decimal? @db.Decimal(10, 2)
  value     Decimal  @db.Decimal(10, 2)
  label     String?
  userId    String?
  user      User?    @relation(fields: [userId], references: [id], onDelete: Cascade)
}
0.8.9

2 years ago

0.8.8

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.7

2 years ago

0.8.6

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.8.10

2 years ago

0.6.249

2 years ago

0.6.248

2 years ago

0.6.247

2 years ago

0.6.246

2 years ago

0.6.245

2 years ago

0.6.244

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.7.9

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.7.10

2 years ago

0.6.199

2 years ago

0.6.198

2 years ago

0.6.197

2 years ago

0.6.229

2 years ago

0.6.228

2 years ago

0.6.227

2 years ago

0.6.226

2 years ago

0.6.236

2 years ago

0.6.235

2 years ago

0.6.234

2 years ago

0.6.233

2 years ago

0.6.232

2 years ago

0.6.231

2 years ago

0.6.230

2 years ago

0.6.239

2 years ago

0.6.238

2 years ago

0.6.237

2 years ago

0.6.243

2 years ago

0.6.242

2 years ago

0.6.241

2 years ago

0.6.240

2 years ago

0.6.209

2 years ago

0.6.208

2 years ago

0.6.207

2 years ago

0.6.206

2 years ago

0.6.205

2 years ago

0.6.204

2 years ago

0.6.214

2 years ago

0.6.213

2 years ago

0.6.212

2 years ago

0.6.211

2 years ago

0.6.210

2 years ago

0.6.219

2 years ago

0.6.218

2 years ago

0.6.217

2 years ago

0.6.216

2 years ago

0.6.215

2 years ago

0.6.225

2 years ago

0.6.224

2 years ago

0.6.223

2 years ago

0.6.222

2 years ago

0.6.221

2 years ago

0.6.220

2 years ago

0.6.203

2 years ago

0.6.202

2 years ago

0.6.201

2 years ago

0.6.200

2 years ago

0.6.137

2 years ago

0.6.136

2 years ago

0.6.135

2 years ago

0.6.134

2 years ago

0.6.133

2 years ago

0.6.132

2 years ago

0.6.139

2 years ago

0.6.138

2 years ago

0.6.140

2 years ago

0.6.148

2 years ago

0.6.147

2 years ago

0.6.146

2 years ago

0.6.145

2 years ago

0.6.144

2 years ago

0.6.143

2 years ago

0.6.142

2 years ago

0.6.141

2 years ago

0.6.173

2 years ago

0.6.172

2 years ago

0.6.171

2 years ago

0.6.170

2 years ago

0.6.179

2 years ago

0.6.178

2 years ago

0.6.177

2 years ago

0.6.176

2 years ago

0.6.175

2 years ago

0.6.174

2 years ago

0.6.184

2 years ago

0.6.183

2 years ago

0.6.182

2 years ago

0.6.181

2 years ago

0.6.180

2 years ago

0.6.189

2 years ago

0.6.188

2 years ago

0.6.187

2 years ago

0.6.186

2 years ago

0.6.185

2 years ago

0.6.149

2 years ago

0.6.151

2 years ago

0.6.150

2 years ago

0.6.159

2 years ago

0.6.158

2 years ago

0.6.157

2 years ago

0.6.156

2 years ago

0.6.155

2 years ago

0.6.153

2 years ago

0.6.152

2 years ago

0.6.162

2 years ago

0.6.161

2 years ago

0.6.160

2 years ago

0.6.169

2 years ago

0.6.168

2 years ago

0.6.167

2 years ago

0.6.166

2 years ago

0.6.165

2 years ago

0.6.164

2 years ago

0.6.163

2 years ago

0.6.195

2 years ago

0.6.194

2 years ago

0.6.193

2 years ago

0.6.192

2 years ago

0.6.191

2 years ago

0.6.190

2 years ago

0.6.196

2 years ago

0.6.129

2 years ago

0.6.128

2 years ago

0.6.127

2 years ago

0.6.131

2 years ago

0.6.130

2 years ago

0.6.109

3 years ago

0.6.108

3 years ago

0.6.107

3 years ago

0.6.106

3 years ago

0.6.105

3 years ago

0.6.115

3 years ago

0.6.114

3 years ago

0.6.113

3 years ago

0.6.112

3 years ago

0.6.111

3 years ago

0.6.110

3 years ago

0.6.119

2 years ago

0.6.118

2 years ago

0.6.117

2 years ago

0.6.116

3 years ago

0.6.126

2 years ago

0.6.125

2 years ago

0.6.124

2 years ago

0.6.123

2 years ago

0.6.122

2 years ago

0.6.121

2 years ago

0.6.120

2 years ago

0.6.98

3 years ago

0.6.97

3 years ago

0.6.99

3 years ago

0.6.94

3 years ago

0.6.93

3 years ago

0.6.96

3 years ago

0.6.95

3 years ago

0.6.104

3 years ago

0.6.90

3 years ago

0.6.103

3 years ago

0.6.102

3 years ago

0.6.92

3 years ago

0.6.101

3 years ago

0.6.91

3 years ago

0.6.100

3 years ago

0.6.87

3 years ago

0.6.89

3 years ago

0.6.88

3 years ago

0.6.21

3 years ago

0.6.20

3 years ago

0.6.23

3 years ago

0.6.22

3 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.6.9

3 years ago

0.6.8

3 years ago

0.6.29

3 years ago

0.6.28

3 years ago

0.6.25

3 years ago

0.6.24

3 years ago

0.6.27

3 years ago

0.6.26

3 years ago

0.6.10

3 years ago

0.6.12

3 years ago

0.6.11

3 years ago

0.6.18

3 years ago

0.5.147

3 years ago

0.6.17

3 years ago

0.5.149

3 years ago

0.6.19

3 years ago

0.5.148

3 years ago

0.6.14

3 years ago

0.6.13

3 years ago

0.6.16

3 years ago

0.6.15

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.5

3 years ago

0.6.4

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.6.65

3 years ago

0.5.172

3 years ago

0.6.64

3 years ago

0.5.171

3 years ago

0.6.67

3 years ago

0.5.174

3 years ago

0.6.66

3 years ago

0.5.173

3 years ago

0.6.61

3 years ago

0.6.60

3 years ago

0.6.63

3 years ago

0.6.62

3 years ago

0.6.69

3 years ago

0.6.68

3 years ago

0.6.54

3 years ago

0.6.53

3 years ago

0.6.56

3 years ago

0.6.55

3 years ago

0.6.50

3 years ago

0.6.52

3 years ago

0.6.51

3 years ago

0.6.58

3 years ago

0.6.57

3 years ago

0.6.59

3 years ago

0.6.43

3 years ago

0.5.150

3 years ago

0.6.42

3 years ago

0.6.45

3 years ago

0.5.152

3 years ago

0.6.44

3 years ago

0.5.151

3 years ago

0.6.41

3 years ago

0.6.40

3 years ago

0.5.158

3 years ago

0.5.157

3 years ago

0.5.159

3 years ago

0.6.47

3 years ago

0.5.154

3 years ago

0.6.46

3 years ago

0.5.153

3 years ago

0.6.49

3 years ago

0.5.156

3 years ago

0.6.48

3 years ago

0.5.155

3 years ago

0.6.32

3 years ago

0.5.161

3 years ago

0.6.31

3 years ago

0.5.160

3 years ago

0.6.34

3 years ago

0.5.163

3 years ago

0.6.33

3 years ago

0.5.162

3 years ago

0.6.30

3 years ago

0.5.169

3 years ago

0.6.39

3 years ago

0.5.168

3 years ago

0.6.36

3 years ago

0.5.165

3 years ago

0.6.35

3 years ago

0.5.164

3 years ago

0.6.38

3 years ago

0.5.167

3 years ago

0.6.37

3 years ago

0.5.166

3 years ago

0.6.86

3 years ago

0.6.83

3 years ago

0.6.82

3 years ago

0.6.85

3 years ago

0.6.84

3 years ago

0.6.81

3 years ago

0.6.80

3 years ago

0.6.76

3 years ago

0.6.75

3 years ago

0.6.78

3 years ago

0.6.77

3 years ago

0.6.72

3 years ago

0.6.71

3 years ago

0.6.74

3 years ago

0.6.73

3 years ago

0.6.79

3 years ago

0.6.70

3 years ago

0.5.98

3 years ago

0.5.99

3 years ago

0.5.96

3 years ago

0.5.97

3 years ago

0.5.94

3 years ago

0.5.95

3 years ago

0.5.92

3 years ago

0.5.93

3 years ago

0.5.90

3 years ago

0.5.91

3 years ago

0.5.87

3 years ago

0.5.88

3 years ago

0.5.85

3 years ago

0.5.86

3 years ago

0.5.83

3 years ago

0.5.84

3 years ago

0.5.81

3 years ago

0.5.82

3 years ago

0.5.103

3 years ago

0.5.102

3 years ago

0.5.105

3 years ago

0.5.104

3 years ago

0.5.101

3 years ago

0.5.89

3 years ago

0.5.100

3 years ago

0.5.80

3 years ago

0.5.76

3 years ago

0.5.77

3 years ago

0.5.74

3 years ago

0.5.75

3 years ago

0.5.72

3 years ago

0.5.73

3 years ago

0.5.70

3 years ago

0.5.71

3 years ago

0.5.78

3 years ago

0.5.79

3 years ago

0.5.65

3 years ago

0.5.66

3 years ago

0.5.63

3 years ago

0.5.61

3 years ago

0.5.62

3 years ago

0.5.60

3 years ago

0.5.69

3 years ago

0.5.67

3 years ago

0.5.68

3 years ago

0.5.54

3 years ago

0.5.55

3 years ago

0.5.130

3 years ago

0.5.53

3 years ago

0.5.136

3 years ago

0.5.135

3 years ago

0.5.138

3 years ago

0.5.137

3 years ago

0.5.132

3 years ago

0.5.58

3 years ago

0.5.131

3 years ago

0.5.59

3 years ago

0.5.134

3 years ago

0.5.56

3 years ago

0.5.133

3 years ago

0.5.57

3 years ago

0.5.129

3 years ago

0.5.128

3 years ago

0.5.141

3 years ago

0.5.140

3 years ago

0.5.146

3 years ago

0.5.143

3 years ago

0.5.142

3 years ago

0.5.145

3 years ago

0.5.144

3 years ago

0.5.139

3 years ago

0.5.114

3 years ago

0.5.113

3 years ago

0.5.116

3 years ago

0.5.115

3 years ago

0.5.110

3 years ago

0.5.112

3 years ago

0.5.111

3 years ago

0.5.107

3 years ago

0.5.106

3 years ago

0.5.109

3 years ago

0.5.108

3 years ago

0.5.125

3 years ago

0.5.124

3 years ago

0.5.127

3 years ago

0.5.126

3 years ago

0.5.121

3 years ago

0.5.120

3 years ago

0.5.123

3 years ago

0.5.122

3 years ago

0.5.118

3 years ago

0.5.117

3 years ago

0.5.119

3 years ago

0.5.52

3 years ago

0.5.51

3 years ago

0.5.50

3 years ago

0.5.49

3 years ago

0.5.48

3 years ago

0.5.47

3 years ago

0.5.46

3 years ago

0.5.45

3 years ago

0.5.44

3 years ago

0.5.43

3 years ago

0.5.42

3 years ago

0.5.41

3 years ago

0.5.40

3 years ago

0.5.39

3 years ago

0.5.38

3 years ago

0.5.37

3 years ago

0.5.36

3 years ago

0.5.35

3 years ago

0.5.34

3 years ago

0.5.33

3 years ago

0.5.32

3 years ago

0.5.31

3 years ago

0.5.30

3 years ago

0.5.29

3 years ago

0.5.28

3 years ago

0.5.27

3 years ago

0.5.26

3 years ago

0.5.25

3 years ago

0.5.24

3 years ago

0.5.23

3 years ago

0.5.22

3 years ago

0.5.21

3 years ago

0.5.20

3 years ago

0.5.19

3 years ago

0.5.18

3 years ago

0.5.17

3 years ago

0.5.16

3 years ago

0.5.15

3 years ago

0.5.14

3 years ago

0.5.13

3 years ago

0.5.12

3 years ago

0.5.11

3 years ago

0.5.10

3 years ago

0.5.9

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago