@findhotel/sapi 0.22.7 → 0.22.11

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/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ ## [0.22.11](https://github.com/FindHotel/sapi/compare/v0.22.10...v0.22.11) (2021-12-09)
2
+ ### Changed
3
+ - SAF search replaced with SAPI backend search
4
+
5
+
6
+ ## [0.22.10](https://github.com/FindHotel/sapi/compare/v0.22.9...v0.22.10) (2021-11-30)
7
+ ### Added
8
+ - boundingBox parameter to SAF-search request
9
+
10
+ ## [0.22.9](https://github.com/FindHotel/sapi/compare/v0.22.8...v0.22.9) (2021-11-24)
11
+ ### Added
12
+ - Added missing field to suggest method
13
+
14
+
15
+ ## [0.22.8](https://github.com/FindHotel/sapi/compare/v0.22.7...v0.22.8) (2021-11-16)
16
+ ### Added
17
+ - `roomLimit` parameter for RAA requests
18
+
19
+
1
20
  ## [0.22.7](https://github.com/FindHotel/sapi/compare/v0.22.6...v0.22.7) (2021-11-09)
2
21
  ### Added
3
22
  - clientRequestId for each individual WS request to RAA
package/README.md CHANGED
@@ -15,7 +15,10 @@
15
15
  1. [Search parameters](#search-parameters)
16
16
  2. [Callbacks](#search-callbacks)
17
17
  3. [Response](#search-response)
18
- 3. [`rooms()` method](#rooms-method)
18
+ 3. [`suggest()` method](#suggest-method)
19
+ 1. [Suggest parameters](#suggest-parameters)
20
+ 2. [Response](#suggest-response)
21
+ 4. [`rooms()` method](#rooms-method)
19
22
  1. [Rooms parameters](#rooms-parameters)
20
23
  2. [Response](#rooms-response)
21
24
 
@@ -145,7 +148,6 @@ Create SAPI client:
145
148
  includeLocalTaxes: true,
146
149
  includeTaxes: false,
147
150
  pageSize: 20,
148
- useSaf: false,
149
151
  initWithProfile: {
150
152
  features: ['search', 'configs'],
151
153
  },
@@ -486,6 +488,111 @@ Search method receives callbacks object as the second argument:
486
488
  *in progress…*
487
489
 
488
490
 
491
+ <a id="suggest-method"></a>
492
+
493
+ ## `suggest()` method
494
+
495
+ Suggest provides autosuggestions for a given query
496
+
497
+ const suggestions = await sapiClient.suggest('London', 6)
498
+
499
+
500
+ <a id="suggest-parameters"></a>
501
+
502
+ ### Suggest parameters
503
+
504
+ <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
505
+
506
+
507
+ <colgroup>
508
+ <col class="org-left" />
509
+
510
+ <col class="org-left" />
511
+
512
+ <col class="org-left" />
513
+
514
+ <col class="org-left" />
515
+
516
+ <col class="org-left" />
517
+ </colgroup>
518
+ <thead>
519
+ <tr>
520
+ <th scope="col" class="org-left">name</th>
521
+ <th scope="col" class="org-left">type</th>
522
+ <th scope="col" class="org-left">description</th>
523
+ <th scope="col" class="org-left">required</th>
524
+ <th scope="col" class="org-left">example</th>
525
+ </tr>
526
+ </thead>
527
+
528
+ <tbody>
529
+ <tr>
530
+ <td class="org-left">`query`</td>
531
+ <td class="org-left">`string`</td>
532
+ <td class="org-left">Query string</td>
533
+ <td class="org-left">yes</td>
534
+ <td class="org-left">`London`</td>
535
+ </tr>
536
+
537
+
538
+ <tr>
539
+ <td class="org-left">`suggestsCount`</td>
540
+ <td class="org-left">`number`</td>
541
+ <td class="org-left">Desired number of suggestions (default 6)</td>
542
+ <td class="org-left">no</td>
543
+ <td class="org-left">`10`</td>
544
+ </tr>
545
+ </tbody>
546
+ </table>
547
+
548
+
549
+ <a id="suggest-response"></a>
550
+
551
+ ### Response
552
+
553
+ const suggestions = await sapiClient.suggest('London', 2)
554
+
555
+ [
556
+ {
557
+ highlightValue: "<em>London</em>",
558
+ objectID: "158584",
559
+ objectType: "place",
560
+ placeDisplayName: "United Kingdom",
561
+ placeTypeName: "city",
562
+ value: "London"
563
+ },
564
+ {
565
+ highlightValue: "<em>London</em> Heathrow Airport",
566
+ objectID: "167733",
567
+ objectType: "place",
568
+ placeDisplayName: "London, United Kingdom",
569
+ placeTypeName: "airport",
570
+ value: "London Heathrow Airport"
571
+ }
572
+ ]
573
+
574
+ const suggestions = await sapiClient.suggest('London hotel', 2)
575
+
576
+ [
577
+ {
578
+ highlightValue: "Park Plaza Westminster Bridge <em>London</em>",
579
+ objectID: "1546646",
580
+ objectType: "hotel",
581
+ placeDisplayName: "London, United Kingdom",
582
+ placeTypeName: "property",
583
+ value: "Park Plaza Westminster Bridge London"
584
+ },
585
+ {
586
+ highlightValue: "Hampton by Hilton <em>London</em> Stansted Airport",
587
+ objectID: "3333916",
588
+ objectType: "hotel",
589
+ placeDisplayName: "United Kingdom",
590
+ placeTypeName: "property",
591
+ value: "Hampton by Hilton London Stansted Airport"
592
+ }
593
+ ]
594
+
595
+
489
596
  <a id="rooms-method"></a>
490
597
 
491
598
  ## `rooms()` method