graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 6.46 kB
JavaScript
export const __webpack_id__=24025;export const __webpack_ids__=[5783,23686,24025,34894,77512,90275];export const __webpack_modules__={5783:(t,e,s)=>{s.r(e),s.d(e,{EndpointGenerationReport:()=>n,EndpointGenerationReportList:()=>i});class i{_reports;constructor(t){this._reports=t||[]}getReport(t){return this._reports.find(e=>e.endpointId===t)}get reports(){return this._reports}set reports(t){this._reports=t}}class n{_endpointId;_endpointURI;_active;_default;_label;_description;_lastModified;_objectsCount;_propertiesCount;_warnings;_errors;_messages;_createdSuccessfully;constructor(t){this._endpointId=t.endpointId||"",this._endpointURI=t.endpointURI||"",this._active=t.active||!1,this._default=t.default||!1,this._label=t.label||"",this._description=t.description||"",this._lastModified=t.lastModified||"",this._objectsCount=t.objectsCount||0,this._propertiesCount=t.propertiesCount||0,this._warnings=t.warnings||0,this._errors=t.errors||0,this._messages=t.messages||[],this._createdSuccessfully=this._active&&0===this._errors}toJSON(){return{id:this._endpointId,active:this._active,default:this._default,label:this._label,description:this._description,lastModified:this._lastModified,objectsCount:this._objectsCount,propertiesCount:this._propertiesCount,warnings:this._warnings,errors:this._errors,messages:this._messages}}get endpointId(){return this._endpointId}set endpointId(t){this._endpointId=t}get endpointURI(){return this._endpointURI}set endpointURI(t){this._endpointURI=t}get active(){return this._active}set active(t){this._active=t}get default(){return this._default}set default(t){this._default=t}get label(){return this._label}set label(t){this._label=t}get description(){return this._description}set description(t){this._description=t}get lastModified(){return this._lastModified}set lastModified(t){this._lastModified=t}get objectsCount(){return this._objectsCount}set objectsCount(t){this._objectsCount=t}get propertiesCount(){return this._propertiesCount}set propertiesCount(t){this._propertiesCount=t}get warnings(){return this._warnings}set warnings(t){this._warnings=t}get errors(){return this._errors}set errors(t){this._errors=t}get messages(){return this._messages}set messages(t){this._messages=t}get createdSuccessfully(){return this._createdSuccessfully}set createdSuccessfully(t){this._createdSuccessfully=t}}},23686:(t,e,s)=>{s.r(e),s.d(e,{EndpointDefinitionFile:()=>a,EndpointDefinitionFileList:()=>o,ImportStatus:()=>i,ImportStatusLabelKeys:()=>n,ImportStatusToViewMapping:()=>r});const i={PENDING:"PENDING",SUCCESS:"SUCCESS",FAIL:"FAIL",SKIP:"SKIP"},n={[i.PENDING]:"graphql.endpoints_management.import_definition_modal.status.pending",[i.SUCCESS]:"graphql.endpoints_management.import_definition_modal.status.completed",[i.FAIL]:"graphql.endpoints_management.import_definition_modal.status.failed",[i.SKIP]:"graphql.endpoints_management.import_definition_modal.status.not_allowed"},r={[i.PENDING]:"tag-warning",[i.SUCCESS]:"tag-success",[i.FAIL]:"tag-danger",[i.SKIP]:"tag-info"};class o{_list;_size;constructor(t=[]){this._list=t,this._size=t.length}processWith(t){this.list.forEach(t)}findDefinitionFileByName(t){return this.list.find(e=>e.file.name===t)}getFileNames(){return this.list.map(t=>t.file.name)}appendFiles(t){this.list.push(...t),this._size=this.list.length}removeFile(t){this.list=this.list.filter(e=>e.file!==t.file)}get size(){return this._size}set size(t){this._size=t}set list(t){this._list=t,this._size=t.length}get list(){return this._list}}class a{_list;_file;_filename;_status;_viewStatus;_statusMessage;_endpointId;_report;constructor(t,e,s,i){this._file=t,this._status=e,this._viewStatus=r[e],this._statusMessage=s,this._list=i}set file(t){this._file=t}get file(){return this._file}set filename(t){this._filename=t}get filename(){return this._filename}set status(t){this._status=t,this._viewStatus=r[t]}get status(){return this._status}set viewStatus(t){this._viewStatus=t}get viewStatus(){return this._viewStatus}set statusMessage(t){this._statusMessage=t}get statusMessage(){return this._statusMessage}set endpointId(t){this._endpointId=t}get endpointId(){return this._endpointId}set report(t){this._report=t}get report(){return this._report}get list(){return this._list}set list(t){this._list=t}}},24025:(t,e,s)=>{s.r(e),s.d(e,{fileToImportDefinitionMapper:()=>o,fileToImportDefinitionsMapper:()=>r,importEndpointDefinitionListMapper:()=>a});var i=s(23686),n=s(34894);const r=(t,e)=>{const s=t.map(t=>o(t,e));return new i.EndpointDefinitionFileList(s)},o=(t,e)=>new i.EndpointDefinitionFile(t,e,i.ImportStatusLabelKeys[e]),a=(t,e,s)=>{if(!t||!t.length)return new i.EndpointDefinitionFileList;const r=t=>{const o=t.id,a=t.filename,p=t.status.toUpperCase();let d=s.findDefinitionFileByName(a)||new i.EndpointDefinitionFile;if(d.endpointId=o,d.filename=a,d.status=p,d.statusMessage=i.ImportStatusLabelKeys[p],d.report=(0,n.importEndpointDefinitionReportMapper)(t,o,e),t.subFiles){const e=t.subFiles.map(r);d.list=new i.EndpointDefinitionFileList(e)}return d};return t.forEach(r),new i.EndpointDefinitionFileList([...s.list])}},34894:(t,e,s)=>{s.r(e),s.d(e,{endpointGenerationReportListMapper:()=>r,endpointGenerationReportMapper:()=>o,importEndpointDefinitionReportMapper:()=>a});var i=s(5783),n=s(90275);const r=(t,e)=>{if(!t)return new i.EndpointGenerationReportList;const s=t.map(t=>o(t,e));return new i.EndpointGenerationReportList(s)},o=(t,e)=>new i.EndpointGenerationReport({endpointId:t.id,endpointURI:(0,n.resolveGraphqlEndpoint)(e,t.id),active:t.active,default:t.default,label:t.label,description:t.description,lastModified:t.lastModified,objectsCount:t.objectsCount,propertiesCount:t.propertiesCount,warnings:t.warnings,errors:t.errors,messages:t.messages}),a=(t,e,s)=>{const r=t.messages?t.messages.errors?.length:0,o=t.messages?t.messages.warnings?.length:0;return new i.EndpointGenerationReport({endpointId:t.id,endpointURI:(0,n.resolveGraphqlEndpoint)(s,t.id),warnings:o,errors:r,messages:t.messages})}},77512:(t,e,s)=>{s.r(e),s.d(e,{endpointUrl:()=>i});const i={PLAYGROUND:"graphql/playground",CREATE_ENDPOINT:"graphql/endpoint/create",ENDPOINT_MANAGEMENT:"graphql/endpoints"}},90275:(t,e,s)=>{s.r(e),s.d(e,{resolveGraphqlEndpoint:()=>r,resolvePlaygroundUrlWithEndpoint:()=>o});var i=s(77512),n=s(69289);const r=(t,e)=>`${n.REPOSITORIES_ENDPOINT}/${t}/graphql/${e}`,o=t=>`${i.endpointUrl.PLAYGROUND}?endpointId=${t}`}};
//# sourceMappingURL=24025.5d9b042302441c40e552.bundle.js.map