@tokenoftrust/storefront-runner 1.3.4-rc.4 → 1.4.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 (224) hide show
  1. package/apps/storefront/astro.config.mjs +15 -0
  2. package/apps/storefront/dev-plugins/dev-publish.mjs +55 -0
  3. package/apps/storefront/dev-plugins/tenant-hot-reload.mjs +86 -7
  4. package/apps/storefront/drizzle.config.apps.ts +13 -0
  5. package/apps/storefront/env.d.ts +10 -0
  6. package/apps/storefront/migrations/README.md +13 -7
  7. package/apps/storefront/migrations-apps/0000_fast_millenium_guard.sql +129 -0
  8. package/apps/storefront/migrations-apps/meta/0000_snapshot.json +843 -0
  9. package/apps/storefront/migrations-apps/meta/_journal.json +13 -0
  10. package/apps/storefront/package.json +13 -1
  11. package/apps/storefront/perf/README.md +64 -0
  12. package/apps/storefront/perf/assert-budgets.ts +159 -0
  13. package/apps/storefront/playwright.config.ts +23 -0
  14. package/apps/storefront/public/js/dashboard-apps.js +173 -0
  15. package/apps/storefront/public/shared/commerce-marketing.css +221 -0
  16. package/apps/storefront/src/components/CollectionCard.astro +1 -0
  17. package/apps/storefront/src/components/ProductCard.astro +1 -0
  18. package/apps/storefront/src/components/admin/AdminPublishTab.astro +1959 -0
  19. package/apps/storefront/src/components/apps/AppWidgetFrame.astro +30 -0
  20. package/apps/storefront/src/components/chrome/NavDropdown.astro +6 -3
  21. package/apps/storefront/src/components/chrome/SiteFooter.astro +10 -0
  22. package/apps/storefront/src/components/chrome/SiteHeader.astro +10 -0
  23. package/apps/storefront/src/components/commerce/RatingStars.astro +3 -2
  24. package/apps/storefront/src/components/content/Callout.astro +75 -0
  25. package/apps/storefront/src/components/content/NeedsReviewCallout.astro +66 -0
  26. package/apps/storefront/src/components/content/ProseSections.astro +121 -0
  27. package/apps/storefront/src/components/content/ProseToc.astro +34 -0
  28. package/apps/storefront/src/components/content/RichText.astro +44 -0
  29. package/apps/storefront/src/components/content/TrustStrip.astro +46 -0
  30. package/apps/storefront/src/components/home/Hero.astro +14 -0
  31. package/apps/storefront/src/components/islands/CheckoutComplianceGate.tsx +295 -0
  32. package/apps/storefront/src/components/islands/ImageGallery.tsx +42 -21
  33. package/apps/storefront/src/components/islands/VariantSelector.tsx +62 -12
  34. package/apps/storefront/src/components/plp/FacetSidebar.astro +2 -2
  35. package/apps/storefront/src/components/subscription/ManageSubscriptionEntry.astro +1 -0
  36. package/apps/storefront/src/config/compliance/rulesets.ts +79 -0
  37. package/apps/storefront/src/config/storeName.ts +34 -0
  38. package/apps/storefront/src/layouts/Layout.astro +97 -23
  39. package/apps/storefront/src/lib/analytics/budgets.json +69 -0
  40. package/apps/storefront/src/lib/analytics/lighthouseReport.ts +109 -0
  41. package/apps/storefront/src/lib/analytics/perfBudgets.ts +452 -0
  42. package/apps/storefront/src/lib/analytics/rumAlert.ts +179 -0
  43. package/apps/storefront/src/lib/analytics/webVitals.ts +269 -0
  44. package/apps/storefront/src/lib/apps/adminService.ts +106 -0
  45. package/apps/storefront/src/lib/apps/adminSession.ts +205 -0
  46. package/apps/storefront/src/lib/apps/apiAuth.ts +91 -0
  47. package/apps/storefront/src/lib/apps/apiRoute.ts +35 -0
  48. package/apps/storefront/src/lib/apps/catalogMapper.ts +39 -0
  49. package/apps/storefront/src/lib/apps/credentials.ts +153 -0
  50. package/apps/storefront/src/lib/apps/gatewayKeys.ts +156 -0
  51. package/apps/storefront/src/lib/apps/healthAggregate.ts +66 -0
  52. package/apps/storefront/src/lib/apps/orders/attributionService.ts +206 -0
  53. package/apps/storefront/src/lib/apps/orders/customerHash.ts +28 -0
  54. package/apps/storefront/src/lib/apps/orders/foxyOrderClient.ts +203 -0
  55. package/apps/storefront/src/lib/apps/orders/idempotency.ts +100 -0
  56. package/apps/storefront/src/lib/apps/orders/orderForwardReceiver.ts +117 -0
  57. package/apps/storefront/src/lib/apps/orders/orderMapper.ts +91 -0
  58. package/apps/storefront/src/lib/apps/orders/ordersStore.ts +181 -0
  59. package/apps/storefront/src/lib/apps/registryService.ts +579 -0
  60. package/apps/storefront/src/lib/apps/scopes.ts +79 -0
  61. package/apps/storefront/src/lib/apps/tokenIssuer.ts +121 -0
  62. package/apps/storefront/src/lib/apps/tokenVerifier.ts +148 -0
  63. package/apps/storefront/src/lib/apps/widgets/eligibility.ts +18 -0
  64. package/apps/storefront/src/lib/apps/widgets/frameProps.ts +52 -0
  65. package/apps/storefront/src/lib/apps/widgets/launchToken.ts +84 -0
  66. package/apps/storefront/src/lib/apps/widgets/placements.ts +57 -0
  67. package/apps/storefront/src/lib/apps/widgets/renderSlot.ts +111 -0
  68. package/apps/storefront/src/lib/auth/adminEntry.ts +119 -0
  69. package/apps/storefront/src/lib/auth/identityToken.ts +21 -2
  70. package/apps/storefront/src/lib/auth/loginGate.ts +102 -18
  71. package/apps/storefront/src/lib/auth/mcpClientAssertion.ts +215 -0
  72. package/apps/storefront/src/lib/auth/route.ts +16 -1
  73. package/apps/storefront/src/lib/auth/session.ts +8 -0
  74. package/apps/storefront/src/lib/auth/stepUpChallenge.ts +107 -0
  75. package/apps/storefront/src/lib/auth/totAccessClient.ts +208 -0
  76. package/apps/storefront/src/lib/blog/provider.ts +39 -0
  77. package/apps/storefront/src/lib/blog/types.ts +26 -0
  78. package/apps/storefront/src/lib/checkoutCommerce.ts +39 -1
  79. package/apps/storefront/src/lib/chrome/model.ts +11 -0
  80. package/apps/storefront/src/lib/compliance/enforcement.ts +95 -0
  81. package/apps/storefront/src/lib/content/callout.ts +78 -0
  82. package/apps/storefront/src/lib/content/index.ts +27 -0
  83. package/apps/storefront/src/lib/content/needsReview.ts +58 -0
  84. package/apps/storefront/src/lib/content/prose.ts +186 -0
  85. package/apps/storefront/src/lib/content/richtext.ts +76 -0
  86. package/apps/storefront/src/lib/content/trustStrip.ts +74 -0
  87. package/apps/storefront/src/lib/content-edit/client.ts +70 -14
  88. package/apps/storefront/src/lib/d1/catalog.ts +12 -0
  89. package/apps/storefront/src/lib/d1/schema-apps.ts +213 -0
  90. package/apps/storefront/src/lib/dev/apiBase.ts +8 -2
  91. package/apps/storefront/src/lib/dev/cliSignInCode.ts +65 -115
  92. package/apps/storefront/src/lib/dev/cockpitStore.ts +65 -0
  93. package/apps/storefront/src/lib/dev/previewStatus.ts +112 -0
  94. package/apps/storefront/src/lib/dev/rendezvousBroker.ts +241 -0
  95. package/apps/storefront/src/lib/dev/subjectReissue.ts +67 -0
  96. package/apps/storefront/src/lib/email/magicLinkInviteEmail.ts +10 -10
  97. package/apps/storefront/src/lib/env.ts +12 -0
  98. package/apps/storefront/src/lib/jsonld.ts +12 -17
  99. package/apps/storefront/src/lib/membership/eligibility.ts +37 -0
  100. package/apps/storefront/src/lib/monitoring/manifest.ts +302 -0
  101. package/apps/storefront/src/lib/privacy/emailHint.ts +13 -5
  102. package/apps/storefront/src/lib/publish/apex-readiness.ts +337 -0
  103. package/apps/storefront/src/lib/publish/dispatchHealth.ts +269 -0
  104. package/apps/storefront/src/lib/publish/domainState.ts +351 -0
  105. package/apps/storefront/src/lib/publish/shipWorkspace.ts +362 -0
  106. package/apps/storefront/src/lib/rawChrome.ts +34 -3
  107. package/apps/storefront/src/lib/storyblok/content-model.ts +34 -2
  108. package/apps/storefront/src/lib/storyblok/provider.ts +11 -4
  109. package/apps/storefront/src/lib/subscription/model.ts +114 -0
  110. package/apps/storefront/src/lib/tot/ToTClient.ts +3 -3
  111. package/apps/storefront/src/lib/tot/query.ts +32 -0
  112. package/apps/storefront/src/lib/webhooks/cloudflareQueueDispatcher.ts +82 -0
  113. package/apps/storefront/src/lib/webhooks/deliveryEngine.ts +245 -0
  114. package/apps/storefront/src/lib/webhooks/deliveryMapper.ts +34 -0
  115. package/apps/storefront/src/lib/webhooks/deliveryStore.ts +668 -0
  116. package/apps/storefront/src/lib/webhooks/dispatcher.ts +168 -0
  117. package/apps/storefront/src/lib/webhooks/emit.ts +167 -0
  118. package/apps/storefront/src/lib/webhooks/endpointGuard.ts +135 -0
  119. package/apps/storefront/src/lib/webhooks/events.ts +98 -0
  120. package/apps/storefront/src/lib/webhooks/getDispatcher.ts +49 -0
  121. package/apps/storefront/src/lib/webhooks/signing.ts +29 -0
  122. package/apps/storefront/src/lib/webhooks/webhookSigningKey.ts +146 -0
  123. package/apps/storefront/src/middleware/index.ts +28 -13
  124. package/apps/storefront/src/pages/404.astro +21 -9
  125. package/apps/storefront/src/pages/[...slug].astro +36 -2
  126. package/apps/storefront/src/pages/admin.astro +29 -3
  127. package/apps/storefront/src/pages/api/apps/admin/credentials/rotate.ts +60 -0
  128. package/apps/storefront/src/pages/api/apps/admin/health.ts +44 -0
  129. package/apps/storefront/src/pages/api/apps/admin/install.ts +100 -0
  130. package/apps/storefront/src/pages/api/apps/admin/list.ts +26 -0
  131. package/apps/storefront/src/pages/api/apps/admin/resume.ts +56 -0
  132. package/apps/storefront/src/pages/api/apps/admin/suspend.ts +57 -0
  133. package/apps/storefront/src/pages/api/apps/admin/uninstall.ts +74 -0
  134. package/apps/storefront/src/pages/api/apps/admin/update.ts +103 -0
  135. package/apps/storefront/src/pages/api/apps/admin/webhooks/deliveries/[deliveryId]/replay.ts +59 -0
  136. package/apps/storefront/src/pages/api/apps/admin/webhooks/deliveries.ts +51 -0
  137. package/apps/storefront/src/pages/api/apps/internal/order-forward.ts +172 -0
  138. package/apps/storefront/src/pages/api/apps/oauth/token.ts +87 -0
  139. package/apps/storefront/src/pages/api/apps/v1/attribution.ts +142 -0
  140. package/apps/storefront/src/pages/api/apps/v1/catalog/products/[handle].ts +39 -0
  141. package/apps/storefront/src/pages/api/apps/v1/catalog/products.ts +49 -0
  142. package/apps/storefront/src/pages/api/apps/v1/health.ts +32 -0
  143. package/apps/storefront/src/pages/api/apps/v1/inventory.ts +59 -0
  144. package/apps/storefront/src/pages/api/apps/v1/orders/[id].ts +48 -0
  145. package/apps/storefront/src/pages/api/apps/v1/orders.ts +73 -0
  146. package/apps/storefront/src/pages/api/apps/v1/reports.ts +21 -0
  147. package/apps/storefront/src/pages/api/apps/v1/webhooks/deliveries/[deliveryId]/replay.ts +62 -0
  148. package/apps/storefront/src/pages/api/apps/v1/webhooks/deliveries.ts +47 -0
  149. package/apps/storefront/src/pages/api/auth/magic-exchange.ts +48 -1
  150. package/apps/storefront/src/pages/api/auth/step-up-send.ts +57 -0
  151. package/apps/storefront/src/pages/api/auth/step-up-verify.ts +129 -0
  152. package/apps/storefront/src/pages/api/auth/verify.ts +23 -0
  153. package/apps/storefront/src/pages/api/compliance/preflight.ts +206 -0
  154. package/apps/storefront/src/pages/api/rum/vitals.ts +54 -0
  155. package/apps/storefront/src/pages/api/test/dev-session.ts +133 -0
  156. package/apps/storefront/src/pages/auth/login.astro +197 -41
  157. package/apps/storefront/src/pages/auth/magic.astro +75 -43
  158. package/apps/storefront/src/pages/blog/[slug].astro +107 -0
  159. package/apps/storefront/src/pages/blog/index.astro +98 -0
  160. package/apps/storefront/src/pages/capabilities.astro +8 -0
  161. package/apps/storefront/src/pages/cockpit.astro +433 -69
  162. package/apps/storefront/src/pages/collections/[handle].astro +8 -0
  163. package/apps/storefront/src/pages/collections/index.astro +10 -2
  164. package/apps/storefront/src/pages/dashboard/[appDomain]/apps/index.astro +119 -0
  165. package/apps/storefront/src/pages/dashboard/[appDomain]/index.astro +5 -0
  166. package/apps/storefront/src/pages/index.astro +57 -0
  167. package/apps/storefront/src/pages/llms.txt.ts +31 -10
  168. package/apps/storefront/src/pages/products/[handle].astro +100 -9
  169. package/apps/storefront/src/pages/sitemap.xml.ts +21 -4
  170. package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +198 -0
  171. package/apps/storefront/src/pages/style-guide/[tenant]/chrome/[theme].astro +7 -0
  172. package/apps/storefront/src/pages/style-guide/[tenant]/guide/[theme].astro +7 -0
  173. package/apps/storefront/src/pages/style-guide/[tenant]/index.astro +7 -0
  174. package/apps/storefront/src/pages/style-guide/index.astro +10 -0
  175. package/apps/storefront/src/styles/fonts.css +54 -0
  176. package/apps/storefront/src/styles/global.css +22 -2
  177. package/apps/storefront/src/themes/schema.ts +3 -25
  178. package/apps/storefront/tsconfig.json +1 -1
  179. package/apps/storefront/vitest.config.ts +4 -1
  180. package/package.json +1 -1
  181. package/packages/public-runtime/src/candidate-index.ts +311 -0
  182. package/packages/public-runtime/src/checkout.ts +94 -2
  183. package/packages/public-runtime/src/compliance/evaluate.ts +265 -0
  184. package/packages/public-runtime/src/compliance/evidence-signals.ts +81 -0
  185. package/packages/public-runtime/src/compliance/index.ts +22 -0
  186. package/packages/public-runtime/src/compliance/pact-report.ts +94 -0
  187. package/packages/public-runtime/src/compliance/profile.ts +198 -0
  188. package/packages/public-runtime/src/compliance/ruleset.ts +117 -0
  189. package/packages/public-runtime/src/compliance/verification.ts +81 -0
  190. package/packages/public-runtime/src/csp.ts +27 -3
  191. package/packages/public-runtime/src/customization-reconcile.ts +35 -0
  192. package/packages/public-runtime/src/customization-runtime.ts +8 -0
  193. package/packages/public-runtime/src/customization-versioning.ts +17 -0
  194. package/packages/public-runtime/src/extension-contract.ts +2 -1
  195. package/packages/public-runtime/src/hash.ts +25 -0
  196. package/packages/public-runtime/src/index.ts +6 -0
  197. package/packages/public-runtime/src/membership.ts +353 -0
  198. package/packages/public-runtime/src/product.ts +24 -2
  199. package/packages/public-runtime/src/review-trust-proof.ts +194 -0
  200. package/packages/public-runtime/src/tenant-assets.ts +40 -5
  201. package/packages/public-runtime/src/tenant.ts +236 -0
  202. package/packages/public-runtime/src/widget-postmessage.ts +205 -0
  203. package/scripts/dev/publish.mjs +158 -0
  204. package/scripts/dev/transient-files.mjs +2 -1
  205. package/tenants/home/public/fonts/inter-latin-400-normal.woff2 +0 -0
  206. package/tenants/home/public/fonts/inter-latin-500-normal.woff2 +0 -0
  207. package/tenants/home/public/fonts/inter-latin-600-normal.woff2 +0 -0
  208. package/tenants/home/public/fonts/inter-latin-ext-400-normal.woff2 +0 -0
  209. package/tenants/home/public/fonts/inter-latin-ext-500-normal.woff2 +0 -0
  210. package/tenants/home/public/fonts/inter-latin-ext-600-normal.woff2 +0 -0
  211. package/tenants/home/public/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  212. package/tenants/home/public/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
  213. package/tenants/home/public/fonts/jetbrains-mono-latin-ext-400-normal.woff2 +0 -0
  214. package/tenants/home/public/fonts/jetbrains-mono-latin-ext-500-normal.woff2 +0 -0
  215. package/tenants/home/public/fonts/plus-jakarta-sans-latin-500-normal.woff2 +0 -0
  216. package/tenants/home/public/fonts/plus-jakarta-sans-latin-600-normal.woff2 +0 -0
  217. package/tenants/home/public/fonts/plus-jakarta-sans-latin-700-normal.woff2 +0 -0
  218. package/tenants/home/public/fonts/plus-jakarta-sans-latin-800-normal.woff2 +0 -0
  219. package/tenants/home/public/fonts/plus-jakarta-sans-latin-ext-500-normal.woff2 +0 -0
  220. package/tenants/home/public/fonts/plus-jakarta-sans-latin-ext-600-normal.woff2 +0 -0
  221. package/tenants/home/public/fonts/plus-jakarta-sans-latin-ext-700-normal.woff2 +0 -0
  222. package/tenants/home/public/fonts/plus-jakarta-sans-latin-ext-800-normal.woff2 +0 -0
  223. package/tenants/home/public/pages/storefront.css +23 -0
  224. package/apps/storefront/src/lib/dev/hostedCockpit.ts +0 -169
