@empathyco/x-adapter-platform 1.1.0-alpha.29 → 1.1.0-alpha.30

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.
Files changed (49) hide show
  1. package/dist/cjs/endpoint-adapters/ai/suggestions.endpoint-adapter.js +32 -0
  2. package/dist/cjs/endpoint-adapters/ai/suggestions.endpoint-adapter.js.map +1 -0
  3. package/dist/cjs/endpoint-adapters/index.js +1 -0
  4. package/dist/cjs/endpoint-adapters/index.js.map +1 -1
  5. package/dist/cjs/endpoint-adapters/utils.js +1 -1
  6. package/dist/cjs/endpoint-adapters/utils.js.map +1 -1
  7. package/dist/cjs/mappers/requests/ai/index.js +1 -0
  8. package/dist/cjs/mappers/requests/ai/index.js.map +1 -1
  9. package/dist/cjs/mappers/requests/ai/suggestions-request.mapper.js +12 -0
  10. package/dist/cjs/mappers/requests/ai/suggestions-request.mapper.js.map +1 -0
  11. package/dist/cjs/platform.adapter.js +2 -0
  12. package/dist/cjs/platform.adapter.js.map +1 -1
  13. package/dist/cjs/schemas/requests/ai/suggestions-request.schema.js +21 -0
  14. package/dist/cjs/schemas/requests/ai/suggestions-request.schema.js.map +1 -0
  15. package/dist/cjs/types/platform-adapter.types.js.map +1 -1
  16. package/dist/cjs/types/requests/ai/index.js +1 -0
  17. package/dist/cjs/types/requests/ai/index.js.map +1 -1
  18. package/dist/cjs/types/requests/ai/suggestions-request.model.js +3 -0
  19. package/dist/cjs/types/requests/ai/suggestions-request.model.js.map +1 -0
  20. package/dist/esm/endpoint-adapters/ai/suggestions.endpoint-adapter.js +29 -0
  21. package/dist/esm/endpoint-adapters/ai/suggestions.endpoint-adapter.js.map +1 -0
  22. package/dist/esm/endpoint-adapters/index.js +1 -0
  23. package/dist/esm/endpoint-adapters/index.js.map +1 -1
  24. package/dist/esm/endpoint-adapters/utils.js +1 -1
  25. package/dist/esm/endpoint-adapters/utils.js.map +1 -1
  26. package/dist/esm/mappers/requests/ai/index.js +1 -0
  27. package/dist/esm/mappers/requests/ai/index.js.map +1 -1
  28. package/dist/esm/mappers/requests/ai/suggestions-request.mapper.js +9 -0
  29. package/dist/esm/mappers/requests/ai/suggestions-request.mapper.js.map +1 -0
  30. package/dist/esm/platform.adapter.js +2 -0
  31. package/dist/esm/platform.adapter.js.map +1 -1
  32. package/dist/esm/schemas/requests/ai/suggestions-request.schema.js +18 -0
  33. package/dist/esm/schemas/requests/ai/suggestions-request.schema.js.map +1 -0
  34. package/dist/esm/types/platform-adapter.types.js.map +1 -1
  35. package/dist/esm/types/requests/ai/index.js +1 -0
  36. package/dist/esm/types/requests/ai/index.js.map +1 -1
  37. package/dist/esm/types/requests/ai/suggestions-request.model.js +2 -0
  38. package/dist/esm/types/requests/ai/suggestions-request.model.js.map +1 -0
  39. package/dist/types/endpoint-adapters/ai/suggestions.endpoint-adapter.d.ts +7 -0
  40. package/dist/types/endpoint-adapters/index.d.ts +1 -0
  41. package/dist/types/mappers/requests/ai/index.d.ts +1 -0
  42. package/dist/types/mappers/requests/ai/suggestions-request.mapper.d.ts +8 -0
  43. package/dist/types/schemas/requests/ai/suggestions-request.schema.d.ts +8 -0
  44. package/dist/types/types/platform-adapter.types.d.ts +2 -1
  45. package/dist/types/types/requests/ai/index.d.ts +1 -0
  46. package/dist/types/types/requests/ai/suggestions-request.model.d.ts +13 -0
  47. package/package.json +4 -4
  48. package/report/x-adapter-platform.api.json +204 -0
  49. package/report/x-adapter-platform.api.md +21 -0
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiSuggestionsEndpointAdapter = void 0;
4
+ const x_adapter_1 = require("@empathyco/x-adapter");
5
+ const mappers_1 = require("../../mappers");
6
+ const utils_1 = require("../utils");
7
+ /**
8
+ * Default adapter for the Overview suggestions v1 endpoint.
9
+ *
10
+ * @public
11
+ */
12
+ exports.aiSuggestionsEndpointAdapter = (0, x_adapter_1.endpointAdapterFactory)({
13
+ endpoint: from => (0, x_adapter_1.interpolate)(`${(0, utils_1.getAiSuggestionsServiceUrl)(from)}/{extraParams.instance}/suggestions`, from),
14
+ httpClient: x_adapter_1.fetchRawHttpClient,
15
+ requestMapper: mappers_1.aiSuggestionsRequestMapper,
16
+ defaultRequestOptions: {
17
+ id: 'ai-overview-suggestions',
18
+ properties: {
19
+ method: 'POST',
20
+ headers: {
21
+ accept: 'text/event-stream',
22
+ 'Content-Type': 'application/json',
23
+ ...(0, utils_1.getDefaultHeaders)(),
24
+ },
25
+ },
26
+ parameters: {
27
+ internal: true,
28
+ },
29
+ sendParamsInBody: true,
30
+ },
31
+ });
32
+ //# sourceMappingURL=suggestions.endpoint-adapter.js.map
@@ -0,0 +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,CACf,IAAA,uBAAW,EAAC,GAAG,IAAA,kCAA0B,EAAC,IAAI,CAAC,qCAAqC,EAAE,IAAI,CAAC;IAC7F,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 =>\n interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/suggestions`, 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"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./ai/questions.endpoint-adapter"), exports);
5
5
  tslib_1.__exportStar(require("./ai/suggestions-search.endpoint-adapter"), exports);
6
+ tslib_1.__exportStar(require("./ai/suggestions.endpoint-adapter"), exports);
6
7
  tslib_1.__exportStar(require("./ai/tasks.endpoint-adapter"), exports);
7
8
  tslib_1.__exportStar(require("./experience-controls.endpoint-adapter"), exports);
8
9
  tslib_1.__exportStar(require("./identifier-results.endpoint-adapter"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/index.ts"],"names":[],"mappings":";;;AAAA,0EAA+C;AAC/C,mFAAwD;AACxD,sEAA2C;AAC3C,iFAAsD;AACtD,gFAAqD;AACrD,0EAA+C;AAC/C,8EAAmD;AACnD,+EAAoD;AACpD,6EAAkD;AAClD,6EAAkD;AAClD,0EAA+C;AAC/C,oEAAyC;AACzC,8EAAmD;AACnD,qEAA0C","sourcesContent":["export * from './ai/questions.endpoint-adapter'\nexport * from './ai/suggestions-search.endpoint-adapter'\nexport * from './ai/tasks.endpoint-adapter'\nexport * from './experience-controls.endpoint-adapter'\nexport * from './identifier-results.endpoint-adapter'\nexport * from './next-queries.endpoint-adapter'\nexport * from './popular-searches.endpoint-adapter'\nexport * from './query-suggestions.endpoint-adapter'\nexport * from './recommendations.endpoint-adapter'\nexport * from './related-prompts.endpoint-adapter'\nexport * from './related-tags.endpoint-adapter'\nexport * from './search.endpoint-adapter'\nexport * from './semantic-queries.endpoint-adapter'\nexport * from './tagging.endpoint-adapter'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/index.ts"],"names":[],"mappings":";;;AAAA,0EAA+C;AAC/C,mFAAwD;AACxD,4EAAiD;AACjD,sEAA2C;AAC3C,iFAAsD;AACtD,gFAAqD;AACrD,0EAA+C;AAC/C,8EAAmD;AACnD,+EAAoD;AACpD,6EAAkD;AAClD,6EAAkD;AAClD,0EAA+C;AAC/C,oEAAyC;AACzC,8EAAmD;AACnD,qEAA0C","sourcesContent":["export * from './ai/questions.endpoint-adapter'\nexport * from './ai/suggestions-search.endpoint-adapter'\nexport * from './ai/suggestions.endpoint-adapter'\nexport * from './ai/tasks.endpoint-adapter'\nexport * from './experience-controls.endpoint-adapter'\nexport * from './identifier-results.endpoint-adapter'\nexport * from './next-queries.endpoint-adapter'\nexport * from './popular-searches.endpoint-adapter'\nexport * from './query-suggestions.endpoint-adapter'\nexport * from './recommendations.endpoint-adapter'\nexport * from './related-prompts.endpoint-adapter'\nexport * from './related-tags.endpoint-adapter'\nexport * from './search.endpoint-adapter'\nexport * from './semantic-queries.endpoint-adapter'\nexport * from './tagging.endpoint-adapter'\n"]}
@@ -50,7 +50,7 @@ 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/overview';
54
54
  }
55
55
  if (((_b = from.extraParams) === null || _b === void 0 ? void 0 : _b.env) === 'staging') {
56
56
  return 'https://questions.staging.empathy.co/v1/overview';
@@ -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;AACH,SAAgB,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,SAAgB,0BAA0B,CAAC,IAAwB;;IACjE,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,kDAAkD,CAAA;IAC3D,CAAC;IACD,OAAO,qDAAqD,CAAA;AAC9D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,IAAwB;;IAC7D,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,mDAAmD,CAAA;IAC5D,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAAC,IAAwB;;IACzD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,yCAAyC,CAAA;IAClD,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,IAAwB;;IAC7D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,gDAAgD;QAClD,CAAC,CAAC,0DAA0D,CAAA;AAChE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,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,SAAgB,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'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/overview'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/overview'\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
+ {"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;AACH,SAAgB,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,SAAgB,0BAA0B,CAAC,IAAwB;;IACjE,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,qDAAqD,CAAA;IAC9D,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,kDAAkD,CAAA;IAC3D,CAAC;IACD,OAAO,qDAAqD,CAAA;AAC9D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,IAAwB;;IAC7D,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,mDAAmD,CAAA;IAC5D,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,kBAAkB,CAAC,IAAwB;;IACzD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,yCAAyC,CAAA;IAClD,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CAAC,IAAwB;;IAC7D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,gDAAgD;QAClD,CAAC,CAAC,0DAA0D,CAAA;AAChE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,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,SAAgB,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/overview'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/overview'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/overview'\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"]}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./questions-request.mapper"), exports);
5
+ tslib_1.__exportStar(require("./suggestions-request.mapper"), exports);
5
6
  tslib_1.__exportStar(require("./suggestions-search-request.mapper"), exports);
6
7
  tslib_1.__exportStar(require("./tasks-request.mapper"), exports);
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/index.ts"],"names":[],"mappings":";;;AAAA,qEAA0C;AAC1C,8EAAmD;AACnD,iEAAsC","sourcesContent":["export * from './questions-request.mapper'\nexport * from './suggestions-search-request.mapper'\nexport * from './tasks-request.mapper'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/index.ts"],"names":[],"mappings":";;;AAAA,qEAA0C;AAC1C,uEAA4C;AAC5C,8EAAmD;AACnD,iEAAsC","sourcesContent":["export * from './questions-request.mapper'\nexport * from './suggestions-request.mapper'\nexport * from './suggestions-search-request.mapper'\nexport * from './tasks-request.mapper'\n"]}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiSuggestionsRequestMapper = void 0;
4
+ const x_adapter_1 = require("@empathyco/x-adapter");
5
+ const suggestions_request_schema_1 = require("../../../schemas/requests/ai/suggestions-request.schema");
6
+ /**
7
+ * Default implementation for the aiSuggestionsRequestMapper.
8
+ *
9
+ * @public
10
+ */
11
+ exports.aiSuggestionsRequestMapper = (0, x_adapter_1.schemaMapperFactory)(suggestions_request_schema_1.aiSuggestionsRequestSchema);
12
+ //# sourceMappingURL=suggestions-request.mapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions-request.mapper.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/suggestions-request.mapper.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,wGAAoG;AAEpG;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,IAAA,+BAAmB,EAG3D,uDAA0B,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsRequest } from '../../../types'\nimport { schemaMapperFactory } from '@empathyco/x-adapter'\nimport { aiSuggestionsRequestSchema } from '../../../schemas/requests/ai/suggestions-request.schema'\n\n/**\n * Default implementation for the aiSuggestionsRequestMapper.\n *\n * @public\n */\nexport const aiSuggestionsRequestMapper = schemaMapperFactory<\n AiSuggestionsRequest,\n PlatformAiSuggestionsRequest\n>(aiSuggestionsRequestSchema)\n"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.platformAdapter = void 0;
4
4
  const questions_endpoint_adapter_1 = require("./endpoint-adapters/ai/questions.endpoint-adapter");
5
5
  const suggestions_search_endpoint_adapter_1 = require("./endpoint-adapters/ai/suggestions-search.endpoint-adapter");
6
+ const suggestions_endpoint_adapter_1 = require("./endpoint-adapters/ai/suggestions.endpoint-adapter");
6
7
  const tasks_endpoint_adapter_1 = require("./endpoint-adapters/ai/tasks.endpoint-adapter");
7
8
  const experience_controls_endpoint_adapter_1 = require("./endpoint-adapters/experience-controls.endpoint-adapter");
8
9
  const identifier_results_endpoint_adapter_1 = require("./endpoint-adapters/identifier-results.endpoint-adapter");
@@ -32,6 +33,7 @@ exports.platformAdapter = {
32
33
  tagging: tagging_endpoint_adapter_1.taggingEndpointAdapter,
33
34
  semanticQueries: semantic_queries_endpoint_adapter_1.semanticQueriesEndpointAdapter,
34
35
  experienceControls: experience_controls_endpoint_adapter_1.experienceControlsEndpointAdapter,
36
+ aiSuggestions: suggestions_endpoint_adapter_1.aiSuggestionsEndpointAdapter,
35
37
  aiSuggestionsSearch: suggestions_search_endpoint_adapter_1.aiSuggestionsSearchEndpointAdapter,
36
38
  aiQuestions: questions_endpoint_adapter_1.aiQuestionsEndpointAdapter,
37
39
  aiTasks: tasks_endpoint_adapter_1.aiTasksEndpointAdapter,
@@ -1 +1 @@
1
- {"version":3,"file":"platform.adapter.js","sourceRoot":"","sources":["../../src/platform.adapter.ts"],"names":[],"mappings":";;;AACA,kGAA8F;AAC9F,oHAA+G;AAC/G,0FAAsF;AACtF,mHAA4G;AAC5G,iHAA0G;AAC1G,qGAA8F;AAC9F,6GAAsG;AACtG,+GAAwG;AACxG,2GAAqG;AACrG,2GAAoG;AACpG,qGAA8F;AAC9F,yFAAmF;AACnF,6GAAsG;AACtG,2FAAqF;AACrF;;;;GAIG;AACU,QAAA,eAAe,GAAoB;IAC9C,MAAM,EAAE,+CAAqB;IAC7B,eAAe,EAAE,kEAA8B;IAC/C,eAAe,EAAE,iEAA8B;IAC/C,WAAW,EAAE,0DAA0B;IACvC,gBAAgB,EAAE,oEAA+B;IACjD,cAAc,EAAE,gEAA6B;IAC7C,WAAW,EAAE,0DAA0B;IACvC,iBAAiB,EAAE,sEAAgC;IACnD,OAAO,EAAE,iDAAsB;IAC/B,eAAe,EAAE,kEAA8B;IAC/C,kBAAkB,EAAE,wEAAiC;IACrD,mBAAmB,EAAE,wEAAkC;IACvD,WAAW,EAAE,uDAA0B;IACvC,OAAO,EAAE,+CAAsB;CAChC,CAAA","sourcesContent":["import type { PlatformAdapter } from './types/platform-adapter.types'\nimport { aiQuestionsEndpointAdapter } from './endpoint-adapters/ai/questions.endpoint-adapter'\nimport { aiSuggestionsSearchEndpointAdapter } from './endpoint-adapters/ai/suggestions-search.endpoint-adapter'\nimport { aiTasksEndpointAdapter } from './endpoint-adapters/ai/tasks.endpoint-adapter'\nimport { experienceControlsEndpointAdapter } from './endpoint-adapters/experience-controls.endpoint-adapter'\nimport { identifierResultsEndpointAdapter } from './endpoint-adapters/identifier-results.endpoint-adapter'\nimport { nextQueriesEndpointAdapter } from './endpoint-adapters/next-queries.endpoint-adapter'\nimport { popularSearchesEndpointAdapter } from './endpoint-adapters/popular-searches.endpoint-adapter'\nimport { querySuggestionsEndpointAdapter } from './endpoint-adapters/query-suggestions.endpoint-adapter'\nimport { recommendationsEndpointAdapter } from './endpoint-adapters/recommendations.endpoint-adapter'\nimport { relatedPromptsEndpointAdapter } from './endpoint-adapters/related-prompts.endpoint-adapter'\nimport { relatedTagsEndpointAdapter } from './endpoint-adapters/related-tags.endpoint-adapter'\nimport { searchEndpointAdapter } from './endpoint-adapters/search.endpoint-adapter'\nimport { semanticQueriesEndpointAdapter } from './endpoint-adapters/semantic-queries.endpoint-adapter'\nimport { taggingEndpointAdapter } from './endpoint-adapters/tagging.endpoint-adapter'\n/**\n * Default implementation for the PlatformAdapter.\n *\n * @public\n */\nexport const platformAdapter: PlatformAdapter = {\n search: searchEndpointAdapter,\n popularSearches: popularSearchesEndpointAdapter,\n recommendations: recommendationsEndpointAdapter,\n nextQueries: nextQueriesEndpointAdapter,\n querySuggestions: querySuggestionsEndpointAdapter,\n relatedPrompts: relatedPromptsEndpointAdapter,\n relatedTags: relatedTagsEndpointAdapter,\n identifierResults: identifierResultsEndpointAdapter,\n tagging: taggingEndpointAdapter,\n semanticQueries: semanticQueriesEndpointAdapter,\n experienceControls: experienceControlsEndpointAdapter,\n aiSuggestionsSearch: aiSuggestionsSearchEndpointAdapter,\n aiQuestions: aiQuestionsEndpointAdapter,\n aiTasks: aiTasksEndpointAdapter,\n}\n"]}
1
+ {"version":3,"file":"platform.adapter.js","sourceRoot":"","sources":["../../src/platform.adapter.ts"],"names":[],"mappings":";;;AACA,kGAA8F;AAC9F,oHAA+G;AAC/G,sGAAkG;AAClG,0FAAsF;AACtF,mHAA4G;AAC5G,iHAA0G;AAC1G,qGAA8F;AAC9F,6GAAsG;AACtG,+GAAwG;AACxG,2GAAqG;AACrG,2GAAoG;AACpG,qGAA8F;AAC9F,yFAAmF;AACnF,6GAAsG;AACtG,2FAAqF;AACrF;;;;GAIG;AACU,QAAA,eAAe,GAAoB;IAC9C,MAAM,EAAE,+CAAqB;IAC7B,eAAe,EAAE,kEAA8B;IAC/C,eAAe,EAAE,iEAA8B;IAC/C,WAAW,EAAE,0DAA0B;IACvC,gBAAgB,EAAE,oEAA+B;IACjD,cAAc,EAAE,gEAA6B;IAC7C,WAAW,EAAE,0DAA0B;IACvC,iBAAiB,EAAE,sEAAgC;IACnD,OAAO,EAAE,iDAAsB;IAC/B,eAAe,EAAE,kEAA8B;IAC/C,kBAAkB,EAAE,wEAAiC;IACrD,aAAa,EAAE,2DAA4B;IAC3C,mBAAmB,EAAE,wEAAkC;IACvD,WAAW,EAAE,uDAA0B;IACvC,OAAO,EAAE,+CAAsB;CAChC,CAAA","sourcesContent":["import type { PlatformAdapter } from './types/platform-adapter.types'\nimport { aiQuestionsEndpointAdapter } from './endpoint-adapters/ai/questions.endpoint-adapter'\nimport { aiSuggestionsSearchEndpointAdapter } from './endpoint-adapters/ai/suggestions-search.endpoint-adapter'\nimport { aiSuggestionsEndpointAdapter } from './endpoint-adapters/ai/suggestions.endpoint-adapter'\nimport { aiTasksEndpointAdapter } from './endpoint-adapters/ai/tasks.endpoint-adapter'\nimport { experienceControlsEndpointAdapter } from './endpoint-adapters/experience-controls.endpoint-adapter'\nimport { identifierResultsEndpointAdapter } from './endpoint-adapters/identifier-results.endpoint-adapter'\nimport { nextQueriesEndpointAdapter } from './endpoint-adapters/next-queries.endpoint-adapter'\nimport { popularSearchesEndpointAdapter } from './endpoint-adapters/popular-searches.endpoint-adapter'\nimport { querySuggestionsEndpointAdapter } from './endpoint-adapters/query-suggestions.endpoint-adapter'\nimport { recommendationsEndpointAdapter } from './endpoint-adapters/recommendations.endpoint-adapter'\nimport { relatedPromptsEndpointAdapter } from './endpoint-adapters/related-prompts.endpoint-adapter'\nimport { relatedTagsEndpointAdapter } from './endpoint-adapters/related-tags.endpoint-adapter'\nimport { searchEndpointAdapter } from './endpoint-adapters/search.endpoint-adapter'\nimport { semanticQueriesEndpointAdapter } from './endpoint-adapters/semantic-queries.endpoint-adapter'\nimport { taggingEndpointAdapter } from './endpoint-adapters/tagging.endpoint-adapter'\n/**\n * Default implementation for the PlatformAdapter.\n *\n * @public\n */\nexport const platformAdapter: PlatformAdapter = {\n search: searchEndpointAdapter,\n popularSearches: popularSearchesEndpointAdapter,\n recommendations: recommendationsEndpointAdapter,\n nextQueries: nextQueriesEndpointAdapter,\n querySuggestions: querySuggestionsEndpointAdapter,\n relatedPrompts: relatedPromptsEndpointAdapter,\n relatedTags: relatedTagsEndpointAdapter,\n identifierResults: identifierResultsEndpointAdapter,\n tagging: taggingEndpointAdapter,\n semanticQueries: semanticQueriesEndpointAdapter,\n experienceControls: experienceControlsEndpointAdapter,\n aiSuggestions: aiSuggestionsEndpointAdapter,\n aiSuggestionsSearch: aiSuggestionsSearchEndpointAdapter,\n aiQuestions: aiQuestionsEndpointAdapter,\n aiTasks: aiTasksEndpointAdapter,\n}\n"]}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.aiSuggestionsRequestSchema = void 0;
4
+ const x_adapter_1 = require("@empathyco/x-adapter");
5
+ /**
6
+ * Default implementation for the aiSuggestionsRequestSchema.
7
+ *
8
+ * @public
9
+ */
10
+ exports.aiSuggestionsRequestSchema = (0, x_adapter_1.createMutableSchema)({
11
+ context: ({ query, extraParams }) => {
12
+ var _a;
13
+ return ({
14
+ query,
15
+ lang: (_a = extraParams === null || extraParams === void 0 ? void 0 : extraParams.lang) !== null && _a !== void 0 ? _a : '',
16
+ instance: extraParams === null || extraParams === void 0 ? void 0 : extraParams.instance,
17
+ filters: extraParams === null || extraParams === void 0 ? void 0 : extraParams.filters,
18
+ });
19
+ },
20
+ });
21
+ //# sourceMappingURL=suggestions-request.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions-request.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/suggestions-request.schema.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAE1D;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,IAAA,+BAAmB,EAG3D;IACA,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;;QAAC,OAAA,CAAC;YACpC,KAAK;YACL,IAAI,EAAE,MAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAA2B,mCAAI,EAAE;YACrD,QAAQ,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAA8B;YACrD,OAAO,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAA8C;SACrE,CAAC,CAAA;KAAA;CACH,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsRequest } from '../../../types'\nimport { createMutableSchema } from '@empathyco/x-adapter'\n\n/**\n * Default implementation for the aiSuggestionsRequestSchema.\n *\n * @public\n */\nexport const aiSuggestionsRequestSchema = createMutableSchema<\n AiSuggestionsRequest,\n PlatformAiSuggestionsRequest\n>({\n context: ({ query, extraParams }) => ({\n query,\n lang: (extraParams?.lang as string | undefined) ?? '',\n instance: extraParams?.instance as string | undefined,\n filters: extraParams?.filters as Record<string, unknown> | undefined,\n }),\n})\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"platform-adapter.types.js","sourceRoot":"","sources":["../../../src/types/platform-adapter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExtendableEndpointAdapter } from '@empathyco/x-adapter'\nimport type {\n AiQuestionsRequest,\n AiQuestionsResponse,\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse,\n AiTasksRequest,\n AiTasksResponse,\n ExperienceControlsRequest,\n ExperienceControlsResponse,\n IdentifierResultsRequest,\n IdentifierResultsResponse,\n NextQueriesRequest,\n NextQueriesResponse,\n PopularSearchesRequest,\n PopularSearchesResponse,\n QuerySuggestionsRequest,\n QuerySuggestionsResponse,\n RecommendationsRequest,\n RecommendationsResponse,\n RelatedPromptsRequest,\n RelatedPromptsResponse,\n RelatedTagsRequest,\n RelatedTagsResponse,\n SearchRequest,\n SearchResponse,\n SemanticQueriesRequest,\n SemanticQueriesResponse,\n TaggingRequest,\n XComponentsAdapter,\n} from '@empathyco/x-types'\n\n/**\n * Platform adapter interface.\n *\n * @public\n */\nexport interface PlatformAdapter extends XComponentsAdapter {\n search: ExtendableEndpointAdapter<SearchRequest, SearchResponse>\n popularSearches: ExtendableEndpointAdapter<PopularSearchesRequest, PopularSearchesResponse>\n nextQueries: ExtendableEndpointAdapter<NextQueriesRequest, NextQueriesResponse>\n recommendations: ExtendableEndpointAdapter<RecommendationsRequest, RecommendationsResponse>\n querySuggestions: ExtendableEndpointAdapter<QuerySuggestionsRequest, QuerySuggestionsResponse>\n relatedPrompts: ExtendableEndpointAdapter<RelatedPromptsRequest, RelatedPromptsResponse>\n relatedTags: ExtendableEndpointAdapter<RelatedTagsRequest, RelatedTagsResponse>\n identifierResults: ExtendableEndpointAdapter<IdentifierResultsRequest, IdentifierResultsResponse>\n semanticQueries: ExtendableEndpointAdapter<SemanticQueriesRequest, SemanticQueriesResponse>\n tagging: ExtendableEndpointAdapter<TaggingRequest, void>\n experienceControls: ExtendableEndpointAdapter<\n ExperienceControlsRequest,\n ExperienceControlsResponse\n >\n aiSuggestionsSearch: ExtendableEndpointAdapter<\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse\n >\n aiQuestions: ExtendableEndpointAdapter<AiQuestionsRequest, AiQuestionsResponse>\n aiTasks: ExtendableEndpointAdapter<AiTasksRequest, AiTasksResponse>\n}\n"]}
1
+ {"version":3,"file":"platform-adapter.types.js","sourceRoot":"","sources":["../../../src/types/platform-adapter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExtendableEndpointAdapter } from '@empathyco/x-adapter'\nimport type {\n AiQuestionsRequest,\n AiQuestionsResponse,\n AiSuggestionsRequest,\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse,\n AiTasksRequest,\n AiTasksResponse,\n ExperienceControlsRequest,\n ExperienceControlsResponse,\n IdentifierResultsRequest,\n IdentifierResultsResponse,\n NextQueriesRequest,\n NextQueriesResponse,\n PopularSearchesRequest,\n PopularSearchesResponse,\n QuerySuggestionsRequest,\n QuerySuggestionsResponse,\n RecommendationsRequest,\n RecommendationsResponse,\n RelatedPromptsRequest,\n RelatedPromptsResponse,\n RelatedTagsRequest,\n RelatedTagsResponse,\n SearchRequest,\n SearchResponse,\n SemanticQueriesRequest,\n SemanticQueriesResponse,\n TaggingRequest,\n XComponentsAdapter,\n} from '@empathyco/x-types'\n\n/**\n * Platform adapter interface.\n *\n * @public\n */\nexport interface PlatformAdapter extends XComponentsAdapter {\n search: ExtendableEndpointAdapter<SearchRequest, SearchResponse>\n popularSearches: ExtendableEndpointAdapter<PopularSearchesRequest, PopularSearchesResponse>\n nextQueries: ExtendableEndpointAdapter<NextQueriesRequest, NextQueriesResponse>\n recommendations: ExtendableEndpointAdapter<RecommendationsRequest, RecommendationsResponse>\n querySuggestions: ExtendableEndpointAdapter<QuerySuggestionsRequest, QuerySuggestionsResponse>\n relatedPrompts: ExtendableEndpointAdapter<RelatedPromptsRequest, RelatedPromptsResponse>\n relatedTags: ExtendableEndpointAdapter<RelatedTagsRequest, RelatedTagsResponse>\n identifierResults: ExtendableEndpointAdapter<IdentifierResultsRequest, IdentifierResultsResponse>\n semanticQueries: ExtendableEndpointAdapter<SemanticQueriesRequest, SemanticQueriesResponse>\n tagging: ExtendableEndpointAdapter<TaggingRequest, void>\n experienceControls: ExtendableEndpointAdapter<\n ExperienceControlsRequest,\n ExperienceControlsResponse\n >\n aiSuggestionsSearch: ExtendableEndpointAdapter<\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse\n >\n aiQuestions: ExtendableEndpointAdapter<AiQuestionsRequest, AiQuestionsResponse>\n aiTasks: ExtendableEndpointAdapter<AiTasksRequest, AiTasksResponse>\n aiSuggestions: ExtendableEndpointAdapter<AiSuggestionsRequest, Response>\n}\n"]}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./questions-request.model"), exports);
5
+ tslib_1.__exportStar(require("./suggestions-request.model"), exports);
5
6
  tslib_1.__exportStar(require("./suggestions-search-request.model"), exports);
6
7
  tslib_1.__exportStar(require("./tasks-request.model"), exports);
7
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyC;AACzC,6EAAkD;AAClD,gEAAqC","sourcesContent":["export * from './questions-request.model'\nexport * from './suggestions-search-request.model'\nexport * from './tasks-request.model'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyC;AACzC,sEAA2C;AAC3C,6EAAkD;AAClD,gEAAqC","sourcesContent":["export * from './questions-request.model'\nexport * from './suggestions-request.model'\nexport * from './suggestions-search-request.model'\nexport * from './tasks-request.model'\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=suggestions-request.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions-request.model.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/suggestions-request.model.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Request for the ai suggestions endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsRequest {\n context: {\n query?: string\n lang: string\n instance?: string\n filters?: Record<string, unknown>\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { endpointAdapterFactory, fetchRawHttpClient, interpolate } from '@empathyco/x-adapter';
2
+ import { aiSuggestionsRequestMapper } from '../../mappers';
3
+ import { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils';
4
+ /**
5
+ * Default adapter for the Overview suggestions v1 endpoint.
6
+ *
7
+ * @public
8
+ */
9
+ export const aiSuggestionsEndpointAdapter = endpointAdapterFactory({
10
+ endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/suggestions`, from),
11
+ httpClient: fetchRawHttpClient,
12
+ requestMapper: aiSuggestionsRequestMapper,
13
+ defaultRequestOptions: {
14
+ id: 'ai-overview-suggestions',
15
+ properties: {
16
+ method: 'POST',
17
+ headers: {
18
+ accept: 'text/event-stream',
19
+ 'Content-Type': 'application/json',
20
+ ...getDefaultHeaders(),
21
+ },
22
+ },
23
+ parameters: {
24
+ internal: true,
25
+ },
26
+ sendParamsInBody: true,
27
+ },
28
+ });
29
+ //# sourceMappingURL=suggestions.endpoint-adapter.js.map
@@ -0,0 +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,CACf,WAAW,CAAC,GAAG,0BAA0B,CAAC,IAAI,CAAC,qCAAqC,EAAE,IAAI,CAAC;IAC7F,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 =>\n interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/suggestions`, 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"]}
@@ -1,5 +1,6 @@
1
1
  export * from './ai/questions.endpoint-adapter';
2
2
  export * from './ai/suggestions-search.endpoint-adapter';
3
+ export * from './ai/suggestions.endpoint-adapter';
3
4
  export * from './ai/tasks.endpoint-adapter';
4
5
  export * from './experience-controls.endpoint-adapter';
5
6
  export * from './identifier-results.endpoint-adapter';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0CAA0C,CAAA;AACxD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wCAAwC,CAAA;AACtD,cAAc,uCAAuC,CAAA;AACrD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qCAAqC,CAAA;AACnD,cAAc,sCAAsC,CAAA;AACpD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,4BAA4B,CAAA","sourcesContent":["export * from './ai/questions.endpoint-adapter'\nexport * from './ai/suggestions-search.endpoint-adapter'\nexport * from './ai/tasks.endpoint-adapter'\nexport * from './experience-controls.endpoint-adapter'\nexport * from './identifier-results.endpoint-adapter'\nexport * from './next-queries.endpoint-adapter'\nexport * from './popular-searches.endpoint-adapter'\nexport * from './query-suggestions.endpoint-adapter'\nexport * from './recommendations.endpoint-adapter'\nexport * from './related-prompts.endpoint-adapter'\nexport * from './related-tags.endpoint-adapter'\nexport * from './search.endpoint-adapter'\nexport * from './semantic-queries.endpoint-adapter'\nexport * from './tagging.endpoint-adapter'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA;AAC/C,cAAc,0CAA0C,CAAA;AACxD,cAAc,mCAAmC,CAAA;AACjD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,wCAAwC,CAAA;AACtD,cAAc,uCAAuC,CAAA;AACrD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,qCAAqC,CAAA;AACnD,cAAc,sCAAsC,CAAA;AACpD,cAAc,oCAAoC,CAAA;AAClD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,2BAA2B,CAAA;AACzC,cAAc,qCAAqC,CAAA;AACnD,cAAc,4BAA4B,CAAA","sourcesContent":["export * from './ai/questions.endpoint-adapter'\nexport * from './ai/suggestions-search.endpoint-adapter'\nexport * from './ai/suggestions.endpoint-adapter'\nexport * from './ai/tasks.endpoint-adapter'\nexport * from './experience-controls.endpoint-adapter'\nexport * from './identifier-results.endpoint-adapter'\nexport * from './next-queries.endpoint-adapter'\nexport * from './popular-searches.endpoint-adapter'\nexport * from './query-suggestions.endpoint-adapter'\nexport * from './recommendations.endpoint-adapter'\nexport * from './related-prompts.endpoint-adapter'\nexport * from './related-tags.endpoint-adapter'\nexport * from './search.endpoint-adapter'\nexport * from './semantic-queries.endpoint-adapter'\nexport * from './tagging.endpoint-adapter'\n"]}
@@ -40,7 +40,7 @@ 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/overview';
44
44
  }
45
45
  if (((_b = from.extraParams) === null || _b === void 0 ? void 0 : _b.env) === 'staging') {
46
46
  return 'https://questions.staging.empathy.co/v1/overview';
@@ -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,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,kDAAkD,CAAA;IAC3D,CAAC;IACD,OAAO,qDAAqD,CAAA;AAC9D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAwB;;IAC7D,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,mDAAmD,CAAA;IAC5D,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAwB;;IACzD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,yCAAyC,CAAA;IAClD,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAwB;;IAC7D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,gDAAgD;QAClD,CAAC,CAAC,0DAA0D,CAAA;AAChE,CAAC;AAED;;;;;;;;GAQG;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'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/overview'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/overview'\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
+ {"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,qDAAqD,CAAA;IAC9D,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,kDAAkD,CAAA;IAC3D,CAAC;IACD,OAAO,qDAAqD,CAAA;AAC9D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAwB;;IAC7D,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,mDAAmD,CAAA;IAC5D,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAwB;;IACzD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM,EAAE,CAAC;QACrC,OAAO,4CAA4C,CAAA;IACrD,CAAC;IACD,IAAI,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,SAAS,EAAE,CAAC;QACxC,OAAO,yCAAyC,CAAA;IAClD,CAAC;IACD,OAAO,sDAAsD,CAAA;AAC/D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAwB;;IAC7D,OAAO,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,GAAG,MAAK,MAAM;QACrC,CAAC,CAAC,gDAAgD;QAClD,CAAC,CAAC,0DAA0D,CAAA;AAChE,CAAC;AAED;;;;;;;;GAQG;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/overview'\n }\n if (from.extraParams?.env === 'staging') {\n return 'https://questions.staging.empathy.co/v1/overview'\n }\n return 'https://api.{extraParams.env(.)}empathy.co/overview'\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,4 +1,5 @@
1
1
  export * from './questions-request.mapper';
2
+ export * from './suggestions-request.mapper';
2
3
  export * from './suggestions-search-request.mapper';
3
4
  export * from './tasks-request.mapper';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,wBAAwB,CAAA","sourcesContent":["export * from './questions-request.mapper'\nexport * from './suggestions-search-request.mapper'\nexport * from './tasks-request.mapper'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,qCAAqC,CAAA;AACnD,cAAc,wBAAwB,CAAA","sourcesContent":["export * from './questions-request.mapper'\nexport * from './suggestions-request.mapper'\nexport * from './suggestions-search-request.mapper'\nexport * from './tasks-request.mapper'\n"]}
@@ -0,0 +1,9 @@
1
+ import { schemaMapperFactory } from '@empathyco/x-adapter';
2
+ import { aiSuggestionsRequestSchema } from '../../../schemas/requests/ai/suggestions-request.schema';
3
+ /**
4
+ * Default implementation for the aiSuggestionsRequestMapper.
5
+ *
6
+ * @public
7
+ */
8
+ export const aiSuggestionsRequestMapper = schemaMapperFactory(aiSuggestionsRequestSchema);
9
+ //# sourceMappingURL=suggestions-request.mapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions-request.mapper.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/suggestions-request.mapper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,yDAAyD,CAAA;AAEpG;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAG3D,0BAA0B,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsRequest } from '../../../types'\nimport { schemaMapperFactory } from '@empathyco/x-adapter'\nimport { aiSuggestionsRequestSchema } from '../../../schemas/requests/ai/suggestions-request.schema'\n\n/**\n * Default implementation for the aiSuggestionsRequestMapper.\n *\n * @public\n */\nexport const aiSuggestionsRequestMapper = schemaMapperFactory<\n AiSuggestionsRequest,\n PlatformAiSuggestionsRequest\n>(aiSuggestionsRequestSchema)\n"]}
@@ -1,5 +1,6 @@
1
1
  import { aiQuestionsEndpointAdapter } from './endpoint-adapters/ai/questions.endpoint-adapter';
2
2
  import { aiSuggestionsSearchEndpointAdapter } from './endpoint-adapters/ai/suggestions-search.endpoint-adapter';
3
+ import { aiSuggestionsEndpointAdapter } from './endpoint-adapters/ai/suggestions.endpoint-adapter';
3
4
  import { aiTasksEndpointAdapter } from './endpoint-adapters/ai/tasks.endpoint-adapter';
4
5
  import { experienceControlsEndpointAdapter } from './endpoint-adapters/experience-controls.endpoint-adapter';
5
6
  import { identifierResultsEndpointAdapter } from './endpoint-adapters/identifier-results.endpoint-adapter';
@@ -29,6 +30,7 @@ export const platformAdapter = {
29
30
  tagging: taggingEndpointAdapter,
30
31
  semanticQueries: semanticQueriesEndpointAdapter,
31
32
  experienceControls: experienceControlsEndpointAdapter,
33
+ aiSuggestions: aiSuggestionsEndpointAdapter,
32
34
  aiSuggestionsSearch: aiSuggestionsSearchEndpointAdapter,
33
35
  aiQuestions: aiQuestionsEndpointAdapter,
34
36
  aiTasks: aiTasksEndpointAdapter,
@@ -1 +1 @@
1
- {"version":3,"file":"platform.adapter.js","sourceRoot":"","sources":["../../src/platform.adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAC9F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4DAA4D,CAAA;AAC/G,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,0DAA0D,CAAA;AAC5G,OAAO,EAAE,gCAAgC,EAAE,MAAM,yDAAyD,CAAA;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAC9F,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAA;AACtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAA;AACxG,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAA;AACrG,OAAO,EAAE,6BAA6B,EAAE,MAAM,sDAAsD,CAAA;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAA;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAA;AACrF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,MAAM,EAAE,qBAAqB;IAC7B,eAAe,EAAE,8BAA8B;IAC/C,eAAe,EAAE,8BAA8B;IAC/C,WAAW,EAAE,0BAA0B;IACvC,gBAAgB,EAAE,+BAA+B;IACjD,cAAc,EAAE,6BAA6B;IAC7C,WAAW,EAAE,0BAA0B;IACvC,iBAAiB,EAAE,gCAAgC;IACnD,OAAO,EAAE,sBAAsB;IAC/B,eAAe,EAAE,8BAA8B;IAC/C,kBAAkB,EAAE,iCAAiC;IACrD,mBAAmB,EAAE,kCAAkC;IACvD,WAAW,EAAE,0BAA0B;IACvC,OAAO,EAAE,sBAAsB;CAChC,CAAA","sourcesContent":["import type { PlatformAdapter } from './types/platform-adapter.types'\nimport { aiQuestionsEndpointAdapter } from './endpoint-adapters/ai/questions.endpoint-adapter'\nimport { aiSuggestionsSearchEndpointAdapter } from './endpoint-adapters/ai/suggestions-search.endpoint-adapter'\nimport { aiTasksEndpointAdapter } from './endpoint-adapters/ai/tasks.endpoint-adapter'\nimport { experienceControlsEndpointAdapter } from './endpoint-adapters/experience-controls.endpoint-adapter'\nimport { identifierResultsEndpointAdapter } from './endpoint-adapters/identifier-results.endpoint-adapter'\nimport { nextQueriesEndpointAdapter } from './endpoint-adapters/next-queries.endpoint-adapter'\nimport { popularSearchesEndpointAdapter } from './endpoint-adapters/popular-searches.endpoint-adapter'\nimport { querySuggestionsEndpointAdapter } from './endpoint-adapters/query-suggestions.endpoint-adapter'\nimport { recommendationsEndpointAdapter } from './endpoint-adapters/recommendations.endpoint-adapter'\nimport { relatedPromptsEndpointAdapter } from './endpoint-adapters/related-prompts.endpoint-adapter'\nimport { relatedTagsEndpointAdapter } from './endpoint-adapters/related-tags.endpoint-adapter'\nimport { searchEndpointAdapter } from './endpoint-adapters/search.endpoint-adapter'\nimport { semanticQueriesEndpointAdapter } from './endpoint-adapters/semantic-queries.endpoint-adapter'\nimport { taggingEndpointAdapter } from './endpoint-adapters/tagging.endpoint-adapter'\n/**\n * Default implementation for the PlatformAdapter.\n *\n * @public\n */\nexport const platformAdapter: PlatformAdapter = {\n search: searchEndpointAdapter,\n popularSearches: popularSearchesEndpointAdapter,\n recommendations: recommendationsEndpointAdapter,\n nextQueries: nextQueriesEndpointAdapter,\n querySuggestions: querySuggestionsEndpointAdapter,\n relatedPrompts: relatedPromptsEndpointAdapter,\n relatedTags: relatedTagsEndpointAdapter,\n identifierResults: identifierResultsEndpointAdapter,\n tagging: taggingEndpointAdapter,\n semanticQueries: semanticQueriesEndpointAdapter,\n experienceControls: experienceControlsEndpointAdapter,\n aiSuggestionsSearch: aiSuggestionsSearchEndpointAdapter,\n aiQuestions: aiQuestionsEndpointAdapter,\n aiTasks: aiTasksEndpointAdapter,\n}\n"]}
1
+ {"version":3,"file":"platform.adapter.js","sourceRoot":"","sources":["../../src/platform.adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAC9F,OAAO,EAAE,kCAAkC,EAAE,MAAM,4DAA4D,CAAA;AAC/G,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAA;AAClG,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AACtF,OAAO,EAAE,iCAAiC,EAAE,MAAM,0DAA0D,CAAA;AAC5G,OAAO,EAAE,gCAAgC,EAAE,MAAM,yDAAyD,CAAA;AAC1G,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAC9F,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAA;AACtG,OAAO,EAAE,+BAA+B,EAAE,MAAM,wDAAwD,CAAA;AACxG,OAAO,EAAE,8BAA8B,EAAE,MAAM,sDAAsD,CAAA;AACrG,OAAO,EAAE,6BAA6B,EAAE,MAAM,sDAAsD,CAAA;AACpG,OAAO,EAAE,0BAA0B,EAAE,MAAM,mDAAmD,CAAA;AAC9F,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAA;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,uDAAuD,CAAA;AACtG,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAA;AACrF;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,MAAM,EAAE,qBAAqB;IAC7B,eAAe,EAAE,8BAA8B;IAC/C,eAAe,EAAE,8BAA8B;IAC/C,WAAW,EAAE,0BAA0B;IACvC,gBAAgB,EAAE,+BAA+B;IACjD,cAAc,EAAE,6BAA6B;IAC7C,WAAW,EAAE,0BAA0B;IACvC,iBAAiB,EAAE,gCAAgC;IACnD,OAAO,EAAE,sBAAsB;IAC/B,eAAe,EAAE,8BAA8B;IAC/C,kBAAkB,EAAE,iCAAiC;IACrD,aAAa,EAAE,4BAA4B;IAC3C,mBAAmB,EAAE,kCAAkC;IACvD,WAAW,EAAE,0BAA0B;IACvC,OAAO,EAAE,sBAAsB;CAChC,CAAA","sourcesContent":["import type { PlatformAdapter } from './types/platform-adapter.types'\nimport { aiQuestionsEndpointAdapter } from './endpoint-adapters/ai/questions.endpoint-adapter'\nimport { aiSuggestionsSearchEndpointAdapter } from './endpoint-adapters/ai/suggestions-search.endpoint-adapter'\nimport { aiSuggestionsEndpointAdapter } from './endpoint-adapters/ai/suggestions.endpoint-adapter'\nimport { aiTasksEndpointAdapter } from './endpoint-adapters/ai/tasks.endpoint-adapter'\nimport { experienceControlsEndpointAdapter } from './endpoint-adapters/experience-controls.endpoint-adapter'\nimport { identifierResultsEndpointAdapter } from './endpoint-adapters/identifier-results.endpoint-adapter'\nimport { nextQueriesEndpointAdapter } from './endpoint-adapters/next-queries.endpoint-adapter'\nimport { popularSearchesEndpointAdapter } from './endpoint-adapters/popular-searches.endpoint-adapter'\nimport { querySuggestionsEndpointAdapter } from './endpoint-adapters/query-suggestions.endpoint-adapter'\nimport { recommendationsEndpointAdapter } from './endpoint-adapters/recommendations.endpoint-adapter'\nimport { relatedPromptsEndpointAdapter } from './endpoint-adapters/related-prompts.endpoint-adapter'\nimport { relatedTagsEndpointAdapter } from './endpoint-adapters/related-tags.endpoint-adapter'\nimport { searchEndpointAdapter } from './endpoint-adapters/search.endpoint-adapter'\nimport { semanticQueriesEndpointAdapter } from './endpoint-adapters/semantic-queries.endpoint-adapter'\nimport { taggingEndpointAdapter } from './endpoint-adapters/tagging.endpoint-adapter'\n/**\n * Default implementation for the PlatformAdapter.\n *\n * @public\n */\nexport const platformAdapter: PlatformAdapter = {\n search: searchEndpointAdapter,\n popularSearches: popularSearchesEndpointAdapter,\n recommendations: recommendationsEndpointAdapter,\n nextQueries: nextQueriesEndpointAdapter,\n querySuggestions: querySuggestionsEndpointAdapter,\n relatedPrompts: relatedPromptsEndpointAdapter,\n relatedTags: relatedTagsEndpointAdapter,\n identifierResults: identifierResultsEndpointAdapter,\n tagging: taggingEndpointAdapter,\n semanticQueries: semanticQueriesEndpointAdapter,\n experienceControls: experienceControlsEndpointAdapter,\n aiSuggestions: aiSuggestionsEndpointAdapter,\n aiSuggestionsSearch: aiSuggestionsSearchEndpointAdapter,\n aiQuestions: aiQuestionsEndpointAdapter,\n aiTasks: aiTasksEndpointAdapter,\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import { createMutableSchema } from '@empathyco/x-adapter';
2
+ /**
3
+ * Default implementation for the aiSuggestionsRequestSchema.
4
+ *
5
+ * @public
6
+ */
7
+ export const aiSuggestionsRequestSchema = createMutableSchema({
8
+ context: ({ query, extraParams }) => {
9
+ var _a;
10
+ return ({
11
+ query,
12
+ lang: (_a = extraParams === null || extraParams === void 0 ? void 0 : extraParams.lang) !== null && _a !== void 0 ? _a : '',
13
+ instance: extraParams === null || extraParams === void 0 ? void 0 : extraParams.instance,
14
+ filters: extraParams === null || extraParams === void 0 ? void 0 : extraParams.filters,
15
+ });
16
+ },
17
+ });
18
+ //# sourceMappingURL=suggestions-request.schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions-request.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/suggestions-request.schema.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAG3D;IACA,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE;;QAAC,OAAA,CAAC;YACpC,KAAK;YACL,IAAI,EAAE,MAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,IAA2B,mCAAI,EAAE;YACrD,QAAQ,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAA8B;YACrD,OAAO,EAAE,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAA8C;SACrE,CAAC,CAAA;KAAA;CACH,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsRequest } from '../../../types'\nimport { createMutableSchema } from '@empathyco/x-adapter'\n\n/**\n * Default implementation for the aiSuggestionsRequestSchema.\n *\n * @public\n */\nexport const aiSuggestionsRequestSchema = createMutableSchema<\n AiSuggestionsRequest,\n PlatformAiSuggestionsRequest\n>({\n context: ({ query, extraParams }) => ({\n query,\n lang: (extraParams?.lang as string | undefined) ?? '',\n instance: extraParams?.instance as string | undefined,\n filters: extraParams?.filters as Record<string, unknown> | undefined,\n }),\n})\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"platform-adapter.types.js","sourceRoot":"","sources":["../../../src/types/platform-adapter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExtendableEndpointAdapter } from '@empathyco/x-adapter'\nimport type {\n AiQuestionsRequest,\n AiQuestionsResponse,\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse,\n AiTasksRequest,\n AiTasksResponse,\n ExperienceControlsRequest,\n ExperienceControlsResponse,\n IdentifierResultsRequest,\n IdentifierResultsResponse,\n NextQueriesRequest,\n NextQueriesResponse,\n PopularSearchesRequest,\n PopularSearchesResponse,\n QuerySuggestionsRequest,\n QuerySuggestionsResponse,\n RecommendationsRequest,\n RecommendationsResponse,\n RelatedPromptsRequest,\n RelatedPromptsResponse,\n RelatedTagsRequest,\n RelatedTagsResponse,\n SearchRequest,\n SearchResponse,\n SemanticQueriesRequest,\n SemanticQueriesResponse,\n TaggingRequest,\n XComponentsAdapter,\n} from '@empathyco/x-types'\n\n/**\n * Platform adapter interface.\n *\n * @public\n */\nexport interface PlatformAdapter extends XComponentsAdapter {\n search: ExtendableEndpointAdapter<SearchRequest, SearchResponse>\n popularSearches: ExtendableEndpointAdapter<PopularSearchesRequest, PopularSearchesResponse>\n nextQueries: ExtendableEndpointAdapter<NextQueriesRequest, NextQueriesResponse>\n recommendations: ExtendableEndpointAdapter<RecommendationsRequest, RecommendationsResponse>\n querySuggestions: ExtendableEndpointAdapter<QuerySuggestionsRequest, QuerySuggestionsResponse>\n relatedPrompts: ExtendableEndpointAdapter<RelatedPromptsRequest, RelatedPromptsResponse>\n relatedTags: ExtendableEndpointAdapter<RelatedTagsRequest, RelatedTagsResponse>\n identifierResults: ExtendableEndpointAdapter<IdentifierResultsRequest, IdentifierResultsResponse>\n semanticQueries: ExtendableEndpointAdapter<SemanticQueriesRequest, SemanticQueriesResponse>\n tagging: ExtendableEndpointAdapter<TaggingRequest, void>\n experienceControls: ExtendableEndpointAdapter<\n ExperienceControlsRequest,\n ExperienceControlsResponse\n >\n aiSuggestionsSearch: ExtendableEndpointAdapter<\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse\n >\n aiQuestions: ExtendableEndpointAdapter<AiQuestionsRequest, AiQuestionsResponse>\n aiTasks: ExtendableEndpointAdapter<AiTasksRequest, AiTasksResponse>\n}\n"]}
1
+ {"version":3,"file":"platform-adapter.types.js","sourceRoot":"","sources":["../../../src/types/platform-adapter.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ExtendableEndpointAdapter } from '@empathyco/x-adapter'\nimport type {\n AiQuestionsRequest,\n AiQuestionsResponse,\n AiSuggestionsRequest,\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse,\n AiTasksRequest,\n AiTasksResponse,\n ExperienceControlsRequest,\n ExperienceControlsResponse,\n IdentifierResultsRequest,\n IdentifierResultsResponse,\n NextQueriesRequest,\n NextQueriesResponse,\n PopularSearchesRequest,\n PopularSearchesResponse,\n QuerySuggestionsRequest,\n QuerySuggestionsResponse,\n RecommendationsRequest,\n RecommendationsResponse,\n RelatedPromptsRequest,\n RelatedPromptsResponse,\n RelatedTagsRequest,\n RelatedTagsResponse,\n SearchRequest,\n SearchResponse,\n SemanticQueriesRequest,\n SemanticQueriesResponse,\n TaggingRequest,\n XComponentsAdapter,\n} from '@empathyco/x-types'\n\n/**\n * Platform adapter interface.\n *\n * @public\n */\nexport interface PlatformAdapter extends XComponentsAdapter {\n search: ExtendableEndpointAdapter<SearchRequest, SearchResponse>\n popularSearches: ExtendableEndpointAdapter<PopularSearchesRequest, PopularSearchesResponse>\n nextQueries: ExtendableEndpointAdapter<NextQueriesRequest, NextQueriesResponse>\n recommendations: ExtendableEndpointAdapter<RecommendationsRequest, RecommendationsResponse>\n querySuggestions: ExtendableEndpointAdapter<QuerySuggestionsRequest, QuerySuggestionsResponse>\n relatedPrompts: ExtendableEndpointAdapter<RelatedPromptsRequest, RelatedPromptsResponse>\n relatedTags: ExtendableEndpointAdapter<RelatedTagsRequest, RelatedTagsResponse>\n identifierResults: ExtendableEndpointAdapter<IdentifierResultsRequest, IdentifierResultsResponse>\n semanticQueries: ExtendableEndpointAdapter<SemanticQueriesRequest, SemanticQueriesResponse>\n tagging: ExtendableEndpointAdapter<TaggingRequest, void>\n experienceControls: ExtendableEndpointAdapter<\n ExperienceControlsRequest,\n ExperienceControlsResponse\n >\n aiSuggestionsSearch: ExtendableEndpointAdapter<\n AiSuggestionsSearchRequest,\n AiSuggestionsSearchResponse\n >\n aiQuestions: ExtendableEndpointAdapter<AiQuestionsRequest, AiQuestionsResponse>\n aiTasks: ExtendableEndpointAdapter<AiTasksRequest, AiTasksResponse>\n aiSuggestions: ExtendableEndpointAdapter<AiSuggestionsRequest, Response>\n}\n"]}
@@ -1,4 +1,5 @@
1
1
  export * from './questions-request.model';
2
+ export * from './suggestions-request.model';
2
3
  export * from './suggestions-search-request.model';
3
4
  export * from './tasks-request.model';
4
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,oCAAoC,CAAA;AAClD,cAAc,uBAAuB,CAAA","sourcesContent":["export * from './questions-request.model'\nexport * from './suggestions-search-request.model'\nexport * from './tasks-request.model'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,oCAAoC,CAAA;AAClD,cAAc,uBAAuB,CAAA","sourcesContent":["export * from './questions-request.model'\nexport * from './suggestions-request.model'\nexport * from './suggestions-search-request.model'\nexport * from './tasks-request.model'\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=suggestions-request.model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suggestions-request.model.js","sourceRoot":"","sources":["../../../../../src/types/requests/ai/suggestions-request.model.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Request for the ai suggestions endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsRequest {\n context: {\n query?: string\n lang: string\n instance?: string\n filters?: Record<string, unknown>\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ import type { AiSuggestionsRequest } from '@empathyco/x-types';
2
+ /**
3
+ * Default adapter for the Overview suggestions v1 endpoint.
4
+ *
5
+ * @public
6
+ */
7
+ export declare const aiSuggestionsEndpointAdapter: import("@empathyco/x-adapter").ExtendableEndpointAdapter<AiSuggestionsRequest, Response>;
@@ -1,5 +1,6 @@
1
1
  export * from './ai/questions.endpoint-adapter';
2
2
  export * from './ai/suggestions-search.endpoint-adapter';
3
+ export * from './ai/suggestions.endpoint-adapter';
3
4
  export * from './ai/tasks.endpoint-adapter';
4
5
  export * from './experience-controls.endpoint-adapter';
5
6
  export * from './identifier-results.endpoint-adapter';
@@ -1,3 +1,4 @@
1
1
  export * from './questions-request.mapper';
2
+ export * from './suggestions-request.mapper';
2
3
  export * from './suggestions-search-request.mapper';
3
4
  export * from './tasks-request.mapper';
@@ -0,0 +1,8 @@
1
+ import type { AiSuggestionsRequest } from '@empathyco/x-types';
2
+ import type { PlatformAiSuggestionsRequest } from '../../../types';
3
+ /**
4
+ * Default implementation for the aiSuggestionsRequestMapper.
5
+ *
6
+ * @public
7
+ */
8
+ export declare const aiSuggestionsRequestMapper: import("@empathyco/x-adapter").Mapper<AiSuggestionsRequest, PlatformAiSuggestionsRequest>;
@@ -0,0 +1,8 @@
1
+ import type { AiSuggestionsRequest } from '@empathyco/x-types';
2
+ import type { PlatformAiSuggestionsRequest } from '../../../types';
3
+ /**
4
+ * Default implementation for the aiSuggestionsRequestSchema.
5
+ *
6
+ * @public
7
+ */
8
+ export declare const aiSuggestionsRequestSchema: import("@empathyco/x-adapter").MutableSchema<AiSuggestionsRequest, PlatformAiSuggestionsRequest>;
@@ -1,5 +1,5 @@
1
1
  import type { ExtendableEndpointAdapter } from '@empathyco/x-adapter';
2
- import type { AiQuestionsRequest, AiQuestionsResponse, AiSuggestionsSearchRequest, AiSuggestionsSearchResponse, AiTasksRequest, AiTasksResponse, ExperienceControlsRequest, ExperienceControlsResponse, IdentifierResultsRequest, IdentifierResultsResponse, NextQueriesRequest, NextQueriesResponse, PopularSearchesRequest, PopularSearchesResponse, QuerySuggestionsRequest, QuerySuggestionsResponse, RecommendationsRequest, RecommendationsResponse, RelatedPromptsRequest, RelatedPromptsResponse, RelatedTagsRequest, RelatedTagsResponse, SearchRequest, SearchResponse, SemanticQueriesRequest, SemanticQueriesResponse, TaggingRequest, XComponentsAdapter } from '@empathyco/x-types';
2
+ import type { AiQuestionsRequest, AiQuestionsResponse, AiSuggestionsRequest, AiSuggestionsSearchRequest, AiSuggestionsSearchResponse, AiTasksRequest, AiTasksResponse, ExperienceControlsRequest, ExperienceControlsResponse, IdentifierResultsRequest, IdentifierResultsResponse, NextQueriesRequest, NextQueriesResponse, PopularSearchesRequest, PopularSearchesResponse, QuerySuggestionsRequest, QuerySuggestionsResponse, RecommendationsRequest, RecommendationsResponse, RelatedPromptsRequest, RelatedPromptsResponse, RelatedTagsRequest, RelatedTagsResponse, SearchRequest, SearchResponse, SemanticQueriesRequest, SemanticQueriesResponse, TaggingRequest, XComponentsAdapter } from '@empathyco/x-types';
3
3
  /**
4
4
  * Platform adapter interface.
5
5
  *
@@ -20,4 +20,5 @@ export interface PlatformAdapter extends XComponentsAdapter {
20
20
  aiSuggestionsSearch: ExtendableEndpointAdapter<AiSuggestionsSearchRequest, AiSuggestionsSearchResponse>;
21
21
  aiQuestions: ExtendableEndpointAdapter<AiQuestionsRequest, AiQuestionsResponse>;
22
22
  aiTasks: ExtendableEndpointAdapter<AiTasksRequest, AiTasksResponse>;
23
+ aiSuggestions: ExtendableEndpointAdapter<AiSuggestionsRequest, Response>;
23
24
  }
@@ -1,3 +1,4 @@
1
1
  export * from './questions-request.model';
2
+ export * from './suggestions-request.model';
2
3
  export * from './suggestions-search-request.model';
3
4
  export * from './tasks-request.model';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Request for the ai suggestions endpoint.
3
+ *
4
+ * @public
5
+ */
6
+ export interface PlatformAiSuggestionsRequest {
7
+ context: {
8
+ query?: string;
9
+ lang: string;
10
+ instance?: string;
11
+ filters?: Record<string, unknown>;
12
+ };
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empathyco/x-adapter-platform",
3
- "version": "1.1.0-alpha.29",
3
+ "version": "1.1.0-alpha.30",
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",
@@ -45,8 +45,8 @@
45
45
  "prepublishOnly": "pnpm run build"
46
46
  },
47
47
  "dependencies": {
48
- "@empathyco/x-adapter": "^8.1.0-alpha.8",
49
- "@empathyco/x-types": "^10.1.0-alpha.22",
48
+ "@empathyco/x-adapter": "^8.1.0-alpha.9",
49
+ "@empathyco/x-types": "^10.1.0-alpha.23",
50
50
  "@empathyco/x-utils": "^1.0.3-alpha.8",
51
51
  "tslib": "~2.6.0"
52
52
  },
@@ -63,5 +63,5 @@
63
63
  "publishConfig": {
64
64
  "access": "public"
65
65
  },
66
- "gitHead": "f0730481a378298b7724245847f31e488f740fef"
66
+ "gitHead": "7045b8448848d85e2cb09fca9e3abdc35c3b2904"
67
67
  }
@@ -522,6 +522,106 @@
522
522
  "endIndex": 8
523
523
  }
524
524
  },
525
+ {
526
+ "kind": "Variable",
527
+ "canonicalReference": "@empathyco/x-adapter-platform!aiSuggestionsEndpointAdapter:var",
528
+ "docComment": "/**\n * Default adapter for the Overview suggestions v1 endpoint.\n *\n * @public\n */\n",
529
+ "excerptTokens": [
530
+ {
531
+ "kind": "Content",
532
+ "text": "aiSuggestionsEndpointAdapter: "
533
+ },
534
+ {
535
+ "kind": "Content",
536
+ "text": "import(\"@empathyco/x-adapter\")."
537
+ },
538
+ {
539
+ "kind": "Reference",
540
+ "text": "ExtendableEndpointAdapter",
541
+ "canonicalReference": "@empathyco/x-adapter!ExtendableEndpointAdapter:interface"
542
+ },
543
+ {
544
+ "kind": "Content",
545
+ "text": "<"
546
+ },
547
+ {
548
+ "kind": "Reference",
549
+ "text": "AiSuggestionsRequest",
550
+ "canonicalReference": "@empathyco/x-adapter-platform!AiSuggestionsRequest:interface"
551
+ },
552
+ {
553
+ "kind": "Content",
554
+ "text": ", "
555
+ },
556
+ {
557
+ "kind": "Reference",
558
+ "text": "Response",
559
+ "canonicalReference": "!Response:interface"
560
+ },
561
+ {
562
+ "kind": "Content",
563
+ "text": ">"
564
+ }
565
+ ],
566
+ "fileUrlPath": "dist/types/endpoint-adapters/ai/suggestions.endpoint-adapter.d.ts",
567
+ "isReadonly": true,
568
+ "releaseTag": "Public",
569
+ "name": "aiSuggestionsEndpointAdapter",
570
+ "variableTypeTokenRange": {
571
+ "startIndex": 1,
572
+ "endIndex": 8
573
+ }
574
+ },
575
+ {
576
+ "kind": "Variable",
577
+ "canonicalReference": "@empathyco/x-adapter-platform!aiSuggestionsRequestMapper:var",
578
+ "docComment": "/**\n * Default implementation for the aiSuggestionsRequestMapper.\n *\n * @public\n */\n",
579
+ "excerptTokens": [
580
+ {
581
+ "kind": "Content",
582
+ "text": "aiSuggestionsRequestMapper: "
583
+ },
584
+ {
585
+ "kind": "Content",
586
+ "text": "import(\"@empathyco/x-adapter\")."
587
+ },
588
+ {
589
+ "kind": "Reference",
590
+ "text": "Mapper",
591
+ "canonicalReference": "@empathyco/x-adapter!Mapper:type"
592
+ },
593
+ {
594
+ "kind": "Content",
595
+ "text": "<"
596
+ },
597
+ {
598
+ "kind": "Reference",
599
+ "text": "AiSuggestionsRequest",
600
+ "canonicalReference": "@empathyco/x-adapter-platform!AiSuggestionsRequest:interface"
601
+ },
602
+ {
603
+ "kind": "Content",
604
+ "text": ", "
605
+ },
606
+ {
607
+ "kind": "Reference",
608
+ "text": "PlatformAiSuggestionsRequest",
609
+ "canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionsRequest:interface"
610
+ },
611
+ {
612
+ "kind": "Content",
613
+ "text": ">"
614
+ }
615
+ ],
616
+ "fileUrlPath": "dist/types/mappers/requests/ai/suggestions-request.mapper.d.ts",
617
+ "isReadonly": true,
618
+ "releaseTag": "Public",
619
+ "name": "aiSuggestionsRequestMapper",
620
+ "variableTypeTokenRange": {
621
+ "startIndex": 1,
622
+ "endIndex": 8
623
+ }
624
+ },
525
625
  {
526
626
  "kind": "Variable",
527
627
  "canonicalReference": "@empathyco/x-adapter-platform!aiSuggestionsSearchEndpointAdapter:var",
@@ -2581,6 +2681,56 @@
2581
2681
  "endIndex": 7
2582
2682
  }
2583
2683
  },
2684
+ {
2685
+ "kind": "PropertySignature",
2686
+ "canonicalReference": "@empathyco/x-adapter-platform!PlatformAdapter#aiSuggestions:member",
2687
+ "docComment": "",
2688
+ "excerptTokens": [
2689
+ {
2690
+ "kind": "Content",
2691
+ "text": "aiSuggestions: "
2692
+ },
2693
+ {
2694
+ "kind": "Reference",
2695
+ "text": "ExtendableEndpointAdapter",
2696
+ "canonicalReference": "@empathyco/x-adapter!ExtendableEndpointAdapter:interface"
2697
+ },
2698
+ {
2699
+ "kind": "Content",
2700
+ "text": "<"
2701
+ },
2702
+ {
2703
+ "kind": "Reference",
2704
+ "text": "AiSuggestionsRequest",
2705
+ "canonicalReference": "@empathyco/x-adapter-platform!AiSuggestionsRequest:interface"
2706
+ },
2707
+ {
2708
+ "kind": "Content",
2709
+ "text": ", "
2710
+ },
2711
+ {
2712
+ "kind": "Reference",
2713
+ "text": "Response",
2714
+ "canonicalReference": "!Response:interface"
2715
+ },
2716
+ {
2717
+ "kind": "Content",
2718
+ "text": ">"
2719
+ },
2720
+ {
2721
+ "kind": "Content",
2722
+ "text": ";"
2723
+ }
2724
+ ],
2725
+ "isReadonly": false,
2726
+ "isOptional": false,
2727
+ "releaseTag": "Public",
2728
+ "name": "aiSuggestions",
2729
+ "propertyTypeTokenRange": {
2730
+ "startIndex": 1,
2731
+ "endIndex": 7
2732
+ }
2733
+ },
2584
2734
  {
2585
2735
  "kind": "PropertySignature",
2586
2736
  "canonicalReference": "@empathyco/x-adapter-platform!PlatformAdapter#aiSuggestionsSearch:member",
@@ -3416,6 +3566,60 @@
3416
3566
  ],
3417
3567
  "extendsTokenRanges": []
3418
3568
  },
3569
+ {
3570
+ "kind": "Interface",
3571
+ "canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionsRequest:interface",
3572
+ "docComment": "/**\n * Request for the ai suggestions endpoint.\n *\n * @public\n */\n",
3573
+ "excerptTokens": [
3574
+ {
3575
+ "kind": "Content",
3576
+ "text": "export interface PlatformAiSuggestionsRequest "
3577
+ }
3578
+ ],
3579
+ "fileUrlPath": "dist/types/types/requests/ai/suggestions-request.model.d.ts",
3580
+ "releaseTag": "Public",
3581
+ "name": "PlatformAiSuggestionsRequest",
3582
+ "preserveMemberOrder": false,
3583
+ "members": [
3584
+ {
3585
+ "kind": "PropertySignature",
3586
+ "canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionsRequest#context:member",
3587
+ "docComment": "",
3588
+ "excerptTokens": [
3589
+ {
3590
+ "kind": "Content",
3591
+ "text": "context: "
3592
+ },
3593
+ {
3594
+ "kind": "Content",
3595
+ "text": "{\n query?: string;\n lang: string;\n instance?: string;\n filters?: "
3596
+ },
3597
+ {
3598
+ "kind": "Reference",
3599
+ "text": "Record",
3600
+ "canonicalReference": "!Record:type"
3601
+ },
3602
+ {
3603
+ "kind": "Content",
3604
+ "text": "<string, unknown>;\n }"
3605
+ },
3606
+ {
3607
+ "kind": "Content",
3608
+ "text": ";"
3609
+ }
3610
+ ],
3611
+ "isReadonly": false,
3612
+ "isOptional": false,
3613
+ "releaseTag": "Public",
3614
+ "name": "context",
3615
+ "propertyTypeTokenRange": {
3616
+ "startIndex": 1,
3617
+ "endIndex": 4
3618
+ }
3619
+ }
3620
+ ],
3621
+ "extendsTokenRanges": []
3622
+ },
3419
3623
  {
3420
3624
  "kind": "Interface",
3421
3625
  "canonicalReference": "@empathyco/x-adapter-platform!PlatformAiSuggestionsSearchRequest:interface",
@@ -57,6 +57,14 @@ export const aiQuestionsSchema: MutableSchema<PlatformAiQuestionsResponse, AiQue
57
57
  // @public
58
58
  export const aiSuggestionSearchSchema: MutableSchema<PlatformAiSuggestionSearch, AiSuggestionSearch>;
59
59
 
60
+ // Warning: (ae-forgotten-export) The symbol "AiSuggestionsRequest" needs to be exported by the entry point index.d.ts
61
+ //
62
+ // @public
63
+ export const aiSuggestionsEndpointAdapter: ExtendableEndpointAdapter<AiSuggestionsRequest, Response>;
64
+
65
+ // @public
66
+ export const aiSuggestionsRequestMapper: Mapper<AiSuggestionsRequest, PlatformAiSuggestionsRequest>;
67
+
60
68
  // Warning: (ae-forgotten-export) The symbol "AiSuggestionsSearchRequest" needs to be exported by the entry point index.d.ts
61
69
  // Warning: (ae-forgotten-export) The symbol "AiSuggestionsSearchResponse" needs to be exported by the entry point index.d.ts
62
70
  //
@@ -225,6 +233,8 @@ export interface PlatformAdapter extends XComponentsAdapter {
225
233
  // (undocumented)
226
234
  aiQuestions: ExtendableEndpointAdapter<AiQuestionsRequest, AiQuestionsResponse>;
227
235
  // (undocumented)
236
+ aiSuggestions: ExtendableEndpointAdapter<AiSuggestionsRequest, Response>;
237
+ // (undocumented)
228
238
  aiSuggestionsSearch: ExtendableEndpointAdapter<AiSuggestionsSearchRequest, AiSuggestionsSearchResponse>;
229
239
  // (undocumented)
230
240
  aiTasks: ExtendableEndpointAdapter<AiTasksRequest, AiTasksResponse>;
@@ -299,6 +309,17 @@ export interface PlatformAiSuggestionSearch {
299
309
  results: PlatformResult[];
300
310
  }
301
311
 
312
+ // @public
313
+ export interface PlatformAiSuggestionsRequest {
314
+ // (undocumented)
315
+ context: {
316
+ query?: string;
317
+ lang: string;
318
+ instance?: string;
319
+ filters?: Record<string, unknown>;
320
+ };
321
+ }
322
+
302
323
  // @public
303
324
  export interface PlatformAiSuggestionsSearchRequest {
304
325
  // (undocumented)