@backendrelay/core 1.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (598) hide show
  1. package/dist/standalone/index.js +1 -1
  2. package/dist/standalone/index.umd.cjs +1 -1
  3. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts +20 -0
  4. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
  5. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js +5 -0
  6. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typeUtils.js.map +1 -0
  7. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts +2 -0
  8. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
  9. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js +88 -0
  10. package/node_modules/@backendrelay/admin/dist/commonjs/__types__/typesTests.js.map +1 -0
  11. package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts +2 -0
  12. package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.d.ts.map +1 -0
  13. package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js +131 -0
  14. package/node_modules/@backendrelay/admin/dist/commonjs/byop.live.e2e.test.js.map +1 -0
  15. package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts +2 -0
  16. package/node_modules/@backendrelay/admin/dist/commonjs/config.test.d.ts.map +1 -0
  17. package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js +65 -0
  18. package/node_modules/@backendrelay/admin/dist/commonjs/config.test.js.map +1 -0
  19. package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts +725 -0
  20. package/node_modules/@backendrelay/admin/dist/commonjs/index.d.ts.map +1 -0
  21. package/node_modules/@backendrelay/admin/dist/commonjs/index.js +1159 -0
  22. package/node_modules/@backendrelay/admin/dist/commonjs/index.js.map +1 -0
  23. package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts +2 -0
  24. package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.d.ts.map +1 -0
  25. package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js +91 -0
  26. package/node_modules/@backendrelay/admin/dist/commonjs/live.e2e.test.js.map +1 -0
  27. package/node_modules/@backendrelay/admin/dist/commonjs/package.json +3 -0
  28. package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts +17 -0
  29. package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.d.ts.map +1 -0
  30. package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js +26 -0
  31. package/node_modules/@backendrelay/admin/dist/commonjs/polyfill.js.map +1 -0
  32. package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts +2 -0
  33. package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.d.ts.map +1 -0
  34. package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js +50 -0
  35. package/node_modules/@backendrelay/admin/dist/commonjs/removed-features.test.js.map +1 -0
  36. package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts +2 -0
  37. package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.d.ts.map +1 -0
  38. package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js +33 -0
  39. package/node_modules/@backendrelay/admin/dist/commonjs/storage-upload.test.js.map +1 -0
  40. package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts +39 -0
  41. package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.d.ts.map +1 -0
  42. package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js +306 -0
  43. package/node_modules/@backendrelay/admin/dist/commonjs/subscribe.js.map +1 -0
  44. package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts +3 -0
  45. package/node_modules/@backendrelay/admin/dist/commonjs/version.d.ts.map +1 -0
  46. package/node_modules/@backendrelay/admin/dist/commonjs/version.js +5 -0
  47. package/node_modules/@backendrelay/admin/dist/commonjs/version.js.map +1 -0
  48. package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts +20 -0
  49. package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.d.ts.map +1 -0
  50. package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js +4 -0
  51. package/node_modules/@backendrelay/admin/dist/esm/__types__/typeUtils.js.map +1 -0
  52. package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts +2 -0
  53. package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.d.ts.map +1 -0
  54. package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js +86 -0
  55. package/node_modules/@backendrelay/admin/dist/esm/__types__/typesTests.js.map +1 -0
  56. package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts +2 -0
  57. package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.d.ts.map +1 -0
  58. package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js +129 -0
  59. package/node_modules/@backendrelay/admin/dist/esm/byop.live.e2e.test.js.map +1 -0
  60. package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts +2 -0
  61. package/node_modules/@backendrelay/admin/dist/esm/config.test.d.ts.map +1 -0
  62. package/node_modules/@backendrelay/admin/dist/esm/config.test.js +63 -0
  63. package/node_modules/@backendrelay/admin/dist/esm/config.test.js.map +1 -0
  64. package/node_modules/@backendrelay/admin/dist/esm/index.d.ts +725 -0
  65. package/node_modules/@backendrelay/admin/dist/esm/index.d.ts.map +1 -0
  66. package/node_modules/@backendrelay/admin/dist/esm/index.js +1146 -0
  67. package/node_modules/@backendrelay/admin/dist/esm/index.js.map +1 -0
  68. package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts +2 -0
  69. package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.d.ts.map +1 -0
  70. package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js +89 -0
  71. package/node_modules/@backendrelay/admin/dist/esm/live.e2e.test.js.map +1 -0
  72. package/node_modules/@backendrelay/admin/dist/esm/package.json +3 -0
  73. package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts +17 -0
  74. package/node_modules/@backendrelay/admin/dist/esm/polyfill.d.ts.map +1 -0
  75. package/node_modules/@backendrelay/admin/dist/esm/polyfill.js +22 -0
  76. package/node_modules/@backendrelay/admin/dist/esm/polyfill.js.map +1 -0
  77. package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts +2 -0
  78. package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.d.ts.map +1 -0
  79. package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js +48 -0
  80. package/node_modules/@backendrelay/admin/dist/esm/removed-features.test.js.map +1 -0
  81. package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts +2 -0
  82. package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.d.ts.map +1 -0
  83. package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js +31 -0
  84. package/node_modules/@backendrelay/admin/dist/esm/storage-upload.test.js.map +1 -0
  85. package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts +39 -0
  86. package/node_modules/@backendrelay/admin/dist/esm/subscribe.d.ts.map +1 -0
  87. package/node_modules/@backendrelay/admin/dist/esm/subscribe.js +300 -0
  88. package/node_modules/@backendrelay/admin/dist/esm/subscribe.js.map +1 -0
  89. package/node_modules/@backendrelay/admin/dist/esm/version.d.ts +3 -0
  90. package/node_modules/@backendrelay/admin/dist/esm/version.d.ts.map +1 -0
  91. package/{src/version.ts → node_modules/@backendrelay/admin/dist/esm/version.js} +1 -1
  92. package/node_modules/@backendrelay/admin/dist/esm/version.js.map +1 -0
  93. package/node_modules/@backendrelay/admin/package.json +52 -0
  94. package/node_modules/@backendrelay/functions/README.md +131 -0
  95. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts +3 -0
  96. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
  97. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js +3 -0
  98. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typeUtils.js.map +1 -0
  99. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts +2 -0
  100. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
  101. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js +51 -0
  102. package/node_modules/@backendrelay/functions/dist/commonjs/__types__/typesTests.js.map +1 -0
  103. package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts +230 -0
  104. package/node_modules/@backendrelay/functions/dist/commonjs/index.d.ts.map +1 -0
  105. package/node_modules/@backendrelay/functions/dist/commonjs/index.js +415 -0
  106. package/node_modules/@backendrelay/functions/dist/commonjs/index.js.map +1 -0
  107. package/node_modules/@backendrelay/functions/dist/commonjs/package.json +3 -0
  108. package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts +3 -0
  109. package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.d.ts.map +1 -0
  110. package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js +2 -0
  111. package/node_modules/@backendrelay/functions/dist/esm/__types__/typeUtils.js.map +1 -0
  112. package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts +2 -0
  113. package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.d.ts.map +1 -0
  114. package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js +49 -0
  115. package/node_modules/@backendrelay/functions/dist/esm/__types__/typesTests.js.map +1 -0
  116. package/node_modules/@backendrelay/functions/dist/esm/index.d.ts +230 -0
  117. package/node_modules/@backendrelay/functions/dist/esm/index.d.ts.map +1 -0
  118. package/node_modules/@backendrelay/functions/dist/esm/index.js +403 -0
  119. package/node_modules/@backendrelay/functions/dist/esm/index.js.map +1 -0
  120. package/node_modules/@backendrelay/functions/dist/esm/package.json +3 -0
  121. package/node_modules/@backendrelay/functions/package.json +49 -0
  122. package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts +43 -0
  123. package/node_modules/@backendrelay/hatchet/dist/commonjs/index.d.ts.map +1 -0
  124. package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js +63 -0
  125. package/node_modules/@backendrelay/hatchet/dist/commonjs/index.js.map +1 -0
  126. package/node_modules/@backendrelay/hatchet/dist/commonjs/package.json +3 -0
  127. package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts +43 -0
  128. package/node_modules/@backendrelay/hatchet/dist/esm/index.d.ts.map +1 -0
  129. package/node_modules/@backendrelay/hatchet/dist/esm/index.js +59 -0
  130. package/node_modules/@backendrelay/hatchet/dist/esm/index.js.map +1 -0
  131. package/node_modules/@backendrelay/hatchet/dist/esm/package.json +3 -0
  132. package/node_modules/@backendrelay/hatchet/package.json +46 -0
  133. package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts +18 -0
  134. package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.d.ts.map +1 -0
  135. package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js +77 -0
  136. package/node_modules/@backendrelay/platform/dist/commonjs/ProgressPromise.js.map +1 -0
  137. package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts +99 -0
  138. package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.d.ts.map +1 -0
  139. package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js +177 -0
  140. package/node_modules/@backendrelay/platform/dist/commonjs/api/apps.js.map +1 -0
  141. package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts +7 -0
  142. package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.d.ts.map +1 -0
  143. package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js +15 -0
  144. package/node_modules/@backendrelay/platform/dist/commonjs/api/auth.js.map +1 -0
  145. package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts +3 -0
  146. package/node_modules/@backendrelay/platform/dist/commonjs/api/http.d.ts.map +1 -0
  147. package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js +46 -0
  148. package/node_modules/@backendrelay/platform/dist/commonjs/api/http.js.map +1 -0
  149. package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts +13 -0
  150. package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.d.ts.map +1 -0
  151. package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js +25 -0
  152. package/node_modules/@backendrelay/platform/dist/commonjs/api/perms.js.map +1 -0
  153. package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts +285 -0
  154. package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.d.ts.map +1 -0
  155. package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js +426 -0
  156. package/node_modules/@backendrelay/platform/dist/commonjs/api/platform-api.js.map +1 -0
  157. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts +24 -0
  158. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.d.ts.map +1 -0
  159. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js +108 -0
  160. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema-coerce.js.map +1 -0
  161. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts +188 -0
  162. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.d.ts.map +1 -0
  163. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js +412 -0
  164. package/node_modules/@backendrelay/platform/dist/commonjs/api/schema.js.map +1 -0
  165. package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts +9 -0
  166. package/node_modules/@backendrelay/platform/dist/commonjs/api.d.ts.map +1 -0
  167. package/node_modules/@backendrelay/platform/dist/commonjs/api.js +12 -0
  168. package/node_modules/@backendrelay/platform/dist/commonjs/api.js.map +1 -0
  169. package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts +89 -0
  170. package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.d.ts.map +1 -0
  171. package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js +357 -0
  172. package/node_modules/@backendrelay/platform/dist/commonjs/backupDownload.js.map +1 -0
  173. package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts +146 -0
  174. package/node_modules/@backendrelay/platform/dist/commonjs/backups.d.ts.map +1 -0
  175. package/node_modules/@backendrelay/platform/dist/commonjs/backups.js +251 -0
  176. package/node_modules/@backendrelay/platform/dist/commonjs/backups.js.map +1 -0
  177. package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts +2 -0
  178. package/node_modules/@backendrelay/platform/dist/commonjs/clerk.d.ts.map +1 -0
  179. package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js +29 -0
  180. package/node_modules/@backendrelay/platform/dist/commonjs/clerk.js.map +1 -0
  181. package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts +11 -0
  182. package/node_modules/@backendrelay/platform/dist/commonjs/consts.d.ts.map +1 -0
  183. package/node_modules/@backendrelay/platform/dist/commonjs/consts.js +17 -0
  184. package/node_modules/@backendrelay/platform/dist/commonjs/consts.js.map +1 -0
  185. package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts +4 -0
  186. package/node_modules/@backendrelay/platform/dist/commonjs/crypto.d.ts.map +1 -0
  187. package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js +26 -0
  188. package/node_modules/@backendrelay/platform/dist/commonjs/crypto.js.map +1 -0
  189. package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts +19 -0
  190. package/node_modules/@backendrelay/platform/dist/commonjs/index.d.ts.map +1 -0
  191. package/node_modules/@backendrelay/platform/dist/commonjs/index.js +76 -0
  192. package/node_modules/@backendrelay/platform/dist/commonjs/index.js.map +1 -0
  193. package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts +4 -0
  194. package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.d.ts.map +1 -0
  195. package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js +52 -0
  196. package/node_modules/@backendrelay/platform/dist/commonjs/migrationUtils.js.map +1 -0
  197. package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts +99 -0
  198. package/node_modules/@backendrelay/platform/dist/commonjs/migrations.d.ts.map +1 -0
  199. package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js +597 -0
  200. package/node_modules/@backendrelay/platform/dist/commonjs/migrations.js.map +1 -0
  201. package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts +98 -0
  202. package/node_modules/@backendrelay/platform/dist/commonjs/oauth.d.ts.map +1 -0
  203. package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js +275 -0
  204. package/node_modules/@backendrelay/platform/dist/commonjs/oauth.js.map +1 -0
  205. package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts +12 -0
  206. package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.d.ts.map +1 -0
  207. package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js +26 -0
  208. package/node_modules/@backendrelay/platform/dist/commonjs/oauthCommon.js.map +1 -0
  209. package/node_modules/@backendrelay/platform/dist/commonjs/package.json +3 -0
  210. package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts +3 -0
  211. package/node_modules/@backendrelay/platform/dist/commonjs/perms.d.ts.map +1 -0
  212. package/node_modules/@backendrelay/platform/dist/commonjs/perms.js +66 -0
  213. package/node_modules/@backendrelay/platform/dist/commonjs/perms.js.map +1 -0
  214. package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts +13 -0
  215. package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.d.ts.map +1 -0
  216. package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js +31 -0
  217. package/node_modules/@backendrelay/platform/dist/commonjs/privateFields.js.map +1 -0
  218. package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts +7 -0
  219. package/node_modules/@backendrelay/platform/dist/commonjs/relationships.d.ts.map +1 -0
  220. package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js +46 -0
  221. package/node_modules/@backendrelay/platform/dist/commonjs/relationships.js.map +1 -0
  222. package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts +161 -0
  223. package/node_modules/@backendrelay/platform/dist/commonjs/schema.d.ts.map +1 -0
  224. package/node_modules/@backendrelay/platform/dist/commonjs/schema.js +174 -0
  225. package/node_modules/@backendrelay/platform/dist/commonjs/schema.js.map +1 -0
  226. package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts +25 -0
  227. package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.d.ts.map +1 -0
  228. package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js +68 -0
  229. package/node_modules/@backendrelay/platform/dist/commonjs/serverOAuth.js.map +1 -0
  230. package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts +17 -0
  231. package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.d.ts.map +1 -0
  232. package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js +314 -0
  233. package/node_modules/@backendrelay/platform/dist/commonjs/typescript-schema.js.map +1 -0
  234. package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts +13 -0
  235. package/node_modules/@backendrelay/platform/dist/commonjs/util.d.ts.map +1 -0
  236. package/node_modules/@backendrelay/platform/dist/commonjs/util.js +55 -0
  237. package/node_modules/@backendrelay/platform/dist/commonjs/util.js.map +1 -0
  238. package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts +3 -0
  239. package/node_modules/@backendrelay/platform/dist/commonjs/version.d.ts.map +1 -0
  240. package/node_modules/@backendrelay/platform/dist/commonjs/version.js +5 -0
  241. package/node_modules/@backendrelay/platform/dist/commonjs/version.js.map +1 -0
  242. package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts +18 -0
  243. package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.d.ts.map +1 -0
  244. package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js +73 -0
  245. package/node_modules/@backendrelay/platform/dist/esm/ProgressPromise.js.map +1 -0
  246. package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts +99 -0
  247. package/node_modules/@backendrelay/platform/dist/esm/api/apps.d.ts.map +1 -0
  248. package/node_modules/@backendrelay/platform/dist/esm/api/apps.js +165 -0
  249. package/node_modules/@backendrelay/platform/dist/esm/api/apps.js.map +1 -0
  250. package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts +7 -0
  251. package/node_modules/@backendrelay/platform/dist/esm/api/auth.d.ts.map +1 -0
  252. package/node_modules/@backendrelay/platform/dist/esm/api/auth.js +12 -0
  253. package/node_modules/@backendrelay/platform/dist/esm/api/auth.js.map +1 -0
  254. package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts +3 -0
  255. package/node_modules/@backendrelay/platform/dist/esm/api/http.d.ts.map +1 -0
  256. package/node_modules/@backendrelay/platform/dist/esm/api/http.js +39 -0
  257. package/node_modules/@backendrelay/platform/dist/esm/api/http.js.map +1 -0
  258. package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts +13 -0
  259. package/node_modules/@backendrelay/platform/dist/esm/api/perms.d.ts.map +1 -0
  260. package/node_modules/@backendrelay/platform/dist/esm/api/perms.js +21 -0
  261. package/node_modules/@backendrelay/platform/dist/esm/api/perms.js.map +1 -0
  262. package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts +285 -0
  263. package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.d.ts.map +1 -0
  264. package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js +421 -0
  265. package/node_modules/@backendrelay/platform/dist/esm/api/platform-api.js.map +1 -0
  266. package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts +24 -0
  267. package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.d.ts.map +1 -0
  268. package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js +99 -0
  269. package/node_modules/@backendrelay/platform/dist/esm/api/schema-coerce.js.map +1 -0
  270. package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts +188 -0
  271. package/node_modules/@backendrelay/platform/dist/esm/api/schema.d.ts.map +1 -0
  272. package/node_modules/@backendrelay/platform/dist/esm/api/schema.js +393 -0
  273. package/node_modules/@backendrelay/platform/dist/esm/api/schema.js.map +1 -0
  274. package/node_modules/@backendrelay/platform/dist/esm/api.d.ts +9 -0
  275. package/node_modules/@backendrelay/platform/dist/esm/api.d.ts.map +1 -0
  276. package/node_modules/@backendrelay/platform/dist/esm/api.js +4 -0
  277. package/node_modules/@backendrelay/platform/dist/esm/api.js.map +1 -0
  278. package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts +89 -0
  279. package/node_modules/@backendrelay/platform/dist/esm/backupDownload.d.ts.map +1 -0
  280. package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js +354 -0
  281. package/node_modules/@backendrelay/platform/dist/esm/backupDownload.js.map +1 -0
  282. package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts +146 -0
  283. package/node_modules/@backendrelay/platform/dist/esm/backups.d.ts.map +1 -0
  284. package/node_modules/@backendrelay/platform/dist/esm/backups.js +240 -0
  285. package/node_modules/@backendrelay/platform/dist/esm/backups.js.map +1 -0
  286. package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts +2 -0
  287. package/node_modules/@backendrelay/platform/dist/esm/clerk.d.ts.map +1 -0
  288. package/node_modules/@backendrelay/platform/dist/esm/clerk.js +26 -0
  289. package/node_modules/@backendrelay/platform/dist/esm/clerk.js.map +1 -0
  290. package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts +11 -0
  291. package/node_modules/@backendrelay/platform/dist/esm/consts.d.ts.map +1 -0
  292. package/node_modules/@backendrelay/platform/dist/esm/consts.js +13 -0
  293. package/node_modules/@backendrelay/platform/dist/esm/consts.js.map +1 -0
  294. package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts +4 -0
  295. package/node_modules/@backendrelay/platform/dist/esm/crypto.d.ts.map +1 -0
  296. package/node_modules/@backendrelay/platform/dist/esm/crypto.js +21 -0
  297. package/node_modules/@backendrelay/platform/dist/esm/crypto.js.map +1 -0
  298. package/node_modules/@backendrelay/platform/dist/esm/index.d.ts +19 -0
  299. package/node_modules/@backendrelay/platform/dist/esm/index.d.ts.map +1 -0
  300. package/node_modules/@backendrelay/platform/dist/esm/index.js +18 -0
  301. package/node_modules/@backendrelay/platform/dist/esm/index.js.map +1 -0
  302. package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts +4 -0
  303. package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.d.ts.map +1 -0
  304. package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js +47 -0
  305. package/node_modules/@backendrelay/platform/dist/esm/migrationUtils.js.map +1 -0
  306. package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts +99 -0
  307. package/node_modules/@backendrelay/platform/dist/esm/migrations.d.ts.map +1 -0
  308. package/node_modules/@backendrelay/platform/dist/esm/migrations.js +588 -0
  309. package/node_modules/@backendrelay/platform/dist/esm/migrations.js.map +1 -0
  310. package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts +98 -0
  311. package/node_modules/@backendrelay/platform/dist/esm/oauth.d.ts.map +1 -0
  312. package/node_modules/@backendrelay/platform/dist/esm/oauth.js +266 -0
  313. package/node_modules/@backendrelay/platform/dist/esm/oauth.js.map +1 -0
  314. package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts +12 -0
  315. package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.d.ts.map +1 -0
  316. package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js +22 -0
  317. package/node_modules/@backendrelay/platform/dist/esm/oauthCommon.js.map +1 -0
  318. package/node_modules/@backendrelay/platform/dist/esm/package.json +3 -0
  319. package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts +3 -0
  320. package/node_modules/@backendrelay/platform/dist/esm/perms.d.ts.map +1 -0
  321. package/node_modules/@backendrelay/platform/dist/esm/perms.js +62 -0
  322. package/node_modules/@backendrelay/platform/dist/esm/perms.js.map +1 -0
  323. package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts +13 -0
  324. package/node_modules/@backendrelay/platform/dist/esm/privateFields.d.ts.map +1 -0
  325. package/node_modules/@backendrelay/platform/dist/esm/privateFields.js +28 -0
  326. package/node_modules/@backendrelay/platform/dist/esm/privateFields.js.map +1 -0
  327. package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts +7 -0
  328. package/node_modules/@backendrelay/platform/dist/esm/relationships.d.ts.map +1 -0
  329. package/node_modules/@backendrelay/platform/dist/esm/relationships.js +43 -0
  330. package/node_modules/@backendrelay/platform/dist/esm/relationships.js.map +1 -0
  331. package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts +161 -0
  332. package/node_modules/@backendrelay/platform/dist/esm/schema.d.ts.map +1 -0
  333. package/node_modules/@backendrelay/platform/dist/esm/schema.js +158 -0
  334. package/node_modules/@backendrelay/platform/dist/esm/schema.js.map +1 -0
  335. package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts +25 -0
  336. package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.d.ts.map +1 -0
  337. package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js +64 -0
  338. package/node_modules/@backendrelay/platform/dist/esm/serverOAuth.js.map +1 -0
  339. package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts +17 -0
  340. package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.d.ts.map +1 -0
  341. package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js +310 -0
  342. package/node_modules/@backendrelay/platform/dist/esm/typescript-schema.js.map +1 -0
  343. package/node_modules/@backendrelay/platform/dist/esm/util.d.ts +13 -0
  344. package/node_modules/@backendrelay/platform/dist/esm/util.d.ts.map +1 -0
  345. package/node_modules/@backendrelay/platform/dist/esm/util.js +46 -0
  346. package/node_modules/@backendrelay/platform/dist/esm/util.js.map +1 -0
  347. package/node_modules/@backendrelay/platform/dist/esm/version.d.ts +3 -0
  348. package/node_modules/@backendrelay/platform/dist/esm/version.d.ts.map +1 -0
  349. package/node_modules/@backendrelay/platform/dist/esm/version.js +3 -0
  350. package/node_modules/@backendrelay/platform/dist/esm/version.js.map +1 -0
  351. package/node_modules/@backendrelay/platform/dist/standalone/index.js +13738 -0
  352. package/node_modules/@backendrelay/platform/dist/standalone/index.umd.cjs +72 -0
  353. package/node_modules/@backendrelay/platform/package.json +51 -0
  354. package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts +67 -0
  355. package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.d.ts.map +1 -0
  356. package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js +129 -0
  357. package/node_modules/@backendrelay/resumable-stream/dist/commonjs/index.js.map +1 -0
  358. package/node_modules/@backendrelay/resumable-stream/dist/commonjs/package.json +3 -0
  359. package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts +67 -0
  360. package/node_modules/@backendrelay/resumable-stream/dist/esm/index.d.ts.map +1 -0
  361. package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js +126 -0
  362. package/node_modules/@backendrelay/resumable-stream/dist/esm/index.js.map +1 -0
  363. package/node_modules/@backendrelay/resumable-stream/dist/esm/package.json +3 -0
  364. package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.js +4354 -0
  365. package/node_modules/@backendrelay/resumable-stream/dist/standalone/index.umd.cjs +6 -0
  366. package/node_modules/@backendrelay/resumable-stream/package.json +47 -0
  367. package/node_modules/@backendrelay/rules/README.md +34 -0
  368. package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts +117 -0
  369. package/node_modules/@backendrelay/rules/dist/commonjs/index.d.ts.map +1 -0
  370. package/node_modules/@backendrelay/rules/dist/commonjs/index.js +68 -0
  371. package/node_modules/@backendrelay/rules/dist/commonjs/index.js.map +1 -0
  372. package/node_modules/@backendrelay/rules/dist/commonjs/package.json +3 -0
  373. package/node_modules/@backendrelay/rules/dist/esm/index.d.ts +117 -0
  374. package/node_modules/@backendrelay/rules/dist/esm/index.d.ts.map +1 -0
  375. package/node_modules/@backendrelay/rules/dist/esm/index.js +64 -0
  376. package/node_modules/@backendrelay/rules/dist/esm/index.js.map +1 -0
  377. package/node_modules/@backendrelay/rules/dist/esm/package.json +3 -0
  378. package/node_modules/@backendrelay/rules/package.json +46 -0
  379. package/node_modules/@backendrelay/test/README.md +75 -0
  380. package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts +74 -0
  381. package/node_modules/@backendrelay/test/dist/commonjs/index.d.ts.map +1 -0
  382. package/node_modules/@backendrelay/test/dist/commonjs/index.js +197 -0
  383. package/node_modules/@backendrelay/test/dist/commonjs/index.js.map +1 -0
  384. package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts +2 -0
  385. package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.d.ts.map +1 -0
  386. package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js +45 -0
  387. package/node_modules/@backendrelay/test/dist/commonjs/live.e2e.test.js.map +1 -0
  388. package/node_modules/@backendrelay/test/dist/commonjs/package.json +3 -0
  389. package/node_modules/@backendrelay/test/dist/esm/index.d.ts +74 -0
  390. package/node_modules/@backendrelay/test/dist/esm/index.d.ts.map +1 -0
  391. package/node_modules/@backendrelay/test/dist/esm/index.js +192 -0
  392. package/node_modules/@backendrelay/test/dist/esm/index.js.map +1 -0
  393. package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts +2 -0
  394. package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.d.ts.map +1 -0
  395. package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js +43 -0
  396. package/node_modules/@backendrelay/test/dist/esm/live.e2e.test.js.map +1 -0
  397. package/node_modules/@backendrelay/test/dist/esm/package.json +3 -0
  398. package/node_modules/@backendrelay/test/package.json +49 -0
  399. package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts +3 -0
  400. package/node_modules/@backendrelay/version/dist/commonjs/index.d.ts.map +1 -0
  401. package/node_modules/@backendrelay/version/dist/commonjs/index.js +6 -0
  402. package/node_modules/@backendrelay/version/dist/commonjs/index.js.map +1 -0
  403. package/node_modules/@backendrelay/version/dist/commonjs/package.json +3 -0
  404. package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts +3 -0
  405. package/node_modules/@backendrelay/version/dist/commonjs/version.d.ts.map +1 -0
  406. package/node_modules/@backendrelay/version/dist/commonjs/version.js +10 -0
  407. package/node_modules/@backendrelay/version/dist/commonjs/version.js.map +1 -0
  408. package/node_modules/@backendrelay/version/dist/esm/index.d.ts +3 -0
  409. package/node_modules/@backendrelay/version/dist/esm/index.d.ts.map +1 -0
  410. package/node_modules/@backendrelay/version/dist/esm/index.js +3 -0
  411. package/node_modules/@backendrelay/version/dist/esm/index.js.map +1 -0
  412. package/node_modules/@backendrelay/version/dist/esm/package.json +3 -0
  413. package/node_modules/@backendrelay/version/dist/esm/version.d.ts +3 -0
  414. package/node_modules/@backendrelay/version/dist/esm/version.d.ts.map +1 -0
  415. package/node_modules/@backendrelay/version/dist/esm/version.js +7 -0
  416. package/node_modules/@backendrelay/version/dist/esm/version.js.map +1 -0
  417. package/node_modules/@backendrelay/version/dist/standalone/index.js +4 -0
  418. package/node_modules/@backendrelay/version/dist/standalone/index.umd.cjs +1 -0
  419. package/node_modules/@backendrelay/version/package.json +44 -0
  420. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts +12 -0
  421. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.d.ts.map +1 -0
  422. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js +5 -0
  423. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typeUtils.js.map +1 -0
  424. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts +2 -0
  425. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.d.ts.map +1 -0
  426. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js +82 -0
  427. package/node_modules/@backendrelay/webhooks/dist/commonjs/__types__/typesTests.js.map +1 -0
  428. package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts +607 -0
  429. package/node_modules/@backendrelay/webhooks/dist/commonjs/index.d.ts.map +1 -0
  430. package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js +830 -0
  431. package/node_modules/@backendrelay/webhooks/dist/commonjs/index.js.map +1 -0
  432. package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts +2 -0
  433. package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.d.ts.map +1 -0
  434. package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js +139 -0
  435. package/node_modules/@backendrelay/webhooks/dist/commonjs/live.e2e.test.js.map +1 -0
  436. package/node_modules/@backendrelay/webhooks/dist/commonjs/package.json +3 -0
  437. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts +12 -0
  438. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.d.ts.map +1 -0
  439. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js +4 -0
  440. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typeUtils.js.map +1 -0
  441. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts +2 -0
  442. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.d.ts.map +1 -0
  443. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js +80 -0
  444. package/node_modules/@backendrelay/webhooks/dist/esm/__types__/typesTests.js.map +1 -0
  445. package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts +607 -0
  446. package/node_modules/@backendrelay/webhooks/dist/esm/index.d.ts.map +1 -0
  447. package/node_modules/@backendrelay/webhooks/dist/esm/index.js +825 -0
  448. package/node_modules/@backendrelay/webhooks/dist/esm/index.js.map +1 -0
  449. package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts +2 -0
  450. package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.d.ts.map +1 -0
  451. package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js +137 -0
  452. package/node_modules/@backendrelay/webhooks/dist/esm/live.e2e.test.js.map +1 -0
  453. package/node_modules/@backendrelay/webhooks/dist/esm/package.json +3 -0
  454. package/node_modules/@backendrelay/webhooks/package.json +46 -0
  455. package/package.json +129 -56
  456. package/subpaths/admin/index.cjs +1 -0
  457. package/subpaths/admin/index.d.ts +1 -0
  458. package/subpaths/admin/index.mjs +3 -0
  459. package/subpaths/functions/index.cjs +1 -0
  460. package/subpaths/functions/index.d.ts +1 -0
  461. package/subpaths/functions/index.mjs +3 -0
  462. package/subpaths/hatchet/index.cjs +1 -0
  463. package/subpaths/hatchet/index.d.ts +1 -0
  464. package/subpaths/hatchet/index.mjs +3 -0
  465. package/subpaths/platform/index.cjs +1 -0
  466. package/subpaths/platform/index.d.ts +1 -0
  467. package/subpaths/platform/index.mjs +3 -0
  468. package/subpaths/resumable-stream/index.cjs +1 -0
  469. package/subpaths/resumable-stream/index.d.ts +1 -0
  470. package/subpaths/resumable-stream/index.mjs +3 -0
  471. package/subpaths/rules/index.cjs +1 -0
  472. package/subpaths/rules/index.d.ts +1 -0
  473. package/subpaths/rules/index.mjs +3 -0
  474. package/subpaths/test/index.cjs +1 -0
  475. package/subpaths/test/index.d.ts +1 -0
  476. package/subpaths/test/index.mjs +3 -0
  477. package/subpaths/version/index.cjs +1 -0
  478. package/subpaths/version/index.d.ts +1 -0
  479. package/subpaths/version/index.mjs +3 -0
  480. package/subpaths/webhooks/index.cjs +1 -0
  481. package/subpaths/webhooks/index.d.ts +1 -0
  482. package/subpaths/webhooks/index.mjs +3 -0
  483. package/.tshy/build.json +0 -8
  484. package/.tshy/commonjs.json +0 -16
  485. package/.tshy/esm.json +0 -15
  486. package/__example__/standalone.esm.html +0 -23
  487. package/__example__/standalone.umd.html +0 -21
  488. package/__tests__/src/Connection.test.ts +0 -292
  489. package/__tests__/src/IndexedDBStorage.test.ts +0 -96
  490. package/__tests__/src/Reactor.test.ts +0 -1179
  491. package/__tests__/src/auth-extra-fields.e2e.test.ts +0 -160
  492. package/__tests__/src/byop.e2e.test.ts +0 -762
  493. package/__tests__/src/config.test.ts +0 -85
  494. package/__tests__/src/cookieSync.e2e.test.ts +0 -163
  495. package/__tests__/src/data/movies/attrs.json +0 -145
  496. package/__tests__/src/data/movies/triples.json +0 -1507
  497. package/__tests__/src/data/zeneca/attrs.json +0 -251
  498. package/__tests__/src/data/zeneca/triples.json +0 -15854
  499. package/__tests__/src/datalog.test.ts +0 -175
  500. package/__tests__/src/devtool.test.ts +0 -23
  501. package/__tests__/src/framework.test.ts +0 -173
  502. package/__tests__/src/infiniteQuery.e2e.test.ts +0 -467
  503. package/__tests__/src/instaml.test.ts +0 -1593
  504. package/__tests__/src/instaql.bench.ts +0 -34
  505. package/__tests__/src/instaql.test.ts +0 -1497
  506. package/__tests__/src/instaqlInference.test.ts +0 -243
  507. package/__tests__/src/presence.test.ts +0 -49
  508. package/__tests__/src/queryValidation.test.ts +0 -1101
  509. package/__tests__/src/schema.test.ts +0 -653
  510. package/__tests__/src/serializeSchema.test.ts +0 -123
  511. package/__tests__/src/simple.e2e.test.ts +0 -133
  512. package/__tests__/src/storage-upload.test.ts +0 -37
  513. package/__tests__/src/store.test.ts +0 -960
  514. package/__tests__/src/syncTable.e2e.test.ts +0 -245
  515. package/__tests__/src/syncTable.test.ts +0 -235
  516. package/__tests__/src/transactionValidation.test.ts +0 -450
  517. package/__tests__/src/typeUtils.ts +0 -39
  518. package/__tests__/src/upstream-improvements.e2e.test.ts +0 -54
  519. package/__tests__/src/utils/MutationStorage.test.ts +0 -77
  520. package/__tests__/src/utils/PersistedObject.test.ts +0 -569
  521. package/__tests__/src/utils/dates.test.ts +0 -111
  522. package/__tests__/src/utils/e2e.ts +0 -100
  523. package/__tests__/src/utils/msw.ts +0 -3
  524. package/__tests__/src/utils/object.test.ts +0 -78
  525. package/__tests__/src/utils/weakHash.test.ts +0 -68
  526. package/__tests__/src/utils/weakHashLegacy.test.ts +0 -22
  527. package/__tests__/src/vite.env.d.ts +0 -1
  528. package/src/BackendRelayError.ts +0 -50
  529. package/src/Connection.ts +0 -361
  530. package/src/InMemoryStorage.ts +0 -34
  531. package/src/IndexedDBStorage.ts +0 -398
  532. package/src/Reactor.js +0 -1541
  533. package/src/StorageAPI.ts +0 -147
  534. package/src/Stream.ts +0 -1252
  535. package/src/SyncTable.ts +0 -750
  536. package/src/WindowNetworkListener.js +0 -19
  537. package/src/__types__/fieldsTypeTest.ts +0 -111
  538. package/src/__types__/typeUtils.ts +0 -39
  539. package/src/__types__/useDatesTypeTest.ts +0 -66
  540. package/src/attrTypes.ts +0 -37
  541. package/src/authAPI.ts +0 -205
  542. package/src/clientTypes.ts +0 -28
  543. package/src/coreTypes.ts +0 -58
  544. package/src/createRouteHandler.ts +0 -68
  545. package/src/datalog.js +0 -116
  546. package/src/devtool.ts +0 -179
  547. package/src/framework.ts +0 -450
  548. package/src/helperTypes.ts +0 -117
  549. package/src/index.ts +0 -1293
  550. package/src/infiniteQuery.ts +0 -599
  551. package/src/instaml.ts +0 -676
  552. package/src/instaql.ts +0 -999
  553. package/src/instatx.ts +0 -265
  554. package/src/model/instaqlResult.js +0 -25
  555. package/src/parseSchemaFromJSON.ts +0 -176
  556. package/src/presence.ts +0 -123
  557. package/src/presenceTypes.ts +0 -19
  558. package/src/queryTypes.ts +0 -749
  559. package/src/queryValidation.ts +0 -598
  560. package/src/reactorAuth.js +0 -236
  561. package/src/reactorEvents.js +0 -414
  562. package/src/reactorMutations.js +0 -354
  563. package/src/reactorRooms.js +0 -297
  564. package/src/reactorStorage.js +0 -180
  565. package/src/reactorSubs.js +0 -275
  566. package/src/reactorTransport.js +0 -391
  567. package/src/reactorTypes.ts +0 -41
  568. package/src/routeHandlerProtocol.ts +0 -25
  569. package/src/rulesTypes.ts +0 -132
  570. package/src/sanityCheckQueries.ts +0 -191
  571. package/src/schema.ts +0 -206
  572. package/src/schemaTypes.ts +0 -664
  573. package/src/store.ts +0 -1165
  574. package/src/transactionValidation.ts +0 -204
  575. package/src/urls.ts +0 -50
  576. package/src/utils/Deferred.ts +0 -20
  577. package/src/utils/MutationStorage.ts +0 -89
  578. package/src/utils/PersistedObject.ts +0 -612
  579. package/src/utils/dates.ts +0 -269
  580. package/src/utils/error.ts +0 -9
  581. package/src/utils/fetch.ts +0 -131
  582. package/src/utils/flags.ts +0 -14
  583. package/src/utils/id.ts +0 -28
  584. package/src/utils/linkIndex.ts +0 -33
  585. package/src/utils/log.ts +0 -23
  586. package/src/utils/object.js +0 -180
  587. package/src/utils/pgtime.ts +0 -199
  588. package/src/utils/pick.js +0 -9
  589. package/src/utils/strings.ts +0 -19
  590. package/src/utils/weakHash.ts +0 -77
  591. package/src/utils/weakHashLegacy.ts +0 -75
  592. package/src/warningToggle.ts +0 -5
  593. package/tsconfig.cjs.dev.json +0 -15
  594. package/tsconfig.dev.json +0 -14
  595. package/tsconfig.json +0 -13
  596. package/tsconfig.test.json +0 -5
  597. package/vite.config.ts +0 -19
  598. package/vitest.config.ts +0 -54
