Skip to content

Commit

Permalink
Version 1.6.0 (#162)
Browse files Browse the repository at this point in the history
## Version 1.6.0
### Features
- Added AUTOCOMPLETE as a query source to support visual autocomplete (#126)
- Added support for data returned in search responses from query rules actions (#128)
- Added support for passing Answers Agents in the HTTP header (#141, #144)
- Added number range facets and filters support (#145)
- Updated `AppliedQueryFilter` to support a type and details (#159)

### Changes
- Exposed Service interfaces and the `AnswersCore` constructor (#131)
- Updated the `v` param to have number range facets returned in API responses (#149)

### Bug Fixes
- Updated `FilterSearchResponse` to match the fields returned in the API response (#112)
- Updated `Source` to allow CUSTOM_SEARCHER as a source of results (#158)
  • Loading branch information
nmanu1 authored May 10, 2022
2 parents 5bc777c + a5787ac commit 1e5b3fe
Show file tree
Hide file tree
Showing 173 changed files with 7,965 additions and 2,938 deletions.
25 changes: 1 addition & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module'
},
extends: [
'plugin:@typescript-eslint/recommended'
'@yext/slapshot/typescript'
],
rules: {
indent: ['error', 2],
'no-trailing-spaces' : ['error'],
'no-multi-spaces' : ['error'],
quotes: ['error', 'single'],
'space-before-function-paren': ['error', {
named: 'never',
anonymous: 'never'
}],
'quote-props': ['error', 'as-needed'],
'max-len': ['error', {
code: 110,
ignorePattern: '^import\\s.+\\sfrom\\s.+;$'
}],
'@typescript-eslint/semi': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error'],
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '^_' }],
},
overrides: [
{
files: ['src/transformers/**/*.ts'],
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @yext/slapshot
23 changes: 4 additions & 19 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,7 @@ on:
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 }}
call_code_coverage:
uses: yext/slapshot-reusable-workflows/.github/workflows/coverage.yml@v1
secrets:
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
21 changes: 4 additions & 17 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,7 @@ name: Run Tests
on: [push, pull_request]

jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x, 14.x, 15.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: npm run build-ci
- run: ./scripts/validate-docs.sh
- run: npm test
call_run_tests:
uses: yext/slapshot-reusable-workflows/.github/workflows/run_tests.yml@v1
with:
build_script: npm run build-ci
26 changes: 5 additions & 21 deletions .github/workflows/sync_develop_and_main.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
name: create PR from main to develop
name: Create PR from main to develop

on:
push:
branches: [main, master]

permissions:
contents: read
pull-requests: write

jobs:
createPullRequest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: extract package version
id: vars
run: |
PACKAGE_VERSION="v$(cat ./package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')"
echo ::set-output name=tag::${PACKAGE_VERSION}
- uses: repo-sync/pull-request@v2
with:
source_branch: "${{ github.event.repository.default_branch }}"
destination_branch: "develop"
pr_title: "Merge ${{ github.event.repository.default_branch }} (${{ steps.vars.outputs.tag }}) into develop"
pr_body: "Merge ${{ github.event.repository.default_branch }} (${{ steps.vars.outputs.tag }}) into develop"
github_token: ${{ secrets.GITHUB_TOKEN }}
call_sync_develop_and_main:
uses: yext/slapshot-reusable-workflows/.github/workflows/sync_develop_and_main.yml@v1
secrets:
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
9 changes: 9 additions & 0 deletions .github/workflows/third_party_notices_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Check and Update Third Party Notices

on: pull_request

jobs:
call_notices_check:
uses: yext/slapshot-reusable-workflows/.github/workflows/third_party_notices_check.yml@v1
secrets:
REPO_SCOPED_TOKEN: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
11 changes: 11 additions & 0 deletions .github/workflows/update_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Check and Update Repo's documenation

on: pull_request

jobs:
call_update_docs:
uses: yext/slapshot-reusable-workflows/.github/workflows/update_docs.yml@v1
with:
build_script: npm run build-ci
secrets:
REPO_SCOPED_TOKEN: ${{ secrets.BOT_REPO_SCOPED_TOKEN }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/
dist/
lib/
temp/
coverage/
.DS_Store
8 changes: 7 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
The Answers 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)
which is made available under the ODC Attribution License (https://github.com/mattcg/language-subtag-registry/blob/master/LICENSE.md).

BSD 3-Clause License

Copyright (c) 2021, Yext
Copyright (c) 2022, Yext
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
65 changes: 63 additions & 2 deletions THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ THE SOFTWARE.

The following NPM package may be included in this product:

- [email protected].4
- [email protected].5

This package contains the following license and notice below:

Expand Down Expand Up @@ -89,7 +89,7 @@ SOFTWARE.

The following NPM package may be included in this product:

- [email protected].1
- [email protected].7

This package contains the following license and notice below:

Expand Down Expand Up @@ -147,4 +147,65 @@ SOFTWARE.

-----------

The following NPM package may be included in this product:

- [email protected]

This package contains the following license and notice below:

(MIT)

-----------

The following NPM package may be included in this product:

- [email protected]

This package contains the following license and notice below:

# The BSD 2-Clause License

Copyright (c) 2014, Domenic Denicola
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-----------

The following NPM package may be included in this product:

- [email protected]

This package contains the following license and notice below:

The MIT License (MIT)

Copyright (c) 2015–2016 Sebastian Mayr

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

-----------

This file was generated with generate-license-file! https://www.npmjs.com/package/generate-license-file
8 changes: 4 additions & 4 deletions api-extractor.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
*
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
*/
"mainEntryPointFilePath": "<projectFolder>/lib/commonjs/index.d.ts",
"mainEntryPointFilePath": "<projectFolder>/dist/commonjs/src/index.d.ts",

/**
* A list of NPM package names whose exports should be treated as part of this package.
Expand Down Expand Up @@ -299,7 +299,7 @@
*
* DEFAULT VALUE: "warning"
*/
"logLevel": "warning"
"logLevel": "error"

/**
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
Expand Down Expand Up @@ -328,7 +328,7 @@
*/
"extractorMessageReporting": {
"default": {
"logLevel": "warning"
"logLevel": "error"
// "addToApiReportFile": false
}

Expand All @@ -349,7 +349,7 @@
*/
"tsdocMessageReporting": {
"default": {
"logLevel": "warning"
"logLevel": "error"
// "addToApiReportFile": false
}

Expand Down
13 changes: 13 additions & 0 deletions docs/answers-core.additionalhttpheaders._client-sdk_.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; [AdditionalHttpHeaders](./answers-core.additionalhttpheaders.md) &gt; ["Client-SDK"](./answers-core.additionalhttpheaders._client-sdk_.md)

## 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.

<b>Signature:</b>

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

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

## AdditionalHttpHeaders interface

AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers.

<b>Signature:</b>

```typescript
export interface AdditionalHttpHeaders
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| ["Client-SDK"?](./answers-core.additionalhttpheaders._client-sdk_.md) | [ClientSDKHeaderValues](./answers-core.clientsdkheadervalues.md) | <i>(Optional)</i> 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. |

22 changes: 22 additions & 0 deletions docs/answers-core.answerscore._constructor_.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@yext/answers-core](./answers-core.md) &gt; [AnswersCore](./answers-core.answerscore.md) &gt; [(constructor)](./answers-core.answerscore._constructor_.md)

## AnswersCore.(constructor)

Constructs a new instance of the `AnswersCore` class

<b>Signature:</b>

```typescript
constructor(searchService: SearchService, questionSubmissionService: QuestionSubmissionService, autoCompleteService: AutocompleteService);
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| searchService | [SearchService](./answers-core.searchservice.md) | |
| questionSubmissionService | [QuestionSubmissionService](./answers-core.questionsubmissionservice.md) | |
| autoCompleteService | [AutocompleteService](./answers-core.autocompleteservice.md) | |

6 changes: 4 additions & 2 deletions docs/answers-core.answerscore.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ Provides methods for executing searches, submitting questions, and performing au
export declare class AnswersCore
```

## Remarks
## Constructors

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `AnswersCore` class.
| Constructor | Modifiers | Description |
| --- | --- | --- |
| [(constructor)(searchService, questionSubmissionService, autoCompleteService)](./answers-core.answerscore._constructor_.md) | | Constructs a new instance of the <code>AnswersCore</code> class |

## Methods

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

## AnswersRequest.additionalHttpHeaders property

AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers.

<b>Signature:</b>

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

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

## AnswersRequest interface

Options for an Answers API request.

<b>Signature:</b>

```typescript
export interface AnswersRequest
```

## Properties

| Property | Type | Description |
| --- | --- | --- |
| [additionalHttpHeaders?](./answers-core.answersrequest.additionalhttpheaders.md) | [AdditionalHttpHeaders](./answers-core.additionalhttpheaders.md) | <i>(Optional)</i> AdditionalHttpHeaders allows users to specify additional values for specific HTTP headers. |

Loading

0 comments on commit 1e5b3fe

Please sign in to comment.