pingerchips-js 1.0.0-a

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 (434) hide show
  1. package/.editorconfig +14 -0
  2. package/.github/ISSUE_TEMPLATE.md +11 -0
  3. package/.github/PULL_REQUEST_TEMPLATE.md +14 -0
  4. package/.github/dependabot.yml +14 -0
  5. package/.github/stale.yml +26 -0
  6. package/.github/workflows/release.yml +112 -0
  7. package/.github/workflows/release_pr.yml +43 -0
  8. package/.github/workflows/run-tests.yml +62 -0
  9. package/.gitmodules +3 -0
  10. package/.prettierrc +2 -0
  11. package/CHANGELOG.md +924 -0
  12. package/LICENCE +19 -0
  13. package/Makefile +78 -0
  14. package/README.md +707 -0
  15. package/bower.json +28 -0
  16. package/dist/node/pusher.js +10870 -0
  17. package/dist/node/pusher.js.map +1 -0
  18. package/dist/react-native/pusher.js +9 -0
  19. package/dist/react-native/pusher.js.map +1 -0
  20. package/dist/web/json2.js +486 -0
  21. package/dist/web/json2.min.js +1 -0
  22. package/dist/web/pusher-with-encryption.js +7009 -0
  23. package/dist/web/pusher-with-encryption.js.map +1 -0
  24. package/dist/web/pusher-with-encryption.min.js +9 -0
  25. package/dist/web/pusher-with-encryption.min.js.map +1 -0
  26. package/dist/web/pusher.js +4587 -0
  27. package/dist/web/pusher.js.map +1 -0
  28. package/dist/web/pusher.min.js +9 -0
  29. package/dist/web/pusher.min.js.map +1 -0
  30. package/dist/web/sockjs.js +2435 -0
  31. package/dist/web/sockjs.min.js +89 -0
  32. package/dist/worker/pusher-with-encryption.worker.js +6622 -0
  33. package/dist/worker/pusher-with-encryption.worker.js.map +1 -0
  34. package/dist/worker/pusher-with-encryption.worker.min.js +9 -0
  35. package/dist/worker/pusher-with-encryption.worker.min.js.map +1 -0
  36. package/dist/worker/pusher.worker.js +4200 -0
  37. package/dist/worker/pusher.worker.js.map +1 -0
  38. package/dist/worker/pusher.worker.min.js +9 -0
  39. package/dist/worker/pusher.worker.min.js.map +1 -0
  40. package/index.d.ts +29 -0
  41. package/integration_tests_server/index.js +176 -0
  42. package/integration_tests_server/package-lock.json +1177 -0
  43. package/integration_tests_server/package.json +15 -0
  44. package/node.js +1 -0
  45. package/package.json +70 -0
  46. package/pusher-with-encryption/index.js +1 -0
  47. package/react-native/index.d.ts +29 -0
  48. package/react-native/index.js +1 -0
  49. package/spec/config/jasmine/helpers/reporter.js +14 -0
  50. package/spec/config/jasmine/integration.json +13 -0
  51. package/spec/config/jasmine/unit.json +13 -0
  52. package/spec/config/jasmine/webpack.integration.js +33 -0
  53. package/spec/config/jasmine/webpack.unit.js +30 -0
  54. package/spec/config/karma/available_browsers.json +4957 -0
  55. package/spec/config/karma/config.ci.js +25 -0
  56. package/spec/config/karma/config.common.js +50 -0
  57. package/spec/config/karma/config.integration.js +26 -0
  58. package/spec/config/karma/config.unit.js +10 -0
  59. package/spec/config/karma/config.worker.js +34 -0
  60. package/spec/config/karma/integration.js +24 -0
  61. package/spec/config/karma/unit.js +20 -0
  62. package/spec/javascripts/helpers/mocks.js +274 -0
  63. package/spec/javascripts/helpers/node/integration.js +33 -0
  64. package/spec/javascripts/helpers/node/mock-dom-dependencies.ts +1 -0
  65. package/spec/javascripts/helpers/pusher_integration.js +1 -0
  66. package/spec/javascripts/helpers/pusher_integration_class.ts +12 -0
  67. package/spec/javascripts/helpers/timers/promises.js +9 -0
  68. package/spec/javascripts/helpers/waitsFor.js +37 -0
  69. package/spec/javascripts/helpers/web/integration.js +44 -0
  70. package/spec/javascripts/helpers/worker/mock-dom-dependencies.js +1 -0
  71. package/spec/javascripts/integration/core/cluster_config_spec.js +153 -0
  72. package/spec/javascripts/integration/core/falling_back_spec.js +195 -0
  73. package/spec/javascripts/integration/core/pusher_spec/index.js +68 -0
  74. package/spec/javascripts/integration/core/pusher_spec/test_builder.js +715 -0
  75. package/spec/javascripts/integration/core/timeout_configuration_spec.js +200 -0
  76. package/spec/javascripts/integration/core/transport_lists_spec.js +103 -0
  77. package/spec/javascripts/integration/index.node.js +12 -0
  78. package/spec/javascripts/integration/index.web.js +63 -0
  79. package/spec/javascripts/integration/index.worker.js +13 -0
  80. package/spec/javascripts/integration/web/dom/jsonp_spec.js +97 -0
  81. package/spec/javascripts/integration/web/dom/script_request_spec.js +90 -0
  82. package/spec/javascripts/polyfills/index.js +105 -0
  83. package/spec/javascripts/unit/core/channels/channel_spec.js +355 -0
  84. package/spec/javascripts/unit/core/channels/channels_spec.js +94 -0
  85. package/spec/javascripts/unit/core/channels/encrypted_channel_spec.js +343 -0
  86. package/spec/javascripts/unit/core/channels/presence_channel_spec.js +553 -0
  87. package/spec/javascripts/unit/core/channels/private_channel_spec.js +182 -0
  88. package/spec/javascripts/unit/core/config_spec.js +507 -0
  89. package/spec/javascripts/unit/core/connection/connection_manager_spec.js +656 -0
  90. package/spec/javascripts/unit/core/connection/connection_spec.js +286 -0
  91. package/spec/javascripts/unit/core/connection/handshake_spec.js +160 -0
  92. package/spec/javascripts/unit/core/connection/protocol_spec.js +420 -0
  93. package/spec/javascripts/unit/core/defaults_spec.js +26 -0
  94. package/spec/javascripts/unit/core/events_dispatcher_spec.js +385 -0
  95. package/spec/javascripts/unit/core/http/http_polling_socket_spec.js +60 -0
  96. package/spec/javascripts/unit/core/http/http_request_spec.js +185 -0
  97. package/spec/javascripts/unit/core/http/http_socket_spec.js +370 -0
  98. package/spec/javascripts/unit/core/http/http_streaming_socket_spec.js +56 -0
  99. package/spec/javascripts/unit/core/http/http_xhr_request_spec.js +164 -0
  100. package/spec/javascripts/unit/core/logger_spec.js +133 -0
  101. package/spec/javascripts/unit/core/pusher_spec.js +613 -0
  102. package/spec/javascripts/unit/core/pusher_with_encryption_spec.js +18 -0
  103. package/spec/javascripts/unit/core/strategies/best_connected_ever_strategy_spec.js +104 -0
  104. package/spec/javascripts/unit/core/strategies/delayed_strategy_spec.js +95 -0
  105. package/spec/javascripts/unit/core/strategies/first_connected_strategy_spec.js +68 -0
  106. package/spec/javascripts/unit/core/strategies/if_strategy_spec.js +165 -0
  107. package/spec/javascripts/unit/core/strategies/sequential_strategy_spec.js +213 -0
  108. package/spec/javascripts/unit/core/strategies/transport_strategy_spec.js +250 -0
  109. package/spec/javascripts/unit/core/strategies/websocket_prioritized_cached_strategy_spec.js +400 -0
  110. package/spec/javascripts/unit/core/timeline/timeline_spec.js +153 -0
  111. package/spec/javascripts/unit/core/transports/assistant_to_the_transport_manager_spec.js +223 -0
  112. package/spec/javascripts/unit/core/transports/hosts_and_ports_spec.js +85 -0
  113. package/spec/javascripts/unit/core/transports/transport_connection_spec.js +585 -0
  114. package/spec/javascripts/unit/core/transports/transport_manager_spec.js +64 -0
  115. package/spec/javascripts/unit/core/user_spec.js +303 -0
  116. package/spec/javascripts/unit/core/utils/periodic_timer_spec.js +74 -0
  117. package/spec/javascripts/unit/core/utils/timers_spec.js +157 -0
  118. package/spec/javascripts/unit/core/utils/url_store_spec.js +14 -0
  119. package/spec/javascripts/unit/core/watchlist_spec.js +48 -0
  120. package/spec/javascripts/unit/core_with_runtime/auth/channel_authorizer_spec.js +137 -0
  121. package/spec/javascripts/unit/core_with_runtime/auth/deprecated_channel_authorizer_spec.js +48 -0
  122. package/spec/javascripts/unit/core_with_runtime/auth/user_authorizer_spec.js +128 -0
  123. package/spec/javascripts/unit/core_with_runtime/readme.md +5 -0
  124. package/spec/javascripts/unit/index.node.js +11 -0
  125. package/spec/javascripts/unit/index.web.js +12 -0
  126. package/spec/javascripts/unit/index.worker.js +11 -0
  127. package/spec/javascripts/unit/isomorphic/transports/hosts_and_ports_spec.js +82 -0
  128. package/spec/javascripts/unit/isomorphic/transports/transports_spec.js +202 -0
  129. package/spec/javascripts/unit/node/timeline_sender_spec.js +83 -0
  130. package/spec/javascripts/unit/web/dom/dependency_loader_spec.js +249 -0
  131. package/spec/javascripts/unit/web/dom/jsonp_request_spec.js +130 -0
  132. package/spec/javascripts/unit/web/dom/script_receiver_factory_spec.js +68 -0
  133. package/spec/javascripts/unit/web/http/http_xdomain_request_spec.js +222 -0
  134. package/spec/javascripts/unit/web/pusher_authorizer_spec.js +64 -0
  135. package/spec/javascripts/unit/web/timeline/timeline_sender_spec.js +131 -0
  136. package/spec/javascripts/unit/web/transports/hosts_and_ports_spec.js +127 -0
  137. package/spec/javascripts/unit/web/transports/transports_spec.js +444 -0
  138. package/spec/javascripts/unit/worker/channel_authorizer_spec.js +156 -0
  139. package/spec/javascripts/unit/worker/timeline_sender_spec.js +76 -0
  140. package/src/core/auth/auth_transports.ts +18 -0
  141. package/src/core/auth/channel_authorizer.ts +64 -0
  142. package/src/core/auth/deprecated_channel_authorizer.ts +58 -0
  143. package/src/core/auth/options.ts +78 -0
  144. package/src/core/auth/user_authenticator.ts +62 -0
  145. package/src/core/base64.ts +49 -0
  146. package/src/core/channels/channel.ts +163 -0
  147. package/src/core/channels/channel_table.ts +7 -0
  148. package/src/core/channels/channels.ts +85 -0
  149. package/src/core/channels/encrypted_channel.ts +149 -0
  150. package/src/core/channels/members.ts +80 -0
  151. package/src/core/channels/metadata.ts +5 -0
  152. package/src/core/channels/presence_channel.ts +113 -0
  153. package/src/core/channels/private_channel.ts +25 -0
  154. package/src/core/config.ts +189 -0
  155. package/src/core/connection/callbacks.ts +21 -0
  156. package/src/core/connection/connection.ts +160 -0
  157. package/src/core/connection/connection_manager.ts +371 -0
  158. package/src/core/connection/connection_manager_options.ts +14 -0
  159. package/src/core/connection/handshake/handshake_payload.ts +10 -0
  160. package/src/core/connection/handshake/index.ts +90 -0
  161. package/src/core/connection/protocol/action.ts +8 -0
  162. package/src/core/connection/protocol/message-types.ts +8 -0
  163. package/src/core/connection/protocol/protocol.ts +154 -0
  164. package/src/core/defaults.ts +66 -0
  165. package/src/core/errors.ts +69 -0
  166. package/src/core/events/callback.ts +6 -0
  167. package/src/core/events/callback_registry.ts +75 -0
  168. package/src/core/events/callback_table.ts +7 -0
  169. package/src/core/events/dispatcher.ts +84 -0
  170. package/src/core/http/ajax.ts +24 -0
  171. package/src/core/http/http_factory.ts +16 -0
  172. package/src/core/http/http_polling_socket.ts +24 -0
  173. package/src/core/http/http_request.ts +81 -0
  174. package/src/core/http/http_socket.ts +220 -0
  175. package/src/core/http/http_streaming_socket.ts +19 -0
  176. package/src/core/http/request_hooks.ts +9 -0
  177. package/src/core/http/socket_hooks.ts +11 -0
  178. package/src/core/http/state.ts +7 -0
  179. package/src/core/http/url_location.ts +6 -0
  180. package/src/core/logger.ts +53 -0
  181. package/src/core/options.ts +59 -0
  182. package/src/core/pusher-licence.js +7 -0
  183. package/src/core/pusher-with-encryption.js +1 -0
  184. package/src/core/pusher-with-encryption.ts +14 -0
  185. package/src/core/pusher.js +2 -0
  186. package/src/core/pusher.ts +249 -0
  187. package/src/core/reachability.ts +7 -0
  188. package/src/core/socket.ts +14 -0
  189. package/src/core/strategies/best_connected_ever_strategy.ts +81 -0
  190. package/src/core/strategies/delayed_strategy.ts +48 -0
  191. package/src/core/strategies/first_connected_strategy.ts +28 -0
  192. package/src/core/strategies/if_strategy.ts +34 -0
  193. package/src/core/strategies/sequential_strategy.ts +129 -0
  194. package/src/core/strategies/strategy.ts +8 -0
  195. package/src/core/strategies/strategy_builder.ts +67 -0
  196. package/src/core/strategies/strategy_options.ts +18 -0
  197. package/src/core/strategies/strategy_runner.ts +6 -0
  198. package/src/core/strategies/transport_strategy.ts +144 -0
  199. package/src/core/strategies/websocket_prioritized_cached_strategy.ts +157 -0
  200. package/src/core/timeline/level.ts +7 -0
  201. package/src/core/timeline/timeline.ts +90 -0
  202. package/src/core/timeline/timeline_sender.ts +33 -0
  203. package/src/core/timeline/timeline_transport.ts +11 -0
  204. package/src/core/transports/assistant_to_the_transport_manager.ts +104 -0
  205. package/src/core/transports/ping_delay_options.ts +7 -0
  206. package/src/core/transports/transport.ts +54 -0
  207. package/src/core/transports/transport_connection.ts +241 -0
  208. package/src/core/transports/transport_connection_options.ts +8 -0
  209. package/src/core/transports/transport_hooks.ts +16 -0
  210. package/src/core/transports/transport_manager.ts +52 -0
  211. package/src/core/transports/transports_table.ts +12 -0
  212. package/src/core/transports/url_scheme.ts +13 -0
  213. package/src/core/transports/url_schemes.ts +47 -0
  214. package/src/core/user.ts +186 -0
  215. package/src/core/util.ts +34 -0
  216. package/src/core/utils/collections.ts +353 -0
  217. package/src/core/utils/factory.ts +75 -0
  218. package/src/core/utils/flat_promise.ts +10 -0
  219. package/src/core/utils/timers/abstract_timer.ts +39 -0
  220. package/src/core/utils/timers/index.ts +39 -0
  221. package/src/core/utils/timers/scheduling.ts +11 -0
  222. package/src/core/utils/timers/timed_callback.ts +5 -0
  223. package/src/core/utils/url_store.ts +48 -0
  224. package/src/core/watchlist.ts +31 -0
  225. package/src/d.ts/constants/index.d.ts +5 -0
  226. package/src/d.ts/faye-websocket/faye-websocket.d.ts +21 -0
  227. package/src/d.ts/global/global.d.ts +1 -0
  228. package/src/d.ts/module/module.d.ts +12 -0
  229. package/src/d.ts/tweetnacl-util/index.d.ts +6 -0
  230. package/src/d.ts/window/events.d.ts +4 -0
  231. package/src/d.ts/window/sockjs.d.ts +3 -0
  232. package/src/d.ts/window/websocket.d.ts +4 -0
  233. package/src/d.ts/window/xmlhttprequest.d.ts +3 -0
  234. package/src/runtimes/interface.ts +59 -0
  235. package/src/runtimes/isomorphic/auth/xhr_auth.ts +90 -0
  236. package/src/runtimes/isomorphic/default_strategy.ts +155 -0
  237. package/src/runtimes/isomorphic/http/http.ts +32 -0
  238. package/src/runtimes/isomorphic/http/http_xhr_request.ts +35 -0
  239. package/src/runtimes/isomorphic/runtime.ts +62 -0
  240. package/src/runtimes/isomorphic/timeline/xhr_timeline.ts +50 -0
  241. package/src/runtimes/isomorphic/transports/transport_connection_initializer.ts +19 -0
  242. package/src/runtimes/isomorphic/transports/transports.ts +81 -0
  243. package/src/runtimes/node/net_info.ts +10 -0
  244. package/src/runtimes/node/runtime.ts +68 -0
  245. package/src/runtimes/react-native/net_info.ts +42 -0
  246. package/src/runtimes/react-native/runtime.ts +65 -0
  247. package/src/runtimes/web/auth/jsonp_auth.ts +51 -0
  248. package/src/runtimes/web/browser.ts +24 -0
  249. package/src/runtimes/web/default_strategy.ts +201 -0
  250. package/src/runtimes/web/dom/dependencies.ts +16 -0
  251. package/src/runtimes/web/dom/dependency_loader.ts +93 -0
  252. package/src/runtimes/web/dom/json2.js +486 -0
  253. package/src/runtimes/web/dom/jsonp_request.ts +52 -0
  254. package/src/runtimes/web/dom/script_receiver.ts +8 -0
  255. package/src/runtimes/web/dom/script_receiver_factory.ts +57 -0
  256. package/src/runtimes/web/dom/script_request.ts +85 -0
  257. package/src/runtimes/web/dom/sockjs/COPYING +11 -0
  258. package/src/runtimes/web/dom/sockjs/Changelog +147 -0
  259. package/src/runtimes/web/dom/sockjs/LICENSE-MIT-SockJS +19 -0
  260. package/src/runtimes/web/dom/sockjs/Makefile +109 -0
  261. package/src/runtimes/web/dom/sockjs/README.md +388 -0
  262. package/src/runtimes/web/dom/sockjs/VERSION-GEN +17 -0
  263. package/src/runtimes/web/dom/sockjs/bin/render.coffee +111 -0
  264. package/src/runtimes/web/dom/sockjs/bin/run_testling.sh +135 -0
  265. package/src/runtimes/web/dom/sockjs/lib/all.js +9 -0
  266. package/src/runtimes/web/dom/sockjs/lib/dom.js +185 -0
  267. package/src/runtimes/web/dom/sockjs/lib/dom2.js +280 -0
  268. package/src/runtimes/web/dom/sockjs/lib/eventemitter.js +57 -0
  269. package/src/runtimes/web/dom/sockjs/lib/heartbeater.js +70 -0
  270. package/src/runtimes/web/dom/sockjs/lib/index.js +41 -0
  271. package/src/runtimes/web/dom/sockjs/lib/info.js +117 -0
  272. package/src/runtimes/web/dom/sockjs/lib/json2.min.js +1 -0
  273. package/src/runtimes/web/dom/sockjs/lib/reventtarget.js +55 -0
  274. package/src/runtimes/web/dom/sockjs/lib/simpleevent.js +28 -0
  275. package/src/runtimes/web/dom/sockjs/lib/sockjs.js +288 -0
  276. package/src/runtimes/web/dom/sockjs/lib/test-hooks.js +16 -0
  277. package/src/runtimes/web/dom/sockjs/lib/trans-iframe-eventsource.js +29 -0
  278. package/src/runtimes/web/dom/sockjs/lib/trans-iframe-htmlfile.js +35 -0
  279. package/src/runtimes/web/dom/sockjs/lib/trans-iframe-within.js +100 -0
  280. package/src/runtimes/web/dom/sockjs/lib/trans-iframe-xhr-polling.js +30 -0
  281. package/src/runtimes/web/dom/sockjs/lib/trans-iframe.js +103 -0
  282. package/src/runtimes/web/dom/sockjs/lib/trans-jsonp-polling.js +106 -0
  283. package/src/runtimes/web/dom/sockjs/lib/trans-jsonp-receiver.js +116 -0
  284. package/src/runtimes/web/dom/sockjs/lib/trans-polling.js +44 -0
  285. package/src/runtimes/web/dom/sockjs/lib/trans-receiver-eventsource.js +41 -0
  286. package/src/runtimes/web/dom/sockjs/lib/trans-receiver-htmlfile.js +65 -0
  287. package/src/runtimes/web/dom/sockjs/lib/trans-receiver-xhr.js +42 -0
  288. package/src/runtimes/web/dom/sockjs/lib/trans-sender.js +138 -0
  289. package/src/runtimes/web/dom/sockjs/lib/trans-xhr.js +29 -0
  290. package/src/runtimes/web/dom/sockjs/lib/utils.js +297 -0
  291. package/src/runtimes/web/dom/sockjs/package.json +18 -0
  292. package/src/runtimes/web/dom/sockjs/version +1 -0
  293. package/src/runtimes/web/http/http.ts +8 -0
  294. package/src/runtimes/web/http/http_xdomain_request.ts +37 -0
  295. package/src/runtimes/web/net_info.ts +50 -0
  296. package/src/runtimes/web/runtime.ts +174 -0
  297. package/src/runtimes/web/timeline/jsonp_timeline.ts +34 -0
  298. package/src/runtimes/web/transports/transport_connection_initializer.ts +39 -0
  299. package/src/runtimes/web/transports/transports.ts +65 -0
  300. package/src/runtimes/worker/auth/fetch_auth.ts +69 -0
  301. package/src/runtimes/worker/net_info.ts +10 -0
  302. package/src/runtimes/worker/runtime.ts +75 -0
  303. package/src/runtimes/worker/timeline/fetch_timeline.ts +39 -0
  304. package/tsconfig.json +26 -0
  305. package/types/spec/javascripts/helpers/node/mock-dom-dependencies.d.ts +1 -0
  306. package/types/spec/javascripts/helpers/pusher_integration_class.d.ts +4 -0
  307. package/types/src/core/auth/auth_transports.d.ts +9 -0
  308. package/types/src/core/auth/channel_authorizer.d.ts +3 -0
  309. package/types/src/core/auth/deprecated_channel_authorizer.d.ts +18 -0
  310. package/types/src/core/auth/options.d.ts +48 -0
  311. package/types/src/core/auth/user_authenticator.d.ts +3 -0
  312. package/types/src/core/base64.d.ts +1 -0
  313. package/types/src/core/channels/channel.d.ts +23 -0
  314. package/types/src/core/channels/channel_table.d.ts +5 -0
  315. package/types/src/core/channels/channels.d.ts +12 -0
  316. package/types/src/core/channels/encrypted_channel.d.ts +15 -0
  317. package/types/src/core/channels/members.d.ts +14 -0
  318. package/types/src/core/channels/metadata.d.ts +4 -0
  319. package/types/src/core/channels/presence_channel.d.ts +13 -0
  320. package/types/src/core/channels/private_channel.d.ts +5 -0
  321. package/types/src/core/config.d.ts +31 -0
  322. package/types/src/core/connection/callbacks.d.ts +18 -0
  323. package/types/src/core/connection/connection.d.ts +16 -0
  324. package/types/src/core/connection/connection_manager.d.ts +50 -0
  325. package/types/src/core/connection/connection_manager_options.d.ts +11 -0
  326. package/types/src/core/connection/handshake/handshake_payload.d.ts +8 -0
  327. package/types/src/core/connection/handshake/index.d.ts +12 -0
  328. package/types/src/core/connection/protocol/action.d.ts +7 -0
  329. package/types/src/core/connection/protocol/message-types.d.ts +7 -0
  330. package/types/src/core/connection/protocol/protocol.d.ts +10 -0
  331. package/types/src/core/defaults.d.ts +26 -0
  332. package/types/src/core/errors.d.ts +28 -0
  333. package/types/src/core/events/callback.d.ts +5 -0
  334. package/types/src/core/events/callback_registry.d.ts +11 -0
  335. package/types/src/core/events/callback_table.d.ts +5 -0
  336. package/types/src/core/events/dispatcher.d.ts +14 -0
  337. package/types/src/core/http/ajax.d.ts +16 -0
  338. package/types/src/core/http/http_factory.d.ts +13 -0
  339. package/types/src/core/http/http_polling_socket.d.ts +3 -0
  340. package/types/src/core/http/http_request.d.ts +17 -0
  341. package/types/src/core/http/http_socket.d.ts +32 -0
  342. package/types/src/core/http/http_streaming_socket.d.ts +3 -0
  343. package/types/src/core/http/request_hooks.d.ts +6 -0
  344. package/types/src/core/http/socket_hooks.d.ts +8 -0
  345. package/types/src/core/http/state.d.ts +6 -0
  346. package/types/src/core/http/url_location.d.ts +5 -0
  347. package/types/src/core/logger.d.ts +11 -0
  348. package/types/src/core/options.d.ts +34 -0
  349. package/types/src/core/pusher-with-encryption.d.ts +5 -0
  350. package/types/src/core/pusher.d.ts +49 -0
  351. package/types/src/core/reachability.d.ts +5 -0
  352. package/types/src/core/socket.d.ts +12 -0
  353. package/types/src/core/strategies/best_connected_ever_strategy.d.ts +10 -0
  354. package/types/src/core/strategies/delayed_strategy.d.ts +15 -0
  355. package/types/src/core/strategies/first_connected_strategy.d.ts +8 -0
  356. package/types/src/core/strategies/if_strategy.d.ts +10 -0
  357. package/types/src/core/strategies/sequential_strategy.d.ts +16 -0
  358. package/types/src/core/strategies/strategy.d.ts +6 -0
  359. package/types/src/core/strategies/strategy_builder.d.ts +5 -0
  360. package/types/src/core/strategies/strategy_options.d.ts +16 -0
  361. package/types/src/core/strategies/strategy_runner.d.ts +5 -0
  362. package/types/src/core/strategies/transport_strategy.d.ts +15 -0
  363. package/types/src/core/strategies/websocket_prioritized_cached_strategy.d.ts +20 -0
  364. package/types/src/core/timeline/level.d.ts +6 -0
  365. package/types/src/core/timeline/timeline.d.ts +25 -0
  366. package/types/src/core/timeline/timeline_sender.d.ts +13 -0
  367. package/types/src/core/timeline/timeline_transport.d.ts +6 -0
  368. package/types/src/core/transports/assistant_to_the_transport_manager.d.ts +14 -0
  369. package/types/src/core/transports/ping_delay_options.d.ts +6 -0
  370. package/types/src/core/transports/transport.d.ts +8 -0
  371. package/types/src/core/transports/transport_connection.d.ts +35 -0
  372. package/types/src/core/transports/transport_connection_options.d.ts +6 -0
  373. package/types/src/core/transports/transport_hooks.d.ts +13 -0
  374. package/types/src/core/transports/transport_manager.d.ts +14 -0
  375. package/types/src/core/transports/transports_table.d.ts +10 -0
  376. package/types/src/core/transports/url_scheme.d.ts +11 -0
  377. package/types/src/core/transports/url_schemes.d.ts +4 -0
  378. package/types/src/core/user.d.ts +21 -0
  379. package/types/src/core/util.d.ts +8 -0
  380. package/types/src/core/utils/collections.d.ts +18 -0
  381. package/types/src/core/utils/factory.d.ts +29 -0
  382. package/types/src/core/utils/flat_promise.d.ts +6 -0
  383. package/types/src/core/utils/timers/abstract_timer.d.ts +10 -0
  384. package/types/src/core/utils/timers/index.d.ts +9 -0
  385. package/types/src/core/utils/timers/scheduling.d.ts +8 -0
  386. package/types/src/core/utils/timers/timed_callback.d.ts +4 -0
  387. package/types/src/core/utils/url_store.d.ts +4 -0
  388. package/types/src/core/watchlist.d.ts +8 -0
  389. package/types/src/runtimes/interface.d.ts +43 -0
  390. package/types/src/runtimes/isomorphic/auth/xhr_auth.d.ts +3 -0
  391. package/types/src/runtimes/isomorphic/default_strategy.d.ts +5 -0
  392. package/types/src/runtimes/isomorphic/http/http.d.ts +3 -0
  393. package/types/src/runtimes/isomorphic/http/http_xhr_request.d.ts +3 -0
  394. package/types/src/runtimes/isomorphic/runtime.d.ts +2 -0
  395. package/types/src/runtimes/isomorphic/timeline/xhr_timeline.d.ts +6 -0
  396. package/types/src/runtimes/isomorphic/transports/transport_connection_initializer.d.ts +1 -0
  397. package/types/src/runtimes/isomorphic/transports/transports.d.ts +5 -0
  398. package/types/src/runtimes/node/net_info.d.ts +6 -0
  399. package/types/src/runtimes/node/runtime.d.ts +3 -0
  400. package/types/src/runtimes/react-native/net_info.d.ts +8 -0
  401. package/types/src/runtimes/react-native/runtime.d.ts +3 -0
  402. package/types/src/runtimes/web/auth/jsonp_auth.d.ts +3 -0
  403. package/types/src/runtimes/web/browser.d.ts +19 -0
  404. package/types/src/runtimes/web/default_strategy.d.ts +5 -0
  405. package/types/src/runtimes/web/dom/dependencies.d.ts +4 -0
  406. package/types/src/runtimes/web/dom/dependency_loader.d.ts +10 -0
  407. package/types/src/runtimes/web/dom/jsonp_request.d.ts +10 -0
  408. package/types/src/runtimes/web/dom/script_receiver.d.ts +7 -0
  409. package/types/src/runtimes/web/dom/script_receiver_factory.d.ts +10 -0
  410. package/types/src/runtimes/web/dom/script_request.d.ts +9 -0
  411. package/types/src/runtimes/web/http/http.d.ts +2 -0
  412. package/types/src/runtimes/web/http/http_xdomain_request.d.ts +3 -0
  413. package/types/src/runtimes/web/net_info.d.ts +7 -0
  414. package/types/src/runtimes/web/runtime.d.ts +3 -0
  415. package/types/src/runtimes/web/timeline/jsonp_timeline.d.ts +6 -0
  416. package/types/src/runtimes/web/transports/transport_connection_initializer.d.ts +1 -0
  417. package/types/src/runtimes/web/transports/transports.d.ts +2 -0
  418. package/types/src/runtimes/worker/auth/fetch_auth.d.ts +3 -0
  419. package/types/src/runtimes/worker/net_info.d.ts +6 -0
  420. package/types/src/runtimes/worker/runtime.d.ts +3 -0
  421. package/types/src/runtimes/worker/timeline/fetch_timeline.d.ts +6 -0
  422. package/webpack/config.node.js +26 -0
  423. package/webpack/config.react-native.js +35 -0
  424. package/webpack/config.shared.js +50 -0
  425. package/webpack/config.web.js +36 -0
  426. package/webpack/config.worker.js +42 -0
  427. package/webpack/dev.server.js +17 -0
  428. package/webpack/hosting_config.js +6 -0
  429. package/with-encryption/index.d.ts +29 -0
  430. package/with-encryption/index.js +4 -0
  431. package/worker/index.d.ts +29 -0
  432. package/worker/index.js +1 -0
  433. package/worker/with-encryption/index.d.ts +29 -0
  434. package/worker/with-encryption/index.js +1 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,924 @@
