@empathyco/x-adapter-platform 1.0.0-alpha.81 → 1.0.0-alpha.83
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/filters/editable-number-filter.schema.js +26 -0
- package/dist/cjs/schemas/models/filters/editable-number-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/filters/editable-number-filter.schema.js +23 -0
- package/dist/esm/schemas/models/filters/editable-number-filter.schema.js.map +1 -0
- package/dist/esm/types/models/facet.model.js.map +1 -1
- package/dist/types/schemas/models/filters/editable-number-filter.schema.d.ts +8 -0
- package/dist/types/types/models/facet.model.d.ts +1 -1
- package/package.json +4 -4
- package/report/x-adapter-platform.api.json +1 -1
- package/report/x-adapter-platform.api.md +1 -1
|
@@ -4,6 +4,7 @@ exports.getFacetConfig = void 0;
|
|
|
4
4
|
const hierarchical_filter_schema_1 = require("../models/filters/hierarchical-filter.schema");
|
|
5
5
|
const number_filter_schema_1 = require("../models/filters/number-filter.schema");
|
|
6
6
|
const simple_filter_schema_1 = require("../models/filters/simple-filter.schema");
|
|
7
|
+
const editable_number_filter_schema_1 = require("../models/filters/editable-number-filter.schema");
|
|
7
8
|
/**
|
|
8
9
|
* Returns the facet's config.
|
|
9
10
|
*
|
|
@@ -26,6 +27,10 @@ function getFacetConfig(type) {
|
|
|
26
27
|
range: {
|
|
27
28
|
modelName: 'NumberRangeFacet',
|
|
28
29
|
schema: number_filter_schema_1.numberFilterSchema
|
|
30
|
+
},
|
|
31
|
+
'editable-range': {
|
|
32
|
+
modelName: 'EditableNumberRangeFacet',
|
|
33
|
+
schema: editable_number_filter_schema_1.editableNumberFilterSchema
|
|
29
34
|
}
|
|
30
35
|
};
|
|
31
36
|
return (_a = typeConfigs[type]) !== null && _a !== void 0 ? _a : typeConfigs.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":";;;AACA,6FAAwF;AACxF,iFAA4E;AAC5E,iFAA4E;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":";;;AACA,6FAAwF;AACxF,iFAA4E;AAC5E,iFAA4E;AAC5E,mGAA6F;AAG7F;;;;;;;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,gBAAgB,EAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,MAAM,EAAE,0DAA0B;SACnC;KACF,CAAC;IACF,OAAO,MAAA,WAAW,CAAC,IAAI,CAAC,mCAAI,WAAW,CAAC,KAAK,CAAC;AAChD,CAAC;AApBD,wCAoBC","sourcesContent":["import { PlatformFacetType } from '../../types/models/facet.model';\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 { editableNumberFilterSchema } from '../models/filters/editable-number-filter.schema';\nimport { FacetConfig } from './types';\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 'editable-range': {\n modelName: 'EditableNumberRangeFacet',\n schema: editableNumberFilterSchema\n }\n };\n return typeConfigs[type] ?? typeConfigs.value;\n}\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.editableNumberFilterSchema = void 0;
|
|
4
|
+
const x_adapter_1 = require("@empathyco/x-adapter");
|
|
5
|
+
/**
|
|
6
|
+
* Default implementation for the NumberFilterSchema.
|
|
7
|
+
*
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.editableNumberFilterSchema = (0, x_adapter_1.createMutableSchema)({
|
|
11
|
+
id: 'filter',
|
|
12
|
+
facetId: (_, $context) => $context === null || $context === void 0 ? void 0 : $context.facetId,
|
|
13
|
+
selected: () => false,
|
|
14
|
+
modelName: () => 'EditableNumberRangeFilter',
|
|
15
|
+
range: {
|
|
16
|
+
min: ({ value }) => {
|
|
17
|
+
const min = Number(value.split('-')[0]);
|
|
18
|
+
return Number.isNaN(min) ? null : min;
|
|
19
|
+
},
|
|
20
|
+
max: ({ value }) => {
|
|
21
|
+
const max = Number(value.split('-')[1]);
|
|
22
|
+
return Number.isNaN(max) ? null : max;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
//# sourceMappingURL=editable-number-filter.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editable-number-filter.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/models/filters/editable-number-filter.schema.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAI3D;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,IAAA,+BAAmB,EAG3D;IACA,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAiB;IACrD,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,SAAS,EAAE,GAAG,EAAE,CAAC,2BAA2B;IAC5C,KAAK,EAAE;QACL,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YACjB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxC,CAAC;QACD,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YACjB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxC,CAAC;KACF;CACF,CAAC,CAAC","sourcesContent":["import { createMutableSchema } from '@empathyco/x-adapter';\nimport { EditableNumberRangeFilter } from '@empathyco/x-types';\nimport { PlatformFilter } from '../../../types/models/facet.model';\n\n/**\n * Default implementation for the NumberFilterSchema.\n *\n * @public\n */\nexport const editableNumberFilterSchema = createMutableSchema<\n PlatformFilter,\n EditableNumberRangeFilter\n>({\n id: 'filter',\n facetId: (_, $context) => $context?.facetId as string,\n selected: () => false,\n modelName: () => 'EditableNumberRangeFilter',\n range: {\n min: ({ value }) => {\n const min = Number(value.split('-')[0]);\n return Number.isNaN(min) ? null : min;\n },\n max: ({ value }) => {\n const max = Number(value.split('-')[1]);\n return Number.isNaN(max) ? null : max;\n }\n }\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import { BooleanFilter, Facet, Filter } from '@empathyco/x-types';\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\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 = 'value' | 'hierarchical' | 'range';\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 * 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
|
+
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import { BooleanFilter, Facet, Filter } from '@empathyco/x-types';\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\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 = 'value' | 'hierarchical' | 'range' | 'editable-range';\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 * 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,6 +1,7 @@
|
|
|
1
1
|
import { hierarchicalFilterSchema } from '../models/filters/hierarchical-filter.schema';
|
|
2
2
|
import { numberFilterSchema } from '../models/filters/number-filter.schema';
|
|
3
3
|
import { simpleFilterSchema } from '../models/filters/simple-filter.schema';
|
|
4
|
+
import { editableNumberFilterSchema } from '../models/filters/editable-number-filter.schema';
|
|
4
5
|
/**
|
|
5
6
|
* Returns the facet's config.
|
|
6
7
|
*
|
|
@@ -23,6 +24,10 @@ export function getFacetConfig(type) {
|
|
|
23
24
|
range: {
|
|
24
25
|
modelName: 'NumberRangeFacet',
|
|
25
26
|
schema: numberFilterSchema
|
|
27
|
+
},
|
|
28
|
+
'editable-range': {
|
|
29
|
+
modelName: 'EditableNumberRangeFacet',
|
|
30
|
+
schema: editableNumberFilterSchema
|
|
26
31
|
}
|
|
27
32
|
};
|
|
28
33
|
return (_a = typeConfigs[type]) !== null && _a !== void 0 ? _a : typeConfigs.value;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/schemas/facets/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,0BAA0B,EAAE,MAAM,iDAAiD,CAAC;AAG7F;;;;;;;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,gBAAgB,EAAE;YAChB,SAAS,EAAE,0BAA0B;YACrC,MAAM,EAAE,0BAA0B;SACnC;KACF,CAAC;IACF,OAAO,MAAA,WAAW,CAAC,IAAI,CAAC,mCAAI,WAAW,CAAC,KAAK,CAAC;AAChD,CAAC","sourcesContent":["import { PlatformFacetType } from '../../types/models/facet.model';\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 { editableNumberFilterSchema } from '../models/filters/editable-number-filter.schema';\nimport { FacetConfig } from './types';\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 'editable-range': {\n modelName: 'EditableNumberRangeFacet',\n schema: editableNumberFilterSchema\n }\n };\n return typeConfigs[type] ?? typeConfigs.value;\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createMutableSchema } from '@empathyco/x-adapter';
|
|
2
|
+
/**
|
|
3
|
+
* Default implementation for the NumberFilterSchema.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export const editableNumberFilterSchema = createMutableSchema({
|
|
8
|
+
id: 'filter',
|
|
9
|
+
facetId: (_, $context) => $context === null || $context === void 0 ? void 0 : $context.facetId,
|
|
10
|
+
selected: () => false,
|
|
11
|
+
modelName: () => 'EditableNumberRangeFilter',
|
|
12
|
+
range: {
|
|
13
|
+
min: ({ value }) => {
|
|
14
|
+
const min = Number(value.split('-')[0]);
|
|
15
|
+
return Number.isNaN(min) ? null : min;
|
|
16
|
+
},
|
|
17
|
+
max: ({ value }) => {
|
|
18
|
+
const max = Number(value.split('-')[1]);
|
|
19
|
+
return Number.isNaN(max) ? null : max;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=editable-number-filter.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editable-number-filter.schema.js","sourceRoot":"","sources":["../../../../../src/schemas/models/filters/editable-number-filter.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAI3D;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAG3D;IACA,EAAE,EAAE,QAAQ;IACZ,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAiB;IACrD,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,SAAS,EAAE,GAAG,EAAE,CAAC,2BAA2B;IAC5C,KAAK,EAAE;QACL,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YACjB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxC,CAAC;QACD,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;YACjB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACxC,OAAO,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;QACxC,CAAC;KACF;CACF,CAAC,CAAC","sourcesContent":["import { createMutableSchema } from '@empathyco/x-adapter';\nimport { EditableNumberRangeFilter } from '@empathyco/x-types';\nimport { PlatformFilter } from '../../../types/models/facet.model';\n\n/**\n * Default implementation for the NumberFilterSchema.\n *\n * @public\n */\nexport const editableNumberFilterSchema = createMutableSchema<\n PlatformFilter,\n EditableNumberRangeFilter\n>({\n id: 'filter',\n facetId: (_, $context) => $context?.facetId as string,\n selected: () => false,\n modelName: () => 'EditableNumberRangeFilter',\n range: {\n min: ({ value }) => {\n const min = Number(value.split('-')[0]);\n return Number.isNaN(min) ? null : min;\n },\n max: ({ value }) => {\n const max = Number(value.split('-')[1]);\n return Number.isNaN(max) ? null : max;\n }\n }\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import { BooleanFilter, Facet, Filter } from '@empathyco/x-types';\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\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 = 'value' | 'hierarchical' | 'range';\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 * 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
|
+
{"version":3,"file":"facet.model.js","sourceRoot":"","sources":["../../../../src/types/models/facet.model.ts"],"names":[],"mappings":"","sourcesContent":["import { BooleanFilter, Facet, Filter } from '@empathyco/x-types';\n\n/**\n * Facet model for the `platform` API.\n *\n * @public\n */\nexport interface PlatformFacet {\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 = 'value' | 'hierarchical' | 'range' | 'editable-range';\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 * 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"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EditableNumberRangeFilter } from '@empathyco/x-types';
|
|
2
|
+
import { PlatformFilter } from '../../../types/models/facet.model';
|
|
3
|
+
/**
|
|
4
|
+
* Default implementation for the NumberFilterSchema.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare const editableNumberFilterSchema: import("@empathyco/x-adapter").MutableSchema<PlatformFilter, EditableNumberRangeFilter>;
|
|
@@ -14,7 +14,7 @@ export interface PlatformFacet {
|
|
|
14
14
|
*
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export type PlatformFacetType = 'value' | 'hierarchical' | 'range';
|
|
17
|
+
export type PlatformFacetType = 'value' | 'hierarchical' | 'range' | 'editable-range';
|
|
18
18
|
/**
|
|
19
19
|
* Filter model for the `platform` API.
|
|
20
20
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empathyco/x-adapter-platform",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.83",
|
|
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",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"prepublishOnly": "pnpm run build"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@empathyco/x-adapter": "^8.0.0-alpha.
|
|
45
|
-
"@empathyco/x-types": "^10.0.0-alpha.
|
|
44
|
+
"@empathyco/x-adapter": "^8.0.0-alpha.33",
|
|
45
|
+
"@empathyco/x-types": "^10.0.0-alpha.72",
|
|
46
46
|
"@empathyco/x-utils": "^1.0.0-alpha.22",
|
|
47
47
|
"tslib": "~2.5.0"
|
|
48
48
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "22b42b09b1862b64a4bc639d9ae4a610c412dcf5"
|
|
63
63
|
}
|
|
@@ -201,7 +201,7 @@ export interface PlatformFacet {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// @public
|
|
204
|
-
export type PlatformFacetType = 'value' | 'hierarchical' | 'range';
|
|
204
|
+
export type PlatformFacetType = 'value' | 'hierarchical' | 'range' | 'editable-range';
|
|
205
205
|
|
|
206
206
|
// @public
|
|
207
207
|
export interface PlatformFilter {
|