Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
## Version 1.2.0
### Changes
- The `fieldType` attribute has been added to the `DirectAnswer` model. (#84)
- The `endpoints` attribute of `AnswersConfig` is now public, as is the `Endpoints` type. This attribute can be used to override the endpoints for search, autocomplete, and question submission. (#81)
- Added test coverage reports to the repository. (#78)

### Bug Fixes
- The `Snippet` type is now properly exported. (#83)
  • Loading branch information
tmeyer2115 authored Jun 22, 2021
2 parents 95c2c57 + 35b3fd9 commit 19c773d
Show file tree
Hide file tree
Showing 45 changed files with 521 additions and 103 deletions.
9 changes: 5 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ module.exports = {
'plugin:@typescript-eslint/recommended'
],
rules: {
indent: ['error', 2],
'no-trailing-spaces' : ['error'],
'no-multi-spaces' : ['error'],
quotes: ['error', 'single'],
'space-before-function-paren': ['error', {
named: 'never',
anonymous: 'never'
named: 'never',
anonymous: 'never'
}],
'quote-props': ['error', 'as-needed'],
'max-len': ['error', {
code: 125,
ignorePattern: '^import\\s.+\\sfrom\\s.+;$'
code: 125,
ignorePattern: '^import\\s.+\\sfrom\\s.+;$'
}],
'@typescript-eslint/semi': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error'],
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will run our tests, generate an lcov code coverage file,
# and send that coverage to Coveralls

name: Code Coverage

on:
push:
branches-ignore: dev/*
pull_request:

jobs:
Coveralls:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx jest --coverage
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<a href="./LICENSE">
<img src="https://img.shields.io/badge/License-BSD%203--Clause-blue.svg" alt="License"/>
</a>
<a href='https://coveralls.io/github/yext/answers-core?branch=master'>
<img src='https://coveralls.io/repos/github/yext/answers-core/badge.svg?branch=master' alt='Coverage Status' />
</a>
</div>
<br>

Expand Down
13 changes: 13 additions & 0 deletions docs/answers-core.answersconfig.endpoints.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/answers-core](./answers-core.md) &gt; [AnswersConfig](./answers-core.answersconfig.md) &gt; [endpoints](./answers-core.answersconfig.endpoints.md)

## AnswersConfig.endpoints property

Overrides for the URLs which are used when making requests to the Answers API.

<b>Signature:</b>

```typescript
endpoints?: Endpoints;
```
1 change: 1 addition & 0 deletions docs/answers-core.answersconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface AnswersConfig
| Property | Type | Description |
| --- | --- | --- |
| [apiKey](./answers-core.answersconfig.apikey.md) | string | The api key of the answers experience. |
| [endpoints?](./answers-core.answersconfig.endpoints.md) | [Endpoints](./answers-core.endpoints.md) | <i>(Optional)</i> Overrides for the URLs which are used when making requests to the Answers API. |
| [experienceKey](./answers-core.answersconfig.experiencekey.md) | string | The experience key of the answers experience. |
| [experienceVersion?](./answers-core.answersconfig.experienceversion.md) | 'STAGING' \| 'PRODUCTION' \| string \| number | <i>(Optional)</i> The version of the answers experience configuration. |
| [locale](./answers-core.answersconfig.locale.md) | string | The locale of the answers experience. |
Expand Down
13 changes: 13 additions & 0 deletions docs/answers-core.directanswer.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/answers-core](./answers-core.md) &gt; [DirectAnswer](./answers-core.directanswer.md) &gt; [fieldType](./answers-core.directanswer.fieldtype.md)

## DirectAnswer.fieldType property

The field type of the direct answer.

<b>Signature:</b>

```typescript
fieldType: string;
```
3 changes: 2 additions & 1 deletion docs/answers-core.directanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ export interface DirectAnswer

| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./answers-core.directanswer.fieldtype.md) | string | The field type of the direct answer. |
| [relatedResult](./answers-core.directanswer.relatedresult.md) | [Result](./answers-core.result.md) | The entity associated with the direct answer. |
| [type](./answers-core.directanswer.type.md) | [DirectAnswerType](./answers-core.directanswertype.md) | The [DirectAnswerType](./answers-core.directanswertype.md)<!-- -->. |
| [value](./answers-core.directanswer.value.md) | string | The result of the direct answer. |
| [value?](./answers-core.directanswer.value.md) | string | <i>(Optional)</i> The result of the direct answer. |
| [verticalKey](./answers-core.directanswer.verticalkey.md) | string | The vertical key of the direct answer. |

7 changes: 6 additions & 1 deletion docs/answers-core.directanswer.value.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ The result of the direct answer.
<b>Signature:</b>

```typescript
value: string;
value?: string;
```

## Remarks

A value will not be present if the [DirectAnswer.fieldType](./answers-core.directanswer.fieldtype.md) is 'rich\_text'.

11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.filtersearch.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [filterSearch](./answers-core.endpoints.filtersearch.md)

## Endpoints.filterSearch property

<b>Signature:</b>

```typescript
filterSearch?: string;
```
26 changes: 26 additions & 0 deletions docs/answers-core.endpoints.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md)

## Endpoints interface

Overrides for the URLs which are used when making requests to the Answers API.

<b>Signature:</b>

```typescript
export interface Endpoints
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [filterSearch?](./answers-core.endpoints.filtersearch.md) | string | <i>(Optional)</i> |
| [questionSubmission?](./answers-core.endpoints.questionsubmission.md) | string | <i>(Optional)</i> |
| [status?](./answers-core.endpoints.status.md) | string | <i>(Optional)</i> |
| [universalAutocomplete?](./answers-core.endpoints.universalautocomplete.md) | string | <i>(Optional)</i> |
| [universalSearch?](./answers-core.endpoints.universalsearch.md) | string | <i>(Optional)</i> |
| [verticalAutocomplete?](./answers-core.endpoints.verticalautocomplete.md) | string | <i>(Optional)</i> |
| [verticalSearch?](./answers-core.endpoints.verticalsearch.md) | string | <i>(Optional)</i> |

11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.questionsubmission.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [questionSubmission](./answers-core.endpoints.questionsubmission.md)

## Endpoints.questionSubmission property

<b>Signature:</b>

```typescript
questionSubmission?: string;
```
11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.status.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [status](./answers-core.endpoints.status.md)

## Endpoints.status property

<b>Signature:</b>

```typescript
status?: string;
```
11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.universalautocomplete.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [universalAutocomplete](./answers-core.endpoints.universalautocomplete.md)

## Endpoints.universalAutocomplete property

<b>Signature:</b>

```typescript
universalAutocomplete?: string;
```
11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.universalsearch.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [universalSearch](./answers-core.endpoints.universalsearch.md)

## Endpoints.universalSearch property

<b>Signature:</b>

```typescript
universalSearch?: string;
```
11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.verticalautocomplete.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [verticalAutocomplete](./answers-core.endpoints.verticalautocomplete.md)

## Endpoints.verticalAutocomplete property

<b>Signature:</b>

```typescript
verticalAutocomplete?: string;
```
11 changes: 11 additions & 0 deletions docs/answers-core.endpoints.verticalsearch.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/answers-core](./answers-core.md) &gt; [Endpoints](./answers-core.endpoints.md) &gt; [verticalSearch](./answers-core.endpoints.verticalsearch.md)

## Endpoints.verticalSearch property

<b>Signature:</b>

```typescript
verticalSearch?: string;
```
13 changes: 13 additions & 0 deletions docs/answers-core.featuredsnippetdirectanswer.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/answers-core](./answers-core.md) &gt; [FeaturedSnippetDirectAnswer](./answers-core.featuredsnippetdirectanswer.md) &gt; [fieldType](./answers-core.featuredsnippetdirectanswer.fieldtype.md)

## FeaturedSnippetDirectAnswer.fieldType property

The field type of the direct answer.

<b>Signature:</b>

```typescript
fieldType: string;
```
5 changes: 3 additions & 2 deletions docs/answers-core.featuredsnippetdirectanswer.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ export interface FeaturedSnippetDirectAnswer extends DirectAnswer
| Property | Type | Description |
| --- | --- | --- |
| [fieldType](./answers-core.featuredsnippetdirectanswer.fieldtype.md) | string | The field type of the direct answer. |
| [relatedResult](./answers-core.featuredsnippetdirectanswer.relatedresult.md) | [Result](./answers-core.result.md) | The entity associated with the direct answer. |
| [snippet](./answers-core.featuredsnippetdirectanswer.snippet.md) | Snippet | The snippet where the direct answer was found. |
| [snippet](./answers-core.featuredsnippetdirectanswer.snippet.md) | [Snippet](./answers-core.snippet.md) | The snippet where the direct answer was found. |
| [type](./answers-core.featuredsnippetdirectanswer.type.md) | [DirectAnswerType.FeaturedSnippet](./answers-core.directanswertype.featuredsnippet.md) | [DirectAnswerType](./answers-core.directanswertype.md)<!-- -->.FeaturedSnippet. |
| [value](./answers-core.featuredsnippetdirectanswer.value.md) | string | The result of the direct answer. |
| [value?](./answers-core.featuredsnippetdirectanswer.value.md) | string | <i>(Optional)</i> The result of the direct answer. |
| [verticalKey](./answers-core.featuredsnippetdirectanswer.verticalkey.md) | string | The vertical key of the direct answer. |
7 changes: 6 additions & 1 deletion docs/answers-core.featuredsnippetdirectanswer.value.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ The result of the direct answer.
<b>Signature:</b>

```typescript
value: string;
value?: string;
```

## Remarks

A value will not be present if the [DirectAnswer.fieldType](./answers-core.directanswer.fieldtype.md) is 'rich\_text'.

5 changes: 5 additions & 0 deletions docs/answers-core.fieldvaluedirectanswer.value.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ The result of the direct answer.
```typescript
value: string;
```

## Remarks

A value will not be present if the [DirectAnswer.fieldType](./answers-core.directanswer.fieldtype.md) is 'rich\_text'.

2 changes: 2 additions & 0 deletions docs/answers-core.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
| [DirectAnswer](./answers-core.directanswer.md) | A direct answer to a search. |
| [DisplayableFacet](./answers-core.displayablefacet.md) | A [Facet](./answers-core.facet.md) which contains extra fields meant to be displayed to the end user. |
| [DisplayableFacetOption](./answers-core.displayablefacetoption.md) | A [FacetOption](./answers-core.facetoption.md) with extra data meant to be displayed to the end user. |
| [Endpoints](./answers-core.endpoints.md) | Overrides for the URLs which are used when making requests to the Answers API. |
| [Facet](./answers-core.facet.md) | Represents dynamic filter options for the Answers API. |
| [FacetOption](./answers-core.facetoption.md) | A filter associated with the facet. |
| [FeaturedSnippetDirectAnswer](./answers-core.featuredsnippetdirectanswer.md) | A direct answer which was found within a document. |
Expand All @@ -60,6 +61,7 @@
| [QuestionSubmissionResponse](./answers-core.questionsubmissionresponse.md) | A representation of a question submission response. |
| [Result](./answers-core.result.md) | An individual search result. |
| [SearchParameterField](./answers-core.searchparameterfield.md) | Indicates which entity field to perform the autocomplete request on. |
| [Snippet](./answers-core.snippet.md) | The section of text where a [FeaturedSnippetDirectAnswer](./answers-core.featuredsnippetdirectanswer.md) was found. |
| [SortBy](./answers-core.sortby.md) | Represents a criterion that can be used to sort results. |
| [SpellCheck](./answers-core.spellcheck.md) | A spellcheck response from a search query. |
| [UniversalAutocompleteRequest](./answers-core.universalautocompleterequest.md) | Options for a universal autocomplete request. |
Expand Down
16 changes: 16 additions & 0 deletions docs/answers-core.snippet.matchedsubstrings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/answers-core](./answers-core.md) &gt; [Snippet](./answers-core.snippet.md) &gt; [matchedSubstrings](./answers-core.snippet.matchedsubstrings.md)

## Snippet.matchedSubstrings property

The locations in the document text of the [FeaturedSnippetDirectAnswer.value](./answers-core.featuredsnippetdirectanswer.value.md)

<b>Signature:</b>

```typescript
matchedSubstrings: {
offset: number;
length: number;
}[];
```
21 changes: 21 additions & 0 deletions docs/answers-core.snippet.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/answers-core](./answers-core.md) &gt; [Snippet](./answers-core.snippet.md)

## Snippet interface

The section of text where a [FeaturedSnippetDirectAnswer](./answers-core.featuredsnippetdirectanswer.md) was found.

<b>Signature:</b>

```typescript
export interface Snippet
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [matchedSubstrings](./answers-core.snippet.matchedsubstrings.md) | { offset: number; length: number; }\[\] | The locations in the document text of the [FeaturedSnippetDirectAnswer.value](./answers-core.featuredsnippetdirectanswer.value.md) |
| [value](./answers-core.snippet.value.md) | string | The snippet's body of text |

13 changes: 13 additions & 0 deletions docs/answers-core.snippet.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/answers-core](./answers-core.md) &gt; [Snippet](./answers-core.snippet.md) &gt; [value](./answers-core.snippet.value.md)

## Snippet.value property

The snippet's body of text

<b>Signature:</b>

```typescript
value: string;
```
Loading

0 comments on commit 19c773d

Please sign in to comment.