@cratis/arc 20.4.0 → 20.4.2

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 (131) hide show
  1. package/dist/cjs/queries/ObservableQueryConnection.d.ts.map +1 -1
  2. package/dist/cjs/queries/ObservableQueryConnection.js +1 -1
  3. package/dist/cjs/queries/ObservableQueryConnection.js.map +1 -1
  4. package/dist/cjs/queries/QueryResult.js +1 -1
  5. package/dist/cjs/queries/QueryResult.js.map +1 -1
  6. package/dist/cjs/queries/QueryResultWithState.js +3 -3
  7. package/dist/cjs/queries/QueryResultWithState.js.map +1 -1
  8. package/dist/cjs/queries/ServerSentEventHubConnection.d.ts.map +1 -1
  9. package/dist/cjs/queries/ServerSentEventHubConnection.js +6 -1
  10. package/dist/cjs/queries/ServerSentEventHubConnection.js.map +1 -1
  11. package/dist/cjs/queries/WebSocketHubConnection.d.ts.map +1 -1
  12. package/dist/cjs/queries/WebSocketHubConnection.js +7 -1
  13. package/dist/cjs/queries/WebSocketHubConnection.js.map +1 -1
  14. package/dist/cjs/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.d.ts +21 -0
  15. package/dist/cjs/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.d.ts.map +1 -0
  16. package/dist/cjs/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.d.ts +2 -0
  17. package/dist/cjs/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.d.ts.map +1 -0
  18. package/dist/cjs/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.d.ts +2 -0
  19. package/dist/cjs/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.d.ts.map +1 -0
  20. package/dist/cjs/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.d.ts +2 -0
  21. package/dist/cjs/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.d.ts.map +1 -0
  22. package/dist/cjs/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.d.ts +2 -0
  23. package/dist/cjs/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.d.ts.map +1 -0
  24. package/dist/cjs/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.d.ts +2 -0
  25. package/dist/cjs/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.d.ts.map +1 -0
  26. package/dist/cjs/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.d.ts +2 -0
  27. package/dist/cjs/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.d.ts.map +1 -0
  28. package/dist/cjs/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.d.ts +2 -0
  29. package/dist/cjs/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.d.ts.map +1 -0
  30. package/dist/cjs/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.d.ts +2 -0
  31. package/dist/cjs/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.d.ts.map +1 -0
  32. package/dist/cjs/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.d.ts +2 -0
  33. package/dist/cjs/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.d.ts.map +1 -0
  34. package/dist/cjs/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.d.ts +2 -0
  35. package/dist/cjs/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.d.ts.map +1 -0
  36. package/dist/cjs/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.d.ts +2 -0
  37. package/dist/cjs/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.d.ts.map +1 -0
  38. package/dist/cjs/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.d.ts +2 -0
  39. package/dist/cjs/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.d.ts.map +1 -0
  40. package/dist/cjs/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.d.ts +2 -0
  41. package/dist/cjs/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.d.ts.map +1 -0
  42. package/dist/esm/queries/ObservableQueryConnection.d.ts.map +1 -1
  43. package/dist/esm/queries/ObservableQueryConnection.js +1 -1
  44. package/dist/esm/queries/ObservableQueryConnection.js.map +1 -1
  45. package/dist/esm/queries/QueryResult.js +1 -1
  46. package/dist/esm/queries/QueryResult.js.map +1 -1
  47. package/dist/esm/queries/QueryResultWithState.js +3 -3
  48. package/dist/esm/queries/QueryResultWithState.js.map +1 -1
  49. package/dist/esm/queries/ServerSentEventHubConnection.d.ts.map +1 -1
  50. package/dist/esm/queries/ServerSentEventHubConnection.js +6 -1
  51. package/dist/esm/queries/ServerSentEventHubConnection.js.map +1 -1
  52. package/dist/esm/queries/WebSocketHubConnection.d.ts.map +1 -1
  53. package/dist/esm/queries/WebSocketHubConnection.js +7 -1
  54. package/dist/esm/queries/WebSocketHubConnection.js.map +1 -1
  55. package/dist/esm/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.d.ts +21 -0
  56. package/dist/esm/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.d.ts.map +1 -0
  57. package/dist/esm/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.js +35 -0
  58. package/dist/esm/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.js.map +1 -0
  59. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.d.ts +2 -0
  60. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.d.ts.map +1 -0
  61. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.js +37 -0
  62. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.js.map +1 -0
  63. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.d.ts +2 -0
  64. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.d.ts.map +1 -0
  65. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.js +36 -0
  66. package/dist/esm/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.js.map +1 -0
  67. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.d.ts +2 -0
  68. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.d.ts.map +1 -0
  69. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.js +23 -0
  70. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.js.map +1 -0
  71. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.d.ts +2 -0
  72. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.d.ts.map +1 -0
  73. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.js +23 -0
  74. package/dist/esm/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.js.map +1 -0
  75. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.d.ts +2 -0
  76. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.d.ts.map +1 -0
  77. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.js +9 -0
  78. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.js.map +1 -0
  79. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.d.ts +2 -0
  80. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.d.ts.map +1 -0
  81. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.js +9 -0
  82. package/dist/esm/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.js.map +1 -0
  83. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.d.ts +2 -0
  84. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.d.ts.map +1 -0
  85. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.js +25 -0
  86. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.js.map +1 -0
  87. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.d.ts +2 -0
  88. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.d.ts.map +1 -0
  89. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.js +25 -0
  90. package/dist/esm/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.js.map +1 -0
  91. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.d.ts +2 -0
  92. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.d.ts.map +1 -0
  93. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.js +9 -0
  94. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.js.map +1 -0
  95. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.d.ts +2 -0
  96. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.d.ts.map +1 -0
  97. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.js +9 -0
  98. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.js.map +1 -0
  99. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.d.ts +2 -0
  100. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.d.ts.map +1 -0
  101. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.js +9 -0
  102. package/dist/esm/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.js.map +1 -0
  103. package/dist/esm/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.d.ts +2 -0
  104. package/dist/esm/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.d.ts.map +1 -0
  105. package/dist/esm/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.js +26 -0
  106. package/dist/esm/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.js.map +1 -0
  107. package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.d.ts +2 -0
  108. package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.d.ts.map +1 -0
  109. package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.js +25 -0
  110. package/dist/esm/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.js.map +1 -0
  111. package/dist/esm/tsconfig.tsbuildinfo +1 -1
  112. package/package.json +1 -1
  113. package/queries/ObservableQueryConnection.ts +3 -2
  114. package/queries/QueryResult.ts +1 -1
  115. package/queries/QueryResultWithState.ts +3 -3
  116. package/queries/ServerSentEventHubConnection.ts +10 -1
  117. package/queries/WebSocketHubConnection.ts +12 -1
  118. package/queries/for_ObservableQueryConnection/given/an_observable_query_connection_with_websocket.ts +58 -0
  119. package/queries/for_ObservableQueryConnection/when_receiving_data_message_with_type.ts +48 -0
  120. package/queries/for_ObservableQueryConnection/when_receiving_legacy_data_message.ts +48 -0
  121. package/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.ts +29 -0
  122. package/queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.ts +29 -0
  123. package/queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.ts +13 -0
  124. package/queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.ts +13 -0
  125. package/queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.ts +30 -0
  126. package/queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.ts +30 -0
  127. package/queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.ts +13 -0
  128. package/queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.ts +13 -0
  129. package/queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.ts +13 -0
  130. package/queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.ts +36 -0
  131. package/queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.ts +33 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and_it_is_null_for_enumerable.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { QueryResult } from '../../QueryResult';
