@empathyco/x-adapter-platform 1.11.1 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/schemas/facets/utils.js +5 -0
- package/dist/cjs/schemas/facets/utils.js.map +1 -1
- package/dist/cjs/schemas/models/facet.schema.js.map +1 -1
- package/dist/cjs/schemas/models/filters/slider-filter.schema.js +48 -0
- package/dist/cjs/schemas/models/filters/slider-filter.schema.js.map +1 -0
- package/dist/cjs/types/models/facet.model.js.map +1 -1
- package/dist/esm/schemas/facets/utils.js +5 -0
- package/dist/esm/schemas/facets/utils.js.map +1 -1
- package/dist/esm/schemas/models/facet.schema.js.map +1 -1
- package/dist/esm/schemas/models/filters/slider-filter.schema.js +45 -0
- package/dist/esm/schemas/models/filters/slider-filter.schema.js.map +1 -0
- package/dist/esm/types/models/facet.model.js.map +1 -1
- package/dist/types/schemas/models/facet.schema.d.ts +2 -2
- package/dist/types/schemas/models/filters/slider-filter.schema.d.ts +8 -0
- package/dist/types/types/models/facet.model.d.ts +12 -2
- package/package.json +3 -3
- package/report/x-adapter-platform.api.json +130 -4
- package/report/x-adapter-platform.api.md +14 -3
|
@@ -6,6 +6,7 @@ const editable_number_filter_schema_1 = require("../models/filters/editable-numb
|
|
|
6
6
|
const hierarchical_filter_schema_1 = require("../models/filters/hierarchical-filter.schema");
|
|
7
7
|
const number_filter_schema_1 = require("../models/filters/number-filter.schema");
|
|
8
8
|
const simple_filter_schema_1 = require("../models/filters/simple-filter.schema");
|
|
9
|
+
const slider_filter_schema_1 = require("../models/filters/slider-filter.schema");
|
|
9
10
|
/**
|
|
10
11
|
* Returns the facet's config.
|
|
11
12
|
*
|
|
@@ -37,6 +38,10 @@ function getFacetConfig(type) {
|
|
|
37
38
|
modelName: 'EditableNumberRangeFacet',
|
|
38
39
|
schema: editable_number_filter_schema_1.editableNumberFilterSchema,
|
|
39
40
|
},
|
|
41
|
+
slider: {
|
|
42
|
+
modelName: 'SliderFacet',
|
|
43
|
+
schema: slider_filter_schema_1.sliderFilterSchema,
|
|
44
|
+
},
|
|
40
45
|
};
|
|
41
46
|
return (_a = typeConfigs[type]) !== null && _a !== void 0 ? _a : typeConfigs.value;
|
|
42
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":";;AAiBA,wCA4BC;AA3CD,mFAA6E;AAC7E,mGAA4F;AAC5F,6FAAuF;AACvF,iFAA2E;AAC3E,iFAA2E;AAC3E,iFAA2E;AAE3E;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,IAAuB;;IACpD,MAAM,WAAW,GAA2C;QAC1D,KAAK,EAAE;YACL,SAAS,EAAE,aAAa;YACxB,MAAM,EAAE,yCAAkB;SAC3B;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,mBAAmB;YAC9B,MAAM,EAAE,qDAAwB;SACjC;QACD,KAAK,EAAE;YACL,SAAS,EAAE,kBAAkB;YAC7B,MAAM,EAAE,yCAAkB;SAC3B;QACD,OAAO,EAAE;YACP,SAAS,EAAE,cAAc;YACzB,MAAM,EAAE,2CAAmB;SAC5B;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,MAAM,EAAE,0DAA0B;SACnC;QACD,MAAM,EAAE;YACN,SAAS,EAAE,aAAa;YACxB,MAAM,EAAE,yCAAkB;SAC3B;KACF,CAAA;IACD,OAAO,MAAA,WAAW,CAAC,IAAI,CAAC,mCAAI,WAAW,CAAC,KAAK,CAAA;AAC/C,CAAC","sourcesContent":["import type { PlatformFacetType } from '../../types/models/facet.model'\nimport type { FacetConfig } from './types'\nimport { booleanFilterSchema } from '../models/filters/boolean-filter.schema'\nimport { editableNumberFilterSchema } from '../models/filters/editable-number-filter.schema'\nimport { hierarchicalFilterSchema } from '../models/filters/hierarchical-filter.schema'\nimport { numberFilterSchema } from '../models/filters/number-filter.schema'\nimport { simpleFilterSchema } from '../models/filters/simple-filter.schema'\nimport { sliderFilterSchema } from '../models/filters/slider-filter.schema'\n\n/**\n * Returns the facet's config.\n *\n * @param type - The facet type to resolve the configuration.\n * @returns The facet's config.\n *\n * @public\n */\nexport function getFacetConfig(type: PlatformFacetType): FacetConfig {\n const typeConfigs: Record<PlatformFacetType, FacetConfig> = {\n value: {\n modelName: 'SimpleFacet',\n schema: simpleFilterSchema,\n },\n hierarchical: {\n modelName: 'HierarchicalFacet',\n schema: hierarchicalFilterSchema,\n },\n range: {\n modelName: 'NumberRangeFacet',\n schema: numberFilterSchema,\n },\n boolean: {\n modelName: 'BooleanFacet',\n schema: booleanFilterSchema,\n },\n 'editable-range': {\n modelName: 'EditableNumberRangeFacet',\n schema: editableNumberFilterSchema,\n },\n slider: {\n modelName: 'SliderFacet',\n schema: sliderFilterSchema,\n },\n }\n return typeConfigs[type] ?? typeConfigs.value\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.schema.js","sourceRoot":"","sources":["../../../../src/schemas/models/facet.schema.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"facet.schema.js","sourceRoot":"","sources":["../../../../src/schemas/models/facet.schema.ts"],"names":[],"mappings":";;;AASA,oDAA0D;AAC1D,2CAAgD;AAEhD;;;;GAIG;AACU,QAAA,WAAW,GAAG,IAAA,+BAAmB,EAQ5C;IACA,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,OAAO;IACd,+CAA+C;IAC/C,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAC,SAAgB;IAC9D,OAAO,EAAE;QACP,KAAK,EAAE,QAAQ;QACf,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAC,MAAM;QACrD,QAAQ,EAAE;YACR,OAAO,EAAE,OAAO;SACjB;KACF;CACF,CAAC,CAAA","sourcesContent":["import type {\n BooleanFacet,\n EditableNumberRangeFacet,\n HierarchicalFacet,\n NumberRangeFacet,\n SimpleFacet,\n SliderFacet,\n} from '@empathyco/x-types'\nimport type { PlatformFacet } from '../../types/models/facet.model'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { getFacetConfig } from '../facets/utils'\n\n/**\n * Default implementation for the FacetSchema.\n *\n * @public\n */\nexport const facetSchema = createMutableSchema<\n PlatformFacet,\n | HierarchicalFacet\n | NumberRangeFacet\n | SimpleFacet\n | EditableNumberRangeFacet\n | BooleanFacet\n | SliderFacet\n>({\n id: 'facet',\n label: 'label',\n // eslint-disable-next-line ts/no-unsafe-return\n modelName: ({ type }) => getFacetConfig(type).modelName as any,\n filters: {\n $path: 'values',\n $subSchema: ({ type }) => getFacetConfig(type).schema,\n $context: {\n facetId: 'facet',\n },\n },\n})\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sliderFilterSchema = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
const getFilter = (context) => {
|
|
6
|
+
var _a, _b;
|
|
7
|
+
if (!context) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
const facetId = context.facetId;
|
|
11
|
+
return (_b = (_a = context.requestParameters) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.find(filter => filter.startsWith(`${facetId}:`));
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Default implementation for the sliderFilterSchema.
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
exports.sliderFilterSchema = (0, x_adapter_1.createMutableSchema)({
|
|
19
|
+
id: ({ min, max }, context) => {
|
|
20
|
+
const facetId = context === null || context === void 0 ? void 0 : context.facetId;
|
|
21
|
+
const filter = getFilter(context);
|
|
22
|
+
return filter !== null && filter !== void 0 ? filter : `${facetId}:${min}-${max}`;
|
|
23
|
+
},
|
|
24
|
+
facetId: (_, context) => context === null || context === void 0 ? void 0 : context.facetId,
|
|
25
|
+
selected: () => false,
|
|
26
|
+
modelName: () => 'SliderFilter',
|
|
27
|
+
range: ({ min, max }) => ({
|
|
28
|
+
min: Number(min),
|
|
29
|
+
max: Number(max),
|
|
30
|
+
}),
|
|
31
|
+
selectedRange: (_, context) => {
|
|
32
|
+
const filter = getFilter(context);
|
|
33
|
+
if (!filter) {
|
|
34
|
+
return { min: null, max: null };
|
|
35
|
+
}
|
|
36
|
+
const [, range] = filter.split(':');
|
|
37
|
+
const match = range.match(/^(-?\d+(?:\.\d+)?)-(-?\d+(?:\.\d+)?)$/);
|
|
38
|
+
if (!match) {
|
|
39
|
+
return { min: null, max: null };
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
min: Number(match[1]),
|
|
43
|
+
max: Number(match[2]),
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
unit: 'unit',
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=slider-filter.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-filter.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/models/filters/slider-filter.schema.ts"],"names":[],"mappings":";;;AAGA,oDAA0D;AAE1D,MAAM,SAAS,GAAG,CAAC,OAAkC,EAAE,EAAE;;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAiB,CAAA;IACzC,OAAO,MAAC,MAAA,OAAO,CAAC,iBAAiB,0CAAE,MAA+B,0CAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAChF,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,CACjC,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,IAAA,+BAAmB,EAAqC;IACxF,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAiB,CAAA;QAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QAEjC,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG,OAAO,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IAC7C,CAAC;IACD,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAiB;IACnD,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc;IAC/B,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QACxB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;KACjB,CAAC;IACF,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QAEjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAElE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;QACjC,CAAC;QAED,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACrB,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACtB,CAAA;IACH,CAAC;IAED,IAAI,EAAE,MAAM;CACb,CAAC,CAAA","sourcesContent":["import type { MapperContext } from '@empathyco/x-adapter'\nimport type { SliderFilter } from '@empathyco/x-types'\nimport type { PlatformSliderFilter } from '../../../types/models/facet.model'\nimport { createMutableSchema } from '@empathyco/x-adapter'\n\nconst getFilter = (context: MapperContext | undefined) => {\n if (!context) {\n return undefined\n }\n\n const facetId = context.facetId as string\n return (context.requestParameters?.filter as string[] | undefined)?.find(filter =>\n filter.startsWith(`${facetId}:`),\n )\n}\n\n/**\n * Default implementation for the sliderFilterSchema.\n *\n * @public\n */\nexport const sliderFilterSchema = createMutableSchema<PlatformSliderFilter, SliderFilter>({\n id: ({ min, max }, context) => {\n const facetId = context?.facetId as string\n const filter = getFilter(context)\n\n return filter ?? `${facetId}:${min}-${max}`\n },\n facetId: (_, context) => context?.facetId as string,\n selected: () => false,\n modelName: () => 'SliderFilter',\n range: ({ min, max }) => ({\n min: Number(min),\n max: Number(max),\n }),\n selectedRange: (_, context) => {\n const filter = getFilter(context)\n\n if (!filter) {\n return { min: null, max: null }\n }\n\n const [, range] = filter.split(':')\n const match = range.match(/^(-?\\d+(?:\\.\\d+)?)-(-?\\d+(?:\\.\\d+)?)$/)\n\n if (!match) {\n return { min: null, max: null }\n }\n\n return {\n min: Number(match[1]),\n max: Number(match[2]),\n }\n },\n\n unit: 'unit',\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { BooleanFilter, Facet, Filter } from '@empathyco/x-types'\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\n label: string\n facet: string\n type: PlatformFacetType\n values: PlatformFilter[]\n}\n\n/**\n * Facet type for the `platform` API. It can be: value, hierarchical or range.\n *\n * @public\n */\nexport type PlatformFacetType
|
|
1
|
+
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { BooleanFilter, Facet, Filter } from '@empathyco/x-types'\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\n label: string\n facet: string\n type: PlatformFacetType\n values: (PlatformFilter | PlatformSliderFilter)[]\n}\n\n/**\n * Facet type for the `platform` API. It can be: value, hierarchical or range.\n *\n * @public\n */\nexport type PlatformFacetType =\n | 'value'\n | 'hierarchical'\n | 'range'\n | 'editable-range'\n | 'boolean'\n | 'slider'\n\n/**\n * Filter model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFilter {\n count: number\n filter: string\n id: string\n value: string\n}\n\n/**\n * Slider filter model for the `platform` API, used when {@link PlatformFacetType} is `slider`.\n *\n * @public\n */\nexport interface PlatformSliderFilter {\n min: string\n max: string\n unit: Intl.NumberFormatOptions['style']\n}\n\n/**\n * HierarchicalFilter model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformHierarchicalFilter extends PlatformFilter {\n children: PlatformFacet\n}\n\n/**\n * Hierarchical Facet model used when combining search response mappers.\n *\n * @internal\n */\nexport interface AdapterHierarchicalFacet extends Facet {\n /** Model name to indicate the facet type. */\n modelName: 'HierarchicalFacet'\n /** Filters available for the facet. */\n filters: AdapterHierarchicalFilter[]\n}\n\n/**\n * Hierarchical Filter model used when combining search response mappers.\n *\n * @internal\n */\nexport interface AdapterHierarchicalFilter extends BooleanFilter {\n /** Model name to indicate the filter type. */\n modelName: 'HierarchicalFilter'\n /** A unique id used to reference the parent filter or null if it hasn't. */\n parentId: Filter['id'] | null\n /** Descendants filters. */\n children?: AdapterHierarchicalFilter[]\n}\n"]}
|
|
@@ -3,6 +3,7 @@ import { editableNumberFilterSchema } from '../models/filters/editable-number-fi
|
|
|
3
3
|
import { hierarchicalFilterSchema } from '../models/filters/hierarchical-filter.schema';
|
|
4
4
|
import { numberFilterSchema } from '../models/filters/number-filter.schema';
|
|
5
5
|
import { simpleFilterSchema } from '../models/filters/simple-filter.schema';
|
|
6
|
+
import { sliderFilterSchema } from '../models/filters/slider-filter.schema';
|
|
6
7
|
/**
|
|
7
8
|
* Returns the facet's config.
|
|
8
9
|
*
|
|
@@ -34,6 +35,10 @@ export function getFacetConfig(type) {
|
|
|
34
35
|
modelName: 'EditableNumberRangeFacet',
|
|
35
36
|
schema: editableNumberFilterSchema,
|
|
36
37
|
},
|
|
38
|
+
slider: {
|
|
39
|
+
modelName: 'SliderFacet',
|
|
40
|
+
schema: sliderFilterSchema,
|
|
41
|
+
},
|
|
37
42
|
};
|
|
38
43
|
return (_a = typeConfigs[type]) !== null && _a !== void 0 ? _a : typeConfigs.value;
|
|
39
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAE3E;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAuB;;IACpD,MAAM,WAAW,GAA2C;QAC1D,KAAK,EAAE;YACL,SAAS,EAAE,aAAa;YACxB,MAAM,EAAE,kBAAkB;SAC3B;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,mBAAmB;YAC9B,MAAM,EAAE,wBAAwB;SACjC;QACD,KAAK,EAAE;YACL,SAAS,EAAE,kBAAkB;YAC7B,MAAM,EAAE,kBAAkB;SAC3B;QACD,OAAO,EAAE;YACP,SAAS,EAAE,cAAc;YACzB,MAAM,EAAE,mBAAmB;SAC5B;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,MAAM,EAAE,0BAA0B;SACnC;KACF,CAAA;IACD,OAAO,MAAA,WAAW,CAAC,IAAI,CAAC,mCAAI,WAAW,CAAC,KAAK,CAAA;AAC/C,CAAC","sourcesContent":["import type { PlatformFacetType } from '../../types/models/facet.model'\nimport type { FacetConfig } from './types'\nimport { booleanFilterSchema } from '../models/filters/boolean-filter.schema'\nimport { editableNumberFilterSchema } from '../models/filters/editable-number-filter.schema'\nimport { hierarchicalFilterSchema } from '../models/filters/hierarchical-filter.schema'\nimport { numberFilterSchema } from '../models/filters/number-filter.schema'\nimport { simpleFilterSchema } from '../models/filters/simple-filter.schema'\n\n/**\n * Returns the facet's config.\n *\n * @param type - The facet type to resolve the configuration.\n * @returns The facet's config.\n *\n * @public\n */\nexport function getFacetConfig(type: PlatformFacetType): FacetConfig {\n const typeConfigs: Record<PlatformFacetType, FacetConfig> = {\n value: {\n modelName: 'SimpleFacet',\n schema: simpleFilterSchema,\n },\n hierarchical: {\n modelName: 'HierarchicalFacet',\n schema: hierarchicalFilterSchema,\n },\n range: {\n modelName: 'NumberRangeFacet',\n schema: numberFilterSchema,\n },\n boolean: {\n modelName: 'BooleanFacet',\n schema: booleanFilterSchema,\n },\n 'editable-range': {\n modelName: 'EditableNumberRangeFacet',\n schema: editableNumberFilterSchema,\n },\n }\n return typeConfigs[type] ?? typeConfigs.value\n}\n"]}
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAA;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAA;AACvF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAA;AAE3E;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,IAAuB;;IACpD,MAAM,WAAW,GAA2C;QAC1D,KAAK,EAAE;YACL,SAAS,EAAE,aAAa;YACxB,MAAM,EAAE,kBAAkB;SAC3B;QACD,YAAY,EAAE;YACZ,SAAS,EAAE,mBAAmB;YAC9B,MAAM,EAAE,wBAAwB;SACjC;QACD,KAAK,EAAE;YACL,SAAS,EAAE,kBAAkB;YAC7B,MAAM,EAAE,kBAAkB;SAC3B;QACD,OAAO,EAAE;YACP,SAAS,EAAE,cAAc;YACzB,MAAM,EAAE,mBAAmB;SAC5B;QACD,gBAAgB,EAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,MAAM,EAAE,0BAA0B;SACnC;QACD,MAAM,EAAE;YACN,SAAS,EAAE,aAAa;YACxB,MAAM,EAAE,kBAAkB;SAC3B;KACF,CAAA;IACD,OAAO,MAAA,WAAW,CAAC,IAAI,CAAC,mCAAI,WAAW,CAAC,KAAK,CAAA;AAC/C,CAAC","sourcesContent":["import type { PlatformFacetType } from '../../types/models/facet.model'\nimport type { FacetConfig } from './types'\nimport { booleanFilterSchema } from '../models/filters/boolean-filter.schema'\nimport { editableNumberFilterSchema } from '../models/filters/editable-number-filter.schema'\nimport { hierarchicalFilterSchema } from '../models/filters/hierarchical-filter.schema'\nimport { numberFilterSchema } from '../models/filters/number-filter.schema'\nimport { simpleFilterSchema } from '../models/filters/simple-filter.schema'\nimport { sliderFilterSchema } from '../models/filters/slider-filter.schema'\n\n/**\n * Returns the facet's config.\n *\n * @param type - The facet type to resolve the configuration.\n * @returns The facet's config.\n *\n * @public\n */\nexport function getFacetConfig(type: PlatformFacetType): FacetConfig {\n const typeConfigs: Record<PlatformFacetType, FacetConfig> = {\n value: {\n modelName: 'SimpleFacet',\n schema: simpleFilterSchema,\n },\n hierarchical: {\n modelName: 'HierarchicalFacet',\n schema: hierarchicalFilterSchema,\n },\n range: {\n modelName: 'NumberRangeFacet',\n schema: numberFilterSchema,\n },\n boolean: {\n modelName: 'BooleanFacet',\n schema: booleanFilterSchema,\n },\n 'editable-range': {\n modelName: 'EditableNumberRangeFacet',\n schema: editableNumberFilterSchema,\n },\n slider: {\n modelName: 'SliderFacet',\n schema: sliderFilterSchema,\n },\n }\n return typeConfigs[type] ?? typeConfigs.value\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.schema.js","sourceRoot":"","sources":["../../../../src/schemas/models/facet.schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"facet.schema.js","sourceRoot":"","sources":["../../../../src/schemas/models/facet.schema.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,mBAAmB,CAQ5C;IACA,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,OAAO;IACd,+CAA+C;IAC/C,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,SAAgB;IAC9D,OAAO,EAAE;QACP,KAAK,EAAE,QAAQ;QACf,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM;QACrD,QAAQ,EAAE;YACR,OAAO,EAAE,OAAO;SACjB;KACF;CACF,CAAC,CAAA","sourcesContent":["import type {\n BooleanFacet,\n EditableNumberRangeFacet,\n HierarchicalFacet,\n NumberRangeFacet,\n SimpleFacet,\n SliderFacet,\n} from '@empathyco/x-types'\nimport type { PlatformFacet } from '../../types/models/facet.model'\nimport { createMutableSchema } from '@empathyco/x-adapter'\nimport { getFacetConfig } from '../facets/utils'\n\n/**\n * Default implementation for the FacetSchema.\n *\n * @public\n */\nexport const facetSchema = createMutableSchema<\n PlatformFacet,\n | HierarchicalFacet\n | NumberRangeFacet\n | SimpleFacet\n | EditableNumberRangeFacet\n | BooleanFacet\n | SliderFacet\n>({\n id: 'facet',\n label: 'label',\n // eslint-disable-next-line ts/no-unsafe-return\n modelName: ({ type }) => getFacetConfig(type).modelName as any,\n filters: {\n $path: 'values',\n $subSchema: ({ type }) => getFacetConfig(type).schema,\n $context: {\n facetId: 'facet',\n },\n },\n})\n"]}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { createMutableSchema } from '@empathyco/x-adapter';
|
|
2
|
+
const getFilter = (context) => {
|
|
3
|
+
var _a, _b;
|
|
4
|
+
if (!context) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const facetId = context.facetId;
|
|
8
|
+
return (_b = (_a = context.requestParameters) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.find(filter => filter.startsWith(`${facetId}:`));
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Default implementation for the sliderFilterSchema.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export const sliderFilterSchema = createMutableSchema({
|
|
16
|
+
id: ({ min, max }, context) => {
|
|
17
|
+
const facetId = context === null || context === void 0 ? void 0 : context.facetId;
|
|
18
|
+
const filter = getFilter(context);
|
|
19
|
+
return filter !== null && filter !== void 0 ? filter : `${facetId}:${min}-${max}`;
|
|
20
|
+
},
|
|
21
|
+
facetId: (_, context) => context === null || context === void 0 ? void 0 : context.facetId,
|
|
22
|
+
selected: () => false,
|
|
23
|
+
modelName: () => 'SliderFilter',
|
|
24
|
+
range: ({ min, max }) => ({
|
|
25
|
+
min: Number(min),
|
|
26
|
+
max: Number(max),
|
|
27
|
+
}),
|
|
28
|
+
selectedRange: (_, context) => {
|
|
29
|
+
const filter = getFilter(context);
|
|
30
|
+
if (!filter) {
|
|
31
|
+
return { min: null, max: null };
|
|
32
|
+
}
|
|
33
|
+
const [, range] = filter.split(':');
|
|
34
|
+
const match = range.match(/^(-?\d+(?:\.\d+)?)-(-?\d+(?:\.\d+)?)$/);
|
|
35
|
+
if (!match) {
|
|
36
|
+
return { min: null, max: null };
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
min: Number(match[1]),
|
|
40
|
+
max: Number(match[2]),
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
unit: 'unit',
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=slider-filter.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider-filter.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/models/filters/slider-filter.schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,SAAS,GAAG,CAAC,OAAkC,EAAE,EAAE;;IACvD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,MAAM,OAAO,GAAG,OAAO,CAAC,OAAiB,CAAA;IACzC,OAAO,MAAC,MAAA,OAAO,CAAC,iBAAiB,0CAAE,MAA+B,0CAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAChF,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,GAAG,CAAC,CACjC,CAAA;AACH,CAAC,CAAA;AAED;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAqC;IACxF,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE;QAC5B,MAAM,OAAO,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAiB,CAAA;QAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QAEjC,OAAO,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,GAAG,OAAO,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;IAC7C,CAAC;IACD,OAAO,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAiB;IACnD,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,SAAS,EAAE,GAAG,EAAE,CAAC,cAAc;IAC/B,KAAK,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC;QACxB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC;KACjB,CAAC;IACF,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QAEjC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;QACjC,CAAC;QAED,MAAM,CAAC,EAAE,KAAK,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAA;QAElE,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,CAAA;QACjC,CAAC;QAED,OAAO;YACL,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACrB,GAAG,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACtB,CAAA;IACH,CAAC;IAED,IAAI,EAAE,MAAM;CACb,CAAC,CAAA","sourcesContent":["import type { MapperContext } from '@empathyco/x-adapter'\nimport type { SliderFilter } from '@empathyco/x-types'\nimport type { PlatformSliderFilter } from '../../../types/models/facet.model'\nimport { createMutableSchema } from '@empathyco/x-adapter'\n\nconst getFilter = (context: MapperContext | undefined) => {\n if (!context) {\n return undefined\n }\n\n const facetId = context.facetId as string\n return (context.requestParameters?.filter as string[] | undefined)?.find(filter =>\n filter.startsWith(`${facetId}:`),\n )\n}\n\n/**\n * Default implementation for the sliderFilterSchema.\n *\n * @public\n */\nexport const sliderFilterSchema = createMutableSchema<PlatformSliderFilter, SliderFilter>({\n id: ({ min, max }, context) => {\n const facetId = context?.facetId as string\n const filter = getFilter(context)\n\n return filter ?? `${facetId}:${min}-${max}`\n },\n facetId: (_, context) => context?.facetId as string,\n selected: () => false,\n modelName: () => 'SliderFilter',\n range: ({ min, max }) => ({\n min: Number(min),\n max: Number(max),\n }),\n selectedRange: (_, context) => {\n const filter = getFilter(context)\n\n if (!filter) {\n return { min: null, max: null }\n }\n\n const [, range] = filter.split(':')\n const match = range.match(/^(-?\\d+(?:\\.\\d+)?)-(-?\\d+(?:\\.\\d+)?)$/)\n\n if (!match) {\n return { min: null, max: null }\n }\n\n return {\n min: Number(match[1]),\n max: Number(match[2]),\n }\n },\n\n unit: 'unit',\n})\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { BooleanFilter, Facet, Filter } from '@empathyco/x-types'\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\n label: string\n facet: string\n type: PlatformFacetType\n values: PlatformFilter[]\n}\n\n/**\n * Facet type for the `platform` API. It can be: value, hierarchical or range.\n *\n * @public\n */\nexport type PlatformFacetType
|
|
1
|
+
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import type { BooleanFilter, Facet, Filter } from '@empathyco/x-types'\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\n label: string\n facet: string\n type: PlatformFacetType\n values: (PlatformFilter | PlatformSliderFilter)[]\n}\n\n/**\n * Facet type for the `platform` API. It can be: value, hierarchical or range.\n *\n * @public\n */\nexport type PlatformFacetType =\n | 'value'\n | 'hierarchical'\n | 'range'\n | 'editable-range'\n | 'boolean'\n | 'slider'\n\n/**\n * Filter model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFilter {\n count: number\n filter: string\n id: string\n value: string\n}\n\n/**\n * Slider filter model for the `platform` API, used when {@link PlatformFacetType} is `slider`.\n *\n * @public\n */\nexport interface PlatformSliderFilter {\n min: string\n max: string\n unit: Intl.NumberFormatOptions['style']\n}\n\n/**\n * HierarchicalFilter model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformHierarchicalFilter extends PlatformFilter {\n children: PlatformFacet\n}\n\n/**\n * Hierarchical Facet model used when combining search response mappers.\n *\n * @internal\n */\nexport interface AdapterHierarchicalFacet extends Facet {\n /** Model name to indicate the facet type. */\n modelName: 'HierarchicalFacet'\n /** Filters available for the facet. */\n filters: AdapterHierarchicalFilter[]\n}\n\n/**\n * Hierarchical Filter model used when combining search response mappers.\n *\n * @internal\n */\nexport interface AdapterHierarchicalFilter extends BooleanFilter {\n /** Model name to indicate the filter type. */\n modelName: 'HierarchicalFilter'\n /** A unique id used to reference the parent filter or null if it hasn't. */\n parentId: Filter['id'] | null\n /** Descendants filters. */\n children?: AdapterHierarchicalFilter[]\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { BooleanFacet, EditableNumberRangeFacet, HierarchicalFacet, NumberRangeFacet, SimpleFacet } from '@empathyco/x-types';
|
|
1
|
+
import type { BooleanFacet, EditableNumberRangeFacet, HierarchicalFacet, NumberRangeFacet, SimpleFacet, SliderFacet } from '@empathyco/x-types';
|
|
2
2
|
import type { PlatformFacet } from '../../types/models/facet.model';
|
|
3
3
|
/**
|
|
4
4
|
* Default implementation for the FacetSchema.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export declare const facetSchema: import("@empathyco/x-adapter").MutableSchema<PlatformFacet, HierarchicalFacet | NumberRangeFacet | SimpleFacet | EditableNumberRangeFacet | BooleanFacet>;
|
|
8
|
+
export declare const facetSchema: import("@empathyco/x-adapter").MutableSchema<PlatformFacet, HierarchicalFacet | NumberRangeFacet | SimpleFacet | EditableNumberRangeFacet | BooleanFacet | SliderFacet>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { SliderFilter } from '@empathyco/x-types';
|
|
2
|
+
import type { PlatformSliderFilter } from '../../../types/models/facet.model';
|
|
3
|
+
/**
|
|
4
|
+
* Default implementation for the sliderFilterSchema.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare const sliderFilterSchema: import("@empathyco/x-adapter").MutableSchema<PlatformSliderFilter, SliderFilter>;
|
|
@@ -8,14 +8,14 @@ export interface PlatformFacet {
|
|
|
8
8
|
label: string;
|
|
9
9
|
facet: string;
|
|
10
10
|
type: PlatformFacetType;
|
|
11
|
-
values: PlatformFilter[];
|
|
11
|
+
values: (PlatformFilter | PlatformSliderFilter)[];
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Facet type for the `platform` API. It can be: value, hierarchical or range.
|
|
15
15
|
*
|
|
16
16
|
* @public
|
|
17
17
|
*/
|
|
18
|
-
export type PlatformFacetType = 'value' | 'hierarchical' | 'range' | 'editable-range' | 'boolean';
|
|
18
|
+
export type PlatformFacetType = 'value' | 'hierarchical' | 'range' | 'editable-range' | 'boolean' | 'slider';
|
|
19
19
|
/**
|
|
20
20
|
* Filter model for the `platform` API.
|
|
21
21
|
*
|
|
@@ -27,6 +27,16 @@ export interface PlatformFilter {
|
|
|
27
27
|
id: string;
|
|
28
28
|
value: string;
|
|
29
29
|
}
|
|
30
|
+
/**
|
|
31
|
+
* Slider filter model for the `platform` API, used when {@link PlatformFacetType} is `slider`.
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface PlatformSliderFilter {
|
|
36
|
+
min: string;
|
|
37
|
+
max: string;
|
|
38
|
+
unit: Intl.NumberFormatOptions['style'];
|
|
39
|
+
}
|
|
30
40
|
/**
|
|
31
41
|
* HierarchicalFilter model for the `platform` API.
|
|
32
42
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-adapter-platform",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"description": "A search client for the Empathy Platform API",
|
|
5
5
|
"author": "Empathy Systems Corporation S.L.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@empathyco/x-adapter": "8.2.0",
|
|
52
|
-
"@empathyco/x-types": "10.
|
|
52
|
+
"@empathyco/x-types": "10.11.0",
|
|
53
53
|
"@empathyco/x-utils": "1.1.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "f895c84e579714c8f285ad7c235fdbb828622903"
|
|
67
67
|
}
|
|
@@ -1438,6 +1438,15 @@
|
|
|
1438
1438
|
"text": "BooleanFacet",
|
|
1439
1439
|
"canonicalReference": "@empathyco/x-adapter-platform!BooleanFacet:interface"
|
|
1440
1440
|
},
|
|
1441
|
+
{
|
|
1442
|
+
"kind": "Content",
|
|
1443
|
+
"text": " | "
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
"kind": "Reference",
|
|
1447
|
+
"text": "SliderFacet",
|
|
1448
|
+
"canonicalReference": "@empathyco/x-adapter-platform!SliderFacet:interface"
|
|
1449
|
+
},
|
|
1441
1450
|
{
|
|
1442
1451
|
"kind": "Content",
|
|
1443
1452
|
"text": ">"
|
|
@@ -1449,7 +1458,7 @@
|
|
|
1449
1458
|
"name": "facetSchema",
|
|
1450
1459
|
"variableTypeTokenRange": {
|
|
1451
1460
|
"startIndex": 1,
|
|
1452
|
-
"endIndex":
|
|
1461
|
+
"endIndex": 18
|
|
1453
1462
|
}
|
|
1454
1463
|
},
|
|
1455
1464
|
{
|
|
@@ -3942,6 +3951,10 @@
|
|
|
3942
3951
|
"kind": "Content",
|
|
3943
3952
|
"text": "values: "
|
|
3944
3953
|
},
|
|
3954
|
+
{
|
|
3955
|
+
"kind": "Content",
|
|
3956
|
+
"text": "("
|
|
3957
|
+
},
|
|
3945
3958
|
{
|
|
3946
3959
|
"kind": "Reference",
|
|
3947
3960
|
"text": "PlatformFilter",
|
|
@@ -3949,7 +3962,16 @@
|
|
|
3949
3962
|
},
|
|
3950
3963
|
{
|
|
3951
3964
|
"kind": "Content",
|
|
3952
|
-
"text": "
|
|
3965
|
+
"text": " | "
|
|
3966
|
+
},
|
|
3967
|
+
{
|
|
3968
|
+
"kind": "Reference",
|
|
3969
|
+
"text": "PlatformSliderFilter",
|
|
3970
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformSliderFilter:interface"
|
|
3971
|
+
},
|
|
3972
|
+
{
|
|
3973
|
+
"kind": "Content",
|
|
3974
|
+
"text": ")[]"
|
|
3953
3975
|
},
|
|
3954
3976
|
{
|
|
3955
3977
|
"kind": "Content",
|
|
@@ -3962,7 +3984,7 @@
|
|
|
3962
3984
|
"name": "values",
|
|
3963
3985
|
"propertyTypeTokenRange": {
|
|
3964
3986
|
"startIndex": 1,
|
|
3965
|
-
"endIndex":
|
|
3987
|
+
"endIndex": 6
|
|
3966
3988
|
}
|
|
3967
3989
|
}
|
|
3968
3990
|
],
|
|
@@ -4103,7 +4125,7 @@
|
|
|
4103
4125
|
},
|
|
4104
4126
|
{
|
|
4105
4127
|
"kind": "Content",
|
|
4106
|
-
"text": "'value' | 'hierarchical' | 'range' | 'editable-range' | 'boolean'"
|
|
4128
|
+
"text": "'value' | 'hierarchical' | 'range' | 'editable-range' | 'boolean' | 'slider'"
|
|
4107
4129
|
},
|
|
4108
4130
|
{
|
|
4109
4131
|
"kind": "Content",
|
|
@@ -6739,6 +6761,110 @@
|
|
|
6739
6761
|
],
|
|
6740
6762
|
"extendsTokenRanges": []
|
|
6741
6763
|
},
|
|
6764
|
+
{
|
|
6765
|
+
"kind": "Interface",
|
|
6766
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformSliderFilter:interface",
|
|
6767
|
+
"docComment": "/**\n * Slider filter model for the `platform` API, used when {@link PlatformFacetType} is `slider`.\n *\n * @public\n */\n",
|
|
6768
|
+
"excerptTokens": [
|
|
6769
|
+
{
|
|
6770
|
+
"kind": "Content",
|
|
6771
|
+
"text": "export interface PlatformSliderFilter "
|
|
6772
|
+
}
|
|
6773
|
+
],
|
|
6774
|
+
"fileUrlPath": "dist/types/types/models/facet.model.d.ts",
|
|
6775
|
+
"releaseTag": "Public",
|
|
6776
|
+
"name": "PlatformSliderFilter",
|
|
6777
|
+
"preserveMemberOrder": false,
|
|
6778
|
+
"members": [
|
|
6779
|
+
{
|
|
6780
|
+
"kind": "PropertySignature",
|
|
6781
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformSliderFilter#max:member",
|
|
6782
|
+
"docComment": "",
|
|
6783
|
+
"excerptTokens": [
|
|
6784
|
+
{
|
|
6785
|
+
"kind": "Content",
|
|
6786
|
+
"text": "max: "
|
|
6787
|
+
},
|
|
6788
|
+
{
|
|
6789
|
+
"kind": "Content",
|
|
6790
|
+
"text": "string"
|
|
6791
|
+
},
|
|
6792
|
+
{
|
|
6793
|
+
"kind": "Content",
|
|
6794
|
+
"text": ";"
|
|
6795
|
+
}
|
|
6796
|
+
],
|
|
6797
|
+
"isReadonly": false,
|
|
6798
|
+
"isOptional": false,
|
|
6799
|
+
"releaseTag": "Public",
|
|
6800
|
+
"name": "max",
|
|
6801
|
+
"propertyTypeTokenRange": {
|
|
6802
|
+
"startIndex": 1,
|
|
6803
|
+
"endIndex": 2
|
|
6804
|
+
}
|
|
6805
|
+
},
|
|
6806
|
+
{
|
|
6807
|
+
"kind": "PropertySignature",
|
|
6808
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformSliderFilter#min:member",
|
|
6809
|
+
"docComment": "",
|
|
6810
|
+
"excerptTokens": [
|
|
6811
|
+
{
|
|
6812
|
+
"kind": "Content",
|
|
6813
|
+
"text": "min: "
|
|
6814
|
+
},
|
|
6815
|
+
{
|
|
6816
|
+
"kind": "Content",
|
|
6817
|
+
"text": "string"
|
|
6818
|
+
},
|
|
6819
|
+
{
|
|
6820
|
+
"kind": "Content",
|
|
6821
|
+
"text": ";"
|
|
6822
|
+
}
|
|
6823
|
+
],
|
|
6824
|
+
"isReadonly": false,
|
|
6825
|
+
"isOptional": false,
|
|
6826
|
+
"releaseTag": "Public",
|
|
6827
|
+
"name": "min",
|
|
6828
|
+
"propertyTypeTokenRange": {
|
|
6829
|
+
"startIndex": 1,
|
|
6830
|
+
"endIndex": 2
|
|
6831
|
+
}
|
|
6832
|
+
},
|
|
6833
|
+
{
|
|
6834
|
+
"kind": "PropertySignature",
|
|
6835
|
+
"canonicalReference": "@empathyco/x-adapter-platform!PlatformSliderFilter#unit:member",
|
|
6836
|
+
"docComment": "",
|
|
6837
|
+
"excerptTokens": [
|
|
6838
|
+
{
|
|
6839
|
+
"kind": "Content",
|
|
6840
|
+
"text": "unit: "
|
|
6841
|
+
},
|
|
6842
|
+
{
|
|
6843
|
+
"kind": "Reference",
|
|
6844
|
+
"text": "Intl.NumberFormatOptions",
|
|
6845
|
+
"canonicalReference": "!Intl.NumberFormatOptions:interface"
|
|
6846
|
+
},
|
|
6847
|
+
{
|
|
6848
|
+
"kind": "Content",
|
|
6849
|
+
"text": "['style']"
|
|
6850
|
+
},
|
|
6851
|
+
{
|
|
6852
|
+
"kind": "Content",
|
|
6853
|
+
"text": ";"
|
|
6854
|
+
}
|
|
6855
|
+
],
|
|
6856
|
+
"isReadonly": false,
|
|
6857
|
+
"isOptional": false,
|
|
6858
|
+
"releaseTag": "Public",
|
|
6859
|
+
"name": "unit",
|
|
6860
|
+
"propertyTypeTokenRange": {
|
|
6861
|
+
"startIndex": 1,
|
|
6862
|
+
"endIndex": 3
|
|
6863
|
+
}
|
|
6864
|
+
}
|
|
6865
|
+
],
|
|
6866
|
+
"extendsTokenRanges": []
|
|
6867
|
+
},
|
|
6742
6868
|
{
|
|
6743
6869
|
"kind": "Interface",
|
|
6744
6870
|
"canonicalReference": "@empathyco/x-adapter-platform!PlatformSuggestion:interface",
|
|
@@ -136,9 +136,10 @@ export interface FacetConfig {
|
|
|
136
136
|
// Warning: (ae-forgotten-export) The symbol "SimpleFacet" needs to be exported by the entry point index.d.ts
|
|
137
137
|
// Warning: (ae-forgotten-export) The symbol "EditableNumberRangeFacet" needs to be exported by the entry point index.d.ts
|
|
138
138
|
// Warning: (ae-forgotten-export) The symbol "BooleanFacet" needs to be exported by the entry point index.d.ts
|
|
139
|
+
// Warning: (ae-forgotten-export) The symbol "SliderFacet" needs to be exported by the entry point index.d.ts
|
|
139
140
|
//
|
|
140
141
|
// @public
|
|
141
|
-
export const facetSchema: MutableSchema<PlatformFacet, HierarchicalFacet | NumberRangeFacet | SimpleFacet | EditableNumberRangeFacet | BooleanFacet>;
|
|
142
|
+
export const facetSchema: MutableSchema<PlatformFacet, HierarchicalFacet | NumberRangeFacet | SimpleFacet | EditableNumberRangeFacet | BooleanFacet | SliderFacet>;
|
|
142
143
|
|
|
143
144
|
// Warning: (ae-forgotten-export) The symbol "FacetsRequest" needs to be exported by the entry point index.d.ts
|
|
144
145
|
// Warning: (ae-forgotten-export) The symbol "FacetsResponse" needs to be exported by the entry point index.d.ts
|
|
@@ -370,7 +371,7 @@ export interface PlatformFacet {
|
|
|
370
371
|
// (undocumented)
|
|
371
372
|
type: PlatformFacetType;
|
|
372
373
|
// (undocumented)
|
|
373
|
-
values: PlatformFilter[];
|
|
374
|
+
values: (PlatformFilter | PlatformSliderFilter)[];
|
|
374
375
|
}
|
|
375
376
|
|
|
376
377
|
// Warning: (ae-forgotten-export) The symbol "PlatformQueryableRequest" needs to be exported by the entry point index.d.ts
|
|
@@ -390,7 +391,7 @@ export interface PlatformFacetsResponse {
|
|
|
390
391
|
}
|
|
391
392
|
|
|
392
393
|
// @public
|
|
393
|
-
export type PlatformFacetType = 'value' | 'hierarchical' | 'range' | 'editable-range' | 'boolean';
|
|
394
|
+
export type PlatformFacetType = 'value' | 'hierarchical' | 'range' | 'editable-range' | 'boolean' | 'slider';
|
|
394
395
|
|
|
395
396
|
// @public
|
|
396
397
|
export interface PlatformFilter {
|
|
@@ -690,6 +691,16 @@ export interface PlatformSemanticQuery {
|
|
|
690
691
|
query: string;
|
|
691
692
|
}
|
|
692
693
|
|
|
694
|
+
// @public
|
|
695
|
+
export interface PlatformSliderFilter {
|
|
696
|
+
// (undocumented)
|
|
697
|
+
max: string;
|
|
698
|
+
// (undocumented)
|
|
699
|
+
min: string;
|
|
700
|
+
// (undocumented)
|
|
701
|
+
unit: Intl.NumberFormatOptions['style'];
|
|
702
|
+
}
|
|
703
|
+
|
|
693
704
|
// @public
|
|
694
705
|
export interface PlatformSuggestion {
|
|
695
706
|
// (undocumented)
|