@eventmodelers/node-kit 0.0.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 (546) hide show
  1. package/README.md +66 -0
  2. package/package.json +36 -0
  3. package/src/cli.js +176 -0
  4. package/templates/.claude/skills/connect/SKILL.md +169 -0
  5. package/templates/.claude/skills/load-slice/SKILL.md +86 -0
  6. package/templates/realtime-agent/node_modules/.package-lock.json +107 -0
  7. package/templates/realtime-agent/node_modules/@supabase/auth-js/LICENSE +21 -0
  8. package/templates/realtime-agent/node_modules/@supabase/auth-js/README.md +190 -0
  9. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts +4 -0
  10. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts.map +1 -0
  11. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js +7 -0
  12. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js.map +1 -0
  13. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts +4 -0
  14. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts.map +1 -0
  15. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js +7 -0
  16. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js.map +1 -0
  17. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts +716 -0
  18. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  19. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js +1108 -0
  20. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js.map +1 -0
  21. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts +2473 -0
  22. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts.map +1 -0
  23. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js +5217 -0
  24. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js.map +1 -0
  25. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts +9 -0
  26. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts.map +1 -0
  27. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js +20 -0
  28. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js.map +1 -0
  29. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts +76 -0
  30. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts.map +1 -0
  31. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js +269 -0
  32. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js.map +1 -0
  33. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts +26 -0
  34. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts.map +1 -0
  35. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js +31 -0
  36. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js.map +1 -0
  37. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts +7 -0
  38. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts.map +1 -0
  39. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js +3 -0
  40. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js.map +1 -0
  41. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts +258 -0
  42. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts.map +1 -0
  43. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js +290 -0
  44. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js.map +1 -0
  45. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts +54 -0
  46. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts.map +1 -0
  47. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js +200 -0
  48. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js.map +1 -0
  49. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts +94 -0
  50. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts.map +1 -0
  51. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js +406 -0
  52. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js.map +1 -0
  53. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts +9 -0
  54. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts.map +1 -0
  55. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js +21 -0
  56. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js.map +1 -0
  57. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts +107 -0
  58. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts.map +1 -0
  59. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js +349 -0
  60. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js.map +1 -0
  61. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts +5 -0
  62. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts.map +1 -0
  63. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js +29 -0
  64. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js.map +1 -0
  65. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts +2498 -0
  66. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts.map +1 -0
  67. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js +23 -0
  68. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js.map +1 -0
  69. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts +2 -0
  70. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts.map +1 -0
  71. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js +11 -0
  72. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js.map +1 -0
  73. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts +96 -0
  74. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts.map +1 -0
  75. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js +66 -0
  76. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js.map +1 -0
  77. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts +160 -0
  78. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts.map +1 -0
  79. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js +4 -0
  80. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js.map +1 -0
  81. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts +284 -0
  82. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts.map +1 -0
  83. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts +583 -0
  84. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts.map +1 -0
  85. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js +4 -0
  86. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js.map +1 -0
  87. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts +85 -0
  88. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts.map +1 -0
  89. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js +272 -0
  90. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js.map +1 -0
  91. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js +707 -0
  92. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js.map +1 -0
  93. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts +4 -0
  94. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts.map +1 -0
  95. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js +4 -0
  96. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js.map +1 -0
  97. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts +4 -0
  98. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts.map +1 -0
  99. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js +4 -0
  100. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js.map +1 -0
  101. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts +716 -0
  102. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  103. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js +1105 -0
  104. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js.map +1 -0
  105. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts +2473 -0
  106. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts.map +1 -0
  107. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js +5214 -0
  108. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js.map +1 -0
  109. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts +9 -0
  110. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts.map +1 -0
  111. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js +9 -0
  112. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js.map +1 -0
  113. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts +76 -0
  114. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts.map +1 -0
  115. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js +257 -0
  116. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js.map +1 -0
  117. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts +26 -0
  118. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts.map +1 -0
  119. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js +28 -0
  120. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js.map +1 -0
  121. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts +7 -0
  122. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts.map +1 -0
  123. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js +2 -0
  124. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js.map +1 -0
  125. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts +258 -0
  126. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts.map +1 -0
  127. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js +267 -0
  128. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js.map +1 -0
  129. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts +54 -0
  130. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts.map +1 -0
  131. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js +190 -0
  132. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js.map +1 -0
  133. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts +94 -0
  134. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts.map +1 -0
  135. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js +378 -0
  136. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js.map +1 -0
  137. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts +9 -0
  138. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts.map +1 -0
  139. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js +18 -0
  140. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js.map +1 -0
  141. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts +107 -0
  142. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts.map +1 -0
  143. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js +341 -0
  144. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js.map +1 -0
  145. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts +5 -0
  146. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts.map +1 -0
  147. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js +26 -0
  148. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js.map +1 -0
  149. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts +2498 -0
  150. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts.map +1 -0
  151. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js +20 -0
  152. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js.map +1 -0
  153. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts +2 -0
  154. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts.map +1 -0
  155. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js +8 -0
  156. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js.map +1 -0
  157. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts +96 -0
  158. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts.map +1 -0
  159. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js +60 -0
  160. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js.map +1 -0
  161. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts +160 -0
  162. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts.map +1 -0
  163. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js +3 -0
  164. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js.map +1 -0
  165. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts +284 -0
  166. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts.map +1 -0
  167. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts +583 -0
  168. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts.map +1 -0
  169. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js +3 -0
  170. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js.map +1 -0
  171. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts +85 -0
  172. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts.map +1 -0
  173. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js +264 -0
  174. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js.map +1 -0
  175. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js +689 -0
  176. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js.map +1 -0
  177. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.module.tsbuildinfo +1 -0
  178. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.tsbuildinfo +1 -0
  179. package/templates/realtime-agent/node_modules/@supabase/auth-js/package.json +44 -0
  180. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthAdminApi.ts +5 -0
  181. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthClient.ts +5 -0
  182. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueAdminApi.ts +1267 -0
  183. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueClient.ts +6360 -0
  184. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/index.ts +13 -0
  185. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/base64url.ts +308 -0
  186. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/constants.ts +34 -0
  187. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/error-codes.ts +90 -0
  188. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/errors.ts +359 -0
  189. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/fetch.ts +320 -0
  190. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/helpers.ts +476 -0
  191. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/local-storage.ts +21 -0
  192. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/locks.ts +420 -0
  193. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/polyfills.ts +23 -0
  194. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/types.ts +2917 -0
  195. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/version.ts +7 -0
  196. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/ethereum.ts +184 -0
  197. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/solana.ts +186 -0
  198. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.dom.ts +636 -0
  199. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.errors.ts +329 -0
  200. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.ts +946 -0
  201. package/templates/realtime-agent/node_modules/@supabase/functions-js/README.md +134 -0
  202. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts +177 -0
  203. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts.map +1 -0
  204. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js +309 -0
  205. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js.map +1 -0
  206. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts +3 -0
  207. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts.map +1 -0
  208. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js +11 -0
  209. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js.map +1 -0
  210. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts +3 -0
  211. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts.map +1 -0
  212. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js +12 -0
  213. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js.map +1 -0
  214. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts +122 -0
  215. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts.map +1 -0
  216. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js +98 -0
  217. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js.map +1 -0
  218. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts +2 -0
  219. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts.map +1 -0
  220. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js +11 -0
  221. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js.map +1 -0
  222. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts +177 -0
  223. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts.map +1 -0
  224. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js +305 -0
  225. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js.map +1 -0
  226. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts +3 -0
  227. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts.map +1 -0
  228. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js +7 -0
  229. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js.map +1 -0
  230. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts +3 -0
  231. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts.map +1 -0
  232. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js +3 -0
  233. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js.map +1 -0
  234. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts +122 -0
  235. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts.map +1 -0
  236. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js +91 -0
  237. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js.map +1 -0
  238. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts +2 -0
  239. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts.map +1 -0
  240. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js +8 -0
  241. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js.map +1 -0
  242. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.module.tsbuildinfo +1 -0
  243. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.tsbuildinfo +1 -0
  244. package/templates/realtime-agent/node_modules/@supabase/functions-js/package.json +52 -0
  245. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/FunctionsClient.ts +335 -0
  246. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/edge-runtime.d.ts +214 -0
  247. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/helper.ts +8 -0
  248. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/index.ts +10 -0
  249. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/types.ts +146 -0
  250. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/version.ts +7 -0
  251. package/templates/realtime-agent/node_modules/@supabase/phoenix/LICENSE.md +22 -0
  252. package/templates/realtime-agent/node_modules/@supabase/phoenix/README.md +121 -0
  253. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/ajax.js +116 -0
  254. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/channel.js +331 -0
  255. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/constants.js +35 -0
  256. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/index.js +212 -0
  257. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/longpoll.js +192 -0
  258. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/presence.js +208 -0
  259. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/push.js +134 -0
  260. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/serializer.js +133 -0
  261. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/socket.js +756 -0
  262. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/timer.js +48 -0
  263. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/types.js +184 -0
  264. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/utils.js +16 -0
  265. package/templates/realtime-agent/node_modules/@supabase/phoenix/package.json +58 -0
  266. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/favicon.ico +0 -0
  267. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix-orange.png +0 -0
  268. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js +1825 -0
  269. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js.map +7 -0
  270. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.js +1847 -0
  271. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.min.js +2 -0
  272. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs +1802 -0
  273. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs.map +7 -0
  274. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.png +0 -0
  275. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts +10 -0
  276. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts.map +1 -0
  277. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts +167 -0
  278. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts.map +1 -0
  279. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts +36 -0
  280. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts.map +1 -0
  281. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts +10 -0
  282. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts.map +1 -0
  283. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts +29 -0
  284. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts.map +1 -0
  285. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts +107 -0
  286. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts.map +1 -0
  287. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts +70 -0
  288. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts.map +1 -0
  289. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts +74 -0
  290. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts.map +1 -0
  291. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts +291 -0
  292. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts.map +1 -0
  293. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts +36 -0
  294. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts.map +1 -0
  295. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts +280 -0
  296. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts.map +1 -0
  297. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts +2 -0
  298. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts.map +1 -0
  299. package/templates/realtime-agent/node_modules/@supabase/phoenix/tsconfig.json +20 -0
  300. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/README.md +213 -0
  301. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs +5025 -0
  302. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs.map +1 -0
  303. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts +3828 -0
  304. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts.map +1 -0
  305. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts +3828 -0
  306. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts.map +1 -0
  307. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs +5017 -0
  308. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs.map +1 -0
  309. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/package.json +69 -0
  310. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +688 -0
  311. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +447 -0
  312. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +41 -0
  313. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +2137 -0
  314. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +1703 -0
  315. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +981 -0
  316. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/constants.ts +2 -0
  317. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/index.ts +34 -0
  318. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +476 -0
  319. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +550 -0
  320. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +129 -0
  321. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +704 -0
  322. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/common.ts +83 -0
  323. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/rpc.ts +148 -0
  324. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/feature-flags.ts +17 -0
  325. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/types.ts +161 -0
  326. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/version.ts +7 -0
  327. package/templates/realtime-agent/node_modules/@supabase/realtime-js/README.md +326 -0
  328. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts +442 -0
  329. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts.map +1 -0
  330. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js +719 -0
  331. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js.map +1 -0
  332. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts +275 -0
  333. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts.map +1 -0
  334. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js +697 -0
  335. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js.map +1 -0
  336. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts +62 -0
  337. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts.map +1 -0
  338. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js +43 -0
  339. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js.map +1 -0
  340. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts +6 -0
  341. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts.map +1 -0
  342. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js +18 -0
  343. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js.map +1 -0
  344. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts +43 -0
  345. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts.map +1 -0
  346. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js +43 -0
  347. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js.map +1 -0
  348. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts +10 -0
  349. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts.map +1 -0
  350. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js +29 -0
  351. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js.map +1 -0
  352. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts +33 -0
  353. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts.map +1 -0
  354. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js +155 -0
  355. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js.map +1 -0
  356. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts +109 -0
  357. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts.map +1 -0
  358. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js +241 -0
  359. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js.map +1 -0
  360. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts +2 -0
  361. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts.map +1 -0
  362. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js +11 -0
  363. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js.map +1 -0
  364. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts +82 -0
  365. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts.map +1 -0
  366. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js +130 -0
  367. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js.map +1 -0
  368. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts +32 -0
  369. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts.map +1 -0
  370. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js +103 -0
  371. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js.map +1 -0
  372. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts +53 -0
  373. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts.map +1 -0
  374. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js +93 -0
  375. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js.map +1 -0
  376. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts +38 -0
  377. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts.map +1 -0
  378. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js +114 -0
  379. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js.map +1 -0
  380. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts +5 -0
  381. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts.map +1 -0
  382. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js +3 -0
  383. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js.map +1 -0
  384. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts +442 -0
  385. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts.map +1 -0
  386. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js +714 -0
  387. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js.map +1 -0
  388. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts +275 -0
  389. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts.map +1 -0
  390. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js +693 -0
  391. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js.map +1 -0
  392. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts +62 -0
  393. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts.map +1 -0
  394. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js +38 -0
  395. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js.map +1 -0
  396. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts +6 -0
  397. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts.map +1 -0
  398. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js +6 -0
  399. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js.map +1 -0
  400. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts +43 -0
  401. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts.map +1 -0
  402. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js +40 -0
  403. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js.map +1 -0
  404. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts +10 -0
  405. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts.map +1 -0
  406. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js +26 -0
  407. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js.map +1 -0
  408. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts +33 -0
  409. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts.map +1 -0
  410. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js +152 -0
  411. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js.map +1 -0
  412. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts +109 -0
  413. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts.map +1 -0
  414. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js +229 -0
  415. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js.map +1 -0
  416. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts +2 -0
  417. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts.map +1 -0
  418. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js +8 -0
  419. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js.map +1 -0
  420. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts +82 -0
  421. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts.map +1 -0
  422. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js +126 -0
  423. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js.map +1 -0
  424. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts +32 -0
  425. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts.map +1 -0
  426. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js +100 -0
  427. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js.map +1 -0
  428. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts +53 -0
  429. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts.map +1 -0
  430. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js +90 -0
  431. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js.map +1 -0
  432. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts +38 -0
  433. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts.map +1 -0
  434. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js +111 -0
  435. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js.map +1 -0
  436. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts +5 -0
  437. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts.map +1 -0
  438. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js +2 -0
  439. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js.map +1 -0
  440. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.module.tsbuildinfo +1 -0
  441. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.tsbuildinfo +1 -0
  442. package/templates/realtime-agent/node_modules/@supabase/realtime-js/package.json +58 -0
  443. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts +1118 -0
  444. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeClient.ts +868 -0
  445. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimePresence.ts +71 -0
  446. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/index.ts +53 -0
  447. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/constants.ts +62 -0
  448. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/normalizeChannelError.ts +30 -0
  449. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/serializer.ts +203 -0
  450. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/transformers.ts +270 -0
  451. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/version.ts +7 -0
  452. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/websocket-factory.ts +204 -0
  453. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/channelAdapter.ts +149 -0
  454. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/presenceAdapter.ts +116 -0
  455. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/socketAdapter.ts +168 -0
  456. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/types.ts +32 -0
  457. package/templates/realtime-agent/node_modules/@supabase/storage-js/README.md +1262 -0
  458. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs +2995 -0
  459. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs.map +1 -0
  460. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts +2956 -0
  461. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts.map +1 -0
  462. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts +2956 -0
  463. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts.map +1 -0
  464. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs +2979 -0
  465. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs.map +1 -0
  466. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/umd/supabase.js +1 -0
  467. package/templates/realtime-agent/node_modules/@supabase/storage-js/package.json +62 -0
  468. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/StorageClient.ts +98 -0
  469. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/index.ts +19 -0
  470. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/BaseApiClient.ts +104 -0
  471. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/errors.ts +160 -0
  472. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/fetch.ts +303 -0
  473. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/headers.ts +43 -0
  474. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/helpers.ts +146 -0
  475. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/constants.ts +4 -0
  476. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/types.ts +654 -0
  477. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/version.ts +7 -0
  478. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/BlobDownloadBuilder.ts +62 -0
  479. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageAnalyticsClient.ts +420 -0
  480. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageBucketApi.ts +414 -0
  481. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageFileApi.ts +1423 -0
  482. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageVectorsClient.ts +644 -0
  483. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StreamDownloadBuilder.ts +39 -0
  484. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorBucketApi.ts +73 -0
  485. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorDataApi.ts +98 -0
  486. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorIndexApi.ts +90 -0
  487. package/templates/realtime-agent/node_modules/@supabase/supabase-js/README.md +238 -0
  488. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs +89 -0
  489. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs.map +1 -0
  490. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts +58 -0
  491. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts.map +1 -0
  492. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts +58 -0
  493. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts.map +1 -0
  494. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs +88 -0
  495. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs.map +1 -0
  496. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs +660 -0
  497. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs.map +1 -0
  498. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts +616 -0
  499. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts.map +1 -0
  500. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts +616 -0
  501. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts.map +1 -0
  502. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs +607 -0
  503. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs.map +1 -0
  504. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/umd/supabase.js +24 -0
  505. package/templates/realtime-agent/node_modules/@supabase/supabase-js/package.json +122 -0
  506. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/SupabaseClient.ts +625 -0
  507. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/cors.ts +84 -0
  508. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/index.ts +106 -0
  509. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/SupabaseAuthClient.ts +8 -0
  510. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/constants.ts +35 -0
  511. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/fetch.ts +36 -0
  512. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/helpers.ts +98 -0
  513. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/common.ts +93 -0
  514. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/rpc.ts +158 -0
  515. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/types.ts +196 -0
  516. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/version.ts +7 -0
  517. package/templates/realtime-agent/node_modules/iceberg-js/LICENSE +21 -0
  518. package/templates/realtime-agent/node_modules/iceberg-js/README.md +439 -0
  519. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs +596 -0
  520. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs.map +1 -0
  521. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.cts +547 -0
  522. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.ts +547 -0
  523. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs +587 -0
  524. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs.map +1 -0
  525. package/templates/realtime-agent/node_modules/iceberg-js/package.json +77 -0
  526. package/templates/realtime-agent/node_modules/tslib/CopyrightNotice.txt +15 -0
  527. package/templates/realtime-agent/node_modules/tslib/LICENSE.txt +12 -0
  528. package/templates/realtime-agent/node_modules/tslib/README.md +164 -0
  529. package/templates/realtime-agent/node_modules/tslib/SECURITY.md +41 -0
  530. package/templates/realtime-agent/node_modules/tslib/modules/index.d.ts +38 -0
  531. package/templates/realtime-agent/node_modules/tslib/modules/index.js +70 -0
  532. package/templates/realtime-agent/node_modules/tslib/modules/package.json +3 -0
  533. package/templates/realtime-agent/node_modules/tslib/package.json +47 -0
  534. package/templates/realtime-agent/node_modules/tslib/tslib.d.ts +460 -0
  535. package/templates/realtime-agent/node_modules/tslib/tslib.es6.html +1 -0
  536. package/templates/realtime-agent/node_modules/tslib/tslib.es6.js +402 -0
  537. package/templates/realtime-agent/node_modules/tslib/tslib.es6.mjs +401 -0
  538. package/templates/realtime-agent/node_modules/tslib/tslib.html +1 -0
  539. package/templates/realtime-agent/node_modules/tslib/tslib.js +484 -0
  540. package/templates/realtime-agent/package-lock.json +114 -0
  541. package/templates/realtime-agent/package.json +11 -0
  542. package/templates/realtime-agent/src/index.js +152 -0
  543. package/templates/root/AGENT.md +37 -0
  544. package/templates/root/model.md +1 -0
  545. package/templates/root/prompt.md +91 -0
  546. package/templates/root/ralph.sh +47 -0
