diff --git a/packages/_vue3-migration-test/CHANGELOG.md b/packages/_vue3-migration-test/CHANGELOG.md index 30bfcca548..502d13227f 100644 --- a/packages/_vue3-migration-test/CHANGELOG.md +++ b/packages/_vue3-migration-test/CHANGELOG.md @@ -3,6 +3,46 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.0-alpha.57](https://github.com/empathyco/x/compare/vue3-migration-test@1.0.0-alpha.56...vue3-migration-test@1.0.0-alpha.57) (2024-10-31) + +**Note:** Version bump only for package vue3-migration-test + + + + + +## [1.0.0-alpha.56](https://github.com/empathyco/x/compare/vue3-migration-test@1.0.0-alpha.55...vue3-migration-test@1.0.0-alpha.56) (2024-10-31) + +**Note:** Version bump only for package vue3-migration-test + + + + + +## [1.0.0-alpha.55](https://github.com/empathyco/x/compare/vue3-migration-test@1.0.0-alpha.54...vue3-migration-test@1.0.0-alpha.55) (2024-10-31) + +**Note:** Version bump only for package vue3-migration-test + + + + + +## [1.0.0-alpha.54](https://github.com/empathyco/x/compare/vue3-migration-test@1.0.0-alpha.53...vue3-migration-test@1.0.0-alpha.54) (2024-10-28) + +**Note:** Version bump only for package vue3-migration-test + + + + + +## [1.0.0-alpha.53](https://github.com/empathyco/x/compare/vue3-migration-test@1.0.0-alpha.52...vue3-migration-test@1.0.0-alpha.53) (2024-10-28) + +**Note:** Version bump only for package vue3-migration-test + + + + + ## [1.0.0-alpha.52](https://github.com/empathyco/x/compare/vue3-migration-test@1.0.0-alpha.50...vue3-migration-test@1.0.0-alpha.52) (2024-10-24) diff --git a/packages/_vue3-migration-test/package.json b/packages/_vue3-migration-test/package.json index b8ec7fd0e4..257242ec68 100644 --- a/packages/_vue3-migration-test/package.json +++ b/packages/_vue3-migration-test/package.json @@ -1,7 +1,7 @@ { "name": "vue3-migration-test", "private": "true", - "version": "1.0.0-alpha.52", + "version": "1.0.0-alpha.57", "scripts": { "dev": "vite", "preview": "vite preview", @@ -9,9 +9,9 @@ "build": "vue-tsc && vite build" }, "dependencies": { - "@empathyco/x-adapter-platform": "^1.1.0-alpha.3", + "@empathyco/x-adapter-platform": "^1.1.0-alpha.8", "@empathyco/x-bus": "^1.0.3-alpha.1", - "@empathyco/x-types": "^10.1.0-alpha.3", + "@empathyco/x-types": "^10.1.0-alpha.5", "@empathyco/x-utils": "^1.0.3-alpha.1", "@vue/compat": "^3.4.22", "@vueuse/core": "~10.7.1", diff --git a/packages/x-adapter-platform/CHANGELOG.md b/packages/x-adapter-platform/CHANGELOG.md index 89d57357f0..69b581515f 100644 --- a/packages/x-adapter-platform/CHANGELOG.md +++ b/packages/x-adapter-platform/CHANGELOG.md @@ -3,6 +3,50 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.0-alpha.8](https://github.com/empathyco/x/compare/@empathyco/x-adapter-platform@1.1.0-alpha.7...@empathyco/x-adapter-platform@1.1.0-alpha.8) (2024-10-31) + + +### Features + +* add stats to search adapter (#1649) ([14b94ec](https://github.com/empathyco/x/commit/14b94ecf4c4a1f642232c74c22a50f4110976519)) + + + +## [1.1.0-alpha.7](https://github.com/empathyco/x/compare/@empathyco/x-adapter-platform@1.1.0-alpha.6...@empathyco/x-adapter-platform@1.1.0-alpha.7) (2024-10-31) + +**Note:** Version bump only for package @empathyco/x-adapter-platform + + + + + +## [1.1.0-alpha.6](https://github.com/empathyco/x/compare/@empathyco/x-adapter-platform@1.1.0-alpha.5...@empathyco/x-adapter-platform@1.1.0-alpha.6) (2024-10-31) + + +### Bug Fixes + +* change related prompts endpoint (#1652) ([61468cd](https://github.com/empathyco/x/commit/61468cd6b7fae02bb37f765490b8680e583de113)) + + + +## [1.1.0-alpha.5](https://github.com/empathyco/x/compare/@empathyco/x-adapter-platform@1.1.0-alpha.4...@empathyco/x-adapter-platform@1.1.0-alpha.5) (2024-10-28) + + +### Features + +* add adapter for related prompts (#1641) ([8066983](https://github.com/empathyco/x/commit/80669835142a5e8d3823d42d599adb51ffc5849a)) + + + +## [1.1.0-alpha.4](https://github.com/empathyco/x/compare/@empathyco/x-adapter-platform@1.1.0-alpha.3...@empathyco/x-adapter-platform@1.1.0-alpha.4) (2024-10-28) + + +### Features + +* add types for related prompts (#1640) ([9822c28](https://github.com/empathyco/x/commit/9822c285410f6d308a8a0e43f47e951b052592a2)) + + + ## [1.1.0-alpha.3](https://github.com/empathyco/x/compare/@empathyco/x-adapter-platform@1.1.0-alpha.2...@empathyco/x-adapter-platform@1.1.0-alpha.3) (2024-05-21) diff --git a/packages/x-adapter-platform/package.json b/packages/x-adapter-platform/package.json index dd001a423a..fc9a56d430 100644 --- a/packages/x-adapter-platform/package.json +++ b/packages/x-adapter-platform/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-adapter-platform", - "version": "1.1.0-alpha.3", + "version": "1.1.0-alpha.8", "description": "A search client for the Empathy Platform API", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", @@ -42,7 +42,7 @@ }, "dependencies": { "@empathyco/x-adapter": "^8.1.0-alpha.0", - "@empathyco/x-types": "^10.1.0-alpha.3", + "@empathyco/x-types": "^10.1.0-alpha.5", "@empathyco/x-utils": "^1.0.3-alpha.1", "tslib": "~2.6.0" }, diff --git a/packages/x-adapter-platform/src/endpoint-adapters/index.ts b/packages/x-adapter-platform/src/endpoint-adapters/index.ts index 10dd4e4907..b2e517250c 100644 --- a/packages/x-adapter-platform/src/endpoint-adapters/index.ts +++ b/packages/x-adapter-platform/src/endpoint-adapters/index.ts @@ -3,6 +3,7 @@ export * from './identifier-results.endpoint-adapter'; export * from './next-queries.endpoint-adapter'; export * from './query-suggestions.endpoint-adapter'; export * from './recommendations.endpoint-adapter'; +export * from './related-prompts.endpoint-adapter'; export * from './related-tags.endpoint-adapter'; export * from './search.endpoint-adapter'; export * from './semantic-queries.endpoint-adapter'; diff --git a/packages/x-adapter-platform/src/endpoint-adapters/related-prompts.endpoint-adapter.ts b/packages/x-adapter-platform/src/endpoint-adapters/related-prompts.endpoint-adapter.ts new file mode 100644 index 0000000000..65baab1d33 --- /dev/null +++ b/packages/x-adapter-platform/src/endpoint-adapters/related-prompts.endpoint-adapter.ts @@ -0,0 +1,27 @@ +import { endpointAdapterFactory, interpolate } from '@empathyco/x-adapter'; +import { RelatedPromptsRequest, RelatedPromptsResponse } from '@empathyco/x-types'; +import { relatedPromptsRequestMapper } from '../mappers/requests/related-prompts-request.mapper'; +import { relatedPromptsResponseMapper } from '../mappers/responses/related-prompts-response.mapper'; +import { getBeaconServiceUrl } from './utils'; + +/** + * Default adapter for the related prompt endpoint. + * This endpoint does not support pagination in the request. + * + * @public + */ +export const relatedPromptsEndpointAdapter = endpointAdapterFactory< + RelatedPromptsRequest, + RelatedPromptsResponse +>({ + endpoint: from => + interpolate(`${getBeaconServiceUrl(from)}/relatedprompts/{extraParams.instance}`, from), + requestMapper: relatedPromptsRequestMapper, + responseMapper: relatedPromptsResponseMapper, + defaultRequestOptions: { + id: 'related-prompts', + parameters: { + internal: true + } + } +}); diff --git a/packages/x-adapter-platform/src/mappers/requests/index.ts b/packages/x-adapter-platform/src/mappers/requests/index.ts index 986aa3c41d..b31333be37 100644 --- a/packages/x-adapter-platform/src/mappers/requests/index.ts +++ b/packages/x-adapter-platform/src/mappers/requests/index.ts @@ -3,6 +3,7 @@ export * from './next-queries-request.mapper'; export * from './popular-searches-request.mapper'; export * from './query-suggestions-request.mapper'; export * from './recommendations-request.mapper'; +export * from './related-prompts-request.mapper'; export * from './related-tags-request.mapper'; export * from './search-request.mapper'; export * from './semantic-queries-request.mapper'; diff --git a/packages/x-adapter-platform/src/mappers/requests/related-prompts-request.mapper.ts b/packages/x-adapter-platform/src/mappers/requests/related-prompts-request.mapper.ts new file mode 100644 index 0000000000..0931253491 --- /dev/null +++ b/packages/x-adapter-platform/src/mappers/requests/related-prompts-request.mapper.ts @@ -0,0 +1,12 @@ +import { schemaMapperFactory } from '@empathyco/x-adapter'; +import { RelatedPromptsRequest } from '@empathyco/x-types'; +import { PlatformRelatedPromptsRequest } from '../../types/requests/related-prompts-request.model'; +import { relatedPromptsRequestSchema } from '../../schemas/requests/related-prompts-request.schema'; + +/** + * Default implementation for the RelatedPromptsRequestMapper. + */ +export const relatedPromptsRequestMapper = schemaMapperFactory< + RelatedPromptsRequest, + PlatformRelatedPromptsRequest +>(relatedPromptsRequestSchema); diff --git a/packages/x-adapter-platform/src/mappers/responses/index.ts b/packages/x-adapter-platform/src/mappers/responses/index.ts index 52e3469712..8f51eaf871 100644 --- a/packages/x-adapter-platform/src/mappers/responses/index.ts +++ b/packages/x-adapter-platform/src/mappers/responses/index.ts @@ -3,6 +3,7 @@ export * from './next-queries-response.mapper'; export * from './query-suggestions-response.mapper'; export * from './popular-searches-response.mapper'; export * from './recommendations-response.mapper'; +export * from './related-prompts-response.mapper'; export * from './related-tags-response.mapper'; export * from './search-response.mapper'; export * from './semantic-queries-response.mapper'; diff --git a/packages/x-adapter-platform/src/mappers/responses/related-prompts-response.mapper.ts b/packages/x-adapter-platform/src/mappers/responses/related-prompts-response.mapper.ts new file mode 100644 index 0000000000..869520f73c --- /dev/null +++ b/packages/x-adapter-platform/src/mappers/responses/related-prompts-response.mapper.ts @@ -0,0 +1,14 @@ +import { schemaMapperFactory } from '@empathyco/x-adapter'; +import { RelatedPromptsResponse } from '@empathyco/x-types'; +// eslint-disable-next-line max-len +import { PlatformRelatedPromptsResponse } from '../../types/responses/related-prompts-response.model'; +// eslint-disable-next-line max-len +import { relatedPromptsResponseSchema } from '../../schemas/responses/related-prompts-response.schema'; + +/** + * Default implementation for the RelatedPromptsResponseMapper. + */ +export const relatedPromptsResponseMapper = schemaMapperFactory< + PlatformRelatedPromptsResponse, + RelatedPromptsResponse +>(relatedPromptsResponseSchema); diff --git a/packages/x-adapter-platform/src/platform.adapter.ts b/packages/x-adapter-platform/src/platform.adapter.ts index a144cb63ec..b7035cfa29 100644 --- a/packages/x-adapter-platform/src/platform.adapter.ts +++ b/packages/x-adapter-platform/src/platform.adapter.ts @@ -10,6 +10,7 @@ import { taggingEndpointAdapter } from './endpoint-adapters/tagging.endpoint-ada import { querySuggestionsEndpointAdapter } from './endpoint-adapters/query-suggestions.endpoint-adapter'; import { semanticQueriesEndpointAdapter } from './endpoint-adapters/semantic-queries.endpoint-adapter'; import { experienceControlsEndpointAdapter } from './endpoint-adapters/experience-controls.endpoint-adapter'; +import { relatedPromptsEndpointAdapter } from './endpoint-adapters/related-prompts.endpoint-adapter'; /* eslint-enable max-len */ /** @@ -23,6 +24,7 @@ export const platformAdapter: PlatformAdapter = { recommendations: recommendationsEndpointAdapter, nextQueries: nextQueriesEndpointAdapter, querySuggestions: querySuggestionsEndpointAdapter, + relatedPrompts: relatedPromptsEndpointAdapter, relatedTags: relatedTagsEndpointAdapter, identifierResults: identifierResultsEndpointAdapter, tagging: taggingEndpointAdapter, diff --git a/packages/x-adapter-platform/src/schemas/models/index.ts b/packages/x-adapter-platform/src/schemas/models/index.ts index 8336035f28..22f4015ff2 100644 --- a/packages/x-adapter-platform/src/schemas/models/index.ts +++ b/packages/x-adapter-platform/src/schemas/models/index.ts @@ -2,6 +2,7 @@ export * from './banner.schema'; export * from './facet.schema'; export * from './filters'; export * from './next-query.schema'; +export * from './related-prompt.schema'; export * from './related-tag.schema'; export * from './partial-results.schema'; export * from './promoted.schema'; diff --git a/packages/x-adapter-platform/src/schemas/models/related-prompt.schema.ts b/packages/x-adapter-platform/src/schemas/models/related-prompt.schema.ts new file mode 100644 index 0000000000..1589a2076d --- /dev/null +++ b/packages/x-adapter-platform/src/schemas/models/related-prompt.schema.ts @@ -0,0 +1,13 @@ +import { createMutableSchema } from '@empathyco/x-adapter'; +import { RelatedPrompt } from '@empathyco/x-types'; +import { PlatformRelatedPrompt } from '../../types/models/related-prompt.model'; + +/** + * Default implementation for the RelatedPromptSchema. + */ +export const relatedPromptSchema = createMutableSchema({ + modelName: () => 'RelatedPrompt', + nextQueries: 'nextQueries', + suggestionText: 'suggestionText', + type: 'type' +}); diff --git a/packages/x-adapter-platform/src/schemas/requests/index.ts b/packages/x-adapter-platform/src/schemas/requests/index.ts index 4d92a409f0..2b8c2f5baa 100644 --- a/packages/x-adapter-platform/src/schemas/requests/index.ts +++ b/packages/x-adapter-platform/src/schemas/requests/index.ts @@ -2,6 +2,7 @@ export * from './identifier-results-request.schema'; export * from './next-queries-request.schema'; export * from './popular-searches-request.schema'; export * from './query-suggestions-request.schema'; +export * from './related-prompts-request.schema'; export * from './related-tags-request.schema'; export * from './recommendations-request.schema'; export * from './search-request.schema'; diff --git a/packages/x-adapter-platform/src/schemas/requests/related-prompts-request.schema.ts b/packages/x-adapter-platform/src/schemas/requests/related-prompts-request.schema.ts new file mode 100644 index 0000000000..abc14613c8 --- /dev/null +++ b/packages/x-adapter-platform/src/schemas/requests/related-prompts-request.schema.ts @@ -0,0 +1,14 @@ +import { createMutableSchema } from '@empathyco/x-adapter'; +import { RelatedPromptsRequest } from '@empathyco/x-types'; +import { PlatformRelatedPromptsRequest } from '../../types/requests/related-prompts-request.model'; + +/** + * Default implementation for the RelatedPromptsRequestSchema. + */ +export const relatedPromptsRequestSchema = createMutableSchema< + RelatedPromptsRequest, + PlatformRelatedPromptsRequest +>({ + query: 'query', + extraParams: 'extraParams' +}); diff --git a/packages/x-adapter-platform/src/schemas/responses/index.ts b/packages/x-adapter-platform/src/schemas/responses/index.ts index 49ff504a2b..52ad69461f 100644 --- a/packages/x-adapter-platform/src/schemas/responses/index.ts +++ b/packages/x-adapter-platform/src/schemas/responses/index.ts @@ -2,6 +2,7 @@ export * from './identifier-results-response.schema'; export * from './next-queries-response.schema'; export * from './popular-searches-response.schema'; export * from './query-suggestions-response.schema'; +export * from './related-prompts-response.schema'; export * from './related-tags-response.schema'; export * from './recommendations-response.schema'; export * from './semantic-queries-response.schema'; diff --git a/packages/x-adapter-platform/src/schemas/responses/related-prompts-response.schema.ts b/packages/x-adapter-platform/src/schemas/responses/related-prompts-response.schema.ts new file mode 100644 index 0000000000..46480429c6 --- /dev/null +++ b/packages/x-adapter-platform/src/schemas/responses/related-prompts-response.schema.ts @@ -0,0 +1,18 @@ +import { createMutableSchema } from '@empathyco/x-adapter'; +import { RelatedPromptsResponse } from '@empathyco/x-types'; +// eslint-disable-next-line max-len +import { PlatformRelatedPromptsResponse } from '../../types/responses/related-prompts-response.model'; +import { relatedPromptSchema } from '../models/related-prompt.schema'; + +/** + * Default implementation for the RelatedPromptsResponseSchema. + */ +export const relatedPromptsResponseSchema = createMutableSchema< + PlatformRelatedPromptsResponse, + RelatedPromptsResponse +>({ + relatedPrompts: { + $path: 'data.relatedprompts', + $subSchema: relatedPromptSchema + } +}); diff --git a/packages/x-adapter-platform/src/types/models/index.ts b/packages/x-adapter-platform/src/types/models/index.ts index 0a610d2bd3..b75b8efacc 100644 --- a/packages/x-adapter-platform/src/types/models/index.ts +++ b/packages/x-adapter-platform/src/types/models/index.ts @@ -4,6 +4,7 @@ export * from './next-query.model'; export * from './partials.model'; export * from './promoted.model'; export * from './redirection.model'; +export * from './related-prompt.model'; export * from './related-tag.model'; export * from './result.model'; export * from './semantic-query.model'; diff --git a/packages/x-adapter-platform/src/types/models/related-prompt.model.ts b/packages/x-adapter-platform/src/types/models/related-prompt.model.ts new file mode 100644 index 0000000000..c219d1324b --- /dev/null +++ b/packages/x-adapter-platform/src/types/models/related-prompt.model.ts @@ -0,0 +1,8 @@ +/** + * Related prompt model for the `platform` API. + */ +export interface PlatformRelatedPrompt { + nextQueries: string[]; + suggestionText: string; + type: 'SYNTHETIC' | 'CURATED'; +} diff --git a/packages/x-adapter-platform/src/types/platform-adapter.types.ts b/packages/x-adapter-platform/src/types/platform-adapter.types.ts index 03a7f51f37..d2c8ccfde6 100644 --- a/packages/x-adapter-platform/src/types/platform-adapter.types.ts +++ b/packages/x-adapter-platform/src/types/platform-adapter.types.ts @@ -18,7 +18,9 @@ import { TaggingRequest, ExperienceControlsRequest, ExperienceControlsResponse, - XComponentsAdapter + XComponentsAdapter, + RelatedPromptsRequest, + RelatedPromptsResponse } from '@empathyco/x-types'; import { ExtendableEndpointAdapter } from '@empathyco/x-adapter'; @@ -33,6 +35,7 @@ export interface PlatformAdapter extends XComponentsAdapter { nextQueries: ExtendableEndpointAdapter; recommendations: ExtendableEndpointAdapter; querySuggestions: ExtendableEndpointAdapter; + relatedPrompts: ExtendableEndpointAdapter; relatedTags: ExtendableEndpointAdapter; identifierResults: ExtendableEndpointAdapter; semanticQueries: ExtendableEndpointAdapter; diff --git a/packages/x-adapter-platform/src/types/requests/index.ts b/packages/x-adapter-platform/src/types/requests/index.ts index d527c13190..1728fde9ba 100644 --- a/packages/x-adapter-platform/src/types/requests/index.ts +++ b/packages/x-adapter-platform/src/types/requests/index.ts @@ -3,6 +3,7 @@ export * from './next-queries-request.model'; export * from './popular-searches-request.model'; export * from './query-suggestions-request.model'; export * from './recommendations-request.model'; +export * from './related-prompts-request.model'; export * from './related-tags-request.model'; export * from './search-request.model'; export * from './semantic-queries-request.model'; diff --git a/packages/x-adapter-platform/src/types/requests/related-prompts-request.model.ts b/packages/x-adapter-platform/src/types/requests/related-prompts-request.model.ts new file mode 100644 index 0000000000..ee2d94f634 --- /dev/null +++ b/packages/x-adapter-platform/src/types/requests/related-prompts-request.model.ts @@ -0,0 +1,10 @@ +import { PlatformExtraParamsRequest, PlatformQueryableRequest } from './request.types'; + +/** + * Request for the `related prompts` endpoint with `extra params`. + * + * @public + */ +export interface PlatformRelatedPromptsRequest + extends PlatformQueryableRequest, + PlatformExtraParamsRequest {} diff --git a/packages/x-adapter-platform/src/types/responses/index.ts b/packages/x-adapter-platform/src/types/responses/index.ts index f145e8418f..a3f2e1f343 100644 --- a/packages/x-adapter-platform/src/types/responses/index.ts +++ b/packages/x-adapter-platform/src/types/responses/index.ts @@ -2,6 +2,7 @@ export * from './identifier-results-response.model'; export * from './query-suggestions-response.model'; export * from './next-queries-response.model'; export * from './popular-searches-response.model'; +export * from './related-prompts-response.model'; export * from './related-tags-response.model'; export * from './recommendations-response.model'; export * from './search-response.model'; diff --git a/packages/x-adapter-platform/src/types/responses/related-prompts-response.model.ts b/packages/x-adapter-platform/src/types/responses/related-prompts-response.model.ts new file mode 100644 index 0000000000..1eb0be25f2 --- /dev/null +++ b/packages/x-adapter-platform/src/types/responses/related-prompts-response.model.ts @@ -0,0 +1,11 @@ +import { PlatformRelatedPrompt } from '../models/related-prompt.model'; + +/** + * Response for the `related prompts` endpoint. + */ +export interface PlatformRelatedPromptsResponse { + data: { + relatedprompts: PlatformRelatedPrompt[]; + }; + status: number; +} diff --git a/packages/x-components/CHANGELOG.md b/packages/x-components/CHANGELOG.md index f07ef74d9c..ef6876f829 100644 --- a/packages/x-components/CHANGELOG.md +++ b/packages/x-components/CHANGELOG.md @@ -3,6 +3,56 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [6.0.0-alpha.10](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.9...@empathyco/x-components@6.0.0-alpha.10) (2024-10-31) + +**Note:** Version bump only for package @empathyco/x-components + + + + + +## [6.0.0-alpha.9](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.8...@empathyco/x-components@6.0.0-alpha.9) (2024-10-31) + +**Note:** Version bump only for package @empathyco/x-components + + + + + +## [6.0.0-alpha.8](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.7...@empathyco/x-components@6.0.0-alpha.8) (2024-10-31) + +**Note:** Version bump only for package @empathyco/x-components + + + + + +## [6.0.0-alpha.7](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.6...@empathyco/x-components@6.0.0-alpha.7) (2024-10-28) + +**Note:** Version bump only for package @empathyco/x-components + + + + + +## [6.0.0-alpha.6](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.5...@empathyco/x-components@6.0.0-alpha.6) (2024-10-28) + + +### Features + +* add types for related prompts (#1640) ([9822c28](https://github.com/empathyco/x/commit/9822c285410f6d308a8a0e43f47e951b052592a2)) + + + +## [6.0.0-alpha.5](https://github.com/empathyco/x/compare/@empathyco/x-components@6.0.0-alpha.4...@empathyco/x-components@6.0.0-alpha.5) (2024-10-28) + + +### Build System + +* use vue latest version as peer dependency (#1651) ([1618993](https://github.com/empathyco/x/commit/161899326d325db46f39eead4ca7b57984b58b39)) + + + ## [6.0.0-alpha.4](https://github.com/empathyco/x/compare/@empathyco/x-components@5.0.0-alpha.83...@empathyco/x-components@6.0.0-alpha.4) (2024-10-24) diff --git a/packages/x-components/package.json b/packages/x-components/package.json index a899612e1b..24699219e9 100644 --- a/packages/x-components/package.json +++ b/packages/x-components/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-components", - "version": "6.0.0-alpha.4", + "version": "6.0.0-alpha.10", "description": "Empathy X Components", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", @@ -70,12 +70,12 @@ }, "dependencies": { "@empathyco/x-adapter": "^8.1.0-alpha.0", - "@empathyco/x-adapter-platform": "^1.1.0-alpha.3", + "@empathyco/x-adapter-platform": "^1.1.0-alpha.8", "@empathyco/x-bus": "^1.0.3-alpha.1", "@empathyco/x-deep-merge": "^2.0.3-alpha.1", "@empathyco/x-logger": "^1.2.0-alpha.11", "@empathyco/x-storage-service": "^2.0.3-alpha.0", - "@empathyco/x-types": "^10.1.0-alpha.3", + "@empathyco/x-types": "^10.1.0-alpha.5", "@empathyco/x-utils": "^1.0.3-alpha.1", "@vue/devtools-api": "~6.5.0", "@vueuse/core": "~10.7.1", @@ -86,7 +86,7 @@ "vue-global-events": "~3.0.1" }, "peerDependencies": { - "vue": "~3.4.31", + "vue": "^3.5.12", "vuex": "4.0.2" }, "devDependencies": { diff --git a/packages/x-components/src/__tests__/adapter.dummy.ts b/packages/x-components/src/__tests__/adapter.dummy.ts index 2238dcb0d7..de130321fc 100644 --- a/packages/x-components/src/__tests__/adapter.dummy.ts +++ b/packages/x-components/src/__tests__/adapter.dummy.ts @@ -6,6 +6,7 @@ export const XComponentsAdapterDummy: XComponentsAdapter = { popularSearches: jest.fn(), querySuggestions: jest.fn(), recommendations: jest.fn(), + relatedPrompts: jest.fn(), relatedTags: jest.fn(), search: jest.fn(), semanticQueries: jest.fn(), diff --git a/packages/x-components/src/__tests__/utils.ts b/packages/x-components/src/__tests__/utils.ts index 4eceba7d5c..a48590b35a 100644 --- a/packages/x-components/src/__tests__/utils.ts +++ b/packages/x-components/src/__tests__/utils.ts @@ -12,7 +12,8 @@ import { RelatedTagsResponse, SearchResponse, SemanticQueriesResponse, - ExperienceControlsResponse + ExperienceControlsResponse, + RelatedPromptsResponse } from '@empathyco/x-types'; import { XPluginOptions } from '../plugins'; import { XPlugin } from '../plugins/x-plugin'; @@ -41,6 +42,7 @@ interface MockedAdapterFeatures { popularSearches: PopularSearchesResponse; querySuggestions: QuerySuggestionsResponse; recommendations: RecommendationsResponse; + relatedPrompts: RelatedPromptsResponse; relatedTags: RelatedTagsResponse; search: SearchResponse; semanticQueries: SemanticQueriesResponse; @@ -156,6 +158,7 @@ export function getMockedAdapter( popularSearches: getMockedAdapterFunction(responseFeatures?.popularSearches!), querySuggestions: getMockedAdapterFunction(responseFeatures?.querySuggestions!), recommendations: getMockedAdapterFunction(responseFeatures?.recommendations!), + relatedPrompts: getMockedAdapterFunction(responseFeatures?.relatedPrompts!), relatedTags: getMockedAdapterFunction(responseFeatures?.relatedTags!), search: getMockedAdapterFunction(responseFeatures?.search!), semanticQueries: getMockedAdapterFunction(responseFeatures?.semanticQueries!), diff --git a/packages/x-components/src/adapter/e2e-adapter.ts b/packages/x-components/src/adapter/e2e-adapter.ts index 7c7108bc06..092d8a049b 100644 --- a/packages/x-components/src/adapter/e2e-adapter.ts +++ b/packages/x-components/src/adapter/e2e-adapter.ts @@ -42,6 +42,7 @@ export const e2eAdapter: XComponentsAdapter = { popularSearches: mockEndpointAdapter('popular-searches'), querySuggestions: mockEndpointAdapter('query-suggestions'), recommendations: mockEndpointAdapter('recommendations'), + relatedPrompts: mockEndpointAdapter('related-prompts'), relatedTags: mockEndpointAdapter('related-tags'), search: mockEndpointAdapter('search'), semanticQueries: mockEndpointAdapter('semantic-queries'), diff --git a/packages/x-types/CHANGELOG.md b/packages/x-types/CHANGELOG.md index 15f01a0289..7d63e5faae 100644 --- a/packages/x-types/CHANGELOG.md +++ b/packages/x-types/CHANGELOG.md @@ -3,6 +3,24 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [10.1.0-alpha.5](https://github.com/empathyco/x/compare/@empathyco/x-types@10.1.0-alpha.4...@empathyco/x-types@10.1.0-alpha.5) (2024-10-31) + + +### Features + +* add stats to search response (#1648) ([0fdf5b4](https://github.com/empathyco/x/commit/0fdf5b4030a90da6ec7b4d30d667c08afeb5a80d)) + + + +## [10.1.0-alpha.4](https://github.com/empathyco/x/compare/@empathyco/x-types@10.1.0-alpha.3...@empathyco/x-types@10.1.0-alpha.4) (2024-10-28) + + +### Features + +* add types for related prompts (#1640) ([9822c28](https://github.com/empathyco/x/commit/9822c285410f6d308a8a0e43f47e951b052592a2)) + + + ## [10.1.0-alpha.3](https://github.com/empathyco/x/compare/@empathyco/x-types@10.1.0-alpha.2...@empathyco/x-types@10.1.0-alpha.3) (2024-05-03) **Note:** Version bump only for package @empathyco/x-types diff --git a/packages/x-types/package.json b/packages/x-types/package.json index 06afd9ef27..7dedb0cd10 100644 --- a/packages/x-types/package.json +++ b/packages/x-types/package.json @@ -1,6 +1,6 @@ { "name": "@empathyco/x-types", - "version": "10.1.0-alpha.3", + "version": "10.1.0-alpha.5", "description": "Empathy search types", "author": "Empathy Systems Corporation S.L.", "license": "Apache-2.0", diff --git a/packages/x-types/src/query-signals/index.ts b/packages/x-types/src/query-signals/index.ts index 84e0740073..b75c532072 100644 --- a/packages/x-types/src/query-signals/index.ts +++ b/packages/x-types/src/query-signals/index.ts @@ -1,4 +1,5 @@ export * from './next-queries.model'; export * from './next-query.model'; +export * from './related-prompt.model'; export * from './related-tag.model'; export * from './semantic-query.model'; diff --git a/packages/x-types/src/query-signals/related-prompt.model.ts b/packages/x-types/src/query-signals/related-prompt.model.ts new file mode 100644 index 0000000000..e3601cbda6 --- /dev/null +++ b/packages/x-types/src/query-signals/related-prompt.model.ts @@ -0,0 +1,13 @@ +import { NamedModel } from '../named-model.model'; + +/** + * Represents a related prompt. + */ +export interface RelatedPrompt extends NamedModel<'RelatedPrompt'> { + /** The next queries related to the prompt. */ + nextQueries: string[]; + /** The prompt. */ + suggestionText: string; + /** The type of the prompt. */ + type: string; +} diff --git a/packages/x-types/src/request/index.ts b/packages/x-types/src/request/index.ts index cd0fd87b3f..f5d02bc968 100644 --- a/packages/x-types/src/request/index.ts +++ b/packages/x-types/src/request/index.ts @@ -3,6 +3,7 @@ export * from './next-queries-request.model'; export * from './popular-searches-request.model'; export * from './query-suggestions-request.model'; export * from './recommendations-request.model'; +export * from './related-prompts-request.model'; export * from './related-tags-request.model'; export * from './request.model'; export * from './search-request.model'; diff --git a/packages/x-types/src/request/related-prompts-request.model.ts b/packages/x-types/src/request/related-prompts-request.model.ts new file mode 100644 index 0000000000..fe005b3c6c --- /dev/null +++ b/packages/x-types/src/request/related-prompts-request.model.ts @@ -0,0 +1,6 @@ +import { ExtraParamsRequest, QueryableRequest } from './request.model'; + +/** + * Request for Related Prompts endpoint. + */ +export interface RelatedPromptsRequest extends QueryableRequest, ExtraParamsRequest {} diff --git a/packages/x-types/src/response/index.ts b/packages/x-types/src/response/index.ts index 14fc912f28..3852605e9f 100644 --- a/packages/x-types/src/response/index.ts +++ b/packages/x-types/src/response/index.ts @@ -3,6 +3,7 @@ export * from './next-queries-response.model'; export * from './popular-searches-response.model'; export * from './query-suggestions-response.model'; export * from './recommendations-response.model'; +export * from './related-prompts-response.model'; export * from './related-tags-response.model'; export * from './response.model'; export * from './search-response.model'; diff --git a/packages/x-types/src/response/related-prompts-response.model.ts b/packages/x-types/src/response/related-prompts-response.model.ts new file mode 100644 index 0000000000..c07147e100 --- /dev/null +++ b/packages/x-types/src/response/related-prompts-response.model.ts @@ -0,0 +1,8 @@ +import { RelatedPrompt } from '../query-signals/related-prompt.model'; + +/** + * Response for the related prompts endpoint. + */ +export interface RelatedPromptsResponse { + relatedPrompts: RelatedPrompt[]; +} diff --git a/packages/x-types/src/schemas/related-prompt.schema.ts b/packages/x-types/src/schemas/related-prompt.schema.ts new file mode 100644 index 0000000000..b2c5400e2b --- /dev/null +++ b/packages/x-types/src/schemas/related-prompt.schema.ts @@ -0,0 +1,11 @@ +import { RelatedPrompt } from '../query-signals'; + +/** + * Jest schema for validating Related Prompt entities. + */ +export const RelatedPromptSchema: RelatedPrompt = { + modelName: expect.any(String), + nextQueries: expect.any(Array), + suggestionText: expect.any(String), + type: expect.any(String) +}; diff --git a/packages/x-types/src/stats.model.ts b/packages/x-types/src/stats.model.ts index 6fc5733c38..ec67ed2fb2 100644 --- a/packages/x-types/src/stats.model.ts +++ b/packages/x-types/src/stats.model.ts @@ -1,5 +1,7 @@ /** - * The stats model. + * Statistics for the current search results. + * + * Price - interval of the prices of the results. * * @public */ diff --git a/packages/x-types/src/x-components-adapter.model.ts b/packages/x-types/src/x-components-adapter.model.ts index f25072e53f..20978ed03f 100644 --- a/packages/x-types/src/x-components-adapter.model.ts +++ b/packages/x-types/src/x-components-adapter.model.ts @@ -6,6 +6,7 @@ import { PopularSearchesRequest, QuerySuggestionsRequest, RecommendationsRequest, + RelatedPromptsRequest, RelatedTagsRequest, SearchRequest, SemanticQueriesRequest, @@ -20,7 +21,8 @@ import { RelatedTagsResponse, SearchResponse, SemanticQueriesResponse, - ExperienceControlsResponse + ExperienceControlsResponse, + RelatedPromptsResponse } from './response'; export interface XComponentsAdapter { @@ -29,6 +31,7 @@ export interface XComponentsAdapter { nextQueries: EndpointAdapter; recommendations: EndpointAdapter; querySuggestions: EndpointAdapter; + relatedPrompts: EndpointAdapter; relatedTags: EndpointAdapter; identifierResults: EndpointAdapter; tagging: EndpointAdapter; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62ff95950f..b0351d48ae 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -41,13 +41,13 @@ importers: packages/_vue3-migration-test: dependencies: '@empathyco/x-adapter-platform': - specifier: ^1.1.0-alpha.3 + specifier: ^1.1.0-alpha.8 version: link:../x-adapter-platform '@empathyco/x-bus': specifier: ^1.0.3-alpha.1 version: link:../x-bus '@empathyco/x-types': - specifier: ^10.1.0-alpha.3 + specifier: ^10.1.0-alpha.5 version: link:../x-types '@empathyco/x-utils': specifier: ^1.0.3-alpha.1 @@ -306,7 +306,7 @@ importers: specifier: ^8.1.0-alpha.0 version: link:../x-adapter '@empathyco/x-types': - specifier: ^10.1.0-alpha.3 + specifier: ^10.1.0-alpha.5 version: link:../x-types '@empathyco/x-utils': specifier: ^1.0.3-alpha.1 @@ -432,7 +432,7 @@ importers: specifier: ^8.1.0-alpha.0 version: link:../x-adapter '@empathyco/x-adapter-platform': - specifier: ^1.1.0-alpha.3 + specifier: ^1.1.0-alpha.8 version: link:../x-adapter-platform '@empathyco/x-bus': specifier: ^1.0.3-alpha.1 @@ -447,7 +447,7 @@ importers: specifier: ^2.0.3-alpha.0 version: link:../storage-service '@empathyco/x-types': - specifier: ^10.1.0-alpha.3 + specifier: ^10.1.0-alpha.5 version: link:../x-types '@empathyco/x-utils': specifier: ^1.0.3-alpha.1