@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
package/src/instaml.ts DELETED
@@ -1,676 +0,0 @@
1
- import {
2
- AttrsStore,
3
- AttrsStoreClass,
4
- getAttrByFwdIdentName,
5
- getAttrByReverseIdentName,
6
- Store,
7
- } from './store.ts';
8
- import { getOps, isLookup, parseLookup } from './instatx.ts';
9
- import { immutableRemoveUndefined } from './utils/object.js';
10
- import { coerceToDate } from './utils/dates.ts';
11
- import uuid from './utils/id.ts';
12
- import {
13
- EntitiesWithLinks,
14
- IContainEntitiesAndLinks,
15
- LinkDef,
16
- } from './schemaTypes.ts';
17
- import { BackendRelayDBAttr, BackendRelayDBIdent } from './attrTypes.ts';
18
-
19
- export type AttrMapping = {
20
- attrIdMap: Record<string, string>;
21
- refSwapAttrIds: Set<string>;
22
- };
23
-
24
- type TXStep = any[];
25
-
26
- // Rewrites optimistic attrs with the attrs we get back from the server.
27
- export function rewriteStep(attrMapping: AttrMapping, txStep: TXStep): TXStep {
28
- const { attrIdMap, refSwapAttrIds } = attrMapping;
29
- const rewritten: TXStep = [];
30
- for (const part of txStep) {
31
- const newValue = attrIdMap[part];
32
-
33
- if (newValue) {
34
- // Rewrites attr id
35
- rewritten.push(newValue);
36
- } else if (Array.isArray(part) && part.length == 2 && attrIdMap[part[0]]) {
37
- // Rewrites attr id in lookups
38
- const [aid, value] = part;
39
- rewritten.push([attrIdMap[aid], value]);
40
- } else {
41
- rewritten.push(part);
42
- }
43
- }
44
- const [action] = txStep;
45
- if (
46
- (action === 'add-triple' || action === 'retract-triple') &&
47
- refSwapAttrIds.has(txStep[2])
48
- ) {
49
- // Reverse links if the optimistic link attr is backwards
50
- const tmp = rewritten[1];
51
- rewritten[1] = rewritten[3];
52
- rewritten[3] = tmp;
53
- }
54
- return rewritten;
55
- }
56
-
57
- function explodeLookupRef(eid) {
58
- if (Array.isArray(eid)) {
59
- return eid;
60
- }
61
- const entries = Object.entries(eid);
62
- if (entries.length !== 1) {
63
- throw new Error(
64
- 'lookup must be an object with a single unique attr and value.',
65
- );
66
- }
67
- return entries[0];
68
- }
69
-
70
- function isRefLookupIdent(attrs: AttrsStore, etype: string, identName: string) {
71
- return (
72
- identName.indexOf('.') !== -1 &&
73
- // attr names can have `.` in them, so use the attr we find with a `.`
74
- // before assuming it's a ref lookup.
75
- !getAttrByFwdIdentName(attrs, etype, identName)
76
- );
77
- }
78
-
79
- function extractRefLookupFwdName(identName) {
80
- const [fwdName, idIdent, ...rest] = identName.split('.');
81
- if (rest.length > 0 || idIdent !== 'id') {
82
- throw new Error(`${identName} is not a valid lookup attribute.`);
83
- }
84
-
85
- return fwdName;
86
- }
87
-
88
- function lookupIdentToAttr(
89
- attrs: AttrsStore,
90
- etype: string,
91
- identName: string,
92
- ) {
93
- if (!isRefLookupIdent(attrs, etype, identName)) {
94
- return getAttrByFwdIdentName(attrs, etype, identName);
95
- }
96
-
97
- const fwdName = extractRefLookupFwdName(identName);
98
-
99
- const refAttr =
100
- getAttrByFwdIdentName(attrs, etype, fwdName) ||
101
- getAttrByReverseIdentName(attrs, etype, fwdName);
102
- if (refAttr && refAttr['value-type'] !== 'ref') {
103
- throw new Error(`${identName} does not reference a valid link attribute.`);
104
- }
105
- return refAttr;
106
- }
107
-
108
- // Returns [attr, value] for the eid if the eid is a lookup.
109
- // If it's a regular eid, returns null
110
- function lookupPairOfEid(eid) {
111
- if (typeof eid === 'string' && !isLookup(eid)) {
112
- return null;
113
- }
114
- return typeof eid === 'string' && isLookup(eid)
115
- ? parseLookup(eid)
116
- : explodeLookupRef(eid);
117
- }
118
-
119
- function extractLookup(attrs: AttrsStore, etype: string, eid: string) {
120
- const lookupPair = lookupPairOfEid(eid);
121
-
122
- if (lookupPair === null) {
123
- return eid;
124
- }
125
-
126
- const [identName, value] = lookupPair;
127
- const attr = lookupIdentToAttr(attrs, etype, identName);
128
- if (!attr || !attr['unique?']) {
129
- throw new Error(`${identName} is not a unique attribute.`);
130
- }
131
- return [attr.id, value];
132
- }
133
-
134
- function withIdAttrForLookup(
135
- attrs: AttrsStore,
136
- etype: string,
137
- eidA: string,
138
- txSteps: TXStep[],
139
- ) {
140
- const lookup = extractLookup(attrs, etype, eidA);
141
- if (!Array.isArray(lookup)) {
142
- return txSteps;
143
- }
144
- const idTuple = [
145
- 'add-triple',
146
- lookup,
147
- getAttrByFwdIdentName(attrs, etype, 'id')?.id,
148
- lookup,
149
- ];
150
- return [idTuple].concat(txSteps);
151
- }
152
-
153
- function expandLink({ attrsStore }: Ctx, [etype, eidA, obj]) {
154
- const addTriples = Object.entries(obj).flatMap(([label, eidOrEids]) => {
155
- const eids = Array.isArray(eidOrEids) ? eidOrEids : [eidOrEids];
156
- const fwdAttr = getAttrByFwdIdentName(attrsStore, etype, label);
157
- const revAttr = getAttrByReverseIdentName(attrsStore, etype, label);
158
- return eids.map((eidB) => {
159
- const txStep = fwdAttr
160
- ? [
161
- 'add-triple',
162
- extractLookup(attrsStore, etype, eidA),
163
- fwdAttr.id,
164
- // Uses `!` because if we get here, we should have created the attr if it doesn't
165
- // already exist
166
- extractLookup(attrsStore, fwdAttr['reverse-identity']![1], eidB),
167
- ]
168
- : [
169
- 'add-triple',
170
- // Uses `!` because if we get here, we should have created the attr if it doesn't
171
- // already exist
172
- extractLookup(attrsStore, revAttr!['forward-identity']![1], eidB),
173
- revAttr?.id,
174
- extractLookup(attrsStore, etype, eidA),
175
- ];
176
- return txStep;
177
- });
178
- });
179
- return withIdAttrForLookup(attrsStore, etype, eidA, addTriples);
180
- }
181
-
182
- function expandUnlink({ attrsStore }: Ctx, [etype, eidA, obj]) {
183
- const retractTriples = Object.entries(obj).flatMap(([label, eidOrEids]) => {
184
- const eids = Array.isArray(eidOrEids) ? eidOrEids : [eidOrEids];
185
- const fwdAttr = getAttrByFwdIdentName(attrsStore, etype, label);
186
- const revAttr = getAttrByReverseIdentName(attrsStore, etype, label);
187
- return eids.map((eidB) => {
188
- const txStep = fwdAttr
189
- ? [
190
- 'retract-triple',
191
- extractLookup(attrsStore, etype, eidA),
192
- fwdAttr.id,
193
- // Uses `!` because if we get here, we should have created the attr if it doesn't
194
- // already exist
195
- extractLookup(attrsStore, fwdAttr!['reverse-identity']![1], eidB),
196
- ]
197
- : [
198
- 'retract-triple',
199
- // Uses `!` because if we get here, we should have created the attr if it doesn't
200
- // already exist
201
- extractLookup(attrsStore, revAttr!['forward-identity'][1], eidB),
202
- revAttr!.id,
203
- extractLookup(attrsStore, etype, eidA),
204
- ];
205
- return txStep;
206
- });
207
- });
208
- return withIdAttrForLookup(attrsStore, etype, eidA, retractTriples);
209
- }
210
-
211
- type Ctx = {
212
- stores?: (Store | undefined)[];
213
- attrsStore: AttrsStore;
214
- schema?: Schema;
215
- useDateObjects?: boolean | null;
216
- };
217
-
218
- function convertOpts(_ctx: Ctx, [_etype, _eid, _obj, opts]) {
219
- // Cached entities may have been deleted out of band (#2769). Only an
220
- // explicit opt-out may turn the documented default upsert into an update.
221
- return opts?.upsert === false ? { mode: 'update' } : null;
222
- }
223
-
224
- function expandCreate(ctx: Ctx, step) {
225
- const { attrsStore } = ctx;
226
- const [etype, eid, obj_, opts] = step;
227
- const obj = immutableRemoveUndefined(obj_);
228
- const lookup = extractLookup(attrsStore, etype, eid);
229
- // id first so that we don't clobber updates on the lookup field
230
- const attrTuples = [['id', lookup]]
231
- .concat(Object.entries(obj))
232
- .map(([identName, value]: [string, any]) => {
233
- // Uses `!` because we should have optimistically created the attr if it doesn't exist
234
- const attr = getAttrByFwdIdentName(attrsStore, etype, identName)!;
235
-
236
- if (attr['checked-data-type'] === 'date' && ctx.useDateObjects) {
237
- value = coerceToDate(value);
238
- }
239
-
240
- return ['add-triple', lookup, attr.id, value, { mode: 'create' }];
241
- });
242
- return attrTuples;
243
- }
244
-
245
- function expandUpdate(ctx: Ctx, step) {
246
- const { attrsStore } = ctx;
247
- const [etype, eid, obj_, opts] = step;
248
- const obj = immutableRemoveUndefined(obj_);
249
- const lookup = extractLookup(attrsStore, etype, eid);
250
- const serverOpts = convertOpts(ctx, [etype, lookup, obj_, opts]);
251
- // id first so that we don't clobber updates on the lookup field
252
- const attrTuples = [['id', lookup]]
253
- .concat(Object.entries(obj))
254
- .map(([identName, value]: [string, any]) => {
255
- const attr = getAttrByFwdIdentName(attrsStore, etype, identName)!;
256
-
257
- if (attr['checked-data-type'] === 'date' && ctx.useDateObjects) {
258
- value = coerceToDate(value);
259
- }
260
-
261
- return [
262
- 'add-triple',
263
- lookup,
264
- attr.id,
265
- value,
266
- ...(serverOpts ? [serverOpts] : []),
267
- ];
268
- });
269
- return attrTuples;
270
- }
271
-
272
- function expandDelete({ attrsStore }: Ctx, [etype, eid]) {
273
- const lookup = extractLookup(attrsStore, etype, eid);
274
- return [['delete-entity', lookup, etype]];
275
- }
276
-
277
- function expandDeepMerge(ctx: Ctx, step) {
278
- const { attrsStore } = ctx;
279
- const [etype, eid, obj_, opts] = step;
280
- const obj = immutableRemoveUndefined(obj_);
281
- const lookup = extractLookup(attrsStore, etype, eid);
282
- const serverOpts = convertOpts(ctx, [etype, lookup, obj_, opts]);
283
- const attrTuples = Object.entries(obj).map(([identName, value]) => {
284
- const attr = getAttrByFwdIdentName(attrsStore, etype, identName)!;
285
- return [
286
- 'deep-merge-triple',
287
- lookup,
288
- attr.id,
289
- value,
290
- ...(serverOpts ? [serverOpts] : []),
291
- ];
292
- });
293
-
294
- const idTuple = [
295
- 'add-triple',
296
- lookup,
297
- getAttrByFwdIdentName(attrsStore, etype, 'id')!.id,
298
- lookup,
299
- ...(serverOpts ? [serverOpts] : []),
300
- ];
301
-
302
- // id first so that we don't clobber updates on the lookup field
303
- return [idTuple].concat(attrTuples);
304
- }
305
-
306
- function expandRuleParams({ attrsStore }: Ctx, [etype, eid, ruleParams]) {
307
- const lookup = extractLookup(attrsStore, etype, eid);
308
- return [['rule-params', lookup, etype, ruleParams]];
309
- }
310
-
311
- function removeIdFromArgs(step) {
312
- const [op, etype, eid, obj, opts] = step;
313
- if (!obj) {
314
- return step;
315
- }
316
- const newObj = { ...obj };
317
- delete newObj.id;
318
- return [op, etype, eid, newObj, ...(opts ? [opts] : [])];
319
- }
320
-
321
- function toTxSteps(ctx: Ctx, step) {
322
- const [action, ...args] = removeIdFromArgs(step);
323
- switch (action) {
324
- case 'merge':
325
- return expandDeepMerge(ctx, args);
326
- case 'create':
327
- return expandCreate(ctx, args);
328
- case 'update':
329
- return expandUpdate(ctx, args);
330
- case 'link':
331
- return expandLink(ctx, args);
332
- case 'unlink':
333
- return expandUnlink(ctx, args);
334
- case 'delete':
335
- return expandDelete(ctx, args);
336
- case 'ruleParams':
337
- return expandRuleParams(ctx, args);
338
- default:
339
- throw new Error(`unsupported action ${action}`);
340
- }
341
- }
342
-
343
- // ---------
344
- // transform
345
-
346
- function checkedDataTypeOfValueType(valueType) {
347
- switch (valueType) {
348
- case 'string':
349
- case 'date':
350
- case 'boolean':
351
- case 'number':
352
- return valueType;
353
- default:
354
- return undefined;
355
- }
356
- }
357
-
358
- function objectPropsFromSchema(schema, etype, label) {
359
- const attr = schema.entities[etype]?.attrs?.[label];
360
- if (label === 'id') return null;
361
- if (!attr) {
362
- throw new Error(`${etype}.${label} does not exist in your schema`);
363
- }
364
- const { unique, indexed } = attr?.config;
365
- const checkedDataType = checkedDataTypeOfValueType(attr?.valueType);
366
-
367
- return {
368
- 'index?': indexed,
369
- 'unique?': unique,
370
- 'checked-data-type': checkedDataType,
371
- };
372
- }
373
-
374
- function createObjectAttr(schema, etype, label, props) {
375
- const schemaObjectProps = schema
376
- ? objectPropsFromSchema(schema, etype, label)
377
- : null;
378
- const attrId = uuid();
379
- const fwdIdentId = uuid();
380
- const fwdIdent = [fwdIdentId, etype, label];
381
- return {
382
- id: attrId,
383
- 'forward-identity': fwdIdent,
384
- 'value-type': 'blob',
385
- cardinality: 'one',
386
- 'unique?': false,
387
- 'index?': false,
388
- isUnsynced: true,
389
- ...(schemaObjectProps || {}),
390
- ...(props || {}),
391
- };
392
- }
393
-
394
- type Link = LinkDef<any, any, any, any, any, any, any>;
395
- type Schema = IContainEntitiesAndLinks<any, any>;
396
-
397
- function findSchemaLink(schema: Schema, etype, label): Link | undefined {
398
- const links: Link[] = Object.values(schema.links);
399
- const found = links.find((x: Link) => {
400
- return (
401
- (x.forward.on === etype && x.forward.label === label) ||
402
- (x.reverse.on === etype && x.reverse.label === label)
403
- );
404
- });
405
- return found;
406
- }
407
-
408
- function refPropsFromSchema(schema: Schema, etype, label) {
409
- const found = findSchemaLink(schema, etype, label);
410
- if (!found) {
411
- throw new Error(`Couldn't find the link ${etype}.${label} in your schema`);
412
- }
413
- const { forward, reverse } = found;
414
- return {
415
- 'forward-identity': [uuid(), forward.on, forward.label],
416
- 'reverse-identity': [uuid(), reverse.on, reverse.label],
417
- cardinality: forward.has === 'one' ? 'one' : 'many',
418
- 'unique?': reverse.has === 'one',
419
- 'on-delete': forward.onDelete,
420
- 'on-delete-reverse': reverse.onDelete,
421
- };
422
- }
423
-
424
- function createRefAttr(
425
- schema: Schema | undefined,
426
- etype: string,
427
- label: string,
428
- props?: Partial<BackendRelayDBAttr> | undefined,
429
- ): BackendRelayDBAttr {
430
- const schemaRefProps = schema
431
- ? refPropsFromSchema(schema, etype, label)
432
- : null;
433
- const attrId = uuid();
434
- const fwdIdent: BackendRelayDBIdent = [uuid(), etype, label];
435
- const revIdent: BackendRelayDBIdent = [uuid(), label, etype];
436
- return {
437
- id: attrId,
438
- // @ts-ignore: ts thinks it's any[]
439
- 'forward-identity': fwdIdent,
440
- // @ts-ignore: ts thinks it's any[]
441
- 'reverse-identity': revIdent,
442
- 'value-type': 'ref',
443
- // @ts-ignore: ts thinks it's type string
444
- cardinality: 'many',
445
- 'unique?': false,
446
- 'index?': false,
447
- isUnsynced: true,
448
- ...(schemaRefProps || {}),
449
- ...(props || {}),
450
- };
451
- }
452
-
453
- // Actions that have an object, e.g. not delete
454
- const OBJ_ACTIONS = new Set(['create', 'update', 'merge', 'link', 'unlink']);
455
- const REF_ACTIONS = new Set(['link', 'unlink']);
456
- const UPDATE_ACTIONS = new Set(['create', 'update', 'merge']);
457
- const SUPPORTS_LOOKUP_ACTIONS = new Set([
458
- 'link',
459
- 'unlink',
460
- 'create',
461
- 'update',
462
- 'merge',
463
- 'delete',
464
- 'ruleParams',
465
- ]);
466
-
467
- const lookupProps: Partial<BackendRelayDBAttr> = {
468
- 'unique?': true,
469
- 'index?': true,
470
- };
471
- const refLookupProps: Partial<BackendRelayDBAttr> = {
472
- ...lookupProps,
473
- cardinality: 'one',
474
- };
475
-
476
- function lookupPairsOfOp(op) {
477
- const res: { etype: string; lookupPair: any; linkLabel?: string }[] = [];
478
- const [action, etype, eid, obj] = op;
479
- if (!SUPPORTS_LOOKUP_ACTIONS.has(action)) {
480
- return res;
481
- }
482
-
483
- const eidLookupPair = lookupPairOfEid(eid);
484
- if (eidLookupPair) {
485
- res.push({ etype: etype, lookupPair: eidLookupPair });
486
- }
487
- if (action === 'link') {
488
- for (const [label, eidOrEids] of Object.entries(obj)) {
489
- const eids = Array.isArray(eidOrEids) ? eidOrEids : [eidOrEids];
490
- for (const linkEid of eids) {
491
- const linkEidLookupPair = lookupPairOfEid(linkEid);
492
- if (linkEidLookupPair) {
493
- res.push({
494
- etype: etype,
495
- lookupPair: linkEidLookupPair,
496
- linkLabel: label,
497
- });
498
- }
499
- }
500
- }
501
- }
502
- return res;
503
- }
504
-
505
- function createMissingAttrs(
506
- { attrsStore, schema }: Ctx,
507
- ops,
508
- ): [AttrsStore, TXStep[]] {
509
- const addedIds = new Set();
510
- const localAttrs: BackendRelayDBAttr[] = [];
511
- const addOps: TXStep[] = [];
512
-
513
- function attrByFwdIdent(etype, label): BackendRelayDBAttr | undefined {
514
- return (
515
- getAttrByFwdIdentName(attrsStore, etype, label) ||
516
- localAttrs.find(
517
- (x) =>
518
- x['forward-identity'][1] === etype &&
519
- x['forward-identity'][2] === label,
520
- )
521
- );
522
- }
523
-
524
- function attrByRevIdent(etype, label): BackendRelayDBAttr | undefined {
525
- return (
526
- getAttrByReverseIdentName(attrsStore, etype, label) ||
527
- localAttrs.find(
528
- (x) =>
529
- x['reverse-identity']?.[1] === etype &&
530
- x['reverse-identity']?.[2] === label,
531
- )
532
- );
533
- }
534
-
535
- function addAttr(attr: BackendRelayDBAttr) {
536
- localAttrs.push(attr);
537
- addOps.push(['add-attr', attr]);
538
- addedIds.add(attr.id);
539
- }
540
- function addUnsynced(
541
- attr:
542
- | (BackendRelayDBAttr & { isUnsynced?: boolean })
543
- | BackendRelayDBAttr
544
- | undefined,
545
- ) {
546
- if (
547
- attr &&
548
- 'isUnsynced' in attr &&
549
- attr.isUnsynced &&
550
- !addedIds.has(attr.id)
551
- ) {
552
- localAttrs.push(attr);
553
- addOps.push(['add-attr', attr]);
554
- addedIds.add(attr.id);
555
- }
556
- }
557
-
558
- function isRefLookupIdentLocal(etype: string, identName: string) {
559
- return (
560
- identName.indexOf('.') !== -1 &&
561
- // attr names can have `.` in them, so use the attr we find with a `.`
562
- // before assuming it's a ref lookup.
563
- !attrByFwdIdent(etype, identName)
564
- );
565
- }
566
-
567
- // Adds attrs needed for a ref lookup
568
- function addForRef(etype, label) {
569
- const fwdAttr = attrByFwdIdent(etype, label);
570
- const revAttr = attrByRevIdent(etype, label);
571
- addUnsynced(fwdAttr);
572
- addUnsynced(revAttr);
573
- if (!fwdAttr && !revAttr) {
574
- addAttr(createRefAttr(schema, etype, label, refLookupProps));
575
- }
576
- }
577
-
578
- // Create attrs for lookups if we need to
579
- // Do these first because otherwise we might add a non-unique attr
580
- // before we get to it
581
- for (const op of ops) {
582
- for (const { etype, lookupPair, linkLabel } of lookupPairsOfOp(op)) {
583
- const identName = lookupPair[0];
584
- // We got a link eid that's a lookup, linkLabel is the label of the ident,
585
- // e.g. `posts` in `link({posts: postIds})`
586
- if (linkLabel) {
587
- // Add our ref attr, e.g. users.posts
588
- addForRef(etype, linkLabel);
589
-
590
- // Figure out the link etype so we can make sure we have the attrs
591
- // for the link lookup
592
- const fwdAttr = attrByFwdIdent(etype, linkLabel);
593
- const revAttr = attrByRevIdent(etype, linkLabel);
594
- addUnsynced(fwdAttr);
595
- addUnsynced(revAttr);
596
- const linkEtype =
597
- fwdAttr?.['reverse-identity']?.[1] ||
598
- revAttr?.['forward-identity']?.[1] ||
599
- linkLabel;
600
- if (isRefLookupIdentLocal(linkEtype, identName)) {
601
- addForRef(linkEtype, extractRefLookupFwdName(identName));
602
- } else {
603
- const attr = attrByFwdIdent(linkEtype, identName);
604
- if (!attr) {
605
- addAttr(
606
- createObjectAttr(schema, linkEtype, identName, lookupProps),
607
- );
608
- }
609
- addUnsynced(attr);
610
- }
611
- } else if (isRefLookupIdentLocal(etype, identName)) {
612
- addForRef(etype, extractRefLookupFwdName(identName));
613
- } else {
614
- const attr = attrByFwdIdent(etype, identName);
615
- if (!attr) {
616
- addAttr(createObjectAttr(schema, etype, identName, lookupProps));
617
- }
618
- addUnsynced(attr);
619
- }
620
- }
621
- }
622
-
623
- // Create object and ref attrs
624
- for (const op of ops) {
625
- const [action, etype, eid, obj] = op;
626
- if (OBJ_ACTIONS.has(action)) {
627
- const idAttr = attrByFwdIdent(etype, 'id');
628
- addUnsynced(idAttr);
629
- if (!idAttr) {
630
- addAttr(createObjectAttr(schema, etype, 'id', { 'unique?': true }));
631
- }
632
-
633
- for (const label of Object.keys(obj)) {
634
- const fwdAttr = attrByFwdIdent(etype, label);
635
- addUnsynced(fwdAttr);
636
- if (UPDATE_ACTIONS.has(action)) {
637
- if (!fwdAttr) {
638
- addAttr(
639
- createObjectAttr(
640
- schema,
641
- etype,
642
- label,
643
- label === 'id' ? { 'unique?': true } : null,
644
- ),
645
- );
646
- }
647
- }
648
- if (REF_ACTIONS.has(action)) {
649
- const revAttr = attrByRevIdent(etype, label);
650
- if (!fwdAttr && !revAttr) {
651
- addAttr(createRefAttr(schema, etype, label));
652
- }
653
- addUnsynced(revAttr);
654
- }
655
- }
656
- }
657
- }
658
-
659
- if (localAttrs.length) {
660
- const nextAttrs = { ...attrsStore.attrs };
661
- for (const attr of localAttrs) {
662
- nextAttrs[attr.id] = attr;
663
- }
664
- return [new AttrsStoreClass(nextAttrs, attrsStore.linkIndex), addOps];
665
- }
666
- return [attrsStore, addOps];
667
- }
668
-
669
- export function transform(ctx: Ctx, inputChunks) {
670
- const chunks = Array.isArray(inputChunks) ? inputChunks : [inputChunks];
671
- const ops = chunks.flatMap((tx) => getOps(tx));
672
- const [newAttrs, addAttrTxSteps] = createMissingAttrs(ctx, ops);
673
- const newCtx = { ...ctx, attrsStore: newAttrs };
674
- const txSteps = ops.flatMap((op) => toTxSteps(newCtx, op));
675
- return [...addAttrTxSteps, ...txSteps];
676
- }