@@ -0,0 +1,146 @@
1
+ import type { WithAuth } from '@backendrelay/webhooks';
2
+ import { type BackupDownloadResult, type DownloadBackupArchiveOpts } from './backupDownload.ts';
3
+ /** A point-in-time snapshot of an app. */
4
+ export type AppBackup = {
5
+ /** Unique identifier for the backup. */
6
+ id: string;
7
+ /** BackendRelay sequence number the snapshot was taken at. */
8
+ isn: string;
9
+ /** When the snapshot was taken. */
10
+ backupAt: Date;
11
+ /** Total size in bytes of the app's storage files at backup time, if known. */
12
+ filesSize: number | null;
13
+ /** Size in bytes of the app's database at backup time, if known. */
14
+ dbSize: number | null;
15
+ /**
16
+ * Total uncompressed size in bytes of the backup's entity files (what they
17
+ * take up unpacked on disk), if known.
18
+ */
19
+ uncompressedSize: number | null;
20
+ /** Human-readable label, e.g. "Automated Daily Snapshot". */
21
+ description: string | null;
22
+ /** When the backup stops being available for download. */
23
+ expiresAt: Date | null;
24
+ };
25
+ /**
26
+ * A file that makes up the backup payload: `config.json` or an
27
+ * `entities/<etype>.jsonl` shard.
28
+ */
29
+ export type AppBackupFile = {
30
+ name: string;
31
+ /** Size in bytes as stored (the entity shards are stored compressed). */
32
+ size: number;
33
+ };
34
+ /** A storage file captured in a backup, with a presigned download URL. */
35
+ export type AppBackupStorageFile = {
36
+ /**
37
+ * Stable id of the file's blob. A backup archive stores the blob at
38
+ * `files/<locationId>`.
39
+ */
40
+ locationId: string;
41
+ /** The path the user uploaded the file to. */
42
+ path: string | null;
43
+ /** Presigned URL for the file's contents. Expires after 12 hours. */
44
+ url: string;
45
+ };
46
+ type AppBackupResponse = {
47
+ id: string;
48
+ isn: string;
49
+ backup_at: string;
50
+ files_size: number | null;
51
+ db_size: number | null;
52
+ uncompressed_size: number | null;
53
+ description: string | null;
54
+ expires_at: string | null;
55
+ };
56
+ /** Converts a backup row as the server sends it into an {@link AppBackup}. */
57
+ export declare function toAppBackup(row: AppBackupResponse): AppBackup;
58
+ /** Suggested filename for a backup archive. */
59
+ export declare function backupZipName(backup: AppBackup): string;
60
+ /**
61
+ * Formats a byte count the way macOS/Finder reports file sizes: decimal
62
+ * (1000-based) units with SI labels, so the number lines up with what lands
63
+ * on disk.
64
+ */
65
+ export declare function formatFileSize(n: number): string;
66
+ /**
67
+ * Estimated size range for a backup's zip archive, or null when the backup
68
+ * row carries no sizes. Upper bound: everything stored uncompressed (STORE
69
+ * mode and/or files that don't compress). Lower bound: everything compressed
70
+ * at a ~4x DEFLATE ratio, best case for text/JSON, but storage files vary
71
+ * wildly (raw text compresses well, already-compressed images/videos don't).
72
+ * The same divisor applies to both since the file types aren't visible from
73
+ * here; the actual zip lands somewhere inside the range.
74
+ */
75
+ export declare function estimateZipSize(backup: AppBackup): {
76
+ min: number;
77
+ max: number;
78
+ } | null;
79
+ /**
80
+ * Read-only API for an app's backups.
81
+ *
82
+ * A backup archive has a canonical entry order that restore relies on:
83
+ * `config.json` first, then every `entities/<etype>.jsonl` shard, then the
84
+ * `files/<locationId>` storage blobs. In particular ALL entity files must
85
+ * come before ANY storage file, so a restore can process the archive in a
86
+ * single streaming pass: `config.json` sets up the schema, the `$files`
87
+ * entities register file metadata, and only then can each blob be matched
88
+ * to its entity. {@link downloadArchive} implements that order end to end;
89
+ * {@link listFiles} (which returns the entity files already in write order)
90
+ * and {@link streamStorageFiles} are the pieces for building a custom
91
+ * pipeline.
92
+ */
93
+ export declare class BackupsManager {
94
+ #private;
95
+ constructor(opts: {
96
+ appId: string;
97
+ apiURI: string;
98
+ withAuth: WithAuth;
99
+ });
100
+ /**
101
+ * Returns the app's downloadable (non-expired) backups, newest first.
102
+ */
103
+ list(opts?: {
104
+ signal?: AbortSignal;
105
+ }): Promise<AppBackup[]>;
106
+ /**
107
+ * Returns the backup's entity files (`config.json` and the
108
+ * `entities/<etype>.jsonl` shards) in archive write order. Storage blobs
109
+ * are not included; discover those with {@link streamStorageFiles}.
110
+ */
111
+ listFiles(backupId: string, opts?: {
112
+ signal?: AbortSignal;
113
+ }): Promise<AppBackupFile[]>;
114
+ /**
115
+ * Returns a presigned download URL for one of the backup's entity files.
116
+ * The URL expires after 1 hour, so fetch it right before downloading.
117
+ *
118
+ * The entity files are stored zstd-compressed (the response carries
119
+ * `Content-Encoding: zstd`); decompress to get the raw JSON/JSONL.
120
+ */
121
+ getFileUrl(backupId: string, name: string, opts?: {
122
+ signal?: AbortSignal;
123
+ }): Promise<string>;
124
+ /**
125
+ * Streams every storage file captured in the backup, each with a presigned
126
+ * download URL. Completes without yielding anything when the app has no
127
+ * storage files.
128
+ *
129
+ * The server ends a healthy stream with a terminal sentinel; if the stream
130
+ * closes without it (a server-side failure truncated the listing), this
131
+ * throws instead of silently under-reporting files.
132
+ */
133
+ streamStorageFiles(backupId: string, opts?: {
134
+ signal?: AbortSignal;
135
+ }): AsyncGenerator<AppBackupStorageFile, void, void>;
136
+ /**
137
+ * Downloads the backup into a single zip archive written to `opts.sink`,
138
+ * entries in the canonical restore order described above. The caller
139
+ * supplies the runtime-specific pieces — how to fetch a presigned URL,
140
+ * where the bytes go, and the archive encoder (e.g. zip.js's `ZipWriter`);
141
+ * see {@link DownloadBackupArchiveOpts}.
142
+ */
143
+ downloadArchive(opts: DownloadBackupArchiveOpts): Promise<BackupDownloadResult>;
144
+ }
145
+ export {};
146
+ //# sourceMappingURL=backups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backups.d.ts","sourceRoot":"","sources":["../../src/backups.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAEL,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC/B,MAAM,qBAAqB,CAAC;AAE7B,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG;IACtB,wCAAwC;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,QAAQ,EAAE,IAAI,CAAC;IACf,+EAA+E;IAC/E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,oEAAoE;IACpE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;OAGG;IACH,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,6DAA6D;IAC7D,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,0DAA0D;IAC1D,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM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IAAI,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAQjE;;;;OAIG;IACG,SAAS,CACb,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC9B,OAAO,CAAC,aAAa,EAAE,CAAC;IAQ3B;;;;;;OAMG;IACG,UAAU,CACd,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC9B,OAAO,CAAC,MAAM,CAAC;IAQlB;;;;;;;;OAQG;IACI,kBAAkB,CACvB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC9B,cAAc,CAAC,oBAAoB,EAAE,IAAI,EAAE,IAAI,CAAC;IAmDnD;;;;;;OAMG;IACH,eAAe,CACb,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,oBAAoB,CAAC;CAGjC"}
@@ -0,0 +1,240 @@
1
+ import { BackendRelayAPIError, version as coreVersion, } from '@backendrelay/core';
2
+ import version from "./version.js";
3
+ import { downloadBackupArchive, } from "./backupDownload.js";
4
+ /** Converts a backup row as the server sends it into an {@link AppBackup}. */
5
+ export function toAppBackup(row) {
6
+ return {
7
+ id: row.id,
8
+ isn: row.isn,
9
+ backupAt: new Date(row.backup_at),
10
+ filesSize: row.files_size,
11
+ dbSize: row.db_size,
12
+ uncompressedSize: row.uncompressed_size,
13
+ description: row.description,
14
+ expiresAt: row.expires_at ? new Date(row.expires_at) : null,
15
+ };
16
+ }
17
+ /** Suggested filename for a backup archive. */
18
+ export function backupZipName(backup) {
19
+ const safe = backup.backupAt.toISOString().replace(/[:.]/g, '-');
20
+ return `backendrelay-backup-${safe}.zip`;
21
+ }
22
+ /**
23
+ * Formats a byte count the way macOS/Finder reports file sizes: decimal
24
+ * (1000-based) units with SI labels, so the number lines up with what lands
25
+ * on disk.
26
+ */
27
+ export function formatFileSize(n) {
28
+ if (n < 1000)
29
+ return `${n} B`;
30
+ const units = ['KB', 'MB', 'GB', 'TB'];
31
+ let i = -1;
32
+ let v = n;
33
+ do {
34
+ v /= 1000;
35
+ i++;
36
+ } while (v >= 1000 && i < units.length - 1);
37
+ let digits = v < 10 ? 2 : v < 100 ? 1 : 0;
38
+ // Rounding can cross a unit boundary (999,500 would read "1000 KB");
39
+ // promote to the next unit instead.
40
+ if (Number(v.toFixed(digits)) >= 1000 && i < units.length - 1) {
41
+ v /= 1000;
42
+ i++;
43
+ digits = 2;
44
+ }
45
+ return `${v.toFixed(digits)} ${units[i]}`;
46
+ }
47
+ /**
48
+ * Estimated size range for a backup's zip archive, or null when the backup
49
+ * row carries no sizes. Upper bound: everything stored uncompressed (STORE
50
+ * mode and/or files that don't compress). Lower bound: everything compressed
51
+ * at a ~4x DEFLATE ratio, best case for text/JSON, but storage files vary
52
+ * wildly (raw text compresses well, already-compressed images/videos don't).
53
+ * The same divisor applies to both since the file types aren't visible from
54
+ * here; the actual zip lands somewhere inside the range.
55
+ */
56
+ export function estimateZipSize(backup) {
57
+ const backupBytes = backup.uncompressedSize ?? backup.dbSize;
58
+ if (backupBytes == null || backup.filesSize == null)
59
+ return null;
60
+ const max = backupBytes + backup.filesSize;
61
+ return { min: Math.round(max / 4), max };
62
+ }
63
+ function authHeaders(token) {
64
+ return {
65
+ authorization: `Bearer ${token}`,
66
+ 'BackendRelay-Platform-Version': version,
67
+ 'BackendRelay-Core-Version': coreVersion,
68
+ 'X-BackendRelay-Source': 'platform-sdk',
69
+ 'X-BackendRelay-Version': version,
70
+ };
71
+ }
72
+ async function apiError(res) {
73
+ const body = await res.text();
74
+ try {
75
+ return new BackendRelayAPIError({
76
+ status: res.status,
77
+ body: JSON.parse(body),
78
+ });
79
+ }
80
+ catch (_e) {
81
+ return new BackendRelayAPIError({
82
+ status: res.status,
83
+ body: { type: undefined, message: body },
84
+ });
85
+ }
86
+ }
87
+ async function* ndjsonLines(body) {
88
+ const reader = body.getReader();
89
+ try {
90
+ const decoder = new TextDecoder();
91
+ let buf = '';
92
+ while (true) {
93
+ const { done, value } = await reader.read();
94
+ if (done)
95
+ break;
96
+ buf += decoder.decode(value, { stream: true });
97
+ let nl = buf.indexOf('\n');
98
+ while (nl !== -1) {
99
+ const line = buf.slice(0, nl).trim();
100
+ buf = buf.slice(nl + 1);
101
+ if (line.length > 0) {
102
+ yield JSON.parse(line);
103
+ }
104
+ nl = buf.indexOf('\n');
105
+ }
106
+ }
107
+ const line = buf.trim();
108
+ if (line.length > 0) {
109
+ yield JSON.parse(line);
110
+ }
111
+ }
112
+ finally {
113
+ // Also releases the connection when the consumer stops iterating early.
114
+ await reader.cancel().catch(() => { });
115
+ }
116
+ }
117
+ /**
118
+ * Read-only API for an app's backups.
119
+ *
120
+ * A backup archive has a canonical entry order that restore relies on:
121
+ * `config.json` first, then every `entities/<etype>.jsonl` shard, then the
122
+ * `files/<locationId>` storage blobs. In particular ALL entity files must
123
+ * come before ANY storage file, so a restore can process the archive in a
124
+ * single streaming pass: `config.json` sets up the schema, the `$files`
125
+ * entities register file metadata, and only then can each blob be matched
126
+ * to its entity. {@link downloadArchive} implements that order end to end;
127
+ * {@link listFiles} (which returns the entity files already in write order)
128
+ * and {@link streamStorageFiles} are the pieces for building a custom
129
+ * pipeline.
130
+ */
131
+ export class BackupsManager {
132
+ #appId;
133
+ #apiURI;
134
+ #withAuth;
135
+ constructor(opts) {
136
+ this.#appId = opts.appId;
137
+ this.#apiURI = opts.apiURI;
138
+ this.#withAuth = opts.withAuth;
139
+ }
140
+ #getJson(path, signal) {
141
+ return this.#withAuth(async (token) => {
142
+ const res = await fetch(`${this.#apiURI}${path}`, {
143
+ headers: authHeaders(token),
144
+ signal,
145
+ });
146
+ if (res.status !== 200) {
147
+ throw await apiError(res);
148
+ }
149
+ return res.json();
150
+ });
151
+ }
152
+ /**
153
+ * Returns the app's downloadable (non-expired) backups, newest first.
154
+ */
155
+ async list(opts) {
156
+ const res = await this.#getJson(`/dash/apps/${this.#appId}/backups`, opts?.signal);
157
+ return (res.backups || []).map(toAppBackup);
158
+ }
159
+ /**
160
+ * Returns the backup's entity files (`config.json` and the
161
+ * `entities/<etype>.jsonl` shards) in archive write order. Storage blobs
162
+ * are not included; discover those with {@link streamStorageFiles}.
163
+ */
164
+ async listFiles(backupId, opts) {
165
+ const res = await this.#getJson(`/dash/apps/${this.#appId}/backups/${backupId}/files`, opts?.signal);
166
+ return (res.files || []);
167
+ }
168
+ /**
169
+ * Returns a presigned download URL for one of the backup's entity files.
170
+ * The URL expires after 1 hour, so fetch it right before downloading.
171
+ *
172
+ * The entity files are stored zstd-compressed (the response carries
173
+ * `Content-Encoding: zstd`); decompress to get the raw JSON/JSONL.
174
+ */
175
+ async getFileUrl(backupId, name, opts) {
176
+ const res = await this.#getJson(`/dash/apps/${this.#appId}/backups/${backupId}/file-url?name=${encodeURIComponent(name)}`, opts?.signal);
177
+ return res.url;
178
+ }
179
+ /**
180
+ * Streams every storage file captured in the backup, each with a presigned
181
+ * download URL. Completes without yielding anything when the app has no
182
+ * storage files.
183
+ *
184
+ * The server ends a healthy stream with a terminal sentinel; if the stream
185
+ * closes without it (a server-side failure truncated the listing), this
186
+ * throws instead of silently under-reporting files.
187
+ */
188
+ async *streamStorageFiles(backupId, opts) {
189
+ const res = await this.#withAuth(async (token) => {
190
+ const res = await fetch(`${this.#apiURI}/dash/apps/${this.#appId}/backups/${backupId}/storage-files`, { headers: authHeaders(token), signal: opts?.signal });
191
+ if (res.status !== 200) {
192
+ throw await apiError(res);
193
+ }
194
+ return res;
195
+ });
196
+ if (!res.body) {
197
+ throw new Error('Storage file listing returned no body.');
198
+ }
199
+ let complete = false;
200
+ for await (const line of ndjsonLines(res.body)) {
201
+ if (line.done === true) {
202
+ complete = true;
203
+ break;
204
+ }
205
+ // A file record always carries a locationId and url; anything else is
206
+ // corruption, and skipping it would silently omit a file from the
207
+ // archive.
208
+ if (typeof line.locationId !== 'string' ||
209
+ line.locationId.length === 0 ||
210
+ // The locationId becomes the archive entry path `files/<locationId>`;
211
+ // reject separators and control characters that could escape it.
212
+ /[/\\\u0000-\u001f\u007f]/.test(line.locationId) ||
213
+ line.locationId === '.' ||
214
+ line.locationId === '..' ||
215
+ typeof line.url !== 'string' ||
216
+ line.url.length === 0) {
217
+ throw new Error('Storage file listing returned a malformed record. Please retry the download.');
218
+ }
219
+ yield {
220
+ locationId: line.locationId,
221
+ path: line.path ?? null,
222
+ url: line.url,
223
+ };
224
+ }
225
+ if (!complete) {
226
+ throw new Error('Storage file listing ended before it finished. Please retry the download.');
227
+ }
228
+ }
229
+ /**
230
+ * Downloads the backup into a single zip archive written to `opts.sink`,
231
+ * entries in the canonical restore order described above. The caller
232
+ * supplies the runtime-specific pieces — how to fetch a presigned URL,
233
+ * where the bytes go, and the archive encoder (e.g. zip.js's `ZipWriter`);
234
+ * see {@link DownloadBackupArchiveOpts}.
235
+ */
236
+ downloadArchive(opts) {
237
+ return downloadBackupArchive({ manager: this, ...opts });
238
+ }
239
+ }
240
+ //# sourceMappingURL=backups.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"backups.js","sourceRoot":"","sources":["../../src/backups.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,OAAO,IAAI,WAAW,GACvB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EACL,qBAAqB,GAGtB,MAAM,qBAAqB,CAAC;AA2D7B,8EAA8E;AAC9E,MAAM,UAAU,WAAW,CAAC,GAAsB;IAChD,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,QAAQ,EAAE,IAAI,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC;QACjC,SAAS,E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CAAC,IAAI,CAAC,EAAE,CAAC;YAC/C,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;gBACvB,QAAQ,GAAG,IAAI,CAAC;gBAChB,MAAM;YACR,CAAC;YACD,sEAAsE;YACtE,kEAAkE;YAClE,WAAW;YACX,IACE,OAAO,IAAI,CAAC,UAAU,KAAK,QAAQ;gBACnC,IAAI,CAAC,UAAU,CAAC,MAAM,KAAK,CAAC;gBAC5B,sEAAsE;gBACtE,iEAAiE;gBACjE,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;gBAChD,IAAI,CAAC,UAAU,KAAK,GAAG;gBACvB,IAAI,CAAC,UAAU,KAAK,IAAI;gBACxB,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ;gBAC5B,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EACrB,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,8EAA8E,CAC/E,CAAC;YACJ,CAAC;YACD,MAAM;gBACJ,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;gBACvB,GAAG,EAAE,IAAI,CAAC,GAAG;aACd,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,2EAA2E,CAC5E,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACH,eAAe,CACb,IAA+B;QAE/B,OAAO,qBAAqB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;CACF","sourcesContent":["import {\n BackendRelayAPIError,\n version as coreVersion,\n} from '@backendrelay/core';\nimport type { WithAuth } from '@backendrelay/webhooks';\nimport version from './version.ts';\nimport {\n downloadBackupArchive,\n type BackupDownloadResult,\n type DownloadBackupArchiveOpts,\n} from './backupDownload.ts';\n\n/** A point-in-time snapshot of an app. */\nexport type AppBackup = {\n /** Unique identifier for the backup. */\n id: string;\n /** BackendRelay sequence number the snapshot was taken at. */\n isn: string;\n /** When the snapshot was taken. */\n backupAt: Date;\n /** Total size in bytes of the app's storage files at backup time, if known. */\n filesSize: number | null;\n /** Size in bytes of the app's database at backup time, if known. */\n dbSize: number | null;\n /**\n * Total uncompressed size in bytes of the backup's entity files (what they\n * take up unpacked on disk), if known.\n */\n uncompressedSize: number | null;\n /** Human-readable label, e.g. \"Automated Daily Snapshot\". */\n description: string | null;\n /** When the backup stops being available for download. */\n expiresAt: Date | null;\n};\n\n/**\n * A file that makes up the backup payload: `config.json` or an\n * `entities/<etype>.jsonl` shard.\n */\nexport type AppBackupFile = {\n name: string;\n /** Size in bytes as stored (the entity shards are stored compressed). */\n size: number;\n};\n\n/** A storage file captured in a backup, with a presigned download URL. */\nexport type AppBackupStorageFile = {\n /**\n * Stable id of the file's blob. A backup archive stores the blob at\n * `files/<locationId>`.\n */\n locationId: string;\n /** The path the user uploaded the file to. */\n path: string | null;\n /** Presigned URL for the file's contents. Expires after 12 hours. */\n url: string;\n};\n\ntype AppBackupResponse = {\n id: string;\n isn: string;\n backup_at: string;\n files_size: number | null;\n db_size: number | null;\n uncompressed_size: number | null;\n description: string | null;\n expires_at: string | null;\n};\n\n/** Converts a backup row as the server sends it into an {@link AppBackup}. */\nexport function toAppBackup(row: AppBackupResponse): AppBackup {\n return {\n id: row.id,\n isn: row.isn,\n backupAt: new Date(row.backup_at),\n filesSize: row.files_size,\n dbSize: row.db_size,\n uncompressedSize: row.uncompressed_size,\n description: row.description,\n expiresAt: row.expires_at ? new Date(row.expires_at) : null,\n };\n}\n\n/** Suggested filename for a backup archive. */\nexport function backupZipName(backup: AppBackup): string {\n const safe = backup.backupAt.toISOString().replace(/[:.]/g, '-');\n return `backendrelay-backup-${safe}.zip`;\n}\n\n/**\n * Formats a byte count the way macOS/Finder reports file sizes: decimal\n * (1000-based) units with SI labels, so the number lines up with what lands\n * on disk.\n */\nexport function formatFileSize(n: number): string {\n if (n < 1000) return `${n} B`;\n const units = ['KB', 'MB', 'GB', 'TB'];\n let i = -1;\n let v = n;\n do {\n v /= 1000;\n i++;\n } while (v >= 1000 && i < units.length - 1);\n let digits = v < 10 ? 2 : v < 100 ? 1 : 0;\n // Rounding can cross a unit boundary (999,500 would read \"1000 KB\");\n // promote to the next unit instead.\n if (Number(v.toFixed(digits)) >= 1000 && i < units.length - 1) {\n v /= 1000;\n i++;\n digits = 2;\n }\n return `${v.toFixed(digits)} ${units[i]}`;\n}\n\n/**\n * Estimated size range for a backup's zip archive, or null when the backup\n * row carries no sizes. Upper bound: everything stored uncompressed (STORE\n * mode and/or files that don't compress). Lower bound: everything compressed\n * at a ~4x DEFLATE ratio, best case for text/JSON, but storage files vary\n * wildly (raw text compresses well, already-compressed images/videos don't).\n * The same divisor applies to both since the file types aren't visible from\n * here; the actual zip lands somewhere inside the range.\n */\nexport function estimateZipSize(\n backup: AppBackup,\n): { min: number; max: number } | null {\n const backupBytes = backup.uncompressedSize ?? backup.dbSize;\n if (backupBytes == null || backup.filesSize == null) return null;\n const max = backupBytes + backup.filesSize;\n return { min: Math.round(max / 4), max };\n}\n\nfunction authHeaders(token: string): Record<string, string> {\n return {\n authorization: `Bearer ${token}`,\n 'BackendRelay-Platform-Version': version,\n 'BackendRelay-Core-Version': coreVersion,\n 'X-BackendRelay-Source': 'platform-sdk',\n 'X-BackendRelay-Version': version,\n };\n}\n\nasync function apiError(res: Response): Promise<BackendRelayAPIError> {\n const body = await res.text();\n try {\n return new BackendRelayAPIError({\n status: res.status,\n body: JSON.parse(body),\n });\n } catch (_e) {\n return new BackendRelayAPIError({\n status: res.status,\n body: { type: undefined, message: body },\n });\n }\n}\n\nasync function* ndjsonLines(\n body: ReadableStream<Uint8Array>,\n): AsyncGenerator<any, void, void> {\n const reader = body.getReader();\n try {\n const decoder = new TextDecoder();\n let buf = '';\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n buf += decoder.decode(value, { stream: true });\n let nl = buf.indexOf('\\n');\n while (nl !== -1) {\n const line = buf.slice(0, nl).trim();\n buf = buf.slice(nl + 1);\n if (line.length > 0) {\n yield JSON.parse(line);\n }\n nl = buf.indexOf('\\n');\n }\n }\n const line = buf.trim();\n if (line.length > 0) {\n yield JSON.parse(line);\n }\n } finally {\n // Also releases the connection when the consumer stops iterating early.\n await reader.cancel().catch(() => {});\n }\n}\n\n/**\n * Read-only API for an app's backups.\n *\n * A backup archive has a canonical entry order that restore relies on:\n * `config.json` first, then every `entities/<etype>.jsonl` shard, then the\n * `files/<locationId>` storage blobs. In particular ALL entity files must\n * come before ANY storage file, so a restore can process the archive in a\n * single streaming pass: `config.json` sets up the schema, the `$files`\n * entities register file metadata, and only then can each blob be matched\n * to its entity. {@link downloadArchive} implements that order end to end;\n * {@link listFiles} (which returns the entity files already in write order)\n * and {@link streamStorageFiles} are the pieces for building a custom\n * pipeline.\n */\nexport class BackupsManager {\n #appId: string;\n #apiURI: string;\n #withAuth: WithAuth;\n\n constructor(opts: { appId: string; apiURI: string; withAuth: WithAuth }) {\n this.#appId = opts.appId;\n this.#apiURI = opts.apiURI;\n this.#withAuth = opts.withAuth;\n }\n\n #getJson(path: string, signal?: AbortSignal): Promise<any> {\n return this.#withAuth(async (token) => {\n const res = await fetch(`${this.#apiURI}${path}`, {\n headers: authHeaders(token),\n signal,\n });\n if (res.status !== 200) {\n throw await apiError(res);\n }\n return res.json();\n });\n }\n\n /**\n * Returns the app's downloadable (non-expired) backups, newest first.\n */\n async list(opts?: { signal?: AbortSignal }): Promise<AppBackup[]> {\n const res = await this.#getJson(\n `/dash/apps/${this.#appId}/backups`,\n opts?.signal,\n );\n return ((res.backups || []) as AppBackupResponse[]).map(toAppBackup);\n }\n\n /**\n * Returns the backup's entity files (`config.json` and the\n * `entities/<etype>.jsonl` shards) in archive write order. Storage blobs\n * are not included; discover those with {@link streamStorageFiles}.\n */\n async listFiles(\n backupId: string,\n opts?: { signal?: AbortSignal },\n ): Promise<AppBackupFile[]> {\n const res = await this.#getJson(\n `/dash/apps/${this.#appId}/backups/${backupId}/files`,\n opts?.signal,\n );\n return (res.files || []) as AppBackupFile[];\n }\n\n /**\n * Returns a presigned download URL for one of the backup's entity files.\n * The URL expires after 1 hour, so fetch it right before downloading.\n *\n * The entity files are stored zstd-compressed (the response carries\n * `Content-Encoding: zstd`); decompress to get the raw JSON/JSONL.\n */\n async getFileUrl(\n backupId: string,\n name: string,\n opts?: { signal?: AbortSignal },\n ): Promise<string> {\n const res = await this.#getJson(\n `/dash/apps/${this.#appId}/backups/${backupId}/file-url?name=${encodeURIComponent(name)}`,\n opts?.signal,\n );\n return res.url as string;\n }\n\n /**\n * Streams every storage file captured in the backup, each with a presigned\n * download URL. Completes without yielding anything when the app has no\n * storage files.\n *\n * The server ends a healthy stream with a terminal sentinel; if the stream\n * closes without it (a server-side failure truncated the listing), this\n * throws instead of silently under-reporting files.\n */\n async *streamStorageFiles(\n backupId: string,\n opts?: { signal?: AbortSignal },\n ): AsyncGenerator<AppBackupStorageFile, void, void> {\n const res = await this.#withAuth(async (token) => {\n const res = await fetch(\n `${this.#apiURI}/dash/apps/${this.#appId}/backups/${backupId}/storage-files`,\n { headers: authHeaders(token), signal: opts?.signal },\n );\n if (res.status !== 200) {\n throw await apiError(res);\n }\n return res;\n });\n if (!res.body) {\n throw new Error('Storage file listing returned no body.');\n }\n let complete = false;\n for await (const line of ndjsonLines(res.body)) {\n if (line.done === true) {\n complete = true;\n break;\n }\n // A file record always carries a locationId and url; anything else is\n // corruption, and skipping it would silently omit a file from the\n // archive.\n if (\n typeof line.locationId !== 'string' ||\n line.locationId.length === 0 ||\n // The locationId becomes the archive entry path `files/<locationId>`;\n // reject separators and control characters that could escape it.\n /[/\\\\\\u0000-\\u001f\\u007f]/.test(line.locationId) ||\n line.locationId === '.' ||\n line.locationId === '..' ||\n typeof line.url !== 'string' ||\n line.url.length === 0\n ) {\n throw new Error(\n 'Storage file listing returned a malformed record. Please retry the download.',\n );\n }\n yield {\n locationId: line.locationId,\n path: line.path ?? null,\n url: line.url,\n };\n }\n if (!complete) {\n throw new Error(\n 'Storage file listing ended before it finished. Please retry the download.',\n );\n }\n }\n\n /**\n * Downloads the backup into a single zip archive written to `opts.sink`,\n * entries in the canonical restore order described above. The caller\n * supplies the runtime-specific pieces — how to fetch a presigned URL,\n * where the bytes go, and the archive encoder (e.g. zip.js's `ZipWriter`);\n * see {@link DownloadBackupArchiveOpts}.\n */\n downloadArchive(\n opts: DownloadBackupArchiveOpts,\n ): Promise<BackupDownloadResult> {\n return downloadBackupArchive({ manager: this, ...opts });\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function clerkDomainFromPublishableKey(key: string): string | null;
2
+ //# sourceMappingURL=clerk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clerk.d.ts","sourceRoot":"","sources":["../../src/clerk.ts"],"names":[],"mappings":"AAaA,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAUxE"}
@@ -0,0 +1,26 @@
1
+ // Base64 decode, switching to url-safe decode if we hit an error
2
+ // Can't be sure which method Clerk uses because you can't generate
3
+ // `+` or `/` with characters that go in a normal host. Urls with
4
+ // chinese characters exist, they might encode to `+` or `/`, and
5
+ // Clerk might support them, so we'll be safe and do both.
6
+ function base64Decode(s) {
7
+ try {
8
+ return Buffer.from(s, 'base64').toString('utf-8');
9
+ }
10
+ catch (e) {
11
+ return Buffer.from(s, 'base64url').toString('utf-8');
12
+ }
13
+ }
14
+ export function clerkDomainFromPublishableKey(key) {
15
+ try {
16
+ const parts = key.split('_');
17
+ const domainPartB64 = parts[parts.length - 1];
18
+ const domainPart = base64Decode(domainPartB64);
19
+ return domainPart.replace('$', '');
20
+ }
21
+ catch (e) {
22
+ console.error('Error getting domain from clerk key', e);
23
+ return null;
24
+ }
25
+ }
26
+ //# sourceMappingURL=clerk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clerk.js","sourceRoot":"","sources":["../../src/clerk.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,mEAAmE;AACnE,iEAAiE;AACjE,iEAAiE;AACjE,0DAA0D;AAC1D,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,6BAA6B,CAAC,GAAW;IACvD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9C,MAAM,UAAU,GAAG,YAAY,CAAC,aAAa,CAAC,CAAC;QAC/C,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,CAAC,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC","sourcesContent":["// Base64 decode, switching to url-safe decode if we hit an error\n// Can't be sure which method Clerk uses because you can't generate\n// `+` or `/` with characters that go in a normal host. Urls with\n// chinese characters exist, they might encode to `+` or `/`, and\n// Clerk might support them, so we'll be safe and do both.\nfunction base64Decode(s: string) {\n try {\n return Buffer.from(s, 'base64').toString('utf-8');\n } catch (e) {\n return Buffer.from(s, 'base64url').toString('utf-8');\n }\n}\n\nexport function clerkDomainFromPublishableKey(key: string): string | null {\n try {\n const parts = key.split('_');\n const domainPartB64 = parts[parts.length - 1];\n const domainPart = base64Decode(domainPartB64);\n return domainPart.replace('$', '');\n } catch (e) {\n console.error('Error getting domain from clerk key', e);\n return null;\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ export declare function oauthCallbackURL(apiURI: string): string;
2
+ export declare const GOOGLE_AUTHORIZATION_ENDPOINT = "https://accounts.google.com/o/oauth2/v2/auth";
3
+ export declare const GOOGLE_TOKEN_ENDPOINT = "https://oauth2.googleapis.com/token";
4
+ export declare const GOOGLE_DISCOVERY_ENDPOINT = "https://accounts.google.com/.well-known/openid-configuration";
5
+ export declare const APPLE_AUTHORIZATION_ENDPOINT = "https://appleid.apple.com/auth/authorize";
6
+ export declare const APPLE_TOKEN_ENDPOINT = "https://appleid.apple.com/auth/token";
7
+ export declare const APPLE_DISCOVERY_ENDPOINT = "https://appleid.apple.com/.well-known/openid-configuration";
8
+ export declare const LINKEDIN_AUTHORIZATION_ENDPOINT = "https://www.linkedin.com/oauth/v2/authorization";
9
+ export declare const LINKEDIN_TOKEN_ENDPOINT = "https://www.linkedin.com/oauth/v2/accessToken";
10
+ export declare const LINKEDIN_DISCOVERY_ENDPOINT = "https://www.linkedin.com/oauth/.well-known/openid-configuration";
11
+ //# sourceMappingURL=consts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/consts.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,UAE9C;AAED,eAAO,MAAM,6BAA6B,iDACM,CAAC;AACjD,eAAO,MAAM,qBAAqB,wCAAwC,CAAC;AAC3E,eAAO,MAAM,yBAAyB,iEAC0B,CAAC;AAEjE,eAAO,MAAM,4BAA4B,6CACG,CAAC;AAC7C,eAAO,MAAM,oBAAoB,yCAAyC,CAAC;AAC3E,eAAO,MAAM,wBAAwB,+DACyB,CAAC;AAE/D,eAAO,MAAM,+BAA+B,oDACO,CAAC;AACpD,eAAO,MAAM,uBAAuB,kDACa,CAAC;AAClD,eAAO,MAAM,2BAA2B,oEAC2B,CAAC"}
@@ -0,0 +1,13 @@
1
+ export function oauthCallbackURL(apiURI) {
2
+ return `${apiURI.replace(/\/+$/, '')}/runtime/oauth/callback`;
3
+ }
4
+ export const GOOGLE_AUTHORIZATION_ENDPOINT = 'https://accounts.google.com/o/oauth2/v2/auth';
5
+ export const GOOGLE_TOKEN_ENDPOINT = 'https://oauth2.googleapis.com/token';
6
+ export const GOOGLE_DISCOVERY_ENDPOINT = 'https://accounts.google.com/.well-known/openid-configuration';
7
+ export const APPLE_AUTHORIZATION_ENDPOINT = 'https://appleid.apple.com/auth/authorize';
8
+ export const APPLE_TOKEN_ENDPOINT = 'https://appleid.apple.com/auth/token';
9
+ export const APPLE_DISCOVERY_ENDPOINT = 'https://appleid.apple.com/.well-known/openid-configuration';
10
+ export const LINKEDIN_AUTHORIZATION_ENDPOINT = 'https://www.linkedin.com/oauth/v2/authorization';
11
+ export const LINKEDIN_TOKEN_ENDPOINT = 'https://www.linkedin.com/oauth/v2/accessToken';
12
+ export const LINKEDIN_DISCOVERY_ENDPOINT = 'https://www.linkedin.com/oauth/.well-known/openid-configuration';
13
+ //# sourceMappingURL=consts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/consts.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC;AAChE,CAAC;AAED,MAAM,CAAC,MAAM,6BAA6B,GACxC,8CAA8C,CAAC;AACjD,MAAM,CAAC,MAAM,qBAAqB,GAAG,qCAAqC,CAAC;AAC3E,MAAM,CAAC,MAAM,yBAAyB,GACpC,8DAA8D,CAAC;AAEjE,MAAM,CAAC,MAAM,4BAA4B,GACvC,0CAA0C,CAAC;AAC7C,MAAM,CAAC,MAAM,oBAAoB,GAAG,sCAAsC,CAAC;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GACnC,4DAA4D,CAAC;AAE/D,MAAM,CAAC,MAAM,+BAA+B,GAC1C,iDAAiD,CAAC;AACpD,MAAM,CAAC,MAAM,uBAAuB,GAClC,+CAA+C,CAAC;AAClD,MAAM,CAAC,MAAM,2BAA2B,GACtC,iEAAiE,CAAC","sourcesContent":["export function oauthCallbackURL(apiURI: string) {\n return `${apiURI.replace(/\\/+$/, '')}/runtime/oauth/callback`;\n}\n\nexport const GOOGLE_AUTHORIZATION_ENDPOINT =\n 'https://accounts.google.com/o/oauth2/v2/auth';\nexport const GOOGLE_TOKEN_ENDPOINT = 'https://oauth2.googleapis.com/token';\nexport const GOOGLE_DISCOVERY_ENDPOINT =\n 'https://accounts.google.com/.well-known/openid-configuration';\n\nexport const APPLE_AUTHORIZATION_ENDPOINT =\n 'https://appleid.apple.com/auth/authorize';\nexport const APPLE_TOKEN_ENDPOINT = 'https://appleid.apple.com/auth/token';\nexport const APPLE_DISCOVERY_ENDPOINT =\n 'https://appleid.apple.com/.well-known/openid-configuration';\n\nexport const LINKEDIN_AUTHORIZATION_ENDPOINT =\n 'https://www.linkedin.com/oauth/v2/authorization';\nexport const LINKEDIN_TOKEN_ENDPOINT =\n 'https://www.linkedin.com/oauth/v2/accessToken';\nexport const LINKEDIN_DISCOVERY_ENDPOINT =\n 'https://www.linkedin.com/oauth/.well-known/openid-configuration';\n"]}
@@ -0,0 +1,4 @@
1
+ export declare function pkceVerifier(): string;
2
+ export declare function sha256(s: string): Promise<ArrayBuffer>;
3
+ export declare function pkceCodeChallengeOfVerifier(verifier: string): Promise<string>;
4
+ //# sourceMappingURL=crypto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AACA,wBAAgB,YAAY,IAAI,MAAM,CAUrC;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAEtD;AAMD,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAM7E"}
@@ -0,0 +1,21 @@
1
+ // https://tools.ietf.org/html/rfc7636#section-4.1
2
+ export function pkceVerifier() {
3
+ const chars = '0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._~';
4
+ let s = '';
5
+ for (const value of crypto.getRandomValues(new Uint8Array(64))) {
6
+ s = s + chars[value % chars.length];
7
+ }
8
+ return s;
9
+ }
10
+ export function sha256(s) {
11
+ return crypto.subtle.digest({ name: 'SHA-256' }, new TextEncoder().encode(s));
12
+ }
13
+ function urlSafeBase64(s) {
14
+ return s.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
15
+ }
16
+ export function pkceCodeChallengeOfVerifier(verifier) {
17
+ return sha256(verifier).then((s) => {
18
+ return urlSafeBase64(btoa(String.fromCharCode(...Array.from(new Uint8Array(s)))));
19
+ });
20
+ }
21
+ //# sourceMappingURL=crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../src/crypto.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,MAAM,UAAU,YAAY;IAC1B,MAAM,KAAK,GACT,oEAAoE,CAAC;IACvE,IAAI,CAAC,GAAG,EAAE,CAAC;IAEX,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC/D,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,CAAS;IAC9B,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC;AAED,SAAS,aAAa,CAAC,CAAS;IAC9B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,QAAgB;IAC1D,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACjC,OAAO,aAAa,CAClB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["// https://tools.ietf.org/html/rfc7636#section-4.1\nexport function pkceVerifier(): string {\n const chars =\n '0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz-._~';\n let s = '';\n\n for (const value of crypto.getRandomValues(new Uint8Array(64))) {\n s = s + chars[value % chars.length];\n }\n\n return s;\n}\n\nexport function sha256(s: string): Promise<ArrayBuffer> {\n return crypto.subtle.digest({ name: 'SHA-256' }, new TextEncoder().encode(s));\n}\n\nfunction urlSafeBase64(s: string): string {\n return s.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}\n\nexport function pkceCodeChallengeOfVerifier(verifier: string): Promise<string> {\n return sha256(verifier).then((s) => {\n return urlSafeBase64(\n btoa(String.fromCharCode(...Array.from(new Uint8Array(s)))),\n );\n });\n}\n"]}
@@ -0,0 +1,19 @@
1
+ import { BackendRelayOAuthError, type OAuthScope } from './oauthCommon.ts';
2
+ import { type BackendRelayDBOAuthAccessToken, type OAuthHandlerConfig, OAuthHandler } from './oauth.ts';
3
+ import { generatePermsTypescriptFile, permsTypescriptFileToCode } from './perms.ts';
4
+ import { type BackendRelayAPIPlatformSchema, generateSchemaTypescriptFile, collectSystemCatalogIdentNames, validateSchema, SchemaValidationError } from './schema.ts';
5
+ import { apiSchemaToBackendRelaySchemaDef, PlatformApi, translatePlanSteps } from './api.ts';
6
+ import { schemaTypescriptFileToBackendRelaySchema } from './typescript-schema.ts';
7
+ import version from './version.ts';
8
+ import { ProgressPromise } from './ProgressPromise.ts';
9
+ import { i, type BackendRelayRules, type BackendRelayRouteHandlerPayloadByType, type BackendRelayRouteHandlerType, type BackendRelayRouteHandlerBody } from '@backendrelay/core';
10
+ import { exchangeCodeForToken, exchangeRefreshToken } from './serverOAuth.ts';
11
+ import { clerkDomainFromPublishableKey } from './clerk.ts';
12
+ import { Webhooks, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams, WebhooksManager } from '@backendrelay/webhooks';
13
+ export { type BackendRelayAPIPlatformSchema, type BackendRelayDBOAuthAccessToken, type OAuthHandlerConfig, type OAuthScope, type BackendRelayRules, type BackendRelayRouteHandlerPayloadByType, type BackendRelayRouteHandlerType, type BackendRelayRouteHandlerBody, OAuthHandler, BackendRelayOAuthError, generateSchemaTypescriptFile, collectSystemCatalogIdentNames, validateSchema, SchemaValidationError, generatePermsTypescriptFile, permsTypescriptFileToCode, apiSchemaToBackendRelaySchemaDef, schemaTypescriptFileToBackendRelaySchema, version, translatePlanSteps, PlatformApi, ProgressPromise, exchangeCodeForToken, exchangeRefreshToken, clerkDomainFromPublishableKey, i, Webhooks, WebhooksManager, type WebhookAction, type WebhookStatus, type WebhookEventStatus, type WebhookInfo, type WebhookAttempt, type WebhookEventInfo, type WebhookEventsPage, type WebhookBody, type WebhookEntity, type WebhookPayload, type WebhookPayloadRecord, type WebhookPayloadRecordFor, type WebhookHandlerFn, type WebhookHandlers, type WebhookHelpers, type CreateWebhookParams, type UpdateWebhookParams, };
14
+ export { diffSchemas, convertTxSteps, isRenamePromptItem, buildAutoRenameSelector, type RenameResolveFn, type MigrationTx, type MigrationTxSpecific, type MigrationTxTypes, type Identifier, } from './migrations.ts';
15
+ export { BackupsManager, backupZipName, estimateZipSize, formatFileSize, toAppBackup, type AppBackup, type AppBackupFile, type AppBackupStorageFile, } from './backups.ts';
16
+ export { type DownloadBackupArchiveOpts, type BackupArchiveWriter, type BackupDownloadProgress, type BackupDownloadResult, } from './backupDownload.ts';
17
+ export { oauthCallbackURL, GOOGLE_AUTHORIZATION_ENDPOINT, GOOGLE_DISCOVERY_ENDPOINT, GOOGLE_TOKEN_ENDPOINT, APPLE_AUTHORIZATION_ENDPOINT, APPLE_DISCOVERY_ENDPOINT, APPLE_TOKEN_ENDPOINT, LINKEDIN_AUTHORIZATION_ENDPOINT, LINKEDIN_DISCOVERY_ENDPOINT, LINKEDIN_TOKEN_ENDPOINT, } from './consts.ts';
18
+ export * from './privateFields.ts';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,kBAAkB,EACvB,YAAY,EACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,KAAK,6BAA6B,EAClC,4BAA4B,EAC5B,8BAA8B,EAC9B,cAAc,EACd,qBAAqB,EACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gCAAgC,EAChC,WAAW,EACX,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB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a,EAClB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,GACzB,CAAC;AAEF,OAAO,EACL,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,cAAc,EACd,aAAa,EACb,eAAe,EACf,cAAc,EACd,WAAW,EACX,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,oBAAoB,GAC1B,MAAM,cAAc,CAAC;AAEtB,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,oBAAoB,GAC1B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,oBAAoB,EACpB,+BAA+B,EAC/B,2BAA2B,EAC3B,uBAAuB,GACxB,MAAM,aAAa,CAAC;AAErB,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { BackendRelayOAuthError } from "./oauthCommon.js";
2
+ import { OAuthHandler, } from "./oauth.js";
3
+ import { generatePermsTypescriptFile, permsTypescriptFileToCode, } from "./perms.js";
4
+ import { generateSchemaTypescriptFile, collectSystemCatalogIdentNames, validateSchema, SchemaValidationError, } from "./schema.js";
5
+ import { apiSchemaToBackendRelaySchemaDef, PlatformApi, translatePlanSteps, } from "./api.js";
6
+ import { schemaTypescriptFileToBackendRelaySchema } from "./typescript-schema.js";
7
+ import version from "./version.js";
8
+ import { ProgressPromise } from "./ProgressPromise.js";
9
+ import { i, } from '@backendrelay/core';
10
+ import { exchangeCodeForToken, exchangeRefreshToken } from "./serverOAuth.js";
11
+ import { clerkDomainFromPublishableKey } from "./clerk.js";
12
+ import { Webhooks, WebhooksManager, } from '@backendrelay/webhooks';
13
+ export { OAuthHandler, BackendRelayOAuthError, generateSchemaTypescriptFile, collectSystemCatalogIdentNames, validateSchema, SchemaValidationError, generatePermsTypescriptFile, permsTypescriptFileToCode, apiSchemaToBackendRelaySchemaDef, schemaTypescriptFileToBackendRelaySchema, version, translatePlanSteps, PlatformApi, ProgressPromise, exchangeCodeForToken, exchangeRefreshToken, clerkDomainFromPublishableKey, i, Webhooks, WebhooksManager, };
14
+ export { diffSchemas, convertTxSteps, isRenamePromptItem, buildAutoRenameSelector, } from "./migrations.js";
15
+ export { BackupsManager, backupZipName, estimateZipSize, formatFileSize, toAppBackup, } from "./backups.js";
16
+ export { oauthCallbackURL, GOOGLE_AUTHORIZATION_ENDPOINT, GOOGLE_DISCOVERY_ENDPOINT, GOOGLE_TOKEN_ENDPOINT, APPLE_AUTHORIZATION_ENDPOINT, APPLE_DISCOVERY_ENDPOINT, APPLE_TOKEN_ENDPOINT, LINKEDIN_AUTHORIZATION_ENDPOINT, LINKEDIN_DISCOVERY_ENDPOINT, LINKEDIN_TOKEN_ENDPOINT, } from "./consts.js";
17
+ export * from "./privateFields.js";
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAmB,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAGL,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,Y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,CAAC","sourcesContent":["import { BackendRelayOAuthError, type OAuthScope } from './oauthCommon.ts';\nimport {\n type BackendRelayDBOAuthAccessToken,\n type OAuthHandlerConfig,\n OAuthHandler,\n} from './oauth.ts';\nimport {\n generatePermsTypescriptFile,\n permsTypescriptFileToCode,\n} from './perms.ts';\nimport {\n type BackendRelayAPIPlatformSchema,\n generateSchemaTypescriptFile,\n collectSystemCatalogIdentNames,\n validateSchema,\n SchemaValidationError,\n} from './schema.ts';\nimport {\n apiSchemaToBackendRelaySchemaDef,\n PlatformApi,\n translatePlanSteps,\n} from './api.ts';\nimport { schemaTypescriptFileToBackendRelaySchema } from './typescript-schema.ts';\n\nimport version from './version.ts';\nimport { ProgressPromise } from './ProgressPromise.ts';\nimport {\n i,\n type BackendRelayRules,\n type BackendRelayRouteHandlerPayloadByType,\n type BackendRelayRouteHandlerType,\n type BackendRelayRouteHandlerBody,\n} from '@backendrelay/core';\nimport { exchangeCodeForToken, exchangeRefreshToken } from './serverOAuth.ts';\nimport { clerkDomainFromPublishableKey } from './clerk.ts';\nimport {\n Webhooks,\n type WebhookAction,\n type WebhookStatus,\n type WebhookEventStatus,\n type WebhookInfo,\n type WebhookAttempt,\n type WebhookEventInfo,\n type WebhookEventsPage,\n type WebhookBody,\n type WebhookEntity,\n type WebhookPayload,\n type WebhookPayloadRecord,\n type WebhookPayloadRecordFor,\n type WebhookHandlerFn,\n type WebhookHandlers,\n type WebhookHelpers,\n type CreateWebhookParams,\n type UpdateWebhookParams,\n WebhooksManager,\n} from '@backendrelay/webhooks';\n\nexport {\n type BackendRelayAPIPlatformSchema,\n type BackendRelayDBOAuthAccessToken,\n type OAuthHandlerConfig,\n type OAuthScope,\n type BackendRelayRules,\n type BackendRelayRouteHandlerPayloadByType,\n type BackendRelayRouteHandlerType,\n type BackendRelayRouteHandlerBody,\n OAuthHandler,\n BackendRelayOAuthError,\n generateSchemaTypescriptFile,\n collectSystemCatalogIdentNames,\n validateSchema,\n SchemaValidationError,\n generatePermsTypescriptFile,\n permsTypescriptFileToCode,\n apiSchemaToBackendRelaySchemaDef,\n schemaTypescriptFileToBackendRelaySchema,\n version,\n translatePlanSteps,\n PlatformApi,\n ProgressPromise,\n exchangeCodeForToken,\n exchangeRefreshToken,\n clerkDomainFromPublishableKey,\n i,\n Webhooks,\n WebhooksManager,\n type WebhookAction,\n type WebhookStatus,\n type WebhookEventStatus,\n type WebhookInfo,\n type WebhookAttempt,\n type WebhookEventInfo,\n type WebhookEventsPage,\n type WebhookBody,\n type WebhookEntity,\n type WebhookPayload,\n type WebhookPayloadRecord,\n type WebhookPayloadRecordFor,\n type WebhookHandlerFn,\n type WebhookHandlers,\n type WebhookHelpers,\n type CreateWebhookParams,\n type UpdateWebhookParams,\n};\n\nexport {\n diffSchemas,\n convertTxSteps,\n isRenamePromptItem,\n buildAutoRenameSelector,\n type RenameResolveFn,\n type MigrationTx,\n type MigrationTxSpecific,\n type MigrationTxTypes,\n type Identifier,\n} from './migrations.ts';\n\nexport {\n BackupsManager,\n backupZipName,\n estimateZipSize,\n formatFileSize,\n toAppBackup,\n type AppBackup,\n type AppBackupFile,\n type AppBackupStorageFile,\n} from './backups.ts';\n\nexport {\n type DownloadBackupArchiveOpts,\n type BackupArchiveWriter,\n type BackupDownloadProgress,\n type BackupDownloadResult,\n} from './backupDownload.ts';\n\nexport {\n oauthCallbackURL,\n GOOGLE_AUTHORIZATION_ENDPOINT,\n GOOGLE_DISCOVERY_ENDPOINT,\n GOOGLE_TOKEN_ENDPOINT,\n APPLE_AUTHORIZATION_ENDPOINT,\n APPLE_DISCOVERY_ENDPOINT,\n APPLE_TOKEN_ENDPOINT,\n LINKEDIN_AUTHORIZATION_ENDPOINT,\n LINKEDIN_DISCOVERY_ENDPOINT,\n LINKEDIN_TOKEN_ENDPOINT,\n} from './consts.ts';\n\nexport * from './privateFields.ts';\n"]}
@@ -0,0 +1,4 @@
1
+ import { AnyBlob, AnyLink, MigrationTx } from './migrations.ts';
2
+ export declare const attrDefToNewAttrTx: (attrInSchema: AnyBlob, entityName: string, createdName: string) => MigrationTx;
3
+ export declare const linkDefToNewAttrTx: (link: AnyLink) => MigrationTx;
4
+ //# sourceMappingURL=migrationUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrationUtils.d.ts","sourceRoot":"","sources":["../../src/migrationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGhE,eAAO,MAAM,kBAAkB,GAC7B,cAAc,OAAO,EACrB,YAAY,MAAM,EAClB,aAAa,MAAM,KAClB,WAmBF,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,MAAM,OAAO,KAAG,WA2BlD,CAAC"}