stream-chat 10.0.0-rc.8 → 10.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 (366) hide show
  1. package/README.md +7 -6
  2. package/dist/cjs/index.browser.js +22095 -22290
  3. package/dist/cjs/index.browser.js.map +4 -4
  4. package/dist/cjs/index.node.js +22143 -22298
  5. package/dist/cjs/index.node.js.map +4 -4
  6. package/dist/esm/index.mjs +22093 -22288
  7. package/dist/esm/index.mjs.map +4 -4
  8. package/dist/types/ChannelManager.d.ts +216 -135
  9. package/dist/types/CooldownTimer.d.ts +16 -27
  10. package/dist/types/EventHandlerPipeline.d.ts +18 -38
  11. package/dist/types/LiveLocationManager.d.ts +25 -47
  12. package/dist/types/api-client.d.ts +17 -5
  13. package/dist/types/channel.d.ts +435 -500
  14. package/dist/types/channel_state.d.ts +72 -112
  15. package/dist/types/client.d.ts +323 -440
  16. package/dist/types/client_state.d.ts +1 -3
  17. package/dist/types/configuration/ConfigController.d.ts +31 -125
  18. package/dist/types/configuration/InstanceConfigurationRegistry.d.ts +32 -124
  19. package/dist/types/configuration/keys.d.ts +5 -19
  20. package/dist/types/configuration/shape.d.ts +12 -29
  21. package/dist/types/configuration/types.d.ts +64 -79
  22. package/dist/types/configuration/utils/applyInstanceConfiguration.d.ts +14 -36
  23. package/dist/types/configuration/utils/copyConfigPatch.d.ts +8 -0
  24. package/dist/types/configuration/utils/declarativeSlices.d.ts +5 -16
  25. package/dist/types/configuration/utils/deepFreezeConfig.d.ts +3 -17
  26. package/dist/types/configuration/utils/serverAuthority.d.ts +9 -29
  27. package/dist/types/connection/ConnectionIdManager.d.ts +45 -0
  28. package/dist/types/connection/ConnectionRecoveryManager.d.ts +84 -0
  29. package/dist/types/connection/index.d.ts +4 -0
  30. package/dist/types/connection/networkConnection/NetworkConnectionObserver.d.ts +82 -0
  31. package/dist/types/connection/networkConnection/index.d.ts +3 -0
  32. package/dist/types/connection/networkConnection/reporters.d.ts +20 -0
  33. package/dist/types/connection/networkConnection/types.d.ts +40 -0
  34. package/dist/types/connection/wsConnection/StableWSConnection.d.ts +137 -0
  35. package/dist/types/connection/wsConnection/WSConnection.d.ts +105 -0
  36. package/dist/types/connection/wsConnection/WSConnectionFallback.d.ts +47 -0
  37. package/dist/types/connection/wsConnection/config.d.ts +31 -0
  38. package/dist/types/connection/wsConnection/index.d.ts +4 -0
  39. package/dist/types/connection/wsConnection/types.d.ts +46 -0
  40. package/dist/types/constants.d.ts +3 -1
  41. package/dist/types/custom_types.d.ts +0 -2
  42. package/dist/types/entityStore/EntityStore.d.ts +226 -65
  43. package/dist/types/entityStore/StoreBackedItemIndex.d.ts +19 -33
  44. package/dist/types/entityStore/index.d.ts +0 -1
  45. package/dist/types/errors.d.ts +16 -19
  46. package/dist/types/formatMessageMemo.d.ts +5 -0
  47. package/dist/types/gen/chat/ChannelApi.d.ts +5 -1
  48. package/dist/types/gen/chat/ChatApi.d.ts +149 -105
  49. package/dist/types/gen/models/index.d.ts +2540 -698
  50. package/dist/types/gen/models/timestamp-guard.d.ts +22 -0
  51. package/dist/types/gen/moderation/ModerationApi.d.ts +37 -14
  52. package/dist/types/index.d.ts +10 -5
  53. package/dist/types/{i18n/languageNames.d.ts → languageNames.d.ts} +9 -24
  54. package/dist/types/logger.d.ts +1 -3
  55. package/dist/types/messageComposer/CustomDataManager.d.ts +7 -1
  56. package/dist/types/messageComposer/LocationComposer.d.ts +8 -2
  57. package/dist/types/messageComposer/attachmentIdentity.d.ts +24 -0
  58. package/dist/types/messageComposer/attachmentManager.d.ts +52 -24
  59. package/dist/types/messageComposer/attachmentUtils.d.ts +23 -0
  60. package/dist/types/messageComposer/configuration/configuration.d.ts +2 -5
  61. package/dist/types/messageComposer/configuration/types.d.ts +38 -50
  62. package/dist/types/messageComposer/index.d.ts +1 -0
  63. package/dist/types/messageComposer/linkPreviewsManager.d.ts +12 -9
  64. package/dist/types/messageComposer/messageComposer.d.ts +60 -123
  65. package/dist/types/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.d.ts +10 -1
  66. package/dist/types/messageComposer/middleware/messageComposer/attachments.d.ts +4 -0
  67. package/dist/types/messageComposer/middleware/messageComposer/commandInjection.d.ts +5 -0
  68. package/dist/types/messageComposer/middleware/messageComposer/index.d.ts +2 -0
  69. package/dist/types/messageComposer/middleware/messageComposer/pollOnly.d.ts +6 -0
  70. package/dist/types/messageComposer/middleware/messageComposer/userDataInjection.d.ts +5 -0
  71. package/dist/types/messageComposer/middleware/pollComposer/types.d.ts +2 -4
  72. package/dist/types/messageComposer/middleware/pollComposer/validation.d.ts +7 -19
  73. package/dist/types/messageComposer/middleware/textComposer/commandUtils.d.ts +4 -0
  74. package/dist/types/messageComposer/middleware/textComposer/commands.d.ts +11 -2
  75. package/dist/types/messageComposer/middleware/textComposer/mentions.d.ts +20 -19
  76. package/dist/types/messageComposer/middleware/textComposer/textMiddlewareUtils.d.ts +9 -3
  77. package/dist/types/messageComposer/middleware/textComposer/types.d.ts +1 -6
  78. package/dist/types/messageComposer/pollComposer.d.ts +15 -5
  79. package/dist/types/messageComposer/textComposer.d.ts +14 -7
  80. package/dist/types/messageComposer/types.d.ts +27 -7
  81. package/dist/types/messageDelivery/MessageDeliveryReporter.d.ts +27 -80
  82. package/dist/types/messageDelivery/MessageReceiptsTracker.d.ts +43 -73
  83. package/dist/types/messageOperations/FailedSendCache.d.ts +29 -0
  84. package/dist/types/messageOperations/MessageOperationStatePolicy.d.ts +16 -22
  85. package/dist/types/messageOperations/MessageOperations.d.ts +63 -34
  86. package/dist/types/messageOperations/applyReactionLocally.d.ts +15 -0
  87. package/dist/types/messageOperations/createMessageOperations.d.ts +9 -0
  88. package/dist/types/messageOperations/index.d.ts +6 -4
  89. package/dist/types/messageOperations/reflectReactionEvent.d.ts +16 -0
  90. package/dist/types/messageOperations/sendOrdering.d.ts +14 -0
  91. package/dist/types/messageOperations/settlePendingAttachmentUploads.d.ts +20 -0
  92. package/dist/types/messageOperations/types.d.ts +43 -14
  93. package/dist/types/middleware.d.ts +10 -0
  94. package/dist/types/moderation.d.ts +21 -14
  95. package/dist/types/notifications/NotificationManager.d.ts +10 -23
  96. package/dist/types/notifications/types.d.ts +21 -57
  97. package/dist/types/offline-support/offline_support_api.d.ts +150 -528
  98. package/dist/types/offline-support/offline_sync_manager.d.ts +21 -42
  99. package/dist/types/offline-support/queueableOperations.d.ts +35 -37
  100. package/dist/types/offline-support/types.d.ts +40 -185
  101. package/dist/types/pagination/FilterBuilder.d.ts +1 -18
  102. package/dist/types/pagination/ItemIndex.d.ts +4 -12
  103. package/dist/types/pagination/cursorDerivation/aroundPaginationFlags.d.ts +13 -0
  104. package/dist/types/pagination/cursorDerivation/createdAtAroundPaginationFlags.d.ts +4 -5
  105. package/dist/types/pagination/cursorDerivation/linearPaginationFlags.d.ts +19 -5
  106. package/dist/types/pagination/index.d.ts +1 -0
  107. package/dist/types/pagination/paginators/BasePaginator.d.ts +604 -550
  108. package/dist/types/pagination/paginators/ChannelPaginator.d.ts +123 -106
  109. package/dist/types/pagination/paginators/MessageIntervalPaginator.d.ts +576 -327
  110. package/dist/types/pagination/paginators/MessagePaginator.d.ts +237 -131
  111. package/dist/types/pagination/paginators/PinnedMessagePaginator.d.ts +15 -26
  112. package/dist/types/pagination/paginators/ReminderPaginator.d.ts +4 -3
  113. package/dist/types/pagination/paginators/ThreadPaginator.d.ts +44 -0
  114. package/dist/types/pagination/paginators/UserGroupPaginator.d.ts +5 -8
  115. package/dist/types/pagination/paginators/index.d.ts +1 -0
  116. package/dist/types/pagination/sortCompiler.d.ts +11 -22
  117. package/dist/types/pagination/utility.normalization.d.ts +8 -13
  118. package/dist/types/pagination/utility.search.d.ts +3 -8
  119. package/dist/types/poll.d.ts +35 -8
  120. package/dist/types/poll_manager.d.ts +12 -2
  121. package/dist/types/poll_optimistic_votes.d.ts +57 -0
  122. package/dist/types/reminders/Reminder.d.ts +17 -7
  123. package/dist/types/reminders/ReminderManager.d.ts +13 -25
  124. package/dist/types/search/BaseSearchSource.d.ts +10 -8
  125. package/dist/types/search/ChannelSearchSource.d.ts +16 -0
  126. package/dist/types/search/MessageSearchSource.d.ts +17 -0
  127. package/dist/types/search/SearchController.d.ts +26 -28
  128. package/dist/types/search/types.d.ts +6 -10
  129. package/dist/types/signing.d.ts +12 -3
  130. package/dist/types/thread.d.ts +67 -129
  131. package/dist/types/thread_manager.d.ts +95 -66
  132. package/dist/types/token_manager.d.ts +8 -13
  133. package/dist/types/types.d.ts +81 -197
  134. package/dist/types/types.utility.d.ts +3 -3
  135. package/dist/types/upload-utils.d.ts +5 -10
  136. package/dist/types/uploadManager.d.ts +31 -11
  137. package/dist/types/utils/FixedSizeQueueCache.d.ts +8 -11
  138. package/dist/types/utils/WithSubscriptions.d.ts +6 -16
  139. package/dist/types/utils/abort.d.ts +17 -0
  140. package/dist/types/utils/concurrency.d.ts +12 -20
  141. package/dist/types/utils/mergeWith/mergeWith.d.ts +8 -11
  142. package/dist/types/utils/mergeWith/mergeWithCore.d.ts +5 -13
  143. package/dist/types/utils/mergeWith/mergeWithDiff.d.ts +22 -0
  144. package/dist/types/utils/objectPath.d.ts +6 -41
  145. package/dist/types/utils/retryable.d.ts +8 -12
  146. package/dist/types/utils/throttling/throttle.d.ts +8 -23
  147. package/dist/types/utils/time.d.ts +45 -0
  148. package/dist/types/utils.d.ts +74 -93
  149. package/package.json +14 -40
  150. package/src/ChannelManager.ts +494 -303
  151. package/src/CooldownTimer.ts +46 -59
  152. package/src/EventHandlerPipeline.ts +22 -45
  153. package/src/LiveLocationManager.ts +99 -91
  154. package/src/api-client.ts +113 -50
  155. package/src/campaign.ts +1 -1
  156. package/src/channel.ts +1098 -1351
  157. package/src/channel_batch_updater.ts +1 -1
  158. package/src/channel_state.ts +81 -174
  159. package/src/client.ts +755 -970
  160. package/src/client_state.ts +3 -8
  161. package/src/configuration/ConfigController.ts +42 -158
  162. package/src/configuration/InstanceConfigurationRegistry.ts +43 -172
  163. package/src/configuration/index.ts +1 -1
  164. package/src/configuration/keys.ts +13 -32
  165. package/src/configuration/shape.ts +169 -59
  166. package/src/configuration/types.ts +69 -92
  167. package/src/configuration/utils/applyInstanceConfiguration.ts +22 -54
  168. package/src/configuration/utils/copyConfigPatch.ts +11 -32
  169. package/src/configuration/utils/declarativeSlices.ts +9 -39
  170. package/src/configuration/utils/deepFreezeConfig.ts +3 -17
  171. package/src/configuration/utils/index.ts +2 -4
  172. package/src/configuration/utils/serverAuthority.ts +20 -68
  173. package/src/connection/ConnectionIdManager.ts +111 -0
  174. package/src/connection/ConnectionRecoveryManager.ts +257 -0
  175. package/src/connection/index.ts +4 -0
  176. package/src/connection/networkConnection/NetworkConnectionObserver.ts +204 -0
  177. package/src/connection/networkConnection/index.ts +3 -0
  178. package/src/connection/networkConnection/reporters.ts +58 -0
  179. package/src/connection/networkConnection/types.ts +45 -0
  180. package/src/{connection.ts → connection/wsConnection/StableWSConnection.ts} +230 -231
  181. package/src/connection/wsConnection/WSConnection.ts +270 -0
  182. package/src/connection/wsConnection/WSConnectionFallback.ts +250 -0
  183. package/src/connection/wsConnection/config.ts +73 -0
  184. package/src/connection/wsConnection/index.ts +4 -0
  185. package/src/connection/wsConnection/types.ts +48 -0
  186. package/src/constants.ts +7 -5
  187. package/src/custom_types.ts +0 -1
  188. package/src/entityStore/EntityStore.ts +415 -79
  189. package/src/entityStore/StoreBackedItemIndex.ts +37 -41
  190. package/src/entityStore/index.ts +0 -1
  191. package/src/errors.ts +39 -20
  192. package/src/formatMessageMemo.ts +17 -0
  193. package/src/gen/chat/ChannelApi.ts +122 -36
  194. package/src/gen/chat/ChatApi.ts +578 -1752
  195. package/src/gen/models/index.ts +2566 -3440
  196. package/src/gen/models/timestamp-guard.ts +27 -0
  197. package/src/gen/moderation/ModerationApi.ts +183 -406
  198. package/src/index.ts +32 -10
  199. package/src/languageNames.ts +88 -0
  200. package/src/logger.ts +1 -3
  201. package/src/messageComposer/CustomDataManager.ts +19 -6
  202. package/src/messageComposer/LocationComposer.ts +49 -9
  203. package/src/messageComposer/MessageComposerEffectHandlers.ts +1 -2
  204. package/src/messageComposer/attachmentIdentity.ts +54 -0
  205. package/src/messageComposer/attachmentManager.ts +170 -185
  206. package/src/messageComposer/attachmentUtils.ts +44 -0
  207. package/src/messageComposer/configuration/configuration.ts +15 -8
  208. package/src/messageComposer/configuration/types.ts +38 -50
  209. package/src/messageComposer/fileUtils.ts +1 -1
  210. package/src/messageComposer/index.ts +1 -0
  211. package/src/messageComposer/linkPreviewsManager.ts +18 -21
  212. package/src/messageComposer/messageComposer.ts +234 -179
  213. package/src/messageComposer/middleware/attachmentManager/postUpload/AttachmentPostUploadMiddlewareExecutor.ts +1 -1
  214. package/src/messageComposer/middleware/attachmentManager/postUpload/attachmentEnrichment.ts +46 -33
  215. package/src/messageComposer/middleware/attachmentManager/postUpload/uploadErrorHandler.ts +4 -1
  216. package/src/messageComposer/middleware/attachmentManager/preUpload/blockedUploadNotification.ts +1 -1
  217. package/src/messageComposer/middleware/messageComposer/MessageComposerMiddlewareExecutor.ts +6 -0
  218. package/src/messageComposer/middleware/messageComposer/attachments.ts +76 -5
  219. package/src/messageComposer/middleware/messageComposer/commandInjection.ts +10 -4
  220. package/src/messageComposer/middleware/messageComposer/customData.ts +17 -5
  221. package/src/messageComposer/middleware/messageComposer/index.ts +2 -0
  222. package/src/messageComposer/middleware/messageComposer/linkPreviews.ts +22 -12
  223. package/src/messageComposer/middleware/messageComposer/pollOnly.ts +9 -1
  224. package/src/messageComposer/middleware/messageComposer/sharedLocation.ts +7 -2
  225. package/src/messageComposer/middleware/messageComposer/textComposer.ts +1 -1
  226. package/src/messageComposer/middleware/messageComposer/userDataInjection.ts +12 -12
  227. package/src/messageComposer/middleware/pollComposer/state.ts +2 -2
  228. package/src/messageComposer/middleware/pollComposer/types.ts +2 -4
  229. package/src/messageComposer/middleware/pollComposer/validation.ts +8 -26
  230. package/src/messageComposer/middleware/textComposer/TextComposerMiddlewareExecutor.ts +8 -6
  231. package/src/messageComposer/middleware/textComposer/commandUtils.ts +10 -3
  232. package/src/messageComposer/middleware/textComposer/commands.ts +11 -16
  233. package/src/messageComposer/middleware/textComposer/mentions.ts +32 -70
  234. package/src/messageComposer/middleware/textComposer/textMiddlewareUtils.ts +10 -4
  235. package/src/messageComposer/middleware/textComposer/types.ts +1 -6
  236. package/src/messageComposer/pollComposer.ts +21 -9
  237. package/src/messageComposer/textComposer.ts +37 -57
  238. package/src/messageComposer/types.ts +39 -11
  239. package/src/messageDelivery/MessageDeliveryReporter.ts +86 -124
  240. package/src/messageDelivery/MessageReceiptsTracker.ts +122 -139
  241. package/src/messageOperations/FailedSendCache.ts +85 -0
  242. package/src/messageOperations/MessageOperationStatePolicy.ts +124 -116
  243. package/src/messageOperations/MessageOperations.ts +297 -175
  244. package/src/{entityStore → messageOperations}/applyReactionLocally.ts +13 -25
  245. package/src/messageOperations/createMessageOperations.ts +176 -0
  246. package/src/messageOperations/index.ts +6 -14
  247. package/src/messageOperations/reflectReactionEvent.ts +43 -0
  248. package/src/messageOperations/sendOrdering.ts +25 -0
  249. package/src/messageOperations/settlePendingAttachmentUploads.ts +98 -0
  250. package/src/messageOperations/types.ts +51 -13
  251. package/src/middleware.ts +13 -5
  252. package/src/moderation.ts +25 -21
  253. package/src/notifications/NotificationManager.ts +19 -28
  254. package/src/notifications/types.ts +21 -57
  255. package/src/offline-support/offline_support_api.ts +231 -681
  256. package/src/offline-support/offline_sync_manager.ts +51 -90
  257. package/src/offline-support/queueableOperations.ts +98 -73
  258. package/src/offline-support/types.ts +43 -185
  259. package/src/pagination/FilterBuilder.ts +1 -22
  260. package/src/pagination/ItemIndex.ts +4 -12
  261. package/src/pagination/cursorDerivation/aroundPaginationFlags.ts +29 -0
  262. package/src/pagination/cursorDerivation/createdAtAroundPaginationFlags.ts +17 -62
  263. package/src/pagination/cursorDerivation/idAroundPaginationFlags.ts +11 -39
  264. package/src/pagination/cursorDerivation/linearPaginationFlags.ts +53 -33
  265. package/src/pagination/filterCompiler.ts +11 -25
  266. package/src/pagination/index.ts +1 -0
  267. package/src/pagination/paginators/BasePaginator.ts +1415 -1041
  268. package/src/pagination/paginators/ChannelPaginator.ts +481 -219
  269. package/src/pagination/paginators/MessageIntervalPaginator.ts +1362 -775
  270. package/src/pagination/paginators/MessagePaginator.ts +521 -240
  271. package/src/pagination/paginators/PinnedMessagePaginator.ts +32 -40
  272. package/src/pagination/paginators/ReminderPaginator.ts +21 -16
  273. package/src/pagination/paginators/ThreadPaginator.ts +170 -0
  274. package/src/pagination/paginators/UserGroupPaginator.ts +18 -15
  275. package/src/pagination/paginators/index.ts +1 -0
  276. package/src/pagination/paginators/stateThrottling.ts +5 -10
  277. package/src/pagination/sortCompiler.ts +23 -50
  278. package/src/pagination/utility.normalization.ts +17 -24
  279. package/src/pagination/utility.search.ts +4 -11
  280. package/src/poll.ts +183 -102
  281. package/src/poll_manager.ts +24 -22
  282. package/src/poll_optimistic_votes.ts +335 -0
  283. package/src/reminders/Reminder.ts +33 -16
  284. package/src/reminders/ReminderManager.ts +23 -56
  285. package/src/reminders/ReminderTimer.ts +6 -6
  286. package/src/search/BaseSearchSource.ts +19 -25
  287. package/src/search/ChannelSearchSource.ts +43 -1
  288. package/src/search/MessageSearchSource.ts +77 -13
  289. package/src/search/SearchController.ts +39 -36
  290. package/src/search/types.ts +6 -10
  291. package/src/segment.ts +1 -1
  292. package/src/signing.ts +23 -3
  293. package/src/thread.ts +430 -712
  294. package/src/thread_manager.ts +300 -234
  295. package/src/token_manager.ts +12 -22
  296. package/src/types.ts +102 -214
  297. package/src/types.utility.ts +3 -3
  298. package/src/upload-utils.ts +5 -10
  299. package/src/uploadManager.ts +64 -18
  300. package/src/utils/FixedSizeQueueCache.ts +18 -21
  301. package/src/utils/WithSubscriptions.ts +6 -16
  302. package/src/utils/abort.ts +45 -0
  303. package/src/utils/concurrency.ts +16 -55
  304. package/src/utils/mergeWith/mergeWith.ts +10 -13
  305. package/src/utils/mergeWith/mergeWithCore.ts +24 -81
  306. package/src/utils/mergeWith/mergeWithDiff.ts +15 -33
  307. package/src/utils/objectPath.ts +6 -41
  308. package/src/utils/retryable.ts +10 -14
  309. package/src/utils/throttling/throttle.ts +9 -25
  310. package/src/utils/time.ts +64 -0
  311. package/src/utils.ts +227 -174
  312. package/codegen/i18n/callSites.ts +0 -126
  313. package/codegen/i18n/generate.ts +0 -226
  314. package/codegen/i18n/guards.ts +0 -178
  315. package/codegen/i18n/index.ts +0 -29
  316. package/codegen/i18n/stringMaps.ts +0 -91
  317. package/codegen/i18n/types.ts +0 -100
  318. package/dist/cjs/i18n.browser.js +0 -1131
  319. package/dist/cjs/i18n.browser.js.map +0 -7
  320. package/dist/cjs/i18n.node.js +0 -1160
  321. package/dist/cjs/i18n.node.js.map +0 -7
  322. package/dist/esm/i18n-codegen.mjs +0 -409
  323. package/dist/esm/i18n-codegen.mjs.map +0 -7
  324. package/dist/esm/i18n.mjs +0 -1098
  325. package/dist/esm/i18n.mjs.map +0 -7
  326. package/dist/types/ConnectionRecoveryManager.d.ts +0 -156
  327. package/dist/types/connection.d.ts +0 -139
  328. package/dist/types/entityStore/applyReactionLocally.d.ts +0 -26
  329. package/dist/types/gen/model-decoders/decoders.d.ts +0 -3
  330. package/dist/types/gen/model-decoders/event-decoder-mapping.d.ts +0 -6
  331. package/dist/types/i18n/Streami18n.d.ts +0 -168
  332. package/dist/types/i18n/TranslationBuilder.d.ts +0 -70
  333. package/dist/types/i18n/TranslationStore.d.ts +0 -57
  334. package/dist/types/i18n/dayjs.d.ts +0 -104
  335. package/dist/types/i18n/formatters.d.ts +0 -91
  336. package/dist/types/i18n/index.d.ts +0 -15
  337. package/dist/types/i18n/translator.d.ts +0 -29
  338. package/dist/types/i18n/types.d.ts +0 -262
  339. package/dist/types/i18n-codegen/callSites.d.ts +0 -10
  340. package/dist/types/i18n-codegen/generate.d.ts +0 -15
  341. package/dist/types/i18n-codegen/guards.d.ts +0 -61
  342. package/dist/types/i18n-codegen/index.d.ts +0 -29
  343. package/dist/types/i18n-codegen/stringMaps.d.ts +0 -14
  344. package/dist/types/i18n-codegen/types.d.ts +0 -94
  345. package/dist/types/insights.d.ts +0 -56
  346. package/dist/types/messageOperations/optimistic.d.ts +0 -118
  347. package/dist/types/messageOperations/persistence.d.ts +0 -21
  348. package/dist/types/pagination/utility.queryChannel.d.ts +0 -26
  349. package/dist/types/store.d.ts +0 -125
  350. package/src/ConnectionRecoveryManager.ts +0 -293
  351. package/src/gen/model-decoders/decoders.ts +0 -2710
  352. package/src/gen/model-decoders/event-decoder-mapping.ts +0 -198
  353. package/src/i18n/Streami18n.ts +0 -520
  354. package/src/i18n/TranslationBuilder.ts +0 -176
  355. package/src/i18n/TranslationStore.ts +0 -96
  356. package/src/i18n/dayjs.ts +0 -228
  357. package/src/i18n/formatters.ts +0 -461
  358. package/src/i18n/index.ts +0 -15
  359. package/src/i18n/languageNames.ts +0 -103
  360. package/src/i18n/translator.ts +0 -76
  361. package/src/i18n/types.ts +0 -375
  362. package/src/insights.ts +0 -82
  363. package/src/messageOperations/optimistic.ts +0 -249
  364. package/src/messageOperations/persistence.ts +0 -40
  365. package/src/pagination/utility.queryChannel.ts +0 -84
  366. package/src/store.ts +0 -304
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../codegen/i18n/callSites.ts", "../../codegen/i18n/generate.ts", "../../codegen/i18n/guards.ts", "../../codegen/i18n/stringMaps.ts"],
4
- "sourcesContent": ["import fs from 'node:fs';\nimport path from 'node:path';\nimport type * as ts from 'typescript';\n\nimport type { CallSiteCopy, TypeScriptModule } from './types';\n\nconst DEFAULT_IGNORE_DIRS = ['__tests__', 'mock-builders'];\n\n/**\n * Every `t()` call in the source is the catalog's source of truth.\n *\n * A prose key exists because a component asks for it and passes its English copy inline; delete the\n * call and the key is gone. That is what removes the need for a checked-in `en.json` and for an\n * extract / remove-unused-keys pass, and it makes a dead prose key structurally impossible.\n *\n * The only keys that cannot be described this way are the ones with no inline copy \u2014 a formatter\n * expression, or a key built from a runtime value. Those come from `runtimeDefaults`, and the generator\n * cross-checks the two.\n */\nconst isTCallee = (tsModule: TypeScriptModule, expr: ts.Expression): boolean =>\n (tsModule.isIdentifier(expr) && expr.text === 't') ||\n (tsModule.isPropertyAccessExpression(expr) && expr.name.text === 't');\n\nexport const sourceFiles = ({\n ignoreDirs = DEFAULT_IGNORE_DIRS,\n srcRoot = 'src',\n}: {\n ignoreDirs?: string[];\n srcRoot?: string;\n} = {}): string[] => {\n const out: string[] = [];\n const walk = (dir: string) => {\n for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n if (ignoreDirs.includes(entry.name)) continue;\n walk(full);\n } else if (/\\.tsx?$/.test(entry.name) && !entry.name.endsWith('.d.ts')) {\n out.push(full);\n }\n }\n };\n walk(srcRoot);\n return out;\n};\n\nexport const readCallSiteCopy = ({\n ignoreDirs,\n srcRoot,\n ts: tsModule,\n}: {\n ts: TypeScriptModule;\n ignoreDirs?: string[];\n srcRoot?: string;\n}): CallSiteCopy => {\n const copy = new Map<string, string>();\n const withoutCopy = new Map<string, string>();\n const pluralWithoutCopy = new Map<string, string>();\n const conflicts: CallSiteCopy['conflicts'] = [];\n\n const record = (key: string, value: string, file: string) => {\n const existing = copy.get(key);\n if (existing !== undefined && existing !== value) {\n conflicts.push({ a: existing, b: value, file, key });\n return;\n }\n copy.set(key, value);\n };\n\n for (const file of sourceFiles({ ignoreDirs, srcRoot })) {\n const sourceFile = tsModule.createSourceFile(\n file,\n fs.readFileSync(file, 'utf8'),\n tsModule.ScriptTarget.Latest,\n true,\n file.endsWith('.tsx') ? tsModule.ScriptKind.TSX : tsModule.ScriptKind.TS,\n );\n\n const visit = (node: ts.Node) => {\n if (tsModule.isCallExpression(node) && isTCallee(tsModule, node.expression)) {\n const [keyArg, second] = node.arguments;\n if (keyArg && tsModule.isStringLiteralLike(keyArg)) {\n const key = keyArg.text;\n if (second && tsModule.isStringLiteralLike(second)) {\n // t('key', 'Copy')\n record(key, second.text, file);\n } else if (second && tsModule.isObjectLiteralExpression(second)) {\n // t('key', { count, defaultValue_one, defaultValue_other }) \u2014 the catalog holds the\n // `_one` / `_other` forms, never the bare key.\n let plurals = 0;\n let hasCount = false;\n for (const prop of second.properties) {\n // `count` can arrive shorthand (`{ count }`), which is not a PropertyAssignment.\n if (\n tsModule.isShorthandPropertyAssignment(prop) &&\n prop.name.text === 'count'\n ) {\n hasCount = true;\n continue;\n }\n if (!tsModule.isPropertyAssignment(prop)) continue;\n const name = prop.name.getText(sourceFile).replace(/['\"]/g, '');\n if (name === 'count') hasCount = true;\n const suffix = name.match(/^defaultValue_(\\w+)$/)?.[1];\n if (suffix && tsModule.isStringLiteralLike(prop.initializer)) {\n record(`${key}_${suffix}`, prop.initializer.text, file);\n plurals++;\n }\n }\n // A `count` with no inline plural copy is a *bundled plural*: i18next will look up\n // `<key>_<category>`, so the guard has to demand that shape rather than the bare key.\n if (!plurals) (hasCount ? pluralWithoutCopy : withoutCopy).set(key, file);\n } else {\n // t('key') \u2014 no inline copy, so it has to resolve from runtimeDefaults.\n withoutCopy.set(key, file);\n }\n }\n }\n tsModule.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n }\n\n return { conflicts, copy, pluralWithoutCopy, withoutCopy };\n};\n", "import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { readCallSiteCopy } from './callSites';\nimport {\n formatFailures,\n guardBundledPluralShape,\n guardConflictingCopy,\n guardPrefixCollisions,\n guardShadowedKeys,\n guardUnresolvableKeys,\n} from './guards';\nimport { readStringMap } from './stringMaps';\nimport type { GeneratedCatalog, GeneratorConfig } from './types';\n\n/** Values under these prefixes are dayjs/i18next expressions, not copy. */\nconst BUILTIN_FORMATTER_PREFIXES = ['timestamp.', 'duration.'];\n\n/**\n * A catalog entry that is one plural category of a key, e.g. `x.y_other`.\n *\n * These are excluded from the emitted `BundledTranslationKey` union: a call site passes the *bare* key\n * and `StreamTFunctionFor`'s plural overload already accepts it, so listing the suffixed forms as\n * bundled keys would offer `t('x.y_other')` \u2014 a call that resolves nothing.\n */\nconst PLURAL_CATEGORY_SUFFIX = /_(zero|one|two|few|many|other)$/;\n\n/**\n * Two ways English hides inside a formatter expression, both of which have to be reported: a translator\n * working from the JSON export never sees these keys otherwise.\n */\nconst hasEnglishWords = (value: string) =>\n // Day words baked into a `calendarFormats` argument, e.g. `[Yesterday]` \u2014 dayjs escapes literal text\n // in brackets.\n [...value.matchAll(/\\[([^\\]]+)\\]/g)].some(([, literal]) =>\n /[A-Za-z]{2}/.test(literal),\n ) ||\n // Prose sitting beside the interpolation, e.g. `Last seen {{ timestamp | \u2026 }}`. Each expression is\n // matched individually \u2014 a greedy `{{[\\s\\S]*}}` would span from the first `{{` to the last `}}` and\n // swallow the prose between two of them. Stopping at `}}` rather than any `}` is what keeps the\n // nested braces of a `calendarFormats` argument inside the match.\n /[A-Za-z]{2}/.test(value.replace(/\\{\\{(?:[^}]|\\}(?!\\}))*\\}\\}/g, ''));\n\n/**\n * Builds the catalog and runs every guard, without writing anything.\n *\n * Separate from {@link generateI18nKeys} so a test \u2014 or a caller wanting to inspect before committing \u2014\n * can get the failures as data rather than as process output.\n */\nexport const buildCatalog = (config: GeneratorConfig): GeneratedCatalog => {\n const { runtimeDefaultsPath, ts } = config;\n\n const runtimeDefaults = readStringMap({\n exportName: 'runtimeDefaults',\n file: runtimeDefaultsPath,\n ts,\n });\n const {\n conflicts,\n copy: inlineCopy,\n pluralWithoutCopy,\n withoutCopy,\n } = readCallSiteCopy({\n ignoreDirs: config.ignoreDirs,\n srcRoot: config.srcRoot,\n ts,\n });\n\n const catalogEntries = new Map([...inlineCopy, ...runtimeDefaults]);\n const keys = [...catalogEntries.keys()].sort();\n const catalog = new Map(keys.map((key) => [key, catalogEntries.get(key) as string]));\n\n const failures = [\n guardConflictingCopy(conflicts),\n guardUnresolvableKeys({\n pluralWithoutCopy,\n runtimeDefaults,\n runtimeDefaultsPath,\n withoutCopy,\n }),\n guardBundledPluralShape({ pluralWithoutCopy, runtimeDefaults, runtimeDefaultsPath }),\n guardShadowedKeys({ inlineCopy, runtimeDefaults, runtimeDefaultsPath }),\n guardPrefixCollisions(keys),\n ].filter((failure): failure is NonNullable<typeof failure> => failure !== null);\n\n return { bundledKeys: [...runtimeDefaults.keys()].sort(), catalog, failures };\n};\n\nconst renderKeysFile = ({\n bundledKeys,\n catalog,\n emitBundledKeyUnion,\n}: {\n bundledKeys: string[];\n catalog: Map<string, string>;\n emitBundledKeyUnion?: boolean;\n}): string => {\n const lines: string[] = [\n '// AUTO-GENERATED \u2014 do not edit by hand.',\n '// Regenerate with `yarn build-translations`. CI fails if this file is out of sync.',\n '//',\n '// Type-only: no runtime value is emitted, so this adds nothing to the bundle.',\n '',\n '/**',\n ' * Every translation entry shipped with the SDK, mapped to its English copy.',\n ' *',\n ' * Plural entries appear as `<key>_one` / `<key>_other`; call sites use the bare `<key>` and',\n ' * pass `count`.',\n ' */',\n 'export type TranslationCatalog = {',\n ];\n\n for (const [key, value] of catalog) {\n lines.push(` ${JSON.stringify(key)}: ${JSON.stringify(value)};`);\n }\n lines.push('};', '');\n\n if (emitBundledKeyUnion) {\n lines.push(\n '/**',\n ' * Keys whose copy is bundled rather than passed inline at the call site.',\n ' *',\n ' * They reach `t()` as runtime values \u2014 a JSX prop, a ternary branch, a lookup table \u2014 so there',\n ' * is nowhere to write a `defaultValue`. Call sites pass the key alone.',\n ' */',\n 'export type BundledTranslationKey =',\n );\n for (const key of bundledKeys) lines.push(` | ${JSON.stringify(key)}`);\n lines.push(';', '');\n }\n\n return lines.join('\\n');\n};\n\n/**\n * Regenerates an SDK's translation catalog from its `t()` call sites and bundled defaults.\n *\n * Throws on a guard failure with every failure formatted, so the caller's script exits non-zero and CI\n * fails. The catalog is written only when all guards pass.\n */\nexport const generateI18nKeys = (config: GeneratorConfig): GeneratedCatalog => {\n const log = config.log ?? ((message: string) => console.log(message));\n const result = buildCatalog(config);\n\n if (result.failures.length) {\n throw new Error(formatFailures(result.failures));\n }\n\n const { bundledKeys, catalog } = result;\n const keys = [...catalog.keys()];\n\n fs.mkdirSync(path.dirname(config.keysOut), { recursive: true });\n fs.writeFileSync(\n config.keysOut,\n renderKeysFile({\n bundledKeys: bundledKeys.filter((key) => !PLURAL_CATEGORY_SUFFIX.test(key)),\n catalog,\n emitBundledKeyUnion: config.emitBundledKeyUnion,\n }),\n );\n\n if (config.fixtureOut) {\n fs.mkdirSync(path.dirname(config.fixtureOut), { recursive: true });\n fs.writeFileSync(\n config.fixtureOut,\n `${JSON.stringify(Object.fromEntries(catalog), null, 2)}\\n`,\n );\n }\n\n log(\n `generated ${config.keysOut} (${keys.length} entries, type-only) \u2014 ` +\n `${keys.length - bundledKeys.length} from inline defaults, ${bundledKeys.length} bundled`,\n );\n\n if (config.json) {\n const formatterPrefixes = [\n ...BUILTIN_FORMATTER_PREFIXES,\n ...(config.extraFormatterPrefixes ?? []),\n ];\n const isFormatterKey = (key: string) =>\n formatterPrefixes.some((prefix) => key.startsWith(prefix));\n\n const exported = config.json.includeFormats\n ? keys\n : keys.filter((k) => !isFormatterKey(k));\n fs.writeFileSync(\n config.json.out,\n `${JSON.stringify(\n Object.fromEntries(exported.map((key) => [key, catalog.get(key)])),\n null,\n 2,\n )}\\n`,\n );\n\n log(\n `wrote ${config.json.out} (${exported.length} ${\n config.json.includeFormats\n ? 'entries, formatter expressions included'\n : 'translatable entries'\n })`,\n );\n\n const excluded = keys.filter((key) => !exported.includes(key));\n if (excluded.length) {\n // Excluding formatter expressions does drop some translatable text: a few embed English day\n // words. It is not translatable *as copy* \u2014 the format string has to be rewritten \u2014 so it is\n // named here and handled by overriding the key. Detected rather than hardcoded, so the list\n // cannot go stale.\n const withEnglish = excluded.filter((key) =>\n hasEnglishWords(catalog.get(key) as string),\n );\n log(\n ` excluded ${excluded.length} formatter expressions (${formatterPrefixes.join(', ')}) \u2014 ` +\n `not copy, and a TMS that translates them breaks date rendering. Pass --all to include ` +\n `them.` +\n (withEnglish.length\n ? `\\n ${withEnglish.length} of them do carry English copy and must be translated by ` +\n `overriding the key:\\n${withEnglish.map((key) => ` ${key}`).join('\\n')}` +\n (config.migrationGuideRef ? `\\n see ${config.migrationGuideRef}.` : '')\n : ''),\n );\n }\n }\n\n return result;\n};\n", "import type { CallSiteCopy, GuardFailure } from './types';\n\n/**\n * The five hard-fail checks the catalog has to pass.\n *\n * Each is a pure function returning failures as data. The guard both UI SDKs carried that is *not* here\n * \u2014 checking that an `EXTERNAL_STRING_KEYS` entry's wording matched the key's catalog copy \u2014 is gone\n * because the map it policed is gone: notifications now resolve through a stable identifier instead of\n * by matching English prose.\n */\n\n/** A key must render one thing. */\nexport const guardConflictingCopy = (\n conflicts: CallSiteCopy['conflicts'],\n): GuardFailure | null => {\n if (!conflicts.length) return null;\n return {\n entries: conflicts.map(\n ({ a, b, file, key }) =>\n `${key}\\n ${JSON.stringify(a)}\\n ${JSON.stringify(b)} (${file})`,\n ),\n kind: 'conflicting-copy',\n summary:\n `${conflicts.length} key(s) used with conflicting inline copy \u2014 a key must render ` +\n `one thing:`,\n };\n};\n\n/**\n * A key called without inline copy resolves from the bundled data or not at all.\n *\n * Without this, i18next renders the raw dotted key in the UI \u2014 the failure mode is a user seeing\n * `message.status.sent.text` where a word should be.\n */\nexport const guardUnresolvableKeys = ({\n pluralWithoutCopy,\n runtimeDefaults,\n runtimeDefaultsPath,\n withoutCopy,\n}: {\n pluralWithoutCopy: CallSiteCopy['pluralWithoutCopy'];\n runtimeDefaults: Map<string, string>;\n runtimeDefaultsPath: string;\n withoutCopy: CallSiteCopy['withoutCopy'];\n}): GuardFailure | null => {\n const unresolvable = [\n ...[...withoutCopy].filter(([key]) => !runtimeDefaults.has(key)),\n // A plural resolves as `<key>_<category>`, so `_other` \u2014 the one category every language has \u2014 is\n // what has to be bundled. Demanding the bare key here is what used to reject a correct catalog.\n //\n // A key bundled under the *bare* name is skipped here on purpose: it is not unresolvable, it is\n // the wrong shape, and `guardBundledPluralShape` says so precisely. Reporting both would give two\n // failures with different advice for one mistake.\n ...[...pluralWithoutCopy]\n .filter(\n ([key]) => !runtimeDefaults.has(`${key}_other`) && !runtimeDefaults.has(key),\n )\n .map(([key, file]): [string, string] => [`${key}_other`, file]),\n ];\n if (!unresolvable.length) return null;\n return {\n entries: unresolvable.map(([key, file]) => `${key} (${file})`),\n kind: 'unresolvable-key',\n summary:\n `${unresolvable.length} key(s) are called with no inline default and are missing from ` +\n `${runtimeDefaultsPath}.\\nThey would render as the raw key. Either pass the English copy ` +\n `inline \u2014 t('key', 'Copy') \u2014 or add an entry to ${runtimeDefaultsPath}:`,\n };\n};\n\n/**\n * A bundled plural must be stored under its category suffixes, not under the bare key.\n *\n * i18next falls back to an unsuffixed entry when no `<key>_<category>` exists, so the bare form does\n * render \u2014 it just renders the same string for every count, with plural selection silently dead and no\n * error anywhere. Verified against i18next directly: a bundled `'x.y': '{{count}} items'` answers\n * `count: 1` with \"1 items\".\n */\nexport const guardBundledPluralShape = ({\n pluralWithoutCopy,\n runtimeDefaults,\n runtimeDefaultsPath,\n}: {\n pluralWithoutCopy: CallSiteCopy['pluralWithoutCopy'];\n runtimeDefaults: Map<string, string>;\n runtimeDefaultsPath: string;\n}): GuardFailure | null => {\n const bare = [...pluralWithoutCopy].filter(([key]) => runtimeDefaults.has(key));\n if (!bare.length) return null;\n return {\n entries: bare.map(\n ([key, file]) =>\n `${key}\\n bundled as: ${JSON.stringify(runtimeDefaults.get(key))}\\n` +\n ` called as: t('${key}', { count }) (${file})`,\n ),\n kind: 'bundled-plural-shape',\n summary:\n `${bare.length} key(s) are called with \\`count\\` but bundled under the bare key in ` +\n `${runtimeDefaultsPath}.\\ni18next resolves plurals as \\`<key>_<category>\\`, so this renders ` +\n `one form for every count with no error. Split the entry into \\`_one\\` / \\`_other\\`:`,\n };\n};\n\n/**\n * A key must not be in both places.\n *\n * The bundled value wins over a `defaultValue`, so a key in both silently renders the bundled string\n * and ignores the call site \u2014 meaning an edit to the copy at the call site changes nothing, with no\n * error. This is the bug class that used to hide behind a checked-in `en.json`.\n */\nexport const guardShadowedKeys = ({\n inlineCopy,\n runtimeDefaults,\n runtimeDefaultsPath,\n}: {\n inlineCopy: Map<string, string>;\n runtimeDefaults: Map<string, string>;\n runtimeDefaultsPath: string;\n}): GuardFailure | null => {\n const shadowed = [...runtimeDefaults.keys()].filter((key) => inlineCopy.has(key));\n if (!shadowed.length) return null;\n return {\n entries: shadowed.map(\n (key) =>\n `${key}\\n bundled: ${JSON.stringify(runtimeDefaults.get(key))}\\n` +\n ` call site: ${JSON.stringify(inlineCopy.get(key))}`,\n ),\n kind: 'shadowed-key',\n summary:\n `${shadowed.length} key(s) are in both ${runtimeDefaultsPath} and an inline default.\\n` +\n `The bundled value wins, so editing the call site would silently change nothing. Remove ` +\n `the ${runtimeDefaultsPath} entry:`,\n };\n};\n\n/**\n * A key cannot be both a leaf and a namespace.\n *\n * With i18next's default `keySeparator: '.'` the shorter key would resolve to an object, and a nested\n * resource tree cannot represent both at once. The SDKs set `keySeparator: false` so this is latent\n * rather than active \u2014 but it is a landmine for anyone who ever flips that, and cheap to prevent.\n *\n * Compared on segment boundaries, so `poll.title` / `poll.titleText` is fine while `poll.title` /\n * `poll.title.text` is not.\n */\nexport const guardPrefixCollisions = (keys: string[]): GuardFailure | null => {\n const keySet = new Set(keys);\n const collisions: Array<{ leaf: string; nested: string }> = [];\n\n for (const key of keys) {\n const segments = key.split('.');\n for (let i = 1; i < segments.length; i++) {\n const ancestor = segments.slice(0, i).join('.');\n if (keySet.has(ancestor)) collisions.push({ leaf: ancestor, nested: key });\n }\n }\n\n if (!collisions.length) return null;\n return {\n entries: collisions.map(\n ({ leaf, nested }) => `${leaf}\\n is a strict prefix of: ${nested}`,\n ),\n kind: 'prefix-collision',\n summary:\n `${collisions.length} key(s) are a strict prefix of another key \u2014 a key cannot be both a ` +\n `leaf and a namespace. Rename one, usually by giving the shorter key a modality segment ` +\n `(.label / .text / .title):`,\n };\n};\n\n/** Formats failures the way the generator prints them before exiting. */\nexport const formatFailures = (failures: GuardFailure[]): string =>\n failures\n .map(\n ({ entries, summary }) =>\n `\\n${summary}\\n${entries.map((e) => ` ${e}`).join('\\n')}`,\n )\n .join('\\n');\n", "import fs from 'node:fs';\nimport type * as ts from 'typescript';\n\nimport type { TypeScriptModule } from './types';\n\n/**\n * Reads a flat `Record<string, string>` export out of a source file.\n *\n * Parsed rather than imported: `await import()` works under Node's type stripping but warns\n * `MODULE_TYPELESS_PACKAGE_JSON` on every run, and the SDK packages cannot be `\"type\": \"module\"`.\n *\n * Throws rather than exiting, so a caller \u2014 including a test \u2014 can handle the failure.\n */\nexport const readStringMap = ({\n exportName,\n file,\n ts: tsModule,\n}: {\n exportName: string;\n file: string;\n ts: TypeScriptModule;\n}): Map<string, string> => {\n if (!fs.existsSync(file)) {\n throw new Error(\n `i18n-codegen: could not read the file expected to export \\`${exportName}\\`: ${file}`,\n );\n }\n\n const source = tsModule.createSourceFile(\n file,\n fs.readFileSync(file, 'utf8'),\n tsModule.ScriptTarget.Latest,\n true,\n tsModule.ScriptKind.TS,\n );\n\n const out = new Map<string, string>();\n let found = false;\n\n tsModule.forEachChild(source, (node) => {\n if (!tsModule.isVariableStatement(node)) return;\n\n for (const declaration of node.declarationList.declarations) {\n if (\n !tsModule.isIdentifier(declaration.name) ||\n declaration.name.text !== exportName ||\n !declaration.initializer\n ) {\n continue;\n }\n\n // `= { \u2026 } as const` and `satisfies \u2026` are both fine.\n let initializer: ts.Expression = declaration.initializer;\n while (\n tsModule.isAsExpression(initializer) ||\n tsModule.isSatisfiesExpression(initializer)\n ) {\n initializer = initializer.expression;\n }\n if (!tsModule.isObjectLiteralExpression(initializer)) continue;\n\n found = true;\n for (const property of initializer.properties) {\n if (!tsModule.isPropertyAssignment(property)) {\n throw new Error(\n `i18n-codegen: ${exportName} in ${file} must be a flat object of string literals, got: ` +\n property.getText(source).slice(0, 80),\n );\n }\n if (\n !tsModule.isStringLiteralLike(property.name) ||\n !tsModule.isStringLiteralLike(property.initializer)\n ) {\n throw new Error(\n `i18n-codegen: ${exportName} entries must be 'quoted.key': 'string literal', got: ` +\n property.getText(source).slice(0, 80),\n );\n }\n out.set(property.name.text, property.initializer.text);\n }\n }\n });\n\n if (!found) {\n throw new Error(\n `i18n-codegen: could not find an exported \\`${exportName}\\` object literal in ${file}`,\n );\n }\n\n return out;\n};\n"],
5
- "mappings": ";AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAKjB,IAAM,sBAAsB,CAAC,aAAa,eAAe;AAazD,IAAM,YAAY,CAAC,UAA4B,SAC5C,SAAS,aAAa,IAAI,KAAK,KAAK,SAAS,OAC7C,SAAS,2BAA2B,IAAI,KAAK,KAAK,KAAK,SAAS;AAE5D,IAAM,cAAc,CAAC;AAAA,EAC1B,aAAa;AAAA,EACb,UAAU;AACZ,IAGI,CAAC,MAAgB;AACnB,QAAM,MAAgB,CAAC;AACvB,QAAM,OAAO,CAAC,QAAgB;AAC5B,eAAW,SAAS,GAAG,YAAY,KAAK,EAAE,eAAe,KAAK,CAAC,GAAG;AAChE,YAAM,OAAO,KAAK,KAAK,KAAK,MAAM,IAAI;AACtC,UAAI,MAAM,YAAY,GAAG;AACvB,YAAI,WAAW,SAAS,MAAM,IAAI,EAAG;AACrC,aAAK,IAAI;AAAA,MACX,WAAW,UAAU,KAAK,MAAM,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS,OAAO,GAAG;AACtE,YAAI,KAAK,IAAI;AAAA,MACf;AAAA,IACF;AAAA,EACF;AACA,OAAK,OAAO;AACZ,SAAO;AACT;AAEO,IAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,IAAI;AACN,MAIoB;AAClB,QAAM,OAAO,oBAAI,IAAoB;AACrC,QAAM,cAAc,oBAAI,IAAoB;AAC5C,QAAM,oBAAoB,oBAAI,IAAoB;AAClD,QAAM,YAAuC,CAAC;AAE9C,QAAM,SAAS,CAAC,KAAa,OAAe,SAAiB;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