@hexclave/shared 1.0.41 → 1.0.42

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 (1066) hide show
  1. package/dist/admin-interface-Y9EZqwD6.d.ts +379 -0
  2. package/dist/admin-interface-Y9EZqwD6.d.ts.map +1 -0
  3. package/dist/admin-metrics-bsOkw4YQ.d.ts +807 -0
  4. package/dist/admin-metrics-bsOkw4YQ.d.ts.map +1 -0
  5. package/dist/ai/image-limits.d.ts.map +1 -1
  6. package/dist/ai/image-limits.js +6 -7
  7. package/dist/ai/image-limits.js.map +1 -1
  8. package/dist/ai/llms/llms.d.ts.map +1 -1
  9. package/dist/ai/llms/llms.js +2 -4
  10. package/dist/ai/llms/llms.js.map +1 -1
  11. package/dist/ai/unified-prompts/reminders.js +3 -6
  12. package/dist/ai/unified-prompts/reminders.js.map +1 -1
  13. package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -1
  14. package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +2 -5
  15. package/dist/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -1
  16. package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.js +3 -6
  17. package/dist/ai/unified-prompts/skill-site-prompt-parts/brain.js.map +1 -1
  18. package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.js +3 -6
  19. package/dist/ai/unified-prompts/skill-site-prompt-parts/cli-help.js.map +1 -1
  20. package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.js +3 -6
  21. package/dist/ai/unified-prompts/skill-site-prompt-parts/config-docs.js.map +1 -1
  22. package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js +3 -6
  23. package/dist/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js.map +1 -1
  24. package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js +3 -6
  25. package/dist/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js.map +1 -1
  26. package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts.map +1 -1
  27. package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.js +5 -6
  28. package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-index.js.map +1 -1
  29. package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js +1 -2
  30. package/dist/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js.map +1 -1
  31. package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js +3 -6
  32. package/dist/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js.map +1 -1
  33. package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js +3 -6
  34. package/dist/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js.map +1 -1
  35. package/dist/ai/unified-prompts/skill-site-prompt.d.ts.map +1 -1
  36. package/dist/ai/unified-prompts/skill-site-prompt.js +2 -4
  37. package/dist/ai/unified-prompts/skill-site-prompt.js.map +1 -1
  38. package/dist/analytics-IjkAsefy.d.ts +14 -0
  39. package/dist/analytics-IjkAsefy.d.ts.map +1 -0
  40. package/dist/apps/apps-config.d.ts.map +1 -1
  41. package/dist/apps/apps-config.js +2 -3
  42. package/dist/apps/apps-config.js.map +1 -1
  43. package/dist/apps/apps-ui.d.ts +1 -2
  44. package/dist/apps/apps-ui.d.ts.map +1 -1
  45. package/dist/apps/apps-ui.js +4 -5
  46. package/dist/apps/apps-ui.js.map +1 -1
  47. package/dist/client-interface-iIw4nU5k.d.ts +447 -0
  48. package/dist/client-interface-iIw4nU5k.d.ts.map +1 -0
  49. package/dist/config/db-sync-mappings.js +2 -3
  50. package/dist/config/db-sync-mappings.js.map +1 -1
  51. package/dist/config/format.d.ts +2 -61
  52. package/dist/config/format.js +2 -192
  53. package/dist/config/format.js.map +1 -1
  54. package/dist/config/migrate-catalogs-to-product-lines.d.ts.map +1 -1
  55. package/dist/config/migrate-catalogs-to-product-lines.js +2 -196
  56. package/dist/config/migrate-catalogs-to-product-lines.js.map +1 -1
  57. package/dist/config/schema-fuzzer.test.js +18 -172
  58. package/dist/config/schema-fuzzer.test.js.map +1 -1
  59. package/dist/config/schema.d.ts +2 -2328
  60. package/dist/config/schema.js +6 -351
  61. package/dist/config/schema.js.map +1 -1
  62. package/dist/config-authoring.d.ts +1 -1
  63. package/dist/config-authoring.d.ts.map +1 -1
  64. package/dist/config-authoring.js +2 -3
  65. package/dist/config-authoring.js.map +1 -1
  66. package/dist/config-authoring.test.js +1 -3
  67. package/dist/config-authoring.test.js.map +1 -1
  68. package/dist/config-eval.d.ts.map +1 -1
  69. package/dist/config-eval.js +4 -46
  70. package/dist/config-eval.js.map +1 -1
  71. package/dist/config-rendering.d.ts.map +1 -1
  72. package/dist/config-rendering.js +2 -48
  73. package/dist/config-rendering.js.map +1 -1
  74. package/dist/connected-accounts-D5CKe50A.d.ts +67 -0
  75. package/dist/connected-accounts-D5CKe50A.d.ts.map +1 -0
  76. package/dist/contact-channels-DW8yQxlc.d.ts +180 -0
  77. package/dist/contact-channels-DW8yQxlc.d.ts.map +1 -0
  78. package/dist/country-codes-CRWDroBE.d.ts +11 -0
  79. package/dist/country-codes-CRWDroBE.d.ts.map +1 -0
  80. package/dist/crud-CqmEW9s6.d.ts +98 -0
  81. package/dist/crud-CqmEW9s6.d.ts.map +1 -0
  82. package/dist/crud.d.ts +2 -98
  83. package/dist/crud.js +3 -71
  84. package/dist/crud.js.map +1 -1
  85. package/dist/currency-constants-Cq_q8twn.d.ts +45 -0
  86. package/dist/currency-constants-Cq_q8twn.d.ts.map +1 -0
  87. package/dist/current-user-BBoN3hsn.d.ts +284 -0
  88. package/dist/current-user-BBoN3hsn.d.ts.map +1 -0
  89. package/dist/dates-B6ne9iOR.d.ts +23 -0
  90. package/dist/dates-B6ne9iOR.d.ts.map +1 -0
  91. package/dist/email-outbox-B1wmVPRG.d.ts +1464 -0
  92. package/dist/{interface/crud/email-outbox.d.ts.map → email-outbox-B1wmVPRG.d.ts.map} +1 -1
  93. package/dist/emails-Ba4yEaCS.d.ts +40 -0
  94. package/dist/emails-Ba4yEaCS.d.ts.map +1 -0
  95. package/dist/errors-Cl-RUyed.d.ts +238 -0
  96. package/dist/errors-Cl-RUyed.d.ts.map +1 -0
  97. package/dist/esm/ai/image-limits.d.ts.map +1 -1
  98. package/dist/esm/ai/image-limits.js +5 -5
  99. package/dist/esm/ai/image-limits.js.map +1 -1
  100. package/dist/esm/ai/llms/llms.d.ts +1 -1
  101. package/dist/esm/ai/llms/llms.d.ts.map +1 -1
  102. package/dist/esm/ai/llms/llms.js +1 -2
  103. package/dist/esm/ai/llms/llms.js.map +1 -1
  104. package/dist/esm/ai/unified-prompts/reminders.js +2 -3
  105. package/dist/esm/ai/unified-prompts/reminders.js.map +1 -1
  106. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.d.ts.map +1 -1
  107. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js +25 -28
  108. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/ai-setup-prompt.js.map +1 -1
  109. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.js +1 -2
  110. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/brain.js.map +1 -1
  111. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.js +1 -2
  112. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/cli-help.js.map +1 -1
  113. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.js +1 -2
  114. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/config-docs.js.map +1 -1
  115. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js +1 -2
  116. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/custom-components-instructions.js.map +1 -1
  117. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js +1 -2
  118. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/dashboard-instructions.js.map +1 -1
  119. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.d.ts.map +1 -1
  120. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.js +2 -3
  121. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-index.js.map +1 -1
  122. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js +1 -1
  123. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/docs-json.generated.js.map +1 -1
  124. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js +1 -2
  125. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/openapi-specs.js.map +1 -1
  126. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js +1 -2
  127. package/dist/esm/ai/unified-prompts/skill-site-prompt-parts/sdk-interface-source.js.map +1 -1
  128. package/dist/esm/ai/unified-prompts/skill-site-prompt.d.ts.map +1 -1
  129. package/dist/esm/ai/unified-prompts/skill-site-prompt.js +1 -2
  130. package/dist/esm/ai/unified-prompts/skill-site-prompt.js.map +1 -1
  131. package/dist/esm/apps/apps-config.d.ts.map +1 -1
  132. package/dist/esm/apps/apps-config.js +1 -1
  133. package/dist/esm/apps/apps-config.js.map +1 -1
  134. package/dist/esm/apps/apps-ui.d.ts +2 -3
  135. package/dist/esm/apps/apps-ui.d.ts.map +1 -1
  136. package/dist/esm/apps/apps-ui.js +2 -3
  137. package/dist/esm/apps/apps-ui.js.map +1 -1
  138. package/dist/esm/config/db-sync-mappings.js +1 -1
  139. package/dist/esm/config/db-sync-mappings.js.map +1 -1
  140. package/dist/esm/config/format.d.ts +1 -1
  141. package/dist/esm/config/format.d.ts.map +1 -1
  142. package/dist/esm/config/format.js +1 -190
  143. package/dist/esm/config/format.js.map +1 -1
  144. package/dist/esm/config/migrate-catalogs-to-product-lines.d.ts.map +1 -1
  145. package/dist/esm/config/migrate-catalogs-to-product-lines.js +1 -194
  146. package/dist/esm/config/migrate-catalogs-to-product-lines.js.map +1 -1
  147. package/dist/esm/config/schema-fuzzer.test.js +20 -173
  148. package/dist/esm/config/schema-fuzzer.test.js.map +1 -1
  149. package/dist/esm/config/schema.d.ts +227 -228
  150. package/dist/esm/config/schema.d.ts.map +1 -1
  151. package/dist/esm/config/schema.js +2 -347
  152. package/dist/esm/config/schema.js.map +1 -1
  153. package/dist/esm/config-authoring.d.ts +1 -1
  154. package/dist/esm/config-authoring.d.ts.map +1 -1
  155. package/dist/esm/config-authoring.js +1 -1
  156. package/dist/esm/config-authoring.js.map +1 -1
  157. package/dist/esm/config-authoring.test.js +2 -3
  158. package/dist/esm/config-authoring.test.js.map +1 -1
  159. package/dist/esm/config-eval.d.ts +1 -1
  160. package/dist/esm/config-eval.d.ts.map +1 -1
  161. package/dist/esm/config-eval.js +1 -43
  162. package/dist/esm/config-eval.js.map +1 -1
  163. package/dist/esm/config-rendering.d.ts.map +1 -1
  164. package/dist/esm/config-rendering.js +1 -46
  165. package/dist/esm/config-rendering.js.map +1 -1
  166. package/dist/esm/crud.d.ts +1 -1
  167. package/dist/esm/crud.d.ts.map +1 -1
  168. package/dist/esm/crud.js +2 -69
  169. package/dist/esm/crud.js.map +1 -1
  170. package/dist/esm/helpers/emails.js +1 -2
  171. package/dist/esm/helpers/emails.js.map +1 -1
  172. package/dist/esm/helpers/init-prompt.d.ts.map +1 -1
  173. package/dist/esm/helpers/init-prompt.js +1 -2
  174. package/dist/esm/helpers/init-prompt.js.map +1 -1
  175. package/dist/esm/helpers/password.d.ts +1 -1
  176. package/dist/esm/helpers/password.d.ts.map +1 -1
  177. package/dist/esm/helpers/password.js +1 -2
  178. package/dist/esm/helpers/password.js.map +1 -1
  179. package/dist/esm/helpers/production-mode.d.ts +1 -1
  180. package/dist/esm/helpers/production-mode.d.ts.map +1 -1
  181. package/dist/esm/helpers/production-mode.js +1 -2
  182. package/dist/esm/helpers/production-mode.js.map +1 -1
  183. package/dist/esm/helpers/support-sla.d.ts.map +1 -1
  184. package/dist/esm/helpers/support-sla.js +1 -1
  185. package/dist/esm/helpers/support-sla.js.map +1 -1
  186. package/dist/esm/helpers/support-sla.test.js +2 -3
  187. package/dist/esm/helpers/support-sla.test.js.map +1 -1
  188. package/dist/esm/helpers/vault/client-side.d.ts.map +1 -1
  189. package/dist/esm/helpers/vault/client-side.js +1 -20
  190. package/dist/esm/helpers/vault/client-side.js.map +1 -1
  191. package/dist/esm/helpers/vault/server-side.js +1 -2
  192. package/dist/esm/helpers/vault/server-side.js.map +1 -1
  193. package/dist/esm/hooks/use-async-callback.d.ts.map +1 -1
  194. package/dist/esm/hooks/use-async-callback.js +1 -2
  195. package/dist/esm/hooks/use-async-callback.js.map +1 -1
  196. package/dist/esm/hooks/use-async-external-store.d.ts +1 -1
  197. package/dist/esm/hooks/use-async-external-store.d.ts.map +1 -1
  198. package/dist/esm/hooks/use-async-external-store.js +1 -2
  199. package/dist/esm/hooks/use-async-external-store.js.map +1 -1
  200. package/dist/esm/hooks/use-hash.js +1 -2
  201. package/dist/esm/hooks/use-hash.js.map +1 -1
  202. package/dist/esm/hooks/use-hover.d.ts.map +1 -1
  203. package/dist/esm/hooks/use-hover.js +1 -2
  204. package/dist/esm/hooks/use-hover.js.map +1 -1
  205. package/dist/esm/hooks/use-strict-memo.d.ts.map +1 -1
  206. package/dist/esm/hooks/use-strict-memo.js +1 -70
  207. package/dist/esm/hooks/use-strict-memo.js.map +1 -1
  208. package/dist/esm/index.d.ts +4 -4
  209. package/dist/esm/index.js +1 -2
  210. package/dist/esm/interface/admin-interface.d.ts +19 -19
  211. package/dist/esm/interface/admin-interface.d.ts.map +1 -1
  212. package/dist/esm/interface/admin-interface.js +2 -3
  213. package/dist/esm/interface/admin-interface.js.map +1 -1
  214. package/dist/esm/interface/admin-metrics.d.ts +10 -10
  215. package/dist/esm/interface/admin-metrics.d.ts.map +1 -1
  216. package/dist/esm/interface/admin-metrics.js +1 -2
  217. package/dist/esm/interface/admin-metrics.js.map +1 -1
  218. package/dist/esm/interface/client-interface.d.ts +22 -22
  219. package/dist/esm/interface/client-interface.d.ts.map +1 -1
  220. package/dist/esm/interface/client-interface.js +32 -16
  221. package/dist/esm/interface/client-interface.js.map +1 -1
  222. package/dist/esm/interface/client-interface.test.js +84 -13
  223. package/dist/esm/interface/client-interface.test.js.map +1 -1
  224. package/dist/esm/interface/conversations.d.ts +8 -8
  225. package/dist/esm/interface/conversations.d.ts.map +1 -1
  226. package/dist/esm/interface/conversations.js +1 -2
  227. package/dist/esm/interface/conversations.js.map +1 -1
  228. package/dist/esm/interface/crud/analytics.d.ts.map +1 -1
  229. package/dist/esm/interface/crud/analytics.js +1 -1
  230. package/dist/esm/interface/crud/connected-accounts.d.ts +15 -17
  231. package/dist/esm/interface/crud/connected-accounts.d.ts.map +1 -1
  232. package/dist/esm/interface/crud/connected-accounts.js +1 -2
  233. package/dist/esm/interface/crud/connected-accounts.js.map +1 -1
  234. package/dist/esm/interface/crud/contact-channels.d.ts +24 -26
  235. package/dist/esm/interface/crud/contact-channels.d.ts.map +1 -1
  236. package/dist/esm/interface/crud/contact-channels.js +1 -2
  237. package/dist/esm/interface/crud/contact-channels.js.map +1 -1
  238. package/dist/esm/interface/crud/current-user.d.ts +22 -24
  239. package/dist/esm/interface/crud/current-user.d.ts.map +1 -1
  240. package/dist/esm/interface/crud/current-user.js +25 -29
  241. package/dist/esm/interface/crud/current-user.js.map +1 -1
  242. package/dist/esm/interface/crud/email-outbox.d.ts +30 -32
  243. package/dist/esm/interface/crud/email-outbox.d.ts.map +1 -1
  244. package/dist/esm/interface/crud/email-outbox.js +1 -2
  245. package/dist/esm/interface/crud/email-outbox.js.map +1 -1
  246. package/dist/esm/interface/crud/email-templates.d.ts +16 -18
  247. package/dist/esm/interface/crud/email-templates.d.ts.map +1 -1
  248. package/dist/esm/interface/crud/email-templates.js +1 -2
  249. package/dist/esm/interface/crud/email-templates.js.map +1 -1
  250. package/dist/esm/interface/crud/emails.d.ts +6 -8
  251. package/dist/esm/interface/crud/emails.d.ts.map +1 -1
  252. package/dist/esm/interface/crud/emails.js +1 -2
  253. package/dist/esm/interface/crud/emails.js.map +1 -1
  254. package/dist/esm/interface/crud/internal-api-keys.d.ts +16 -18
  255. package/dist/esm/interface/crud/internal-api-keys.d.ts.map +1 -1
  256. package/dist/esm/interface/crud/internal-api-keys.js +1 -2
  257. package/dist/esm/interface/crud/internal-api-keys.js.map +1 -1
  258. package/dist/esm/interface/crud/invoices.d.ts.map +1 -1
  259. package/dist/esm/interface/crud/invoices.js +1 -2
  260. package/dist/esm/interface/crud/invoices.js.map +1 -1
  261. package/dist/esm/interface/crud/items.d.ts +6 -8
  262. package/dist/esm/interface/crud/items.d.ts.map +1 -1
  263. package/dist/esm/interface/crud/items.js +12 -16
  264. package/dist/esm/interface/crud/items.js.map +1 -1
  265. package/dist/esm/interface/crud/notification-preferences.d.ts +6 -8
  266. package/dist/esm/interface/crud/notification-preferences.d.ts.map +1 -1
  267. package/dist/esm/interface/crud/notification-preferences.js +8 -12
  268. package/dist/esm/interface/crud/notification-preferences.js.map +1 -1
  269. package/dist/esm/interface/crud/oauth-providers.d.ts +24 -26
  270. package/dist/esm/interface/crud/oauth-providers.d.ts.map +1 -1
  271. package/dist/esm/interface/crud/oauth-providers.js +1 -2
  272. package/dist/esm/interface/crud/oauth-providers.js.map +1 -1
  273. package/dist/esm/interface/crud/products.d.ts +21 -22
  274. package/dist/esm/interface/crud/products.d.ts.map +1 -1
  275. package/dist/esm/interface/crud/products.js +3 -2
  276. package/dist/esm/interface/crud/products.js.map +1 -1
  277. package/dist/esm/interface/crud/project-api-keys.d.ts +5 -6
  278. package/dist/esm/interface/crud/project-api-keys.d.ts.map +1 -1
  279. package/dist/esm/interface/crud/project-api-keys.js +1 -2
  280. package/dist/esm/interface/crud/project-api-keys.js.map +1 -1
  281. package/dist/esm/interface/crud/project-permissions.d.ts +29 -31
  282. package/dist/esm/interface/crud/project-permissions.d.ts.map +1 -1
  283. package/dist/esm/interface/crud/project-permissions.js +1 -2
  284. package/dist/esm/interface/crud/project-permissions.js.map +1 -1
  285. package/dist/esm/interface/crud/projects.d.ts +63 -65
  286. package/dist/esm/interface/crud/projects.d.ts.map +1 -1
  287. package/dist/esm/interface/crud/projects.js +3 -2
  288. package/dist/esm/interface/crud/projects.js.map +1 -1
  289. package/dist/esm/interface/crud/session-replays.d.ts.map +1 -1
  290. package/dist/esm/interface/crud/session-replays.js +1 -1
  291. package/dist/esm/interface/crud/sessions.d.ts +15 -17
  292. package/dist/esm/interface/crud/sessions.d.ts.map +1 -1
  293. package/dist/esm/interface/crud/sessions.js +1 -2
  294. package/dist/esm/interface/crud/sessions.js.map +1 -1
  295. package/dist/esm/interface/crud/sign-up-rules.d.ts.map +1 -1
  296. package/dist/esm/interface/crud/sign-up-rules.js +1 -1
  297. package/dist/esm/interface/crud/svix-token.d.ts +8 -10
  298. package/dist/esm/interface/crud/svix-token.d.ts.map +1 -1
  299. package/dist/esm/interface/crud/svix-token.js +1 -2
  300. package/dist/esm/interface/crud/svix-token.js.map +1 -1
  301. package/dist/esm/interface/crud/team-invitation-details.d.ts +6 -8
  302. package/dist/esm/interface/crud/team-invitation-details.d.ts.map +1 -1
  303. package/dist/esm/interface/crud/team-invitation-details.js +1 -2
  304. package/dist/esm/interface/crud/team-invitation-details.js.map +1 -1
  305. package/dist/esm/interface/crud/team-invitation.d.ts +7 -9
  306. package/dist/esm/interface/crud/team-invitation.d.ts.map +1 -1
  307. package/dist/esm/interface/crud/team-invitation.js +1 -2
  308. package/dist/esm/interface/crud/team-invitation.js.map +1 -1
  309. package/dist/esm/interface/crud/team-member-profiles.d.ts +36 -38
  310. package/dist/esm/interface/crud/team-member-profiles.d.ts.map +1 -1
  311. package/dist/esm/interface/crud/team-member-profiles.js +1 -2
  312. package/dist/esm/interface/crud/team-member-profiles.js.map +1 -1
  313. package/dist/esm/interface/crud/team-memberships.d.ts +14 -16
  314. package/dist/esm/interface/crud/team-memberships.d.ts.map +1 -1
  315. package/dist/esm/interface/crud/team-memberships.js +1 -2
  316. package/dist/esm/interface/crud/team-memberships.js.map +1 -1
  317. package/dist/esm/interface/crud/team-permissions.d.ts +29 -31
  318. package/dist/esm/interface/crud/team-permissions.d.ts.map +1 -1
  319. package/dist/esm/interface/crud/team-permissions.js +1 -2
  320. package/dist/esm/interface/crud/team-permissions.js.map +1 -1
  321. package/dist/esm/interface/crud/teams.d.ts +36 -38
  322. package/dist/esm/interface/crud/teams.d.ts.map +1 -1
  323. package/dist/esm/interface/crud/teams.js +2 -4
  324. package/dist/esm/interface/crud/teams.js.map +1 -1
  325. package/dist/esm/interface/crud/transactions.d.ts +14 -16
  326. package/dist/esm/interface/crud/transactions.d.ts.map +1 -1
  327. package/dist/esm/interface/crud/transactions.js +7 -13
  328. package/dist/esm/interface/crud/transactions.js.map +1 -1
  329. package/dist/esm/interface/crud/users.d.ts +21 -22
  330. package/dist/esm/interface/crud/users.d.ts.map +1 -1
  331. package/dist/esm/interface/crud/users.js +9 -5
  332. package/dist/esm/interface/crud/users.js.map +1 -1
  333. package/dist/esm/interface/handler-urls.d.ts +1 -1
  334. package/dist/esm/interface/handler-urls.d.ts.map +1 -1
  335. package/dist/esm/interface/handler-urls.js +1 -2
  336. package/dist/esm/interface/page-component-versions.d.ts +1 -1
  337. package/dist/esm/interface/page-component-versions.d.ts.map +1 -1
  338. package/dist/esm/interface/page-component-versions.js +1 -2
  339. package/dist/esm/interface/page-component-versions.js.map +1 -1
  340. package/dist/esm/interface/plan-usage.d.ts +1 -1
  341. package/dist/esm/interface/plan-usage.d.ts.map +1 -1
  342. package/dist/esm/interface/plan-usage.js +1 -2
  343. package/dist/esm/interface/plan-usage.js.map +1 -1
  344. package/dist/esm/interface/server-interface.d.ts +19 -19
  345. package/dist/esm/interface/server-interface.d.ts.map +1 -1
  346. package/dist/esm/interface/server-interface.js +2 -3
  347. package/dist/esm/interface/server-interface.js.map +1 -1
  348. package/dist/esm/interface/webhooks.d.ts +4 -4
  349. package/dist/esm/interface/webhooks.d.ts.map +1 -1
  350. package/dist/esm/interface/webhooks.js +1 -2
  351. package/dist/esm/interface/webhooks.js.map +1 -1
  352. package/dist/esm/known-errors.d.ts +2 -2
  353. package/dist/esm/known-errors.d.ts.map +1 -1
  354. package/dist/esm/known-errors.js +10 -21
  355. package/dist/esm/known-errors.js.map +1 -1
  356. package/dist/esm/payments/payment-methods.d.ts.map +1 -1
  357. package/dist/esm/payments/payment-methods.js +1 -1
  358. package/dist/esm/payments/payment-methods.js.map +1 -1
  359. package/dist/esm/payments/stripe-limits.d.ts.map +1 -1
  360. package/dist/esm/payments/stripe-limits.js +1 -1
  361. package/dist/esm/payments/stripe-limits.js.map +1 -1
  362. package/dist/esm/plans.d.ts.map +1 -1
  363. package/dist/esm/plans.js +1 -1
  364. package/dist/esm/plans.js.map +1 -1
  365. package/dist/esm/schema-fields.d.ts +14 -14
  366. package/dist/esm/schema-fields.d.ts.map +1 -1
  367. package/dist/esm/schema-fields.js +3 -64
  368. package/dist/esm/schema-fields.js.map +1 -1
  369. package/dist/esm/sessions.d.ts +6 -6
  370. package/dist/esm/sessions.d.ts.map +1 -1
  371. package/dist/esm/sessions.js +1 -2
  372. package/dist/esm/sessions.js.map +1 -1
  373. package/dist/esm/sessions.test.js +2 -3
  374. package/dist/esm/sessions.test.js.map +1 -1
  375. package/dist/esm/utils/analytics-clickmap-overlay.d.ts.map +1 -1
  376. package/dist/esm/utils/analytics-clickmap-overlay.js +1 -1
  377. package/dist/esm/utils/api-keys.d.ts.map +1 -1
  378. package/dist/esm/utils/api-keys.js +1 -2
  379. package/dist/esm/utils/api-keys.js.map +1 -1
  380. package/dist/esm/utils/arrays.d.ts.map +1 -1
  381. package/dist/esm/utils/arrays.js +1 -470
  382. package/dist/esm/utils/arrays.js.map +1 -1
  383. package/dist/esm/utils/auth-methods.d.ts.map +1 -1
  384. package/dist/esm/utils/auth-methods.js +1 -1
  385. package/dist/esm/utils/auth-methods.js.map +1 -1
  386. package/dist/esm/utils/base64.d.ts.map +1 -1
  387. package/dist/esm/utils/base64.js +1 -10
  388. package/dist/esm/utils/base64.js.map +1 -1
  389. package/dist/esm/utils/booleans.d.ts.map +1 -1
  390. package/dist/esm/utils/booleans.js +1 -25
  391. package/dist/esm/utils/booleans.js.map +1 -1
  392. package/dist/esm/utils/browser-compat.d.ts.map +1 -1
  393. package/dist/esm/utils/browser-compat.js +1 -1
  394. package/dist/esm/utils/browser-compat.js.map +1 -1
  395. package/dist/esm/utils/bytes.d.ts.map +1 -1
  396. package/dist/esm/utils/bytes.js +3 -198
  397. package/dist/esm/utils/bytes.js.map +1 -1
  398. package/dist/esm/utils/caches.d.ts +1 -1
  399. package/dist/esm/utils/caches.d.ts.map +1 -1
  400. package/dist/esm/utils/caches.js +1 -27
  401. package/dist/esm/utils/caches.js.map +1 -1
  402. package/dist/esm/utils/cel-fields.d.ts.map +1 -1
  403. package/dist/esm/utils/cel-fields.js +1 -2
  404. package/dist/esm/utils/cel-fields.js.map +1 -1
  405. package/dist/esm/utils/cloud-hosts.d.ts.map +1 -1
  406. package/dist/esm/utils/cloud-hosts.js +1 -27
  407. package/dist/esm/utils/cloud-hosts.js.map +1 -1
  408. package/dist/esm/utils/compile-time.d.ts.map +1 -1
  409. package/dist/esm/utils/compile-time.js +1 -1
  410. package/dist/esm/utils/compile-time.js.map +1 -1
  411. package/dist/esm/utils/country-codes.d.ts.map +1 -1
  412. package/dist/esm/utils/country-codes.js +1 -16
  413. package/dist/esm/utils/country-codes.js.map +1 -1
  414. package/dist/esm/utils/crypto.d.ts.map +1 -1
  415. package/dist/esm/utils/crypto.js +3 -113
  416. package/dist/esm/utils/crypto.js.map +1 -1
  417. package/dist/esm/utils/currencies.d.ts +1 -1
  418. package/dist/esm/utils/currencies.d.ts.map +1 -1
  419. package/dist/esm/utils/currencies.js +2 -37
  420. package/dist/esm/utils/currencies.js.map +1 -1
  421. package/dist/esm/utils/currency-constants.d.ts.map +1 -1
  422. package/dist/esm/utils/currency-constants.js +1 -1
  423. package/dist/esm/utils/currency-constants.js.map +1 -1
  424. package/dist/esm/utils/dates.d.ts.map +1 -1
  425. package/dist/esm/utils/dates.js +1 -44
  426. package/dist/esm/utils/dates.js.map +1 -1
  427. package/dist/esm/utils/dev-env-state-path.d.ts.map +1 -1
  428. package/dist/esm/utils/dev-env-state-path.js +1 -2
  429. package/dist/esm/utils/dev-env-state-path.js.map +1 -1
  430. package/dist/esm/utils/dev-tool.d.ts.map +1 -1
  431. package/dist/esm/utils/dev-tool.js +1 -1
  432. package/dist/esm/utils/dom.d.ts.map +1 -1
  433. package/dist/esm/utils/dom.js +1 -1
  434. package/dist/esm/utils/dom.js.map +1 -1
  435. package/dist/esm/utils/elements-chain.d.ts.map +1 -1
  436. package/dist/esm/utils/elements-chain.js +5 -50
  437. package/dist/esm/utils/elements-chain.js.map +1 -1
  438. package/dist/esm/utils/env.d.ts.map +1 -1
  439. package/dist/esm/utils/env.js +1 -2
  440. package/dist/esm/utils/env.js.map +1 -1
  441. package/dist/esm/utils/env.test.js +2 -3
  442. package/dist/esm/utils/env.test.js.map +1 -1
  443. package/dist/esm/utils/errors.d.ts +1 -1
  444. package/dist/esm/utils/errors.d.ts.map +1 -1
  445. package/dist/esm/utils/errors.js +1 -2
  446. package/dist/esm/utils/errors.js.map +1 -1
  447. package/dist/esm/utils/esbuild.d.ts +1 -1
  448. package/dist/esm/utils/esbuild.d.ts.map +1 -1
  449. package/dist/esm/utils/esbuild.js +2 -3
  450. package/dist/esm/utils/esbuild.js.map +1 -1
  451. package/dist/esm/utils/featurebase.d.ts.map +1 -1
  452. package/dist/esm/utils/featurebase.js +1 -2
  453. package/dist/esm/utils/featurebase.js.map +1 -1
  454. package/dist/esm/utils/fs.d.ts.map +1 -1
  455. package/dist/esm/utils/fs.js +1 -2
  456. package/dist/esm/utils/fs.js.map +1 -1
  457. package/dist/esm/utils/functions.d.ts.map +1 -1
  458. package/dist/esm/utils/functions.js +1 -24
  459. package/dist/esm/utils/functions.js.map +1 -1
  460. package/dist/esm/utils/geo.d.ts.map +1 -1
  461. package/dist/esm/utils/geo.js +1 -2
  462. package/dist/esm/utils/geo.js.map +1 -1
  463. package/dist/esm/utils/globals.d.ts.map +1 -1
  464. package/dist/esm/utils/globals.js +1 -1
  465. package/dist/esm/utils/globals.js.map +1 -1
  466. package/dist/esm/utils/hashes.d.ts.map +1 -1
  467. package/dist/esm/utils/hashes.js +1 -2
  468. package/dist/esm/utils/hashes.js.map +1 -1
  469. package/dist/esm/utils/html.d.ts.map +1 -1
  470. package/dist/esm/utils/html.js +1 -19
  471. package/dist/esm/utils/html.js.map +1 -1
  472. package/dist/esm/utils/http.d.ts.map +1 -1
  473. package/dist/esm/utils/http.js +1 -19
  474. package/dist/esm/utils/http.js.map +1 -1
  475. package/dist/esm/utils/ips.d.ts.map +1 -1
  476. package/dist/esm/utils/ips.js +1 -25
  477. package/dist/esm/utils/ips.js.map +1 -1
  478. package/dist/esm/utils/json.d.ts +1 -1
  479. package/dist/esm/utils/json.d.ts.map +1 -1
  480. package/dist/esm/utils/json.js +1 -155
  481. package/dist/esm/utils/json.js.map +1 -1
  482. package/dist/esm/utils/jsx-editable-transpiler.d.ts.map +1 -1
  483. package/dist/esm/utils/jsx-editable-transpiler.js +1 -2
  484. package/dist/esm/utils/jsx-editable-transpiler.js.map +1 -1
  485. package/dist/esm/utils/jsx-editable-transpiler.test.js +2 -3
  486. package/dist/esm/utils/jsx-editable-transpiler.test.js.map +1 -1
  487. package/dist/esm/utils/jwt.d.ts.map +1 -1
  488. package/dist/esm/utils/jwt.js +1 -2
  489. package/dist/esm/utils/jwt.js.map +1 -1
  490. package/dist/esm/utils/locks.d.ts.map +1 -1
  491. package/dist/esm/utils/locks.js +1 -2
  492. package/dist/esm/utils/locks.js.map +1 -1
  493. package/dist/esm/utils/maps.d.ts.map +1 -1
  494. package/dist/esm/utils/maps.js +1 -111
  495. package/dist/esm/utils/maps.js.map +1 -1
  496. package/dist/esm/utils/math.d.ts.map +1 -1
  497. package/dist/esm/utils/math.js +1 -11
  498. package/dist/esm/utils/math.js.map +1 -1
  499. package/dist/esm/utils/monkey-patch.d.ts.map +1 -1
  500. package/dist/esm/utils/monkey-patch.js +2 -3
  501. package/dist/esm/utils/monkey-patch.js.map +1 -1
  502. package/dist/esm/utils/node-http.js +1 -2
  503. package/dist/esm/utils/node-http.js.map +1 -1
  504. package/dist/esm/utils/numbers.d.ts.map +1 -1
  505. package/dist/esm/utils/numbers.js +1 -45
  506. package/dist/esm/utils/numbers.js.map +1 -1
  507. package/dist/esm/utils/oauth.d.ts.map +1 -1
  508. package/dist/esm/utils/oauth.js +1 -1
  509. package/dist/esm/utils/oauth.js.map +1 -1
  510. package/dist/esm/utils/objects.d.ts.map +1 -1
  511. package/dist/esm/utils/objects.js +1 -622
  512. package/dist/esm/utils/objects.js.map +1 -1
  513. package/dist/esm/utils/paginated-lists.d.ts.map +1 -1
  514. package/dist/esm/utils/paginated-lists.js +1 -2
  515. package/dist/esm/utils/paginated-lists.js.map +1 -1
  516. package/dist/esm/utils/paginated-lists.test.js +2 -3
  517. package/dist/esm/utils/paginated-lists.test.js.map +1 -1
  518. package/dist/esm/utils/passkey.d.ts +1 -1
  519. package/dist/esm/utils/passkey.js +1 -1
  520. package/dist/esm/utils/promises.d.ts +1 -1
  521. package/dist/esm/utils/promises.d.ts.map +1 -1
  522. package/dist/esm/utils/promises.js +2 -161
  523. package/dist/esm/utils/promises.js.map +1 -1
  524. package/dist/esm/utils/proxies.d.ts.map +1 -1
  525. package/dist/esm/utils/proxies.js +1 -37
  526. package/dist/esm/utils/proxies.js.map +1 -1
  527. package/dist/esm/utils/react.d.ts.map +1 -1
  528. package/dist/esm/utils/react.js +1 -41
  529. package/dist/esm/utils/react.js.map +1 -1
  530. package/dist/esm/utils/redirect-urls.d.ts.map +1 -1
  531. package/dist/esm/utils/redirect-urls.js +2 -92
  532. package/dist/esm/utils/redirect-urls.js.map +1 -1
  533. package/dist/esm/utils/regex.js +1 -1
  534. package/dist/esm/utils/regex.js.map +1 -1
  535. package/dist/esm/utils/results.d.ts.map +1 -1
  536. package/dist/esm/utils/results.js +1 -213
  537. package/dist/esm/utils/results.js.map +1 -1
  538. package/dist/esm/utils/sentry.js +1 -1
  539. package/dist/esm/utils/sentry.js.map +1 -1
  540. package/dist/esm/utils/stores.d.ts +3 -3
  541. package/dist/esm/utils/stores.d.ts.map +1 -1
  542. package/dist/esm/utils/stores.js +1 -2
  543. package/dist/esm/utils/stores.js.map +1 -1
  544. package/dist/esm/utils/strings.d.ts.map +1 -1
  545. package/dist/esm/utils/strings.js +1 -251
  546. package/dist/esm/utils/strings.js.map +1 -1
  547. package/dist/esm/utils/strings.nicify.test.js +2 -3
  548. package/dist/esm/utils/strings.nicify.test.js.map +1 -1
  549. package/dist/esm/utils/telemetry.d.ts.map +1 -1
  550. package/dist/esm/utils/telemetry.js +1 -2
  551. package/dist/esm/utils/telemetry.js.map +1 -1
  552. package/dist/esm/utils/turnstile-browser.d.ts +1 -1
  553. package/dist/esm/utils/turnstile-browser.d.ts.map +1 -1
  554. package/dist/esm/utils/turnstile-browser.js +1 -2
  555. package/dist/esm/utils/turnstile-browser.js.map +1 -1
  556. package/dist/esm/utils/turnstile-flow.d.ts +1 -1
  557. package/dist/esm/utils/turnstile-flow.d.ts.map +1 -1
  558. package/dist/esm/utils/turnstile-flow.js +1 -2
  559. package/dist/esm/utils/turnstile-flow.js.map +1 -1
  560. package/dist/esm/utils/turnstile-flow.test.js +2 -3
  561. package/dist/esm/utils/turnstile-flow.test.js.map +1 -1
  562. package/dist/esm/utils/turnstile.d.ts.map +1 -1
  563. package/dist/esm/utils/turnstile.js +1 -1
  564. package/dist/esm/utils/turnstile.js.map +1 -1
  565. package/dist/esm/utils/typed-arrays.js +1 -2
  566. package/dist/esm/utils/typed-arrays.js.map +1 -1
  567. package/dist/esm/utils/types.d.ts +1 -1
  568. package/dist/esm/utils/types.d.ts.map +1 -1
  569. package/dist/esm/utils/types.js +1 -1
  570. package/dist/esm/utils/types.js.map +1 -1
  571. package/dist/esm/utils/unicode.d.ts.map +1 -1
  572. package/dist/esm/utils/unicode.js +1 -13
  573. package/dist/esm/utils/unicode.js.map +1 -1
  574. package/dist/esm/utils/urls.d.ts.map +1 -1
  575. package/dist/esm/utils/urls.js +1 -151
  576. package/dist/esm/utils/urls.js.map +1 -1
  577. package/dist/esm/utils/uuids.d.ts.map +1 -1
  578. package/dist/esm/utils/uuids.js +2 -26
  579. package/dist/esm/utils/uuids.js.map +1 -1
  580. package/dist/format-4JG1MGv5.d.ts +61 -0
  581. package/dist/format-4JG1MGv5.d.ts.map +1 -0
  582. package/dist/handler-urls-BHt3v8Ai.d.ts +70 -0
  583. package/dist/handler-urls-BHt3v8Ai.d.ts.map +1 -0
  584. package/dist/helpers/emails.js +2 -4
  585. package/dist/helpers/emails.js.map +1 -1
  586. package/dist/helpers/init-prompt.d.ts.map +1 -1
  587. package/dist/helpers/init-prompt.js +2 -4
  588. package/dist/helpers/init-prompt.js.map +1 -1
  589. package/dist/helpers/password.d.ts +1 -1
  590. package/dist/helpers/password.d.ts.map +1 -1
  591. package/dist/helpers/password.js +2 -4
  592. package/dist/helpers/password.js.map +1 -1
  593. package/dist/helpers/production-mode.d.ts +1 -1
  594. package/dist/helpers/production-mode.d.ts.map +1 -1
  595. package/dist/helpers/production-mode.js +2 -4
  596. package/dist/helpers/production-mode.js.map +1 -1
  597. package/dist/helpers/support-sla.d.ts.map +1 -1
  598. package/dist/helpers/support-sla.js +2 -3
  599. package/dist/helpers/support-sla.js.map +1 -1
  600. package/dist/helpers/support-sla.test.js +1 -3
  601. package/dist/helpers/support-sla.test.js.map +1 -1
  602. package/dist/helpers/vault/client-side.d.ts.map +1 -1
  603. package/dist/helpers/vault/client-side.js +2 -22
  604. package/dist/helpers/vault/client-side.js.map +1 -1
  605. package/dist/helpers/vault/server-side.js +2 -4
  606. package/dist/helpers/vault/server-side.js.map +1 -1
  607. package/dist/hooks/use-async-callback.d.ts.map +1 -1
  608. package/dist/hooks/use-async-callback.js +4 -5
  609. package/dist/hooks/use-async-callback.js.map +1 -1
  610. package/dist/hooks/use-async-external-store.d.ts +1 -1
  611. package/dist/hooks/use-async-external-store.d.ts.map +1 -1
  612. package/dist/hooks/use-async-external-store.js +2 -4
  613. package/dist/hooks/use-async-external-store.js.map +1 -1
  614. package/dist/hooks/use-hash.js +2 -4
  615. package/dist/hooks/use-hash.js.map +1 -1
  616. package/dist/hooks/use-hover.d.ts.map +1 -1
  617. package/dist/hooks/use-hover.js +2 -4
  618. package/dist/hooks/use-hover.js.map +1 -1
  619. package/dist/hooks/use-strict-memo.d.ts.map +1 -1
  620. package/dist/hooks/use-strict-memo.js +2 -72
  621. package/dist/hooks/use-strict-memo.js.map +1 -1
  622. package/dist/index.d.ts +4 -4
  623. package/dist/index.js +27 -29
  624. package/dist/interface/admin-interface.d.ts +3 -379
  625. package/dist/interface/admin-interface.js +3 -5
  626. package/dist/interface/admin-interface.js.map +1 -1
  627. package/dist/interface/admin-metrics.d.ts +2 -807
  628. package/dist/interface/admin-metrics.js +2 -4
  629. package/dist/interface/admin-metrics.js.map +1 -1
  630. package/dist/interface/client-interface.d.ts +2 -447
  631. package/dist/interface/client-interface.js +33 -18
  632. package/dist/interface/client-interface.js.map +1 -1
  633. package/dist/interface/client-interface.test.js +83 -13
  634. package/dist/interface/client-interface.test.js.map +1 -1
  635. package/dist/interface/conversations.d.ts +8 -8
  636. package/dist/interface/conversations.d.ts.map +1 -1
  637. package/dist/interface/conversations.js +2 -4
  638. package/dist/interface/conversations.js.map +1 -1
  639. package/dist/interface/crud/analytics.d.ts +2 -14
  640. package/dist/interface/crud/connected-accounts.d.ts +2 -68
  641. package/dist/interface/crud/connected-accounts.js +2 -4
  642. package/dist/interface/crud/connected-accounts.js.map +1 -1
  643. package/dist/interface/crud/contact-channels.d.ts +2 -181
  644. package/dist/interface/crud/contact-channels.js +2 -4
  645. package/dist/interface/crud/contact-channels.js.map +1 -1
  646. package/dist/interface/crud/current-user.d.ts +2 -285
  647. package/dist/interface/crud/current-user.js +2 -4
  648. package/dist/interface/crud/current-user.js.map +1 -1
  649. package/dist/interface/crud/email-outbox.d.ts +2 -1465
  650. package/dist/interface/crud/email-outbox.js +4 -5
  651. package/dist/interface/crud/email-outbox.js.map +1 -1
  652. package/dist/interface/crud/email-templates.d.ts +15 -16
  653. package/dist/interface/crud/email-templates.d.ts.map +1 -1
  654. package/dist/interface/crud/email-templates.js +2 -4
  655. package/dist/interface/crud/email-templates.js.map +1 -1
  656. package/dist/interface/crud/emails.d.ts +2 -41
  657. package/dist/interface/crud/emails.js +4 -5
  658. package/dist/interface/crud/emails.js.map +1 -1
  659. package/dist/interface/crud/internal-api-keys.d.ts +2 -140
  660. package/dist/interface/crud/internal-api-keys.js +2 -4
  661. package/dist/interface/crud/internal-api-keys.js.map +1 -1
  662. package/dist/interface/crud/invoices.d.ts +2 -43
  663. package/dist/interface/crud/invoices.js +2 -4
  664. package/dist/interface/crud/invoices.js.map +1 -1
  665. package/dist/interface/crud/items.d.ts +2 -30
  666. package/dist/interface/crud/items.js +2 -4
  667. package/dist/interface/crud/items.js.map +1 -1
  668. package/dist/interface/crud/notification-preferences.d.ts +2 -38
  669. package/dist/interface/crud/notification-preferences.js +2 -4
  670. package/dist/interface/crud/notification-preferences.js.map +1 -1
  671. package/dist/interface/crud/oauth-providers.d.ts +2 -186
  672. package/dist/interface/crud/oauth-providers.js +2 -4
  673. package/dist/interface/crud/oauth-providers.js.map +1 -1
  674. package/dist/interface/crud/products.d.ts +2 -182
  675. package/dist/interface/crud/products.js +4 -4
  676. package/dist/interface/crud/products.js.map +1 -1
  677. package/dist/interface/crud/project-api-keys.d.ts +2 -203
  678. package/dist/interface/crud/project-api-keys.js +2 -4
  679. package/dist/interface/crud/project-api-keys.js.map +1 -1
  680. package/dist/interface/crud/project-permissions.d.ts +2 -161
  681. package/dist/interface/crud/project-permissions.js +4 -5
  682. package/dist/interface/crud/project-permissions.js.map +1 -1
  683. package/dist/interface/crud/projects.d.ts +2 -901
  684. package/dist/interface/crud/projects.js +6 -5
  685. package/dist/interface/crud/projects.js.map +1 -1
  686. package/dist/interface/crud/session-replays.d.ts +2 -83
  687. package/dist/interface/crud/sessions.d.ts +2 -150
  688. package/dist/interface/crud/sessions.js +2 -4
  689. package/dist/interface/crud/sessions.js.map +1 -1
  690. package/dist/interface/crud/sign-up-rules.d.ts.map +1 -1
  691. package/dist/interface/crud/svix-token.d.ts +2 -31
  692. package/dist/interface/crud/svix-token.js +2 -4
  693. package/dist/interface/crud/svix-token.js.map +1 -1
  694. package/dist/interface/crud/team-invitation-details.d.ts +5 -6
  695. package/dist/interface/crud/team-invitation-details.d.ts.map +1 -1
  696. package/dist/interface/crud/team-invitation-details.js +4 -5
  697. package/dist/interface/crud/team-invitation-details.js.map +1 -1
  698. package/dist/interface/crud/team-invitation.d.ts +2 -54
  699. package/dist/interface/crud/team-invitation.js +4 -5
  700. package/dist/interface/crud/team-invitation.js.map +1 -1
  701. package/dist/interface/crud/team-member-profiles.d.ts +2 -286
  702. package/dist/interface/crud/team-member-profiles.js +4 -5
  703. package/dist/interface/crud/team-member-profiles.js.map +1 -1
  704. package/dist/interface/crud/team-memberships.d.ts +2 -75
  705. package/dist/interface/crud/team-memberships.js +2 -4
  706. package/dist/interface/crud/team-memberships.js.map +1 -1
  707. package/dist/interface/crud/team-permissions.d.ts +2 -169
  708. package/dist/interface/crud/team-permissions.js +4 -5
  709. package/dist/interface/crud/team-permissions.js.map +1 -1
  710. package/dist/interface/crud/teams.d.ts +2 -299
  711. package/dist/interface/crud/teams.js +5 -7
  712. package/dist/interface/crud/teams.js.map +1 -1
  713. package/dist/interface/crud/transactions.d.ts +2 -183
  714. package/dist/interface/crud/transactions.js +2 -4
  715. package/dist/interface/crud/transactions.js.map +1 -1
  716. package/dist/interface/crud/users.d.ts +2 -653
  717. package/dist/interface/crud/users.js +12 -8
  718. package/dist/interface/crud/users.js.map +1 -1
  719. package/dist/interface/handler-urls.d.ts +2 -51
  720. package/dist/interface/handler-urls.js +12 -14
  721. package/dist/interface/page-component-versions.d.ts +2 -25
  722. package/dist/interface/page-component-versions.js +2 -4
  723. package/dist/interface/page-component-versions.js.map +1 -1
  724. package/dist/interface/plan-usage.d.ts +2 -57
  725. package/dist/interface/plan-usage.js +2 -4
  726. package/dist/interface/plan-usage.js.map +1 -1
  727. package/dist/interface/server-interface.d.ts +2 -257
  728. package/dist/interface/server-interface.js +3 -5
  729. package/dist/interface/server-interface.js.map +1 -1
  730. package/dist/interface/webhooks.d.ts +2 -326
  731. package/dist/interface/webhooks.js +2 -4
  732. package/dist/interface/webhooks.js.map +1 -1
  733. package/dist/internal-api-keys-D8IYDodH.d.ts +139 -0
  734. package/dist/internal-api-keys-D8IYDodH.d.ts.map +1 -0
  735. package/dist/invoices-CHo9YKbI.d.ts +43 -0
  736. package/dist/invoices-CHo9YKbI.d.ts.map +1 -0
  737. package/dist/items-DlLSlVUD.d.ts +29 -0
  738. package/dist/items-DlLSlVUD.d.ts.map +1 -0
  739. package/dist/json-a1QIXu5z.d.ts +15 -0
  740. package/dist/json-a1QIXu5z.d.ts.map +1 -0
  741. package/dist/known-errors-Bm4a61wL.d.ts +575 -0
  742. package/dist/known-errors-Bm4a61wL.d.ts.map +1 -0
  743. package/dist/known-errors.d.ts +2 -575
  744. package/dist/known-errors.js +11 -23
  745. package/dist/known-errors.js.map +1 -1
  746. package/dist/notification-preferences-Bmzr_EOY.d.ts +37 -0
  747. package/dist/notification-preferences-Bmzr_EOY.d.ts.map +1 -0
  748. package/dist/oauth-providers-BMkKSSlA.d.ts +185 -0
  749. package/dist/oauth-providers-BMkKSSlA.d.ts.map +1 -0
  750. package/dist/objects-DkCkeBWE.d.ts +59 -0
  751. package/dist/objects-DkCkeBWE.d.ts.map +1 -0
  752. package/dist/passkey-CKg87UH-.d.ts +2 -0
  753. package/dist/payments/payment-methods.d.ts.map +1 -1
  754. package/dist/payments/payment-methods.js +2 -3
  755. package/dist/payments/payment-methods.js.map +1 -1
  756. package/dist/payments/stripe-limits.d.ts.map +1 -1
  757. package/dist/payments/stripe-limits.js +2 -3
  758. package/dist/payments/stripe-limits.js.map +1 -1
  759. package/dist/plan-usage-DfDoj5K4.d.ts +57 -0
  760. package/dist/plan-usage-DfDoj5K4.d.ts.map +1 -0
  761. package/dist/plans.d.ts.map +1 -1
  762. package/dist/plans.js +2 -3
  763. package/dist/plans.js.map +1 -1
  764. package/dist/products-Bs74ld-v.d.ts +182 -0
  765. package/dist/products-Bs74ld-v.d.ts.map +1 -0
  766. package/dist/project-api-keys--7V5X_UW.d.ts +203 -0
  767. package/dist/project-api-keys--7V5X_UW.d.ts.map +1 -0
  768. package/dist/project-permissions-kdi675F-.d.ts +160 -0
  769. package/dist/project-permissions-kdi675F-.d.ts.map +1 -0
  770. package/dist/projects-CFTNXRfG.d.ts +900 -0
  771. package/dist/projects-CFTNXRfG.d.ts.map +1 -0
  772. package/dist/results-DP3BzoL6.d.ts +70 -0
  773. package/dist/results-DP3BzoL6.d.ts.map +1 -0
  774. package/dist/{chunk-BE-pF4vm.js → rolldown-runtime-D6vf50IK.js} +12 -18
  775. package/dist/schema-CJwkGkdf.d.ts +2328 -0
  776. package/dist/schema-CJwkGkdf.d.ts.map +1 -0
  777. package/dist/schema-fields-DqGQ4kF7.d.ts +517 -0
  778. package/dist/schema-fields-DqGQ4kF7.d.ts.map +1 -0
  779. package/dist/schema-fields.d.ts +3 -518
  780. package/dist/schema-fields.js +21 -82
  781. package/dist/schema-fields.js.map +1 -1
  782. package/dist/server-interface-CgpxsLT_.d.ts +257 -0
  783. package/dist/server-interface-CgpxsLT_.d.ts.map +1 -0
  784. package/dist/session-replays-CXqhDpZq.d.ts +83 -0
  785. package/dist/session-replays-CXqhDpZq.d.ts.map +1 -0
  786. package/dist/sessions-B7Ko2Ldr.d.ts +149 -0
  787. package/dist/sessions-B7Ko2Ldr.d.ts.map +1 -0
  788. package/dist/sessions-d8qtvBUB.d.ts +175 -0
  789. package/dist/sessions-d8qtvBUB.d.ts.map +1 -0
  790. package/dist/sessions.d.ts +2 -175
  791. package/dist/sessions.js +4 -5
  792. package/dist/sessions.js.map +1 -1
  793. package/dist/sessions.test.js +1 -3
  794. package/dist/sessions.test.js.map +1 -1
  795. package/dist/strings-DWgkUybS.d.ts +76 -0
  796. package/dist/strings-DWgkUybS.d.ts.map +1 -0
  797. package/dist/svix-token-BsMrLGvy.d.ts +30 -0
  798. package/dist/svix-token-BsMrLGvy.d.ts.map +1 -0
  799. package/dist/team-invitation-Cyqt9oWw.d.ts +53 -0
  800. package/dist/team-invitation-Cyqt9oWw.d.ts.map +1 -0
  801. package/dist/team-member-profiles-BoDEqx-0.d.ts +285 -0
  802. package/dist/team-member-profiles-BoDEqx-0.d.ts.map +1 -0
  803. package/dist/team-memberships-DZHk2A5b.d.ts +74 -0
  804. package/dist/team-memberships-DZHk2A5b.d.ts.map +1 -0
  805. package/dist/team-permissions-DqOpaOWh.d.ts +168 -0
  806. package/dist/team-permissions-DqOpaOWh.d.ts.map +1 -0
  807. package/dist/teams-CQMcBnjM.d.ts +298 -0
  808. package/dist/teams-CQMcBnjM.d.ts.map +1 -0
  809. package/dist/transactions-DhnbvGH5.d.ts +182 -0
  810. package/dist/transactions-DhnbvGH5.d.ts.map +1 -0
  811. package/dist/types-DfTcxNtM.d.ts +77 -0
  812. package/dist/types-DfTcxNtM.d.ts.map +1 -0
  813. package/dist/users-DHNRwoSz.d.ts +653 -0
  814. package/dist/users-DHNRwoSz.d.ts.map +1 -0
  815. package/dist/utils/analytics-clickmap-overlay.d.ts.map +1 -1
  816. package/dist/utils/analytics-clickmap-overlay.js +2 -3
  817. package/dist/utils/analytics-clickmap-overlay.js.map +1 -1
  818. package/dist/utils/api-keys.d.ts.map +1 -1
  819. package/dist/utils/api-keys.js +4 -5
  820. package/dist/utils/api-keys.js.map +1 -1
  821. package/dist/utils/arrays.d.ts.map +1 -1
  822. package/dist/utils/arrays.js +2 -472
  823. package/dist/utils/arrays.js.map +1 -1
  824. package/dist/utils/auth-methods.d.ts.map +1 -1
  825. package/dist/utils/auth-methods.js +2 -3
  826. package/dist/utils/auth-methods.js.map +1 -1
  827. package/dist/utils/base64.d.ts.map +1 -1
  828. package/dist/utils/base64.js +2 -12
  829. package/dist/utils/base64.js.map +1 -1
  830. package/dist/utils/booleans.d.ts.map +1 -1
  831. package/dist/utils/booleans.js +2 -27
  832. package/dist/utils/booleans.js.map +1 -1
  833. package/dist/utils/browser-compat.d.ts.map +1 -1
  834. package/dist/utils/browser-compat.js +2 -3
  835. package/dist/utils/browser-compat.js.map +1 -1
  836. package/dist/utils/bytes.d.ts.map +1 -1
  837. package/dist/utils/bytes.js +4 -200
  838. package/dist/utils/bytes.js.map +1 -1
  839. package/dist/utils/caches.d.ts.map +1 -1
  840. package/dist/utils/caches.js +2 -29
  841. package/dist/utils/caches.js.map +1 -1
  842. package/dist/utils/cel-fields.d.ts.map +1 -1
  843. package/dist/utils/cel-fields.js +2 -4
  844. package/dist/utils/cel-fields.js.map +1 -1
  845. package/dist/utils/cloud-hosts.d.ts.map +1 -1
  846. package/dist/utils/cloud-hosts.js +2 -29
  847. package/dist/utils/cloud-hosts.js.map +1 -1
  848. package/dist/utils/compile-time.d.ts.map +1 -1
  849. package/dist/utils/compile-time.js +2 -3
  850. package/dist/utils/compile-time.js.map +1 -1
  851. package/dist/utils/country-codes.d.ts +2 -11
  852. package/dist/utils/country-codes.js +2 -18
  853. package/dist/utils/country-codes.js.map +1 -1
  854. package/dist/utils/crypto.d.ts.map +1 -1
  855. package/dist/utils/crypto.js +4 -115
  856. package/dist/utils/crypto.js.map +1 -1
  857. package/dist/utils/currencies.d.ts +1 -1
  858. package/dist/utils/currencies.d.ts.map +1 -1
  859. package/dist/utils/currencies.js +3 -39
  860. package/dist/utils/currencies.js.map +1 -1
  861. package/dist/utils/currency-constants.d.ts +2 -45
  862. package/dist/utils/currency-constants.js +2 -3
  863. package/dist/utils/currency-constants.js.map +1 -1
  864. package/dist/utils/dates.d.ts +2 -23
  865. package/dist/utils/dates.js +2 -46
  866. package/dist/utils/dates.js.map +1 -1
  867. package/dist/utils/dev-env-state-path.d.ts.map +1 -1
  868. package/dist/utils/dev-env-state-path.js +2 -4
  869. package/dist/utils/dev-env-state-path.js.map +1 -1
  870. package/dist/utils/dev-tool.d.ts.map +1 -1
  871. package/dist/utils/dev-tool.js +2 -3
  872. package/dist/utils/dev-tool.js.map +1 -1
  873. package/dist/utils/dom.d.ts.map +1 -1
  874. package/dist/utils/dom.js +2 -3
  875. package/dist/utils/dom.js.map +1 -1
  876. package/dist/utils/elements-chain.d.ts.map +1 -1
  877. package/dist/utils/elements-chain.js +6 -52
  878. package/dist/utils/elements-chain.js.map +1 -1
  879. package/dist/utils/env.d.ts.map +1 -1
  880. package/dist/utils/env.js +2 -4
  881. package/dist/utils/env.js.map +1 -1
  882. package/dist/utils/env.test.js +1 -3
  883. package/dist/utils/env.test.js.map +1 -1
  884. package/dist/utils/errors.d.ts +2 -238
  885. package/dist/utils/errors.js +2 -4
  886. package/dist/utils/errors.js.map +1 -1
  887. package/dist/utils/esbuild.d.ts +1 -1
  888. package/dist/utils/esbuild.d.ts.map +1 -1
  889. package/dist/utils/esbuild.js +5 -6
  890. package/dist/utils/esbuild.js.map +1 -1
  891. package/dist/utils/featurebase.d.ts.map +1 -1
  892. package/dist/utils/featurebase.js +2 -4
  893. package/dist/utils/featurebase.js.map +1 -1
  894. package/dist/utils/fs.d.ts.map +1 -1
  895. package/dist/utils/fs.js +5 -6
  896. package/dist/utils/fs.js.map +1 -1
  897. package/dist/utils/functions.d.ts.map +1 -1
  898. package/dist/utils/functions.js +2 -26
  899. package/dist/utils/functions.js.map +1 -1
  900. package/dist/utils/geo.d.ts.map +1 -1
  901. package/dist/utils/geo.js +2 -4
  902. package/dist/utils/geo.js.map +1 -1
  903. package/dist/utils/globals.d.ts.map +1 -1
  904. package/dist/utils/globals.js +2 -3
  905. package/dist/utils/globals.js.map +1 -1
  906. package/dist/utils/hashes.d.ts.map +1 -1
  907. package/dist/utils/hashes.js +4 -5
  908. package/dist/utils/hashes.js.map +1 -1
  909. package/dist/utils/html.d.ts.map +1 -1
  910. package/dist/utils/html.js +2 -21
  911. package/dist/utils/html.js.map +1 -1
  912. package/dist/utils/http.d.ts.map +1 -1
  913. package/dist/utils/http.js +2 -21
  914. package/dist/utils/http.js.map +1 -1
  915. package/dist/utils/ips.d.ts.map +1 -1
  916. package/dist/utils/ips.js +4 -28
  917. package/dist/utils/ips.js.map +1 -1
  918. package/dist/utils/json.d.ts +2 -15
  919. package/dist/utils/json.js +2 -157
  920. package/dist/utils/json.js.map +1 -1
  921. package/dist/utils/jsx-editable-transpiler.d.ts.map +1 -1
  922. package/dist/utils/jsx-editable-transpiler.js +7 -8
  923. package/dist/utils/jsx-editable-transpiler.js.map +1 -1
  924. package/dist/utils/jsx-editable-transpiler.test.js +1 -3
  925. package/dist/utils/jsx-editable-transpiler.test.js.map +1 -1
  926. package/dist/utils/jwt.d.ts.map +1 -1
  927. package/dist/utils/jwt.js +6 -7
  928. package/dist/utils/jwt.js.map +1 -1
  929. package/dist/utils/locks.d.ts.map +1 -1
  930. package/dist/utils/locks.js +2 -4
  931. package/dist/utils/locks.js.map +1 -1
  932. package/dist/utils/maps.d.ts.map +1 -1
  933. package/dist/utils/maps.js +2 -113
  934. package/dist/utils/maps.js.map +1 -1
  935. package/dist/utils/math.d.ts.map +1 -1
  936. package/dist/utils/math.js +2 -13
  937. package/dist/utils/math.js.map +1 -1
  938. package/dist/utils/monkey-patch.d.ts.map +1 -1
  939. package/dist/utils/monkey-patch.js +3 -5
  940. package/dist/utils/monkey-patch.js.map +1 -1
  941. package/dist/utils/node-http.js +2 -4
  942. package/dist/utils/node-http.js.map +1 -1
  943. package/dist/utils/numbers.d.ts.map +1 -1
  944. package/dist/utils/numbers.js +2 -47
  945. package/dist/utils/numbers.js.map +1 -1
  946. package/dist/utils/oauth.d.ts.map +1 -1
  947. package/dist/utils/oauth.js +2 -3
  948. package/dist/utils/oauth.js.map +1 -1
  949. package/dist/utils/objects.d.ts +2 -59
  950. package/dist/utils/objects.js +2 -624
  951. package/dist/utils/objects.js.map +1 -1
  952. package/dist/utils/paginated-lists.d.ts.map +1 -1
  953. package/dist/utils/paginated-lists.js +2 -4
  954. package/dist/utils/paginated-lists.js.map +1 -1
  955. package/dist/utils/paginated-lists.test.js +1 -3
  956. package/dist/utils/paginated-lists.test.js.map +1 -1
  957. package/dist/utils/passkey.d.ts +2 -2
  958. package/dist/utils/promises.d.ts +1 -1
  959. package/dist/utils/promises.d.ts.map +1 -1
  960. package/dist/utils/promises.js +3 -163
  961. package/dist/utils/promises.js.map +1 -1
  962. package/dist/utils/proxies.d.ts.map +1 -1
  963. package/dist/utils/proxies.js +2 -39
  964. package/dist/utils/proxies.js.map +1 -1
  965. package/dist/utils/react.d.ts.map +1 -1
  966. package/dist/utils/react.js +4 -44
  967. package/dist/utils/react.js.map +1 -1
  968. package/dist/utils/redirect-urls.d.ts.map +1 -1
  969. package/dist/utils/redirect-urls.js +3 -94
  970. package/dist/utils/redirect-urls.js.map +1 -1
  971. package/dist/utils/regex.js +2 -3
  972. package/dist/utils/regex.js.map +1 -1
  973. package/dist/utils/results.d.ts +2 -70
  974. package/dist/utils/results.js +2 -215
  975. package/dist/utils/results.js.map +1 -1
  976. package/dist/utils/sentry.js +2 -3
  977. package/dist/utils/sentry.js.map +1 -1
  978. package/dist/utils/stores.d.ts +1 -1
  979. package/dist/utils/stores.d.ts.map +1 -1
  980. package/dist/utils/stores.js +2 -4
  981. package/dist/utils/stores.js.map +1 -1
  982. package/dist/utils/strings.d.ts +2 -76
  983. package/dist/utils/strings.js +2 -253
  984. package/dist/utils/strings.js.map +1 -1
  985. package/dist/utils/strings.nicify.test.js +1 -3
  986. package/dist/utils/strings.nicify.test.js.map +1 -1
  987. package/dist/utils/telemetry.d.ts.map +1 -1
  988. package/dist/utils/telemetry.js +2 -4
  989. package/dist/utils/telemetry.js.map +1 -1
  990. package/dist/utils/turnstile-browser.d.ts.map +1 -1
  991. package/dist/utils/turnstile-browser.js +2 -4
  992. package/dist/utils/turnstile-browser.js.map +1 -1
  993. package/dist/utils/turnstile-flow.d.ts.map +1 -1
  994. package/dist/utils/turnstile-flow.js +2 -4
  995. package/dist/utils/turnstile-flow.js.map +1 -1
  996. package/dist/utils/turnstile-flow.test.js +1 -3
  997. package/dist/utils/turnstile-flow.test.js.map +1 -1
  998. package/dist/utils/turnstile.d.ts.map +1 -1
  999. package/dist/utils/turnstile.js +2 -3
  1000. package/dist/utils/turnstile.js.map +1 -1
  1001. package/dist/utils/typed-arrays.js +2 -4
  1002. package/dist/utils/typed-arrays.js.map +1 -1
  1003. package/dist/utils/types.d.ts +2 -77
  1004. package/dist/utils/types.js +2 -3
  1005. package/dist/utils/types.js.map +1 -1
  1006. package/dist/utils/unicode.d.ts.map +1 -1
  1007. package/dist/utils/unicode.js +2 -15
  1008. package/dist/utils/unicode.js.map +1 -1
  1009. package/dist/utils/urls.d.ts.map +1 -1
  1010. package/dist/utils/urls.js +2 -153
  1011. package/dist/utils/urls.js.map +1 -1
  1012. package/dist/utils/uuids.d.ts.map +1 -1
  1013. package/dist/utils/uuids.js +3 -28
  1014. package/dist/utils/uuids.js.map +1 -1
  1015. package/dist/webhooks-8Ts1Clcb.d.ts +326 -0
  1016. package/dist/webhooks-8Ts1Clcb.d.ts.map +1 -0
  1017. package/package.json +2 -8
  1018. package/src/interface/client-interface.test.ts +77 -12
  1019. package/src/interface/client-interface.ts +9 -9
  1020. package/dist/config/format.d.ts.map +0 -1
  1021. package/dist/config/schema.d.ts.map +0 -1
  1022. package/dist/crud.d.ts.map +0 -1
  1023. package/dist/interface/admin-interface.d.ts.map +0 -1
  1024. package/dist/interface/admin-metrics.d.ts.map +0 -1
  1025. package/dist/interface/client-interface.d.ts.map +0 -1
  1026. package/dist/interface/crud/analytics.d.ts.map +0 -1
  1027. package/dist/interface/crud/connected-accounts.d.ts.map +0 -1
  1028. package/dist/interface/crud/contact-channels.d.ts.map +0 -1
  1029. package/dist/interface/crud/current-user.d.ts.map +0 -1
  1030. package/dist/interface/crud/emails.d.ts.map +0 -1
  1031. package/dist/interface/crud/internal-api-keys.d.ts.map +0 -1
  1032. package/dist/interface/crud/invoices.d.ts.map +0 -1
  1033. package/dist/interface/crud/items.d.ts.map +0 -1
  1034. package/dist/interface/crud/notification-preferences.d.ts.map +0 -1
  1035. package/dist/interface/crud/oauth-providers.d.ts.map +0 -1
  1036. package/dist/interface/crud/products.d.ts.map +0 -1
  1037. package/dist/interface/crud/project-api-keys.d.ts.map +0 -1
  1038. package/dist/interface/crud/project-permissions.d.ts.map +0 -1
  1039. package/dist/interface/crud/projects.d.ts.map +0 -1
  1040. package/dist/interface/crud/session-replays.d.ts.map +0 -1
  1041. package/dist/interface/crud/sessions.d.ts.map +0 -1
  1042. package/dist/interface/crud/svix-token.d.ts.map +0 -1
  1043. package/dist/interface/crud/team-invitation.d.ts.map +0 -1
  1044. package/dist/interface/crud/team-member-profiles.d.ts.map +0 -1
  1045. package/dist/interface/crud/team-memberships.d.ts.map +0 -1
  1046. package/dist/interface/crud/team-permissions.d.ts.map +0 -1
  1047. package/dist/interface/crud/teams.d.ts.map +0 -1
  1048. package/dist/interface/crud/transactions.d.ts.map +0 -1
  1049. package/dist/interface/crud/users.d.ts.map +0 -1
  1050. package/dist/interface/handler-urls.d.ts.map +0 -1
  1051. package/dist/interface/page-component-versions.d.ts.map +0 -1
  1052. package/dist/interface/plan-usage.d.ts.map +0 -1
  1053. package/dist/interface/server-interface.d.ts.map +0 -1
  1054. package/dist/interface/webhooks.d.ts.map +0 -1
  1055. package/dist/known-errors.d.ts.map +0 -1
  1056. package/dist/schema-fields.d.ts.map +0 -1
  1057. package/dist/sessions.d.ts.map +0 -1
  1058. package/dist/utils/country-codes.d.ts.map +0 -1
  1059. package/dist/utils/currency-constants.d.ts.map +0 -1
  1060. package/dist/utils/dates.d.ts.map +0 -1
  1061. package/dist/utils/errors.d.ts.map +0 -1
  1062. package/dist/utils/json.d.ts.map +0 -1
  1063. package/dist/utils/objects.d.ts.map +0 -1
  1064. package/dist/utils/results.d.ts.map +0 -1
  1065. package/dist/utils/strings.d.ts.map +0 -1
  1066. package/dist/utils/types.d.ts.map +0 -1
