Skip to content

Commit

Permalink
Merge f01c210 into 8901628
Browse files Browse the repository at this point in the history
  • Loading branch information
ElemelonWind committed Jul 12, 2022
2 parents 8901628 + f01c210 commit 5bdf6e0
Show file tree
Hide file tree
Showing 101 changed files with 530 additions and 437 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules/
coverage/
dist/
temp/
temp/
.DS_STORE
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The Answers Headless files listed in this repository are licensed under the below license.  All other features and products are subject to separate agreements
The Search Headless files listed in this repository are licensed under the below license.  All other features and products are subject to separate agreements
and certain functionality requires paid subscriptions to Yext products.

Contains information from the language-subtag-registry JSON Database (https://github.com/mattcg/language-subtag-registry/tree/master/data/json)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# answers-headless
A library for powering UI components for Yext Answers integrations.
# search-headless
A library for powering UI components for Yext Search integrations.

[Full Documentation](./docs/answers-headless.md)
[Full Documentation](./docs/search-headless.md)

<a href='https://coveralls.io/github/yext/answers-headless?branch=main'>
<img src='https://coveralls.io/repos/github/yext/answers-headless/badge.svg?branch=main' alt='Coverage Status' />
<a href='https://coveralls.io/github/yext/search-headless?branch=main'>
<img src='https://coveralls.io/repos/github/yext/search-headless/badge.svg?branch=main' alt='Coverage Status' />
</a>
19 changes: 0 additions & 19 deletions docs/search-headless.answersheadless.executeverticalquery.md

This file was deleted.

58 changes: 6 additions & 52 deletions docs/search-headless.answersheadless.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,15 @@

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [AnswersHeadless](./search-headless.answersheadless.md)

## AnswersHeadless class
## AnswersHeadless variable

Provides the functionality for interacting with an Answers Search experience.
> Warning: This API is now obsolete.
>
> AnswersHeadless has been deprecated and renamed to SearchHeadless
>
<b>Signature:</b>

```typescript
export default class AnswersHeadless
AnswersHeadless: typeof SearchHeadless
```

## Constructors

| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(core, stateManager, httpManager, additionalHttpHeaders)](./search-headless.answersheadless._constructor_.md) | | Constructs a new instance of the <code>AnswersHeadless</code> class |

## Properties

| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [state](./search-headless.answersheadless.state.md) | | [State](./search-headless.state.md) | Gets the current state of the AnswersHeadless instance. |
| [utilities](./search-headless.answersheadless.utilities.md) | | typeof answersUtilities | Common utility functions for manipulating Answers-related data. |

## Methods

