@fluid-topics/public-api 1.0.75 → 1.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/.npmignore +13 -0
  2. package/dist/cjs/types/ft-common/public.js +83 -29
  3. package/dist/fluidtopics.min.js +1 -1
  4. package/dist/mjs/types/ft-common/public.d.ts +57 -17
  5. package/dist/mjs/types/ft-common/public.js +72 -25
  6. package/package.json +1 -1
  7. package/yarn.lock +4146 -0
  8. package/.yarnrc +0 -1
  9. package/build/cjs/helpers/GenAIChunkReader.js +0 -66
  10. package/build/cjs/index.js +0 -476
  11. package/build/cjs/preferences/unauthenticated-preferences.js +0 -67
  12. package/build/cjs/roles/roles.js +0 -31
  13. package/build/cjs/types/ft-common/public.js +0 -848
  14. package/build/cjs/types/ft-server/public.js +0 -146
  15. package/build/mjs/helpers/GenAIChunkReader.d.ts +0 -19
  16. package/build/mjs/helpers/GenAIChunkReader.js +0 -37
  17. package/build/mjs/index.d.ts +0 -190
  18. package/build/mjs/index.js +0 -432
  19. package/build/mjs/preferences/unauthenticated-preferences.d.ts +0 -9
  20. package/build/mjs/preferences/unauthenticated-preferences.js +0 -61
  21. package/build/mjs/roles/roles.d.ts +0 -2
  22. package/build/mjs/roles/roles.js +0 -25
  23. package/build/mjs/types/ft-common/public.d.ts +0 -657
  24. package/build/mjs/types/ft-common/public.js +0 -762
  25. package/build/mjs/types/ft-server/public.d.ts +0 -104
  26. package/build/mjs/types/ft-server/public.js +0 -127
  27. package/build/rollup/fluidtopics.min.js +0 -1
  28. package/build/test-results/public-api.xml +0 -18
  29. package/build/test-results/web-components.xml +0 -12
  30. package/packages/cjs/package.json +0 -3
  31. package/packages/mjs/package.json +0 -3
  32. package/test-browser/helpers/GenAIChunkReader.test.ts +0 -54
  33. package/vite-plugin.mjs +0 -95
  34. package/web-test-runner.config.mjs +0 -58
