graphdb-workbench
Version:
The web application for GraphDB APIs
2 lines • 9.8 kB
JavaScript
export const __webpack_id__=32534;export const __webpack_ids__=[16747,21388,23864,30514,32534];export const __webpack_modules__={10406:(e,t,s)=>{s.r(t),s.d(t,{GraphqlEndpointConfiguration:()=>c,GraphqlEndpointParams:()=>S});var r=s(29646),i=s(82854),n=s(28379),o=s(16014),p=s(23864),a=s(30514),h=s(21388);class c{_schemaSourceType;_owlOrShaclSourceType;_selectedGraphqlSchemaShapes;_selectedGraphs;_params;_settings;constructor(){this._schemaSourceType=h.SchemaSourceType.GRAPHQL_SCHEMA_SHAPES,this._owlOrShaclSourceType=h.OntologyShaclShapeSource.USE_ALL_GRAPHS,this._selectedGraphqlSchemaShapes=new r.GraphqlSchemaShapes,this._selectedGraphs=new i.GraphListOptions,this._params=new S({}),this._endpointConfigurationSettings=new n.GraphqlEndpointConfigurationSettings}generateFromGraphqlSchemaShapes(){return this.schemaSourceType===h.SchemaSourceType.GRAPHQL_SCHEMA_SHAPES}generateFromShaclShapes(){return this.schemaSourceType===h.SchemaSourceType.SHACL_SHAPES}toCreateEndpointFromShapesRequest(e){return new p.CreateEndpointFromShapesRequest({fromRepo:e,shapes:this.selectedGraphqlSchemaShapes.getShapeIds(),config:this.settings.toFlatJSON()})}toCreateEndpointFromOwlRequest(e){const t=this._owlOrShaclSourceType===h.OntologyShaclShapeSource.USE_ALL_GRAPHS?[]:this.selectedGraphs.getGraphIds();return new a.CreateEndpointFromOwlRequest({id:this.params.endpointId,label:this.params.endpointLabel,description:this.params.endpointDescription,fromRepo:e,namedGraphs:t,vocabPrefix:this.params.vocPrefix,config:this.settings.toFlatJSON()})}getSelectedGraphqlSchemaShapesOverview(){return this.generateFromGraphqlSchemaShapes()?this.selectedGraphqlSchemaShapes.processShapes(e=>new o.GraphqlEndpointOverview({label:e.label||e.id,uri:e.id})):this.generateFromShaclShapes()?this.selectedGraphs.isEmpty?[new o.GraphqlEndpointOverview({label:`${this.params.endpointId}`})]:this.selectedGraphs.processGraphList(e=>new o.GraphqlEndpointOverview({label:e.label||e.uri,uri:e.uri})):void 0}getSelectedGraphqlSchemaShapesCount(){return this.selectedGraphqlSchemaShapes.shapes.length}hasSelectedGraphqlSchemaShapes(){return this.getSelectedGraphqlSchemaShapesCount()>0}getSelectedGraphsCount(){return this.selectedGraphs.graphList.length}hasSelectedGraphs(){return this.getSelectedGraphsCount()>0}get owlOrShaclSourceType(){return this._owlOrShaclSourceType}set owlOrShaclSourceType(e){this._owlOrShaclSourceType=e}get schemaSourceType(){return this._schemaSourceType}set schemaSourceType(e){this._schemaSourceType=e}get settings(){return this._settings}set settings(e){this._settings=e}get selectedGraphs(){return this._selectedGraphs}set selectedGraphs(e){this._selectedGraphs=e}get params(){return this._params}set params(e){this._params=e}get selectedGraphqlSchemaShapes(){return this._selectedGraphqlSchemaShapes}set selectedGraphqlSchemaShapes(e){this._selectedGraphqlSchemaShapes=e}}class S{_endpointId;_endpointLabel;_endpointDescription;_vocPrefix;constructor(e){this._endpointId=e.endpointId||"",this._endpointLabel=e.endpointLabel||"",this._vocPrefix=e.vocPrefix||"",this._endpointDescription=e.endpointDescription||""}get endpointId(){return this._endpointId}set endpointId(e){this._endpointId=e}get endpointLabel(){return this._endpointLabel}set endpointLabel(e){this._endpointLabel=e}get endpointDescription(){return this._endpointDescription}set endpointDescription(e){this._endpointDescription=e}get vocPrefix(){return this._vocPrefix}set vocPrefix(e){this._vocPrefix=e}toJSON(){return{endpointId:this.endpointId,endpointLabel:this.endpointLabel,vocPrefix:this.vocPrefix,description:this.endpointDescription}}}},16747:(e,t,s)=>{s.r(t),s.d(t,{Wizard:()=>r,WizardStep:()=>i});class r{#e=[];#t=0;constructor(e=[],t=0){this.#e=e,this.#t=t}addStep(e){return this.#e.push(e),this}getActiveStep(){return this.#e.find(e=>e.active)}isAPreviousStep(e){return this.#e.indexOf(e)<this.#t}setStepActive(e){this.#e.forEach(e=>e.active=!1),e.active=!0;const t=this.#e.indexOf(e);this.#t=t,this.#e.forEach((e,s)=>{e.visited=s<t})}previousStep(){this.#t>0&&this.#t--;const e=this.#e[this.#t];return this.setStepActive(e),e}nextStep(){this.#t<this.#e.length-1&&this.#t++;const e=this.#e[this.#t];return this.setStepActive(e),e}get steps(){return this.#e}set steps(e){this.#e=e}get currentStep(){return this.#t}set currentStep(e){this.#t=e}}class i{#s="";#r=!1;#i=!1;#n="";#o="";constructor(e,t,s,r=!1){this.#s=e,this.#r=r,this.#n=t,this.#o=s,this.#i=!1}get page(){return this.#o}set page(e){this.#o=e}get templateUrl(){return this.#n}set templateUrl(e){this.#n=e}get active(){return this.#r}set active(e){this.#r=e}get id(){return this.#s}set id(e){this.#s=e}get visited(){return this.#i}set visited(e){this.#i=e}}},21388:(e,t,s)=>{s.r(t),s.d(t,{ConfigureEndpointStep:()=>p,GenerateEndpointStep:()=>a,OntologyShaclShapeSource:()=>n,SchemaSourceType:()=>i,SelectSchemaSourceStep:()=>o});var r=s(16747);const i={GRAPHQL_SCHEMA_SHAPES:"graphql_schema_shapes",SHACL_SHAPES:"shacl_shapes"},n={USE_ALL_GRAPHS:"use_all_graphs",USE_SHACL_SHAPE_GRAPH:"use_shacl_shape_graph",PICK_GRAPHS:"pick_graphs"};class o extends r.WizardStep{_schemaSourceTypes=[{value:i.GRAPHQL_SCHEMA_SHAPES},{value:i.SHACL_SHAPES}];_schemaSourceType=this._schemaSourceTypes[0].value;_ontologyShaclShapeSources=[{value:n.USE_ALL_GRAPHS},{value:n.USE_SHACL_SHAPE_GRAPH},{value:n.PICK_GRAPHS}];_ontotlogyShaclShapeSource=this._ontologyShaclShapeSources[0].value;constructor(){super("select_schema_sources",void 0,"schema-sources",!0)}get ontotlogyShaclShapeSource(){return this._ontotlogyShaclShapeSource}set ontotlogyShaclShapeSource(e){this._ontotlogyShaclShapeSource=e}get ontologyShaclShapeSources(){return this._ontologyShaclShapeSources}set ontologyShaclShapeSources(e){this._ontologyShaclShapeSources=e}get schemaSourceType(){return this._schemaSourceType}set schemaSourceType(e){this._schemaSourceType=e}get schemaSourceTypes(){return this._schemaSourceTypes}set schemaSourceTypes(e){this._schemaSourceTypes=e}}class p extends r.WizardStep{constructor(){super("configure_endpoint",void 0,"endpoint-config",!1)}}class a extends r.WizardStep{constructor(){super("generate_endpoint",void 0,"generate-endpoint",!1)}}},23864:(e,t,s)=>{s.r(t),s.d(t,{CreateEndpointFromShapesRequest:()=>r});class r{_fromRepo;_shapes;_config;constructor(e){this._fromRepo=e.fromRepo||"",this._shapes=e.shapes||[],this._config=e.config||{}}toJSON(){return{fromRepo:this.fromRepo,shapes:this.shapes,config:this.config}}get fromRepo(){return this._fromRepo}set fromRepo(e){this._fromRepo=e}get shapes(){return this._shapes}set shapes(e){this._shapes=e}get config(){return this._config}set config(e){this._config=e}}},30514:(e,t,s)=>{s.r(t),s.d(t,{CreateEndpointFromOwlRequest:()=>r});class r{_fromRepo;_namedGraphs;_id;_label;_description;_vocPrefix;_config;constructor(e){this._id=e.id||"",this._label=e.label||"",this._description=e.description||"",this._fromRepo=e.fromRepo||"",this._namedGraphs=e.namedGraphs||[],this._vocPrefix=e.vocabPrefix||"",this._config=e.config||{}}toJSON(){return{id:this.id,label:this.label,description:this.description,fromRepo:this.fromRepo,namedGraphs:this.namedGraphs,vocabPrefix:this.vocPrefix,config:this.config}}get fromRepo(){return this._fromRepo}set fromRepo(e){this._fromRepo=e}get namedGraphs(){return this._namedGraphs}set namedGraphs(e){this._namedGraphs=e}get id(){return this._id}set id(e){this._id=e}get label(){return this._label}set label(e){this._label=e}get description(){return this._description}set description(e){this._description=e}get vocPrefix(){return this._vocPrefix}set vocPrefix(e){this._vocPrefix=e}get config(){return this._config}set config(e){this._config=e}}},32534:(e,t,s)=>{s.r(t),s.d(t,{GraphqlEventName:()=>o});var r=s(98980),i=s(10406);function n(e){let t,s,n;const p=()=>t,a=()=>n,h=(t,s)=>{e.emitSync(t,(0,r.cloneDeep)(s))},c=(t,s)=>e.subscribeSync(t,e=>s(e));return{resetContext:()=>{s=void 0,n=void 0},updateSourceRepository:e=>{t=e,h(o.SOURCE_REPOSITORY_UPDATED,p())},getSourceRepository:p,setSelectedEndpoint:e=>{s=e},getSelectedEndpoint:()=>(0,r.cloneDeep)(s),getNewEndpoint:a,createEndpointConfig:()=>{n=new i.GraphqlEndpointConfiguration,e.emitSync(o.ENDPOINT_CONFIG_CREATED,n)},onEndpointConfigCreated:e=>(n&&angular.isFunction(e)&&e(n),c(o.ENDPOINT_CONFIG_CREATED,t=>e(t))),startCreateEndpointWizard:()=>{h(o.START_CREATE_ENDPOINT_WIZARD,null)},generateEndpoint:()=>{h(o.GENERATE_ENDPOINT,a())},endpointGenerated:e=>{h(o.ENDPOINT_GENERATED,e)},exploreEndpointInPlayground:e=>{h(o.EXPLORE_ENDPOINT_IN_PLAYGROUND,e)},openEndpointGenerationReport:e=>{h(o.OPEN_ENDPOINT_GENERATION_REPORT,e)},deleteEndpointGenerationReport:e=>{h(o.DELETE_ENDPOINT_REPORT,e)},cancelEndpointCreation:()=>{h(o.CANCEL_ENDPOINT_CREATION,{})},finishGenerationWorkflow:()=>{h(o.FINISH_GENERATION_WORKFLOW,{})},nextEndpointCreationStep:()=>{h(o.NEXT_ENDPOINT_CREATION_STEP,{})},previousEndpointCreationStep:()=>{h(o.PREVIOUS_ENDPOINT_CREATION_STEP,{})},subscribe:c}}angular.module("graphdb.framework.graphql.services.graphql-context",[]).factory("GraphqlContextService",n),n.$inject=["EventEmitterService","GraphqlService"];const o={SOURCE_REPOSITORY_UPDATED:"sourceRepositoryUpdated",START_CREATE_ENDPOINT_WIZARD:"startCreateEndpointWizard",ENDPOINT_CONFIG_CREATED:"updateConfigCreated",GENERATE_ENDPOINT:"generateEndpoint",ENDPOINT_GENERATED:"endpointGenerated",CANCEL_ENDPOINT_CREATION:"cancelEndpointCreation",FINISH_GENERATION_WORKFLOW:"finishGenerationWorkflow",EXPLORE_ENDPOINT_IN_PLAYGROUND:"exploreEndpointInPlayground",OPEN_ENDPOINT_GENERATION_REPORT:"openEndpointGenerationReport",DELETE_ENDPOINT_REPORT:"deleteEndpointReport",NEXT_ENDPOINT_CREATION_STEP:"nextEndpointCreationStep",PREVIOUS_ENDPOINT_CREATION_STEP:"previousEndpointCreationStep"}}};
//# sourceMappingURL=32534.fb6ef715bfb44761ec63.bundle.js.map