@fluid-topics/public-api 1.0.66 → 1.0.68

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.
@@ -95,6 +95,22 @@ export const isFtPaginationConfiguration = (o) => {
95
95
  return isObject(o)
96
96
  && (isBoolean(o.splitCurrentPageToc));
97
97
  };
98
+ export const isFtClusteredSemanticSearchReply = (o) => {
99
+ return isObject(o)
100
+ && ((Array.isArray(o.documents)
101
+ && o.documents.every((v) => isFtSemanticSearchResponseItem(v))))
102
+ && ((Array.isArray(o.clusterId)
103
+ && o.clusterId.every((v) => isString(v))));
104
+ };
105
+ export const isFtSemanticSearchResponseItem = (o) => {
106
+ return isObject(o)
107
+ && ((isObject(o.metadata)
108
+ && Object.keys(o.metadata).every((k) => isString(k))
109
+ && Object.values(o.metadata).every((v) => (Array.isArray(v)
110
+ && v.every((v) => isString(v))))))
111
+ && (isString(o.excerpt))
112
+ && (isNumber(o.relevance));
113
+ };
98
114
  export const isFtSemanticSearchFilter = (o) => {
99
115
  return isObject(o)
100
116
  && ((Array.isArray(o.values)
@@ -104,7 +120,7 @@ export const isFtSemanticSearchFilter = (o) => {
104
120
  export const isFtSemanticSearchRequest = (o) => {
105
121
  return isObject(o)
106
122
  && (isString(o.query))
107
- && ((Array.isArray(o.filters)
123
+ && (o.filters == null || (Array.isArray(o.filters)
108
124
  && o.filters.every((v) => isFtSemanticSearchFilter(v))))
109
- && (isNumber(o.nbResults));
125
+ && (o.nbResults == null || isNumber(o.nbResults));
110
126
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/public-api",
3
- "version": "1.0.66",
3
+ "version": "1.0.68",
4
4
  "description": "Fluid Topics Public API",
5
5
  "author": "Fluid Topics dev team <opensource@antidot.net>",
6
6
  "license": "LGPL-3.0-only",
package/.npmignore DELETED
@@ -1,8 +0,0 @@
1
- .gradle
2
- build.gradle.kts
3
- node_modules
4
- test
5
- src
6
- tsconfig.*
7
- rollup.config.js
8
- INTERNAL_README.md
package/.yarnrc DELETED
@@ -1 +0,0 @@
1
- --frozen-lockfile false