@@ -1,9 +1,7 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_chunk = require('./chunk-BE-pF4vm.js');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
2
  let __utils_errors_js = require("./utils/errors.js");
4
3
  let __utils_functions_js = require("./utils/functions.js");
5
4
  let __utils_strings_js = require("./utils/strings.js");
6
-
7
5
  //#region src/known-errors.tsx
8
6
  var KnownError = class extends __utils_errors_js.StatusError {
9
7
  constructor(statusCode, humanReadableMessage, details) {
@@ -77,14 +75,6 @@ function createKnownErrorConstructor(SuperClass, errorCode, create, constructorA
77
75
  }
78
76
  return KnownErrorImpl;
79
77
  }
80
- (void 0)?.test("KnownError.isInstance", ({ expect }) => {
81
- expect(KnownErrors.InvalidProjectAuthentication.isInstance(void 0)).toBe(false);
82
- expect(KnownErrors.InvalidProjectAuthentication.isInstance(/* @__PURE__ */ new Error())).toBe(false);
83
- const error = new KnownErrors.ProjectKeyWithoutAccessType();
84
- expect(KnownErrors.ProjectKeyWithoutAccessType.isInstance(error)).toBe(true);
85
- expect(KnownErrors.InvalidProjectAuthentication.isInstance(error)).toBe(true);
86
- expect(KnownErrors.InvalidAccessType.isInstance(error)).toBe(false);
87
- });
88
78
  const UnsupportedError = createKnownErrorConstructor(KnownError, "UNSUPPORTED_ERROR", (originalErrorCode) => [
89
79
  500,
90
80
  `An error occurred that is not currently supported (possibly because it was added in a version of Stack that is newer than this client). The original unsupported error code was: ${originalErrorCode}`,
@@ -631,15 +621,6 @@ const AnalyticsQueryError = createKnownErrorConstructor(KnownError, "ANALYTICS_Q
631
621
  { error }
632
622
  ], (json) => [json.error]);
633
623
  const AnalyticsNotEnabled = createKnownErrorConstructor(KnownError, "ANALYTICS_NOT_ENABLED", () => [400, "Analytics is not enabled for this project."], () => []);
634
- const DefaultPaymentMethodRequired = createKnownErrorConstructor(KnownError, "DEFAULT_PAYMENT_METHOD_REQUIRED", (customerType, customerId) => [
635
- 400,
636
- "No default payment method is set for this customer.",
637
- {
638
- customer_type: customerType,
639
- customer_id: customerId
640
- }
641
- ], (json) => [json.customer_type, json.customer_id]);
642
- const NewPurchasesBlocked = createKnownErrorConstructor(KnownError, "NEW_PURCHASES_BLOCKED", () => [403, "New purchases are currently blocked for this project. Please contact support for more information."], () => []);
643
624
  const KnownErrors = {
644
625
  CannotDeleteCurrentSession,
645
626
  UnsupportedError,
@@ -778,8 +759,15 @@ const KnownErrors = {
778
759
  TestModePurchaseNonRefundable,
779
760
  ItemQuantityInsufficientAmount,
780
761
  StripeAccountInfoNotFound,
781
- DefaultPaymentMethodRequired,
782
- NewPurchasesBlocked,
762
+ DefaultPaymentMethodRequired: createKnownErrorConstructor(KnownError, "DEFAULT_PAYMENT_METHOD_REQUIRED", (customerType, customerId) => [
763
+ 400,
764
+ "No default payment method is set for this customer.",
765
+ {
766
+ customer_type: customerType,
767
+ customer_id: customerId
768
+ }
769
+ ], (json) => [json.customer_type, json.customer_id]),
770
+ NewPurchasesBlocked: createKnownErrorConstructor(KnownError, "NEW_PURCHASES_BLOCKED", () => [403, "New purchases are currently blocked for this project. Please contact support for more information."], () => []),
783
771
  DataVaultStoreDoesNotExist,
784
772
  DataVaultStoreHashedKeyDoesNotExist,
785
773
  AnalyticsQueryTimeout,
@@ -791,8 +779,8 @@ for (const [_, KnownError] of Object.entries(KnownErrors)) {
791
779
  if (knownErrorCodes.has(KnownError.errorCode)) throw new Error(`Duplicate known error code: ${KnownError.errorCode}`);
792
780
  knownErrorCodes.add(KnownError.errorCode);
793
781
  }
794
-
795
782
  //#endregion
796
783
  exports.KnownError = KnownError;
797
784
  exports.KnownErrors = KnownErrors;
785
+
798
786
  //# sourceMappingURL=known-errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"known-errors.js","names":[],"sources":["../src/known-errors.tsx"],"sourcesContent":["import { HexclaveAssertionError, StatusError, throwErr } from \"./utils/errors\";\nimport { identityArgs } from \"./utils/functions\";\nimport { Json } from \"./utils/json\";\nimport { deindent } from \"./utils/strings\";\n\nexport type KnownErrorJson = {\n code: string,\n message: string,\n details?: Json,\n};\n\nexport type AbstractKnownErrorConstructor<Args extends any[]> =\n & (abstract new (...args: Args) => KnownError)\n & {\n constructorArgsFromJson: (json: KnownErrorJson) => Args,\n };\n\nexport type KnownErrorConstructor<SuperInstance extends KnownError, Args extends any[]> = {\n new(...args: Args): SuperInstance & { constructorArgs: Args },\n errorCode: string,\n constructorArgsFromJson: (json: KnownErrorJson) => Args,\n isInstance: (error: unknown) => error is SuperInstance & { constructorArgs: Args },\n};\n\nexport abstract class KnownError extends StatusError {\n private readonly __stackKnownErrorBrand = \"stack-known-error-brand-sentinel\" as const;\n public name = \"KnownError\";\n\n constructor(\n public readonly statusCode: number,\n public readonly humanReadableMessage: string,\n public readonly details?: Json,\n ) {\n super(\n statusCode,\n humanReadableMessage\n );\n }\n\n public static isKnownError(error: unknown): error is KnownError {\n // like instanceof, but also works for errors thrown in other realms or by different versions of the same package\n return typeof error === \"object\" && error !== null && \"__stackKnownErrorBrand\" in error && error.__stackKnownErrorBrand === \"stack-known-error-brand-sentinel\";\n }\n\n public override getBody(): Uint8Array {\n return new TextEncoder().encode(JSON.stringify(this.toDescriptiveJson(), undefined, 2));\n }\n\n public override getHeaders(): Record<string, string[]> {\n return {\n \"Content-Type\": [\"application/json; charset=utf-8\"],\n // Hexclave rebrand: dual-emit both X-Hexclave-* and X-Stack-* so old and new SDKs can both read it.\n \"X-Stack-Known-Error\": [this.errorCode],\n \"X-Hexclave-Known-Error\": [this.errorCode],\n };\n }\n\n public override toDescriptiveJson(): Json {\n return {\n code: this.errorCode,\n ...this.details ? { details: this.details } : {},\n error: this.humanReadableMessage,\n };\n }\n\n get errorCode(): string {\n return (this.constructor as any).errorCode ?? throwErr(`Can't find error code for this KnownError. Is its constructor a KnownErrorConstructor? ${this}`);\n }\n\n public static constructorArgsFromJson(json: KnownErrorJson): ConstructorParameters<typeof KnownError> {\n return [\n 400,\n json.message,\n json,\n ];\n }\n\n public static fromJson(json: KnownErrorJson): KnownError {\n for (const [_, KnownErrorType] of Object.entries(KnownErrors)) {\n if (json.code === KnownErrorType.prototype.errorCode) {\n const constructorArgs = KnownErrorType.constructorArgsFromJson(json);\n return new KnownErrorType(\n // @ts-ignore-next-line\n ...constructorArgs,\n );\n }\n }\n\n throw new Error(`An error occurred. Please update your version of the Hexclave SDK. ${json.code}: ${json.message}`);\n }\n}\n\nconst knownErrorConstructorErrorCodeSentinel = Symbol(\"knownErrorConstructorErrorCodeSentinel\");\n/**\n * Exists solely so that known errors are nominative types (ie. two KnownErrors with the same interface are not the same type)\n */\ntype KnownErrorBrand<ErrorCode extends string> = {\n /**\n * Does not exist at runtime\n *\n * Must be an object because it may be true for multiple error codes (it's true for all parents)\n */\n [knownErrorConstructorErrorCodeSentinel]: {\n [K in ErrorCode]: true\n },\n};\n\nfunction createKnownErrorConstructor<ErrorCode extends string, Super extends AbstractKnownErrorConstructor<any>, Args extends any[]>(\n SuperClass: Super,\n errorCode: ErrorCode,\n create: ((...args: Args) => Readonly<ConstructorParameters<Super>>),\n constructorArgsFromJson: ((jsonDetails: any) => NoInfer<Args>),\n): KnownErrorConstructor<InstanceType<Super> & KnownErrorBrand<ErrorCode>, Args> & { errorCode: ErrorCode };\nfunction createKnownErrorConstructor<ErrorCode extends string, Super extends AbstractKnownErrorConstructor<any>>(\n SuperClass: Super,\n errorCode: ErrorCode,\n create: \"inherit\",\n constructorArgsFromJson: \"inherit\",\n): KnownErrorConstructor<InstanceType<Super> & KnownErrorBrand<ErrorCode>, ConstructorParameters<Super>> & { errorCode: ErrorCode };\nfunction createKnownErrorConstructor<ErrorCode extends string, Super extends AbstractKnownErrorConstructor<any>, Args extends any[]>(\n SuperClass: Super,\n errorCode: ErrorCode,\n create: \"inherit\" | ((...args: Args) => Readonly<ConstructorParameters<Super>>),\n constructorArgsFromJson: \"inherit\" | ((jsonDetails: any) => NoInfer<Args>),\n): KnownErrorConstructor<InstanceType<Super> & KnownErrorBrand<ErrorCode>, Args> & { errorCode: ErrorCode } {\n const createFn = create === \"inherit\" ? identityArgs<Args> as never : create;\n const constructorArgsFromJsonFn = constructorArgsFromJson === \"inherit\" ? SuperClass.constructorArgsFromJson as never : constructorArgsFromJson;\n\n // @ts-expect-error this is not a mixin, but TS detects it as one\n class KnownErrorImpl extends SuperClass {\n public static readonly errorCode = errorCode;\n public name = `KnownError<${errorCode}>`;\n public readonly constructorArgs: Args;\n\n constructor(...args: Args) {\n // @ts-ignore legendary comment, may never be removed https://x.com/konstiwohlwend/status/1998543556567617780\n super(...createFn(...args));\n this.constructorArgs = args;\n }\n\n static constructorArgsFromJson(json: KnownErrorJson): Args {\n return constructorArgsFromJsonFn(json.details);\n }\n\n static isInstance(error: unknown): error is InstanceType<Super> & { constructorArgs: Args } {\n if (!KnownError.isKnownError(error)) return false;\n let current: unknown = error;\n while (true) {\n current = Object.getPrototypeOf(current);\n if (!current) break;\n if (\"errorCode\" in current.constructor && current.constructor.errorCode === errorCode) return true;\n }\n return false;\n }\n };\n\n // @ts-expect-error\n return KnownErrorImpl;\n}\nimport.meta.vitest?.test(\"KnownError.isInstance\", ({ expect }) => {\n expect(KnownErrors.InvalidProjectAuthentication.isInstance(undefined)).toBe(false);\n expect(KnownErrors.InvalidProjectAuthentication.isInstance(new Error())).toBe(false);\n\n const error = new KnownErrors.ProjectKeyWithoutAccessType();\n expect(KnownErrors.ProjectKeyWithoutAccessType.isInstance(error)).toBe(true);\n expect(KnownErrors.InvalidProjectAuthentication.isInstance(error)).toBe(true);\n expect(KnownErrors.InvalidAccessType.isInstance(error)).toBe(false);\n});\n\nconst UnsupportedError = createKnownErrorConstructor(\n KnownError,\n \"UNSUPPORTED_ERROR\",\n (originalErrorCode: string) => [\n 500,\n `An error occurred that is not currently supported (possibly because it was added in a version of Stack that is newer than this client). The original unsupported error code was: ${originalErrorCode}`,\n {\n originalErrorCode,\n },\n ] as const,\n (json) => [\n (json as any)?.originalErrorCode ?? throwErr(\"originalErrorCode not found in UnsupportedError details\"),\n ] as const,\n);\n\nconst BodyParsingError = createKnownErrorConstructor(\n KnownError,\n \"BODY_PARSING_ERROR\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json) => [json.message] as const,\n);\n\nconst SchemaError = createKnownErrorConstructor(\n KnownError,\n \"SCHEMA_ERROR\",\n (message: string) => [\n 400,\n message || throwErr(\"SchemaError requires a message\"),\n {\n message,\n },\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst AllOverloadsFailed = createKnownErrorConstructor(\n KnownError,\n \"ALL_OVERLOADS_FAILED\",\n (overloadErrors: Json[]) => [\n 400,\n deindent`\n This endpoint has multiple overloads, but they all failed to process the request.\n\n ${overloadErrors.map((e, i) => deindent`\n Overload ${i + 1}: ${JSON.stringify(e, undefined, 2)}\n `).join(\"\\n\\n\")}\n `,\n {\n overload_errors: overloadErrors,\n },\n ] as const,\n (json) => [\n (json as any)?.overload_errors ?? throwErr(\"overload_errors not found in AllOverloadsFailed details\"),\n ] as const,\n);\n\nconst ProjectAuthenticationError = createKnownErrorConstructor(\n KnownError,\n \"PROJECT_AUTHENTICATION_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst InvalidProjectAuthentication = createKnownErrorConstructor(\n ProjectAuthenticationError,\n \"INVALID_PROJECT_AUTHENTICATION\",\n \"inherit\",\n \"inherit\",\n);\n\nconst ProjectKeyWithoutAccessType = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"PROJECT_KEY_WITHOUT_ACCESS_TYPE\",\n () => [\n 400,\n \"Either an API key or an admin access token was provided, but the x-hexclave-access-type header is missing. Set it to 'client', 'server', or 'admin' as appropriate. (The legacy x-stack-access-type header is also accepted.)\",\n ] as const,\n () => [] as const,\n);\n\nconst InvalidAccessType = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_ACCESS_TYPE\",\n (accessType: string) => [\n 400,\n `The x-hexclave-access-type header must be 'client', 'server', or 'admin', but was '${accessType}'. (The legacy x-stack-access-type header is also accepted.)`,\n ] as const,\n (json) => [\n (json as any)?.accessType ?? throwErr(\"accessType not found in InvalidAccessType details\"),\n ] as const,\n);\n\nconst AccessTypeWithoutProjectId = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"ACCESS_TYPE_WITHOUT_PROJECT_ID\",\n (accessType: \"client\" | \"server\" | \"admin\") => [\n 400,\n deindent`\n The x-hexclave-access-type header was '${accessType}', but the x-hexclave-project-id header was not provided. (The legacy x-stack-access-type and x-stack-project-id headers are also accepted.)\n \n For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication\n `,\n {\n request_type: accessType,\n },\n ] as const,\n (json: any) => [json.request_type] as const,\n);\n\nconst AccessTypeRequired = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"ACCESS_TYPE_REQUIRED\",\n () => [\n 400,\n deindent`\n You must specify an access level for this Hexclave project. Make sure project API keys are provided (eg. x-hexclave-publishable-client-key) and you set the x-hexclave-access-type header to 'client', 'server', or 'admin'. (The legacy x-stack-* equivalents are also accepted.)\n \n For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication\n `,\n ] as const,\n () => [] as const,\n);\n\nconst InsufficientAccessType = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INSUFFICIENT_ACCESS_TYPE\",\n (actualAccessType: \"client\" | \"server\" | \"admin\", allowedAccessTypes: (\"client\" | \"server\" | \"admin\")[]) => [\n 401,\n `The x-hexclave-access-type header must be ${allowedAccessTypes.map(s => `'${s}'`).join(\" or \")}, but was '${actualAccessType}'. (The legacy x-stack-access-type header is also accepted.)`,\n {\n actual_access_type: actualAccessType,\n allowed_access_types: allowedAccessTypes,\n },\n ] as const,\n (json: any) => [\n json.actual_access_type,\n json.allowed_access_types,\n ] as const,\n);\n\nconst InvalidPublishableClientKey = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_PUBLISHABLE_CLIENT_KEY\",\n (projectId: string) => [\n 401,\n `The publishable key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst InvalidSecretServerKey = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_SECRET_SERVER_KEY\",\n (projectId: string) => [\n 401,\n `The secret server key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst InvalidSuperSecretAdminKey = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_SUPER_SECRET_ADMIN_KEY\",\n (projectId: string) => [\n 401,\n `The super secret admin key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst InvalidAdminAccessToken = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_ADMIN_ACCESS_TOKEN\",\n \"inherit\",\n \"inherit\",\n);\n\nconst UnparsableAdminAccessToken = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"UNPARSABLE_ADMIN_ACCESS_TOKEN\",\n () => [\n 401,\n \"Admin access token is not parsable.\",\n ] as const,\n () => [] as const,\n);\n\nconst AdminAccessTokenExpired = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"ADMIN_ACCESS_TOKEN_EXPIRED\",\n (expiredAt: Date | undefined) => [\n 401,\n `Admin access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : \"\"}`,\n { expired_at_millis: expiredAt?.getTime() ?? null },\n ] as const,\n (json: any) => [json.expired_at_millis ? new Date(json.expired_at_millis) : undefined] as const,\n);\n\nconst InvalidProjectForAdminAccessToken = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN\",\n () => [\n 401,\n \"Admin access tokens must be created on the internal project.\",\n ] as const,\n () => [] as const,\n);\n\nconst AdminAccessTokenIsNotAdmin = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN\",\n () => [\n 401,\n \"Admin access token does not have the required permissions to access this project.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ProjectAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationError,\n \"PROJECT_AUTHENTICATION_REQUIRED\",\n \"inherit\",\n \"inherit\",\n);\n\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"The publishable client key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\nconst PublishableClientKeyRequiredForProject = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"PUBLISHABLE_CLIENT_KEY_REQUIRED_FOR_PROJECT\",\n (projectId?: string) => [\n 401,\n \"Publishable client keys are required for this project. Create one in Project Keys, or disable this requirement there to allow keyless client access.\",\n {\n project_id: projectId ?? null,\n },\n ] as const,\n (json: any) => [json.project_id ?? undefined] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ServerAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"SERVER_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"The secret server key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientOrServerAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"Either the publishable client key or the secret server key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientOrAdminAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"Either the publishable client key or the super secret admin key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientOrServerOrAdminAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"Either the publishable client key, the secret server key, or the super secret admin key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst AdminAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"ADMIN_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"The super secret admin key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\nconst ExpectedInternalProject = createKnownErrorConstructor(\n ProjectAuthenticationError,\n \"EXPECTED_INTERNAL_PROJECT\",\n () => [\n 401,\n \"The project ID is expected to be internal.\",\n ] as const,\n () => [] as const,\n);\n\nconst SessionAuthenticationError = createKnownErrorConstructor(\n KnownError,\n \"SESSION_AUTHENTICATION_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst InvalidSessionAuthentication = createKnownErrorConstructor(\n SessionAuthenticationError,\n \"INVALID_SESSION_AUTHENTICATION\",\n \"inherit\",\n \"inherit\",\n);\n\nconst InvalidAccessToken = createKnownErrorConstructor(\n InvalidSessionAuthentication,\n \"INVALID_ACCESS_TOKEN\",\n \"inherit\",\n \"inherit\",\n);\n\nconst UnparsableAccessToken = createKnownErrorConstructor(\n InvalidAccessToken,\n \"UNPARSABLE_ACCESS_TOKEN\",\n () => [\n 401,\n \"Access token is not parsable.\",\n ] as const,\n () => [] as const,\n);\n\nconst AccessTokenExpired = createKnownErrorConstructor(\n InvalidAccessToken,\n \"ACCESS_TOKEN_EXPIRED\",\n (expiredAt: Date | undefined, projectId: string | undefined, userId: string | undefined, refreshTokenId: string | undefined) => [\n 401,\n deindent`\n Access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : \"\"}${projectId ? ` Project ID: ${projectId}.` : \"\"}${userId ? ` User ID: ${userId}.` : \"\"}${refreshTokenId ? ` Refresh token ID: ${refreshTokenId}.` : \"\"}\n\n Debug info: Most likely, you fetched the access token before it expired (for example, in a server component, pre-rendered page, or on page load), but then didn't refresh it before it expired. If this is the case, and you're using the SDK, make sure you call getAccessToken() every time you need to use the access token. If you're not using the SDK, make sure you refresh the access token with the refresh endpoint.\n `,\n {\n expired_at_millis: expiredAt?.getTime() ?? null,\n project_id: projectId ?? null,\n user_id: userId ?? null,\n refresh_token_id: refreshTokenId ?? null,\n },\n ] as const,\n (json: any) => [\n json.expired_at_millis ? new Date(json.expired_at_millis) : undefined,\n json.project_id ?? undefined,\n json.user_id ?? undefined,\n json.refresh_token_id ?? undefined,\n ] as const,\n);\n\nconst InvalidProjectForAccessToken = createKnownErrorConstructor(\n InvalidAccessToken,\n \"INVALID_PROJECT_FOR_ACCESS_TOKEN\",\n (expectedProjectId: string, actualProjectId: string) => [\n 401,\n `Access token not valid for this project. Expected project ID ${JSON.stringify(expectedProjectId)}, but the token is for project ID ${JSON.stringify(actualProjectId)}.`,\n {\n expected_project_id: expectedProjectId,\n actual_project_id: actualProjectId,\n },\n ] as const,\n (json: any) => [json.expected_project_id, json.actual_project_id] as const,\n);\n\n\nconst RefreshTokenError = createKnownErrorConstructor(\n KnownError,\n \"REFRESH_TOKEN_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst RefreshTokenNotFoundOrExpired = createKnownErrorConstructor(\n RefreshTokenError,\n \"REFRESH_TOKEN_NOT_FOUND_OR_EXPIRED\",\n () => [\n 401,\n \"Refresh token not found for this project, or the session has expired/been revoked.\",\n ] as const,\n () => [] as const,\n);\n\nconst CannotDeleteCurrentSession = createKnownErrorConstructor(\n RefreshTokenError,\n \"CANNOT_DELETE_CURRENT_SESSION\",\n () => [\n 400,\n \"Cannot delete the current session.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst ProviderRejected = createKnownErrorConstructor(\n RefreshTokenError,\n \"PROVIDER_REJECTED\",\n () => [\n 401,\n \"The provider refused to refresh their token. This usually means that the provider used to authenticate the user no longer regards this session as valid, and the user must re-authenticate.\",\n ] as const,\n () => [] as const,\n);\n\nconst UserWithEmailAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"USER_EMAIL_ALREADY_EXISTS\",\n (email: string, wouldWorkIfEmailWasVerified: boolean = false) => [\n 409,\n `A user with email ${JSON.stringify(email)} already exists${wouldWorkIfEmailWasVerified ? \" but the email is not verified. Please login to your existing account with the method you used to sign up, and then verify your email to sign in with this login method.\" : \".\"}`,\n {\n email,\n would_work_if_email_was_verified: wouldWorkIfEmailWasVerified,\n },\n ] as const,\n (json: any) => [json.email, json.would_work_if_email_was_verified ?? false] as const,\n);\n\nconst EmailNotVerified = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_NOT_VERIFIED\",\n () => [\n 400,\n \"The email is not verified.\",\n ] as const,\n () => [] as const,\n);\n\nconst CannotGetOwnUserWithoutUser = createKnownErrorConstructor(\n KnownError,\n \"CANNOT_GET_OWN_USER_WITHOUT_USER\",\n () => [\n 400,\n \"You have specified 'me' as a userId, but did not provide authentication for a user.\",\n ] as const,\n () => [] as const,\n);\n\nconst UserIdDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"USER_ID_DOES_NOT_EXIST\",\n (userId: string) => [\n 400,\n `The given user with the ID ${userId} does not exist.`,\n {\n user_id: userId,\n },\n ] as const,\n (json: any) => [json.user_id] as const,\n);\n\nconst UserNotFound = createKnownErrorConstructor(\n KnownError,\n \"USER_NOT_FOUND\",\n () => [\n 404,\n \"User not found.\",\n ] as const,\n () => [] as const,\n);\n\nconst RestrictedUserNotAllowed = createKnownErrorConstructor(\n KnownError,\n \"RESTRICTED_USER_NOT_ALLOWED\",\n (restrictedReason: { type: \"anonymous\" | \"email_not_verified\" | \"restricted_by_administrator\" }) => [\n 403,\n `The user in the access token is in restricted state. Reason: ${restrictedReason.type}. Please pass the X-Stack-Allow-Restricted-User header if this is intended.`,\n {\n restricted_reason: restrictedReason,\n },\n ] as const,\n (json: any) => [json.restricted_reason ?? { type: \"anonymous\" }] as const,\n);\n\nconst ProjectNotFound = createKnownErrorConstructor(\n KnownError,\n \"PROJECT_NOT_FOUND\",\n (projectId: string) => {\n if (typeof projectId !== \"string\") throw new HexclaveAssertionError(\"projectId of KnownErrors.ProjectNotFound must be a string\");\n return [\n 404,\n `Project ${projectId} not found or is not accessible with the current user.`,\n {\n project_id: projectId,\n },\n ] as const;\n },\n (json: any) => [json.project_id] as const,\n);\n\nconst CurrentProjectNotFound = createKnownErrorConstructor(\n KnownError,\n \"CURRENT_PROJECT_NOT_FOUND\",\n (projectId: string) => [\n 400,\n `The current project with ID ${projectId} was not found. Please check the value of the x-hexclave-project-id header. (The legacy x-stack-project-id header is also accepted.)`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst BranchDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"BRANCH_DOES_NOT_EXIST\",\n (branchId: string) => [\n 400,\n `The branch with ID ${branchId} does not exist.`,\n {\n branch_id: branchId,\n },\n ] as const,\n (json: any) => [json.branch_id] as const,\n);\n\n\nconst SignUpNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"SIGN_UP_NOT_ENABLED\",\n () => [\n 400,\n \"Creation of new accounts is not enabled for this project. Please ask the project owner to enable it.\",\n ] as const,\n () => [] as const,\n);\n\nconst SignUpRejected = createKnownErrorConstructor(\n KnownError,\n \"SIGN_UP_REJECTED\",\n (message?: string) => [\n 403,\n message ?? \"Your sign up was rejected by an administrator's sign-up rule.\",\n {\n message: message ?? \"Your sign up was rejected by an administrator's sign-up rule.\",\n },\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst BotChallengeRequired = createKnownErrorConstructor(\n KnownError,\n \"BOT_CHALLENGE_REQUIRED\",\n () => [\n 409,\n \"An additional bot challenge is required before sign-up can continue.\",\n ] as const,\n () => [] as const,\n);\n\nconst BotChallengeFailed = createKnownErrorConstructor(\n KnownError,\n \"BOT_CHALLENGE_FAILED\",\n (message: string) => [\n 400,\n message,\n {\n message,\n },\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst PasswordAuthenticationNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"PASSWORD_AUTHENTICATION_NOT_ENABLED\",\n () => [\n 400,\n \"Password authentication is not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst DataVaultStoreDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"DATA_VAULT_STORE_DOES_NOT_EXIST\",\n (storeId: string) => [\n 400,\n `Data vault store with ID ${storeId} does not exist.`,\n {\n store_id: storeId,\n },\n ] as const,\n (json: any) => [json.store_id] as const,\n);\n\nconst DataVaultStoreHashedKeyDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"DATA_VAULT_STORE_HASHED_KEY_DOES_NOT_EXIST\",\n (storeId: string, hashedKey: string) => [\n 400,\n `Data vault store with ID ${storeId} does not contain a key with hash ${hashedKey}.`,\n {\n store_id: storeId,\n hashed_key: hashedKey,\n },\n ] as const,\n (json: any) => [json.store_id, json.hashed_key] as const,\n);\n\nconst PasskeyAuthenticationNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_AUTHENTICATION_NOT_ENABLED\",\n () => [\n 400,\n \"Passkey authentication is not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst AnonymousAccountsNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"ANONYMOUS_ACCOUNTS_NOT_ENABLED\",\n () => [\n 400,\n \"Anonymous accounts are not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst AnonymousAuthenticationNotAllowed = createKnownErrorConstructor(\n KnownError,\n \"ANONYMOUS_AUTHENTICATION_NOT_ALLOWED\",\n () => [\n 401,\n \"X-Stack-Access-Token is for an anonymous user, but anonymous users are not enabled. Set the X-Stack-Allow-Anonymous-User header of this request to 'true' to allow anonymous users.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst EmailPasswordMismatch = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_PASSWORD_MISMATCH\",\n () => [\n 400,\n \"Wrong e-mail or password.\",\n ] as const,\n () => [] as const,\n);\n\nconst RedirectUrlNotWhitelisted = createKnownErrorConstructor(\n KnownError,\n \"REDIRECT_URL_NOT_WHITELISTED\",\n (redirectUrl?: string) => [\n 400,\n \"Redirect URL not whitelisted. Did you forget to add this domain to the trusted domains list on the Hexclave dashboard?\",\n redirectUrl === undefined ? undefined : {\n redirect_url: redirectUrl,\n },\n ] as const,\n (json) => [(json as any)?.redirect_url] as const,\n);\n\nconst PasswordRequirementsNotMet = createKnownErrorConstructor(\n KnownError,\n \"PASSWORD_REQUIREMENTS_NOT_MET\",\n \"inherit\",\n \"inherit\",\n);\n\nconst PasswordTooShort = createKnownErrorConstructor(\n PasswordRequirementsNotMet,\n \"PASSWORD_TOO_SHORT\",\n (minLength: number) => [\n 400,\n `Password too short. Minimum length is ${minLength}.`,\n {\n min_length: minLength,\n },\n ] as const,\n (json) => [\n (json as any)?.min_length ?? throwErr(\"min_length not found in PasswordTooShort details\"),\n ] as const,\n);\n\nconst PasswordTooLong = createKnownErrorConstructor(\n PasswordRequirementsNotMet,\n \"PASSWORD_TOO_LONG\",\n (maxLength: number) => [\n 400,\n `Password too long. Maximum length is ${maxLength}.`,\n {\n maxLength,\n },\n ] as const,\n (json) => [\n (json as any)?.maxLength ?? throwErr(\"maxLength not found in PasswordTooLong details\"),\n ] as const,\n);\n\nconst UserDoesNotHavePassword = createKnownErrorConstructor(\n KnownError,\n \"USER_DOES_NOT_HAVE_PASSWORD\",\n () => [\n 400,\n \"This user does not have password authentication enabled.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeError = createKnownErrorConstructor(\n KnownError,\n \"VERIFICATION_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst VerificationCodeNotFound = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_NOT_FOUND\",\n () => [\n 404,\n \"The verification code does not exist for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeExpired = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_EXPIRED\",\n () => [\n 400,\n \"The verification code has expired.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeAlreadyUsed = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_ALREADY_USED\",\n () => [\n 409,\n \"The verification link has already been used.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeMaxAttemptsReached = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_MAX_ATTEMPTS_REACHED\",\n () => [\n 400,\n \"The verification code nonce has reached the maximum number of attempts. This code is not valid anymore.\",\n ] as const,\n () => [] as const,\n);\n\nconst PasswordConfirmationMismatch = createKnownErrorConstructor(\n KnownError,\n \"PASSWORD_CONFIRMATION_MISMATCH\",\n () => [\n 400,\n \"Passwords do not match.\",\n ] as const,\n () => [] as const,\n);\n\nconst EmailAlreadyVerified = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_ALREADY_VERIFIED\",\n () => [\n 409,\n \"The e-mail is already verified.\",\n ] as const,\n () => [] as const,\n);\n\nconst EmailNotAssociatedWithUser = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_NOT_ASSOCIATED_WITH_USER\",\n () => [\n 400,\n \"The e-mail is not associated with a user that could log in with that e-mail.\",\n ] as const,\n () => [] as const,\n);\n\nconst EmailIsNotPrimaryEmail = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_IS_NOT_PRIMARY_EMAIL\",\n (email: string, primaryEmail: string | null) => [\n 400,\n `The given e-mail (${email}) must equal the user's primary e-mail (${primaryEmail}).`,\n {\n email,\n primary_email: primaryEmail,\n },\n ] as const,\n (json: any) => [json.email, json.primary_email] as const,\n);\n\n\nconst PasskeyRegistrationFailed = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_REGISTRATION_FAILED\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\n\nconst PasskeyWebAuthnError = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_WEBAUTHN_ERROR\",\n (message: string, code: string) => [\n 400,\n message,\n {\n message,\n code,\n },\n ] as const,\n (json: any) => [json.message, json.code] as const,\n);\n\nconst PasskeyAuthenticationFailed = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_AUTHENTICATION_FAILED\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\n\nconst PermissionNotFound = createKnownErrorConstructor(\n KnownError,\n \"PERMISSION_NOT_FOUND\",\n (permissionId: string) => [\n 404,\n `Permission \"${permissionId}\" not found. Make sure you created it on the dashboard.`,\n {\n permission_id: permissionId,\n },\n ] as const,\n (json: any) => [json.permission_id] as const,\n);\n\nconst PermissionScopeMismatch = createKnownErrorConstructor(\n KnownError,\n \"WRONG_PERMISSION_SCOPE\",\n (permissionId: string, expectedScope: \"team\" | \"project\", actualScope: \"team\" | \"project\" | null) => [\n 404,\n `Permission ${JSON.stringify(permissionId)} not found. (It was found for a different scope ${JSON.stringify(actualScope)}, but scope ${JSON.stringify(expectedScope)} was expected.)`,\n {\n permission_id: permissionId,\n expected_scope: expectedScope,\n actual_scope: actualScope,\n },\n ] as const,\n (json: any) => [json.permission_id, json.expected_scope, json.actual_scope] as const,\n);\n\nconst ContainedPermissionNotFound = createKnownErrorConstructor(\n KnownError,\n \"CONTAINED_PERMISSION_NOT_FOUND\",\n (permissionId: string) => [\n 400,\n `Contained permission with ID \"${permissionId}\" not found. Make sure you created it on the dashboard.`,\n {\n permission_id: permissionId,\n },\n ] as const,\n (json: any) => [json.permission_id] as const,\n);\n\nconst TeamNotFound = createKnownErrorConstructor(\n KnownError,\n \"TEAM_NOT_FOUND\",\n (teamId: string) => [\n 404,\n `Team ${teamId} not found.`,\n {\n team_id: teamId,\n },\n ] as const,\n (json: any) => [json.team_id] as const,\n);\n\nconst TeamAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"TEAM_ALREADY_EXISTS\",\n (teamId: string) => [\n 409,\n `Team ${teamId} already exists.`,\n {\n team_id: teamId,\n },\n ] as const,\n (json: any) => [json.team_id] as const,\n);\n\nconst TeamMembershipNotFound = createKnownErrorConstructor(\n KnownError,\n \"TEAM_MEMBERSHIP_NOT_FOUND\",\n (teamId: string, userId: string) => [\n 404,\n `User ${userId} is not found in team ${teamId}.`,\n {\n team_id: teamId,\n user_id: userId,\n },\n ] as const,\n (json: any) => [json.team_id, json.user_id] as const,\n);\n\nconst TeamInvitationRestrictedUserNotAllowed = createKnownErrorConstructor(\n KnownError,\n \"TEAM_INVITATION_RESTRICTED_USER_NOT_ALLOWED\",\n (restrictedReason: { type: \"anonymous\" | \"email_not_verified\" | \"restricted_by_administrator\" }) => [\n 403,\n `Restricted users cannot accept team invitations. Reason: ${restrictedReason.type}. Please complete the onboarding process before accepting team invitations.`,\n {\n restricted_reason: restrictedReason,\n },\n ] as const,\n (json: any) => [json.restricted_reason ?? { type: \"anonymous\" }] as const,\n);\n\nconst TeamInvitationEmailMismatch = createKnownErrorConstructor(\n KnownError,\n \"TEAM_INVITATION_EMAIL_MISMATCH\",\n () => [\n 403,\n \"This team invitation was sent to a different email address. Sign in with the invited email, or add and verify that email on your account, then try again.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst EmailTemplateAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_TEMPLATE_ALREADY_EXISTS\",\n () => [\n 409,\n \"Email template already exists.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthConnectionNotConnectedToUser = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_CONNECTION_NOT_CONNECTED_TO_USER\",\n () => [\n 400,\n \"The OAuth connection is not connected to any user.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthConnectionAlreadyConnectedToAnotherUser = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_CONNECTION_ALREADY_CONNECTED_TO_ANOTHER_USER\",\n () => [\n 409,\n \"The OAuth connection is already connected to another user.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthConnectionDoesNotHaveRequiredScope = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_CONNECTION_DOES_NOT_HAVE_REQUIRED_SCOPE\",\n () => [\n 400,\n \"The OAuth connection does not have the required scope.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthAccessTokenNotAvailable = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_ACCESS_TOKEN_NOT_AVAILABLE\",\n (provider: string, details: string) => [\n 400,\n `Failed to retrieve an OAuth access token for the connected account (provider: ${provider}). ${details}`,\n {\n provider,\n details,\n } as const,\n ] as const,\n (json: any) => [json.provider, json.details] as const,\n);\n\nconst OAuthExtraScopeNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_EXTRA_SCOPE_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS\",\n () => [\n 400,\n \"Extra scopes are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use extra scopes.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthAccessTokenNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_ACCESS_TOKEN_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS\",\n () => [\n 400,\n \"Access tokens are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use access tokens.\",\n ] as const,\n () => [] as const,\n);\n\nconst InvalidOAuthClientIdOrSecret = createKnownErrorConstructor(\n KnownError,\n \"INVALID_OAUTH_CLIENT_ID_OR_SECRET\",\n (clientId?: string) => [\n 400,\n \"The OAuth client ID or secret is invalid. The client ID must be equal to the project ID (potentially with a hash and a branch ID), and the client secret must be a publishable client key.\",\n {\n client_id: clientId ?? null,\n },\n ] as const,\n (json: any) => [json.client_id ?? undefined] as const,\n);\n\nconst InvalidScope = createKnownErrorConstructor(\n KnownError,\n \"INVALID_SCOPE\",\n (scope: string) => [\n 400,\n `The scope \"${scope}\" is not a valid OAuth scope for Stack.`,\n ] as const,\n (json: any) => [json.scope] as const,\n);\n\nconst UserAlreadyConnectedToAnotherOAuthConnection = createKnownErrorConstructor(\n KnownError,\n \"USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION\",\n () => [\n 409,\n \"The user is already connected to another OAuth account. Did you maybe selected the wrong account?\",\n ] as const,\n () => [] as const,\n);\n\nconst OuterOAuthTimeout = createKnownErrorConstructor(\n KnownError,\n \"OUTER_OAUTH_TIMEOUT\",\n () => [\n 408,\n \"The OAuth flow has timed out. Please sign in again.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderNotFoundOrNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_NOT_FOUND_OR_NOT_ENABLED\",\n () => [\n 400,\n \"The OAuth provider is not found or not enabled.\",\n ] as const,\n () => [] as const,\n);\n\nconst AppleBundleIdNotConfigured = createKnownErrorConstructor(\n KnownError,\n \"APPLE_BUNDLE_ID_NOT_CONFIGURED\",\n () => [\n 400,\n \"Apple Sign In is enabled, but no Bundle IDs are configured. Please add your app's Bundle ID in the Hexclave dashboard under OAuth Providers > Apple > Apple Bundle IDs.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderAccountIdAlreadyUsedForSignIn = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_ACCOUNT_ID_ALREADY_USED_FOR_SIGN_IN\",\n () => [\n 400,\n `A provider with the same account ID is already used for signing in.`,\n ] as const,\n () => [] as const,\n);\n\nconst MultiFactorAuthenticationRequired = createKnownErrorConstructor(\n KnownError,\n \"MULTI_FACTOR_AUTHENTICATION_REQUIRED\",\n (attemptCode: string) => [\n 400,\n `Multi-factor authentication is required for this user.`,\n {\n attempt_code: attemptCode,\n },\n ] as const,\n (json) => [json.attempt_code] as const,\n);\n\nconst InvalidTotpCode = createKnownErrorConstructor(\n KnownError,\n \"INVALID_TOTP_CODE\",\n () => [\n 400,\n \"The TOTP code is invalid. Please try again.\",\n ] as const,\n () => [] as const,\n);\n\nconst UserAuthenticationRequired = createKnownErrorConstructor(\n KnownError,\n \"USER_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"User authentication required for this endpoint.\",\n ] as const,\n () => [] as const,\n);\n\nconst TeamMembershipAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"TEAM_MEMBERSHIP_ALREADY_EXISTS\",\n () => [\n 409,\n \"Team membership already exists.\",\n ] as const,\n () => [] as const,\n);\n\nconst ProjectPermissionRequired = createKnownErrorConstructor(\n KnownError,\n \"PROJECT_PERMISSION_REQUIRED\",\n (userId, permissionId) => [\n 401,\n `User ${userId} does not have permission ${permissionId}.`,\n {\n user_id: userId,\n permission_id: permissionId,\n },\n ] as const,\n (json) => [json.user_id, json.permission_id] as const,\n);\n\nconst TeamPermissionRequired = createKnownErrorConstructor(\n KnownError,\n \"TEAM_PERMISSION_REQUIRED\",\n (teamId, userId, permissionId) => [\n 401,\n `User ${userId} does not have permission ${permissionId} in team ${teamId}.`,\n {\n team_id: teamId,\n user_id: userId,\n permission_id: permissionId,\n },\n ] as const,\n (json) => [json.team_id, json.user_id, json.permission_id] as const,\n);\n\nconst TeamPermissionNotFound = createKnownErrorConstructor(\n KnownError,\n \"TEAM_PERMISSION_NOT_FOUND\",\n (teamId, userId, permissionId) => [\n 401,\n `User ${userId} does not have permission ${permissionId} in team ${teamId}.`,\n {\n team_id: teamId,\n user_id: userId,\n permission_id: permissionId,\n },\n ] as const,\n (json) => [json.team_id, json.user_id, json.permission_id] as const,\n);\n\nconst InvalidSharedOAuthProviderId = createKnownErrorConstructor(\n KnownError,\n \"INVALID_SHARED_OAUTH_PROVIDER_ID\",\n (providerId) => [\n 400,\n `The shared OAuth provider with ID ${providerId} is not valid.`,\n {\n provider_id: providerId,\n },\n ] as const,\n (json) => [json.provider_id] as const,\n);\n\nconst InvalidStandardOAuthProviderId = createKnownErrorConstructor(\n KnownError,\n \"INVALID_STANDARD_OAUTH_PROVIDER_ID\",\n (providerId) => [\n 400,\n `The standard OAuth provider with ID ${providerId} is not valid.`,\n {\n provider_id: providerId,\n },\n ] as const,\n (json) => [json.provider_id] as const,\n);\n\nconst InvalidAuthorizationCode = createKnownErrorConstructor(\n KnownError,\n \"INVALID_AUTHORIZATION_CODE\",\n () => [\n 400,\n \"The given authorization code is invalid.\",\n ] as const,\n () => [] as const,\n);\n\nconst InvalidAppleCredentials = createKnownErrorConstructor(\n KnownError,\n \"INVALID_APPLE_CREDENTIALS\",\n () => [\n 400,\n \"The Apple Sign In credentials could not be verified. Please try signing in again.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderAccessDenied = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_ACCESS_DENIED\",\n () => [\n 400,\n \"The OAuth provider denied access to the user.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderTemporarilyUnavailable = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_TEMPORARILY_UNAVAILABLE\",\n () => [\n 503,\n \"The OAuth provider is temporarily unavailable. Please try again later.\",\n ] as const,\n () => [] as const,\n);\n\nconst ContactChannelAlreadyUsedForAuthBySomeoneElse = createKnownErrorConstructor(\n KnownError,\n \"CONTACT_CHANNEL_ALREADY_USED_FOR_AUTH_BY_SOMEONE_ELSE\",\n (type: \"email\", contactChannelValue?: string, wouldWorkIfEmailWasVerified: boolean = false) => [\n 409,\n `This ${type} ${contactChannelValue ? `\"(${contactChannelValue})\"` : \"\"} is already used for authentication by another account${wouldWorkIfEmailWasVerified ? \" but the email is not verified. Please login to your existing account with the method you used to sign up, and then verify your email to sign in with this login method.\" : \".\"}`,\n {\n type,\n contact_channel_value: contactChannelValue ?? null,\n would_work_if_email_was_verified: wouldWorkIfEmailWasVerified,\n },\n ] as const,\n (json) => [json.type, json.contact_channel_value, json.would_work_if_email_was_verified ?? false] as const,\n);\n\nconst InvalidPollingCodeError = createKnownErrorConstructor(\n KnownError,\n \"INVALID_POLLING_CODE\",\n (details?: Json) => [\n 400,\n \"The polling code is invalid or does not exist.\",\n details,\n ] as const,\n (json: any) => [json] as const,\n);\n\nconst CliAuthError = createKnownErrorConstructor(\n KnownError,\n \"CLI_AUTH_ERROR\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst CliAuthExpiredError = createKnownErrorConstructor(\n KnownError,\n \"CLI_AUTH_EXPIRED_ERROR\",\n (message: string = \"CLI authentication request expired. Please try again.\") => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst CliAuthUsedError = createKnownErrorConstructor(\n KnownError,\n \"CLI_AUTH_USED_ERROR\",\n (message: string = \"This authentication token has already been used.\") => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\n\nconst ApiKeyNotValid = createKnownErrorConstructor(\n KnownError,\n \"API_KEY_NOT_VALID\",\n \"inherit\",\n \"inherit\",\n);\n\nconst ApiKeyExpired = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"API_KEY_EXPIRED\",\n () => [\n 401,\n \"API key has expired.\",\n ] as const,\n () => [] as const,\n);\n\nconst ApiKeyRevoked = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"API_KEY_REVOKED\",\n () => [\n 401,\n \"API key has been revoked.\",\n ] as const,\n () => [] as const,\n);\n\nconst WrongApiKeyType = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"WRONG_API_KEY_TYPE\",\n (expectedType: string, actualType: string) => [\n 400,\n `This endpoint is for ${expectedType} API keys, but a ${actualType} API key was provided.`,\n { expected_type: expectedType, actual_type: actualType },\n ] as const,\n (json) => [json.expected_type, json.actual_type] as const,\n);\n\nconst ApiKeyNotFound = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"API_KEY_NOT_FOUND\",\n () => [\n 404,\n \"API key not found.\",\n ] as const,\n () => [] as const,\n);\n\nconst PublicApiKeyCannotBeRevoked = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"PUBLIC_API_KEY_CANNOT_BE_REVOKED\",\n () => [\n 400,\n \"Public API keys cannot be revoked by the secretscanner endpoint.\",\n ] as const,\n () => [] as const,\n);\nconst PermissionIdAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"PERMISSION_ID_ALREADY_EXISTS\",\n (permissionId: string) => [\n 400,\n `Permission with ID \"${permissionId}\" already exists. Choose a different ID.`,\n {\n permission_id: permissionId,\n },\n ] as const,\n (json: any) => [json.permission_id] as const,\n);\n\nconst EmailRenderingError = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_RENDERING_ERROR\",\n (error: string) => [\n 400,\n `Failed to render email with theme: ${error}`,\n { error },\n ] as const,\n (json: any) => [json.error] as const,\n);\n\nconst TemplateSourceRewriteError = createKnownErrorConstructor(\n KnownError,\n \"TEMPLATE_SOURCE_REWRITE_ERROR\",\n (error: string) => [\n 400,\n `Failed to rewrite template source: ${error}`,\n { error },\n ] as const,\n (json: any) => [json.error] as const,\n);\n\nconst RequiresCustomEmailServer = createKnownErrorConstructor(\n KnownError,\n \"REQUIRES_CUSTOM_EMAIL_SERVER\",\n () => [\n 400,\n `This action requires a custom SMTP server. Please edit your email server configuration and try again.`,\n ] as const,\n () => [] as const,\n);\n\nconst EmailCapacityBoostAlreadyActive = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_CAPACITY_BOOST_ALREADY_ACTIVE\",\n (expiresAt: string) => [\n 409,\n `Email capacity boost is already active until ${expiresAt}.`,\n { expires_at: expiresAt },\n ] as const,\n (json: any) => [json.expires_at] as const,\n);\n\nconst EmailNotEditable = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_NOT_EDITABLE\",\n (emailId: string, status: string) => [\n 400,\n `Email with ID \"${emailId}\" cannot be edited because it is in status \"${status}\". Only emails in PAUSED, PREPARING, RENDERING, RENDER_ERROR, SCHEDULED, QUEUED, or SERVER_ERROR status can be edited.`,\n {\n email_id: emailId,\n status,\n },\n ] as const,\n (json: any) => [json.email_id, json.status] as const,\n);\n\nconst ItemNotFound = createKnownErrorConstructor(\n KnownError,\n \"ITEM_NOT_FOUND\",\n (itemId: string) => [\n 404,\n `Item with ID \"${itemId}\" not found.`,\n {\n item_id: itemId,\n },\n ] as const,\n (json) => [json.item_id] as const,\n);\n\nconst ItemCustomerTypeDoesNotMatch = createKnownErrorConstructor(\n KnownError,\n \"ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH\",\n (itemId: string, customerId: string, itemCustomerType: \"user\" | \"team\" | \"custom\" | undefined, actualCustomerType: \"user\" | \"team\" | \"custom\") => [\n 400,\n `The ${actualCustomerType} with ID ${JSON.stringify(customerId)} is not a valid customer for the item with ID ${JSON.stringify(itemId)}. ${itemCustomerType ? `The item is configured to only be available for ${itemCustomerType} customers, but the customer is a ${actualCustomerType}.` : `The item is missing a customer type field. Please make sure it is set up correctly in your project configuration.`}`,\n {\n item_id: itemId,\n customer_id: customerId,\n item_customer_type: itemCustomerType ?? null,\n actual_customer_type: actualCustomerType,\n },\n ] as const,\n (json) => [json.item_id, json.customer_id, json.item_customer_type ?? undefined, json.actual_customer_type] as const,\n);\n\nconst CustomerDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"CUSTOMER_DOES_NOT_EXIST\",\n (customerId: string) => [\n 400,\n `Customer with ID ${JSON.stringify(customerId)} does not exist.`,\n {\n customer_id: customerId,\n },\n ] as const,\n (json) => [json.customer_id] as const,\n);\n\nconst SubscriptionInvoiceNotFound = createKnownErrorConstructor(\n KnownError,\n \"SUBSCRIPTION_INVOICE_NOT_FOUND\",\n (subscriptionInvoiceId: string) => [\n 404,\n `Subscription invoice with ID ${JSON.stringify(subscriptionInvoiceId)} does not exist.`,\n {\n subscription_invoice_id: subscriptionInvoiceId,\n },\n ] as const,\n (json) => [json.subscription_invoice_id] as const,\n);\n\nconst OneTimePurchaseNotFound = createKnownErrorConstructor(\n KnownError,\n \"ONE_TIME_PURCHASE_NOT_FOUND\",\n (purchaseId: string) => [\n 404,\n `One-time purchase with ID ${JSON.stringify(purchaseId)} does not exist.`,\n {\n one_time_purchase_id: purchaseId,\n },\n ] as const,\n (json) => [json.one_time_purchase_id] as const,\n);\n\n// Used by the three-knob refund flow's legacy backstop — these are thrown\n// when a purchase has the pre-rework `refundedAt` column set (i.e. it was\n// refunded under the previous flow). The new flow's bulldozer-derived\n// prior-refund summary can't see those rows, so this gate prevents\n// double-refunding through Stripe.\nconst SubscriptionAlreadyRefunded = createKnownErrorConstructor(\n KnownError,\n \"SUBSCRIPTION_ALREADY_REFUNDED\",\n (subscriptionId: string) => [\n 400,\n `Subscription with ID ${JSON.stringify(subscriptionId)} was already refunded.`,\n {\n subscription_id: subscriptionId,\n },\n ] as const,\n (json) => [json.subscription_id] as const,\n);\n\nconst OneTimePurchaseAlreadyRefunded = createKnownErrorConstructor(\n KnownError,\n \"ONE_TIME_PURCHASE_ALREADY_REFUNDED\",\n (purchaseId: string) => [\n 400,\n `One-time purchase with ID ${JSON.stringify(purchaseId)} was already refunded.`,\n {\n one_time_purchase_id: purchaseId,\n },\n ] as const,\n (json) => [json.one_time_purchase_id] as const,\n);\n\nconst TestModePurchaseNonRefundable = createKnownErrorConstructor(\n KnownError,\n \"TEST_MODE_PURCHASE_NON_REFUNDABLE\",\n () => [\n 400,\n \"Test mode purchases are not refundable.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst ProductDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"PRODUCT_DOES_NOT_EXIST\",\n (productId: string, context: \"item_exists\" | \"server_only\" | null) => [\n 400,\n `Product with ID ${JSON.stringify(productId)} ${context === \"server_only\"\n ? \"is marked as server-only and cannot be accessed client side.\"\n : context === \"item_exists\"\n ? \"does not exist, but an item with this ID exists.\"\n : \"does not exist.\"\n }`,\n {\n product_id: productId,\n context,\n } as const,\n ] as const,\n (json) => [json.product_id, json.context] as const,\n);\n\nconst ProductCustomerTypeDoesNotMatch = createKnownErrorConstructor(\n KnownError,\n \"PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH\",\n (productId: string | undefined, customerId: string, productCustomerType: \"user\" | \"team\" | \"custom\" | undefined, actualCustomerType: \"user\" | \"team\" | \"custom\") => [\n 400,\n `The ${actualCustomerType} with ID ${JSON.stringify(customerId)} is not a valid customer for the inline product that has been passed in. ${productCustomerType ? `The product is configured to only be available for ${productCustomerType} customers, but the customer is a ${actualCustomerType}.` : `The product is missing a customer type field. Please make sure it is set up correctly in your project configuration.`}`,\n {\n product_id: productId ?? null,\n customer_id: customerId,\n product_customer_type: productCustomerType ?? null,\n actual_customer_type: actualCustomerType,\n },\n ] as const,\n (json) => [json.product_id ?? undefined, json.customer_id, json.product_customer_type ?? undefined, json.actual_customer_type] as const,\n);\n\nconst ProductAlreadyGranted = createKnownErrorConstructor(\n KnownError,\n \"PRODUCT_ALREADY_GRANTED\",\n (productId: string, customerId: string) => [\n 400,\n `Customer with ID ${JSON.stringify(customerId)} already owns product ${JSON.stringify(productId)}.`,\n {\n product_id: productId,\n customer_id: customerId,\n },\n ] as const,\n (json) => [json.product_id, json.customer_id] as const,\n);\n\nconst ItemQuantityInsufficientAmount = createKnownErrorConstructor(\n KnownError,\n \"ITEM_QUANTITY_INSUFFICIENT_AMOUNT\",\n (itemId: string, customerId: string, quantity: number) => [\n 400,\n `The item with ID ${JSON.stringify(itemId)} has an insufficient quantity for the customer with ID ${JSON.stringify(customerId)}. An attempt was made to charge ${quantity} credits.`,\n {\n item_id: itemId,\n customer_id: customerId,\n quantity,\n },\n ] as const,\n (json) => [json.item_id, json.customer_id, json.quantity] as const,\n);\n\nconst StripeAccountInfoNotFound = createKnownErrorConstructor(\n KnownError,\n \"STRIPE_ACCOUNT_INFO_NOT_FOUND\",\n () => [\n 404,\n \"Stripe account information not found. Please make sure the user has onboarded with Stripe.\",\n ] as const,\n () => [] as const,\n);\n\nconst AnalyticsQueryTimeout = createKnownErrorConstructor(\n KnownError,\n \"ANALYTICS_QUERY_TIMEOUT\",\n (timeoutMs: number) => [\n 400,\n `The query timed out. Please try again with a shorter query or increase the timeout. Timeout was ${timeoutMs}ms.`,\n { timeout_ms: timeoutMs },\n ] as const,\n (json) => [json.timeout_ms] as const,\n);\n\nconst AnalyticsQueryError = createKnownErrorConstructor(\n KnownError,\n \"ANALYTICS_QUERY_ERROR\",\n (error: string) => [\n 400,\n `${error}`,\n { error },\n ] as const,\n (json) => [json.error] as const,\n);\n\nconst AnalyticsNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"ANALYTICS_NOT_ENABLED\",\n () => [\n 400,\n \"Analytics is not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst DefaultPaymentMethodRequired = createKnownErrorConstructor(\n KnownError,\n \"DEFAULT_PAYMENT_METHOD_REQUIRED\",\n (customerType: \"user\" | \"team\", customerId: string) => [\n 400,\n \"No default payment method is set for this customer.\",\n {\n customer_type: customerType,\n customer_id: customerId,\n },\n ] as const,\n (json) => [json.customer_type, json.customer_id] as const,\n);\n\nconst NewPurchasesBlocked = createKnownErrorConstructor(\n KnownError,\n \"NEW_PURCHASES_BLOCKED\",\n () => [\n 403,\n \"New purchases are currently blocked for this project. Please contact support for more information.\",\n ] as const,\n () => [] as const,\n);\n\nexport type KnownErrors = {\n [K in keyof typeof KnownErrors]: InstanceType<typeof KnownErrors[K]>;\n};\n\nexport const KnownErrors = {\n CannotDeleteCurrentSession,\n UnsupportedError,\n BodyParsingError,\n SchemaError,\n AllOverloadsFailed,\n ProjectAuthenticationError,\n PermissionIdAlreadyExists,\n CliAuthError,\n CliAuthExpiredError,\n CliAuthUsedError,\n InvalidProjectAuthentication,\n ProjectKeyWithoutAccessType,\n InvalidAccessType,\n AccessTypeWithoutProjectId,\n AccessTypeRequired,\n CannotGetOwnUserWithoutUser,\n InsufficientAccessType,\n InvalidPublishableClientKey,\n InvalidSecretServerKey,\n InvalidSuperSecretAdminKey,\n InvalidAdminAccessToken,\n UnparsableAdminAccessToken,\n AdminAccessTokenExpired,\n InvalidProjectForAdminAccessToken,\n AdminAccessTokenIsNotAdmin,\n ProjectAuthenticationRequired,\n ClientAuthenticationRequired,\n PublishableClientKeyRequiredForProject,\n ServerAuthenticationRequired,\n ClientOrServerAuthenticationRequired,\n ClientOrAdminAuthenticationRequired,\n ClientOrServerOrAdminAuthenticationRequired,\n AdminAuthenticationRequired,\n ExpectedInternalProject,\n SessionAuthenticationError,\n InvalidSessionAuthentication,\n InvalidAccessToken,\n UnparsableAccessToken,\n AccessTokenExpired,\n InvalidProjectForAccessToken,\n RefreshTokenError,\n ProviderRejected,\n RefreshTokenNotFoundOrExpired,\n UserWithEmailAlreadyExists,\n EmailNotVerified,\n UserIdDoesNotExist,\n UserNotFound,\n RestrictedUserNotAllowed,\n ApiKeyNotFound,\n PublicApiKeyCannotBeRevoked,\n ProjectNotFound,\n CurrentProjectNotFound,\n BranchDoesNotExist,\n SignUpNotEnabled,\n SignUpRejected,\n BotChallengeRequired,\n BotChallengeFailed,\n PasswordAuthenticationNotEnabled,\n PasskeyAuthenticationNotEnabled,\n AnonymousAccountsNotEnabled,\n AnonymousAuthenticationNotAllowed,\n EmailPasswordMismatch,\n RedirectUrlNotWhitelisted,\n PasswordRequirementsNotMet,\n PasswordTooShort,\n PasswordTooLong,\n UserDoesNotHavePassword,\n VerificationCodeError,\n VerificationCodeNotFound,\n VerificationCodeExpired,\n VerificationCodeAlreadyUsed,\n VerificationCodeMaxAttemptsReached,\n PasswordConfirmationMismatch,\n EmailAlreadyVerified,\n EmailNotAssociatedWithUser,\n EmailIsNotPrimaryEmail,\n PasskeyRegistrationFailed,\n PasskeyWebAuthnError,\n PasskeyAuthenticationFailed,\n PermissionNotFound,\n PermissionScopeMismatch,\n ContainedPermissionNotFound,\n TeamNotFound,\n TeamMembershipNotFound,\n TeamInvitationRestrictedUserNotAllowed,\n TeamInvitationEmailMismatch,\n EmailTemplateAlreadyExists,\n OAuthConnectionNotConnectedToUser,\n OAuthConnectionAlreadyConnectedToAnotherUser,\n OAuthConnectionDoesNotHaveRequiredScope,\n OAuthAccessTokenNotAvailable,\n OAuthExtraScopeNotAvailableWithSharedOAuthKeys,\n OAuthAccessTokenNotAvailableWithSharedOAuthKeys,\n InvalidOAuthClientIdOrSecret,\n InvalidScope,\n UserAlreadyConnectedToAnotherOAuthConnection,\n OuterOAuthTimeout,\n OAuthProviderNotFoundOrNotEnabled,\n AppleBundleIdNotConfigured,\n OAuthProviderAccountIdAlreadyUsedForSignIn,\n MultiFactorAuthenticationRequired,\n InvalidTotpCode,\n UserAuthenticationRequired,\n TeamMembershipAlreadyExists,\n ProjectPermissionRequired,\n TeamPermissionRequired,\n InvalidSharedOAuthProviderId,\n InvalidStandardOAuthProviderId,\n InvalidAuthorizationCode,\n InvalidAppleCredentials,\n TeamPermissionNotFound,\n OAuthProviderAccessDenied,\n OAuthProviderTemporarilyUnavailable,\n ContactChannelAlreadyUsedForAuthBySomeoneElse,\n InvalidPollingCodeError,\n ApiKeyNotValid,\n ApiKeyExpired,\n ApiKeyRevoked,\n WrongApiKeyType,\n EmailRenderingError,\n TemplateSourceRewriteError,\n RequiresCustomEmailServer,\n EmailCapacityBoostAlreadyActive,\n EmailNotEditable,\n ItemNotFound,\n ItemCustomerTypeDoesNotMatch,\n CustomerDoesNotExist,\n ProductDoesNotExist,\n ProductCustomerTypeDoesNotMatch,\n ProductAlreadyGranted,\n SubscriptionInvoiceNotFound,\n OneTimePurchaseNotFound,\n SubscriptionAlreadyRefunded,\n OneTimePurchaseAlreadyRefunded,\n TestModePurchaseNonRefundable,\n ItemQuantityInsufficientAmount,\n StripeAccountInfoNotFound,\n DefaultPaymentMethodRequired,\n NewPurchasesBlocked,\n DataVaultStoreDoesNotExist,\n DataVaultStoreHashedKeyDoesNotExist,\n AnalyticsQueryTimeout,\n AnalyticsQueryError,\n AnalyticsNotEnabled,\n} satisfies Record<string, KnownErrorConstructor<any, any>>;\n\n\n// ensure that all known error codes are unique\nconst knownErrorCodes = new Set<string>();\nfor (const [_, KnownError] of Object.entries(KnownErrors)) {\n if (knownErrorCodes.has(KnownError.errorCode)) {\n throw new Error(`Duplicate known error code: ${KnownError.errorCode}`);\n }\n knownErrorCodes.add(KnownError.errorCode);\n}\n"],"mappings":";;;;;;;AAwBA,IAAsB,aAAtB,cAAyC,8BAAY;CAInD,YACE,AAAgB,YAChB,AAAgB,sBAChB,AAAgB,SAChB;AACA,QACE,YACA,qBACD;EAPe;EACA;EACA;gCANwB;cAC5B;;CAad,OAAc,aAAa,OAAqC;AAE9D,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,4BAA4B,SAAS,MAAM,2BAA2B;;CAG9H,AAAgB,UAAsB;AACpC,SAAO,IAAI,aAAa,CAAC,OAAO,KAAK,UAAU,KAAK,mBAAmB,EAAE,QAAW,EAAE,CAAC;;CAGzF,AAAgB,aAAuC;AACrD,SAAO;GACL,gBAAgB,CAAC,kCAAkC;GAEnD,uBAAuB,CAAC,KAAK,UAAU;GACvC,0BAA0B,CAAC,KAAK,UAAU;GAC3C;;CAGH,AAAgB,oBAA0B;AACxC,SAAO;GACL,MAAM,KAAK;GACX,GAAG,KAAK,UAAU,EAAE,SAAS,KAAK,SAAS,GAAG,EAAE;GAChD,OAAO,KAAK;GACb;;CAGH,IAAI,YAAoB;AACtB,SAAQ,KAAK,YAAoB,6CAAsB,0FAA0F,OAAO;;CAG1J,OAAc,wBAAwB,MAAgE;AACpG,SAAO;GACL;GACA,KAAK;GACL;GACD;;CAGH,OAAc,SAAS,MAAkC;AACvD,OAAK,MAAM,CAAC,GAAG,mBAAmB,OAAO,QAAQ,Y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UAAU,KAAK,WAAW,CAChD;AAED,MAAM,kCAAkC,4BACtC,YACA,4CACM,CACJ,KACA,0DACD,QACK,EAAE,CACT;AAED,MAAM,8BAA8B,4BAClC,YACA,wCACM,CACJ,KACA,uDACD,QACK,EAAE,CACT;AAED,MAAM,oCAAoC,4BACxC,YACA,8CACM,CACJ,KACA,sLACD,QACK,EAAE,CACT;AAGD,MAAM,wBAAwB,4BAC5B,YACA,iCACM,CACJ,KACA,4BACD,QACK,EAAE,CACT;AAED,MAAM,4BAA4B,4BAChC,YACA,iCACC,gBAAyB;CACxB;CACA;CACA,gBAAgB,SAAY,SAAY,EACtC,cAAc,aACf;CACF,GACA,SAAS,CAAE,MAAc,aAAa,CACxC;AAED,MAAM,6BAA6B,4BACjC,YACA,iCACA,WACA,UACD;AAED,MAAM,mBAAmB,4BACvB,4BACA,uBACC,cAAsB;CACrB;CACA,yCAAyC,UAAU;CACnD,EACE,YAAY,WACb;CACF,GACA,SAAS,CACP,MAAc,8CAAuB,mDAAmD,CAC1F,CACF;AAED,MAAM,kBAAkB,4BACtB,4BACA,sBACC,cAAsB;CACrB;CACA,wCAAwC,UAAU;CAClD,EACE,WACD;CACF,GACA,SAAS,CACP,MAAc,6CAAsB,iDAAiD,CACvF,CACF;AAED,MAAM,0BAA0B,4BAC9B,YACA,qCACM,CACJ,KACA,2DACD,QACK,EAAE,CACT;AAED,MAAM,wBAAwB,4BAC5B,YACA,sBACA,WACA,UACD;AAED,MAAM,2BAA2B,4BAC/B,uBACA,qCACM,CACJ,KACA,yDACD,QACK,EAAE,CACT;AAED,MAAM,0BAA0B,4BAC9B,uBACA,mCACM,CACJ,KACA,qCACD,QACK,EAAE,CACT;AAED,MAAM,8BAA8B,4BAClC,uBACA,wCACM,CACJ,KACA,+CACD,QACK,EAAE,CACT;AAED,MAAM,qCAAqC,4BACzC,uBACA,gDACM,CACJ,KACA,0GACD,QACK,EAAE,CACT;AAED,MAAM,+BAA+B,4BACnC,YACA,wCACM,CACJ,KACA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;AAED,MAAM,+BAA+B,4BACnC,YACA,sCACC,aAAsB;CACrB;CACA;CACA,EACE,WAAW,YAAY,MACxB;CACF,GACA,SAAc,CAAC,KAAK,aAAa,OAAU,CAC7C;AAED,MAAM,eAAe,4BACnB,YACA,kBACC,UAAkB,CACjB,KACA,cAAc,MAAM,yCACrB,GACA,SAAc,CAAC,KAAK,MAAM,CAC5B;AAED,MAAM,+CAA+C,4BACnD,YACA,4DACM,CACJ,KACA,oGACD,QACK,EAAE,CACT;AAED,MAAM,oBAAoB,4BACxB,YACA,6BACM,CACJ,KACA,sDACD,QACK,EAAE,CACT;AAED,MAAM,oCAAoC,4BACxC,YACA,iDACM,CACJ,KACA,kDACD,QACK,EAAE,CACT;AAED,MAAM,6BAA6B,4BACjC,YACA,wCACM,CACJ,KACA,0KACD,QACK,EAAE,CACT;AAED,MAAM,6CAA6C,4BACjD,YACA,4DACM,CACJ,KACA,sEACD,QACK,EAAE,CACT;AAED,MAAM,oCAAoC,4BACxC,YACA,yCACC,gBAAwB;CACvB;CACA;CACA,EACE,cAAc,aACf;CACF,GACA,SAAS,CAAC,KAAK,aAAa,CAC9B;AAED,MAAM,kBAAkB,4BACtB,YACA,2BACM,CACJ,KACA,8CACD,QACK,EAAE,CACT;AAED,MAAM,6BAA6B,4BACjC,YACA,sCACM,CACJ,KACA,kDACD,QACK,EAAE,CACT;AAED,MAAM,8BAA8B,4BAClC,YACA,wCACM,CACJ,KACA,kCACD,QACK,EAAE,CACT;AAED,MAAM,4BAA4B,4BAChC,YACA,gCACC,QAAQ,iBAAiB;CACxB;CACA,QAAQ,OAAO,4BAA4B,aAAa;CACxD;EACE,SAAS;EACT,eAAe;EAChB;CACF,GACA,SAAS,CAAC,KAAK,SAAS,KAAK,cAAc,CAC7C;AAED,MAAM,yBAAyB,4BAC7B,YACA,6BACC,QAAQ,QAAQ,iBAAiB;CAChC;CACA,QAAQ,OAAO,4BAA4B,aAAa,WAAW,OAAO;CAC1E;EACE,SAAS;EACT,SAA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KAAK,YAAY,KAAK,YAAY,CAC9C;AAED,MAAM,iCAAiC,4BACrC,YACA,sCACC,QAAgB,YAAoB,aAAqB;CACxD;CACA,oBAAoB,KAAK,UAAU,OAAO,CAAC,yDAAyD,KAAK,UAAU,WAAW,CAAC,kCAAkC,SAAS;CAC1K;EACE,SAAS;EACT,aAAa;EACb;EACD;CACF,GACA,SAAS;CAAC,KAAK;CAAS,KAAK;CAAa,KAAK;CAAS,CAC1D;AAED,MAAM,4BAA4B,4BAChC,YACA,uCACM,CACJ,KACA,6FACD,QACK,EAAE,CACT;AAED,MAAM,wBAAwB,4BAC5B,YACA,4BACC,cAAsB;CACrB;CACA,mGAAmG,UAAU;CAC7G,EAAE,YAAY,WAAW;CAC1B,GACA,SAAS,CAAC,KAAK,WAAW,CAC5B;AAED,MAAM,sBAAsB,4BAC1B,YACA,0BACC,UAAkB;CACjB;CACA,GAAG;CACH,EAAE,OAAO;CACV,GACA,SAAS,CAAC,KAAK,MAAM,CACvB;AAED,MAAM,sBAAsB,4BAC1B,YACA,+BACM,CACJ,KACA,6CACD,QACK,EAAE,CACT;AAED,MAAM,+BAA+B,4BACnC,YACA,oCACC,cAA+B,eAAuB;CACrD;CACA;CACA;EACE,eAAe;EACf,aAAa;EACd;CACF,GACA,SAAS,CAAC,KAAK,eAAe,KAAK,YAAY,CACjD;AAED,MAAM,sBAAsB,4BAC1B,YACA,+BACM,CACJ,KACA,qGACD,QACK,EAAE,CACT;AAMD,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;MAIK,kCAAkB,IAAI,KAAa;AACzC,KAAK,MAAM,CAAC,GAAG,eAAe,OAAO,QAAQ,YAAY,EAAE;AACzD,KAAI,gBAAgB,IAAI,WAAW,UAAU,CAC3C,OAAM,IAAI,MAAM,+BAA+B,WAAW,YAAY;AAExE,iBAAgB,IAAI,WAAW,UAAU"}
1
+ {"version":3,"file":"known-errors.js","names":["StatusError","identityArgs","HexclaveAssertionError"],"sources":["../src/known-errors.tsx"],"sourcesContent":["import { HexclaveAssertionError, StatusError, throwErr } from \"./utils/errors\";\nimport { identityArgs } from \"./utils/functions\";\nimport { Json } from \"./utils/json\";\nimport { deindent } from \"./utils/strings\";\n\nexport type KnownErrorJson = {\n code: string,\n message: string,\n details?: Json,\n};\n\nexport type AbstractKnownErrorConstructor<Args extends any[]> =\n & (abstract new (...args: Args) => KnownError)\n & {\n constructorArgsFromJson: (json: KnownErrorJson) => Args,\n };\n\nexport type KnownErrorConstructor<SuperInstance extends KnownError, Args extends any[]> = {\n new(...args: Args): SuperInstance & { constructorArgs: Args },\n errorCode: string,\n constructorArgsFromJson: (json: KnownErrorJson) => Args,\n isInstance: (error: unknown) => error is SuperInstance & { constructorArgs: Args },\n};\n\nexport abstract class KnownError extends StatusError {\n private readonly __stackKnownErrorBrand = \"stack-known-error-brand-sentinel\" as const;\n public name = \"KnownError\";\n\n constructor(\n public readonly statusCode: number,\n public readonly humanReadableMessage: string,\n public readonly details?: Json,\n ) {\n super(\n statusCode,\n humanReadableMessage\n );\n }\n\n public static isKnownError(error: unknown): error is KnownError {\n // like instanceof, but also works for errors thrown in other realms or by different versions of the same package\n return typeof error === \"object\" && error !== null && \"__stackKnownErrorBrand\" in error && error.__stackKnownErrorBrand === \"stack-known-error-brand-sentinel\";\n }\n\n public override getBody(): Uint8Array {\n return new TextEncoder().encode(JSON.stringify(this.toDescriptiveJson(), undefined, 2));\n }\n\n public override getHeaders(): Record<string, string[]> {\n return {\n \"Content-Type\": [\"application/json; charset=utf-8\"],\n // Hexclave rebrand: dual-emit both X-Hexclave-* and X-Stack-* so old and new SDKs can both read it.\n \"X-Stack-Known-Error\": [this.errorCode],\n \"X-Hexclave-Known-Error\": [this.errorCode],\n };\n }\n\n public override toDescriptiveJson(): Json {\n return {\n code: this.errorCode,\n ...this.details ? { details: this.details } : {},\n error: this.humanReadableMessage,\n };\n }\n\n get errorCode(): string {\n return (this.constructor as any).errorCode ?? throwErr(`Can't find error code for this KnownError. Is its constructor a KnownErrorConstructor? ${this}`);\n }\n\n public static constructorArgsFromJson(json: KnownErrorJson): ConstructorParameters<typeof KnownError> {\n return [\n 400,\n json.message,\n json,\n ];\n }\n\n public static fromJson(json: KnownErrorJson): KnownError {\n for (const [_, KnownErrorType] of Object.entries(KnownErrors)) {\n if (json.code === KnownErrorType.prototype.errorCode) {\n const constructorArgs = KnownErrorType.constructorArgsFromJson(json);\n return new KnownErrorType(\n // @ts-ignore-next-line\n ...constructorArgs,\n );\n }\n }\n\n throw new Error(`An error occurred. Please update your version of the Hexclave SDK. ${json.code}: ${json.message}`);\n }\n}\n\nconst knownErrorConstructorErrorCodeSentinel = Symbol(\"knownErrorConstructorErrorCodeSentinel\");\n/**\n * Exists solely so that known errors are nominative types (ie. two KnownErrors with the same interface are not the same type)\n */\ntype KnownErrorBrand<ErrorCode extends string> = {\n /**\n * Does not exist at runtime\n *\n * Must be an object because it may be true for multiple error codes (it's true for all parents)\n */\n [knownErrorConstructorErrorCodeSentinel]: {\n [K in ErrorCode]: true\n },\n};\n\nfunction createKnownErrorConstructor<ErrorCode extends string, Super extends AbstractKnownErrorConstructor<any>, Args extends any[]>(\n SuperClass: Super,\n errorCode: ErrorCode,\n create: ((...args: Args) => Readonly<ConstructorParameters<Super>>),\n constructorArgsFromJson: ((jsonDetails: any) => NoInfer<Args>),\n): KnownErrorConstructor<InstanceType<Super> & KnownErrorBrand<ErrorCode>, Args> & { errorCode: ErrorCode };\nfunction createKnownErrorConstructor<ErrorCode extends string, Super extends AbstractKnownErrorConstructor<any>>(\n SuperClass: Super,\n errorCode: ErrorCode,\n create: \"inherit\",\n constructorArgsFromJson: \"inherit\",\n): KnownErrorConstructor<InstanceType<Super> & KnownErrorBrand<ErrorCode>, ConstructorParameters<Super>> & { errorCode: ErrorCode };\nfunction createKnownErrorConstructor<ErrorCode extends string, Super extends AbstractKnownErrorConstructor<any>, Args extends any[]>(\n SuperClass: Super,\n errorCode: ErrorCode,\n create: \"inherit\" | ((...args: Args) => Readonly<ConstructorParameters<Super>>),\n constructorArgsFromJson: \"inherit\" | ((jsonDetails: any) => NoInfer<Args>),\n): KnownErrorConstructor<InstanceType<Super> & KnownErrorBrand<ErrorCode>, Args> & { errorCode: ErrorCode } {\n const createFn = create === \"inherit\" ? identityArgs<Args> as never : create;\n const constructorArgsFromJsonFn = constructorArgsFromJson === \"inherit\" ? SuperClass.constructorArgsFromJson as never : constructorArgsFromJson;\n\n // @ts-expect-error this is not a mixin, but TS detects it as one\n class KnownErrorImpl extends SuperClass {\n public static readonly errorCode = errorCode;\n public name = `KnownError<${errorCode}>`;\n public readonly constructorArgs: Args;\n\n constructor(...args: Args) {\n // @ts-ignore legendary comment, may never be removed https://x.com/konstiwohlwend/status/1998543556567617780\n super(...createFn(...args));\n this.constructorArgs = args;\n }\n\n static constructorArgsFromJson(json: KnownErrorJson): Args {\n return constructorArgsFromJsonFn(json.details);\n }\n\n static isInstance(error: unknown): error is InstanceType<Super> & { constructorArgs: Args } {\n if (!KnownError.isKnownError(error)) return false;\n let current: unknown = error;\n while (true) {\n current = Object.getPrototypeOf(current);\n if (!current) break;\n if (\"errorCode\" in current.constructor && current.constructor.errorCode === errorCode) return true;\n }\n return false;\n }\n };\n\n // @ts-expect-error\n return KnownErrorImpl;\n}\nimport.meta.vitest?.test(\"KnownError.isInstance\", ({ expect }) => {\n expect(KnownErrors.InvalidProjectAuthentication.isInstance(undefined)).toBe(false);\n expect(KnownErrors.InvalidProjectAuthentication.isInstance(new Error())).toBe(false);\n\n const error = new KnownErrors.ProjectKeyWithoutAccessType();\n expect(KnownErrors.ProjectKeyWithoutAccessType.isInstance(error)).toBe(true);\n expect(KnownErrors.InvalidProjectAuthentication.isInstance(error)).toBe(true);\n expect(KnownErrors.InvalidAccessType.isInstance(error)).toBe(false);\n});\n\nconst UnsupportedError = createKnownErrorConstructor(\n KnownError,\n \"UNSUPPORTED_ERROR\",\n (originalErrorCode: string) => [\n 500,\n `An error occurred that is not currently supported (possibly because it was added in a version of Stack that is newer than this client). The original unsupported error code was: ${originalErrorCode}`,\n {\n originalErrorCode,\n },\n ] as const,\n (json) => [\n (json as any)?.originalErrorCode ?? throwErr(\"originalErrorCode not found in UnsupportedError details\"),\n ] as const,\n);\n\nconst BodyParsingError = createKnownErrorConstructor(\n KnownError,\n \"BODY_PARSING_ERROR\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json) => [json.message] as const,\n);\n\nconst SchemaError = createKnownErrorConstructor(\n KnownError,\n \"SCHEMA_ERROR\",\n (message: string) => [\n 400,\n message || throwErr(\"SchemaError requires a message\"),\n {\n message,\n },\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst AllOverloadsFailed = createKnownErrorConstructor(\n KnownError,\n \"ALL_OVERLOADS_FAILED\",\n (overloadErrors: Json[]) => [\n 400,\n deindent`\n This endpoint has multiple overloads, but they all failed to process the request.\n\n ${overloadErrors.map((e, i) => deindent`\n Overload ${i + 1}: ${JSON.stringify(e, undefined, 2)}\n `).join(\"\\n\\n\")}\n `,\n {\n overload_errors: overloadErrors,\n },\n ] as const,\n (json) => [\n (json as any)?.overload_errors ?? throwErr(\"overload_errors not found in AllOverloadsFailed details\"),\n ] as const,\n);\n\nconst ProjectAuthenticationError = createKnownErrorConstructor(\n KnownError,\n \"PROJECT_AUTHENTICATION_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst InvalidProjectAuthentication = createKnownErrorConstructor(\n ProjectAuthenticationError,\n \"INVALID_PROJECT_AUTHENTICATION\",\n \"inherit\",\n \"inherit\",\n);\n\nconst ProjectKeyWithoutAccessType = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"PROJECT_KEY_WITHOUT_ACCESS_TYPE\",\n () => [\n 400,\n \"Either an API key or an admin access token was provided, but the x-hexclave-access-type header is missing. Set it to 'client', 'server', or 'admin' as appropriate. (The legacy x-stack-access-type header is also accepted.)\",\n ] as const,\n () => [] as const,\n);\n\nconst InvalidAccessType = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_ACCESS_TYPE\",\n (accessType: string) => [\n 400,\n `The x-hexclave-access-type header must be 'client', 'server', or 'admin', but was '${accessType}'. (The legacy x-stack-access-type header is also accepted.)`,\n ] as const,\n (json) => [\n (json as any)?.accessType ?? throwErr(\"accessType not found in InvalidAccessType details\"),\n ] as const,\n);\n\nconst AccessTypeWithoutProjectId = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"ACCESS_TYPE_WITHOUT_PROJECT_ID\",\n (accessType: \"client\" | \"server\" | \"admin\") => [\n 400,\n deindent`\n The x-hexclave-access-type header was '${accessType}', but the x-hexclave-project-id header was not provided. (The legacy x-stack-access-type and x-stack-project-id headers are also accepted.)\n \n For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication\n `,\n {\n request_type: accessType,\n },\n ] as const,\n (json: any) => [json.request_type] as const,\n);\n\nconst AccessTypeRequired = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"ACCESS_TYPE_REQUIRED\",\n () => [\n 400,\n deindent`\n You must specify an access level for this Hexclave project. Make sure project API keys are provided (eg. x-hexclave-publishable-client-key) and you set the x-hexclave-access-type header to 'client', 'server', or 'admin'. (The legacy x-stack-* equivalents are also accepted.)\n \n For more information, see the docs on REST API authentication: https://docs.hexclave.com/api/overview#authentication\n `,\n ] as const,\n () => [] as const,\n);\n\nconst InsufficientAccessType = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INSUFFICIENT_ACCESS_TYPE\",\n (actualAccessType: \"client\" | \"server\" | \"admin\", allowedAccessTypes: (\"client\" | \"server\" | \"admin\")[]) => [\n 401,\n `The x-hexclave-access-type header must be ${allowedAccessTypes.map(s => `'${s}'`).join(\" or \")}, but was '${actualAccessType}'. (The legacy x-stack-access-type header is also accepted.)`,\n {\n actual_access_type: actualAccessType,\n allowed_access_types: allowedAccessTypes,\n },\n ] as const,\n (json: any) => [\n json.actual_access_type,\n json.allowed_access_types,\n ] as const,\n);\n\nconst InvalidPublishableClientKey = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_PUBLISHABLE_CLIENT_KEY\",\n (projectId: string) => [\n 401,\n `The publishable key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst InvalidSecretServerKey = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_SECRET_SERVER_KEY\",\n (projectId: string) => [\n 401,\n `The secret server key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst InvalidSuperSecretAdminKey = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_SUPER_SECRET_ADMIN_KEY\",\n (projectId: string) => [\n 401,\n `The super secret admin key is not valid for the project ${JSON.stringify(projectId)}. Does the project and/or the key exist?`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst InvalidAdminAccessToken = createKnownErrorConstructor(\n InvalidProjectAuthentication,\n \"INVALID_ADMIN_ACCESS_TOKEN\",\n \"inherit\",\n \"inherit\",\n);\n\nconst UnparsableAdminAccessToken = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"UNPARSABLE_ADMIN_ACCESS_TOKEN\",\n () => [\n 401,\n \"Admin access token is not parsable.\",\n ] as const,\n () => [] as const,\n);\n\nconst AdminAccessTokenExpired = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"ADMIN_ACCESS_TOKEN_EXPIRED\",\n (expiredAt: Date | undefined) => [\n 401,\n `Admin access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : \"\"}`,\n { expired_at_millis: expiredAt?.getTime() ?? null },\n ] as const,\n (json: any) => [json.expired_at_millis ? new Date(json.expired_at_millis) : undefined] as const,\n);\n\nconst InvalidProjectForAdminAccessToken = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"INVALID_PROJECT_FOR_ADMIN_ACCESS_TOKEN\",\n () => [\n 401,\n \"Admin access tokens must be created on the internal project.\",\n ] as const,\n () => [] as const,\n);\n\nconst AdminAccessTokenIsNotAdmin = createKnownErrorConstructor(\n InvalidAdminAccessToken,\n \"ADMIN_ACCESS_TOKEN_IS_NOT_ADMIN\",\n () => [\n 401,\n \"Admin access token does not have the required permissions to access this project.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ProjectAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationError,\n \"PROJECT_AUTHENTICATION_REQUIRED\",\n \"inherit\",\n \"inherit\",\n);\n\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"The publishable client key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\nconst PublishableClientKeyRequiredForProject = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"PUBLISHABLE_CLIENT_KEY_REQUIRED_FOR_PROJECT\",\n (projectId?: string) => [\n 401,\n \"Publishable client keys are required for this project. Create one in Project Keys, or disable this requirement there to allow keyless client access.\",\n {\n project_id: projectId ?? null,\n },\n ] as const,\n (json: any) => [json.project_id ?? undefined] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ServerAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"SERVER_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"The secret server key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientOrServerAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_OR_SERVER_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"Either the publishable client key or the secret server key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientOrAdminAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_OR_ADMIN_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"Either the publishable client key or the super secret admin key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst ClientOrServerOrAdminAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"CLIENT_OR_SERVER_OR_ADMIN_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"Either the publishable client key, the secret server key, or the super secret admin key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\n/**\n * @deprecated Use InsufficientAccessType instead\n */\nconst AdminAuthenticationRequired = createKnownErrorConstructor(\n ProjectAuthenticationRequired,\n \"ADMIN_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"The super secret admin key must be provided.\",\n ] as const,\n () => [] as const,\n);\n\nconst ExpectedInternalProject = createKnownErrorConstructor(\n ProjectAuthenticationError,\n \"EXPECTED_INTERNAL_PROJECT\",\n () => [\n 401,\n \"The project ID is expected to be internal.\",\n ] as const,\n () => [] as const,\n);\n\nconst SessionAuthenticationError = createKnownErrorConstructor(\n KnownError,\n \"SESSION_AUTHENTICATION_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst InvalidSessionAuthentication = createKnownErrorConstructor(\n SessionAuthenticationError,\n \"INVALID_SESSION_AUTHENTICATION\",\n \"inherit\",\n \"inherit\",\n);\n\nconst InvalidAccessToken = createKnownErrorConstructor(\n InvalidSessionAuthentication,\n \"INVALID_ACCESS_TOKEN\",\n \"inherit\",\n \"inherit\",\n);\n\nconst UnparsableAccessToken = createKnownErrorConstructor(\n InvalidAccessToken,\n \"UNPARSABLE_ACCESS_TOKEN\",\n () => [\n 401,\n \"Access token is not parsable.\",\n ] as const,\n () => [] as const,\n);\n\nconst AccessTokenExpired = createKnownErrorConstructor(\n InvalidAccessToken,\n \"ACCESS_TOKEN_EXPIRED\",\n (expiredAt: Date | undefined, projectId: string | undefined, userId: string | undefined, refreshTokenId: string | undefined) => [\n 401,\n deindent`\n Access token has expired. Please refresh it and try again.${expiredAt ? ` (The access token expired at ${expiredAt.toISOString()}.)` : \"\"}${projectId ? ` Project ID: ${projectId}.` : \"\"}${userId ? ` User ID: ${userId}.` : \"\"}${refreshTokenId ? ` Refresh token ID: ${refreshTokenId}.` : \"\"}\n\n Debug info: Most likely, you fetched the access token before it expired (for example, in a server component, pre-rendered page, or on page load), but then didn't refresh it before it expired. If this is the case, and you're using the SDK, make sure you call getAccessToken() every time you need to use the access token. If you're not using the SDK, make sure you refresh the access token with the refresh endpoint.\n `,\n {\n expired_at_millis: expiredAt?.getTime() ?? null,\n project_id: projectId ?? null,\n user_id: userId ?? null,\n refresh_token_id: refreshTokenId ?? null,\n },\n ] as const,\n (json: any) => [\n json.expired_at_millis ? new Date(json.expired_at_millis) : undefined,\n json.project_id ?? undefined,\n json.user_id ?? undefined,\n json.refresh_token_id ?? undefined,\n ] as const,\n);\n\nconst InvalidProjectForAccessToken = createKnownErrorConstructor(\n InvalidAccessToken,\n \"INVALID_PROJECT_FOR_ACCESS_TOKEN\",\n (expectedProjectId: string, actualProjectId: string) => [\n 401,\n `Access token not valid for this project. Expected project ID ${JSON.stringify(expectedProjectId)}, but the token is for project ID ${JSON.stringify(actualProjectId)}.`,\n {\n expected_project_id: expectedProjectId,\n actual_project_id: actualProjectId,\n },\n ] as const,\n (json: any) => [json.expected_project_id, json.actual_project_id] as const,\n);\n\n\nconst RefreshTokenError = createKnownErrorConstructor(\n KnownError,\n \"REFRESH_TOKEN_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst RefreshTokenNotFoundOrExpired = createKnownErrorConstructor(\n RefreshTokenError,\n \"REFRESH_TOKEN_NOT_FOUND_OR_EXPIRED\",\n () => [\n 401,\n \"Refresh token not found for this project, or the session has expired/been revoked.\",\n ] as const,\n () => [] as const,\n);\n\nconst CannotDeleteCurrentSession = createKnownErrorConstructor(\n RefreshTokenError,\n \"CANNOT_DELETE_CURRENT_SESSION\",\n () => [\n 400,\n \"Cannot delete the current session.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst ProviderRejected = createKnownErrorConstructor(\n RefreshTokenError,\n \"PROVIDER_REJECTED\",\n () => [\n 401,\n \"The provider refused to refresh their token. This usually means that the provider used to authenticate the user no longer regards this session as valid, and the user must re-authenticate.\",\n ] as const,\n () => [] as const,\n);\n\nconst UserWithEmailAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"USER_EMAIL_ALREADY_EXISTS\",\n (email: string, wouldWorkIfEmailWasVerified: boolean = false) => [\n 409,\n `A user with email ${JSON.stringify(email)} already exists${wouldWorkIfEmailWasVerified ? \" but the email is not verified. Please login to your existing account with the method you used to sign up, and then verify your email to sign in with this login method.\" : \".\"}`,\n {\n email,\n would_work_if_email_was_verified: wouldWorkIfEmailWasVerified,\n },\n ] as const,\n (json: any) => [json.email, json.would_work_if_email_was_verified ?? false] as const,\n);\n\nconst EmailNotVerified = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_NOT_VERIFIED\",\n () => [\n 400,\n \"The email is not verified.\",\n ] as const,\n () => [] as const,\n);\n\nconst CannotGetOwnUserWithoutUser = createKnownErrorConstructor(\n KnownError,\n \"CANNOT_GET_OWN_USER_WITHOUT_USER\",\n () => [\n 400,\n \"You have specified 'me' as a userId, but did not provide authentication for a user.\",\n ] as const,\n () => [] as const,\n);\n\nconst UserIdDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"USER_ID_DOES_NOT_EXIST\",\n (userId: string) => [\n 400,\n `The given user with the ID ${userId} does not exist.`,\n {\n user_id: userId,\n },\n ] as const,\n (json: any) => [json.user_id] as const,\n);\n\nconst UserNotFound = createKnownErrorConstructor(\n KnownError,\n \"USER_NOT_FOUND\",\n () => [\n 404,\n \"User not found.\",\n ] as const,\n () => [] as const,\n);\n\nconst RestrictedUserNotAllowed = createKnownErrorConstructor(\n KnownError,\n \"RESTRICTED_USER_NOT_ALLOWED\",\n (restrictedReason: { type: \"anonymous\" | \"email_not_verified\" | \"restricted_by_administrator\" }) => [\n 403,\n `The user in the access token is in restricted state. Reason: ${restrictedReason.type}. Please pass the X-Stack-Allow-Restricted-User header if this is intended.`,\n {\n restricted_reason: restrictedReason,\n },\n ] as const,\n (json: any) => [json.restricted_reason ?? { type: \"anonymous\" }] as const,\n);\n\nconst ProjectNotFound = createKnownErrorConstructor(\n KnownError,\n \"PROJECT_NOT_FOUND\",\n (projectId: string) => {\n if (typeof projectId !== \"string\") throw new HexclaveAssertionError(\"projectId of KnownErrors.ProjectNotFound must be a string\");\n return [\n 404,\n `Project ${projectId} not found or is not accessible with the current user.`,\n {\n project_id: projectId,\n },\n ] as const;\n },\n (json: any) => [json.project_id] as const,\n);\n\nconst CurrentProjectNotFound = createKnownErrorConstructor(\n KnownError,\n \"CURRENT_PROJECT_NOT_FOUND\",\n (projectId: string) => [\n 400,\n `The current project with ID ${projectId} was not found. Please check the value of the x-hexclave-project-id header. (The legacy x-stack-project-id header is also accepted.)`,\n {\n project_id: projectId,\n },\n ] as const,\n (json: any) => [json.project_id] as const,\n);\n\nconst BranchDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"BRANCH_DOES_NOT_EXIST\",\n (branchId: string) => [\n 400,\n `The branch with ID ${branchId} does not exist.`,\n {\n branch_id: branchId,\n },\n ] as const,\n (json: any) => [json.branch_id] as const,\n);\n\n\nconst SignUpNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"SIGN_UP_NOT_ENABLED\",\n () => [\n 400,\n \"Creation of new accounts is not enabled for this project. Please ask the project owner to enable it.\",\n ] as const,\n () => [] as const,\n);\n\nconst SignUpRejected = createKnownErrorConstructor(\n KnownError,\n \"SIGN_UP_REJECTED\",\n (message?: string) => [\n 403,\n message ?? \"Your sign up was rejected by an administrator's sign-up rule.\",\n {\n message: message ?? \"Your sign up was rejected by an administrator's sign-up rule.\",\n },\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst BotChallengeRequired = createKnownErrorConstructor(\n KnownError,\n \"BOT_CHALLENGE_REQUIRED\",\n () => [\n 409,\n \"An additional bot challenge is required before sign-up can continue.\",\n ] as const,\n () => [] as const,\n);\n\nconst BotChallengeFailed = createKnownErrorConstructor(\n KnownError,\n \"BOT_CHALLENGE_FAILED\",\n (message: string) => [\n 400,\n message,\n {\n message,\n },\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst PasswordAuthenticationNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"PASSWORD_AUTHENTICATION_NOT_ENABLED\",\n () => [\n 400,\n \"Password authentication is not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst DataVaultStoreDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"DATA_VAULT_STORE_DOES_NOT_EXIST\",\n (storeId: string) => [\n 400,\n `Data vault store with ID ${storeId} does not exist.`,\n {\n store_id: storeId,\n },\n ] as const,\n (json: any) => [json.store_id] as const,\n);\n\nconst DataVaultStoreHashedKeyDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"DATA_VAULT_STORE_HASHED_KEY_DOES_NOT_EXIST\",\n (storeId: string, hashedKey: string) => [\n 400,\n `Data vault store with ID ${storeId} does not contain a key with hash ${hashedKey}.`,\n {\n store_id: storeId,\n hashed_key: hashedKey,\n },\n ] as const,\n (json: any) => [json.store_id, json.hashed_key] as const,\n);\n\nconst PasskeyAuthenticationNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_AUTHENTICATION_NOT_ENABLED\",\n () => [\n 400,\n \"Passkey authentication is not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst AnonymousAccountsNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"ANONYMOUS_ACCOUNTS_NOT_ENABLED\",\n () => [\n 400,\n \"Anonymous accounts are not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst AnonymousAuthenticationNotAllowed = createKnownErrorConstructor(\n KnownError,\n \"ANONYMOUS_AUTHENTICATION_NOT_ALLOWED\",\n () => [\n 401,\n \"X-Stack-Access-Token is for an anonymous user, but anonymous users are not enabled. Set the X-Stack-Allow-Anonymous-User header of this request to 'true' to allow anonymous users.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst EmailPasswordMismatch = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_PASSWORD_MISMATCH\",\n () => [\n 400,\n \"Wrong e-mail or password.\",\n ] as const,\n () => [] as const,\n);\n\nconst RedirectUrlNotWhitelisted = createKnownErrorConstructor(\n KnownError,\n \"REDIRECT_URL_NOT_WHITELISTED\",\n (redirectUrl?: string) => [\n 400,\n \"Redirect URL not whitelisted. Did you forget to add this domain to the trusted domains list on the Hexclave dashboard?\",\n redirectUrl === undefined ? undefined : {\n redirect_url: redirectUrl,\n },\n ] as const,\n (json) => [(json as any)?.redirect_url] as const,\n);\n\nconst PasswordRequirementsNotMet = createKnownErrorConstructor(\n KnownError,\n \"PASSWORD_REQUIREMENTS_NOT_MET\",\n \"inherit\",\n \"inherit\",\n);\n\nconst PasswordTooShort = createKnownErrorConstructor(\n PasswordRequirementsNotMet,\n \"PASSWORD_TOO_SHORT\",\n (minLength: number) => [\n 400,\n `Password too short. Minimum length is ${minLength}.`,\n {\n min_length: minLength,\n },\n ] as const,\n (json) => [\n (json as any)?.min_length ?? throwErr(\"min_length not found in PasswordTooShort details\"),\n ] as const,\n);\n\nconst PasswordTooLong = createKnownErrorConstructor(\n PasswordRequirementsNotMet,\n \"PASSWORD_TOO_LONG\",\n (maxLength: number) => [\n 400,\n `Password too long. Maximum length is ${maxLength}.`,\n {\n maxLength,\n },\n ] as const,\n (json) => [\n (json as any)?.maxLength ?? throwErr(\"maxLength not found in PasswordTooLong details\"),\n ] as const,\n);\n\nconst UserDoesNotHavePassword = createKnownErrorConstructor(\n KnownError,\n \"USER_DOES_NOT_HAVE_PASSWORD\",\n () => [\n 400,\n \"This user does not have password authentication enabled.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeError = createKnownErrorConstructor(\n KnownError,\n \"VERIFICATION_ERROR\",\n \"inherit\",\n \"inherit\",\n);\n\nconst VerificationCodeNotFound = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_NOT_FOUND\",\n () => [\n 404,\n \"The verification code does not exist for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeExpired = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_EXPIRED\",\n () => [\n 400,\n \"The verification code has expired.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeAlreadyUsed = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_ALREADY_USED\",\n () => [\n 409,\n \"The verification link has already been used.\",\n ] as const,\n () => [] as const,\n);\n\nconst VerificationCodeMaxAttemptsReached = createKnownErrorConstructor(\n VerificationCodeError,\n \"VERIFICATION_CODE_MAX_ATTEMPTS_REACHED\",\n () => [\n 400,\n \"The verification code nonce has reached the maximum number of attempts. This code is not valid anymore.\",\n ] as const,\n () => [] as const,\n);\n\nconst PasswordConfirmationMismatch = createKnownErrorConstructor(\n KnownError,\n \"PASSWORD_CONFIRMATION_MISMATCH\",\n () => [\n 400,\n \"Passwords do not match.\",\n ] as const,\n () => [] as const,\n);\n\nconst EmailAlreadyVerified = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_ALREADY_VERIFIED\",\n () => [\n 409,\n \"The e-mail is already verified.\",\n ] as const,\n () => [] as const,\n);\n\nconst EmailNotAssociatedWithUser = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_NOT_ASSOCIATED_WITH_USER\",\n () => [\n 400,\n \"The e-mail is not associated with a user that could log in with that e-mail.\",\n ] as const,\n () => [] as const,\n);\n\nconst EmailIsNotPrimaryEmail = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_IS_NOT_PRIMARY_EMAIL\",\n (email: string, primaryEmail: string | null) => [\n 400,\n `The given e-mail (${email}) must equal the user's primary e-mail (${primaryEmail}).`,\n {\n email,\n primary_email: primaryEmail,\n },\n ] as const,\n (json: any) => [json.email, json.primary_email] as const,\n);\n\n\nconst PasskeyRegistrationFailed = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_REGISTRATION_FAILED\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\n\nconst PasskeyWebAuthnError = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_WEBAUTHN_ERROR\",\n (message: string, code: string) => [\n 400,\n message,\n {\n message,\n code,\n },\n ] as const,\n (json: any) => [json.message, json.code] as const,\n);\n\nconst PasskeyAuthenticationFailed = createKnownErrorConstructor(\n KnownError,\n \"PASSKEY_AUTHENTICATION_FAILED\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\n\nconst PermissionNotFound = createKnownErrorConstructor(\n KnownError,\n \"PERMISSION_NOT_FOUND\",\n (permissionId: string) => [\n 404,\n `Permission \"${permissionId}\" not found. Make sure you created it on the dashboard.`,\n {\n permission_id: permissionId,\n },\n ] as const,\n (json: any) => [json.permission_id] as const,\n);\n\nconst PermissionScopeMismatch = createKnownErrorConstructor(\n KnownError,\n \"WRONG_PERMISSION_SCOPE\",\n (permissionId: string, expectedScope: \"team\" | \"project\", actualScope: \"team\" | \"project\" | null) => [\n 404,\n `Permission ${JSON.stringify(permissionId)} not found. (It was found for a different scope ${JSON.stringify(actualScope)}, but scope ${JSON.stringify(expectedScope)} was expected.)`,\n {\n permission_id: permissionId,\n expected_scope: expectedScope,\n actual_scope: actualScope,\n },\n ] as const,\n (json: any) => [json.permission_id, json.expected_scope, json.actual_scope] as const,\n);\n\nconst ContainedPermissionNotFound = createKnownErrorConstructor(\n KnownError,\n \"CONTAINED_PERMISSION_NOT_FOUND\",\n (permissionId: string) => [\n 400,\n `Contained permission with ID \"${permissionId}\" not found. Make sure you created it on the dashboard.`,\n {\n permission_id: permissionId,\n },\n ] as const,\n (json: any) => [json.permission_id] as const,\n);\n\nconst TeamNotFound = createKnownErrorConstructor(\n KnownError,\n \"TEAM_NOT_FOUND\",\n (teamId: string) => [\n 404,\n `Team ${teamId} not found.`,\n {\n team_id: teamId,\n },\n ] as const,\n (json: any) => [json.team_id] as const,\n);\n\nconst TeamAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"TEAM_ALREADY_EXISTS\",\n (teamId: string) => [\n 409,\n `Team ${teamId} already exists.`,\n {\n team_id: teamId,\n },\n ] as const,\n (json: any) => [json.team_id] as const,\n);\n\nconst TeamMembershipNotFound = createKnownErrorConstructor(\n KnownError,\n \"TEAM_MEMBERSHIP_NOT_FOUND\",\n (teamId: string, userId: string) => [\n 404,\n `User ${userId} is not found in team ${teamId}.`,\n {\n team_id: teamId,\n user_id: userId,\n },\n ] as const,\n (json: any) => [json.team_id, json.user_id] as const,\n);\n\nconst TeamInvitationRestrictedUserNotAllowed = createKnownErrorConstructor(\n KnownError,\n \"TEAM_INVITATION_RESTRICTED_USER_NOT_ALLOWED\",\n (restrictedReason: { type: \"anonymous\" | \"email_not_verified\" | \"restricted_by_administrator\" }) => [\n 403,\n `Restricted users cannot accept team invitations. Reason: ${restrictedReason.type}. Please complete the onboarding process before accepting team invitations.`,\n {\n restricted_reason: restrictedReason,\n },\n ] as const,\n (json: any) => [json.restricted_reason ?? { type: \"anonymous\" }] as const,\n);\n\nconst TeamInvitationEmailMismatch = createKnownErrorConstructor(\n KnownError,\n \"TEAM_INVITATION_EMAIL_MISMATCH\",\n () => [\n 403,\n \"This team invitation was sent to a different email address. Sign in with the invited email, or add and verify that email on your account, then try again.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst EmailTemplateAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_TEMPLATE_ALREADY_EXISTS\",\n () => [\n 409,\n \"Email template already exists.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthConnectionNotConnectedToUser = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_CONNECTION_NOT_CONNECTED_TO_USER\",\n () => [\n 400,\n \"The OAuth connection is not connected to any user.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthConnectionAlreadyConnectedToAnotherUser = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_CONNECTION_ALREADY_CONNECTED_TO_ANOTHER_USER\",\n () => [\n 409,\n \"The OAuth connection is already connected to another user.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthConnectionDoesNotHaveRequiredScope = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_CONNECTION_DOES_NOT_HAVE_REQUIRED_SCOPE\",\n () => [\n 400,\n \"The OAuth connection does not have the required scope.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthAccessTokenNotAvailable = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_ACCESS_TOKEN_NOT_AVAILABLE\",\n (provider: string, details: string) => [\n 400,\n `Failed to retrieve an OAuth access token for the connected account (provider: ${provider}). ${details}`,\n {\n provider,\n details,\n } as const,\n ] as const,\n (json: any) => [json.provider, json.details] as const,\n);\n\nconst OAuthExtraScopeNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_EXTRA_SCOPE_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS\",\n () => [\n 400,\n \"Extra scopes are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use extra scopes.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthAccessTokenNotAvailableWithSharedOAuthKeys = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_ACCESS_TOKEN_NOT_AVAILABLE_WITH_SHARED_OAUTH_KEYS\",\n () => [\n 400,\n \"Access tokens are not available with shared OAuth keys. Please add your own OAuth keys on the Hexclave dashboard to use access tokens.\",\n ] as const,\n () => [] as const,\n);\n\nconst InvalidOAuthClientIdOrSecret = createKnownErrorConstructor(\n KnownError,\n \"INVALID_OAUTH_CLIENT_ID_OR_SECRET\",\n (clientId?: string) => [\n 400,\n \"The OAuth client ID or secret is invalid. The client ID must be equal to the project ID (potentially with a hash and a branch ID), and the client secret must be a publishable client key.\",\n {\n client_id: clientId ?? null,\n },\n ] as const,\n (json: any) => [json.client_id ?? undefined] as const,\n);\n\nconst InvalidScope = createKnownErrorConstructor(\n KnownError,\n \"INVALID_SCOPE\",\n (scope: string) => [\n 400,\n `The scope \"${scope}\" is not a valid OAuth scope for Stack.`,\n ] as const,\n (json: any) => [json.scope] as const,\n);\n\nconst UserAlreadyConnectedToAnotherOAuthConnection = createKnownErrorConstructor(\n KnownError,\n \"USER_ALREADY_CONNECTED_TO_ANOTHER_OAUTH_CONNECTION\",\n () => [\n 409,\n \"The user is already connected to another OAuth account. Did you maybe selected the wrong account?\",\n ] as const,\n () => [] as const,\n);\n\nconst OuterOAuthTimeout = createKnownErrorConstructor(\n KnownError,\n \"OUTER_OAUTH_TIMEOUT\",\n () => [\n 408,\n \"The OAuth flow has timed out. Please sign in again.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderNotFoundOrNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_NOT_FOUND_OR_NOT_ENABLED\",\n () => [\n 400,\n \"The OAuth provider is not found or not enabled.\",\n ] as const,\n () => [] as const,\n);\n\nconst AppleBundleIdNotConfigured = createKnownErrorConstructor(\n KnownError,\n \"APPLE_BUNDLE_ID_NOT_CONFIGURED\",\n () => [\n 400,\n \"Apple Sign In is enabled, but no Bundle IDs are configured. Please add your app's Bundle ID in the Hexclave dashboard under OAuth Providers > Apple > Apple Bundle IDs.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderAccountIdAlreadyUsedForSignIn = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_ACCOUNT_ID_ALREADY_USED_FOR_SIGN_IN\",\n () => [\n 400,\n `A provider with the same account ID is already used for signing in.`,\n ] as const,\n () => [] as const,\n);\n\nconst MultiFactorAuthenticationRequired = createKnownErrorConstructor(\n KnownError,\n \"MULTI_FACTOR_AUTHENTICATION_REQUIRED\",\n (attemptCode: string) => [\n 400,\n `Multi-factor authentication is required for this user.`,\n {\n attempt_code: attemptCode,\n },\n ] as const,\n (json) => [json.attempt_code] as const,\n);\n\nconst InvalidTotpCode = createKnownErrorConstructor(\n KnownError,\n \"INVALID_TOTP_CODE\",\n () => [\n 400,\n \"The TOTP code is invalid. Please try again.\",\n ] as const,\n () => [] as const,\n);\n\nconst UserAuthenticationRequired = createKnownErrorConstructor(\n KnownError,\n \"USER_AUTHENTICATION_REQUIRED\",\n () => [\n 401,\n \"User authentication required for this endpoint.\",\n ] as const,\n () => [] as const,\n);\n\nconst TeamMembershipAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"TEAM_MEMBERSHIP_ALREADY_EXISTS\",\n () => [\n 409,\n \"Team membership already exists.\",\n ] as const,\n () => [] as const,\n);\n\nconst ProjectPermissionRequired = createKnownErrorConstructor(\n KnownError,\n \"PROJECT_PERMISSION_REQUIRED\",\n (userId, permissionId) => [\n 401,\n `User ${userId} does not have permission ${permissionId}.`,\n {\n user_id: userId,\n permission_id: permissionId,\n },\n ] as const,\n (json) => [json.user_id, json.permission_id] as const,\n);\n\nconst TeamPermissionRequired = createKnownErrorConstructor(\n KnownError,\n \"TEAM_PERMISSION_REQUIRED\",\n (teamId, userId, permissionId) => [\n 401,\n `User ${userId} does not have permission ${permissionId} in team ${teamId}.`,\n {\n team_id: teamId,\n user_id: userId,\n permission_id: permissionId,\n },\n ] as const,\n (json) => [json.team_id, json.user_id, json.permission_id] as const,\n);\n\nconst TeamPermissionNotFound = createKnownErrorConstructor(\n KnownError,\n \"TEAM_PERMISSION_NOT_FOUND\",\n (teamId, userId, permissionId) => [\n 401,\n `User ${userId} does not have permission ${permissionId} in team ${teamId}.`,\n {\n team_id: teamId,\n user_id: userId,\n permission_id: permissionId,\n },\n ] as const,\n (json) => [json.team_id, json.user_id, json.permission_id] as const,\n);\n\nconst InvalidSharedOAuthProviderId = createKnownErrorConstructor(\n KnownError,\n \"INVALID_SHARED_OAUTH_PROVIDER_ID\",\n (providerId) => [\n 400,\n `The shared OAuth provider with ID ${providerId} is not valid.`,\n {\n provider_id: providerId,\n },\n ] as const,\n (json) => [json.provider_id] as const,\n);\n\nconst InvalidStandardOAuthProviderId = createKnownErrorConstructor(\n KnownError,\n \"INVALID_STANDARD_OAUTH_PROVIDER_ID\",\n (providerId) => [\n 400,\n `The standard OAuth provider with ID ${providerId} is not valid.`,\n {\n provider_id: providerId,\n },\n ] as const,\n (json) => [json.provider_id] as const,\n);\n\nconst InvalidAuthorizationCode = createKnownErrorConstructor(\n KnownError,\n \"INVALID_AUTHORIZATION_CODE\",\n () => [\n 400,\n \"The given authorization code is invalid.\",\n ] as const,\n () => [] as const,\n);\n\nconst InvalidAppleCredentials = createKnownErrorConstructor(\n KnownError,\n \"INVALID_APPLE_CREDENTIALS\",\n () => [\n 400,\n \"The Apple Sign In credentials could not be verified. Please try signing in again.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderAccessDenied = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_ACCESS_DENIED\",\n () => [\n 400,\n \"The OAuth provider denied access to the user.\",\n ] as const,\n () => [] as const,\n);\n\nconst OAuthProviderTemporarilyUnavailable = createKnownErrorConstructor(\n KnownError,\n \"OAUTH_PROVIDER_TEMPORARILY_UNAVAILABLE\",\n () => [\n 503,\n \"The OAuth provider is temporarily unavailable. Please try again later.\",\n ] as const,\n () => [] as const,\n);\n\nconst ContactChannelAlreadyUsedForAuthBySomeoneElse = createKnownErrorConstructor(\n KnownError,\n \"CONTACT_CHANNEL_ALREADY_USED_FOR_AUTH_BY_SOMEONE_ELSE\",\n (type: \"email\", contactChannelValue?: string, wouldWorkIfEmailWasVerified: boolean = false) => [\n 409,\n `This ${type} ${contactChannelValue ? `\"(${contactChannelValue})\"` : \"\"} is already used for authentication by another account${wouldWorkIfEmailWasVerified ? \" but the email is not verified. Please login to your existing account with the method you used to sign up, and then verify your email to sign in with this login method.\" : \".\"}`,\n {\n type,\n contact_channel_value: contactChannelValue ?? null,\n would_work_if_email_was_verified: wouldWorkIfEmailWasVerified,\n },\n ] as const,\n (json) => [json.type, json.contact_channel_value, json.would_work_if_email_was_verified ?? false] as const,\n);\n\nconst InvalidPollingCodeError = createKnownErrorConstructor(\n KnownError,\n \"INVALID_POLLING_CODE\",\n (details?: Json) => [\n 400,\n \"The polling code is invalid or does not exist.\",\n details,\n ] as const,\n (json: any) => [json] as const,\n);\n\nconst CliAuthError = createKnownErrorConstructor(\n KnownError,\n \"CLI_AUTH_ERROR\",\n (message: string) => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst CliAuthExpiredError = createKnownErrorConstructor(\n KnownError,\n \"CLI_AUTH_EXPIRED_ERROR\",\n (message: string = \"CLI authentication request expired. Please try again.\") => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\nconst CliAuthUsedError = createKnownErrorConstructor(\n KnownError,\n \"CLI_AUTH_USED_ERROR\",\n (message: string = \"This authentication token has already been used.\") => [\n 400,\n message,\n ] as const,\n (json: any) => [json.message] as const,\n);\n\n\nconst ApiKeyNotValid = createKnownErrorConstructor(\n KnownError,\n \"API_KEY_NOT_VALID\",\n \"inherit\",\n \"inherit\",\n);\n\nconst ApiKeyExpired = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"API_KEY_EXPIRED\",\n () => [\n 401,\n \"API key has expired.\",\n ] as const,\n () => [] as const,\n);\n\nconst ApiKeyRevoked = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"API_KEY_REVOKED\",\n () => [\n 401,\n \"API key has been revoked.\",\n ] as const,\n () => [] as const,\n);\n\nconst WrongApiKeyType = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"WRONG_API_KEY_TYPE\",\n (expectedType: string, actualType: string) => [\n 400,\n `This endpoint is for ${expectedType} API keys, but a ${actualType} API key was provided.`,\n { expected_type: expectedType, actual_type: actualType },\n ] as const,\n (json) => [json.expected_type, json.actual_type] as const,\n);\n\nconst ApiKeyNotFound = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"API_KEY_NOT_FOUND\",\n () => [\n 404,\n \"API key not found.\",\n ] as const,\n () => [] as const,\n);\n\nconst PublicApiKeyCannotBeRevoked = createKnownErrorConstructor(\n ApiKeyNotValid,\n \"PUBLIC_API_KEY_CANNOT_BE_REVOKED\",\n () => [\n 400,\n \"Public API keys cannot be revoked by the secretscanner endpoint.\",\n ] as const,\n () => [] as const,\n);\nconst PermissionIdAlreadyExists = createKnownErrorConstructor(\n KnownError,\n \"PERMISSION_ID_ALREADY_EXISTS\",\n (permissionId: string) => [\n 400,\n `Permission with ID \"${permissionId}\" already exists. Choose a different ID.`,\n {\n permission_id: permissionId,\n },\n ] as const,\n (json: any) => [json.permission_id] as const,\n);\n\nconst EmailRenderingError = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_RENDERING_ERROR\",\n (error: string) => [\n 400,\n `Failed to render email with theme: ${error}`,\n { error },\n ] as const,\n (json: any) => [json.error] as const,\n);\n\nconst TemplateSourceRewriteError = createKnownErrorConstructor(\n KnownError,\n \"TEMPLATE_SOURCE_REWRITE_ERROR\",\n (error: string) => [\n 400,\n `Failed to rewrite template source: ${error}`,\n { error },\n ] as const,\n (json: any) => [json.error] as const,\n);\n\nconst RequiresCustomEmailServer = createKnownErrorConstructor(\n KnownError,\n \"REQUIRES_CUSTOM_EMAIL_SERVER\",\n () => [\n 400,\n `This action requires a custom SMTP server. Please edit your email server configuration and try again.`,\n ] as const,\n () => [] as const,\n);\n\nconst EmailCapacityBoostAlreadyActive = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_CAPACITY_BOOST_ALREADY_ACTIVE\",\n (expiresAt: string) => [\n 409,\n `Email capacity boost is already active until ${expiresAt}.`,\n { expires_at: expiresAt },\n ] as const,\n (json: any) => [json.expires_at] as const,\n);\n\nconst EmailNotEditable = createKnownErrorConstructor(\n KnownError,\n \"EMAIL_NOT_EDITABLE\",\n (emailId: string, status: string) => [\n 400,\n `Email with ID \"${emailId}\" cannot be edited because it is in status \"${status}\". Only emails in PAUSED, PREPARING, RENDERING, RENDER_ERROR, SCHEDULED, QUEUED, or SERVER_ERROR status can be edited.`,\n {\n email_id: emailId,\n status,\n },\n ] as const,\n (json: any) => [json.email_id, json.status] as const,\n);\n\nconst ItemNotFound = createKnownErrorConstructor(\n KnownError,\n \"ITEM_NOT_FOUND\",\n (itemId: string) => [\n 404,\n `Item with ID \"${itemId}\" not found.`,\n {\n item_id: itemId,\n },\n ] as const,\n (json) => [json.item_id] as const,\n);\n\nconst ItemCustomerTypeDoesNotMatch = createKnownErrorConstructor(\n KnownError,\n \"ITEM_CUSTOMER_TYPE_DOES_NOT_MATCH\",\n (itemId: string, customerId: string, itemCustomerType: \"user\" | \"team\" | \"custom\" | undefined, actualCustomerType: \"user\" | \"team\" | \"custom\") => [\n 400,\n `The ${actualCustomerType} with ID ${JSON.stringify(customerId)} is not a valid customer for the item with ID ${JSON.stringify(itemId)}. ${itemCustomerType ? `The item is configured to only be available for ${itemCustomerType} customers, but the customer is a ${actualCustomerType}.` : `The item is missing a customer type field. Please make sure it is set up correctly in your project configuration.`}`,\n {\n item_id: itemId,\n customer_id: customerId,\n item_customer_type: itemCustomerType ?? null,\n actual_customer_type: actualCustomerType,\n },\n ] as const,\n (json) => [json.item_id, json.customer_id, json.item_customer_type ?? undefined, json.actual_customer_type] as const,\n);\n\nconst CustomerDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"CUSTOMER_DOES_NOT_EXIST\",\n (customerId: string) => [\n 400,\n `Customer with ID ${JSON.stringify(customerId)} does not exist.`,\n {\n customer_id: customerId,\n },\n ] as const,\n (json) => [json.customer_id] as const,\n);\n\nconst SubscriptionInvoiceNotFound = createKnownErrorConstructor(\n KnownError,\n \"SUBSCRIPTION_INVOICE_NOT_FOUND\",\n (subscriptionInvoiceId: string) => [\n 404,\n `Subscription invoice with ID ${JSON.stringify(subscriptionInvoiceId)} does not exist.`,\n {\n subscription_invoice_id: subscriptionInvoiceId,\n },\n ] as const,\n (json) => [json.subscription_invoice_id] as const,\n);\n\nconst OneTimePurchaseNotFound = createKnownErrorConstructor(\n KnownError,\n \"ONE_TIME_PURCHASE_NOT_FOUND\",\n (purchaseId: string) => [\n 404,\n `One-time purchase with ID ${JSON.stringify(purchaseId)} does not exist.`,\n {\n one_time_purchase_id: purchaseId,\n },\n ] as const,\n (json) => [json.one_time_purchase_id] as const,\n);\n\n// Used by the three-knob refund flow's legacy backstop — these are thrown\n// when a purchase has the pre-rework `refundedAt` column set (i.e. it was\n// refunded under the previous flow). The new flow's bulldozer-derived\n// prior-refund summary can't see those rows, so this gate prevents\n// double-refunding through Stripe.\nconst SubscriptionAlreadyRefunded = createKnownErrorConstructor(\n KnownError,\n \"SUBSCRIPTION_ALREADY_REFUNDED\",\n (subscriptionId: string) => [\n 400,\n `Subscription with ID ${JSON.stringify(subscriptionId)} was already refunded.`,\n {\n subscription_id: subscriptionId,\n },\n ] as const,\n (json) => [json.subscription_id] as const,\n);\n\nconst OneTimePurchaseAlreadyRefunded = createKnownErrorConstructor(\n KnownError,\n \"ONE_TIME_PURCHASE_ALREADY_REFUNDED\",\n (purchaseId: string) => [\n 400,\n `One-time purchase with ID ${JSON.stringify(purchaseId)} was already refunded.`,\n {\n one_time_purchase_id: purchaseId,\n },\n ] as const,\n (json) => [json.one_time_purchase_id] as const,\n);\n\nconst TestModePurchaseNonRefundable = createKnownErrorConstructor(\n KnownError,\n \"TEST_MODE_PURCHASE_NON_REFUNDABLE\",\n () => [\n 400,\n \"Test mode purchases are not refundable.\",\n ] as const,\n () => [] as const,\n);\n\n\nconst ProductDoesNotExist = createKnownErrorConstructor(\n KnownError,\n \"PRODUCT_DOES_NOT_EXIST\",\n (productId: string, context: \"item_exists\" | \"server_only\" | null) => [\n 400,\n `Product with ID ${JSON.stringify(productId)} ${context === \"server_only\"\n ? \"is marked as server-only and cannot be accessed client side.\"\n : context === \"item_exists\"\n ? \"does not exist, but an item with this ID exists.\"\n : \"does not exist.\"\n }`,\n {\n product_id: productId,\n context,\n } as const,\n ] as const,\n (json) => [json.product_id, json.context] as const,\n);\n\nconst ProductCustomerTypeDoesNotMatch = createKnownErrorConstructor(\n KnownError,\n \"PRODUCT_CUSTOMER_TYPE_DOES_NOT_MATCH\",\n (productId: string | undefined, customerId: string, productCustomerType: \"user\" | \"team\" | \"custom\" | undefined, actualCustomerType: \"user\" | \"team\" | \"custom\") => [\n 400,\n `The ${actualCustomerType} with ID ${JSON.stringify(customerId)} is not a valid customer for the inline product that has been passed in. ${productCustomerType ? `The product is configured to only be available for ${productCustomerType} customers, but the customer is a ${actualCustomerType}.` : `The product is missing a customer type field. Please make sure it is set up correctly in your project configuration.`}`,\n {\n product_id: productId ?? null,\n customer_id: customerId,\n product_customer_type: productCustomerType ?? null,\n actual_customer_type: actualCustomerType,\n },\n ] as const,\n (json) => [json.product_id ?? undefined, json.customer_id, json.product_customer_type ?? undefined, json.actual_customer_type] as const,\n);\n\nconst ProductAlreadyGranted = createKnownErrorConstructor(\n KnownError,\n \"PRODUCT_ALREADY_GRANTED\",\n (productId: string, customerId: string) => [\n 400,\n `Customer with ID ${JSON.stringify(customerId)} already owns product ${JSON.stringify(productId)}.`,\n {\n product_id: productId,\n customer_id: customerId,\n },\n ] as const,\n (json) => [json.product_id, json.customer_id] as const,\n);\n\nconst ItemQuantityInsufficientAmount = createKnownErrorConstructor(\n KnownError,\n \"ITEM_QUANTITY_INSUFFICIENT_AMOUNT\",\n (itemId: string, customerId: string, quantity: number) => [\n 400,\n `The item with ID ${JSON.stringify(itemId)} has an insufficient quantity for the customer with ID ${JSON.stringify(customerId)}. An attempt was made to charge ${quantity} credits.`,\n {\n item_id: itemId,\n customer_id: customerId,\n quantity,\n },\n ] as const,\n (json) => [json.item_id, json.customer_id, json.quantity] as const,\n);\n\nconst StripeAccountInfoNotFound = createKnownErrorConstructor(\n KnownError,\n \"STRIPE_ACCOUNT_INFO_NOT_FOUND\",\n () => [\n 404,\n \"Stripe account information not found. Please make sure the user has onboarded with Stripe.\",\n ] as const,\n () => [] as const,\n);\n\nconst AnalyticsQueryTimeout = createKnownErrorConstructor(\n KnownError,\n \"ANALYTICS_QUERY_TIMEOUT\",\n (timeoutMs: number) => [\n 400,\n `The query timed out. Please try again with a shorter query or increase the timeout. Timeout was ${timeoutMs}ms.`,\n { timeout_ms: timeoutMs },\n ] as const,\n (json) => [json.timeout_ms] as const,\n);\n\nconst AnalyticsQueryError = createKnownErrorConstructor(\n KnownError,\n \"ANALYTICS_QUERY_ERROR\",\n (error: string) => [\n 400,\n `${error}`,\n { error },\n ] as const,\n (json) => [json.error] as const,\n);\n\nconst AnalyticsNotEnabled = createKnownErrorConstructor(\n KnownError,\n \"ANALYTICS_NOT_ENABLED\",\n () => [\n 400,\n \"Analytics is not enabled for this project.\",\n ] as const,\n () => [] as const,\n);\n\nconst DefaultPaymentMethodRequired = createKnownErrorConstructor(\n KnownError,\n \"DEFAULT_PAYMENT_METHOD_REQUIRED\",\n (customerType: \"user\" | \"team\", customerId: string) => [\n 400,\n \"No default payment method is set for this customer.\",\n {\n customer_type: customerType,\n customer_id: customerId,\n },\n ] as const,\n (json) => [json.customer_type, json.customer_id] as const,\n);\n\nconst NewPurchasesBlocked = createKnownErrorConstructor(\n KnownError,\n \"NEW_PURCHASES_BLOCKED\",\n () => [\n 403,\n \"New purchases are currently blocked for this project. Please contact support for more information.\",\n ] as const,\n () => [] as const,\n);\n\nexport type KnownErrors = {\n [K in keyof typeof KnownErrors]: InstanceType<typeof KnownErrors[K]>;\n};\n\nexport const KnownErrors = {\n CannotDeleteCurrentSession,\n UnsupportedError,\n BodyParsingError,\n SchemaError,\n AllOverloadsFailed,\n ProjectAuthenticationError,\n PermissionIdAlreadyExists,\n CliAuthError,\n CliAuthExpiredError,\n CliAuthUsedError,\n InvalidProjectAuthentication,\n ProjectKeyWithoutAccessType,\n InvalidAccessType,\n AccessTypeWithoutProjectId,\n AccessTypeRequired,\n CannotGetOwnUserWithoutUser,\n InsufficientAccessType,\n InvalidPublishableClientKey,\n InvalidSecretServerKey,\n InvalidSuperSecretAdminKey,\n InvalidAdminAccessToken,\n UnparsableAdminAccessToken,\n AdminAccessTokenExpired,\n InvalidProjectForAdminAccessToken,\n AdminAccessTokenIsNotAdmin,\n ProjectAuthenticationRequired,\n ClientAuthenticationRequired,\n PublishableClientKeyRequiredForProject,\n ServerAuthenticationRequired,\n ClientOrServerAuthenticationRequired,\n ClientOrAdminAuthenticationRequired,\n ClientOrServerOrAdminAuthenticationRequired,\n AdminAuthenticationRequired,\n ExpectedInternalProject,\n SessionAuthenticationError,\n InvalidSessionAuthentication,\n InvalidAccessToken,\n UnparsableAccessToken,\n AccessTokenExpired,\n InvalidProjectForAccessToken,\n RefreshTokenError,\n ProviderRejected,\n RefreshTokenNotFoundOrExpired,\n UserWithEmailAlreadyExists,\n EmailNotVerified,\n UserIdDoesNotExist,\n UserNotFound,\n RestrictedUserNotAllowed,\n ApiKeyNotFound,\n PublicApiKeyCannotBeRevoked,\n ProjectNotFound,\n CurrentProjectNotFound,\n BranchDoesNotExist,\n SignUpNotEnabled,\n SignUpRejected,\n BotChallengeRequired,\n BotChallengeFailed,\n PasswordAuthenticationNotEnabled,\n PasskeyAuthenticationNotEnabled,\n AnonymousAccountsNotEnabled,\n AnonymousAuthenticationNotAllowed,\n EmailPasswordMismatch,\n RedirectUrlNotWhitelisted,\n PasswordRequirementsNotMet,\n PasswordTooShort,\n PasswordTooLong,\n UserDoesNotHavePassword,\n VerificationCodeError,\n VerificationCodeNotFound,\n VerificationCodeExpired,\n VerificationCodeAlreadyUsed,\n VerificationCodeMaxAttemptsReached,\n PasswordConfirmationMismatch,\n EmailAlreadyVerified,\n EmailNotAssociatedWithUser,\n EmailIsNotPrimaryEmail,\n PasskeyRegistrationFailed,\n PasskeyWebAuthnError,\n PasskeyAuthenticationFailed,\n PermissionNotFound,\n PermissionScopeMismatch,\n ContainedPermissionNotFound,\n TeamNotFound,\n TeamMembershipNotFound,\n TeamInvitationRestrictedUserNotAllowed,\n TeamInvitationEmailMismatch,\n EmailTemplateAlreadyExists,\n OAuthConnectionNotConnectedToUser,\n OAuthConnectionAlreadyConnectedToAnotherUser,\n OAuthConnectionDoesNotHaveRequiredScope,\n OAuthAccessTokenNotAvailable,\n OAuthExtraScopeNotAvailableWithSharedOAuthKeys,\n OAuthAccessTokenNotAvailableWithSharedOAuthKeys,\n InvalidOAuthClientIdOrSecret,\n InvalidScope,\n UserAlreadyConnectedToAnotherOAuthConnection,\n OuterOAuthTimeout,\n OAuthProviderNotFoundOrNotEnabled,\n AppleBundleIdNotConfigured,\n OAuthProviderAccountIdAlreadyUsedForSignIn,\n MultiFactorAuthenticationRequired,\n InvalidTotpCode,\n UserAuthenticationRequired,\n TeamMembershipAlreadyExists,\n ProjectPermissionRequired,\n TeamPermissionRequired,\n InvalidSharedOAuthProviderId,\n InvalidStandardOAuthProviderId,\n InvalidAuthorizationCode,\n InvalidAppleCredentials,\n TeamPermissionNotFound,\n OAuthProviderAccessDenied,\n OAuthProviderTemporarilyUnavailable,\n ContactChannelAlreadyUsedForAuthBySomeoneElse,\n InvalidPollingCodeError,\n ApiKeyNotValid,\n ApiKeyExpired,\n ApiKeyRevoked,\n WrongApiKeyType,\n EmailRenderingError,\n TemplateSourceRewriteError,\n RequiresCustomEmailServer,\n EmailCapacityBoostAlreadyActive,\n EmailNotEditable,\n ItemNotFound,\n ItemCustomerTypeDoesNotMatch,\n CustomerDoesNotExist,\n ProductDoesNotExist,\n ProductCustomerTypeDoesNotMatch,\n ProductAlreadyGranted,\n SubscriptionInvoiceNotFound,\n OneTimePurchaseNotFound,\n SubscriptionAlreadyRefunded,\n OneTimePurchaseAlreadyRefunded,\n TestModePurchaseNonRefundable,\n ItemQuantityInsufficientAmount,\n StripeAccountInfoNotFound,\n DefaultPaymentMethodRequired,\n NewPurchasesBlocked,\n DataVaultStoreDoesNotExist,\n DataVaultStoreHashedKeyDoesNotExist,\n AnalyticsQueryTimeout,\n AnalyticsQueryError,\n AnalyticsNotEnabled,\n} satisfies Record<string, KnownErrorConstructor<any, any>>;\n\n\n// ensure that all known error codes are unique\nconst knownErrorCodes = new Set<string>();\nfor (const [_, KnownError] of Object.entries(KnownErrors)) {\n if (knownErrorCodes.has(KnownError.errorCode)) {\n throw new Error(`Duplicate known error code: ${KnownError.errorCode}`);\n }\n knownErrorCodes.add(KnownError.errorCode);\n}\n"],"mappings":";;;;;AAwBA,IAAsB,aAAtB,cAAyCA,kBAAAA,YAAY;CAInD,YACE,YACA,sBACA,SACA;EACA,MACE,YACA,oBACF;EAPgB,KAAA,aAAA;EACA,KAAA,uBAAA;EACA,KAAA,UAAA;gCANwB;cAC5B;CAWd;CAEA,OAAc,aAAa,OAAqC;EAE9D,OAAO,OAAO,UAAU,YAAY,U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AClC,YACA,wCACM,CACJ,KACA,2JACF,SACM,CAAC,CACT;AAGA,MAAM,6BAA6B,4BACjC,YACA,uCACM,CACJ,KACA,gCACF,SACM,CAAC,CACT;AAEA,MAAM,oCAAoC,4BACxC,YACA,gDACM,CACJ,KACA,oDACF,SACM,CAAC,CACT;AAEA,MAAM,+CAA+C,4BACnD,YACA,4DACM,CACJ,KACA,4DACF,SACM,CAAC,CACT;AAEA,MAAM,0CAA0C,4BAC9C,YACA,uDACM,CACJ,KACA,wDACF,SACM,CAAC,CACT;AAEA,MAAM,+BAA+B,4BACnC,YACA,qCACC,UAAkB,YAAoB;CACrC;CACA,iFAAiF,SAAS,KAAK;CAC/F;EACE;EACA;CACF;AACF,IACC,SAAc,CAAC,KAAK,UAAU,KAAK,OAAO,CAC7C;AAEA,MAAM,iDAAiD,4BACrD,YACA,gEACM,CACJ,KACA,sIACF,SACM,CAAC,CACT;AAEA,MAAM,kDAAkD,4BACtD,YACA,iEACM,CACJ,KACA,wIACF,SACM,CAAC,CACT;AAEA,MAAM,+BAA+B,4BACnC,YACA,sCACC,aAAsB;CACrB;CACA;CACA,EACE,WAAW,YAAY,KACzB;AACF,IACC,SAAc,CAAC,KAAK,aAAa,KAAA,CAAS,CAC7C;AAEA,MAAM,eAAe,4BACnB,YACA,kBACC,UAAkB,CACjB,KACA,cAAc,MAAM,wCACtB,IACC,SAAc,CAAC,KAAK,KAAK,CAC5B;AAEA,MAAM,+CAA+C,4BACnD,YACA,4DACM,CACJ,KACA,mGACF,SACM,CAAC,CACT;AAEA,MAAM,oBAAoB,4BACxB,YACA,6BACM,CACJ,KACA,qDACF,SACM,CAAC,CACT;AAEA,MAAM,oCAAoC,4BACxC,YACA,iDACM,CACJ,KACA,iDACF,SACM,CAAC,CACT;AAEA,MAAM,6BAA6B,4BACjC,YACA,wCACM,CACJ,KACA,yKACF,SACM,CAAC,CACT;AAEA,MAAM,6CAA6C,4BACjD,YACA,4DACM,CACJ,KACA,qEACF,SACM,CAAC,C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,0BACC,UAAkB;CACjB;CACA,GAAG;CACH,EAAE,MAAM;AACV,IACC,SAAS,CAAC,KAAK,KAAK,CACvB;AAEA,MAAM,sBAAsB,4BAC1B,YACA,+BACM,CACJ,KACA,4CACF,SACM,CAAC,CACT;AA8BA,MAAa,cAAc;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA,8BAtKmC,4BACnC,YACA,oCACC,cAA+B,eAAuB;EACrD;EACA;EACA;GACE,eAAe;GACf,aAAa;EACf;CACF,IACC,SAAS,CAAC,KAAK,eAAe,KAAK,WAAW,CA2J/C;CACA,qBAzJ0B,4BAC1B,YACA,+BACM,CACJ,KACA,oGACF,SACM,CAAC,CAkJP;CACA;CACA;CACA;CACA;CACA;AACF;AAIA,MAAM,kCAAkB,IAAI,IAAY;AACxC,KAAK,MAAM,CAAC,GAAG,eAAe,OAAO,QAAQ,WAAW,GAAG;CACzD,IAAI,gBAAgB,IAAI,WAAW,SAAS,GAC1C,MAAM,IAAI,MAAM,+BAA+B,WAAW,WAAW;CAEvE,gBAAgB,IAAI,WAAW,SAAS;AAC1C"}
@@ -0,0 +1,37 @@
1
+ import { c as CrudTypeOf, s as CrudSchemaFromOptions } from "./crud-CqmEW9s6.js";
2
+
3
+ //#region src/interface/crud/notification-preferences.d.ts
4
+ declare const notificationPreferenceCrud: CrudSchemaFromOptions<{
5
+ clientReadSchema: import("yup").ObjectSchema<{
6
+ notification_category_id: string;
7
+ notification_category_name: string;
8
+ enabled: boolean;
9
+ can_disable: boolean;
10
+ }, import("yup").AnyObject, {
11
+ notification_category_id: undefined;
12
+ notification_category_name: undefined;
13
+ enabled: undefined;
14
+ can_disable: undefined;
15
+ }, "">;
16
+ clientUpdateSchema: import("yup").ObjectSchema<{
17
+ enabled: boolean;
18
+ }, import("yup").AnyObject, {
19
+ enabled: undefined;
20
+ }, "">;
21
+ docs: {
22
+ clientList: {
23
+ summary: string;
24
+ description: string;
25
+ tags: string[];
26
+ };
27
+ clientUpdate: {
28
+ summary: string;
29
+ description: string;
30
+ tags: string[];
31
+ };
32
+ };
33
+ }>;
34
+ type NotificationPreferenceCrud = CrudTypeOf<typeof notificationPreferenceCrud>;
35
+ //#endregion
36
+ export { notificationPreferenceCrud as n, NotificationPreferenceCrud as t };
37
+ //# sourceMappingURL=notification-preferences-Bmzr_EOY.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-preferences-Bmzr_EOY.d.ts","names":[],"sources":["../src/interface/crud/notification-preferences.ts"],"mappings":";;;cAea,0BAAA,EAeX,qBAfqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAiB3B,0BAAA,GAA6B,UAAU,QAAQ,0BAAA"}