Skip to content

Commit

Permalink
re-export DA interfaces from search-core (#131)
Browse files Browse the repository at this point in the history
- update search-core version to be 2.0.0-alpha.215 which the new DA interfaces. re-export those DA interfaces in headless.
- fix some new TS issues in DA jest test and existing issues in facets and verticalSearch test.

bump headless version to 2.0.0-alpha.131, to be publish after this pr is merged

J=SLAP-2324
TEST=none
  • Loading branch information
yen-tt authored Aug 17, 2022
1 parent 0e57c31 commit 90e9feb
Show file tree
Hide file tree
Showing 72 changed files with 962 additions and 235 deletions.
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.0.0-alpha.204
- @yext/search-core@2.0.0-alpha.215

This package contains the following license and notice below:

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

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [AddressDirectAnswer](./search-headless.addressdirectanswer.md) &gt; [fieldType](./search-headless.addressdirectanswer.fieldtype.md)

## AddressDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.Address>;
```
21 changes: 21 additions & 0 deletions docs/search-headless.addressdirectanswer.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; [AddressDirectAnswer](./search-headless.addressdirectanswer.md)

## AddressDirectAnswer interface

A [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) interface with 'address' field type.

<b>Signature:</b>

```typescript
export declare interface AddressDirectAnswer extends BaseFieldValueDirectAnswer<Address>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md)<!-- -->&lt;Address&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.addressdirectanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.Address](./search-headless.builtinfieldtype.md)<!-- -->&gt; | |
11 changes: 11 additions & 0 deletions docs/search-headless.androidappurldirectanswer.fieldtype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [AndroidAppUrlDirectAnswer](./search-headless.androidappurldirectanswer.md) &gt; [fieldType](./search-headless.androidappurldirectanswer.fieldtype.md)

## AndroidAppUrlDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.AndroidAppURL>;
```
21 changes: 21 additions & 0 deletions docs/search-headless.androidappurldirectanswer.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; [AndroidAppUrlDirectAnswer](./search-headless.androidappurldirectanswer.md)

## AndroidAppUrlDirectAnswer interface

A direct answer for an android app url field.

<b>Signature:</b>

```typescript
export declare interface AndroidAppUrlDirectAnswer extends BaseFieldValueDirectAnswer<string>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md)<!-- -->&lt;string&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.androidappurldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.AndroidAppURL](./search-headless.builtinfieldtype.md)<!-- -->&gt; | |
13 changes: 13 additions & 0 deletions docs/search-headless.basefeaturedsnippetdirectanswer.fieldtype.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; [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) &gt; [fieldType](./search-headless.basefeaturedsnippetdirectanswer.fieldtype.md)

## BaseFeaturedSnippetDirectAnswer.fieldType property

