@donotdev/functions 0.2.0 → 0.2.2

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 (313) hide show
  1. package/README.md +1 -1
  2. package/lib/chunks/{chunk-JTAGPPPL.js → chunk-2A4FPYNB.js} +2 -2
  3. package/lib/chunks/chunk-2IFFIUFV.js +23 -0
  4. package/lib/chunks/{chunk-RM7DV6IQ.js.map → chunk-2IFFIUFV.js.map} +3 -3
  5. package/lib/chunks/chunk-FQSQGOBN.js +22 -0
  6. package/lib/chunks/chunk-FQSQGOBN.js.map +7 -0
  7. package/lib/chunks/chunk-G4FO76EA.js +22 -0
  8. package/lib/chunks/{chunk-5DTPEM64.js.map → chunk-G4FO76EA.js.map} +3 -3
  9. package/lib/chunks/{chunk-QJAU2MWV.js → chunk-LSM5Y2E5.js} +2 -2
  10. package/lib/chunks/{chunk-QJAU2MWV.js.map → chunk-LSM5Y2E5.js.map} +3 -3
  11. package/lib/chunks/{chunk-4U7QQWYG.js → chunk-M4JV2JCF.js} +2 -2
  12. package/lib/chunks/chunk-OZX5ZG44.js +22 -0
  13. package/lib/chunks/chunk-OZX5ZG44.js.map +7 -0
  14. package/lib/chunks/{chunk-IFOYVSPU.js → chunk-PJCJ5H2O.js} +2 -2
  15. package/lib/chunks/chunk-PWAGW4R6.js +22 -0
  16. package/lib/chunks/chunk-PWAGW4R6.js.map +7 -0
  17. package/lib/chunks/chunk-UYI56E6Q.js +151 -0
  18. package/lib/chunks/chunk-UYI56E6Q.js.map +7 -0
  19. package/lib/chunks/chunk-ZVHC2CAV.js +22 -0
  20. package/lib/chunks/chunk-ZVHC2CAV.js.map +7 -0
  21. package/lib/chunks/{monitoring-AGCSU3FI.js → monitoring-UIDJS2KA.js} +2 -2
  22. package/lib/chunks/{rateLimiter-6KO7AIZP.js → rateLimiter-WNWHI3B4.js} +2 -2
  23. package/lib/chunks/server-RYGEBS2B.js +22 -0
  24. package/lib/firebase/auth/getCustomClaims.d.ts +0 -0
  25. package/lib/firebase/auth/getUserAuthStatus.d.ts +0 -0
  26. package/lib/firebase/auth/index.d.ts +0 -0
  27. package/lib/firebase/auth/removeCustomClaims.d.ts +0 -0
  28. package/lib/firebase/auth/setCustomClaims.d.ts +0 -0
  29. package/lib/firebase/baseFunction.d.ts +0 -0
  30. package/lib/firebase/billing/cancelSubscription.d.ts +0 -0
  31. package/lib/firebase/billing/changePlan.d.ts +0 -0
  32. package/lib/firebase/billing/createCheckoutSession.d.ts +0 -0
  33. package/lib/firebase/billing/createCustomerPortal.d.ts +0 -0
  34. package/lib/firebase/billing/healthCheck.d.ts +0 -0
  35. package/lib/firebase/billing/index.d.ts +2 -2
  36. package/lib/firebase/billing/refreshSubscriptionStatus.d.ts +0 -0
  37. package/lib/firebase/billing/webhookHandler.d.ts +0 -0
  38. package/lib/firebase/config/constants.d.ts +0 -0
  39. package/lib/firebase/config/index.d.ts +0 -0
  40. package/lib/firebase/config/secrets.d.ts +0 -0
  41. package/lib/firebase/crud/aggregate.d.ts +0 -0
  42. package/lib/firebase/crud/create.d.ts +0 -0
  43. package/lib/firebase/crud/delete.d.ts +0 -0
  44. package/lib/firebase/crud/get.d.ts +0 -0
  45. package/lib/firebase/crud/index.d.ts +0 -0
  46. package/lib/firebase/crud/list.d.ts +0 -0
  47. package/lib/firebase/crud/update.d.ts +0 -0
  48. package/lib/firebase/helpers/githubAccessHelper.d.ts +0 -0
  49. package/lib/firebase/helpers/githubTeamAccessHelper.d.ts +0 -0
  50. package/lib/firebase/helpers/index.d.ts +0 -0
  51. package/lib/firebase/index.d.ts +1 -1
  52. package/lib/firebase/index.js +1 -1
  53. package/lib/firebase/index.js.map +4 -4
  54. package/lib/firebase/oauth/disconnect.d.ts +0 -0
  55. package/lib/firebase/oauth/exchangeToken.d.ts +0 -0
  56. package/lib/firebase/oauth/getConnections.d.ts +0 -0
  57. package/lib/firebase/oauth/githubAccess.d.ts +0 -0
  58. package/lib/firebase/oauth/index.d.ts +0 -0
  59. package/lib/firebase/oauth/refreshToken.d.ts +0 -0
  60. package/lib/firebase/registerCrudFunctions.d.ts +0 -5
  61. package/lib/firebase/scheduled/checkExpiredSubscriptions.d.ts +0 -0
  62. package/lib/firebase/scheduled/index.d.ts +0 -0
  63. package/lib/shared/ai/classifyAIError.d.ts +0 -0
  64. package/lib/shared/ai/costTracker.d.ts +0 -0
  65. package/lib/shared/ai/createAIRoute.d.ts +0 -0
  66. package/lib/shared/ai/index.d.ts +0 -0
  67. package/lib/shared/ai/resolveModelTier.d.ts +0 -0
  68. package/lib/shared/billing/checkoutPrice.d.ts +3 -6
  69. package/lib/shared/billing/createCheckout.d.ts +3 -3
  70. package/lib/shared/billing/firestoreIdempotency.d.ts +13 -0
  71. package/lib/shared/billing/helpers/index.d.ts +0 -0
  72. package/lib/shared/billing/helpers/subscriptionManagement.d.ts +0 -0
  73. package/lib/shared/billing/helpers/updateUserSubscription.d.ts +0 -0
  74. package/lib/shared/billing/idempotency.d.ts +4 -35
  75. package/lib/shared/billing/idempotencyContract.d.ts +0 -20
  76. package/lib/shared/billing/index.d.ts +0 -0
  77. package/lib/shared/billing/stripeClient.d.ts +45 -0
  78. package/lib/shared/billing/webhookHandler.d.ts +5 -4
  79. package/lib/shared/email/createEmailRoute.d.ts +0 -0
  80. package/lib/shared/email/index.d.ts +0 -0
  81. package/lib/shared/email/provider.d.ts +0 -0
  82. package/lib/shared/email/resendProvider.d.ts +0 -0
  83. package/lib/shared/errorHandling.d.ts +0 -0
  84. package/lib/shared/firebase.d.ts +0 -0
  85. package/lib/shared/github.d.ts +0 -0
  86. package/lib/shared/index.d.ts +0 -0
  87. package/lib/shared/index.js +1 -1
  88. package/lib/shared/index.js.map +0 -0
  89. package/lib/shared/logger.d.ts +0 -0
  90. package/lib/shared/metadata.d.ts +0 -0
  91. package/lib/shared/oauth/exchangeToken.d.ts +0 -0
  92. package/lib/shared/oauth/grantAccess.d.ts +0 -0
  93. package/lib/shared/oauth/index.d.ts +0 -0
  94. package/lib/shared/schema.d.ts +0 -0
  95. package/lib/shared/utils/detectFirestore.d.ts +0 -0
  96. package/lib/shared/utils/external/date.d.ts +0 -0
  97. package/lib/shared/utils/external/index.d.ts +0 -0
  98. package/lib/shared/utils/external/references.d.ts +0 -0
  99. package/lib/shared/utils/external/subscription.d.ts +0 -0
  100. package/lib/shared/utils/firebaseHelpers.d.ts +0 -0
  101. package/lib/shared/utils/functionWrapper.d.ts +0 -0
  102. package/lib/shared/utils/index.d.ts +0 -0
  103. package/lib/shared/utils/internal/auth.d.ts +1 -5
  104. package/lib/shared/utils/internal/firebase.d.ts +0 -0
  105. package/lib/shared/utils/internal/idempotency.d.ts +0 -0
  106. package/lib/shared/utils/internal/index.d.ts +0 -0
  107. package/lib/shared/utils/internal/monitoring.d.ts +0 -0
  108. package/lib/shared/utils/internal/rateLimiter.d.ts +0 -0
  109. package/lib/shared/utils/internal/validation.d.ts +0 -8
  110. package/lib/shared/utils/schemaValidation.d.ts +0 -0
  111. package/lib/shared/utils/validation.d.ts +0 -0
  112. package/lib/shared/utils/vercelHelpers.d.ts +0 -0
  113. package/lib/shared/utils.d.ts +0 -126
  114. package/lib/shared/validation.d.ts +0 -0
  115. package/lib/supabase/ai/createAIFunction.d.ts +0 -0
  116. package/lib/supabase/auth/deleteAccount.d.ts +0 -0
  117. package/lib/supabase/auth/getCustomClaims.d.ts +0 -0
  118. package/lib/supabase/auth/getUserAuthStatus.d.ts +0 -0
  119. package/lib/supabase/auth/removeCustomClaims.d.ts +0 -0
  120. package/lib/supabase/auth/setCustomClaims.d.ts +0 -0
  121. package/lib/supabase/baseFunction.d.ts +0 -0
  122. package/lib/supabase/billing/cancelSubscription.d.ts +0 -0
  123. package/lib/supabase/billing/changePlan.d.ts +0 -0
  124. package/lib/supabase/billing/createCheckoutSession.d.ts +0 -0
  125. package/lib/supabase/billing/createCustomerPortal.d.ts +0 -0
  126. package/lib/supabase/billing/refreshSubscriptionStatus.d.ts +0 -0
  127. package/lib/supabase/crud/aggregate.d.ts +0 -0
  128. package/lib/supabase/crud/create.d.ts +0 -0
  129. package/lib/supabase/crud/delete.d.ts +0 -0
  130. package/lib/supabase/crud/get.d.ts +0 -0
  131. package/lib/supabase/crud/index.d.ts +0 -0
  132. package/lib/supabase/crud/list.d.ts +0 -8
  133. package/lib/supabase/crud/update.d.ts +0 -0
  134. package/lib/supabase/edgeFunction.d.ts +0 -0
  135. package/lib/supabase/email/createEmailFunction.d.ts +0 -0
  136. package/lib/supabase/helpers/authProvider.d.ts +0 -0
  137. package/lib/supabase/index.d.ts +3 -2
  138. package/lib/supabase/index.js +1 -1
  139. package/lib/supabase/index.js.map +3 -3
  140. package/lib/supabase/oauth/disconnect.d.ts +0 -0
  141. package/lib/supabase/oauth/exchangeToken.d.ts +0 -0
  142. package/lib/supabase/oauth/getConnections.d.ts +0 -0
  143. package/lib/supabase/oauth/index.d.ts +0 -0
  144. package/lib/supabase/oauth/refreshToken.d.ts +0 -0
  145. package/lib/supabase/registerCrudFunctions.d.ts +0 -0
  146. package/lib/supabase/utils/idempotency.d.ts +0 -0
  147. package/lib/supabase/utils/monitoring.d.ts +0 -0
  148. package/lib/supabase/utils/rateLimiter.d.ts +0 -0
  149. package/lib/vercel/api/ai/chat.d.ts +0 -0
  150. package/lib/vercel/api/ai/index.d.ts +0 -0
  151. package/lib/vercel/api/auth/get-custom-claims.d.ts +0 -0
  152. package/lib/vercel/api/auth/get-user-auth-status.d.ts +0 -0
  153. package/lib/vercel/api/auth/index.d.ts +0 -0
  154. package/lib/vercel/api/auth/remove-custom-claims.d.ts +0 -0
  155. package/lib/vercel/api/auth/set-custom-claims.d.ts +0 -0
  156. package/lib/vercel/api/billing/cancel.d.ts +0 -0
  157. package/lib/vercel/api/billing/change-plan.d.ts +0 -0
  158. package/lib/vercel/api/billing/create-checkout-session.d.ts +0 -0
  159. package/lib/vercel/api/billing/customer-portal.d.ts +0 -0
  160. package/lib/vercel/api/billing/index.d.ts +0 -0
  161. package/lib/vercel/api/billing/refresh-subscription-status.d.ts +0 -0
  162. package/lib/vercel/api/billing/webhook-handler.d.ts +0 -0
  163. package/lib/vercel/api/config/constants.d.ts +0 -0
  164. package/lib/vercel/api/config/firebase-admin.d.ts +0 -0
  165. package/lib/vercel/api/config/index.d.ts +0 -0
  166. package/lib/vercel/api/crud/create.d.ts +0 -0
  167. package/lib/vercel/api/crud/delete.d.ts +0 -0
  168. package/lib/vercel/api/crud/get.d.ts +0 -0
  169. package/lib/vercel/api/crud/index.d.ts +0 -0
  170. package/lib/vercel/api/crud/list.d.ts +0 -0
  171. package/lib/vercel/api/crud/update.d.ts +0 -0
  172. package/lib/vercel/api/index.d.ts +0 -0
  173. package/lib/vercel/api/index.js +1 -1
  174. package/lib/vercel/api/index.js.map +2 -2
  175. package/lib/vercel/api/oauth/check-github-access.d.ts +0 -0
  176. package/lib/vercel/api/oauth/exchange-token.d.ts +0 -0
  177. package/lib/vercel/api/oauth/grant-github-access.d.ts +0 -0
  178. package/lib/vercel/api/oauth/index.d.ts +0 -0
  179. package/lib/vercel/api/oauth/revoke-github-access.d.ts +0 -0
  180. package/lib/vercel/api/utils/cors.d.ts +0 -0
  181. package/lib/vercel/baseFunction.d.ts +0 -0
  182. package/package.json +2 -2
  183. package/src/firebase/baseFunction.ts +3 -2
  184. package/src/firebase/billing/cancelSubscription.ts +1 -1
  185. package/src/firebase/billing/changePlan.ts +1 -5
  186. package/src/firebase/billing/createCheckoutSession.ts +1 -5
  187. package/src/firebase/billing/createCustomerPortal.ts +1 -1
  188. package/src/firebase/billing/healthCheck.ts +1 -1
  189. package/src/firebase/billing/index.d.ts +0 -12
  190. package/src/firebase/billing/index.ts +0 -3
  191. package/src/firebase/billing/refreshSubscriptionStatus.ts +1 -1
  192. package/src/firebase/billing/webhookHandler.ts +2 -2
  193. package/src/firebase/index.ts +0 -1
  194. package/src/firebase/oauth/disconnect.ts +2 -2
  195. package/src/firebase/oauth/exchangeToken.ts +2 -2
  196. package/src/firebase/oauth/getConnections.ts +2 -2
  197. package/src/firebase/oauth/githubAccess.ts +4 -4
  198. package/src/firebase/oauth/refreshToken.ts +2 -2
  199. package/src/firebase/registerCrudFunctions.ts +0 -19
  200. package/src/shared/__tests__/idempotency.test.ts +0 -32
  201. package/src/shared/__tests__/internalValidation.test.ts +1 -40
  202. package/src/shared/__tests__/logger.test.ts +31 -0
  203. package/src/shared/__tests__/utils.test.ts +1 -26
  204. package/src/shared/billing/__tests__/createCheckout.compat.test.ts +4 -110
  205. package/src/shared/billing/__tests__/webhookHandler.test.ts +1 -38
  206. package/src/shared/billing/checkoutPrice.ts +7 -42
  207. package/src/shared/billing/createCheckout.ts +3 -19
  208. package/src/shared/billing/firestoreIdempotency.ts +170 -0
  209. package/src/shared/billing/helpers/subscriptionManagement.ts +1 -1
  210. package/src/shared/billing/idempotency.ts +8 -225
  211. package/src/shared/billing/idempotencyContract.ts +0 -21
  212. package/src/shared/billing/stripeClient.ts +91 -0
  213. package/src/shared/billing/webhookHandler.ts +5 -5
  214. package/src/shared/logger.ts +4 -6
  215. package/src/shared/utils/internal/auth.ts +1 -6
  216. package/src/shared/utils/internal/validation.ts +0 -18
  217. package/src/shared/utils.ts +0 -208
  218. package/src/supabase/billing/cancelSubscription.ts +1 -1
  219. package/src/supabase/billing/changePlan.ts +1 -1
  220. package/src/supabase/billing/createCheckoutSession.ts +1 -5
  221. package/src/supabase/billing/createCustomerPortal.ts +1 -1
  222. package/src/supabase/billing/refreshSubscriptionStatus.ts +1 -5
  223. package/src/supabase/billing/stripeWebhook.ts +2 -2
  224. package/src/supabase/crud/list.ts +2 -0
  225. package/src/supabase/index.ts +3 -3
  226. package/src/vercel/api/billing/change-plan.ts +1 -1
  227. package/src/vercel/api/billing/create-checkout-session.ts +1 -5
  228. package/src/vercel/api/billing/customer-portal.ts +1 -1
  229. package/src/vercel/api/billing/refresh-subscription-status.ts +1 -1
  230. package/src/vercel/api/billing/webhook-handler.ts +1 -1
  231. package/lib/chunks/chunk-2JL3GDTO.js +0 -151
  232. package/lib/chunks/chunk-2JL3GDTO.js.map +0 -7
  233. package/lib/chunks/chunk-4TVLH2W2.js +0 -22
  234. package/lib/chunks/chunk-5DTPEM64.js +0 -22
  235. package/lib/chunks/chunk-6CQXHNVL.js +0 -22
  236. package/lib/chunks/chunk-6CQXHNVL.js.map +0 -7
  237. package/lib/chunks/chunk-6DSCPZC6.js +0 -22
  238. package/lib/chunks/chunk-6DSCPZC6.js.map +0 -7
  239. package/lib/chunks/chunk-7E6TGWHU.js +0 -22
  240. package/lib/chunks/chunk-7E6TGWHU.js.map +0 -7
  241. package/lib/chunks/chunk-7LT32OWE.js +0 -22
  242. package/lib/chunks/chunk-7VH2GJXT.js +0 -151
  243. package/lib/chunks/chunk-7VH2GJXT.js.map +0 -7
  244. package/lib/chunks/chunk-API5A4BV.js +0 -22
  245. package/lib/chunks/chunk-API5A4BV.js.map +0 -7
  246. package/lib/chunks/chunk-BUP7SXPV.js +0 -23
  247. package/lib/chunks/chunk-BUP7SXPV.js.map +0 -7
  248. package/lib/chunks/chunk-BXKRI3JJ.js +0 -22
  249. package/lib/chunks/chunk-BXKRI3JJ.js.map +0 -7
  250. package/lib/chunks/chunk-FSLGZD7A.js +0 -21
  251. package/lib/chunks/chunk-GVLSPWDD.js +0 -151
  252. package/lib/chunks/chunk-GVLSPWDD.js.map +0 -7
  253. package/lib/chunks/chunk-GXQVWEFT.js +0 -22
  254. package/lib/chunks/chunk-GXQVWEFT.js.map +0 -7
  255. package/lib/chunks/chunk-HB7EGXVI.js +0 -22
  256. package/lib/chunks/chunk-HB7EGXVI.js.map +0 -7
  257. package/lib/chunks/chunk-HM7XCMWW.js +0 -22
  258. package/lib/chunks/chunk-HM7XCMWW.js.map +0 -7
  259. package/lib/chunks/chunk-I7IOIL6U.js +0 -151
  260. package/lib/chunks/chunk-I7IOIL6U.js.map +0 -7
  261. package/lib/chunks/chunk-IFOYVSPU.js.map +0 -7
  262. package/lib/chunks/chunk-JTAGPPPL.js.map +0 -7
  263. package/lib/chunks/chunk-MZ232FUE.js +0 -22
  264. package/lib/chunks/chunk-MZ232FUE.js.map +0 -7
  265. package/lib/chunks/chunk-NE5ZTUUZ.js +0 -22
  266. package/lib/chunks/chunk-NE5ZTUUZ.js.map +0 -7
  267. package/lib/chunks/chunk-NP2AN2TV.js +0 -22
  268. package/lib/chunks/chunk-NP2AN2TV.js.map +0 -7
  269. package/lib/chunks/chunk-RM7DV6IQ.js +0 -23
  270. package/lib/chunks/chunk-RQZGIZHD.js +0 -151
  271. package/lib/chunks/chunk-RQZGIZHD.js.map +0 -7
  272. package/lib/chunks/chunk-TBEDQLOB.js +0 -23
  273. package/lib/chunks/chunk-TBEDQLOB.js.map +0 -7
  274. package/lib/chunks/chunk-TMHBP3HB.js +0 -22
  275. package/lib/chunks/chunk-TMHBP3HB.js.map +0 -7
  276. package/lib/chunks/chunk-UH4L3EF3.js +0 -151
  277. package/lib/chunks/chunk-UH4L3EF3.js.map +0 -7
  278. package/lib/chunks/chunk-UJBIU6TL.js +0 -22
  279. package/lib/chunks/chunk-UJBIU6TL.js.map +0 -7
  280. package/lib/chunks/chunk-VKEYW3NT.js +0 -22
  281. package/lib/chunks/chunk-VKEYW3NT.js.map +0 -7
  282. package/lib/chunks/chunk-XGXBMXJ6.js +0 -22
  283. package/lib/chunks/chunk-XGXBMXJ6.js.map +0 -7
  284. package/lib/chunks/chunk-Y44NEQQG.js +0 -22
  285. package/lib/chunks/chunk-Y44NEQQG.js.map +0 -7
  286. package/lib/chunks/chunk-ZVU3KPXI.js +0 -22
  287. package/lib/chunks/chunk-ZVU3KPXI.js.map +0 -7
  288. package/lib/chunks/monitoring-PVQMFL34.js +0 -22
  289. package/lib/chunks/monitoring-V7FZXTTW.js +0 -22
  290. package/lib/chunks/monitoring-V7FZXTTW.js.map +0 -7
  291. package/lib/chunks/rateLimiter-6KO7AIZP.js.map +0 -7
  292. package/lib/chunks/rateLimiter-OXVBFW5C.js +0 -22
  293. package/lib/chunks/rateLimiter-OXVBFW5C.js.map +0 -7
  294. package/lib/chunks/rateLimiter-U45OMTWR.js +0 -22
  295. package/lib/chunks/rateLimiter-U45OMTWR.js.map +0 -7
  296. package/lib/chunks/server-32A5RH4C.js +0 -22
  297. package/lib/chunks/server-32A5RH4C.js.map +0 -7
  298. package/lib/chunks/server-7HDAP5DL.js +0 -22
  299. package/lib/chunks/server-7HDAP5DL.js.map +0 -7
  300. package/lib/chunks/server-S2IMFOY7.js +0 -22
  301. package/lib/chunks/server-S2IMFOY7.js.map +0 -7
  302. package/lib/shared/ai/createAIHandler.d.ts +0 -39
  303. package/lib/shared/ai/providers/anthropic.d.ts +0 -12
  304. package/lib/shared/ai/providers/google.d.ts +0 -10
  305. package/lib/shared/ai/providers/index.d.ts +0 -23
  306. package/lib/shared/ai/providers/openai.d.ts +0 -10
  307. package/lib/shared/ai/utils/parseSSE.d.ts +0 -22
  308. /package/lib/chunks/{chunk-4TVLH2W2.js.map → chunk-2A4FPYNB.js.map} +0 -0
  309. /package/lib/chunks/{chunk-4U7QQWYG.js.map → chunk-M4JV2JCF.js.map} +0 -0
  310. /package/lib/chunks/{chunk-7LT32OWE.js.map → chunk-PJCJ5H2O.js.map} +0 -0
  311. /package/lib/chunks/{chunk-FSLGZD7A.js.map → monitoring-UIDJS2KA.js.map} +0 -0
  312. /package/lib/chunks/{monitoring-AGCSU3FI.js.map → rateLimiter-WNWHI3B4.js.map} +0 -0
  313. /package/lib/chunks/{monitoring-PVQMFL34.js.map → server-RYGEBS2B.js.map} +0 -0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -32,9 +32,4 @@ export type CrudFunctions = Record<string, HttpsFunction>;
