@cratis/arc 20.1.4 → 20.1.5
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/HubConnectionKeepAlive.d.ts +2 -1
- package/dist/cjs/queries/HubConnectionKeepAlive.d.ts.map +1 -1
- package/dist/cjs/queries/HubConnectionKeepAlive.js +4 -2
- package/dist/cjs/queries/HubConnectionKeepAlive.js.map +1 -1
- package/dist/cjs/queries/ReconnectPolicy.d.ts.map +1 -1
- package/dist/cjs/queries/ReconnectPolicy.js +1 -0
- package/dist/cjs/queries/ReconnectPolicy.js.map +1 -1
- package/dist/cjs/queries/ServerSentEventHubConnection.d.ts.map +1 -1
- package/dist/cjs/queries/ServerSentEventHubConnection.js +10 -3
- package/dist/cjs/queries/ServerSentEventHubConnection.js.map +1 -1
- package/dist/cjs/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.d.ts +2 -0
- package/dist/cjs/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.d.ts.map +1 -0
- package/dist/cjs/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.d.ts +2 -0
- package/dist/cjs/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.d.ts.map +1 -0
- package/dist/cjs/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.d.ts +2 -0
- package/dist/cjs/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.d.ts.map +1 -0
- package/dist/esm/queries/HubConnectionKeepAlive.d.ts +2 -1
- package/dist/esm/queries/HubConnectionKeepAlive.d.ts.map +1 -1
- package/dist/esm/queries/HubConnectionKeepAlive.js +4 -2
- package/dist/esm/queries/HubConnectionKeepAlive.js.map +1 -1
- package/dist/esm/queries/ReconnectPolicy.d.ts.map +1 -1
- package/dist/esm/queries/ReconnectPolicy.js +1 -0
- package/dist/esm/queries/ReconnectPolicy.js.map +1 -1
- package/dist/esm/queries/ServerSentEventHubConnection.d.ts.map +1 -1
- package/dist/esm/queries/ServerSentEventHubConnection.js +10 -3
- package/dist/esm/queries/ServerSentEventHubConnection.js.map +1 -1
- package/dist/esm/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.d.ts +2 -0
- package/dist/esm/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.d.ts.map +1 -0
- package/dist/esm/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.js +33 -0
- package/dist/esm/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.js.map +1 -0
- package/dist/esm/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.d.ts +2 -0
- package/dist/esm/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.d.ts.map +1 -0
- package/dist/esm/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.js +24 -0
- package/dist/esm/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.js.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_keep_alive_is_idle/triggers_reconnect.js +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_keep_alive_is_idle/triggers_reconnect.js.map +1 -1
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.d.ts +2 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.d.ts.map +1 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.js +33 -0
- package/dist/esm/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.js.map +1 -0
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/queries/HubConnectionKeepAlive.ts +20 -6
- package/queries/ReconnectPolicy.ts +4 -0
- package/queries/ServerSentEventHubConnection.ts +17 -4
- package/queries/for_HubConnectionKeepAlive/when_started_with_custom_idle_threshold/respects_threshold.ts +46 -0
- package/queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.ts +36 -0
- package/queries/for_ServerSentEventHubConnection/when_keep_alive_is_idle/triggers_reconnect.ts +5 -2
- package/queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.ts +51 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancels_previous_timer.js","sourceRoot":"","sources":["../../../../../../queries/for_ReconnectPolicy/when_scheduling/and_rescheduled_before_first_fires/cancels_previous_timer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAE3D,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAChE,IAAI,MAAuB,CAAC;IAC5B,IAAI,KAA4B,CAAC;IACjC,IAAI,aAA8B,CAAC;IACnC,IAAI,cAA+B,CAAC;IAEpC,UAAU,CAAC,GAAG,EAAE;QACZ,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QAC9B,MAAM,GAAG,IAAI,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACpD,aAAa,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,cAAc,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAE9B,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAExC,MAAM,CAAC,QAAQ,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QAK1C,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IAClG,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACvF,CAAC,CAAC,CAAC"}
|
|
@@ -13,7 +13,7 @@ describe('when keep-alive interval elapses without any server message', given(a_
|
|
|
13
13
|
context.connection.subscribe('q1', { queryName: 'MyQuery' }, sinon.stub());
|
|
14
14
|
context.simulateOpen();
|
|
15
15
|
context.simulateMessage({ type: HubMessageType.Connected, payload: 'conn-123' });
|
|
16
|
-
clock.tick(KEEP_ALIVE_MS + 1);
|
|
16
|
+
clock.tick(KEEP_ALIVE_MS * 2 + 1);
|
|
17
17
|
});
|
|
18
18
|
afterEach(() => {
|
|
19
19
|
clock.restore();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggers_reconnect.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_keep_alive_is_idle/triggers_reconnect.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,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,QAAQ,CAAC,6DAA6D,EAAE,KAAK,CAAC,kCAAkC,EAAE,OAAO,CAAC,EAAE;IACxH,IAAI,KAA4B,CAAC;IAEjC,UAAU,CAAC,GAAG,EAAE;QACZ,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,EAAE,CAAC;QAGhB,MAAM,EAAE,4BAA4B,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;QACvF,OAAO,CAAC,UAAU,GAAG,IAAI,4BAA4B,CACjD,sCAAsC,EACtC,gDAAgD,EAChD,kDAAkD,EAClD,EAAE,EACF,aAAa,EACb,KAAK,EACL,OAAO,CAAC,MAAM,CACjB,CAAC;QAEF,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;QAGvB,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"triggers_reconnect.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_keep_alive_is_idle/triggers_reconnect.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,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B,QAAQ,CAAC,6DAA6D,EAAE,KAAK,CAAC,kCAAkC,EAAE,OAAO,CAAC,EAAE;IACxH,IAAI,KAA4B,CAAC;IAEjC,UAAU,CAAC,GAAG,EAAE;QACZ,KAAK,GAAG,KAAK,CAAC,aAAa,EAAE,CAAC;QAC9B,OAAO,CAAC,KAAK,EAAE,CAAC;QAGhB,MAAM,EAAE,4BAA4B,EAAE,GAAG,OAAO,CAAC,oCAAoC,CAAC,CAAC;QACvF,OAAO,CAAC,UAAU,GAAG,IAAI,4BAA4B,CACjD,sCAAsC,EACtC,gDAAgD,EAChD,kDAAkD,EAClD,EAAE,EACF,aAAa,EACb,KAAK,EACL,OAAO,CAAC,MAAM,CACjB,CAAC;QAEF,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;QAGvB,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,EAAE,cAAc,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;QAMjF,KAAK,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;QACjD,OAAO,CAAC,MAAM,CAAC,QAA4B,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"and_subscribe_post_fails.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 subscribe POST returns a non-OK status', given(a_server_sent_event_hub_connection, context => {
|
|
6
|
+
beforeEach(async () => {
|
|
7
|
+
context.setup();
|
|
8
|
+
context.fetchStub.resolves({ ok: false, status: 404 });
|
|
9
|
+
context.connection.subscribe('q1', { queryName: 'MyQuery' }, sinon.stub());
|
|
10
|
+
context.simulateOpen();
|
|
11
|
+
context.simulateMessage({ type: HubMessageType.Connected, payload: 'conn-abc' });
|
|
12
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
13
|
+
});
|
|
14
|
+
afterEach(() => sinon.restore());
|
|
15
|
+
it('should schedule a reconnect via the policy', () => {
|
|
16
|
+
context.policy.schedule.calledOnce.should.be.true;
|
|
17
|
+
});
|
|
18
|
+
}));
|
|
19
|
+
describe('when subscribe POST rejects with a network error', given(a_server_sent_event_hub_connection, context => {
|
|
20
|
+
beforeEach(async () => {
|
|
21
|
+
context.setup();
|
|
22
|
+
context.fetchStub.rejects(new Error('Network error'));
|
|
23
|
+
context.connection.subscribe('q1', { queryName: 'MyQuery' }, sinon.stub());
|
|
24
|
+
context.simulateOpen();
|
|
25
|
+
context.simulateMessage({ type: HubMessageType.Connected, payload: 'conn-abc' });
|
|
26
|
+
await new Promise(resolve => setTimeout(resolve, 0));
|
|
27
|
+
});
|
|
28
|
+
afterEach(() => sinon.restore());
|
|
29
|
+
it('should schedule a reconnect via the policy', () => {
|
|
30
|
+
context.policy.schedule.calledOnce.should.be.true;
|
|
31
|
+
});
|
|
32
|
+
}));
|
|
33
|
+
//# sourceMappingURL=and_subscribe_post_fails.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"and_subscribe_post_fails.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_subscribing/and_subscribe_post_fails.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,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