2
+ describe('when asking has data and it is null for enumerable query', () => {
3
+ const queryResult = new QueryResult({
4
+ isSuccess: true,
5
+ isAuthorized: true,
6
+ isValid: true,
7
+ hasExceptions: false,
8
+ exceptionMessages: [],
9
+ exceptionStackTrace: '',
10
+ paging: {
11
+ totalItems: 0,
12
+ totalPages: 0,
13
+ page: 0,
14
+ size: 0
15
+ },
16
+ validationResults: [],
17
+ data: null
18
+ }, Object, true);
19
+ it('should consider it to not have data', () => queryResult.hasData.should.be.false);
20
+ it('should have data that is not null', () => (queryResult.data !== null).should.be.true);
21
+ it('should have data that is an empty array', () => queryResult.data.should.deep.equal([]));
22
+ });
23
+ //# sourceMappingURL=and_it_is_null_for_enumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and_it_is_null_for_enumerable.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_enumerable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,QAAQ,CAAC,0DAA0D,EAAE,GAAG,EAAE;IACtE,MAAM,WAAW,GAAG,IAAI,WAAW,CAAM;QACrC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,MAAM,EAAE;YACJ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;SACV;QACD,iBAAiB,EAAE,EAAE;QACrB,IAAI,EAAE,IAAI;KACb,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEjB,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACrF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1F,EAAE,CAAC,yCAAyC,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAChG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=and_it_is_null_for_non_enumerable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and_it_is_null_for_non_enumerable.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { QueryResult } from '../../QueryResult';
2
+ describe('when asking has data and it is null for non-enumerable query', () => {
3
+ const queryResult = new QueryResult({
4
+ isSuccess: true,
5
+ isAuthorized: true,
6
+ isValid: true,
7
+ hasExceptions: false,
8
+ exceptionMessages: [],
9
+ exceptionStackTrace: '',
10
+ paging: {
11
+ totalItems: 0,
12
+ totalPages: 0,
13
+ page: 0,
14
+ size: 0
15
+ },
16
+ validationResults: [],
17
+ data: null
18
+ }, Object, false);
19
+ it('should consider to have data since empty object is truthy', () => queryResult.hasData.should.be.true);
20
+ it('should have data that is not null', () => (queryResult.data !== null).should.be.true);
21
+ it('should have data that is an empty object', () => queryResult.data.should.deep.equal({}));
22
+ });
23
+ //# sourceMappingURL=and_it_is_null_for_non_enumerable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and_it_is_null_for_non_enumerable.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResult/when_asking_has_data/and_it_is_null_for_non_enumerable.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,QAAQ,CAAC,8DAA8D,EAAE,GAAG,EAAE;IAC1E,MAAM,WAAW,GAAG,IAAI,WAAW,CAAM;QACrC,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,OAAO,EAAE,IAAI;QACb,aAAa,EAAE,KAAK;QACpB,iBAAiB,EAAE,EAAE;QACrB,mBAAmB,EAAE,EAAE;QACvB,MAAM,EAAE;YACJ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;SACV;QACD,iBAAiB,EAAE,EAAE;QACrB,IAAI,EAAE,IAAI;KACb,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAElB,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1G,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1F,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AACjG,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_null_default_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_default_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { QueryResultWithState } from '../../QueryResultWithState';
2
+ describe('when creating empty with null default value', () => {
3
+ const result = QueryResultWithState.empty(null);
4
+ it('should have data that is not undefined', () => (result.data !== undefined).should.be.true);
5
+ it('should have data that is not null', () => (result.data !== null).should.be.true);
6
+ it('should not have data', () => result.hasData.should.be.false);
7
+ it('should not be performing', () => result.isPerforming.should.be.false);
8
+ });
9
+ //# sourceMappingURL=with_null_default_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_default_value.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_empty/with_null_default_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,6CAA6C,EAAE,GAAG,EAAE;IACzD,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAW,IAA2B,CAAC,CAAC;IAEjF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/F,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACrF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACjE,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_undefined_default_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_default_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { QueryResultWithState } from '../../QueryResultWithState';
2
+ describe('when creating empty with undefined default value', () => {
3
+ const result = QueryResultWithState.empty(undefined);
4
+ it('should have data that is not undefined', () => (result.data !== undefined).should.be.true);
5
+ it('should have data that is not null', () => (result.data !== null).should.be.true);
6
+ it('should not have data', () => result.hasData.should.be.false);
7
+ it('should not be performing', () => result.isPerforming.should.be.false);
8
+ });
9
+ //# sourceMappingURL=with_undefined_default_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_default_value.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_empty/with_undefined_default_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC9D,MAAM,MAAM,GAAG,oBAAoB,CAAC,KAAK,CAAW,SAAgC,CAAC,CAAC;IAEtF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/F,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACrF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACjE,EAAE,CAAC,0BAA0B,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_null_data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_data.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { QueryResult } from '../../QueryResult';
2
+ import { QueryResultWithState } from '../../QueryResultWithState';
3
+ describe('when creating from query result with null data', () => {
4
+ const queryResult = new QueryResult({
5
+ data: null,
6
+ isSuccess: true,
7
+ isAuthorized: true,
8
+ isValid: true,
9
+ hasExceptions: false,
10
+ validationResults: [],
11
+ exceptionMessages: [],
12
+ exceptionStackTrace: '',
13
+ paging: {
14
+ totalItems: 0,
15
+ totalPages: 0,
16
+ page: 0,
17
+ size: 0
18
+ }
19
+ }, Object, true);
20
+ const result = QueryResultWithState.fromQueryResult(queryResult, false);
21
+ it('should have data that is not undefined', () => (result.data !== undefined).should.be.true);
22
+ it('should have data that is not null', () => (result.data !== null).should.be.true);
23
+ it('should not have data', () => result.hasData.should.be.false);
24
+ });
25
+ //# sourceMappingURL=with_null_data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_data.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/with_null_data.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,gDAAgD,EAAE,GAAG,EAAE;IAC5D,MAAM,WAAW,GAAG,IAAI,WAAW,CAAS;QACxC,IAAI,EAAE,IAAyB;QAC/B,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;YACJ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;SACV;KACJ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEjB,MAAM,MAAM,GAAG,oBAAoB,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAExE,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/F,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACrF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_undefined_data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_data.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import { QueryResult } from '../../QueryResult';
2
+ import { QueryResultWithState } from '../../QueryResultWithState';
3
+ describe('when creating from query result with undefined data', () => {
4
+ const queryResult = new QueryResult({
5
+ data: undefined,
6
+ isSuccess: true,
7
+ isAuthorized: true,
8
+ isValid: true,
9
+ hasExceptions: false,
10
+ validationResults: [],
11
+ exceptionMessages: [],
12
+ exceptionStackTrace: '',
13
+ paging: {
14
+ totalItems: 0,
15
+ totalPages: 0,
16
+ page: 0,
17
+ size: 0
18
+ }
19
+ }, Object, true);
20
+ const result = QueryResultWithState.fromQueryResult(queryResult, false);
21
+ it('should have data that is not undefined', () => (result.data !== undefined).should.be.true);
22
+ it('should have data that is not null', () => (result.data !== null).should.be.true);
23
+ it('should not have data', () => result.hasData.should.be.false);
24
+ });
25
+ //# sourceMappingURL=with_undefined_data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_data.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_from_query_result/with_undefined_data.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,qDAAqD,EAAE,GAAG,EAAE;IACjE,MAAM,WAAW,GAAG,IAAI,WAAW,CAAS;QACxC,IAAI,EAAE,SAA8B;QACpC,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;YACJ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,CAAC;YACb,IAAI,EAAE,CAAC;YACP,IAAI,EAAE,CAAC;SACV;KACJ,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;IAEjB,MAAM,MAAM,GAAG,oBAAoB,CAAC,eAAe,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAExE,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/F,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACrF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_null_default_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_default_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { QueryResultWithState } from '../../QueryResultWithState';
2
+ describe('when creating initial with null default value', () => {
3
+ const result = QueryResultWithState.initial(null);
4
+ it('should have data that is not undefined', () => (result.data !== undefined).should.be.true);
5
+ it('should have data that is not null', () => (result.data !== null).should.be.true);
6
+ it('should not have data', () => result.hasData.should.be.false);
7
+ it('should be performing', () => result.isPerforming.should.be.true);
8
+ });
9
+ //# sourceMappingURL=with_null_default_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_null_default_value.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_initial/with_null_default_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,+CAA+C,EAAE,GAAG,EAAE;IAC3D,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAW,IAA2B,CAAC,CAAC;IAEnF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/F,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACrF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACjE,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_undefined_default_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_default_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { QueryResultWithState } from '../../QueryResultWithState';
2
+ describe('when creating initial with undefined default value', () => {
3
+ const result = QueryResultWithState.initial(undefined);
4
+ it('should have data that is not undefined', () => (result.data !== undefined).should.be.true);
5
+ it('should have data that is not null', () => (result.data !== null).should.be.true);
6
+ it('should not have data', () => result.hasData.should.be.false);
7
+ it('should be performing', () => result.isPerforming.should.be.true);
8
+ });
9
+ //# sourceMappingURL=with_undefined_default_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_undefined_default_value.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_initial/with_undefined_default_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,oDAAoD,EAAE,GAAG,EAAE;IAChE,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAW,SAAgC,CAAC,CAAC;IAExF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC/F,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IACrF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;IACjE,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=with_valid_default_value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_valid_default_value.d.ts","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.ts"],"names":[],"mappings":""}
@@ -0,0 +1,9 @@
1
+ import { QueryResultWithState } from '../../QueryResultWithState';
2
+ describe('when creating initial with valid default value', () => {
3
+ const defaultValue = [{ id: '1', name: 'test' }];
4
+ const result = QueryResultWithState.initial(defaultValue);
5
+ it('should use the provided default value', () => result.data.should.equal(defaultValue));
6
+ it('should have data', () => result.hasData.should.be.true);
7
+ it('should be performing', () => result.isPerforming.should.be.true);
8
+ });
9
+ //# sourceMappingURL=with_valid_default_value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with_valid_default_value.js","sourceRoot":"","sources":["../../../../../queries/for_QueryResultWithState/when_creating_initial/with_valid_default_value.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,QAAQ,CAAC,gDAAgD,EAAE,GAAG,EAAE;IAC5D,MAAM,YAAY,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjD,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IAE1D,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1F,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;IAC5D,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=nulls_event_source_handlers_before_closing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nulls_event_source_handlers_before_closing.d.ts","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.ts"],"names":[],"mappings":""}
@@ -0,0 +1,26 @@
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 unsubscribing the only query, nulls event source handlers before closing the event source', given(a_server_sent_event_hub_connection, context => {
6
+ let handlersWereNullWhenClosed;
7
+ beforeEach(async () => {
8
+ context.setup();
9
+ context.connection.subscribe('q1', { queryName: 'MyQuery' }, sinon.stub());
10
+ context.simulateOpen();
11
+ context.simulateMessage({ type: HubMessageType.Connected, payload: 'conn-abc' });
12
+ handlersWereNullWhenClosed = { onopen: false, onmessage: false, onerror: false };
13
+ context.fakeEventSource.close.callsFake(() => {
14
+ handlersWereNullWhenClosed.onopen = context.fakeEventSource.onopen === null;
15
+ handlersWereNullWhenClosed.onmessage = context.fakeEventSource.onmessage === null;
16
+ handlersWereNullWhenClosed.onerror = context.fakeEventSource.onerror === null;
17
+ });
18
+ context.connection.unsubscribe('q1');
19
+ await Promise.resolve();
20
+ });
21
+ afterEach(() => sinon.restore());
22
+ it('should have nulled onopen before calling eventSource.close()', () => handlersWereNullWhenClosed.onopen.should.be.true);
23
+ it('should have nulled onmessage before calling eventSource.close()', () => handlersWereNullWhenClosed.onmessage.should.be.true);
24
+ it('should have nulled onerror before calling eventSource.close()', () => handlersWereNullWhenClosed.onerror.should.be.true);
25
+ }));
26
+ //# sourceMappingURL=nulls_event_source_handlers_before_closing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nulls_event_source_handlers_before_closing.js","sourceRoot":"","sources":["../../../../../queries/for_ServerSentEventHubConnection/when_unsubscribing/nulls_event_source_handlers_before_closing.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,CAAC,gGAAgG,EAAE,KAAK,CAAC,kCAAkC,EAAE,OAAO,CAAC,EAAE;IAC3J,IAAI,0BAAqF,CAAC;IAE1F,UAAU,CAAC,KAAK,IAAI,EAAE;QAClB,OAAO,CAAC,KAAK,EAAE,CAAC;QAChB,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,CA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lers_before_closing.d.ts","sourceRoot":"","sources":["../../../../../queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ import sinon from 'sinon';
2
+ import { a_web_socket_hub_connection } from '../given/a_web_socket_hub_connection';
3
+ import { given } from '../../../given';
4
+ describe('when unsubscribing the only query, nulls socket handlers before closing the socket', given(a_web_socket_hub_connection, context => {
5
+ let handlersWereNullWhenClosed;
6
+ beforeEach(() => {
7
+ context.setup();
8
+ context.connection.subscribe('q1', { queryName: 'MyQuery' }, sinon.stub());
9
+ context.simulateOpen();
10
+ handlersWereNullWhenClosed = { onopen: false, onclose: false, onerror: false, onmessage: false };
11
+ context.fakeSocket.close.callsFake(() => {
12
+ handlersWereNullWhenClosed.onopen = context.fakeSocket.onopen === null;
13
+ handlersWereNullWhenClosed.onclose = context.fakeSocket.onclose === null;
14
+ handlersWereNullWhenClosed.onerror = context.fakeSocket.onerror === null;
15
+ handlersWereNullWhenClosed.onmessage = context.fakeSocket.onmessage === null;
16
+ });
17
+ context.connection.unsubscribe('q1');
18
+ });
19
+ afterEach(() => sinon.restore());
20
+ it('should have nulled onopen before calling socket.close()', () => handlersWereNullWhenClosed.onopen.should.be.true);
21
+ it('should have nulled onclose before calling socket.close()', () => handlersWereNullWhenClosed.onclose.should.be.true);
22
+ it('should have nulled onerror before calling socket.close()', () => handlersWereNullWhenClosed.onerror.should.be.true);
23
+ it('should have nulled onmessage before calling socket.close()', () => handlersWereNullWhenClosed.onmessage.should.be.true);
24
+ }));
25
+ //# sourceMappingURL=nulls_socket_handlers_before_closing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nulls_socket_handlers_before_closing.js","sourceRoot":"","sources":["../../../../../queries/for_WebSocketHubConnection/when_unsubscribing/nulls_socket_handlers_before_closing.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAA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