@naturalcycles/abba 1.5.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/abba.d.ts +15 -29
  2. package/dist/abba.js +56 -107
  3. package/dist/dao/bucket.dao.d.ts +5 -0
  4. package/dist/dao/bucket.dao.js +15 -0
  5. package/dist/dao/experiment.dao.d.ts +10 -0
  6. package/dist/dao/experiment.dao.js +19 -0
  7. package/dist/dao/userAssignment.dao.d.ts +5 -0
  8. package/dist/dao/userAssignment.dao.js +15 -0
  9. package/dist/index.d.ts +0 -1
  10. package/dist/index.js +1 -1
  11. package/dist/migrations/init.sql +47 -0
  12. package/dist/types.d.ts +30 -7
  13. package/dist/util.d.ts +5 -5
  14. package/package.json +7 -8
  15. package/readme.md +8 -9
  16. package/src/abba.ts +90 -134
  17. package/src/dao/bucket.dao.ts +13 -0
  18. package/src/dao/experiment.dao.ts +22 -0
  19. package/src/dao/userAssignment.dao.ts +13 -0
  20. package/src/index.ts +0 -3
  21. package/src/migrations/init.sql +47 -0
  22. package/src/types.ts +33 -7
  23. package/src/util.ts +5 -5
  24. package/dist/prisma-output/index-browser.js +0 -141
  25. package/dist/prisma-output/index.d.ts +0 -5521
  26. package/dist/prisma-output/index.js +0 -192
  27. package/dist/prisma-output/libquery_engine-darwin.dylib.node +0 -0
  28. package/dist/prisma-output/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
  29. package/dist/prisma-output/runtime/esm/index-browser.mjs +0 -2370
  30. package/dist/prisma-output/runtime/esm/index.mjs +0 -40587
  31. package/dist/prisma-output/runtime/esm/proxy.mjs +0 -113
  32. package/dist/prisma-output/runtime/index-browser.d.ts +0 -269
  33. package/dist/prisma-output/runtime/index-browser.js +0 -2621
  34. package/dist/prisma-output/runtime/index.d.ts +0 -1373
  35. package/dist/prisma-output/runtime/index.js +0 -52855
  36. package/dist/prisma-output/runtime/proxy.d.ts +0 -1373
  37. package/dist/prisma-output/runtime/proxy.js +0 -13717
  38. package/dist/prisma-output/schema.prisma +0 -47
  39. package/src/prisma-output/index-browser.js +0 -141
  40. package/src/prisma-output/index.d.ts +0 -5521
  41. package/src/prisma-output/index.js +0 -192
  42. package/src/prisma-output/libquery_engine-darwin.dylib.node +0 -0
  43. package/src/prisma-output/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
  44. package/src/prisma-output/runtime/esm/index-browser.mjs +0 -2370
  45. package/src/prisma-output/runtime/esm/index.mjs +0 -40587
  46. package/src/prisma-output/runtime/esm/proxy.mjs +0 -113
  47. package/src/prisma-output/runtime/index-browser.d.ts +0 -269
  48. package/src/prisma-output/runtime/index-browser.js +0 -2621
  49. package/src/prisma-output/runtime/index.d.ts +0 -1373
  50. package/src/prisma-output/runtime/index.js +0 -52855
  51. package/src/prisma-output/runtime/proxy.d.ts +0 -1373
  52. package/src/prisma-output/runtime/proxy.js +0 -13717
  53. package/src/prisma-output/schema.prisma +0 -47
