@fluid-topics/public-api 1.0.98 → 1.0.100-alpha

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.
@@ -37,49 +37,53 @@ export var FtAnalyticsDocumentType;
37
37
  FtAnalyticsDocumentType["UNSTRUCTURED_DOCUMENT"] = "UNSTRUCTURED_DOCUMENT";
38
38
  FtAnalyticsDocumentType["SHARED_PERSONAL_BOOK"] = "SHARED_PERSONAL_BOOK";
39
39
  FtAnalyticsDocumentType["PERSONAL_BOOK"] = "PERSONAL_BOOK";
40
- FtAnalyticsDocumentType["MAP_ATTACHMENT"] = "MAP_ATTACHMENT";
40
+ FtAnalyticsDocumentType["ATTACHMENT"] = "ATTACHMENT";
41
41
  FtAnalyticsDocumentType["RESOURCE"] = "RESOURCE";
42
42
  })(FtAnalyticsDocumentType || (FtAnalyticsDocumentType = {}));
43
43
  export const isFtAnalyticsDocumentType = (o) => Object.keys(FtAnalyticsDocumentType).includes(o);
44
- export const isFtAnalyticsEventDisplay = (o) => {
45
- return isObject(o)
46
- && (isNumber(o.width))
47
- && (isNumber(o.height));
48
- };
49
- export const isFtAnalyticsEventDocument = (o) => {
50
- return isObject(o)
51
- && (o.metadata == null || (Array.isArray(o.metadata)
52
- && o.metadata.every((v) => isFtMetadata(v))))
53
- && (isString(o.id))
54
- && (o.mimeType == null || isString(o.mimeType))
55
- && (o.title == null || isString(o.title))
56
- && (o.type == null || isFtAnalyticsDocumentType(o.type))
57
- && (o.parentId == null || isString(o.parentId));
58
- };
59
- export const isFtAnalyticsEventGenAIProfile = (o) => {
44
+ export const isFtAnalyticsEventAIProfile = (o) => {
60
45
  return isObject(o)
61
- && (o.chatbotDetails == null || isFtAnalyticsEventGenAIProfileChatbotDetails(o.chatbotDetails))
62
- && (o.translationDetails == null || isFtAnalyticsEventGenAIProfileTranslationDetails(o.translationDetails))
63
- && (o.completionDetails == null || isFtAnalyticsEventGenAIProfileCompletionDetails(o.completionDetails))
46
+ && (o.chatbotDetails == null || isFtAnalyticsEventAIProfileChatbotDetails(o.chatbotDetails))
47
+ && (o.translationDetails == null || isFtAnalyticsEventAIProfileTranslationDetails(o.translationDetails))
48
+ && (o.completionDetails == null || isFtAnalyticsEventAIProfileCompletionDetails(o.completionDetails))
64
49
  && (isString(o.name))
65
50
  && (isString(o.id))
66
51
  && (isString(o.type));
67
52
  };
68
- export const isFtAnalyticsEventGenAIProfileChatbotDetails = (o) => {
53
+ export const isFtAnalyticsEventAIProfileChatbotDetails = (o) => {
69
54
  return isObject(o)
70
55
  && (isString(o.provider))
71
56
  && (o.model == null || isString(o.model));
72
57
  };
73
- export const isFtAnalyticsEventGenAIProfileCompletionDetails = (o) => {
58
+ export const isFtAnalyticsEventAIProfileCompletionDetails = (o) => {
74
59
  return isObject(o)
75
60
  && (isString(o.provider))
76
61
  && (o.model == null || isString(o.model));
77
62
  };
78
- export const isFtAnalyticsEventGenAIProfileTranslationDetails = (o) => {
63
+ export const isFtAnalyticsEventAIProfileTranslationDetails = (o) => {
79
64
  return isObject(o)
80
65
  && (isString(o.provider))
81
66
  && (o.engine == null || isString(o.engine));
82
67
  };
68
+ export const isFtAnalyticsEventDisplay = (o) => {
69
+ return isObject(o)
70
+ && (isNumber(o.width))
71
+ && (isNumber(o.height));
72
+ };
73
+ export const isFtAnalyticsEventDocument = (o) => {
74
+ return isObject(o)
75
+ && (o.metadata == null || (Array.isArray(o.metadata)
76
+ && o.metadata.every((v) => isFtMetadata(v))))
77
+ && (isString(o.id))
78
+ && (o.mimeType == null || isString(o.mimeType))
79
+ && (o.title == null || isString(o.title))
80
+ && (o.type == null || isFtAnalyticsDocumentType(o.type))
81
+ && (o.parentId == null || isString(o.parentId));
82
+ };
83
+ export const isFtAnalyticsEventDocumentSearchQuery = (o) => {
84
+ return isObject(o)
85
+ && (isString(o.terms));
86
+ };
83
87
  export const isFtAnalyticsEventLocation = (o) => {
84
88
  return isObject(o)
85
89
  && (isString(o.type))
@@ -124,7 +128,7 @@ export const isFtAnalyticsEventSearchQuery = (o) => {
124
128
  };
125
129
  export const isFtAnalyticsEventSearchResponse = (o) => {
126
130
  return isObject(o)
127
- && (o.autocorrect == null || isBoolean(o.autocorrect))
131
+ && (isBoolean(o.autocorrect))
128
132
  && (isNumber(o.nbResults));
129
133
  };
130
134
  export const isFtAnalyticsEventSearchResult = (o) => {
@@ -150,7 +154,7 @@ export var FtAnalyticsPublicationType;
150
154
  FtAnalyticsPublicationType["UNSTRUCTURED_DOCUMENT"] = "UNSTRUCTURED_DOCUMENT";
151
155
  FtAnalyticsPublicationType["SHARED_PERSONAL_BOOK"] = "SHARED_PERSONAL_BOOK";
152
156
  FtAnalyticsPublicationType["PERSONAL_BOOK"] = "PERSONAL_BOOK";
153
- FtAnalyticsPublicationType["MAP_ATTACHMENT"] = "MAP_ATTACHMENT";
157
+ FtAnalyticsPublicationType["ATTACHMENT"] = "ATTACHMENT";
154
158
  FtAnalyticsPublicationType["RESOURCE"] = "RESOURCE";
155
159
  })(FtAnalyticsPublicationType || (FtAnalyticsPublicationType = {}));
156
160
  export const isFtAnalyticsPublicationType = (o) => Object.keys(FtAnalyticsPublicationType).includes(o);
@@ -181,10 +185,33 @@ export var FtAnalyticsSearchFacetType;
181
185
  FtAnalyticsSearchFacetType["RANGE"] = "RANGE";
182
186
  })(FtAnalyticsSearchFacetType || (FtAnalyticsSearchFacetType = {}));
183
187
  export const isFtAnalyticsSearchFacetType = (o) => Object.keys(FtAnalyticsSearchFacetType).includes(o);
188
+ export const isFtAiCaseDeflectionEvent = (o) => {
189
+ return isObject(o)
190
+ && (o.generationId == null || isString(o.generationId))
191
+ && (o.searchQuery == null || isFtAnalyticsEventSearchQuery(o.searchQuery))
192
+ && (isString(o.context));
193
+ };
194
+ export const isFtAiCompletedQueryEvent = (o) => {
195
+ return isObject(o)
196
+ && (isString(o.result))
197
+ && (isFtAnalyticsEventAIProfile(o.profile))
198
+ && (isNumber(o.durationMs))
199
+ && (o.parameters == null || (isObject(o.parameters)
200
+ && Object.keys(o.parameters).every((k) => isString(k))
201
+ && Object.values(o.parameters).every((v) => isString(v))))
202
+ && (isString(o.queryId));
203
+ };
204
+ export const isFtAiRateEvent = (o) => {
205
+ return isObject(o)
206
+ && (isFtAnalyticsEventRating(o.rating))
207
+ && (isString(o.comment))
208
+ && (isString(o.queryId));
209
+ };
184
210
  export const isFtAnalyticsEvent = (o) => {
185
211
  return isObject(o)
186
212
  && (isBoolean(o.offline))
187
213
  && (isString(o.appVersion))
214
+ && (o.internal == null || isBoolean(o.internal))
188
215
  && (isString(o.appName))
189
216
  && (isFtAnalyticsEventName(o.name));
190
217
  };
@@ -199,6 +226,7 @@ export var FtAnalyticsEventName;
199
226
  FtAnalyticsEventName["COLLECTION__CREATE"] = "COLLECTION__CREATE";
200
227
  FtAnalyticsEventName["COLLECTION__UPDATE"] = "COLLECTION__UPDATE";
201
228
  FtAnalyticsEventName["COLLECTION__DELETE"] = "COLLECTION__DELETE";
229
+ FtAnalyticsEventName["CUSTOM_EVENT__TRIGGER"] = "CUSTOM_EVENT__TRIGGER";
202
230
  FtAnalyticsEventName["DOCUMENT__DISPLAY"] = "DOCUMENT__DISPLAY";
203
231
  FtAnalyticsEventName["DOCUMENT__DOWNLOAD"] = "DOCUMENT__DOWNLOAD";
204
232
  FtAnalyticsEventName["DOCUMENT__PRINT"] = "DOCUMENT__PRINT";
@@ -208,10 +236,10 @@ export var FtAnalyticsEventName;
208
236
  FtAnalyticsEventName["DOCUMENT__START_DISPLAY"] = "DOCUMENT__START_DISPLAY";
209
237
  FtAnalyticsEventName["DOCUMENT__UNRATE"] = "DOCUMENT__UNRATE";
210
238
  FtAnalyticsEventName["FEEDBACK__SEND"] = "FEEDBACK__SEND";
211
- FtAnalyticsEventName["GEN_AI__COMPLETED_QUERY"] = "GEN_AI__COMPLETED_QUERY";
212
- FtAnalyticsEventName["GEN_AI__RATE"] = "GEN_AI__RATE";
213
- FtAnalyticsEventName["GENAI_CASE_DEFLECTION__START"] = "GENAI_CASE_DEFLECTION__START";
214
- FtAnalyticsEventName["GENAI_CASE_DEFLECTION__OPEN_TICKET"] = "GENAI_CASE_DEFLECTION__OPEN_TICKET";
239
+ FtAnalyticsEventName["AI__COMPLETED_QUERY"] = "AI__COMPLETED_QUERY";
240
+ FtAnalyticsEventName["AI__RATE"] = "AI__RATE";
241
+ FtAnalyticsEventName["AI_CASE_DEFLECTION__START"] = "AI_CASE_DEFLECTION__START";
242
+ FtAnalyticsEventName["AI_CASE_DEFLECTION__OPEN_TICKET"] = "AI_CASE_DEFLECTION__OPEN_TICKET";
215
243
  FtAnalyticsEventName["KHUB__PROCESS"] = "KHUB__PROCESS";
216
244
  FtAnalyticsEventName["KHUB__SEARCH"] = "KHUB__SEARCH";
217
245
  FtAnalyticsEventName["LABELS__DOWNLOAD"] = "LABELS__DOWNLOAD";
@@ -244,6 +272,12 @@ export const isFtCaseDeflectionEvent = (o) => {
244
272
  && (o.rating == null || isFtAnalyticsEventRating(o.rating))
245
273
  && (o.topic == null || isFtAnalyticsEventTopic(o.topic));
246
274
  };
275
+ export const isFtCustomTriggerEvent = (o) => {
276
+ return isObject(o)
277
+ && (o.componentId == null || isString(o.componentId))
278
+ && (isString(o.eventName))
279
+ && (isFtAnalyticsEventPage(o.page));
280
+ };
247
281
  export const isFtDocumentDisplayEvent = (o) => {
248
282
  return isObject(o)
249
283
  && (o.publication == null || isFtAnalyticsEventPublication(o.publication))
@@ -266,7 +300,7 @@ export const isFtDocumentSearchEvent = (o) => {
266
300
  && (isFtAnalyticsEventSearchResponse(o.searchResponse))
267
301
  && (o.publication == null || isFtAnalyticsEventPublication(o.publication))
268
302
  && (o.document == null || isFtAnalyticsEventDocument(o.document))
269
- && (isFtAnalyticsEventSearchQuery(o.searchQuery));
303
+ && (isFtAnalyticsEventDocumentSearchQuery(o.searchQuery));
270
304
  };
271
305
  export const isFtDocumentStartDisplayEvent = (o) => {
272
306
  return isObject(o)
@@ -282,18 +316,6 @@ export const isFtFeedbackSendEvent = (o) => {
282
316
  && (o.document == null || isFtAnalyticsEventDocument(o.document))
283
317
  && (isBoolean(o.loggedIn));
284
318
  };
285
- export const isFtGenAiCaseDeflectionEvent = (o) => {
286
- return isObject(o)
287
- && (o.generationId == null || isString(o.generationId))
288
- && (o.searchQuery == null || isFtAnalyticsEventSearchQuery(o.searchQuery))
289
- && (isString(o.context));
290
- };
291
- export const isFtGenAiRateEvent = (o) => {
292
- return isObject(o)
293
- && (isFtAnalyticsEventRating(o.rating))
294
- && (isString(o.comment))
295
- && (isString(o.queryId));
296
- };
297
319
  export const isFtKhubSearchEvent = (o) => {
298
320
  return isObject(o)
299
321
  && (isFtAnalyticsEventSearchResponse(o.searchResponse))
@@ -411,28 +433,29 @@ export const isFtMap = (o) => {
411
433
  && (o.prettyUrl == null || isString(o.prettyUrl))
412
434
  && ((Array.isArray(o.metadata)
413
435
  && o.metadata.every((v) => isFtMetadata(v))))
414
- && (o.watermark == null || isFtWatermark(o.watermark))
415
- && (isFtOpenMode(o.openMode))
416
436
  && (o.topicsApiEndpoint == null || isString(o.topicsApiEndpoint))
417
437
  && (o.description == null || isString(o.description))
418
- && (o.attachmentsApiEndpoint == null || isString(o.attachmentsApiEndpoint))
419
438
  && (isFtEditorialType(o.editorialType))
420
439
  && (isString(o.baseId))
421
440
  && (isString(o.clusterId))
422
441
  && (isString(o.title))
423
- && (isString(o.lastPublication))
424
- && (isBoolean(o.pbkConfidential))
425
442
  && (isString(o.lastEdition))
426
443
  && (isString(o.originId))
427
444
  && (o.rightsApiEndpoint == null || isString(o.rightsApiEndpoint))
428
- && (isFtMapStyles(o.contentStyles))
429
- && (o.originUrl == null || isString(o.originUrl))
430
445
  && (isString(o.fingerprint))
431
446
  && (isString(o.readerUrl))
432
- && (o.untranslatedTitle == null || o.untranslatedTitle == null || isString(o.untranslatedTitle))
447
+ && (o.untranslatedTitle == null || isString(o.untranslatedTitle))
433
448
  && (o.khubVersion == null || isString(o.khubVersion))
434
449
  && (isString(o.id))
435
- && (o.lang == null || isString(o.lang));
450
+ && (o.lang == null || isString(o.lang))
451
+ && (o.watermark == null || isFtWatermark(o.watermark))
452
+ && (isFtOpenMode(o.openMode))
453
+ && (o.attachmentsApiEndpoint == null || isString(o.attachmentsApiEndpoint))
454
+ && (isString(o.lastPublication))
455
+ && (isBoolean(o.pbkConfidential))
456
+ && (isFtMapStyles(o.contentStyles))
457
+ && (o.originUrl == null || isString(o.originUrl))
458
+ && (isBoolean(o.translationError));
436
459
  };
437
460
  export const isFtMapStyles = (o) => {
438
461
  return isObject(o)
@@ -450,7 +473,7 @@ export const isFtTocNode = (o) => {
450
473
  && o.children.every((v) => isFtTocNode(v))))
451
474
  && (o.origin == null || isFtTopicOrigin(o.origin))
452
475
  && (isString(o.contentId))
453
- && (o.untranslatedTitle == null || o.untranslatedTitle == null || isString(o.untranslatedTitle))
476
+ && (o.untranslatedTitle == null || isString(o.untranslatedTitle))
454
477
  && (isString(o.title));
455
478
  };
456
479
  export const isFtTopic = (o) => {
@@ -479,18 +502,18 @@ export const isFtUnstructuredDocument = (o) => {
479
502
  && (isString(o.openMode))
480
503
  && (o.description == null || isString(o.description))
481
504
  && (isString(o.mimeType))
482
- && (o.baseId == null || isString(o.baseId))
505
+ && (isString(o.baseId))
483
506
  && (o.clusterId == null || isString(o.clusterId))
484
507
  && (isString(o.contentApiEndpoint))
485
508
  && (isString(o.title))
486
- && (o.lastPublication == null || isString(o.lastPublication))
509
+ && (isString(o.lastPublication))
487
510
  && (isString(o.viewerUrl))
488
511
  && (isString(o.lastEdition))
489
512
  && (isString(o.filename))
490
513
  && (o.originId == null || isString(o.originId))
491
514
  && (isString(o.rightsApiEndpoint))
492
515
  && (o.originUrl == null || isString(o.originUrl))
493
- && (o.khubVersion == null || isString(o.khubVersion))
516
+ && (isString(o.khubVersion))
494
517
  && (isString(o.id))
495
518
  && (o.lang == null || isString(o.lang));
496
519
  };
@@ -638,12 +661,13 @@ export const isFtMySearchCreation = (o) => {
638
661
  };
639
662
  export const isFtMySearchRequest = (o) => {
640
663
  return isObject(o)
641
- && (o.periodFilter == null || o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
664
+ && (o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
665
+ && (o.sortId == null || isString(o.sortId))
642
666
  && (isString(o.query))
643
667
  && (o.scope == null || isFtSearchScope(o.scope))
644
668
  && (o.filters == null || (Array.isArray(o.filters)
645
669
  && o.filters.every((v) => isFtLegacyLabeledMetadataFilter(v))))
646
- && ((Array.isArray(o.sort)
670
+ && (o.sort == null || (Array.isArray(o.sort)
647
671
  && o.sort.every((v) => isFtSearchSortCriterion(v))))
648
672
  && (o.virtualField == null || isFtVirtualField(o.virtualField))
649
673
  && (o.metadataFilters == null || (Array.isArray(o.metadataFilters)
@@ -884,18 +908,19 @@ export const isFtSearchPrior = (o) => {
884
908
  };
885
909
  export const isFtSearchRequest = (o) => {
886
910
  return isObject(o)
887
- && (o.periodFilter == null || o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
911
+ && (o.periodFilter == null || isFtPeriodFilter(o.periodFilter))
888
912
  && (isString(o.query))
889
913
  && (isFtPageRequest(o.paging))
890
914
  && (o.filters == null || (Array.isArray(o.filters)
891
915
  && o.filters.every((v) => isFtLegacyMetadataFilter(v))))
892
- && ((Array.isArray(o.sort)
916
+ && (o.sort == null || (Array.isArray(o.sort)
893
917
  && o.sort.every((v) => isFtSearchSortCriterion(v))))
894
918
  && (o.virtualField == null || isFtVirtualField(o.virtualField))
895
919
  && ((Array.isArray(o.metadataFilters)
896
920
  && o.metadataFilters.every((v) => isFtMetadataFilter(v))))
897
921
  && ((Array.isArray(o.facets)
898
922
  && o.facets.every((v) => isFtSearchFacetConf(v))))
923
+ && (o.sortId == null || isString(o.sortId))
899
924
  && (o.scope == null || isFtSearchScope(o.scope))
900
925
  && (o.uiLocale == null || isString(o.uiLocale))
901
926
  && (o.contentLocale == null || isString(o.contentLocale))
@@ -923,11 +948,11 @@ export const isFtSearchResultUnstructuredDocument = (o) => {
923
948
  return isObject(o)
924
949
  && ((Array.isArray(o.metadata)
925
950
  && o.metadata.every((v) => isFtMetadata(v))))
926
- && (isFtOpenMode(o.openMode))
951
+ && (o.openMode == null || isFtOpenMode(o.openMode))
927
952
  && (isString(o.documentUrl))
928
953
  && (isString(o.mimeType))
929
954
  && (isString(o.title))
930
- && (o.lastPublicationDate == null || isString(o.lastPublicationDate))
955
+ && (isString(o.lastPublicationDate))
931
956
  && (isString(o.viewerUrl))
932
957
  && (isString(o.contentUrl))
933
958
  && (isString(o.filename))
@@ -944,7 +969,7 @@ export const isFtSearchResultMap = (o) => {
944
969
  && (o.openMode == null || isFtOpenMode(o.openMode))
945
970
  && (isFtEditorialType(o.editorialType))
946
971
  && (isString(o.title))
947
- && (o.lastPublicationDate == null || isString(o.lastPublicationDate))
972
+ && (isString(o.lastPublicationDate))
948
973
  && (isString(o.htmlTitle))
949
974
  && (o.originUrl == null || isString(o.originUrl))
950
975
  && (isString(o.mapUrl))
@@ -957,7 +982,7 @@ export const isFtSearchResultTopic = (o) => {
957
982
  return isObject(o)
958
983
  && ((Array.isArray(o.metadata)
959
984
  && o.metadata.every((v) => isFtMetadata(v))))
960
- && (isFtOpenMode(o.openMode))
985
+ && (o.openMode == null || isFtOpenMode(o.openMode))
961
986
  && (isString(o.contentId))
962
987
  && ((Array.isArray(o.resources)
963
988
  && o.resources.every((v) => isFtTopicResource(v))))
@@ -1042,9 +1067,18 @@ export const isFtTopicResource = (o) => {
1042
1067
  && (isString(o.resourceContentUrl))
1043
1068
  && (isString(o.viewerUrl));
1044
1069
  };
1070
+ // From: LocalizableLabelType
1071
+ export var FtLocalizableLabelType;
1072
+ (function (FtLocalizableLabelType) {
1073
+ FtLocalizableLabelType["PLAIN_TEXT"] = "PLAIN_TEXT";
1074
+ FtLocalizableLabelType["LOCALIZED_OFFICIAL"] = "LOCALIZED_OFFICIAL";
1075
+ FtLocalizableLabelType["LOCALIZED_CUSTOM"] = "LOCALIZED_CUSTOM";
1076
+ })(FtLocalizableLabelType || (FtLocalizableLabelType = {}));
1077
+ export const isFtLocalizableLabelType = (o) => Object.keys(FtLocalizableLabelType).includes(o);
1045
1078
  export const isFtSuggestRequest = (o) => {
1046
1079
  return isObject(o)
1047
1080
  && (isString(o.input))
1081
+ && (o.sortId == null || isString(o.sortId))
1048
1082
  && (o.scope == null || isFtSearchScope(o.scope))
1049
1083
  && ((Array.isArray(o.sort)
1050
1084
  && o.sort.every((v) => isFtSearchSortCriterion(v))))
@@ -1092,6 +1126,15 @@ export var FtUserRole;
1092
1126
  FtUserRole["ADMIN"] = "ADMIN";
1093
1127
  })(FtUserRole || (FtUserRole = {}));
1094
1128
  export const isFtUserRole = (o) => Object.keys(FtUserRole).includes(o);
1129
+ // From: UserAssetType
1130
+ export var FtUserAssetType;
1131
+ (function (FtUserAssetType) {
1132
+ FtUserAssetType["SEARCHES"] = "SEARCHES";
1133
+ FtUserAssetType["BOOKMARKS"] = "BOOKMARKS";
1134
+ FtUserAssetType["BOOKS"] = "BOOKS";
1135
+ FtUserAssetType["COLLECTIONS"] = "COLLECTIONS";
1136
+ })(FtUserAssetType || (FtUserAssetType = {}));
1137
+ export const isFtUserAssetType = (o) => Object.keys(FtUserAssetType).includes(o);
1095
1138
  export const isFtAuthenticationIdentifier = (o) => {
1096
1139
  return isObject(o)
1097
1140
  && (isString(o.identifier))
@@ -1129,6 +1172,11 @@ export const isFtUserProfile = (o) => {
1129
1172
  && ((Array.isArray(o.tags)
1130
1173
  && o.tags.every((v) => isString(v))));
1131
1174
  };
1175
+ export const isFtUserAssetCount = (o) => {
1176
+ return isObject(o)
1177
+ && (isNumber(o.count))
1178
+ && (isFtUserAssetType(o.userAssetType));
1179
+ };
1132
1180
  export const isFtWatermark = (o) => {
1133
1181
  return isObject(o)
1134
1182
  && (isString(o.color))
@@ -1136,3 +1184,22 @@ export const isFtWatermark = (o) => {
1136
1184
  && o.text.every((v) => isString(v))))
1137
1185
  && (isNumber(o.opacity));
1138
1186
  };
1187
+ export const isFtLocalizableLabel = (o) => {
1188
+ return isObject(o)
1189
+ && (isString(o.context))
1190
+ && (isString(o.text))
1191
+ && (isFtLocalizableLabelType(o.type))
1192
+ && (isString(o.key));
1193
+ };
1194
+ export const isFtSearchConfiguration = (o) => {
1195
+ return isObject(o)
1196
+ && ((Array.isArray(o.sortOptions)
1197
+ && o.sortOptions.every((v) => isFtSearchSortOption(v))));
1198
+ };
1199
+ export const isFtSearchSortOption = (o) => {
1200
+ return isObject(o)
1201
+ && (isString(o.id))
1202
+ && (isFtLocalizableLabel(o.label))
1203
+ && ((Array.isArray(o.sortCriteria)
1204
+ && o.sortCriteria.every((v) => isFtSearchSortCriterion(v))));
1205
+ };
@@ -51,6 +51,78 @@ export interface FtRagInput {
51
51
  filters?: Array<FtSemanticSearchFilter>;
52
52
  }
53
53
  export declare const isFtRagInput: (o: any) => o is FtRagInput;
54
+ export interface FtGenAIGenerationFetchTracesRequest {
55
+ endDate?: string;
56
+ nbResults?: number;
57
+ userId?: string;
58
+ startDate?: string;
59
+ }
60
+ export declare const isFtGenAIGenerationFetchTracesRequest: (o: any) => o is FtGenAIGenerationFetchTracesRequest;
61
+ export interface FtGenAIFetchGenerationTracesResult {
62
+ endDate?: string;
63
+ nbResults: number;
64
+ results: Array<FtGenAIGenerationTrace>;
65
+ startDate?: string;
66
+ }
67
+ export declare const isFtGenAIFetchGenerationTracesResult: (o: any) => o is FtGenAIFetchGenerationTracesResult;
68
+ export interface FtGenAIGenerationTrace {
69
+ output: FtGenAIGenerationTraceOutput;
70
+ input: FtGenAIGenerationTraceInput;
71
+ profileId?: string;
72
+ id: string;
73
+ sessionId?: string;
74
+ userId?: string;
75
+ timestamp: string;
76
+ }
77
+ export declare const isFtGenAIGenerationTrace: (o: any) => o is FtGenAIGenerationTrace;
78
+ export interface FtGenAIGenerationTraceInput {
79
+ query: string;
80
+ }
81
+ export declare const isFtGenAIGenerationTraceInput: (o: any) => o is FtGenAIGenerationTraceInput;
82
+ export interface FtGenAIGenerationTraceOutput {
83
+ response: string;
84
+ }
85
+ export declare const isFtGenAIGenerationTraceOutput: (o: any) => o is FtGenAIGenerationTraceOutput;
86
+ export interface FtGenAIRagFetchTracesRequest {
87
+ endDate?: string;
88
+ nbResults?: number;
89
+ userId?: string;
90
+ startDate?: string;
91
+ }
92
+ export declare const isFtGenAIRagFetchTracesRequest: (o: any) => o is FtGenAIRagFetchTracesRequest;
93
+ export interface FtGenAIFetchRagTracesResult {
94
+ endDate?: string;
95
+ nbResults: number;
96
+ results: Array<FtGenAIRagTrace>;
97
+ startDate?: string;
98
+ }
99
+ export declare const isFtGenAIFetchRagTracesResult: (o: any) => o is FtGenAIFetchRagTracesResult;
100
+ export interface FtGenAIRagTrace {
101
+ output: FtGenAIRagTraceOutput;
102
+ input: FtGenAIRagTraceInput;
103
+ conversationId?: string;
104
+ profileId?: string;
105
+ id: string;
106
+ sessionId?: string;
107
+ userId?: string;
108
+ timestamp: string;
109
+ }
110
+ export declare const isFtGenAIRagTrace: (o: any) => o is FtGenAIRagTrace;
111
+ export interface FtGenAIRagTraceHistoryItem {
112
+ role: string;
113
+ content: string;
114
+ }
115
+ export declare const isFtGenAIRagTraceHistoryItem: (o: any) => o is FtGenAIRagTraceHistoryItem;
116
+ export interface FtGenAIRagTraceInput {
117
+ userInstructions: string;
118
+ query: string;
119
+ history: Array<FtGenAIRagTraceHistoryItem>;
120
+ }
121
+ export declare const isFtGenAIRagTraceInput: (o: any) => o is FtGenAIRagTraceInput;
122
+ export interface FtGenAIRagTraceOutput {
123
+ response: string;
124
+ }
125
+ export declare const isFtGenAIRagTraceOutput: (o: any) => o is FtGenAIRagTraceOutput;
54
126
  export declare enum TranslationFormat {
55
127
  TEXT = "TEXT",
56
128
  HTML = "HTML"
@@ -64,6 +64,81 @@ export const isFtRagInput = (o) => {
64
64
  && (o.filters == null || (Array.isArray(o.filters)
65
65
  && o.filters.every((v) => isFtSemanticSearchFilter(v))));
66
66
  };
67
+ export const isFtGenAIGenerationFetchTracesRequest = (o) => {
68
+ return isObject(o)
69
+ && (o.endDate == null || isString(o.endDate))
70
+ && (o.nbResults == null || isNumber(o.nbResults))
71
+ && (o.userId == null || isString(o.userId))
72
+ && (o.startDate == null || isString(o.startDate));
73
+ };
74
+ export const isFtGenAIFetchGenerationTracesResult = (o) => {
75
+ return isObject(o)
76
+ && (o.endDate == null || isString(o.endDate))
77
+ && (isNumber(o.nbResults))
78
+ && ((Array.isArray(o.results)
79
+ && o.results.every((v) => isFtGenAIGenerationTrace(v))))
80
+ && (o.startDate == null || isString(o.startDate));
81
+ };
82
+ export const isFtGenAIGenerationTrace = (o) => {
83
+ return isObject(o)
84
+ && (isFtGenAIGenerationTraceOutput(o.output))
85
+ && (isFtGenAIGenerationTraceInput(o.input))
86
+ && (o.profileId == null || isString(o.profileId))
87
+ && (isString(o.id))
88
+ && (o.sessionId == null || isString(o.sessionId))
89
+ && (o.userId == null || isString(o.userId))
90
+ && (isString(o.timestamp));
91
+ };
92
+ export const isFtGenAIGenerationTraceInput = (o) => {
93
+ return isObject(o)
94
+ && (isString(o.query));
95
+ };
96
+ export const isFtGenAIGenerationTraceOutput = (o) => {
97
+ return isObject(o)
98
+ && (isString(o.response));
99
+ };
100
+ export const isFtGenAIRagFetchTracesRequest = (o) => {
101
+ return isObject(o)
102
+ && (o.endDate == null || isString(o.endDate))
103
+ && (o.nbResults == null || isNumber(o.nbResults))
104
+ && (o.userId == null || isString(o.userId))
105
+ && (o.startDate == null || isString(o.startDate));
106
+ };
107
+ export const isFtGenAIFetchRagTracesResult = (o) => {
108
+ return isObject(o)
109
+ && (o.endDate == null || isString(o.endDate))
110
+ && (isNumber(o.nbResults))
111
+ && ((Array.isArray(o.results)
112
+ && o.results.every((v) => isFtGenAIRagTrace(v))))
113
+ && (o.startDate == null || isString(o.startDate));
114
+ };
115
+ export const isFtGenAIRagTrace = (o) => {
116
+ return isObject(o)
117
+ && (isFtGenAIRagTraceOutput(o.output))
118
+ && (isFtGenAIRagTraceInput(o.input))
119
+ && (o.conversationId == null || isString(o.conversationId))
120
+ && (o.profileId == null || isString(o.profileId))
121
+ && (isString(o.id))
122
+ && (o.sessionId == null || isString(o.sessionId))
123
+ && (o.userId == null || isString(o.userId))
124
+ && (isString(o.timestamp));
125
+ };
126
+ export const isFtGenAIRagTraceHistoryItem = (o) => {
127
+ return isObject(o)
128
+ && (isString(o.role))
129
+ && (isString(o.content));
130
+ };
131
+ export const isFtGenAIRagTraceInput = (o) => {
132
+ return isObject(o)
133
+ && (isString(o.userInstructions))
134
+ && (isString(o.query))
135
+ && ((Array.isArray(o.history)
136
+ && o.history.every((v) => isFtGenAIRagTraceHistoryItem(v))));
137
+ };
138
+ export const isFtGenAIRagTraceOutput = (o) => {
139
+ return isObject(o)
140
+ && (isString(o.response));
141
+ };
67
142
  export var TranslationFormat;
68
143
  (function (TranslationFormat) {
69
144
  TranslationFormat["TEXT"] = "TEXT";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/public-api",
3
- "version": "1.0.98",
3
+ "version": "1.0.100-alpha",
4
4
  "description": "Fluid Topics Public API",
5
5
  "author": "Fluid Topics dev team <opensource@antidot.net>",
6
6
  "license": "LGPL-3.0-only",
@@ -38,7 +38,7 @@
38
38
  "chai": "4.3.7",
39
39
  "fetch-mock": "9.11.0",
40
40
  "mocha": "10.2.0",
41
- "rollup": "3.20.6",
41
+ "rollup": "3.20.7",
42
42
  "rollup-plugin-terser": "7.0.2",
43
43
  "rollup-plugin-typescript2": "0.34.1",
44
44
  "ts-node": "10.9.1",
package/.npmignore DELETED
@@ -1,14 +0,0 @@
1
- .gradle
2
- .editorconfig
3
- build
4
- build.gradle.kts
5
- node_modules
6
- test
7
- test-browser
8
- packages
9
- src
10
- tsconfig.*
11
- rollup.config.js
12
- INTERNAL_README.md
13
- vite-plugin.mjs
14
- web-test-runner.config.mjs
package/.yarnrc DELETED
@@ -1 +0,0 @@
1
- --frozen-lockfile false
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
3
- var __asyncValues = (this && this.__asyncValues) || function (o) {
4
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
5
- var m = o[Symbol.asyncIterator], i;
6
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
7
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
8
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
9
- };
10
- var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
11
- var i, p;
12
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
13
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
14
- };
15
- var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
16
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
17
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
18
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
19
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
20
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
21
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
22
- function fulfill(value) { resume("next", value); }
23
- function reject(value) { resume("throw", value); }
24
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
25
- };
26
- Object.defineProperty(exports, "__esModule", { value: true });
27
- exports.GenAIChunkReader = void 0;
28
- class GenAIChunkReader {
29
- constructor(reader) {
30
- this.reader = reader;
31
- this.decoder = new TextDecoder();
32
- this.partialChunk = "";
33
- }
34
- read() {
35
- return __asyncGenerator(this, arguments, function* read_1() {
36
- while (true) {
37
- const { done, value } = yield __await(this.reader.read());
38
- if (done) {
39
- yield __await(yield* __asyncDelegator(__asyncValues(this.readRemainingChunks())));
40
- return yield __await(void 0);
41
- }
42
- else {
43
- yield __await(yield* __asyncDelegator(__asyncValues(this.readChunksFromValue(value))));
44
- }
45
- }
46
- });
47
- }
48
- *readRemainingChunks() {
49
- yield* this.parseLine(this.partialChunk);
50
- }
51
- *readChunksFromValue(value) {
52
- const text = this.partialChunk + this.decoder.decode(value);
53
- const lines = text.split("\n");
54
- this.partialChunk = lines.pop();
55
- for (let line of lines) {
56
- yield* this.parseLine(line);
57
- }
58
- }
59
- *parseLine(line) {
60
- const [type, content] = line.split(/:(.*)/);
61
- if (type == "data" && content.length > 0) {
62
- yield JSON.parse(content);
63
- }
64
- }
65
- }
66
- exports.GenAIChunkReader = GenAIChunkReader;