Skip to content

Commit

Permalink
Merge branch 'main' into feat/new-base-slider
Browse files Browse the repository at this point in the history
  • Loading branch information
victorcg88 committed Oct 31, 2024
2 parents 458c1d9 + 162dc54 commit 91197c4
Show file tree
Hide file tree
Showing 41 changed files with 363 additions and 19 deletions.
40 changes: 40 additions & 0 deletions packages/_vue3-migration-test/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]@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/[email protected]@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/[email protected]@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/[email protected]@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/[email protected]@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/[email protected]@1.0.0-alpha.52) (2024-10-24)


Expand Down
6 changes: 3 additions & 3 deletions packages/_vue3-migration-test/package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "vue3-migration-test",
"private": "true",
"version": "1.0.0-alpha.52",
"version": "1.0.0-alpha.57",
"scripts": {
"dev": "vite",
"preview": "vite preview",
"lint": "eslint . --ext .ts,.vue",
"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",
Expand Down
44 changes: 44 additions & 0 deletions packages/x-adapter-platform/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (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/[email protected]...@empathyco/[email protected]) (2024-05-21)


Expand Down
4 changes: 2 additions & 2 deletions packages/x-adapter-platform/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/endpoint-adapters/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
});
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/mappers/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/mappers/responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
2 changes: 2 additions & 0 deletions packages/x-adapter-platform/src/platform.adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

/**
Expand All @@ -23,6 +24,7 @@ export const platformAdapter: PlatformAdapter = {
recommendations: recommendationsEndpointAdapter,
nextQueries: nextQueriesEndpointAdapter,
querySuggestions: querySuggestionsEndpointAdapter,
relatedPrompts: relatedPromptsEndpointAdapter,
relatedTags: relatedTagsEndpointAdapter,
identifierResults: identifierResultsEndpointAdapter,
tagging: taggingEndpointAdapter,
Expand Down
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/schemas/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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<PlatformRelatedPrompt, RelatedPrompt>({
modelName: () => 'RelatedPrompt',
nextQueries: 'nextQueries',
suggestionText: 'suggestionText',
type: 'type'
});
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/schemas/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
});
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/schemas/responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
});
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/types/models/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Related prompt model for the `platform` API.
*/
export interface PlatformRelatedPrompt {
nextQueries: string[];
suggestionText: string;
type: 'SYNTHETIC' | 'CURATED';
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import {
TaggingRequest,
ExperienceControlsRequest,
ExperienceControlsResponse,
XComponentsAdapter
XComponentsAdapter,
RelatedPromptsRequest,
RelatedPromptsResponse
} from '@empathyco/x-types';
import { ExtendableEndpointAdapter } from '@empathyco/x-adapter';

Expand All @@ -33,6 +35,7 @@ export interface PlatformAdapter extends XComponentsAdapter {
nextQueries: ExtendableEndpointAdapter<NextQueriesRequest, NextQueriesResponse>;
recommendations: ExtendableEndpointAdapter<RecommendationsRequest, RecommendationsResponse>;
querySuggestions: ExtendableEndpointAdapter<QuerySuggestionsRequest, QuerySuggestionsResponse>;
relatedPrompts: ExtendableEndpointAdapter<RelatedPromptsRequest, RelatedPromptsResponse>;
relatedTags: ExtendableEndpointAdapter<RelatedTagsRequest, RelatedTagsResponse>;
identifierResults: ExtendableEndpointAdapter<IdentifierResultsRequest, IdentifierResultsResponse>;
semanticQueries: ExtendableEndpointAdapter<SemanticQueriesRequest, SemanticQueriesResponse>;
Expand Down
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/types/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {}
1 change: 1 addition & 0 deletions packages/x-adapter-platform/src/types/responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Loading

0 comments on commit 91197c4

Please sign in to comment.