@empathyco/x-adapter-platform 1.1.0-alpha.28 → 1.1.0-alpha.29
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 +31 -0
- package/dist/cjs/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js.map +1 -0
- package/dist/cjs/endpoint-adapters/index.js +1 -0
- package/dist/cjs/endpoint-adapters/index.js.map +1 -1
- package/dist/cjs/endpoint-adapters/utils.js +20 -0
- package/dist/cjs/endpoint-adapters/utils.js.map +1 -1
- package/dist/cjs/mappers/requests/ai/index.js +1 -0
- package/dist/cjs/mappers/requests/ai/index.js.map +1 -1
- package/dist/cjs/mappers/requests/ai/suggestions-search-request.mapper.js +12 -0
- package/dist/cjs/mappers/requests/ai/suggestions-search-request.mapper.js.map +1 -0
- package/dist/cjs/mappers/responses/ai/index.js +1 -0
- package/dist/cjs/mappers/responses/ai/index.js.map +1 -1
- package/dist/cjs/mappers/responses/ai/suggestions-search-response.mapper.js +11 -0
- package/dist/cjs/mappers/responses/ai/suggestions-search-response.mapper.js.map +1 -0
- package/dist/cjs/platform.adapter.js +2 -0
- package/dist/cjs/platform.adapter.js.map +1 -1
- package/dist/cjs/schemas/models/ai/index.js +2 -0
- package/dist/cjs/schemas/models/ai/index.js.map +1 -1
- package/dist/cjs/schemas/models/ai/suggestion-search.schema.js +17 -0
- package/dist/cjs/schemas/models/ai/suggestion-search.schema.js.map +1 -0
- package/dist/cjs/schemas/models/ai/suggestions-search.schema.js +16 -0
- package/dist/cjs/schemas/models/ai/suggestions-search.schema.js.map +1 -0
- package/dist/cjs/schemas/requests/ai/index.js +1 -0
- package/dist/cjs/schemas/requests/ai/index.js.map +1 -1
- package/dist/cjs/schemas/requests/ai/suggestions-search-request.schema.js +21 -0
- package/dist/cjs/schemas/requests/ai/suggestions-search-request.schema.js.map +1 -0
- package/dist/cjs/schemas/responses/ai/index.js +1 -0
- package/dist/cjs/schemas/responses/ai/index.js.map +1 -1
- package/dist/cjs/schemas/responses/ai/suggestions-search-response.schema.js +11 -0
- package/dist/cjs/schemas/responses/ai/suggestions-search-response.schema.js.map +1 -0
- package/dist/cjs/types/models/ai/index.js +5 -0
- package/dist/cjs/types/models/ai/index.js.map +1 -0
- package/dist/cjs/types/models/ai/suggestion-search.model.js +3 -0
- package/dist/cjs/types/models/ai/suggestion-search.model.js.map +1 -0
- package/dist/cjs/types/models/index.js +1 -0
- package/dist/cjs/types/models/index.js.map +1 -1
- package/dist/cjs/types/platform-adapter.types.js.map +1 -1
- package/dist/cjs/types/requests/ai/index.js +1 -0
- package/dist/cjs/types/requests/ai/index.js.map +1 -1
- package/dist/cjs/types/requests/ai/suggestions-search-request.model.js +3 -0
- package/dist/cjs/types/requests/ai/suggestions-search-request.model.js.map +1 -0
- package/dist/cjs/types/responses/ai/index.js +1 -0
- package/dist/cjs/types/responses/ai/index.js.map +1 -1
- package/dist/cjs/types/responses/ai/suggestions-search-response.model.js +3 -0
- package/dist/cjs/types/responses/ai/suggestions-search-response.model.js.map +1 -0
- package/dist/esm/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js +28 -0
- package/dist/esm/endpoint-adapters/ai/suggestions-search.endpoint-adapter.js.map +1 -0
- package/dist/esm/endpoint-adapters/index.js +1 -0
- package/dist/esm/endpoint-adapters/index.js.map +1 -1
- package/dist/esm/endpoint-adapters/utils.js +19 -0
- package/dist/esm/endpoint-adapters/utils.js.map +1 -1
- package/dist/esm/mappers/requests/ai/index.js +1 -0
- package/dist/esm/mappers/requests/ai/index.js.map +1 -1
- package/dist/esm/mappers/requests/ai/suggestions-search-request.mapper.js +9 -0
- package/dist/esm/mappers/requests/ai/suggestions-search-request.mapper.js.map +1 -0
- package/dist/esm/mappers/responses/ai/index.js +1 -0
- package/dist/esm/mappers/responses/ai/index.js.map +1 -1
- package/dist/esm/mappers/responses/ai/suggestions-search-response.mapper.js +8 -0
- package/dist/esm/mappers/responses/ai/suggestions-search-response.mapper.js.map +1 -0
- package/dist/esm/platform.adapter.js +2 -0
- package/dist/esm/platform.adapter.js.map +1 -1
- package/dist/esm/schemas/models/ai/index.js +2 -0
- package/dist/esm/schemas/models/ai/index.js.map +1 -1
- package/dist/esm/schemas/models/ai/suggestion-search.schema.js +14 -0
- package/dist/esm/schemas/models/ai/suggestion-search.schema.js.map +1 -0
- package/dist/esm/schemas/models/ai/suggestions-search.schema.js +13 -0
- package/dist/esm/schemas/models/ai/suggestions-search.schema.js.map +1 -0
- package/dist/esm/schemas/requests/ai/index.js +1 -0
- package/dist/esm/schemas/requests/ai/index.js.map +1 -1
- package/dist/esm/schemas/requests/ai/suggestions-search-request.schema.js +18 -0
- package/dist/esm/schemas/requests/ai/suggestions-search-request.schema.js.map +1 -0
- package/dist/esm/schemas/responses/ai/index.js +1 -0
- package/dist/esm/schemas/responses/ai/index.js.map +1 -1
- package/dist/esm/schemas/responses/ai/suggestions-search-response.schema.js +8 -0
- package/dist/esm/schemas/responses/ai/suggestions-search-response.schema.js.map +1 -0
- package/dist/esm/types/models/ai/index.js +2 -0
- package/dist/esm/types/models/ai/index.js.map +1 -0
- package/dist/esm/types/models/ai/suggestion-search.model.js +2 -0
- package/dist/esm/types/models/ai/suggestion-search.model.js.map +1 -0
- package/dist/esm/types/models/index.js +1 -0
- package/dist/esm/types/models/index.js.map +1 -1
- package/dist/esm/types/platform-adapter.types.js.map +1 -1
- package/dist/esm/types/requests/ai/index.js +1 -0
- package/dist/esm/types/requests/ai/index.js.map +1 -1
- package/dist/esm/types/requests/ai/suggestions-search-request.model.js +2 -0
- package/dist/esm/types/requests/ai/suggestions-search-request.model.js.map +1 -0
- package/dist/esm/types/responses/ai/index.js +1 -0
- package/dist/esm/types/responses/ai/index.js.map +1 -1
- package/dist/esm/types/responses/ai/suggestions-search-response.model.js +2 -0
- package/dist/esm/types/responses/ai/suggestions-search-response.model.js.map +1 -0
- package/dist/types/endpoint-adapters/ai/suggestions-search.endpoint-adapter.d.ts +7 -0
- package/dist/types/endpoint-adapters/index.d.ts +1 -0
- package/dist/types/endpoint-adapters/utils.d.ts +10 -0
- package/dist/types/mappers/requests/ai/index.d.ts +1 -0
- package/dist/types/mappers/requests/ai/suggestions-search-request.mapper.d.ts +8 -0
- package/dist/types/mappers/responses/ai/index.d.ts +1 -0
- package/dist/types/mappers/responses/ai/suggestions-search-response.mapper.d.ts +7 -0
- package/dist/types/schemas/models/ai/index.d.ts +2 -0
- package/dist/types/schemas/models/ai/suggestion-search.schema.d.ts +7 -0
- package/dist/types/schemas/models/ai/suggestions-search.schema.d.ts +7 -0
- package/dist/types/schemas/requests/ai/index.d.ts +1 -0
- package/dist/types/schemas/requests/ai/suggestions-search-request.schema.d.ts +8 -0
- package/dist/types/schemas/responses/ai/index.d.ts +1 -0
- package/dist/types/schemas/responses/ai/suggestions-search-response.schema.d.ts +7 -0
- package/dist/types/types/models/ai/index.d.ts +1 -0
- package/dist/types/types/models/ai/suggestion-search.model.d.ts +9 -0
- package/dist/types/types/models/index.d.ts +1 -0
- package/dist/types/types/platform-adapter.types.d.ts +2 -1
- package/dist/types/types/requests/ai/index.d.ts +1 -0
- package/dist/types/types/requests/ai/suggestions-search-request.model.d.ts +16 -0
- package/dist/types/types/responses/ai/index.d.ts +1 -0
- package/dist/types/types/responses/ai/suggestions-search-response.model.d.ts +12 -0
- package/package.json +3 -3
- package/report/x-adapter-platform.api.json +612 -0
- package/report/x-adapter-platform.api.md +60 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiSuggestionsSearchEndpointAdapter = 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 ai suggestions search endpoint.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
exports.aiSuggestionsSearchEndpointAdapter = (0, x_adapter_1.endpointAdapterFactory)({
|
|
13
|
+
endpoint: from => (0, x_adapter_1.interpolate)(`${(0, utils_1.getAiSuggestionsServiceUrl)(from)}/{extraParams.instance}/suggestions/search`, from),
|
|
14
|
+
requestMapper: mappers_1.aiSuggestionsSearchRequestMapper,
|
|
15
|
+
responseMapper: mappers_1.aiSuggestionsSearchResponseMapper,
|
|
16
|
+
defaultRequestOptions: {
|
|
17
|
+
id: 'ai-suggestions-search',
|
|
18
|
+
sendParamsInBody: true,
|
|
19
|
+
properties: {
|
|
20
|
+
method: 'POST',
|
|
21
|
+
headers: {
|
|
22
|
+
'Content-Type': 'application/json',
|
|
23
|
+
...(0, utils_1.getDefaultHeaders)(),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
parameters: {
|
|
27
|
+
internal: true,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=suggestions-search.endpoint-adapter.js.map
|
|
@@ -0,0 +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,EACT,GAAG,IAAA,kCAA0B,EAAC,IAAI,CAAC,4CAA4C,EAC/E,IAAI,CACL;IACH,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(\n `${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/suggestions/search`,\n from,\n ),\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"]}
|
|
@@ -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("./ai/questions.endpoint-adapter"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./ai/suggestions-search.endpoint-adapter"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./ai/tasks.endpoint-adapter"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./experience-controls.endpoint-adapter"), exports);
|
|
7
8
|
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,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/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,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"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSearchServiceUrl = getSearchServiceUrl;
|
|
4
4
|
exports.getBeaconServiceUrl = getBeaconServiceUrl;
|
|
5
|
+
exports.getAiSuggestionsServiceUrl = getAiSuggestionsServiceUrl;
|
|
5
6
|
exports.getQuestionsServiceUrl = getQuestionsServiceUrl;
|
|
6
7
|
exports.getTasksServiceUrl = getTasksServiceUrl;
|
|
7
8
|
exports.getSemanticsServiceUrl = getSemanticsServiceUrl;
|
|
@@ -37,6 +38,25 @@ function getBeaconServiceUrl(from) {
|
|
|
37
38
|
? 'https://beacon-api.internal.test.empathy.co'
|
|
38
39
|
: 'https://api.{extraParams.env(.)}empathy.co';
|
|
39
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Gets the AI suggestions service URL for the given request.
|
|
43
|
+
*
|
|
44
|
+
* @param from - The request.
|
|
45
|
+
*
|
|
46
|
+
* @returns The service URL.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
function getAiSuggestionsServiceUrl(from) {
|
|
51
|
+
var _a, _b;
|
|
52
|
+
if (((_a = from.extraParams) === null || _a === void 0 ? void 0 : _a.env) === 'test') {
|
|
53
|
+
return 'https://questions.internal.test.empathy.co';
|
|
54
|
+
}
|
|
55
|
+
if (((_b = from.extraParams) === null || _b === void 0 ? void 0 : _b.env) === 'staging') {
|
|
56
|
+
return 'https://questions.staging.empathy.co/v1/overview';
|
|
57
|
+
}
|
|
58
|
+
return 'https://api.{extraParams.env(.)}empathy.co/overview';
|
|
59
|
+
}
|
|
40
60
|
/**
|
|
41
61
|
* Gets the Questions service URL for the given request.
|
|
42
62
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/utils.ts"],"names":[],"mappings":";;AAWA,kDAIC;AAWD,kDAIC;AAWD,wDAQC;AAWD,gDAQC;AAWD,wDAIC;AAWD,kDAIC;AAUD,8CAWC;
|
|
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"]}
|
|
@@ -2,5 +2,6 @@
|
|
|
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-search-request.mapper"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./tasks-request.mapper"), exports);
|
|
6
7
|
//# 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,iEAAsC","sourcesContent":["export * from './questions-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,8EAAmD;AACnD,iEAAsC","sourcesContent":["export * from './questions-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.aiSuggestionsSearchRequestMapper = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
const schemas_1 = require("../../../schemas");
|
|
6
|
+
/**
|
|
7
|
+
* Default implementation for the aiSuggestionsSearchRequestMapper.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
exports.aiSuggestionsSearchRequestMapper = (0, x_adapter_1.schemaMapperFactory)(schemas_1.aiSuggestionsSearchRequestSchema);
|
|
12
|
+
//# sourceMappingURL=suggestions-search-request.mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions-search-request.mapper.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/suggestions-search-request.mapper.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,8CAAmE;AAEnE;;;;GAIG;AACU,QAAA,gCAAgC,GAAG,IAAA,+BAAmB,EAGjE,0CAAgC,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchRequest } from '../../../types'\nimport { schemaMapperFactory } from '@empathyco/x-adapter'\nimport { aiSuggestionsSearchRequestSchema } from '../../../schemas'\n\n/**\n * Default implementation for the aiSuggestionsSearchRequestMapper.\n *\n * @public\n */\nexport const aiSuggestionsSearchRequestMapper = schemaMapperFactory<\n AiSuggestionsSearchRequest,\n PlatformAiSuggestionsSearchRequest\n>(aiSuggestionsSearchRequestSchema)\n"]}
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./questions-response.mapper"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./suggestions-search-response.mapper"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./tasks-response.mapper"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/responses/ai/index.ts"],"names":[],"mappings":";;;AAAA,sEAA2C;AAC3C,kEAAuC","sourcesContent":["export * from './questions-response.mapper'\nexport * from './tasks-response.mapper'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/responses/ai/index.ts"],"names":[],"mappings":";;;AAAA,sEAA2C;AAC3C,+EAAoD;AACpD,kEAAuC","sourcesContent":["export * from './questions-response.mapper'\nexport * from './suggestions-search-response.mapper'\nexport * from './tasks-response.mapper'\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiSuggestionsSearchResponseMapper = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
const schemas_1 = require("../../../schemas");
|
|
6
|
+
/**
|
|
7
|
+
* Default implementation for the AiSuggestionsSearchResponseMapper.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.aiSuggestionsSearchResponseMapper = (0, x_adapter_1.schemaMapperFactory)(schemas_1.aiSuggestionsSearchResponseSchema);
|
|
11
|
+
//# sourceMappingURL=suggestions-search-response.mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions-search-response.mapper.js","sourceRoot":"","sources":["../../../../../src/mappers/responses/ai/suggestions-search-response.mapper.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,8CAAoE;AAEpE;;;GAGG;AACU,QAAA,iCAAiC,GAAG,IAAA,+BAAmB,EAGlE,2CAAiC,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchResponse } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchResponse } from '../../../types'\nimport { schemaMapperFactory } from '@empathyco/x-adapter'\nimport { aiSuggestionsSearchResponseSchema } from '../../../schemas'\n\n/**\n * Default implementation for the AiSuggestionsSearchResponseMapper.\n * @public\n */\nexport const aiSuggestionsSearchResponseMapper = schemaMapperFactory<\n PlatformAiSuggestionsSearchResponse,\n AiSuggestionsSearchResponse\n>(aiSuggestionsSearchResponseSchema)\n"]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
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
|
+
const suggestions_search_endpoint_adapter_1 = require("./endpoint-adapters/ai/suggestions-search.endpoint-adapter");
|
|
5
6
|
const tasks_endpoint_adapter_1 = require("./endpoint-adapters/ai/tasks.endpoint-adapter");
|
|
6
7
|
const experience_controls_endpoint_adapter_1 = require("./endpoint-adapters/experience-controls.endpoint-adapter");
|
|
7
8
|
const identifier_results_endpoint_adapter_1 = require("./endpoint-adapters/identifier-results.endpoint-adapter");
|
|
@@ -31,6 +32,7 @@ exports.platformAdapter = {
|
|
|
31
32
|
tagging: tagging_endpoint_adapter_1.taggingEndpointAdapter,
|
|
32
33
|
semanticQueries: semantic_queries_endpoint_adapter_1.semanticQueriesEndpointAdapter,
|
|
33
34
|
experienceControls: experience_controls_endpoint_adapter_1.experienceControlsEndpointAdapter,
|
|
35
|
+
aiSuggestionsSearch: suggestions_search_endpoint_adapter_1.aiSuggestionsSearchEndpointAdapter,
|
|
34
36
|
aiQuestions: questions_endpoint_adapter_1.aiQuestionsEndpointAdapter,
|
|
35
37
|
aiTasks: tasks_endpoint_adapter_1.aiTasksEndpointAdapter,
|
|
36
38
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.adapter.js","sourceRoot":"","sources":["../../src/platform.adapter.ts"],"names":[],"mappings":";;;AACA,kGAA8F;AAC9F,0FAAsF;AACtF,mHAA4G;AAC5G,iHAA0G;AAC1G,qGAA8F;AAC9F,6GAAsG;AACtG,+GAAwG;AACxG,2GAAqG;AACrG,2GAAoG;AACpG,qGAA8F;AAC9F,yFAAmF;AACnF,6GAAsG;AACtG,2FAAqF;
|
|
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"]}
|
|
@@ -2,5 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./questions.schema"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./suggestion-search.schema"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./suggestions-search.schema"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./tasks.schema"), exports);
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schemas/models/ai/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,yDAA8B","sourcesContent":["export * from './questions.schema'\nexport * from './tasks.schema'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schemas/models/ai/index.ts"],"names":[],"mappings":";;;AAAA,6DAAkC;AAClC,qEAA0C;AAC1C,sEAA2C;AAC3C,yDAA8B","sourcesContent":["export * from './questions.schema'\nexport * from './suggestion-search.schema'\nexport * from './suggestions-search.schema'\nexport * from './tasks.schema'\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiSuggestionSearchSchema = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
const result_schema_1 = require("../result.schema");
|
|
6
|
+
/**
|
|
7
|
+
* Default implementation for the AiSuggestionSearchSchema.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.aiSuggestionSearchSchema = (0, x_adapter_1.createMutableSchema)({
|
|
11
|
+
query: 'query',
|
|
12
|
+
results: {
|
|
13
|
+
$path: 'results',
|
|
14
|
+
$subSchema: result_schema_1.resultSchema,
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
//# sourceMappingURL=suggestion-search.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestion-search.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/models/ai/suggestion-search.schema.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,oDAA+C;AAE/C;;;GAGG;AACU,QAAA,wBAAwB,GAAG,IAAA,+BAAmB,EAGzD;IACA,KAAK,EAAE,OAAO;IACd,OAAO,EAAE;QACP,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE,4BAAY;KACzB;CACF,CAAC,CAAA","sourcesContent":["import type { AiSuggestionSearch } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionSearch } from '../../../types/models/ai/suggestion-search.model'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { resultSchema } from '../result.schema'\n\n/**\n * Default implementation for the AiSuggestionSearchSchema.\n * @public\n */\nexport const aiSuggestionSearchSchema = createMutableSchema<\n PlatformAiSuggestionSearch,\n AiSuggestionSearch\n>({\n query: 'query',\n results: {\n $path: 'results',\n $subSchema: resultSchema,\n },\n})\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiSuggestionsSearchSchema = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
const suggestion_search_schema_1 = require("./suggestion-search.schema");
|
|
6
|
+
/**
|
|
7
|
+
* Default implementation for the AIOverviewSuggestionsSearchSchema.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.aiSuggestionsSearchSchema = (0, x_adapter_1.createMutableSchema)({
|
|
11
|
+
suggestions: {
|
|
12
|
+
$path: 'items',
|
|
13
|
+
$subSchema: suggestion_search_schema_1.aiSuggestionSearchSchema,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=suggestions-search.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions-search.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/models/ai/suggestions-search.schema.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,yEAAqE;AAErE;;;GAGG;AACU,QAAA,yBAAyB,GAAG,IAAA,+BAAmB,EAG1D;IACA,WAAW,EAAE;QACX,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,mDAAwB;KACrC;CACF,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchResponse } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchResponse } from '../../../types'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { aiSuggestionSearchSchema } from './suggestion-search.schema'\n\n/**\n * Default implementation for the AIOverviewSuggestionsSearchSchema.\n * @public\n */\nexport const aiSuggestionsSearchSchema = createMutableSchema<\n PlatformAiSuggestionsSearchResponse,\n AiSuggestionsSearchResponse\n>({\n suggestions: {\n $path: 'items',\n $subSchema: aiSuggestionSearchSchema,\n },\n})\n"]}
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./questions-request.schema"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./suggestions-search-request.schema"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./tasks-request.schema"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/index.ts"],"names":[],"mappings":";;;AAAA,qEAA0C;AAC1C,iEAAsC","sourcesContent":["export * from './questions-request.schema'\nexport * from './tasks-request.schema'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schemas/requests/ai/index.ts"],"names":[],"mappings":";;;AAAA,qEAA0C;AAC1C,8EAAmD;AACnD,iEAAsC","sourcesContent":["export * from './questions-request.schema'\nexport * from './suggestions-search-request.schema'\nexport * from './tasks-request.schema'\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiSuggestionsSearchRequestSchema = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
/**
|
|
6
|
+
* Default implementation for the AiOverviewSuggestionsSearchRequestSchema.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.aiSuggestionsSearchRequestSchema = (0, x_adapter_1.createMutableSchema)({
|
|
11
|
+
context: ({ extraParams }) => {
|
|
12
|
+
var _a;
|
|
13
|
+
return ({
|
|
14
|
+
lang: (_a = extraParams === null || extraParams === void 0 ? void 0 : extraParams.lang) !== null && _a !== void 0 ? _a : '',
|
|
15
|
+
instance: extraParams === null || extraParams === void 0 ? void 0 : extraParams.instance,
|
|
16
|
+
filters: extraParams === null || extraParams === void 0 ? void 0 : extraParams.filters,
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
queries: 'queries',
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=suggestions-search-request.schema.js.map
|
|
@@ -0,0 +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;AAE1D;;;;GAIG;AACU,QAAA,gCAAgC,GAAG,IAAA,+BAAmB,EAGjE;IACA,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;;QAAC,OAAA,CAAC;YAC7B,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;IACF,OAAO,EAAE,SAAS;CACnB,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchRequest } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchRequest } from '../../../types'\nimport { createMutableSchema } from '@empathyco/x-adapter'\n\n/**\n * Default implementation for the AiOverviewSuggestionsSearchRequestSchema.\n *\n * @public\n */\nexport const aiSuggestionsSearchRequestSchema = createMutableSchema<\n AiSuggestionsSearchRequest,\n PlatformAiSuggestionsSearchRequest\n>({\n context: ({ extraParams }) => ({\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 queries: 'queries',\n})\n"]}
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./questions-response.schema"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./suggestions-search-response.schema"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./tasks-response.schema"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schemas/responses/ai/index.ts"],"names":[],"mappings":";;;AAAA,sEAA2C;AAC3C,kEAAuC","sourcesContent":["export * from './questions-response.schema'\nexport * from './tasks-response.schema'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/schemas/responses/ai/index.ts"],"names":[],"mappings":";;;AAAA,sEAA2C;AAC3C,+EAAoD;AACpD,kEAAuC","sourcesContent":["export * from './questions-response.schema'\nexport * from './suggestions-search-response.schema'\nexport * from './tasks-response.schema'\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aiSuggestionsSearchResponseSchema = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
const suggestions_search_schema_1 = require("../../models/ai/suggestions-search.schema");
|
|
6
|
+
/**
|
|
7
|
+
* Default implementation for the AIOverviewSuggestionsSearchResponseSchema.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.aiSuggestionsSearchResponseSchema = (0, x_adapter_1.createMutableSchema)(suggestions_search_schema_1.aiSuggestionsSearchSchema);
|
|
11
|
+
//# sourceMappingURL=suggestions-search-response.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions-search-response.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/responses/ai/suggestions-search-response.schema.ts"],"names":[],"mappings":";;;AAEA,oDAA0D;AAC1D,yFAAqF;AAErF;;;GAGG;AACU,QAAA,iCAAiC,GAAG,IAAA,+BAAmB,EAGlE,qDAAyB,CAAC,CAAA","sourcesContent":["import type { AiSuggestionsSearchResponse } from '@empathyco/x-types'\nimport type { PlatformAiSuggestionsSearchResponse } from '../../../types/responses'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { aiSuggestionsSearchSchema } from '../../models/ai/suggestions-search.schema'\n\n/**\n * Default implementation for the AIOverviewSuggestionsSearchResponseSchema.\n * @public\n */\nexport const aiSuggestionsSearchResponseSchema = createMutableSchema<\n PlatformAiSuggestionsSearchResponse,\n AiSuggestionsSearchResponse\n>(aiSuggestionsSearchSchema)\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/models/ai/index.ts"],"names":[],"mappings":";;;AAAA,oEAAyC","sourcesContent":["export * from './suggestion-search.model'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestion-search.model.js","sourceRoot":"","sources":["../../../../../src/types/models/ai/suggestion-search.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { PlatformResult } from '../result.model'\n\n/**\n * Each platform suggestion search is a query and the platform results of that query.\n * @public\n */\nexport interface PlatformAiSuggestionSearch {\n query: string\n results: PlatformResult[]\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ai"), exports);
|
|
4
5
|
tslib_1.__exportStar(require("./banner.model"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./facet.model"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./next-query.model"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/models/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,wDAA6B;AAC7B,6DAAkC;AAClC,2DAAgC;AAChC,2DAAgC;AAChC,8DAAmC;AACnC,iEAAsC;AACtC,8DAAmC;AACnC,yDAA8B;AAC9B,iEAAsC;AACtC,6DAAkC;AAClC,0DAA+B","sourcesContent":["export * from './banner.model'\nexport * from './facet.model'\nexport * from './next-query.model'\nexport * from './partials.model'\nexport * from './promoted.model'\nexport * from './redirection.model'\nexport * from './related-prompt.model'\nexport * from './related-tag.model'\nexport * from './result.model'\nexport * from './semantic-query.model'\nexport * from './suggestion.model'\nexport * from './tagging.model'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/models/index.ts"],"names":[],"mappings":";;;AAAA,+CAAoB;AACpB,yDAA8B;AAC9B,wDAA6B;AAC7B,6DAAkC;AAClC,2DAAgC;AAChC,2DAAgC;AAChC,8DAAmC;AACnC,iEAAsC;AACtC,8DAAmC;AACnC,yDAA8B;AAC9B,iEAAsC;AACtC,6DAAkC;AAClC,0DAA+B","sourcesContent":["export * from './ai'\nexport * from './banner.model'\nexport * from './facet.model'\nexport * from './next-query.model'\nexport * from './partials.model'\nexport * from './promoted.model'\nexport * from './redirection.model'\nexport * from './related-prompt.model'\nexport * from './related-tag.model'\nexport * from './result.model'\nexport * from './semantic-query.model'\nexport * from './suggestion.model'\nexport * from './tagging.model'\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 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 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 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"]}
|
|
@@ -2,5 +2,6 @@
|
|
|
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-search-request.model"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./tasks-request.model"), exports);
|
|
6
7
|
//# 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,gEAAqC","sourcesContent":["export * from './questions-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,6EAAkD;AAClD,gEAAqC","sourcesContent":["export * from './questions-request.model'\nexport * from './suggestions-search-request.model'\nexport * from './tasks-request.model'\n"]}
|
|
@@ -0,0 +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"]}
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./questions-response.model"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./suggestions-search-response.model"), exports);
|
|
5
6
|
tslib_1.__exportStar(require("./tasks-response.model"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/responses/ai/index.ts"],"names":[],"mappings":";;;AAAA,qEAA0C;AAC1C,iEAAsC","sourcesContent":["export * from './questions-response.model'\nexport * from './tasks-response.model'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/types/responses/ai/index.ts"],"names":[],"mappings":";;;AAAA,qEAA0C;AAC1C,8EAAmD;AACnD,iEAAsC","sourcesContent":["export * from './questions-response.model'\nexport * from './suggestions-search-response.model'\nexport * from './tasks-response.model'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suggestions-search-response.model.js","sourceRoot":"","sources":["../../../../../src/types/responses/ai/suggestions-search-response.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { PlatformResult } from '../../models/result.model'\n\n/**\n * Response for the `AI suggestions search` endpoint.\n *\n * @public\n */\nexport interface PlatformAiSuggestionsSearchResponse {\n items: {\n query: string\n results: PlatformResult[]\n }[]\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { endpointAdapterFactory, interpolate } from '@empathyco/x-adapter';
|
|
2
|
+
import { aiSuggestionsSearchRequestMapper, aiSuggestionsSearchResponseMapper } from '../../mappers';
|
|
3
|
+
import { getAiSuggestionsServiceUrl, getDefaultHeaders } from '../utils';
|
|
4
|
+
/**
|
|
5
|
+
* Default adapter for the ai suggestions search endpoint.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
export const aiSuggestionsSearchEndpointAdapter = endpointAdapterFactory({
|
|
10
|
+
endpoint: from => interpolate(`${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/suggestions/search`, from),
|
|
11
|
+
requestMapper: aiSuggestionsSearchRequestMapper,
|
|
12
|
+
responseMapper: aiSuggestionsSearchResponseMapper,
|
|
13
|
+
defaultRequestOptions: {
|
|
14
|
+
id: 'ai-suggestions-search',
|
|
15
|
+
sendParamsInBody: true,
|
|
16
|
+
properties: {
|
|
17
|
+
method: 'POST',
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...getDefaultHeaders(),
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
parameters: {
|
|
24
|
+
internal: true,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=suggestions-search.endpoint-adapter.js.map
|
|
@@ -0,0 +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,CACT,GAAG,0BAA0B,CAAC,IAAI,CAAC,4CAA4C,EAC/E,IAAI,CACL;IACH,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(\n `${getAiSuggestionsServiceUrl(from)}/{extraParams.instance}/suggestions/search`,\n from,\n ),\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"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/endpoint-adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAA;AAC/C,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/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,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"]}
|
|
@@ -28,6 +28,25 @@ export function getBeaconServiceUrl(from) {
|
|
|
28
28
|
? 'https://beacon-api.internal.test.empathy.co'
|
|
29
29
|
: 'https://api.{extraParams.env(.)}empathy.co';
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Gets the AI suggestions service URL for the given request.
|
|
33
|
+
*
|
|
34
|
+
* @param from - The request.
|
|
35
|
+
*
|
|
36
|
+
* @returns The service URL.
|
|
37
|
+
*
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
export function getAiSuggestionsServiceUrl(from) {
|
|
41
|
+
var _a, _b;
|
|
42
|
+
if (((_a = from.extraParams) === null || _a === void 0 ? void 0 : _a.env) === 'test') {
|
|
43
|
+
return 'https://questions.internal.test.empathy.co';
|
|
44
|
+
}
|
|
45
|
+
if (((_b = from.extraParams) === null || _b === void 0 ? void 0 : _b.env) === 'staging') {
|
|
46
|
+
return 'https://questions.staging.empathy.co/v1/overview';
|
|
47
|
+
}
|
|
48
|
+
return 'https://api.{extraParams.env(.)}empathy.co/overview';
|
|
49
|
+
}
|
|
31
50
|
/**
|
|
32
51
|
* Gets the Questions service URL for the given request.
|
|
33
52
|
*
|
|
@@ -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,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 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,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/mappers/requests/ai/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA","sourcesContent":["export * from './questions-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,qCAAqC,CAAA;AACnD,cAAc,wBAAwB,CAAA","sourcesContent":["export * from './questions-request.mapper'\nexport * from './suggestions-search-request.mapper'\nexport * from './tasks-request.mapper'\n"]}
|