diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index 9ae4310c..8c826c40 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -62,11 +62,11 @@ SOFTWARE. The following NPM package may be included in this product: - - @yext/answers-core@1.7.0 + - @yext/search-core@1.8.0 This package contains the following license and notice below: -The Answers Core files listed in this repository are licensed under the below license.  All other features and products are subject to separate agreements +The Search Core 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) diff --git a/__mocks__/@yext/answers-core.ts b/__mocks__/@yext/answers-core.ts index b5360b84..21782a94 100644 --- a/__mocks__/@yext/answers-core.ts +++ b/__mocks__/@yext/answers-core.ts @@ -1,4 +1,4 @@ -export * from '@yext/answers-core'; +export * from '@yext/search-core'; export function provideCore(): unknown { return { diff --git a/api-extractor.json b/api-extractor.json index 19381780..da4041fc 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -60,7 +60,7 @@ * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been * local files for library1. */ - "bundledPackages": [ "@yext/answers-core" ], + "bundledPackages": [ "@yext/search-core" ], /** * Determines how the TypeScript compiler engine will be invoked by API Extractor. diff --git a/docs/search-headless.additionalhttpheaders._client-sdk_.md b/docs/search-headless.additionalhttpheaders._client-sdk_.md index 65685d74..5c3ff41f 100644 --- a/docs/search-headless.additionalhttpheaders._client-sdk_.md +++ b/docs/search-headless.additionalhttpheaders._client-sdk_.md @@ -4,7 +4,7 @@ ## AdditionalHttpHeaders."Client-SDK" property -Additional agents and their versions used to create the Answers experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. +Additional agents and their versions used to create the Search experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. Signature: diff --git a/docs/search-headless.additionalhttpheaders.md b/docs/search-headless.additionalhttpheaders.md index 6cd3d732..36da04a0 100644 --- a/docs/search-headless.additionalhttpheaders.md +++ b/docs/search-headless.additionalhttpheaders.md @@ -16,5 +16,5 @@ export declare interface AdditionalHttpHeaders | Property | Type | Description | | --- | --- | --- | -| ["Client-SDK"?](./search-headless.additionalhttpheaders._client-sdk_.md) | [ClientSDKHeaderValues](./search-headless.clientsdkheadervalues.md) | (Optional) Additional agents and their versions used to create the Answers experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. | +| ["Client-SDK"?](./search-headless.additionalhttpheaders._client-sdk_.md) | [ClientSDKHeaderValues](./search-headless.clientsdkheadervalues.md) | (Optional) Additional agents and their versions used to create the Search experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. | diff --git a/docs/search-headless.answersconfig.md b/docs/search-headless.answersconfig.md index 3bfb92f3..3642f101 100644 --- a/docs/search-headless.answersconfig.md +++ b/docs/search-headless.answersconfig.md @@ -4,12 +4,15 @@ ## AnswersConfig type -The main configuration options for [AnswersCore](./search-headless.answerscore.md). For a full description of the options, see [BaseAnswersConfig](./search-headless.baseanswersconfig.md). The config requires either an apiKey or a token. +> Warning: This API is now obsolete. +> +> AnswersConfig is deprecated and has been replaced by [SearchConfig](./search-headless.searchconfig.md) +> Signature: ```typescript -export declare type AnswersConfig = AnswersConfigWithApiKey | AnswersConfigWithToken; +export declare type AnswersConfig = SearchConfig; ``` -References: [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md), [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) +References: [SearchConfig](./search-headless.searchconfig.md) diff --git a/docs/search-headless.answersconfigwithapikey.apikey.md b/docs/search-headless.answersconfigwithapikey.apikey.md deleted file mode 100644 index 72c66e34..00000000 --- a/docs/search-headless.answersconfigwithapikey.apikey.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) > [apiKey](./search-headless.answersconfigwithapikey.apikey.md) - -## AnswersConfigWithApiKey.apiKey property - -The api key of the answers experience which will be sent as a query param. - -Signature: - -```typescript -apiKey: string; -``` diff --git a/docs/search-headless.answersconfigwithapikey.md b/docs/search-headless.answersconfigwithapikey.md index 43cdeb09..70b3d3f1 100644 --- a/docs/search-headless.answersconfigwithapikey.md +++ b/docs/search-headless.answersconfigwithapikey.md @@ -4,19 +4,15 @@ ## AnswersConfigWithApiKey interface -Configuration options for [AnswersCore](./search-headless.answerscore.md), which includes the options from [BaseAnswersConfig](./search-headless.baseanswersconfig.md), but requires apiKey. +> Warning: This API is now obsolete. +> +> AnswersConfigWithApiKey is deprecated and has been replaced by [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) +> Signature: ```typescript -export declare interface AnswersConfigWithApiKey extends BaseAnswersConfig +export declare interface AnswersConfigWithApiKey extends SearchConfigWithApiKey ``` -Extends: [BaseAnswersConfig](./search-headless.baseanswersconfig.md) - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [apiKey](./search-headless.answersconfigwithapikey.apikey.md) | string | The api key of the answers experience which will be sent as a query param. | -| [token?](./search-headless.answersconfigwithapikey.token.md) | never | (Optional) token should NOT be provided along with apiKey. | +Extends: [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) diff --git a/docs/search-headless.answersconfigwithtoken.md b/docs/search-headless.answersconfigwithtoken.md index 9aad9d5e..dd00b76a 100644 --- a/docs/search-headless.answersconfigwithtoken.md +++ b/docs/search-headless.answersconfigwithtoken.md @@ -4,19 +4,15 @@ ## AnswersConfigWithToken interface -Configuration options for [AnswersCore](./search-headless.answerscore.md), which includes the options from [BaseAnswersConfig](./search-headless.baseanswersconfig.md), but requires token. +> Warning: This API is now obsolete. +> +> AnswersConfigWithToken is deprecated and has been replaced by [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) +> Signature: ```typescript -export declare interface AnswersConfigWithToken extends BaseAnswersConfig +export declare interface AnswersConfigWithToken extends SearchConfigWithToken ``` -Extends: [BaseAnswersConfig](./search-headless.baseanswersconfig.md) - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [apiKey?](./search-headless.answersconfigwithtoken.apikey.md) | never | (Optional) apiKey should NOT be provided along with token. | -| [token](./search-headless.answersconfigwithtoken.token.md) | string | The authentication token of the answers experience which will be passed in the Auth header as a Bearer token. | +Extends: [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) diff --git a/docs/search-headless.answersconfigwithtoken.token.md b/docs/search-headless.answersconfigwithtoken.token.md deleted file mode 100644 index 50f34915..00000000 --- a/docs/search-headless.answersconfigwithtoken.token.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) > [token](./search-headless.answersconfigwithtoken.token.md) - -## AnswersConfigWithToken.token property - -The authentication token of the answers experience which will be passed in the Auth header as a Bearer token. - -Signature: - -```typescript -token: string; -``` diff --git a/docs/search-headless.answerscore.md b/docs/search-headless.answerscore.md index 2ce43d0c..8d9b67af 100644 --- a/docs/search-headless.answerscore.md +++ b/docs/search-headless.answerscore.md @@ -4,28 +4,15 @@ ## AnswersCore class -Provides methods for executing searches, submitting questions, and performing autocompletes. +> Warning: This API is now obsolete. +> +> AnswersCore is deprecated and has been replaced by [SearchCore](./search-headless.searchcore.md) +> Signature: ```typescript -export declare class AnswersCore +export declare class AnswersCore extends SearchCore ``` - -## Constructors - -| Constructor | Modifiers | Description | -| --- | --- | --- | -| [(constructor)(searchService, questionSubmissionService, autoCompleteService)](./search-headless.answerscore._constructor_.md) | | Constructs a new instance of the AnswersCore class | - -## Methods - -| Method | Modifiers | Description | -| --- | --- | --- | -| [filterSearch(request)](./search-headless.answerscore.filtersearch.md) | | Performs a filtersearch request against specified fields within a single vertical. | -| [submitQuestion(request)](./search-headless.answerscore.submitquestion.md) | | Submits a custom question to the Answers API. | -| [universalAutocomplete(request)](./search-headless.answerscore.universalautocomplete.md) | | Performs an autocomplete request across all verticals. | -| [universalSearch(request)](./search-headless.answerscore.universalsearch.md) | | Performs an Answers search across all verticals. | -| [verticalAutocomplete(request)](./search-headless.answerscore.verticalautocomplete.md) | | Performs an autocomplete request for a single vertical. | -| [verticalSearch(request)](./search-headless.answerscore.verticalsearch.md) | | Performs an Answers search for a single vertical. | +Extends: [SearchCore](./search-headless.searchcore.md) diff --git a/docs/search-headless.answerserror.md b/docs/search-headless.answerserror.md index 7f847a46..c6aa99a6 100644 --- a/docs/search-headless.answerserror.md +++ b/docs/search-headless.answerserror.md @@ -2,26 +2,17 @@ [Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersError](./search-headless.answerserror.md) -## AnswersError class +## AnswersError interface -Represents an error +> Warning: This API is now obsolete. +> +> AnswersError is deprecated and has been replaced by [SearchError](./search-headless.searcherror.md) +> Signature: ```typescript -export declare class AnswersError extends Error +export declare interface AnswersError extends SearchError ``` -Extends: Error - -## Remarks - -If the error originates from the Answer API, the code and type property will be present. - -## Properties - -| Property | Modifiers | Type | Description | -| --- | --- | --- | --- | -| [code?](./search-headless.answerserror.code.md) | | number | (Optional) Answers API error code. | -| [message](./search-headless.answerserror.message.md) | | string | The error message. | -| [type?](./search-headless.answerserror.type.md) | | string | (Optional) Answers API error type. | +Extends: [SearchError](./search-headless.searcherror.md) diff --git a/docs/search-headless.answersrequest.md b/docs/search-headless.answersrequest.md index 45cfc5d3..ef1f1198 100644 --- a/docs/search-headless.answersrequest.md +++ b/docs/search-headless.answersrequest.md @@ -4,17 +4,15 @@ ## AnswersRequest interface -Options for an Answers API request. +> Warning: This API is now obsolete. +> +> AnswersRequest is deprecated and has been replaced by [SearchRequest](./search-headless.searchrequest.md) +> Signature: ```typescript -export declare interface AnswersRequest +export declare interface AnswersRequest extends SearchRequest ``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [additionalHttpHeaders?](./search-headless.answersrequest.additionalhttpheaders.md) | [AdditionalHttpHeaders](./search-headless.additionalhttpheaders.md) | (Optional) AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers. | +Extends: [SearchRequest](./search-headless.searchrequest.md) diff --git a/docs/search-headless.appliedqueryfilter.md b/docs/search-headless.appliedqueryfilter.md index 0f30bd66..ed342f5e 100644 --- a/docs/search-headless.appliedqueryfilter.md +++ b/docs/search-headless.appliedqueryfilter.md @@ -4,7 +4,7 @@ ## AppliedQueryFilter interface -A filter that the Answers API applied to the search. +A filter that the Search API applied to the search. Signature: diff --git a/docs/search-headless.autocompleteresponse.inputintents.md b/docs/search-headless.autocompleteresponse.inputintents.md index ebb3cca2..a229ca6b 100644 --- a/docs/search-headless.autocompleteresponse.inputintents.md +++ b/docs/search-headless.autocompleteresponse.inputintents.md @@ -4,7 +4,7 @@ ## AutocompleteResponse.inputIntents property -Represents intents from the Answers API. +Represents intents from the Search API. Signature: diff --git a/docs/search-headless.autocompleteresponse.md b/docs/search-headless.autocompleteresponse.md index 60ee61e5..0d915373 100644 --- a/docs/search-headless.autocompleteresponse.md +++ b/docs/search-headless.autocompleteresponse.md @@ -16,7 +16,7 @@ export declare interface AutocompleteResponse | Property | Type | Description | | --- | --- | --- | -| [inputIntents](./search-headless.autocompleteresponse.inputintents.md) | [SearchIntent](./search-headless.searchintent.md)\[\] | Represents intents from the Answers API. | +| [inputIntents](./search-headless.autocompleteresponse.inputintents.md) | [SearchIntent](./search-headless.searchintent.md)\[\] | Represents intents from the Search API. | | [queryId?](./search-headless.autocompleteresponse.queryid.md) | string | (Optional) The ID of the search query. | | [results](./search-headless.autocompleteresponse.results.md) | [AutocompleteResult](./search-headless.autocompleteresult.md)\[\] | An array of [AutocompleteResult](./search-headless.autocompleteresult.md)s. | | [uuid](./search-headless.autocompleteresponse.uuid.md) | string | A unique id which corresponds to the request. | diff --git a/docs/search-headless.baseanswersconfig.experiencekey.md b/docs/search-headless.baseanswersconfig.experiencekey.md deleted file mode 100644 index 5ef58900..00000000 --- a/docs/search-headless.baseanswersconfig.experiencekey.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseAnswersConfig](./search-headless.baseanswersconfig.md) > [experienceKey](./search-headless.baseanswersconfig.experiencekey.md) - -## BaseAnswersConfig.experienceKey property - -The experience key of the answers experience. - -Signature: - -```typescript -experienceKey: string; -``` diff --git a/docs/search-headless.baseanswersconfig.locale.md b/docs/search-headless.baseanswersconfig.locale.md deleted file mode 100644 index 4078a994..00000000 --- a/docs/search-headless.baseanswersconfig.locale.md +++ /dev/null @@ -1,13 +0,0 @@ - - -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseAnswersConfig](./search-headless.baseanswersconfig.md) > [locale](./search-headless.baseanswersconfig.locale.md) - -## BaseAnswersConfig.locale property - -The locale of the answers experience. - -Signature: - -```typescript -locale: string; -``` diff --git a/docs/search-headless.baseanswersconfig.md b/docs/search-headless.baseanswersconfig.md index febb96a9..cf0a755f 100644 --- a/docs/search-headless.baseanswersconfig.md +++ b/docs/search-headless.baseanswersconfig.md @@ -4,21 +4,15 @@ ## BaseAnswersConfig interface -The base configuration options for [AnswersCore](./search-headless.answerscore.md). +> Warning: This API is now obsolete. +> +> BaseAnswersConfig is deprecated and has been replaced by [BaseSearchConfig](./search-headless.basesearchconfig.md) +> Signature: ```typescript -export declare interface BaseAnswersConfig +export declare interface BaseAnswersConfig extends BaseSearchConfig ``` - -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [endpoints?](./search-headless.baseanswersconfig.endpoints.md) | [Endpoints](./search-headless.endpoints.md) | (Optional) Overrides for the URLs which are used when making requests to the Answers API. | -| [experienceKey](./search-headless.baseanswersconfig.experiencekey.md) | string | The experience key of the answers experience. | -| [experienceVersion?](./search-headless.baseanswersconfig.experienceversion.md) | 'STAGING' \| 'PRODUCTION' \| string \| number | (Optional) The version of the answers experience configuration. | -| [locale](./search-headless.baseanswersconfig.locale.md) | string | The locale of the answers experience. | -| [visitor?](./search-headless.baseanswersconfig.visitor.md) | [Visitor](./search-headless.visitor.md) | (Optional) Information used to associate requests with a particular user. | +Extends: [BaseSearchConfig](./search-headless.basesearchconfig.md) diff --git a/docs/search-headless.baseanswersconfig.endpoints.md b/docs/search-headless.basesearchconfig.endpoints.md similarity index 56% rename from docs/search-headless.baseanswersconfig.endpoints.md rename to docs/search-headless.basesearchconfig.endpoints.md index be9ad45d..01ea98aa 100644 --- a/docs/search-headless.baseanswersconfig.endpoints.md +++ b/docs/search-headless.basesearchconfig.endpoints.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseAnswersConfig](./search-headless.baseanswersconfig.md) > [endpoints](./search-headless.baseanswersconfig.endpoints.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) > [endpoints](./search-headless.basesearchconfig.endpoints.md) -## BaseAnswersConfig.endpoints property +## BaseSearchConfig.endpoints property -Overrides for the URLs which are used when making requests to the Answers API. +Overrides for the URLs which are used when making requests to the Search API. Signature: diff --git a/docs/search-headless.basesearchconfig.experiencekey.md b/docs/search-headless.basesearchconfig.experiencekey.md new file mode 100644 index 00000000..74356661 --- /dev/null +++ b/docs/search-headless.basesearchconfig.experiencekey.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) > [experienceKey](./search-headless.basesearchconfig.experiencekey.md) + +## BaseSearchConfig.experienceKey property + +The experience key of the search experience. + +Signature: + +```typescript +experienceKey: string; +``` diff --git a/docs/search-headless.baseanswersconfig.experienceversion.md b/docs/search-headless.basesearchconfig.experienceversion.md similarity index 57% rename from docs/search-headless.baseanswersconfig.experienceversion.md rename to docs/search-headless.basesearchconfig.experienceversion.md index 8e4f294c..647080b2 100644 --- a/docs/search-headless.baseanswersconfig.experienceversion.md +++ b/docs/search-headless.basesearchconfig.experienceversion.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseAnswersConfig](./search-headless.baseanswersconfig.md) > [experienceVersion](./search-headless.baseanswersconfig.experienceversion.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) > [experienceVersion](./search-headless.basesearchconfig.experienceversion.md) -## BaseAnswersConfig.experienceVersion property +## BaseSearchConfig.experienceVersion property -The version of the answers experience configuration. +The version of the search experience configuration. Signature: diff --git a/docs/search-headless.basesearchconfig.locale.md b/docs/search-headless.basesearchconfig.locale.md new file mode 100644 index 00000000..b2b9abe8 --- /dev/null +++ b/docs/search-headless.basesearchconfig.locale.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) > [locale](./search-headless.basesearchconfig.locale.md) + +## BaseSearchConfig.locale property + +The locale of the search experience. + +Signature: + +```typescript +locale: string; +``` diff --git a/docs/search-headless.basesearchconfig.md b/docs/search-headless.basesearchconfig.md new file mode 100644 index 00000000..41211133 --- /dev/null +++ b/docs/search-headless.basesearchconfig.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) + +## BaseSearchConfig interface + +The base configuration options for [SearchCore](./search-headless.searchcore.md). + +Signature: + +```typescript +export declare interface BaseSearchConfig +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [endpoints?](./search-headless.basesearchconfig.endpoints.md) | [Endpoints](./search-headless.endpoints.md) | (Optional) Overrides for the URLs which are used when making requests to the Search API. | +| [experienceKey](./search-headless.basesearchconfig.experiencekey.md) | string | The experience key of the search experience. | +| [experienceVersion?](./search-headless.basesearchconfig.experienceversion.md) | 'STAGING' \| 'PRODUCTION' \| string \| number | (Optional) The version of the search experience configuration. | +| [locale](./search-headless.basesearchconfig.locale.md) | string | The locale of the search experience. | +| [visitor?](./search-headless.basesearchconfig.visitor.md) | [Visitor](./search-headless.visitor.md) | (Optional) Information used to associate requests with a particular user. | + diff --git a/docs/search-headless.baseanswersconfig.visitor.md b/docs/search-headless.basesearchconfig.visitor.md similarity index 66% rename from docs/search-headless.baseanswersconfig.visitor.md rename to docs/search-headless.basesearchconfig.visitor.md index 055b50ff..46cbdc32 100644 --- a/docs/search-headless.baseanswersconfig.visitor.md +++ b/docs/search-headless.basesearchconfig.visitor.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseAnswersConfig](./search-headless.baseanswersconfig.md) > [visitor](./search-headless.baseanswersconfig.visitor.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [BaseSearchConfig](./search-headless.basesearchconfig.md) > [visitor](./search-headless.basesearchconfig.visitor.md) -## BaseAnswersConfig.visitor property +## BaseSearchConfig.visitor property Information used to associate requests with a particular user. diff --git a/docs/search-headless.clientsdkheadervalues.answers_core.md b/docs/search-headless.clientsdkheadervalues.answers_core.md index 27564cea..6ef8911c 100644 --- a/docs/search-headless.clientsdkheadervalues.answers_core.md +++ b/docs/search-headless.clientsdkheadervalues.answers_core.md @@ -4,7 +4,7 @@ ## ClientSDKHeaderValues.ANSWERS\_CORE property -The ANSWERS\_CORE agent should not be supplied. Instead, it will be automatically added to the header and populated with the version of Answers Core being used. +The ANSWERS\_CORE agent should not be supplied. Instead, it will be automatically added to the header and populated with the version of Search Core being used. Signature: diff --git a/docs/search-headless.clientsdkheadervalues.md b/docs/search-headless.clientsdkheadervalues.md index f9471afb..51c1620e 100644 --- a/docs/search-headless.clientsdkheadervalues.md +++ b/docs/search-headless.clientsdkheadervalues.md @@ -4,7 +4,7 @@ ## ClientSDKHeaderValues interface -Additional agents and their versions used to create the Answers experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. +Additional agents and their versions used to create the Search experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. Signature: @@ -16,5 +16,5 @@ export declare interface ClientSDKHeaderValues | Property | Type | Description | | --- | --- | --- | -| [ANSWERS\_CORE?](./search-headless.clientsdkheadervalues.answers_core.md) | never | (Optional) The ANSWERS\_CORE agent should not be supplied. Instead, it will be automatically added to the header and populated with the version of Answers Core being used. | +| [ANSWERS\_CORE?](./search-headless.clientsdkheadervalues.answers_core.md) | never | (Optional) The ANSWERS\_CORE agent should not be supplied. Instead, it will be automatically added to the header and populated with the version of Search Core being used. | diff --git a/docs/search-headless.context.md b/docs/search-headless.context.md index fddc047f..6b53a350 100644 --- a/docs/search-headless.context.md +++ b/docs/search-headless.context.md @@ -4,7 +4,7 @@ ## Context type -Used to trigger Answers [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). +Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). Signature: diff --git a/docs/search-headless.endpoints.md b/docs/search-headless.endpoints.md index 4cebfe5e..7df496cc 100644 --- a/docs/search-headless.endpoints.md +++ b/docs/search-headless.endpoints.md @@ -4,7 +4,7 @@ ## Endpoints interface -Overrides for the URLs which are used when making requests to the Answers API. +Overrides for the URLs which are used when making requests to the Search API. Signature: diff --git a/docs/search-headless.facet.md b/docs/search-headless.facet.md index 6249ab14..8d195ca5 100644 --- a/docs/search-headless.facet.md +++ b/docs/search-headless.facet.md @@ -4,7 +4,7 @@ ## Facet interface -Represents dynamic filter options for the Answers API. +Represents dynamic filter options for the Search API. Signature: diff --git a/docs/search-headless.filtersearchrequest.md b/docs/search-headless.filtersearchrequest.md index 4d78f6c0..d4159e38 100644 --- a/docs/search-headless.filtersearchrequest.md +++ b/docs/search-headless.filtersearchrequest.md @@ -9,9 +9,9 @@ Options for a filtersearch request. Signature: ```typescript -export declare interface FilterSearchRequest extends AnswersRequest +export declare interface FilterSearchRequest extends SearchRequest ``` -Extends: [AnswersRequest](./search-headless.answersrequest.md) +Extends: [SearchRequest](./search-headless.searchrequest.md) ## Properties diff --git a/docs/search-headless.filtersearchresponse.businessid.md b/docs/search-headless.filtersearchresponse.businessid.md index 0bc5fbd4..f165643d 100644 --- a/docs/search-headless.filtersearchresponse.businessid.md +++ b/docs/search-headless.filtersearchresponse.businessid.md @@ -4,7 +4,7 @@ ## FilterSearchResponse.businessId property -ID of the account associated with this Answers experience +ID of the account associated with this Search experience. Signature: diff --git a/docs/search-headless.filtersearchresponse.md b/docs/search-headless.filtersearchresponse.md index bb83b6c4..9d28833c 100644 --- a/docs/search-headless.filtersearchresponse.md +++ b/docs/search-headless.filtersearchresponse.md @@ -16,7 +16,7 @@ export declare interface FilterSearchResponse | Property | Type | Description | | --- | --- | --- | -| [businessId?](./search-headless.filtersearchresponse.businessid.md) | string | (Optional) ID of the account associated with this Answers experience | +| [businessId?](./search-headless.filtersearchresponse.businessid.md) | string | (Optional) ID of the account associated with this Search experience. | | [queryId?](./search-headless.filtersearchresponse.queryid.md) | string | (Optional) The ID of the search query. | | [sections](./search-headless.filtersearchresponse.sections.md) | { label?: string; results: [AutocompleteResult](./search-headless.autocompleteresult.md)\[\]; }\[\] | Represents autocomplete results separated by field. | | [uuid](./search-headless.filtersearchresponse.uuid.md) | string | A unique id which corresponds to the request. | diff --git a/docs/search-headless.headlessconfig.md b/docs/search-headless.headlessconfig.md index 19257d26..62554b43 100644 --- a/docs/search-headless.headlessconfig.md +++ b/docs/search-headless.headlessconfig.md @@ -9,10 +9,10 @@ The configuration for a SearchHeadless instance. Signature: ```typescript -export declare type HeadlessConfig = AnswersConfig & { +export declare type HeadlessConfig = SearchConfig & { headlessId?: string; verticalKey?: string; }; ``` -References: [AnswersConfig](./search-headless.answersconfig.md) +References: [SearchConfig](./search-headless.searchconfig.md) diff --git a/docs/search-headless.highlightedfields.md b/docs/search-headless.highlightedfields.md index 7c523832..347c4547 100644 --- a/docs/search-headless.highlightedfields.md +++ b/docs/search-headless.highlightedfields.md @@ -4,7 +4,7 @@ ## HighlightedFields type -A mapping of fields to the values emphasized by the Answers API +A mapping of fields to the values emphasized by the Search API. Signature: diff --git a/docs/search-headless.highlightedvalue.md b/docs/search-headless.highlightedvalue.md index 7a3103ad..2c130a51 100644 --- a/docs/search-headless.highlightedvalue.md +++ b/docs/search-headless.highlightedvalue.md @@ -4,7 +4,7 @@ ## HighlightedValue interface -A field value and its substring matches as emphasized by the Answers API. +A field value and its substring matches as emphasized by the Search API. Signature: diff --git a/docs/search-headless.highlightedvalue.value.md b/docs/search-headless.highlightedvalue.value.md index efe8cef6..3e5de0cd 100644 --- a/docs/search-headless.highlightedvalue.value.md +++ b/docs/search-headless.highlightedvalue.value.md @@ -14,5 +14,5 @@ value: string; ## Remarks -No formatting is applied to this value. This is simply the value that the Answers API determined should be highlighted. +No formatting is applied to this value. This is simply the value that the Search API determined should be highlighted. diff --git a/docs/search-headless.md b/docs/search-headless.md index 9dab6bcd..54d637cf 100644 --- a/docs/search-headless.md +++ b/docs/search-headless.md @@ -8,9 +8,10 @@ | Class | Description | | --- | --- | -| [AnswersCore](./search-headless.answerscore.md) | Provides methods for executing searches, submitting questions, and performing autocompletes. | -| [AnswersError](./search-headless.answerserror.md) | Represents an error | -| [SearchHeadless](./search-headless.searchheadless.md) | Provides the functionality for interacting with an Search experience. | +| [AnswersCore](./search-headless.answerscore.md) | | +| [SearchCore](./search-headless.searchcore.md) | Provides methods for executing searches, submitting questions, and performing autocompletes. | +| [SearchError](./search-headless.searcherror.md) | Represents an error | +| [SearchHeadless](./search-headless.searchheadless.md) | Provides the functionality for interacting with a Search experience. | ## Enumerations @@ -25,7 +26,7 @@ | [Matcher](./search-headless.matcher.md) | A Matcher is a filtering operation. | | [QuerySource](./search-headless.querysource.md) | The source of the search request. | | [QueryTrigger](./search-headless.querytrigger.md) | Describes the ways a search can be executed besides user input. | -| [SearchIntent](./search-headless.searchintent.md) | Represents intents from the Answers API. | +| [SearchIntent](./search-headless.searchintent.md) | Represents intents from the Search API. | | [SearchTypeEnum](./search-headless.searchtypeenum.md) | An enum which indicates the type of search that Headless is managing. | | [SortType](./search-headless.sorttype.md) | The method of sorting. | | [Source](./search-headless.source.md) | Represents the source of a [Result](./search-headless.result.md). | @@ -48,23 +49,25 @@ | --- | --- | | [AdditionalHttpHeaders](./search-headless.additionalhttpheaders.md) | AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers. | | [AllResultsForVertical](./search-headless.allresultsforvertical.md) | Represents all results for the current vertical. | -| [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) | Configuration options for [AnswersCore](./search-headless.answerscore.md), which includes the options from [BaseAnswersConfig](./search-headless.baseanswersconfig.md), but requires apiKey. | -| [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) | Configuration options for [AnswersCore](./search-headless.answerscore.md), which includes the options from [BaseAnswersConfig](./search-headless.baseanswersconfig.md), but requires token. | -| [AnswersRequest](./search-headless.answersrequest.md) | Options for an Answers API request. | -| [AppliedQueryFilter](./search-headless.appliedqueryfilter.md) | A filter that the Answers API applied to the search. | +| [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) | | +| [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) | | +| [AnswersError](./search-headless.answerserror.md) | | +| [AnswersRequest](./search-headless.answersrequest.md) | | +| [AppliedQueryFilter](./search-headless.appliedqueryfilter.md) | A filter that the Search API applied to the search. | | [AutocompleteResponse](./search-headless.autocompleteresponse.md) | The response of a universal or vertical autocomplete request. | | [AutocompleteResult](./search-headless.autocompleteresult.md) | An autocomplete suggestion. | | [AutocompleteService](./search-headless.autocompleteservice.md) | A service for autocomplete requests. | -| [BaseAnswersConfig](./search-headless.baseanswersconfig.md) | The base configuration options for [AnswersCore](./search-headless.answerscore.md). | +| [BaseAnswersConfig](./search-headless.baseanswersconfig.md) | | +| [BaseSearchConfig](./search-headless.basesearchconfig.md) | The base configuration options for [SearchCore](./search-headless.searchcore.md). | | [BoundedRange](./search-headless.boundedrange.md) | An interface representing a range of values of type T. | -| [ClientSDKHeaderValues](./search-headless.clientsdkheadervalues.md) | Additional agents and their versions used to create the Answers experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. | +| [ClientSDKHeaderValues](./search-headless.clientsdkheadervalues.md) | Additional agents and their versions used to create the Search experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. | | [CombinedFilter](./search-headless.combinedfilter.md) | Represents multiple filters that will be combined to refine results. | | [DirectAnswer](./search-headless.directanswer.md) | A direct answer to a search. | | [DirectAnswerState](./search-headless.directanswerstate.md) | Maintains the direct answer associated with the latest search. | | [DisplayableFacet](./search-headless.displayablefacet.md) | A [Facet](./search-headless.facet.md) which contains extra fields meant to be displayed to the end user. | | [DisplayableFacetOption](./search-headless.displayablefacetoption.md) | A [FacetOption](./search-headless.facetoption.md) with extra data meant to be displayed to the end user. | -| [Endpoints](./search-headless.endpoints.md) | Overrides for the URLs which are used when making requests to the Answers API. | -| [Facet](./search-headless.facet.md) | Represents dynamic filter options for the Answers API. | +| [Endpoints](./search-headless.endpoints.md) | Overrides for the URLs which are used when making requests to the Search API. | +| [Facet](./search-headless.facet.md) | Represents dynamic filter options for the Search API. | | [FacetOption](./search-headless.facetoption.md) | A filter associated with the facet. | | [FailedVertical](./search-headless.failedvertical.md) | Error information from when a vertical fails to return results. | | [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) | A direct answer which was found within a document. | @@ -73,7 +76,7 @@ | [FilterSearchRequest](./search-headless.filtersearchrequest.md) | Options for a filtersearch request. | | [FilterSearchResponse](./search-headless.filtersearchresponse.md) | The response of a filtersearch request. | | [FiltersState](./search-headless.filtersstate.md) | Maintains the current state of facets and filters in the application. | -| [HighlightedValue](./search-headless.highlightedvalue.md) | A field value and its substring matches as emphasized by the Answers API. | +| [HighlightedValue](./search-headless.highlightedvalue.md) | A field value and its substring matches as emphasized by the Search API. | | [LatLong](./search-headless.latlong.md) | The latitude and longitude of the user making the request. Used to bias the results. | | [LocationBias](./search-headless.locationbias.md) | Information about the user's location. | | [LocationBoundingBox](./search-headless.locationboundingbox.md) | Location boundaries for a filter with "Place" for its [AppliedQueryFilterType](./search-headless.appliedqueryfiltertype.md). (e.g. boundary for a locality or region specific location filter) | @@ -84,16 +87,19 @@ | [NearFilterValue](./search-headless.nearfiltervalue.md) | A filter value for a filter with a $near [Matcher](./search-headless.matcher.md). | | [NumberRangeValue](./search-headless.numberrangevalue.md) | A filter value for a filter with a $between [Matcher](./search-headless.matcher.md). | | [ParentState](./search-headless.parentstate.md) | The overall shape of the redux state tree, with each key value pair of headlessId to [State](./search-headless.state.md) representing a single SearchHeadless instance. | -| [QueryRulesActionsData](./search-headless.queryrulesactionsdata.md) | Data returned from the Answers query rules system. | +| [QueryRulesActionsData](./search-headless.queryrulesactionsdata.md) | Data returned from the Search query rules system. | | [QueryRulesState](./search-headless.queryrulesstate.md) | Maintains the data from the triggered query rules. | | [QueryState](./search-headless.querystate.md) | Maintains the latest query and its associated data. | | [QuestionSubmissionRequest](./search-headless.questionsubmissionrequest.md) | Options for a QuestionSubmission request. | | [QuestionSubmissionResponse](./search-headless.questionsubmissionresponse.md) | A representation of a question submission response. | -| [QuestionSubmissionService](./search-headless.questionsubmissionservice.md) | Submits a custom question to the Answers API. | +| [QuestionSubmissionService](./search-headless.questionsubmissionservice.md) | Submits a custom question to the Search API. | | [RangeBoundary](./search-headless.rangeboundary.md) | A boundary for a [BoundedRange](./search-headless.boundedrange.md) of type T. | | [Result](./search-headless.result.md) | An individual search result. | +| [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) | Configuration options for [SearchCore](./search-headless.searchcore.md), which includes the options from [BaseSearchConfig](./search-headless.basesearchconfig.md), but requires apiKey. | +| [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) | Configuration options for [SearchCore](./search-headless.searchcore.md), which includes the options from [BaseSearchConfig](./search-headless.basesearchconfig.md), but requires token. | | [SearchParameterField](./search-headless.searchparameterfield.md) | Indicates which entity field to perform the autocomplete request on. | -| [SearchService](./search-headless.searchservice.md) | A service which performs Yext Answers searches | +| [SearchRequest](./search-headless.searchrequest.md) | Options for a Search API request. | +| [SearchService](./search-headless.searchservice.md) | A service which performs Yext Search. | | [SearchStatusState](./search-headless.searchstatusstate.md) | Maintains the status of the latest search. | | [SelectableFilter](./search-headless.selectablefilter.md) | A [Filter](./search-headless.filter.md) with additional information, such as an optional display name and whether or not it is selected. | | [SessionTrackingState](./search-headless.sessiontrackingstate.md) | Maintains whether the user session should be tracked and, if so, the session information. | @@ -137,11 +143,12 @@ | Type Alias | Description | | --- | --- | -| [AnswersConfig](./search-headless.answersconfig.md) | The main configuration options for [AnswersCore](./search-headless.answerscore.md). For a full description of the options, see [BaseAnswersConfig](./search-headless.baseanswersconfig.md). The config requires either an apiKey or a token. | -| [Context](./search-headless.context.md) | Used to trigger Answers [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | +| [AnswersConfig](./search-headless.answersconfig.md) | | +| [Context](./search-headless.context.md) | Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | | [EnumOrLiteral](./search-headless.enumorliteral.md) | Produces a union type from the enum passed as a generic which consists of the enum values and the string literals of the enum. | | [FilterTypes](./search-headless.filtertypes.md) | A union type for the different kinds of filter. | | [HeadlessConfig](./search-headless.headlessconfig.md) | The configuration for a SearchHeadless instance. | -| [HighlightedFields](./search-headless.highlightedfields.md) | A mapping of fields to the values emphasized by the Answers API | +| [HighlightedFields](./search-headless.highlightedfields.md) | A mapping of fields to the values emphasized by the Search API. | +| [SearchConfig](./search-headless.searchconfig.md) | The main configuration options for [SearchCore](./search-headless.searchcore.md). For a full description of the options, see [BaseSearchConfig](./search-headless.basesearchconfig.md). The config requires either an apiKey or a token. | | [SearchType](./search-headless.searchtype.md) | An enum and its corresponding string literals which indicate the type of search that Headless is managing. | diff --git a/docs/search-headless.queryrulesactionsdata.md b/docs/search-headless.queryrulesactionsdata.md index 9733adc1..016b9f3a 100644 --- a/docs/search-headless.queryrulesactionsdata.md +++ b/docs/search-headless.queryrulesactionsdata.md @@ -4,7 +4,7 @@ ## QueryRulesActionsData interface -Data returned from the Answers query rules system. +Data returned from the Search query rules system. Signature: diff --git a/docs/search-headless.querysource.md b/docs/search-headless.querysource.md index 191cffe1..2760cbdd 100644 --- a/docs/search-headless.querysource.md +++ b/docs/search-headless.querysource.md @@ -17,6 +17,6 @@ export declare enum QuerySource | Member | Value | Description | | --- | --- | --- | | Autocomplete | "AUTOCOMPLETE" | Indicates that the query was initiated from visual autocomplete. | -| Overlay | "OVERLAY" | Indicates that the query was initiated from an Answers Overlay. | -| Standard | "STANDARD" | Indicates that the query was initiated from a standard Answers integration. | +| Overlay | "OVERLAY" | Indicates that the query was initiated from a Search Overlay. | +| Standard | "STANDARD" | Indicates that the query was initiated from a standard Search integration. | diff --git a/docs/search-headless.querytrigger.md b/docs/search-headless.querytrigger.md index 9c67cce2..adfe5209 100644 --- a/docs/search-headless.querytrigger.md +++ b/docs/search-headless.querytrigger.md @@ -25,5 +25,5 @@ Used for search analytics. If a user supplied the search query, do not include a ## Example -An answers site may be configured to perform a search for 'What services do you offer?' when the page loads. Because that query is a default query rather than a user-supplied query, the Initialize QueryTrigger should be included in the request. +A Search site may be configured to perform a search for 'What services do you offer?' when the page loads. Because that query is a default query rather than a user-supplied query, the Initialize QueryTrigger should be included in the request. diff --git a/docs/search-headless.questionsubmissionrequest.md b/docs/search-headless.questionsubmissionrequest.md index 0c6cbc9b..10becc40 100644 --- a/docs/search-headless.questionsubmissionrequest.md +++ b/docs/search-headless.questionsubmissionrequest.md @@ -9,9 +9,9 @@ Options for a QuestionSubmission request. Signature: ```typescript -export declare interface QuestionSubmissionRequest extends AnswersRequest +export declare interface QuestionSubmissionRequest extends SearchRequest ``` -Extends: [AnswersRequest](./search-headless.answersrequest.md) +Extends: [SearchRequest](./search-headless.searchrequest.md) ## Properties diff --git a/docs/search-headless.questionsubmissionservice.md b/docs/search-headless.questionsubmissionservice.md index 0e7cf4d0..b117006e 100644 --- a/docs/search-headless.questionsubmissionservice.md +++ b/docs/search-headless.questionsubmissionservice.md @@ -4,7 +4,7 @@ ## QuestionSubmissionService interface -Submits a custom question to the Answers API. +Submits a custom question to the Search API. Signature: diff --git a/docs/search-headless.searchconfig.md b/docs/search-headless.searchconfig.md new file mode 100644 index 00000000..88b80bf4 --- /dev/null +++ b/docs/search-headless.searchconfig.md @@ -0,0 +1,15 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfig](./search-headless.searchconfig.md) + +## SearchConfig type + +The main configuration options for [SearchCore](./search-headless.searchcore.md). For a full description of the options, see [BaseSearchConfig](./search-headless.basesearchconfig.md). The config requires either an apiKey or a token. + +Signature: + +```typescript +export declare type SearchConfig = SearchConfigWithApiKey | SearchConfigWithToken; +``` +References: [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md), [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) + diff --git a/docs/search-headless.searchconfigwithapikey.apikey.md b/docs/search-headless.searchconfigwithapikey.apikey.md new file mode 100644 index 00000000..0b0ce9ba --- /dev/null +++ b/docs/search-headless.searchconfigwithapikey.apikey.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) > [apiKey](./search-headless.searchconfigwithapikey.apikey.md) + +## SearchConfigWithApiKey.apiKey property + +The api key of the search experience which will be sent as a query param. + +Signature: + +```typescript +apiKey: string; +``` diff --git a/docs/search-headless.searchconfigwithapikey.md b/docs/search-headless.searchconfigwithapikey.md new file mode 100644 index 00000000..090f71ef --- /dev/null +++ b/docs/search-headless.searchconfigwithapikey.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) + +## SearchConfigWithApiKey interface + +Configuration options for [SearchCore](./search-headless.searchcore.md), which includes the options from [BaseSearchConfig](./search-headless.basesearchconfig.md), but requires apiKey. + +Signature: + +```typescript +export declare interface SearchConfigWithApiKey extends BaseSearchConfig +``` +Extends: [BaseSearchConfig](./search-headless.basesearchconfig.md) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [apiKey](./search-headless.searchconfigwithapikey.apikey.md) | string | The api key of the search experience which will be sent as a query param. | +| [token?](./search-headless.searchconfigwithapikey.token.md) | never | (Optional) token should NOT be provided along with apiKey. | + diff --git a/docs/search-headless.answersconfigwithapikey.token.md b/docs/search-headless.searchconfigwithapikey.token.md similarity index 55% rename from docs/search-headless.answersconfigwithapikey.token.md rename to docs/search-headless.searchconfigwithapikey.token.md index ae39b2d4..58550fad 100644 --- a/docs/search-headless.answersconfigwithapikey.token.md +++ b/docs/search-headless.searchconfigwithapikey.token.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) > [token](./search-headless.answersconfigwithapikey.token.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfigWithApiKey](./search-headless.searchconfigwithapikey.md) > [token](./search-headless.searchconfigwithapikey.token.md) -## AnswersConfigWithApiKey.token property +## SearchConfigWithApiKey.token property token should NOT be provided along with apiKey. diff --git a/docs/search-headless.answersconfigwithtoken.apikey.md b/docs/search-headless.searchconfigwithtoken.apikey.md similarity index 55% rename from docs/search-headless.answersconfigwithtoken.apikey.md rename to docs/search-headless.searchconfigwithtoken.apikey.md index 52ffa271..3579426a 100644 --- a/docs/search-headless.answersconfigwithtoken.apikey.md +++ b/docs/search-headless.searchconfigwithtoken.apikey.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) > [apiKey](./search-headless.answersconfigwithtoken.apikey.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) > [apiKey](./search-headless.searchconfigwithtoken.apikey.md) -## AnswersConfigWithToken.apiKey property +## SearchConfigWithToken.apiKey property apiKey should NOT be provided along with token. diff --git a/docs/search-headless.searchconfigwithtoken.md b/docs/search-headless.searchconfigwithtoken.md new file mode 100644 index 00000000..2d0a30f0 --- /dev/null +++ b/docs/search-headless.searchconfigwithtoken.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) + +## SearchConfigWithToken interface + +Configuration options for [SearchCore](./search-headless.searchcore.md), which includes the options from [BaseSearchConfig](./search-headless.basesearchconfig.md), but requires token. + +Signature: + +```typescript +export declare interface SearchConfigWithToken extends BaseSearchConfig +``` +Extends: [BaseSearchConfig](./search-headless.basesearchconfig.md) + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [apiKey?](./search-headless.searchconfigwithtoken.apikey.md) | never | (Optional) apiKey should NOT be provided along with token. | +| [token](./search-headless.searchconfigwithtoken.token.md) | string | The authentication token of the search experience which will be passed in the Auth header as a Bearer token. | + diff --git a/docs/search-headless.searchconfigwithtoken.token.md b/docs/search-headless.searchconfigwithtoken.token.md new file mode 100644 index 00000000..c749fb8b --- /dev/null +++ b/docs/search-headless.searchconfigwithtoken.token.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchConfigWithToken](./search-headless.searchconfigwithtoken.md) > [token](./search-headless.searchconfigwithtoken.token.md) + +## SearchConfigWithToken.token property + +The authentication token of the search experience which will be passed in the Auth header as a Bearer token. + +Signature: + +```typescript +token: string; +``` diff --git a/docs/search-headless.answerscore._constructor_.md b/docs/search-headless.searchcore._constructor_.md similarity index 74% rename from docs/search-headless.answerscore._constructor_.md rename to docs/search-headless.searchcore._constructor_.md index 29e9942a..763c7487 100644 --- a/docs/search-headless.answerscore._constructor_.md +++ b/docs/search-headless.searchcore._constructor_.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [(constructor)](./search-headless.answerscore._constructor_.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [(constructor)](./search-headless.searchcore._constructor_.md) -## AnswersCore.(constructor) +## SearchCore.(constructor) -Constructs a new instance of the `AnswersCore` class +Constructs a new instance of the `SearchCore` class Signature: diff --git a/docs/search-headless.answerscore.filtersearch.md b/docs/search-headless.searchcore.filtersearch.md similarity index 80% rename from docs/search-headless.answerscore.filtersearch.md rename to docs/search-headless.searchcore.filtersearch.md index 698ca48b..850d60b2 100644 --- a/docs/search-headless.answerscore.filtersearch.md +++ b/docs/search-headless.searchcore.filtersearch.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [filterSearch](./search-headless.answerscore.filtersearch.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [filterSearch](./search-headless.searchcore.filtersearch.md) -## AnswersCore.filterSearch() method +## SearchCore.filterSearch() method Performs a filtersearch request against specified fields within a single vertical. @@ -24,7 +24,7 @@ Promise<[FilterSearchResponse](./search-headless.filtersearchresponse.md). +This differs from the vertical autocomplete because the vertical autocomplete operates on all entity fields whereas filtersearch operates only on specified fields. If rejected, the reason will be an [SearchError](./search-headless.searcherror.md). ## Example diff --git a/docs/search-headless.searchcore.md b/docs/search-headless.searchcore.md new file mode 100644 index 00000000..ae4a2086 --- /dev/null +++ b/docs/search-headless.searchcore.md @@ -0,0 +1,31 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) + +## SearchCore class + +Provides methods for executing searches, submitting questions, and performing autocompletes. + +Signature: + +```typescript +export declare class SearchCore +``` + +## Constructors + +| Constructor | Modifiers | Description | +| --- | --- | --- | +| [(constructor)(searchService, questionSubmissionService, autoCompleteService)](./search-headless.searchcore._constructor_.md) | | Constructs a new instance of the SearchCore class | + +## Methods + +| Method | Modifiers | Description | +| --- | --- | --- | +| [filterSearch(request)](./search-headless.searchcore.filtersearch.md) | | Performs a filtersearch request against specified fields within a single vertical. | +| [submitQuestion(request)](./search-headless.searchcore.submitquestion.md) | | Submits a custom question to the Search API. | +| [universalAutocomplete(request)](./search-headless.searchcore.universalautocomplete.md) | | Performs an autocomplete request across all verticals. | +| [universalSearch(request)](./search-headless.searchcore.universalsearch.md) | | Performs a search across all verticals. | +| [verticalAutocomplete(request)](./search-headless.searchcore.verticalautocomplete.md) | | Performs an autocomplete request for a single vertical. | +| [verticalSearch(request)](./search-headless.searchcore.verticalsearch.md) | | Performs a search for a single vertical. | + diff --git a/docs/search-headless.answerscore.submitquestion.md b/docs/search-headless.searchcore.submitquestion.md similarity index 64% rename from docs/search-headless.answerscore.submitquestion.md rename to docs/search-headless.searchcore.submitquestion.md index 18baac8d..320963c7 100644 --- a/docs/search-headless.answerscore.submitquestion.md +++ b/docs/search-headless.searchcore.submitquestion.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [submitQuestion](./search-headless.answerscore.submitquestion.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [submitQuestion](./search-headless.searchcore.submitquestion.md) -## AnswersCore.submitQuestion() method +## SearchCore.submitQuestion() method -Submits a custom question to the Answers API. +Submits a custom question to the Search API. Signature: @@ -24,5 +24,5 @@ Promise<[QuestionSubmissionResponse](./search-headless.questionsubmissionresp ## Remarks -If rejected, the reason will be an [AnswersError](./search-headless.answerserror.md). +If rejected, the reason will be an [SearchError](./search-headless.searcherror.md). diff --git a/docs/search-headless.answerscore.universalautocomplete.md b/docs/search-headless.searchcore.universalautocomplete.md similarity index 68% rename from docs/search-headless.answerscore.universalautocomplete.md rename to docs/search-headless.searchcore.universalautocomplete.md index b6bc7b82..cebca219 100644 --- a/docs/search-headless.answerscore.universalautocomplete.md +++ b/docs/search-headless.searchcore.universalautocomplete.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [universalAutocomplete](./search-headless.answerscore.universalautocomplete.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [universalAutocomplete](./search-headless.searchcore.universalautocomplete.md) -## AnswersCore.universalAutocomplete() method +## SearchCore.universalAutocomplete() method Performs an autocomplete request across all verticals. @@ -24,5 +24,5 @@ Promise<[AutocompleteResponse](./search-headless.autocompleteresponse.md). +If rejected, the reason will be an [SearchError](./search-headless.searcherror.md). diff --git a/docs/search-headless.answerscore.universalsearch.md b/docs/search-headless.searchcore.universalsearch.md similarity index 63% rename from docs/search-headless.answerscore.universalsearch.md rename to docs/search-headless.searchcore.universalsearch.md index 5d5462f0..b5b96b0c 100644 --- a/docs/search-headless.answerscore.universalsearch.md +++ b/docs/search-headless.searchcore.universalsearch.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [universalSearch](./search-headless.answerscore.universalsearch.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [universalSearch](./search-headless.searchcore.universalsearch.md) -## AnswersCore.universalSearch() method +## SearchCore.universalSearch() method -Performs an Answers search across all verticals. +Performs a search across all verticals. Signature: @@ -24,5 +24,5 @@ Promise<[UniversalSearchResponse](./search-headless.universalsearchresponse.m ## Remarks -If rejected, the reason will be an [AnswersError](./search-headless.answerserror.md). +If rejected, the reason will be an [SearchError](./search-headless.searcherror.md). diff --git a/docs/search-headless.answerscore.verticalautocomplete.md b/docs/search-headless.searchcore.verticalautocomplete.md similarity index 68% rename from docs/search-headless.answerscore.verticalautocomplete.md rename to docs/search-headless.searchcore.verticalautocomplete.md index 987e3b1c..2e961f2f 100644 --- a/docs/search-headless.answerscore.verticalautocomplete.md +++ b/docs/search-headless.searchcore.verticalautocomplete.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [verticalAutocomplete](./search-headless.answerscore.verticalautocomplete.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [verticalAutocomplete](./search-headless.searchcore.verticalautocomplete.md) -## AnswersCore.verticalAutocomplete() method +## SearchCore.verticalAutocomplete() method Performs an autocomplete request for a single vertical. @@ -24,5 +24,5 @@ Promise<[AutocompleteResponse](./search-headless.autocompleteresponse.md). +If rejected, the reason will be an [SearchError](./search-headless.searcherror.md). diff --git a/docs/search-headless.answerscore.verticalsearch.md b/docs/search-headless.searchcore.verticalsearch.md similarity index 63% rename from docs/search-headless.answerscore.verticalsearch.md rename to docs/search-headless.searchcore.verticalsearch.md index b427cb82..6efac35e 100644 --- a/docs/search-headless.answerscore.verticalsearch.md +++ b/docs/search-headless.searchcore.verticalsearch.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersCore](./search-headless.answerscore.md) > [verticalSearch](./search-headless.answerscore.verticalsearch.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchCore](./search-headless.searchcore.md) > [verticalSearch](./search-headless.searchcore.verticalsearch.md) -## AnswersCore.verticalSearch() method +## SearchCore.verticalSearch() method -Performs an Answers search for a single vertical. +Performs a search for a single vertical. Signature: @@ -24,5 +24,5 @@ Promise<[VerticalSearchResponse](./search-headless.verticalsearchresponse.md) ## Remarks -If rejected, the reason will be an [AnswersError](./search-headless.answerserror.md). +If rejected, the reason will be an [SearchError](./search-headless.searcherror.md). diff --git a/docs/search-headless.answerserror.code.md b/docs/search-headless.searcherror.code.md similarity index 52% rename from docs/search-headless.answerserror.code.md rename to docs/search-headless.searcherror.code.md index 27bee863..1c8b8fb5 100644 --- a/docs/search-headless.answerserror.code.md +++ b/docs/search-headless.searcherror.code.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersError](./search-headless.answerserror.md) > [code](./search-headless.answerserror.code.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchError](./search-headless.searcherror.md) > [code](./search-headless.searcherror.code.md) -## AnswersError.code property +## SearchError.code property -Answers API error code. +Search API error code. Signature: diff --git a/docs/search-headless.searcherror.md b/docs/search-headless.searcherror.md new file mode 100644 index 00000000..9e70279f --- /dev/null +++ b/docs/search-headless.searcherror.md @@ -0,0 +1,27 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchError](./search-headless.searcherror.md) + +## SearchError class + +Represents an error + +Signature: + +```typescript +export declare class SearchError extends Error +``` +Extends: Error + +## Remarks + +If the error originates from the Search API, the code and type property will be present. + +## Properties + +| Property | Modifiers | Type | Description | +| --- | --- | --- | --- | +| [code?](./search-headless.searcherror.code.md) | | number | (Optional) Search API error code. | +| [message](./search-headless.searcherror.message.md) | | string | The error message. | +| [type?](./search-headless.searcherror.type.md) | | string | (Optional) Search API error type. | + diff --git a/docs/search-headless.answerserror.message.md b/docs/search-headless.searcherror.message.md similarity index 57% rename from docs/search-headless.answerserror.message.md rename to docs/search-headless.searcherror.message.md index 7e29f286..8df7939e 100644 --- a/docs/search-headless.answerserror.message.md +++ b/docs/search-headless.searcherror.message.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersError](./search-headless.answerserror.md) > [message](./search-headless.answerserror.message.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchError](./search-headless.searcherror.md) > [message](./search-headless.searcherror.message.md) -## AnswersError.message property +## SearchError.message property The error message. diff --git a/docs/search-headless.answerserror.type.md b/docs/search-headless.searcherror.type.md similarity index 52% rename from docs/search-headless.answerserror.type.md rename to docs/search-headless.searcherror.type.md index d1d03584..1173d5c8 100644 --- a/docs/search-headless.answerserror.type.md +++ b/docs/search-headless.searcherror.type.md @@ -1,10 +1,10 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersError](./search-headless.answerserror.md) > [type](./search-headless.answerserror.type.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchError](./search-headless.searcherror.md) > [type](./search-headless.searcherror.type.md) -## AnswersError.type property +## SearchError.type property -Answers API error type. +Search API error type. Signature: diff --git a/docs/search-headless.searchheadless._constructor_.md b/docs/search-headless.searchheadless._constructor_.md index 5c45809d..e6d1be0b 100644 --- a/docs/search-headless.searchheadless._constructor_.md +++ b/docs/search-headless.searchheadless._constructor_.md @@ -9,14 +9,14 @@ Constructs a new instance of the `SearchHeadless` class Signature: ```typescript -constructor(core: AnswersCore, stateManager: StateManager, httpManager: HttpManager, additionalHttpHeaders?: AdditionalHttpHeaders | undefined); +constructor(core: SearchCore, stateManager: StateManager, httpManager: HttpManager, additionalHttpHeaders?: AdditionalHttpHeaders | undefined); ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| core | [AnswersCore](./search-headless.answerscore.md) | | +| core | [SearchCore](./search-headless.searchcore.md) | | | stateManager | StateManager | | | httpManager | HttpManager | | | additionalHttpHeaders | [AdditionalHttpHeaders](./search-headless.additionalhttpheaders.md) \| undefined | | diff --git a/docs/search-headless.searchheadless.md b/docs/search-headless.searchheadless.md index 658d509a..4163f2ae 100644 --- a/docs/search-headless.searchheadless.md +++ b/docs/search-headless.searchheadless.md @@ -4,7 +4,7 @@ ## SearchHeadless class -Provides the functionality for interacting with an Search experience. +Provides the functionality for interacting with a Search experience. Signature: diff --git a/docs/search-headless.searchintent.md b/docs/search-headless.searchintent.md index 1efe76de..1dc82924 100644 --- a/docs/search-headless.searchintent.md +++ b/docs/search-headless.searchintent.md @@ -4,7 +4,7 @@ ## SearchIntent enum -Represents intents from the Answers API. +Represents intents from the Search API. Signature: @@ -16,5 +16,5 @@ export declare enum SearchIntent | Member | Value | Description | | --- | --- | --- | -| NearMe | "NEAR_ME" | The Answers API is requesting a prompt for the user's location. | +| NearMe | "NEAR_ME" | The Search API is requesting a prompt for the user's location. | diff --git a/docs/search-headless.answersrequest.additionalhttpheaders.md b/docs/search-headless.searchrequest.additionalhttpheaders.md similarity index 60% rename from docs/search-headless.answersrequest.additionalhttpheaders.md rename to docs/search-headless.searchrequest.additionalhttpheaders.md index 7b57cc90..bb991b68 100644 --- a/docs/search-headless.answersrequest.additionalhttpheaders.md +++ b/docs/search-headless.searchrequest.additionalhttpheaders.md @@ -1,8 +1,8 @@ -[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [AnswersRequest](./search-headless.answersrequest.md) > [additionalHttpHeaders](./search-headless.answersrequest.additionalhttpheaders.md) +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchRequest](./search-headless.searchrequest.md) > [additionalHttpHeaders](./search-headless.searchrequest.additionalhttpheaders.md) -## AnswersRequest.additionalHttpHeaders property +## SearchRequest.additionalHttpHeaders property AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers. diff --git a/docs/search-headless.searchrequest.md b/docs/search-headless.searchrequest.md new file mode 100644 index 00000000..f051600b --- /dev/null +++ b/docs/search-headless.searchrequest.md @@ -0,0 +1,20 @@ + + +[Home](./index.md) > [@yext/search-headless](./search-headless.md) > [SearchRequest](./search-headless.searchrequest.md) + +## SearchRequest interface + +Options for a Search API request. + +Signature: + +```typescript +export declare interface SearchRequest +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [additionalHttpHeaders?](./search-headless.searchrequest.additionalhttpheaders.md) | [AdditionalHttpHeaders](./search-headless.additionalhttpheaders.md) | (Optional) AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers. | + diff --git a/docs/search-headless.searchservice.md b/docs/search-headless.searchservice.md index d92e497c..8a3c8227 100644 --- a/docs/search-headless.searchservice.md +++ b/docs/search-headless.searchservice.md @@ -4,7 +4,7 @@ ## SearchService interface -A service which performs Yext Answers searches +A service which performs Yext Search. Signature: diff --git a/docs/search-headless.source.md b/docs/search-headless.source.md index 121707c6..678c26c2 100644 --- a/docs/search-headless.source.md +++ b/docs/search-headless.source.md @@ -20,6 +20,6 @@ export declare enum Source | Bing | "BING_CSE" | The result is from Bing Search Engine. | | Custom | "CUSTOM_SEARCHER" | The result was from a custom source. | | Google | "GOOGLE_CSE" | The result is from Google Custom Search Engine. | -| KnowledgeManager | "KNOWLEDGE_MANAGER" | The result is from an Answers Knowledge Graph. | +| KnowledgeManager | "KNOWLEDGE_MANAGER" | The result is from a Knowledge Graph. | | Zendesk | "ZENDESK" | The result is from Zendesk. | diff --git a/docs/search-headless.universalautocompleterequest.md b/docs/search-headless.universalautocompleterequest.md index 4e67bb45..dd26eaa5 100644 --- a/docs/search-headless.universalautocompleterequest.md +++ b/docs/search-headless.universalautocompleterequest.md @@ -9,9 +9,9 @@ Options for a universal autocomplete request. Signature: ```typescript -export declare interface UniversalAutocompleteRequest extends AnswersRequest +export declare interface UniversalAutocompleteRequest extends SearchRequest ``` -Extends: [AnswersRequest](./search-headless.answersrequest.md) +Extends: [SearchRequest](./search-headless.searchrequest.md) ## Properties diff --git a/docs/search-headless.universalsearchrequest.context.md b/docs/search-headless.universalsearchrequest.context.md index 8016f0ca..e6f08168 100644 --- a/docs/search-headless.universalsearchrequest.context.md +++ b/docs/search-headless.universalsearchrequest.context.md @@ -4,7 +4,7 @@ ## UniversalSearchRequest.context property -Used to trigger Answers [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). +Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). Signature: diff --git a/docs/search-headless.universalsearchrequest.md b/docs/search-headless.universalsearchrequest.md index c33262b0..9af59147 100644 --- a/docs/search-headless.universalsearchrequest.md +++ b/docs/search-headless.universalsearchrequest.md @@ -9,15 +9,15 @@ Options which can be specified for a universal search. Signature: ```typescript -export declare interface UniversalSearchRequest extends AnswersRequest +export declare interface UniversalSearchRequest extends SearchRequest ``` -Extends: [AnswersRequest](./search-headless.answersrequest.md) +Extends: [SearchRequest](./search-headless.searchrequest.md) ## Properties | Property | Type | Description | | --- | --- | --- | -| [context?](./search-headless.universalsearchrequest.context.md) | [Context](./search-headless.context.md) | (Optional) Used to trigger Answers [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | +| [context?](./search-headless.universalsearchrequest.context.md) | [Context](./search-headless.context.md) | (Optional) Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | | [limit?](./search-headless.universalsearchrequest.limit.md) | [UniversalLimit](./search-headless.universallimit.md) | (Optional) The maximum limit of results per vertical. Each limit can be set from 1-50, inclusive. | | [location?](./search-headless.universalsearchrequest.location.md) | [LatLong](./search-headless.latlong.md) | (Optional) The latitude and longitude of the user making the request. Used to bias the results. | | [query](./search-headless.universalsearchrequest.query.md) | string | The search query. | diff --git a/docs/search-headless.universalsearchresponse.md b/docs/search-headless.universalsearchresponse.md index bd2e465b..44e16d63 100644 --- a/docs/search-headless.universalsearchresponse.md +++ b/docs/search-headless.universalsearchresponse.md @@ -20,7 +20,7 @@ export declare interface UniversalSearchResponse | [failedVerticals?](./search-headless.universalsearchresponse.failedverticals.md) | [FailedVertical](./search-headless.failedvertical.md)\[\] | (Optional) Error information from when a vertical fails to return results. | | [locationBias?](./search-headless.universalsearchresponse.locationbias.md) | [LocationBias](./search-headless.locationbias.md) | (Optional) Information about the user's location. | | [queryId?](./search-headless.universalsearchresponse.queryid.md) | string | (Optional) The ID of the search query. | -| [queryRulesActionsData?](./search-headless.universalsearchresponse.queryrulesactionsdata.md) | [QueryRulesActionsData](./search-headless.queryrulesactionsdata.md)\[\] | (Optional) Data returned from the Answers query rules system. | +| [queryRulesActionsData?](./search-headless.universalsearchresponse.queryrulesactionsdata.md) | [QueryRulesActionsData](./search-headless.queryrulesactionsdata.md)\[\] | (Optional) Data returned from the Search query rules system. | | [searchIntents?](./search-headless.universalsearchresponse.searchintents.md) | [SearchIntent](./search-headless.searchintent.md)\[\] | (Optional) An array of [SearchIntent](./search-headless.searchintent.md)s which represents requests from the API. | | [spellCheck?](./search-headless.universalsearchresponse.spellcheck.md) | [SpellCheck](./search-headless.spellcheck.md) | (Optional) A spellcheck response from a search query. | | [uuid](./search-headless.universalsearchresponse.uuid.md) | string | A unique id which corresponds to the request. | diff --git a/docs/search-headless.universalsearchresponse.queryrulesactionsdata.md b/docs/search-headless.universalsearchresponse.queryrulesactionsdata.md index 24374dfd..ceaee97b 100644 --- a/docs/search-headless.universalsearchresponse.queryrulesactionsdata.md +++ b/docs/search-headless.universalsearchresponse.queryrulesactionsdata.md @@ -4,7 +4,7 @@ ## UniversalSearchResponse.queryRulesActionsData property -Data returned from the Answers query rules system. +Data returned from the Search query rules system. Signature: diff --git a/docs/search-headless.verticalautocompleterequest.md b/docs/search-headless.verticalautocompleterequest.md index 53d49fcc..f2bf3b7b 100644 --- a/docs/search-headless.verticalautocompleterequest.md +++ b/docs/search-headless.verticalautocompleterequest.md @@ -9,9 +9,9 @@ Options for a vertial autocomplete request. Signature: ```typescript -export declare interface VerticalAutocompleteRequest extends AnswersRequest +export declare interface VerticalAutocompleteRequest extends SearchRequest ``` -Extends: [AnswersRequest](./search-headless.answersrequest.md) +Extends: [SearchRequest](./search-headless.searchrequest.md) ## Properties diff --git a/docs/search-headless.verticalsearchrequest.context.md b/docs/search-headless.verticalsearchrequest.context.md index 8a837477..f229070f 100644 --- a/docs/search-headless.verticalsearchrequest.context.md +++ b/docs/search-headless.verticalsearchrequest.context.md @@ -4,7 +4,7 @@ ## VerticalSearchRequest.context property -Used to trigger Answers [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). +Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). Signature: diff --git a/docs/search-headless.verticalsearchrequest.md b/docs/search-headless.verticalsearchrequest.md index 5c242ee4..4602ba9b 100644 --- a/docs/search-headless.verticalsearchrequest.md +++ b/docs/search-headless.verticalsearchrequest.md @@ -9,15 +9,15 @@ Options which can be specified for a vertical search. Signature: ```typescript -export declare interface VerticalSearchRequest extends AnswersRequest +export declare interface VerticalSearchRequest extends SearchRequest ``` -Extends: [AnswersRequest](./search-headless.answersrequest.md) +Extends: [SearchRequest](./search-headless.searchrequest.md) ## Properties | Property | Type | Description | | --- | --- | --- | -| [context?](./search-headless.verticalsearchrequest.context.md) | [Context](./search-headless.context.md) | (Optional) Used to trigger Answers [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | +| [context?](./search-headless.verticalsearchrequest.context.md) | [Context](./search-headless.context.md) | (Optional) Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/). | | [facets?](./search-headless.verticalsearchrequest.facets.md) | [Facet](./search-headless.facet.md)\[\] | (Optional) The facet filters to apply to the search. | | [limit?](./search-headless.verticalsearchrequest.limit.md) | number | (Optional) The maximum number of results to include with a max of 50. | | [location?](./search-headless.verticalsearchrequest.location.md) | [LatLong](./search-headless.latlong.md) | (Optional) The latitude and longitude of the user making the request. Used to bias the results. | diff --git a/docs/search-headless.verticalsearchresponse.md b/docs/search-headless.verticalsearchresponse.md index 92751551..7c0e1168 100644 --- a/docs/search-headless.verticalsearchresponse.md +++ b/docs/search-headless.verticalsearchresponse.md @@ -22,7 +22,7 @@ export declare interface VerticalSearchResponse | [facets?](./search-headless.verticalsearchresponse.facets.md) | [DisplayableFacet](./search-headless.displayablefacet.md)\[\] | (Optional) An array of [Facet](./search-headless.facet.md)s associated with the search results. | | [locationBias?](./search-headless.verticalsearchresponse.locationbias.md) | [LocationBias](./search-headless.locationbias.md) | (Optional) Information about the user's location. | | [queryId](./search-headless.verticalsearchresponse.queryid.md) | string | The ID of the query. | -| [queryRulesActionsData?](./search-headless.verticalsearchresponse.queryrulesactionsdata.md) | [QueryRulesActionsData](./search-headless.queryrulesactionsdata.md)\[\] | (Optional) Data returned from the Answers query rules system. | +| [queryRulesActionsData?](./search-headless.verticalsearchresponse.queryrulesactionsdata.md) | [QueryRulesActionsData](./search-headless.queryrulesactionsdata.md)\[\] | (Optional) Data returned from the Search query rules system. | | [searchIntents?](./search-headless.verticalsearchresponse.searchintents.md) | [SearchIntent](./search-headless.searchintent.md)\[\] | (Optional) An array of [SearchIntent](./search-headless.searchintent.md)s. | | [spellCheck?](./search-headless.verticalsearchresponse.spellcheck.md) | [SpellCheck](./search-headless.spellcheck.md) | (Optional) A spellcheck response from a search query. | | [uuid](./search-headless.verticalsearchresponse.uuid.md) | string | A unique id which corresponds to the request. | diff --git a/docs/search-headless.verticalsearchresponse.queryrulesactionsdata.md b/docs/search-headless.verticalsearchresponse.queryrulesactionsdata.md index 276c2315..796bd7d8 100644 --- a/docs/search-headless.verticalsearchresponse.queryrulesactionsdata.md +++ b/docs/search-headless.verticalsearchresponse.queryrulesactionsdata.md @@ -4,7 +4,7 @@ ## VerticalSearchResponse.queryRulesActionsData property -Data returned from the Answers query rules system. +Data returned from the Search query rules system. Signature: diff --git a/etc/search-headless.api.md b/etc/search-headless.api.md index 75d31c54..6aa62db7 100644 --- a/etc/search-headless.api.md +++ b/etc/search-headless.api.md @@ -18,46 +18,30 @@ export interface AllResultsForVertical { resultsCount: number; } -// @public -export type AnswersConfig = AnswersConfigWithApiKey | AnswersConfigWithToken; +// @public @deprecated (undocumented) +export type AnswersConfig = SearchConfig; -// @public -export interface AnswersConfigWithApiKey extends BaseAnswersConfig { - apiKey: string; - token?: never; +// @public @deprecated (undocumented) +export interface AnswersConfigWithApiKey extends SearchConfigWithApiKey { } -// @public -export interface AnswersConfigWithToken extends BaseAnswersConfig { - apiKey?: never; - token: string; +// @public @deprecated (undocumented) +export interface AnswersConfigWithToken extends SearchConfigWithToken { } -// @public -export class AnswersCore { - constructor(searchService: SearchService, questionSubmissionService: QuestionSubmissionService, autoCompleteService: AutocompleteService); - filterSearch(request: FilterSearchRequest): Promise; - submitQuestion(request: QuestionSubmissionRequest): Promise; - universalAutocomplete(request: UniversalAutocompleteRequest): Promise; - universalSearch(request: UniversalSearchRequest): Promise; - verticalAutocomplete(request: VerticalAutocompleteRequest): Promise; - verticalSearch(request: VerticalSearchRequest): Promise; +// @public @deprecated (undocumented) +export class AnswersCore extends SearchCore { } -// @public -export class AnswersError extends Error { - code?: number; - message: string; - type?: string; - /* Excluded from this release type: __constructor */ +// @public @deprecated (undocumented) +export interface AnswersError extends SearchError { } // @public @deprecated (undocumented) export const AnswersHeadless: typeof SearchHeadless; -// @public -export interface AnswersRequest { - additionalHttpHeaders?: AdditionalHttpHeaders; +// @public @deprecated (undocumented) +export interface AnswersRequest extends SearchRequest { } // @public @deprecated (undocumented) @@ -107,8 +91,12 @@ export interface AutocompleteService { verticalAutocomplete(request: VerticalAutocompleteRequest): Promise; } +// @public @deprecated (undocumented) +export interface BaseAnswersConfig extends BaseSearchConfig { +} + // @public -export interface BaseAnswersConfig { +export interface BaseSearchConfig { endpoints?: Endpoints; experienceKey: string; experienceVersion?: 'STAGING' | 'PRODUCTION' | string | number; @@ -286,7 +274,7 @@ export enum FilterCombinator { } // @public -export interface FilterSearchRequest extends AnswersRequest { +export interface FilterSearchRequest extends SearchRequest { excluded?: Filter[]; fields: SearchParameterField[]; input: string; @@ -316,7 +304,7 @@ export interface FiltersState { export type FilterTypes = Filter | CombinedFilter; // @public -export type HeadlessConfig = AnswersConfig & { +export type HeadlessConfig = SearchConfig & { headlessId?: string; verticalKey?: string; }; @@ -477,7 +465,7 @@ export enum QueryTrigger { } // @public -export interface QuestionSubmissionRequest extends AnswersRequest { +export interface QuestionSubmissionRequest extends SearchRequest { email: string; entityId: string; name: string; @@ -520,10 +508,44 @@ export interface Result { // @public export const SandboxEndpoints: Required; +// @public +export type SearchConfig = SearchConfigWithApiKey | SearchConfigWithToken; + +// @public +export interface SearchConfigWithApiKey extends BaseSearchConfig { + apiKey: string; + token?: never; +} + +// @public +export interface SearchConfigWithToken extends BaseSearchConfig { + apiKey?: never; + token: string; +} + +// @public +export class SearchCore { + constructor(searchService: SearchService, questionSubmissionService: QuestionSubmissionService, autoCompleteService: AutocompleteService); + filterSearch(request: FilterSearchRequest): Promise; + submitQuestion(request: QuestionSubmissionRequest): Promise; + universalAutocomplete(request: UniversalAutocompleteRequest): Promise; + universalSearch(request: UniversalSearchRequest): Promise; + verticalAutocomplete(request: VerticalAutocompleteRequest): Promise; + verticalSearch(request: VerticalSearchRequest): Promise; +} + +// @public +export class SearchError extends Error { + code?: number; + message: string; + type?: string; + /* Excluded from this release type: __constructor */ +} + // @public export class SearchHeadless { // Warning: (ae-forgotten-export) The symbol "HttpManager" needs to be exported by the entry point index.d.ts - constructor(core: AnswersCore, stateManager: StateManager, httpManager: HttpManager, additionalHttpHeaders?: AdditionalHttpHeaders | undefined); + constructor(core: SearchCore, stateManager: StateManager, httpManager: HttpManager, additionalHttpHeaders?: AdditionalHttpHeaders | undefined); addListener(listener: StateListener): Unsubscribe; executeFilterSearch(query: string, sectioned: boolean, fields: SearchParameterField[]): Promise; executeUniversalAutocomplete(): Promise; @@ -570,6 +592,11 @@ export interface SearchParameterField { fieldApiName: string; } +// @public +export interface SearchRequest { + additionalHttpHeaders?: AdditionalHttpHeaders; +} + // @public export interface SearchService { universalSearch(request: UniversalSearchRequest): Promise; @@ -694,7 +721,7 @@ export interface StateManager { } // @public -export interface UniversalAutocompleteRequest extends AnswersRequest { +export interface UniversalAutocompleteRequest extends SearchRequest { input: string; sessionTrackingEnabled?: boolean; } @@ -706,7 +733,7 @@ export interface UniversalLimit { } // @public -export interface UniversalSearchRequest extends AnswersRequest { +export interface UniversalSearchRequest extends SearchRequest { context?: Context; limit?: UniversalLimit; location?: LatLong; @@ -747,7 +774,7 @@ export interface UpperNumberRangeLimit { } // @public -export interface VerticalAutocompleteRequest extends AnswersRequest { +export interface VerticalAutocompleteRequest extends SearchRequest { input: string; sessionTrackingEnabled?: boolean; verticalKey: string; @@ -764,7 +791,7 @@ export interface VerticalResults { } // @public -export interface VerticalSearchRequest extends AnswersRequest { +export interface VerticalSearchRequest extends SearchRequest { context?: Context; facets?: Facet[]; limit?: number; diff --git a/package-lock.json b/package-lock.json index 935ddbaa..2587d232 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "ISC", "dependencies": { "@reduxjs/toolkit": "^1.8.1", - "@yext/answers-core": "^1.7.0", + "@yext/search-core": "^1.8.0", "js-levenshtein": "^1.1.6", "lodash": "^4.17.21" }, @@ -4647,18 +4647,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@yext/answers-core": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@yext/answers-core/-/answers-core-1.7.0.tgz", - "integrity": "sha512-wOG9TAj3fVUXVJvS5HO+S54O6Ehyd32FfRUtZ4j1kE8ES5T9bhJ8xALos4NC+gCuXIMmV1kHXzsKLafeuSrpAg==", - "dependencies": { - "@babel/runtime-corejs3": "^7.12.5", - "cross-fetch": "^3.1.5" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@yext/eslint-config-slapshot": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@yext/eslint-config-slapshot/-/eslint-config-slapshot-0.2.0.tgz", @@ -4688,6 +4676,18 @@ "eslint-module-utils": "^2.7.1" } }, + "node_modules/@yext/search-core": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-1.8.0.tgz", + "integrity": "sha512-t7rg9JZ9K6pIt2nBZ1O+xhzG+zMFVAu9Vgwh8cTey8NA7878cQ6n6BauTwimVdbrNGHq3D2dPUno/kVtKAgPiQ==", + "dependencies": { + "@babel/runtime-corejs3": "^7.12.5", + "cross-fetch": "^3.1.5" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", @@ -16247,15 +16247,6 @@ "eslint-visitor-keys": "^3.0.0" } }, - "@yext/answers-core": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@yext/answers-core/-/answers-core-1.7.0.tgz", - "integrity": "sha512-wOG9TAj3fVUXVJvS5HO+S54O6Ehyd32FfRUtZ4j1kE8ES5T9bhJ8xALos4NC+gCuXIMmV1kHXzsKLafeuSrpAg==", - "requires": { - "@babel/runtime-corejs3": "^7.12.5", - "cross-fetch": "^3.1.5" - } - }, "@yext/eslint-config-slapshot": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@yext/eslint-config-slapshot/-/eslint-config-slapshot-0.2.0.tgz", @@ -16277,6 +16268,15 @@ "eslint-module-utils": "^2.7.1" } }, + "@yext/search-core": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@yext/search-core/-/search-core-1.8.0.tgz", + "integrity": "sha512-t7rg9JZ9K6pIt2nBZ1O+xhzG+zMFVAu9Vgwh8cTey8NA7878cQ6n6BauTwimVdbrNGHq3D2dPUno/kVtKAgPiQ==", + "requires": { + "@babel/runtime-corejs3": "^7.12.5", + "cross-fetch": "^3.1.5" + } + }, "abbrev": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", diff --git a/package.json b/package.json index 40c2ff00..5712c92e 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "dependencies": { "@reduxjs/toolkit": "^1.8.1", - "@yext/answers-core": "^1.7.0", + "@yext/search-core": "^1.8.0", "js-levenshtein": "^1.1.6", "lodash": "^4.17.21" }, diff --git a/src/deprecated.ts b/src/deprecated.ts index 00bc4cda..3d326d29 100644 --- a/src/deprecated.ts +++ b/src/deprecated.ts @@ -1,6 +1,16 @@ import { searchUtilities, provideHeadless } from '.'; import SearchHeadless from './search-headless'; +export { + AnswersConfig, + AnswersConfigWithToken, + AnswersConfigWithApiKey, + AnswersCore, + AnswersError, + AnswersRequest, + BaseAnswersConfig +} from '@yext/search-core'; + /** * @public * diff --git a/src/http-manager.ts b/src/http-manager.ts index 1594081f..bea3b142 100644 --- a/src/http-manager.ts +++ b/src/http-manager.ts @@ -6,7 +6,7 @@ type ServiceIds = { /** * Assigns numeric IDs to every http request and the corresponding response - * through {@link AnswersCore}. This helps track the received order of requests + * through {@link SearchCore}. This helps track the received order of requests * and responses. {@link SearchHeadless} uses it to ensure dispatch events for * state updates are triggered with up-to-date responses (e.g. if the newly received * response has a higher ID number than the recorded received response). diff --git a/src/index.ts b/src/index.ts index 996cb4f0..984e2724 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -import { provideCore, AnswersConfig, AdditionalHttpHeaders } from '@yext/answers-core'; +import { provideCore, SearchConfig, AdditionalHttpHeaders } from '@yext/search-core'; import HttpManager from './http-manager'; import ReduxStateManager from './redux-state-manager'; import SearchHeadless from './search-headless'; @@ -9,7 +9,7 @@ import { SessionTrackingState } from './models/slices/sessiontracking'; import * as searchUtilities from './search-utilities'; import { getHttpHeaders } from './utils/client-sdk-utils'; -export * from './answers-core-re-exports'; +export * from './search-core-re-exports'; export * from './models'; export * from './constants'; export * from './utils/filter-creators'; @@ -22,7 +22,7 @@ export { searchUtilities }; * * @public */ -export type HeadlessConfig = AnswersConfig & { +export type HeadlessConfig = SearchConfig & { /** * The ID of the SearchHeadless instance. * @@ -77,13 +77,13 @@ export function provideHeadless( const { verticalKey, headlessId, - ...answersConfig + ...searchConfig } = config; if (headlessId === DEFAULT_HEADLESS_ID) { throw new Error(`Cannot instantiate a SearchHeadless using the default headlessId "${headlessId}". ` + 'Specify a different headlessId.'); } - const answersCore = provideCore(answersConfig); + const answersCore = provideCore(searchConfig); const stateManager = new ReduxStateManager( store, headlessId || DEFAULT_HEADLESS_ID, headlessReducerManager); const httpManager = new HttpManager(); diff --git a/src/models/slices/directanswer.ts b/src/models/slices/directanswer.ts index a657978b..038db811 100644 --- a/src/models/slices/directanswer.ts +++ b/src/models/slices/directanswer.ts @@ -1,4 +1,4 @@ -import { FeaturedSnippetDirectAnswer, FieldValueDirectAnswer } from '@yext/answers-core'; +import { FeaturedSnippetDirectAnswer, FieldValueDirectAnswer } from '@yext/search-core'; /** * Maintains the direct answer associated with the latest search. diff --git a/src/models/slices/filters.ts b/src/models/slices/filters.ts index a8eeb5ab..c2286db7 100644 --- a/src/models/slices/filters.ts +++ b/src/models/slices/filters.ts @@ -1,4 +1,4 @@ -import { DisplayableFacet } from '@yext/answers-core'; +import { DisplayableFacet } from '@yext/search-core'; import { SelectableFilter } from '../utils/selectableFilter'; /** diff --git a/src/models/slices/location.ts b/src/models/slices/location.ts index 7923fa3a..3286adf4 100644 --- a/src/models/slices/location.ts +++ b/src/models/slices/location.ts @@ -1,4 +1,4 @@ -import { LatLong, LocationBias } from '@yext/answers-core'; +import { LatLong, LocationBias } from '@yext/search-core'; /** * Maintains the user's location, if given, or the inferred location, that is diff --git a/src/models/slices/meta.ts b/src/models/slices/meta.ts index 9b24989c..d6b9e205 100644 --- a/src/models/slices/meta.ts +++ b/src/models/slices/meta.ts @@ -1,4 +1,4 @@ -import { Context } from '@yext/answers-core'; +import { Context } from '@yext/search-core'; import { SearchType } from '../utils/searchType'; /** diff --git a/src/models/slices/query.ts b/src/models/slices/query.ts index f819b73d..d1141717 100644 --- a/src/models/slices/query.ts +++ b/src/models/slices/query.ts @@ -1,4 +1,4 @@ -import { QuerySource, QueryTrigger, SearchIntent } from '@yext/answers-core'; +import { QuerySource, QueryTrigger, SearchIntent } from '@yext/search-core'; /** * Maintains the latest query and its associated data. diff --git a/src/models/slices/queryrules.ts b/src/models/slices/queryrules.ts index 6a7f6b11..93cfc523 100644 --- a/src/models/slices/queryrules.ts +++ b/src/models/slices/queryrules.ts @@ -1,4 +1,4 @@ -import { QueryRulesActionsData } from '@yext/answers-core'; +import { QueryRulesActionsData } from '@yext/search-core'; /** * Maintains the data from the triggered query rules. diff --git a/src/models/slices/spellcheck.ts b/src/models/slices/spellcheck.ts index 1117760d..1950141a 100644 --- a/src/models/slices/spellcheck.ts +++ b/src/models/slices/spellcheck.ts @@ -1,4 +1,4 @@ -import { SpellCheck } from '@yext/answers-core'; +import { SpellCheck } from '@yext/search-core'; /** * Maintains whether spellcheck is enabled and the spellcheck response from the diff --git a/src/models/slices/universal.ts b/src/models/slices/universal.ts index 29a2c521..41cc222a 100644 --- a/src/models/slices/universal.ts +++ b/src/models/slices/universal.ts @@ -1,4 +1,4 @@ -import { UniversalLimit, VerticalResults } from '@yext/answers-core'; +import { UniversalLimit, VerticalResults } from '@yext/search-core'; /** * Maintains the data for the latest universal search. diff --git a/src/models/slices/vertical.ts b/src/models/slices/vertical.ts index 670efc7b..6805f041 100644 --- a/src/models/slices/vertical.ts +++ b/src/models/slices/vertical.ts @@ -5,7 +5,7 @@ import { SortBy, Source, VerticalResults -} from '@yext/answers-core'; +} from '@yext/search-core'; /** * Represents all results for the current vertical. diff --git a/src/models/utils/selectableFilter.ts b/src/models/utils/selectableFilter.ts index 1d46f6f9..27b82d79 100644 --- a/src/models/utils/selectableFilter.ts +++ b/src/models/utils/selectableFilter.ts @@ -1,4 +1,4 @@ -import { Filter } from '@yext/answers-core'; +import { Filter } from '@yext/search-core'; /** * A {@link Filter} with additional information, such as an diff --git a/src/answers-core-re-exports.ts b/src/search-core-re-exports.ts similarity index 88% rename from src/answers-core-re-exports.ts rename to src/search-core-re-exports.ts index addcc122..d1331649 100644 --- a/src/answers-core-re-exports.ts +++ b/src/search-core-re-exports.ts @@ -1,17 +1,17 @@ export { AdditionalHttpHeaders, - AnswersConfig, - AnswersConfigWithApiKey, - AnswersConfigWithToken, - AnswersCore, - AnswersError, - AnswersRequest, + SearchConfig, + SearchConfigWithApiKey, + SearchConfigWithToken, + SearchCore, + SearchError, + SearchRequest, AppliedQueryFilter, AppliedQueryFilterType, AutocompleteResponse, AutocompleteResult, AutocompleteService, - BaseAnswersConfig, + BaseSearchConfig, CombinedFilter, Context, ClientSDKHeaderValues, @@ -69,4 +69,4 @@ export { VerticalSearchRequest, VerticalSearchResponse, Visitor -} from '@yext/answers-core'; +} from '@yext/search-core'; \ No newline at end of file diff --git a/src/search-headless.ts b/src/search-headless.ts index 58ee4d4e..8c8e0381 100644 --- a/src/search-headless.ts +++ b/src/search-headless.ts @@ -1,5 +1,5 @@ import { - AnswersCore, + SearchCore, QueryTrigger, QuerySource, QuestionSubmissionRequest, @@ -17,7 +17,7 @@ import { UniversalLimit, VerticalSearchResponse, AdditionalHttpHeaders -} from '@yext/answers-core'; +} from '@yext/search-core'; import StateListener from './models/state-listener'; import { State } from './models/state'; @@ -36,7 +36,7 @@ import { initialState as initialQueryRulesState } from './slices/queryrules'; import { initialState as initialSearchStatusState } from './slices/searchstatus'; /** - * Provides the functionality for interacting with an Search experience. + * Provides the functionality for interacting with a Search experience. * * @public */ @@ -47,7 +47,7 @@ export default class SearchHeadless { public readonly utilities = searchUtilities; constructor( - private core: AnswersCore, + private core: SearchCore, private stateManager: StateManager, private httpManager: HttpManager, private additionalHttpHeaders?: AdditionalHttpHeaders diff --git a/src/search-utilities.ts b/src/search-utilities.ts index 14b93101..3d9d8a5e 100644 --- a/src/search-utilities.ts +++ b/src/search-utilities.ts @@ -1,4 +1,4 @@ -import { DisplayableFacet } from '@yext/answers-core'; +import { DisplayableFacet } from '@yext/search-core'; import { isLevenshteinMatch } from './utils/searchable-facets'; /** diff --git a/src/slices/directanswer.ts b/src/slices/directanswer.ts index a028889b..64ccbbd4 100644 --- a/src/slices/directanswer.ts +++ b/src/slices/directanswer.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { FeaturedSnippetDirectAnswer, FieldValueDirectAnswer } from '@yext/answers-core'; +import { FeaturedSnippetDirectAnswer, FieldValueDirectAnswer } from '@yext/search-core'; import { DirectAnswerState } from '../models/slices/directanswer'; export const initialState: DirectAnswerState = {}; diff --git a/src/slices/filters.ts b/src/slices/filters.ts index 39de12ea..b083a382 100644 --- a/src/slices/filters.ts +++ b/src/slices/filters.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { FacetOption, DisplayableFacet } from '@yext/answers-core'; +import { FacetOption, DisplayableFacet } from '@yext/search-core'; import { SelectableFilter } from '../models/utils/selectableFilter'; import { FiltersState } from '../models/slices/filters'; import isEqual from 'lodash/isEqual'; diff --git a/src/slices/location.ts b/src/slices/location.ts index 5e7f4ca4..f6ee9463 100644 --- a/src/slices/location.ts +++ b/src/slices/location.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { LatLong, LocationBias } from '@yext/answers-core'; +import { LatLong, LocationBias } from '@yext/search-core'; import { LocationState } from '../models/slices/location'; const initialState: LocationState = {}; diff --git a/src/slices/meta.ts b/src/slices/meta.ts index 26c57094..24e069cb 100644 --- a/src/slices/meta.ts +++ b/src/slices/meta.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { Context } from '@yext/answers-core'; +import { Context } from '@yext/search-core'; import { MetaState } from '../models/slices/meta'; import { SearchTypeEnum } from '../models/utils/searchType'; diff --git a/src/slices/query.ts b/src/slices/query.ts index dbfa70b4..84fb2f4f 100644 --- a/src/slices/query.ts +++ b/src/slices/query.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { QuerySource, QueryTrigger, SearchIntent } from '@yext/answers-core'; +import { QuerySource, QueryTrigger, SearchIntent } from '@yext/search-core'; import { QueryState } from '../models/slices/query'; const initialState: QueryState = {}; diff --git a/src/slices/queryrules.ts b/src/slices/queryrules.ts index b76c735b..76c2c94a 100644 --- a/src/slices/queryrules.ts +++ b/src/slices/queryrules.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { QueryRulesActionsData } from '@yext/answers-core'; +import { QueryRulesActionsData } from '@yext/search-core'; import { QueryRulesState } from '../models/slices/queryrules'; export const initialState: QueryRulesState = { actions: [] }; diff --git a/src/slices/spellcheck.ts b/src/slices/spellcheck.ts index cf561ffc..97936a0c 100644 --- a/src/slices/spellcheck.ts +++ b/src/slices/spellcheck.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { SpellCheck } from '@yext/answers-core'; +import { SpellCheck } from '@yext/search-core'; import { SpellCheckState } from '../models/slices/spellcheck'; const initialState: SpellCheckState = { diff --git a/src/slices/universal.ts b/src/slices/universal.ts index 38c71dfc..eee70cf7 100644 --- a/src/slices/universal.ts +++ b/src/slices/universal.ts @@ -1,5 +1,5 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; -import { UniversalLimit, VerticalResults } from '@yext/answers-core'; +import { UniversalLimit, VerticalResults } from '@yext/search-core'; import { UniversalSearchState } from '../models/slices/universal'; export const initialState: UniversalSearchState = {}; diff --git a/src/slices/vertical.ts b/src/slices/vertical.ts index 05ddf3b1..1ef469d4 100644 --- a/src/slices/vertical.ts +++ b/src/slices/vertical.ts @@ -2,7 +2,7 @@ import { createSlice, PayloadAction, Slice } from '@reduxjs/toolkit'; import { SortBy, VerticalSearchResponse -} from '@yext/answers-core'; +} from '@yext/search-core'; import { AllResultsForVertical, VerticalSearchState } from '../models/slices/vertical'; export const initialState: VerticalSearchState = {}; diff --git a/src/utils/client-sdk-utils.ts b/src/utils/client-sdk-utils.ts index 03468a2c..b155d17d 100644 --- a/src/utils/client-sdk-utils.ts +++ b/src/utils/client-sdk-utils.ts @@ -1,4 +1,4 @@ -import { AdditionalHttpHeaders, ClientSDKHeaderValues } from '@yext/answers-core'; +import { AdditionalHttpHeaders, ClientSDKHeaderValues } from '@yext/search-core'; import packageJson from '../../package.json'; const CLIENT_SDK_HEADER = 'Client-SDK'; diff --git a/src/utils/filter-creators.ts b/src/utils/filter-creators.ts index eab3f1a2..b0b87364 100644 --- a/src/utils/filter-creators.ts +++ b/src/utils/filter-creators.ts @@ -1,4 +1,4 @@ -import { CombinedFilter, Filter, FilterCombinator, Matcher, NearFilterValue } from '@yext/answers-core'; +import { CombinedFilter, Filter, FilterCombinator, Matcher, NearFilterValue } from '@yext/search-core'; import { BoundedRange } from '../models/utils/boundedrange'; /** diff --git a/src/utils/filter-utils.ts b/src/utils/filter-utils.ts index 34e0de09..3384124a 100644 --- a/src/utils/filter-utils.ts +++ b/src/utils/filter-utils.ts @@ -1,6 +1,6 @@ import isEqual from 'lodash/isEqual'; -import { Filter } from '@yext/answers-core'; +import { Filter } from '@yext/search-core'; /** * Returns true if the two given filters are the same. diff --git a/src/utils/transform-filters.ts b/src/utils/transform-filters.ts index 4a27eb97..d976ebb8 100644 --- a/src/utils/transform-filters.ts +++ b/src/utils/transform-filters.ts @@ -1,4 +1,4 @@ -import { CombinedFilter, Filter, FilterCombinator } from '@yext/answers-core'; +import { CombinedFilter, Filter, FilterCombinator } from '@yext/search-core'; import { SelectableFilter } from '../models/utils/selectableFilter'; /** diff --git a/test-site-node/package-lock.json b/test-site-node/package-lock.json index ead6cae5..96c63d0d 100644 --- a/test-site-node/package-lock.json +++ b/test-site-node/package-lock.json @@ -18,7 +18,7 @@ "license": "ISC", "dependencies": { "@reduxjs/toolkit": "^1.8.1", - "@yext/answers-core": "^1.7.0", + "@yext/search-core": "^1.8.0", "js-levenshtein": "^1.1.6", "lodash": "^4.17.21" }, @@ -63,7 +63,7 @@ "@types/node": "^16.11.12", "@typescript-eslint/eslint-plugin": "^5.16.0", "@typescript-eslint/parser": "^5.16.0", - "@yext/answers-core": "^1.7.0", + "@yext/search-core": "^1.8.0", "@yext/eslint-config-slapshot": "^0.2.0", "@yext/eslint-plugin-export-star": "^1.0.0", "babel-jest": "^27.4.5", diff --git a/tests/integration/directanswer.ts b/tests/integration/directanswer.ts index b92d7efc..20915389 100644 --- a/tests/integration/directanswer.ts +++ b/tests/integration/directanswer.ts @@ -1,5 +1,5 @@ +import { FeaturedSnippetDirectAnswer, DirectAnswerType, Source } from '@yext/search-core'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; -import { FeaturedSnippetDirectAnswer, DirectAnswerType, Source } from '@yext/answers-core'; import { State } from '../../src/models/state'; import { SearchTypeEnum } from '../../src/models/utils/searchType'; diff --git a/tests/integration/facets.ts b/tests/integration/facets.ts index f8fd3923..7dc1adf7 100644 --- a/tests/integration/facets.ts +++ b/tests/integration/facets.ts @@ -1,4 +1,4 @@ -import { DisplayableFacet, DisplayableFacetOption, Matcher } from '@yext/answers-core'; +import { DisplayableFacet, DisplayableFacetOption, Matcher } from '@yext/search-core'; import { State } from '../../src/models/state'; import { SearchTypeEnum } from '../../src/models/utils/searchType'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; diff --git a/tests/integration/location.ts b/tests/integration/location.ts index 686fed4c..10d36066 100644 --- a/tests/integration/location.ts +++ b/tests/integration/location.ts @@ -1,4 +1,4 @@ -import { VerticalSearchRequest, UniversalSearchRequest, LocationBias, LocationBiasMethod, LatLong } from '@yext/answers-core'; +import { VerticalSearchRequest, UniversalSearchRequest, LocationBias, LocationBiasMethod, LatLong } from '@yext/search-core'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; describe('userLocation', () => { diff --git a/tests/integration/meta.ts b/tests/integration/meta.ts index 69fc400a..c1a616d9 100644 --- a/tests/integration/meta.ts +++ b/tests/integration/meta.ts @@ -1,4 +1,4 @@ -import { UniversalSearchRequest, VerticalSearchRequest } from '@yext/answers-core'; +import { UniversalSearchRequest, VerticalSearchRequest } from '@yext/search-core'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; it('by default no meta attributes are sent', async () => { diff --git a/tests/integration/query.ts b/tests/integration/query.ts index 457f97f7..7fc2140c 100644 --- a/tests/integration/query.ts +++ b/tests/integration/query.ts @@ -2,7 +2,7 @@ import { VerticalSearchRequest, UniversalSearchRequest, SearchIntent -} from '@yext/answers-core'; +} from '@yext/search-core'; import HttpManager from '../../src/http-manager'; import ReduxStateManager from '../../src/redux-state-manager'; import SearchHeadless from '../../src/search-headless'; diff --git a/tests/integration/redux-state-manager.ts b/tests/integration/redux-state-manager.ts index 351ce0ca..f9e4d1c1 100644 --- a/tests/integration/redux-state-manager.ts +++ b/tests/integration/redux-state-manager.ts @@ -4,7 +4,7 @@ import HeadlessReducerManager from '../../src/headless-reducer-manager'; import SearchHeadless from '../../src/search-headless'; import { expectedInitialState } from '../mocks/expectedInitialState'; import HttpManager from '../../src/http-manager'; -import { AnswersCore } from '@yext/answers-core'; +import { SearchCore } from '@yext/search-core'; it('instantiating a ReduxStateManager creates adjacent state subtrees', () => { const store = createBaseStore(); @@ -57,7 +57,7 @@ it('dispatching answers actions through SearchHeadless', () => { const store = createBaseStore(); const headlessReducerManager = new HeadlessReducerManager(); const stateManager = new ReduxStateManager(store, 'anId', headlessReducerManager); - const headless = new SearchHeadless({} as AnswersCore, stateManager, new HttpManager()); + const headless = new SearchHeadless({} as SearchCore, stateManager, new HttpManager()); headless.setQuery('yo'); expect(store.getState()).toEqual({ anId: { @@ -73,7 +73,7 @@ it('addListener works with multiple headless instances', () => { const store = createBaseStore(); const headlessReducerManager = new HeadlessReducerManager(); const stateManager = new ReduxStateManager(store, 'anId', headlessReducerManager); - const headless = new SearchHeadless({} as AnswersCore, stateManager, new HttpManager()); + const headless = new SearchHeadless({} as SearchCore, stateManager, new HttpManager()); const callback = jest.fn(); headless.addListener({ valueAccessor: state => state.query.input, @@ -93,12 +93,12 @@ it('addListener can be used to link together different headless instances', () = const store = createBaseStore(); const headlessReducerManager = new HeadlessReducerManager(); const firstHeadless = new SearchHeadless( - {} as AnswersCore, + {} as SearchCore, new ReduxStateManager(store, 'first', headlessReducerManager), new HttpManager() ); const secondHeadless = new SearchHeadless( - {} as AnswersCore, + {} as SearchCore, new ReduxStateManager(store, 'second', headlessReducerManager), new HttpManager() ); diff --git a/tests/integration/sortbys.ts b/tests/integration/sortbys.ts index 814525ca..515ef335 100644 --- a/tests/integration/sortbys.ts +++ b/tests/integration/sortbys.ts @@ -1,4 +1,4 @@ -import { Direction, SortType, VerticalSearchRequest } from '@yext/answers-core'; +import { Direction, SortType, VerticalSearchRequest } from '@yext/search-core'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; it('executeVerticalQuery properly updates spellcheck state', async () => { diff --git a/tests/integration/status.ts b/tests/integration/status.ts index 4ea7528f..912027a3 100644 --- a/tests/integration/status.ts +++ b/tests/integration/status.ts @@ -1,4 +1,4 @@ -import { UniversalSearchRequest, VerticalSearchRequest } from '@yext/answers-core'; +import { UniversalSearchRequest, VerticalSearchRequest } from '@yext/search-core'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; import setTimeout from '../utils/setTimeout'; diff --git a/tests/integration/universalsearch.ts b/tests/integration/universalsearch.ts index eb25f7b2..a67d91f3 100644 --- a/tests/integration/universalsearch.ts +++ b/tests/integration/universalsearch.ts @@ -1,4 +1,4 @@ -import { UniversalSearchRequest } from '@yext/answers-core'; +import { UniversalSearchRequest } from '@yext/search-core'; import HttpManager from '../../src/http-manager'; import { getHttpHeaders } from '../../src/utils/client-sdk-utils'; import { createMockedHeadless } from '../mocks/createMockedHeadless'; diff --git a/tests/integration/verticalsearch.ts b/tests/integration/verticalsearch.ts index 6241ed88..af08d5bd 100644 --- a/tests/integration/verticalsearch.ts +++ b/tests/integration/verticalsearch.ts @@ -1,4 +1,4 @@ -import { AppliedQueryFilter, Matcher, Result, Source, VerticalResults, VerticalSearchRequest, VerticalSearchResponse } from '@yext/answers-core'; +import { AppliedQueryFilter, Matcher, Result, Source, VerticalResults, VerticalSearchRequest, VerticalSearchResponse } from '@yext/search-core'; import HttpManager from '../../src/http-manager'; import { AllResultsForVertical } from '../../src/models/slices/vertical'; import { State } from '../../src/models/state'; diff --git a/tests/unit/search-headless.ts b/tests/unit/search-headless.ts index fabeb965..8362d2a8 100644 --- a/tests/unit/search-headless.ts +++ b/tests/unit/search-headless.ts @@ -1,4 +1,4 @@ -import { Matcher, QuerySource, QueryTrigger } from '@yext/answers-core'; +import { Matcher, QuerySource, QueryTrigger } from '@yext/search-core'; import HttpManager from '../../src/http-manager'; import StateManager from '../../src/models/state-manager'; import SearchHeadless from '../../src/search-headless'; diff --git a/tests/unit/slices/filters.ts b/tests/unit/slices/filters.ts index 503ab769..9ef1c9ce 100644 --- a/tests/unit/slices/filters.ts +++ b/tests/unit/slices/filters.ts @@ -1,4 +1,4 @@ -import { DisplayableFacetOption, Filter, Matcher } from '@yext/answers-core'; +import { DisplayableFacetOption, Filter, Matcher } from '@yext/search-core'; import createFiltersSlice from '../../../src/slices/filters'; import _ from 'lodash'; import { FiltersState, SelectableFilter } from '../../../src'; diff --git a/tests/unit/slices/query.ts b/tests/unit/slices/query.ts index 5be826cd..97c2966b 100644 --- a/tests/unit/slices/query.ts +++ b/tests/unit/slices/query.ts @@ -1,4 +1,4 @@ -import { QuerySource, QueryTrigger } from '@yext/answers-core'; +import { QuerySource, QueryTrigger } from '@yext/search-core'; import createQuerySlice from '../../../src/slices/query'; const { reducer, actions } = createQuerySlice(''); diff --git a/tests/unit/slices/spellcheck.ts b/tests/unit/slices/spellcheck.ts index d41754b3..9a2b1924 100644 --- a/tests/unit/slices/spellcheck.ts +++ b/tests/unit/slices/spellcheck.ts @@ -1,4 +1,4 @@ -import { SpellCheck, SpellCheckType } from '@yext/answers-core'; +import { SpellCheck, SpellCheckType } from '@yext/search-core'; import createSpellCheckSlice from '../../../src/slices/spellcheck'; const { reducer, actions } = createSpellCheckSlice(''); diff --git a/tests/unit/slices/universal.ts b/tests/unit/slices/universal.ts index ca08fdbf..52f5cea2 100644 --- a/tests/unit/slices/universal.ts +++ b/tests/unit/slices/universal.ts @@ -1,4 +1,4 @@ -import { Source, VerticalResults } from '@yext/answers-core'; +import { Source, VerticalResults } from '@yext/search-core'; import createUniversalSlice from '../../../src/slices/universal'; const { reducer, actions } = createUniversalSlice(''); diff --git a/tests/unit/utils/filter-creator.ts b/tests/unit/utils/filter-creator.ts index a762cd78..25b2ebc9 100644 --- a/tests/unit/utils/filter-creator.ts +++ b/tests/unit/utils/filter-creator.ts @@ -1,4 +1,4 @@ -import { FilterCombinator, Matcher } from '@yext/answers-core'; +import { FilterCombinator, Matcher } from '@yext/search-core'; import { combineFilters, createDateRangeFilter, createEqualsFilter, createNearMeFilter, createNumberRangeFilter } from '../../../src/utils/filter-creators'; describe('filter creators work properly', () => { diff --git a/tests/unit/utils/transform-filters.ts b/tests/unit/utils/transform-filters.ts index a7fcec46..e5a115aa 100644 --- a/tests/unit/utils/transform-filters.ts +++ b/tests/unit/utils/transform-filters.ts @@ -1,4 +1,4 @@ -import { CombinedFilter, Filter, FilterCombinator, Matcher } from '@yext/answers-core'; +import { CombinedFilter, Filter, FilterCombinator, Matcher } from '@yext/search-core'; import { SelectableFilter } from '../../../src/models/utils/selectableFilter'; import { transformFiltersToCoreFormat } from '../../../src/utils/transform-filters';