create-signet-app 0.2.2 → 0.4.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 (76) hide show
  1. package/README.md +128 -7
  2. package/package.json +4 -3
  3. package/src/index.ts +338 -66
  4. package/template-api/_github/workflows/ci.yml +0 -3
  5. package/template-api/_mcp/test/mcp-off.test.ts +13 -0
  6. package/template-api/_mcp/test/mcp.test.ts +49 -0
  7. package/template-api/_targets/bun/Dockerfile +13 -0
  8. package/template-api/_targets/bun/_dockerignore +10 -0
  9. package/template-api/_targets/bun/src/server.ts +32 -0
  10. package/template-api/_targets/cloudflare/_github/workflows/ci.yml +24 -0
  11. package/template-api/_targets/cloudflare/src/index.ts +17 -0
  12. package/template-api/_targets/node/src/server.ts +55 -0
  13. package/template-api/_targets/vercel/index.ts +16 -0
  14. package/template-api/_targets/vercel/vercel.json +4 -0
  15. package/template-api/src/app.ts +77 -0
  16. package/template-api/src/env.ts +4 -0
  17. package/template-api/tsconfig.json +2 -1
  18. package/template-api/tsconfig.test.json +1 -1
  19. package/template-full/README.md +155 -0
  20. package/template-full/_github/workflows/ci.yml +22 -0
  21. package/template-full/_gitignore +9 -0
  22. package/template-full/_mcp/test/mcp.test.ts +55 -0
  23. package/template-full/api/app.ts +132 -0
  24. package/template-full/api/db/index.ts +10 -0
  25. package/template-full/api/db/kv.ts +54 -0
  26. package/template-full/api/db/open.ts +33 -0
  27. package/template-full/api/db/schema.ts +57 -0
  28. package/template-full/api/env.ts +44 -0
  29. package/template-full/api/plans.ts +23 -0
  30. package/template-full/api/routes/account.ts +63 -0
  31. package/template-full/api/routes/auth.ts +134 -0
  32. package/template-full/api/routes/billing.ts +44 -0
  33. package/template-full/api/routes/notifications.ts +59 -0
  34. package/template-full/api/routes/privacy.ts +52 -0
  35. package/template-full/api/server.ts +44 -0
  36. package/template-full/api/services.ts +185 -0
  37. package/template-full/biome.json +50 -0
  38. package/template-full/drizzle/0000_init.sql +155 -0
  39. package/template-full/drizzle/0001_orgs.sql +47 -0
  40. package/template-full/drizzle/meta/0000_snapshot.json +974 -0
  41. package/template-full/drizzle/meta/0001_snapshot.json +1270 -0
  42. package/template-full/drizzle/meta/_journal.json +20 -0
  43. package/template-full/drizzle.config.ts +9 -0
  44. package/template-full/e2e/smoke.spec.ts +152 -0
  45. package/template-full/index.html +17 -0
  46. package/template-full/playwright.config.ts +10 -0
  47. package/template-full/scripts/dev.ts +17 -0
  48. package/template-full/src/app.css +9 -0
  49. package/template-full/src/components/toaster.tsx +13 -0
  50. package/template-full/src/lib/api.ts +40 -0
  51. package/template-full/src/main.tsx +36 -0
  52. package/template-full/src/routeTree.gen.ts +297 -0
  53. package/template-full/src/router.test.ts +23 -0
  54. package/template-full/src/router.ts +17 -0
  55. package/template-full/src/routes/__root.tsx +9 -0
  56. package/template-full/src/routes/_app/account.tsx +64 -0
  57. package/template-full/src/routes/_app/admin.tsx +38 -0
  58. package/template-full/src/routes/_app/billing.tsx +40 -0
  59. package/template-full/src/routes/_app/index.tsx +33 -0
  60. package/template-full/src/routes/_app/notifications.tsx +72 -0
  61. package/template-full/src/routes/_app/org/index.tsx +38 -0
  62. package/template-full/src/routes/_app/org/members.tsx +86 -0
  63. package/template-full/src/routes/_app/org/new.tsx +45 -0
  64. package/template-full/src/routes/_app/privacy.tsx +48 -0
  65. package/template-full/src/routes/_app.tsx +88 -0
  66. package/template-full/src/routes/invite.$token.tsx +55 -0
  67. package/template-full/src/routes/login.tsx +36 -0
  68. package/template-full/test/api.test.ts +189 -0
  69. package/template-full/tsconfig.api.json +19 -0
  70. package/template-full/tsconfig.app.json +26 -0
  71. package/template-full/tsconfig.json +9 -0
  72. package/template-full/tsconfig.node.json +16 -0
  73. package/template-full/tsconfig.test.json +8 -0
  74. package/template-full/vite.config.ts +24 -0
  75. package/template-api/src/index.ts +0 -55
  76. /package/template-api/{wrangler.jsonc → _targets/cloudflare/wrangler.jsonc} +0 -0
