spacetimedb 0.0.2 → 0.0.3

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 (278) hide show
  1. package/dist/browser/react/index.mjs.map +1 -1
  2. package/dist/index.browser.mjs +18 -4
  3. package/dist/index.browser.mjs.map +1 -1
  4. package/dist/index.cjs +18 -16
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.ts +13 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.mjs +18 -16
  9. package/dist/index.mjs.map +1 -1
  10. package/dist/lib/algebraic_type.d.ts +115 -0
  11. package/dist/lib/algebraic_type.d.ts.map +1 -0
  12. package/dist/lib/algebraic_value.d.ts +6 -0
  13. package/dist/lib/algebraic_value.d.ts.map +1 -0
  14. package/dist/lib/autogen/algebraic_type_type.d.ts +64 -0
  15. package/dist/lib/autogen/algebraic_type_type.d.ts.map +1 -0
  16. package/dist/lib/autogen/algebraic_type_variants.d.ts +68 -0
  17. package/dist/lib/autogen/algebraic_type_variants.d.ts.map +1 -0
  18. package/dist/lib/autogen/index_type_type.d.ts +16 -0
  19. package/dist/lib/autogen/index_type_type.d.ts.map +1 -0
  20. package/dist/lib/autogen/index_type_variants.d.ts +7 -0
  21. package/dist/lib/autogen/index_type_variants.d.ts.map +1 -0
  22. package/dist/lib/autogen/lifecycle_type.d.ts +19 -0
  23. package/dist/lib/autogen/lifecycle_type.d.ts.map +1 -0
  24. package/dist/lib/autogen/lifecycle_variants.d.ts +10 -0
  25. package/dist/lib/autogen/lifecycle_variants.d.ts.map +1 -0
  26. package/dist/lib/autogen/misc_module_export_type.d.ts +12 -0
  27. package/dist/lib/autogen/misc_module_export_type.d.ts.map +1 -0
  28. package/dist/lib/autogen/misc_module_export_variants.d.ts +6 -0
  29. package/dist/lib/autogen/misc_module_export_variants.d.ts.map +1 -0
  30. package/dist/lib/autogen/product_type_element_type.d.ts +20 -0
  31. package/dist/lib/autogen/product_type_element_type.d.ts.map +1 -0
  32. package/dist/lib/autogen/product_type_type.d.ts +19 -0
  33. package/dist/lib/autogen/product_type_type.d.ts.map +1 -0
  34. package/dist/lib/autogen/raw_column_def_v_8_type.d.ts +20 -0
  35. package/dist/lib/autogen/raw_column_def_v_8_type.d.ts.map +1 -0
  36. package/dist/lib/autogen/raw_column_default_value_v_9_type.d.ts +20 -0
  37. package/dist/lib/autogen/raw_column_default_value_v_9_type.d.ts.map +1 -0
  38. package/dist/lib/autogen/raw_constraint_data_v_9_type.d.ts +12 -0
  39. package/dist/lib/autogen/raw_constraint_data_v_9_type.d.ts.map +1 -0
  40. package/dist/lib/autogen/raw_constraint_data_v_9_variants.d.ts +6 -0
  41. package/dist/lib/autogen/raw_constraint_data_v_9_variants.d.ts.map +1 -0
  42. package/dist/lib/autogen/raw_constraint_def_v_8_type.d.ts +20 -0
  43. package/dist/lib/autogen/raw_constraint_def_v_8_type.d.ts.map +1 -0
  44. package/dist/lib/autogen/raw_constraint_def_v_9_type.d.ts +20 -0
  45. package/dist/lib/autogen/raw_constraint_def_v_9_type.d.ts.map +1 -0
  46. package/dist/lib/autogen/raw_index_algorithm_type.d.ts +13 -0
  47. package/dist/lib/autogen/raw_index_algorithm_type.d.ts.map +1 -0
  48. package/dist/lib/autogen/raw_index_algorithm_variants.d.ts +13 -0
  49. package/dist/lib/autogen/raw_index_algorithm_variants.d.ts.map +1 -0
  50. package/dist/lib/autogen/raw_index_def_v_8_type.d.ts +22 -0
  51. package/dist/lib/autogen/raw_index_def_v_8_type.d.ts.map +1 -0
  52. package/dist/lib/autogen/raw_index_def_v_9_type.d.ts +21 -0
  53. package/dist/lib/autogen/raw_index_def_v_9_type.d.ts.map +1 -0
  54. package/dist/lib/autogen/raw_misc_module_export_v_9_type.d.ts +12 -0
  55. package/dist/lib/autogen/raw_misc_module_export_v_9_type.d.ts.map +1 -0
  56. package/dist/lib/autogen/raw_misc_module_export_v_9_variants.d.ts +6 -0
  57. package/dist/lib/autogen/raw_misc_module_export_v_9_variants.d.ts.map +1 -0
  58. package/dist/lib/autogen/raw_module_def_type.d.ts +14 -0
  59. package/dist/lib/autogen/raw_module_def_type.d.ts.map +1 -0
  60. package/dist/lib/autogen/raw_module_def_v_8_type.d.ts +25 -0
  61. package/dist/lib/autogen/raw_module_def_v_8_type.d.ts.map +1 -0
  62. package/dist/lib/autogen/raw_module_def_v_9_type.d.ts +29 -0
  63. package/dist/lib/autogen/raw_module_def_v_9_type.d.ts.map +1 -0
  64. package/dist/lib/autogen/raw_module_def_variants.d.ts +11 -0
  65. package/dist/lib/autogen/raw_module_def_variants.d.ts.map +1 -0
  66. package/dist/lib/autogen/raw_reducer_def_v_9_type.d.ts +22 -0
  67. package/dist/lib/autogen/raw_reducer_def_v_9_type.d.ts.map +1 -0
  68. package/dist/lib/autogen/raw_row_level_security_def_v_9_type.d.ts +18 -0
  69. package/dist/lib/autogen/raw_row_level_security_def_v_9_type.d.ts.map +1 -0
  70. package/dist/lib/autogen/raw_schedule_def_v_9_type.d.ts +20 -0
  71. package/dist/lib/autogen/raw_schedule_def_v_9_type.d.ts.map +1 -0
  72. package/dist/lib/autogen/raw_scoped_type_name_v_9_type.d.ts +19 -0
  73. package/dist/lib/autogen/raw_scoped_type_name_v_9_type.d.ts.map +1 -0
  74. package/dist/lib/autogen/raw_sequence_def_v_8_type.d.ts +24 -0
  75. package/dist/lib/autogen/raw_sequence_def_v_8_type.d.ts.map +1 -0
  76. package/dist/lib/autogen/raw_sequence_def_v_9_type.d.ts +23 -0
  77. package/dist/lib/autogen/raw_sequence_def_v_9_type.d.ts.map +1 -0
  78. package/dist/lib/autogen/raw_table_def_v_8_type.d.ts +29 -0
  79. package/dist/lib/autogen/raw_table_def_v_8_type.d.ts.map +1 -0
  80. package/dist/lib/autogen/raw_table_def_v_9_type.d.ts +32 -0
  81. package/dist/lib/autogen/raw_table_def_v_9_type.d.ts.map +1 -0
  82. package/dist/lib/autogen/raw_type_def_v_9_type.d.ts +21 -0
  83. package/dist/lib/autogen/raw_type_def_v_9_type.d.ts.map +1 -0
  84. package/dist/lib/autogen/raw_unique_constraint_data_v_9_type.d.ts +18 -0
  85. package/dist/lib/autogen/raw_unique_constraint_data_v_9_type.d.ts.map +1 -0
  86. package/dist/lib/autogen/reducer_def_type.d.ts +20 -0
  87. package/dist/lib/autogen/reducer_def_type.d.ts.map +1 -0
  88. package/dist/lib/autogen/sum_type_type.d.ts +19 -0
  89. package/dist/lib/autogen/sum_type_type.d.ts.map +1 -0
  90. package/dist/lib/autogen/sum_type_variant_type.d.ts +20 -0
  91. package/dist/lib/autogen/sum_type_variant_type.d.ts.map +1 -0
  92. package/dist/lib/autogen/table_access_type.d.ts +16 -0
  93. package/dist/lib/autogen/table_access_type.d.ts.map +1 -0
  94. package/dist/lib/autogen/table_access_variants.d.ts +7 -0
  95. package/dist/lib/autogen/table_access_variants.d.ts.map +1 -0
  96. package/dist/lib/autogen/table_desc_type.d.ts +20 -0
  97. package/dist/lib/autogen/table_desc_type.d.ts.map +1 -0
  98. package/dist/lib/autogen/table_type_type.d.ts +16 -0
  99. package/dist/lib/autogen/table_type_type.d.ts.map +1 -0
  100. package/dist/lib/autogen/table_type_variants.d.ts +7 -0
  101. package/dist/lib/autogen/table_type_variants.d.ts.map +1 -0
  102. package/dist/lib/autogen/type_alias_type.d.ts +19 -0
  103. package/dist/lib/autogen/type_alias_type.d.ts.map +1 -0
  104. package/dist/lib/autogen/typespace_type.d.ts +19 -0
  105. package/dist/lib/autogen/typespace_type.d.ts.map +1 -0
  106. package/dist/lib/binary_reader.d.ts +25 -0
  107. package/dist/lib/binary_reader.d.ts.map +1 -0
  108. package/dist/lib/binary_writer.d.ts +25 -0
  109. package/dist/lib/binary_writer.d.ts.map +1 -0
  110. package/dist/lib/connection_id.d.ts +37 -0
  111. package/dist/lib/connection_id.d.ts.map +1 -0
  112. package/dist/lib/identity.d.ts +39 -0
  113. package/dist/lib/identity.d.ts.map +1 -0
  114. package/dist/lib/schedule_at.d.ts +23 -0
  115. package/dist/lib/schedule_at.d.ts.map +1 -0
  116. package/dist/lib/time_duration.d.ts +18 -0
  117. package/dist/lib/time_duration.d.ts.map +1 -0
  118. package/dist/lib/timestamp.d.ts +35 -0
  119. package/dist/lib/timestamp.d.ts.map +1 -0
  120. package/dist/lib/utils.d.ts +13 -0
  121. package/dist/lib/utils.d.ts.map +1 -0
  122. package/dist/min/index.browser.mjs +1 -1
  123. package/dist/min/index.browser.mjs.map +1 -1
  124. package/dist/min/react/index.mjs.map +1 -1
  125. package/dist/min/sdk/index.browser.mjs +1 -1
  126. package/dist/min/sdk/index.browser.mjs.map +1 -1
  127. package/dist/react/SpacetimeDBProvider.d.ts +8 -0
  128. package/dist/react/SpacetimeDBProvider.d.ts.map +1 -0
  129. package/dist/react/index.cjs.map +1 -1
  130. package/dist/react/index.d.ts +4 -0
  131. package/dist/react/index.d.ts.map +1 -0
  132. package/dist/react/index.mjs.map +1 -1
  133. package/dist/react/useSpacetimeDB.d.ts +5 -0
  134. package/dist/react/useSpacetimeDB.d.ts.map +1 -0
  135. package/dist/react/useTable.d.ts +120 -0
  136. package/dist/react/useTable.d.ts.map +1 -0
  137. package/dist/sdk/client_api/bsatn_row_list_type.d.ts +20 -0
  138. package/dist/sdk/client_api/bsatn_row_list_type.d.ts.map +1 -0
  139. package/dist/sdk/client_api/call_reducer_type.d.ts +21 -0
  140. package/dist/sdk/client_api/call_reducer_type.d.ts.map +1 -0
  141. package/dist/sdk/client_api/client_message_type.d.ts +24 -0
  142. package/dist/sdk/client_api/client_message_type.d.ts.map +1 -0
  143. package/dist/sdk/client_api/client_message_variants.d.ts +36 -0
  144. package/dist/sdk/client_api/client_message_variants.d.ts.map +1 -0
  145. package/dist/sdk/client_api/compressable_query_update_type.d.ts +14 -0
  146. package/dist/sdk/client_api/compressable_query_update_type.d.ts.map +1 -0
  147. package/dist/sdk/client_api/compressable_query_update_variants.d.ts +14 -0
  148. package/dist/sdk/client_api/compressable_query_update_variants.d.ts.map +1 -0
  149. package/dist/sdk/client_api/database_update_type.d.ts +19 -0
  150. package/dist/sdk/client_api/database_update_type.d.ts.map +1 -0
  151. package/dist/sdk/client_api/energy_quanta_type.d.ts +18 -0
  152. package/dist/sdk/client_api/energy_quanta_type.d.ts.map +1 -0
  153. package/dist/sdk/client_api/identity_token_type.d.ts +20 -0
  154. package/dist/sdk/client_api/identity_token_type.d.ts.map +1 -0
  155. package/dist/sdk/client_api/index.d.ts +86 -0
  156. package/dist/sdk/client_api/index.d.ts.map +1 -0
  157. package/dist/sdk/client_api/initial_subscription_type.d.ts +21 -0
  158. package/dist/sdk/client_api/initial_subscription_type.d.ts.map +1 -0
  159. package/dist/sdk/client_api/one_off_query_response_type.d.ts +22 -0
  160. package/dist/sdk/client_api/one_off_query_response_type.d.ts.map +1 -0
  161. package/dist/sdk/client_api/one_off_query_type.d.ts +19 -0
  162. package/dist/sdk/client_api/one_off_query_type.d.ts.map +1 -0
  163. package/dist/sdk/client_api/one_off_table_type.d.ts +20 -0
  164. package/dist/sdk/client_api/one_off_table_type.d.ts.map +1 -0
  165. package/dist/sdk/client_api/query_id_type.d.ts +18 -0
  166. package/dist/sdk/client_api/query_id_type.d.ts.map +1 -0
  167. package/dist/sdk/client_api/query_update_type.d.ts +20 -0
  168. package/dist/sdk/client_api/query_update_type.d.ts.map +1 -0
  169. package/dist/sdk/client_api/reducer_call_info_type.d.ts +21 -0
  170. package/dist/sdk/client_api/reducer_call_info_type.d.ts.map +1 -0
  171. package/dist/sdk/client_api/row_size_hint_type.d.ts +12 -0
  172. package/dist/sdk/client_api/row_size_hint_type.d.ts.map +1 -0
  173. package/dist/sdk/client_api/row_size_hint_variants.d.ts +9 -0
  174. package/dist/sdk/client_api/row_size_hint_variants.d.ts.map +1 -0
  175. package/dist/sdk/client_api/server_message_type.d.ts +30 -0
  176. package/dist/sdk/client_api/server_message_type.d.ts.map +1 -0
  177. package/dist/sdk/client_api/server_message_variants.d.ts +51 -0
  178. package/dist/sdk/client_api/server_message_variants.d.ts.map +1 -0
  179. package/dist/sdk/client_api/subscribe_applied_type.d.ts +23 -0
  180. package/dist/sdk/client_api/subscribe_applied_type.d.ts.map +1 -0
  181. package/dist/sdk/client_api/subscribe_multi_applied_type.d.ts +23 -0
  182. package/dist/sdk/client_api/subscribe_multi_applied_type.d.ts.map +1 -0
  183. package/dist/sdk/client_api/subscribe_multi_type.d.ts +21 -0
  184. package/dist/sdk/client_api/subscribe_multi_type.d.ts.map +1 -0
  185. package/dist/sdk/client_api/subscribe_rows_type.d.ts +21 -0
  186. package/dist/sdk/client_api/subscribe_rows_type.d.ts.map +1 -0
  187. package/dist/sdk/client_api/subscribe_single_type.d.ts +21 -0
  188. package/dist/sdk/client_api/subscribe_single_type.d.ts.map +1 -0
  189. package/dist/sdk/client_api/subscribe_type.d.ts +19 -0
  190. package/dist/sdk/client_api/subscribe_type.d.ts.map +1 -0
  191. package/dist/sdk/client_api/subscription_error_type.d.ts +22 -0
  192. package/dist/sdk/client_api/subscription_error_type.d.ts.map +1 -0
  193. package/dist/sdk/client_api/table_update_type.d.ts +22 -0
  194. package/dist/sdk/client_api/table_update_type.d.ts.map +1 -0
  195. package/dist/sdk/client_api/transaction_update_light_type.d.ts +20 -0
  196. package/dist/sdk/client_api/transaction_update_light_type.d.ts.map +1 -0
  197. package/dist/sdk/client_api/transaction_update_type.d.ts +27 -0
  198. package/dist/sdk/client_api/transaction_update_type.d.ts.map +1 -0
  199. package/dist/sdk/client_api/unsubscribe_applied_type.d.ts +23 -0
  200. package/dist/sdk/client_api/unsubscribe_applied_type.d.ts.map +1 -0
  201. package/dist/sdk/client_api/unsubscribe_multi_applied_type.d.ts +23 -0
  202. package/dist/sdk/client_api/unsubscribe_multi_applied_type.d.ts.map +1 -0
  203. package/dist/sdk/client_api/unsubscribe_multi_type.d.ts +20 -0
  204. package/dist/sdk/client_api/unsubscribe_multi_type.d.ts.map +1 -0
  205. package/dist/sdk/client_api/unsubscribe_type.d.ts +20 -0
  206. package/dist/sdk/client_api/unsubscribe_type.d.ts.map +1 -0
  207. package/dist/sdk/client_api/update_status_type.d.ts +16 -0
  208. package/dist/sdk/client_api/update_status_type.d.ts.map +1 -0
  209. package/dist/sdk/client_api/update_status_variants.d.ts +13 -0
  210. package/dist/sdk/client_api/update_status_variants.d.ts.map +1 -0
  211. package/dist/sdk/client_cache.d.ts +17 -0
  212. package/dist/sdk/client_cache.d.ts.map +1 -0
  213. package/dist/sdk/db_connection_builder.d.ts +145 -0
  214. package/dist/sdk/db_connection_builder.d.ts.map +1 -0
  215. package/dist/sdk/db_connection_impl.d.ts +102 -0
  216. package/dist/sdk/db_connection_impl.d.ts.map +1 -0
  217. package/dist/sdk/db_context.d.ts +25 -0
  218. package/dist/sdk/db_context.d.ts.map +1 -0
  219. package/dist/sdk/decompress.d.ts +2 -0
  220. package/dist/sdk/decompress.d.ts.map +1 -0
  221. package/dist/sdk/event.d.ts +15 -0
  222. package/dist/sdk/event.d.ts.map +1 -0
  223. package/dist/sdk/event_context.d.ts +18 -0
  224. package/dist/sdk/event_context.d.ts.map +1 -0
  225. package/dist/sdk/event_emitter.d.ts +7 -0
  226. package/dist/sdk/event_emitter.d.ts.map +1 -0
  227. package/dist/sdk/index.browser.mjs +18 -4
  228. package/dist/sdk/index.browser.mjs.map +1 -1
  229. package/dist/sdk/index.cjs +18 -16
  230. package/dist/sdk/index.cjs.map +1 -1
  231. package/dist/sdk/index.d.ts +4 -0
  232. package/dist/sdk/index.d.ts.map +1 -0
  233. package/dist/sdk/index.mjs +18 -16
  234. package/dist/sdk/index.mjs.map +1 -1
  235. package/dist/sdk/json_api.d.ts +40 -0
  236. package/dist/sdk/json_api.d.ts.map +1 -0
  237. package/dist/sdk/logger.d.ts +4 -0
  238. package/dist/sdk/logger.d.ts.map +1 -0
  239. package/dist/sdk/message_types.d.ts +50 -0
  240. package/dist/sdk/message_types.d.ts.map +1 -0
  241. package/dist/sdk/reducer_event.d.ts +42 -0
  242. package/dist/sdk/reducer_event.d.ts.map +1 -0
  243. package/dist/sdk/spacetime_module.d.ts +31 -0
  244. package/dist/sdk/spacetime_module.d.ts.map +1 -0
  245. package/dist/sdk/subscription_builder_impl.d.ts +126 -0
  246. package/dist/sdk/subscription_builder_impl.d.ts.map +1 -0
  247. package/dist/sdk/table_cache.d.ts +111 -0
  248. package/dist/sdk/table_cache.d.ts.map +1 -0
  249. package/dist/sdk/version.d.ts +18 -0
  250. package/dist/sdk/version.d.ts.map +1 -0
  251. package/dist/sdk/websocket_decompress_adapter.d.ts +21 -0
  252. package/dist/sdk/websocket_decompress_adapter.d.ts.map +1 -0
  253. package/dist/sdk/websocket_test_adapter.d.ts +22 -0
  254. package/dist/sdk/websocket_test_adapter.d.ts.map +1 -0
  255. package/dist/sdk/ws.d.ts +2 -0
  256. package/dist/sdk/ws.d.ts.map +1 -0
  257. package/dist/server/index.d.ts +3 -0
  258. package/dist/server/index.d.ts.map +1 -0
  259. package/dist/server/type_builders.d.ts +656 -0
  260. package/dist/server/type_builders.d.ts.map +1 -0
  261. package/dist/server/type_builders.test-d.d.ts +2 -0
  262. package/dist/server/type_builders.test-d.d.ts.map +1 -0
  263. package/dist/server/type_util.d.ts +18 -0
  264. package/dist/server/type_util.d.ts.map +1 -0
  265. package/package.json +30 -27
  266. package/src/react/SpacetimeDBProvider.ts +4 -1
  267. package/src/react/useSpacetimeDB.ts +1 -1
  268. package/src/react/useTable.ts +1 -1
  269. package/src/sdk/db_connection_builder.ts +1 -1
  270. package/src/sdk/db_connection_impl.ts +6 -6
  271. package/src/sdk/message_types.ts +3 -3
  272. package/src/sdk/reducer_event.ts +3 -3
  273. package/src/sdk/spacetime_module.ts +1 -1
  274. package/src/sdk/table_cache.ts +1 -1
  275. package/src/sdk/websocket_decompress_adapter.ts +2 -30
  276. package/src/sdk/websocket_test_adapter.ts +1 -1
  277. package/src/sdk/ws.ts +24 -0
  278. package/LICENSE.txt +0 -759