32
32
  * ```
33
33
  */
34
34
  export declare function createCrudFunctions(entities: Record<string, Entity | unknown>, options?: RegisterOptions): CrudFunctions;
35
- /**
36
- * @deprecated Use createCrudFunctions() for ESM. This mutates target which doesn't work in ESM.
37
- * Auto-register CRUD functions for all entities (CJS pattern)
38
- */
39
- export declare function registerCrudFunctions(entities: Record<string, Entity | unknown>, target?: Record<string, any>, options?: RegisterOptions): CrudFunctions;
40
35
  export {};
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -11,16 +11,13 @@ import type Stripe from 'stripe';
11
11
  import type { CheckoutMode, CheckoutSessionParams, CreateCheckoutSessionRequest, StripePaymentBackItem, StripeSubscriptionBackItem } from '@donotdev/core/server';
12
12
  /** Price resolved for a single-price item (0.1.x rules). */
13
13
  export interface PricePlan {
14
- /** Fixed price charged; undefined for dynamic pricing */
15
- priceId?: string;
16
- /** 0.1.x dynamic pricing (client unitAmount + productName) */
17
- dynamic: boolean;
14
+ /** Price charged */
15
+ priceId: string;
18
16
  mode: CheckoutMode;
19
17
  }
20
18
  /**
21
19
  * 0.1.x pricing for StripePayment/StripeSubscription: a request priceId (must
22
- * match the config priceId when set), else 0.1.x dynamic pricing capped by
23
- * `maxUnitAmount`, else the back-config priceId.
20
+ * match the config priceId when set), else the back-config priceId.
24
21
  */
25
22
  export declare function resolvePricePlan(item: StripePaymentBackItem | StripeSubscriptionBackItem, request: CreateCheckoutSessionRequest): PricePlan;
26
23
  /** 0.1.x params → Stripe params (what the 0.1.x Firebase/Supabase providers sent). */
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Create Checkout Session Algorithm
3
3
  * @description Platform-agnostic algorithm for creating Stripe checkout sessions.
4
4
  * StripePayment/StripeSubscription items keep the 0.1.x behaviour (request or
5
- * back-config priceId, 0.1.x dynamic pricing). StripeOrder items are priced on
5
+ * back-config priceId). StripeOrder items are priced on
6
6
  * the server (`resolveLineItems`) and need a {@link StripeSessionProvider}.
7
7
  *
8
8
  * @version 0.2.0
@@ -64,8 +64,8 @@ export interface AuthCheckoutProvider {
64
64
  * Create checkout session algorithm
65
65
  *
66
66
  * 1. Resolve the billing config item and verify the user
67
- * 2. Single-price items: 0.1.x pricing (request/back-config priceId, dynamic pricing)
68
- * 3. `beforeCheckout` hook (block/allow; 0.1.x dynamic-pricing overrides)
67
+ * 2. Single-price items: 0.1.x pricing (request/back-config priceId)
68
+ * 3. `beforeCheckout` hook (block/allow)
69
69
  * 4. StripeOrder: reject inclusive manual Tax Rates, `resolveLineItems` prices every line
70
70
  * and may set per-order session options (`ResolvedOrder.session`: tax rates,
71
71
  * payment methods, expiry, invoice footer)
@@ -0,0 +1,13 @@
1
+ import type { IdempotencyStore } from './idempotencyContract.js';
2
+ /**
3
+ * Firestore-backed store (transactions). Collection: `webhook_idempotency`.
4
+ *
5
+ * `expiresAt` is a Firestore Timestamp {@link WEBHOOK_EVENT_RETENTION_MS} after
6
+ * the last write: enable a TTL policy on `webhook_idempotency.expiresAt` so
7
+ * Firestore deletes old documents.
8
+ *
9
+ * @version 0.2.0
10
+ * @since 0.2.0
11
+ * @author AMBROISE PARK Consulting
12
+ */
13
+ export declare function createFirestoreIdempotencyStore(): IdempotencyStore;
File without changes
@@ -1,6 +1,7 @@
1
- import type { LegacyIdempotencyStore } from './idempotencyContract.js';
1
+ import type { IdempotencyStore } from './idempotencyContract.js';
2
2
  export { RESERVATION_LEASE_MS, ReservationLostError, WEBHOOK_EVENT_RETENTION_MS, } from './idempotencyContract.js';
3
- export type { IdempotencyStore, LegacyIdempotencyStore, ReservationResult, } from './idempotencyContract.js';
3
+ export type { IdempotencyStore, ReservationResult, } from './idempotencyContract.js';
4
+ export { createFirestoreIdempotencyStore } from './firestoreIdempotency.js';
4
5
  /**
5
6
  * In-memory store. Single process only: for tests, never for a deployed webhook.
6
7
  *
@@ -8,37 +9,5 @@ export type { IdempotencyStore, LegacyIdempotencyStore, ReservationResult, } fro
8
9
  * @since 0.2.0
9
10
  * @author AMBROISE PARK Consulting
10
11
  */
11
- export declare function createInMemoryIdempotencyStore(): LegacyIdempotencyStore;
12
- /**
13
- * Firestore-backed store (transactions). Collection: `webhook_idempotency`.
14
- *
15
- * `expiresAt` is a Firestore Timestamp {@link WEBHOOK_EVENT_RETENTION_MS} after
16
- * the last write: enable a TTL policy on `webhook_idempotency.expiresAt` so
17
- * Firestore deletes old documents.
18
- *
19
- * @version 0.2.0
20
- * @since 0.2.0
21
- * @author AMBROISE PARK Consulting
22
- */
23
- export declare function createFirestoreIdempotencyStore(): LegacyIdempotencyStore;
24
- /**
25
- * 0.1.x store auto-detection: Firestore when configured, else in-memory.
26
- *
27
- * @deprecated In-memory is not durable across instances. Pass an explicit store:
28
- * {@link createFirestoreIdempotencyStore} or `createSupabaseIdempotencyStore`.
29
- * Framework webhook entry points already do.
30
- * @version 0.2.0
31
- * @since 0.0.1
32
- * @author AMBROISE PARK Consulting
33
- */
34
- export declare function createIdempotencyStore(): LegacyIdempotencyStore;
35
- /**
36
- * Reset the store cached by {@link createIdempotencyStore} (tests).
37
- *
38
- * @deprecated See {@link createIdempotencyStore}.
39
- * @version 0.1.0
40
- * @since 0.0.1
41
- * @author AMBROISE PARK Consulting
42
- */
43
- export declare function resetIdempotencyStore(): void;
12
+ export declare function createInMemoryIdempotencyStore(): IdempotencyStore;
44
13
  export { WEBHOOK_EVENTS_SQL, createSupabaseIdempotencyStore, } from './supabaseIdempotency.js';
@@ -48,26 +48,6 @@ export interface IdempotencyStore {
48
48
  */
49
49
  release(eventId: string, ownerToken: string): Promise<boolean>;
50
50
  }
51
- /**
52
- * Store with the 0.1.x accessors.
53
- *
54
- * @deprecated Use {@link IdempotencyStore}: `reserve` returns three states and
55
- * an owner token; `checkAndReserve` and `isProcessed` do not.
56
- * @version 0.2.0
57
- * @since 0.2.0
58
- * @author AMBROISE PARK Consulting
59
- */
60
- export interface LegacyIdempotencyStore extends IdempotencyStore {
61
- /** 0.1.x: `true` when the event must be skipped (processed or live lease). */
62
- checkAndReserve(eventId: string): Promise<boolean>;
63
- /** Whether the event was processed (non-atomic read). */
64
- isProcessed(eventId: string): Promise<boolean>;
65
- /**
66
- * Mark processed. Without `ownerToken` (0.1.x call) the write is unconditional.
67
- * @throws {ReservationLostError} When `ownerToken` is given and no longer owns the event
68
- */
69
- markProcessed(eventId: string, ownerToken?: string): Promise<void>;
70
- }
71
51
  /**
72
52
  * Thrown by `markProcessed` when the caller no longer owns the reservation:
73
53
  * its lease expired and another delivery retook the event, or the row is gone.
File without changes
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @fileoverview Stripe client for billing functions
3
+ * @description Lazily initialized Stripe SDK instance shared by the Firebase,
4
+ * Vercel and Supabase billing handlers. Kept apart from `shared/utils.ts` so
5
+ * code that does not bill (CRUD, auth) never loads the Stripe SDK.
6
+ *
7
+ * @version 0.2.1
8
+ * @since 0.0.1
9
+ * @author AMBROISE PARK Consulting
10
+ */
11
+ import Stripe from 'stripe';
12
+ /**
13
+ * Initialize Stripe explicitly (e.g. with a secret from defineSecret).
14
+ * API version: `STRIPE_API_VERSION`, else {@link STRIPE_API_VERSION_PIN}.
15
+ * @param apiKey - Stripe secret key
16
+ *
17
+ * @version 0.2.0
18
+ * @since 0.0.1
19
+ * @author AMBROISE PARK Consulting
20
+ */
21
+ export declare function initStripe(apiKey: string): Stripe;
22
+ /**
23
+ * Get Stripe instance with lazy initialization
24
+ *
25
+ * @version 0.1.0
26
+ * @since 0.0.1
27
+ * @author AMBROISE PARK Consulting
28
+ */
29
+ export declare function getStripe(): Stripe;
30
+ /**
31
+ * Lazy-initialized Stripe instance proxy
32
+ *
33
+ * @version 0.1.0
34
+ * @since 0.0.1
35
+ * @author AMBROISE PARK Consulting
36
+ */
37
+ export declare const stripe: Stripe;
38
+ /**
39
+ * Validates that required Stripe environment variables are set
40
+ *
41
+ * @version 0.1.0
42
+ * @since 0.0.1
43
+ * @author AMBROISE PARK Consulting
44
+ */
45
+ export declare function validateStripeEnvironment(): void;
@@ -31,15 +31,16 @@ import type { IdempotencyStore } from './idempotencyContract.js';
31
31
  * @param billingConfig - Billing configuration
32
32
  * @param updateSubscription - Function to update user subscription
33
33
  * @param authProvider - Auth provider for subscription claims (null: subscription events fail)
34
- * @param idempotencyStore - Durable store matching the backend (Firestore / Supabase).
35
- * Omitted: deprecated 0.1.x auto-detection ({@link createIdempotencyStore}).
34
+ * @param idempotencyStore - Durable store matching the backend
35
+ * (`createFirestoreIdempotencyStore` / `createSupabaseIdempotencyStore`). Required:
36
+ * shared logic never picks a backend.
36
37
  * @throws Any failure: the caller must answer non-2xx so Stripe retries
37
38
  *
38
- * @version 0.2.0
39
+ * @version 0.2.1
39
40
  * @since 0.0.1
40
41
  * @author AMBROISE PARK Consulting
41
42
  */
42
- export declare function processWebhook(rawBody: string | Buffer, signature: string, webhookSecret: string, stripe: Stripe, billingConfig: StripeBackConfig, updateSubscription: UpdateSubscriptionFn, authProvider: BillingAuthProvider | null, idempotencyStore?: IdempotencyStore): Promise<{
43
+ export declare function processWebhook(rawBody: string | Buffer, signature: string, webhookSecret: string, stripe: Stripe, billingConfig: StripeBackConfig, updateSubscription: UpdateSubscriptionFn, authProvider: BillingAuthProvider | null, idempotencyStore: IdempotencyStore): Promise<{
43
44
  success: boolean;
44
45
  message: string;
45
46
  }>;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -18,5 +18,5 @@ if (typeof globalThis !== 'undefined') {
18
18
  globalThis.global = globalThis;
19
19
  }
20
20
  }
21
- import{A as E,B as F,C as G,D as O,E as P,F as Q,G as aa,H as ba,I as ca,J as da,K as Ea,L as Fa,M as Ga,N as Ha,O as Ia,P as Ja,Q as Ka,a as c,b as d,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as p,m as q,n as r,o as s,p as t,q as u,r as v,s as w,t as x,u as y,v as z,w as A,x as B,y as C,z as D}from"../chunks/chunk-GXQVWEFT.js";import"../chunks/chunk-FSLGZD7A.js";import{a as e,b as f,c as ea,d as Ca,e as Da}from"../chunks/chunk-BXKRI3JJ.js";import{A as ta,B as ua,C as va,D as wa,E as xa,F as ya,G as za,H as Aa,I as Ba,a as b,b as H,c as I,d as J,e as K,f as L,g as M,h as N,i as fa,j as ga,k as ha,l as ia,m as ja,p as ka,q as la,r as ma,s as na,t as oa,u as pa,v as qa,w as ra,z as sa}from"../chunks/chunk-UH4L3EF3.js";import"../chunks/chunk-BUP7SXPV.js";import{L as a}from"../chunks/chunk-5DTPEM64.js";import{a as R,b as S,c as T,d as U,e as V}from"../chunks/chunk-JTAGPPPL.js";import{a as W,b as X,c as Y,d as Z,e as _,f as $}from"../chunks/chunk-7LT32OWE.js";import"../chunks/chunk-NP2AN2TV.js";import"../chunks/chunk-AYY7UXNI.js";export{H as AuthBackendSchema,$ as DEFAULT_RATE_LIMITS,a as DoNotDevError,c as GitHubApiService,ka as MIN_ORDER_API_VERSION,la as ORDER_ID_METADATA_KEY,ma as PRODUCT_ID_METADATA_KEY,ta as RESERVATION_LEASE_MS,sa as ReservationLostError,j as StripeValidationSchemas,va as WEBHOOK_EVENTS_SQL,ua as WEBHOOK_EVENT_RETENTION_MS,K as assertAdmin,J as assertAuthenticated,fa as calculateCost,C as calculateSubscriptionEndDate,F as cancelUserSubscription,P as checkIdempotency,S as checkPaymentFailureRate,T as checkPaymentVolume,W as checkRateLimit,X as checkRateLimitWithFirestore,ia as classifyAIError,V as cleanupOldMetrics,qa as createCheckoutAlgorithm,x as createFirebaseCallable,v as createFirebaseFunction,y as createFirebaseFunctionExports,ya as createFirestoreIdempotencyStore,d as createGitHubApiService,za as createIdempotencyStore,xa as createInMemoryIdempotencyStore,e as createMetadata,Da as createResendProvider,wa as createSupabaseIdempotencyStore,Ga as createTimestamp,A as createVercelApiHandler,w as createVercelFunction,z as createVercelHandler,Ea as exchangeTokenAlgorithm,ea as executeBulk,i as filterVisibleFields,D as findReferences,U as getPaymentMetricsSummary,_ as getRateLimitStatus,E as getTierFromPriceId,G as getUserSubscription,h as getVisibleFields,Fa as grantAccessAlgorithm,ga as handleAIRequest,Ca as handleEmailRequest,b as handleError,pa as handleOrderSessionEvent,O as initializeFirebaseAdmin,g as isFieldVisible,Ia as isTimestamp,oa as listPaidLineItems,ja as mapClassifiedToHTTP,I as parseAuthBackend,Ka as prepareForFirestore,Ba as processWebhook,R as recordPaymentMetrics,Aa as resetIdempotencyStore,Y as resetRateLimit,Z as resetRateLimitInFirestore,ha as resolveModelForTier,ba as safeJsonParse,Q as storeIdempotencyResult,na as toCheckoutSessionSnapshot,B as toISOString,Ha as toTimestamp,Ja as transformFirestoreData,f as updateMetadata,ra as updateUserSubscription,ca as validateCollectionName,da as validateDocument,n as validateEmail,m as validateGitHubUsername,r as validateMetadata,l as validatePurchaseRequest,s as validateRequestData,aa as validateStripeEnvironment,o as validateStripePriceId,p as validateStripeSessionId,q as validateUrl,k as validateWebhookEvent,M as verifyAuthToken,N as verifyFirebaseAuthToken,L as verifyToken,t as withSchemaValidation,u as withVercelSchemaValidation};
21
+ import{A as E,B as F,C as G,D as N,E as O,F as P,G as $,H as aa,I as ba,J as Aa,K as Ba,L as Ca,M as Da,N as Ea,O as Fa,P as Ga,a as c,b as d,c as g,d as h,e as i,f as j,g as k,h as l,i as m,j as n,k as o,l as p,m as q,n as r,o as s,p as t,q as u,r as v,s as w,t as x,u as y,v as z,w as A,x as B,y as C,z as D}from"../chunks/chunk-LSM5Y2E5.js";import{a as H,b as I,c as J,d as K,e as L,f as M,g as ua,h as xa}from"../chunks/chunk-OZX5ZG44.js";import{a as e,b as f,c as ca,d as ya,e as za}from"../chunks/chunk-M4JV2JCF.js";import{a as b,b as da,c as ea,d as fa,e as ga,f as ha,i as ia,j as ja,k as ka,l as la,m as ma,n as na,o as oa,p as pa,q as qa,r as ra,s as sa,u as ta,v as va,w as wa}from"../chunks/chunk-UYI56E6Q.js";import"../chunks/chunk-2IFFIUFV.js";import{L as a}from"../chunks/chunk-G4FO76EA.js";import{a as Q,b as R,c as S,d as T,e as U}from"../chunks/chunk-2A4FPYNB.js";import{a as V,b as W,c as X,d as Y,e as Z,f as _}from"../chunks/chunk-PJCJ5H2O.js";import"../chunks/chunk-PWAGW4R6.js";import"../chunks/chunk-AYY7UXNI.js";export{H as AuthBackendSchema,_ as DEFAULT_RATE_LIMITS,a as DoNotDevError,c as GitHubApiService,ia as MIN_ORDER_API_VERSION,ja as ORDER_ID_METADATA_KEY,ka as PRODUCT_ID_METADATA_KEY,ra as RESERVATION_LEASE_MS,qa as ReservationLostError,j as StripeValidationSchemas,va as WEBHOOK_EVENTS_SQL,sa as WEBHOOK_EVENT_RETENTION_MS,K as assertAdmin,J as assertAuthenticated,da as calculateCost,C as calculateSubscriptionEndDate,F as cancelUserSubscription,O as checkIdempotency,R as checkPaymentFailureRate,S as checkPaymentVolume,V as checkRateLimit,W as checkRateLimitWithFirestore,ga as classifyAIError,U as cleanupOldMetrics,oa as createCheckoutAlgorithm,x as createFirebaseCallable,v as createFirebaseFunction,y as createFirebaseFunctionExports,ua as createFirestoreIdempotencyStore,d as createGitHubApiService,xa as createInMemoryIdempotencyStore,e as createMetadata,za as createResendProvider,wa as createSupabaseIdempotencyStore,Ca as createTimestamp,A as createVercelApiHandler,w as createVercelFunction,z as createVercelHandler,Aa as exchangeTokenAlgorithm,ca as executeBulk,i as filterVisibleFields,D as findReferences,T as getPaymentMetricsSummary,Z as getRateLimitStatus,E as getTierFromPriceId,G as getUserSubscription,h as getVisibleFields,Ba as grantAccessAlgorithm,ea as handleAIRequest,ya as handleEmailRequest,b as handleError,na as handleOrderSessionEvent,N as initializeFirebaseAdmin,g as isFieldVisible,Ea as isTimestamp,ma as listPaidLineItems,ha as mapClassifiedToHTTP,I as parseAuthBackend,Ga as prepareForFirestore,ta as processWebhook,Q as recordPaymentMetrics,X as resetRateLimit,Y as resetRateLimitInFirestore,fa as resolveModelForTier,$ as safeJsonParse,P as storeIdempotencyResult,la as toCheckoutSessionSnapshot,B as toISOString,Da as toTimestamp,Fa as transformFirestoreData,f as updateMetadata,pa as updateUserSubscription,aa as validateCollectionName,ba as validateDocument,n as validateEmail,m as validateGitHubUsername,r as validateMetadata,l as validatePurchaseRequest,s as validateRequestData,o as validateStripePriceId,p as validateStripeSessionId,q as validateUrl,k as validateWebhookEvent,M as verifyAuthToken,L as verifyToken,t as withSchemaValidation,u as withVercelSchemaValidation};
22
22
  //# sourceMappingURL=index.js.map
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -45,7 +45,7 @@ export declare function parseAuthBackend(backend: unknown): AuthProvider;
45
45
  * @since 0.0.1
46
46
  * @author AMBROISE PARK Consulting
47
47
  */
48
- export declare function assertAuthenticated(uid: string): string;
48
+ export declare function assertAuthenticated(uid: string | undefined): string;
49
49
  /**
50
50
  * Validates that user has admin privileges.
51
51
  * Uses IServerAuthAdapter when configured, falls back to Firebase Admin SDK.
@@ -88,7 +88,3 @@ export declare function verifyToken(token: string, provider?: AuthProvider): Pro
88
88
  * @author AMBROISE PARK Consulting
89
89
  */
90
90
  export declare function verifyAuthToken(req: NextApiRequest, provider?: AuthProvider): Promise<string>;
91
- /**
92
- * @deprecated Use verifyAuthToken instead. Kept for backwards compatibility.
93
- */
94
- export declare const verifyFirebaseAuthToken: typeof verifyAuthToken;
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,11 +1,3 @@
1
- /**
2
- * Validates environment variables required for Stripe
3
- *
4
- * @version 0.1.0
5
- * @since 0.0.1
6
- * @author AMBROISE PARK Consulting
7
- */
8
- export declare function validateStripeEnvironment(): void;
9
1
  /**
10
2
  * Safely parses JSON with error handling
11
3
  *
File without changes
File without changes
File without changes
@@ -1,56 +1,6 @@
1
- /**
2
- * @fileoverview Shared utilities for Firebase and Vercel functions
3
- * @description Common utilities that can be used by both Firebase and Vercel function implementations
4
- *
5
- * @version 0.1.0
6
- * @since 0.0.1
7
- * @author AMBROISE PARK Consulting
8
- */
9
- import Stripe from 'stripe';
10
1
  import { DoNotDevError } from '@donotdev/core/server';
11
2
  import type { UserRole } from '@donotdev/core/server';
12
3
  export { DoNotDevError };
13
- /**
14
- * Initialize Stripe explicitly (e.g. with a secret from defineSecret).
15
- * API version: `STRIPE_API_VERSION`, else {@link STRIPE_API_VERSION_PIN}.
16
- * @param apiKey - Stripe secret key
17
- *
18
- * @version 0.2.0
19
- * @since 0.0.1
20
- * @author AMBROISE PARK Consulting
21
- */
22
- export declare function initStripe(apiKey: string): Stripe;
23
- /**
24
- * Get Stripe instance with lazy initialization
25
- *
26
- * @version 0.1.0
27
- * @since 0.0.1
28
- * @author AMBROISE PARK Consulting
29
- */
30
- export declare function getStripe(): Stripe;
31
- /**
32
- * Lazy-initialized Stripe instance proxy
33
- *
34
- * @version 0.1.0
35
- * @since 0.0.1
36
- * @author AMBROISE PARK Consulting
37
- */
38
- export declare const stripe: Stripe;
39
- /**
40
- * Assert that a user is authenticated from a Firebase callable auth context.
41
- *
42
- * @deprecated Import `assertAuthenticated` from `@donotdev/functions/shared/utils/internal/auth` instead.
43
- * This wrapper extracts uid from a Firebase callable auth context and delegates
44
- * to the canonical version.
45
- *
46
- * @param auth - Firebase callable request auth context (object with `.uid`)
47
- * @returns The authenticated user's uid
48
- *
49
- * @version 0.1.0
50
- * @since 0.0.1
51
- * @author AMBROISE PARK Consulting
52
- */
53
- export declare function assertAuthenticated(auth: any): string;
54
4
  /**
55
5
  * Get user role from Firebase auth context
56
6
  *
@@ -68,14 +18,6 @@ export declare function assertAuthenticated(auth: any): string;
68
18
  * @author AMBROISE PARK Consulting
69
19
  */
70
20
  export declare function getUserRole(auth: any): UserRole;
71
- /**
72
- * Validates that required Stripe environment variables are set
73
- *
74
- * @version 0.1.0
75
- * @since 0.0.1
76
- * @author AMBROISE PARK Consulting
77
- */
78
- export declare function validateStripeEnvironment(): void;
79
21
  /**
80
22
  * Creates a standardized success response
81
23
  *
@@ -102,74 +44,6 @@ export declare function createErrorResponse(error: unknown): {
102
44
  details?: any;
103
45
  };
104
46
  };
105
- /**
106
- * Updates user subscription in Firebase.
107
- *
108
- * **Architecture decision — throwing stubs for billing functions:**
109
- * These subscription functions (`updateUserSubscription`, `getUserSubscription`,
110
- * `cancelUserSubscription`, `handleSubscriptionCancellation`) are intentional
111
- * placeholder implementations. They exist so the framework compiles and
112
- * type-checks out of the box, but throw at runtime to surface missing
113
- * integration early. Consumer apps replace them with their billing provider
114
- * integration (Stripe, Paddle, LemonSqueezy, etc.) via the documented
115
- * `shared/billing/helpers/` modules.
116
- *
117
- * C10: This was a silent no-op stub. It now throws to surface the missing
118
- * implementation at startup rather than silently dropping webhook events.
119
- * Use `updateUserSubscription` from `shared/billing/helpers/updateUserSubscription.ts`
120
- * (which requires an authProvider) instead.
121
- *
122
- * @deprecated Import `updateUserSubscription` from `@donotdev/functions/shared/billing/helpers/updateUserSubscription`.
123
- * @version 0.1.0
124
- * @since 0.0.1
125
- * @author AMBROISE PARK Consulting
126
- */
127
- export declare function updateUserSubscription(_firebaseUid: string, _subscription: any): Promise<void>;
128
- /**
129
- * Gets user subscription from Firebase.
130
- *
131
- * C10: This was a silent no-op stub. Now throws to surface the missing implementation.
132
- *
133
- * @deprecated Import from `@donotdev/functions/shared/billing/helpers` or implement directly using Firebase Admin SDK / Stripe API.
134
- * @version 0.1.0
135
- * @since 0.0.1
136
- * @author AMBROISE PARK Consulting
137
- */
138
- export declare function getUserSubscription(_firebaseUid: string): Promise<any>;
139
- /**
140
- * Cancels user subscription.
141
- *
142
- * C10: This was a silent no-op stub. Now throws to surface the missing implementation.
143
- *
144
- * @deprecated Import `cancelUserSubscription` from `@donotdev/functions/shared/billing/helpers/subscriptionManagement`.
145
- * @version 0.1.0
146
- * @since 0.0.1
147
- * @author AMBROISE PARK Consulting
148
- */
149
- export declare function cancelUserSubscription(_firebaseUid: string, _subscription: any): Promise<void>;
150
- /**
151
- * Handles subscription cancellation.
152
- *
153
- * C10: This was a silent no-op stub. Now throws to surface the missing implementation.
154
- *
155
- * @deprecated Handle via Stripe webhook events. Use `processWebhook` from `@donotdev/functions/shared/billing/webhookHandler`.
156
- * @version 0.1.0
157
- * @since 0.0.1
158
- * @author AMBROISE PARK Consulting
159
- */
160
- export declare function handleSubscriptionCancellation(_firebaseUid: string, _subscription: any): Promise<void>;
161
- /**
162
- * Asserts that a user has admin privileges
163
- * Uses role hierarchy: super > admin > user > guest
164
- *
165
- * @deprecated Import `assertAdmin` from `@donotdev/functions/shared/utils/internal/auth` instead.
166
- * This is a thin wrapper that delegates to the canonical provider-agnostic version.
167
- *
168
- * @version 0.1.0
169
- * @since 0.0.1
170
- * @author AMBROISE PARK Consulting
171
- */
172
- export declare function assertAdmin(uid: string): Promise<string>;
173
47
  /**
174
48
  * Validates document data
175
49
  *
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,11 +1,3 @@
1
- /**
2
- * @fileoverview Generic handler to list entities from Supabase with pagination, filtering, and sorting.
3
- * @description Provides a reusable implementation for listing documents from PostgreSQL with advanced query capabilities.
4
- *
5
- * @version 0.1.0
6
- * @since 0.5.0
7
- * @author AMBROISE PARK Consulting
8
- */
9
1
  import * as v from 'valibot';
10
2
  import type { EntityOwnershipConfig, UserRole } from '@donotdev/core/server';
11
3
  /** Request payload for listing entities with filtering, sorting, and pagination. */
File without changes
File without changes
File without changes
File without changes
@@ -19,8 +19,9 @@ export { createRemoveCustomClaims } from './auth/removeCustomClaims.js';
19
19
  export { createGetUserAuthStatus } from './auth/getUserAuthStatus.js';
20
20
  export { createCheckoutSession } from './billing/createCheckoutSession.js';
21
21
  export { createStripeWebhook } from './billing/stripeWebhook.js';
22
- export { createSupabaseIdempotencyStore, ReservationLostError, WEBHOOK_EVENTS_SQL, } from '../shared/billing/idempotency.js';
23
- export type { IdempotencyStore, ReservationResult, } from '../shared/billing/idempotency.js';
22
+ export { createSupabaseIdempotencyStore, WEBHOOK_EVENTS_SQL, } from '../shared/billing/supabaseIdempotency.js';
23
+ export { ReservationLostError } from '../shared/billing/idempotencyContract.js';
24
+ export type { IdempotencyStore, ReservationResult, } from '../shared/billing/idempotencyContract.js';
24
25
  export { createCheckoutAlgorithm } from '../shared/billing/createCheckout.js';
25
26
  export type { StripeSessionProvider } from '../shared/billing/createCheckout.js';
26
27
  export { STRIPE_API_VERSION_PIN } from '../shared/billing/apiVersion.js';