The field type of the direct answer.

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.MultiLineText | BuiltInFieldType.RichText>;
```
23 changes: 23 additions & 0 deletions docs/search-headless.basefeaturedsnippetdirectanswer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

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

## BaseFeaturedSnippetDirectAnswer interface

A direct answer which was found within a document.

<b>Signature:</b>

```typescript
export declare interface BaseFeaturedSnippetDirectAnswer<T = unknown> extends DirectAnswer<T>
```
<b>Extends:</b> [DirectAnswer](./search-headless.directanswer.md)<!-- -->&lt;T&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.basefeaturedsnippetdirectanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.MultiLineText](./search-headless.builtinfieldtype.md) \| [BuiltInFieldType.RichText](./search-headless.builtinfieldtype.md)<!-- -->&gt; | The field type of the direct answer. |
| [snippet](./search-headless.basefeaturedsnippetdirectanswer.snippet.md) | [Snippet](./search-headless.snippet.md) | The snippet where the direct answer was found. |
| [type](./search-headless.basefeaturedsnippetdirectanswer.type.md) | [DirectAnswerType.FeaturedSnippet](./search-headless.directanswertype.md) | Indicates that the DirectAnswer is a [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md)<!-- -->. |
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) &gt; [snippet](./search-headless.featuredsnippetdirectanswer.snippet.md)
[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) &gt; [snippet](./search-headless.basefeaturedsnippetdirectanswer.snippet.md)

## FeaturedSnippetDirectAnswer.snippet property
## BaseFeaturedSnippetDirectAnswer.snippet property

The snippet where the direct answer was found.

Expand Down
13 changes: 13 additions & 0 deletions docs/search-headless.basefeaturedsnippetdirectanswer.type.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; [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) &gt; [type](./search-headless.basefeaturedsnippetdirectanswer.type.md)

## BaseFeaturedSnippetDirectAnswer.type property

Indicates that the DirectAnswer is a [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md)<!-- -->.

<b>Signature:</b>

```typescript
type: DirectAnswerType.FeaturedSnippet;
```
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md) &gt; [entityName](./search-headless.fieldvaluedirectanswer.entityname.md)
[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) &gt; [entityName](./search-headless.basefieldvaluedirectanswer.entityname.md)

## FieldValueDirectAnswer.entityName property
## BaseFieldValueDirectAnswer.entityName property

The name of the entity that direct answer came from.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md) &gt; [fieldApiName](./search-headless.fieldvaluedirectanswer.fieldapiname.md)
[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) &gt; [fieldApiName](./search-headless.basefieldvaluedirectanswer.fieldapiname.md)

## FieldValueDirectAnswer.fieldApiName property
## BaseFieldValueDirectAnswer.fieldApiName property

The field api name of the direct answer.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md) &gt; [fieldName](./search-headless.fieldvaluedirectanswer.fieldname.md)
[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) &gt; [fieldName](./search-headless.basefieldvaluedirectanswer.fieldname.md)

## FieldValueDirectAnswer.fieldName property
## BaseFieldValueDirectAnswer.fieldName property

The field name of the direct answer.

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

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

## BaseFieldValueDirectAnswer interface

A direct answer where the answer came from a field from the knowledge graph.

<b>Signature:</b>

```typescript
export declare interface BaseFieldValueDirectAnswer<T = unknown> extends DirectAnswer<T>
```
<b>Extends:</b> [DirectAnswer](./search-headless.directanswer.md)<!-- -->&lt;T&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [entityName](./search-headless.basefieldvaluedirectanswer.entityname.md) | string | The name of the entity that direct answer came from. |
| [fieldApiName](./search-headless.basefieldvaluedirectanswer.fieldapiname.md) | string | The field api name of the direct answer. |
| [fieldName](./search-headless.basefieldvaluedirectanswer.fieldname.md) | string | The field name of the direct answer. |
| [type](./search-headless.basefieldvaluedirectanswer.type.md) | [DirectAnswerType.FieldValue](./search-headless.directanswertype.md) | Indicates that the DirectAnswer is a [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md)<!-- -->. |
| [value](./search-headless.basefieldvaluedirectanswer.value.md) | T | The result of the direct answer. |
13 changes: 13 additions & 0 deletions docs/search-headless.basefieldvaluedirectanswer.type.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; [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) &gt; [type](./search-headless.basefieldvaluedirectanswer.type.md)

## BaseFieldValueDirectAnswer.type property

Indicates that the DirectAnswer is a [FieldValueDirectAnswer](./search-headless.fieldvaluedirectanswer.md)<!-- -->.

<b>Signature:</b>

```typescript
type: DirectAnswerType.FieldValue;
```
13 changes: 13 additions & 0 deletions docs/search-headless.basefieldvaluedirectanswer.value.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; [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) &gt; [value](./search-headless.basefieldvaluedirectanswer.value.md)

## BaseFieldValueDirectAnswer.value property

The result of the direct answer.

<b>Signature:</b>

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

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

## BuiltInFieldType enum

Possible built-in field types for [DirectAnswer.fieldType](./search-headless.directanswer.fieldtype.md)<!-- -->.

<b>Signature:</b>

```typescript
export declare enum BuiltInFieldType
```

## Enumeration Members

| Member | Value | Description |
| --- | --- | --- |
| Address | <code>&quot;address&quot;</code> | |
| AndroidAppURL | <code>&quot;android_app_url&quot;</code> | |
| ComplexURL | <code>&quot;complex_url&quot;</code> | |
| Decimal | <code>&quot;decimal&quot;</code> | |
| Email | <code>&quot;email&quot;</code> | |
| FacebookURL | <code>&quot;facebook_url&quot;</code> | |
| InstagramHandle | <code>&quot;instagram_handle&quot;</code> | |
| Integer | <code>&quot;integer&quot;</code> | |
| IOSAppURL | <code>&quot;ios_app_url&quot;</code> | |
| MultiLineText | <code>&quot;multi_line_text&quot;</code> | |
| Phone | <code>&quot;phone&quot;</code> | |
| RichText | <code>&quot;rich_text&quot;</code> | |
| SingleLineText | <code>&quot;single_line_text&quot;</code> | |
| TwitterHandle | <code>&quot;twitter_handle&quot;</code> | |
| URL | <code>&quot;url&quot;</code> | |

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

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [ComplexUrlDirectAnswer](./search-headless.complexurldirectanswer.md) &gt; [fieldType](./search-headless.complexurldirectanswer.fieldtype.md)

## ComplexUrlDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.ComplexURL>;
```
21 changes: 21 additions & 0 deletions docs/search-headless.complexurldirectanswer.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; [ComplexUrlDirectAnswer](./search-headless.complexurldirectanswer.md)