@@ -1,762 +0,0 @@
1
- const isObject = (o) => typeof o === "object" && o != null;
2
- const isBoolean = (o) => typeof o === "boolean";
3
- const isNumber = (o) => typeof o === "number";
4
- const isString = (o) => typeof o === "string";
5
- export const isFtHttpErrorDetails = (o) => {
6
- return isObject(o)
7
- && (isString(o.endpoint))
8
- && (isString(o.method))
9
- && (isString(o.statusText))
10
- && (isString(o.body))
11
- && (isNumber(o.status));
12
- };
13
- // From: MyLibraryColors
14
- export var FtMyLibraryColors;
15
- (function (FtMyLibraryColors) {
16
- FtMyLibraryColors["black"] = "black";
17
- FtMyLibraryColors["green"] = "green";
18
- FtMyLibraryColors["blue"] = "blue";
19
- FtMyLibraryColors["purple"] = "purple";
20
- FtMyLibraryColors["red"] = "red";
21
- FtMyLibraryColors["orange"] = "orange";
22
- FtMyLibraryColors["yellow"] = "yellow";
23
- })(FtMyLibraryColors || (FtMyLibraryColors = {}));
24
- export const isFtMyLibraryColors = (o) => {
25
- return ["black", "green", "blue", "purple", "red", "orange", "yellow"].includes(o);
26
- };
27
- // From: SourceType
28
- export var FtTopicOriginType;
29
- (function (FtTopicOriginType) {
30
- FtTopicOriginType["OFFICIAL"] = "OFFICIAL";
31
- FtTopicOriginType["PERSONAL"] = "PERSONAL";
32
- FtTopicOriginType["SHARED"] = "SHARED";
33
- })(FtTopicOriginType || (FtTopicOriginType = {}));
34
- export const isFtTopicOriginType = (o) => {
35
- return ["OFFICIAL", "PERSONAL", "SHARED"].includes(o);
36
- };
37
- export const isFtCredentials = (o) => {
38
- return isObject(o)
39
- && (isString(o.password))
40
- && (o.newPassword == null || isString(o.newPassword))
41
- && (isBoolean(o.rememberMe))
42
- && (isString(o.login));
43
- };
44
- export const isFtPersonalBookCreation = (o) => {
45
- return isObject(o)
46
- && ((Array.isArray(o.metadata)
47
- && o.metadata.every((v) => isFtPersonalBookMetadataUpdate(v))))
48
- && ((Array.isArray(o.nodes)
49
- && o.nodes.every((v) => isFtPersonalBookNodeCreation(v))))
50
- && (isString(o.description))
51
- && (isString(o.title));
52
- };
53
- export const isFtPersonalBookMetadataUpdate = (o) => {
54
- return isObject(o)
55
- && ((Array.isArray(o.values)
56
- && o.values.every((v) => (Array.isArray(v)
57
- && v.every((v) => isString(v))))))
58
- && (isString(o.key));
59
- };
60
- export const isFtPersonalBookNodeCreation = (o) => {
61
- return isObject(o)
62
- && (isString(o.notes))
63
- && ((Array.isArray(o.children)
64
- && o.children.every((v) => isFtPersonalBookNodeCreation(v))))
65
- && (o.topicLink == null || isFtPersonalBookTopicLinkCreation(o.topicLink))
66
- && (isString(o.title))
67
- && (o.htmlContent == null || isString(o.htmlContent));
68
- };
69
- export const isFtPersonalBookTopicLinkCreation = (o) => {
70
- return isObject(o)
71
- && (isString(o.tocId))
72
- && (isString(o.contentId))
73
- && (isString(o.mapId));
74
- };
75
- export const isFtBookmark = (o) => {
76
- return isObject(o)
77
- && (isString(o.mapTitle))
78
- && (isFtMyLibraryColors(o.color))
79
- && ((Array.isArray(o.breadcrumb)
80
- && o.breadcrumb.every((v) => isString(v))))
81
- && (isString(o.tocId))
82
- && (isString(o.lastUpdate))
83
- && (isString(o.readerUrl))
84
- && (isString(o.mapId))
85
- && (isString(o.id))
86
- && (isString(o.title))
87
- && (isString(o.creationDate));
88
- };
89
- export const isFtCollectionDocument = (o) => {
90
- return isObject(o)
91
- && (isBoolean(o.deleted))
92
- && (o.apiUrl == null || isString(o.apiUrl))
93
- && (o.portalUrl == null || isString(o.portalUrl))
94
- && (isString(o.id))
95
- && (isString(o.title))
96
- && (isFtCollectionDocumentType(o.type));
97
- };
98
- export const isFtMap = (o) => {
99
- return isObject(o)
100
- && (o.prettyUrl == null || isString(o.prettyUrl))
101
- && ((Array.isArray(o.metadata)
102
- && o.metadata.every((v) => isFtMetadata(v))))
103
- && (o.watermark == null || isFtWatermark(o.watermark))
104
- && (isFtOpenMode(o.openMode))
105
- && (o.topicsApiEndpoint == null || isString(o.topicsApiEndpoint))
106
- && (o.description == null || isString(o.description))
107
- && (o.attachmentsApiEndpoint == null || isString(o.attachmentsApiEndpoint))
108
- && (isFtEditorialType(o.editorialType))
109
- && (isString(o.baseId))
110
- && (isString(o.clusterId))
111
- && (isString(o.title))
112
- && (isString(o.lastPublication))
113
- && (isBoolean(o.pbkConfidential))
114
- && (isString(o.lastEdition))
115
- && (isString(o.originId))
116
- && (o.rightsApiEndpoint == null || isString(o.rightsApiEndpoint))
117
- && (isFtMapStyles(o.contentStyles))
118
- && (o.originUrl == null || isString(o.originUrl))
119
- && (isString(o.fingerprint))
120
- && (isString(o.readerUrl))
121
- && (o.khubVersion == null || isString(o.khubVersion))
122
- && (isString(o.id))
123
- && (o.lang == null || isString(o.lang));
124
- };
125
- export const isFtMapStyles = (o) => {
126
- return isObject(o)
127
- && (isString(o.topicStylesheetUrl))
128
- && (isString(o.titleStylesheetUrl))
129
- && ((Array.isArray(o.customCssClasses)
130
- && o.customCssClasses.every((v) => isString(v))));
131
- };
132
- export const isFtTocNode = (o) => {
133
- return isObject(o)
134
- && (o.prettyUrl == null || isString(o.prettyUrl))
135
- && (o.hasRating == null || isBoolean(o.hasRating))
136
- && (isString(o.tocId))
137
- && ((Array.isArray(o.children)
138
- && o.children.every((v) => isFtTocNode(v))))
139
- && (o.origin == null || isFtTopicOrigin(o.origin))
140
- && (isString(o.contentId))
141
- && (isString(o.title));
142
- };
143
- export const isFtTopic = (o) => {
144
- return isObject(o)
145
- && ((Array.isArray(o.metadata)
146
- && o.metadata.every((v) => isFtMetadata(v))))
147
- && (isString(o.id))
148
- && (isString(o.contentApiEndpoint))
149
- && (isString(o.title));
150
- };
151
- export const isFtTopicOrigin = (o) => {
152
- return isObject(o)
153
- && (isString(o.mapTitle))
154
- && ((Array.isArray(o.breadcrumb)
155
- && o.breadcrumb.every((v) => isString(v))))
156
- && (isString(o.tocId))
157
- && (isString(o.contentId))
158
- && (isString(o.mapId))
159
- && (isFtTopicOriginType(o.type));
160
- };
161
- export const isFtUnstructuredDocument = (o) => {
162
- return isObject(o)
163
- && (o.prettyUrl == null || isString(o.prettyUrl))
164
- && ((Array.isArray(o.metadata)
165
- && o.metadata.every((v) => isFtMetadata(v))))
166
- && (isString(o.openMode))
167
- && (o.description == null || isString(o.description))
168
- && (isString(o.mimeType))
169
- && (o.baseId == null || isString(o.baseId))
170
- && (o.clusterId == null || isString(o.clusterId))
171
- && (isString(o.contentApiEndpoint))
172
- && (isString(o.title))
173
- && (o.lastPublication == null || isString(o.lastPublication))
174
- && (isString(o.viewerUrl))
175
- && (isString(o.lastEdition))
176
- && (isString(o.filename))
177
- && (o.originId == null || isString(o.originId))
178
- && (isString(o.rightsApiEndpoint))
179
- && (o.originUrl == null || isString(o.originUrl))
180
- && (o.khubVersion == null || isString(o.khubVersion))
181
- && (isString(o.id))
182
- && (o.lang == null || isString(o.lang));
183
- };
184
- // From: WsTopicContentTarget
185
- export var FtTopicContentTarget;
186
- (function (FtTopicContentTarget) {
187
- FtTopicContentTarget["THIRD_PARTY"] = "THIRD_PARTY";
188
- FtTopicContentTarget["OFF_THE_GRID"] = "OFF_THE_GRID";
189
- FtTopicContentTarget["CONTENT_PACKAGER"] = "CONTENT_PACKAGER";
190
- FtTopicContentTarget["PAGES"] = "PAGES";
191
- FtTopicContentTarget["DESIGNED_READER"] = "DESIGNED_READER";
192
- })(FtTopicContentTarget || (FtTopicContentTarget = {}));
193
- export const isFtTopicContentTarget = (o) => {
194
- return ["THIRD_PARTY", "OFF_THE_GRID", "CONTENT_PACKAGER", "PAGES", "DESIGNED_READER"].includes(o);
195
- };
196
- // From: ExternalWebComponentContext
197
- export var FtExternalWebComponentContext;
198
- (function (FtExternalWebComponentContext) {
199
- FtExternalWebComponentContext["HOMEPAGE"] = "HOMEPAGE";
200
- FtExternalWebComponentContext["CUSTOM"] = "CUSTOM";
201
- FtExternalWebComponentContext["HEADER"] = "HEADER";
202
- FtExternalWebComponentContext["READER"] = "READER";
203
- FtExternalWebComponentContext["TOPIC_TEMPLATE"] = "TOPIC_TEMPLATE";
204
- FtExternalWebComponentContext["SEARCH"] = "SEARCH";
205
- FtExternalWebComponentContext["SEARCH_RESULT"] = "SEARCH_RESULT";
206
- })(FtExternalWebComponentContext || (FtExternalWebComponentContext = {}));
207
- export const isFtExternalWebComponentContext = (o) => {
208
- return ["HOMEPAGE", "CUSTOM", "HEADER", "READER", "TOPIC_TEMPLATE", "SEARCH", "SEARCH_RESULT"].includes(o);
209
- };
210
- export const isFtFeedbackCreation = (o) => {
211
- return isObject(o)
212
- && (o.from == null || isString(o.from))
213
- && (isString(o.message));
214
- };
215
- // From: HomeLayout
216
- export var FtMetadataHomeLayout;
217
- (function (FtMetadataHomeLayout) {
218
- FtMetadataHomeLayout["CLASSIC"] = "CLASSIC";
219
- FtMetadataHomeLayout["CUSTOM"] = "CUSTOM";
220
- FtMetadataHomeLayout["DESIGNER"] = "DESIGNER";
221
- })(FtMetadataHomeLayout || (FtMetadataHomeLayout = {}));
222
- export const isFtMetadataHomeLayout = (o) => {
223
- return ["CLASSIC", "CUSTOM", "DESIGNER"].includes(o);
224
- };
225
- export const isFtSearchLocale = (o) => {
226
- return isObject(o)
227
- && (isNumber(o.count))
228
- && (isString(o.label))
229
- && (o.lang == null || isString(o.lang));
230
- };
231
- export const isFtSearchLocales = (o) => {
232
- return isObject(o)
233
- && ((Array.isArray(o.contentLocales)
234
- && o.contentLocales.every((v) => isFtSearchLocale(v))));
235
- };
236
- export const isFtMessageContext = (o) => {
237
- return isObject(o)
238
- && (isString(o.name))
239
- && ((isObject(o.messages)
240
- && Object.keys(o.messages).every((k) => isString(k))
241
- && Object.values(o.messages).every((v) => isString(v))))
242
- && (isString(o.locale));
243
- };
244
- export const isFtUiLocale = (o) => {
245
- return isObject(o)
246
- && (isString(o.displayName))
247
- && (isString(o.languageTag))
248
- && (isBoolean(o.translated));
249
- };
250
- // From: WsFacetType
251
- export var FtFacetType;
252
- (function (FtFacetType) {
253
- FtFacetType["AND"] = "AND";
254
- FtFacetType["OR"] = "OR";
255
- FtFacetType["MONOVALUED"] = "MONOVALUED";
256
- })(FtFacetType || (FtFacetType = {}));
257
- export const isFtFacetType = (o) => {
258
- return ["AND", "OR", "MONOVALUED"].includes(o);
259
- };
260
- export const isFtMetadata = (o) => {
261
- return isObject(o)
262
- && ((Array.isArray(o.values)
263
- && o.values.every((v) => isString(v))))
264
- && (o.hierarchicalValues == null || (Array.isArray(o.hierarchicalValues)
265
- && o.hierarchicalValues.every((v) => (Array.isArray(v)
266
- && v.every((v) => isString(v))))))
267
- && (isString(o.label))
268
- && (isString(o.key));
269
- };
270
- // From: WsMetadataSortRule
271
- export var FtMetadataSortRule;
272
- (function (FtMetadataSortRule) {
273
- FtMetadataSortRule["NONE"] = "NONE";
274
- FtMetadataSortRule["ALPHABET"] = "ALPHABET";
275
- FtMetadataSortRule["VERSION"] = "VERSION";
276
- })(FtMetadataSortRule || (FtMetadataSortRule = {}));
277
- export const isFtMetadataSortRule = (o) => {
278
- return ["NONE", "ALPHABET", "VERSION"].includes(o);
279
- };
280
- export const isFtMetadataConfiguration = (o) => {
281
- return isObject(o)
282
- && ((Array.isArray(o.descriptors)
283
- && o.descriptors.every((v) => isFtMetadataDescriptor(v))));
284
- };
285
- export const isFtMetadataDescriptor = (o) => {
286
- return isObject(o)
287
- && (isBoolean(o.date))
288
- && (isFtMetadataSortRule(o.sortRule))
289
- && (isString(o.label))
290
- && (isBoolean(o.reverseSort))
291
- && (isString(o.key));
292
- };
293
- export const isFtMySearch = (o) => {
294
- return isObject(o)
295
- && (isFtMySearchRequest(o.searchRequest))
296
- && (isFtMyLibraryColors(o.color))
297
- && (isBoolean(o.alert))
298
- && (isString(o.description))
299
- && (isString(o.id))
300
- && (isString(o.ownerId))
301
- && (isString(o.title))
302
- && (isString(o.creationDate));
303
- };
304
- export const isFtMySearchRequest = (o) => {
305
- return isObject(o)
306
- && (o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
307
- && (isString(o.query))
308
- && (o.scope == null || isFtSearchScope(o.scope))
309
- && ((Array.isArray(o.filters)
310
- && o.filters.every((v) => isFtLabeledSearchFilter(v))))
311
- && ((Array.isArray(o.sort)
312
- && o.sort.every((v) => isFtSearchSortCriterion(v))))
313
- && (o.virtualField == null || isFtVirtualField(o.virtualField))
314
- && (o.contentLocale == null || isString(o.contentLocale));
315
- };
316
- // From: RatingType
317
- export var FtRatingType;
318
- (function (FtRatingType) {
319
- FtRatingType["STARS"] = "STARS";
320
- FtRatingType["LIKE"] = "LIKE";
321
- FtRatingType["DICHOTOMOUS"] = "DICHOTOMOUS";
322
- FtRatingType["NO_RATING"] = "NO_RATING";
323
- })(FtRatingType || (FtRatingType = {}));
324
- export const isFtRatingType = (o) => {
325
- return ["STARS", "LIKE", "DICHOTOMOUS", "NO_RATING"].includes(o);
326
- };
327
- export const isFtPublicationRating = (o) => {
328
- return isObject(o)
329
- && (isString(o.date))
330
- && (isFtRatingType(o.type))
331
- && (isNumber(o.value));
332
- };
333
- export const isFtPublicationRatingSummary = (o) => {
334
- return isObject(o)
335
- && (o.rating == null || isFtPublicationRating(o.rating))
336
- && (isFtRatingType(o.type));
337
- };
338
- export const isFtRatingCreation = (o) => {
339
- return isObject(o)
340
- && (isFtRatingType(o.type))
341
- && (isNumber(o.value));
342
- };
343
- export const isFtRatingSummary = (o) => {
344
- return isObject(o)
345
- && (o.topics == null || isFtTopicsRatingSummary(o.topics))
346
- && (isFtPublicationRatingSummary(o.publication));
347
- };
348
- export const isFtTopicRating = (o) => {
349
- return isObject(o)
350
- && (isString(o.date))
351
- && (isString(o.tocId))
352
- && (isFtRatingType(o.type))
353
- && (isNumber(o.value));
354
- };
355
- export const isFtTopicsRatingSummary = (o) => {
356
- return isObject(o)
357
- && ((Array.isArray(o.ratings)
358
- && o.ratings.every((v) => isFtTopicRating(v))))
359
- && (isFtRatingType(o.type));
360
- };
361
- export const isFtMapResource = (o) => {
362
- return isObject(o)
363
- && (isString(o.contentUrl))
364
- && (isString(o.filename))
365
- && (isString(o.id))
366
- && (isString(o.mimeType));
367
- };
368
- export const isFtMetadataPreferenceConfiguration = (o) => {
369
- return isObject(o)
370
- && ((Array.isArray(o.filter)
371
- && o.filter.every((v) => isString(v))))
372
- && ((Array.isArray(o.prior)
373
- && o.prior.every((v) => isString(v))));
374
- };
375
- export const isFtSearchPreferencesConfiguration = (o) => {
376
- return isObject(o)
377
- && ((isObject(o.metadata)
378
- && Object.keys(o.metadata).every((k) => isString(k))
379
- && Object.values(o.metadata).every((v) => isFtMetadataPreferenceConfiguration(v))));
380
- };
381
- // From: PeriodFilterType
382
- export var FtPeriodFilterType;
383
- (function (FtPeriodFilterType) {
384
- FtPeriodFilterType["LAST_WEEK"] = "LAST_WEEK";
385
- FtPeriodFilterType["LAST_MONTH"] = "LAST_MONTH";
386
- FtPeriodFilterType["LAST_QUARTER"] = "LAST_QUARTER";
387
- FtPeriodFilterType["LAST_YEAR"] = "LAST_YEAR";
388
- FtPeriodFilterType["CUSTOM"] = "CUSTOM";
389
- })(FtPeriodFilterType || (FtPeriodFilterType = {}));
390
- export const isFtPeriodFilterType = (o) => {
391
- return ["LAST_WEEK", "LAST_MONTH", "LAST_QUARTER", "LAST_YEAR", "CUSTOM"].includes(o);
392
- };
393
- export const isFtSearchFilter = (o) => {
394
- return isObject(o)
395
- && (isBoolean(o.negative))
396
- && ((Array.isArray(o.values)
397
- && o.values.every((v) => isString(v))))
398
- && (isString(o.key));
399
- };
400
- export const isFtSearchPreset = (o) => {
401
- return isObject(o)
402
- && (isString(o.name))
403
- && ((Array.isArray(o.filters)
404
- && o.filters.every((v) => isFtSearchFilter(v))))
405
- && (isNumber(o.priority))
406
- && (o.contentLocale == null || isString(o.contentLocale));
407
- };
408
- // From: SearchSortCriterionOrder
409
- export var FtSearchSortCriterionOrder;
410
- (function (FtSearchSortCriterionOrder) {
411
- FtSearchSortCriterionOrder["ASC"] = "ASC";
412
- FtSearchSortCriterionOrder["DESC"] = "DESC";
413
- })(FtSearchSortCriterionOrder || (FtSearchSortCriterionOrder = {}));
414
- export const isFtSearchSortCriterionOrder = (o) => {
415
- return ["ASC", "DESC"].includes(o);
416
- };
417
- // From: SearchSortCriterionType
418
- export var FtSearchSortCriterionType;
419
- (function (FtSearchSortCriterionType) {
420
- FtSearchSortCriterionType["ALPHA"] = "ALPHA";
421
- FtSearchSortCriterionType["NATURAL"] = "NATURAL";
422
- })(FtSearchSortCriterionType || (FtSearchSortCriterionType = {}));
423
- export const isFtSearchSortCriterionType = (o) => {
424
- return ["ALPHA", "NATURAL"].includes(o);
425
- };
426
- // From: VirtualField
427
- export var FtVirtualField;
428
- (function (FtVirtualField) {
429
- FtVirtualField["EVERYWHERE"] = "EVERYWHERE";
430
- FtVirtualField["TITLE_ONLY"] = "TITLE_ONLY";
431
- FtVirtualField["NONE"] = "NONE";
432
- })(FtVirtualField || (FtVirtualField = {}));
433
- export const isFtVirtualField = (o) => {
434
- return ["EVERYWHERE", "TITLE_ONLY", "NONE"].includes(o);
435
- };
436
- export const isFtSearchResultsPageInfo = (o) => {
437
- return isObject(o)
438
- && (isNumber(o.totalResultsCount))
439
- && (isBoolean(o.isLastPage))
440
- && (isNumber(o.currentPage))
441
- && (isNumber(o.totalClustersCount));
442
- };
443
- // From: WsEditorialType
444
- export var FtEditorialType;
445
- (function (FtEditorialType) {
446
- FtEditorialType["ARTICLE"] = "ARTICLE";
447
- FtEditorialType["BOOK"] = "BOOK";
448
- FtEditorialType["SHARED_BOOK"] = "SHARED_BOOK";
449
- })(FtEditorialType || (FtEditorialType = {}));
450
- export const isFtEditorialType = (o) => {
451
- return ["ARTICLE", "BOOK", "SHARED_BOOK"].includes(o);
452
- };
453
- // From: WsOpenMode
454
- export var FtOpenMode;
455
- (function (FtOpenMode) {
456
- FtOpenMode["FLUIDTOPICS"] = "FLUIDTOPICS";
457
- FtOpenMode["EXTERNAL"] = "EXTERNAL";
458
- })(FtOpenMode || (FtOpenMode = {}));
459
- export const isFtOpenMode = (o) => {
460
- return ["FLUIDTOPICS", "EXTERNAL"].includes(o);
461
- };
462
- export const isFtPageRequest = (o) => {
463
- return isObject(o)
464
- && (o.perPage == null || isNumber(o.perPage))
465
- && (isNumber(o.page));
466
- };
467
- export const isFtPublicClusterSortCriterion = (o) => {
468
- return isObject(o)
469
- && (isString(o.key));
470
- };
471
- // From: WsPublicCollectionDocumentType
472
- export var FtCollectionDocumentType;
473
- (function (FtCollectionDocumentType) {
474
- FtCollectionDocumentType["MAP"] = "MAP";
475
- FtCollectionDocumentType["DOCUMENT"] = "DOCUMENT";
476
- FtCollectionDocumentType["TOPIC"] = "TOPIC";
477
- FtCollectionDocumentType["PERSONAL_BOOK"] = "PERSONAL_BOOK";
478
- FtCollectionDocumentType["SHARED_BOOK"] = "SHARED_BOOK";
479
- })(FtCollectionDocumentType || (FtCollectionDocumentType = {}));
480
- export const isFtCollectionDocumentType = (o) => {
481
- return ["MAP", "DOCUMENT", "TOPIC", "PERSONAL_BOOK", "SHARED_BOOK"].includes(o);
482
- };
483
- export const isFtSearchResults = (o) => {
484
- return isObject(o)
485
- && (o.spellcheck == null || isFtSpellcheck(o.spellcheck))
486
- && (isFtSearchResultsPageInfo(o.paging))
487
- && ((Array.isArray(o.results)
488
- && o.results.every((v) => isFtSearchResultCluster(v))))
489
- && ((Array.isArray(o.facets)
490
- && o.facets.every((v) => isFtSearchFacet(v))));
491
- };
492
- export const isFtLabeledSearchFilter = (o) => {
493
- return isObject(o)
494
- && (isBoolean(o.negative))
495
- && ((Array.isArray(o.values)
496
- && o.values.every((v) => isString(v))))
497
- && (isString(o.label))
498
- && (isString(o.key));
499
- };
500
- export const isFtPeriod = (o) => {
501
- return isObject(o)
502
- && (isString(o.from))
503
- && (isString(o.to));
504
- };
505
- export const isFtPeriodFilter = (o) => {
506
- return isObject(o)
507
- && (o.period == null || isFtPeriod(o.period))
508
- && (isFtPeriodFilterType(o.periodType))
509
- && (o.key == null || isString(o.key));
510
- };
511
- export const isFtSearchPrior = (o) => {
512
- return isObject(o)
513
- && (isNumber(o.weight))
514
- && (isString(o.value))
515
- && (isString(o.key));
516
- };
517
- export const isFtSearchRequest = (o) => {
518
- return isObject(o)
519
- && (o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
520
- && (isString(o.query))
521
- && (isFtPageRequest(o.paging))
522
- && ((Array.isArray(o.filters)
523
- && o.filters.every((v) => isFtSearchFilter(v))))
524
- && ((Array.isArray(o.sort)
525
- && o.sort.every((v) => isFtSearchSortCriterion(v))))
526
- && (o.virtualField == null || isFtVirtualField(o.virtualField))
527
- && ((Array.isArray(o.facets)
528
- && o.facets.every((v) => isFtSearchFacetConf(v))))
529
- && (o.scope == null || isFtSearchScope(o.scope))
530
- && (o.uiLocale == null || isString(o.uiLocale))
531
- && (o.contentLocale == null || isString(o.contentLocale))
532
- && (o.priors == null || (Array.isArray(o.priors)
533
- && o.priors.every((v) => isFtSearchPrior(v))))
534
- && (o.clusterSortCriterions == null || (Array.isArray(o.clusterSortCriterions)
535
- && o.clusterSortCriterions.every((v) => isFtPublicClusterSortCriterion(v))));
536
- };
537
- export const isFtSearchResultCluster = (o) => {
538
- return isObject(o)
539
- && ((Array.isArray(o.entries)
540
- && o.entries.every((v) => isFtSearchResultClusterEntry(v))))
541
- && (o.metadataVariableAxis == null || isString(o.metadataVariableAxis));
542
- };
543
- export const isFtSearchResultClusterEntry = (o) => {
544
- return isObject(o)
545
- && ((Array.isArray(o.missingTerms)
546
- && o.missingTerms.every((v) => isString(v))))
547
- && (o.document == null || isFtSearchResultUnstructuredDocument(o.document))
548
- && (o.topic == null || isFtSearchResultTopic(o.topic))
549
- && (isFtSearchResultType(o.type))
550
- && (o.map == null || isFtSearchResultMap(o.map));
551
- };
552
- export const isFtSearchResultUnstructuredDocument = (o) => {
553
- return isObject(o)
554
- && ((Array.isArray(o.metadata)
555
- && o.metadata.every((v) => isFtMetadata(v))))
556
- && (isFtOpenMode(o.openMode))
557
- && (isString(o.documentUrl))
558
- && (isString(o.mimeType))
559
- && (isString(o.title))
560
- && (o.lastPublicationDate == null || isString(o.lastPublicationDate))
561
- && (isString(o.viewerUrl))
562
- && (isString(o.contentUrl))
563
- && (isString(o.filename))
564
- && (isString(o.htmlTitle))
565
- && (o.originUrl == null || isString(o.originUrl))
566
- && (isString(o.documentId))
567
- && (isString(o.lastEditionDate))
568
- && (isString(o.htmlExcerpt));
569
- };
570
- export const isFtSearchResultMap = (o) => {
571
- return isObject(o)
572
- && ((Array.isArray(o.metadata)
573
- && o.metadata.every((v) => isFtMetadata(v))))
574
- && (o.openMode == null || isFtOpenMode(o.openMode))
575
- && (isFtEditorialType(o.editorialType))
576
- && (isString(o.title))
577
- && (o.lastPublicationDate == null || isString(o.lastPublicationDate))
578
- && (isString(o.htmlTitle))
579
- && (o.originUrl == null || isString(o.originUrl))
580
- && (isString(o.mapUrl))
581
- && (isString(o.readerUrl))
582
- && (isString(o.mapId))
583
- && (o.lastEditionDate == null || isString(o.lastEditionDate))
584
- && (isString(o.htmlExcerpt));
585
- };
586
- export const isFtSearchResultTopic = (o) => {
587
- return isObject(o)
588
- && ((Array.isArray(o.metadata)
589
- && o.metadata.every((v) => isFtMetadata(v))))
590
- && (isFtOpenMode(o.openMode))
591
- && (isString(o.contentId))
592
- && ((Array.isArray(o.resources)
593
- && o.resources.every((v) => isFtTopicResource(v))))
594
- && (isString(o.title))
595
- && (isString(o.mapTitle))
596
- && (isString(o.topicUrl))
597
- && (isString(o.contentUrl))
598
- && (isString(o.htmlTitle))
599
- && ((Array.isArray(o.breadcrumb)
600
- && o.breadcrumb.every((v) => isString(v))))
601
- && (isString(o.tocId))
602
- && (o.originUrl == null || isString(o.originUrl))
603
- && (isString(o.readerUrl))
604
- && (isString(o.mapId))
605
- && (o.lastEditionDate == null || isString(o.lastEditionDate))
606
- && (isString(o.htmlExcerpt));
607
- };
608
- // From: WsPublicSearchResultType
609
- export var FtSearchResultType;
610
- (function (FtSearchResultType) {
611
- FtSearchResultType["MAP"] = "MAP";
612
- FtSearchResultType["DOCUMENT"] = "DOCUMENT";
613
- FtSearchResultType["TOPIC"] = "TOPIC";
614
- })(FtSearchResultType || (FtSearchResultType = {}));
615
- export const isFtSearchResultType = (o) => {
616
- return ["MAP", "DOCUMENT", "TOPIC"].includes(o);
617
- };
618
- // From: WsPublicSearchScope
619
- export var FtSearchScope;
620
- (function (FtSearchScope) {
621
- FtSearchScope["DEFAULT"] = "DEFAULT";
622
- FtSearchScope["DOCUMENTS"] = "DOCUMENTS";
623
- FtSearchScope["ALL_TOPICS"] = "ALL_TOPICS";
624
- })(FtSearchScope || (FtSearchScope = {}));
625
- export const isFtSearchScope = (o) => {
626
- return ["DEFAULT", "DOCUMENTS", "ALL_TOPICS"].includes(o);
627
- };
628
- export const isFtSearchFacet = (o) => {
629
- return isObject(o)
630
- && (isBoolean(o.hierarchical))
631
- && (isString(o.label))
632
- && (isBoolean(o.multiSelectionable))
633
- && (isString(o.key))
634
- && ((Array.isArray(o.rootNodes)
635
- && o.rootNodes.every((v) => isFtSearchFacetEntry(v))));
636
- };
637
- export const isFtSearchFacetConf = (o) => {
638
- return isObject(o)
639
- && (o.maxDepth == null || isNumber(o.maxDepth))
640
- && (isString(o.id));
641
- };
642
- export const isFtSearchFacetEntry = (o) => {
643
- return isObject(o)
644
- && (isNumber(o.totalResultsCount))
645
- && (isBoolean(o.descendantSelected))
646
- && ((Array.isArray(o.childNodes)
647
- && o.childNodes.every((v) => isFtSearchFacetEntry(v))))
648
- && (isString(o.label))
649
- && (isString(o.value))
650
- && (isBoolean(o.selected));
651
- };
652
- export const isFtSearchSortCriterion = (o) => {
653
- return isObject(o)
654
- && (isFtSearchSortCriterionType(o.type))
655
- && (isString(o.key))
656
- && (isFtSearchSortCriterionOrder(o.order));
657
- };
658
- export const isFtSpellcheck = (o) => {
659
- return isObject(o)
660
- && (isString(o.suggestedQuery))
661
- && (isString(o.htmlSuggestedQuery));
662
- };
663
- export const isFtTopicResource = (o) => {
664
- return isObject(o)
665
- && (isString(o.filename))
666
- && (isString(o.resourceUrl))
667
- && (isString(o.id))
668
- && (isString(o.mimeType))
669
- && (isString(o.resourceContentUrl))
670
- && (isString(o.viewerUrl));
671
- };
672
- export const isFtSuggestRequest = (o) => {
673
- return isObject(o)
674
- && (isString(o.input))
675
- && (o.scope == null || isFtSearchScope(o.scope))
676
- && ((Array.isArray(o.filters)
677
- && o.filters.every((v) => isFtSearchFilter(v))))
678
- && ((Array.isArray(o.sort)
679
- && o.sort.every((v) => isFtSearchSortCriterion(v))))
680
- && (o.maxCount == null || isNumber(o.maxCount))
681
- && (o.contentLocale == null || isString(o.contentLocale));
682
- };
683
- export const isFtSuggestResult = (o) => {
684
- return isObject(o)
685
- && (o.filenameExtension == null || isString(o.filenameExtension))
686
- && (o.editorialType == null || isFtEditorialType(o.editorialType))
687
- && (o.mimeType == null || isString(o.mimeType))
688
- && (isFtSearchResultType(o.type))
689
- && (isString(o.value));
690
- };
691
- export const isFtSuggestResults = (o) => {
692
- return isObject(o)
693
- && ((Array.isArray(o.suggestions)
694
- && o.suggestions.every((v) => isFtSuggestResult(v))));
695
- };
696
- // From: Role
697
- export var FtUserRole;
698
- (function (FtUserRole) {
699
- FtUserRole["PERSONAL_BOOK_USER"] = "PERSONAL_BOOK_USER";
700
- FtUserRole["PERSONAL_BOOK_SHARE_USER"] = "PERSONAL_BOOK_SHARE_USER";
701
- FtUserRole["HTML_EXPORT_USER"] = "HTML_EXPORT_USER";
702
- FtUserRole["PDF_EXPORT_USER"] = "PDF_EXPORT_USER";
703
- FtUserRole["SAVED_SEARCH_USER"] = "SAVED_SEARCH_USER";
704
- FtUserRole["COLLECTION_USER"] = "COLLECTION_USER";
705
- FtUserRole["OFFLINE_USER"] = "OFFLINE_USER";
706
- FtUserRole["ANALYTICS_USER"] = "ANALYTICS_USER";
707
- FtUserRole["BETA_USER"] = "BETA_USER";
708
- FtUserRole["DEBUG_USER"] = "DEBUG_USER";
709
- FtUserRole["PRINT_USER"] = "PRINT_USER";
710
- FtUserRole["RATING_USER"] = "RATING_USER";
711
- FtUserRole["FEEDBACK_USER"] = "FEEDBACK_USER";
712
- FtUserRole["GENERATIVE_AI_USER"] = "GENERATIVE_AI_USER";
713
- FtUserRole["CONTENT_PUBLISHER"] = "CONTENT_PUBLISHER";
714
- FtUserRole["KHUB_ADMIN"] = "KHUB_ADMIN";
715
- FtUserRole["USERS_ADMIN"] = "USERS_ADMIN";
716
- FtUserRole["PORTAL_ADMIN"] = "PORTAL_ADMIN";
717
- FtUserRole["ADMIN"] = "ADMIN";
718
- FtUserRole["DEVELOPER"] = "DEVELOPER";
719
- })(FtUserRole || (FtUserRole = {}));
720
- export const isFtUserRole = (o) => {
721
- return ["PERSONAL_BOOK_USER", "PERSONAL_BOOK_SHARE_USER", "HTML_EXPORT_USER", "PDF_EXPORT_USER", "SAVED_SEARCH_USER", "COLLECTION_USER", "OFFLINE_USER", "ANALYTICS_USER", "BETA_USER", "DEBUG_USER", "PRINT_USER", "RATING_USER", "FEEDBACK_USER", "GENERATIVE_AI_USER", "CONTENT_PUBLISHER", "KHUB_ADMIN", "USERS_ADMIN", "PORTAL_ADMIN", "ADMIN", "DEVELOPER"].includes(o);
722
- };
723
- export const isFtAuthenticationIdentifier = (o) => {
724
- return isObject(o)
725
- && (isString(o.identifier))
726
- && (isString(o.realm));
727
- };
728
- export const isFtAuthenticatedSession = (o) => {
729
- return isObject(o)
730
- && (isFtAuthenticationIdentifier(o.authenticationIdentifier))
731
- && (isFtUserProfile(o.profile));
732
- };
733
- export const isFtSearchPreferences = (o) => {
734
- return isObject(o)
735
- && ((Array.isArray(o.defaultFilters)
736
- && o.defaultFilters.every((v) => isFtSearchFilter(v))));
737
- };
738
- export const isFtSession = (o) => {
739
- return isObject(o)
740
- && (o.authenticationIdentifier == null || isFtAuthenticationIdentifier(o.authenticationIdentifier))
741
- && (isNumber(o.idleTimeoutInMillis))
742
- && (isFtUserProfile(o.profile))
743
- && (isBoolean(o.sessionAuthenticated))
744
- && (isFtSearchPreferences(o.searchPreferences));
745
- };
746
- export const isFtUserProfile = (o) => {
747
- return isObject(o)
748
- && (o.emailAddress == null || isString(o.emailAddress))
749
- && (o.displayName == null || isString(o.displayName))
750
- && ((Array.isArray(o.roles)
751
- && o.roles.every((v) => isFtUserRole(v))))
752
- && (o.userId == null || isString(o.userId))
753
- && ((Array.isArray(o.tags)
754
- && o.tags.every((v) => isString(v))));
755
- };
756
- export const isFtWatermark = (o) => {
757
- return isObject(o)
758
- && (isString(o.color))
759
- && ((Array.isArray(o.text)
760
- && o.text.every((v) => isString(v))))
761
- && (isNumber(o.opacity));
762
- };