Skip to content

Commit

Permalink
Version 2.3.0 (#151)
Browse files Browse the repository at this point in the history
### Changes

Support the EU Cloud region
- We introduced two new configuration options: cloudRegion and environment. The search endpoints are hosted in both the US and in Europe, and the cloudRegion config option determines which endpoints are used. The environment config option supports both Prod and Sandbox. The SandboxEndpoints object is now deprecated, and the environment config option should be used instead to specify the sandbox environment.
  • Loading branch information
cea2aj authored May 9, 2023
2 parents 8d34a79 + f25d082 commit dad9f41
Show file tree
Hide file tree
Showing 20 changed files with 204 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @yext/slapshot
* @yext/backfire
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules/
coverage/
dist/
temp/
.DS_Store
.DS_Store
.idea/
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SOFTWARE.

The following NPM package may be included in this product:

- @yext/search-core@2.1.0
- @yext/search-core@2.3.0

This package contains the following license and notice below:

Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.autocompleteresult.inputintents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [AutocompleteResult](./search-headless.autocompleteresult.md) &gt; [inputIntents](./search-headless.autocompleteresult.inputintents.md)

## AutocompleteResult.inputIntents property

[SearchIntent](./search-headless.searchintent.md)<!-- -->s corresponding to the autocomplete result.

<b>Signature:</b>

```typescript
inputIntents: SearchIntent[];
```
1 change: 1 addition & 0 deletions docs/search-headless.autocompleteresult.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export declare interface AutocompleteResult
| Property | Type | Description |
| --- | --- | --- |
| [filter?](./search-headless.autocompleteresult.filter.md) | [FieldValueFilter](./search-headless.fieldvaluefilter.md) | <i>(Optional)</i> A filter applied to the autocomplete response. |
| [inputIntents](./search-headless.autocompleteresult.inputintents.md) | [SearchIntent](./search-headless.searchintent.md)<!-- -->\[\] | [SearchIntent](./search-headless.searchintent.md)<!-- -->s corresponding to the autocomplete result. |
| [key?](./search-headless.autocompleteresult.key.md) | string | <i>(Optional)</i> The fieldId which corresponds to the AutocompleteResult value. |
| [matchedSubstrings?](./search-headless.autocompleteresult.matchedsubstrings.md) | { length: number; offset: number; }\[\] | <i>(Optional)</i> An array of substrings which overlap with the autocomplete input. |
| [relatedItem?](./search-headless.autocompleteresult.relateditem.md) | [Result](./search-headless.result.md) | <i>(Optional)</i> An entity that corresponds to the autocomplete result. |
Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.basesearchconfig.cloudregion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [BaseSearchConfig](./search-headless.basesearchconfig.md) &gt; [cloudRegion](./search-headless.basesearchconfig.cloudregion.md)

## BaseSearchConfig.cloudRegion property

Defines the cloud region of the API domains.

<b>Signature:</b>

```typescript
cloudRegion?: CloudRegion;
```
13 changes: 13 additions & 0 deletions docs/search-headless.basesearchconfig.environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [BaseSearchConfig](./search-headless.basesearchconfig.md) &gt; [environment](./search-headless.basesearchconfig.environment.md)

## BaseSearchConfig.environment property

Defines the environment of the API domains.

<b>Signature:</b>

```typescript
environment?: Environment;
```
7 changes: 5 additions & 2 deletions docs/search-headless.basesearchconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,23 @@

## BaseSearchConfig interface

The base configuration options for [SearchCore](./search-headless.searchcore.md)<!-- -->.
The base configuration options for [SearchCore](./search-headless.searchcore.md)<!-- -->, which includes the options from [ServingConfig](./search-headless.servingconfig.md)<!-- -->.

<b>Signature:</b>

```typescript
export declare interface BaseSearchConfig
export declare interface BaseSearchConfig extends ServingConfig
```
<b>Extends:</b> [ServingConfig](./search-headless.servingconfig.md)
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [additionalQueryParams?](./search-headless.basesearchconfig.additionalqueryparams.md) | { \[key: string\]: string \| number \| boolean; } | <i>(Optional)</i> Additional query params added on to every request. |
| [cloudRegion?](./search-headless.basesearchconfig.cloudregion.md) | [CloudRegion](./search-headless.cloudregion.md) | <i>(Optional)</i> Defines the cloud region of the API domains. |
| [endpoints?](./search-headless.basesearchconfig.endpoints.md) | [Endpoints](./search-headless.endpoints.md) | <i>(Optional)</i> Overrides for the URLs which are used when making requests to the Search API. |
| [environment?](./search-headless.basesearchconfig.environment.md) | [Environment](./search-headless.environment.md) | <i>(Optional)</i> Defines the environment of the API domains. |
| [experienceKey](./search-headless.basesearchconfig.experiencekey.md) | string | The experience key of the search experience. |
| [experienceVersion?](./search-headless.basesearchconfig.experienceversion.md) | 'STAGING' \| 'PRODUCTION' \| string \| number | <i>(Optional)</i> The version of the search experience configuration. |
| [locale](./search-headless.basesearchconfig.locale.md) | string | The locale of the search experience. |
Expand Down
21 changes: 21 additions & 0 deletions docs/search-headless.cloudregion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

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

## CloudRegion enum

Defines the cloud region of the API domains.

<b>Signature:</b>

```typescript
export declare enum CloudRegion
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| EU | <code>&quot;eu&quot;</code> | |
| US | <code>&quot;us&quot;</code> | |

21 changes: 21 additions & 0 deletions docs/search-headless.environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

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

## Environment enum

Defines the environment of the API domains.

<b>Signature:</b>

```typescript
export declare enum Environment
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| PROD | <code>&quot;prod&quot;</code> | |
| SANDBOX | <code>&quot;sbx&quot;</code> | |

5 changes: 4 additions & 1 deletion docs/search-headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
| --- | --- |
| [AppliedQueryFilterType](./search-headless.appliedqueryfiltertype.md) | Represents the type of [AppliedQueryFilter](./search-headless.appliedqueryfilter.md) applied to a search. |
| [BuiltInFieldType](./search-headless.builtinfieldtype.md) | Possible built-in field types for [DirectAnswer.fieldType](./search-headless.directanswer.fieldtype.md)<!-- -->. |
| [CloudRegion](./search-headless.cloudregion.md) | Defines the cloud region of the API domains. |
| [DirectAnswerType](./search-headless.directanswertype.md) | Represents the type of direct answer. |
| [Direction](./search-headless.direction.md) | The direction of a sort. |
| [Environment](./search-headless.environment.md) | Defines the environment of the API domains. |
| [ErrorType](./search-headless.errortype.md) | Identifier for the type of error causing the failure. |
| [FilterCombinator](./search-headless.filtercombinator.md) | Indicates how child filters in a [StaticFilter](./search-headless.staticfilter.md) should be combined. |
| [LocationBiasMethod](./search-headless.locationbiasmethod.md) | The method used to determine the location. |
Expand Down Expand Up @@ -58,7 +60,7 @@
| [AutocompleteService](./search-headless.autocompleteservice.md) | A service for autocomplete requests. |
| [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) | A direct answer which was found within a document. |
| [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) | A direct answer where the answer came from a field from the knowledge graph. |
| [BaseSearchConfig](./search-headless.basesearchconfig.md) | The base configuration options for [SearchCore](./search-headless.searchcore.md)<!-- -->. |
| [BaseSearchConfig](./search-headless.basesearchconfig.md) | The base configuration options for [SearchCore](./search-headless.searchcore.md)<!-- -->, which includes the options from [ServingConfig](./search-headless.servingconfig.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 Search experience. The information for these agents is added to the Client-SDK HTTP header along with that of the ANSWERS\_CORE agent. |
| [ComplexURL](./search-headless.complexurl.md) | The shape of a [BuiltInFieldType.ComplexURL](./search-headless.builtinfieldtype.md) DirectAnswer value |
Expand Down Expand Up @@ -119,6 +121,7 @@
| [SearchService](./search-headless.searchservice.md) | A service which performs Yext Search. |
| [SearchStatusState](./search-headless.searchstatusstate.md) | Maintains the status of the latest search. |
| [SelectableStaticFilter](./search-headless.selectablestaticfilter.md) | A [StaticFilter](./search-headless.staticfilter.md) with additional information, such as an optional display name and whether or not it is selected. |
| [ServingConfig](./search-headless.servingconfig.md) | The configuration options for getting the endpoints. |
| [SessionTrackingState](./search-headless.sessiontrackingstate.md) | Maintains whether the user session should be tracked and, if so, the session information. |
| [Snippet](./search-headless.snippet.md) | The section of text where a [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) was found. |
| [SortBy](./search-headless.sortby.md) | Represents a criterion that can be used to sort results. |
Expand Down
5 changes: 5 additions & 0 deletions docs/search-headless.sandboxendpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@

## SandboxEndpoints variable

> Warning: This API is now obsolete.
>
> Set the appropriate environment and cloud region in [ServingConfig](./search-headless.servingconfig.md) instead.
>
The endpoints to use for sandbox experiences.

<b>Signature:</b>
Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.servingconfig.cloudregion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [ServingConfig](./search-headless.servingconfig.md) &gt; [cloudRegion](./search-headless.servingconfig.cloudregion.md)

## ServingConfig.cloudRegion property

Defines the cloud region of the API domains.

<b>Signature:</b>

```typescript
cloudRegion?: CloudRegion;
```
13 changes: 13 additions & 0 deletions docs/search-headless.servingconfig.environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [ServingConfig](./search-headless.servingconfig.md) &gt; [environment](./search-headless.servingconfig.environment.md)

## ServingConfig.environment property

Defines the environment of the API domains.

<b>Signature:</b>

```typescript
environment?: Environment;
```
21 changes: 21 additions & 0 deletions docs/search-headless.servingconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

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

## ServingConfig interface

The configuration options for getting the endpoints.

<b>Signature:</b>

```typescript
export declare interface ServingConfig
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [cloudRegion?](./search-headless.servingconfig.cloudregion.md) | [CloudRegion](./search-headless.cloudregion.md) | <i>(Optional)</i> Defines the cloud region of the API domains. |
| [environment?](./search-headless.servingconfig.environment.md) | [Environment](./search-headless.environment.md) | <i>(Optional)</i> Defines the environment of the API domains. |

29 changes: 27 additions & 2 deletions etc/search-headless.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export interface AutocompleteResponse {
// @public
export interface AutocompleteResult {
filter?: FieldValueFilter;
inputIntents: SearchIntent[];
key?: string;
matchedSubstrings?: {
length: number;
Expand Down Expand Up @@ -113,11 +114,13 @@ export interface BaseFieldValueDirectAnswer<T = unknown> extends DirectAnswer<T>
}

// @public
export interface BaseSearchConfig {
export interface BaseSearchConfig extends ServingConfig {
additionalQueryParams?: {
[key: string]: string | number | boolean;
};
cloudRegion?: CloudRegion;
endpoints?: Endpoints;
environment?: Environment;
experienceKey: string;
experienceVersion?: 'STAGING' | 'PRODUCTION' | string | number;
locale: string;
Expand Down Expand Up @@ -172,6 +175,14 @@ export interface ClientSDKHeaderValues {
ANSWERS_CORE?: never;
}

// @public
export enum CloudRegion {
// (undocumented)
EU = "eu",
// (undocumented)
US = "us"
}

// @public
export function combineStaticFilters(filterA: StaticFilter, filterB: StaticFilter, combinator: FilterCombinator): StaticFilter;

Expand Down Expand Up @@ -303,6 +314,14 @@ export interface Endpoints {
// @public
export type EnumOrLiteral<T extends string> = T | `${T}`;

// @public
export enum Environment {
// (undocumented)
PROD = "prod",
// (undocumented)
SANDBOX = "sbx"
}

// @public
export enum ErrorType {
BackendError = "BACKEND_ERROR",
Expand Down Expand Up @@ -678,7 +697,7 @@ export interface RichTextSnippetDirectAnswer extends Omit<BaseFeaturedSnippetDir
fieldType: EnumOrLiteral<BuiltInFieldType.RichText>;
}

// @public
// @public @deprecated
export const SandboxEndpoints: Required<Endpoints>;

// @public
Expand Down Expand Up @@ -809,6 +828,12 @@ export interface SelectableStaticFilter {
selected: boolean;
}

// @public
export interface ServingConfig {
cloudRegion?: CloudRegion;
environment?: Environment;
}

// @public
export interface SessionTrackingState {
enabled?: boolean;
Expand Down
Loading

0 comments on commit dad9f41

Please sign in to comment.