jamespot-user-api 1.0.111 → 1.0.112
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/documentation/assets/search.js +1 -1
- package/documentation/classes/AdminLicenseApi.html +11 -11
- package/documentation/classes/AdminStoreApi.html +1 -1
- package/documentation/classes/AdminUtilsApi.html +1 -1
- package/documentation/classes/JApplicationApi.html +8 -8
- package/documentation/classes/JArticleApi.html +1 -1
- package/documentation/classes/JAssetReservation.html +1 -1
- package/documentation/classes/JAudienceApi.html +1 -1
- package/documentation/classes/JBaseApi.html +1 -1
- package/documentation/classes/JBookmarkApi.html +1 -1
- package/documentation/classes/JCommunityApi.html +1 -1
- package/documentation/classes/JDiapazoneApi.html +1 -1
- package/documentation/classes/JFileApi.html +5 -5
- package/documentation/classes/JFilebankApi.html +1 -1
- package/documentation/classes/JGroupApi.html +9 -9
- package/documentation/classes/JLandApi.html +1 -1
- package/documentation/classes/JMessengerApi.html +1 -1
- package/documentation/classes/JSearchApi.html +6 -6
- package/documentation/classes/JShareApi.html +1 -1
- package/documentation/classes/JTaxonomyApi.html +2 -2
- package/documentation/classes/JUserApi.html +4 -4
- package/documentation/classes/JWedocApi.html +1 -1
- package/documentation/classes/JamespotUserApi.html +1 -1
- package/documentation/classes/Network.html +1 -1
- package/documentation/classes/TVDisplayApi.html +1 -1
- package/documentation/classes/WindowBrowser.html +1 -1
- package/documentation/enums/StudioApplicationStatus.html +1 -1
- package/documentation/index.html +1 -1
- package/documentation/interfaces/AccessRightObject.html +1 -1
- package/documentation/interfaces/AdminLicenseUser.html +1 -1
- package/documentation/interfaces/ApiDefaultWrapper.html +1 -1
- package/documentation/interfaces/ApiWrapper.html +1 -1
- package/documentation/interfaces/BaseAutocomplete.html +1 -1
- package/documentation/interfaces/BaseMessage.html +1 -1
- package/documentation/interfaces/Category.html +1 -1
- package/documentation/interfaces/FileBankProps.html +1 -1
- package/documentation/interfaces/FolderProps.html +1 -1
- package/documentation/interfaces/ListFilterSpec.html +1 -1
- package/documentation/interfaces/OF.html +1 -1
- package/documentation/interfaces/ObjectListProps.html +1 -1
- package/documentation/interfaces/PagingResults.html +1 -1
- package/documentation/interfaces/RootFolderProps.html +1 -1
- package/documentation/interfaces/SearchCategoryModel.html +1 -1
- package/documentation/interfaces/SearchCategoryValue.html +1 -1
- package/documentation/interfaces/SearchConfig.html +1 -1
- package/documentation/interfaces/SearchFacetModel.html +1 -1
- package/documentation/interfaces/SearchFacetValueModel.html +1 -1
- package/documentation/interfaces/SearchQuery.html +1 -1
- package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
- package/documentation/interfaces/SearchQueryOption.html +1 -1
- package/documentation/interfaces/SearchQueryResult.html +1 -1
- package/documentation/interfaces/SearchQuerySortModel.html +1 -1
- package/documentation/interfaces/SearchResultCatProps.html +1 -1
- package/documentation/interfaces/SearchResultPropsApp.html +1 -1
- package/documentation/interfaces/SearchResultPropsObject.html +1 -1
- package/documentation/interfaces/SpotProps.html +1 -1
- package/documentation/interfaces/Taxonomy.html +1 -1
- package/documentation/interfaces/TaxonomyCreate.html +1 -1
- package/documentation/interfaces/WindowInterface.html +1 -1
- package/documentation/modules.html +9 -9
- package/lib/jamespot-user-api.js +1 -1
- package/lib/jamespot-user-api.js.map +1 -1
- package/lib/src/apis/filebank.d.ts +15 -3
- package/lib/src/types/group.d.ts +1 -1
- package/package.json +1 -1
- package/phpunitMock/spotGetProperties-default.json +1 -1
package/lib/jamespot-user-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var t,e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},s={};e.r(s),e.d(s,{AdminLicenseApi:()=>o,AdminStoreApi:()=>n,AdminUtilsApi:()=>i,JApplicationApi:()=>a,JArticleApi:()=>c,JAssetReservation:()=>p,JAudienceApi:()=>l,JBaseApi:()=>r,JBookmarkApi:()=>f,JCommunityApi:()=>h,JDiapazoneApi:()=>d,JFileApi:()=>g,JFilebankApi:()=>w,JGroupApi:()=>k,JLandApi:()=>O,JMessengerApi:()=>v,JSearchApi:()=>A,JShareApi:()=>F,JTaxonomyApi:()=>S,JUserApi:()=>x,JWedocApi:()=>L,JamespotUserApi:()=>R,JamespotUserApiInstance:()=>ut,Network:()=>U,StudioApplicationStatus:()=>t,TVDisplayApi:()=>C,UserLevel:()=>P,WindowBrowser:()=>M,allowedFileExtensions:()=>D,api:()=>lt,apiFileToWidgetFile:()=>W,deepEqual:()=>ot,default:()=>pt,extractTaxonomiesFromObject:()=>it,extractTaxonomiesFromObjectAndMapUri:()=>at,formatImgUrl:()=>tt,getArgs:()=>X,getExtensionFromName:()=>I,getFileFamily:()=>q,getFormat:()=>Y,getFrom:()=>H,getMimetypeFromExtension:()=>N,getSize:()=>K,getTimestamp:()=>V,getUri:()=>G,getUrl:()=>Z,jEnsure:()=>$,mimetypeMap:()=>E,network:()=>ct,padStartTwoDigits:()=>Q,removeIfStartsWith:()=>_,replacePropertiesWithTypes:()=>nt,suffixIfDoesNotExist:()=>z});class r{constructor(t){this.jApi=t,this.network=t.network}}class o extends r{getLicenseUserStatistics(){return this.network.post({o:"licenseManager",f:"userStatistics"})}assignLicense(t){return this.network.postCSRF({o:"licenseManager",f:"assignLicense",uri:t})}unAssignLicense(t){return this.network.postCSRF({o:"licenseManager",f:"unassignLicense",uri:t})}getAssignmentMode(t){return this.network.post({o:"licenseManager",f:"getAssignmentMode",type:t})}setAssignmentMode(t,e){return this.network.postCSRF({o:"licenseManager",f:"setAssignmentMode",value:e,type:t})}assignPossiblesLicenses(t){return this.network.postCSRF({o:"licenseManager",f:"assignPossiblesLicenses",type:t})}unAssignUnusedLicenses(t){return this.network.postCSRF({o:"licenseManager",f:"unassignUnusedLicenses",type:t})}optimizeLicenses(t){return this.network.postCSRF({o:"licenseManager",f:"optimizeLicenses",type:t})}getObjectsWithoutLicense(t,e){return this.network.post({o:"licenseManager",f:"countObjectsWithoutLicense",type:t,filter:e})}getLicensesNotAssigned(t){return this.network.post({o:"licenseManager",f:"countLicensesNotAssigned",type:t})}getLicensesAssigned(t){return this.network.post({o:"licenseManager",f:"getLicensesAssigned",type:t})}}class n extends r{getItem(t){return this.network.post({o:"adminStore",f:"getItem",uri:t})}checkoutBilling(t){return this.network.postCSRF({o:"adminStore",f:"checkoutBilling",uri:t})}checkoutFinalize(t){return this.network.postCSRF({o:"adminStore",f:"checkoutFinalize",uri:t})}}class i extends r{getApps(){return this.network.post({o:"admin",f:"apps"})}}!function(t){t.local="local",t.installed="installed",t.autosaved="autosaved",t.saved="saved"}(t||(t={}));class a extends r{list(){return this.network.post({o:"studio",f:"list"})}get(t,e){return this.network.post({o:"studio",f:"get",idApp:t,status:e})}install(t){return this.network.postCSRF({o:"studio",f:"install",value:t})}suspend(t){return this.network.postCSRF({o:"studio",f:"suspend",idApp:t})}restart(t){return this.network.postCSRF({o:"studio",f:"restart",idApp:t})}save(e,s,r){if(r===t.saved||r===t.autosaved)return this.network.postCSRF({o:"studio",f:"save",idApp:e,value:s,status:r});throw"Invalid status value"}delete(t,e){return s=this,r=void 0,n=function*(){return this.network.postCSRF({o:"studio",f:"delete",idApp:t,status:e}).then((t=>{if(0===t.error)return t.messages;throw t.messages}))},new((o=void 0)||(o=Promise))((function(t,e){function i(t){try{c(n.next(t))}catch(t){e(t)}}function a(t){try{c(n.throw(t))}catch(t){e(t)}}function c(e){var s;e.done?t(e.value):(s=e.value,s instanceof o?s:new o((function(t){t(s)}))).then(i,a)}c((n=n.apply(s,r||[])).next())}));var s,r,o,n}cssClassList(){return this.network.post({o:"studio",f:"icons"})}}class c extends r{list(t){return this.network.post(Object.assign({o:"objectList",f:"jamespotArticleQueryList"},t))}get(t){return this.network.post(Object.assign({o:"article",f:"get"},t))}create(t,e){return this.network.maybePostToken(Object.assign({o:"article",f:"create",format:null!=e?e:"raw-list"},t))}update(t){return this.network.post(Object.assign(Object.assign({format:"raw-list"},t),{o:"article",f:"update"}))}delete(t){return this.network.postCSRF({o:"article",f:"delete",idArticle:t})}count(t){return this.network.post({o:"article",f:"count",type:t})}}var u=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s};class p extends r{configuration(){return this.network.post({o:"assetReservation",f:"configuration"})}createReservation(t){return this.network.postCSRF(Object.assign({o:"assetReservation",f:"createReservation",format:"raw-list"},t))}getReservations(t){var{format:e="raw-list"}=t,s=u(t,["format"]);return this.network.post(Object.assign({o:"assetReservation",f:"getReservations",format:e},s))}cancelReservation(t){return this.network.post({o:"assetReservation",f:"cancelReservation",format:"raw-list",idArticle:t})}bookByDate(t){var{format:e="raw-list"}=t,s=u(t,["format"]);return this.network.post(Object.assign({o:"assetReservation",f:"BookByDate",format:e},s))}getList(t){var{format:e="raw-list"}=t,s=u(t,["format"]);return this.network.post(Object.assign({o:"objectList",f:"assetReservationList",format:e},s))}}class l extends r{autocomplete(t){return this.network.post({o:"autocomplete",f:"audience",q:t}).then((t=>{if(Array.isArray(t.result))return t.result;throw"Bad response from backend"}))}}class f extends r{getFormattedList(t,e){return this.network.post(Object.assign({o:"objectList",f:"bookmarksList",format:e},t))}addFormattedLink(t,e,s){const r=null!=s?s:"list";return this.network.post({o:"custom",f:"actionAdd",type:"bookmarkLink",targetId:t,targetType:e,format:r})}addBookmark(t,e){return this.network.postCSRF(Object.assign({o:"bookmarks",f:"add"},t))}delete(t){return this.network.postCSRF({o:"bookmarks",f:"delete",bookmarkID:t})}rename(t,e,s){return this.network.postCSRF({o:"bookmarks",f:"rename",bookmarkID:t,bookmarkLabel:e,bookmarkUrl:s})}move(t,e,s){return this.network.postCSRF({o:"bookmarks",f:"move",bookmarkID:t,bookmarkReference:e,bookmarkPosition:s})}}class h extends r{get(t,e){return this.network.post({o:"community",f:"getCommunity",idCommunity:t,format:e||"raw-little"})}sendRequest(t,e){return this.network.post({o:"community",f:"sendRequest",message:t,idUserTo:e})}autocomplete(t){return this.network.post({o:"autocomplete",f:"community",q:t}).then((t=>t.result))}}class d extends r{create(t,e,s,r,o){return this.network.post({o:"article",f:"create",type:t,token:e,title:s,dateStart:r,publishTo:o})}getList(t="",e=[],s=[],r=1,o="raw-list"){return this.network.post({o:"objectList",f:"diapazoneQueryList",query:t,filters:e,orders:s,page:r,format:o})}}var m=function(t,e,s,r){return new(s||(s=Promise))((function(o,n){function i(t){try{c(r.next(t))}catch(t){n(t)}}function a(t){try{c(r.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))};class g extends r{upload(t){const e=new FormData;return e.append("attrName",t.attrName),t.file?e.append(t.attrName,t.file):t.url&&e.append("url",t.url),e.append("token",t.token),this.network.postFile(e)}uploadMany(t){return m(this,void 0,void 0,(function*(){return Promise.all(t.map((t=>this.upload(t))))}))}update(t,e,s){return m(this,void 0,void 0,(function*(){return this.network.post({o:"file",f:"update",idFile:t,type:e,cropDatas:{w:s.width,h:s.height,x:s.x,y:s.y,rotation:s.rotation,rotateBeforeCrop:!0},killSize:s.killSize}).then((t=>{if(!t.result.crop)return t;const e=JSON.parse(t.result.crop);return Object.assign(Object.assign({},t),{result:Object.assign(Object.assign({},t.result),{crop:{width:e.w,height:e.h,x:e.x,y:e.y,rotation:e.rotation}})})}))}))}deleteFile(t,e,s,r){return m(this,void 0,void 0,(function*(){return this.network.post({o:"file",f:"delete",idFile:t,attrName:e,token:s},r)}))}deleteImage(t,e){return m(this,void 0,void 0,(function*(){return this.network.post({o:"file",f:"deleteImage",id:t,type:e})}))}}class w extends r{getBanks(t="list"){return this.network.post({o:"fileBank",f:"getBanks",format:t}).then((t=>t.result))}getFolders(t){return this.network.post({o:"fileBank",f:"getFolders",parentURI:t}).then((t=>t.result))}}class k extends r{autocomplete(t){return this.network.post({o:"autocomplete",f:"spot",q:t,idToUri:!1}).then((t=>t.result))}create(t,e){return this.network.post(Object.assign(Object.assign({o:"spot",f:"create"},t),{format:e}))}update(t,e){const{spotBanner:s}=t,r=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s}(t,["spotBanner"]);return this.network.postCSRF(Object.assign(Object.assign({o:"spot",f:"update"},r),{format:e}))}getSpot(t,e){return this.network.post({o:"spot",f:"getSpot",idSpot:t,format:e})}getProperties(t){return this.network.post({o:"spot",f:"getProperties",idSpot:t})}getApplications(){return this.network.post({o:"spot",f:"get-available-widget"})}getCategories(){return this.network.post({o:"spot",f:"get-categories"})}getObjectListJamespotSpotMembers(t,e,s,r=1){return this.network.post({o:"objectListJamespot",f:"SpotMembers",idSpot:t,limit:s,page:r,format:"raw-little",query:e})}resetNotifications(t){return this.network.post(Object.assign({o:"spot",f:"resetNotifications"},t))}}class b extends r{list(t,e,s,r=[{name:"dateCreation",sort:"DESC"}]){return this.jApi.article.list({type:"aseiClearanceTicket",format:"raw-view",limit:e,page:t,orders:r,filters:s})}requestStatus(t,e,s){return this.network.post({o:"asei",f:"setStatus",uri:t,requestedStatus:e,audience:s}).then((t=>{if(t&&t.result)return t.result;throw"Bad response from backend"}))}getDedicatedGroups(){return this.network.post({o:"asei",f:"getDedicatedGroups"}).then((t=>{if(t&&t.result)return t.result;throw"Bad response from backend"}))}getConfiguration(){return this.network.post({o:"asei",f:"configuration"}).then((t=>{if(t&&t.result)return t.result.right;throw"Bad response from backend"}))}}class y extends r{tenants(){return this.network.post({o:"drive",f:"getTenants"})}groups(){return this.network.post({o:"drive",f:"getGroups"})}sites(){return this.network.post({o:"drive",f:"getSites"})}documents(t,e){return this.network.post({o:"drive",f:"getDocuments",service:t,documentParams:e})}}class j extends r{GetUnclassifiedFiles(t="raw-list"){return this.network.post({o:"objectListMediaLibrary",f:"GetUnclassifiedFiles",format:t})}}class O extends r{getLogs({dateEnd:t,idLogMax:e}){return this.network.post({o:"jLand",f:"adminLogs",dateEnd:t,idLogMax:e})}getStats({map:t,dateStart:e,dateEnd:s}){return this.network.post({o:"jLand",f:"adminStats",map:t,dateStart:e,dateEnd:s})}getAllMapsAsAdmin(t="raw-list,licenses"){return this.network.post({o:"objectListJLand",f:"jLandList",format:t})}createMap(t,e="raw-list"){return this.network.maybePostToken(Object.assign(Object.assign({},t),{o:"article",f:"create",format:e,type:"jlandmap"}))}}class v extends r{sendMessage(t,e){return this.network.post({o:"messenger",f:"newMessage",idDiscussion:e,msg:{description:t}})}getOrCreateDiscussion(t,e){const s=t<e?`${t}.${e}`:`${e}.${t}`;return this.network.post({o:"messenger",f:"getDiscussion",idDiscussion:s,type:"messengerUser",idUserTo:e})}}class A extends r{getConfig(){return this.network.post({o:"search",f:"getConfig"})}proposition({query:t,format:e},s){return this.network.post({o:"search",f:"proposition",query:t,format:e||"little"},s)}searchQuery(t,e){const{keywords:s,category:r,facetCategories:o,filters:n,page:i,limit:a,sort:c,options:u}=t;return this.network.post({o:"search",f:"query",keywords:s,category:r,facetCategories:o,filters:n,page:i,limit:a,sort:c,options:u},e)}getLastQueries(){return this.network.post({o:"search",f:"getLastQueries"})}getAdminConfig(){return this.network.post({o:"search",f:"getAdminConfig"})}setAdminConfig(t){return this.network.post({o:"search",f:"setAdminConfig",config:t})}}class S extends r{list(){return this.network.post({o:"taxonomy",f:"list"}).then((t=>{if(Array.isArray(t.result))return t.result;throw"Bad response from backend"}))}create(t){return this.network.post(Object.assign({o:"taxonomy",f:"create"},t))}autocomplete(t,e){return this.network.post({o:"autocomplete",f:"taxonomy",q:e,idTaxonomy:t,idToUri:!1})}autocompleteList(t){return this.network.post(Object.assign({o:"objectListTaxonomy",f:"concept"},t))}autocompleteHierarchy(t){return this.network.post(Object.assign({o:"objectListTaxonomyHierarchy",f:"concept"},t))}}class x extends r{autocomplete(t){return this.network.post({o:"autocomplete",f:"user",q:t,idToUri:!1}).then((t=>t.result))}get(t,e="little"){return this.network.post({o:"user",f:"get",uri:t,format:e})}configuration(){return this.network.post({o:"userDirectory",f:"configuration"})}userList(t,e){return this.network.post(Object.assign({o:"objectList",f:"JamespotUserList"},t),e)}userQueryList(t){return this.network.post(Object.assign({o:"objectList",f:"JamespotUserQueryList"},t))}userMap(t){return this.network.post(Object.assign({o:"objectListJamespot",f:"userMap"},t))}userBusinessContactQueryList(t){return this.network.post(Object.assign({o:"businessContact",f:"queryList"},t))}userCreateBusinessContact(t){const e=Object.assign(Object.assign({},t),{pseudo:t.title,firstName:t.firstname,lastName:t.lastname,champ1:t.field1,champ2:t.field2,champ3:t.field3,champ4:t.field4,champ5:t.field5}),s=Object.assign(Object.assign({},e),{type:"businessContactCard",publishTo:"networkPublic/1"});return this.jApi.article.create(s)}userUpdateBusinessContact(t){const e=Object.assign(Object.assign({},t),{pseudo:t.title,firstName:t.firstname,lastName:t.lastname,champ1:t.field1,champ2:t.field2,champ3:t.field3,champ4:t.field4,champ5:t.field5}),s=Object.assign(Object.assign({},e),{uri:t.uri,publishTo:"networkPublic/1"});return this.jApi.article.update(s)}userDeleteBusinessContact(t){return this.jApi.article.delete(t)}userAddContact(t){return this.network.post({o:"user",f:"addContact",idUser:t})}userRemoveContact(t){return this.network.post({o:"user",f:"removeContact",idUser:t})}signIn(t,e){return this.network.post({o:"user",f:"signIn",mail:t,password:e})}}class L extends r{getFiles(t){return this.network.post(Object.assign({o:"onlyOffice",f:"getFiles"},t))}getFile(t,e){return this.network.post({o:"onlyOffice",f:"getFile",idFile:t,hash:e})}getTemplates(){return this.network.post({o:"onlyOffice",f:"getTemplates"})}duplicateFile(t,e,s){return this.network.post({o:"onlyOffice",f:"duplicateFile",idFile:t,title:e,publishTo:s})}deleteFile(t,e){return this.network.postCSRF({o:"onlyOffice",f:"deleteFile",idFile:t,withParent:e})}createFile(t,e,s){return this.network.post({o:"onlyOffice",f:"createFile",title:t,type:e,publishTo:s})}updateFile(t,e){return this.network.post({o:"onlyOffice",f:"updateFile",idFile:t,title:e})}}class C extends r{createChannel(t,e="raw-list"){return this.network.maybePostToken(Object.assign(Object.assign({},t),{o:"article",f:"create",format:e,type:"tvDisplayChannel"}))}getChannel(t){return this.network.post(Object.assign(Object.assign({},t),{o:"tvDisplay",f:"getChannel"}))}getConfigureChannel(t){return this.network.post(Object.assign(Object.assign({},t),{o:"tvDisplay",f:"getConfigureChannel"}))}}class F extends r{setObjectAccessRequest(t,e,s,r){return this.network.post({o:"onlyOffice",f:"setObjectAccessRequest",uri:t,idUser:e,requestAccessValue:s,requestResponseMessage:r})}getObjectAccessRequest(t,e){return this.network.post({o:"onlyOffice",f:"getObjectAccessRequest",format:"raw-little",uri:t,idUser:e})}getObject(t){return this.network.post({o:"onlyOffice",f:"getObject",uri:t})}askObjectAccess(t,e,s){return this.network.post({o:"onlyOffice",f:"askObjectAccess",uri:t,askAccess:e,askMessage:s})}setObjectAccess(t,e,s,r){return this.network.post({o:"onlyOffice",f:"setObjectAccess",uri:t,access:e,message:s,generalAccessRule:r})}getObjectAccess(t){return this.network.post({o:"onlyOffice",f:"getObjectAccess",uri:t})}getObjectAccessHash(t){return this.network.post({o:"onlyOffice",f:"getObjectAccessHash",uri:t})}}class R{constructor(t){this.version="1.0",this.network=t,this.admin={license:new o(this),store:new n(this),utils:new i(this)},this.application=new a(this),this.article=new c(this),this.asei=new b(this),this.assetReservation=new p(this),this.audience=new l(this),this.bookmark=new f(this),this.community=new h(this),this.diapazone=new d(this),this.drive=new y(this),this.file=new g(this),this.filebank=new w(this),this.group=new k(this),this.jland=new O(this),this.mediaLibrary=new j(this),this.messenger=new v(this),this.search=new A(this),this.share=new F(this),this.taxonomy=new S(this),this.tvDisplay=new C(this),this.user=new x(this),this.wedoc=new L(this)}}var T=function(t,e,s,r){return new(s||(s=Promise))((function(o,n){function i(t){try{c(r.next(t))}catch(t){n(t)}}function a(t){try{c(r.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))};class U{constructor(t,e="api-front"){this.window=t,this.action=e}static _formatPostOptions(t){const e=t?{body:JSON.stringify(t)}:void 0;return Object.assign({method:"POST",credentials:"same-origin"},e)}getUrl(t,e){return T(this,void 0,void 0,(function*(){const s=yield this.window.getBackendUrl();let r;try{r=new URL(`/${this.action}/${t}/${e}`,s).href}catch(o){r=`${s}/${this.action}/${t}/${e}`}return r}))}getHostname(){return T(this,void 0,void 0,(function*(){const t=(yield this.window.getBackendUrl()).split("//");return t.length>1?t[1]:t[0]}))}fetch(t,e){var{o:s,f:r}=t,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s}(t,["o","f"]);return T(this,void 0,void 0,(function*(){void 0===e&&(e=null);const t=yield this.getUrl(s,r);return this.window.fetch(t,Object.assign(Object.assign({},U._formatPostOptions(o)),{signal:e}))}))}post(t,e){return this.fetch(t,e).then((t=>t.json())).then((t=>{if(0===t.error)return t;throw{error:t.error,errorMsg:t.errorMsg,messages:t.messages}})).catch((t=>{if(e&&e.aborted)throw{error:-1,aborted:!0};throw t}))}postFile(t){return T(this,void 0,void 0,(function*(){const e=yield this.getUrl("file","create");if(!t.get("token")){const{result:e}=yield this.token();t.append("token",e)}return this.window.fetch(e,{method:"POST",credentials:"same-origin",body:t}).then((t=>t.json()))}))}postCSRF(t){return this.tokenCSRF().then((e=>this.post(Object.assign(t,{tokenCSRF:e.result}))))}postToken(t){return this.token().then((e=>this.post(Object.assign(t,{token:e.result}))))}maybePostToken(t){return"token"in t&&t.token?this.post(t):this.postToken(t)}token(){return this.post({o:"misc",f:"token"})}tokenCSRF(){return this.post({o:"misc",f:"tokenCSRF"})}}class M{getBackendUrl(){return t=this,e=void 0,r=function*(){const t=window.location;return`${t.protocol}//${t.host}`},new((s=void 0)||(s=Promise))((function(o,n){function i(t){try{c(r.next(t))}catch(t){n(t)}}function a(t){try{c(r.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}));var t,e,s,r}fetch(t,e){return window.fetch(t,e)}}const P={ADMIN:9,USER:5,EXTERNAL:3,GUEST:0};function B(t){const e=t;return e&&"number"==typeof e.id&&"number"==typeof e.targetId}const J={bookmarkLink:B},$={isBookmarkLink:function(t){return"targetId"in t&&!!t.targetId},isBookmarkCustom:function(t){const e=t;return void 0!==e.bookmarkLabel||void 0!==e.bookmarkMeta||void 0!==e.bookmarkUrl},isBookmarkRawList:B,isTVChannelType:function(t,e){return"tvChannelType"in t&&t.tvChannelType===e},objectIsType:function(t,e){return null!=e&&J[t](e)},isStandardApiError:t=>"object"==typeof t&&null!==t&&"error"in t&&"errorMsg"in t&&"messages"in t&&"number"==typeof t.error&&"string"==typeof t.errorMsg&&Array.isArray(t.messages),isAbortApiError:t=>null!==t&&"object"==typeof t&&"error"in t&&"aborted"in t&&-1===t.error&&!0===t.aborted},D=["docx","xlsx","pptx","pdf","jpeg","png","zip","mp3","mp4","jpg","txt"],E={docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",pdf:"application/pdf",jpeg:"image/jpeg",jpg:"image/jpg",png:"image/png",zip:"application/zip",mp3:"audio/mp3",mp4:"video/mp4"};function I(t){const e=String(t).split(".").pop();if(void 0!==e&&D.find((t=>t===e.toLocaleLowerCase())))return e}function q(t){return t&&(t.startsWith("image/vnd")||t.startsWith("image/svg"))?"application":t&&t.startsWith("image/")?"image":t&&t.startsWith("video/")?"video":t&&t.startsWith("audio/")?"audio":t&&t.startsWith("font/")?"font":t&&t.startsWith("text/")?"text":"application"}function N(t){var e;const s=void 0!==t?String(t).toLocaleLowerCase():"noExt";return null!==(e=E[s])&&void 0!==e?e:"txt"}function W(t){const e=N(I(t.name));return{id:parseInt(t.id),filename:t.name,mimetype:e,dimension:t.imagesize}}function z(t,e){return t&&!t.endsWith(e)?`${t}${e}`:t}function _(t,e){return t&&t.startsWith(e)?t.split("").slice(e.length).join(""):t}function Q(t){return t.toString().padStart(2,"0")}function G(t){return"uri"in t&&t.uri?t.uri:`${t.type}/${t.recordId}`}function H(t){return _(z(t.from,"/"),"/")||""}function V(t){return t.timestamp?`?_=${t.timestamp}`:""}function X(t){const e=[];return"timestamp"in t&&t.timestamp&&e.push(`_=${t.timestamp}`),"iconColor"in t&&t.iconColor&&e.push(`color=${t.iconColor}`),e.length?"?"+e.join("&"):""}function K(t,e=2){return"size"in t&&t.size?t.size:"width"in t&&t.width&&"height"in t&&t.height?`${t.width*e}x${t.height*e}`:""}function Y(t){return t.format||"png"}function Z(t){try{return new URL(t)}catch(t){}try{return new URL(window.location.origin+"/"+_(t,"/"))}catch(t){}}function tt(t,e=2){if("url"in t&&t.url){const e=Z(t.url);if(e)return"timestamp"in t&&t.timestamp&&!e.searchParams.has("_")&&e.searchParams.append("_",t.timestamp.toString()),e.toString()}return`/${H(t)}${K(t,e)}/${G(t)}.${Y(t)}${X(t)}`}const et=Array.isArray,st=Object.keys,rt=Object.prototype.hasOwnProperty;function ot(t,e,s){const r=null==s?void 0:s.map((t=>t.split(".")));if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){const o=et(t),n=et(e);let i,a,c;if(o&&n){if(a=t.length,a!==e.length)return!1;for(i=a;0!=i--;)if(!ot(t[i],e[i],s))return!1;return!0}if(o!==n)return!1;const u=t instanceof Date,p=e instanceof Date;if(u!==p)return!1;if(u&&p)return t.getTime()===e.getTime();const l=t instanceof RegExp,f=e instanceof RegExp;if(l!==f)return!1;if(l&&f)return t.toString()===e.toString();const h=st(t).filter((t=>!(null==r?void 0:r.some((e=>1===e.length&&e[0]===t)))));if(a=h.length,a!==st(e).filter((t=>!(null==r?void 0:r.some((e=>1===e.length&&e[0]===t))))).length)return!1;for(i=a;0!=i--;)if(!rt.call(e,h[i]))return!1;for(i=a;0!=i--;)if(c=h[i],!("_owner"===c&&t.$$typeof||ot(t[c],e[c],null==r?void 0:r.filter((t=>t.length>1&&t[0]===c)).map((t=>t.splice(1).join("."))))))return!1;return!0}return t!=t&&e!=e}function nt(t,e){if(Array.isArray(t))return t.map((t=>nt(t,e)));if("object"==typeof t&&null!==t){let s={};return Object.keys(t).forEach((r=>{s=Object.assign(Object.assign({},s),{[r]:r&&e.includes(r)?typeof t[r]:nt(t[r],e)})})),s}return t}function it(t){return Object.fromEntries(Object.entries(t).filter((([t])=>t.startsWith("tag_"))))}function at(t){return Object.fromEntries(Object.entries(t).filter((([t])=>t.startsWith("tag_"))).map((([t,e])=>[t,Array.isArray(e)?e.map((t=>"object"==typeof t&&t&&"uri"in t?t.uri:t)):e])))}const ct=new U(new M),ut=new R(ct);window.JamespotUserApi=ut;const pt=ut,lt=R;module.exports=s})();
|
|
1
|
+
(()=>{"use strict";var t,e={d:(t,s)=>{for(var r in s)e.o(s,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:s[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},s={};e.r(s),e.d(s,{AdminLicenseApi:()=>o,AdminStoreApi:()=>n,AdminUtilsApi:()=>i,JApplicationApi:()=>a,JArticleApi:()=>c,JAssetReservation:()=>p,JAudienceApi:()=>l,JBaseApi:()=>r,JBookmarkApi:()=>f,JCommunityApi:()=>h,JDiapazoneApi:()=>d,JFileApi:()=>g,JFilebankApi:()=>w,JGroupApi:()=>k,JLandApi:()=>O,JMessengerApi:()=>v,JSearchApi:()=>A,JShareApi:()=>F,JTaxonomyApi:()=>S,JUserApi:()=>x,JWedocApi:()=>L,JamespotUserApi:()=>R,JamespotUserApiInstance:()=>ut,Network:()=>U,StudioApplicationStatus:()=>t,TVDisplayApi:()=>C,UserLevel:()=>P,WindowBrowser:()=>M,allowedFileExtensions:()=>$,api:()=>lt,apiFileToWidgetFile:()=>W,deepEqual:()=>ot,default:()=>pt,extractTaxonomiesFromObject:()=>it,extractTaxonomiesFromObjectAndMapUri:()=>at,formatImgUrl:()=>tt,getArgs:()=>X,getExtensionFromName:()=>E,getFileFamily:()=>q,getFormat:()=>Y,getFrom:()=>H,getMimetypeFromExtension:()=>N,getSize:()=>K,getTimestamp:()=>V,getUri:()=>G,getUrl:()=>Z,jEnsure:()=>J,mimetypeMap:()=>I,network:()=>ct,padStartTwoDigits:()=>Q,removeIfStartsWith:()=>_,replacePropertiesWithTypes:()=>nt,suffixIfDoesNotExist:()=>z});class r{constructor(t){this.jApi=t,this.network=t.network}}class o extends r{getLicenseUserStatistics(){return this.network.post({o:"licenseManager",f:"userStatistics"})}assignLicense(t){return this.network.postCSRF({o:"licenseManager",f:"assignLicense",uri:t})}unAssignLicense(t){return this.network.postCSRF({o:"licenseManager",f:"unassignLicense",uri:t})}getAssignmentMode(t){return this.network.post({o:"licenseManager",f:"getAssignmentMode",type:t})}setAssignmentMode(t,e){return this.network.postCSRF({o:"licenseManager",f:"setAssignmentMode",value:e,type:t})}assignPossiblesLicenses(t){return this.network.postCSRF({o:"licenseManager",f:"assignPossiblesLicenses",type:t})}unAssignUnusedLicenses(t){return this.network.postCSRF({o:"licenseManager",f:"unassignUnusedLicenses",type:t})}optimizeLicenses(t){return this.network.postCSRF({o:"licenseManager",f:"optimizeLicenses",type:t})}getObjectsWithoutLicense(t,e){return this.network.post({o:"licenseManager",f:"countObjectsWithoutLicense",type:t,filter:e})}getLicensesNotAssigned(t){return this.network.post({o:"licenseManager",f:"countLicensesNotAssigned",type:t})}getLicensesAssigned(t){return this.network.post({o:"licenseManager",f:"getLicensesAssigned",type:t})}}class n extends r{getItem(t){return this.network.post({o:"adminStore",f:"getItem",uri:t})}checkoutBilling(t){return this.network.postCSRF({o:"adminStore",f:"checkoutBilling",uri:t})}checkoutFinalize(t){return this.network.postCSRF({o:"adminStore",f:"checkoutFinalize",uri:t})}}class i extends r{getApps(){return this.network.post({o:"admin",f:"apps"})}}!function(t){t.local="local",t.installed="installed",t.autosaved="autosaved",t.saved="saved"}(t||(t={}));class a extends r{list(){return this.network.post({o:"studio",f:"list"})}get(t,e){return this.network.post({o:"studio",f:"get",idApp:t,status:e})}install(t){return this.network.postCSRF({o:"studio",f:"install",value:t})}suspend(t){return this.network.postCSRF({o:"studio",f:"suspend",idApp:t})}restart(t){return this.network.postCSRF({o:"studio",f:"restart",idApp:t})}save(e,s,r){if(r===t.saved||r===t.autosaved)return this.network.postCSRF({o:"studio",f:"save",idApp:e,value:s,status:r});throw"Invalid status value"}delete(t,e){return s=this,r=void 0,n=function*(){return this.network.postCSRF({o:"studio",f:"delete",idApp:t,status:e}).then((t=>{if(0===t.error)return t.messages;throw t.messages}))},new((o=void 0)||(o=Promise))((function(t,e){function i(t){try{c(n.next(t))}catch(t){e(t)}}function a(t){try{c(n.throw(t))}catch(t){e(t)}}function c(e){var s;e.done?t(e.value):(s=e.value,s instanceof o?s:new o((function(t){t(s)}))).then(i,a)}c((n=n.apply(s,r||[])).next())}));var s,r,o,n}cssClassList(){return this.network.post({o:"studio",f:"icons"})}}class c extends r{list(t){return this.network.post(Object.assign({o:"objectList",f:"jamespotArticleQueryList"},t))}get(t){return this.network.post(Object.assign({o:"article",f:"get"},t))}create(t,e){return this.network.maybePostToken(Object.assign({o:"article",f:"create",format:null!=e?e:"raw-list"},t))}update(t){return this.network.post(Object.assign(Object.assign({format:"raw-list"},t),{o:"article",f:"update"}))}delete(t){return this.network.postCSRF({o:"article",f:"delete",idArticle:t})}count(t){return this.network.post({o:"article",f:"count",type:t})}}var u=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s};class p extends r{configuration(){return this.network.post({o:"assetReservation",f:"configuration"})}createReservation(t){return this.network.postCSRF(Object.assign({o:"assetReservation",f:"createReservation",format:"raw-list"},t))}getReservations(t){var{format:e="raw-list"}=t,s=u(t,["format"]);return this.network.post(Object.assign({o:"assetReservation",f:"getReservations",format:e},s))}cancelReservation(t){return this.network.post({o:"assetReservation",f:"cancelReservation",format:"raw-list",idArticle:t})}bookByDate(t){var{format:e="raw-list"}=t,s=u(t,["format"]);return this.network.post(Object.assign({o:"assetReservation",f:"BookByDate",format:e},s))}getList(t){var{format:e="raw-list"}=t,s=u(t,["format"]);return this.network.post(Object.assign({o:"objectList",f:"assetReservationList",format:e},s))}}class l extends r{autocomplete(t){return this.network.post({o:"autocomplete",f:"audience",q:t}).then((t=>{if(Array.isArray(t.result))return t.result;throw"Bad response from backend"}))}}class f extends r{getFormattedList(t,e){return this.network.post(Object.assign({o:"objectList",f:"bookmarksList",format:e},t))}addFormattedLink(t,e,s){const r=null!=s?s:"list";return this.network.post({o:"custom",f:"actionAdd",type:"bookmarkLink",targetId:t,targetType:e,format:r})}addBookmark(t,e){return this.network.postCSRF(Object.assign({o:"bookmarks",f:"add"},t))}delete(t){return this.network.postCSRF({o:"bookmarks",f:"delete",bookmarkID:t})}rename(t,e,s){return this.network.postCSRF({o:"bookmarks",f:"rename",bookmarkID:t,bookmarkLabel:e,bookmarkUrl:s})}move(t,e,s){return this.network.postCSRF({o:"bookmarks",f:"move",bookmarkID:t,bookmarkReference:e,bookmarkPosition:s})}}class h extends r{get(t,e){return this.network.post({o:"community",f:"getCommunity",idCommunity:t,format:e||"raw-little"})}sendRequest(t,e){return this.network.post({o:"community",f:"sendRequest",message:t,idUserTo:e})}autocomplete(t){return this.network.post({o:"autocomplete",f:"community",q:t}).then((t=>t.result))}}class d extends r{create(t,e,s,r,o){return this.network.post({o:"article",f:"create",type:t,token:e,title:s,dateStart:r,publishTo:o})}getList(t="",e=[],s=[],r=1,o="raw-list"){return this.network.post({o:"objectList",f:"diapazoneQueryList",query:t,filters:e,orders:s,page:r,format:o})}}var m=function(t,e,s,r){return new(s||(s=Promise))((function(o,n){function i(t){try{c(r.next(t))}catch(t){n(t)}}function a(t){try{c(r.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))};class g extends r{upload(t){const e=new FormData;return e.append("attrName",t.attrName),t.file?e.append(t.attrName,t.file):t.url&&e.append("url",t.url),e.append("token",t.token),this.network.postFile(e)}uploadMany(t){return m(this,void 0,void 0,(function*(){return Promise.all(t.map((t=>this.upload(t))))}))}update(t,e,s){return m(this,void 0,void 0,(function*(){return this.network.post({o:"file",f:"update",idFile:t,type:e,cropDatas:{w:s.width,h:s.height,x:s.x,y:s.y,rotation:s.rotation,rotateBeforeCrop:!0},killSize:s.killSize}).then((t=>{if(!t.result.crop)return t;const e=JSON.parse(t.result.crop);return Object.assign(Object.assign({},t),{result:Object.assign(Object.assign({},t.result),{crop:{width:e.w,height:e.h,x:e.x,y:e.y,rotation:e.rotation}})})}))}))}deleteFile(t,e,s,r){return m(this,void 0,void 0,(function*(){return this.network.post({o:"file",f:"delete",idFile:t,attrName:e,token:s},r)}))}deleteImage(t,e){return m(this,void 0,void 0,(function*(){return this.network.post({o:"file",f:"deleteImage",id:t,type:e})}))}}class w extends r{getBanks(t="list"){return this.network.post({o:"fileBank",f:"getBanks",format:t}).then((t=>t.result))}getFolders(t){return this.network.post({o:"fileBank",f:"getFolders",parentURI:t})}getDocuments(t){return this.network.post({o:"fileBank",f:"getDocuments",parentURI:t})}}class k extends r{autocomplete(t){return this.network.post({o:"autocomplete",f:"spot",q:t,idToUri:!1}).then((t=>t.result))}create(t,e){return this.network.post(Object.assign(Object.assign({o:"spot",f:"create"},t),{format:e}))}update(t,e){const{spotBanner:s}=t,r=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s}(t,["spotBanner"]);return this.network.postCSRF(Object.assign(Object.assign({o:"spot",f:"update"},r),{format:e}))}getSpot(t,e){return this.network.post({o:"spot",f:"getSpot",idSpot:t,format:e})}getProperties(t){return this.network.post({o:"spot",f:"getProperties",idSpot:t})}getApplications(){return this.network.post({o:"spot",f:"get-available-widget"})}getCategories(){return this.network.post({o:"spot",f:"get-categories"})}getObjectListJamespotSpotMembers(t,e,s,r=1){return this.network.post({o:"objectListJamespot",f:"SpotMembers",idSpot:t,limit:s,page:r,format:"raw-little",query:e})}resetNotifications(t){return this.network.post(Object.assign({o:"spot",f:"resetNotifications"},t))}}class b extends r{list(t,e,s,r=[{name:"dateCreation",sort:"DESC"}]){return this.jApi.article.list({type:"aseiClearanceTicket",format:"raw-view",limit:e,page:t,orders:r,filters:s})}requestStatus(t,e,s){return this.network.post({o:"asei",f:"setStatus",uri:t,requestedStatus:e,audience:s}).then((t=>{if(t&&t.result)return t.result;throw"Bad response from backend"}))}getDedicatedGroups(){return this.network.post({o:"asei",f:"getDedicatedGroups"}).then((t=>{if(t&&t.result)return t.result;throw"Bad response from backend"}))}getConfiguration(){return this.network.post({o:"asei",f:"configuration"}).then((t=>{if(t&&t.result)return t.result.right;throw"Bad response from backend"}))}}class y extends r{tenants(){return this.network.post({o:"drive",f:"getTenants"})}groups(){return this.network.post({o:"drive",f:"getGroups"})}sites(){return this.network.post({o:"drive",f:"getSites"})}documents(t,e){return this.network.post({o:"drive",f:"getDocuments",service:t,documentParams:e})}}class j extends r{GetUnclassifiedFiles(t="raw-list"){return this.network.post({o:"objectListMediaLibrary",f:"GetUnclassifiedFiles",format:t})}}class O extends r{getLogs({dateEnd:t,idLogMax:e}){return this.network.post({o:"jLand",f:"adminLogs",dateEnd:t,idLogMax:e})}getStats({map:t,dateStart:e,dateEnd:s}){return this.network.post({o:"jLand",f:"adminStats",map:t,dateStart:e,dateEnd:s})}getAllMapsAsAdmin(t="raw-list,licenses"){return this.network.post({o:"objectListJLand",f:"jLandList",format:t})}createMap(t,e="raw-list"){return this.network.maybePostToken(Object.assign(Object.assign({},t),{o:"article",f:"create",format:e,type:"jlandmap"}))}}class v extends r{sendMessage(t,e){return this.network.post({o:"messenger",f:"newMessage",idDiscussion:e,msg:{description:t}})}getOrCreateDiscussion(t,e){const s=t<e?`${t}.${e}`:`${e}.${t}`;return this.network.post({o:"messenger",f:"getDiscussion",idDiscussion:s,type:"messengerUser",idUserTo:e})}}class A extends r{getConfig(){return this.network.post({o:"search",f:"getConfig"})}proposition({query:t,format:e},s){return this.network.post({o:"search",f:"proposition",query:t,format:e||"little"},s)}searchQuery(t,e){const{keywords:s,category:r,facetCategories:o,filters:n,page:i,limit:a,sort:c,options:u}=t;return this.network.post({o:"search",f:"query",keywords:s,category:r,facetCategories:o,filters:n,page:i,limit:a,sort:c,options:u},e)}getLastQueries(){return this.network.post({o:"search",f:"getLastQueries"})}getAdminConfig(){return this.network.post({o:"search",f:"getAdminConfig"})}setAdminConfig(t){return this.network.post({o:"search",f:"setAdminConfig",config:t})}}class S extends r{list(){return this.network.post({o:"taxonomy",f:"list"}).then((t=>{if(Array.isArray(t.result))return t.result;throw"Bad response from backend"}))}create(t){return this.network.post(Object.assign({o:"taxonomy",f:"create"},t))}autocomplete(t,e){return this.network.post({o:"autocomplete",f:"taxonomy",q:e,idTaxonomy:t,idToUri:!1})}autocompleteList(t){return this.network.post(Object.assign({o:"objectListTaxonomy",f:"concept"},t))}autocompleteHierarchy(t){return this.network.post(Object.assign({o:"objectListTaxonomyHierarchy",f:"concept"},t))}}class x extends r{autocomplete(t){return this.network.post({o:"autocomplete",f:"user",q:t,idToUri:!1}).then((t=>t.result))}get(t,e="little"){return this.network.post({o:"user",f:"get",uri:t,format:e})}configuration(){return this.network.post({o:"userDirectory",f:"configuration"})}userList(t,e){return this.network.post(Object.assign({o:"objectList",f:"JamespotUserList"},t),e)}userQueryList(t){return this.network.post(Object.assign({o:"objectList",f:"JamespotUserQueryList"},t))}userMap(t){return this.network.post(Object.assign({o:"objectListJamespot",f:"userMap"},t))}userBusinessContactQueryList(t){return this.network.post(Object.assign({o:"businessContact",f:"queryList"},t))}userCreateBusinessContact(t){const e=Object.assign(Object.assign({},t),{pseudo:t.title,firstName:t.firstname,lastName:t.lastname,champ1:t.field1,champ2:t.field2,champ3:t.field3,champ4:t.field4,champ5:t.field5}),s=Object.assign(Object.assign({},e),{type:"businessContactCard",publishTo:"networkPublic/1"});return this.jApi.article.create(s)}userUpdateBusinessContact(t){const e=Object.assign(Object.assign({},t),{pseudo:t.title,firstName:t.firstname,lastName:t.lastname,champ1:t.field1,champ2:t.field2,champ3:t.field3,champ4:t.field4,champ5:t.field5}),s=Object.assign(Object.assign({},e),{uri:t.uri,publishTo:"networkPublic/1"});return this.jApi.article.update(s)}userDeleteBusinessContact(t){return this.jApi.article.delete(t)}userAddContact(t){return this.network.post({o:"user",f:"addContact",idUser:t})}userRemoveContact(t){return this.network.post({o:"user",f:"removeContact",idUser:t})}signIn(t,e){return this.network.post({o:"user",f:"signIn",mail:t,password:e})}}class L extends r{getFiles(t){return this.network.post(Object.assign({o:"onlyOffice",f:"getFiles"},t))}getFile(t,e){return this.network.post({o:"onlyOffice",f:"getFile",idFile:t,hash:e})}getTemplates(){return this.network.post({o:"onlyOffice",f:"getTemplates"})}duplicateFile(t,e,s){return this.network.post({o:"onlyOffice",f:"duplicateFile",idFile:t,title:e,publishTo:s})}deleteFile(t,e){return this.network.postCSRF({o:"onlyOffice",f:"deleteFile",idFile:t,withParent:e})}createFile(t,e,s){return this.network.post({o:"onlyOffice",f:"createFile",title:t,type:e,publishTo:s})}updateFile(t,e){return this.network.post({o:"onlyOffice",f:"updateFile",idFile:t,title:e})}}class C extends r{createChannel(t,e="raw-list"){return this.network.maybePostToken(Object.assign(Object.assign({},t),{o:"article",f:"create",format:e,type:"tvDisplayChannel"}))}getChannel(t){return this.network.post(Object.assign(Object.assign({},t),{o:"tvDisplay",f:"getChannel"}))}getConfigureChannel(t){return this.network.post(Object.assign(Object.assign({},t),{o:"tvDisplay",f:"getConfigureChannel"}))}}class F extends r{setObjectAccessRequest(t,e,s,r){return this.network.post({o:"onlyOffice",f:"setObjectAccessRequest",uri:t,idUser:e,requestAccessValue:s,requestResponseMessage:r})}getObjectAccessRequest(t,e){return this.network.post({o:"onlyOffice",f:"getObjectAccessRequest",format:"raw-little",uri:t,idUser:e})}getObject(t){return this.network.post({o:"onlyOffice",f:"getObject",uri:t})}askObjectAccess(t,e,s){return this.network.post({o:"onlyOffice",f:"askObjectAccess",uri:t,askAccess:e,askMessage:s})}setObjectAccess(t,e,s,r){return this.network.post({o:"onlyOffice",f:"setObjectAccess",uri:t,access:e,message:s,generalAccessRule:r})}getObjectAccess(t){return this.network.post({o:"onlyOffice",f:"getObjectAccess",uri:t})}getObjectAccessHash(t){return this.network.post({o:"onlyOffice",f:"getObjectAccessHash",uri:t})}}class R{constructor(t){this.version="1.0",this.network=t,this.admin={license:new o(this),store:new n(this),utils:new i(this)},this.application=new a(this),this.article=new c(this),this.asei=new b(this),this.assetReservation=new p(this),this.audience=new l(this),this.bookmark=new f(this),this.community=new h(this),this.diapazone=new d(this),this.drive=new y(this),this.file=new g(this),this.filebank=new w(this),this.group=new k(this),this.jland=new O(this),this.mediaLibrary=new j(this),this.messenger=new v(this),this.search=new A(this),this.share=new F(this),this.taxonomy=new S(this),this.tvDisplay=new C(this),this.user=new x(this),this.wedoc=new L(this)}}var T=function(t,e,s,r){return new(s||(s=Promise))((function(o,n){function i(t){try{c(r.next(t))}catch(t){n(t)}}function a(t){try{c(r.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}))};class U{constructor(t,e="api-front"){this.window=t,this.action=e}static _formatPostOptions(t){const e=t?{body:JSON.stringify(t)}:void 0;return Object.assign({method:"POST",credentials:"same-origin"},e)}getUrl(t,e){return T(this,void 0,void 0,(function*(){const s=yield this.window.getBackendUrl();let r;try{r=new URL(`/${this.action}/${t}/${e}`,s).href}catch(o){r=`${s}/${this.action}/${t}/${e}`}return r}))}getHostname(){return T(this,void 0,void 0,(function*(){const t=(yield this.window.getBackendUrl()).split("//");return t.length>1?t[1]:t[0]}))}fetch(t,e){var{o:s,f:r}=t,o=function(t,e){var s={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(s[r[o]]=t[r[o]])}return s}(t,["o","f"]);return T(this,void 0,void 0,(function*(){void 0===e&&(e=null);const t=yield this.getUrl(s,r);return this.window.fetch(t,Object.assign(Object.assign({},U._formatPostOptions(o)),{signal:e}))}))}post(t,e){return this.fetch(t,e).then((t=>t.json())).then((t=>{if(0===t.error)return t;throw{error:t.error,errorMsg:t.errorMsg,messages:t.messages}})).catch((t=>{if(e&&e.aborted)throw{error:-1,aborted:!0};throw t}))}postFile(t){return T(this,void 0,void 0,(function*(){const e=yield this.getUrl("file","create");if(!t.get("token")){const{result:e}=yield this.token();t.append("token",e)}return this.window.fetch(e,{method:"POST",credentials:"same-origin",body:t}).then((t=>t.json()))}))}postCSRF(t){return this.tokenCSRF().then((e=>this.post(Object.assign(t,{tokenCSRF:e.result}))))}postToken(t){return this.token().then((e=>this.post(Object.assign(t,{token:e.result}))))}maybePostToken(t){return"token"in t&&t.token?this.post(t):this.postToken(t)}token(){return this.post({o:"misc",f:"token"})}tokenCSRF(){return this.post({o:"misc",f:"tokenCSRF"})}}class M{getBackendUrl(){return t=this,e=void 0,r=function*(){const t=window.location;return`${t.protocol}//${t.host}`},new((s=void 0)||(s=Promise))((function(o,n){function i(t){try{c(r.next(t))}catch(t){n(t)}}function a(t){try{c(r.throw(t))}catch(t){n(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(i,a)}c((r=r.apply(t,e||[])).next())}));var t,e,s,r}fetch(t,e){return window.fetch(t,e)}}const P={ADMIN:9,USER:5,EXTERNAL:3,GUEST:0};function B(t){const e=t;return e&&"number"==typeof e.id&&"number"==typeof e.targetId}const D={bookmarkLink:B},J={isBookmarkLink:function(t){return"targetId"in t&&!!t.targetId},isBookmarkCustom:function(t){const e=t;return void 0!==e.bookmarkLabel||void 0!==e.bookmarkMeta||void 0!==e.bookmarkUrl},isBookmarkRawList:B,isTVChannelType:function(t,e){return"tvChannelType"in t&&t.tvChannelType===e},objectIsType:function(t,e){return null!=e&&D[t](e)},isStandardApiError:t=>"object"==typeof t&&null!==t&&"error"in t&&"errorMsg"in t&&"messages"in t&&"number"==typeof t.error&&"string"==typeof t.errorMsg&&Array.isArray(t.messages),isAbortApiError:t=>null!==t&&"object"==typeof t&&"error"in t&&"aborted"in t&&-1===t.error&&!0===t.aborted},$=["docx","xlsx","pptx","pdf","jpeg","png","zip","mp3","mp4","jpg","txt"],I={docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",pdf:"application/pdf",jpeg:"image/jpeg",jpg:"image/jpg",png:"image/png",zip:"application/zip",mp3:"audio/mp3",mp4:"video/mp4"};function E(t){const e=String(t).split(".").pop();if(void 0!==e&&$.find((t=>t===e.toLocaleLowerCase())))return e}function q(t){return t&&(t.startsWith("image/vnd")||t.startsWith("image/svg"))?"application":t&&t.startsWith("image/")?"image":t&&t.startsWith("video/")?"video":t&&t.startsWith("audio/")?"audio":t&&t.startsWith("font/")?"font":t&&t.startsWith("text/")?"text":"application"}function N(t){var e;const s=void 0!==t?String(t).toLocaleLowerCase():"noExt";return null!==(e=I[s])&&void 0!==e?e:"txt"}function W(t){const e=N(E(t.name));return{id:parseInt(t.id),filename:t.name,mimetype:e,dimension:t.imagesize}}function z(t,e){return t&&!t.endsWith(e)?`${t}${e}`:t}function _(t,e){return t&&t.startsWith(e)?t.split("").slice(e.length).join(""):t}function Q(t){return t.toString().padStart(2,"0")}function G(t){return"uri"in t&&t.uri?t.uri:`${t.type}/${t.recordId}`}function H(t){return _(z(t.from,"/"),"/")||""}function V(t){return t.timestamp?`?_=${t.timestamp}`:""}function X(t){const e=[];return"timestamp"in t&&t.timestamp&&e.push(`_=${t.timestamp}`),"iconColor"in t&&t.iconColor&&e.push(`color=${t.iconColor}`),e.length?"?"+e.join("&"):""}function K(t,e=2){return"size"in t&&t.size?t.size:"width"in t&&t.width&&"height"in t&&t.height?`${t.width*e}x${t.height*e}`:""}function Y(t){return t.format||"png"}function Z(t){try{return new URL(t)}catch(t){}try{return new URL(window.location.origin+"/"+_(t,"/"))}catch(t){}}function tt(t,e=2){if("url"in t&&t.url){const e=Z(t.url);if(e)return"timestamp"in t&&t.timestamp&&!e.searchParams.has("_")&&e.searchParams.append("_",t.timestamp.toString()),e.toString()}return`/${H(t)}${K(t,e)}/${G(t)}.${Y(t)}${X(t)}`}const et=Array.isArray,st=Object.keys,rt=Object.prototype.hasOwnProperty;function ot(t,e,s){const r=null==s?void 0:s.map((t=>t.split(".")));if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){const o=et(t),n=et(e);let i,a,c;if(o&&n){if(a=t.length,a!==e.length)return!1;for(i=a;0!=i--;)if(!ot(t[i],e[i],s))return!1;return!0}if(o!==n)return!1;const u=t instanceof Date,p=e instanceof Date;if(u!==p)return!1;if(u&&p)return t.getTime()===e.getTime();const l=t instanceof RegExp,f=e instanceof RegExp;if(l!==f)return!1;if(l&&f)return t.toString()===e.toString();const h=st(t).filter((t=>!(null==r?void 0:r.some((e=>1===e.length&&e[0]===t)))));if(a=h.length,a!==st(e).filter((t=>!(null==r?void 0:r.some((e=>1===e.length&&e[0]===t))))).length)return!1;for(i=a;0!=i--;)if(!rt.call(e,h[i]))return!1;for(i=a;0!=i--;)if(c=h[i],!("_owner"===c&&t.$$typeof||ot(t[c],e[c],null==r?void 0:r.filter((t=>t.length>1&&t[0]===c)).map((t=>t.splice(1).join("."))))))return!1;return!0}return t!=t&&e!=e}function nt(t,e){if(Array.isArray(t))return t.map((t=>nt(t,e)));if("object"==typeof t&&null!==t){let s={};return Object.keys(t).forEach((r=>{s=Object.assign(Object.assign({},s),{[r]:r&&e.includes(r)?typeof t[r]:nt(t[r],e)})})),s}return t}function it(t){return Object.fromEntries(Object.entries(t).filter((([t])=>t.startsWith("tag_"))))}function at(t){return Object.fromEntries(Object.entries(t).filter((([t])=>t.startsWith("tag_"))).map((([t,e])=>[t,Array.isArray(e)?e.map((t=>"object"==typeof t&&t&&"uri"in t?t.uri:t)):e])))}const ct=new U(new M),ut=new R(ct);window.JamespotUserApi=ut;const pt=ut,lt=R;module.exports=s})();
|
|
2
2
|
//# sourceMappingURL=jamespot-user-api.js.map
|