@@ -0,0 +1,1423 @@
1
+ import {
2
+ StorageApiError,
3
+ StorageError,
4
+ StorageUnknownError,
5
+ isStorageError,
6
+ } from '../lib/common/errors'
7
+ import { get, head, post, put, remove, Fetch } from '../lib/common/fetch'
8
+ import { setHeader } from '../lib/common/headers'
9
+ import { recursiveToCamel } from '../lib/common/helpers'
10
+ import BaseApiClient from '../lib/common/BaseApiClient'
11
+ import {
12
+ FileObject,
13
+ FileOptions,
14
+ SearchOptions,
15
+ FetchParameters,
16
+ TransformOptions,
17
+ DestinationOptions,
18
+ FileObjectV2,
19
+ Camelize,
20
+ SearchV2Options,
21
+ SearchV2Result,
22
+ } from '../lib/types'
23
+ import BlobDownloadBuilder from './BlobDownloadBuilder'
24
+
25
+ const DEFAULT_SEARCH_OPTIONS = {
26
+ limit: 100,
27
+ offset: 0,
28
+ sortBy: {
29
+ column: 'name',
30
+ order: 'asc',
31
+ },
32
+ }
33
+
34
+ const DEFAULT_FILE_OPTIONS: FileOptions = {
35
+ cacheControl: '3600',
36
+ contentType: 'text/plain;charset=UTF-8',
37
+ upsert: false,
38
+ }
39
+
40
+ type FileBody =
41
+ | ArrayBuffer
42
+ | ArrayBufferView
43
+ | Blob
44
+ | Buffer
45
+ | File
46
+ | FormData
47
+ | NodeJS.ReadableStream
48
+ | ReadableStream<Uint8Array>
49
+ | URLSearchParams
50
+ | string
51
+
52
+ export default class StorageFileApi extends BaseApiClient<StorageError> {
53
+ protected bucketId: string | undefined
54
+
55
+ constructor(
56
+ url: string,
57
+ headers: { [key: string]: string } = {},
58
+ bucketId?: string,
59
+ fetch?: Fetch
60
+ ) {
61
+ super(url, headers, fetch, 'storage')
62
+ this.bucketId = bucketId
63
+ }
64
+
65
+ /**
66
+ * Uploads a file to an existing bucket or replaces an existing file at the specified path with a new one.
67
+ *
68
+ * @param method HTTP method.
69
+ * @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
70
+ * @param fileBody The body of the file to be stored in the bucket.
71
+ */
72
+ private async uploadOrUpdate(
73
+ method: 'POST' | 'PUT',
74
+ path: string,
75
+ fileBody: FileBody,
76
+ fileOptions?: FileOptions
77
+ ): Promise<
78
+ | {
79
+ data: { id: string; path: string; fullPath: string }
80
+ error: null
81
+ }
82
+ | {
83
+ data: null
84
+ error: StorageError
85
+ }
86
+ > {
87
+ return this.handleOperation(async () => {
88
+ let body
89
+ const options = { ...DEFAULT_FILE_OPTIONS, ...fileOptions }
90
+ let headers: Record<string, string> = {
91
+ ...this.headers,
92
+ ...(method === 'POST' && { 'x-upsert': String(options.upsert as boolean) }),
93
+ }
94
+
95
+ const metadata = options.metadata
96
+
97
+ if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {
98
+ body = new FormData()
99
+ body.append('cacheControl', options.cacheControl as string)
100
+ if (metadata) {
101
+ body.append('metadata', this.encodeMetadata(metadata))
102
+ }
103
+ body.append('', fileBody)
104
+ } else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {
105
+ body = fileBody
106
+ // Only append if not already present
107
+ if (!body.has('cacheControl')) {
108
+ body.append('cacheControl', options.cacheControl as string)
109
+ }
110
+ if (metadata && !body.has('metadata')) {
111
+ body.append('metadata', this.encodeMetadata(metadata))
112
+ }
113
+ } else {
114
+ body = fileBody
115
+ headers['cache-control'] = `max-age=${options.cacheControl}`
116
+ headers['content-type'] = options.contentType as string
117
+
118
+ if (metadata) {
119
+ headers['x-metadata'] = this.toBase64(this.encodeMetadata(metadata))
120
+ }
121
+
122
+ // Node.js streams require duplex option for fetch in Node 20+
123
+ // Check for both web ReadableStream and Node.js streams
124
+ const isStream =
125
+ (typeof ReadableStream !== 'undefined' && body instanceof ReadableStream) ||
126
+ (body && typeof body === 'object' && 'pipe' in body && typeof body.pipe === 'function')
127
+
128
+ if (isStream && !options.duplex) {
129
+ options.duplex = 'half'
130
+ }
131
+ }
132
+
133
+ if (fileOptions?.headers) {
134
+ for (const [key, value] of Object.entries(fileOptions.headers)) {
135
+ headers = setHeader(headers, key, value)
136
+ }
137
+ }
138
+
139
+ const cleanPath = this._removeEmptyFolders(path)
140
+ const _path = this._getFinalPath(cleanPath)
141
+ const data = await (method == 'PUT' ? put : post)(
142
+ this.fetch,
143
+ `${this.url}/object/${_path}`,
144
+ body as object,
145
+ { headers, ...(options?.duplex ? { duplex: options.duplex } : {}) }
146
+ )
147
+
148
+ return { path: cleanPath, id: data.Id, fullPath: data.Key }
149
+ })
150
+ }
151
+
152
+ /**
153
+ * Uploads a file to an existing bucket.
154
+ *
155
+ * @category Storage
156
+ * @subcategory File Buckets
157
+ * @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
158
+ * @param fileBody The body of the file to be stored in the bucket.
159
+ * @param fileOptions Optional file upload options including cacheControl, contentType, upsert, and metadata.
160
+ * @returns Promise with response containing file path, id, and fullPath or error
161
+ *
162
+ * @example Upload file
163
+ * ```js
164
+ * const avatarFile = event.target.files[0]
165
+ * const { data, error } = await supabase
166
+ * .storage
167
+ * .from('avatars')
168
+ * .upload('public/avatar1.png', avatarFile, {
169
+ * cacheControl: '3600',
170
+ * upsert: false
171
+ * })
172
+ * ```
173
+ *
174
+ * Response:
175
+ * ```json
176
+ * {
177
+ * "data": {
178
+ * "path": "public/avatar1.png",
179
+ * "fullPath": "avatars/public/avatar1.png"
180
+ * },
181
+ * "error": null
182
+ * }
183
+ * ```
184
+ *
185
+ * @example Upload file using `ArrayBuffer` from base64 file data
186
+ * ```js
187
+ * import { decode } from 'base64-arraybuffer'
188
+ *
189
+ * const { data, error } = await supabase
190
+ * .storage
191
+ * .from('avatars')
192
+ * .upload('public/avatar1.png', decode('base64FileData'), {
193
+ * contentType: 'image/png'
194
+ * })
195
+ * ```
196
+ *
197
+ * @remarks
198
+ * - RLS policy permissions required:
199
+ * - `buckets` table permissions: none
200
+ * - `objects` table permissions: only `insert` when you are uploading new files and `select`, `insert` and `update` when you are upserting files
201
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
202
+ * - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Upload file using `ArrayBuffer` from base64 file data instead, see example below.
203
+ */
204
+ async upload(
205
+ path: string,
206
+ fileBody: FileBody,
207
+ fileOptions?: FileOptions
208
+ ): Promise<
209
+ | {
210
+ data: { id: string; path: string; fullPath: string }
211
+ error: null
212
+ }
213
+ | {
214
+ data: null
215
+ error: StorageError
216
+ }
217
+ > {
218
+ return this.uploadOrUpdate('POST', path, fileBody, fileOptions)
219
+ }
220
+
221
+ /**
222
+ * Upload a file with a token generated from `createSignedUploadUrl`.
223
+ *
224
+ * @category Storage
225
+ * @subcategory File Buckets
226
+ * @param path The file path, including the file name. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to upload.
227
+ * @param token The token generated from `createSignedUploadUrl`
228
+ * @param fileBody The body of the file to be stored in the bucket.
229
+ * @param fileOptions HTTP headers (cacheControl, contentType, etc.).
230
+ * **Note:** The `upsert` option has no effect here. To enable upsert behavior,
231
+ * pass `{ upsert: true }` when calling `createSignedUploadUrl()` instead.
232
+ * @returns Promise with response containing file path and fullPath or error
233
+ *
234
+ * @example Upload to a signed URL
235
+ * ```js
236
+ * const { data, error } = await supabase
237
+ * .storage
238
+ * .from('avatars')
239
+ * .uploadToSignedUrl('folder/cat.jpg', 'token-from-createSignedUploadUrl', file)
240
+ * ```
241
+ *
242
+ * Response:
243
+ * ```json
244
+ * {
245
+ * "data": {
246
+ * "path": "folder/cat.jpg",
247
+ * "fullPath": "avatars/folder/cat.jpg"
248
+ * },
249
+ * "error": null
250
+ * }
251
+ * ```
252
+ *
253
+ * @remarks
254
+ * - RLS policy permissions required:
255
+ * - `buckets` table permissions: none
256
+ * - `objects` table permissions: none
257
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
258
+ */
259
+ async uploadToSignedUrl(
260
+ path: string,
261
+ token: string,
262
+ fileBody: FileBody,
263
+ fileOptions?: FileOptions
264
+ ) {
265
+ const cleanPath = this._removeEmptyFolders(path)
266
+ const _path = this._getFinalPath(cleanPath)
267
+
268
+ const url = new URL(this.url + `/object/upload/sign/${_path}`)
269
+ url.searchParams.set('token', token)
270
+
271
+ return this.handleOperation(async () => {
272
+ let body
273
+ const options = { ...DEFAULT_FILE_OPTIONS, ...fileOptions }
274
+ let headers: Record<string, string> = {
275
+ ...this.headers,
276
+ ...{ 'x-upsert': String(options.upsert as boolean) },
277
+ }
278
+
279
+ const metadata = options.metadata
280
+
281
+ if (typeof Blob !== 'undefined' && fileBody instanceof Blob) {
282
+ body = new FormData()
283
+ body.append('cacheControl', options.cacheControl as string)
284
+ if (metadata) {
285
+ body.append('metadata', this.encodeMetadata(metadata))
286
+ }
287
+ body.append('', fileBody)
288
+ } else if (typeof FormData !== 'undefined' && fileBody instanceof FormData) {
289
+ body = fileBody
290
+ if (!body.has('cacheControl')) {
291
+ body.append('cacheControl', options.cacheControl as string)
292
+ }
293
+ if (metadata && !body.has('metadata')) {
294
+ body.append('metadata', this.encodeMetadata(metadata))
295
+ }
296
+ } else {
297
+ body = fileBody
298
+ headers['cache-control'] = `max-age=${options.cacheControl}`
299
+ headers['content-type'] = options.contentType as string
300
+ if (metadata) {
301
+ headers['x-metadata'] = this.toBase64(this.encodeMetadata(metadata))
302
+ }
303
+
304
+ const isStream =
305
+ (typeof ReadableStream !== 'undefined' && body instanceof ReadableStream) ||
306
+ (body && typeof body === 'object' && 'pipe' in body && typeof body.pipe === 'function')
307
+
308
+ if (isStream && !options.duplex) {
309
+ options.duplex = 'half'
310
+ }
311
+ }
312
+
313
+ if (fileOptions?.headers) {
314
+ for (const [key, value] of Object.entries(fileOptions.headers)) {
315
+ headers = setHeader(headers, key, value)
316
+ }
317
+ }
318
+
319
+ const data = await put(this.fetch, url.toString(), body as object, {
320
+ headers,
321
+ ...(options?.duplex ? { duplex: options.duplex } : {}),
322
+ })
323
+
324
+ return { path: cleanPath, fullPath: data.Key }
325
+ })
326
+ }
327
+
328
+ /**
329
+ * Creates a signed upload URL.
330
+ * Signed upload URLs can be used to upload files to the bucket without further authentication.
331
+ * They are valid for 2 hours.
332
+ *
333
+ * @category Storage
334
+ * @subcategory File Buckets
335
+ * @param path The file path, including the current file name. For example `folder/image.png`.
336
+ * @param options.upsert If set to true, allows the file to be overwritten if it already exists.
337
+ * @returns Promise with response containing signed upload URL, token, and path or error
338
+ *
339
+ * @example Create Signed Upload URL
340
+ * ```js
341
+ * const { data, error } = await supabase
342
+ * .storage
343
+ * .from('avatars')
344
+ * .createSignedUploadUrl('folder/cat.jpg')
345
+ * ```
346
+ *
347
+ * Response:
348
+ * ```json
349
+ * {
350
+ * "data": {
351
+ * "signedUrl": "https://example.supabase.co/storage/v1/object/upload/sign/avatars/folder/cat.jpg?token=<TOKEN>",
352
+ * "path": "folder/cat.jpg",
353
+ * "token": "<TOKEN>"
354
+ * },
355
+ * "error": null
356
+ * }
357
+ * ```
358
+ *
359
+ * @remarks
360
+ * - RLS policy permissions required:
361
+ * - `buckets` table permissions: none
362
+ * - `objects` table permissions: `insert`
363
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
364
+ */
365
+ async createSignedUploadUrl(
366
+ path: string,
367
+ options?: { upsert: boolean }
368
+ ): Promise<
369
+ | {
370
+ data: { signedUrl: string; token: string; path: string }
371
+ error: null
372
+ }
373
+ | {
374
+ data: null
375
+ error: StorageError
376
+ }
377
+ > {
378
+ return this.handleOperation(async () => {
379
+ let _path = this._getFinalPath(path)
380
+
381
+ const headers = { ...this.headers }
382
+
383
+ if (options?.upsert) {
384
+ headers['x-upsert'] = 'true'
385
+ }
386
+
387
+ const data = await post(
388
+ this.fetch,
389
+ `${this.url}/object/upload/sign/${_path}`,
390
+ {},
391
+ { headers }
392
+ )
393
+
394
+ const url = new URL(this.url + data.url)
395
+
396
+ const token = url.searchParams.get('token')
397
+
398
+ if (!token) {
399
+ throw new StorageError('No token returned by API')
400
+ }
401
+
402
+ return { signedUrl: url.toString(), path, token }
403
+ })
404
+ }
405
+
406
+ /**
407
+ * Replaces an existing file at the specified path with a new one.
408
+ *
409
+ * @category Storage
410
+ * @subcategory File Buckets
411
+ * @param path The relative file path. Should be of the format `folder/subfolder/filename.png`. The bucket must already exist before attempting to update.
412
+ * @param fileBody The body of the file to be stored in the bucket.
413
+ * @param fileOptions Optional file upload options including cacheControl, contentType, and metadata.
414
+ * **Note:** The `upsert` option has no effect here. `update()` always replaces the
415
+ * file at the given path, so the `x-upsert` header is not sent. To control upsert
416
+ * behavior, use `upload()` instead.
417
+ * @returns Promise with response containing file path, id, and fullPath or error
418
+ *
419
+ * @example Update file
420
+ * ```js
421
+ * const avatarFile = event.target.files[0]
422
+ * const { data, error } = await supabase
423
+ * .storage
424
+ * .from('avatars')
425
+ * .update('public/avatar1.png', avatarFile, {
426
+ * cacheControl: '3600'
427
+ * })
428
+ * ```
429
+ *
430
+ * Response:
431
+ * ```json
432
+ * {
433
+ * "data": {
434
+ * "path": "public/avatar1.png",
435
+ * "fullPath": "avatars/public/avatar1.png"
436
+ * },
437
+ * "error": null
438
+ * }
439
+ * ```
440
+ *
441
+ * @example Update file using `ArrayBuffer` from base64 file data
442
+ * ```js
443
+ * import {decode} from 'base64-arraybuffer'
444
+ *
445
+ * const { data, error } = await supabase
446
+ * .storage
447
+ * .from('avatars')
448
+ * .update('public/avatar1.png', decode('base64FileData'), {
449
+ * contentType: 'image/png'
450
+ * })
451
+ * ```
452
+ *
453
+ * @remarks
454
+ * - RLS policy permissions required:
455
+ * - `buckets` table permissions: none
456
+ * - `objects` table permissions: `update` and `select`
457
+ * - `update()` always replaces the file at the given path regardless of the `upsert` option.
458
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
459
+ * - For React Native, using either `Blob`, `File` or `FormData` does not work as intended. Update file using `ArrayBuffer` from base64 file data instead, see example below.
460
+ */
461
+ async update(
462
+ path: string,
463
+ fileBody:
464
+ | ArrayBuffer
465
+ | ArrayBufferView
466
+ | Blob
467
+ | Buffer
468
+ | File
469
+ | FormData
470
+ | NodeJS.ReadableStream
471
+ | ReadableStream<Uint8Array>
472
+ | URLSearchParams
473
+ | string,
474
+ fileOptions?: FileOptions
475
+ ): Promise<
476
+ | {
477
+ data: { id: string; path: string; fullPath: string }
478
+ error: null
479
+ }
480
+ | {
481
+ data: null
482
+ error: StorageError
483
+ }
484
+ > {
485
+ return this.uploadOrUpdate('PUT', path, fileBody, fileOptions)
486
+ }
487
+
488
+ /**
489
+ * Moves an existing file to a new path in the same bucket.
490
+ *
491
+ * @category Storage
492
+ * @subcategory File Buckets
493
+ * @param fromPath The original file path, including the current file name. For example `folder/image.png`.
494
+ * @param toPath The new file path, including the new file name. For example `folder/image-new.png`.
495
+ * @param options The destination options.
496
+ * @returns Promise with response containing success message or error
497
+ *
498
+ * @example Move file
499
+ * ```js
500
+ * const { data, error } = await supabase
501
+ * .storage
502
+ * .from('avatars')
503
+ * .move('public/avatar1.png', 'private/avatar2.png')
504
+ * ```
505
+ *
506
+ * Response:
507
+ * ```json
508
+ * {
509
+ * "data": {
510
+ * "message": "Successfully moved"
511
+ * },
512
+ * "error": null
513
+ * }
514
+ * ```
515
+ *
516
+ * @remarks
517
+ * - RLS policy permissions required:
518
+ * - `buckets` table permissions: none
519
+ * - `objects` table permissions: `update` and `select`
520
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
521
+ */
522
+ async move(
523
+ fromPath: string,
524
+ toPath: string,
525
+ options?: DestinationOptions
526
+ ): Promise<
527
+ | {
528
+ data: { message: string }
529
+ error: null
530
+ }
531
+ | {
532
+ data: null
533
+ error: StorageError
534
+ }
535
+ > {
536
+ return this.handleOperation(async () => {
537
+ return await post(
538
+ this.fetch,
539
+ `${this.url}/object/move`,
540
+ {
541
+ bucketId: this.bucketId,
542
+ sourceKey: fromPath,
543
+ destinationKey: toPath,
544
+ destinationBucket: options?.destinationBucket,
545
+ },
546
+ { headers: this.headers }
547
+ )
548
+ })
549
+ }
550
+
551
+ /**
552
+ * Copies an existing file to a new path in the same bucket.
553
+ *
554
+ * @category Storage
555
+ * @subcategory File Buckets
556
+ * @param fromPath The original file path, including the current file name. For example `folder/image.png`.
557
+ * @param toPath The new file path, including the new file name. For example `folder/image-copy.png`.
558
+ * @param options The destination options.
559
+ * @returns Promise with response containing copied file path or error
560
+ *
561
+ * @example Copy file
562
+ * ```js
563
+ * const { data, error } = await supabase
564
+ * .storage
565
+ * .from('avatars')
566
+ * .copy('public/avatar1.png', 'private/avatar2.png')
567
+ * ```
568
+ *
569
+ * Response:
570
+ * ```json
571
+ * {
572
+ * "data": {
573
+ * "path": "avatars/private/avatar2.png"
574
+ * },
575
+ * "error": null
576
+ * }
577
+ * ```
578
+ *
579
+ * @remarks
580
+ * - RLS policy permissions required:
581
+ * - `buckets` table permissions: none
582
+ * - `objects` table permissions: `insert` and `select`
583
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
584
+ */
585
+ async copy(
586
+ fromPath: string,
587
+ toPath: string,
588
+ options?: DestinationOptions
589
+ ): Promise<
590
+ | {
591
+ data: { path: string }
592
+ error: null
593
+ }
594
+ | {
595
+ data: null
596
+ error: StorageError
597
+ }
598
+ > {
599
+ return this.handleOperation(async () => {
600
+ const data = await post(
601
+ this.fetch,
602
+ `${this.url}/object/copy`,
603
+ {
604
+ bucketId: this.bucketId,
605
+ sourceKey: fromPath,
606
+ destinationKey: toPath,
607
+ destinationBucket: options?.destinationBucket,
608
+ },
609
+ { headers: this.headers }
610
+ )
611
+ return { path: data.Key }
612
+ })
613
+ }
614
+
615
+ /**
616
+ * Creates a signed URL. Use a signed URL to share a file for a fixed amount of time.
617
+ *
618
+ * @category Storage
619
+ * @subcategory File Buckets
620
+ * @param path The file path, including the current file name. For example `folder/image.png`.
621
+ * @param expiresIn The number of seconds until the signed URL expires. For example, `60` for a URL which is valid for one minute.
622
+ * @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
623
+ * @param options.transform Transform the asset before serving it to the client.
624
+ * @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.
625
+ * @returns Promise with response containing signed URL or error
626
+ *
627
+ * @example Create Signed URL
628
+ * ```js
629
+ * const { data, error } = await supabase
630
+ * .storage
631
+ * .from('avatars')
632
+ * .createSignedUrl('folder/avatar1.png', 60)
633
+ * ```
634
+ *
635
+ * Response:
636
+ * ```json
637
+ * {
638
+ * "data": {
639
+ * "signedUrl": "https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=<TOKEN>"
640
+ * },
641
+ * "error": null
642
+ * }
643
+ * ```
644
+ *
645
+ * @example Create a signed URL for an asset with transformations
646
+ * ```js
647
+ * const { data } = await supabase
648
+ * .storage
649
+ * .from('avatars')
650
+ * .createSignedUrl('folder/avatar1.png', 60, {
651
+ * transform: {
652
+ * width: 100,
653
+ * height: 100,
654
+ * }
655
+ * })
656
+ * ```
657
+ *
658
+ * @example Create a signed URL which triggers the download of the asset
659
+ * ```js
660
+ * const { data } = await supabase
661
+ * .storage
662
+ * .from('avatars')
663
+ * .createSignedUrl('folder/avatar1.png', 60, {
664
+ * download: true,
665
+ * })
666
+ * ```
667
+ *
668
+ * @remarks
669
+ * - RLS policy permissions required:
670
+ * - `buckets` table permissions: none
671
+ * - `objects` table permissions: `select`
672
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
673
+ */
674
+ async createSignedUrl(
675
+ path: string,
676
+ expiresIn: number,
677
+ options?: {
678
+ download?: string | boolean
679
+ transform?: TransformOptions
680
+ cacheNonce?: string
681
+ }
682
+ ): Promise<
683
+ | {
684
+ data: { signedUrl: string }
685
+ error: null
686
+ }
687
+ | {
688
+ data: null
689
+ error: StorageError
690
+ }
691
+ > {
692
+ return this.handleOperation(async () => {
693
+ let _path = this._getFinalPath(path)
694
+
695
+ const hasTransform =
696
+ typeof options?.transform === 'object' &&
697
+ options.transform !== null &&
698
+ Object.keys(options.transform).length > 0
699
+
700
+ let data = await post(
701
+ this.fetch,
702
+ `${this.url}/object/sign/${_path}`,
703
+ { expiresIn, ...(hasTransform ? { transform: options!.transform } : {}) },
704
+ { headers: this.headers }
705
+ )
706
+
707
+ const query = new URLSearchParams()
708
+ if (options?.download)
709
+ query.set('download', options.download === true ? '' : options.download)
710
+ if (options?.cacheNonce != null) query.set('cacheNonce', String(options.cacheNonce))
711
+ const queryString = query.toString()
712
+
713
+ // `data.signedURL` contains a `token` query parameter, so append extra params with `&`
714
+ // only when we actually have something to add.
715
+ const signedUrl = encodeURI(
716
+ `${this.url}${data.signedURL}${queryString ? `&${queryString}` : ''}`
717
+ )
718
+
719
+ return { signedUrl }
720
+ })
721
+ }
722
+
723
+ /**
724
+ * Creates multiple signed URLs. Use a signed URL to share a file for a fixed amount of time.
725
+ *
726
+ * @category Storage
727
+ * @subcategory File Buckets
728
+ * @param paths The file paths to be downloaded, including the current file names. For example `['folder/image.png', 'folder2/image2.png']`.
729
+ * @param expiresIn The number of seconds until the signed URLs expire. For example, `60` for URLs which are valid for one minute.
730
+ * @param options.download triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
731
+ * @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.
732
+ * @returns Promise with response containing array of objects with signedUrl, path, and error or error
733
+ *
734
+ * @example Create Signed URLs
735
+ * ```js
736
+ * const { data, error } = await supabase
737
+ * .storage
738
+ * .from('avatars')
739
+ * .createSignedUrls(['folder/avatar1.png', 'folder/avatar2.png'], 60)
740
+ * ```
741
+ *
742
+ * Response:
743
+ * ```json
744
+ * {
745
+ * "data": [
746
+ * {
747
+ * "error": null,
748
+ * "path": "folder/avatar1.png",
749
+ * "signedURL": "/object/sign/avatars/folder/avatar1.png?token=<TOKEN>",
750
+ * "signedUrl": "https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar1.png?token=<TOKEN>"
751
+ * },
752
+ * {
753
+ * "error": null,
754
+ * "path": "folder/avatar2.png",
755
+ * "signedURL": "/object/sign/avatars/folder/avatar2.png?token=<TOKEN>",
756
+ * "signedUrl": "https://example.supabase.co/storage/v1/object/sign/avatars/folder/avatar2.png?token=<TOKEN>"
757
+ * }
758
+ * ],
759
+ * "error": null
760
+ * }
761
+ * ```
762
+ *
763
+ * @remarks
764
+ * - RLS policy permissions required:
765
+ * - `buckets` table permissions: none
766
+ * - `objects` table permissions: `select`
767
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
768
+ */
769
+ async createSignedUrls(
770
+ paths: string[],
771
+ expiresIn: number,
772
+ options?: { download?: string | boolean; cacheNonce?: string }
773
+ ): Promise<
774
+ | {
775
+ data: { error: string | null; path: string | null; signedUrl: string | null }[]
776
+ error: null
777
+ }
778
+ | {
779
+ data: null
780
+ error: StorageError
781
+ }
782
+ > {
783
+ return this.handleOperation(async () => {
784
+ const data = await post(
785
+ this.fetch,
786
+ `${this.url}/object/sign/${this.bucketId}`,
787
+ { expiresIn, paths },
788
+ { headers: this.headers }
789
+ )
790
+
791
+ const query = new URLSearchParams()
792
+
793
+ if (options?.download)
794
+ query.set('download', options.download === true ? '' : options.download)
795
+ if (options?.cacheNonce != null) query.set('cacheNonce', String(options.cacheNonce))
796
+
797
+ const queryString = query.toString()
798
+
799
+ return data.map((datum: { signedURL: string }) => ({
800
+ ...datum,
801
+ signedUrl: datum.signedURL
802
+ ? encodeURI(`${this.url}${datum.signedURL}${queryString ? `&${queryString}` : ''}`)
803
+ : null,
804
+ }))
805
+ })
806
+ }
807
+
808
+ /**
809
+ * Downloads a file from a private bucket. For public buckets, make a request to the URL returned from `getPublicUrl` instead.
810
+ *
811
+ * @category Storage
812
+ * @subcategory File Buckets
813
+ * @param path The full path and file name of the file to be downloaded. For example `folder/image.png`.
814
+ * @param options.transform Transform the asset before serving it to the client.
815
+ * @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.
816
+ * @param parameters Additional fetch parameters like signal for cancellation. Supports standard fetch options including cache control.
817
+ * @returns BlobDownloadBuilder instance for downloading the file
818
+ *
819
+ * @example Download file
820
+ * ```js
821
+ * const { data, error } = await supabase
822
+ * .storage
823
+ * .from('avatars')
824
+ * .download('folder/avatar1.png')
825
+ * ```
826
+ *
827
+ * Response:
828
+ * ```json
829
+ * {
830
+ * "data": <BLOB>,
831
+ * "error": null
832
+ * }
833
+ * ```
834
+ *
835
+ * @example Download file with transformations
836
+ * ```js
837
+ * const { data, error } = await supabase
838
+ * .storage
839
+ * .from('avatars')
840
+ * .download('folder/avatar1.png', {
841
+ * transform: {
842
+ * width: 100,
843
+ * height: 100,
844
+ * quality: 80
845
+ * }
846
+ * })
847
+ * ```
848
+ *
849
+ * @example Download with cache control (useful in Edge Functions)
850
+ * ```js
851
+ * const { data, error } = await supabase
852
+ * .storage
853
+ * .from('avatars')
854
+ * .download('folder/avatar1.png', {}, { cache: 'no-store' })
855
+ * ```
856
+ *
857
+ * @example Download with abort signal
858
+ * ```js
859
+ * const controller = new AbortController()
860
+ * setTimeout(() => controller.abort(), 5000)
861
+ *
862
+ * const { data, error } = await supabase
863
+ * .storage
864
+ * .from('avatars')
865
+ * .download('folder/avatar1.png', {}, { signal: controller.signal })
866
+ * ```
867
+ *
868
+ * @remarks
869
+ * - RLS policy permissions required:
870
+ * - `buckets` table permissions: none
871
+ * - `objects` table permissions: `select`
872
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
873
+ */
874
+ download<Options extends { transform?: TransformOptions; cacheNonce?: string }>(
875
+ path: string,
876
+ options?: Options,
877
+ parameters?: FetchParameters
878
+ ): BlobDownloadBuilder {
879
+ const wantsTransformation =
880
+ typeof options?.transform === 'object' &&
881
+ options.transform !== null &&
882
+ Object.keys(options.transform).length > 0
883
+ const renderPath = wantsTransformation ? 'render/image/authenticated' : 'object'
884
+
885
+ const query = new URLSearchParams()
886
+ if (options?.transform) this.applyTransformOptsToQuery(query, options.transform)
887
+ if (options?.cacheNonce != null) query.set('cacheNonce', String(options.cacheNonce))
888
+ const queryString = query.toString()
889
+
890
+ const _path = this._getFinalPath(path)
891
+ const downloadFn = () =>
892
+ get(
893
+ this.fetch,
894
+ `${this.url}/${renderPath}/${_path}${queryString ? `?${queryString}` : ''}`,
895
+ {
896
+ headers: this.headers,
897
+ noResolveJson: true,
898
+ },
899
+ parameters
900
+ )
901
+ return new BlobDownloadBuilder(downloadFn, this.shouldThrowOnError)
902
+ }
903
+
904
+ /**
905
+ * Retrieves the details of an existing file.
906
+ *
907
+ * Returns detailed file metadata including size, content type, and timestamps.
908
+ * Note: The API returns `last_modified` field, not `updated_at`.
909
+ *
910
+ * @category Storage
911
+ * @subcategory File Buckets
912
+ * @param path The file path, including the file name. For example `folder/image.png`.
913
+ * @returns Promise with response containing file metadata or error
914
+ *
915
+ * @example Get file info
916
+ * ```js
917
+ * const { data, error } = await supabase
918
+ * .storage
919
+ * .from('avatars')
920
+ * .info('folder/avatar1.png')
921
+ *
922
+ * if (data) {
923
+ * console.log('Last modified:', data.lastModified)
924
+ * console.log('Size:', data.size)
925
+ * }
926
+ * ```
927
+ */
928
+ async info(path: string): Promise<
929
+ | {
930
+ data: Camelize<FileObjectV2>
931
+ error: null
932
+ }
933
+ | {
934
+ data: null
935
+ error: StorageError
936
+ }
937
+ > {
938
+ const _path = this._getFinalPath(path)
939
+
940
+ return this.handleOperation(async () => {
941
+ const data = await get(this.fetch, `${this.url}/object/info/${_path}`, {
942
+ headers: this.headers,
943
+ })
944
+
945
+ return recursiveToCamel(data) as Camelize<FileObjectV2>
946
+ })
947
+ }
948
+
949
+ /**
950
+ * Checks the existence of a file.
951
+ *
952
+ * @category Storage
953
+ * @subcategory File Buckets
954
+ * @param path The file path, including the file name. For example `folder/image.png`.
955
+ * @returns Promise with response containing boolean indicating file existence or error
956
+ *
957
+ * @example Check file existence
958
+ * ```js
959
+ * const { data, error } = await supabase
960
+ * .storage
961
+ * .from('avatars')
962
+ * .exists('folder/avatar1.png')
963
+ * ```
964
+ */
965
+ async exists(path: string): Promise<
966
+ | {
967
+ data: boolean
968
+ error: null
969
+ }
970
+ | {
971
+ data: boolean
972
+ error: StorageError
973
+ }
974
+ > {
975
+ const _path = this._getFinalPath(path)
976
+
977
+ try {
978
+ await head(this.fetch, `${this.url}/object/${_path}`, {
979
+ headers: this.headers,
980
+ })
981
+
982
+ return { data: true, error: null }
983
+ } catch (error) {
984
+ if (this.shouldThrowOnError) {
985
+ throw error
986
+ }
987
+ if (isStorageError(error)) {
988
+ // HEAD requests produce StorageApiError (via handleError) or StorageUnknownError (legacy)
989
+ const status =
990
+ error instanceof StorageApiError
991
+ ? error.status
992
+ : error instanceof StorageUnknownError
993
+ ? (error.originalError as { status: number })?.status
994
+ : undefined
995
+
996
+ if (status !== undefined && [400, 404].includes(status)) {
997
+ return { data: false, error }
998
+ }
999
+ }
1000
+
1001
+ throw error
1002
+ }
1003
+ }
1004
+
1005
+ /**
1006
+ * A simple convenience function to get the URL for an asset in a public bucket. If you do not want to use this function, you can construct the public URL by concatenating the bucket URL with the path to the asset.
1007
+ * This function does not verify if the bucket is public. If a public URL is created for a bucket which is not public, you will not be able to download the asset.
1008
+ *
1009
+ * @category Storage
1010
+ * @subcategory File Buckets
1011
+ * @param path The path and name of the file to generate the public URL for. For example `folder/image.png`.
1012
+ * @param options.download Triggers the file as a download if set to true. Set this parameter as the name of the file if you want to trigger the download with a different filename.
1013
+ * @param options.transform Transform the asset before serving it to the client.
1014
+ * @param options.cacheNonce Append a cache nonce parameter to the URL to invalidate the cache.
1015
+ * @returns Object with public URL
1016
+ *
1017
+ * @example Returns the URL for an asset in a public bucket
1018
+ * ```js
1019
+ * const { data } = supabase
1020
+ * .storage
1021
+ * .from('public-bucket')
1022
+ * .getPublicUrl('folder/avatar1.png')
1023
+ * ```
1024
+ *
1025
+ * Response:
1026
+ * ```json
1027
+ * {
1028
+ * "data": {
1029
+ * "publicUrl": "https://example.supabase.co/storage/v1/object/public/public-bucket/folder/avatar1.png"
1030
+ * }
1031
+ * }
1032
+ * ```
1033
+ *
1034
+ * @example Returns the URL for an asset in a public bucket with transformations
1035
+ * ```js
1036
+ * const { data } = supabase
1037
+ * .storage
1038
+ * .from('public-bucket')
1039
+ * .getPublicUrl('folder/avatar1.png', {
1040
+ * transform: {
1041
+ * width: 100,
1042
+ * height: 100,
1043
+ * }
1044
+ * })
1045
+ * ```
1046
+ *
1047
+ * @example Returns the URL which triggers the download of an asset in a public bucket
1048
+ * ```js
1049
+ * const { data } = supabase
1050
+ * .storage
1051
+ * .from('public-bucket')
1052
+ * .getPublicUrl('folder/avatar1.png', {
1053
+ * download: true,
1054
+ * })
1055
+ * ```
1056
+ *
1057
+ * @remarks
1058
+ * - The bucket needs to be set to public, either via [updateBucket()](/docs/reference/javascript/storage-updatebucket) or by going to Storage on [supabase.com/dashboard](https://supabase.com/dashboard), clicking the overflow menu on a bucket and choosing "Make public"
1059
+ * - RLS policy permissions required:
1060
+ * - `buckets` table permissions: none
1061
+ * - `objects` table permissions: none
1062
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
1063
+ */
1064
+ getPublicUrl(
1065
+ path: string,
1066
+ options?: {
1067
+ download?: string | boolean
1068
+ transform?: TransformOptions
1069
+ cacheNonce?: string
1070
+ }
1071
+ ): { data: { publicUrl: string } } {
1072
+ const _path = this._getFinalPath(path)
1073
+
1074
+ const query = new URLSearchParams()
1075
+ if (options?.download) query.set('download', options.download === true ? '' : options.download)
1076
+ if (options?.transform) this.applyTransformOptsToQuery(query, options.transform)
1077
+ if (options?.cacheNonce != null) query.set('cacheNonce', String(options.cacheNonce))
1078
+ const queryString = query.toString()
1079
+
1080
+ const wantsTransformation =
1081
+ typeof options?.transform === 'object' &&
1082
+ options.transform !== null &&
1083
+ Object.keys(options.transform).length > 0
1084
+ const renderPath = wantsTransformation ? 'render/image' : 'object'
1085
+
1086
+ return {
1087
+ data: {
1088
+ publicUrl:
1089
+ encodeURI(`${this.url}/${renderPath}/public/${_path}`) +
1090
+ (queryString ? `?${queryString}` : ''),
1091
+ },
1092
+ }
1093
+ }
1094
+
1095
+ /**
1096
+ * Deletes files within the same bucket
1097
+ *
1098
+ * Returns an array of FileObject entries for the deleted files. Note that deprecated
1099
+ * fields like `bucket_id` may or may not be present in the response - do not rely on them.
1100
+ *
1101
+ * @category Storage
1102
+ * @subcategory File Buckets
1103
+ * @param paths An array of files to delete, including the path and file name. For example [`'folder/image.png'`].
1104
+ * @returns Promise with response containing array of deleted file objects or error
1105
+ *
1106
+ * @example Delete file
1107
+ * ```js
1108
+ * const { data, error } = await supabase
1109
+ * .storage
1110
+ * .from('avatars')
1111
+ * .remove(['folder/avatar1.png'])
1112
+ * ```
1113
+ *
1114
+ * Response:
1115
+ * ```json
1116
+ * {
1117
+ * "data": [],
1118
+ * "error": null
1119
+ * }
1120
+ * ```
1121
+ *
1122
+ * @remarks
1123
+ * - RLS policy permissions required:
1124
+ * - `buckets` table permissions: none
1125
+ * - `objects` table permissions: `delete` and `select`
1126
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
1127
+ */
1128
+ async remove(paths: string[]): Promise<
1129
+ | {
1130
+ data: FileObject[]
1131
+ error: null
1132
+ }
1133
+ | {
1134
+ data: null
1135
+ error: StorageError
1136
+ }
1137
+ > {
1138
+ return this.handleOperation(async () => {
1139
+ return await remove(
1140
+ this.fetch,
1141
+ `${this.url}/object/${this.bucketId}`,
1142
+ { prefixes: paths },
1143
+ { headers: this.headers }
1144
+ )
1145
+ })
1146
+ }
1147
+
1148
+ /**
1149
+ * Get file metadata
1150
+ * @param id the file id to retrieve metadata
1151
+ */
1152
+ // async getMetadata(
1153
+ // id: string
1154
+ // ): Promise<
1155
+ // | {
1156
+ // data: Metadata
1157
+ // error: null
1158
+ // }
1159
+ // | {
1160
+ // data: null
1161
+ // error: StorageError
1162
+ // }
1163
+ // > {
1164
+ // try {
1165
+ // const data = await get(this.fetch, `${this.url}/metadata/${id}`, { headers: this.headers })
1166
+ // return { data, error: null }
1167
+ // } catch (error) {
1168
+ // if (isStorageError(error)) {
1169
+ // return { data: null, error }
1170
+ // }
1171
+
1172
+ // throw error
1173
+ // }
1174
+ // }
1175
+
1176
+ /**
1177
+ * Update file metadata
1178
+ * @param id the file id to update metadata
1179
+ * @param meta the new file metadata
1180
+ */
1181
+ // async updateMetadata(
1182
+ // id: string,
1183
+ // meta: Metadata
1184
+ // ): Promise<
1185
+ // | {
1186
+ // data: Metadata
1187
+ // error: null
1188
+ // }
1189
+ // | {
1190
+ // data: null
1191
+ // error: StorageError
1192
+ // }
1193
+ // > {
1194
+ // try {
1195
+ // const data = await post(
1196
+ // this.fetch,
1197
+ // `${this.url}/metadata/${id}`,
1198
+ // { ...meta },
1199
+ // { headers: this.headers }
1200
+ // )
1201
+ // return { data, error: null }
1202
+ // } catch (error) {
1203
+ // if (isStorageError(error)) {
1204
+ // return { data: null, error }
1205
+ // }
1206
+
1207
+ // throw error
1208
+ // }
1209
+ // }
1210
+
1211
+ /**
1212
+ * Lists all the files and folders within a path of the bucket.
1213
+ *
1214
+ * **Important:** For folder entries, fields like `id`, `updated_at`, `created_at`,
1215
+ * `last_accessed_at`, and `metadata` will be `null`. Only files have these fields populated.
1216
+ * Additionally, deprecated fields like `bucket_id`, `owner`, and `buckets` are NOT returned
1217
+ * by this method.
1218
+ *
1219
+ * @category Storage
1220
+ * @subcategory File Buckets
1221
+ * @param path The folder path.
1222
+ * @param options Search options including limit (defaults to 100), offset, sortBy, and search
1223
+ * @param parameters Optional fetch parameters including signal for cancellation
1224
+ * @returns Promise with response containing array of files/folders or error
1225
+ *
1226
+ * @example List files in a bucket
1227
+ * ```js
1228
+ * const { data, error } = await supabase
1229
+ * .storage
1230
+ * .from('avatars')
1231
+ * .list('folder', {
1232
+ * limit: 100,
1233
+ * offset: 0,
1234
+ * sortBy: { column: 'name', order: 'asc' },
1235
+ * })
1236
+ *
1237
+ * // Handle files vs folders
1238
+ * data?.forEach(item => {
1239
+ * if (item.id !== null) {
1240
+ * // It's a file
1241
+ * console.log('File:', item.name, 'Size:', item.metadata?.size)
1242
+ * } else {
1243
+ * // It's a folder
1244
+ * console.log('Folder:', item.name)
1245
+ * }
1246
+ * })
1247
+ * ```
1248
+ *
1249
+ * Response:
1250
+ * ```json
1251
+ * {
1252
+ * "data": [
1253
+ * {
1254
+ * "name": "avatar1.png",
1255
+ * "id": "e668cf7f-821b-4a2f-9dce-7dfa5dd1cfd2",
1256
+ * "updated_at": "2024-05-22T23:06:05.580Z",
1257
+ * "created_at": "2024-05-22T23:04:34.443Z",
1258
+ * "last_accessed_at": "2024-05-22T23:04:34.443Z",
1259
+ * "metadata": {
1260
+ * "eTag": "\"c5e8c553235d9af30ef4f6e280790b92\"",
1261
+ * "size": 32175,
1262
+ * "mimetype": "image/png",
1263
+ * "cacheControl": "max-age=3600",
1264
+ * "lastModified": "2024-05-22T23:06:05.574Z",
1265
+ * "contentLength": 32175,
1266
+ * "httpStatusCode": 200
1267
+ * }
1268
+ * }
1269
+ * ],
1270
+ * "error": null
1271
+ * }
1272
+ * ```
1273
+ *
1274
+ * @example Search files in a bucket
1275
+ * ```js
1276
+ * const { data, error } = await supabase
1277
+ * .storage
1278
+ * .from('avatars')
1279
+ * .list('folder', {
1280
+ * limit: 100,
1281
+ * offset: 0,
1282
+ * sortBy: { column: 'name', order: 'asc' },
1283
+ * search: 'jon'
1284
+ * })
1285
+ * ```
1286
+ *
1287
+ * @remarks
1288
+ * - RLS policy permissions required:
1289
+ * - `buckets` table permissions: none
1290
+ * - `objects` table permissions: `select`
1291
+ * - Refer to the [Storage guide](/docs/guides/storage/security/access-control) on how access control works
1292
+ */
1293
+ async list(
1294
+ path?: string,
1295
+ options?: SearchOptions,
1296
+ parameters?: FetchParameters
1297
+ ): Promise<
1298
+ | {
1299
+ data: FileObject[]
1300
+ error: null
1301
+ }
1302
+ | {
1303
+ data: null
1304
+ error: StorageError
1305
+ }
1306
+ > {
1307
+ return this.handleOperation(async () => {
1308
+ const body = { ...DEFAULT_SEARCH_OPTIONS, ...options, prefix: path || '' }
1309
+ return await post(
1310
+ this.fetch,
1311
+ `${this.url}/object/list/${this.bucketId}`,
1312
+ body,
1313
+ { headers: this.headers },
1314
+ parameters
1315
+ )
1316
+ })
1317
+ }
1318
+
1319
+ /**
1320
+ * Lists all the files and folders within a bucket using the V2 API with pagination support.
1321
+ *
1322
+ * **Important:** Folder entries in the `folders` array only contain `name` and optionally `key` —
1323
+ * they have no `id`, timestamps, or `metadata` fields. Full file metadata is only available
1324
+ * on entries in the `objects` array.
1325
+ *
1326
+ * @experimental this method signature might change in the future
1327
+ *
1328
+ * @category Storage
1329
+ * @subcategory File Buckets
1330
+ * @param options Search options including prefix, cursor for pagination, limit, with_delimiter
1331
+ * @param parameters Optional fetch parameters including signal for cancellation
1332
+ * @returns Promise with response containing folders/objects arrays with pagination info or error
1333
+ *
1334
+ * @example List files with pagination
1335
+ * ```js
1336
+ * const { data, error } = await supabase
1337
+ * .storage
1338
+ * .from('avatars')
1339
+ * .listV2({
1340
+ * prefix: 'folder/',
1341
+ * limit: 100,
1342
+ * })
1343
+ *
1344
+ * // Handle pagination
1345
+ * if (data?.hasNext) {
1346
+ * const nextPage = await supabase
1347
+ * .storage
1348
+ * .from('avatars')
1349
+ * .listV2({
1350
+ * prefix: 'folder/',
1351
+ * cursor: data.nextCursor,
1352
+ * })
1353
+ * }
1354
+ *
1355
+ * // Handle files vs folders
1356
+ * data?.objects.forEach(file => {
1357
+ * if (file.id !== null) {
1358
+ * console.log('File:', file.name, 'Size:', file.metadata?.size)
1359
+ * }
1360
+ * })
1361
+ * data?.folders.forEach(folder => {
1362
+ * console.log('Folder:', folder.name)
1363
+ * })
1364
+ * ```
1365
+ */
1366
+ async listV2(
1367
+ options?: SearchV2Options,
1368
+ parameters?: FetchParameters
1369
+ ): Promise<
1370
+ | {
1371
+ data: SearchV2Result
1372
+ error: null
1373
+ }
1374
+ | {
1375
+ data: null
1376
+ error: StorageError
1377
+ }
1378
+ > {
1379
+ return this.handleOperation(async () => {
1380
+ const body = { ...options }
1381
+ return await post(
1382
+ this.fetch,
1383
+ `${this.url}/object/list-v2/${this.bucketId}`,
1384
+ body,
1385
+ { headers: this.headers },
1386
+ parameters
1387
+ )
1388
+ })
1389
+ }
1390
+
1391
+ protected encodeMetadata(metadata: Record<string, any>) {
1392
+ return JSON.stringify(metadata)
1393
+ }
1394
+
1395
+ toBase64(data: string) {
1396
+ if (typeof Buffer !== 'undefined') {
1397
+ return Buffer.from(data).toString('base64')
1398
+ }
1399
+ return btoa(data)
1400
+ }
1401
+
1402
+ private _getFinalPath(path: string) {
1403
+ return `${this.bucketId}/${path.replace(/^\/+/, '')}`
1404
+ }
1405
+
1406
+ private _removeEmptyFolders(path: string) {
1407
+ return path.replace(/^\/|\/$/g, '').replace(/\/+/g, '/')
1408
+ }
1409
+
1410
+ /** Modifies the `query`, appending values the from `transform` */
1411
+ private applyTransformOptsToQuery(
1412
+ query: URLSearchParams,
1413
+ transform: TransformOptions
1414
+ ): URLSearchParams {
1415
+ if (transform.width) query.set('width', transform.width.toString())
1416
+ if (transform.height) query.set('height', transform.height.toString())
1417
+ if (transform.resize) query.set('resize', transform.resize)
1418
+ if (transform.format) query.set('format', transform.format)
1419
+ if (transform.quality) query.set('quality', transform.quality.toString())
1420
+
1421
+ return query
1422
+ }
1423
+ }