## ComplexUrlDirectAnswer interface

A direct answer for a complex url field.

<b>Signature:</b>

```typescript
export declare interface ComplexUrlDirectAnswer extends BaseFieldValueDirectAnswer<ComplexURL>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md)<!-- -->&lt;ComplexURL&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.complexurldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.ComplexURL](./search-headless.builtinfieldtype.md)<!-- -->&gt; | |
11 changes: 11 additions & 0 deletions docs/search-headless.decimaldirectanswer.fieldtype.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [DecimalDirectAnswer](./search-headless.decimaldirectanswer.md) &gt; [fieldType](./search-headless.decimaldirectanswer.fieldtype.md)

## DecimalDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.Decimal>;
```
21 changes: 21 additions & 0 deletions docs/search-headless.decimaldirectanswer.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; [DecimalDirectAnswer](./search-headless.decimaldirectanswer.md)

## DecimalDirectAnswer interface

A direct answer for a decimal field, which is a number represented using a string.

<b>Signature:</b>

```typescript
export declare interface DecimalDirectAnswer extends BaseFieldValueDirectAnswer<string | string[]>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md)<!-- -->&lt;string \| string\[\]&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.decimaldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.Decimal](./search-headless.builtinfieldtype.md)<!-- -->&gt; | |
2 changes: 1 addition & 1 deletion docs/search-headless.directanswer.fieldtype.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ The field type of the direct answer.
<b>Signature:</b>

```typescript
fieldType: BuiltInFieldType | string;
fieldType: EnumOrLiteral<BuiltInFieldType> | 'unknown';
```
4 changes: 2 additions & 2 deletions docs/search-headless.directanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export declare interface DirectAnswer<T = unknown>

| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.directanswer.fieldtype.md) | BuiltInFieldType \| string | The field type of the direct answer. |
| [fieldType](./search-headless.directanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType](./search-headless.builtinfieldtype.md)<!-- -->&gt; \| 'unknown' | The field type of the direct answer. |
| [relatedResult](./search-headless.directanswer.relatedresult.md) | [Result](./search-headless.result.md) | The entity associated with the direct answer. |
| [type](./search-headless.directanswer.type.md) | [DirectAnswerType](./search-headless.directanswertype.md) | The [DirectAnswerType](./search-headless.directanswertype.md)<!-- -->. |
| [value?](./search-headless.directanswer.value.md) | T | <i>(Optional)</i> The result of the direct answer. |
| [value?](./search-headless.directanswer.value.md) | T | <i>(Optional)</i> The value of the direct answer. |
| [verticalKey](./search-headless.directanswer.verticalkey.md) | string | The vertical key of the direct answer. |

4 changes: 2 additions & 2 deletions docs/search-headless.directanswer.value.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## DirectAnswer.value property

The result of the direct answer.
The value of the direct answer.

<b>Signature:</b>

Expand All @@ -14,5 +14,5 @@ value?: T;

## Remarks

A value will not be present if the [DirectAnswer.fieldType](./search-headless.directanswer.fieldtype.md) is 'rich\_text'.
A value will not be present if the [DirectAnswer.type](./search-headless.directanswer.type.md) is 'FEATURED\_SNIPPET' and [DirectAnswer.fieldType](./search-headless.directanswer.fieldtype.md) is 'rich\_text'.

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

[Home](./index.md) &gt; [@yext/search-headless](./search-headless.md) &gt; [EmailDirectAnswer](./search-headless.emaildirectanswer.md) &gt; [fieldType](./search-headless.emaildirectanswer.fieldtype.md)

## EmailDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.Email>;
```
21 changes: 21 additions & 0 deletions docs/search-headless.emaildirectanswer.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; [EmailDirectAnswer](./search-headless.emaildirectanswer.md)

## EmailDirectAnswer interface

A [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) interface with 'email' field type.

<b>Signature:</b>

```typescript
export declare interface EmailDirectAnswer extends BaseFieldValueDirectAnswer<string[]>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md)<!-- -->&lt;string\[\]&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-headless.emaildirectanswer.fieldtype.md) | [EnumOrLiteral](./search-headless.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.Email](./search-headless.builtinfieldtype.md)<!-- -->&gt; | |
Loading

0 comments on commit 90e9feb

Please sign in to comment.