Skip to content

Commit

Permalink
add additional string and string[] field value direct answers
Browse files Browse the repository at this point in the history
Each direct answer fieldType was manually tested and experimented with.
I used the test-site to double check that every single BuiltInFieldType
could be switch-cased over, and also added a bunch of test direct answer
queries that I used to test.

J=SLAP-2317,2311,2312,2309,2314
TEST=manual,auto

added switch case to the test site, and updated github workflow
to make sure test site always compiles
  • Loading branch information
oshi97 committed Aug 15, 2022
1 parent 3126bfa commit 77e1feb
Show file tree
Hide file tree
Showing 31 changed files with 602 additions and 15 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@ jobs:
uses: yext/slapshot-reusable-workflows/.github/workflows/run_tests.yml@v1
with:
build_script: npm run build-ci

test_site_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
- run: npm ci
- run: npm run build
- run: cd test-site
- run: npm i
- run: npx tsc
11 changes: 11 additions & 0 deletions docs/search-core.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-core](./search-core.md) &gt; [AndroidAppUrlDirectAnswer](./search-core.androidappurldirectanswer.md) &gt; [fieldType](./search-core.androidappurldirectanswer.fieldtype.md)

## AndroidAppUrlDirectAnswer.fieldType property

<b>Signature:</b>

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

## AndroidAppUrlDirectAnswer interface

A direct answer for an android app url field.

<b>Signature:</b>

```typescript
export interface AndroidAppUrlDirectAnswer extends BaseFieldValueDirectAnswer<string>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.androidappurldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.AndroidAppURL](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
7 changes: 7 additions & 0 deletions docs/search-core.builtinfieldtype.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,15 @@ export declare enum BuiltInFieldType

| Member | Value | Description |
| --- | --- | --- |
| AndroidAppURL | <code>&quot;android_app_url&quot;</code> | |
| Decimal | <code>&quot;decimal&quot;</code> | |
| FacebookURL | <code>&quot;facebook_url&quot;</code> | |
| InstagramHandle | <code>&quot;instagram_handle&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-core.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-core](./search-core.md) &gt; [DecimalDirectAnswer](./search-core.decimaldirectanswer.md) &gt; [fieldType](./search-core.decimaldirectanswer.fieldtype.md)

## DecimalDirectAnswer.fieldType property

<b>Signature:</b>

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

## DecimalDirectAnswer interface

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

<b>Signature:</b>

```typescript
export interface DecimalDirectAnswer extends BaseFieldValueDirectAnswer<string | string[]>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string \| string\[\]&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.decimaldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.Decimal](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
11 changes: 11 additions & 0 deletions docs/search-core.facebookurldirectanswer.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-core](./search-core.md) &gt; [FacebookUrlDirectAnswer](./search-core.facebookurldirectanswer.md) &gt; [fieldType](./search-core.facebookurldirectanswer.fieldtype.md)

## FacebookUrlDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.FacebookURL>;
```
21 changes: 21 additions & 0 deletions docs/search-core.facebookurldirectanswer.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-core](./search-core.md) &gt; [FacebookUrlDirectAnswer](./search-core.facebookurldirectanswer.md)

## FacebookUrlDirectAnswer interface

A direct answer for a facebook url field.

<b>Signature:</b>

```typescript
export interface FacebookUrlDirectAnswer extends BaseFieldValueDirectAnswer<string>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.facebookurldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.FacebookURL](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
4 changes: 2 additions & 2 deletions docs/search-core.fieldvaluedirectanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Possible built-in and custom [BaseFieldValueDirectAnswer](./search-core.basefiel
<b>Signature:</b>

```typescript
export declare type FieldValueDirectAnswer = UnknownFieldValueDirectAnswer;
export declare type FieldValueDirectAnswer = UnknownFieldValueDirectAnswer | TextValueDirectAnswer | UrlDirectAnswer | RichTextDirectAnswer | DecimalDirectAnswer | FacebookUrlDirectAnswer | InstagramHandleDirectAnswer | TwitterHandleDirectAnswer | IosAppUrlDirectAnswer | AndroidAppUrlDirectAnswer;
```
<b>References:</b> [UnknownFieldValueDirectAnswer](./search-core.unknownfieldvaluedirectanswer.md)
<b>References:</b> [UnknownFieldValueDirectAnswer](./search-core.unknownfieldvaluedirectanswer.md)<!-- -->, [TextValueDirectAnswer](./search-core.textvaluedirectanswer.md)<!-- -->, [UrlDirectAnswer](./search-core.urldirectanswer.md)<!-- -->, [RichTextDirectAnswer](./search-core.richtextdirectanswer.md)<!-- -->, [DecimalDirectAnswer](./search-core.decimaldirectanswer.md)<!-- -->, [FacebookUrlDirectAnswer](./search-core.facebookurldirectanswer.md)<!-- -->, [InstagramHandleDirectAnswer](./search-core.instagramhandledirectanswer.md)<!-- -->, [TwitterHandleDirectAnswer](./search-core.twitterhandledirectanswer.md)<!-- -->, [IosAppUrlDirectAnswer](./search-core.iosappurldirectanswer.md)<!-- -->, [AndroidAppUrlDirectAnswer](./search-core.androidappurldirectanswer.md)

11 changes: 11 additions & 0 deletions docs/search-core.instagramhandledirectanswer.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-core](./search-core.md) &gt; [InstagramHandleDirectAnswer](./search-core.instagramhandledirectanswer.md) &gt; [fieldType](./search-core.instagramhandledirectanswer.fieldtype.md)

## InstagramHandleDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.InstagramHandle>;
```
21 changes: 21 additions & 0 deletions docs/search-core.instagramhandledirectanswer.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-core](./search-core.md) &gt; [InstagramHandleDirectAnswer](./search-core.instagramhandledirectanswer.md)

## InstagramHandleDirectAnswer interface

A direct answer for an instagram handle field.

<b>Signature:</b>

```typescript
export interface InstagramHandleDirectAnswer extends BaseFieldValueDirectAnswer<string>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.instagramhandledirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.InstagramHandle](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
11 changes: 11 additions & 0 deletions docs/search-core.iosappurldirectanswer.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-core](./search-core.md) &gt; [IosAppUrlDirectAnswer](./search-core.iosappurldirectanswer.md) &gt; [fieldType](./search-core.iosappurldirectanswer.fieldtype.md)

## IosAppUrlDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.IOSAppURL>;
```
21 changes: 21 additions & 0 deletions docs/search-core.iosappurldirectanswer.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-core](./search-core.md) &gt; [IosAppUrlDirectAnswer](./search-core.iosappurldirectanswer.md)

## IosAppUrlDirectAnswer interface

A direct answer for an iOS app url field.

<b>Signature:</b>

```typescript
export interface IosAppUrlDirectAnswer extends BaseFieldValueDirectAnswer<string>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.iosappurldirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.IOSAppURL](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
9 changes: 9 additions & 0 deletions docs/search-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
| Interface | Description |
| --- | --- |
| [AdditionalHttpHeaders](./search-core.additionalhttpheaders.md) | AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers. |
| [AndroidAppUrlDirectAnswer](./search-core.androidappurldirectanswer.md) | A direct answer for an android app url field. |
| [AnswersConfigWithApiKey](./search-core.answersconfigwithapikey.md) | |
| [AnswersConfigWithToken](./search-core.answersconfigwithtoken.md) | |
| [AnswersError](./search-core.answerserror.md) | |
Expand All @@ -56,11 +57,13 @@
| [BaseSearchConfig](./search-core.basesearchconfig.md) | The base configuration options for [SearchCore](./search-core.searchcore.md)<!-- -->. |
| [ClientSDKHeaderValues](./search-core.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. |
| [ConjunctionStaticFilter](./search-core.conjunctionstaticfilter.md) | A static filter composed by combining other static filters with the logical AND operator. |
| [DecimalDirectAnswer](./search-core.decimaldirectanswer.md) | A direct answer for a decimal field, which is a number represented using a string. |
| [DirectAnswer](./search-core.directanswer.md) | A direct answer to a search. |
| [DisjunctionStaticFilter](./search-core.disjunctionstaticfilter.md) | A static filter composed by combining filters with the logical OR operator. The combined filters can either be field value filters or other disjunction filters. |
| [DisplayableFacet](./search-core.displayablefacet.md) | A [Facet](./search-core.facet.md) which contains extra fields meant to be displayed to the end user. |
| [DisplayableFacetOption](./search-core.displayablefacetoption.md) | A [FacetOption](./search-core.facetoption.md) with extra data meant to be displayed to the end user. |
| [Endpoints](./search-core.endpoints.md) | Overrides for the URLs which are used when making requests to the Search API. |
| [FacebookUrlDirectAnswer](./search-core.facebookurldirectanswer.md) | A direct answer for a facebook url field. |
| [Facet](./search-core.facet.md) | Represents dynamic filter options for the Search API. |
| [FacetOption](./search-core.facetoption.md) | A filter associated with the facet. |
| [FailedVertical](./search-core.failedvertical.md) | Error information from when a vertical fails to return results. |
Expand All @@ -69,6 +72,8 @@
| [FilterSearchRequest](./search-core.filtersearchrequest.md) | Options for a filtersearch request. |
| [FilterSearchResponse](./search-core.filtersearchresponse.md) | The response of a filtersearch request. |
| [HighlightedValue](./search-core.highlightedvalue.md) | A field value and its substring matches as emphasized by the Search API. |
| [InstagramHandleDirectAnswer](./search-core.instagramhandledirectanswer.md) | A direct answer for an instagram handle field. |
| [IosAppUrlDirectAnswer](./search-core.iosappurldirectanswer.md) | A direct answer for an iOS app url field. |
| [LatLong](./search-core.latlong.md) | The latitude and longitude of the user making the request. Used to bias the results. |
| [LocationBias](./search-core.locationbias.md) | Information about the user's location. |
| [LocationBoundingBox](./search-core.locationboundingbox.md) | Location boundaries for a filter with "Place" for its [AppliedQueryFilterType](./search-core.appliedqueryfiltertype.md)<!-- -->. (e.g. boundary for a locality or region specific location filter) |
Expand All @@ -82,6 +87,7 @@
| [QuestionSubmissionResponse](./search-core.questionsubmissionresponse.md) | A representation of a question submission response. |
| [QuestionSubmissionService](./search-core.questionsubmissionservice.md) | Submits a custom question to the Search API. |
| [Result](./search-core.result.md) | An individual search result. |
| [RichTextDirectAnswer](./search-core.richtextdirectanswer.md) | A direct answer for a rich text field. |
| [RichTextFeaturedSnippetDirectAnswer](./search-core.richtextfeaturedsnippetdirectanswer.md) | A [BaseFeaturedSnippetDirectAnswer](./search-core.basefeaturedsnippetdirectanswer.md) with 'rich\_text' field type. "value" field is omitted for featured snippet direct answer of this field type. |
| [SearchConfigWithApiKey](./search-core.searchconfigwithapikey.md) | Configuration options for [SearchCore](./search-core.searchcore.md)<!-- -->, which includes the options from [BaseSearchConfig](./search-core.basesearchconfig.md)<!-- -->, but requires apiKey. |
| [SearchConfigWithToken](./search-core.searchconfigwithtoken.md) | Configuration options for [SearchCore](./search-core.searchcore.md)<!-- -->, which includes the options from [BaseSearchConfig](./search-core.basesearchconfig.md)<!-- -->, but requires token. |
Expand All @@ -91,12 +97,15 @@
| [Snippet](./search-core.snippet.md) | The section of text where a [FeaturedSnippetDirectAnswer](./search-core.featuredsnippetdirectanswer.md) was found. |
| [SortBy](./search-core.sortby.md) | Represents a criterion that can be used to sort results. |
| [SpellCheck](./search-core.spellcheck.md) | A spellcheck response from a search query. |
| [TextValueDirectAnswer](./search-core.textvaluedirectanswer.md) | A direct answer whose source is a string or string list field in the knowledge graph. |
| [TwitterHandleDirectAnswer](./search-core.twitterhandledirectanswer.md) | A direct answer for an twitter handle field. |
| [UniversalAutocompleteRequest](./search-core.universalautocompleterequest.md) | Options for a universal autocomplete request. |
| [UniversalLimit](./search-core.universallimit.md) | The maximum limit of results per vertical. Each limit can be set from 1-50, inclusive. |
| [UniversalSearchRequest](./search-core.universalsearchrequest.md) | Options which can be specified for a universal search. |
| [UniversalSearchResponse](./search-core.universalsearchresponse.md) | A representation of a response from a universal search. |
| [UnknownFieldValueDirectAnswer](./search-core.unknownfieldvaluedirectanswer.md) | A [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md) with a field type outside of [BuiltInFieldType](./search-core.builtinfieldtype.md)<!-- -->. |
| [UpperNumberRangeLimit](./search-core.uppernumberrangelimit.md) | The end limit of [NumberRangeValue](./search-core.numberrangevalue.md)<!-- -->. |
| [UrlDirectAnswer](./search-core.urldirectanswer.md) | A direct answer for a simple url field. |
| [VerticalAutocompleteRequest](./search-core.verticalautocompleterequest.md) | Options for a vertial autocomplete request. |
| [VerticalResults](./search-core.verticalresults.md) | Represents results from a search vertical. |
| [VerticalSearchRequest](./search-core.verticalsearchrequest.md) | Options which can be specified for a vertical search. |
Expand Down
11 changes: 11 additions & 0 deletions docs/search-core.richtextdirectanswer.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-core](./search-core.md) &gt; [RichTextDirectAnswer](./search-core.richtextdirectanswer.md) &gt; [fieldType](./search-core.richtextdirectanswer.fieldtype.md)

## RichTextDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.RichText>;
```
21 changes: 21 additions & 0 deletions docs/search-core.richtextdirectanswer.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-core](./search-core.md) &gt; [RichTextDirectAnswer](./search-core.richtextdirectanswer.md)

## RichTextDirectAnswer interface

A direct answer for a rich text field.

<b>Signature:</b>

```typescript
export interface RichTextDirectAnswer extends BaseFieldValueDirectAnswer<string | string[]>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string \| string\[\]&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.richtextdirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.RichText](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
11 changes: 11 additions & 0 deletions docs/search-core.textvaluedirectanswer.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-core](./search-core.md) &gt; [TextValueDirectAnswer](./search-core.textvaluedirectanswer.md) &gt; [fieldType](./search-core.textvaluedirectanswer.fieldtype.md)

## TextValueDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.SingleLineText | BuiltInFieldType.MultiLineText>;
```
21 changes: 21 additions & 0 deletions docs/search-core.textvaluedirectanswer.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-core](./search-core.md) &gt; [TextValueDirectAnswer](./search-core.textvaluedirectanswer.md)

## TextValueDirectAnswer interface

A direct answer whose source is a string or string list field in the knowledge graph.

<b>Signature:</b>

```typescript
export interface TextValueDirectAnswer extends BaseFieldValueDirectAnswer<string | string[]>
```
<b>Extends:</b> [BaseFieldValueDirectAnswer](./search-core.basefieldvaluedirectanswer.md)<!-- -->&lt;string \| string\[\]&gt;
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./search-core.textvaluedirectanswer.fieldtype.md) | [EnumOrLiteral](./search-core.enumorliteral.md)<!-- -->&lt;[BuiltInFieldType.SingleLineText](./search-core.builtinfieldtype.md) \| [BuiltInFieldType.MultiLineText](./search-core.builtinfieldtype.md)<!-- -->&gt; | |
11 changes: 11 additions & 0 deletions docs/search-core.twitterhandledirectanswer.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-core](./search-core.md) &gt; [TwitterHandleDirectAnswer](./search-core.twitterhandledirectanswer.md) &gt; [fieldType](./search-core.twitterhandledirectanswer.fieldtype.md)

## TwitterHandleDirectAnswer.fieldType property

<b>Signature:</b>

```typescript
fieldType: EnumOrLiteral<BuiltInFieldType.TwitterHandle>;
```
Loading

0 comments on commit 77e1feb

Please sign in to comment.