@nymbalhq/platform 1.5.0 → 1.6.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 (35) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/dist/{chunk-TRLERRUI.js → chunk-KH3BABMV.js} +10467 -7548
  4. package/dist/chunk-KH3BABMV.js.map +1 -0
  5. package/dist/{chunk-NNDIAIT6.js → chunk-TVKV5GBY.js} +102 -7
  6. package/dist/chunk-TVKV5GBY.js.map +1 -0
  7. package/dist/db/schema/index.d.ts +5745 -3404
  8. package/dist/db/schema/index.js +1 -1
  9. package/dist/index.d.ts +678 -47
  10. package/dist/index.js +4055 -2098
  11. package/dist/index.js.map +1 -1
  12. package/dist/register-XP5XVAXM.js +8 -0
  13. package/migrations/postgres/0019_carts_customer_idx.sql +1 -0
  14. package/migrations/postgres/0020_alert_confirmation_sent.sql +1 -0
  15. package/migrations/postgres/0021_proposals.sql +27 -0
  16. package/migrations/postgres/0022_order_source.sql +3 -0
  17. package/migrations/postgres/meta/0019_snapshot.json +2322 -0
  18. package/migrations/postgres/meta/0020_snapshot.json +2328 -0
  19. package/migrations/postgres/meta/0021_snapshot.json +2543 -0
  20. package/migrations/postgres/meta/0022_snapshot.json +2578 -0
  21. package/migrations/postgres/meta/_journal.json +28 -0
  22. package/migrations/sqlite/0019_carts_customer_idx.sql +1 -0
  23. package/migrations/sqlite/0020_alert_confirmation_sent.sql +1 -0
  24. package/migrations/sqlite/0021_proposals.sql +27 -0
  25. package/migrations/sqlite/0022_order_source.sql +3 -0
  26. package/migrations/sqlite/meta/0019_snapshot.json +2056 -0
  27. package/migrations/sqlite/meta/0020_snapshot.json +2063 -0
  28. package/migrations/sqlite/meta/0021_snapshot.json +2246 -0
  29. package/migrations/sqlite/meta/0022_snapshot.json +2270 -0
  30. package/migrations/sqlite/meta/_journal.json +28 -0
  31. package/package.json +24 -21
  32. package/dist/chunk-NNDIAIT6.js.map +0 -1
  33. package/dist/chunk-TRLERRUI.js.map +0 -1
  34. package/dist/register-SBGUI2L5.js +0 -8
  35. /package/dist/{register-SBGUI2L5.js.map → register-XP5XVAXM.js.map} +0 -0