@@ -0,0 +1,1270 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "e21e1d59-fb09-4f21-af12-4dcef6660787",
5
+ "prevId": "9a47dc76-d4a8-4df9-acc3-fc9cf47df999",
6
+ "tables": {
7
+ "audit_log": {
8
+ "name": "audit_log",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "at": {
18
+ "name": "at",
19
+ "type": "integer",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false,
23
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
24
+ },
25
+ "actor_type": {
26
+ "name": "actor_type",
27
+ "type": "text",
28
+ "primaryKey": false,
29
+ "notNull": true,
30
+ "autoincrement": false
31
+ },
32
+ "actor_id": {
33
+ "name": "actor_id",
34
+ "type": "text",
35
+ "primaryKey": false,
36
+ "notNull": true,
37
+ "autoincrement": false
38
+ },
39
+ "action": {
40
+ "name": "action",
41
+ "type": "text",
42
+ "primaryKey": false,
43
+ "notNull": true,
44
+ "autoincrement": false
45
+ },
46
+ "table_name": {
47
+ "name": "table_name",
48
+ "type": "text",
49
+ "primaryKey": false,
50
+ "notNull": true,
51
+ "autoincrement": false
52
+ },
53
+ "row_id": {
54
+ "name": "row_id",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": false,
58
+ "autoincrement": false
59
+ },
60
+ "before": {
61
+ "name": "before",
62
+ "type": "text",
63
+ "primaryKey": false,
64
+ "notNull": false,
65
+ "autoincrement": false
66
+ },
67
+ "after": {
68
+ "name": "after",
69
+ "type": "text",
70
+ "primaryKey": false,
71
+ "notNull": false,
72
+ "autoincrement": false
73
+ }
74
+ },
75
+ "indexes": {},
76
+ "foreignKeys": {},
77
+ "compositePrimaryKeys": {},
78
+ "uniqueConstraints": {},
79
+ "checkConstraints": {}
80
+ },
81
+ "consents": {
82
+ "name": "consents",
83
+ "columns": {
84
+ "id": {
85
+ "name": "id",
86
+ "type": "text",
87
+ "primaryKey": true,
88
+ "notNull": true,
89
+ "autoincrement": false
90
+ },
91
+ "subject": {
92
+ "name": "subject",
93
+ "type": "text",
94
+ "primaryKey": false,
95
+ "notNull": true,
96
+ "autoincrement": false
97
+ },
98
+ "purpose": {
99
+ "name": "purpose",
100
+ "type": "text",
101
+ "primaryKey": false,
102
+ "notNull": true,
103
+ "autoincrement": false
104
+ },
105
+ "notice_version": {
106
+ "name": "notice_version",
107
+ "type": "text",
108
+ "primaryKey": false,
109
+ "notNull": true,
110
+ "autoincrement": false
111
+ },
112
+ "source": {
113
+ "name": "source",
114
+ "type": "text",
115
+ "primaryKey": false,
116
+ "notNull": false,
117
+ "autoincrement": false
118
+ },
119
+ "given_at": {
120
+ "name": "given_at",
121
+ "type": "integer",
122
+ "primaryKey": false,
123
+ "notNull": true,
124
+ "autoincrement": false
125
+ },
126
+ "withdrawn_at": {
127
+ "name": "withdrawn_at",
128
+ "type": "integer",
129
+ "primaryKey": false,
130
+ "notNull": false,
131
+ "autoincrement": false
132
+ }
133
+ },
134
+ "indexes": {
135
+ "consents_subject": {
136
+ "name": "consents_subject",
137
+ "columns": [
138
+ "subject",
139
+ "purpose"
140
+ ],
141
+ "isUnique": false
142
+ }
143
+ },
144
+ "foreignKeys": {},
145
+ "compositePrimaryKeys": {},
146
+ "uniqueConstraints": {},
147
+ "checkConstraints": {}
148
+ },
149
+ "data_requests": {
150
+ "name": "data_requests",
151
+ "columns": {
152
+ "id": {
153
+ "name": "id",
154
+ "type": "text",
155
+ "primaryKey": true,
156
+ "notNull": true,
157
+ "autoincrement": false
158
+ },
159
+ "subject": {
160
+ "name": "subject",
161
+ "type": "text",
162
+ "primaryKey": false,
163
+ "notNull": true,
164
+ "autoincrement": false
165
+ },
166
+ "kind": {
167
+ "name": "kind",
168
+ "type": "text",
169
+ "primaryKey": false,
170
+ "notNull": true,
171
+ "autoincrement": false
172
+ },
173
+ "status": {
174
+ "name": "status",
175
+ "type": "text",
176
+ "primaryKey": false,
177
+ "notNull": true,
178
+ "autoincrement": false,
179
+ "default": "'pending'"
180
+ },
181
+ "requested_at": {
182
+ "name": "requested_at",
183
+ "type": "integer",
184
+ "primaryKey": false,
185
+ "notNull": true,
186
+ "autoincrement": false
187
+ },
188
+ "due_at": {
189
+ "name": "due_at",
190
+ "type": "integer",
191
+ "primaryKey": false,
192
+ "notNull": false,
193
+ "autoincrement": false
194
+ },
195
+ "closed_at": {
196
+ "name": "closed_at",
197
+ "type": "integer",
198
+ "primaryKey": false,
199
+ "notNull": false,
200
+ "autoincrement": false
201
+ },
202
+ "closed_by": {
203
+ "name": "closed_by",
204
+ "type": "text",
205
+ "primaryKey": false,
206
+ "notNull": false,
207
+ "autoincrement": false
208
+ },
209
+ "note": {
210
+ "name": "note",
211
+ "type": "text",
212
+ "primaryKey": false,
213
+ "notNull": false,
214
+ "autoincrement": false
215
+ },
216
+ "result": {
217
+ "name": "result",
218
+ "type": "text",
219
+ "primaryKey": false,
220
+ "notNull": false,
221
+ "autoincrement": false
222
+ }
223
+ },
224
+ "indexes": {
225
+ "data_requests_subject": {
226
+ "name": "data_requests_subject",
227
+ "columns": [
228
+ "subject"
229
+ ],
230
+ "isUnique": false
231
+ }
232
+ },
233
+ "foreignKeys": {},
234
+ "compositePrimaryKeys": {},
235
+ "uniqueConstraints": {},
236
+ "checkConstraints": {}
237
+ },
238
+ "entitlement_overrides": {
239
+ "name": "entitlement_overrides",
240
+ "columns": {
241
+ "id": {
242
+ "name": "id",
243
+ "type": "text",
244
+ "primaryKey": true,
245
+ "notNull": true,
246
+ "autoincrement": false
247
+ },
248
+ "subject": {
249
+ "name": "subject",
250
+ "type": "text",
251
+ "primaryKey": false,
252
+ "notNull": true,
253
+ "autoincrement": false
254
+ },
255
+ "kind": {
256
+ "name": "kind",
257
+ "type": "text",
258
+ "primaryKey": false,
259
+ "notNull": true,
260
+ "autoincrement": false
261
+ },
262
+ "key": {
263
+ "name": "key",
264
+ "type": "text",
265
+ "primaryKey": false,
266
+ "notNull": true,
267
+ "autoincrement": false
268
+ },
269
+ "value": {
270
+ "name": "value",
271
+ "type": "integer",
272
+ "primaryKey": false,
273
+ "notNull": false,
274
+ "autoincrement": false
275
+ },
276
+ "expires_at": {
277
+ "name": "expires_at",
278
+ "type": "integer",
279
+ "primaryKey": false,
280
+ "notNull": false,
281
+ "autoincrement": false
282
+ },
283
+ "created_at": {
284
+ "name": "created_at",
285
+ "type": "integer",
286
+ "primaryKey": false,
287
+ "notNull": true,
288
+ "autoincrement": false,
289
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
290
+ }
291
+ },
292
+ "indexes": {
293
+ "entitlement_overrides_subject": {
294
+ "name": "entitlement_overrides_subject",
295
+ "columns": [
296
+ "subject"
297
+ ],
298
+ "isUnique": false
299
+ }
300
+ },
301
+ "foreignKeys": {},
302
+ "compositePrimaryKeys": {},
303
+ "uniqueConstraints": {},
304
+ "checkConstraints": {}
305
+ },
306
+ "feedback": {
307
+ "name": "feedback",
308
+ "columns": {
309
+ "id": {
310
+ "name": "id",
311
+ "type": "text",
312
+ "primaryKey": true,
313
+ "notNull": true,
314
+ "autoincrement": false
315
+ },
316
+ "subject": {
317
+ "name": "subject",
318
+ "type": "text",
319
+ "primaryKey": false,
320
+ "notNull": false,
321
+ "autoincrement": false
322
+ },
323
+ "kind": {
324
+ "name": "kind",
325
+ "type": "text",
326
+ "primaryKey": false,
327
+ "notNull": true,
328
+ "autoincrement": false
329
+ },
330
+ "message": {
331
+ "name": "message",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": true,
335
+ "autoincrement": false
336
+ },
337
+ "rating": {
338
+ "name": "rating",
339
+ "type": "integer",
340
+ "primaryKey": false,
341
+ "notNull": false,
342
+ "autoincrement": false
343
+ },
344
+ "page": {
345
+ "name": "page",
346
+ "type": "text",
347
+ "primaryKey": false,
348
+ "notNull": false,
349
+ "autoincrement": false
350
+ },
351
+ "meta": {
352
+ "name": "meta",
353
+ "type": "text",
354
+ "primaryKey": false,
355
+ "notNull": false,
356
+ "autoincrement": false
357
+ },
358
+ "status": {
359
+ "name": "status",
360
+ "type": "text",
361
+ "primaryKey": false,
362
+ "notNull": true,
363
+ "autoincrement": false,
364
+ "default": "'new'"
365
+ },
366
+ "created_at": {
367
+ "name": "created_at",
368
+ "type": "integer",
369
+ "primaryKey": false,
370
+ "notNull": true,
371
+ "autoincrement": false,
372
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
373
+ }
374
+ },
375
+ "indexes": {},
376
+ "foreignKeys": {},
377
+ "compositePrimaryKeys": {},
378
+ "uniqueConstraints": {},
379
+ "checkConstraints": {}
380
+ },
381
+ "idempotency_keys": {
382
+ "name": "idempotency_keys",
383
+ "columns": {
384
+ "scope": {
385
+ "name": "scope",
386
+ "type": "text",
387
+ "primaryKey": false,
388
+ "notNull": true,
389
+ "autoincrement": false
390
+ },
391
+ "key": {
392
+ "name": "key",
393
+ "type": "text",
394
+ "primaryKey": false,
395
+ "notNull": true,
396
+ "autoincrement": false
397
+ },
398
+ "status": {
399
+ "name": "status",
400
+ "type": "text",
401
+ "primaryKey": false,
402
+ "notNull": true,
403
+ "autoincrement": false
404
+ },
405
+ "result": {
406
+ "name": "result",
407
+ "type": "text",
408
+ "primaryKey": false,
409
+ "notNull": false,
410
+ "autoincrement": false
411
+ },
412
+ "created_at": {
413
+ "name": "created_at",
414
+ "type": "integer",
415
+ "primaryKey": false,
416
+ "notNull": true,
417
+ "autoincrement": false,
418
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
419
+ },
420
+ "expires_at": {
421
+ "name": "expires_at",
422
+ "type": "integer",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "autoincrement": false
426
+ }
427
+ },
428
+ "indexes": {},
429
+ "foreignKeys": {},
430
+ "compositePrimaryKeys": {
431
+ "idempotency_keys_scope_key_pk": {
432
+ "columns": [
433
+ "scope",
434
+ "key"
435
+ ],
436
+ "name": "idempotency_keys_scope_key_pk"
437
+ }
438
+ },
439
+ "uniqueConstraints": {},
440
+ "checkConstraints": {}
441
+ },
442
+ "invitations": {
443
+ "name": "invitations",
444
+ "columns": {
445
+ "id": {
446
+ "name": "id",
447
+ "type": "text",
448
+ "primaryKey": true,
449
+ "notNull": true,
450
+ "autoincrement": false
451
+ },
452
+ "org_id": {
453
+ "name": "org_id",
454
+ "type": "text",
455
+ "primaryKey": false,
456
+ "notNull": true,
457
+ "autoincrement": false
458
+ },
459
+ "token_hash": {
460
+ "name": "token_hash",
461
+ "type": "text",
462
+ "primaryKey": false,
463
+ "notNull": true,
464
+ "autoincrement": false
465
+ },
466
+ "email": {
467
+ "name": "email",
468
+ "type": "text",
469
+ "primaryKey": false,
470
+ "notNull": false,
471
+ "autoincrement": false
472
+ },
473
+ "role": {
474
+ "name": "role",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true,
478
+ "autoincrement": false
479
+ },
480
+ "invited_by": {
481
+ "name": "invited_by",
482
+ "type": "text",
483
+ "primaryKey": false,
484
+ "notNull": true,
485
+ "autoincrement": false
486
+ },
487
+ "created_at": {
488
+ "name": "created_at",
489
+ "type": "integer",
490
+ "primaryKey": false,
491
+ "notNull": true,
492
+ "autoincrement": false,
493
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
494
+ },
495
+ "expires_at": {
496
+ "name": "expires_at",
497
+ "type": "integer",
498
+ "primaryKey": false,
499
+ "notNull": true,
500
+ "autoincrement": false
501
+ },
502
+ "accepted_at": {
503
+ "name": "accepted_at",
504
+ "type": "integer",
505
+ "primaryKey": false,
506
+ "notNull": false,
507
+ "autoincrement": false
508
+ },
509
+ "accepted_by": {
510
+ "name": "accepted_by",
511
+ "type": "text",
512
+ "primaryKey": false,
513
+ "notNull": false,
514
+ "autoincrement": false
515
+ },
516
+ "revoked_at": {
517
+ "name": "revoked_at",
518
+ "type": "integer",
519
+ "primaryKey": false,
520
+ "notNull": false,
521
+ "autoincrement": false
522
+ }
523
+ },
524
+ "indexes": {
525
+ "invitations_token": {
526
+ "name": "invitations_token",
527
+ "columns": [
528
+ "token_hash"
529
+ ],
530
+ "isUnique": true
531
+ },
532
+ "invitations_org": {
533
+ "name": "invitations_org",
534
+ "columns": [
535
+ "org_id"
536
+ ],
537
+ "isUnique": false
538
+ }
539
+ },
540
+ "foreignKeys": {},
541
+ "compositePrimaryKeys": {},
542
+ "uniqueConstraints": {},
543
+ "checkConstraints": {}
544
+ },
545
+ "invites": {
546
+ "name": "invites",
547
+ "columns": {
548
+ "id": {
549
+ "name": "id",
550
+ "type": "text",
551
+ "primaryKey": true,
552
+ "notNull": true,
553
+ "autoincrement": false
554
+ },
555
+ "token_hash": {
556
+ "name": "token_hash",
557
+ "type": "text",
558
+ "primaryKey": false,
559
+ "notNull": true,
560
+ "autoincrement": false
561
+ },
562
+ "email": {
563
+ "name": "email",
564
+ "type": "text",
565
+ "primaryKey": false,
566
+ "notNull": false,
567
+ "autoincrement": false
568
+ },
569
+ "invited_by": {
570
+ "name": "invited_by",
571
+ "type": "text",
572
+ "primaryKey": false,
573
+ "notNull": true,
574
+ "autoincrement": false
575
+ },
576
+ "scope": {
577
+ "name": "scope",
578
+ "type": "text",
579
+ "primaryKey": false,
580
+ "notNull": false,
581
+ "autoincrement": false
582
+ },
583
+ "role": {
584
+ "name": "role",
585
+ "type": "text",
586
+ "primaryKey": false,
587
+ "notNull": false,
588
+ "autoincrement": false
589
+ },
590
+ "created_at": {
591
+ "name": "created_at",
592
+ "type": "integer",
593
+ "primaryKey": false,
594
+ "notNull": true,
595
+ "autoincrement": false,
596
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
597
+ },
598
+ "expires_at": {
599
+ "name": "expires_at",
600
+ "type": "integer",
601
+ "primaryKey": false,
602
+ "notNull": true,
603
+ "autoincrement": false
604
+ },
605
+ "accepted_at": {
606
+ "name": "accepted_at",
607
+ "type": "integer",
608
+ "primaryKey": false,
609
+ "notNull": false,
610
+ "autoincrement": false
611
+ },
612
+ "accepted_by": {
613
+ "name": "accepted_by",
614
+ "type": "text",
615
+ "primaryKey": false,
616
+ "notNull": false,
617
+ "autoincrement": false
618
+ },
619
+ "revoked_at": {
620
+ "name": "revoked_at",
621
+ "type": "integer",
622
+ "primaryKey": false,
623
+ "notNull": false,
624
+ "autoincrement": false
625
+ }
626
+ },
627
+ "indexes": {
628
+ "invites_token": {
629
+ "name": "invites_token",
630
+ "columns": [
631
+ "token_hash"
632
+ ],
633
+ "isUnique": true
634
+ }
635
+ },
636
+ "foreignKeys": {},
637
+ "compositePrimaryKeys": {},
638
+ "uniqueConstraints": {},
639
+ "checkConstraints": {}
640
+ },
641
+ "kv": {
642
+ "name": "kv",
643
+ "columns": {
644
+ "key": {
645
+ "name": "key",
646
+ "type": "text",
647
+ "primaryKey": true,
648
+ "notNull": true,
649
+ "autoincrement": false
650
+ },
651
+ "value": {
652
+ "name": "value",
653
+ "type": "text",
654
+ "primaryKey": false,
655
+ "notNull": true,
656
+ "autoincrement": false
657
+ },
658
+ "expires_at": {
659
+ "name": "expires_at",
660
+ "type": "integer",
661
+ "primaryKey": false,
662
+ "notNull": false,
663
+ "autoincrement": false
664
+ }
665
+ },
666
+ "indexes": {},
667
+ "foreignKeys": {},
668
+ "compositePrimaryKeys": {},
669
+ "uniqueConstraints": {},
670
+ "checkConstraints": {}
671
+ },
672
+ "marks": {
673
+ "name": "marks",
674
+ "columns": {
675
+ "subject": {
676
+ "name": "subject",
677
+ "type": "text",
678
+ "primaryKey": false,
679
+ "notNull": true,
680
+ "autoincrement": false
681
+ },
682
+ "key": {
683
+ "name": "key",
684
+ "type": "text",
685
+ "primaryKey": false,
686
+ "notNull": true,
687
+ "autoincrement": false
688
+ },
689
+ "at": {
690
+ "name": "at",
691
+ "type": "integer",
692
+ "primaryKey": false,
693
+ "notNull": true,
694
+ "autoincrement": false,
695
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
696
+ }
697
+ },
698
+ "indexes": {},
699
+ "foreignKeys": {},
700
+ "compositePrimaryKeys": {
701
+ "marks_subject_key_pk": {
702
+ "columns": [
703
+ "subject",
704
+ "key"
705
+ ],
706
+ "name": "marks_subject_key_pk"
707
+ }
708
+ },
709
+ "uniqueConstraints": {},
710
+ "checkConstraints": {}
711
+ },
712
+ "memberships": {
713
+ "name": "memberships",
714
+ "columns": {
715
+ "org_id": {
716
+ "name": "org_id",
717
+ "type": "text",
718
+ "primaryKey": false,
719
+ "notNull": true,
720
+ "autoincrement": false
721
+ },
722
+ "user_id": {
723
+ "name": "user_id",
724
+ "type": "text",
725
+ "primaryKey": false,
726
+ "notNull": true,
727
+ "autoincrement": false
728
+ },
729
+ "role": {
730
+ "name": "role",
731
+ "type": "text",
732
+ "primaryKey": false,
733
+ "notNull": true,
734
+ "autoincrement": false
735
+ },
736
+ "created_at": {
737
+ "name": "created_at",
738
+ "type": "integer",
739
+ "primaryKey": false,
740
+ "notNull": true,
741
+ "autoincrement": false,
742
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
743
+ }
744
+ },
745
+ "indexes": {
746
+ "memberships_user": {
747
+ "name": "memberships_user",
748
+ "columns": [
749
+ "user_id"
750
+ ],
751
+ "isUnique": false
752
+ }
753
+ },
754
+ "foreignKeys": {},
755
+ "compositePrimaryKeys": {
756
+ "memberships_org_id_user_id_pk": {
757
+ "columns": [
758
+ "org_id",
759
+ "user_id"
760
+ ],
761
+ "name": "memberships_org_id_user_id_pk"
762
+ }
763
+ },
764
+ "uniqueConstraints": {},
765
+ "checkConstraints": {}
766
+ },
767
+ "org_roles": {
768
+ "name": "org_roles",
769
+ "columns": {
770
+ "org_id": {
771
+ "name": "org_id",
772
+ "type": "text",
773
+ "primaryKey": false,
774
+ "notNull": true,
775
+ "autoincrement": false
776
+ },
777
+ "name": {
778
+ "name": "name",
779
+ "type": "text",
780
+ "primaryKey": false,
781
+ "notNull": true,
782
+ "autoincrement": false
783
+ },
784
+ "permissions": {
785
+ "name": "permissions",
786
+ "type": "text",
787
+ "primaryKey": false,
788
+ "notNull": true,
789
+ "autoincrement": false
790
+ },
791
+ "updated_at": {
792
+ "name": "updated_at",
793
+ "type": "integer",
794
+ "primaryKey": false,
795
+ "notNull": true,
796
+ "autoincrement": false,
797
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
798
+ }
799
+ },
800
+ "indexes": {},
801
+ "foreignKeys": {},
802
+ "compositePrimaryKeys": {
803
+ "org_roles_org_id_name_pk": {
804
+ "columns": [
805
+ "org_id",
806
+ "name"
807
+ ],
808
+ "name": "org_roles_org_id_name_pk"
809
+ }
810
+ },
811
+ "uniqueConstraints": {},
812
+ "checkConstraints": {}
813
+ },
814
+ "organizations": {
815
+ "name": "organizations",
816
+ "columns": {
817
+ "id": {
818
+ "name": "id",
819
+ "type": "text",
820
+ "primaryKey": true,
821
+ "notNull": true,
822
+ "autoincrement": false
823
+ },
824
+ "name": {
825
+ "name": "name",
826
+ "type": "text",
827
+ "primaryKey": false,
828
+ "notNull": true,
829
+ "autoincrement": false
830
+ },
831
+ "slug": {
832
+ "name": "slug",
833
+ "type": "text",
834
+ "primaryKey": false,
835
+ "notNull": true,
836
+ "autoincrement": false
837
+ },
838
+ "domain": {
839
+ "name": "domain",
840
+ "type": "text",
841
+ "primaryKey": false,
842
+ "notNull": false,
843
+ "autoincrement": false
844
+ },
845
+ "theme": {
846
+ "name": "theme",
847
+ "type": "text",
848
+ "primaryKey": false,
849
+ "notNull": false,
850
+ "autoincrement": false
851
+ },
852
+ "brand_color": {
853
+ "name": "brand_color",
854
+ "type": "text",
855
+ "primaryKey": false,
856
+ "notNull": false,
857
+ "autoincrement": false
858
+ },
859
+ "personal": {
860
+ "name": "personal",
861
+ "type": "integer",
862
+ "primaryKey": false,
863
+ "notNull": true,
864
+ "autoincrement": false,
865
+ "default": false
866
+ },
867
+ "created_at": {
868
+ "name": "created_at",
869
+ "type": "integer",
870
+ "primaryKey": false,
871
+ "notNull": true,
872
+ "autoincrement": false,
873
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
874
+ },
875
+ "updated_at": {
876
+ "name": "updated_at",
877
+ "type": "integer",
878
+ "primaryKey": false,
879
+ "notNull": true,
880
+ "autoincrement": false,
881
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
882
+ }
883
+ },
884
+ "indexes": {
885
+ "organizations_slug": {
886
+ "name": "organizations_slug",
887
+ "columns": [
888
+ "slug"
889
+ ],
890
+ "isUnique": true
891
+ },
892
+ "organizations_domain": {
893
+ "name": "organizations_domain",
894
+ "columns": [
895
+ "domain"
896
+ ],
897
+ "isUnique": true
898
+ }
899
+ },
900
+ "foreignKeys": {},
901
+ "compositePrimaryKeys": {},
902
+ "uniqueConstraints": {},
903
+ "checkConstraints": {}
904
+ },
905
+ "referral_codes": {
906
+ "name": "referral_codes",
907
+ "columns": {
908
+ "subject": {
909
+ "name": "subject",
910
+ "type": "text",
911
+ "primaryKey": true,
912
+ "notNull": true,
913
+ "autoincrement": false
914
+ },
915
+ "code": {
916
+ "name": "code",
917
+ "type": "text",
918
+ "primaryKey": false,
919
+ "notNull": true,
920
+ "autoincrement": false
921
+ },
922
+ "created_at": {
923
+ "name": "created_at",
924
+ "type": "integer",
925
+ "primaryKey": false,
926
+ "notNull": true,
927
+ "autoincrement": false,
928
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
929
+ }
930
+ },
931
+ "indexes": {
932
+ "referral_codes_code": {
933
+ "name": "referral_codes_code",
934
+ "columns": [
935
+ "code"
936
+ ],
937
+ "isUnique": true
938
+ }
939
+ },
940
+ "foreignKeys": {},
941
+ "compositePrimaryKeys": {},
942
+ "uniqueConstraints": {},
943
+ "checkConstraints": {}
944
+ },
945
+ "referrals": {
946
+ "name": "referrals",
947
+ "columns": {
948
+ "referee": {
949
+ "name": "referee",
950
+ "type": "text",
951
+ "primaryKey": true,
952
+ "notNull": true,
953
+ "autoincrement": false
954
+ },
955
+ "referrer": {
956
+ "name": "referrer",
957
+ "type": "text",
958
+ "primaryKey": false,
959
+ "notNull": true,
960
+ "autoincrement": false
961
+ },
962
+ "code": {
963
+ "name": "code",
964
+ "type": "text",
965
+ "primaryKey": false,
966
+ "notNull": true,
967
+ "autoincrement": false
968
+ },
969
+ "created_at": {
970
+ "name": "created_at",
971
+ "type": "integer",
972
+ "primaryKey": false,
973
+ "notNull": true,
974
+ "autoincrement": false,
975
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
976
+ },
977
+ "converted_at": {
978
+ "name": "converted_at",
979
+ "type": "integer",
980
+ "primaryKey": false,
981
+ "notNull": false,
982
+ "autoincrement": false
983
+ },
984
+ "rewarded_at": {
985
+ "name": "rewarded_at",
986
+ "type": "integer",
987
+ "primaryKey": false,
988
+ "notNull": false,
989
+ "autoincrement": false
990
+ }
991
+ },
992
+ "indexes": {
993
+ "referrals_referrer": {
994
+ "name": "referrals_referrer",
995
+ "columns": [
996
+ "referrer"
997
+ ],
998
+ "isUnique": false
999
+ }
1000
+ },
1001
+ "foreignKeys": {},
1002
+ "compositePrimaryKeys": {},
1003
+ "uniqueConstraints": {},
1004
+ "checkConstraints": {}
1005
+ },
1006
+ "subject_plans": {
1007
+ "name": "subject_plans",
1008
+ "columns": {
1009
+ "id": {
1010
+ "name": "id",
1011
+ "type": "text",
1012
+ "primaryKey": true,
1013
+ "notNull": true,
1014
+ "autoincrement": false
1015
+ },
1016
+ "subject": {
1017
+ "name": "subject",
1018
+ "type": "text",
1019
+ "primaryKey": false,
1020
+ "notNull": true,
1021
+ "autoincrement": false
1022
+ },
1023
+ "plan": {
1024
+ "name": "plan",
1025
+ "type": "text",
1026
+ "primaryKey": false,
1027
+ "notNull": true,
1028
+ "autoincrement": false
1029
+ },
1030
+ "status": {
1031
+ "name": "status",
1032
+ "type": "text",
1033
+ "primaryKey": false,
1034
+ "notNull": true,
1035
+ "autoincrement": false
1036
+ },
1037
+ "gateway": {
1038
+ "name": "gateway",
1039
+ "type": "text",
1040
+ "primaryKey": false,
1041
+ "notNull": true,
1042
+ "autoincrement": false
1043
+ },
1044
+ "subscription_id": {
1045
+ "name": "subscription_id",
1046
+ "type": "text",
1047
+ "primaryKey": false,
1048
+ "notNull": true,
1049
+ "autoincrement": false
1050
+ },
1051
+ "current_period_end": {
1052
+ "name": "current_period_end",
1053
+ "type": "integer",
1054
+ "primaryKey": false,
1055
+ "notNull": false,
1056
+ "autoincrement": false
1057
+ },
1058
+ "grace_until": {
1059
+ "name": "grace_until",
1060
+ "type": "integer",
1061
+ "primaryKey": false,
1062
+ "notNull": false,
1063
+ "autoincrement": false
1064
+ },
1065
+ "event_at": {
1066
+ "name": "event_at",
1067
+ "type": "integer",
1068
+ "primaryKey": false,
1069
+ "notNull": true,
1070
+ "autoincrement": false
1071
+ },
1072
+ "updated_at": {
1073
+ "name": "updated_at",
1074
+ "type": "integer",
1075
+ "primaryKey": false,
1076
+ "notNull": true,
1077
+ "autoincrement": false,
1078
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
1079
+ }
1080
+ },
1081
+ "indexes": {
1082
+ "subject_plans_subject": {
1083
+ "name": "subject_plans_subject",
1084
+ "columns": [
1085
+ "subject"
1086
+ ],
1087
+ "isUnique": false
1088
+ }
1089
+ },
1090
+ "foreignKeys": {},
1091
+ "compositePrimaryKeys": {},
1092
+ "uniqueConstraints": {},
1093
+ "checkConstraints": {}
1094
+ },
1095
+ "usage_counters": {
1096
+ "name": "usage_counters",
1097
+ "columns": {
1098
+ "subject": {
1099
+ "name": "subject",
1100
+ "type": "text",
1101
+ "primaryKey": false,
1102
+ "notNull": true,
1103
+ "autoincrement": false
1104
+ },
1105
+ "key": {
1106
+ "name": "key",
1107
+ "type": "text",
1108
+ "primaryKey": false,
1109
+ "notNull": true,
1110
+ "autoincrement": false
1111
+ },
1112
+ "period": {
1113
+ "name": "period",
1114
+ "type": "text",
1115
+ "primaryKey": false,
1116
+ "notNull": true,
1117
+ "autoincrement": false
1118
+ },
1119
+ "used": {
1120
+ "name": "used",
1121
+ "type": "integer",
1122
+ "primaryKey": false,
1123
+ "notNull": true,
1124
+ "autoincrement": false,
1125
+ "default": 0
1126
+ }
1127
+ },
1128
+ "indexes": {},
1129
+ "foreignKeys": {},
1130
+ "compositePrimaryKeys": {
1131
+ "usage_counters_subject_key_period_pk": {
1132
+ "columns": [
1133
+ "subject",
1134
+ "key",
1135
+ "period"
1136
+ ],
1137
+ "name": "usage_counters_subject_key_period_pk"
1138
+ }
1139
+ },
1140
+ "uniqueConstraints": {},
1141
+ "checkConstraints": {}
1142
+ },
1143
+ "users": {
1144
+ "name": "users",
1145
+ "columns": {
1146
+ "id": {
1147
+ "name": "id",
1148
+ "type": "text",
1149
+ "primaryKey": true,
1150
+ "notNull": true,
1151
+ "autoincrement": false
1152
+ },
1153
+ "phone": {
1154
+ "name": "phone",
1155
+ "type": "text",
1156
+ "primaryKey": false,
1157
+ "notNull": true,
1158
+ "autoincrement": false
1159
+ },
1160
+ "name": {
1161
+ "name": "name",
1162
+ "type": "text",
1163
+ "primaryKey": false,
1164
+ "notNull": false,
1165
+ "autoincrement": false
1166
+ },
1167
+ "email": {
1168
+ "name": "email",
1169
+ "type": "text",
1170
+ "primaryKey": false,
1171
+ "notNull": false,
1172
+ "autoincrement": false
1173
+ },
1174
+ "role": {
1175
+ "name": "role",
1176
+ "type": "text",
1177
+ "primaryKey": false,
1178
+ "notNull": true,
1179
+ "autoincrement": false,
1180
+ "default": "'user'"
1181
+ },
1182
+ "created_at": {
1183
+ "name": "created_at",
1184
+ "type": "integer",
1185
+ "primaryKey": false,
1186
+ "notNull": true,
1187
+ "autoincrement": false,
1188
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
1189
+ },
1190
+ "updated_at": {
1191
+ "name": "updated_at",
1192
+ "type": "integer",
1193
+ "primaryKey": false,
1194
+ "notNull": true,
1195
+ "autoincrement": false,
1196
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
1197
+ }
1198
+ },
1199
+ "indexes": {
1200
+ "users_phone_unique": {
1201
+ "name": "users_phone_unique",
1202
+ "columns": [
1203
+ "phone"
1204
+ ],
1205
+ "isUnique": true
1206
+ }
1207
+ },
1208
+ "foreignKeys": {},
1209
+ "compositePrimaryKeys": {},
1210
+ "uniqueConstraints": {},
1211
+ "checkConstraints": {}
1212
+ },
1213
+ "waitlist": {
1214
+ "name": "waitlist",
1215
+ "columns": {
1216
+ "email": {
1217
+ "name": "email",
1218
+ "type": "text",
1219
+ "primaryKey": true,
1220
+ "notNull": true,
1221
+ "autoincrement": false
1222
+ },
1223
+ "source": {
1224
+ "name": "source",
1225
+ "type": "text",
1226
+ "primaryKey": false,
1227
+ "notNull": false,
1228
+ "autoincrement": false
1229
+ },
1230
+ "referral_code": {
1231
+ "name": "referral_code",
1232
+ "type": "text",
1233
+ "primaryKey": false,
1234
+ "notNull": false,
1235
+ "autoincrement": false
1236
+ },
1237
+ "created_at": {
1238
+ "name": "created_at",
1239
+ "type": "integer",
1240
+ "primaryKey": false,
1241
+ "notNull": true,
1242
+ "autoincrement": false,
1243
+ "default": "(cast((julianday('now') - 2440587.5) * 86400000 as integer))"
1244
+ },
1245
+ "invited_at": {
1246
+ "name": "invited_at",
1247
+ "type": "integer",
1248
+ "primaryKey": false,
1249
+ "notNull": false,
1250
+ "autoincrement": false
1251
+ }
1252
+ },
1253
+ "indexes": {},
1254
+ "foreignKeys": {},
1255
+ "compositePrimaryKeys": {},
1256
+ "uniqueConstraints": {},
1257
+ "checkConstraints": {}
1258
+ }
1259
+ },
1260
+ "views": {},
1261
+ "enums": {},
1262
+ "_meta": {
1263
+ "schemas": {},
1264
+ "tables": {},
1265
+ "columns": {}
1266
+ },
1267
+ "internal": {
1268
+ "indexes": {}
1269
+ }
1270
+ }