@@ -0,0 +1,22 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ export type SubscriptionError = {
3
+ totalHostExecutionDurationMicros: bigint;
4
+ requestId: number | undefined;
5
+ queryId: number | undefined;
6
+ tableId: number | undefined;
7
+ error: string;
8
+ };
9
+ /**
10
+ * An object for generated helper functions.
11
+ */
12
+ export declare const SubscriptionError: {
13
+ /**
14
+ * A function which returns this type represented as an AlgebraicType.
15
+ * This function is derived from the AlgebraicType used to generate this type.
16
+ */
17
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
18
+ serialize(writer: __BinaryWriter, value: SubscriptionError): void;
19
+ deserialize(reader: __BinaryReader): SubscriptionError;
20
+ };
21
+ export default SubscriptionError;
22
+ //# sourceMappingURL=subscription_error_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscription_error_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/subscription_error_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AAErB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,gCAAgC,EAAE,MAAM,CAAC;IACzC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B;;;OAGG;kCAC2B,mBAAmB;sBA8B/B,cAAc,SAAS,iBAAiB,GAAG,IAAI;wBAQ7C,cAAc,GAAG,iBAAiB;CAMvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { CompressableQueryUpdate } from './compressable_query_update_type';
3
+ export type TableUpdate = {
4
+ tableId: number;
5
+ tableName: string;
6
+ numRows: bigint;
7
+ updates: CompressableQueryUpdate[];
8
+ };
9
+ /**
10
+ * An object for generated helper functions.
11
+ */
12
+ export declare const TableUpdate: {
13
+ /**
14
+ * A function which returns this type represented as an AlgebraicType.
15
+ * This function is derived from the AlgebraicType used to generate this type.
16
+ */
17
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
18
+ serialize(writer: __BinaryWriter, value: TableUpdate): void;
19
+ deserialize(reader: __BinaryReader): TableUpdate;
20
+ };
21
+ export default TableUpdate;
22
+ //# sourceMappingURL=table_update_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table_update_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/table_update_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAI3E,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,uBAAuB,EAAE,CAAC;CACpC,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;;OAGG;kCAC2B,mBAAmB;sBAgB/B,cAAc,SAAS,WAAW,GAAG,IAAI;wBAQvC,cAAc,GAAG,WAAW;CAMjD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { DatabaseUpdate } from './database_update_type';
3
+ export type TransactionUpdateLight = {
4
+ requestId: number;
5
+ update: DatabaseUpdate;
6
+ };
7
+ /**
8
+ * An object for generated helper functions.
9
+ */
10
+ export declare const TransactionUpdateLight: {
11
+ /**
12
+ * A function which returns this type represented as an AlgebraicType.
13
+ * This function is derived from the AlgebraicType used to generate this type.
14
+ */
15
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
16
+ serialize(writer: __BinaryWriter, value: TransactionUpdateLight): void;
17
+ deserialize(reader: __BinaryReader): TransactionUpdateLight;
18
+ };
19
+ export default TransactionUpdateLight;
20
+ //# sourceMappingURL=transaction_update_light_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction_update_light_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/transaction_update_light_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,MAAM,MAAM,sBAAsB,GAAG;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,sBAAsB;IACjC;;;OAGG;kCAC2B,mBAAmB;sBAY/B,cAAc,SAAS,sBAAsB,GAAG,IAAI;wBAQlD,cAAc,GAAG,sBAAsB;CAM5D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, ConnectionId as __ConnectionId, Identity as __Identity, TimeDuration as __TimeDuration, Timestamp as __Timestamp, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { UpdateStatus } from './update_status_type';
3
+ import { ReducerCallInfo } from './reducer_call_info_type';
4
+ import { EnergyQuanta } from './energy_quanta_type';
5
+ export type TransactionUpdate = {
6
+ status: UpdateStatus;
7
+ timestamp: __Timestamp;
8
+ callerIdentity: __Identity;
9
+ callerConnectionId: __ConnectionId;
10
+ reducerCall: ReducerCallInfo;
11
+ energyQuantaUsed: EnergyQuanta;
12
+ totalHostExecutionDuration: __TimeDuration;
13
+ };
14
+ /**
15
+ * An object for generated helper functions.
16
+ */
17
+ export declare const TransactionUpdate: {
18
+ /**
19
+ * A function which returns this type represented as an AlgebraicType.
20
+ * This function is derived from the AlgebraicType used to generate this type.
21
+ */
22
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
23
+ serialize(writer: __BinaryWriter, value: TransactionUpdate): void;
24
+ deserialize(reader: __BinaryReader): TransactionUpdate;
25
+ };
26
+ export default TransactionUpdate;
27
+ //# sourceMappingURL=transaction_update_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction_update_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/transaction_update_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAE9B,YAAY,IAAI,cAAc,EAG9B,QAAQ,IAAI,UAAU,EAGtB,YAAY,IAAI,cAAc,EAC9B,SAAS,IAAI,WAAW,EAExB,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGpD,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAIpD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,WAAW,CAAC;IACvB,cAAc,EAAE,UAAU,CAAC;IAC3B,kBAAkB,EAAE,cAAc,CAAC;IACnC,WAAW,EAAE,eAAe,CAAC;IAC7B,gBAAgB,EAAE,YAAY,CAAC;IAC/B,0BAA0B,EAAE,cAAc,CAAC;CAC5C,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B;;;OAGG;kCAC2B,mBAAmB;sBAmC/B,cAAc,SAAS,iBAAiB,GAAG,IAAI;wBAQ7C,cAAc,GAAG,iBAAiB;CAMvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { QueryId } from './query_id_type';
3
+ import { SubscribeRows } from './subscribe_rows_type';
4
+ export type UnsubscribeApplied = {
5
+ requestId: number;
6
+ totalHostExecutionDurationMicros: bigint;
7
+ queryId: QueryId;
8
+ rows: SubscribeRows;
9
+ };
10
+ /**
11
+ * An object for generated helper functions.
12
+ */
13
+ export declare const UnsubscribeApplied: {
14
+ /**
15
+ * A function which returns this type represented as an AlgebraicType.
16
+ * This function is derived from the AlgebraicType used to generate this type.
17
+ */
18
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
19
+ serialize(writer: __BinaryWriter, value: UnsubscribeApplied): void;
20
+ deserialize(reader: __BinaryReader): UnsubscribeApplied;
21
+ };
22
+ export default UnsubscribeApplied;
23
+ //# sourceMappingURL=unsubscribe_applied_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsubscribe_applied_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/unsubscribe_applied_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAItD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC,EAAE,MAAM,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,aAAa,CAAC;CACrB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,kBAAkB;IAC7B;;;OAGG;kCAC2B,mBAAmB;sBAoB/B,cAAc,SAAS,kBAAkB,GAAG,IAAI;wBAQ9C,cAAc,GAAG,kBAAkB;CAMxD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { QueryId } from './query_id_type';
3
+ import { DatabaseUpdate } from './database_update_type';
4
+ export type UnsubscribeMultiApplied = {
5
+ requestId: number;
6
+ totalHostExecutionDurationMicros: bigint;
7
+ queryId: QueryId;
8
+ update: DatabaseUpdate;
9
+ };
10
+ /**
11
+ * An object for generated helper functions.
12
+ */
13
+ export declare const UnsubscribeMultiApplied: {
14
+ /**
15
+ * A function which returns this type represented as an AlgebraicType.
16
+ * This function is derived from the AlgebraicType used to generate this type.
17
+ */
18
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
19
+ serialize(writer: __BinaryWriter, value: UnsubscribeMultiApplied): void;
20
+ deserialize(reader: __BinaryReader): UnsubscribeMultiApplied;
21
+ };
22
+ export default UnsubscribeMultiApplied;
23
+ //# sourceMappingURL=unsubscribe_multi_applied_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsubscribe_multi_applied_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/unsubscribe_multi_applied_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC,EAAE,MAAM,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,cAAc,CAAC;CACxB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,uBAAuB;IAClC;;;OAGG;kCAC2B,mBAAmB;sBAoB/B,cAAc,SAAS,uBAAuB,GAAG,IAAI;wBAQnD,cAAc,GAAG,uBAAuB;CAM7D,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { QueryId } from './query_id_type';
3
+ export type UnsubscribeMulti = {
4
+ requestId: number;
5
+ queryId: QueryId;
6
+ };
7
+ /**
8
+ * An object for generated helper functions.
9
+ */
10
+ export declare const UnsubscribeMulti: {
11
+ /**
12
+ * A function which returns this type represented as an AlgebraicType.
13
+ * This function is derived from the AlgebraicType used to generate this type.
14
+ */
15
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
16
+ serialize(writer: __BinaryWriter, value: UnsubscribeMulti): void;
17
+ deserialize(reader: __BinaryReader): UnsubscribeMulti;
18
+ };
19
+ export default UnsubscribeMulti;
20
+ //# sourceMappingURL=unsubscribe_multi_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsubscribe_multi_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/unsubscribe_multi_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI1C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,gBAAgB;IAC3B;;;OAGG;kCAC2B,mBAAmB;sBAY/B,cAAc,SAAS,gBAAgB,GAAG,IAAI;wBAQ5C,cAAc,GAAG,gBAAgB;CAMtD,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { QueryId } from './query_id_type';
3
+ export type Unsubscribe = {
4
+ requestId: number;
5
+ queryId: QueryId;
6
+ };
7
+ /**
8
+ * An object for generated helper functions.
9
+ */
10
+ export declare const Unsubscribe: {
11
+ /**
12
+ * A function which returns this type represented as an AlgebraicType.
13
+ * This function is derived from the AlgebraicType used to generate this type.
14
+ */
15
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
16
+ serialize(writer: __BinaryWriter, value: Unsubscribe): void;
17
+ deserialize(reader: __BinaryReader): Unsubscribe;
18
+ };
19
+ export default Unsubscribe;
20
+ //# sourceMappingURL=unsubscribe_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsubscribe_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/unsubscribe_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI1C,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AACF;;GAEG;AACH,eAAO,MAAM,WAAW;IACtB;;;OAGG;kCAC2B,mBAAmB;sBAY/B,cAAc,SAAS,WAAW,GAAG,IAAI;wBAQvC,cAAc,GAAG,WAAW;CAMjD,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { BinaryReader as __BinaryReader, BinaryWriter as __BinaryWriter, type AlgebraicType as __AlgebraicTypeType } from '../../index';
2
+ import { DatabaseUpdate } from './database_update_type';
3
+ import * as UpdateStatusVariants from './update_status_variants';
4
+ export type UpdateStatus = UpdateStatusVariants.Committed | UpdateStatusVariants.Failed | UpdateStatusVariants.OutOfEnergy;
5
+ export declare const UpdateStatus: {
6
+ Committed: (value: DatabaseUpdate) => UpdateStatus;
7
+ Failed: (value: string) => UpdateStatus;
8
+ OutOfEnergy: {
9
+ readonly tag: "OutOfEnergy";
10
+ };
11
+ getTypeScriptAlgebraicType(): __AlgebraicTypeType;
12
+ serialize(writer: __BinaryWriter, value: UpdateStatus): void;
13
+ deserialize(reader: __BinaryReader): UpdateStatus;
14
+ };
15
+ export default UpdateStatus;
16
+ //# sourceMappingURL=update_status_type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update_status_type.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/update_status_type.ts"],"names":[],"mappings":"AAKA,OAAO,EAEL,YAAY,IAAI,cAAc,EAC9B,YAAY,IAAI,cAAc,EAW9B,KAAK,aAAa,IAAI,mBAAmB,EAQ1C,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAC;AAGjE,MAAM,MAAM,YAAY,GACpB,oBAAoB,CAAC,SAAS,GAC9B,oBAAoB,CAAC,MAAM,GAC3B,oBAAoB,CAAC,WAAW,CAAC;AAGrC,eAAO,MAAM,YAAY;uBAOJ,cAAc,KAAG,YAAY;oBAIhC,MAAM,KAAG,YAAY;;;;kCAGP,mBAAmB;sBAgB/B,cAAc,SAAS,YAAY,GAAG,IAAI;wBAQxC,cAAc,GAAG,YAAY;CAMlD,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { DatabaseUpdate as DatabaseUpdateType } from './database_update_type';
2
+ export type Committed = {
3
+ tag: 'Committed';
4
+ value: DatabaseUpdateType;
5
+ };
6
+ export type Failed = {
7
+ tag: 'Failed';
8
+ value: string;
9
+ };
10
+ export type OutOfEnergy = {
11
+ tag: 'OutOfEnergy';
12
+ };
13
+ //# sourceMappingURL=update_status_variants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update_status_variants.d.ts","sourceRoot":"","sources":["../../../src/sdk/client_api/update_status_variants.ts"],"names":[],"mappings":"AA4BA,OAAO,EAAE,cAAc,IAAI,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAI9E,MAAM,MAAM,SAAS,GAAG;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,MAAM,GAAG;IAAE,GAAG,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,aAAa,CAAA;CAAE,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { TableRuntimeTypeInfo } from './spacetime_module.ts';
2
+ import { TableCache } from './table_cache.ts';
3
+ export declare class ClientCache {
4
+ /**
5
+ * The tables in the database.
6
+ */
7
+ tables: Map<string, TableCache<any>>;
8
+ constructor();
9
+ /**
10
+ * Returns the table with the given name.
11
+ * @param name The name of the table.
12
+ * @returns The table
13
+ */
14
+ getTable<RowType extends Record<string, any>>(name: string): TableCache<RowType>;
15
+ getOrCreateTable<RowType extends Record<string, any>>(tableTypeInfo: TableRuntimeTypeInfo): TableCache<RowType>;
16
+ }
17
+ //# sourceMappingURL=client_cache.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client_cache.d.ts","sourceRoot":"","sources":["../../src/sdk/client_cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,WAAW;IACtB;;OAEG;IACH,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;;IAMrC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC1C,IAAI,EAAE,MAAM,GACX,UAAU,CAAC,OAAO,CAAC;IActB,gBAAgB,CAAC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAClD,aAAa,EAAE,oBAAoB,GAClC,UAAU,CAAC,OAAO,CAAC;CAUvB"}
@@ -0,0 +1,145 @@
1
+ import { DbConnectionImpl } from './db_connection_impl';
2
+ import type { Identity } from '../';
3
+ import type RemoteModule from './spacetime_module';
4
+ import { WebsocketDecompressAdapter } from './websocket_decompress_adapter';
5
+ /**
6
+ * The database client connection to a SpacetimeDB server.
7
+ */
8
+ export declare class DbConnectionBuilder<DbConnection, ErrorContext, _SubscriptionEventContext> {
9
+ #private;
10
+ private remoteModule;
11
+ private dbConnectionConstructor;
12
+ /**
13
+ * Creates a new `DbConnectionBuilder` database client and set the initial parameters.
14
+ *
15
+ * Users are not expected to call this constructor directly. Instead, use the static method `DbConnection.builder()`.
16
+ *
17
+ * @param remoteModule The remote module to use to connect to the SpacetimeDB server.
18
+ * @param dbConnectionConstructor The constructor to use to create a new `DbConnection`.
19
+ */
20
+ constructor(remoteModule: RemoteModule, dbConnectionConstructor: (imp: DbConnectionImpl) => DbConnection);
21
+ /**
22
+ * Set the URI of the SpacetimeDB server to connect to.
23
+ *
24
+ * @param uri The URI of the SpacetimeDB server to connect to.
25
+ *
26
+ **/
27
+ withUri(uri: string | URL): this;
28
+ /**
29
+ * Set the name or Identity of the database module to connect to.
30
+ *
31
+ * @param nameOrAddress
32
+ *
33
+ * @returns The `DbConnectionBuilder` instance.
34
+ */
35
+ withModuleName(nameOrAddress: string): this;
36
+ /**
37
+ * Set the identity of the client to connect to the database.
38
+ *
39
+ * @param token The credentials to use to authenticate with SpacetimeDB. This
40
+ * is optional. You can store the token returned by the `onConnect` callback
41
+ * to use in future connections.
42
+ *
43
+ * @returns The `DbConnectionBuilder` instance.
44
+ */
45
+ withToken(token?: string): this;
46
+ withWSFn(createWSFn: (args: {
47
+ url: URL;
48
+ wsProtocol: string;
49
+ authToken?: string;
50
+ }) => Promise<WebsocketDecompressAdapter>): this;
51
+ /**
52
+ * Set the compression algorithm to use for the connection.
53
+ *
54
+ * @param compression The compression algorithm to use for the connection.
55
+ */
56
+ withCompression(compression: 'gzip' | 'none'): this;
57
+ /**
58
+ * Sets the connection to operate in light mode.
59
+ *
60
+ * Light mode is a mode that reduces the amount of data sent over the network.
61
+ *
62
+ * @param lightMode The light mode for the connection.
63
+ */
64
+ withLightMode(lightMode: boolean): this;
65
+ /**
66
+ * Register a callback to be invoked upon authentication with the database.
67
+ *
68
+ * @param identity A unique identifier for a client connected to a database.
69
+ * @param token The credentials to use to authenticate with SpacetimeDB.
70
+ *
71
+ * @returns The `DbConnectionBuilder` instance.
72
+ *
73
+ * The callback will be invoked with the `Identity` and private authentication `token` provided by the database to identify this connection.
74
+ *
75
+ * If credentials were supplied to connect, those passed to the callback will be equivalent to the ones used to connect.
76
+ *
77
+ * If the initial connection was anonymous, a new set of credentials will be generated by the database to identify this user.
78
+ *
79
+ * The credentials passed to the callback can be saved and used to authenticate the same user in future connections.
80
+ *
81
+ * @example
82
+ *
83
+ * ```ts
84
+ * DbConnection.builder().onConnect((ctx, identity, token) => {
85
+ * console.log("Connected to SpacetimeDB with identity:", identity.toHexString());
86
+ * });
87
+ * ```
88
+ */
89
+ onConnect(callback: (connection: DbConnection, identity: Identity, token: string) => void): this;
90
+ /**
91
+ * Register a callback to be invoked upon an error.
92
+ *
93
+ * @example
94
+ *
95
+ * ```ts
96
+ * DbConnection.builder().onConnectError((ctx, error) => {
97
+ * console.log("Error connecting to SpacetimeDB:", error);
98
+ * });
99
+ * ```
100
+ */
101
+ onConnectError(callback: (ctx: ErrorContext, error: Error) => void): this;
102
+ /**
103
+ * Registers a callback to run when a {@link DbConnection} whose connection initially succeeded
104
+ * is disconnected, either after a {@link DbConnection.disconnect} call or due to an error.
105
+ *
106
+ * If the connection ended because of an error, the error is passed to the callback.
107
+ *
108
+ * The `callback` will be installed on the `DbConnection` created by `build`
109
+ * before initiating the connection, ensuring there's no opportunity for the disconnect to happen
110
+ * before the callback is installed.
111
+ *
112
+ * Note that this does not trigger if `build` fails
113
+ * or in cases where {@link DbConnectionBuilder.onConnectError} would trigger.
114
+ * This callback only triggers if the connection closes after `build` returns successfully
115
+ * and {@link DbConnectionBuilder.onConnect} is invoked, i.e., after the `IdentityToken` is received.
116
+ *
117
+ * To simplify SDK implementation, at most one such callback can be registered.
118
+ * Calling `onDisconnect` on the same `DbConnectionBuilder` multiple times throws an error.
119
+ *
120
+ * Unlike callbacks registered via {@link DbConnection},
121
+ * no mechanism is provided to unregister the provided callback.
122
+ * This is a concession to ergonomics; there's no clean place to return a `CallbackId` from this method
123
+ * or from `build`.
124
+ *
125
+ * @param {function(error?: Error): void} callback - The callback to invoke upon disconnection.
126
+ * @throws {Error} Throws an error if called multiple times on the same `DbConnectionBuilder`.
127
+ */
128
+ onDisconnect(callback: (ctx: ErrorContext, error?: Error | undefined) => void): this;
129
+ /**
130
+ * Builds a new `DbConnection` with the parameters set on this `DbConnectionBuilder` and attempts to connect to the SpacetimeDB server.
131
+ *
132
+ * @returns A new `DbConnection` with the parameters set on this `DbConnectionBuilder`.
133
+ *
134
+ * @example
135
+ *
136
+ * ```ts
137
+ * const host = "http://localhost:3000";
138
+ * const name_or_address = "database_name"
139
+ * const auth_token = undefined;
140
+ * DbConnection.builder().withUri(host).withModuleName(name_or_address).withToken(auth_token).build();
141
+ * ```
142
+ */
143
+ build(): DbConnection;
144
+ }
145
+ //# sourceMappingURL=db_connection_builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db_connection_builder.d.ts","sourceRoot":"","sources":["../../src/sdk/db_connection_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAwB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAE5E;;GAEG;AACH,qBAAa,mBAAmB,CAC9B,YAAY,EACZ,YAAY,EACZ,yBAAyB;;IAoBvB,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,uBAAuB;IAVjC;;;;;;;OAOG;gBAEO,YAAY,EAAE,YAAY,EAC1B,uBAAuB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,YAAY;IAK1E;;;;;QAKI;IACJ,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,IAAI;IAKhC;;;;;;OAMG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAK3C;;;;;;;;OAQG;IACH,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAK/B,QAAQ,CACN,UAAU,EAAE,CAAC,IAAI,EAAE;QACjB,GAAG,EAAE,GAAG,CAAC;QACT,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,KAAK,OAAO,CAAC,0BAA0B,CAAC,GACxC,IAAI;IAKP;;;;OAIG;IACH,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAKnD;;;;;;OAMG;IACH,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IAKvC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,SAAS,CACP,QAAQ,EAAE,CACR,UAAU,EAAE,YAAY,EACxB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,KACV,IAAI,GACR,IAAI;IAKP;;;;;;;;;;OAUG;IACH,cAAc,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,GAAG,IAAI;IAKzE;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,YAAY,CACV,QAAQ,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,SAAS,KAAK,IAAI,GAC/D,IAAI;IAKP;;;;;;;;;;;;;OAaG;IACH,KAAK,IAAI,YAAY;CA4BtB"}
@@ -0,0 +1,102 @@
1
+ import { ConnectionId } from '../';
2
+ import { BinaryReader } from '../';
3
+ import { BinaryWriter } from '../';
4
+ import { DbConnectionBuilder } from './db_connection_builder.ts';
5
+ import { type DbContext } from './db_context.ts';
6
+ import type { Event } from './event.ts';
7
+ import { type ErrorContextInterface, type EventContextInterface, type ReducerEventContextInterface, type SubscriptionEventContextInterface } from './event_context.ts';
8
+ import { EventEmitter } from './event_emitter.ts';
9
+ import type { Identity } from '../';
10
+ import type { ReducerEvent } from './reducer_event.ts';
11
+ import type RemoteModule from './spacetime_module.ts';
12
+ import { TableCache } from './table_cache.ts';
13
+ import { WebsocketDecompressAdapter } from './websocket_decompress_adapter.ts';
14
+ import { SubscriptionBuilderImpl, SubscriptionHandleImpl, type SubscribeEvent } from './subscription_builder_impl.ts';
15
+ export { BinaryReader, BinaryWriter, DbConnectionBuilder, SubscriptionBuilderImpl, TableCache, type Event, };
16
+ export type { DbContext, EventContextInterface, ReducerEventContextInterface, SubscriptionEventContextInterface, ErrorContextInterface, ReducerEvent, };
17
+ export type ConnectionEvent = 'connect' | 'disconnect' | 'connectError';
18
+ export type CallReducerFlags = 'FullUpdate' | 'NoSuccessNotify';
19
+ type ReducerEventCallback<ReducerArgs extends any[] = any[]> = (ctx: ReducerEventContextInterface, ...args: ReducerArgs) => void;
20
+ type SubscriptionEventCallback = (ctx: SubscriptionEventContextInterface) => void;
21
+ type DbConnectionConfig = {
22
+ uri: URL;
23
+ nameOrAddress: string;
24
+ identity?: Identity;
25
+ token?: string;
26
+ emitter: EventEmitter<ConnectionEvent>;
27
+ remoteModule: RemoteModule;
28
+ createWSFn: typeof WebsocketDecompressAdapter.createWebSocketFn;
29
+ compression: 'gzip' | 'none';
30
+ lightMode: boolean;
31
+ };
32
+ export declare class DbConnectionImpl<DBView = any, Reducers = any, SetReducerFlags = any> implements DbContext<DBView, Reducers> {
33
+ #private;
34
+ /**
35
+ * Whether or not the connection is active.
36
+ */
37
+ isActive: boolean;
38
+ /**
39
+ * This connection's public identity.
40
+ */
41
+ identity?: Identity;
42
+ /**
43
+ * This connection's private authentication token.
44
+ */
45
+ token?: string;
46
+ /**
47
+ * The accessor field to access the tables in the database and associated
48
+ * callback functions.
49
+ */
50
+ db: DBView;
51
+ /**
52
+ * The accessor field to access the reducers in the database and associated
53
+ * callback functions.
54
+ */
55
+ reducers: Reducers;
56
+ /**
57
+ * The accessor field to access functions related to setting flags on
58
+ * reducers regarding how the server should handle the reducer call and
59
+ * the events that it sends back to the client.
60
+ */
61
+ setReducerFlags: SetReducerFlags;
62
+ /**
63
+ * The `ConnectionId` of the connection to to the database.
64
+ */
65
+ connectionId: ConnectionId;
66
+ private clientCache;
67
+ private ws?;
68
+ private wsPromise;
69
+ constructor({ uri, nameOrAddress, identity, token, emitter, remoteModule, createWSFn, compression, lightMode, }: DbConnectionConfig);
70
+ subscriptionBuilder: () => SubscriptionBuilderImpl;
71
+ registerSubscription(handle: SubscriptionHandleImpl<DBView, Reducers, SetReducerFlags>, handleEmitter: EventEmitter<SubscribeEvent, SubscriptionEventCallback>, querySql: string[]): number;
72
+ unregisterSubscription(queryId: number): void;
73
+ /**
74
+ * Call a reducer on your SpacetimeDB module.
75
+ *
76
+ * @param reducerName The name of the reducer to call
77
+ * @param argsSerializer The arguments to pass to the reducer
78
+ */
79
+ callReducer(reducerName: string, argsBuffer: Uint8Array, flags: CallReducerFlags): void;
80
+ /**
81
+ * Close the current connection.
82
+ *
83
+ * @example
84
+ *
85
+ * ```ts
86
+ * const connection = DbConnection.builder().build();
87
+ * connection.disconnect()
88
+ * ```
89
+ */
90
+ disconnect(): void;
91
+ private on;
92
+ private off;
93
+ private onConnect;
94
+ private onDisconnect;
95
+ private onConnectError;
96
+ private removeOnConnect;
97
+ private removeOnDisconnect;
98
+ private removeOnConnectError;
99
+ onReducer(reducerName: string, callback: ReducerEventCallback): void;
100
+ offReducer(reducerName: string, callback: ReducerEventCallback): void;
101
+ }
102
+ //# sourceMappingURL=db_connection_impl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db_connection_impl.d.ts","sourceRoot":"","sources":["../../src/sdk/db_connection_impl.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,25 @@
1
+ import type { SubscriptionBuilderImpl } from './subscription_builder_impl';
2
+ /**
3
+ * Interface representing a database context.
4
+ *
5
+ * @template DBView - Type representing the database view.
6
+ * @template Reducers - Type representing the reducers.
7
+ * @template SetReducerFlags - Type representing the reducer flags collection.
8
+ */
9
+ export interface DbContext<DBView = any, Reducers = any, SetReducerFlags = any> {
10
+ db: DBView;
11
+ reducers: Reducers;
12
+ setReducerFlags: SetReducerFlags;
13
+ isActive: boolean;
14
+ /**
15
+ * Creates a new subscription builder.
16
+ *
17
+ * @returns The subscription builder.
18
+ */
19
+ subscriptionBuilder(): SubscriptionBuilderImpl<DBView, Reducers, SetReducerFlags>;
20
+ /**
21
+ * Disconnects from the database.
22
+ */
23
+ disconnect(): void;
24
+ }
25
+ //# sourceMappingURL=db_context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"db_context.d.ts","sourceRoot":"","sources":["../../src/sdk/db_context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E;;;;;;GAMG;AACH,MAAM,WAAW,SAAS,CACxB,MAAM,GAAG,GAAG,EACZ,QAAQ,GAAG,GAAG,EACd,eAAe,GAAG,GAAG;IAErB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,QAAQ,CAAC;IACnB,eAAe,EAAE,eAAe,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC;IAElB;;;;OAIG;IACH,mBAAmB,IAAI,uBAAuB,CAC5C,MAAM,EACN,QAAQ,EACR,eAAe,CAChB,CAAC;IAEF;;OAEG;IACH,UAAU,IAAI,IAAI,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export declare function decompress(buffer: Uint8Array, type: 'gzip', chunkSize?: number): Promise<Uint8Array>;
2
+ //# sourceMappingURL=decompress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decompress.d.ts","sourceRoot":"","sources":["../../src/sdk/decompress.ts"],"names":[],"mappings":"AAAA,wBAAsB,UAAU,CAC9B,MAAM,EAAE,UAAU,EAElB,IAAI,EAAE,MAAM,EACZ,SAAS,GAAE,MAAmB,GAC7B,OAAO,CAAC,UAAU,CAAC,CA8CrB"}
@@ -0,0 +1,15 @@
1
+ import type { ReducerEvent, ReducerInfoType } from './reducer_event';
2
+ export type Event<Reducer extends ReducerInfoType> = {
3
+ tag: 'Reducer';
4
+ value: ReducerEvent<Reducer>;
5
+ } | {
6
+ tag: 'SubscribeApplied';
7
+ } | {
8
+ tag: 'UnsubscribeApplied';
9
+ } | {
10
+ tag: 'Error';
11
+ value: Error;
12
+ } | {
13
+ tag: 'UnknownTransaction';
14
+ };
15
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/sdk/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAErE,MAAM,MAAM,KAAK,CAAC,OAAO,SAAS,eAAe,IAC7C;IAAE,GAAG,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAA;CAAE,GAChD;IAAE,GAAG,EAAE,kBAAkB,CAAA;CAAE,GAC3B;IAAE,GAAG,EAAE,oBAAoB,CAAA;CAAE,GAC7B;IAAE,GAAG,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,GAC9B;IAAE,GAAG,EAAE,oBAAoB,CAAA;CAAE,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { DbContext } from './db_context';
2
+ import type { Event } from './event.ts';
3
+ import type { ReducerEvent, ReducerInfoType } from './reducer_event.ts';
4
+ export interface EventContextInterface<DBView = any, Reducers = any, SetReducerFlags = any, Reducer extends ReducerInfoType = never> extends DbContext<DBView, Reducers, SetReducerFlags> {
5
+ /** Enum with variants for all possible events. */
6
+ event: Event<Reducer>;
7
+ }
8
+ export interface ReducerEventContextInterface<DBView = any, Reducers = any, SetReducerFlags = any, Reducer extends ReducerInfoType = never> extends DbContext<DBView, Reducers, SetReducerFlags> {
9
+ /** Enum with variants for all possible events. */
10
+ event: ReducerEvent<Reducer>;
11
+ }
12
+ export interface SubscriptionEventContextInterface<DBView = any, Reducers = any, SetReducerFlags = any> extends DbContext<DBView, Reducers, SetReducerFlags> {
13
+ }
14
+ export interface ErrorContextInterface<DBView = any, Reducers = any, SetReducerFlags = any> extends DbContext<DBView, Reducers, SetReducerFlags> {
15
+ /** Enum with variants for all possible events. */
16
+ event?: Error;
17
+ }
18
+ //# sourceMappingURL=event_context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event_context.d.ts","sourceRoot":"","sources":["../../src/sdk/event_context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAExE,MAAM,WAAW,qBAAqB,CACpC,MAAM,GAAG,GAAG,EACZ,QAAQ,GAAG,GAAG,EACd,eAAe,GAAG,GAAG,EACrB,OAAO,SAAS,eAAe,GAAG,KAAK,CACvC,SAAQ,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC;IACpD,kDAAkD;IAClD,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,4BAA4B,CAC3C,MAAM,GAAG,GAAG,EACZ,QAAQ,GAAG,GAAG,EACd,eAAe,GAAG,GAAG,EACrB,OAAO,SAAS,eAAe,GAAG,KAAK,CACvC,SAAQ,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC;IACpD,kDAAkD;IAClD,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;CAC9B;AAGD,MAAM,WAAW,iCAAiC,CAChD,MAAM,GAAG,GAAG,EACZ,QAAQ,GAAG,GAAG,EACd,eAAe,GAAG,GAAG,CACrB,SAAQ,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC;CAErD;AAED,MAAM,WAAW,qBAAqB,CACpC,MAAM,GAAG,GAAG,EACZ,QAAQ,GAAG,GAAG,EACd,eAAe,GAAG,GAAG,CACrB,SAAQ,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,eAAe,CAAC;IACpD,kDAAkD;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
@@ -0,0 +1,7 @@
1
+ export declare class EventEmitter<Key, Callback extends Function = Function> {
2
+ #private;
3
+ on(event: Key, callback: Callback): void;
4
+ off(event: Key, callback: Callback): void;
5
+ emit(event: Key, ...args: any[]): void;
6
+ }
7
+ //# sourceMappingURL=event_emitter.d.ts.map