@@ -0,0 +1,2270 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "cb8b11a6-cec0-4805-81e6-7dd226a7ebfc",
5
+ "prevId": "f13e008b-69ad-40d9-9dc0-012c68ce6457",
6
+ "tables": {
7
+ "alert_subscriptions": {
8
+ "name": "alert_subscriptions",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "email": {
18
+ "name": "email",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "kind": {
25
+ "name": "kind",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "variant_id": {
32
+ "name": "variant_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "product_id": {
39
+ "name": "product_id",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": true,
43
+ "autoincrement": false
44
+ },
45
+ "status": {
46
+ "name": "status",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false
51
+ },
52
+ "confirm_token": {
53
+ "name": "confirm_token",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": true,
57
+ "autoincrement": false
58
+ },
59
+ "unsubscribe_token": {
60
+ "name": "unsubscribe_token",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": true,
64
+ "autoincrement": false
65
+ },
66
+ "origin": {
67
+ "name": "origin",
68
+ "type": "text",
69
+ "primaryKey": false,
70
+ "notNull": true,
71
+ "autoincrement": false
72
+ },
73
+ "baseline_price_minor": {
74
+ "name": "baseline_price_minor",
75
+ "type": "integer",
76
+ "primaryKey": false,
77
+ "notNull": false,
78
+ "autoincrement": false
79
+ },
80
+ "created_at": {
81
+ "name": "created_at",
82
+ "type": "text",
83
+ "primaryKey": false,
84
+ "notNull": true,
85
+ "autoincrement": false
86
+ },
87
+ "updated_at": {
88
+ "name": "updated_at",
89
+ "type": "text",
90
+ "primaryKey": false,
91
+ "notNull": true,
92
+ "autoincrement": false
93
+ },
94
+ "confirmed_at": {
95
+ "name": "confirmed_at",
96
+ "type": "text",
97
+ "primaryKey": false,
98
+ "notNull": false,
99
+ "autoincrement": false
100
+ },
101
+ "confirmation_sent_at": {
102
+ "name": "confirmation_sent_at",
103
+ "type": "text",
104
+ "primaryKey": false,
105
+ "notNull": false,
106
+ "autoincrement": false
107
+ }
108
+ },
109
+ "indexes": {
110
+ "alert_subscriptions_address_unique": {
111
+ "name": "alert_subscriptions_address_unique",
112
+ "columns": [
113
+ "email",
114
+ "variant_id",
115
+ "kind"
116
+ ],
117
+ "isUnique": true
118
+ },
119
+ "alert_subscriptions_confirm_token_unique": {
120
+ "name": "alert_subscriptions_confirm_token_unique",
121
+ "columns": [
122
+ "confirm_token"
123
+ ],
124
+ "isUnique": true
125
+ },
126
+ "alert_subscriptions_unsubscribe_token_unique": {
127
+ "name": "alert_subscriptions_unsubscribe_token_unique",
128
+ "columns": [
129
+ "unsubscribe_token"
130
+ ],
131
+ "isUnique": true
132
+ },
133
+ "alert_subscriptions_fan_out_idx": {
134
+ "name": "alert_subscriptions_fan_out_idx",
135
+ "columns": [
136
+ "variant_id",
137
+ "kind",
138
+ "status"
139
+ ],
140
+ "isUnique": false
141
+ }
142
+ },
143
+ "foreignKeys": {},
144
+ "compositePrimaryKeys": {},
145
+ "uniqueConstraints": {},
146
+ "checkConstraints": {
147
+ "alert_subscriptions_kind": {
148
+ "name": "alert_subscriptions_kind",
149
+ "value": "\"alert_subscriptions\".\"kind\" IN ('back_in_stock', 'price_drop')"
150
+ },
151
+ "alert_subscriptions_status": {
152
+ "name": "alert_subscriptions_status",
153
+ "value": "\"alert_subscriptions\".\"status\" IN ('pending', 'active', 'fired', 'unsubscribed')"
154
+ }
155
+ }
156
+ },
157
+ "audit_entries": {
158
+ "name": "audit_entries",
159
+ "columns": {
160
+ "id": {
161
+ "name": "id",
162
+ "type": "text",
163
+ "primaryKey": true,
164
+ "notNull": true,
165
+ "autoincrement": false
166
+ },
167
+ "at": {
168
+ "name": "at",
169
+ "type": "text",
170
+ "primaryKey": false,
171
+ "notNull": true,
172
+ "autoincrement": false
173
+ },
174
+ "actor_kind": {
175
+ "name": "actor_kind",
176
+ "type": "text",
177
+ "primaryKey": false,
178
+ "notNull": true,
179
+ "autoincrement": false
180
+ },
181
+ "actor_id": {
182
+ "name": "actor_id",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": true,
186
+ "autoincrement": false
187
+ },
188
+ "command": {
189
+ "name": "command",
190
+ "type": "text",
191
+ "primaryKey": false,
192
+ "notNull": true,
193
+ "autoincrement": false
194
+ },
195
+ "subjects": {
196
+ "name": "subjects",
197
+ "type": "text",
198
+ "primaryKey": false,
199
+ "notNull": true,
200
+ "autoincrement": false
201
+ },
202
+ "correlation_id": {
203
+ "name": "correlation_id",
204
+ "type": "text",
205
+ "primaryKey": false,
206
+ "notNull": false,
207
+ "autoincrement": false
208
+ },
209
+ "idempotency_key": {
210
+ "name": "idempotency_key",
211
+ "type": "text",
212
+ "primaryKey": false,
213
+ "notNull": false,
214
+ "autoincrement": false
215
+ },
216
+ "request_hash": {
217
+ "name": "request_hash",
218
+ "type": "text",
219
+ "primaryKey": false,
220
+ "notNull": false,
221
+ "autoincrement": false
222
+ },
223
+ "outcome": {
224
+ "name": "outcome",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": true,
228
+ "autoincrement": false
229
+ },
230
+ "response_status": {
231
+ "name": "response_status",
232
+ "type": "integer",
233
+ "primaryKey": false,
234
+ "notNull": false,
235
+ "autoincrement": false
236
+ },
237
+ "response_body": {
238
+ "name": "response_body",
239
+ "type": "text",
240
+ "primaryKey": false,
241
+ "notNull": false,
242
+ "autoincrement": false
243
+ }
244
+ },
245
+ "indexes": {
246
+ "audit_entries_applied_key_unique": {
247
+ "name": "audit_entries_applied_key_unique",
248
+ "columns": [
249
+ "actor_id",
250
+ "command",
251
+ "idempotency_key"
252
+ ],
253
+ "isUnique": true,
254
+ "where": "\"audit_entries\".\"outcome\" = 'applied' AND \"audit_entries\".\"idempotency_key\" IS NOT NULL"
255
+ },
256
+ "audit_entries_at_idx": {
257
+ "name": "audit_entries_at_idx",
258
+ "columns": [
259
+ "at",
260
+ "id"
261
+ ],
262
+ "isUnique": false
263
+ },
264
+ "audit_entries_correlation_idx": {
265
+ "name": "audit_entries_correlation_idx",
266
+ "columns": [
267
+ "correlation_id"
268
+ ],
269
+ "isUnique": false
270
+ }
271
+ },
272
+ "foreignKeys": {},
273
+ "compositePrimaryKeys": {},
274
+ "uniqueConstraints": {},
275
+ "checkConstraints": {
276
+ "audit_entries_outcome": {
277
+ "name": "audit_entries_outcome",
278
+ "value": "\"audit_entries\".\"outcome\" IN ('applied', 'refused', 'replayed')"
279
+ }
280
+ }
281
+ },
282
+ "carts": {
283
+ "name": "carts",
284
+ "columns": {
285
+ "token": {
286
+ "name": "token",
287
+ "type": "text",
288
+ "primaryKey": true,
289
+ "notNull": true,
290
+ "autoincrement": false
291
+ },
292
+ "customer_id": {
293
+ "name": "customer_id",
294
+ "type": "text",
295
+ "primaryKey": false,
296
+ "notNull": false,
297
+ "autoincrement": false
298
+ },
299
+ "currency": {
300
+ "name": "currency",
301
+ "type": "text",
302
+ "primaryKey": false,
303
+ "notNull": true,
304
+ "autoincrement": false
305
+ },
306
+ "items": {
307
+ "name": "items",
308
+ "type": "text",
309
+ "primaryKey": false,
310
+ "notNull": true,
311
+ "autoincrement": false,
312
+ "default": "'[]'"
313
+ },
314
+ "line_count": {
315
+ "name": "line_count",
316
+ "type": "integer",
317
+ "primaryKey": false,
318
+ "notNull": true,
319
+ "autoincrement": false,
320
+ "default": 0
321
+ },
322
+ "subtotal_minor": {
323
+ "name": "subtotal_minor",
324
+ "type": "integer",
325
+ "primaryKey": false,
326
+ "notNull": true,
327
+ "autoincrement": false,
328
+ "default": 0
329
+ },
330
+ "source": {
331
+ "name": "source",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": true,
335
+ "autoincrement": false,
336
+ "default": "'storefront'"
337
+ },
338
+ "expires_at": {
339
+ "name": "expires_at",
340
+ "type": "text",
341
+ "primaryKey": false,
342
+ "notNull": true,
343
+ "autoincrement": false
344
+ },
345
+ "created_at": {
346
+ "name": "created_at",
347
+ "type": "text",
348
+ "primaryKey": false,
349
+ "notNull": true,
350
+ "autoincrement": false
351
+ },
352
+ "updated_at": {
353
+ "name": "updated_at",
354
+ "type": "text",
355
+ "primaryKey": false,
356
+ "notNull": true,
357
+ "autoincrement": false
358
+ },
359
+ "abandoned_notified_at": {
360
+ "name": "abandoned_notified_at",
361
+ "type": "text",
362
+ "primaryKey": false,
363
+ "notNull": false,
364
+ "autoincrement": false
365
+ }
366
+ },
367
+ "indexes": {
368
+ "carts_expires_idx": {
369
+ "name": "carts_expires_idx",
370
+ "columns": [
371
+ "expires_at"
372
+ ],
373
+ "isUnique": false
374
+ },
375
+ "carts_updated_idx": {
376
+ "name": "carts_updated_idx",
377
+ "columns": [
378
+ "updated_at"
379
+ ],
380
+ "isUnique": false
381
+ },
382
+ "carts_customer_idx": {
383
+ "name": "carts_customer_idx",
384
+ "columns": [
385
+ "customer_id"
386
+ ],
387
+ "isUnique": false,
388
+ "where": "\"carts\".\"customer_id\" IS NOT NULL"
389
+ }
390
+ },
391
+ "foreignKeys": {},
392
+ "compositePrimaryKeys": {},
393
+ "uniqueConstraints": {},
394
+ "checkConstraints": {}
395
+ },
396
+ "categories": {
397
+ "name": "categories",
398
+ "columns": {
399
+ "id": {
400
+ "name": "id",
401
+ "type": "text",
402
+ "primaryKey": true,
403
+ "notNull": true,
404
+ "autoincrement": false
405
+ },
406
+ "parent_id": {
407
+ "name": "parent_id",
408
+ "type": "text",
409
+ "primaryKey": false,
410
+ "notNull": false,
411
+ "autoincrement": false
412
+ },
413
+ "slug": {
414
+ "name": "slug",
415
+ "type": "text",
416
+ "primaryKey": false,
417
+ "notNull": true,
418
+ "autoincrement": false
419
+ },
420
+ "name": {
421
+ "name": "name",
422
+ "type": "text",
423
+ "primaryKey": false,
424
+ "notNull": true,
425
+ "autoincrement": false
426
+ },
427
+ "description": {
428
+ "name": "description",
429
+ "type": "text",
430
+ "primaryKey": false,
431
+ "notNull": true,
432
+ "autoincrement": false,
433
+ "default": "''"
434
+ },
435
+ "position": {
436
+ "name": "position",
437
+ "type": "integer",
438
+ "primaryKey": false,
439
+ "notNull": true,
440
+ "autoincrement": false,
441
+ "default": 0
442
+ },
443
+ "created_at": {
444
+ "name": "created_at",
445
+ "type": "text",
446
+ "primaryKey": false,
447
+ "notNull": true,
448
+ "autoincrement": false
449
+ }
450
+ },
451
+ "indexes": {
452
+ "categories_slug_unique": {
453
+ "name": "categories_slug_unique",
454
+ "columns": [
455
+ "slug"
456
+ ],
457
+ "isUnique": true
458
+ },
459
+ "categories_parent_idx": {
460
+ "name": "categories_parent_idx",
461
+ "columns": [
462
+ "parent_id"
463
+ ],
464
+ "isUnique": false
465
+ }
466
+ },
467
+ "foreignKeys": {},
468
+ "compositePrimaryKeys": {},
469
+ "uniqueConstraints": {},
470
+ "checkConstraints": {}
471
+ },
472
+ "customers": {
473
+ "name": "customers",
474
+ "columns": {
475
+ "id": {
476
+ "name": "id",
477
+ "type": "text",
478
+ "primaryKey": true,
479
+ "notNull": true,
480
+ "autoincrement": false
481
+ },
482
+ "email": {
483
+ "name": "email",
484
+ "type": "text",
485
+ "primaryKey": false,
486
+ "notNull": true,
487
+ "autoincrement": false
488
+ },
489
+ "password_hash": {
490
+ "name": "password_hash",
491
+ "type": "text",
492
+ "primaryKey": false,
493
+ "notNull": true,
494
+ "autoincrement": false
495
+ },
496
+ "first_name": {
497
+ "name": "first_name",
498
+ "type": "text",
499
+ "primaryKey": false,
500
+ "notNull": true,
501
+ "autoincrement": false,
502
+ "default": "''"
503
+ },
504
+ "last_name": {
505
+ "name": "last_name",
506
+ "type": "text",
507
+ "primaryKey": false,
508
+ "notNull": true,
509
+ "autoincrement": false,
510
+ "default": "''"
511
+ },
512
+ "phone": {
513
+ "name": "phone",
514
+ "type": "text",
515
+ "primaryKey": false,
516
+ "notNull": true,
517
+ "autoincrement": false,
518
+ "default": "''"
519
+ },
520
+ "addresses": {
521
+ "name": "addresses",
522
+ "type": "text",
523
+ "primaryKey": false,
524
+ "notNull": true,
525
+ "autoincrement": false,
526
+ "default": "'[]'"
527
+ },
528
+ "order_count": {
529
+ "name": "order_count",
530
+ "type": "integer",
531
+ "primaryKey": false,
532
+ "notNull": true,
533
+ "autoincrement": false,
534
+ "default": 0
535
+ },
536
+ "total_spent_minor": {
537
+ "name": "total_spent_minor",
538
+ "type": "integer",
539
+ "primaryKey": false,
540
+ "notNull": true,
541
+ "autoincrement": false,
542
+ "default": 0
543
+ },
544
+ "metadata": {
545
+ "name": "metadata",
546
+ "type": "text",
547
+ "primaryKey": false,
548
+ "notNull": true,
549
+ "autoincrement": false,
550
+ "default": "'{}'"
551
+ },
552
+ "roles": {
553
+ "name": "roles",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": true,
557
+ "autoincrement": false,
558
+ "default": "'[\"customer\"]'"
559
+ },
560
+ "requires_password_reset": {
561
+ "name": "requires_password_reset",
562
+ "type": "integer",
563
+ "primaryKey": false,
564
+ "notNull": true,
565
+ "autoincrement": false,
566
+ "default": false
567
+ },
568
+ "created_at": {
569
+ "name": "created_at",
570
+ "type": "text",
571
+ "primaryKey": false,
572
+ "notNull": true,
573
+ "autoincrement": false
574
+ },
575
+ "updated_at": {
576
+ "name": "updated_at",
577
+ "type": "text",
578
+ "primaryKey": false,
579
+ "notNull": true,
580
+ "autoincrement": false
581
+ }
582
+ },
583
+ "indexes": {
584
+ "customers_email_unique": {
585
+ "name": "customers_email_unique",
586
+ "columns": [
587
+ "email"
588
+ ],
589
+ "isUnique": true
590
+ }
591
+ },
592
+ "foreignKeys": {},
593
+ "compositePrimaryKeys": {},
594
+ "uniqueConstraints": {},
595
+ "checkConstraints": {}
596
+ },
597
+ "email_suppressions": {
598
+ "name": "email_suppressions",
599
+ "columns": {
600
+ "email": {
601
+ "name": "email",
602
+ "type": "text",
603
+ "primaryKey": true,
604
+ "notNull": true,
605
+ "autoincrement": false
606
+ },
607
+ "reason": {
608
+ "name": "reason",
609
+ "type": "text",
610
+ "primaryKey": false,
611
+ "notNull": true,
612
+ "autoincrement": false
613
+ },
614
+ "event_id": {
615
+ "name": "event_id",
616
+ "type": "text",
617
+ "primaryKey": false,
618
+ "notNull": true,
619
+ "autoincrement": false
620
+ },
621
+ "created_at": {
622
+ "name": "created_at",
623
+ "type": "text",
624
+ "primaryKey": false,
625
+ "notNull": true,
626
+ "autoincrement": false
627
+ }
628
+ },
629
+ "indexes": {},
630
+ "foreignKeys": {},
631
+ "compositePrimaryKeys": {},
632
+ "uniqueConstraints": {},
633
+ "checkConstraints": {
634
+ "email_suppressions_reason": {
635
+ "name": "email_suppressions_reason",
636
+ "value": "\"email_suppressions\".\"reason\" IN ('hard_bounce', 'complaint')"
637
+ }
638
+ }
639
+ },
640
+ "events": {
641
+ "name": "events",
642
+ "columns": {
643
+ "seq": {
644
+ "name": "seq",
645
+ "type": "integer",
646
+ "primaryKey": true,
647
+ "notNull": true,
648
+ "autoincrement": true
649
+ },
650
+ "id": {
651
+ "name": "id",
652
+ "type": "text",
653
+ "primaryKey": false,
654
+ "notNull": true,
655
+ "autoincrement": false
656
+ },
657
+ "type": {
658
+ "name": "type",
659
+ "type": "text",
660
+ "primaryKey": false,
661
+ "notNull": true,
662
+ "autoincrement": false
663
+ },
664
+ "envelope": {
665
+ "name": "envelope",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": true,
669
+ "autoincrement": false
670
+ },
671
+ "correlation_id": {
672
+ "name": "correlation_id",
673
+ "type": "text",
674
+ "primaryKey": false,
675
+ "notNull": true,
676
+ "autoincrement": false
677
+ },
678
+ "created_at": {
679
+ "name": "created_at",
680
+ "type": "text",
681
+ "primaryKey": false,
682
+ "notNull": true,
683
+ "autoincrement": false
684
+ },
685
+ "subject_type": {
686
+ "name": "subject_type",
687
+ "type": "text",
688
+ "primaryKey": false,
689
+ "notNull": false,
690
+ "autoincrement": false
691
+ },
692
+ "subject_id": {
693
+ "name": "subject_id",
694
+ "type": "text",
695
+ "primaryKey": false,
696
+ "notNull": false,
697
+ "autoincrement": false
698
+ },
699
+ "delivered_at": {
700
+ "name": "delivered_at",
701
+ "type": "text",
702
+ "primaryKey": false,
703
+ "notNull": false,
704
+ "autoincrement": false
705
+ },
706
+ "attempts": {
707
+ "name": "attempts",
708
+ "type": "integer",
709
+ "primaryKey": false,
710
+ "notNull": true,
711
+ "autoincrement": false,
712
+ "default": 0
713
+ },
714
+ "dead_at": {
715
+ "name": "dead_at",
716
+ "type": "text",
717
+ "primaryKey": false,
718
+ "notNull": false,
719
+ "autoincrement": false
720
+ },
721
+ "retry_at": {
722
+ "name": "retry_at",
723
+ "type": "text",
724
+ "primaryKey": false,
725
+ "notNull": false,
726
+ "autoincrement": false
727
+ }
728
+ },
729
+ "indexes": {
730
+ "events_id_unique": {
731
+ "name": "events_id_unique",
732
+ "columns": [
733
+ "id"
734
+ ],
735
+ "isUnique": true
736
+ },
737
+ "events_undelivered_idx": {
738
+ "name": "events_undelivered_idx",
739
+ "columns": [
740
+ "delivered_at",
741
+ "seq"
742
+ ],
743
+ "isUnique": false
744
+ },
745
+ "events_correlation_idx": {
746
+ "name": "events_correlation_idx",
747
+ "columns": [
748
+ "correlation_id",
749
+ "seq"
750
+ ],
751
+ "isUnique": false
752
+ },
753
+ "events_catch_up_idx": {
754
+ "name": "events_catch_up_idx",
755
+ "columns": [
756
+ "dead_at",
757
+ "delivered_at",
758
+ "seq"
759
+ ],
760
+ "isUnique": false
761
+ },
762
+ "events_subject_idx": {
763
+ "name": "events_subject_idx",
764
+ "columns": [
765
+ "subject_type",
766
+ "subject_id",
767
+ "seq"
768
+ ],
769
+ "isUnique": false
770
+ }
771
+ },
772
+ "foreignKeys": {},
773
+ "compositePrimaryKeys": {},
774
+ "uniqueConstraints": {},
775
+ "checkConstraints": {}
776
+ },
777
+ "inventory_reservations": {
778
+ "name": "inventory_reservations",
779
+ "columns": {
780
+ "reservation_id": {
781
+ "name": "reservation_id",
782
+ "type": "text",
783
+ "primaryKey": true,
784
+ "notNull": true,
785
+ "autoincrement": false
786
+ },
787
+ "variant_id": {
788
+ "name": "variant_id",
789
+ "type": "text",
790
+ "primaryKey": false,
791
+ "notNull": true,
792
+ "autoincrement": false
793
+ },
794
+ "qty": {
795
+ "name": "qty",
796
+ "type": "integer",
797
+ "primaryKey": false,
798
+ "notNull": true,
799
+ "autoincrement": false
800
+ },
801
+ "order_ref": {
802
+ "name": "order_ref",
803
+ "type": "text",
804
+ "primaryKey": false,
805
+ "notNull": false,
806
+ "autoincrement": false
807
+ },
808
+ "expires_at": {
809
+ "name": "expires_at",
810
+ "type": "text",
811
+ "primaryKey": false,
812
+ "notNull": true,
813
+ "autoincrement": false
814
+ },
815
+ "created_at": {
816
+ "name": "created_at",
817
+ "type": "text",
818
+ "primaryKey": false,
819
+ "notNull": true,
820
+ "autoincrement": false
821
+ }
822
+ },
823
+ "indexes": {
824
+ "inv_reservations_variant_idx": {
825
+ "name": "inv_reservations_variant_idx",
826
+ "columns": [
827
+ "variant_id"
828
+ ],
829
+ "isUnique": false
830
+ },
831
+ "inv_reservations_expires_idx": {
832
+ "name": "inv_reservations_expires_idx",
833
+ "columns": [
834
+ "expires_at"
835
+ ],
836
+ "isUnique": false
837
+ }
838
+ },
839
+ "foreignKeys": {},
840
+ "compositePrimaryKeys": {},
841
+ "uniqueConstraints": {},
842
+ "checkConstraints": {}
843
+ },
844
+ "order_access_keys": {
845
+ "name": "order_access_keys",
846
+ "columns": {
847
+ "id": {
848
+ "name": "id",
849
+ "type": "text",
850
+ "primaryKey": true,
851
+ "notNull": true,
852
+ "autoincrement": false
853
+ },
854
+ "order_id": {
855
+ "name": "order_id",
856
+ "type": "text",
857
+ "primaryKey": false,
858
+ "notNull": true,
859
+ "autoincrement": false
860
+ },
861
+ "key_hash": {
862
+ "name": "key_hash",
863
+ "type": "text",
864
+ "primaryKey": false,
865
+ "notNull": true,
866
+ "autoincrement": false
867
+ },
868
+ "purpose": {
869
+ "name": "purpose",
870
+ "type": "text",
871
+ "primaryKey": false,
872
+ "notNull": true,
873
+ "autoincrement": false
874
+ },
875
+ "created_at": {
876
+ "name": "created_at",
877
+ "type": "text",
878
+ "primaryKey": false,
879
+ "notNull": true,
880
+ "autoincrement": false
881
+ },
882
+ "expires_at": {
883
+ "name": "expires_at",
884
+ "type": "text",
885
+ "primaryKey": false,
886
+ "notNull": true,
887
+ "autoincrement": false
888
+ }
889
+ },
890
+ "indexes": {
891
+ "order_access_keys_key_hash_idx": {
892
+ "name": "order_access_keys_key_hash_idx",
893
+ "columns": [
894
+ "key_hash"
895
+ ],
896
+ "isUnique": true
897
+ },
898
+ "order_access_keys_order_idx": {
899
+ "name": "order_access_keys_order_idx",
900
+ "columns": [
901
+ "order_id"
902
+ ],
903
+ "isUnique": false
904
+ }
905
+ },
906
+ "foreignKeys": {},
907
+ "compositePrimaryKeys": {},
908
+ "uniqueConstraints": {},
909
+ "checkConstraints": {}
910
+ },
911
+ "order_history": {
912
+ "name": "order_history",
913
+ "columns": {
914
+ "id": {
915
+ "name": "id",
916
+ "type": "text",
917
+ "primaryKey": true,
918
+ "notNull": true,
919
+ "autoincrement": false
920
+ },
921
+ "order_id": {
922
+ "name": "order_id",
923
+ "type": "text",
924
+ "primaryKey": false,
925
+ "notNull": true,
926
+ "autoincrement": false
927
+ },
928
+ "from_status": {
929
+ "name": "from_status",
930
+ "type": "text",
931
+ "primaryKey": false,
932
+ "notNull": false,
933
+ "autoincrement": false
934
+ },
935
+ "to_status": {
936
+ "name": "to_status",
937
+ "type": "text",
938
+ "primaryKey": false,
939
+ "notNull": true,
940
+ "autoincrement": false
941
+ },
942
+ "actor": {
943
+ "name": "actor",
944
+ "type": "text",
945
+ "primaryKey": false,
946
+ "notNull": true,
947
+ "autoincrement": false
948
+ },
949
+ "note": {
950
+ "name": "note",
951
+ "type": "text",
952
+ "primaryKey": false,
953
+ "notNull": true,
954
+ "autoincrement": false,
955
+ "default": "''"
956
+ },
957
+ "timestamp": {
958
+ "name": "timestamp",
959
+ "type": "text",
960
+ "primaryKey": false,
961
+ "notNull": true,
962
+ "autoincrement": false
963
+ }
964
+ },
965
+ "indexes": {
966
+ "order_history_order_idx": {
967
+ "name": "order_history_order_idx",
968
+ "columns": [
969
+ "order_id"
970
+ ],
971
+ "isUnique": false
972
+ }
973
+ },
974
+ "foreignKeys": {},
975
+ "compositePrimaryKeys": {},
976
+ "uniqueConstraints": {},
977
+ "checkConstraints": {}
978
+ },
979
+ "order_refunds": {
980
+ "name": "order_refunds",
981
+ "columns": {
982
+ "id": {
983
+ "name": "id",
984
+ "type": "text",
985
+ "primaryKey": true,
986
+ "notNull": true,
987
+ "autoincrement": false
988
+ },
989
+ "order_id": {
990
+ "name": "order_id",
991
+ "type": "text",
992
+ "primaryKey": false,
993
+ "notNull": true,
994
+ "autoincrement": false
995
+ },
996
+ "amount_minor": {
997
+ "name": "amount_minor",
998
+ "type": "integer",
999
+ "primaryKey": false,
1000
+ "notNull": true,
1001
+ "autoincrement": false
1002
+ },
1003
+ "currency": {
1004
+ "name": "currency",
1005
+ "type": "text",
1006
+ "primaryKey": false,
1007
+ "notNull": true,
1008
+ "autoincrement": false
1009
+ },
1010
+ "provider_refund_id": {
1011
+ "name": "provider_refund_id",
1012
+ "type": "text",
1013
+ "primaryKey": false,
1014
+ "notNull": false,
1015
+ "autoincrement": false
1016
+ },
1017
+ "status": {
1018
+ "name": "status",
1019
+ "type": "text",
1020
+ "primaryKey": false,
1021
+ "notNull": true,
1022
+ "autoincrement": false,
1023
+ "default": "'pending'"
1024
+ },
1025
+ "reason": {
1026
+ "name": "reason",
1027
+ "type": "text",
1028
+ "primaryKey": false,
1029
+ "notNull": false,
1030
+ "autoincrement": false
1031
+ },
1032
+ "actor": {
1033
+ "name": "actor",
1034
+ "type": "text",
1035
+ "primaryKey": false,
1036
+ "notNull": true,
1037
+ "autoincrement": false
1038
+ },
1039
+ "created_at": {
1040
+ "name": "created_at",
1041
+ "type": "text",
1042
+ "primaryKey": false,
1043
+ "notNull": true,
1044
+ "autoincrement": false
1045
+ },
1046
+ "request_id": {
1047
+ "name": "request_id",
1048
+ "type": "text",
1049
+ "primaryKey": false,
1050
+ "notNull": false,
1051
+ "autoincrement": false
1052
+ }
1053
+ },
1054
+ "indexes": {
1055
+ "order_refunds_order_idx": {
1056
+ "name": "order_refunds_order_idx",
1057
+ "columns": [
1058
+ "order_id"
1059
+ ],
1060
+ "isUnique": false
1061
+ },
1062
+ "order_refunds_order_request_idx": {
1063
+ "name": "order_refunds_order_request_idx",
1064
+ "columns": [
1065
+ "order_id",
1066
+ "request_id"
1067
+ ],
1068
+ "isUnique": true
1069
+ }
1070
+ },
1071
+ "foreignKeys": {},
1072
+ "compositePrimaryKeys": {},
1073
+ "uniqueConstraints": {},
1074
+ "checkConstraints": {}
1075
+ },
1076
+ "order_sequences": {
1077
+ "name": "order_sequences",
1078
+ "columns": {
1079
+ "id": {
1080
+ "name": "id",
1081
+ "type": "integer",
1082
+ "primaryKey": true,
1083
+ "notNull": true,
1084
+ "autoincrement": false
1085
+ },
1086
+ "next_value": {
1087
+ "name": "next_value",
1088
+ "type": "integer",
1089
+ "primaryKey": false,
1090
+ "notNull": true,
1091
+ "autoincrement": false
1092
+ }
1093
+ },
1094
+ "indexes": {},
1095
+ "foreignKeys": {},
1096
+ "compositePrimaryKeys": {},
1097
+ "uniqueConstraints": {},
1098
+ "checkConstraints": {}
1099
+ },
1100
+ "order_shipments": {
1101
+ "name": "order_shipments",
1102
+ "columns": {
1103
+ "order_id": {
1104
+ "name": "order_id",
1105
+ "type": "text",
1106
+ "primaryKey": true,
1107
+ "notNull": true,
1108
+ "autoincrement": false
1109
+ },
1110
+ "carrier": {
1111
+ "name": "carrier",
1112
+ "type": "text",
1113
+ "primaryKey": false,
1114
+ "notNull": true,
1115
+ "autoincrement": false
1116
+ },
1117
+ "tracking_number": {
1118
+ "name": "tracking_number",
1119
+ "type": "text",
1120
+ "primaryKey": false,
1121
+ "notNull": true,
1122
+ "autoincrement": false
1123
+ },
1124
+ "created_at": {
1125
+ "name": "created_at",
1126
+ "type": "text",
1127
+ "primaryKey": false,
1128
+ "notNull": true,
1129
+ "autoincrement": false
1130
+ }
1131
+ },
1132
+ "indexes": {
1133
+ "order_shipments_tracking_number_idx": {
1134
+ "name": "order_shipments_tracking_number_idx",
1135
+ "columns": [
1136
+ "tracking_number"
1137
+ ],
1138
+ "isUnique": false
1139
+ }
1140
+ },
1141
+ "foreignKeys": {
1142
+ "order_shipments_order_id_orders_id_fk": {
1143
+ "name": "order_shipments_order_id_orders_id_fk",
1144
+ "tableFrom": "order_shipments",
1145
+ "tableTo": "orders",
1146
+ "columnsFrom": [
1147
+ "order_id"
1148
+ ],
1149
+ "columnsTo": [
1150
+ "id"
1151
+ ],
1152
+ "onDelete": "no action",
1153
+ "onUpdate": "no action"
1154
+ }
1155
+ },
1156
+ "compositePrimaryKeys": {},
1157
+ "uniqueConstraints": {},
1158
+ "checkConstraints": {}
1159
+ },
1160
+ "orders": {
1161
+ "name": "orders",
1162
+ "columns": {
1163
+ "id": {
1164
+ "name": "id",
1165
+ "type": "text",
1166
+ "primaryKey": true,
1167
+ "notNull": true,
1168
+ "autoincrement": false
1169
+ },
1170
+ "order_number": {
1171
+ "name": "order_number",
1172
+ "type": "text",
1173
+ "primaryKey": false,
1174
+ "notNull": true,
1175
+ "autoincrement": false
1176
+ },
1177
+ "sequence": {
1178
+ "name": "sequence",
1179
+ "type": "integer",
1180
+ "primaryKey": false,
1181
+ "notNull": true,
1182
+ "autoincrement": false
1183
+ },
1184
+ "customer_id": {
1185
+ "name": "customer_id",
1186
+ "type": "text",
1187
+ "primaryKey": false,
1188
+ "notNull": false,
1189
+ "autoincrement": false
1190
+ },
1191
+ "status": {
1192
+ "name": "status",
1193
+ "type": "text",
1194
+ "primaryKey": false,
1195
+ "notNull": true,
1196
+ "autoincrement": false,
1197
+ "default": "'pending'"
1198
+ },
1199
+ "email": {
1200
+ "name": "email",
1201
+ "type": "text",
1202
+ "primaryKey": false,
1203
+ "notNull": true,
1204
+ "autoincrement": false
1205
+ },
1206
+ "billing_address": {
1207
+ "name": "billing_address",
1208
+ "type": "text",
1209
+ "primaryKey": false,
1210
+ "notNull": true,
1211
+ "autoincrement": false
1212
+ },
1213
+ "shipping_address": {
1214
+ "name": "shipping_address",
1215
+ "type": "text",
1216
+ "primaryKey": false,
1217
+ "notNull": true,
1218
+ "autoincrement": false
1219
+ },
1220
+ "line_items": {
1221
+ "name": "line_items",
1222
+ "type": "text",
1223
+ "primaryKey": false,
1224
+ "notNull": true,
1225
+ "autoincrement": false
1226
+ },
1227
+ "subtotal_minor": {
1228
+ "name": "subtotal_minor",
1229
+ "type": "integer",
1230
+ "primaryKey": false,
1231
+ "notNull": true,
1232
+ "autoincrement": false
1233
+ },
1234
+ "tax_total_minor": {
1235
+ "name": "tax_total_minor",
1236
+ "type": "integer",
1237
+ "primaryKey": false,
1238
+ "notNull": true,
1239
+ "autoincrement": false,
1240
+ "default": 0
1241
+ },
1242
+ "shipping_total_minor": {
1243
+ "name": "shipping_total_minor",
1244
+ "type": "integer",
1245
+ "primaryKey": false,
1246
+ "notNull": true,
1247
+ "autoincrement": false,
1248
+ "default": 0
1249
+ },
1250
+ "discount_total_minor": {
1251
+ "name": "discount_total_minor",
1252
+ "type": "integer",
1253
+ "primaryKey": false,
1254
+ "notNull": true,
1255
+ "autoincrement": false,
1256
+ "default": 0
1257
+ },
1258
+ "total_minor": {
1259
+ "name": "total_minor",
1260
+ "type": "integer",
1261
+ "primaryKey": false,
1262
+ "notNull": true,
1263
+ "autoincrement": false
1264
+ },
1265
+ "currency": {
1266
+ "name": "currency",
1267
+ "type": "text",
1268
+ "primaryKey": false,
1269
+ "notNull": true,
1270
+ "autoincrement": false
1271
+ },
1272
+ "notes": {
1273
+ "name": "notes",
1274
+ "type": "text",
1275
+ "primaryKey": false,
1276
+ "notNull": true,
1277
+ "autoincrement": false,
1278
+ "default": "''"
1279
+ },
1280
+ "metadata": {
1281
+ "name": "metadata",
1282
+ "type": "text",
1283
+ "primaryKey": false,
1284
+ "notNull": true,
1285
+ "autoincrement": false,
1286
+ "default": "'{}'"
1287
+ },
1288
+ "payment_intent_id": {
1289
+ "name": "payment_intent_id",
1290
+ "type": "text",
1291
+ "primaryKey": false,
1292
+ "notNull": false,
1293
+ "autoincrement": false
1294
+ },
1295
+ "cart_token": {
1296
+ "name": "cart_token",
1297
+ "type": "text",
1298
+ "primaryKey": false,
1299
+ "notNull": false,
1300
+ "autoincrement": false
1301
+ },
1302
+ "captured_minor": {
1303
+ "name": "captured_minor",
1304
+ "type": "integer",
1305
+ "primaryKey": false,
1306
+ "notNull": true,
1307
+ "autoincrement": false,
1308
+ "default": 0
1309
+ },
1310
+ "captured_at": {
1311
+ "name": "captured_at",
1312
+ "type": "text",
1313
+ "primaryKey": false,
1314
+ "notNull": false,
1315
+ "autoincrement": false
1316
+ },
1317
+ "refunded_minor": {
1318
+ "name": "refunded_minor",
1319
+ "type": "integer",
1320
+ "primaryKey": false,
1321
+ "notNull": true,
1322
+ "autoincrement": false,
1323
+ "default": 0
1324
+ },
1325
+ "capture_method": {
1326
+ "name": "capture_method",
1327
+ "type": "text",
1328
+ "primaryKey": false,
1329
+ "notNull": false,
1330
+ "autoincrement": false
1331
+ },
1332
+ "source": {
1333
+ "name": "source",
1334
+ "type": "text",
1335
+ "primaryKey": false,
1336
+ "notNull": true,
1337
+ "autoincrement": false,
1338
+ "default": "'storefront'"
1339
+ },
1340
+ "created_at": {
1341
+ "name": "created_at",
1342
+ "type": "text",
1343
+ "primaryKey": false,
1344
+ "notNull": true,
1345
+ "autoincrement": false
1346
+ },
1347
+ "updated_at": {
1348
+ "name": "updated_at",
1349
+ "type": "text",
1350
+ "primaryKey": false,
1351
+ "notNull": true,
1352
+ "autoincrement": false
1353
+ }
1354
+ },
1355
+ "indexes": {
1356
+ "orders_number_unique": {
1357
+ "name": "orders_number_unique",
1358
+ "columns": [
1359
+ "order_number"
1360
+ ],
1361
+ "isUnique": true
1362
+ },
1363
+ "orders_sequence_unique": {
1364
+ "name": "orders_sequence_unique",
1365
+ "columns": [
1366
+ "sequence"
1367
+ ],
1368
+ "isUnique": true
1369
+ },
1370
+ "orders_customer_idx": {
1371
+ "name": "orders_customer_idx",
1372
+ "columns": [
1373
+ "customer_id"
1374
+ ],
1375
+ "isUnique": false
1376
+ },
1377
+ "orders_status_idx": {
1378
+ "name": "orders_status_idx",
1379
+ "columns": [
1380
+ "status"
1381
+ ],
1382
+ "isUnique": false
1383
+ },
1384
+ "orders_payment_intent_idx": {
1385
+ "name": "orders_payment_intent_idx",
1386
+ "columns": [
1387
+ "payment_intent_id"
1388
+ ],
1389
+ "isUnique": false
1390
+ },
1391
+ "orders_source_created_idx": {
1392
+ "name": "orders_source_created_idx",
1393
+ "columns": [
1394
+ "source",
1395
+ "created_at"
1396
+ ],
1397
+ "isUnique": false
1398
+ },
1399
+ "orders_pending_cart_unique": {
1400
+ "name": "orders_pending_cart_unique",
1401
+ "columns": [
1402
+ "cart_token"
1403
+ ],
1404
+ "isUnique": true,
1405
+ "where": "status = 'pending'"
1406
+ }
1407
+ },
1408
+ "foreignKeys": {},
1409
+ "compositePrimaryKeys": {},
1410
+ "uniqueConstraints": {},
1411
+ "checkConstraints": {}
1412
+ },
1413
+ "processed_events": {
1414
+ "name": "processed_events",
1415
+ "columns": {
1416
+ "handler_name": {
1417
+ "name": "handler_name",
1418
+ "type": "text",
1419
+ "primaryKey": false,
1420
+ "notNull": true,
1421
+ "autoincrement": false
1422
+ },
1423
+ "event_id": {
1424
+ "name": "event_id",
1425
+ "type": "text",
1426
+ "primaryKey": false,
1427
+ "notNull": true,
1428
+ "autoincrement": false
1429
+ },
1430
+ "processed_at": {
1431
+ "name": "processed_at",
1432
+ "type": "text",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "autoincrement": false
1436
+ }
1437
+ },
1438
+ "indexes": {},
1439
+ "foreignKeys": {},
1440
+ "compositePrimaryKeys": {
1441
+ "processed_events_handler_name_event_id_pk": {
1442
+ "columns": [
1443
+ "handler_name",
1444
+ "event_id"
1445
+ ],
1446
+ "name": "processed_events_handler_name_event_id_pk"
1447
+ }
1448
+ },
1449
+ "uniqueConstraints": {},
1450
+ "checkConstraints": {}
1451
+ },
1452
+ "product_categories": {
1453
+ "name": "product_categories",
1454
+ "columns": {
1455
+ "product_id": {
1456
+ "name": "product_id",
1457
+ "type": "text",
1458
+ "primaryKey": false,
1459
+ "notNull": true,
1460
+ "autoincrement": false
1461
+ },
1462
+ "category_id": {
1463
+ "name": "category_id",
1464
+ "type": "text",
1465
+ "primaryKey": false,
1466
+ "notNull": true,
1467
+ "autoincrement": false
1468
+ }
1469
+ },
1470
+ "indexes": {
1471
+ "product_categories_category_idx": {
1472
+ "name": "product_categories_category_idx",
1473
+ "columns": [
1474
+ "category_id"
1475
+ ],
1476
+ "isUnique": false
1477
+ }
1478
+ },
1479
+ "foreignKeys": {},
1480
+ "compositePrimaryKeys": {
1481
+ "product_categories_product_id_category_id_pk": {
1482
+ "columns": [
1483
+ "product_id",
1484
+ "category_id"
1485
+ ],
1486
+ "name": "product_categories_product_id_category_id_pk"
1487
+ }
1488
+ },
1489
+ "uniqueConstraints": {},
1490
+ "checkConstraints": {}
1491
+ },
1492
+ "products": {
1493
+ "name": "products",
1494
+ "columns": {
1495
+ "id": {
1496
+ "name": "id",
1497
+ "type": "text",
1498
+ "primaryKey": true,
1499
+ "notNull": true,
1500
+ "autoincrement": false
1501
+ },
1502
+ "slug": {
1503
+ "name": "slug",
1504
+ "type": "text",
1505
+ "primaryKey": false,
1506
+ "notNull": true,
1507
+ "autoincrement": false
1508
+ },
1509
+ "name": {
1510
+ "name": "name",
1511
+ "type": "text",
1512
+ "primaryKey": false,
1513
+ "notNull": true,
1514
+ "autoincrement": false
1515
+ },
1516
+ "description": {
1517
+ "name": "description",
1518
+ "type": "text",
1519
+ "primaryKey": false,
1520
+ "notNull": true,
1521
+ "autoincrement": false,
1522
+ "default": "''"
1523
+ },
1524
+ "short_description": {
1525
+ "name": "short_description",
1526
+ "type": "text",
1527
+ "primaryKey": false,
1528
+ "notNull": true,
1529
+ "autoincrement": false,
1530
+ "default": "''"
1531
+ },
1532
+ "status": {
1533
+ "name": "status",
1534
+ "type": "text",
1535
+ "primaryKey": false,
1536
+ "notNull": true,
1537
+ "autoincrement": false,
1538
+ "default": "'draft'"
1539
+ },
1540
+ "type": {
1541
+ "name": "type",
1542
+ "type": "text",
1543
+ "primaryKey": false,
1544
+ "notNull": true,
1545
+ "autoincrement": false,
1546
+ "default": "'simple'"
1547
+ },
1548
+ "seo_title": {
1549
+ "name": "seo_title",
1550
+ "type": "text",
1551
+ "primaryKey": false,
1552
+ "notNull": true,
1553
+ "autoincrement": false,
1554
+ "default": "''"
1555
+ },
1556
+ "seo_description": {
1557
+ "name": "seo_description",
1558
+ "type": "text",
1559
+ "primaryKey": false,
1560
+ "notNull": true,
1561
+ "autoincrement": false,
1562
+ "default": "''"
1563
+ },
1564
+ "media": {
1565
+ "name": "media",
1566
+ "type": "text",
1567
+ "primaryKey": false,
1568
+ "notNull": true,
1569
+ "autoincrement": false,
1570
+ "default": "'[]'"
1571
+ },
1572
+ "metadata": {
1573
+ "name": "metadata",
1574
+ "type": "text",
1575
+ "primaryKey": false,
1576
+ "notNull": true,
1577
+ "autoincrement": false,
1578
+ "default": "'{}'"
1579
+ },
1580
+ "created_at": {
1581
+ "name": "created_at",
1582
+ "type": "text",
1583
+ "primaryKey": false,
1584
+ "notNull": true,
1585
+ "autoincrement": false
1586
+ },
1587
+ "updated_at": {
1588
+ "name": "updated_at",
1589
+ "type": "text",
1590
+ "primaryKey": false,
1591
+ "notNull": true,
1592
+ "autoincrement": false
1593
+ }
1594
+ },
1595
+ "indexes": {
1596
+ "products_slug_unique": {
1597
+ "name": "products_slug_unique",
1598
+ "columns": [
1599
+ "slug"
1600
+ ],
1601
+ "isUnique": true
1602
+ },
1603
+ "products_status_idx": {
1604
+ "name": "products_status_idx",
1605
+ "columns": [
1606
+ "status"
1607
+ ],
1608
+ "isUnique": false
1609
+ }
1610
+ },
1611
+ "foreignKeys": {},
1612
+ "compositePrimaryKeys": {},
1613
+ "uniqueConstraints": {},
1614
+ "checkConstraints": {}
1615
+ },
1616
+ "proposals": {
1617
+ "name": "proposals",
1618
+ "columns": {
1619
+ "id": {
1620
+ "name": "id",
1621
+ "type": "text",
1622
+ "primaryKey": true,
1623
+ "notNull": true,
1624
+ "autoincrement": false
1625
+ },
1626
+ "tool": {
1627
+ "name": "tool",
1628
+ "type": "text",
1629
+ "primaryKey": false,
1630
+ "notNull": true,
1631
+ "autoincrement": false
1632
+ },
1633
+ "command": {
1634
+ "name": "command",
1635
+ "type": "text",
1636
+ "primaryKey": false,
1637
+ "notNull": true,
1638
+ "autoincrement": false
1639
+ },
1640
+ "args": {
1641
+ "name": "args",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": true,
1645
+ "autoincrement": false
1646
+ },
1647
+ "handles": {
1648
+ "name": "handles",
1649
+ "type": "text",
1650
+ "primaryKey": false,
1651
+ "notNull": false,
1652
+ "autoincrement": false
1653
+ },
1654
+ "idempotency_key": {
1655
+ "name": "idempotency_key",
1656
+ "type": "text",
1657
+ "primaryKey": false,
1658
+ "notNull": false,
1659
+ "autoincrement": false
1660
+ },
1661
+ "proposer_id": {
1662
+ "name": "proposer_id",
1663
+ "type": "text",
1664
+ "primaryKey": false,
1665
+ "notNull": false,
1666
+ "autoincrement": false
1667
+ },
1668
+ "agent_name": {
1669
+ "name": "agent_name",
1670
+ "type": "text",
1671
+ "primaryKey": false,
1672
+ "notNull": true,
1673
+ "autoincrement": false
1674
+ },
1675
+ "agent_version": {
1676
+ "name": "agent_version",
1677
+ "type": "text",
1678
+ "primaryKey": false,
1679
+ "notNull": false,
1680
+ "autoincrement": false
1681
+ },
1682
+ "correlation_id": {
1683
+ "name": "correlation_id",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": true,
1687
+ "autoincrement": false
1688
+ },
1689
+ "status": {
1690
+ "name": "status",
1691
+ "type": "text",
1692
+ "primaryKey": false,
1693
+ "notNull": true,
1694
+ "autoincrement": false
1695
+ },
1696
+ "decided_by_kind": {
1697
+ "name": "decided_by_kind",
1698
+ "type": "text",
1699
+ "primaryKey": false,
1700
+ "notNull": false,
1701
+ "autoincrement": false
1702
+ },
1703
+ "decided_by": {
1704
+ "name": "decided_by",
1705
+ "type": "text",
1706
+ "primaryKey": false,
1707
+ "notNull": false,
1708
+ "autoincrement": false
1709
+ },
1710
+ "decided_at": {
1711
+ "name": "decided_at",
1712
+ "type": "text",
1713
+ "primaryKey": false,
1714
+ "notNull": false,
1715
+ "autoincrement": false
1716
+ },
1717
+ "reason": {
1718
+ "name": "reason",
1719
+ "type": "text",
1720
+ "primaryKey": false,
1721
+ "notNull": false,
1722
+ "autoincrement": false
1723
+ },
1724
+ "outcome_status": {
1725
+ "name": "outcome_status",
1726
+ "type": "integer",
1727
+ "primaryKey": false,
1728
+ "notNull": false,
1729
+ "autoincrement": false
1730
+ },
1731
+ "outcome_code": {
1732
+ "name": "outcome_code",
1733
+ "type": "text",
1734
+ "primaryKey": false,
1735
+ "notNull": false,
1736
+ "autoincrement": false
1737
+ },
1738
+ "outcome_message": {
1739
+ "name": "outcome_message",
1740
+ "type": "text",
1741
+ "primaryKey": false,
1742
+ "notNull": false,
1743
+ "autoincrement": false
1744
+ },
1745
+ "created_at": {
1746
+ "name": "created_at",
1747
+ "type": "text",
1748
+ "primaryKey": false,
1749
+ "notNull": true,
1750
+ "autoincrement": false
1751
+ },
1752
+ "settled_at": {
1753
+ "name": "settled_at",
1754
+ "type": "text",
1755
+ "primaryKey": false,
1756
+ "notNull": false,
1757
+ "autoincrement": false
1758
+ }
1759
+ },
1760
+ "indexes": {
1761
+ "proposals_key_unique": {
1762
+ "name": "proposals_key_unique",
1763
+ "columns": [
1764
+ "proposer_id",
1765
+ "tool",
1766
+ "idempotency_key"
1767
+ ],
1768
+ "isUnique": true,
1769
+ "where": "\"proposals\".\"proposer_id\" IS NOT NULL AND \"proposals\".\"idempotency_key\" IS NOT NULL"
1770
+ },
1771
+ "proposals_created_idx": {
1772
+ "name": "proposals_created_idx",
1773
+ "columns": [
1774
+ "created_at",
1775
+ "id"
1776
+ ],
1777
+ "isUnique": false
1778
+ },
1779
+ "proposals_status_idx": {
1780
+ "name": "proposals_status_idx",
1781
+ "columns": [
1782
+ "status",
1783
+ "created_at",
1784
+ "id"
1785
+ ],
1786
+ "isUnique": false
1787
+ }
1788
+ },
1789
+ "foreignKeys": {},
1790
+ "compositePrimaryKeys": {},
1791
+ "uniqueConstraints": {},
1792
+ "checkConstraints": {
1793
+ "proposals_status": {
1794
+ "name": "proposals_status",
1795
+ "value": "\"proposals\".\"status\" IN ('pending', 'approved', 'rejected', 'applied', 'failed')"
1796
+ }
1797
+ }
1798
+ },
1799
+ "refresh_tokens": {
1800
+ "name": "refresh_tokens",
1801
+ "columns": {
1802
+ "id": {
1803
+ "name": "id",
1804
+ "type": "text",
1805
+ "primaryKey": true,
1806
+ "notNull": true,
1807
+ "autoincrement": false
1808
+ },
1809
+ "customer_id": {
1810
+ "name": "customer_id",
1811
+ "type": "text",
1812
+ "primaryKey": false,
1813
+ "notNull": true,
1814
+ "autoincrement": false
1815
+ },
1816
+ "token_hash": {
1817
+ "name": "token_hash",
1818
+ "type": "text",
1819
+ "primaryKey": false,
1820
+ "notNull": true,
1821
+ "autoincrement": false
1822
+ },
1823
+ "revoked_at": {
1824
+ "name": "revoked_at",
1825
+ "type": "text",
1826
+ "primaryKey": false,
1827
+ "notNull": false,
1828
+ "autoincrement": false
1829
+ },
1830
+ "replaced_by_jti": {
1831
+ "name": "replaced_by_jti",
1832
+ "type": "text",
1833
+ "primaryKey": false,
1834
+ "notNull": false,
1835
+ "autoincrement": false
1836
+ },
1837
+ "expires_at": {
1838
+ "name": "expires_at",
1839
+ "type": "text",
1840
+ "primaryKey": false,
1841
+ "notNull": true,
1842
+ "autoincrement": false
1843
+ },
1844
+ "created_at": {
1845
+ "name": "created_at",
1846
+ "type": "text",
1847
+ "primaryKey": false,
1848
+ "notNull": true,
1849
+ "autoincrement": false
1850
+ }
1851
+ },
1852
+ "indexes": {
1853
+ "refresh_tokens_customer_idx": {
1854
+ "name": "refresh_tokens_customer_idx",
1855
+ "columns": [
1856
+ "customer_id"
1857
+ ],
1858
+ "isUnique": false
1859
+ }
1860
+ },
1861
+ "foreignKeys": {},
1862
+ "compositePrimaryKeys": {},
1863
+ "uniqueConstraints": {},
1864
+ "checkConstraints": {}
1865
+ },
1866
+ "reviews": {
1867
+ "name": "reviews",
1868
+ "columns": {
1869
+ "id": {
1870
+ "name": "id",
1871
+ "type": "text",
1872
+ "primaryKey": true,
1873
+ "notNull": true,
1874
+ "autoincrement": false
1875
+ },
1876
+ "product_id": {
1877
+ "name": "product_id",
1878
+ "type": "text",
1879
+ "primaryKey": false,
1880
+ "notNull": true,
1881
+ "autoincrement": false
1882
+ },
1883
+ "customer_id": {
1884
+ "name": "customer_id",
1885
+ "type": "text",
1886
+ "primaryKey": false,
1887
+ "notNull": false,
1888
+ "autoincrement": false
1889
+ },
1890
+ "order_id": {
1891
+ "name": "order_id",
1892
+ "type": "text",
1893
+ "primaryKey": false,
1894
+ "notNull": false,
1895
+ "autoincrement": false
1896
+ },
1897
+ "rating": {
1898
+ "name": "rating",
1899
+ "type": "integer",
1900
+ "primaryKey": false,
1901
+ "notNull": true,
1902
+ "autoincrement": false
1903
+ },
1904
+ "title": {
1905
+ "name": "title",
1906
+ "type": "text",
1907
+ "primaryKey": false,
1908
+ "notNull": true,
1909
+ "autoincrement": false,
1910
+ "default": "''"
1911
+ },
1912
+ "body": {
1913
+ "name": "body",
1914
+ "type": "text",
1915
+ "primaryKey": false,
1916
+ "notNull": true,
1917
+ "autoincrement": false,
1918
+ "default": "''"
1919
+ },
1920
+ "moderation_status": {
1921
+ "name": "moderation_status",
1922
+ "type": "text",
1923
+ "primaryKey": false,
1924
+ "notNull": true,
1925
+ "autoincrement": false,
1926
+ "default": "'pending'"
1927
+ },
1928
+ "submitted_at": {
1929
+ "name": "submitted_at",
1930
+ "type": "text",
1931
+ "primaryKey": false,
1932
+ "notNull": true,
1933
+ "autoincrement": false
1934
+ },
1935
+ "moderated_at": {
1936
+ "name": "moderated_at",
1937
+ "type": "text",
1938
+ "primaryKey": false,
1939
+ "notNull": false,
1940
+ "autoincrement": false
1941
+ },
1942
+ "moderated_by": {
1943
+ "name": "moderated_by",
1944
+ "type": "text",
1945
+ "primaryKey": false,
1946
+ "notNull": false,
1947
+ "autoincrement": false
1948
+ }
1949
+ },
1950
+ "indexes": {
1951
+ "reviews_product_idx": {
1952
+ "name": "reviews_product_idx",
1953
+ "columns": [
1954
+ "product_id"
1955
+ ],
1956
+ "isUnique": false
1957
+ },
1958
+ "reviews_status_idx": {
1959
+ "name": "reviews_status_idx",
1960
+ "columns": [
1961
+ "moderation_status"
1962
+ ],
1963
+ "isUnique": false
1964
+ }
1965
+ },
1966
+ "foreignKeys": {},
1967
+ "compositePrimaryKeys": {},
1968
+ "uniqueConstraints": {},
1969
+ "checkConstraints": {}
1970
+ },
1971
+ "settings": {
1972
+ "name": "settings",
1973
+ "columns": {
1974
+ "slot": {
1975
+ "name": "slot",
1976
+ "type": "text",
1977
+ "primaryKey": false,
1978
+ "notNull": true,
1979
+ "autoincrement": false
1980
+ },
1981
+ "path": {
1982
+ "name": "path",
1983
+ "type": "text",
1984
+ "primaryKey": false,
1985
+ "notNull": true,
1986
+ "autoincrement": false
1987
+ },
1988
+ "ciphertext": {
1989
+ "name": "ciphertext",
1990
+ "type": "blob",
1991
+ "primaryKey": false,
1992
+ "notNull": false,
1993
+ "autoincrement": false
1994
+ },
1995
+ "plain": {
1996
+ "name": "plain",
1997
+ "type": "text",
1998
+ "primaryKey": false,
1999
+ "notNull": false,
2000
+ "autoincrement": false
2001
+ },
2002
+ "iv": {
2003
+ "name": "iv",
2004
+ "type": "blob",
2005
+ "primaryKey": false,
2006
+ "notNull": false,
2007
+ "autoincrement": false
2008
+ },
2009
+ "tag": {
2010
+ "name": "tag",
2011
+ "type": "blob",
2012
+ "primaryKey": false,
2013
+ "notNull": false,
2014
+ "autoincrement": false
2015
+ },
2016
+ "key_id": {
2017
+ "name": "key_id",
2018
+ "type": "text",
2019
+ "primaryKey": false,
2020
+ "notNull": false,
2021
+ "autoincrement": false
2022
+ },
2023
+ "updated_at": {
2024
+ "name": "updated_at",
2025
+ "type": "text",
2026
+ "primaryKey": false,
2027
+ "notNull": true,
2028
+ "autoincrement": false
2029
+ },
2030
+ "updated_by": {
2031
+ "name": "updated_by",
2032
+ "type": "text",
2033
+ "primaryKey": false,
2034
+ "notNull": false,
2035
+ "autoincrement": false
2036
+ }
2037
+ },
2038
+ "indexes": {},
2039
+ "foreignKeys": {},
2040
+ "compositePrimaryKeys": {
2041
+ "settings_slot_path_pk": {
2042
+ "columns": [
2043
+ "slot",
2044
+ "path"
2045
+ ],
2046
+ "name": "settings_slot_path_pk"
2047
+ }
2048
+ },
2049
+ "uniqueConstraints": {},
2050
+ "checkConstraints": {
2051
+ "settings_one_value": {
2052
+ "name": "settings_one_value",
2053
+ "value": "(\"settings\".\"ciphertext\" IS NULL) <> (\"settings\".\"plain\" IS NULL) AND (\"settings\".\"ciphertext\" IS NULL OR (\"settings\".\"iv\" IS NOT NULL AND \"settings\".\"tag\" IS NOT NULL AND \"settings\".\"key_id\" IS NOT NULL))"
2054
+ }
2055
+ }
2056
+ },
2057
+ "stock_adjustments": {
2058
+ "name": "stock_adjustments",
2059
+ "columns": {
2060
+ "id": {
2061
+ "name": "id",
2062
+ "type": "text",
2063
+ "primaryKey": true,
2064
+ "notNull": true,
2065
+ "autoincrement": false
2066
+ },
2067
+ "variant_id": {
2068
+ "name": "variant_id",
2069
+ "type": "text",
2070
+ "primaryKey": false,
2071
+ "notNull": true,
2072
+ "autoincrement": false
2073
+ },
2074
+ "adjustment": {
2075
+ "name": "adjustment",
2076
+ "type": "integer",
2077
+ "primaryKey": false,
2078
+ "notNull": true,
2079
+ "autoincrement": false
2080
+ },
2081
+ "reason": {
2082
+ "name": "reason",
2083
+ "type": "text",
2084
+ "primaryKey": false,
2085
+ "notNull": true,
2086
+ "autoincrement": false
2087
+ },
2088
+ "actor": {
2089
+ "name": "actor",
2090
+ "type": "text",
2091
+ "primaryKey": false,
2092
+ "notNull": true,
2093
+ "autoincrement": false
2094
+ },
2095
+ "previous_qty": {
2096
+ "name": "previous_qty",
2097
+ "type": "integer",
2098
+ "primaryKey": false,
2099
+ "notNull": true,
2100
+ "autoincrement": false
2101
+ },
2102
+ "new_qty": {
2103
+ "name": "new_qty",
2104
+ "type": "integer",
2105
+ "primaryKey": false,
2106
+ "notNull": true,
2107
+ "autoincrement": false
2108
+ },
2109
+ "timestamp": {
2110
+ "name": "timestamp",
2111
+ "type": "text",
2112
+ "primaryKey": false,
2113
+ "notNull": true,
2114
+ "autoincrement": false
2115
+ }
2116
+ },
2117
+ "indexes": {
2118
+ "stock_adjustments_variant_idx": {
2119
+ "name": "stock_adjustments_variant_idx",
2120
+ "columns": [
2121
+ "variant_id"
2122
+ ],
2123
+ "isUnique": false
2124
+ }
2125
+ },
2126
+ "foreignKeys": {},
2127
+ "compositePrimaryKeys": {},
2128
+ "uniqueConstraints": {},
2129
+ "checkConstraints": {}
2130
+ },
2131
+ "variants": {
2132
+ "name": "variants",
2133
+ "columns": {
2134
+ "id": {
2135
+ "name": "id",
2136
+ "type": "text",
2137
+ "primaryKey": true,
2138
+ "notNull": true,
2139
+ "autoincrement": false
2140
+ },
2141
+ "product_id": {
2142
+ "name": "product_id",
2143
+ "type": "text",
2144
+ "primaryKey": false,
2145
+ "notNull": true,
2146
+ "autoincrement": false
2147
+ },
2148
+ "sku": {
2149
+ "name": "sku",
2150
+ "type": "text",
2151
+ "primaryKey": false,
2152
+ "notNull": true,
2153
+ "autoincrement": false
2154
+ },
2155
+ "name": {
2156
+ "name": "name",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true,
2160
+ "autoincrement": false,
2161
+ "default": "''"
2162
+ },
2163
+ "price_minor": {
2164
+ "name": "price_minor",
2165
+ "type": "integer",
2166
+ "primaryKey": false,
2167
+ "notNull": true,
2168
+ "autoincrement": false
2169
+ },
2170
+ "compare_at_price_minor": {
2171
+ "name": "compare_at_price_minor",
2172
+ "type": "integer",
2173
+ "primaryKey": false,
2174
+ "notNull": false,
2175
+ "autoincrement": false
2176
+ },
2177
+ "weight_grams": {
2178
+ "name": "weight_grams",
2179
+ "type": "integer",
2180
+ "primaryKey": false,
2181
+ "notNull": false,
2182
+ "autoincrement": false
2183
+ },
2184
+ "dimensions": {
2185
+ "name": "dimensions",
2186
+ "type": "text",
2187
+ "primaryKey": false,
2188
+ "notNull": false,
2189
+ "autoincrement": false
2190
+ },
2191
+ "stock": {
2192
+ "name": "stock",
2193
+ "type": "integer",
2194
+ "primaryKey": false,
2195
+ "notNull": true,
2196
+ "autoincrement": false,
2197
+ "default": 0
2198
+ },
2199
+ "low_stock_threshold": {
2200
+ "name": "low_stock_threshold",
2201
+ "type": "integer",
2202
+ "primaryKey": false,
2203
+ "notNull": true,
2204
+ "autoincrement": false,
2205
+ "default": 0
2206
+ },
2207
+ "options": {
2208
+ "name": "options",
2209
+ "type": "text",
2210
+ "primaryKey": false,
2211
+ "notNull": true,
2212
+ "autoincrement": false,
2213
+ "default": "'[]'"
2214
+ },
2215
+ "status": {
2216
+ "name": "status",
2217
+ "type": "text",
2218
+ "primaryKey": false,
2219
+ "notNull": true,
2220
+ "autoincrement": false,
2221
+ "default": "'active'"
2222
+ },
2223
+ "created_at": {
2224
+ "name": "created_at",
2225
+ "type": "text",
2226
+ "primaryKey": false,
2227
+ "notNull": true,
2228
+ "autoincrement": false
2229
+ },
2230
+ "updated_at": {
2231
+ "name": "updated_at",
2232
+ "type": "text",
2233
+ "primaryKey": false,
2234
+ "notNull": true,
2235
+ "autoincrement": false
2236
+ }
2237
+ },
2238
+ "indexes": {
2239
+ "variants_sku_unique": {
2240
+ "name": "variants_sku_unique",
2241
+ "columns": [
2242
+ "sku"
2243
+ ],
2244
+ "isUnique": true
2245
+ },
2246
+ "variants_product_idx": {
2247
+ "name": "variants_product_idx",
2248
+ "columns": [
2249
+ "product_id"
2250
+ ],
2251
+ "isUnique": false
2252
+ }
2253
+ },
2254
+ "foreignKeys": {},
2255
+ "compositePrimaryKeys": {},
2256
+ "uniqueConstraints": {},
2257
+ "checkConstraints": {}
2258
+ }
2259
+ },
2260
+ "views": {},
2261
+ "enums": {},
2262
+ "_meta": {
2263
+ "schemas": {},
2264
+ "tables": {},
2265
+ "columns": {}
2266
+ },
2267
+ "internal": {
2268
+ "indexes": {}
2269
+ }
2270
+ }