@cratis/arc 22.0.2 → 22.2.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.
- package/dist/cjs/queries/ObservableQueryFor.js +6 -1
- package/dist/cjs/queries/ObservableQueryFor.js.map +1 -1
- package/dist/cjs/queries/QueryInstanceCache.js +6 -6
- package/dist/cjs/queries/QueryInstanceCache.js.map +1 -1
- package/dist/cjs/queries/QueryResult.js +23 -4
- package/dist/cjs/queries/QueryResult.js.map +1 -1
- package/dist/cjs/queries/QueryResultWithState.js +20 -7
- package/dist/cjs/queries/QueryResultWithState.js.map +1 -1
- package/dist/cjs/queries/ServerSentEventHubConnection.js +120 -58
- package/dist/cjs/queries/ServerSentEventHubConnection.js.map +1 -1
- package/dist/cjs/queries/WebSocketHubConnection.js +121 -51
- package/dist/cjs/queries/WebSocketHubConnection.js.map +1 -1
- package/dist/esm/queries/IQueryResult.d.ts +1 -0
- package/dist/esm/queries/IQueryResult.d.ts.map +1 -1
- package/dist/esm/queries/ObservableQueryFor.d.ts.map +1 -1
- package/dist/esm/queries/ObservableQueryFor.js +6 -1
- package/dist/esm/queries/ObservableQueryFor.js.map +1 -1
- package/dist/esm/queries/QueryInstanceCache.d.ts +1 -1
- package/dist/esm/queries/QueryInstanceCache.d.ts.map +1 -1
- package/dist/esm/queries/QueryInstanceCache.js +6 -6
- package/dist/esm/queries/QueryInstanceCache.js.map +1 -1
- package/dist/esm/queries/QueryResult.d.ts +2 -0
- package/dist/esm/queries/QueryResult.d.ts.map +1 -1
- package/dist/esm/queries/QueryResult.js +23 -4
- package/dist/esm/queries/QueryResult.js.map +1 -1
- package/dist/esm/queries/QueryResultWithState.d.ts +3 -3
- package/dist/esm/queries/QueryResultWithState.d.ts.map +1 -1
- package/dist/esm/queries/QueryResultWithState.js +20 -7
- package/dist/esm/queries/QueryResultWithState.js.map +1 -1
- package/dist/esm/queries/ServerSentEventHubConnection.d.ts +11 -4
- package/dist/esm/queries/ServerSentEventHubConnection.d.ts.map +1 -1
- package/dist/esm/queries/ServerSentEventHubConnection.js +120 -58
- package/dist/esm/queries/ServerSentEventHubConnection.js.map +1 -1
- package/dist/esm/queries/WebSocketHubConnection.d.ts +13 -2
- package/dist/esm/queries/WebSocketHubConnection.d.ts.map +1 -1
- package/dist/esm/queries/WebSocketHubConnection.js +121 -51
- package/dist/esm/queries/WebSocketHubConnection.js.map +1 -1
- package/dist/esm/queries/for_ObservableQueryFor/when_performing/with_a_not_ready_result.d.ts +2 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_performing/with_a_not_ready_result.d.ts.map +1 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_performing/with_a_not_ready_result.js +34 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_performing/with_a_not_ready_result.js.map +1 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_and_sse_transport.js +26 -2
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_and_sse_transport.js.map +1 -1
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_disabled_and_sse_transport.js +60 -3
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_disabled_and_sse_transport.js.map +1 -1
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.d.ts +2 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.d.ts.map +1 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.js +83 -0
- package/dist/esm/queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.js.map +1 -0
- package/dist/esm/queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.d.ts +2 -0
- package/dist/esm/queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.d.ts.map +1 -0
- package/dist/esm/queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.js +22 -0
- package/dist/esm/queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.js.map +1 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.d.ts +2 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.d.ts.map +1 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.js +17 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.js.map +1 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.d.ts +2 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.d.ts.map +1 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.js +16 -0
- package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.js.map +1 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.d.ts +2 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.d.ts.map +1 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.js +19 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.js.map +1 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.d.ts +2 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.d.ts.map +1 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.js +19 -0
- package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_deferred_promise.d.ts +7 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_deferred_promise.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_deferred_promise.js +12 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_deferred_promise.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.d.ts +2 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.d.ts.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.js +15 -4
- package/dist/esm/queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.js.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.js +44 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.js +74 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_unsubscribed.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_unsubscribed.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_unsubscribed.js +74 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_unsubscribed.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_is_rejected.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_is_rejected.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_is_rejected.js +59 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_is_rejected.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_returns_non_ok.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_returns_non_ok.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_returns_non_ok.js +58 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_returns_non_ok.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_disposing/cleans_up_resources.js +6 -3
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_disposing/cleans_up_resources.js.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_receiving_unauthorized/notifies_subscriber_and_removes_subscription.js +23 -6
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_receiving_unauthorized/notifies_subscriber_and_removes_subscription.js.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_reconnecting/after_error.js +20 -5
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_reconnecting/after_error.js.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_reconnecting/and_an_immediate_open_wins_the_backoff_race.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_reconnecting/and_an_immediate_open_wins_the_backoff_race.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_reconnecting/and_an_immediate_open_wins_the_backoff_race.js +20 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_reconnecting/and_an_immediate_open_wins_the_backoff_race.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_replacing_a_subscription/ignores_messages_from_the_retired_generation.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_replacing_a_subscription/ignores_messages_from_the_retired_generation.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_replacing_a_subscription/ignores_messages_from_the_retired_generation.js +68 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_replacing_a_subscription/ignores_messages_from_the_retired_generation.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscribing/sends_subscribe_post.js +38 -13
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscribing/sends_subscribe_post.js.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscription_revisions_are_not_advertised/uses_legacy_protocol.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscription_revisions_are_not_advertised/uses_legacy_protocol.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscription_revisions_are_not_advertised/uses_legacy_protocol.js +54 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscription_revisions_are_not_advertised/uses_legacy_protocol.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_unsubscribing/the_only_query.js +18 -4
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_unsubscribing/the_only_query.js.map +1 -1
- package/dist/esm/queries/for_WebSocketHubConnection/when_receiving_unauthorized/notifies_subscriber_and_removes_subscription.js +22 -5
- package/dist/esm/queries/for_WebSocketHubConnection/when_receiving_unauthorized/notifies_subscriber_and_removes_subscription.js.map +1 -1
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/ignores_a_pending_reconnect_and_stale_socket_callbacks.d.ts +2 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/ignores_a_pending_reconnect_and_stale_socket_callbacks.d.ts.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/ignores_a_pending_reconnect_and_stale_socket_callbacks.js +108 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/ignores_a_pending_reconnect_and_stale_socket_callbacks.js.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/replaces_a_closing_socket_safely.d.ts +2 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/replaces_a_closing_socket_safely.d.ts.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/replaces_a_closing_socket_safely.js +33 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/replaces_a_closing_socket_safely.js.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/resubscribes_all_queries.js +26 -4
- package/dist/esm/queries/for_WebSocketHubConnection/when_reconnecting/resubscribes_all_queries.js.map +1 -1
- package/dist/esm/queries/for_WebSocketHubConnection/when_replacing_a_subscription/ignores_stale_result_unauthorized_and_error.d.ts +2 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_replacing_a_subscription/ignores_stale_result_unauthorized_and_error.d.ts.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_replacing_a_subscription/ignores_stale_result_unauthorized_and_error.js +62 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_replacing_a_subscription/ignores_stale_result_unauthorized_and_error.js.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_subscribing/to_a_query.js +18 -5
- package/dist/esm/queries/for_WebSocketHubConnection/when_subscribing/to_a_query.js.map +1 -1
- package/dist/esm/queries/for_WebSocketHubConnection/when_subscription_revisions_are_supported/upgrades_active_subscriptions_to_strict_mode.d.ts +2 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_subscription_revisions_are_supported/upgrades_active_subscriptions_to_strict_mode.d.ts.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_subscription_revisions_are_supported/upgrades_active_subscriptions_to_strict_mode.js +56 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_subscription_revisions_are_supported/upgrades_active_subscriptions_to_strict_mode.js.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/the_only_query.js +16 -3
- package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/the_only_query.js.map +1 -1
- package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/with_revision_support_not_advertised.d.ts +2 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/with_revision_support_not_advertised.d.ts.map +1 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/with_revision_support_not_advertised.js +33 -0
- package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/with_revision_support_not_advertised.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/queries/IQueryResult.ts +10 -0
- package/queries/ObservableQueryFor.ts +44 -16
- package/queries/QueryInstanceCache.ts +42 -19
- package/queries/QueryResult.ts +145 -79
- package/queries/QueryResultWithState.ts +32 -9
- package/queries/ServerSentEventHubConnection.ts +270 -83
- package/queries/WebSocketHubConnection.ts +188 -56
- package/queries/for_ObservableQueryFor/when_performing/with_a_not_ready_result.ts +46 -0
- package/queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_and_sse_transport.ts +91 -57
- package/queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_disabled_and_sse_transport.ts +125 -53
- package/queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.ts +107 -0
- package/queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.ts +63 -0
- package/queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.ts +25 -0
- package/queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.ts +24 -0
- package/queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.ts +28 -0
- package/queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.ts +25 -0
- package/queries/for_ServerSentEventHubConnection/given/a_deferred_promise.ts +15 -0
- package/queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.ts +18 -7
- package/queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.ts +59 -0
- package/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.ts +113 -0
- package/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_unsubscribed.ts +109 -0
- package/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_is_rejected.ts +81 -0
- package/queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_stale_request_returns_non_ok.ts +83 -0
- package/queries/for_ServerSentEventHubConnection/when_disposing/cleans_up_resources.ts +30 -21
- package/queries/for_ServerSentEventHubConnection/when_receiving_unauthorized/notifies_subscriber_and_removes_subscription.ts +56 -32
- package/queries/for_ServerSentEventHubConnection/when_reconnecting/after_error.ts +23 -6
- package/queries/for_ServerSentEventHubConnection/when_reconnecting/and_an_immediate_open_wins_the_backoff_race.ts +41 -0
- package/queries/for_ServerSentEventHubConnection/when_replacing_a_subscription/ignores_messages_from_the_retired_generation.ts +92 -0
- package/queries/for_ServerSentEventHubConnection/when_subscribing/sends_subscribe_post.ts +69 -30
- package/queries/for_ServerSentEventHubConnection/when_subscription_revisions_are_not_advertised/uses_legacy_protocol.ts +69 -0
- package/queries/for_ServerSentEventHubConnection/when_unsubscribing/the_only_query.ts +43 -24
- package/queries/for_WebSocketHubConnection/when_receiving_unauthorized/notifies_subscriber_and_removes_subscription.ts +53 -29
- package/queries/for_WebSocketHubConnection/when_reconnecting/ignores_a_pending_reconnect_and_stale_socket_callbacks.ts +131 -0
- package/queries/for_WebSocketHubConnection/when_reconnecting/replaces_a_closing_socket_safely.ts +39 -0
- package/queries/for_WebSocketHubConnection/when_reconnecting/resubscribes_all_queries.ts +72 -36
- package/queries/for_WebSocketHubConnection/when_replacing_a_subscription/ignores_stale_result_unauthorized_and_error.ts +88 -0
- package/queries/for_WebSocketHubConnection/when_subscribing/to_a_query.ts +54 -27
- package/queries/for_WebSocketHubConnection/when_subscription_revisions_are_supported/upgrades_active_subscriptions_to_strict_mode.ts +72 -0
- package/queries/for_WebSocketHubConnection/when_unsubscribing/the_only_query.ts +43 -18
- package/queries/for_WebSocketHubConnection/when_unsubscribing/with_revision_support_not_advertised.ts +44 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with_direct_mode_disabled_and_sse_transport.js","sourceRoot":"","sources":["../../../../../queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_disabled_and_sse_transport.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"with_direct_mode_disabled_and_sse_transport.js","sourceRoot":"","sources":["../../../../../queries/for_ObservableQueryFor/when_subscribing/with_direct_mode_disabled_and_sse_transport.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3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E,CAAC,CAAC,CAAC;IAEH,SAAS,gBAAgB;QACrB,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAc,CAE3D,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,EAAE;gBACvD,KAAK,EAAE,KAAK;aACf,CAAC,CAAC;QACP,CAAC;IACL,CAAC;IAED,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QAClD,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_web_socket_hub_payload_without_readiness.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import { given } from '../../../given';
|
|
3
|
+
import { Globals } from '../../../Globals';
|
|
4
|
+
import { HubMessageType } from '../../WebSocketHubConnection';
|
|
5
|
+
import { resetSharedMultiplexer } from '../../ObservableQueryMultiplexer';
|
|
6
|
+
import { QueryTransportMethod } from '../../QueryTransportMethod';
|
|
7
|
+
import { an_observable_query_for } from '../given/an_observable_query_for';
|
|
8
|
+
describe('when subscribing with web socket hub payload without readiness', given(an_observable_query_for, (context) => {
|
|
9
|
+
let callback;
|
|
10
|
+
let subscription;
|
|
11
|
+
let originalQueryDirectMode;
|
|
12
|
+
let originalTransportMethod;
|
|
13
|
+
let originalWebSocket;
|
|
14
|
+
let socket;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
originalQueryDirectMode = Globals.queryDirectMode;
|
|
17
|
+
originalTransportMethod = Globals.queryTransportMethod;
|
|
18
|
+
originalWebSocket = globalThis.WebSocket;
|
|
19
|
+
resetSharedMultiplexer();
|
|
20
|
+
Globals.queryDirectMode = false;
|
|
21
|
+
Globals.queryTransportMethod = QueryTransportMethod.WebSocket;
|
|
22
|
+
context.query.setOrigin('https://example.com');
|
|
23
|
+
callback = sinon.stub();
|
|
24
|
+
socket = {
|
|
25
|
+
readyState: 0,
|
|
26
|
+
onopen: null,
|
|
27
|
+
onclose: null,
|
|
28
|
+
onerror: null,
|
|
29
|
+
onmessage: null,
|
|
30
|
+
send: sinon.stub(),
|
|
31
|
+
close: sinon.stub(),
|
|
32
|
+
};
|
|
33
|
+
const WebSocketStub = sinon.stub().returns(socket);
|
|
34
|
+
Object.assign(WebSocketStub, {
|
|
35
|
+
CONNECTING: 0,
|
|
36
|
+
OPEN: 1,
|
|
37
|
+
CLOSING: 2,
|
|
38
|
+
CLOSED: 3,
|
|
39
|
+
});
|
|
40
|
+
globalThis['WebSocket'] = WebSocketStub;
|
|
41
|
+
subscription = context.query.subscribe(callback, { id: 'test-id' });
|
|
42
|
+
socket.readyState = 1;
|
|
43
|
+
socket.onopen?.();
|
|
44
|
+
let subscribeMessage;
|
|
45
|
+
try {
|
|
46
|
+
subscribeMessage = JSON.parse(socket.send.firstCall.args[0]);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
throw new Error('The WebSocket subscribe message was not valid JSON', {
|
|
50
|
+
cause: error,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
socket.onmessage?.({
|
|
54
|
+
data: JSON.stringify({
|
|
55
|
+
type: HubMessageType.QueryResult,
|
|
56
|
+
queryId: subscribeMessage.queryId,
|
|
57
|
+
payload: {
|
|
58
|
+
data: 'ready result',
|
|
59
|
+
isSuccess: true,
|
|
60
|
+
isAuthorized: true,
|
|
61
|
+
isValid: true,
|
|
62
|
+
hasExceptions: false,
|
|
63
|
+
validationResults: [],
|
|
64
|
+
exceptionMessages: [],
|
|
65
|
+
exceptionStackTrace: '',
|
|
66
|
+
paging: { page: 0, size: 0, totalItems: 0, totalPages: 0 },
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
afterEach(() => {
|
|
72
|
+
subscription?.unsubscribe();
|
|
73
|
+
Globals.queryDirectMode = originalQueryDirectMode;
|
|
74
|
+
Globals.queryTransportMethod = originalTransportMethod;
|
|
75
|
+
globalThis.WebSocket = originalWebSocket;
|
|
76
|
+
resetSharedMultiplexer();
|
|
77
|
+
sinon.restore();
|
|
78
|
+
});
|
|
79
|
+
it('should normalize omitted readiness to true', () => {
|
|
80
|
+
callback.firstCall.args[0].isReady.should.equal(true);
|
|
81
|
+
});
|
|
82
|
+
}));
|
|
83
|
+
//# sourceMappingURL=with_web_socket_hub_payload_without_readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_web_socket_hub_payload_without_readiness.js","sourceRoot":"","sources":["../../../../../queries/for_ObservableQueryFor/when_subscribing/with_web_socket_hub_payload_without_readiness.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE3E,QAAQ,CACJ,gEAAgE,EAChE,KAAK,CAAC,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE;IACvC,IAAI,QAAyB,CAAC;IAC9B,IAAI,YAAiD,CAAC;IACtD,IAAI,uBAAgC,C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,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_only_readiness_changed.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import { PagingInfo } from '../../PagingInfo';
|
|
3
|
+
import { QueryInstanceCache } from '../../QueryInstanceCache';
|
|
4
|
+
import { QueryResultWithState } from '../../QueryResultWithState';
|
|
5
|
+
describe('when setting the last result with only readiness changed', () => {
|
|
6
|
+
const key = 'MyQuery::';
|
|
7
|
+
const data = ['a', 'b'];
|
|
8
|
+
let listener;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
const cache = new QueryInstanceCache();
|
|
11
|
+
cache.getOrCreate(key, () => ({}));
|
|
12
|
+
listener = sinon.stub();
|
|
13
|
+
cache.addListener(key, listener);
|
|
14
|
+
cache.setLastResult(key, new QueryResultWithState(data, PagingInfo.noPaging, false, true, true, [], false, [], '', false, undefined, false));
|
|
15
|
+
listener.resetHistory();
|
|
16
|
+
cache.setLastResult(key, new QueryResultWithState(data, PagingInfo.noPaging, false, true, true, [], false, [], '', false, undefined, true));
|
|
17
|
+
});
|
|
18
|
+
afterEach(() => sinon.restore());
|
|
19
|
+
it('should notify the listener', () => listener.calledOnce.should.be.true);
|
|
20
|
+
it('should provide the changed readiness', () => listener.firstCall.args[0].isReady.should.be.true);
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=with_only_readiness_changed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_only_readiness_changed.js","sourceRoot":"","sources":["../../../../../queries/for_QueryInstanceCache/when_setting_last_result/with_only_readiness_changed.ts"],"names":[],"mappings":"AAGA,OAAO,KA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EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC3E,EAAE,CAAC,sCAAsC,EAAE,GAAG,EAAE,CAC5C,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_readiness_false.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { QueryResult } from '../../QueryResult';
|
|
2
|
+
describe('when constructing from a server result with readiness false', () => {
|
|
3
|
+
const result = new QueryResult({
|
|
4
|
+
data: null,
|
|
5
|
+
isSuccess: false,
|
|
6
|
+
isReady: false,
|
|
7
|
+
isAuthorized: true,
|
|
8
|
+
isValid: true,
|
|
9
|
+
hasExceptions: false,
|
|
10
|
+
validationResults: [],
|
|
11
|
+
exceptionMessages: [],
|
|
12
|
+
exceptionStackTrace: '',
|
|
13
|
+
paging: { page: 0, size: 0, totalItems: 0, totalPages: 0 },
|
|
14
|
+
}, Object, false);
|
|
15
|
+
it('should not be ready', () => result.isReady.should.be.false);
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=with_readiness_false.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_readiness_false.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_constructing_from_a_server_result/with_readiness_false.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,QAAQ,CAAC,6DAA6D,EAAE,GAAG,EAAE;IACzE,MAAM,MAAM,GAAG,IAAI,WAAW,CAC1B;QACI,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;KAC7D,EACD,MAAM,EACN,KAAK,CACR,CAAC;IAEF,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"without_readiness.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.ts"],"names":[],"mappings":""}
|
package/dist/esm/queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { QueryResult } from '../../QueryResult';
|
|
2
|
+
describe('when constructing from a server result without readiness', () => {
|
|
3
|
+
const result = new QueryResult({
|
|
4
|
+
data: {},
|
|
5
|
+
isSuccess: true,
|
|
6
|
+
isAuthorized: true,
|
|
7
|
+
isValid: true,
|
|
8
|
+
hasExceptions: false,
|
|
9
|
+
validationResults: [],
|
|
10
|
+
exceptionMessages: [],
|
|
11
|
+
exceptionStackTrace: '',
|
|
12
|
+
paging: { page: 0, size: 0, totalItems: 0, totalPages: 0 },
|
|
13
|
+
}, Object, false);
|
|
14
|
+
it('should be ready', () => result.isReady.should.be.true);
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=without_readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"without_readiness.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_constructing_from_a_server_result/without_readiness.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,QAAQ,CAAC,0DAA0D,EAAE,GAAG,EAAE;IACtE,MAAM,MAAM,GAAG,IAAI,WAAW,CAC1B;QACI,IAAI,EAAE,EAAE;QACR,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;KAC7D,EACD,MAAM,EACN,KAAK,CACR,CAAC;IAEF,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_readiness_false.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { QueryResult } from '../../QueryResult';
|
|
2
|
+
import { QueryResultWithState } from '../../QueryResultWithState';
|
|
3
|
+
describe('when creating from query result with readiness false', () => {
|
|
4
|
+
const queryResult = new QueryResult({
|
|
5
|
+
data: null,
|
|
6
|
+
isSuccess: false,
|
|
7
|
+
isReady: false,
|
|
8
|
+
isAuthorized: true,
|
|
9
|
+
isValid: true,
|
|
10
|
+
hasExceptions: false,
|
|
11
|
+
validationResults: [],
|
|
12
|
+
exceptionMessages: [],
|
|
13
|
+
exceptionStackTrace: '',
|
|
14
|
+
paging: { page: 0, size: 0, totalItems: 0, totalPages: 0 },
|
|
15
|
+
}, Object, false);
|
|
16
|
+
const result = QueryResultWithState.fromQueryResult(queryResult, false);
|
|
17
|
+
it('should not be ready', () => result.isReady.should.be.false);
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=with_readiness_false.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with_readiness_false.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/with_readiness_false.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,sDAAsD,EAAE,GAAG,EAAE;IAClE,MAAM,WAAW,GAAG,IAAI,WAAW,CAC/B;QACI,IAAI,EAAE,IAAI;QACV,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE;KAC7D,EACD,MAAM,EACN,KAAK,CACR,CAAC;IAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAExE,EAAE,CAAC,qBAAqB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACpE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"without_readiness.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PagingInfo } from '../../PagingInfo';
|
|
2
|
+
import { QueryResultWithState } from '../../QueryResultWithState';
|
|
3
|
+
describe('when creating from query result without readiness', () => {
|
|
4
|
+
const queryResult = {
|
|
5
|
+
data: 'ready result',
|
|
6
|
+
paging: PagingInfo.noPaging,
|
|
7
|
+
isSuccess: true,
|
|
8
|
+
isAuthorized: true,
|
|
9
|
+
isValid: true,
|
|
10
|
+
validationResults: [],
|
|
11
|
+
hasExceptions: false,
|
|
12
|
+
exceptionMessages: [],
|
|
13
|
+
exceptionStackTrace: '',
|
|
14
|
+
hasData: true,
|
|
15
|
+
};
|
|
16
|
+
const result = QueryResultWithState.fromQueryResult(queryResult, false);
|
|
17
|
+
it('should be ready', () => result.isReady.should.be.true);
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=without_readiness.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"without_readiness.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/without_readiness.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC/D,MAAM,WAAW,GAAyB;QACtC,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE,UAAU,CAAC,QAAQ;QAC3B,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,iBAAiB,EAAE,EAAE;QACrB,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,OAAO,EAAE,IAAI;KAChB,CAAC;IAEF,MAAM,MAAM,GAAG,oBAAoB,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAExE,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a_deferred_promise.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/given/a_deferred_promise.ts"],"names":[],"mappings":"AAGA,qBAAa,kBAAkB,CAAC,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAG,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,MAAM,EAAG,CAAC,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEpC,cAKC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"a_deferred_promise.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/given/a_deferred_promise.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,kBAAkB;IAClB,OAAO,CAAa;IAC7B,OAAO,CAAsB;IAC7B,MAAM,CAA8B;IAEpC;QACI,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -10,12 +10,13 @@ export declare class a_server_sent_event_hub_connection {
|
|
|
10
10
|
close: sinon.SinonStub;
|
|
11
11
|
readyState: number;
|
|
12
12
|
};
|
|
13
|
+
eventSources: Array<typeof this.fakeEventSource>;
|
|
13
14
|
policy: sinon.SinonStubbedInstance<IReconnectPolicy>;
|
|
14
15
|
fetchStub: sinon.SinonStub;
|
|
15
16
|
constructor();
|
|
16
17
|
setup(): void;
|
|
17
18
|
simulateOpen(): void;
|
|
18
|
-
simulateMessage(payload:
|
|
19
|
+
simulateMessage(payload: Record<string, unknown>): void;
|
|
19
20
|
simulateError(): void;
|
|
20
21
|
}
|
|
21
22
|
//# sourceMappingURL=a_server_sent_event_hub_connection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a_server_sent_event_hub_connection.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,wBAAwB,CAAC;AAI7E,qBAAa,kCAAkC;IAC3C,UAAU,EAAG,4BAA4B,CAAC;IAC1C,eAAe,EAAG;QACd,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;QAC5B,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;QAClD,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;QAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,MAAM,EAAG,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACtD,SAAS,EAAG,KAAK,CAAC,SAAS,CAAC;IAE5B,cAEC;IAOD,KAAK,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"a_server_sent_event_hub_connection.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAqB,MAAM,wBAAwB,CAAC;AAI7E,qBAAa,kCAAkC;IAC3C,UAAU,EAAG,4BAA4B,CAAC;IAC1C,eAAe,EAAG;QACd,MAAM,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;QAC5B,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;QAClD,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;QAC7B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;QACvB,UAAU,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,YAAY,EAAG,KAAK,CAAC,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC;IAClD,MAAM,EAAG,KAAK,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACtD,SAAS,EAAG,KAAK,CAAC,SAAS,CAAC;IAE5B,cAEC;IAOD,KAAK,IAAI,IAAI,CAgDZ;IAED,YAAY,IAAI,IAAI,CAGnB;IAED,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAItD;IAED,aAAa,IAAI,IAAI,CAEpB;CACJ"}
|
|
@@ -3,12 +3,14 @@ import { ServerSentEventHubConnection } from '../../ServerSentEventHubConnection
|
|
|
3
3
|
export class a_server_sent_event_hub_connection {
|
|
4
4
|
connection;
|
|
5
5
|
fakeEventSource;
|
|
6
|
+
eventSources;
|
|
6
7
|
policy;
|
|
7
8
|
fetchStub;
|
|
8
9
|
constructor() {
|
|
9
10
|
this.setup();
|
|
10
11
|
}
|
|
11
12
|
setup() {
|
|
13
|
+
this.eventSources = [];
|
|
12
14
|
this.fakeEventSource = {
|
|
13
15
|
onopen: null,
|
|
14
16
|
onmessage: null,
|
|
@@ -18,9 +20,16 @@ export class a_server_sent_event_hub_connection {
|
|
|
18
20
|
};
|
|
19
21
|
const self = this;
|
|
20
22
|
const FakeEventSourceClass = function () {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
const eventSource = {
|
|
24
|
+
onopen: null,
|
|
25
|
+
onmessage: null,
|
|
26
|
+
onerror: null,
|
|
27
|
+
close: sinon.stub(),
|
|
28
|
+
readyState: 0,
|
|
29
|
+
};
|
|
30
|
+
self.eventSources.push(eventSource);
|
|
31
|
+
self.fakeEventSource = eventSource;
|
|
32
|
+
return eventSource;
|
|
24
33
|
};
|
|
25
34
|
globalThis['EventSource'] = FakeEventSourceClass;
|
|
26
35
|
globalThis['EventSource'].CONNECTING = 0;
|
|
@@ -41,7 +50,9 @@ export class a_server_sent_event_hub_connection {
|
|
|
41
50
|
this.fakeEventSource.onopen?.();
|
|
42
51
|
}
|
|
43
52
|
simulateMessage(payload) {
|
|
44
|
-
this.fakeEventSource.onmessage?.({
|
|
53
|
+
this.fakeEventSource.onmessage?.({
|
|
54
|
+
data: JSON.stringify(payload),
|
|
55
|
+
});
|
|
45
56
|
}
|
|
46
57
|
simulateError() {
|
|
47
58
|
this.fakeEventSource.onerror?.();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a_server_sent_event_hub_connection.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAKlF,MAAM,OAAO,kCAAkC;IAC3C,UAAU,CAAgC;IAC1C,eAAe,CAMb;IACF,MAAM,CAAgD;IACtD,SAAS,CAAmB;IAE5B;QACI,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAOD,KAAK;QACD,IAAI,CAAC,eAAe,GAAG;YACnB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;YACnB,UAAU,EAAE,CAAC;SAChB,CAAC;QAGF,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,MAAM,oBAAoB,GAAG;YACzB,MAAM,
|
|
1
|
+
{"version":3,"file":"a_server_sent_event_hub_connection.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/given/a_server_sent_event_hub_connection.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAKlF,MAAM,OAAO,kCAAkC;IAC3C,UAAU,CAAgC;IAC1C,eAAe,CAMb;IACF,YAAY,CAAsC;IAClD,MAAM,CAAgD;IACtD,SAAS,CAAmB;IAE5B;QACI,IAAI,CAAC,KAAK,EAAE,CAAC;IACjB,CAAC;IAOD,KAAK;QACD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG;YACnB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;YACnB,UAAU,EAAE,CAAC;SAChB,CAAC;QAGF,MAAM,IAAI,GAAG,IAAI,CAAC;QAClB,MAAM,oBAAoB,GAAG;YACzB,MAAM,WAAW,GAAG;gBAChB,MAAM,EAAE,IAAI;gBACZ,SAAS,EAAE,IAAI;gBACf,OAAO,EAAE,IAAI;gBACb,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;gBACnB,UAAU,EAAE,CAAC;aAChB,CAAC;YACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YACpC,IAAI,CAAC,eAAe,GAAG,WAAW,CAAC;YACnC,OAAO,WAAW,CAAC;QACvB,CAAC,CAAC;QACD,UAAkB,CAAC,aAAa,CAAC,GAAG,oBAAoB,CAAC;QACzD,UAAkB,CAAC,aAAa,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;QACjD,UAAkB,CAAC,aAAa,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC;QAC3C,UAAkB,CAAC,aAAa,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;QAE9C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;QACpD,UAAkB,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC;QAE9C,IAAI,CAAC,MAAM,GAAG;YACV,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,KAAK,CAAC,IAAI,EAAwC,CAAC,OAAO,CAAC,IAAI,CAAC;YAC1E,KAAK,EAAE,KAAK,CAAC,IAAI,EAAE;YACnB,MAAM,EAAE,KAAK,CAAC,IAAI,EAAE;SACvB,CAAC;QAEF,IAAI,CAAC,UAAU,GAAG,IAAI,4BAA4B,CAC9C,sCAAsC,EACtC,gDAAgD,EAChD,kDAAkD,EAClD,EAAE,EACF,SAAS,EACT,SAAS,EACT,IAAI,CAAC,MAAM,CACd,CAAC;IACN,CAAC;IAED,YAAY;QACR,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,CAAC,CAAC;QACpC,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC;IACpC,CAAC;IAED,eAAe,CAAC,OAAgC;QAC5C,IAAI,CAAC,eAAe,CAAC,SAAS,EAAE,CAAC;YAC7B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAChB,CAAC,CAAC;IACvB,CAAC;IAED,aAAa;QACT,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;IACrC,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignores_connected_and_error_callbacks.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import { a_server_sent_event_hub_connection } from '../given/a_server_sent_event_hub_connection';
|
|
3
|
+
import { given } from '../../../given';
|
|
4
|
+
import { HubMessageType } from '../../WebSocketHubConnection';
|
|
5
|
+
describe('when a retired EventSource fires connected and error callbacks', given(a_server_sent_event_hub_connection, (context) => {
|
|
6
|
+
let staleMessage;
|
|
7
|
+
let staleError;
|
|
8
|
+
let currentSource;
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
context.setup();
|
|
11
|
+
sinon.stub(console, 'warn');
|
|
12
|
+
context.connection.subscribe('q1', { queryName: 'MyQuery' }, sinon.stub());
|
|
13
|
+
context.simulateOpen();
|
|
14
|
+
context.simulateMessage({
|
|
15
|
+
type: HubMessageType.Connected,
|
|
16
|
+
payload: 'connection-a',
|
|
17
|
+
});
|
|
18
|
+
const retiredSource = context.eventSources[0];
|
|
19
|
+
staleMessage = retiredSource.onmessage;
|
|
20
|
+
staleError = retiredSource.onerror;
|
|
21
|
+
staleError();
|
|
22
|
+
const reconnect = context.policy.schedule.firstCall
|
|
23
|
+
.args[0];
|
|
24
|
+
reconnect();
|
|
25
|
+
currentSource = context.eventSources[1];
|
|
26
|
+
context.simulateOpen();
|
|
27
|
+
context.simulateMessage({
|
|
28
|
+
type: HubMessageType.Connected,
|
|
29
|
+
payload: 'connection-b',
|
|
30
|
+
});
|
|
31
|
+
staleMessage({
|
|
32
|
+
data: JSON.stringify({
|
|
33
|
+
type: HubMessageType.Connected,
|
|
34
|
+
payload: 'stale-connection',
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
staleError();
|
|
38
|
+
});
|
|
39
|
+
afterEach(() => sinon.restore());
|
|
40
|
+
it('should not send another subscription for stale connected', () => context.fetchStub.callCount.should.equal(2));
|
|
41
|
+
it('should keep the current EventSource open', () => currentSource.close.called.should.be.false);
|
|
42
|
+
it('should not schedule another reconnect for stale error', () => context.policy.schedule.calledOnce.should.be.true);
|
|
43
|
+
}));
|
|
44
|
+
//# sourceMappingURL=ignores_connected_and_error_callbacks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ignores_connected_and_error_callbacks.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_a_retired_event_source_fires/ignores_connected_and_error_callbacks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AACjG,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,QAAQ,CACJ,gEAAgE,EAChE,KAAK,CAAC,kCAAkC,EAAE,CAAC,OAAO,EAAE,EAAE;IAClD,IAAI,YAA2C,CAAC;IAChD,IAAI,UAAsB,CAAC;IAC3B,IAAI,aAA6C,CAAC;IAElD,UAAU,CAAC,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3E,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,eAAe,CAAC;YACpB,IAAI,EAAE,cAAc,CAAC,SAAS;YAC9B,OAAO,EAAE,cAAc;SAC1B,CAAC,CAAC;QAEH,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC9C,YAAY,GAAG,aAAa,CAAC,SAAU,CAAC;QACxC,UAAU,GAAG,aAAa,CAAC,OAAQ,CAAC;QACpC,UAAU,EAAE,CAAC;QAEb,MAAM,SAAS,GAAI,OAAO,CAAC,MAAM,CAAC,QAA4B,CAAC,SAAS;aACnE,IAAI,CAAC,CAAC,CAAe,CAAC;QAC3B,SAAS,EAAE,CAAC;QACZ,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QACxC,OAAO,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,eAAe,CAAC;YACpB,IAAI,EAAE,cAAc,CAAC,SAAS;YAC9B,OAAO,EAAE,cAAc;SAC1B,CAAC,CAAC;QAEH,YAAY,CAAC;YACT,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACjB,IAAI,EAAE,cAAc,CAAC,SAAS;gBAC9B,OAAO,EAAE,kBAAkB;aAC9B,CAAC;SACW,CAAC,CAAC;QACnB,UAAU,EAAE,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAEjC,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE,CAChE,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE,CAChD,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAChD,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE,CAC5D,OAAO,CAAC,MAAM,CAAC,QAA4B,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AAChF,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"and_the_query_is_replaced.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import { a_deferred_promise } from '../given/a_deferred_promise';
|
|
3
|
+
import { a_server_sent_event_hub_connection } from '../given/a_server_sent_event_hub_connection';
|
|
4
|
+
import { given } from '../../../given';
|
|
5
|
+
import { HubMessageType } from '../../WebSocketHubConnection';
|
|
6
|
+
describe('when a query is replaced while its subscribe request is in flight and the connection changes', given(a_server_sent_event_hub_connection, (context) => {
|
|
7
|
+
const queryId = 'q1';
|
|
8
|
+
const replacementRequest = { queryName: 'ReplacementQuery' };
|
|
9
|
+
let clock;
|
|
10
|
+
let originalCallback;
|
|
11
|
+
let replacementCallback;
|
|
12
|
+
beforeEach(async () => {
|
|
13
|
+
context.setup();
|
|
14
|
+
clock = sinon.useFakeTimers({ toFake: ['setTimeout'] });
|
|
15
|
+
sinon.stub(console, 'warn');
|
|
16
|
+
const firstSubscribe = new a_deferred_promise();
|
|
17
|
+
context.fetchStub.onFirstCall().returns(firstSubscribe.promise);
|
|
18
|
+
originalCallback = sinon.stub();
|
|
19
|
+
replacementCallback = sinon.stub();
|
|
20
|
+
context.connection.subscribe(queryId, { queryName: 'OriginalQuery' }, originalCallback);
|
|
21
|
+
context.simulateOpen();
|
|
22
|
+
context.simulateMessage({
|
|
23
|
+
type: HubMessageType.Connected,
|
|
24
|
+
payload: 'connection-a',
|
|
25
|
+
supportsSubscriptionRevisions: true,
|
|
26
|
+
});
|
|
27
|
+
context.connection.subscribe(queryId, replacementRequest, replacementCallback);
|
|
28
|
+
context.simulateMessage({
|
|
29
|
+
type: HubMessageType.Connected,
|
|
30
|
+
payload: 'connection-b',
|
|
31
|
+
supportsSubscriptionRevisions: true,
|
|
32
|
+
});
|
|
33
|
+
firstSubscribe.resolve({ ok: false, status: 404 });
|
|
34
|
+
await Promise.resolve();
|
|
35
|
+
clock.tick(1000);
|
|
36
|
+
await Promise.resolve();
|
|
37
|
+
context.simulateMessage({
|
|
38
|
+
type: HubMessageType.QueryResult,
|
|
39
|
+
queryId,
|
|
40
|
+
revision: getSubscribeBody(2).revision,
|
|
41
|
+
payload: { isSuccess: true },
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
afterEach(() => {
|
|
45
|
+
clock.restore();
|
|
46
|
+
sinon.restore();
|
|
47
|
+
});
|
|
48
|
+
it('should send only the replacement on connection B', () => {
|
|
49
|
+
const body = getSubscribeBody(2);
|
|
50
|
+
body.connectionId.should.equal('connection-b');
|
|
51
|
+
body.queryId.should.equal(queryId);
|
|
52
|
+
body.request.should.deep.equal(replacementRequest);
|
|
53
|
+
body.revision.should.be.greaterThan(0);
|
|
54
|
+
});
|
|
55
|
+
it('should not retry the obsolete subscription', () => context.fetchStub.callCount.should.equal(3));
|
|
56
|
+
it('should notify only the replacement callback', () => {
|
|
57
|
+
originalCallback.called.should.equal(false);
|
|
58
|
+
replacementCallback.calledOnce.should.equal(true);
|
|
59
|
+
});
|
|
60
|
+
it('should not reconnect', () => context.policy.schedule.called.should.be.false);
|
|
61
|
+
it('should retain one active subscription', () => context.connection.queryCount.should.equal(1));
|
|
62
|
+
function getSubscribeBody(callIndex) {
|
|
63
|
+
const rawBody = context.fetchStub.getCall(callIndex).args[1].body;
|
|
64
|
+
try {
|
|
65
|
+
return JSON.parse(rawBody);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
throw new Error('Expected a valid subscribe request body', {
|
|
69
|
+
cause: error,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}));
|
|
74
|
+
//# sourceMappingURL=and_the_query_is_replaced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"and_the_query_is_replaced.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_replaced.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO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AO,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEjD,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACnD,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC5C,mBAAmB,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAC3B,OAAO,CAAC,MAAM,CAAC,QAA4B,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAEzE,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE,CAC7C,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnD,SAAS,gBAAgB,CAAC,SAAiB;QAMvC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAc,CAAC;QAC5E,IAAI,CAAC;YACD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAKxB,CAAC;QACN,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,EAAE;gBACvD,KAAK,EAAE,KAAK;aACf,CAAC,CAAC;QACP,CAAC;IACL,CAAC;AACL,CAAC,CAAC,CACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"and_the_query_is_unsubscribed.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_connection_changes_while_subscribe_is_in_flight/and_the_query_is_unsubscribed.ts"],"names":[],"mappings":""}
|