@@ -0,0 +1,843 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "63405d13-2199-40e7-95d0-8ff7edd4b18f",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "app_attributions": {
8
+ "name": "app_attributions",
9
+ "columns": {
10
+ "install_id": {
11
+ "name": "install_id",
12
+ "type": "text",
13
+ "primaryKey": false,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "attribution_id": {
18
+ "name": "attribution_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "tenant_id": {
25
+ "name": "tenant_id",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "order_id": {
32
+ "name": "order_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "campaign": {
39
+ "name": "campaign",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "referral_code": {
46
+ "name": "referral_code",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "commission_amount": {
53
+ "name": "commission_amount",
54
+ "type": "real",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false
58
+ },
59
+ "commission_currency": {
60
+ "name": "commission_currency",
61
+ "type": "text",
62
+ "primaryKey": false,
63
+ "notNull": false,
64
+ "autoincrement": false
65
+ },
66
+ "customer_hash": {
67
+ "name": "customer_hash",
68
+ "type": "text",
69
+ "primaryKey": false,
70
+ "notNull": false,
71
+ "autoincrement": false
72
+ },
73
+ "recorded_at": {
74
+ "name": "recorded_at",
75
+ "type": "text",
76
+ "primaryKey": false,
77
+ "notNull": true,
78
+ "autoincrement": false
79
+ }
80
+ },
81
+ "indexes": {
82
+ "idx_app_attributions_tenant_order": {
83
+ "name": "idx_app_attributions_tenant_order",
84
+ "columns": [
85
+ "tenant_id",
86
+ "order_id"
87
+ ],
88
+ "isUnique": false
89
+ }
90
+ },
91
+ "foreignKeys": {},
92
+ "compositePrimaryKeys": {
93
+ "app_attributions_install_id_attribution_id_pk": {
94
+ "columns": [
95
+ "install_id",
96
+ "attribution_id"
97
+ ],
98
+ "name": "app_attributions_install_id_attribution_id_pk"
99
+ }
100
+ },
101
+ "uniqueConstraints": {},
102
+ "checkConstraints": {}
103
+ },
104
+ "app_audit_log": {
105
+ "name": "app_audit_log",
106
+ "columns": {
107
+ "id": {
108
+ "name": "id",
109
+ "type": "text",
110
+ "primaryKey": true,
111
+ "notNull": true,
112
+ "autoincrement": false
113
+ },
114
+ "install_id": {
115
+ "name": "install_id",
116
+ "type": "text",
117
+ "primaryKey": false,
118
+ "notNull": true,
119
+ "autoincrement": false
120
+ },
121
+ "tenant_id": {
122
+ "name": "tenant_id",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": true,
126
+ "autoincrement": false
127
+ },
128
+ "event": {
129
+ "name": "event",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "actor": {
136
+ "name": "actor",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false
141
+ },
142
+ "trace_id": {
143
+ "name": "trace_id",
144
+ "type": "text",
145
+ "primaryKey": false,
146
+ "notNull": false,
147
+ "autoincrement": false
148
+ },
149
+ "detail": {
150
+ "name": "detail",
151
+ "type": "text",
152
+ "primaryKey": false,
153
+ "notNull": true,
154
+ "autoincrement": false,
155
+ "default": "'{}'"
156
+ },
157
+ "at": {
158
+ "name": "at",
159
+ "type": "text",
160
+ "primaryKey": false,
161
+ "notNull": true,
162
+ "autoincrement": false
163
+ }
164
+ },
165
+ "indexes": {
166
+ "idx_app_audit_install": {
167
+ "name": "idx_app_audit_install",
168
+ "columns": [
169
+ "install_id"
170
+ ],
171
+ "isUnique": false
172
+ }
173
+ },
174
+ "foreignKeys": {},
175
+ "compositePrimaryKeys": {},
176
+ "uniqueConstraints": {},
177
+ "checkConstraints": {}
178
+ },
179
+ "app_credentials": {
180
+ "name": "app_credentials",
181
+ "columns": {
182
+ "install_id": {
183
+ "name": "install_id",
184
+ "type": "text",
185
+ "primaryKey": true,
186
+ "notNull": true,
187
+ "autoincrement": false
188
+ },
189
+ "client_id": {
190
+ "name": "client_id",
191
+ "type": "text",
192
+ "primaryKey": false,
193
+ "notNull": true,
194
+ "autoincrement": false
195
+ },
196
+ "secret_hash": {
197
+ "name": "secret_hash",
198
+ "type": "text",
199
+ "primaryKey": false,
200
+ "notNull": true,
201
+ "autoincrement": false
202
+ },
203
+ "secret_created_at": {
204
+ "name": "secret_created_at",
205
+ "type": "text",
206
+ "primaryKey": false,
207
+ "notNull": true,
208
+ "autoincrement": false
209
+ },
210
+ "rotated_at": {
211
+ "name": "rotated_at",
212
+ "type": "text",
213
+ "primaryKey": false,
214
+ "notNull": false,
215
+ "autoincrement": false
216
+ },
217
+ "jwks_kid": {
218
+ "name": "jwks_kid",
219
+ "type": "text",
220
+ "primaryKey": false,
221
+ "notNull": true,
222
+ "autoincrement": false
223
+ }
224
+ },
225
+ "indexes": {
226
+ "app_credentials_client_id_unique": {
227
+ "name": "app_credentials_client_id_unique",
228
+ "columns": [
229
+ "client_id"
230
+ ],
231
+ "isUnique": true
232
+ }
233
+ },
234
+ "foreignKeys": {},
235
+ "compositePrimaryKeys": {},
236
+ "uniqueConstraints": {},
237
+ "checkConstraints": {}
238
+ },
239
+ "app_installs": {
240
+ "name": "app_installs",
241
+ "columns": {
242
+ "install_id": {
243
+ "name": "install_id",
244
+ "type": "text",
245
+ "primaryKey": true,
246
+ "notNull": true,
247
+ "autoincrement": false
248
+ },
249
+ "app_id": {
250
+ "name": "app_id",
251
+ "type": "text",
252
+ "primaryKey": false,
253
+ "notNull": true,
254
+ "autoincrement": false
255
+ },
256
+ "app_version": {
257
+ "name": "app_version",
258
+ "type": "text",
259
+ "primaryKey": false,
260
+ "notNull": true,
261
+ "autoincrement": false
262
+ },
263
+ "tenant_id": {
264
+ "name": "tenant_id",
265
+ "type": "text",
266
+ "primaryKey": false,
267
+ "notNull": true,
268
+ "autoincrement": false
269
+ },
270
+ "env": {
271
+ "name": "env",
272
+ "type": "text",
273
+ "primaryKey": false,
274
+ "notNull": true,
275
+ "autoincrement": false
276
+ },
277
+ "status": {
278
+ "name": "status",
279
+ "type": "text",
280
+ "primaryKey": false,
281
+ "notNull": true,
282
+ "autoincrement": false,
283
+ "default": "'active'"
284
+ },
285
+ "scopes": {
286
+ "name": "scopes",
287
+ "type": "text",
288
+ "primaryKey": false,
289
+ "notNull": true,
290
+ "autoincrement": false,
291
+ "default": "'[]'"
292
+ },
293
+ "manifest": {
294
+ "name": "manifest",
295
+ "type": "text",
296
+ "primaryKey": false,
297
+ "notNull": true,
298
+ "autoincrement": false
299
+ },
300
+ "webhook_endpoint": {
301
+ "name": "webhook_endpoint",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": false,
305
+ "autoincrement": false
306
+ },
307
+ "widget_placements": {
308
+ "name": "widget_placements",
309
+ "type": "text",
310
+ "primaryKey": false,
311
+ "notNull": true,
312
+ "autoincrement": false,
313
+ "default": "'[]'"
314
+ },
315
+ "install_actor": {
316
+ "name": "install_actor",
317
+ "type": "text",
318
+ "primaryKey": false,
319
+ "notNull": true,
320
+ "autoincrement": false
321
+ },
322
+ "created_at": {
323
+ "name": "created_at",
324
+ "type": "text",
325
+ "primaryKey": false,
326
+ "notNull": true,
327
+ "autoincrement": false
328
+ },
329
+ "updated_at": {
330
+ "name": "updated_at",
331
+ "type": "text",
332
+ "primaryKey": false,
333
+ "notNull": true,
334
+ "autoincrement": false
335
+ }
336
+ },
337
+ "indexes": {
338
+ "uq_app_installs_app_tenant_env": {
339
+ "name": "uq_app_installs_app_tenant_env",
340
+ "columns": [
341
+ "app_id",
342
+ "tenant_id",
343
+ "env"
344
+ ],
345
+ "isUnique": true
346
+ },
347
+ "idx_app_installs_tenant": {
348
+ "name": "idx_app_installs_tenant",
349
+ "columns": [
350
+ "tenant_id"
351
+ ],
352
+ "isUnique": false
353
+ }
354
+ },
355
+ "foreignKeys": {},
356
+ "compositePrimaryKeys": {},
357
+ "uniqueConstraints": {},
358
+ "checkConstraints": {}
359
+ },
360
+ "idempotency_keys": {
361
+ "name": "idempotency_keys",
362
+ "columns": {
363
+ "install_id": {
364
+ "name": "install_id",
365
+ "type": "text",
366
+ "primaryKey": false,
367
+ "notNull": true,
368
+ "autoincrement": false
369
+ },
370
+ "idempotency_key": {
371
+ "name": "idempotency_key",
372
+ "type": "text",
373
+ "primaryKey": false,
374
+ "notNull": true,
375
+ "autoincrement": false
376
+ },
377
+ "body_hash": {
378
+ "name": "body_hash",
379
+ "type": "text",
380
+ "primaryKey": false,
381
+ "notNull": true,
382
+ "autoincrement": false
383
+ },
384
+ "response_body": {
385
+ "name": "response_body",
386
+ "type": "text",
387
+ "primaryKey": false,
388
+ "notNull": true,
389
+ "autoincrement": false
390
+ },
391
+ "created_at": {
392
+ "name": "created_at",
393
+ "type": "text",
394
+ "primaryKey": false,
395
+ "notNull": true,
396
+ "autoincrement": false
397
+ }
398
+ },
399
+ "indexes": {},
400
+ "foreignKeys": {},
401
+ "compositePrimaryKeys": {
402
+ "idempotency_keys_install_id_idempotency_key_pk": {
403
+ "columns": [
404
+ "install_id",
405
+ "idempotency_key"
406
+ ],
407
+ "name": "idempotency_keys_install_id_idempotency_key_pk"
408
+ }
409
+ },
410
+ "uniqueConstraints": {},
411
+ "checkConstraints": {}
412
+ },
413
+ "orders": {
414
+ "name": "orders",
415
+ "columns": {
416
+ "tenant_id": {
417
+ "name": "tenant_id",
418
+ "type": "text",
419
+ "primaryKey": false,
420
+ "notNull": true,
421
+ "autoincrement": false
422
+ },
423
+ "external_order_id": {
424
+ "name": "external_order_id",
425
+ "type": "text",
426
+ "primaryKey": false,
427
+ "notNull": true,
428
+ "autoincrement": false
429
+ },
430
+ "env": {
431
+ "name": "env",
432
+ "type": "text",
433
+ "primaryKey": false,
434
+ "notNull": true,
435
+ "autoincrement": false
436
+ },
437
+ "status": {
438
+ "name": "status",
439
+ "type": "text",
440
+ "primaryKey": false,
441
+ "notNull": true,
442
+ "autoincrement": false
443
+ },
444
+ "currency": {
445
+ "name": "currency",
446
+ "type": "text",
447
+ "primaryKey": false,
448
+ "notNull": true,
449
+ "autoincrement": false
450
+ },
451
+ "total": {
452
+ "name": "total",
453
+ "type": "real",
454
+ "primaryKey": false,
455
+ "notNull": true,
456
+ "autoincrement": false,
457
+ "default": 0
458
+ },
459
+ "subtotal": {
460
+ "name": "subtotal",
461
+ "type": "real",
462
+ "primaryKey": false,
463
+ "notNull": false,
464
+ "autoincrement": false
465
+ },
466
+ "customer_hash": {
467
+ "name": "customer_hash",
468
+ "type": "text",
469
+ "primaryKey": false,
470
+ "notNull": false,
471
+ "autoincrement": false
472
+ },
473
+ "line_items": {
474
+ "name": "line_items",
475
+ "type": "text",
476
+ "primaryKey": false,
477
+ "notNull": true,
478
+ "autoincrement": false,
479
+ "default": "'[]'"
480
+ },
481
+ "created_at": {
482
+ "name": "created_at",
483
+ "type": "text",
484
+ "primaryKey": false,
485
+ "notNull": true,
486
+ "autoincrement": false
487
+ },
488
+ "updated_at": {
489
+ "name": "updated_at",
490
+ "type": "text",
491
+ "primaryKey": false,
492
+ "notNull": true,
493
+ "autoincrement": false
494
+ }
495
+ },
496
+ "indexes": {
497
+ "idx_orders_tenant": {
498
+ "name": "idx_orders_tenant",
499
+ "columns": [
500
+ "tenant_id"
501
+ ],
502
+ "isUnique": false
503
+ }
504
+ },
505
+ "foreignKeys": {},
506
+ "compositePrimaryKeys": {
507
+ "orders_tenant_id_external_order_id_pk": {
508
+ "columns": [
509
+ "tenant_id",
510
+ "external_order_id"
511
+ ],
512
+ "name": "orders_tenant_id_external_order_id_pk"
513
+ }
514
+ },
515
+ "uniqueConstraints": {},
516
+ "checkConstraints": {}
517
+ },
518
+ "webhook_deliveries": {
519
+ "name": "webhook_deliveries",
520
+ "columns": {
521
+ "delivery_id": {
522
+ "name": "delivery_id",
523
+ "type": "text",
524
+ "primaryKey": true,
525
+ "notNull": true,
526
+ "autoincrement": false
527
+ },
528
+ "event_id": {
529
+ "name": "event_id",
530
+ "type": "text",
531
+ "primaryKey": false,
532
+ "notNull": true,
533
+ "autoincrement": false
534
+ },
535
+ "install_id": {
536
+ "name": "install_id",
537
+ "type": "text",
538
+ "primaryKey": false,
539
+ "notNull": true,
540
+ "autoincrement": false
541
+ },
542
+ "tenant_id": {
543
+ "name": "tenant_id",
544
+ "type": "text",
545
+ "primaryKey": false,
546
+ "notNull": true,
547
+ "autoincrement": false
548
+ },
549
+ "topic": {
550
+ "name": "topic",
551
+ "type": "text",
552
+ "primaryKey": false,
553
+ "notNull": true,
554
+ "autoincrement": false
555
+ },
556
+ "state": {
557
+ "name": "state",
558
+ "type": "text",
559
+ "primaryKey": false,
560
+ "notNull": true,
561
+ "autoincrement": false,
562
+ "default": "'pending'"
563
+ },
564
+ "attempts": {
565
+ "name": "attempts",
566
+ "type": "integer",
567
+ "primaryKey": false,
568
+ "notNull": true,
569
+ "autoincrement": false,
570
+ "default": 0
571
+ },
572
+ "last_status": {
573
+ "name": "last_status",
574
+ "type": "integer",
575
+ "primaryKey": false,
576
+ "notNull": false,
577
+ "autoincrement": false
578
+ },
579
+ "last_error_class": {
580
+ "name": "last_error_class",
581
+ "type": "text",
582
+ "primaryKey": false,
583
+ "notNull": false,
584
+ "autoincrement": false
585
+ },
586
+ "last_trace_id": {
587
+ "name": "last_trace_id",
588
+ "type": "text",
589
+ "primaryKey": false,
590
+ "notNull": false,
591
+ "autoincrement": false
592
+ },
593
+ "next_attempt_at": {
594
+ "name": "next_attempt_at",
595
+ "type": "text",
596
+ "primaryKey": false,
597
+ "notNull": false,
598
+ "autoincrement": false
599
+ },
600
+ "created_at": {
601
+ "name": "created_at",
602
+ "type": "text",
603
+ "primaryKey": false,
604
+ "notNull": true,
605
+ "autoincrement": false
606
+ },
607
+ "updated_at": {
608
+ "name": "updated_at",
609
+ "type": "text",
610
+ "primaryKey": false,
611
+ "notNull": true,
612
+ "autoincrement": false
613
+ }
614
+ },
615
+ "indexes": {
616
+ "idx_webhook_deliveries_install": {
617
+ "name": "idx_webhook_deliveries_install",
618
+ "columns": [
619
+ "install_id"
620
+ ],
621
+ "isUnique": false
622
+ },
623
+ "idx_webhook_deliveries_due": {
624
+ "name": "idx_webhook_deliveries_due",
625
+ "columns": [
626
+ "state",
627
+ "next_attempt_at"
628
+ ],
629
+ "isUnique": false
630
+ }
631
+ },
632
+ "foreignKeys": {},
633
+ "compositePrimaryKeys": {},
634
+ "uniqueConstraints": {},
635
+ "checkConstraints": {}
636
+ },
637
+ "webhook_delivery_attempts": {
638
+ "name": "webhook_delivery_attempts",
639
+ "columns": {
640
+ "id": {
641
+ "name": "id",
642
+ "type": "text",
643
+ "primaryKey": true,
644
+ "notNull": true,
645
+ "autoincrement": false
646
+ },
647
+ "delivery_id": {
648
+ "name": "delivery_id",
649
+ "type": "text",
650
+ "primaryKey": false,
651
+ "notNull": true,
652
+ "autoincrement": false
653
+ },
654
+ "attempt_no": {
655
+ "name": "attempt_no",
656
+ "type": "integer",
657
+ "primaryKey": false,
658
+ "notNull": true,
659
+ "autoincrement": false
660
+ },
661
+ "started_at": {
662
+ "name": "started_at",
663
+ "type": "text",
664
+ "primaryKey": false,
665
+ "notNull": true,
666
+ "autoincrement": false
667
+ },
668
+ "duration_ms": {
669
+ "name": "duration_ms",
670
+ "type": "integer",
671
+ "primaryKey": false,
672
+ "notNull": false,
673
+ "autoincrement": false
674
+ },
675
+ "http_status": {
676
+ "name": "http_status",
677
+ "type": "integer",
678
+ "primaryKey": false,
679
+ "notNull": false,
680
+ "autoincrement": false
681
+ },
682
+ "error_class": {
683
+ "name": "error_class",
684
+ "type": "text",
685
+ "primaryKey": false,
686
+ "notNull": false,
687
+ "autoincrement": false
688
+ },
689
+ "trace_id": {
690
+ "name": "trace_id",
691
+ "type": "text",
692
+ "primaryKey": false,
693
+ "notNull": false,
694
+ "autoincrement": false
695
+ }
696
+ },
697
+ "indexes": {
698
+ "idx_webhook_delivery_attempts_delivery": {
699
+ "name": "idx_webhook_delivery_attempts_delivery",
700
+ "columns": [
701
+ "delivery_id"
702
+ ],
703
+ "isUnique": false
704
+ }
705
+ },
706
+ "foreignKeys": {},
707
+ "compositePrimaryKeys": {},
708
+ "uniqueConstraints": {},
709
+ "checkConstraints": {}
710
+ },
711
+ "webhook_events": {
712
+ "name": "webhook_events",
713
+ "columns": {
714
+ "id": {
715
+ "name": "id",
716
+ "type": "text",
717
+ "primaryKey": true,
718
+ "notNull": true,
719
+ "autoincrement": false
720
+ },
721
+ "tenant_id": {
722
+ "name": "tenant_id",
723
+ "type": "text",
724
+ "primaryKey": false,
725
+ "notNull": true,
726
+ "autoincrement": false
727
+ },
728
+ "topic": {
729
+ "name": "topic",
730
+ "type": "text",
731
+ "primaryKey": false,
732
+ "notNull": true,
733
+ "autoincrement": false
734
+ },
735
+ "dataschema_version": {
736
+ "name": "dataschema_version",
737
+ "type": "text",
738
+ "primaryKey": false,
739
+ "notNull": true,
740
+ "autoincrement": false
741
+ },
742
+ "payload": {
743
+ "name": "payload",
744
+ "type": "text",
745
+ "primaryKey": false,
746
+ "notNull": true,
747
+ "autoincrement": false
748
+ },
749
+ "created_at": {
750
+ "name": "created_at",
751
+ "type": "text",
752
+ "primaryKey": false,
753
+ "notNull": true,
754
+ "autoincrement": false
755
+ }
756
+ },
757
+ "indexes": {},
758
+ "foreignKeys": {},
759
+ "compositePrimaryKeys": {},
760
+ "uniqueConstraints": {},
761
+ "checkConstraints": {}
762
+ },
763
+ "webhook_install_health": {
764
+ "name": "webhook_install_health",
765
+ "columns": {
766
+ "install_id": {
767
+ "name": "install_id",
768
+ "type": "text",
769
+ "primaryKey": true,
770
+ "notNull": true,
771
+ "autoincrement": false
772
+ },
773
+ "last_success_at": {
774
+ "name": "last_success_at",
775
+ "type": "text",
776
+ "primaryKey": false,
777
+ "notNull": false,
778
+ "autoincrement": false
779
+ },
780
+ "failure_streak": {
781
+ "name": "failure_streak",
782
+ "type": "integer",
783
+ "primaryKey": false,
784
+ "notNull": true,
785
+ "autoincrement": false,
786
+ "default": 0
787
+ },
788
+ "dlq_count": {
789
+ "name": "dlq_count",
790
+ "type": "integer",
791
+ "primaryKey": false,
792
+ "notNull": true,
793
+ "autoincrement": false,
794
+ "default": 0
795
+ },
796
+ "last_status": {
797
+ "name": "last_status",
798
+ "type": "integer",
799
+ "primaryKey": false,
800
+ "notNull": false,
801
+ "autoincrement": false
802
+ },
803
+ "last_error_class": {
804
+ "name": "last_error_class",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": false,
808
+ "autoincrement": false
809
+ },
810
+ "recent_trace_ids": {
811
+ "name": "recent_trace_ids",
812
+ "type": "text",
813
+ "primaryKey": false,
814
+ "notNull": true,
815
+ "autoincrement": false,
816
+ "default": "'[]'"
817
+ },
818
+ "updated_at": {
819
+ "name": "updated_at",
820
+ "type": "text",
821
+ "primaryKey": false,
822
+ "notNull": true,
823
+ "autoincrement": false
824
+ }
825
+ },
826
+ "indexes": {},
827
+ "foreignKeys": {},
828
+ "compositePrimaryKeys": {},
829
+ "uniqueConstraints": {},
830
+ "checkConstraints": {}
831
+ }
832
+ },
833
+ "views": {},
834
+ "enums": {},
835
+ "_meta": {
836
+ "schemas": {},
837
+ "tables": {},
838
+ "columns": {}
839
+ },
840
+ "internal": {
841
+ "indexes": {}
842
+ }
843
+ }