@eui/core 17.0.0-rc.6 → 17.0.0-rc.8

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.
@@ -415,10 +415,17 @@
415
415
 
416
416
  <tr>
417
417
  <td class="col-md-4">
418
- <div class="io-description"><p>Process all items in queue after it order them based on their timestamp. Beware that order
419
- matter in execution of Http Request in queue. When a request completes only then next will begin. Emission
420
- or Http response follows order.</p>
421
- </div>
418
+ <div class="io-description"><p>Processes all items in the queue sequentially, based on their timestamp ordering.</p>
419
+ <p>This method first orders the items in the API queue by their timestamp, either in ascending or descending
420
+ order as specified by the <code>ascending</code> parameter. It then processes each item using <code>buildHttpRequest</code>, ensuring
421
+ that each request is completed before the next begins. This sequential processing is crucial when the order of
422
+ execution matters for HTTP requests in the queue. The method returns an Observable that emits the responses
423
+ following the same order as the queue items were processed.</p>
424
+ <p>The function currently returns <code>Observable&lt;any&gt;</code>, indicating a broad type. Future improvements should focus on
425
+ specifying a more accurate return type or utilizing generics for increased type safety.</p>
426
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-none"> timestamp. Defaults to `true`.</code></pre></div><b>Example :</b><div><pre class="line-numbers"><code class="language-html">this.processAllQueueItemsSequential().subscribe(response =&gt; {
427
+ // Handle each response in the order of queue processing
428
+ });</code></pre></div></div>
422
429
 
423
430
  <div class="io-description">
424
431
  <b>Parameters :</b>
@@ -446,7 +453,8 @@ or Http response follows order.</p>
446
453
 
447
454
  <td>
448
455
  <ul>
449
- <li>sets the order of queue items based on timestamp</li>
456
+ <li>Determines whether the queue items are processed in ascending order of their
457
+ timestamp. Defaults to <code>true</code>.</li>
450
458
  </ul>
451
459
 
452
460
  </td>
@@ -459,7 +467,8 @@ or Http response follows order.</p>
459
467
 
460
468
  </div>
461
469
  <div class="io-description">
462
-
470
+ <p>An Observable emitting the responses of the HTTP requests in the order they were processed.</p>
471
+
463
472
  </div>
464
473
  </td>
465
474
  </tr>
@@ -249,9 +249,9 @@
249
249
  <li>
250
250
  <b>@stackblitz/sdk</b> : 1.9.0</li>
251
251
  <li>
252
- <b>@eui/styles-base</b> : 17.0.0-rc.5</li>
252
+ <b>@eui/styles-base</b> : 17.0.0-rc.7</li>
253
253
  <li>
254
- <b>@eui/ecl</b> : 17.0.0-rc.5</li>
254
+ <b>@eui/ecl</b> : 17.0.0-rc.7</li>
255
255
  <li>
256
256
  <b>@eui/tools</b> : ^6.0.0</li>
257
257
  </ul>
@@ -63,6 +63,35 @@
63
63
  </p>
64
64
 
65
65
 
