@naturalcycles/abba 1.7.0 → 1.9.1

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 (58) hide show
  1. package/dist/abba.d.ts +45 -72
  2. package/dist/abba.js +119 -165
  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 -21
  14. package/dist/util.js +0 -16
  15. package/package.json +9 -9
  16. package/readme.md +14 -15
  17. package/src/abba.ts +160 -191
  18. package/src/dao/bucket.dao.ts +13 -0
  19. package/src/dao/experiment.dao.ts +22 -0
  20. package/src/dao/userAssignment.dao.ts +13 -0
  21. package/src/index.ts +0 -3
  22. package/src/migrations/init.sql +47 -0
  23. package/src/types.ts +41 -7
  24. package/src/util.ts +5 -21
  25. package/dist/prisma-output/index-browser.js +0 -141
  26. package/dist/prisma-output/index.d.ts +0 -5526
  27. package/dist/prisma-output/index.js +0 -217
  28. package/dist/prisma-output/libquery_engine-darwin-arm64.dylib.node +0 -0
  29. package/dist/prisma-output/libquery_engine-darwin.dylib.node +0 -0
  30. package/dist/prisma-output/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
  31. package/dist/prisma-output/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
  32. package/dist/prisma-output/runtime/esm/index-browser.mjs +0 -2370
  33. package/dist/prisma-output/runtime/esm/index.mjs +0 -40587
  34. package/dist/prisma-output/runtime/esm/proxy.mjs +0 -113
  35. package/dist/prisma-output/runtime/index-browser.d.ts +0 -269
  36. package/dist/prisma-output/runtime/index-browser.js +0 -2621
  37. package/dist/prisma-output/runtime/index.d.ts +0 -1384
  38. package/dist/prisma-output/runtime/index.js +0 -59183
  39. package/dist/prisma-output/runtime/proxy.d.ts +0 -1384
  40. package/dist/prisma-output/runtime/proxy.js +0 -13576
  41. package/dist/prisma-output/schema.prisma +0 -47
  42. package/src/prisma-output/index-browser.js +0 -141
  43. package/src/prisma-output/index.d.ts +0 -5526
  44. package/src/prisma-output/index.js +0 -217
  45. package/src/prisma-output/libquery_engine-darwin-arm64.dylib.node +0 -0
  46. package/src/prisma-output/libquery_engine-darwin.dylib.node +0 -0
  47. package/src/prisma-output/libquery_engine-debian-openssl-1.1.x.so.node +0 -0
  48. package/src/prisma-output/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
  49. package/src/prisma-output/runtime/esm/index-browser.mjs +0 -2370
  50. package/src/prisma-output/runtime/esm/index.mjs +0 -40587
  51. package/src/prisma-output/runtime/esm/proxy.mjs +0 -113
  52. package/src/prisma-output/runtime/index-browser.d.ts +0 -269
  53. package/src/prisma-output/runtime/index-browser.js +0 -2621
  54. package/src/prisma-output/runtime/index.d.ts +0 -1384
  55. package/src/prisma-output/runtime/index.js +0 -59183
  56. package/src/prisma-output/runtime/proxy.d.ts +0 -1384
  57. package/src/prisma-output/runtime/proxy.js +0 -13576
  58. 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", "darwin-arm64", "debian-openssl-1.1.x", "debian-openssl-3.0.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.13.0
11
- * Query Engine version: efdf9b1183dddfd4258cd181a72125755215ab7b
12
- */
13
- Prisma.prismaVersion = {
14
- client: '3.13.0',
15
- engine: 'efdf9b1183dddfd4258cd181a72125755215ab7b',
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)