1
+ # Changelog
2
+
3
+ ## 8.3.0
4
+
5
+ - [CHANGED] Update cached re-connect strategy to prioritize WebSocket
6
+
7
+ ## 8.2.0
8
+
9
+ - [CHANGED] Remove WebSocket retry limit.
10
+
11
+ ## 8.1.0
12
+
13
+ - [CHANGED] Move @types dependencies to devDependencies
14
+ - [CHANGED] Upgrade typescript to 5.1.3
15
+
16
+ ## 8.0.2
17
+
18
+ - [CHANGED] Fix React Native support.
19
+
20
+ ## 8.0.1
21
+
22
+ - [FIXED] Fix 'window is not defined' error in the worker context
23
+ - [FIXED] Specify the right status when an error is thrown for the pusher worker instance
24
+
25
+ ## 8.0.0
26
+
27
+ - [CHANGED] Specifying a cluster when instantiating the Pusher object is now mandatory. An exception is thrown if the cluster setting is missing.
28
+
29
+ ## 7.6.0
30
+
31
+ - [ADDED] Introduce headersProvider and paramsProvider to channel authorization and user authentication in order to allow for changing header and param values after the Pusher object is initialized.
32
+
33
+ ## 7.5.0
34
+
35
+ - [ADDED] Watchlist Online Status
36
+
37
+ ## 7.4.1
38
+
39
+ - [CHANGED] Authorization error message.
40
+
41
+ ## 7.4.0
42
+
43
+ * [CHANGED] Use secure random generator instead of pseudo-random generator
44
+ * [CHANGED] Replace git protocol with HTTPS in gitsubmodules file
45
+ * [ADDED] Allow presence channel authorization to depend on user authentication
46
+
47
+ ## 7.3.0
48
+
49
+ * [FIXED] Restore previously exported types
50
+
51
+ ## 7.2.0
52
+
53
+ * [ADDED] Add support for subscription_count event
54
+
55
+ ## 7.1.1-beta
56
+
57
+ [FIXED] Exported Typescript types in index.d.ts
58
+
59
+ ## 7.1.0-beta
60
+
61
+ [ADDED] Support for authenticating users with the `signin` method
62
+
63
+ [ADDED] Support for binding to events sent to a specific authenticated user
64
+
65
+ [UPDATED] The initialization of the `Pusher` object has been changed. Two new parameters were introduced: `userAuthentication` and `channelAuthorization`.
66
+
67
+ [DEPRECATED] The Pusher object parameters `auth`, `authEndpoint`, and `authTransport` are still supported, but deprecated. They have been replaced with the `channelAuthorization` parameter.
68
+
69
+ ## 7.0.6
70
+
71
+ * [FIXED] pusher-js/worker can now be bundled and used in a web worker context
72
+
73
+ ## 7.0.5
74
+
75
+ * [FIXED] pusher-js/worker is now built by webpack with umd libraryTarget, which
76
+ allows it to be bundled as described in the README
77
+
78
+ ## 7.0.4
79
+
80
+ * [FIXED] References to nonexistent source map #570
81
+
82
+ ## 7.0.3 (2021-01-25)
83
+
84
+ [UPDATED] Bumped version of faye-websocket (used only by the node runtime) from
85
+ 0.9.4 to 0.11.3. Thanks to @Akhawais for the PR.
86
+
87
+ [UPDATED] Bumped version of @react-native-community/netinfo (used only by the
88
+ react-native runtime) from 4.1.1 to 5.9.7. Thanks to @Yinabled for the PR.
89
+
90
+ [ADDED] We were missing a react-native key in `package.json`. Thanks to @giaset
91
+ for the PR
92
+
93
+ [ADDED] Support for importing the worker builds (solving issue #499)
94
+
95
+ ## 7.0.2 (2020-11-26)
96
+
97
+ [FIXED] Removes `AuthInfo` type from react-native and with-encryption builds.
98
+ This type was removed everywhere else in v7.0.0. See [issue
99
+ 512](https://github.com/pusher/pusher-js/issues/512)
100
+
101
+ ## 7.0.1 (2020-11-02)
102
+
103
+ [FIXED] Channels no longer get stuck in the `subscriptionPending` state
104
+ after a failed request to an auth endpoint. [Fixes Issue
105
+ 255](https://github.com/pusher/pusher-js/issues/255)
106
+
107
+ ## 7.0.0 (2020-07-30)
108
+
109
+ [UPDATED] Type signatures for authorizer callback. Previously the authorizer
110
+ callback had 2 arguments, the first was a boolean indicating that the second
111
+ was an error. Switched for a more conventional `function(err, data)` signature.
112
+ **This is a breaking change, if you use a custom authorizer**
113
+
114
+ [UPDATED] Types of errors emitted on `pusher:subscription_error` events.
115
+ Previously this event just contained the status code the auth endpoint
116
+ returned. This was replaced with a (hopefully) more error object with a message
117
+ and a `status` key.
118
+ **This is a breaking change, if you depend on the status in the
119
+ `pusher:subscription_error` event**
120
+
121
+ [FIXED] Stop wrapping websocket errors multiple times. [Fixes issue
122
+ 464](https://github.com/pusher/pusher-js/issues/464)
123
+ **This might be a breaking change, if you depend on the structure of `'error'` events
124
+ emitted by `pusher.connection`**
125
+
126
+ [FIXED] Stop swallowing errors thrown by handlers on encrypted channels.
127
+ Previously errors thrown by handlers bound to encrypted channels were caught
128
+ and ignored. This was unintentional and undesirable. [Fixes Issue
129
+ 437](https://github.com/pusher/pusher-js/issues/437)
130
+
131
+ ## 6.0.3 (2020-05-14)
132
+
133
+ [FIXED] Added typescript declarations for the pusher-js/with-encryption build
134
+
135
+ [REMOVED] Unnecessary dummy tweetnacl types for react-native (thanks to
136
+ @dmitrybirin)
137
+
138
+ [UPDATED] Copyright years (thanks to @annzenkina)
139
+
140
+ ## 6.0.2 (2020-04-30)
141
+
142
+ [FIXED] React-native import broken in release 6.0.1
143
+
144
+ ## 6.0.1 (2020-04-30)
145
+
146
+ [CHANGED] Moved tweetnacl from `devDependencies` to `dependencies`. No
147
+ additional code is included in the bundle, but this gives the typescript
148
+ compiler access to the tweetnacl types
149
+
150
+ [FIXED] Typescript declarations for react-native. These were supposed to be
151
+ included in 6.0.0 but the commit was missed
152
+
153
+ ## 6.0.0 (2020-04-27)
154
+
155
+ [CHANGED] The default builds for web and worker no longer support encrypted
156
+ channels. To use encrypted channels in web/worker you must import
157
+ `pusher-js/with-encryption` or use the
158
+ `pusher-with-encryption.js`/`pusher-with-encryption.min.js` bundles
159
+
160
+ [CHANGED] `forceTLS` now defaults to `true`
161
+
162
+ [REMOVED] the `encrypted` option - this was deprecated in `4.3.0`. The library
163
+ defaults to TLS anyway. Setting `encrypted` to `false` will **NOT** change
164
+ behaviour
165
+
166
+ [FIXED] `activityTimeout` and `pongTimeout` options now work as described in
167
+ the docs.
168
+
169
+ [NEW] Typescript declarations for react-native
170
+
171
+ [NEW] Support for encrypted-channels in react-native and workers
172
+
173
+ ## 5.1.1 (2020-02-12)
174
+
175
+ [FIXED] An issue with typescript declarations which caused builds to fail on
176
+ typescript projects dependent on pusher-js
177
+
178
+ ## 5.1.0 (2020-02-11)
179
+
180
+ [NEW] Include typescript declarations
181
+
182
+ [CHANGED] Make stats opt in rather than opt out - Previously we sent some
183
+ metrics about connection strategies to stats.pusher.com by default, it could be
184
+ disabled by passing the `disableStats` option. This functionality is now off by
185
+ default and can be enabled by passing the `enableStats` option
186
+
187
+ [FIXED] An issue where local tests would hang for 300s if a browser wasn't
188
+ available
189
+
190
+ ## 5.0.3 (2019-11-18)
191
+
192
+ [NEW] Log a warning when there is an auth error
193
+
194
+ [CHANGED] Default logger now uses console.warn and console.error
195
+
196
+ [CHANGED] Improved log messages
197
+
198
+ ## 5.0.2 (2019-09-25)
199
+
200
+ [FIXED] Utilise new API for @react-native-community/netinfo suppressing
201
+ deprecation warnings
202
+
203
+ [CHANGED] output an ES6 module from typescript to allow webpack to optimise the
204
+ bundle more effectively (thanks to @stof for this change)
205
+
206
+ [CHANGED] Use prettier to format source
207
+
208
+ ## 5.0.1 (2019-09-02)
209
+
210
+ [FIXED] We no longer include an unnecessary Buffer polyfill in bundles
211
+
212
+ ## 5.0.0 (2019-07-19)
213
+
214
+ This is a major version bump but should only contain breaking change for
215
+ react-native users.
216
+
217
+ [CHANGED] The react-native build now assumes @react-native-community/netinfo is
218
+ available in the host project. This change was necessary since netinfo was
219
+ removed from react-native core.
220
+
221
+ [CHANGED] The reconnect strategy is no longer built with a DSL. This makes the
222
+ code much more easily optimised by the javascript engine and should improve
223
+ load times significantly. Thanks to @stof for his contribution.
224
+
225
+ [CHANGED] The project is now built with recent versions of webpack and
226
+ typescript. All other build deps were updated and the build process was
227
+ simplified.
228
+
229
+ [FIXED] An issue that broke encrypted channels in node has been resolved
230
+
231
+ [FIXED] Some consistently flaky tests were fixed and we switched to headless
232
+ browsers for test runs where possible (including in CI).
233
+
234
+ [CHANGED] The node dependencies are now bundled in the node dist file so that
235
+ web/react-native users don't need to install unnecessary dependencies
236
+
237
+ ## 4.4.0 (2019-02-14)
238
+
239
+ [NEW] Callbacks bound to client events on presence channels will be called with an extra argument containing the `user_id` of the message sender
240
+
241
+ [NEW] Warn when trying to trigger client-events to a channel that isn't subscribed
242
+
243
+ ## 4.3.1 (2018-09-03)
244
+
245
+ [FIXED] Honour protocol error codes received after connection succeeds
246
+
247
+ ## 4.3.0 (2018-08-13)
248
+
249
+ [NEW] This release adds support for end to end encrypted channels, a new feature for Channels. Read more [in our docs](https://pusher.com/docs/client_api_guide/client_encrypted_channels).
250
+
251
+ [DEPRECATED] Renamed `encrypted` option to `forceTLS` - `encrypted` will still work!
252
+
253
+ ## 4.2.2 (2018-01-04)
254
+
255
+ [FIXED] Do not warn about a missing cluster when the host is explicitly set.
256
+
257
+ [FIXED] Only log with a custom logger when configured (prevents double
258
+ logging).
259
+
260
+ [FIXED] Update React Native NetInfo usage due to deprecated modules.
261
+
262
+ [NEW] Add `wsPath` option (see README.md for details).
263
+
264
+ Many thanks to @sunweiyang, @rajivm and @WillSewell for their contributions!
265
+
266
+ ## 4.2.1 (2017-09-28)
267
+
268
+ [FIXED] Correct version numbers in file headers (v4.2.0 still showed 4.1.0).
269
+
270
+ ## 4.2.0 (2017-09-28)
271
+
272
+ [FIXED] Fixed an issue where pusher-js would not attempt to subscribe to
273
+ channels that were in the process of being subscribed to when the connection
274
+ failed.
275
+
276
+ [FIXED] Does not attempt to call `handlesActivityChecks` on an undefined
277
+ connection instance anymore. Fixes issues #82 and #233.
278
+
279
+ [NEW] More helpful error messages can now be logged, with URLs.
280
+
281
+ [CHANGED] Various improvements in README.md.
282
+
283
+ Many thanks to @hengwoon, @leesio, @juliangruber and Heng for their
284
+ contributions to this release!
285
+
286
+ ## 4.1.0 (2017-04-20)
287
+
288
+ [NEW] Enable custom authorizers. For more information,
289
+ [see here](https://github.com/pusher/pusher-js#authorizer-function).
290
+
291
+ [NEW] Send credentials with Fetch requests in workers.
292
+
293
+ [NEW] Replace main file with Node.js version and add new browser field. This
294
+ also makes `require('pusher-js')` work out of the box.
295
+
296
+ [FIXED] Change `.done` to `.then` in React Native.
297
+
298
+ [FIXED] Include minified files when installing with Bower.
299
+
300
+ [CHANGED] Change `pusher` to `socket` for instance names in the readme.
301
+
302
+ Many thanks to @ejlangev, @piperchester, @wawyed, @mgalgs, @jamesfisher,
303
+ @kubik369 & @mrbabbs for their contributions to this release!
304
+
305
+ ## 4.0.0 (2016-12-01)
306
+
307
+ New major version released due to breaking changes.
308
+
309
+ [CHANGED] rename bind_all to bind_global
310
+
311
+ [NEW] unbind_global to remove global bindings
312
+
313
+ [CHANGED] unbind_all now removes global bindings as well as event specific
314
+
315
+ [NEW] expose context to pusher level bindings
316
+
317
+ ## 3.2.4 (2016-10-29)
318
+
319
+ [FIXED] Subscriptions are reinstated correctly after a disconnection and
320
+ reconnection. Regression introduced in 3.2.3.
321
+
322
+ ## 3.2.3 (2016-10-22)
323
+
324
+ [NEW] Cancelled subscriptions are now re-instated on subsequent `subscribe`
325
+ calls, allowing arbitrary chains of `subscribe`/`unsubscribe` calls, where the
326
+ final method is always respected regardless of the timings.
327
+ See [PR 201](https://github.com/pusher/pusher-js/pull/201) for details.
328
+
329
+ ## 3.2.2 (2016-10-03)
330
+
331
+ [FIXED] Fix unsubscribe behaviour while subscription is pending (thanks to @hot-leaf-juice).
332
+
333
+ ## 3.2.1 (2016-08-02)
334
+
335
+ [FIXED] Removes instances of evalling for global scope in timers module.
336
+
337
+ ## 3.2.0 (2016-08-01)
338
+
339
+ [FIXED] CSP Issue with 3.1 in Chrome extension background context. #168
340
+
341
+ [FIXED] Stringifying circular JSON structures for React Native. #182
342
+
343
+ [NEW] Add a new global unbind method.
344
+
345
+ [INTERNAL] Uses webpack define plugin to specify the global for each runtime.
346
+
347
+ ## 3.1.0 (2016-05-08)
348
+
349
+ [NEW] New builds for ReactNative, NodeJS and Web Workers. The first two are available on NPM. The last is available as a download.
350
+
351
+ [FIXED] The library no longer swallows connected exceptions. (#105)
352
+
353
+ [FIXED] Callback removal issues in Safari 9 (#125 #129)
354
+
355
+ [CHANGED] Monkey-patching the DependencyLoader when self-hosting no longer supported. New steps in README.
356
+
357
+ [CHANGED] HTTP fallbacks are now included as part of the main file and are not therefore dynamically loaded.
358
+
359
+ [INTERNAL] Ported to TypeScript.
360
+
361
+ [INTERNAL] The library is split into a core directory and a runtimes directory to make a separation between platform-independent and platform-specific code.
362
+
363
+ [INTERNAL] Uses Webpack as a bundler.
364
+
365
+ [INTERNAL] Testing suites for NodeJS and workers.
366
+
367
+ [INTERNAL] TravisCI + Browserstack setup.
368
+
369
+ [INTERNAL] NodeJS and ReactNative builds use XMLHttpRequest polyfills for authorization and session timelines. Workers use the `fetch` API.
370
+
371
+ ## 3.1.0-pre
372
+
373
+ [NEW] Added Pusher.logToConsole to log to console as a short-hand for writing a Pusher.log function to do so
374
+
375
+ ## 3.0.0 (2015-04-23)
376
+
377
+ [NEW] Introduce package.json, pusher-js will be published on NPM !
378
+
379
+ [NEW] added header/footer for UMD, allows CommonJS loaders to use pusher-js
380
+
381
+ [CHANGED] Remove the Flash fallback
382
+
383
+ [FIXED] double-unsubscribe is now idempotent
384
+
385
+ [FIXED] Serve only distribution files via Bower
386
+
387
+ [INTERNAL] Cleaned up a lot of the build process, makes contributing easier
388
+
389
+ ## 2.2.4 (2015-02-13)
390
+
391
+ [FIXED] Dependency loader not using HTTPS for encrypted connections on pages loaded via HTTP
392
+
393
+ ## 2.2.3 (2014-09-10)
394
+
395
+ [FIXED] Wrong encoding of HTTP heartbeats
396
+
397
+ [FIXED] Missing httpPath parameter for sockjs transport
398
+
399
+ [FIXED] Auth query strings no longer start with `&`
400
+
401
+ ## 2.2.2 (2014-06-09)
402
+
403
+ [CHANGED] Updated the HTTPS CDN URL to `https://js.pusher.com`
404
+
405
+ ## 2.2.1 (2014-05-28)
406
+
407
+ [FIXED] Exception triggered by ping being sent when disconnected
408
+
409
+ ## 2.2.0 (2014-04-14)
410
+
411
+ No changes since 2.2.0-rc3, just changed the version number.
412
+
413
+ ## 2.2.0-rc3 (2014-03-26)
414
+
415
+ [NEW] Added third argument to the bind method on event emitters to allow binding of context to callbacks
416
+
417
+ [CHANGED] Changed the primary WebSocket fallback to WSS instead of HTTP
418
+
419
+ [FIXED] Exception when aborting timers, which caused infinite connection loop on IE8
420
+
421
+ ## 2.2.0-rc2 (2014-02-25)
422
+
423
+ [NEW] Dependency loader will retry fetching additional resources if they fail to load
424
+
425
+ [CHANGED] Refactored internals to reduce main file size by over 1KB
426
+
427
+ [CHANGED] Improved heartbeat handling for HTTP transports
428
+
429
+ [CHANGED] Removed wssHost and httpsHost options, reverted to a single domain regardless of encryption
430
+
431
+ [CHANGED] Added extra 1s to the cached transport timeout
432
+
433
+ [CHANGED] Updated the stats protocol
434
+
435
+ [FIXED] MozWebSocket is not assigned to WebSocket anymore
436
+
437
+ [FIXED] Socket listeners are always unbound after closing the connection
438
+
439
+ ## 2.2.0-rc1 (2014-01-14)
440
+
441
+ [NEW] XHR streaming and polling transports were extracted from SockJS
442
+
443
+ [NEW] Reduced the number of roundtrips required by HTTP streaming and polling transports for connecting from 3 to 1
444
+
445
+ [NEW] Refactored the connection strategy to be faster and more reliable for clients using HTTP
446
+
447
+ [NEW] Added new options - `wssHost` and `httpsHost` for encrypted connections
448
+
449
+ [NEW] HTTP streaming and polling are now supported on Opera
450
+
451
+ [CHANGED] Reduced the size of sockjs.js
452
+
453
+ [FIXED] Issue with SockJS streaming not being able to reconnect
454
+
455
+ ## 2.1.6 (2014-01-09)
456
+
457
+ [NEW] Ping on offline events to detect disconnections quicker
458
+
459
+ [CHANGED] Added an exception when handshake does not contain the activity timeout
460
+
461
+ [FIXED] Encrypted transports not being cached correctly
462
+
463
+ ## 2.1.5 (2013-12-16)
464
+
465
+ [NEW] Server can suggest a lower activity timeout in the handshake
466
+
467
+ [CHANGED] Updated the protocol to version 7
468
+
469
+ [CHANGED] Transports are cached separately for encrypted connections
470
+
471
+ [CHANGED] Updated the stats protocol
472
+
473
+ [FIXED] Removed the `Protocol` variable leaking into the global scope
474
+
475
+ [FIXED] Flash check was occasionally raising exceptions on old Firefox releases
476
+
477
+ ## 2.1.4 (2013-11-26)
478
+
479
+ [NEW] Added the `Pusher.prototype.allChannels` method
480
+
481
+ [NEW] Implemented the `enabledTransports` option
482
+
483
+ [NEW] Implemented the `disabledTransports` option
484
+
485
+ [CHANGED] Connections are not closed anymore after receiving an offline event
486
+
487
+ [CHANGED] Connections are still attempted, even if the browser indicates it's offline
488
+
489
+ [CHANGED] When not connected, an online event will trigger a new connection attempt immediately
490
+
491
+ [CHANGED] Updated the stats protocol
492
+
493
+ ## 2.1.3 (2013-10-21)
494
+
495
+ [CHANGED] Updated the json2 library
496
+
497
+ [FIXED] Catch exceptions when accessing localStorage and parsing its contents
498
+
499
+ [FIXED] Flush transport cache if it's corrupted
500
+
501
+ [FIXED] Stop raising exceptions when stats requests fail
502
+
503
+ [CHANGED] Don't report stats when offline
504
+
505
+ [CHANGED] Raise an error when trying to send a client event without the `client-` prefix
506
+
507
+ ## 2.1.2 (2013-08-09)
508
+
509
+ [FIXED] Race condition in SockJS heartbeats
510
+
511
+ [FIXED] Exception in dependency loader when a file happens to be loaded twice
512
+
513
+ [CHANGED] Improved metric reporting
514
+
515
+ ## 2.1.1 (2013-07-08)
516
+
517
+ [FIXED] Disable transports that raise protocol errors
518
+
519
+ [FIXED] Keep trying all transports if a handshake raises an error
520
+
521
+ [CHANGED] Send less verbose error and closed event logs to stats
522
+
523
+ [FIXED] Add missing `connecting_in` event
524
+
525
+ [FIXED] Catch exceptions raised when accessing `window.localStorage` in some environments
526
+
527
+ ## 2.1.0 (2013-06-17)
528
+
529
+ [NEW] Added support for clusters
530
+
531
+ [CHANGED] All configuration options can be passed to the Pusher constructor
532
+
533
+ [DEPRECATED] Global configuration options should not be used anymore
534
+
535
+ [FIXED] SockJS issues on some versions of Opera
536
+
537
+ ## 2.0.5 (2013-05-28)
538
+
539
+ [FIXED] Working connections being closed when a parallel handshake failed in a specific way
540
+
541
+ [CHANGED] Warnings are always sent to Pusher.log if it's available
542
+
543
+ [FIXED] Handshake errors not being emitted
544
+
545
+ [FIXED] Authorizing two connections simultaneously to the same channel using JSONP
546
+
547
+ [CHANGED] Sending more detailed connection logs
548
+
549
+ ## 2.0.4 (2013-04-26)
550
+
551
+ [FIXED] Exception when WebSocket was closed uncleanly immediately after opening
552
+
553
+ [FIXED] Removed SockJS exception when receiving a handshake after closing the connection
554
+
555
+ ## 2.0.3 (2013-04-24)
556
+
557
+ [CHANGED] Transports are now considered working only after getting an initial message
558
+
559
+ [NEW] Added `ignoreNullOrigin` flag to Pusher constructor to ignore null origin checks in SockJS for PhoneGap
560
+
561
+ [FIXED] Exceptions in private browsing mode on (Mobile) Safari while caching transport info
562
+
563
+ [FIXED] Unbinding callback that hasn't been bound caused removal of last registered callback
564
+
565
+ [FIXED] Exceptions while closing connections in Safari
566
+
567
+ ## 2.0.2 (2013-04-16)
568
+
569
+ [FIXED] WebSockets not being disabled after rapid, unclean disconnections
570
+
571
+ ## 2.0.1 (2013-04-11)
572
+
573
+ [FIXED] Issues with disabling Flash transport
574
+
575
+ [FIXED] Error while checking for Flash support in some environments
576
+
577
+ [FIXED] Race condition on disconnections and retries
578
+
579
+ [FIXED] Reporting errors when connection was closed correctly
580
+
581
+ ## 2.0.0 (2013-03-19)
582
+
583
+ [CHANGED] Completely redesigned connection strategy
584
+
585
+ [CHANGED] HTTP fallbacks (built using SockJS) are now used if WebSockets and Flash transports both fail to connect (previously only used if neither WebSockets nor Flash were supported)
586
+
587
+ [NEW] Connection metrics are now submitted to Pusher's stats service
588
+
589
+ [NEW] Added disableFlash boolean option to Pusher constructor
590
+
591
+ [CHANGED] Updated web-socket-js and sockjs-client libraries
592
+
593
+ [FIXED] Improved HTTP fallback reliability
594
+
595
+ ## 1.12.7 (2013-02-25)
596
+
597
+ [CHANGED] Various improvements and fixes for HTTP fallbacks
598
+
599
+ ## 1.12.6 (2013-02-19)
600
+
601
+ [CHANGED] Flash is now detected before fetching fallback files
602
+
603
+ [CHANGED] Empty app key are now raising warnings
604
+
605
+ [FIXED] Fixed local variable leak
606
+
607
+ [FIXED] Reconnecting caused pusher:subscription_succeeded to be emitted more than once
608
+
609
+ ## 1.12.5 (2012-10-31)
610
+
611
+ [CHANGED] Improved connection timeout strategy.
612
+
613
+ ## 1.12.4 (2012-10-08)
614
+
615
+ [NEW] Added experimental fallback used when Flash fallback fails.
616
+
617
+ ## 1.12.3 (2012-10-01)
618
+
619
+ [FIXED] Error when Flash fallback files are served cross-domain.
620
+
621
+ ## 1.12.2 (2012-07-18)
622
+
623
+ [FIXED] Issues with Flash fallback when port 843 is blocked.
624
+
625
+ [FIXED] Binding to events with names of Object's native methods.
626
+
627
+ ## 1.12.1 (2012-05-03)
628
+
629
+ [CHANGED] The error argument passed into `socket.onerror()` is included with the error emitted to the user.
630
+
631
+ [FIXED] impermanentlyClosing to impermanentlyClosing state machine transition.
632
+
633
+ ## 1.12.0 (2012-04-14)
634
+
635
+ [NEW] Use `channel.members.me` to get the id and info for the local presence user. See the docs for more information: http://pusher.com/docs
636
+
637
+ [NEW] Send extra headers and query parameters with the private/presence channel authentication requests sent to your server. This is useful for, amongst other things, frameworks that require cross-site request forgery validation. See the docs for more information: http://pusher.com/docs
638
+
639
+ [FIXED] `channel.subscribed` not set to `false` when `disconnect` event occurs on the connection.
640
+
641
+ [UPGRADE] The linked version of web-socket-js. This includes a switch to the WebSocket version defined in RFC 6455. For the full list of changes in web-socket-js, see <https://github.com/gimite/web-socket-js/compare/bb5797cad5244dc86410e35726ef886bbc49afe9...2ee87e910e92f2366d562efebbbec96349924df3>.
642
+
643
+ [REMOVED] `channel.members.add()`, `channel.members.remove()` and `channel.members.clear()`.
644
+
645
+ ## 1.11.2 (2012-03-15)
646
+
647
+ [FIXED] Mobile Safari crashing after receiving data on closed connection.
648
+
649
+ [FIXED] Attempt to transition from impermanentlyClosing to connected.
650
+
651
+ ## 1.11.1 (2012-03-09)
652
+
653
+ [NEW] Unit tests run twice as fast.
654
+
655
+ [CHANGED] The reconnection attempt following a dropped connection will happen a minimum of one second after the connection was previously established.
656
+
657
+ [FIXED] Calling connect after some failed connection attempts means the attempt to connect is delayed.
658
+
659
+ [FIXED] Connection closing after calling disconnect is not emitted to the developer.
660
+
661
+ ## 1.11.0 (2012-01-03)
662
+
663
+ [NEW] You can now unbind from an event.
664
+
665
+ [NEW] Internal errors are now logged with `console.error` if available. You can override this behaviour by modifying the `Pusher.warn` function.
666
+
667
+ [NEW] Warning logged to `console.error` in the following cases: no api key supplied to initialiser, authentication failure connecting to private/presence channel, attempt to connect using `ws://` for application which have designated themselves as secure only, or unexpected errors returned by Pusher.
668
+
669
+ [NEW] Stale connections between the Pusher client and server are now detected and re-established.
670
+
671
+ [CHANGED] You may no longer bind to pusher_internal events.
672
+
673
+ [REMOVED] Pusher.Channel.is_private
674
+
675
+ [REMOVED] Pusher.Channel.is_presence
676
+
677
+ ## 1.10.1 (2011-12-1)
678
+
679
+ [NEW] Changed `channel.trigger()` to return a boolean indicating whether the message was actually sent.
680
+
681
+ [NEW] Private and public channels now emit `pusher:subscription_succeeded` events. This is consistent with presence channels.
682
+
683
+ [CHANGED] Renamed the `subscription_error` event to `pusher:subscription_error`.
684
+
685
+ ## 1.9.6 (2011-11-16)
686
+
687
+ [FIXED] Issue in Mozilla Firefox 8, where making a connection to non-ssl websocket endpoint from a secure page results in a security exception.
688
+
689
+ ## 1.9.5 (2011-11-15)
690
+
691
+ [FIXED] NetInfo listening as to not clobber the window.ononline and window.onoffline variables. Fixes issue #9.
692
+
693
+ [FIXED] Loading of web-socket-js on Mozilla browsers with MozWebSocket, issue #10.
694
+
695
+ [UPGRADE] Test framework to run in most browsers (IE6+, FF3+, Opera 11.52+, Safari, Chrome). Includes various other improvements to tests and testing infrastructure.
696
+
697
+ [NEW] Smarter SSL only error detection. If a connection is closed by pusher with an error saying that the app is in SSL only mode, then we will now force all future connection attempts to use SSL.
698
+
699
+ [NEW] Added guards around the JSON.parse calls in the Ajax Authoriser for private and presence channels.
700
+
701
+ ## 1.9.4 (2011-09-12)
702
+
703
+ [FIX] Fixed bug which meant that presence channels only worked correctly when `user_info` was supplied. It's now possible to use presence channels without specifying `user_info` (`user_id` is required).
704
+
705
+ ## 1.9.3 (2011-08-19)
706
+
707
+ [FIX] Fixed JSON dependency loading properly, rather than bundling it always.
708
+
709
+ ## 1.9.2 (2011-08-04)
710
+
711
+ [NEW] Cleverer reconnection behaviour.
712
+
713
+ If Connection is connected and the window.ononffline event is fired, this indicates that the computer has lost its connection to the local router. In response, the Connection immediately closes the socket.
714
+
715
+ If Connection is disconnected and waiting to reattempt a connection, and the window.ononline event is fired, the Connection tries to connect immediately, rather than waiting for the current waiting period to elapse.
716
+
717
+ If the window is about to attempt a connection and the window.navigator.onLine variable is false, the Connection immediately goes to the unavailable state.
718
+
719
+ Note: window.ononline, window.onoffline and window.navigator.onLine are only supported by some browsers.
720
+
721
+ [NEW] If channel authentication AJAX request returns a status code that is not 200, a `subscription_error` event is triggered. The `subscription_error` can be bound to so that the library user can respond to the failure.
722
+
723
+ [FIX] Works with IE7 again, after being broken in 1.9.0.
724
+
725
+ [FIX] Traffic Light connection status demo works in installations of Firefox 3.6 without Firebug.
726
+
727
+ ## 1.9.1 (2011-07-18)
728
+
729
+ [FIX] Client events triggering fixed (broken by 1.9.0)
730
+
731
+ [FIX] Removed verbose logging of internal state machine transitions
732
+
733
+ ## 1.9.0 (2011-07-15)
734
+
735
+ [NEW] New API to allow binding to changes in connection state. See blog post for details.
736
+
737
+ [NEW] Support for Firefox 6 native WebSocket using MozWebSocket prefix
738
+
739
+ [REMOVED] Old connection state events: `pusher:connection_established`, `pusher:connection_failed`, `pusher:connection_disconnected`.
740
+
741
+ [CHANGED] Socket id now accessed via `pusher.connection.socket_id` rather than `pusher.socket_id`.
742
+
743
+ ## 1.8.6 (2011-08-19)
744
+
745
+ [NEW] Support for Firefox 6 native WebSocket using MozWebSocket prefix
746
+
747
+ ## 1.8.5 (2011-06-18)
748
+
749
+ [FIX] Fix the fact that member was being added to the global scope
750
+
751
+ [CHANGE] `Pusher.log` function now always receives a single string argument rather than multiple arguments, making it easier to use. If you want more control, you can over-ride `Pusher.debug`
752
+
753
+ ## 1.8.4 (2011-06-18)
754
+
755
+ [FIX] When using multiple presence channels concurrently, the members object for each channel now operates as expected
756
+
757
+ ## 1.8.3 (2011-04-19)
758
+
759
+ [FIX] Delay Pusher initialization until document.body is defined. This fixes an issue in Firefox < 4 & IE which occasionally caused a "document.body is null" error when loading the flash fallback.
760
+
761
+ [UPGRADE] Upgraded linked version of web-socket-js. Amongst other things this removes the dependency on FABridge and reduces the minified size of fallback dependencies by 13KB.
762
+ For the full list of changes in web-socket-js see <https://github.com/gimite/web-socket-js/compare/6640d9d806972ea1720a273d09e8919464bcd131...bb5797cad5244dc86410e35726ef886bbc49afe9>
763
+
764
+ ## 1.8.2 (2011-03-29)
765
+
766
+ [BUGFIX] When loaded onto a HTTPS page, load pusher dependencies from HTTPS.
767
+
768
+ ## 1.8.1 (2011-03-21)
769
+
770
+ [BUGFIX] Minor fix which could have allowed `member_removed` to be triggered with nil.
771
+
772
+ [CHANGE] Increased default connection timeout to reduce likelyhood of timeouts on first connection attempt. This is now configurable as `Pusher.connection_timeout`.
773
+
774
+ ## 1.8.0 (2011-02-10)
775
+
776
+ [NEW] Support triggering client events with new API
777
+
778
+ channel.trigger('client-myeventname', {
779
+ some: 'data'
780
+ })
781
+
782
+ [NEW] Support for new socket presence interface, and changed javascript API. The `subscription_succeeded` event now returns an iterator object:
783
+
784
+ presence_channel.bind('pusher:subscription_succeeded', function(members) {
785
+ members.each(function(member) {
786
+ console.log(member.id, member.info)
787
+ })
788
+ })
789
+
790
+ Also, the member object passed to `member_added` and `member_removed` now has attributes `id` and `info` rather than `user_id` and `user_info`.
791
+
792
+ [CHANGED] Improved javascript debug console logging.
793
+
794
+ ## 1.7.6 (2011-03-29)
795
+
796
+ [BUGFIX] When loaded onto a HTTPS page, load pusher dependencies from HTTPS [backported from 1.8.2].
797
+
798
+ ## 1.7.5 (2011-03-21)
799
+
800
+ [CHANGE] Increased default connection timeout to reduce likelyhood of timeouts on first connection attempt. This is now configurable as `Pusher.connection_timeout` [backported from 1.8.1].
801
+
802
+ ## 1.7.4 (2011-02-09)
803
+
804
+ [FIXED] Javascript error was raised in the case that neither native WebSockets nor Flash were available.
805
+
806
+ [FIXED] Updated linked version of web-socket-js, which fixes issue connecting from Android, allows connection attempts to timeout and retry correctly. For full details see <https://github.com/gimite/web-socket-js/compare/2776dcfbf7847a5e19505432d8d63f8814e37b52...6640d9d806972ea1720a273d09e8919464bcd131>
807
+
808
+ ## 1.7.3 (2011-02-01)
809
+
810
+ [FIXED] Pusher could fail to initialize in IE 7 & 8 when dependencies cached
811
+
812
+ ## 1.7.2 (2011-01-25)
813
+
814
+ [FIXED] pusher.min.js now loads minified rather than unminified dependencies.
815
+
816
+ [CHANGED] Using JBundle for bundling the distribution. This should not in any way affect the minified files, it just simplifies building them.
817
+
818
+ ## 1.7.1
819
+
820
+ Wrap timeout around connections so that silently hanging connections are retried.
821
+
822
+ More robust reconnection logic, with initially shorter reconnect delay, but with increasing backoff.
823
+
824
+ ## 1.7.0
825
+
826
+ Encrypted apps: apps can now be configured to connect via SSL only. There is a corresponding setting in your dashboard which will reject non encrypted connections.
827
+
828
+ var pusher = new Pusher('your-key', {
829
+ encrypted: true
830
+ })
831
+
832
+ Note that the second argument to the Pusher constructor for setting channel names has been removed. You should use `pusher.subscribe instead`. THIS NO LONGER WORKS:
833
+
834
+ var pusher = new Pusher('your-key', 'channel-name') # DOES NOT WORK
835
+
836
+ ## 1.6.4
837
+
838
+ JSONp support for presence and private channels
839
+
840
+ Configurable transport for channel auths. JSONp allows for cross-domain channel authorization (ie. embedable widgets)
841
+
842
+ Pusher.channel_auth_transport = 'jsonp';
843
+
844
+ The default is Ajax for backwards compatibility. Ajax mode POSTS to Pusher.channel_auth_endpoint, whereas JSONp GETs.
845
+
846
+ For JSONp to work, your server must wrap the response in the callback name provided as a query parameter. Ruby example (using Pusher Gem) and Rails:
847
+
848
+ auth = Pusher[channel_name].authenticate(params[:socket_id], {
849
+ :user_id => current_user.id,
850
+ :user_info => {:name => current_user.name}
851
+ })
852
+
853
+ render :text => params[:callback] + "(" + JSON.generate(auth) + ");"
854
+
855
+ ## 1.6.3
856
+
857
+ Fixed presence bug for removed duplicate members.
858
+
859
+ If I connect as the same user in different browser windows or tabs, clients should trigger remove that member from a channel's member list only when the last window/tab is closed.
860
+
861
+ See http://pusher.tenderapp.com/discussions/questions/11-presence-of-friends for discussion.
862
+
863
+ ## 1.6.2
864
+
865
+ Dynamically load Javascript and Flash dependencies only for browsers that need them. Including pusher.js will:
866
+
867
+ IE: require JSON2, require and activate Flash fallback.
868
+ Firefox 3.6x: require and activate Flash fallback
869
+ Chrome, Safari: don't require anything. These browsers already have WebSocket and JSON support.
870
+
871
+ This saves a lot of bandwidth and makes page loads faster.
872
+
873
+ ## 1.6
874
+
875
+ Initial Presence support. Subscribing to presence channels allows you to respond to people entering and leaving the channel in your UI, to show who is has a connection open. More documentation here: http://pusherapp.com/docs/presence.
876
+
877
+ ## 1.5
878
+
879
+ Updated the library to use a version of the swf file hosted by Pusher. This makes it more convenient to integrate and avoids version conflicts in future.
880
+
881
+ Add some full-stack integration tests that interact with the production Pusher environment.
882
+
883
+ ## 1.4.3
884
+
885
+ Trigger pusher:connection\_failed if no websocket is defined, allowing the event to work on iphones etc.
886
+
887
+ ## 1.4.2
888
+
889
+ * Removed switch\_to\_secure and switch\_to\_unsecure in favour of automatic failover to ssl
890
+ * Generate internal events pusher:connection\_disconnected and pusher:connection\_failed
891
+ * Responds to pusher:connection\_established preparing for deprecation of connection\_established
892
+
893
+ ## 1.4.1
894
+
895
+ Added switch\_to\_secure() and switch\_to\_unsecure() to enable ssl testing
896
+
897
+ ## 1.4
898
+
899
+ Add ability to bind events to a specific channel:
900
+
901
+ var server = new Pusher("API_KEY", "my-channel")
902
+ server.channel("my-channel").bind("my-event", function(data) {
903
+ // do something
904
+ })
905
+
906
+ ## 1.3
907
+
908
+ Add support for subscribing to private channels. Retrieves an authentication string via Ajax from your server - for more information view the docs: <http://pusherapp.com/docs/private_channels>
909
+
910
+ ## 1.2.1
911
+
912
+ Basic support for subscribing to multiple channels:
913
+
914
+ var server = new Pusher("API_KEY", "my-channel")
915
+ server.subscribe("another-channel")
916
+ server.unsubscribe("my-channel")
917
+
918
+ ## 1.2
919
+
920
+ Build a single Javascript file including all dependencies for Flash fallback and browsers that don't have a native JSON implementation.
921
+
922
+ ## 1
923
+
924
+ First release!