@fluid-topics/public-api 1.0.33 → 1.0.34
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/index.js +3 -3
- package/dist/cjs/types/ft-common/public.js +1 -1
- package/dist/fluidtopics.min.js +1 -1
- package/dist/mjs/preferences/unauthenticated-preferences.d.ts +1 -1
- package/dist/mjs/types/ft-common/public.d.ts +8 -8
- package/dist/mjs/types/ft-common/public.js +1 -1
- package/package.json +20 -18
- package/.yarnrc +0 -1
package/dist/cjs/index.js
CHANGED
|
@@ -53,6 +53,9 @@ function getBody(response) {
|
|
|
53
53
|
return response.headers.get("Content-Type") === "application/json" ? response.json() : response.text();
|
|
54
54
|
}
|
|
55
55
|
class FluidTopicsApi {
|
|
56
|
+
get defaultHeaders() {
|
|
57
|
+
return Object.assign(Object.assign(Object.assign({}, this.authorization), this.searchLabel), { "Ft-Calling-App": this.ftCallingApp });
|
|
58
|
+
}
|
|
56
59
|
constructor(tenantBaseUrl, integrationIdentifier, overrideIdentifierIfOnTenant) {
|
|
57
60
|
var _a, _b, _c, _d, _e, _f;
|
|
58
61
|
this.endpoints = {
|
|
@@ -154,9 +157,6 @@ class FluidTopicsApi {
|
|
|
154
157
|
this.ftCallingApp = `ft-public-api/${integrationIdentifier}`;
|
|
155
158
|
}
|
|
156
159
|
}
|
|
157
|
-
get defaultHeaders() {
|
|
158
|
-
return Object.assign(Object.assign(Object.assign({}, this.authorization), this.searchLabel), { "Ft-Calling-App": this.ftCallingApp });
|
|
159
|
-
}
|
|
160
160
|
setApiKey(apiKey) {
|
|
161
161
|
this.authorization = { "Authorization": "Bearer " + apiKey };
|
|
162
162
|
}
|
|
@@ -279,7 +279,7 @@ exports.isFtSearchPreset = isFtSearchPreset;
|
|
|
279
279
|
const isFtSearchResultsPageInfo = (o) => {
|
|
280
280
|
return isObject(o)
|
|
281
281
|
&& (isNumber(o.totalResultsCount))
|
|
282
|
-
&& (isBoolean(o.
|
|
282
|
+
&& (isBoolean(o.isLastPage))
|
|
283
283
|
&& (isNumber(o.currentPage))
|
|
284
284
|
&& (isNumber(o.totalClustersCount));
|
|
285
285
|
};
|
package/dist/fluidtopics.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={exports:{}},s={exports:{}};!function(e,t){var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw new Error("unable to locate global object")}();e.exports=t=i.fetch,i.fetch&&(t.default=i.fetch.bind(i)),t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response}(s,s.exports),function(e,t){const i=s.exports,a=i.default||i,n=function(e,t){return/^\/\//.test(e)&&(e="https:"+e),a.call(this,e,t)};n.ponyfill=!0,e.exports=t=n,t.fetch=n,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,t.default=n}(i,i.exports);const a=i.exports,n=a.fetch.bind({});n.polyfill=!0,t.fetch||(t.fetch=n,t.Response=a.Response,t.Headers=a.Headers,t.Request=a.Request);const r=e=>"object"==typeof e&&null!=e,o=e=>"boolean"==typeof e,l=e=>"number"==typeof e,u=e=>"string"==typeof e,c=e=>r(e)&&u(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>c(e)))&&(null==e.topicLink||d(e.topicLink))&&u(e.title)&&(null==e.htmlContent||u(e.htmlContent)),d=e=>r(e)&&u(e.tocId)&&u(e.contentId)&&u(e.mapId),p=e=>r(e)&&u(e.topicStylesheetUrl)&&u(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>u(e))),h=e=>r(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&(null==e.hasRating||o(e.hasRating))&&u(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>h(e)))&&u(e.contentId)&&u(e.title);var y;e.FtTopicContentTarget=void 0,(y=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",y.OFF_THE_GRID="OFF_THE_GRID",y.CONTENT_PACKAGER="CONTENT_PACKAGER",y.PAGES="PAGES",y.DESIGNED_READER="DESIGNED_READER";const g=e=>r(e)&&l(e.count)&&u(e.label)&&(null==e.lang||u(e.lang)),m=e=>r(e)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>u(e))))))&&u(e.label)&&u(e.key);var A;e.FtRatingType=void 0,(A=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",A.LIKE="LIKE",A.DICHOTOMOUS="DICHOTOMOUS",A.NO_RATING="NO_RATING";const f=e=>["STARS","LIKE","DICHOTOMOUS","NO_RATING"].includes(e),R=e=>r(e)&&u(e.date)&&f(e.type)&&l(e.value),E=e=>r(e)&&(null==e.rating||R(e.rating))&&f(e.type),T=e=>r(e)&&u(e.date)&&u(e.tocId)&&f(e.type)&&l(e.value),S=e=>r(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>T(e)))&&f(e.type),b=e=>r(e)&&Array.isArray(e.filter)&&e.filter.every((e=>u(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>u(e))),I=e=>r(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&u(e.key),U=e=>r(e)&&l(e.totalResultsCount)&&o(e.lastPage)&&l(e.currentPage)&&l(e.totalClustersCount);var F;e.FtEditorialType=void 0,(F=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",F.BOOK="BOOK";const C=e=>["ARTICLE","BOOK"].includes(e);var O;e.FtOpenMode=void 0,(O=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",O.EXTERNAL="EXTERNAL";const _=e=>["FLUIDTOPICS","EXTERNAL"].includes(e),v=e=>r(e)&&(null==e.perPage||l(e.perPage))&&l(e.page);var k;e.FtCollectionDocumentType=void 0,(k=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",k.DOCUMENT="DOCUMENT",k.TOPIC="TOPIC",k.PERSONAL_BOOK="PERSONAL_BOOK",k.SHARED_BOOK="SHARED_BOOK";const P=e=>["MAP","DOCUMENT","TOPIC","PERSONAL_BOOK","SHARED_BOOK"].includes(e),D=e=>r(e)&&l(e.weight)&&u(e.value)&&u(e.key),N=e=>r(e)&&Array.isArray(e.entries)&&e.entries.every((e=>L(e)))&&(null==e.metadataVariableAxis||u(e.metadataVariableAxis)),L=e=>r(e)&&(null==e.document||M(e.document))&&(null==e.topic||w(e.topic))&&H(e.type)&&(null==e.map||B(e.map)),M=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>m(e)))&&_(e.openMode)&&u(e.documentUrl)&&u(e.mimeType)&&u(e.title)&&(null==e.lastPublicationDate||u(e.lastPublicationDate))&&u(e.viewerUrl)&&u(e.contentUrl)&&u(e.filename)&&u(e.htmlTitle)&&(null==e.originUrl||u(e.originUrl))&&u(e.documentId)&&u(e.lastEditionDate)&&u(e.htmlExcerpt),B=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>m(e)))&&(null==e.openMode||_(e.openMode))&&C(e.editorialType)&&u(e.title)&&(null==e.lastPublicationDate||u(e.lastPublicationDate))&&u(e.htmlTitle)&&(null==e.originUrl||u(e.originUrl))&&u(e.mapUrl)&&u(e.readerUrl)&&u(e.mapId)&&(null==e.lastEditionDate||u(e.lastEditionDate))&&u(e.htmlExcerpt),w=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>m(e)))&&_(e.openMode)&&u(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>j(e)))&&u(e.title)&&u(e.mapTitle)&&u(e.topicUrl)&&u(e.contentUrl)&&u(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&(null==e.originUrl||u(e.originUrl))&&u(e.readerUrl)&&u(e.mapId)&&(null==e.lastEditionDate||u(e.lastEditionDate))&&u(e.htmlExcerpt);var x;e.FtSearchResultType=void 0,(x=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",x.DOCUMENT="DOCUMENT",x.TOPIC="TOPIC";const H=e=>["MAP","DOCUMENT","TOPIC"].includes(e),$=e=>r(e)&&o(e.hierarchical)&&u(e.label)&&o(e.multiSelectionable)&&u(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>V(e))),K=e=>r(e)&&(null==e.maxDepth||l(e.maxDepth))&&u(e.id),V=e=>r(e)&&l(e.totalResultsCount)&&o(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>V(e)))&&u(e.label)&&u(e.value)&&o(e.selected),G=e=>r(e)&&u(e.key),q=e=>r(e)&&u(e.suggestedQuery)&&u(e.htmlSuggestedQuery),j=e=>r(e)&&u(e.filename)&&u(e.resourceUrl)&&u(e.id)&&u(e.mimeType)&&u(e.resourceContentUrl)&&u(e.viewerUrl),z=e=>r(e)&&(null==e.filenameExtension||u(e.filenameExtension))&&(null==e.editorialType||C(e.editorialType))&&(null==e.mimeType||u(e.mimeType))&&H(e.type)&&u(e.value);var X;e.FtUserRole=void 0,(X=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",X.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",X.HTML_EXPORT_USER="HTML_EXPORT_USER",X.PDF_EXPORT_USER="PDF_EXPORT_USER",X.SAVED_SEARCH_USER="SAVED_SEARCH_USER",X.COLLECTION_USER="COLLECTION_USER",X.OFFLINE_USER="OFFLINE_USER",X.ANALYTICS_USER="ANALYTICS_USER",X.BETA_USER="BETA_USER",X.DEBUG_USER="DEBUG_USER",X.PRINT_USER="PRINT_USER",X.RATING_USER="RATING_USER",X.FEEDBACK_USER="FEEDBACK_USER",X.CONTENT_PUBLISHER="CONTENT_PUBLISHER",X.KHUB_ADMIN="KHUB_ADMIN",X.USERS_ADMIN="USERS_ADMIN",X.PORTAL_ADMIN="PORTAL_ADMIN",X.ADMIN="ADMIN",X.DEVELOPER="DEVELOPER";const Y=e=>["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","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(e),J=e=>r(e)&&u(e.identifier)&&u(e.realm),Q=e=>r(e)&&(null==e.emailAddress||u(e.emailAddress))&&(null==e.displayName||u(e.displayName))&&Array.isArray(e.roles)&&e.roles.every((e=>Y(e)))&&(null==e.userId||u(e.userId)),W=e=>"object"==typeof e&&null!=e,Z=e=>"boolean"==typeof e,ee=e=>"number"==typeof e,te=e=>"string"==typeof e,ie=e=>W(e)&&Z(e.mailsSentByFluidTopics)&&Array.isArray(e.recipients)&&e.recipients.every((e=>te(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>te(e))),se=e=>W(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>Z(e))))&&Z(e.isVisible),ae=e=>W(e)&&(null==e.prettyUrl||te(e.prettyUrl))&&(null==e.hasRating||Z(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||te(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>ae(e)))&&(null==e.pageConfiguration||se(e.pageConfiguration))&&(null==e.contentId||te(e.contentId))&&(null==e.title||te(e.title)),ne=e=>W(e)&&Z(e.splitCurrentPageToc),re="undefined"==typeof window?globalThis:window;function oe(e){let t={};for(let i in e){let s=e[i];("object"!=typeof s||Array.isArray(s))&&(s={prior:s});for(let e of["prior","filter"])s[e]=Array.isArray(s[e])?s[e]:[s[e]],s[e]=s[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[i]=s}return t}function le(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const ue="undefined"==typeof window?globalThis:window;class ce extends Error{status;statusText;body;constructor(e,t,i){super(`${e} - ${t}: ${i}`),this.status=e,this.statusText=t,this.body=i}}async function de(e){if(!e.ok)throw new ce(e.status,e.statusText,await e.text());return e}function pe(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class he{tenantBaseUrl;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})}})},stylesheets:{fonts:"api/stylesheets/fonts.css",theme:"api/stylesheets/theme.css",content:{title:"api/stylesheets/content/title.css",topic:"api/stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader"},locales:{ui:"api/locales/ui"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,i){e=(e??ue.__gwt_ft_moduleBase??ue.fluidtopicsclient?.__moduleBase??ue.__gwt_activeModules?.fluidtopicsclient?.moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",i&&void 0!==ue.location&&ue.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var i;this.authorization={Authorization:"Basic "+(i=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(i).toString("base64"):btoa(i))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let i={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,i).then((i=>(this.setCredentials(e,t),i)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e){return this.get(this.endpoints.khub.maps.mapId(e).info)}getTableOfContent(e){return this.get(this.endpoints.khub.maps.mapId(e).toc)}getPages(e){return this.get(this.endpoints.khub.maps.mapId(e).pages)}getTopic(e,t){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info)}getTopicHTMLContent(e,t,i){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(i?"?target="+i:""))}getMapAttachments(e){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list)}getMapAttachmentContent(e,t){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content)}getMapResources(e){return this.get(this.endpoints.khub.maps.mapId(e).resources.list)}getMapResourceContent(e,t){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content)}getUnstructuredDocument(e){return this.get(this.endpoints.khub.documents.documentId(e).info)}getUnstructuredDocumentContent(e){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content)}getUnstructuredDocumentTextContent(e){return this.get(this.endpoints.khub.documents.documentId(e).text)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.khub.locales)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,i){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:i})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t})}rateTopic(e,t,i,s){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:i,value:s})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:i})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,i){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:i})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}get(e){return this.makeRequest("GET",e)}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return this.tenantBaseUrl+e.replace(/^\//,"")}async fetch(e,t){const i=t;return await fetch(this.makeAbsolute(e),{...i??{},headers:{...this.defaultHeaders,...i?.headers??{}}})}upload(e,t,i,s=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((a,n)=>{let r=new XMLHttpRequest;r.onload=()=>{if(r.status>=200&&r.status<300){let e="application/json"===r.getResponseHeader("Content-Type")?JSON.parse(r.responseText):r.responseText;a(e)}else n(new ce(r.status,r.statusText,r.responseText))},r.upload.onprogress=e=>s(e),r.open(e,this.makeAbsolute(t),!0),r.send(i)})):this.fetch(t,{method:e,body:i}).then(de).then(pe)}makeRequest(e,t,i){return this.fetch(t,{method:e,headers:{...null!=i?{"Content-Type":"application/json"}:{}},body:null!=i?JSON.stringify(i):void 0,credentials:null==this.authorization?"include":void 0}).then(de).then(pe)}fetchRawData(e){return fetch(this.makeAbsolute(e),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then(de).then((e=>e.arrayBuffer()))}}e.FluidTopicsApi=he,e.HttpError=ce,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(re.localStorage){const i=le(e),s=e=>{e.storageArea===re.localStorage&&e.key===i&&t(JSON.parse(e.newValue??"{}"))};return re.addEventListener("storage",s),{removeHandler:()=>re.removeEventListener("storage",s)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=he,e.getUnauthenticatedUserSearchPreferences=function(e){if(re.localStorage)return JSON.parse(re.localStorage.getItem(le(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAuthenticatedSession=e=>r(e)&&J(e.authenticationIdentifier)&&Q(e.profile),e.isFtAuthenticationIdentifier=J,e.isFtCollectionDocument=e=>r(e)&&o(e.deleted)&&(null==e.apiUrl||u(e.apiUrl))&&(null==e.portalUrl||u(e.portalUrl))&&u(e.id)&&u(e.title)&&P(e.type),e.isFtCollectionDocumentType=P,e.isFtCredentials=e=>r(e)&&u(e.password)&&(null==e.newPassword||u(e.newPassword))&&o(e.rememberMe)&&u(e.login),e.isFtEditorialType=C,e.isFtFeedbackCreation=e=>r(e)&&u(e.message),e.isFtMap=e=>r(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>m(e)))&&_(e.openMode)&&u(e.topicsApiEndpoint)&&(null==e.description||u(e.description))&&u(e.attachmentsApiEndpoint)&&C(e.editorialType)&&u(e.baseId)&&u(e.clusterId)&&u(e.title)&&u(e.lastPublication)&&u(e.lastEdition)&&u(e.originId)&&u(e.rightsApiEndpoint)&&p(e.contentStyles)&&(null==e.originUrl||u(e.originUrl))&&u(e.readerUrl)&&(null==e.khubVersion||u(e.khubVersion))&&u(e.id)&&(null==e.lang||u(e.lang)),e.isFtMapAttachment=e=>W(e)&&te(e.file)&&(null==e.size||ee(e.size))&&Z(e.externalLink)&&te(e.name)&&te(e.id)&&(null==e.mimeType||te(e.mimeType))&&(null==e.viewerUrl||te(e.viewerUrl)),e.isFtMapResource=e=>r(e)&&u(e.contentUrl)&&u(e.filename)&&u(e.id)&&u(e.mimeType),e.isFtMapStyles=p,e.isFtMessageContext=e=>r(e)&&u(e.name)&&r(e.messages)&&Object.keys(e.messages).every((e=>u(e)))&&Object.values(e.messages).every((e=>u(e)))&&u(e.locale),e.isFtMetadata=m,e.isFtMetadataPreferenceConfiguration=b,e.isFtOpenMode=_,e.isFtPageConfiguration=se,e.isFtPageRequest=v,e.isFtPaginatedToc=e=>W(e)&&ne(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>ae(e))),e.isFtPaginatedTocNode=ae,e.isFtPaginationConfiguration=ne,e.isFtPersonalBookCreation=e=>r(e)&&Array.isArray(e.nodes)&&e.nodes.every((e=>c(e)))&&u(e.description)&&u(e.title),e.isFtPersonalBookNodeCreation=c,e.isFtPersonalBookTopicLinkCreation=d,e.isFtPublicationRating=R,e.isFtPublicationRatingSummary=E,e.isFtRatingCreation=e=>r(e)&&f(e.type)&&l(e.value),e.isFtRatingSummary=e=>r(e)&&(null==e.topics||S(e.topics))&&E(e.publication),e.isFtRatingType=f,e.isFtReaderConfiguration=e=>W(e)&&ie(e.feedback)&&ee(e.loadAfterLastVisibleTopic)&&ee(e.loadBeforeFirstVisibleTopic),e.isFtReaderFeedbackConfiguration=ie,e.isFtSearchFacet=$,e.isFtSearchFacetConf=K,e.isFtSearchFacetEntry=V,e.isFtSearchFilter=I,e.isFtSearchLocale=g,e.isFtSearchLocales=e=>r(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>g(e))),e.isFtSearchPreferencesConfiguration=e=>r(e)&&r(e.metadata)&&Object.keys(e.metadata).every((e=>u(e)))&&Object.values(e.metadata).every((e=>b(e))),e.isFtSearchPreset=e=>r(e)&&u(e.name)&&Array.isArray(e.filters)&&e.filters.every((e=>I(e)))&&l(e.priority)&&(null==e.contentLocale||u(e.contentLocale)),e.isFtSearchPrior=D,e.isFtSearchRequest=e=>r(e)&&u(e.query)&&v(e.paging)&&Array.isArray(e.filters)&&e.filters.every((e=>I(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>G(e)))&&(null==e.uiLocale||u(e.uiLocale))&&(null==e.contentLocale||u(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>D(e))))&&Array.isArray(e.facets)&&e.facets.every((e=>K(e))),e.isFtSearchResultCluster=N,e.isFtSearchResultClusterEntry=L,e.isFtSearchResultMap=B,e.isFtSearchResultTopic=w,e.isFtSearchResultType=H,e.isFtSearchResultUnstructuredDocument=M,e.isFtSearchResults=e=>r(e)&&(null==e.spellcheck||q(e.spellcheck))&&U(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>N(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>$(e))),e.isFtSearchResultsPageInfo=U,e.isFtSearchSortCriterion=G,e.isFtSession=e=>r(e)&&(null==e.authenticationIdentifier||J(e.authenticationIdentifier))&&l(e.idleTimeoutInMillis)&&Q(e.profile)&&o(e.sessionAuthenticated),e.isFtSpellcheck=q,e.isFtSuggestRequest=e=>r(e)&&u(e.input)&&Array.isArray(e.filters)&&e.filters.every((e=>I(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>G(e)))&&(null==e.maxCount||l(e.maxCount))&&(null==e.contentLocale||u(e.contentLocale)),e.isFtSuggestResult=z,e.isFtSuggestResults=e=>r(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>z(e))),e.isFtTocNode=h,e.isFtTopic=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>m(e)))&&u(e.id)&&u(e.contentApiEndpoint)&&u(e.title),e.isFtTopicContentTarget=e=>["THIRD_PARTY","OFF_THE_GRID","CONTENT_PACKAGER","PAGES","DESIGNED_READER"].includes(e),e.isFtTopicRating=T,e.isFtTopicResource=j,e.isFtTopicsRatingSummary=S,e.isFtUiLocale=e=>r(e)&&u(e.displayName)&&u(e.languageTag)&&o(e.translated),e.isFtUnstructuredDocument=e=>r(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>m(e)))&&u(e.openMode)&&(null==e.description||u(e.description))&&u(e.mimeType)&&(null==e.baseId||u(e.baseId))&&(null==e.clusterId||u(e.clusterId))&&u(e.contentApiEndpoint)&&u(e.title)&&(null==e.lastPublication||u(e.lastPublication))&&u(e.viewerUrl)&&u(e.lastEdition)&&u(e.filename)&&(null==e.originId||u(e.originId))&&u(e.rightsApiEndpoint)&&(null==e.originUrl||u(e.originUrl))&&(null==e.khubVersion||u(e.khubVersion))&&u(e.id)&&(null==e.lang||u(e.lang)),e.isFtUserProfile=Q,e.isFtUserRole=Y,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(re.localStorage){let i={...t,metadata:oe(t.metadata??{})};const s=le(e),a=JSON.stringify(i);return re.localStorage.setItem(s,a),re.dispatchEvent(new StorageEvent("storage",{key:s,newValue:a,storageArea:re.localStorage,url:re.location.href})),i}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")}}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};!function(e){!function(t){var r={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(r.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(e){return e&&i.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function a(e){return"string"!=typeof e&&(e=String(e)),e}function o(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return r.iterable&&(t[Symbol.iterator]=function(){return t}),t}function l(e){this.map={},e instanceof l?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function u(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function d(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function p(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:r.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:r.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():r.arrayBuffer&&r.blob&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=p(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=p(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,i=u(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=c(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i<t.length;i++)r[i]=String.fromCharCode(t[i]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=s(e),t=a(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[s(e)]},l.prototype.get=function(e){return e=s(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(s(e))},l.prototype.set=function(e,t){this.map[s(e)]=a(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),o(e)},l.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),o(e)},l.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),o(e)},r.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var y=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function f(e,t){var r,i,n=(t=t||{}).body;if(e instanceof f){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new l(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),y.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}})),t}function g(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}f.prototype.clone=function(){return new f(this,{body:this._bodyInit})},h.call(f.prototype),h.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},g.error=function(){var e=new g(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];g.redirect=function(e,t){if(-1===b.indexOf(t))throw new RangeError("Invalid status code");return new g(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function A(e,i){return new Promise((function(n,s){var a=new f(e,i);if(a.signal&&a.signal.aborted)return s(new t.DOMException("Aborted","AbortError"));var o=new XMLHttpRequest;function u(){o.abort()}o.onload=function(){var e,t,r={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();t.append(i,n)}})),t)};r.url="responseURL"in o?o.responseURL:r.headers.get("X-Request-URL");var i="response"in o?o.response:o.responseText;n(new g(i,r))},o.onerror=function(){s(new TypeError("Network request failed"))},o.ontimeout=function(){s(new TypeError("Network request failed"))},o.onabort=function(){s(new t.DOMException("Aborted","AbortError"))},o.open(a.method,a.url,!0),"include"===a.credentials?o.withCredentials=!0:"omit"===a.credentials&&(o.withCredentials=!1),"responseType"in o&&r.blob&&(o.responseType="blob"),a.headers.forEach((function(e,t){o.setRequestHeader(t,e)})),a.signal&&(a.signal.addEventListener("abort",u),o.onreadystatechange=function(){4===o.readyState&&a.signal.removeEventListener("abort",u)}),o.send(void 0===a._bodyInit?null:a._bodyInit)}))}A.polyfill=!0,e.fetch||(e.fetch=A,e.Headers=l,e.Request=f,e.Response=g),t.Headers=l,t.Request=f,t.Response=g,t.fetch=A,Object.defineProperty(t,"__esModule",{value:!0})}({})}("undefined"!=typeof self?self:t);const r=e=>"object"==typeof e&&null!=e,i=e=>"boolean"==typeof e,n=e=>"number"==typeof e,s=e=>"string"==typeof e,a=e=>r(e)&&s(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>a(e)))&&(null==e.topicLink||o(e.topicLink))&&s(e.title)&&(null==e.htmlContent||s(e.htmlContent)),o=e=>r(e)&&s(e.tocId)&&s(e.contentId)&&s(e.mapId),l=e=>r(e)&&s(e.topicStylesheetUrl)&&s(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>s(e))),u=e=>r(e)&&(null==e.prettyUrl||s(e.prettyUrl))&&(null==e.hasRating||i(e.hasRating))&&s(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>u(e)))&&s(e.contentId)&&s(e.title);var c;e.FtTopicContentTarget=void 0,(c=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",c.OFF_THE_GRID="OFF_THE_GRID",c.CONTENT_PACKAGER="CONTENT_PACKAGER",c.PAGES="PAGES",c.DESIGNED_READER="DESIGNED_READER";const d=e=>r(e)&&n(e.count)&&s(e.label)&&(null==e.lang||s(e.lang)),p=e=>r(e)&&Array.isArray(e.values)&&e.values.every((e=>s(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>s(e))))))&&s(e.label)&&s(e.key);var h;e.FtRatingType=void 0,(h=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",h.LIKE="LIKE",h.DICHOTOMOUS="DICHOTOMOUS",h.NO_RATING="NO_RATING";const y=e=>["STARS","LIKE","DICHOTOMOUS","NO_RATING"].includes(e),f=e=>r(e)&&s(e.date)&&y(e.type)&&n(e.value),m=e=>r(e)&&(null==e.rating||f(e.rating))&&y(e.type),g=e=>r(e)&&s(e.date)&&s(e.tocId)&&y(e.type)&&n(e.value),b=e=>r(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>g(e)))&&y(e.type),A=e=>r(e)&&Array.isArray(e.filter)&&e.filter.every((e=>s(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>s(e))),E=e=>r(e)&&i(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>s(e)))&&s(e.key),T=e=>r(e)&&n(e.totalResultsCount)&&i(e.isLastPage)&&n(e.currentPage)&&n(e.totalClustersCount);var R;e.FtEditorialType=void 0,(R=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",R.BOOK="BOOK";const S=e=>["ARTICLE","BOOK"].includes(e);var I;e.FtOpenMode=void 0,(I=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",I.EXTERNAL="EXTERNAL";const U=e=>["FLUIDTOPICS","EXTERNAL"].includes(e),v=e=>r(e)&&(null==e.perPage||n(e.perPage))&&n(e.page);var O;e.FtCollectionDocumentType=void 0,(O=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",O.DOCUMENT="DOCUMENT",O.TOPIC="TOPIC",O.PERSONAL_BOOK="PERSONAL_BOOK",O.SHARED_BOOK="SHARED_BOOK";const _=e=>["MAP","DOCUMENT","TOPIC","PERSONAL_BOOK","SHARED_BOOK"].includes(e),F=e=>r(e)&&n(e.weight)&&s(e.value)&&s(e.key),C=e=>r(e)&&Array.isArray(e.entries)&&e.entries.every((e=>P(e)))&&(null==e.metadataVariableAxis||s(e.metadataVariableAxis)),P=e=>r(e)&&(null==e.document||D(e.document))&&(null==e.topic||w(e.topic))&&N(e.type)&&(null==e.map||k(e.map)),D=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>p(e)))&&U(e.openMode)&&s(e.documentUrl)&&s(e.mimeType)&&s(e.title)&&(null==e.lastPublicationDate||s(e.lastPublicationDate))&&s(e.viewerUrl)&&s(e.contentUrl)&&s(e.filename)&&s(e.htmlTitle)&&(null==e.originUrl||s(e.originUrl))&&s(e.documentId)&&s(e.lastEditionDate)&&s(e.htmlExcerpt),k=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>p(e)))&&(null==e.openMode||U(e.openMode))&&S(e.editorialType)&&s(e.title)&&(null==e.lastPublicationDate||s(e.lastPublicationDate))&&s(e.htmlTitle)&&(null==e.originUrl||s(e.originUrl))&&s(e.mapUrl)&&s(e.readerUrl)&&s(e.mapId)&&(null==e.lastEditionDate||s(e.lastEditionDate))&&s(e.htmlExcerpt),w=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>p(e)))&&U(e.openMode)&&s(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>j(e)))&&s(e.title)&&s(e.mapTitle)&&s(e.topicUrl)&&s(e.contentUrl)&&s(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>s(e)))&&s(e.tocId)&&(null==e.originUrl||s(e.originUrl))&&s(e.readerUrl)&&s(e.mapId)&&(null==e.lastEditionDate||s(e.lastEditionDate))&&s(e.htmlExcerpt);var L;e.FtSearchResultType=void 0,(L=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",L.DOCUMENT="DOCUMENT",L.TOPIC="TOPIC";const N=e=>["MAP","DOCUMENT","TOPIC"].includes(e),B=e=>r(e)&&i(e.hierarchical)&&s(e.label)&&i(e.multiSelectionable)&&s(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>x(e))),M=e=>r(e)&&(null==e.maxDepth||n(e.maxDepth))&&s(e.id),x=e=>r(e)&&n(e.totalResultsCount)&&i(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>x(e)))&&s(e.label)&&s(e.value)&&i(e.selected),H=e=>r(e)&&s(e.key),$=e=>r(e)&&s(e.suggestedQuery)&&s(e.htmlSuggestedQuery),j=e=>r(e)&&s(e.filename)&&s(e.resourceUrl)&&s(e.id)&&s(e.mimeType)&&s(e.resourceContentUrl)&&s(e.viewerUrl),K=e=>r(e)&&(null==e.filenameExtension||s(e.filenameExtension))&&(null==e.editorialType||S(e.editorialType))&&(null==e.mimeType||s(e.mimeType))&&N(e.type)&&s(e.value);var G;e.FtUserRole=void 0,(G=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",G.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",G.HTML_EXPORT_USER="HTML_EXPORT_USER",G.PDF_EXPORT_USER="PDF_EXPORT_USER",G.SAVED_SEARCH_USER="SAVED_SEARCH_USER",G.COLLECTION_USER="COLLECTION_USER",G.OFFLINE_USER="OFFLINE_USER",G.ANALYTICS_USER="ANALYTICS_USER",G.BETA_USER="BETA_USER",G.DEBUG_USER="DEBUG_USER",G.PRINT_USER="PRINT_USER",G.RATING_USER="RATING_USER",G.FEEDBACK_USER="FEEDBACK_USER",G.CONTENT_PUBLISHER="CONTENT_PUBLISHER",G.KHUB_ADMIN="KHUB_ADMIN",G.USERS_ADMIN="USERS_ADMIN",G.PORTAL_ADMIN="PORTAL_ADMIN",G.ADMIN="ADMIN",G.DEVELOPER="DEVELOPER";const V=e=>["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","CONTENT_PUBLISHER","KHUB_ADMIN","USERS_ADMIN","PORTAL_ADMIN","ADMIN","DEVELOPER"].includes(e),q=e=>r(e)&&s(e.identifier)&&s(e.realm),X=e=>r(e)&&(null==e.emailAddress||s(e.emailAddress))&&(null==e.displayName||s(e.displayName))&&Array.isArray(e.roles)&&e.roles.every((e=>V(e)))&&(null==e.userId||s(e.userId)),z=e=>"object"==typeof e&&null!=e,J=e=>"boolean"==typeof e,Y=e=>"number"==typeof e,Q=e=>"string"==typeof e,W=e=>z(e)&&J(e.mailsSentByFluidTopics)&&Array.isArray(e.recipients)&&e.recipients.every((e=>Q(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>Q(e))),Z=e=>z(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>J(e))))&&J(e.isVisible),ee=e=>z(e)&&(null==e.prettyUrl||Q(e.prettyUrl))&&(null==e.hasRating||J(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||Q(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>ee(e)))&&(null==e.pageConfiguration||Z(e.pageConfiguration))&&(null==e.contentId||Q(e.contentId))&&(null==e.title||Q(e.title)),te=e=>z(e)&&J(e.splitCurrentPageToc),re="undefined"==typeof window?globalThis:window;function ie(e){let t={};for(let r in e){let i=e[r];("object"!=typeof i||Array.isArray(i))&&(i={prior:i});for(let e of["prior","filter"])i[e]=Array.isArray(i[e])?i[e]:[i[e]],i[e]=i[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=i}return t}function ne(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const se="undefined"==typeof window?globalThis:window;class ae extends Error{status;statusText;body;constructor(e,t,r){super(`${e} - ${t}: ${r}`),this.status=e,this.statusText=t,this.body=r}}async function oe(e){if(!e.ok)throw new ae(e.status,e.statusText,await e.text());return e}function le(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class ue{tenantBaseUrl;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})}})},stylesheets:{fonts:"api/stylesheets/fonts.css",theme:"api/stylesheets/theme.css",content:{title:"api/stylesheets/content/title.css",topic:"api/stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader"},locales:{ui:"api/locales/ui"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??se.__gwt_ft_moduleBase??se.fluidtopicsclient?.__moduleBase??se.__gwt_activeModules?.fluidtopicsclient?.moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",r&&void 0!==se.location&&se.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e){return this.get(this.endpoints.khub.maps.mapId(e).info)}getTableOfContent(e){return this.get(this.endpoints.khub.maps.mapId(e).toc)}getPages(e){return this.get(this.endpoints.khub.maps.mapId(e).pages)}getTopic(e,t){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info)}getTopicHTMLContent(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""))}getMapAttachments(e){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list)}getMapAttachmentContent(e,t){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content)}getMapResources(e){return this.get(this.endpoints.khub.maps.mapId(e).resources.list)}getMapResourceContent(e,t){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content)}getUnstructuredDocument(e){return this.get(this.endpoints.khub.documents.documentId(e).info)}getUnstructuredDocumentContent(e){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content)}getUnstructuredDocumentTextContent(e){return this.get(this.endpoints.khub.documents.documentId(e).text)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.khub.locales)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t})}rateTopic(e,t,r,i){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:i})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}get(e){return this.makeRequest("GET",e)}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return this.tenantBaseUrl+e.replace(/^\//,"")}async fetch(e,t){const r=t;return await fetch(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,i=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((n,s)=>{let a=new XMLHttpRequest;a.onload=()=>{if(a.status>=200&&a.status<300){let e="application/json"===a.getResponseHeader("Content-Type")?JSON.parse(a.responseText):a.responseText;n(e)}else s(new ae(a.status,a.statusText,a.responseText))},a.upload.onprogress=e=>i(e),a.open(e,this.makeAbsolute(t),!0),a.send(r)})):this.fetch(t,{method:e,body:r}).then(oe).then(le)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then(oe).then(le)}fetchRawData(e){return fetch(this.makeAbsolute(e),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then(oe).then((e=>e.arrayBuffer()))}}e.FluidTopicsApi=ue,e.HttpError=ae,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(re.localStorage){const r=ne(e),i=e=>{e.storageArea===re.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return re.addEventListener("storage",i),{removeHandler:()=>re.removeEventListener("storage",i)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=ue,e.getUnauthenticatedUserSearchPreferences=function(e){if(re.localStorage)return JSON.parse(re.localStorage.getItem(ne(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAuthenticatedSession=e=>r(e)&&q(e.authenticationIdentifier)&&X(e.profile),e.isFtAuthenticationIdentifier=q,e.isFtCollectionDocument=e=>r(e)&&i(e.deleted)&&(null==e.apiUrl||s(e.apiUrl))&&(null==e.portalUrl||s(e.portalUrl))&&s(e.id)&&s(e.title)&&_(e.type),e.isFtCollectionDocumentType=_,e.isFtCredentials=e=>r(e)&&s(e.password)&&(null==e.newPassword||s(e.newPassword))&&i(e.rememberMe)&&s(e.login),e.isFtEditorialType=S,e.isFtFeedbackCreation=e=>r(e)&&s(e.message),e.isFtMap=e=>r(e)&&(null==e.prettyUrl||s(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>p(e)))&&U(e.openMode)&&s(e.topicsApiEndpoint)&&(null==e.description||s(e.description))&&s(e.attachmentsApiEndpoint)&&S(e.editorialType)&&s(e.baseId)&&s(e.clusterId)&&s(e.title)&&s(e.lastPublication)&&s(e.lastEdition)&&s(e.originId)&&s(e.rightsApiEndpoint)&&l(e.contentStyles)&&(null==e.originUrl||s(e.originUrl))&&s(e.readerUrl)&&(null==e.khubVersion||s(e.khubVersion))&&s(e.id)&&(null==e.lang||s(e.lang)),e.isFtMapAttachment=e=>z(e)&&Q(e.file)&&(null==e.size||Y(e.size))&&J(e.externalLink)&&Q(e.name)&&Q(e.id)&&(null==e.mimeType||Q(e.mimeType))&&(null==e.viewerUrl||Q(e.viewerUrl)),e.isFtMapResource=e=>r(e)&&s(e.contentUrl)&&s(e.filename)&&s(e.id)&&s(e.mimeType),e.isFtMapStyles=l,e.isFtMessageContext=e=>r(e)&&s(e.name)&&r(e.messages)&&Object.keys(e.messages).every((e=>s(e)))&&Object.values(e.messages).every((e=>s(e)))&&s(e.locale),e.isFtMetadata=p,e.isFtMetadataPreferenceConfiguration=A,e.isFtOpenMode=U,e.isFtPageConfiguration=Z,e.isFtPageRequest=v,e.isFtPaginatedToc=e=>z(e)&&te(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>ee(e))),e.isFtPaginatedTocNode=ee,e.isFtPaginationConfiguration=te,e.isFtPersonalBookCreation=e=>r(e)&&Array.isArray(e.nodes)&&e.nodes.every((e=>a(e)))&&s(e.description)&&s(e.title),e.isFtPersonalBookNodeCreation=a,e.isFtPersonalBookTopicLinkCreation=o,e.isFtPublicationRating=f,e.isFtPublicationRatingSummary=m,e.isFtRatingCreation=e=>r(e)&&y(e.type)&&n(e.value),e.isFtRatingSummary=e=>r(e)&&(null==e.topics||b(e.topics))&&m(e.publication),e.isFtRatingType=y,e.isFtReaderConfiguration=e=>z(e)&&W(e.feedback)&&Y(e.loadAfterLastVisibleTopic)&&Y(e.loadBeforeFirstVisibleTopic),e.isFtReaderFeedbackConfiguration=W,e.isFtSearchFacet=B,e.isFtSearchFacetConf=M,e.isFtSearchFacetEntry=x,e.isFtSearchFilter=E,e.isFtSearchLocale=d,e.isFtSearchLocales=e=>r(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>d(e))),e.isFtSearchPreferencesConfiguration=e=>r(e)&&r(e.metadata)&&Object.keys(e.metadata).every((e=>s(e)))&&Object.values(e.metadata).every((e=>A(e))),e.isFtSearchPreset=e=>r(e)&&s(e.name)&&Array.isArray(e.filters)&&e.filters.every((e=>E(e)))&&n(e.priority)&&(null==e.contentLocale||s(e.contentLocale)),e.isFtSearchPrior=F,e.isFtSearchRequest=e=>r(e)&&s(e.query)&&v(e.paging)&&Array.isArray(e.filters)&&e.filters.every((e=>E(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>H(e)))&&(null==e.uiLocale||s(e.uiLocale))&&(null==e.contentLocale||s(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>F(e))))&&Array.isArray(e.facets)&&e.facets.every((e=>M(e))),e.isFtSearchResultCluster=C,e.isFtSearchResultClusterEntry=P,e.isFtSearchResultMap=k,e.isFtSearchResultTopic=w,e.isFtSearchResultType=N,e.isFtSearchResultUnstructuredDocument=D,e.isFtSearchResults=e=>r(e)&&(null==e.spellcheck||$(e.spellcheck))&&T(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>C(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>B(e))),e.isFtSearchResultsPageInfo=T,e.isFtSearchSortCriterion=H,e.isFtSession=e=>r(e)&&(null==e.authenticationIdentifier||q(e.authenticationIdentifier))&&n(e.idleTimeoutInMillis)&&X(e.profile)&&i(e.sessionAuthenticated),e.isFtSpellcheck=$,e.isFtSuggestRequest=e=>r(e)&&s(e.input)&&Array.isArray(e.filters)&&e.filters.every((e=>E(e)))&&Array.isArray(e.sort)&&e.sort.every((e=>H(e)))&&(null==e.maxCount||n(e.maxCount))&&(null==e.contentLocale||s(e.contentLocale)),e.isFtSuggestResult=K,e.isFtSuggestResults=e=>r(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>K(e))),e.isFtTocNode=u,e.isFtTopic=e=>r(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>p(e)))&&s(e.id)&&s(e.contentApiEndpoint)&&s(e.title),e.isFtTopicContentTarget=e=>["THIRD_PARTY","OFF_THE_GRID","CONTENT_PACKAGER","PAGES","DESIGNED_READER"].includes(e),e.isFtTopicRating=g,e.isFtTopicResource=j,e.isFtTopicsRatingSummary=b,e.isFtUiLocale=e=>r(e)&&s(e.displayName)&&s(e.languageTag)&&i(e.translated),e.isFtUnstructuredDocument=e=>r(e)&&(null==e.prettyUrl||s(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>p(e)))&&s(e.openMode)&&(null==e.description||s(e.description))&&s(e.mimeType)&&(null==e.baseId||s(e.baseId))&&(null==e.clusterId||s(e.clusterId))&&s(e.contentApiEndpoint)&&s(e.title)&&(null==e.lastPublication||s(e.lastPublication))&&s(e.viewerUrl)&&s(e.lastEdition)&&s(e.filename)&&(null==e.originId||s(e.originId))&&s(e.rightsApiEndpoint)&&(null==e.originUrl||s(e.originUrl))&&(null==e.khubVersion||s(e.khubVersion))&&s(e.id)&&(null==e.lang||s(e.lang)),e.isFtUserProfile=X,e.isFtUserRole=V,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(re.localStorage){let r={...t,metadata:ie(t.metadata??{})};const i=ne(e),n=JSON.stringify(r);return re.localStorage.setItem(i,n),re.dispatchEvent(new StorageEvent("storage",{key:i,newValue:n,storageArea:re.localStorage,url:re.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")}}));
|
|
@@ -3,7 +3,7 @@ export declare function setUnauthenticatedUserSearchPreferences(tenantBaseUrl: s
|
|
|
3
3
|
metadata: Record<string, FtMetadataPreferenceConfiguration>;
|
|
4
4
|
};
|
|
5
5
|
export declare function getUnauthenticatedUserSearchPreferences(tenantBaseUrl: string): FtSearchPreferencesConfiguration;
|
|
6
|
-
export
|
|
6
|
+
export type HandlerRegistration = {
|
|
7
7
|
removeHandler: () => void;
|
|
8
8
|
};
|
|
9
9
|
export declare function addUnauthenticatedUserSearchPreferencesChangeHandler(tenantBaseUrl: string, handler: (newValue: FtSearchPreferencesConfiguration) => void): HandlerRegistration;
|
|
@@ -109,7 +109,7 @@ export declare enum FtTopicContentTarget {
|
|
|
109
109
|
PAGES = "PAGES",
|
|
110
110
|
DESIGNED_READER = "DESIGNED_READER"
|
|
111
111
|
}
|
|
112
|
-
export
|
|
112
|
+
export type FtTopicContentTargetKeys = keyof typeof FtTopicContentTarget;
|
|
113
113
|
export declare const isFtTopicContentTarget: (o: any) => o is FtTopicContentTarget;
|
|
114
114
|
export interface FtFeedbackCreation {
|
|
115
115
|
message: string;
|
|
@@ -150,7 +150,7 @@ export declare enum FtRatingType {
|
|
|
150
150
|
DICHOTOMOUS = "DICHOTOMOUS",
|
|
151
151
|
NO_RATING = "NO_RATING"
|
|
152
152
|
}
|
|
153
|
-
export
|
|
153
|
+
export type FtRatingTypeKeys = keyof typeof FtRatingType;
|
|
154
154
|
export declare const isFtRatingType: (o: any) => o is FtRatingType;
|
|
155
155
|
export interface FtPublicationRating {
|
|
156
156
|
date: Date | string;
|
|
@@ -216,7 +216,7 @@ export interface FtSearchPreset {
|
|
|
216
216
|
export declare const isFtSearchPreset: (o: any) => o is FtSearchPreset;
|
|
217
217
|
export interface FtSearchResultsPageInfo {
|
|
218
218
|
totalResultsCount: number;
|
|
219
|
-
|
|
219
|
+
isLastPage: boolean;
|
|
220
220
|
currentPage: number;
|
|
221
221
|
totalClustersCount: number;
|
|
222
222
|
}
|
|
@@ -225,13 +225,13 @@ export declare enum FtEditorialType {
|
|
|
225
225
|
ARTICLE = "ARTICLE",
|
|
226
226
|
BOOK = "BOOK"
|
|
227
227
|
}
|
|
228
|
-
export
|
|
228
|
+
export type FtEditorialTypeKeys = keyof typeof FtEditorialType;
|
|
229
229
|
export declare const isFtEditorialType: (o: any) => o is FtEditorialType;
|
|
230
230
|
export declare enum FtOpenMode {
|
|
231
231
|
FLUIDTOPICS = "FLUIDTOPICS",
|
|
232
232
|
EXTERNAL = "EXTERNAL"
|
|
233
233
|
}
|
|
234
|
-
export
|
|
234
|
+
export type FtOpenModeKeys = keyof typeof FtOpenMode;
|
|
235
235
|
export declare const isFtOpenMode: (o: any) => o is FtOpenMode;
|
|
236
236
|
export interface FtPageRequest {
|
|
237
237
|
perPage?: number;
|
|
@@ -245,7 +245,7 @@ export declare enum FtCollectionDocumentType {
|
|
|
245
245
|
PERSONAL_BOOK = "PERSONAL_BOOK",
|
|
246
246
|
SHARED_BOOK = "SHARED_BOOK"
|
|
247
247
|
}
|
|
248
|
-
export
|
|
248
|
+
export type FtCollectionDocumentTypeKeys = keyof typeof FtCollectionDocumentType;
|
|
249
249
|
export declare const isFtCollectionDocumentType: (o: any) => o is FtCollectionDocumentType;
|
|
250
250
|
export interface FtSearchResults {
|
|
251
251
|
spellcheck?: FtSpellcheck;
|
|
@@ -343,7 +343,7 @@ export declare enum FtSearchResultType {
|
|
|
343
343
|
DOCUMENT = "DOCUMENT",
|
|
344
344
|
TOPIC = "TOPIC"
|
|
345
345
|
}
|
|
346
|
-
export
|
|
346
|
+
export type FtSearchResultTypeKeys = keyof typeof FtSearchResultType;
|
|
347
347
|
export declare const isFtSearchResultType: (o: any) => o is FtSearchResultType;
|
|
348
348
|
export interface FtSearchFacet {
|
|
349
349
|
hierarchical: boolean;
|
|
@@ -428,7 +428,7 @@ export declare enum FtUserRole {
|
|
|
428
428
|
ADMIN = "ADMIN",
|
|
429
429
|
DEVELOPER = "DEVELOPER"
|
|
430
430
|
}
|
|
431
|
-
export
|
|
431
|
+
export type FtUserRoleKeys = keyof typeof FtUserRole;
|
|
432
432
|
export declare const isFtUserRole: (o: any) => o is FtUserRole;
|
|
433
433
|
export interface FtAuthenticationIdentifier {
|
|
434
434
|
identifier: string;
|
|
@@ -246,7 +246,7 @@ export const isFtSearchPreset = (o) => {
|
|
|
246
246
|
export const isFtSearchResultsPageInfo = (o) => {
|
|
247
247
|
return isObject(o)
|
|
248
248
|
&& (isNumber(o.totalResultsCount))
|
|
249
|
-
&& (isBoolean(o.
|
|
249
|
+
&& (isBoolean(o.isLastPage))
|
|
250
250
|
&& (isNumber(o.currentPage))
|
|
251
251
|
&& (isNumber(o.totalClustersCount));
|
|
252
252
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/public-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.34",
|
|
4
4
|
"description": "Fluid Topics Public API",
|
|
5
5
|
"author": "Fluid Topics dev team <opensource@antidot.net>",
|
|
6
6
|
"license": "LGPL-3.0-only",
|
|
@@ -13,29 +13,31 @@
|
|
|
13
13
|
"require": "./dist/cjs/index.js"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
+
"scripts": {
|
|
17
|
+
"bootstrap": "echo '--frozen-lockfile false' > .yarnrc && yarn"
|
|
18
|
+
},
|
|
16
19
|
"publishConfig": {
|
|
17
20
|
"access": "public"
|
|
18
21
|
},
|
|
19
22
|
"dependencies": {
|
|
20
|
-
"cross-fetch": "
|
|
23
|
+
"cross-fetch": "3.1.5"
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"@cyclonedx/bom": "^3.10.6",
|
|
24
|
-
"@rollup/plugin-commonjs": "
|
|
25
|
-
"@rollup/plugin-json": "
|
|
26
|
-
"@rollup/plugin-node-resolve": "
|
|
27
|
-
"@rollup/plugin-typescript": "
|
|
28
|
-
"@types/chai": "
|
|
29
|
-
"@types/mocha": "
|
|
30
|
-
"@types/node": "
|
|
31
|
-
"chai": "
|
|
32
|
-
"mocha": "
|
|
33
|
-
"nock": "
|
|
34
|
-
"rollup": "
|
|
35
|
-
"rollup-plugin-
|
|
36
|
-
"rollup-plugin-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"typescript": "^4.4.2"
|
|
27
|
+
"@rollup/plugin-commonjs": "24.1.0",
|
|
28
|
+
"@rollup/plugin-json": "6.0.0",
|
|
29
|
+
"@rollup/plugin-node-resolve": "15.0.2",
|
|
30
|
+
"@rollup/plugin-typescript": "11.1.0",
|
|
31
|
+
"@types/chai": "4.3.5",
|
|
32
|
+
"@types/mocha": "10.0.1",
|
|
33
|
+
"@types/node": "20.0.0",
|
|
34
|
+
"chai": "4.3.7",
|
|
35
|
+
"mocha": "10.2.0",
|
|
36
|
+
"nock": "13.3.1",
|
|
37
|
+
"rollup": "3.20.6",
|
|
38
|
+
"rollup-plugin-terser": "7.0.2",
|
|
39
|
+
"rollup-plugin-typescript2": "0.34.1",
|
|
40
|
+
"ts-node": "10.9.1",
|
|
41
|
+
"typescript": "5.0.4"
|
|
40
42
|
}
|
|
41
43
|
}
|
package/.yarnrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
--frozen-lockfile true
|