66
+ <p class="comment">
67
+ <h3>Description</h3>
68
+ </p>
69
+ <p class="comment">
70
+ <p>Service class for managing and processing a queue of API requests.</p>
71
+ <p>This service provides functionality to add, remove, process, and manage HTTP requests stored in a queue.
72
+ It enables sequential or bulk processing of requests, ensuring controlled execution and handling of API calls.
73
+ The service methods offer features like processing individual items, processing all items in the queue either
74
+ sequentially or all at once, and removing items from the queue. Each method is designed to handle specific aspects
75
+ of queue management and processing, with attention to details like order of execution and error handling.</p>
76
+ <p>Usage of this service is ideal in scenarios where API requests need to be managed in a queue structure, allowing
77
+ for controlled execution and monitoring of these requests.</p>
78
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Adding a new item to the queue
79
+ apiQueueService.addQueueItem({ id: &#39;item124&#39;, method: &#39;POST&#39;, uri: &#39;/api/data&#39;, payload: {...} });</code></pre></div><p>// Processing a single item from the queue
80
+ apiQueueService.processQueueItem(&#39;item123&#39;).subscribe(result =&gt; {
81
+ console.log(&#39;Processed item 123 with result:&#39;, result);
82
+ });</p>
83
+ <p>// Processing all items in the queue in sequential order
84
+ apiQueueService.processAllQueueItemsSequential(false).subscribe(results =&gt; {
85
+ console.log(&#39;Processed all items in descending order of their timestamp:&#39;, results);
86
+ });</p>
87
+ <p>// Removing an item from the queue
88
+ apiQueueService.removeQueueItem(&#39;item123&#39;);</p>
89
+ <p>// Processing all items in the queue and continuing on error
90
+ apiQueueService.processAllQueueItems(true).subscribe(results =&gt; {
91
+ console.log(&#39;Processed all items in the queue with continuation on errors:&#39;, results);
92
+ });</p>
93
+
94
+ </p>
66
95
 
67
96
 
68
97
 
@@ -210,9 +239,17 @@
210
239
 
211
240
  <tr>
212
241
  <td class="col-md-4">
213
- <div class="io-description"><p>Adds an item in the queue by dispatching an action to the store.
214
- WARNING if matches any other queue item id will overwrite it.</p>
215
- </div>
242
+ <div class="io-description"><p>Adds an item to the queue by dispatching an action to the store.
243
+ This function is specifically designed to enqueue API call requests represented by <code>ApiQueueItem</code> objects.
244
+ Each item is identified by a unique <code>id</code>, which is used to manage the queue.</p>
245
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-none"> If an item with the same ID already exists, the new item will overwrite the existing one.
246
+ WARNING: Duplicate IDs will lead to overwriting of queue items.
247
+
248
+ The `method` property of the item must be one of the allowed methods (&#39;post&#39;, &#39;put&#39;, &#39;get&#39;).
249
+ If an unsupported method is provided, the function will throw an error.
250
+
251
+ The error message is: `[ApiQueue] method &quot;${item.method}&quot; is not allowed`.</code></pre></div><b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Example of adding an item to the API queue
252
+ addQueueItem(&#39;12345&#39;, { method: &#39;post&#39;, url: &#39;/api/data&#39;, payload: {...} });</code></pre></div></div>
216
253
 
217
254
  <div class="io-description">
218
255
  <b>Parameters :</b>
@@ -240,8 +277,9 @@ WARNING if matches any other queue item id will overwrite it.</p>
240
277
 
241
278
  <td>
242
279
  <ul>
243
- <li>The id of the item inside the queue.
244
- WARNING if matches any other queue item id will overwrite it.</li>
280
+ <li>The unique identifier for the queue item. It&#39;s crucial to ensure that this ID is unique within the queue.
281
+ If an item with the same ID already exists, the new item will overwrite the existing one.
282
+ WARNING: Duplicate IDs will lead to overwriting of queue items.</li>
245
283
  </ul>
246
284
 
247
285
  </td>
@@ -259,7 +297,9 @@ WARNING if matches any other queue item id will overwrite it.</li>
259
297
 
260
298
  <td>
261
299
  <ul>
262
- <li>an item for Queue</li>
300
+ <li>The item to be enqueued. This should be an object of type <code>ApiQueueItem</code>.
301
+ The <code>method</code> property of the item must be one of the allowed methods (&#39;post&#39;, &#39;put&#39;, &#39;get&#39;).
302
+ If an unsupported method is provided, the function will throw an error.</li>
263
303
  </ul>
264
304
 
265
305
  </td>
@@ -272,7 +312,8 @@ WARNING if matches any other queue item id will overwrite it.</li>
272
312
 
273
313
  </div>
274
314
  <div class="io-description">
275
-
315
+ <p>This function does not return a value. It adds the item to the queue via a dispatch action.</p>
316
+
276
317
  </div>
277
318
  </td>
278
319
  </tr>
@@ -300,15 +341,27 @@ WARNING if matches any other queue item id will overwrite it.</li>
300
341
 
301
342
  <tr>
302
343
  <td class="col-md-4">
303
- <div class="io-description"><p>Subscribes to the store to retrieve queue and then converts the queue object to an array of items.</p>
304
- </div>
344
+ <div class="io-description"><p>Retrieves the current state of the API queue and converts it into an array of Observables.</p>
345
+ <p>This method subscribes to the store to access the API queue. It then maps the queue object,
346
+ which is an associative array, into a linear array of ApiQueueItem instances. If the queue is empty,
347
+ a warning is logged. This method is useful for tracking the state and contents of the API queue
348
+ at a given moment.</p>
349
+ <p>Note: This method takes a snapshot of the queue at the time of subscription. It does not provide
350
+ a continuous stream of queue updates. To get real-time updates, consider subscribing directly
351
+ to the store&#39;s observable.</p>
352
+ <p>The array represents all items currently in the queue. If the queue is empty, it emits an empty array.</p>
353
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Example usage
354
+ this.getQueue().subscribe(queueItems =&gt; {
355
+ console.log(&#39;Current queue items:&#39;, queueItems);
356
+ });</code></pre></div></div>
305
357
 
306
358
  <div class="io-description">
307
359
  <b>Returns : </b> <code>Observable&lt;ApiQueueItem[]&gt;</code>
308
360
 
309
361
  </div>
310
362
  <div class="io-description">
311
- <p>An Observable of array of all items inside the current queue (ApiQueueItem[])</p>
363
+ <p>An Observable that emits an array of ApiQueueItem.
364
+ The array represents all items currently in the queue. If the queue is empty, it emits an empty array.</p>
312
365
 
313
366
  </div>
314
367
  </td>
@@ -337,8 +390,22 @@ WARNING if matches any other queue item id will overwrite it.</li>
337
390
 
338
391
  <tr>
339
392
  <td class="col-md-4">
340
- <div class="io-description"><p>Subscribes to the store to retrieve an item from the queue.</p>
341
- </div>
393
+ <div class="io-description"><p>Retrieves a specific item from the API queue by its ID.</p>
394
+ <p>This method subscribes to the store and selects a single item from the API queue based on the provided ID.
395
+ It employs a pipeline to fetch the item: the <code>getApiQueueItem</code> selector is used to retrieve the item,
396
+ and a <code>map</code> operator processes the result. If the item with the specified ID does not exist in the queue,
397
+ a warning is logged, and <code>null</code> is returned.</p>
398
+ <p>This method is ideal for accessing a specific queue item when its ID is known, allowing for targeted
399
+ operations or checks on that particular item.</p>
400
+ <p>If no item with the given ID exists in the queue, the Observable emits <code>null</code>.</p>
401
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Example usage
402
+ this.getQueueItem(&#39;item123&#39;).subscribe(item =&gt; {
403
+ if (item) {
404
+ console.log(&#39;Found item:&#39;, item);
405
+ } else {
406
+ console.log(&#39;Item not found in the queue&#39;);
407
+ }
408
+ });</code></pre></div></div>
342
409
 
343
410
  <div class="io-description">
344
411
  <b>Parameters :</b>
@@ -366,7 +433,7 @@ WARNING if matches any other queue item id will overwrite it.</li>
366
433
 
367
434
  <td>
368
435
  <ul>
369
- <li>id of the item inside the queue</li>
436
+ <li>The unique identifier of the item within the queue.</li>
370
437
  </ul>
371
438
 
372
439
  </td>
@@ -379,7 +446,8 @@ WARNING if matches any other queue item id will overwrite it.</li>
379
446
 
380
447
  </div>
381
448
  <div class="io-description">
382
- <p>An Observable of ApiQueueItem type</p>
449
+ <p>An Observable emitting the requested ApiQueueItem.
450
+ If no item with the given ID exists in the queue, the Observable emits <code>null</code>.</p>
383
451
 
384
452
  </div>
385
453
  </td>
@@ -405,11 +473,27 @@ WARNING if matches any other queue item id will overwrite it.</li>
405
473
 
406
474
 
407
475
 
476
+ <tr>
477
+ <td class="col-md-4">
478
+ <b>Type parameters :</b>
479
+ <ul class="type-parameters">
480
+ <li>T</li>
481
+ </ul>
482
+ </td>
483
+ </tr>
408
484
 
409
485
  <tr>
410
486
  <td class="col-md-4">
411
- <div class="io-description"><p>Process all the items inside the queue.</p>
412
- </div>
487
+ <div class="io-description"><p>Processes all items in the API queue and collects their responses.</p>
488
+ <p>Iterates over each item in the queue and processes them using <code>buildHttpRequest</code>. If a request fails,
489
+ the method can either continue processing the remaining items or stop, based on the <code>continueOnError</code> parameter.
490
+ It returns an Observable that emits an array containing the responses or errors from all the processed items.</p>
491
+ <p>The function currently returns <code>Observable&lt;any[]&gt;</code> indicating an array of any type. Future improvements
492
+ should aim to specify a more accurate return type or utilize generics for increased type safety.</p>
493
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-none"> after a request failure. Defaults to `true`.
494
+ queue items.</code></pre></div><b>Example :</b><div><pre class="line-numbers"><code class="language-html">this.processAllQueueItems().subscribe(results =&gt; {
495
+ // Handle the array of responses or errors
496
+ });</code></pre></div></div>
413
497
 
414
498
  <div class="io-description">
415
499
  <b>Parameters :</b>
@@ -437,7 +521,8 @@ WARNING if matches any other queue item id will overwrite it.</li>
437
521
 
438
522
  <td>
439
523
  <ul>
440
- <li>in case of an item request fails continue with the rest in queue</li>
524
+ <li>Determines whether to continue with the next item in the queue
525
+ after a request failure. Defaults to <code>true</code>.</li>
441
526
  </ul>
442
527
 
443
528
  </td>
@@ -446,11 +531,12 @@ WARNING if matches any other queue item id will overwrite it.</li>
446
531
  </table>
447
532
  </div>
448
533
  <div class="io-description">
449
- <b>Returns : </b> <code>Observable&lt;any[]&gt;</code>
534
+ <b>Returns : </b> <code>Observable&lt;T[]&gt;</code>
450
535
 
451
536
  </div>
452
537
  <div class="io-description">
453
- <p>An Observable with an array which contains all responses from all items in queue.</p>
538
+ <p>An Observable emitting an array of either responses or errors from the processed
539
+ queue items.</p>
454
540
 
455
541
  </div>
456
542
  </td>
@@ -479,10 +565,17 @@ WARNING if matches any other queue item id will overwrite it.</li>
479
565
 
480
566
  <tr>
481
567
  <td class="col-md-4">
482
- <div class="io-description"><p>Process all items in queue after it order them based on their timestamp. Beware that order
483
- matter in execution of Http Request in queue. When a request completes only then next will begin. Emission
484
- or Http response follows order.</p>
485
- </div>
568
+ <div class="io-description"><p>Processes all items in the queue sequentially, based on their timestamp ordering.</p>
569
+ <p>This method first orders the items in the API queue by their timestamp, either in ascending or descending
570
+ order as specified by the <code>ascending</code> parameter. It then processes each item using <code>buildHttpRequest</code>, ensuring
571
+ that each request is completed before the next begins. This sequential processing is crucial when the order of
572
+ execution matters for HTTP requests in the queue. The method returns an Observable that emits the responses
573
+ following the same order as the queue items were processed.</p>
574
+ <p>The function currently returns <code>Observable&lt;any&gt;</code>, indicating a broad type. Future improvements should focus on
575
+ specifying a more accurate return type or utilizing generics for increased type safety.</p>
576
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-none"> timestamp. Defaults to `true`.</code></pre></div><b>Example :</b><div><pre class="line-numbers"><code class="language-html">this.processAllQueueItemsSequential().subscribe(response =&gt; {
577
+ // Handle each response in the order of queue processing
578
+ });</code></pre></div></div>
486
579
 
487
580
  <div class="io-description">
488
581
  <b>Parameters :</b>
@@ -510,7 +603,8 @@ or Http response follows order.</p>
510
603
 
511
604
  <td>
512
605
  <ul>
513
- <li>sets the order of queue items based on timestamp</li>
606
+ <li>Determines whether the queue items are processed in ascending order of their
607
+ timestamp. Defaults to <code>true</code>.</li>
514
608
  </ul>
515
609
 
516
610
  </td>
@@ -523,7 +617,8 @@ or Http response follows order.</p>
523
617
 
524
618
  </div>
525
619
  <div class="io-description">
526
-
620
+ <p>An Observable emitting the responses of the HTTP requests in the order they were processed.</p>
621
+
527
622
  </div>
528
623
  </td>
529
624
  </tr>
@@ -551,8 +646,18 @@ or Http response follows order.</p>
551
646
 
552
647
  <tr>
553
648
  <td class="col-md-4">
554
- <div class="io-description"><p>Process an item from the queue.</p>
555
- </div>
649
+ <div class="io-description"><p>Processes an item from the API queue identified by its ID.</p>
650
+ <p>Retrieves the specified item from the queue and applies processing logic as defined in <code>buildHttpRequest</code>.
651
+ If the item is not found, logs a warning and returns an Observable emitting <code>null</code>.</p>
652
+ <p>If the item does not exist, the Observable emits <code>null</code>.</p>
653
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Example usage
654
+ this.processQueueItem(&#39;item123&#39;).subscribe(result =&gt; {
655
+ if (result) {
656
+ console.log(&#39;Processing result:&#39;, result);
657
+ } else {
658
+ console.log(&#39;Item not found in the queue&#39;);
659
+ }
660
+ });</code></pre></div></div>
556
661
 
557
662
  <div class="io-description">
558
663
  <b>Parameters :</b>
@@ -580,7 +685,7 @@ or Http response follows order.</p>
580
685
 
581
686
  <td>
582
687
  <ul>
583
- <li>id of the item inside the queue</li>
688
+ <li>The unique identifier of the item within the queue to be processed.</li>
584
689
  </ul>
585
690
 
586
691
  </td>
@@ -593,7 +698,8 @@ or Http response follows order.</p>
593
698
 
594
699
  </div>
595
700
  <div class="io-description">
596
- <p>An Observable of type any</p>
701
+ <p>An Observable that emits the result of processing the queue item.
702
+ If the item does not exist, the Observable emits <code>null</code>.</p>
597
703
 
598
704
  </div>
599
705
  </td>
@@ -622,13 +728,23 @@ or Http response follows order.</p>
622
728
 
623
729
  <tr>
624
730
  <td class="col-md-4">
625
- <div class="io-description"><p>Removes all items placed in the queue.</p>
626
- </div>
731
+ <div class="io-description"><p>Clears all items from the API queue.</p>
732
+ <p>This method dispatches an action to empty the entire API queue, effectively removing all items that are currently queued.
733
+ It is useful for scenarios where a complete reset of the queue is required, such as during initialization or after processing
734
+ a batch of items. The function does not return any value, as its primary purpose is to trigger a state change in the store.</p>
735
+ <p>Note: Use this method with caution as it will irreversibly clear all items in the queue. Ensure that this action does not
736
+ disrupt any ongoing processes that rely on the queue&#39;s contents.</p>
737
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Example usage
738
+ this.removeAllQueueItem();
739
+ // This will dispatch an action to empty the entire API queue.</code></pre></div></div>
627
740
 
628
741
  <div class="io-description">
629
742
  <b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
630
743
 
631
744
  </div>
745
+ <div class="io-description">
746
+
747
+ </div>
632
748
  </td>
633
749
  </tr>
634
750
  </tbody>
@@ -655,8 +771,16 @@ or Http response follows order.</p>
655
771
 
656
772
  <tr>
657
773
  <td class="col-md-4">
658
- <div class="io-description"><p>Removes a given item from the queue.</p>
659
- </div>
774
+ <div class="io-description"><p>Removes a specific item from the API queue using its ID.</p>
775
+ <p>This method dispatches an action to remove an item from the queue, identified by the provided ID.
776
+ It is essential for managing the queue by eliminating items that are no longer needed or have been processed.
777
+ The function does not return any value, as it primarily triggers an action within the store.</p>
778
+ <p>Note: This method assumes the existence of the item in the queue. It does not perform a check
779
+ to confirm the presence of the item before attempting to remove it. Therefore, it&#39;s recommended
780
+ to verify the item&#39;s existence in the queue if uncertainty exists.</p>
781
+ <b>Example :</b><div><pre class="line-numbers"><code class="language-html">// Example usage
782
+ this.removeQueueItem(&#39;item123&#39;);
783
+ // The item with ID &#39;item123&#39; will be dispatched for removal from the queue.</code></pre></div></div>
660
784
 
661
785
  <div class="io-description">
662
786
  <b>Parameters :</b>
@@ -684,7 +808,7 @@ or Http response follows order.</p>
684
808
 
685
809
  <td>
686
810
  <ul>
687
- <li>id of the item inside the queue</li>
811
+ <li>The unique identifier of the item to be removed from the queue.</li>
688
812
  </ul>
689
813
 
690
814
  </td>