Skip to content

Commit

Permalink
remove deprecated code (#132)
Browse files Browse the repository at this point in the history
This PR removes any code that's marked deprecated as part of renaming and uses the newest alpha of core where all deprecated code is removed.

J=SLAP-2331
TEST=manual

Test: removed code that's tagged deprecated and files named deprecate, updated the documentations, and searched 'deprecate', 'answers', as well as all identifiers in Cindy's renaming prs. Also renamed any deprecated identifiers in past prs that still remain in the document (AnswersHeadless -> SearchHeadless, AnswersCore -> SearchCore). Updated to the newest alpha version to confirm any deprecated re-exports are removed.
  • Loading branch information
juliannzhou authored Aug 18, 2022
1 parent a1f0d44 commit 2fa8868
Show file tree
Hide file tree
Showing 26 changed files with 42 additions and 290 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.215
- @yext/search-core@2.0.0-alpha.218

This package contains the following license and notice below:

Expand Down
18 changes: 0 additions & 18 deletions docs/search-headless.answersconfig.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.answersconfigwithapikey.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.answersconfigwithtoken.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.answerscore.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.answerserror.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.answersheadless.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.answersrequest.md

This file was deleted.

16 changes: 0 additions & 16 deletions docs/search-headless.answersutilities.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/search-headless.baseanswersconfig.md

This file was deleted.

15 changes: 15 additions & 0 deletions docs/search-headless.basesearchconfig.additionalqueryparams.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- 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; [additionalQueryParams](./search-headless.basesearchconfig.additionalqueryparams.md)

## BaseSearchConfig.additionalQueryParams property

Additional query params added on to every request.

<b>Signature:</b>

```typescript
additionalQueryParams?: {
[key: string]: string | number | boolean;
};
```
1 change: 1 addition & 0 deletions docs/search-headless.basesearchconfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export declare interface BaseSearchConfig

| 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. |
| [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. |
| [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. |
Expand Down
10 changes: 0 additions & 10 deletions docs/search-headless.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@

| Class | Description |
| --- | --- |
| [AnswersCore](./search-headless.answerscore.md) | |
| [AnswersHeadless](./search-headless.answersheadless.md) | |
| [SearchCore](./search-headless.searchcore.md) | Provides methods for executing searches, submitting questions, and performing autocompletes. |
| [SearchError](./search-headless.searcherror.md) | Represents an error |
| [SearchHeadless](./search-headless.searchheadless.md) | Provides the functionality for interacting with a Search experience. |
Expand Down Expand Up @@ -54,15 +52,10 @@
| [AddressDirectAnswer](./search-headless.addressdirectanswer.md) | A [BaseFieldValueDirectAnswer](./search-headless.basefieldvaluedirectanswer.md) interface with 'address' field type. |
| [AllResultsForVertical](./search-headless.allresultsforvertical.md) | Represents all results for the current vertical. |
| [AndroidAppUrlDirectAnswer](./search-headless.androidappurldirectanswer.md) | A direct answer for an android app url field. |
| [AnswersConfigWithApiKey](./search-headless.answersconfigwithapikey.md) | |
| [AnswersConfigWithToken](./search-headless.answersconfigwithtoken.md) | |
| [AnswersError](./search-headless.answerserror.md) | |
| [AnswersRequest](./search-headless.answersrequest.md) | |
| [AppliedQueryFilter](./search-headless.appliedqueryfilter.md) | A filter that the Search API applied to the search. |
| [AutocompleteResponse](./search-headless.autocompleteresponse.md) | The response of a universal or vertical autocomplete request. |
| [AutocompleteResult](./search-headless.autocompleteresult.md) | An autocomplete suggestion. |
| [AutocompleteService](./search-headless.autocompleteservice.md) | A service for autocomplete requests. |
| [BaseAnswersConfig](./search-headless.baseanswersconfig.md) | |
| [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)<!-- -->. |
Expand Down Expand Up @@ -150,22 +143,19 @@

| Namespace | Description |
| --- | --- |
| [answersUtilities](./search-headless.answersutilities.md) | |
| [searchUtilities](./search-headless.searchutilities.md) | |

## Variables

| Variable | Description |
| --- | --- |
| [DEFAULT\_HEADLESS\_ID](./search-headless.default_headless_id.md) | The headlessId automatically given to the first SearchHeadless instance created. |
| [provideAnswersHeadless](./search-headless.provideanswersheadless.md) | Supplies a new instance of [SearchHeadless](./search-headless.searchheadless.md)<!-- -->, using the provided configuration. |
| [SandboxEndpoints](./search-headless.sandboxendpoints.md) | The endpoints to use for sandbox experiences. |

## Type Aliases

| Type Alias | Description |
| --- | --- |
| [AnswersConfig](./search-headless.answersconfig.md) | |
| [Context](./search-headless.context.md) | Used to trigger Search [Query Rules](https://hitchhikers.yext.com/tracks/answers-advanced/ans302-query-rules/)<!-- -->. |
| [EnumOrLiteral](./search-headless.enumorliteral.md) | Produces a union type from the enum passed as a generic which consists of the enum values and the string literals of the enum. |
| [FeaturedSnippetDirectAnswer](./search-headless.featuredsnippetdirectanswer.md) | All possible built-in [BaseFeaturedSnippetDirectAnswer](./search-headless.basefeaturedsnippetdirectanswer.md) interfaces. |
Expand Down
18 changes: 0 additions & 18 deletions docs/search-headless.provideanswersheadless.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ referrerPageUrl?: string;

## Example

If a user is on https://www.yext.com/ and navigates to https://www.yext.com/answers and perform a search, the referrerPageUrl would be https://www.yext.com/.
If a user is on https://www.yext.com/ and navigates to https://search.yext.com/ and perform a search, the referrerPageUrl would be https://www.yext.com/.

41 changes: 3 additions & 38 deletions etc/search-headless.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,36 +52,6 @@ export interface AndroidAppUrlDirectAnswer extends BaseFieldValueDirectAnswer<st
fieldType: EnumOrLiteral<BuiltInFieldType.AndroidAppURL>;
}

// @public @deprecated (undocumented)
export type AnswersConfig = SearchConfig;

// @public @deprecated (undocumented)
export interface AnswersConfigWithApiKey extends SearchConfigWithApiKey {
}

// @public @deprecated (undocumented)
export interface AnswersConfigWithToken extends SearchConfigWithToken {
}

// @public @deprecated (undocumented)
export class AnswersCore extends SearchCore {
}

// @public @deprecated (undocumented)
export interface AnswersError extends SearchError {
}

// @public @deprecated (undocumented)
export class AnswersHeadless extends SearchHeadless {
}

// @public @deprecated (undocumented)
export interface AnswersRequest extends SearchRequest {
}

// @public @deprecated (undocumented)
export namespace answersUtilities { }

// @public
export interface AppliedQueryFilter {
details?: LocationFilterDetails;
Expand Down Expand Up @@ -126,10 +96,6 @@ export interface AutocompleteService {
verticalAutocomplete(request: VerticalAutocompleteRequest): Promise<AutocompleteResponse>;
}

// @public @deprecated (undocumented)
export interface BaseAnswersConfig extends BaseSearchConfig {
}

// @public
export interface BaseFeaturedSnippetDirectAnswer<T = unknown> extends DirectAnswer<T> {
fieldType: EnumOrLiteral<BuiltInFieldType.MultiLineText | BuiltInFieldType.RichText>;
Expand All @@ -148,12 +114,14 @@ export interface BaseFieldValueDirectAnswer<T = unknown> extends DirectAnswer<T>

// @public
export interface BaseSearchConfig {
additionalQueryParams?: {
[key: string]: string | number | boolean;
};
endpoints?: Endpoints;
experienceKey: string;
experienceVersion?: 'STAGING' | 'PRODUCTION' | string | number;
locale: string;
visitor?: Visitor;
/* Excluded from this release type: additionalQueryParams */
}

// @public
Expand Down Expand Up @@ -553,9 +521,6 @@ export interface PhoneDirectAnswer extends BaseFieldValueDirectAnswer<string> {
fieldType: BuiltInFieldType.Phone;
}

// @public @deprecated
export const provideAnswersHeadless: typeof provideHeadless;

// Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "provideHeadless" because one of its declarations is marked as @internal
//
// @public
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@reduxjs/toolkit": "^1.8.1",
"@yext/search-core": "^2.0.0-alpha.215",
"@yext/search-core": "^2.0.0-alpha.218",
"js-levenshtein": "^1.1.6",
"lodash": "^4.17.21"
},
Expand Down
Loading

0 comments on commit 2fa8868

Please sign in to comment.