| Method | Modifiers | Description |
| --- | --- | --- |
| [addListener(listener)](./search-headless.answersheadless.addlistener.md) | | Adds a listener for a specific state value of type T. |
| [executeFilterSearch(query, sectioned, fields)](./search-headless.answersheadless.executefiltersearch.md) | | Performs a filtersearch request against specified fields within a single vertical using the vertical key stored in state. |
| [executeUniversalAutocomplete()](./search-headless.answersheadless.executeuniversalautocomplete.md) | | Performs an autocomplete request across all verticals using the query input stored in state. |
| [executeUniversalQuery()](./search-headless.answersheadless.executeuniversalquery.md) | | Performs an Answers search across all verticals with relevant parts of the state used as input to the search. Updates the state with the response data. |
| [executeVerticalAutocomplete()](./search-headless.answersheadless.executeverticalautocomplete.md) | | Performs an autocomplete request for a single vertical using the query input and vertical key stored in state. |
| [executeVerticalQuery()](./search-headless.answersheadless.executeverticalquery.md) | | Perform an Answers search for a single vertical with relevant parts of the state used as input to the search. Updates the state with the response data. |
| [resetFacets()](./search-headless.answersheadless.resetfacets.md) | | Unselects all [facets](./search-headless.filtersstate.facets.md)<!-- -->. |
| [setAlternativeVerticals(alternativeVerticals)](./search-headless.answersheadless.setalternativeverticals.md) | | Sets the alternativeVerticals for [VerticalSearchState.noResults](./search-headless.verticalsearchstate.noresults.md) to the specified verticals. |
| [setContext(context)](./search-headless.answersheadless.setcontext.md) | | Sets [MetaState.context](./search-headless.metastate.context.md) to the specified context. |
| [setFacetOption(fieldId, facetOption, selected)](./search-headless.answersheadless.setfacetoption.md) | | Sets a specified facet option to be selected or unselected. |
| [setFacets(facets)](./search-headless.answersheadless.setfacets.md) | | Sets [FiltersState.facets](./search-headless.filtersstate.facets.md) to the specified facets. |
| [setFilterOption(filter)](./search-headless.answersheadless.setfilteroption.md) | | Sets a static filter option and whether or not it is selected in state. |
| [setOffset(offset)](./search-headless.answersheadless.setoffset.md) | | Sets [VerticalSearchState.offset](./search-headless.verticalsearchstate.offset.md) to the specified offset. |
| [setQuery(input)](./search-headless.answersheadless.setquery.md) | | Sets [QueryState.input](./search-headless.querystate.input.md) to the specified input. |
| [setQuerySource(source)](./search-headless.answersheadless.setquerysource.md) | | Sets [QueryState.querySource](./search-headless.querystate.querysource.md) to the specified source. |
| [setQueryTrigger(trigger)](./search-headless.answersheadless.setquerytrigger.md) | | Sets [QueryState.queryTrigger](./search-headless.querystate.querytrigger.md) to the specified trigger. |
| [setReferrerPageUrl(referrerPageUrl)](./search-headless.answersheadless.setreferrerpageurl.md) | | Sets [MetaState.referrerPageUrl](./search-headless.metastate.referrerpageurl.md) to the specified URL. |
| [setRestrictVerticals(restrictVerticals)](./search-headless.answersheadless.setrestrictverticals.md) | | Sets [UniversalSearchState.restrictVerticals](./search-headless.universalsearchstate.restrictverticals.md) to the specified vertical keys. |
| [setSessionId(sessionId)](./search-headless.answersheadless.setsessionid.md) | | Sets [SessionTrackingState.sessionId](./search-headless.sessiontrackingstate.sessionid.md) to the specified ID. |
| [setSessionTrackingEnabled(enabled)](./search-headless.answersheadless.setsessiontrackingenabled.md) | | Sets [SessionTrackingState.enabled](./search-headless.sessiontrackingstate.enabled.md) to the specified boolean value. |
| [setSortBys(sortBys)](./search-headless.answersheadless.setsortbys.md) | | Sets [VerticalSearchState.sortBys](./search-headless.verticalsearchstate.sortbys.md) to the specified sortBys. |
| [setSpellCheckEnabled(enabled)](./search-headless.answersheadless.setspellcheckenabled.md) | | Sets [SpellCheckState.enabled](./search-headless.spellcheckstate.enabled.md) to the specified boolean value. |
| [setState(state)](./search-headless.answersheadless.setstate.md) | | Sets the [State](./search-headless.state.md) to the specified state. |
| [setStaticFilters(filters)](./search-headless.answersheadless.setstaticfilters.md) | | Sets [FiltersState.static](./search-headless.filtersstate.static.md) to the specified filters. |
| [setUniversal()](./search-headless.answersheadless.setuniversal.md) | | Sets up Headless to manage universal searches. |
| [setUniversalLimit(limit)](./search-headless.answersheadless.setuniversallimit.md) | | Sets [UniversalSearchState.limit](./search-headless.universalsearchstate.limit.md) to the specified limit. |
| [setUserLocation(latLong)](./search-headless.answersheadless.setuserlocation.md) | | Sets [LocationState.userLocation](./search-headless.locationstate.userlocation.md) to the specified latitude and longitude. |
| [setVertical(verticalKey)](./search-headless.answersheadless.setvertical.md) | | Sets up Headless to manage the vertical indicated by the verticalKey. |
| [setVerticalLimit(limit)](./search-headless.answersheadless.setverticallimit.md) | | Sets [VerticalSearchState.limit](./search-headless.verticalsearchstate.limit.md) to the specified limit. |
| [submitQuestion(request)](./search-headless.answersheadless.submitquestion.md) | | Submits a question to the Answers API with the specified request data. |

