@empathyco/x-adapter-platform 1.1.4 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js +1 -1
- package/dist/cjs/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js.map +1 -1
- package/dist/cjs/endpoint-adapters/ai/suggestions.endpoint-adapter.js +1 -1
- package/dist/cjs/endpoint-adapters/ai/suggestions.endpoint-adapter.js.map +1 -1
- package/dist/cjs/endpoint-adapters/utils.js +3 -3
- package/dist/cjs/endpoint-adapters/utils.js.map +1 -1
- package/dist/cjs/schemas/requests/ai/suggestions-search-request.schema.js +1 -0
- package/dist/cjs/schemas/requests/ai/suggestions-search-request.schema.js.map +1 -1
- package/dist/cjs/types/requests/ai/suggestions-search-request.model.js.map +1 -1
- package/dist/esm/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js +1 -1
- package/dist/esm/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js.map +1 -1
- package/dist/esm/endpoint-adapters/ai/suggestions.endpoint-adapter.js +1 -1
- package/dist/esm/endpoint-adapters/ai/suggestions.endpoint-adapter.js.map +1 -1
- package/dist/esm/endpoint-adapters/utils.js +3 -3
- package/dist/esm/endpoint-adapters/utils.js.map +1 -1
- package/dist/esm/schemas/requests/ai/suggestions-search-request.schema.js +1 -0
- package/dist/esm/schemas/requests/ai/suggestions-search-request.schema.js.map +1 -1
- package/dist/esm/types/requests/ai/suggestions-search-request.model.js.map +1 -1
- package/dist/types/types/requests/ai/suggestions-search-request.model.d.ts +4 -0
- package/package.json +3 -3
- package/report/x-adapter-platform.api.json +36 -0
- package/report/x-adapter-platform.api.md +8 -2
|
@@ -10,7 +10,7 @@ const utils_1 = require("../utils");
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
exports.aiSuggestionsSearchEndpointAdapter = (0, x_adapter_1.endpointAdapterFactory)({
|
|
13
|
-
endpoint: from => (0, x_adapter_1.interpolate)(`${(0, utils_1.getAiSuggestionsServiceUrl)(from)}/{extraParams.instance}/
|
|
13
|
+
endpoint: from => (0, x_adapter_1.interpolate)(`${(0, utils_1.getAiSuggestionsServiceUrl)(from)}/{extraParams.instance}/search`, from),
|
|
14
14
|
requestMapper: mappers_1.aiSuggestionsSearchRequestMapper,
|
|
15
15
|
responseMapper: mappers_1.aiSuggestionsSearchResponseMapper,
|
|
16
16
|
defaultRequestOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions-search.endpoint-adapter.ts"],"names":[],"mappings":";;;AACA,oDAA0E;AAC1E,2CAAmG;AACnG,oCAAwE;AAExE;;;;GAIG;AACU,QAAA,kCAAkC,GAAG,IAAA,kCAAsB,EAGtE;IACA,QAAQ,EAAE,IAAI,CAAC,EAAE,CACf,IAAA,uBAAW,
|
|
1
|
+
{"version":3,"file":"suggestions-search.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions-search.endpoint-adapter.ts"],"names":[],"mappings":";;;AACA,oDAA0E;AAC1E,2CAAmG;AACnG,oCAAwE;AAExE;;;;GAIG;AACU,QAAA,kCAAkC,GAAG,IAAA,kCAAsB,EAGtE;IACA,QAAQ,EAAE,IAAI,CAAC,EAAE,CACf,IAAA,uBAAW,EAAC,GAAG,IAAA,kCAA0B,EAAC,IAAI,CAAC,gCAAgC,EAAE,IAAI,CAAC;IACxF,aAAa,EAAE,0CAAgC;IAC/C,cAAc,EAAE,2CAAiC;IACjD,qBAAqB,EAAE;QACrB,EAAE,EAAE,uBAAuB;QAC3B,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE;YACV,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,IAAA,yBAAiB,GAAE;aACvB;SACF;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchRequest, AiSuggestionsSearchResponse } from '@empathyco/x-types'\nimport { endpointAdapterFactory, interpolate } from '@empathyco/x-adapter'\nimport { aiSuggestionsSearchRequestMapper, aiSuggestionsSearchResponseMapper } from '../../mappers'\nimport { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils'\n\n/**\n * Default adapter for the ai suggestions search endpoint.\n *\n * @public\n */\nexport const aiSuggestionsSearchEndpointAdapter = endpointAdapterFactory<\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse\n>({\n endpoint: from =>\n interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/search`, from),\n requestMapper: aiSuggestionsSearchRequestMapper,\n responseMapper: aiSuggestionsSearchResponseMapper,\n defaultRequestOptions: {\n id: 'ai-suggestions-search',\n sendParamsInBody: true,\n properties: {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...getDefaultHeaders(),\n },\n },\n parameters: {\n internal: true,\n },\n },\n})\n"]}
|
|
@@ -10,7 +10,7 @@ const utils_1 = require("../utils");
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
exports.aiSuggestionsEndpointAdapter = (0, x_adapter_1.endpointAdapterFactory)({
|
|
13
|
-
endpoint: from => (0, x_adapter_1.interpolate)(`${(0, utils_1.getAiSuggestionsServiceUrl)(from)}/{extraParams.instance}
|
|
13
|
+
endpoint: from => (0, x_adapter_1.interpolate)(`${(0, utils_1.getAiSuggestionsServiceUrl)(from)}/{extraParams.instance}`, from),
|
|
14
14
|
httpClient: x_adapter_1.fetchRawHttpClient,
|
|
15
15
|
requestMapper: mappers_1.aiSuggestionsRequestMapper,
|
|
16
16
|
defaultRequestOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions.endpoint-adapter.ts"],"names":[],"mappings":";;;AACA,oDAA8F;AAC9F,2CAA0D;AAC1D,oCAAwE;AAExE;;;;GAIG;AACU,QAAA,4BAA4B,GAAG,IAAA,kCAAsB,EAAiC;IACjG,QAAQ,EAAE,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"suggestions.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions.endpoint-adapter.ts"],"names":[],"mappings":";;;AACA,oDAA8F;AAC9F,2CAA0D;AAC1D,oCAAwE;AAExE;;;;GAIG;AACU,QAAA,4BAA4B,GAAG,IAAA,kCAAsB,EAAiC;IACjG,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,IAAA,uBAAW,EAAC,GAAG,IAAA,kCAA0B,EAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC;IACjG,UAAU,EAAE,8BAAkB;IAC9B,aAAa,EAAE,oCAA0B;IACzC,qBAAqB,EAAE;QACrB,EAAE,EAAE,yBAAyB;QAC7B,UAAU,EAAE;YACV,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,MAAM,EAAE,mBAAmB;gBAC3B,cAAc,EAAE,kBAAkB;gBAClC,GAAG,IAAA,yBAAiB,GAAE;aACvB;SACF;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE,IAAI;KACvB;CACF,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsRequest } from '@empathyco/x-types'\nimport { endpointAdapterFactory, fetchRawHttpClient, interpolate } from '@empathyco/x-adapter'\nimport { aiSuggestionsRequestMapper } from '../../mappers'\nimport { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils'\n\n/**\n * Default adapter for the Overview suggestions v1 endpoint.\n *\n * @public\n */\nexport const aiSuggestionsEndpointAdapter = endpointAdapterFactory<AiSuggestionsRequest, Response>({\n endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}`, from),\n httpClient: fetchRawHttpClient,\n requestMapper: aiSuggestionsRequestMapper,\n defaultRequestOptions: {\n id: 'ai-overview-suggestions',\n properties: {\n method: 'POST',\n headers: {\n accept: 'text/event-stream',\n 'Content-Type': 'application/json',\n ...getDefaultHeaders(),\n },\n },\n parameters: {\n internal: true,\n },\n sendParamsInBody: true,\n },\n})\n"]}
|
|
@@ -50,12 +50,12 @@ function getBeaconServiceUrl(from) {
|
|
|
50
50
|
function getAiSuggestionsServiceUrl(from) {
|
|
51
51
|
var _a, _b;
|
|
52
52
|
if (((_a = from.extraParams) === null || _a === void 0 ? void 0 : _a.env) === 'test') {
|
|
53
|
-
return 'https://questions.internal.test.empathy.co/
|
|
53
|
+
return 'https://questions.internal.test.empathy.co/suggestions';
|
|
54
54
|
}
|
|
55
55
|
if (((_b = from.extraParams) === null || _b === void 0 ? void 0 : _b.env) === 'staging') {
|
|
56
|
-
return 'https://questions.staging.empathy.co/v1/
|
|
56
|
+
return 'https://questions.staging.empathy.co/v1/suggestions';
|
|
57
57
|
}
|
|
58
|
-
return 'https://api.{extraParams.env(.)}empathy.co/v1/
|
|
58
|
+
return 'https://api.{extraParams.env(.)}empathy.co/v1/suggestions';
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Gets the Questions service URL for the given request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/utils.ts"],"names":[],"mappings":";;AAWA,kDAIC;AAWD,kDAIC;AAWD,gEAQC;AAWD,wDAQC;AAWD,gDAQC;AAWD,wDAIC;AAWD,kDAIC;AAUD,8CAWC;AAxID;;;;;;;;GAQG;AACH,SAAgB,mBAAmB,CAAC,IAAwB;;IAC1D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,yCAAyC;QAC3C,CAAC,CAAC,sDAAsD,CAAA;AAC5D,CAAC;AAED;;;;;;;;GAQG;AAC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C,UAAU,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAA;IACvC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,UAAU,CAAC,GAAG,aAAa,CAAA;IACrC,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import type { ExtraParamsRequest } from '@empathyco/x-types'\n\n/**\n * Gets the Search service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getSearchServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://search.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co/search/v1'\n}\n\n/**\n * Gets the Beacon service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getBeaconServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://beacon-api.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co'\n}\n\n/**\n * Gets the AI suggestions service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getAiSuggestionsServiceUrl(from: ExtraParamsRequest): string {\n if (from.extraParams?.env === 'test') {\n return 'https://questions.internal.test.empathy.co/suggestions'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/suggestions'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/v1/suggestions'\n}\n\n/**\n * Gets the Questions service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getQuestionsServiceUrl(from: ExtraParamsRequest): string {\n if (from.extraParams?.env === 'test') {\n return 'https://questions.internal.test.empathy.co'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/questions'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/questions'\n}\n\n/**\n * Gets the Tasks service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getTasksServiceUrl(from: ExtraParamsRequest): string {\n if (from.extraParams?.env === 'test') {\n return 'https://questions.internal.test.empathy.co'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/questions'\n}\n\n/**\n * Gets the Semantics service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getSemanticsServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://semantics-api.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co/semantics-api'\n}\n\n/**\n * Gets the Config service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getConfigServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://config-service.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co/config/v1'\n}\n\n/**\n * Returns the default headers for the endpoint adapters.\n * This function is SSR-friendly and will always include the x-origin header.\n * In a browser environment, it uses location.origin; otherwise, it uses a fallback string.\n *\n * @returns The default headers object.\n * @public\n */\nexport function getDefaultHeaders(): Record<string, string> {\n const headers: Record<string, string> = {}\n\n // Add x-origin header with location.origin if in browser, otherwise use fallback\n if (typeof window !== 'undefined' && typeof location !== 'undefined') {\n headers['x-origin'] = location.origin\n } else {\n headers['x-origin'] = 'non-browser'\n }\n\n return headers\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search-request.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/suggestions-search-request.schema.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,gEAA0D;AAE1D;;;;GAIG;AACU,QAAA,gCAAgC,GAAG,IAAA,+BAAmB,EAGjE;IACA,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAA;QAEhE,OAAO;YACL,IAAI,EAAE,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAW;YAC5B,QAAQ,EAAE,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAW;YACpC,OAAO,EAAE;gBACP,GAAG,eAAe;gBAClB,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,IAAA,yBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;gBAChD,MAAM;aACP;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/suggestions-search-request.schema.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,gEAA0D;AAE1D;;;;GAIG;AACU,QAAA,gCAAgC,GAAG,IAAA,+BAAmB,EAGjE;IACA,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAA;QAEhE,OAAO;YACL,IAAI,EAAE,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAW;YAC5B,QAAQ,EAAE,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAW;YACpC,OAAO,EAAE;gBACP,GAAG,eAAe;gBAClB,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,IAAA,yBAAU,EAAC,OAAO,CAAC,EAAE,CAAC;gBAChD,MAAM;aACP;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;CACjC,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchRequest } from '../../../types'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { mapFilters } from '../../../mappers/filter.utils'\n\n/**\n * Default implementation for the AiOverviewSuggestionsSearchRequestSchema.\n *\n * @public\n */\nexport const aiSuggestionsSearchRequestSchema = createMutableSchema<\n AiSuggestionsSearchRequest,\n PlatformAiSuggestionsSearchRequest\n>({\n context: ({ extraParams, filters, origin }) => {\n const { lang, instance, ...restExtraParams } = extraParams ?? {}\n\n return {\n lang: (lang ?? '') as string,\n instance: (instance ?? '') as string,\n filters: {\n ...restExtraParams,\n ...(filters && { filters: mapFilters(filters) }),\n origin,\n },\n }\n },\n queries: 'queries',\n excludeOptions: 'excludeOptions',\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search-request.model.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/suggestions-search-request.model.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Request for the `AI suggestions search` endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsSearchRequest {\n context: {\n lang: string\n instance?: string\n filters?: Record<string, unknown>\n }\n queries: {\n query: string\n categories: string[]\n }[]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.model.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/suggestions-search-request.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { Result } from '@empathyco/x-types'\n\n/**\n * Request for the `AI suggestions search` endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsSearchRequest {\n context: {\n lang: string\n instance?: string\n filters?: Record<string, unknown>\n }\n queries: {\n query: string\n categories: string[]\n }[]\n excludeOptions: {\n resultIds: Result['id'][]\n }\n}\n"]}
|
|
@@ -7,7 +7,7 @@ import { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils';
|
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export const aiSuggestionsSearchEndpointAdapter = endpointAdapterFactory({
|
|
10
|
-
endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/
|
|
10
|
+
endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/search`, from),
|
|
11
11
|
requestMapper: aiSuggestionsSearchRequestMapper,
|
|
12
12
|
responseMapper: aiSuggestionsSearchResponseMapper,
|
|
13
13
|
defaultRequestOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions-search.endpoint-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,sBAAsB,CAGtE;IACA,QAAQ,EAAE,IAAI,CAAC,EAAE,CACf,WAAW,
|
|
1
|
+
{"version":3,"file":"suggestions-search.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions-search.endpoint-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,MAAM,eAAe,CAAA;AACnG,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,sBAAsB,CAGtE;IACA,QAAQ,EAAE,IAAI,CAAC,EAAE,CACf,WAAW,CAAC,GAAG,0BAA0B,CAAC,IAAI,CAAC,gCAAgC,EAAE,IAAI,CAAC;IACxF,aAAa,EAAE,gCAAgC;IAC/C,cAAc,EAAE,iCAAiC;IACjD,qBAAqB,EAAE;QACrB,EAAE,EAAE,uBAAuB;QAC3B,gBAAgB,EAAE,IAAI;QACtB,UAAU,EAAE;YACV,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,GAAG,iBAAiB,EAAE;aACvB;SACF;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;SACf;KACF;CACF,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchRequest, AiSuggestionsSearchResponse } from '@empathyco/x-types'\nimport { endpointAdapterFactory, interpolate } from '@empathyco/x-adapter'\nimport { aiSuggestionsSearchRequestMapper, aiSuggestionsSearchResponseMapper } from '../../mappers'\nimport { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils'\n\n/**\n * Default adapter for the ai suggestions search endpoint.\n *\n * @public\n */\nexport const aiSuggestionsSearchEndpointAdapter = endpointAdapterFactory<\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse\n>({\n endpoint: from =>\n interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/search`, from),\n requestMapper: aiSuggestionsSearchRequestMapper,\n responseMapper: aiSuggestionsSearchResponseMapper,\n defaultRequestOptions: {\n id: 'ai-suggestions-search',\n sendParamsInBody: true,\n properties: {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n ...getDefaultHeaders(),\n },\n },\n parameters: {\n internal: true,\n },\n },\n})\n"]}
|
|
@@ -7,7 +7,7 @@ import { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils';
|
|
|
7
7
|
* @public
|
|
8
8
|
*/
|
|
9
9
|
export const aiSuggestionsEndpointAdapter = endpointAdapterFactory({
|
|
10
|
-
endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}
|
|
10
|
+
endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}`, from),
|
|
11
11
|
httpClient: fetchRawHttpClient,
|
|
12
12
|
requestMapper: aiSuggestionsRequestMapper,
|
|
13
13
|
defaultRequestOptions: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions.endpoint-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAiC;IACjG,QAAQ,EAAE,IAAI,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"suggestions.endpoint-adapter.js","sourceRoot":"","sources":["../../../../src/endpoint-adapters/ai/suggestions.endpoint-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAC9F,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AAExE;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,sBAAsB,CAAiC;IACjG,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,0BAA0B,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC;IACjG,UAAU,EAAE,kBAAkB;IAC9B,aAAa,EAAE,0BAA0B;IACzC,qBAAqB,EAAE;QACrB,EAAE,EAAE,yBAAyB;QAC7B,UAAU,EAAE;YACV,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,MAAM,EAAE,mBAAmB;gBAC3B,cAAc,EAAE,kBAAkB;gBAClC,GAAG,iBAAiB,EAAE;aACvB;SACF;QACD,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE,IAAI;KACvB;CACF,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsRequest } from '@empathyco/x-types'\nimport { endpointAdapterFactory, fetchRawHttpClient, interpolate } from '@empathyco/x-adapter'\nimport { aiSuggestionsRequestMapper } from '../../mappers'\nimport { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils'\n\n/**\n * Default adapter for the Overview suggestions v1 endpoint.\n *\n * @public\n */\nexport const aiSuggestionsEndpointAdapter = endpointAdapterFactory<AiSuggestionsRequest, Response>({\n endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}`, from),\n httpClient: fetchRawHttpClient,\n requestMapper: aiSuggestionsRequestMapper,\n defaultRequestOptions: {\n id: 'ai-overview-suggestions',\n properties: {\n method: 'POST',\n headers: {\n accept: 'text/event-stream',\n 'Content-Type': 'application/json',\n ...getDefaultHeaders(),\n },\n },\n parameters: {\n internal: true,\n },\n sendParamsInBody: true,\n },\n})\n"]}
|
|
@@ -40,12 +40,12 @@ export function getBeaconServiceUrl(from) {
|
|
|
40
40
|
export function getAiSuggestionsServiceUrl(from) {
|
|
41
41
|
var _a, _b;
|
|
42
42
|
if (((_a = from.extraParams) === null || _a === void 0 ? void 0 : _a.env) === 'test') {
|
|
43
|
-
return 'https://questions.internal.test.empathy.co/
|
|
43
|
+
return 'https://questions.internal.test.empathy.co/suggestions';
|
|
44
44
|
}
|
|
45
45
|
if (((_b = from.extraParams) === null || _b === void 0 ? void 0 : _b.env) === 'staging') {
|
|
46
|
-
return 'https://questions.staging.empathy.co/v1/
|
|
46
|
+
return 'https://questions.staging.empathy.co/v1/suggestions';
|
|
47
47
|
}
|
|
48
|
-
return 'https://api.{extraParams.env(.)}empathy.co/v1/
|
|
48
|
+
return 'https://api.{extraParams.env(.)}empathy.co/v1/suggestions';
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Gets the Questions service URL for the given request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAwB;;IAC1D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,yCAAyC;QAC3C,CAAC,CAAC,sDAAsD,CAAA;AAC5D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAwB;;IAC1D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,6CAA6C;QAC/C,CAAC,CAAC,4CAA4C,CAAA;AAClD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,0BAA0B,CAAC,IAAwB;;IACjE,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAwB;;IAC1D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,yCAAyC;QAC3C,CAAC,CAAC,sDAAsD,CAAA;AAC5D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAwB;;IAC1D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,6CAA6C;QAC/C,CAAC,CAAC,4CAA4C,CA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AACH,MAAM,UAAU,mBAAmB,CAAC,IAAwB;;IAC1D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,iDAAiD;QACnD,CAAC,CAAC,sDAAsD,CAAA;AAC5D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAA2B,EAAE,CAAA;IAE1C,iFAAiF;IACjF,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,CAAC;QACrE,OAAO,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAA;IACvC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,UAAU,CAAC,GAAG,aAAa,CAAA;IACrC,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC","sourcesContent":["import type { ExtraParamsRequest } from '@empathyco/x-types'\n\n/**\n * Gets the Search service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getSearchServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://search.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co/search/v1'\n}\n\n/**\n * Gets the Beacon service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getBeaconServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://beacon-api.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co'\n}\n\n/**\n * Gets the AI suggestions service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getAiSuggestionsServiceUrl(from: ExtraParamsRequest): string {\n if (from.extraParams?.env === 'test') {\n return 'https://questions.internal.test.empathy.co/suggestions'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/suggestions'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/v1/suggestions'\n}\n\n/**\n * Gets the Questions service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getQuestionsServiceUrl(from: ExtraParamsRequest): string {\n if (from.extraParams?.env === 'test') {\n return 'https://questions.internal.test.empathy.co'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/questions'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/questions'\n}\n\n/**\n * Gets the Tasks service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getTasksServiceUrl(from: ExtraParamsRequest): string {\n if (from.extraParams?.env === 'test') {\n return 'https://questions.internal.test.empathy.co'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/questions'\n}\n\n/**\n * Gets the Semantics service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getSemanticsServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://semantics-api.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co/semantics-api'\n}\n\n/**\n * Gets the Config service URL for the given request.\n *\n * @param from - The request.\n *\n * @returns The service URL.\n *\n * @internal\n */\nexport function getConfigServiceUrl(from: ExtraParamsRequest): string {\n return from.extraParams?.env === 'test'\n ? 'https://config-service.internal.test.empathy.co'\n : 'https://api.{extraParams.env(.)}empathy.co/config/v1'\n}\n\n/**\n * Returns the default headers for the endpoint adapters.\n * This function is SSR-friendly and will always include the x-origin header.\n * In a browser environment, it uses location.origin; otherwise, it uses a fallback string.\n *\n * @returns The default headers object.\n * @public\n */\nexport function getDefaultHeaders(): Record<string, string> {\n const headers: Record<string, string> = {}\n\n // Add x-origin header with location.origin if in browser, otherwise use fallback\n if (typeof window !== 'undefined' && typeof location !== 'undefined') {\n headers['x-origin'] = location.origin\n } else {\n headers['x-origin'] = 'non-browser'\n }\n\n return headers\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search-request.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/suggestions-search-request.schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAGjE;IACA,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAA;QAEhE,OAAO;YACL,IAAI,EAAE,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAW;YAC5B,QAAQ,EAAE,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAW;YACpC,OAAO,EAAE;gBACP,GAAG,eAAe;gBAClB,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChD,MAAM;aACP;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/suggestions-search-request.schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAGjE;IACA,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE;QAC5C,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,eAAe,EAAE,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,EAAE,CAAA;QAEhE,OAAO;YACL,IAAI,EAAE,CAAC,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,EAAE,CAAW;YAC5B,QAAQ,EAAE,CAAC,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,EAAE,CAAW;YACpC,OAAO,EAAE;gBACP,GAAG,eAAe;gBAClB,GAAG,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChD,MAAM;aACP;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;CACjC,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchRequest } from '../../../types'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { mapFilters } from '../../../mappers/filter.utils'\n\n/**\n * Default implementation for the AiOverviewSuggestionsSearchRequestSchema.\n *\n * @public\n */\nexport const aiSuggestionsSearchRequestSchema = createMutableSchema<\n AiSuggestionsSearchRequest,\n PlatformAiSuggestionsSearchRequest\n>({\n context: ({ extraParams, filters, origin }) => {\n const { lang, instance, ...restExtraParams } = extraParams ?? {}\n\n return {\n lang: (lang ?? '') as string,\n instance: (instance ?? '') as string,\n filters: {\n ...restExtraParams,\n ...(filters && { filters: mapFilters(filters) }),\n origin,\n },\n }\n },\n queries: 'queries',\n excludeOptions: 'excludeOptions',\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suggestions-search-request.model.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/suggestions-search-request.model.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Request for the `AI suggestions search` endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsSearchRequest {\n context: {\n lang: string\n instance?: string\n filters?: Record<string, unknown>\n }\n queries: {\n query: string\n categories: string[]\n }[]\n}\n"]}
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.model.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/suggestions-search-request.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { Result } from '@empathyco/x-types'\n\n/**\n * Request for the `AI suggestions search` endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsSearchRequest {\n context: {\n lang: string\n instance?: string\n filters?: Record<string, unknown>\n }\n queries: {\n query: string\n categories: string[]\n }[]\n excludeOptions: {\n resultIds: Result['id'][]\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Result } from '@empathyco/x-types';
|
|
1
2
|
/**
|
|
2
3
|
* Request for the `AI suggestions search` endpoint.
|
|
3
4
|
*
|
|
@@ -13,4 +14,7 @@ export interface PlatformAiSuggestionsSearchRequest {
|
|
|
13
14
|
query: string;
|
|
14
15
|
categories: string[];
|
|
15
16
|
}[];
|
|
17
|
+
excludeOptions: {
|
|
18
|
+
resultIds: Result['id'][];
|
|
19
|
+
};
|
|
16
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-adapter-platform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "A search client for the Empathy Platform API",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@empathyco/x-adapter": "8.1.4",
|
|
51
|
-
"@empathyco/x-types": "10.
|
|
51
|
+
"@empathyco/x-types": "10.2.0",
|
|
52
52
|
"@empathyco/x-utils": "1.0.5"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "b23e9c753536fd1ba8e45012d0b510931852b7af"
|
|
66
66
|
}
|
|
@@ -4050,6 +4050,42 @@
|
|
|
4050
4050
|
"endIndex": 4
|
|
4051
4051
|
}
|
|
4052
4052
|
},
|
|
4053
|
+
{
|
|
4054
|
+
"kind": "PropertySignature",
|
|
4055
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionsSearchRequest#excludeOptions:member",
|
|
4056
|
+
"docComment": "",
|
|
4057
|
+
"excerptTokens": [
|
|
4058
|
+
{
|
|
4059
|
+
"kind": "Content",
|
|
4060
|
+
"text": "excludeOptions: "
|
|
4061
|
+
},
|
|
4062
|
+
{
|
|
4063
|
+
"kind": "Content",
|
|
4064
|
+
"text": "{\n resultIds: "
|
|
4065
|
+
},
|
|
4066
|
+
{
|
|
4067
|
+
"kind": "Reference",
|
|
4068
|
+
"text": "Result",
|
|
4069
|
+
"canonicalReference": "@empathyco/x-adapter-platform!Result:interface"
|
|
4070
|
+
},
|
|
4071
|
+
{
|
|
4072
|
+
"kind": "Content",
|
|
4073
|
+
"text": "['id'][];\n }"
|
|
4074
|
+
},
|
|
4075
|
+
{
|
|
4076
|
+
"kind": "Content",
|
|
4077
|
+
"text": ";"
|
|
4078
|
+
}
|
|
4079
|
+
],
|
|
4080
|
+
"isReadonly": false,
|
|
4081
|
+
"isOptional": false,
|
|
4082
|
+
"releaseTag": "Public",
|
|
4083
|
+
"name": "excludeOptions",
|
|
4084
|
+
"propertyTypeTokenRange": {
|
|
4085
|
+
"startIndex": 1,
|
|
4086
|
+
"endIndex": 4
|
|
4087
|
+
}
|
|
4088
|
+
},
|
|
4053
4089
|
{
|
|
4054
4090
|
"kind": "PropertySignature",
|
|
4055
4091
|
"canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionsSearchRequest#queries:member",
|
|
@@ -355,6 +355,10 @@ export interface PlatformAiSuggestionsSearchRequest {
|
|
|
355
355
|
filters?: Record<string, unknown>;
|
|
356
356
|
};
|
|
357
357
|
// (undocumented)
|
|
358
|
+
excludeOptions: {
|
|
359
|
+
resultIds: Result['id'][];
|
|
360
|
+
};
|
|
361
|
+
// (undocumented)
|
|
358
362
|
queries: {
|
|
359
363
|
query: string;
|
|
360
364
|
categories: string[];
|
|
@@ -847,8 +851,6 @@ export const relatedTagsResponseMapper: Mapper<PlatformRelatedTagsResponse, Rela
|
|
|
847
851
|
// @public
|
|
848
852
|
export const relatedTagsResponseSchema: MutableSchema<PlatformRelatedTagsResponse, RelatedTagsResponse>;
|
|
849
853
|
|
|
850
|
-
// Warning: (ae-forgotten-export) The symbol "Result" needs to be exported by the entry point index.d.ts
|
|
851
|
-
//
|
|
852
854
|
// @public
|
|
853
855
|
export const resultSchema: MutableSchema<PlatformResult, Result>;
|
|
854
856
|
|
|
@@ -903,6 +905,10 @@ export const taggingEndpointAdapter: ExtendableEndpointAdapter<TaggingRequest, v
|
|
|
903
905
|
// @public
|
|
904
906
|
export const taggingRequestMapper: Mapper<TaggingRequest, any>;
|
|
905
907
|
|
|
908
|
+
// Warnings were encountered during analysis:
|
|
909
|
+
//
|
|
910
|
+
// dist/types/types/requests/ai/suggestions-search-request.model.d.ts:18:9 - (ae-forgotten-export) The symbol "Result" needs to be exported by the entry point index.d.ts
|
|
911
|
+
|
|
906
912
|
// (No @packageDocumentation comment for this package)
|
|
907
913
|
|
|
908
914
|
```
|