@@ -1,47 +0,0 @@
1
- generator client {
2
- provider = "prisma-client-js"
3
- output = "../src/prisma-output"
4
- binaryTargets = ["native", "darwin", "debian-openssl-1.1.x"]
5
- }
6
-
7
- datasource db {
8
- provider = "mysql"
9
- url = env("ABBA_DB_URL")
10
- }
11
-
12
- model Bucket {
13
- id Int @id @default(autoincrement())
14
- experimentId Int
15
- key String @db.VarChar(10)
16
- ratio Int
17
- createdAt DateTime @default(now())
18
- updatedAt DateTime @updatedAt
19
- experiment Experiment @relation(fields: [experimentId], references: [id], onDelete: Cascade)
20
- userAssignments UserAssignment[]
21
- }
22
-
23
- model Experiment {
24
- id Int @id @default(autoincrement())
25
- name String
26
- status Int
27
- sampling Int
28
- createdAt DateTime @default(now())
29
- updatedAt DateTime @updatedAt
30
- description String? @db.VarChar(240)
31
- rules Json?
32
- buckets Bucket[]
33
- userAssignments UserAssignment[]
34
- }
35
-
36
- model UserAssignment {
37
- id Int @id @default(autoincrement())
38
- userId String
39
- experimentId Int
40
- bucketId Int?
41
- createdAt DateTime @default(now())
42
- updatedAt DateTime @updatedAt
43
- bucket Bucket? @relation(fields: [bucketId], references: [id], onDelete: Cascade)
44
- experiment Experiment @relation(fields: [experimentId], references: [id], onDelete: Cascade)
45
-
46
- @@unique([userId, experimentId])
47
- }
@@ -1,141 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true })
2
-
3
- const { Decimal } = require('./runtime/index-browser')
4
-
5
- const Prisma = {}
6
-
7
- exports.Prisma = Prisma
8
-
9
- /**
10
- * Prisma Client JS version: 3.9.2
11
- * Query Engine version: bcc2ff906db47790ee902e7bbc76d7ffb1893009
12
- */
13
- Prisma.prismaVersion = {
14
- client: '3.9.2',
15
- engine: 'bcc2ff906db47790ee902e7bbc76d7ffb1893009',
16
- }
17
-
18
- Prisma.PrismaClientKnownRequestError = () => {
19
- throw new Error(`PrismaClientKnownRequestError is unable to be run in the browser.
20
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
21
- }
22
- Prisma.PrismaClientUnknownRequestError = () => {
23
- throw new Error(`PrismaClientUnknownRequestError is unable to be run in the browser.
24
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
25
- }
26
- Prisma.PrismaClientRustPanicError = () => {
27
- throw new Error(`PrismaClientRustPanicError is unable to be run in the browser.
28
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
29
- }
30
- Prisma.PrismaClientInitializationError = () => {
31
- throw new Error(`PrismaClientInitializationError is unable to be run in the browser.
32
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
33
- }
34
- Prisma.PrismaClientValidationError = () => {
35
- throw new Error(`PrismaClientValidationError is unable to be run in the browser.
36
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
37
- }
38
- Prisma.Decimal = Decimal
39
-
40
- /**
41
- * Re-export of sql-template-tag
42
- */
43
- Prisma.sql = () => {
44
- throw new Error(`sqltag is unable to be run in the browser.
45
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
46
- }
47
- Prisma.empty = () => {
48
- throw new Error(`empty is unable to be run in the browser.
49
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
50
- }
51
- Prisma.join = () => {
52
- throw new Error(`join is unable to be run in the browser.
53
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
54
- }
55
- Prisma.raw = () => {
56
- throw new Error(`raw is unable to be run in the browser.
57
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`)
58
- }
59
- Prisma.validator = () => val => val
60
-
61
- /**
62
- * Shorthand utilities for JSON filtering
63
- */
64
- Prisma.DbNull = 'DbNull'
65
- Prisma.JsonNull = 'JsonNull'
66
- Prisma.AnyNull = 'AnyNull'
67
-
68
- /**
69
- * Enums
70
- */
71
- // Based on
72
- // https://github.com/microsoft/TypeScript/issues/3192#issuecomment-261720275
73
- function makeEnum(x) {
74
- return x
75
- }
76
-
77
- exports.Prisma.BucketScalarFieldEnum = makeEnum({
78
- id: 'id',
79
- experimentId: 'experimentId',
80
- key: 'key',
81
- ratio: 'ratio',
82
- createdAt: 'createdAt',
83
- updatedAt: 'updatedAt',
84
- })
85
-
86
- exports.Prisma.ExperimentScalarFieldEnum = makeEnum({
87
- id: 'id',
88
- name: 'name',
89
- status: 'status',
90
- sampling: 'sampling',
91
- createdAt: 'createdAt',
92
- updatedAt: 'updatedAt',
93
- description: 'description',
94
- rules: 'rules',
95
- })
96
-
97
- exports.Prisma.UserAssignmentScalarFieldEnum = makeEnum({
98
- id: 'id',
99
- userId: 'userId',
100
- experimentId: 'experimentId',
101
- bucketId: 'bucketId',
102
- createdAt: 'createdAt',
103
- updatedAt: 'updatedAt',
104
- })
105
-
106
- exports.Prisma.SortOrder = makeEnum({
107
- asc: 'asc',
108
- desc: 'desc',
109
- })
110
-
111
- exports.Prisma.NullableJsonNullValueInput = makeEnum({
112
- DbNull: 'DbNull',
113
- JsonNull: 'JsonNull',
114
- })
115
-
116
- exports.Prisma.JsonNullValueFilter = makeEnum({
117
- DbNull: 'DbNull',
118
- JsonNull: 'JsonNull',
119
- AnyNull: 'AnyNull',
120
- })
121
-
122
- exports.Prisma.ModelName = makeEnum({
123
- Bucket: 'Bucket',
124
- Experiment: 'Experiment',
125
- UserAssignment: 'UserAssignment',
126
- })
127
-
128
- /**
129
- * Create the Client
130
- */
131
- class PrismaClient {
132
- constructor() {
133
- throw new Error(
134
- `PrismaClient is unable to be run in the browser.
135
- In case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues`,
136
- )
137
- }
138
- }
139
- exports.PrismaClient = PrismaClient
140
-
141
- Object.assign(exports, Prisma)