13 changes: 0 additions & 13 deletions docs/search-headless.answersheadless.state.md

This file was deleted.

13 changes: 0 additions & 13 deletions docs/search-headless.answersheadless.utilities.md

This file was deleted.

15 changes: 9 additions & 6 deletions docs/search-headless.answersutilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [answersUtilities](./search-headless.answersutilities.md)

## answersUtilities namespace
## answersUtilities variable

## Functions
> Warning: This API is now obsolete.
>
> answersUtilities has been deprecated and renamed to searchUtilities
>
| Function | Description |
| --- | --- |
| [isCloseMatch(value, searchTerm)](./search-headless.answersutilities.isclosematch.md) | Checks if the searchTerm is a case-insensitive, Levenshtein match for the value. |
| [searchThroughFacet(facet, searchTerm)](./search-headless.answersutilities.searchthroughfacet.md) | Searches through the specified facet and filters out the options that aren't a close match for the given searchTerm. The comparison is case insensitive. |
<b>Signature:</b>

```typescript
answersUtilities: typeof searchUtilities
```
2 changes: 1 addition & 1 deletion docs/search-headless.default_headless_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## DEFAULT\_HEADLESS\_ID variable

The headlessId automatically given to the first AnswersHeadless instance created.
The headlessId automatically given to the first SearchHeadless instance created.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs/search-headless.directanswerstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ export interface DirectAnswerState

| Property | Type | Description |
| --- | --- | --- |
| [result?](./search-headless.directanswerstate.result.md) | [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) \| [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md) | <i>(Optional)</i> The data for the direct answer. The type of the data is determined by the Answers API based on whether the answer was found within a document or was a field value in the knowledge graph. |
| [result?](./search-headless.directanswerstate.result.md) | [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) \| [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md) | <i>(Optional)</i> The data for the direct answer. The type of the data is determined by the Search API based on whether the answer was found within a document or was a field value in the knowledge graph. |

2 changes: 1 addition & 1 deletion docs/search-headless.directanswerstate.result.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## DirectAnswerState.result property

The data for the direct answer. The type of the data is determined by the Answers API based on whether the answer was found within a document or was a field value in the knowledge graph.
The data for the direct answer. The type of the data is determined by the Search API based on whether the answer was found within a document or was a field value in the knowledge graph.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs/search-headless.headlessconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## HeadlessConfig type

The configuration for an AnswersHeadless instance.
The configuration for an SearchHeadless instance.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs/search-headless.locationstate.locationbias.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## LocationState.locationBias property

The geographical location bias used in the search, returned from the Answers API.
The geographical location bias used in the search, returned from the Search API.

<b>Signature:</b>

Expand Down
2 changes: 1 addition & 1 deletion docs/search-headless.locationstate.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export interface LocationState

| Property | Type | Description |
| --- | --- | --- |
| [locationBias?](./search-headless.locationstate.locationbias.md) | [LocationBias](./search-headless.locationbias.md) | <i>(Optional)</i> The geographical location bias used in the search, returned from the Answers API. |
| [locationBias?](./search-headless.locationstate.locationbias.md) | [LocationBias](./search-headless.locationbias.md) | <i>(Optional)</i> The geographical location bias used in the search, returned from the Search API. |
| [userLocation?](./search-headless.locationstate.userlocation.md) | [LatLong](./search-headless.latlong.md) | <i>(Optional)</i> The latitude and longitude of the user making the request. Used to bias the results. |

0 comments on commit 5bdf6e0

Please sign in to comment.