@sava-info-systems/api-maker-with-extensions 1.16.0 → 1.17.1
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/1097.a379bf7f8a734471.js +1 -0
- package/dist/1558.939ac758cd13195b.js +1 -0
- package/dist/1754.9e41b76a3386cae8.js +1 -0
- package/dist/2295.df48af7c1949d583.js +1 -0
- package/dist/2473.d934970e79ae8da4.js +1 -0
- package/dist/{4186.4e5b3bceb5ffad14.js → 4186.7bc2dcf9efa9b2f2.js} +1 -1
- package/dist/4211.982cb41fe043e117.js +1 -0
- package/dist/4575.f2aa50bc44c89e38.js +1 -0
- package/dist/4842.0193581bd67ed602.js +1 -0
- package/dist/{5249.00fc4d449ff668c8.js → 5249.56d7d31ad405def9.js} +1 -1
- package/dist/5334.4acf3d5504b04b16.js +1 -0
- package/dist/5421.e768cc14f2572282.js +1 -0
- package/dist/5765.1f6a809df411f41b.js +1 -0
- package/dist/6393.249487638df29b1e.js +1 -0
- package/dist/7436.7567f48d90151049.js +1 -0
- package/dist/8125.5423cbe9088fc925.js +1 -0
- package/dist/8266.4bf02925174f068a.js +1 -0
- package/dist/{9243.44e2fc29cd1da80a.js → 9243.841dae0ce64c872e.js} +1 -1
- package/dist/assets/schema-types/InterfaceProps.ts +3 -0
- package/dist/assets/schema-types/store-types.ts +2 -1
- package/dist/assets/schema-types/types.ts +79 -2
- package/dist/index.html +1 -1
- package/dist/main.e4498d2115f483ed.js +1 -0
- package/dist/{runtime.d3eb8eb136f2057b.js → runtime.774a8bbd76c257e7.js} +1 -1
- package/main.js +1 -1
- package/package.json +7 -7
- package/sandbox/Dockerfile +2 -2
- package/sandbox/assets/schema-types/types.js +57 -0
- package/sandbox/package.json +1 -1
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/store-types.ts +2 -1
- package/src/assets/schema-types/types.ts +79 -2
- package/src/json/DefaultEmptyMongoSchema.ts +64 -0
- package/dist/1097.93410906761036e0.js +0 -1
- package/dist/1558.b0504b87dbc60e4b.js +0 -1
- package/dist/1754.09ac603fa4d44261.js +0 -1
- package/dist/2295.cf92db135cf32bb2.js +0 -1
- package/dist/2473.8123cc439eda637a.js +0 -1
- package/dist/4211.3572093523629c8c.js +0 -1
- package/dist/4575.76e4ecd321978636.js +0 -1
- package/dist/4842.26c25ee0683af565.js +0 -1
- package/dist/5334.ae508cb156cd6c5a.js +0 -1
- package/dist/5421.69bd4fa26bea6cc5.js +0 -1
- package/dist/5765.683dcb62389e5337.js +0 -1
- package/dist/6393.f02d7e3c243aabae.js +0 -1
- package/dist/7436.50b383b05362c4e4.js +0 -1
- package/dist/8125.85199a13de4117ed.js +0 -1
- package/dist/8266.fae1fe097b233698.js +0 -1
- package/dist/assets/images/cloud/setup-on-server.svg +0 -51
- package/dist/assets/images/logo/logo_cloud.svg +0 -15
- package/dist/main.79b429ca4d354930.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1097,6925,8374,8682,1617],{1097:(be,q,d)=>{d.r(q),d.d(q,{DbMastersM:()=>Xt});var F=d(7664),w=d(4056),N=d(3726),c=d(5861),u=d(95),_=d(6990),B=d(8645),H=d(3620),f=d(3157),p=d(328),y=d(9361),M=d(1162),s=d(553),I=d(5085),K=d(1601),T=d(3531),V=d(9989),e=d(4946),U=d(9961),k=d(7240),Z=d(7414),se=d(9729),O=d(5852),j=d(2304),re=d(4795),P=d(3429),J=d(2915),R=d(6814),z=d(2660),W=d(5860),X=d(756),x=d(5219),Se=d(1396),Y=d(7680),L=d(4844),Q=d(3259),Te=d(3965),ee=d(5025),ve=d(4323);const De=["insertCodeModalC"],ye=["monacoEditorModalC"];function Ue(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",45),e._uU(2," Add UI Page"),e.qZA())}function ke(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",46),e._uU(2," View UI Page"),e.qZA())}function Ze(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e._uU(2," Edit UI Page "),e.TgZ(3,"span",48),e._uU(4),e.qZA(),e.TgZ(5,"span",48),e._uU(6),e.qZA(),e.TgZ(7,"span",48),e._uU(8),e.qZA(),e.TgZ(9,"span",48),e._uU(10),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(null==t.form.get("instanceName").value?null:t.form.get("instanceName").value.name),e.xp6(2),e.hij("| \xa0",null==t.form.get("databaseName").value?null:t.form.get("databaseName").value.db,""),e.xp6(2),e.hij("| \xa0",null==t.form.get("collectionName").value?null:t.form.get("collectionName").value.name,""),e.xp6(2),e.hij("| \xa0",t.form.get("name").value,"")}}function we(i,r){if(1&i&&(e._UZ(0,"span",49),e.ALo(1,"safeHtml")),2&i){const t=r.$implicit;e.Q6J("innerHTML",e.lcZ(1,1,t.labelHTML||t.label),e.oJD)}}function Ie(i,r){if(1&i&&(e._UZ(0,"span",49),e.ALo(1,"safeHtml")),2&i){const t=r.$implicit;e.Q6J("innerHTML",e.lcZ(1,1,t.labelHTML||t.label),e.oJD)}}function xe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",50)(1,"app-monaco-editor",51),e.NdJ("onDidChangeModelContent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.editorConfigValueChanged())})("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!1)("editorOptions",t.editorOptionsDBMasters)}}function Ee(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",50)(1,"app-monaco-editor",51),e.NdJ("onDidChangeModelContent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.editorConfigJSValueChanged())})("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGeneratedJSUtil(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptionsDBMastersJS)}}function Ae(i,r){if(1&i&&(e.TgZ(0,"span",52),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.AsE(" You are allowed to use ",null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI," UI pages, and you are using ",t.totalCreatedMasters," UI Pages. ")}}function Fe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",53),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Ne(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Oe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",55),e.YNc(2,Ne,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Pe(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Je(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Re(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",55),e.YNc(2,Pe,2,0,"span",4),e.YNc(3,Je,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid||t.totalCreatedMasters>(null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI)),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Ye(i,r){1&i&&e._UZ(0,"p-progressSpinner",56)}let le=(()=>{class i{fb;ns;generalS;constantsS;dbMastersS;authCS;monacoS;authS;instanceS;eventCenterS;generalCS;zone;cd;data;totalCreatedMasters;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=f.F;id;activeIndex=0;BE_HOST_PORT=s.N.BE_HOST_PORT;DOCS_HOST_PORT=s.N.DOCS_HOST_PORT;instances=[];editorDBMaster;editorDBMasterJS;editorOptionsDBMasters={readOnly:!1,language:"typescript",contextmenu:!0};editorOptionsDBMastersJS={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab={};dbIdMap={};colIdMap={};formDataTemp=null;selectedConfigOutlineNode;outlineData=[];selectedConfigOutlineNodeFunctions;outlineDataFunctions=[];constructor(t,a,o,n,l,m,C,g,h,v,D,E,A){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.dbMastersS=l,this.authCS=m,this.monacoS=C,this.authS=g,this.instanceS=h,this.eventCenterS=v,this.generalCS=D,this.zone=E,this.cd=A}ngOnInit(){var t=this;return(0,c.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(o){if(o)if(t.form.enable(),o.action===f.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.form.disable(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.resetDependentObjects("INSTANCE"),yield t.loadInstances();const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,I.R.DB_MASTERS_JSON).toPromise();t.editorOptionsDBMasters={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMaster",n.data);const l=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,I.R.DB_MASTERS_JS_UTILS).toPromise();t.editorOptionsDBMastersJS={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMasterJS",l.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.editorConfigValueChangedSubject.pipe((0,H.b)(500)).subscribe((0,c.Z)(function*(){const a=t.editorDBMaster.getValue();a&&(yield t.getOutlineDBMaster({tsCode:a,mode:"config"}))}))),t.subscriptions.push(t.editorConfigJSValueChangedSubject.pipe((0,H.b)(500)).subscribe((0,c.Z)(function*(){const a=t.editorDBMasterJS.getValue();a&&(yield t.getOutlineDBMasterJS({tsCode:a,mode:"utility_functions"}))})))})()}editViewLoadData(){var t=this;return(0,c.Z)(function*(){const a=yield t.dbMastersS.getById(t.data.formData._id).toPromise();t.form.reset(),t.resetDependentObjects("INSTANCE"),t.form.patchValue(a.data),t.formDataTemp=a.data,t.generalCS.setValueInEditor(t,"editorDBMaster",a.data?.dbMasterConfigCode||""),t.generalCS.setValueInEditor(t,"editorDBMasterJS",a.data?.pageUtilsCode||""),yield t.loadInstances(),t.editorConfigValueChanged(),t.editorConfigJSValueChanged(),t.formDataTemp=null})()}createForm(){this.form=this.fb.group({name:[null,[u.kI.required,u.kI.minLength(3),u.kI.maxLength(50),u.kI.pattern("[a-zA-Z0-9_-]*$")]],instanceName:[null,[u.kI.required]],databaseName:[null,[u.kI.required]],collectionName:[null,[u.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,this.activeIndex=0,setTimeout(()=>{$("#idDBMastersForm").modal("show")},100)}hideModal(){$("#idDBMastersForm").modal("hide")}save(t){var a=this;return(0,c.Z)(function*(){const o=a.form.getRawValue();let C;o.instanceName=o.instanceName.name,o.databaseName=o.databaseName.db,o.collectionName=o.collectionName.name,C=a.data.formData&&a.data.formData._id?(yield a.dbMastersS.getById(a.data.formData._id).toPromise()).data:{};const g=Object.assign({},C,o);g.user=a.authCS.getUserId(),g.dbMasterConfigCode=a.editorDBMaster.getValue(),g.pageUtilsCode=a.editorDBMasterJS.getValue();try{let h;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDBMaster,a.monacoDecorations),a.monacoS.clearEditorDecorations(a.editorDBMasterJS,a.monacoDecorations),a.data.mode===p.D.ADD?h=yield a.dbMastersS.post(g).toPromise():a.data.mode===p.D.EDIT&&(h=yield a.dbMastersS.put(g._id,g,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.dbMaster.addSuccess:a.constantsS.dbMaster.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?f.F.SAVED:f.F.UPDATED,data:h}),a.loading.form=!1}catch(h){a.loading.form=!1,a.ns.showErrorFromResponse(h.error||h,"Unable to save database master."),a.lastError=h.error,a.tab=a.tab||{},a.tab.axiosResponse={data:h.error},a.monacoS.highlightErrorInMonacoEditor(a.editorDBMaster,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=y.H.All,this.insertCodeModalC.showModal(T.b.CodeFinderResultC)}editorGenerated(t){var a=this;return(0,c.Z)(function*(){a.editorDBMaster=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=y.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorGeneratedJSUtil(t){var a=this;return(0,c.Z)(function*(){a.editorDBMasterJS=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=y.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorConfigValueChangedSubject=new B.x;editorConfigValueChanged(){this.editorConfigValueChangedSubject.next()}editorConfigJSValueChangedSubject=new B.x;editorConfigJSValueChanged(){this.editorConfigJSValueChangedSubject.next()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),K.d.json)}loadInstances(){var t=this;return(0,c.Z)(function*(){t.resetDependentObjects("INSTANCE"),t.loading.form=!0;try{const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(a).toPromise()).data||[]}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allInstances=[]}if(t.formDataTemp){const a=t.form.controls.instanceName;t.tab.instance=_.find(t.tab.allInstances,{name:t.formDataTemp.instanceName}),t.tab.instance&&a.setValue(t.tab.instance)}else t.tab.instance=t.tab.allInstances[0];yield t.loadDatabases(),t.loading.form=!1,t.cd.detectChanges()})()}getOutlineDBMaster(t){var a=this;return(0,c.Z)(function*(){try{const o=new Map;a.processNodesForBackupAndRestore(a.outlineData,o,"backup"),a.outlineData=[];const n=a.selectedConfigOutlineNode,l=yield a.instanceS.getOutlineDBMasterConfig(t);a.outlineData=l.data,a.processNodesForBackupAndRestore(a.outlineData,o,"restore"),a.selectedConfigOutlineNode=a.findNodeOfKey(a.outlineData,n?.key),setTimeout(()=>{a.zone.run(()=>{a.outlineData=[...a.outlineData],a.cd.markForCheck()})},10)}catch(o){a.ns.showErrorFromResponse(o.error||o,"Unable to get outline data.")}})()}getOutlineDBMasterJS(t){var a=this;return(0,c.Z)(function*(){try{const o=new Map;a.processNodesForBackupAndRestore(a.outlineDataFunctions,o,"backup"),a.outlineDataFunctions=[];const n=a.selectedConfigOutlineNodeFunctions,l=yield a.instanceS.getOutlineDBMasterConfig(t);a.outlineDataFunctions=l.data,a.processNodesForBackupAndRestore(a.outlineDataFunctions,o,"restore"),a.selectedConfigOutlineNodeFunctions=a.findNodeOfKey(a.outlineDataFunctions,n?.key),setTimeout(()=>{a.zone.run(()=>{a.outlineDataFunctions=[...a.outlineDataFunctions],a.cd.markForCheck()})},10)}catch(o){a.ns.showErrorFromResponse(o.error||o,"Unable to get outline data.")}})()}processNodesForBackupAndRestore(t,a,o){if(Array.isArray(t))for(const n of t)this.processNodesForBackupAndRestore(n,a,o);else"backup"===o?a.set(t.key,t.expanded):"restore"===o&&(t.expanded=a.get(t.key)),t?.children?.length&&this.processNodesForBackupAndRestore(t.children,a,o)}findNodeOfKey(t,a){if(a)if(Array.isArray(t))for(const o of t){const n=this.findNodeOfKey(o,a);if(n)return n}else{if(t.key===a)return t;if(t?.children?.length)return this.findNodeOfKey(t.children,a)}}loadDatabases(){var t=this;return(0,c.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("DATABASE"),!t.tab.instance)return t.tab.allDatabases=[],void(t.tab.allCollections=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=_.keyBy(t.tab.allDatabases,M.N7.db)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allDatabases=[]}if(t.formDataTemp){const a=t.form.get("databaseName");t.tab.database=_.find(t.tab.allDatabases,{db:t.formDataTemp.databaseName}),t.tab.database&&a.patchValue(t.tab.database)}else t.tab.database=t.tab.allDatabases[0];yield t.loadCollections(),t.loading.form=!1})()}loadCollections(){var t=this;return(0,c.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("COLLECTION"),t.tab.instance&&t.tab.database){try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=_.keyBy(t.tab.allCollections,M.GR.name)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allCollections=[]}if(t.formDataTemp){const a=t.form.get("collectionName");t.tab.collection=_.find(t.tab.allCollections,{name:t.formDataTemp.collectionName}),t.tab.collection&&a.patchValue(t.tab.collection)}else t.tab.collection=t.tab.allCollections[0];t.loading.form=!1,t.cd.detectChanges()}else t.tab.allCollections=[]})()}resetDependentObjects(t){"INSTANCE"===t?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===t?(this.tab.allDatabases=this.tab.allCollections=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===t&&(this.tab.allCollections=[],this.tab.collection=this.tab.api=void 0)}outlineNodeSelected(t,a){const o=t.data,n=a.getValue(),l=this.generalCS.getLineNumberFromIndex(n,o.end);a.setPosition(l),a.revealPositionInCenter(l),a.focus()}generateUIMakerCodeForCollection(){var t=this;return(0,c.Z)(function*(){const o=(yield t.instanceS.getSampleUIMCodeForSchema({instanceName:t.tab.instance.name,databaseName:t.tab.database.db,collectionName:t.tab.collection.name})).data;t.editorDBMaster.setValue(o.configCode),t.editorDBMasterJS.setValue(o.functionsCode)})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(e.Y36(u.qu),e.Y36(U.W),e.Y36(k.b),e.Y36(Z.L),e.Y36(se.z),e.Y36(O.D),e.Y36(j.b),e.Y36(re.e),e.Y36(P.E),e.Y36(J.u),e.Y36(k.b),e.Y36(e.R0b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(De,5),e.Gf(ye,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data",totalCreatedMasters:"totalCreatedMasters"},decls:66,vars:32,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDBMastersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["tooltipPosition","left","pTooltip","Generate code for this schema",1,"fas","fa-seedling","fa-fw","text-warning","mr-3","cursor-pointer",2,"font-size","21px",3,"click"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["optionLabel","name","filterBy","name","appendTo","body","formControlName","instanceName","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","databaseName","optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","collectionName","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["header","Code"],[1,"row","m-0"],[1,"col-3","pl-0","pr-2","pt-2","overflow-auto",2,"height","calc(100vh - 186px)"],["selectionMode","single","styleClass","tree-width","scrollHeight","flex",1,"id_ptree_db_master_config_outline",3,"value","hidden","selection","filter","selectionChange"],["pTemplate","default"],[1,"col-9","pl-0","pr-0"],[3,"activeIndex","activeIndexChange"],["header","Config"],["class","overflow-hidden","style","height: calc(100vh - 212px);",4,"ngIf"],["header","userUtils.Main"],[1,"modal-footer"],["class","mr-3 small text-danger",4,"ngIf"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[2,"white-space","nowrap","padding-right","10px",3,"innerHTML"],[1,"overflow-hidden",2,"height","calc(100vh - 212px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","onDidChangeModelContent","editorGenerated"],[1,"mr-3","small","text-danger"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Ue,3,0,"span",4),e.YNc(5,ke,3,0,"span",4),e.YNc(6,Ze,11,4,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"i",9),e.NdJ("click",function(){return o.generateUIMakerCodeForCollection()}),e.qZA(),e.TgZ(12,"span",10),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(13,"i",11),e.qZA(),e.TgZ(14,"a",12),e._UZ(15,"img",13),e.qZA()()(),e.TgZ(16,"div",14)(17,"p-tabView")(18,"p-tabPanel",15)(19,"form",16)(20,"div",17)(21,"label",18),e._uU(22,"Name"),e.qZA(),e.TgZ(23,"div",19),e._UZ(24,"input",20),e.qZA()(),e.TgZ(25,"div",17)(26,"label",18),e._uU(27,"Instance"),e.qZA(),e.TgZ(28,"div",19)(29,"p-dropdown",21),e.NdJ("onChange",function(l){return o.tab.instance=l.value,o.loadDatabases()}),e.qZA()()(),e.TgZ(30,"div",17)(31,"label",18),e._uU(32,"Database"),e.qZA(),e.TgZ(33,"div",19)(34,"p-dropdown",22),e.NdJ("onChange",function(l){return o.tab.database=l.value,o.loadCollections()}),e.qZA()()(),e.TgZ(35,"div",17)(36,"label",18),e._uU(37,"Collection"),e.qZA(),e.TgZ(38,"div",19)(39,"p-dropdown",23),e.NdJ("onChange",function(l){return o.tab.collection=l.value}),e.qZA()()()()(),e.TgZ(40,"p-tabPanel",24)(41,"div",25)(42,"div",26)(43,"p-tree",27),e.NdJ("selectionChange",function(l){return o.selectedConfigOutlineNode=l})("selectionChange",function(l){return o.outlineNodeSelected(l,o.editorDBMaster)}),e.YNc(44,we,2,3,"ng-template",28),e.qZA(),e.TgZ(45,"p-tree",27),e.NdJ("selectionChange",function(l){return o.selectedConfigOutlineNodeFunctions=l})("selectionChange",function(l){return o.outlineNodeSelected(l,o.editorDBMasterJS)}),e.YNc(46,Ie,2,3,"ng-template",28),e.qZA()(),e.TgZ(47,"div",29)(48,"p-tabView",30),e.NdJ("activeIndexChange",function(l){return o.activeIndex=l}),e.TgZ(49,"p-tabPanel",31),e.YNc(50,xe,2,3,"div",32),e.qZA(),e.TgZ(51,"p-tabPanel",33),e.YNc(52,Ee,2,3,"div",32),e.qZA()()()()()()(),e.TgZ(53,"div",34),e.YNc(54,Ae,2,2,"span",35),e.YNc(55,Fe,2,0,"a",36),e.TgZ(56,"button",37),e.NdJ("click",function(){return o.hideModal()}),e._UZ(57,"i",38),e._uU(58," Close"),e.qZA(),e.YNc(59,Oe,3,2,"button",39),e.YNc(60,Re,4,3,"button",39),e.qZA(),e.YNc(61,Ye,1,0,"p-progressSpinner",40),e.qZA()()(),e._UZ(62,"app-insert-code-modal",41,42)(64,"app-monaco-editor-modal",43,44)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(13),e.Q6J("formGroup",o.form),e.xp6(10),e.Q6J("options",o.tab.allInstances)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allDatabases)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allCollections)("filter",!0),e.xp6(4),e.Q6J("value",o.outlineData)("hidden",0!==o.activeIndex)("selection",o.selectedConfigOutlineNode)("filter",!0),e.xp6(2),e.Q6J("value",o.outlineDataFunctions)("hidden",1!==o.activeIndex)("selection",o.selectedConfigOutlineNodeFunctions)("filter",!0),e.xp6(3),e.Q6J("activeIndex",o.activeIndex),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.totalCreatedMasters>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)),e.xp6(1),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalDBMaster")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,R.O5,z.y,W.P,X.O,x.jx,Se.mp,Y.G,L.xf,L.x4,Q.u,Te.Lt,ee.A,ve.z],encapsulation:2,changeDetection:0})}return i})();var te=d(4950);let Le=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[w.u,te.A]})}return i})();var b=d(6212),de=d(6925),Qe=d(9394),ae=d(2466),oe=d(921),ie=d(2189),Be=d(5561),ne=d(3835),Ge=d(7797),S=d(5431);const qe=["DBMastersFormC"],He=["cloneApiModalC"];function Ve(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",25),e.qZA()}}function Ke(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",26),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",27),e.qZA()}}function je(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",29),e.qZA()}}function ze(i,r){1&i&&(e.TgZ(0,"th",31),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function We(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,ze,2,0,"th",30),e.TgZ(2,"th",31),e._uU(3,"*"),e.qZA(),e.TgZ(4,"th",32),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Instance \u2192 Database \u2192 Collection"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Required Auth Headers"),e.qZA(),e._UZ(10,"th",33),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function $e(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",39),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Xe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"tr",34),e.YNc(1,$e,2,2,"td",35),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",36)(12,"button",37),e.NdJ("click",function(){const n=e.CHM(t).$implicit,l=e.oxw();return e.KtG(l.openMasterPageInNewTab(n))}),e._UZ(13,"i",38),e.qZA()()()()}if(2&i){const t=r.$implicit,a=r.rowIndex,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",o.showCheckbox),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.lnq("",t.instanceName," \u2192 ",t.databaseName," \u2192 ",t.collectionName,""),e.xp6(2),e.Oqu(t.authHeadersGrid)}}function et(i,r){1&i&&e._UZ(0,"p-progressSpinner",40)}let ce=(()=>{class i{dbMastersS;generalS;notificationS;navigationCS;navigationS;authCS;authS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};EUserType=oe.d;gridKey=M.iH._id;EAPICategory=I.R;ENavigationMenu=ae.E;BE_HOST_PORT=s.N.BE_HOST_PORT;selectedRows=[];dbMastersFormC;cloneApiModalC;constructor(t,a,o,n,l,m,C,g,h,v,D,E,A,G,ea,ta){this.dbMastersS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.navigationS=l,this.authCS=m,this.authS=C,this.constantsS=g,this.eventCenterS=h,this.router=v,this.userS=D,this.instanceS=E,this.ns=A,this.cs=G,this.confirmationService=ea,this.cd=ta}ngOnInit(){var t=this;return(0,c.Z)(function*(){if(!t.authS.backendSettings.extensions)return t.navigationS.gotoDashboard();t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(o){(o.action===f.F.SAVED||o.action===f.F.UPDATED)&&(t.dbMastersFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("UI Maker")})()}loadGridData(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const a=yield t.dbMastersS.getDBMastersGrid({}).toPromise();if(a){t.selectedRows=[],t.rows=a.data,t.rowsMap=_.keyBy(t.rows,M.iH._id);for(const n of t.rows){const l=[];for(const m of n.authHeaders||[])l.push(m.name);n.authHeadersGrid=l.join(", ")}}let o=t.navigationCS.getQueryParam(b.p.am_db_master);o&&!t.rowsMap[o]&&t.rows.length&&(o=t.rows[0]._id),t.rowsMap[o]?yield t.fillData():t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={order:(_.max(_.map(this.rows,"order"))||0)+1},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.dbMastersFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),this.dbMastersFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){yield t.cloneApiModalC.showModal(t.getSelectedRowId(),[u.kI.pattern("[a-zA-Z0-9_-]*$")],function(){var a=(0,c.Z)(function*(o){o&&(yield t.loadGridData()),t.cd.detectChanges()});return function(o){return a.apply(this,arguments)}}())})()}getSelectedRowId(){return this.selectedRows[0]?._id}removePermanent(){var t=this;return(0,c.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.dbMaster.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,c.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.dbMaster.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,c.Z)(function*(){yield a.dbMastersS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.dbMasters.selectedDBMaster.next(void 0)}resetThisUrl(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.navigationCS.setQueryParam(b.p.am_db_master,null)})()}itemSelected(){var t=this;return(0,c.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(b.p.am_db_master,""),void t.eventCenterS.dbMasters.selectedDBMaster.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(b.p.am_db_master,a._id),t.eventCenterS.dbMasters.selectedDBMaster.next(a)):yield t.resetThisUrl()})()}dblClick(){this.selectedRows.length&&this.edit()}openMasterPageInNewTab(t){const a=this.authCS.getUserPath();let o=[s.N.BE_HOST_PORT,"/dist-db-masters/browser/",`?${de.ZF.ADMIN_PATH}=${a}&`].join("");const n=[`${de.ZF.DB_MASTER_NAME}=${t.name}`];for(const l of t.authHeaders)n.push(`${l.name}=____actual_header_value____`);o+=n.join("&"),window.open(o,"_blank")}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=Qe.k4;static \u0275fac=function(a){return new(a||i)(e.Y36(se.z),e.Y36(k.b),e.Y36(U.W),e.Y36(ie.S),e.Y36(Be.X),e.Y36(O.D),e.Y36(re.e),e.Y36(Z.L),e.Y36(J.u),e.Y36(F.F0),e.Y36(ne.K),e.Y36(P.E),e.Y36(U.W),e.Y36(Z.L),e.Y36(x.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-list"]],viewQuery:function(a,o){if(1&a&&(e.Gf(qe,5),e.Gf(He,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.dbMastersFormC=n.first),e.iGM(n=e.CRH())&&(o.cloneApiModalC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:31,vars:20,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/ui-maker.svg","alt","Database master image",1,"fa-fw","mr-1"],[1,"small","ml-3"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Styles For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-css3","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Common Utilities For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-uniregistry","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"totalCreatedMasters","data"],["DBMastersFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[2,"width","25%"],[2,"width","70px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],["tooltipPosition","left","pTooltip","Open master page",1,"btn","btn-xsm-custom",3,"click"],[1,"fas","fa-external-link-alt","text-info","fa-fw"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span")(3,"span"),e._UZ(4,"img",2),e._uU(5," UI Pages"),e.qZA(),e.TgZ(6,"span",3),e._uU(7,"Using "),e.TgZ(8,"span"),e._uU(9),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"a",4),e._UZ(12,"img",5),e.qZA(),e.TgZ(13,"span",6),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"styles"])}),e._UZ(14,"i",7),e.qZA(),e.TgZ(15,"span",8),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"utils"])}),e._UZ(16,"i",9),e.qZA(),e.TgZ(17,"span",10),e.NdJ("click",function(){return o.add()}),e._UZ(18,"i",11),e.qZA(),e.YNc(19,Ve,2,0,"span",12),e.YNc(20,Ke,2,0,"span",13),e.YNc(21,je,2,0,"span",14),e.qZA(),e.TgZ(22,"div",15)(23,"p-table",16),e.NdJ("selectionChange",function(l){return o.selectedRows=l})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClick()}),e.YNc(24,We,11,1,"ng-template",17),e.YNc(25,Xe,14,8,"ng-template",18),e.qZA(),e.YNc(26,et,1,0,"p-progressSpinner",19),e.qZA()(),e._UZ(27,"app-db-masters-form",20,21)(29,"app-clone-api-modal",22,23)),2&a&&(e.xp6(8),e.Tol((null==o.rows?null:o.rows.length)>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)?"text-danger":""),e.xp6(1),e.hij(" ",o.rows.length,""),e.xp6(1),e.hij("/",o.authS.backendSettings.dbMastersCountForUI," "),e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",1===o.selectedRows.length),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("totalCreatedMasters",null==o.rows?null:o.rows.length)("data",o.data),e.xp6(2),e.Q6J("modalId","idCloneDBMasters")("hostAndPort",o.BE_HOST_PORT)("modelApiPaths",o.EModelApiPaths.DB_MASTERS))},dependencies:[R.O5,Ge.s,S.iA,x.jx,S.Ei,S.UA,S.Mo,Y.G,Q.u,le],encapsulation:2,changeDetection:0})}return i})(),ue=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-db-masters-list"),e.qZA())},dependencies:[ce],encapsulation:2})}return i})();var me=d(9836),tt=d(8057);const at=["insertCodeModalC"],ot=["monacoEditorModalC"];function it(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Styles"),e.qZA())}function nt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Styles"),e.qZA())}function st(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Styles "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function rt(i,r){1&i&&(e.TgZ(0,"div",30)(1,"label",31),e._uU(2,"Order No"),e.qZA(),e.TgZ(3,"div",32),e._UZ(4,"input",37),e.qZA()())}function lt(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()(),e.TgZ(7,"div",30),e._UZ(8,"label",31),e.TgZ(9,"div",32)(10,"label",34),e._UZ(11,"p-checkbox",35),e.qZA()()(),e.YNc(12,rt,5,0,"div",36),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form),e.xp6(10),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",t.form.getRawValue().loadInAllPages)}}function dt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",38)(1,"app-monaco-editor",39),e.NdJ("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!1)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function ct(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function ut(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function mt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",42),e.YNc(2,ut,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ft(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function pt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function _t(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",42),e.YNc(2,ft,2,0,"span",4),e.YNc(3,pt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ht(i,r){1&i&&e._UZ(0,"p-progressSpinner",43)}let fe=(()=>{class i{fb;ns;generalS;constantsS;uiMakerStylesS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=f.F;id;BE_HOST_PORT=s.N.BE_HOST_PORT;DOCS_HOST_PORT=s.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"css",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"typescript",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,n,l,m,C,g,h,v,D){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerStylesS=l,this.authCS=m,this.monacoS=C,this.instanceS=g,this.eventCenterS=h,this.generalCS=v,this.cd=D}ngOnInit(){var t=this;return(0,c.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(o){if(o)if(t.form.enable(),o.action===f.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,I.R.UI_MAKER_STYLES).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",n.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,c.Z)(function*(){const a=yield t.uiMakerStylesS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.styleCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],loadInAllPages:[!1,[]],orderNumber:[!1,[u.kI.min(1)]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerStylesForm").modal("show")},100)}hideModal(){$("#idUIMakerStylesForm").modal("hide")}save(t){var a=this;return(0,c.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerStylesS.getById(a.data.formData._id).toPromise()).data:{};const l=Object.assign({},n,o);l.user=a.authCS.getUserId(),l.styleCode=a.editorPI.getValue();try{let m;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?m=yield a.uiMakerStylesS.post(l).toPromise():a.data.mode===p.D.EDIT&&(m=yield a.uiMakerStylesS.put(l._id,l,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerStyle.addSuccess:a.constantsS.uiMakerStyle.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?f.F.SAVED:f.F.UPDATED,data:m}),a.eventCenterS.uiMakerStylesSavedAndUpdate.next(!0),a.loading.form=!1}catch(m){a.loading.form=!1,a.ns.showErrorFromResponse(m.error||m,"Unable to save styles."),a.lastError=m.error,a.tab=a.tab||{},a.tab.axiosResponse={data:m.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=y.H.All,this.insertCodeModalC.showModal(T.b.UiMakerStylesFormC).then()}editorGenerated(t){var a=this;return(0,c.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=y.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerStylesFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.UiMakerStylesFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),K.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerStylesSavedAndUpdate.next(!1)}ISchedulerProps=M.qH;static \u0275fac=function(a){return new(a||i)(e.Y36(u.qu),e.Y36(U.W),e.Y36(k.b),e.Y36(Z.L),e.Y36(me.q),e.Y36(O.D),e.Y36(j.b),e.Y36(P.E),e.Y36(J.u),e.Y36(k.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(at,5),e.Gf(ot,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerStylesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","loadInAllPages","pTooltip","If true, these styles will be applied to all UI Pages.","label","Load Styles In All Pages",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","orderNumber","name","orderNumber","spellcheck","false","type","number","placeholder","Order number in which these styles will be loaded in page",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,it,3,0,"span",4),e.YNc(5,nt,3,0,"span",4),e.YNc(6,st,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,lt,13,3,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,dt,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,ct,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,mt,3,2,"button",19),e.YNc(25,_t,4,3,"button",19),e.qZA(),e.YNc(26,ht,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerStyles")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[u._Y,u.Fj,u.wV,u.JJ,u.JL,u.sg,u.u,R.O5,z.y,W.P,X.O,Y.G,L.xf,L.x4,Q.u,tt.XZ,ee.A],encapsulation:2,changeDetection:0})}return i})(),gt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[w.u,te.A]})}return i})();const Ct=["uiMakerStylesFormC"];function Mt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function bt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function St(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Tt(i,r){1&i&&(e.TgZ(0,"th",26),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function vt(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Tt,2,0,"th",23),e.TgZ(2,"th",24),e._uU(3,"Order"),e.qZA(),e.TgZ(4,"th",25),e._uU(5,"Load in all pages"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function Dt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",30),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function yt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Yes"),e.qZA())}function Ut(i,r){if(1&i&&(e.TgZ(0,"tr",27),e.YNc(1,Dt,2,2,"td",28),e.TgZ(2,"td",29),e._uU(3),e.qZA(),e.TgZ(4,"td",29),e.YNc(5,yt,2,0,"span",28),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.orderNumber||""),e.xp6(2),e.Q6J("ngIf",t.loadInAllPages),e.xp6(2),e.Oqu(t.name)}}function kt(i,r){1&i&&e._UZ(0,"p-progressSpinner",31)}let pe=(()=>{class i{uiMakerStylesS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=oe.d;gridKey=M.iH._id;EAPICategory=I.R;selectedRows=[];uiMakerStylesFormC;constructor(t,a,o,n,l,m,C,g,h,v,D,E,A,G){this.uiMakerStylesS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=l,this.constantsS=m,this.eventCenterS=C,this.router=g,this.userS=h,this.instanceS=v,this.ns=D,this.cs=E,this.confirmationService=A,this.cd=G}ngOnInit(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(o){(o.action===f.F.SAVED||o.action===f.F.UPDATED)&&(t.uiMakerStylesFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Styles")})()}loadGridData(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,loadInAllPages:1,orderNumber:1,user:1},sort:{orderNumber:1,name:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerStylesS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,M.iH._id));let n=t.navigationCS.getQueryParam(b.p.am_ui_maker_style);n&&!t.rowsMap[n]&&t.rows.length&&(n=t.rows[0]._id),t.rowsMap[n]?(t.selectedRows=[t.rowsMap[n]],yield t.fillData()):t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerStylesFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerStylesFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerStylesS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerStylesS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerStyle.cloneError)}})()}removePermanent(){var t=this;return(0,c.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerStyle.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,c.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerStyle.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,c.Z)(function*(){yield a.uiMakerStylesS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerStyles.selectedStyle.next(void 0)}resetThisUrl(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.navigationCS.setQueryParam(b.p.am_ui_maker_style,null)})()}itemSelected(){var t=this;return(0,c.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(b.p.am_ui_maker_style,""),void t.eventCenterS.uiMakerStyles.selectedStyle.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(b.p.am_ui_maker_style,a._id),t.eventCenterS.uiMakerStyles.selectedStyle.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ae.E;static \u0275fac=function(a){return new(a||i)(e.Y36(me.q),e.Y36(k.b),e.Y36(U.W),e.Y36(ie.S),e.Y36(O.D),e.Y36(Z.L),e.Y36(J.u),e.Y36(F.F0),e.Y36(ne.K),e.Y36(P.E),e.Y36(U.W),e.Y36(Z.L),e.Y36(x.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(Ct,5),2&a){let n;e.iGM(n=e.CRH())&&(o.uiMakerStylesFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-css3","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerStylesFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[1,"text-center",2,"width","40px"],[1,"text-center",2,"width","150px"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Styles For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,Mt,2,0,"span",7),e.YNc(10,bt,2,0,"span",8),e.YNc(11,St,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return o.selectedRows=l})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,vt,8,1,"ng-template",12),e.YNc(15,Ut,8,5,"ng-template",13),e.qZA(),e.YNc(16,kt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-styles-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[R.O5,S.iA,x.jx,S.Ei,S.UA,S.Mo,Y.G,Q.u,fe],encapsulation:2,changeDetection:0})}return i})(),_e=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-styles-list"),e.qZA())},dependencies:[pe],encapsulation:2})}return i})();var he=d(6125);const Zt=["insertCodeModalC"],wt=["monacoEditorModalC"];function It(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Utility"),e.qZA())}function xt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Utility"),e.qZA())}function Et(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Utility "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function At(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()()()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form)}}function Ft(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function Nt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Ot(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Pt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",38),e.YNc(2,Ot,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Jt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Rt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Yt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",38),e.YNc(2,Jt,2,0,"span",4),e.YNc(3,Rt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Lt(i,r){1&i&&e._UZ(0,"p-progressSpinner",39)}let ge=(()=>{class i{fb;ns;generalS;constantsS;uiMakerUtilsS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=f.F;id;BE_HOST_PORT=s.N.BE_HOST_PORT;DOCS_HOST_PORT=s.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,n,l,m,C,g,h,v,D){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerUtilsS=l,this.authCS=m,this.monacoS=C,this.instanceS=g,this.eventCenterS=h,this.generalCS=v,this.cd=D}ngOnInit(){var t=this;return(0,c.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(o){if(o)if(t.form.enable(),o.action===f.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,I.R.UI_MAKER_UTILITY_CLASS).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",n.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,c.Z)(function*(){const a=yield t.uiMakerUtilsS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.utilsCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerUtilForm").modal("show")},100)}hideModal(){$("#idUIMakerUtilForm").modal("hide")}save(t){var a=this;return(0,c.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerUtilsS.getById(a.data.formData._id).toPromise()).data:{};const l=Object.assign({},n,o);l.user=a.authCS.getUserId(),l.utilsCode=a.editorPI.getValue();try{let m;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?m=yield a.uiMakerUtilsS.post(l).toPromise():a.data.mode===p.D.EDIT&&(m=yield a.uiMakerUtilsS.put(l._id,l,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerUtil.addSuccess:a.constantsS.uiMakerUtil.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?f.F.SAVED:f.F.UPDATED,data:m}),a.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!0),a.loading.form=!1}catch(m){a.loading.form=!1,a.ns.showErrorFromResponse(m.error||m,"Unable to save utility."),a.lastError=m.error,a.tab=a.tab||{},a.tab.axiosResponse={data:m.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=y.H.All,this.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC).then()}editorGenerated(t){var a=this;return(0,c.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=y.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.UiMakerUtilsFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),K.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!1)}trim=_.trim;static \u0275fac=function(a){return new(a||i)(e.Y36(u.qu),e.Y36(U.W),e.Y36(k.b),e.Y36(Z.L),e.Y36(he.L),e.Y36(O.D),e.Y36(j.b),e.Y36(P.E),e.Y36(J.u),e.Y36(k.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Zt,5),e.Gf(wt,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerUtilForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[3,"header"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,It,3,0,"span",4),e.YNc(5,xt,3,0,"span",4),e.YNc(6,Et,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,At,7,1,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,Ft,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,Nt,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,Pt,3,2,"button",19),e.YNc(25,Yt,4,3,"button",19),e.qZA(),e.YNc(26,Lt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(1),e.Q6J("header",(o.form.get("name").getRawValue()||"").trim()?"userUtils."+o.form.get("name").getRawValue().trim():"Code"),e.xp6(1),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerUtility")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,R.O5,z.y,W.P,X.O,Y.G,L.xf,L.x4,Q.u,ee.A],encapsulation:2,changeDetection:0})}return i})(),Qt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[w.u,te.A]})}return i})();const Bt=["uiMakerUtilsFormC"];function Gt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function qt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function Ht(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Vt(i,r){1&i&&(e.TgZ(0,"th",24),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function Kt(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Vt,2,0,"th",23),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function jt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",27),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function zt(i,r){if(1&i&&(e.TgZ(0,"tr",25),e.YNc(1,jt,2,2,"td",26),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function Wt(i,r){1&i&&e._UZ(0,"p-progressSpinner",28)}let Ce=(()=>{class i{uiMakerUtilsS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=oe.d;gridKey=M.iH._id;EAPICategory=I.R;selectedRows=[];uiMakerUtilsFormC;constructor(t,a,o,n,l,m,C,g,h,v,D,E,A,G){this.uiMakerUtilsS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=l,this.constantsS=m,this.eventCenterS=C,this.router=g,this.userS=h,this.instanceS=v,this.ns=D,this.cs=E,this.confirmationService=A,this.cd=G}ngOnInit(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(o){(o.action===f.F.SAVED||o.action===f.F.UPDATED)&&(t.uiMakerUtilsFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Utility")})()}loadGridData(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{order:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerUtilsS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,M.iH._id));let n=t.navigationCS.getQueryParam(b.p.am_ui_maker_util);n&&!t.rowsMap[n]&&t.rows.length&&(n=t.rows[0]._id),t.rowsMap[n]?(t.selectedRows=[t.rowsMap[n]],yield t.fillData()):t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerUtilsFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerUtilsFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerUtilsS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerUtilsS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerUtil.cloneError)}})()}removePermanent(){var t=this;return(0,c.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerUtil.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,c.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerUtil.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,c.Z)(function*(){yield a.uiMakerUtilsS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerUtils.selectedUtil.next(void 0)}resetThisUrl(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.navigationCS.setQueryParam(b.p.am_ui_maker_util,null)})()}itemSelected(){var t=this;return(0,c.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(b.p.am_ui_maker_util,""),void t.eventCenterS.uiMakerUtils.selectedUtil.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(b.p.am_ui_maker_util,a._id),t.eventCenterS.uiMakerUtils.selectedUtil.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ae.E;static \u0275fac=function(a){return new(a||i)(e.Y36(he.L),e.Y36(k.b),e.Y36(U.W),e.Y36(ie.S),e.Y36(O.D),e.Y36(Z.L),e.Y36(J.u),e.Y36(F.F0),e.Y36(ne.K),e.Y36(P.E),e.Y36(U.W),e.Y36(Z.L),e.Y36(x.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(Bt,5),2&a){let n;e.iGM(n=e.CRH())&&(o.uiMakerUtilsFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-uniregistry","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerUtilsFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Common Utils For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,Gt,2,0,"span",7),e.YNc(10,qt,2,0,"span",8),e.YNc(11,Ht,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return o.selectedRows=l})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,Kt,4,1,"ng-template",12),e.YNc(15,zt,4,3,"ng-template",13),e.qZA(),e.YNc(16,Wt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-utils-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[R.O5,S.iA,x.jx,S.Ei,S.UA,S.Mo,Y.G,Q.u,ge],encapsulation:2,changeDetection:0})}return i})();const $t=[{path:"main",component:ue,canActivate:[N.P]},{path:"utils",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-utils-list"),e.qZA())},dependencies:[Ce],encapsulation:2})}return i})(),canActivate:[N.P]},{path:"styles",component:_e,canActivate:[N.P]}];let Xt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[F.Bz.forChild($t),w.u,Le,Qt,gt]})}return i})()},6925:(be,q,d)=>{d.d(q,{Eg:()=>_,Yp:()=>N,ZF:()=>B,vT:()=>w});var w=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(w||{}),N=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(N||{}),_=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s}(_||{}),B=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(B||{})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{1558:(R,M,i)=>{i.r(M),i.d(M,{SchedulerManM:()=>E});var c=i(7664),e=i(4056),o=i(4946),h=i(6607);let f=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(u,P){1&u&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=i(3726),I=i(885);const g=[{path:"scheduler-layout",component:f,canActivate:[d.P]}];let E=(()=>{class _{static \u0275fac=function(u){return new(u||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,I.R]})}return _})()},6607:(R,M,i)=>{i.d(M,{V:()=>pe});var c=i(5861),e=i(4946),o=i(3157),h=i(328),f=i(6212),d=i(6990),g=i(1162),D=i(5085),E=i(921),_=i(1042),A=i(7240),S=i(9961),u=i(5219),P=i(2189),y=i(5852),Z=i(7414),L=i(2915),w=i(7664),O=i(95),W=i(6814),C=i(5431),U=i(7680),N=i(3259),b=i(8057),K=i(8479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.clone())}),e._UZ(1,"i",20),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,Q,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function j(n,r){1&n&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function $(n,r){1&n&&e._UZ(0,"th",36)}function q(n,r){1&n&&e._UZ(0,"th")}function V(n,r){1&n&&e._UZ(0,"th",37)}function X(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,j,2,0,"th",32),e.YNc(2,$,1,0,"th",33),e._UZ(3,"th",34),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,q,1,0,"th",6),e.YNc(7,V,1,0,"th",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable),e.xp6(4),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable)}}function z(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",43),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ee(n,r){if(1&n&&(e.TgZ(0,"td",44)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw().rowIndex;e.xp6(2),e.Oqu(t+1)}}function te(n,r){1&n&&e._UZ(0,"i",45)}function ne(n,r){1&n&&e._UZ(0,"i",46)}function se(n,r){1&n&&e._UZ(0,"i",47)}function ae(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",48)(2,"p-checkbox",49),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=a)})("click",function(a){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(a))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ie(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,ae,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const re=function(){return["/api-info/api-testing/testing"]},le=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function oe(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",44)(2,"a",50),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",51),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,re))("queryParams",e.WLB(3,le,s.authCS.getUserId(),t._id))}}function ce(n,r){if(1&n&&(e.TgZ(0,"tr",38),e.YNc(1,z,2,2,"td",6),e.YNc(2,ee,3,1,"td",39),e.TgZ(3,"td"),e.YNc(4,te,1,0,"i",40),e.YNc(5,ne,1,0,"i",41),e.qZA(),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e.YNc(9,se,1,0,"i",42),e.qZA(),e.YNc(10,ie,2,1,"td",6),e.YNc(11,oe,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",s.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(3),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",t.runOnNativeProcess),e.xp6(1),e.Q6J("ngIf",s.isLPM),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function _e(n,r){1&n&&e._UZ(0,"p-progressSpinner",52)}function de(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.selectionChange())})("dblclick",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.dblClickSchedulerList())}),e.YNc(2,X,8,4,"ng-template",29),e.YNc(3,ce,12,9,"ng-template",30),e.qZA(),e.YNc(4,_e,1,0,"p-progressSpinner",31),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let pe=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=E.d;schedulerManFormC;constructor(t,s,a,l,x,m,p,v,T,ue){this.schedulerS=t,this.generalS=s,this.notificationS=a,this.confirmationService=l,this.navigationCS=x,this.authCS=m,this.constantsS=p,this.eventCenterS=v,this.cd=T,this.router=ue}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(a){a.length&&t.loadGridData()});return function(a){return s.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1,runOnNativeProcess:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var a=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(f.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const m=x.split(","),p=d.intersection(d.keys(t.rowsMap),m),v=[];for(const T of p)t.rowsMap[T]&&v.push(t.rowsMap[T]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(p),t.eventCenterS.filterInLog.schedulersIds.next(p)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const m=t.eventCenterS.group.selectedGroups.value[0];for(const p of m?.queryParams?.schedulerNames)t.rowsMapName[p]&&(t.rowsMapName[p].saveResponseInLog=m.schedulersLog?.[p]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(f.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,D.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(f.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(A.b),e.Y36(S.W),e.Y36(u.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,a){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(a.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Schedulers",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped schedulers-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 40px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],["pTooltip","Running on native process","class","fas fa-radiation ml-2 text-danger",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],["pTooltip","Running on native process",1,"fas","fa-radiation","ml-2","text-danger"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,B,6,3,"span",6),e.YNc(9,Y,3,2,"span",7),e.YNc(10,k,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,de,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!a.isReadOnly),e.xp6(1),e.Q6J("ngIf",a.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",a.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",a.data))},dependencies:[w.rH,O.JJ,O.On,W.O5,C.iA,u.jx,C.Ei,C.UA,C.Mo,U.G,N.u,b.XZ,K.o],encapsulation:2})}return n})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1754],{1754:(ft,g,a)=>{a.r(g),a.d(g,{VulnerabilityM:()=>lt});var m=a(7664),f=a(4480),C=a(4056),A=a(3726),t=a(4946),r=a(5861),U=a(6990),Z=a(3157),w=a(328),d=a(6212),v=a(1162),q=a(5085),S=a(921),V=a(7240),h=a(9961),I=a(2189),O=a(5852),T=a(7414),L=a(2915),J=a(3835),Y=a(3429),y=a(5219),D=a(1429),b=a(95),c=a(6814),u=a(5431),P=a(7680),Q=a(707),N=a(3259),R=a(3965);function E(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",11),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.compress())}),t._UZ(1,"i",12),t.qZA()}}function F(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",11),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.expand())}),t._UZ(1,"i",13),t.qZA()}}function M(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"span",11),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.print())}),t._UZ(1,"i",14),t.qZA()}}const K=function(i){return{"text-danger font-weight-bold":i}},G=function(i){return{"text-warning font-weight-bold":i}};function H(i,s){if(1&i&&(t.TgZ(0,"div",15)(1,"div",16)(2,"div",17)(3,"table",18)(4,"tr")(5,"th",19),t._uU(6,"Vulnerability Summary"),t.qZA()(),t.TgZ(7,"tr")(8,"td",20),t._uU(9,"Critical"),t.qZA(),t.TgZ(10,"td",21),t._uU(11),t.qZA()(),t.TgZ(12,"tr")(13,"td",22),t._uU(14,"High"),t.qZA(),t.TgZ(15,"td",21),t._uU(16),t.qZA()(),t.TgZ(17,"tr")(18,"td",22),t._uU(19,"Moderate"),t.qZA(),t.TgZ(20,"td"),t._uU(21),t.qZA()(),t.TgZ(22,"tr")(23,"td",22),t._uU(24,"Info"),t.qZA(),t.TgZ(25,"td"),t._uU(26),t.qZA()(),t.TgZ(27,"tr")(28,"td",22),t._uU(29,"Low"),t.qZA(),t.TgZ(30,"td"),t._uU(31),t.qZA()(),t.TgZ(32,"tr")(33,"td",22),t._uU(34,"Total"),t.qZA(),t.TgZ(35,"td"),t._uU(36),t.qZA()()()(),t.TgZ(37,"div",17)(38,"table",18)(39,"tr")(40,"th",19),t._uU(41,"Dependency Summary"),t.qZA()(),t.TgZ(42,"tr")(43,"td",20),t._uU(44,"Prod"),t.qZA(),t.TgZ(45,"td"),t._uU(46),t.qZA()(),t.TgZ(47,"tr")(48,"td",22),t._uU(49,"Dev"),t.qZA(),t.TgZ(50,"td"),t._uU(51),t.qZA()(),t.TgZ(52,"tr")(53,"td",22),t._uU(54,"Optional"),t.qZA(),t.TgZ(55,"td"),t._uU(56),t.qZA()(),t.TgZ(57,"tr")(58,"td",22),t._uU(59,"Peer"),t.qZA(),t.TgZ(60,"td"),t._uU(61),t.qZA()(),t.TgZ(62,"tr")(63,"td",22),t._uU(64,"Peer Optional"),t.qZA(),t.TgZ(65,"td"),t._uU(66),t.qZA()(),t.TgZ(67,"tr")(68,"td",22),t._uU(69,"Total"),t.qZA(),t.TgZ(70,"td"),t._uU(71),t.qZA()()()()()()),2&i){const e=t.oxw();t.xp6(10),t.Q6J("ngClass",t.VKq(14,K,e.metadata.vulnerabilities.critical)),t.xp6(1),t.hij(" ",e.metadata.vulnerabilities.critical||""," "),t.xp6(4),t.Q6J("ngClass",t.VKq(16,G,e.metadata.vulnerabilities.high)),t.xp6(1),t.hij(" ",e.metadata.vulnerabilities.high||""," "),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.moderate||""),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.info||""),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.low||""),t.xp6(5),t.Oqu(e.metadata.vulnerabilities.total||""),t.xp6(10),t.Oqu(e.metadata.dependencies.prod||""),t.xp6(5),t.Oqu(e.metadata.dependencies.dev||""),t.xp6(5),t.Oqu(e.metadata.dependencies.optional||""),t.xp6(5),t.Oqu(e.metadata.dependencies.peer||""),t.xp6(5),t.Oqu(e.metadata.dependencies.peerOptional||""),t.xp6(5),t.Oqu(e.metadata.dependencies.total||"")}}function B(i,s){1&i&&(t.TgZ(0,"tr"),t._UZ(1,"th",23)(2,"th",24),t.TgZ(3,"th",25),t._uU(4,"Direct"),t.qZA(),t.TgZ(5,"th",26),t._uU(6,"Severity"),t.qZA(),t.TgZ(7,"th",27),t._uU(8,"Version"),t.qZA(),t.TgZ(9,"th"),t._uU(10,"Package Name"),t.qZA(),t.TgZ(11,"th",27),t._uU(12,"Fix"),t.qZA()())}function $(i,s){if(1&i){const e=t.EpF();t.TgZ(0,"button",33),t.NdJ("click",function(){t.CHM(e);const n=t.oxw().$implicit;return t.KtG(n.expanded=!n.expanded)}),t.qZA()}if(2&i){const e=t.oxw().$implicit;t.Q6J("pRowToggler",e)("icon",e.expanded?"pi pi-chevron-down":"pi pi-chevron-right")}}function j(i,s){1&i&&t._UZ(0,"i",34)}function W(i,s){if(1&i&&(t.TgZ(0,"span")(1,"span",35),t._uU(2),t.qZA(),t.TgZ(3,"span"),t._uU(4," \u2192 "),t.qZA()()),2&i){const e=t.oxw(2).$implicit;t.xp6(1),t.Q6J("pTooltip",e.currentVersion+" = Current version"),t.xp6(1),t.Oqu(e.currentVersion)}}function X(i,s){if(1&i&&(t.TgZ(0,"span"),t.YNc(1,W,5,2,"span",32),t.TgZ(2,"span",35),t._uU(3),t.qZA()()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.currentVersion),t.xp6(1),t.Q6J("pTooltip",e.fixAvailable.version+" = Update to version"),t.xp6(1),t.Oqu(e.fixAvailable.version)}}function k(i,s){if(1&i&&(t.TgZ(0,"a",47),t._UZ(1,"i",48),t.qZA()),2&i){const e=t.oxw().$implicit;t.Q6J("href",e.url,t.LSH)}}const z=function(){return[]};function tt(i,s){if(1&i&&(t.TgZ(0,"tr")(1,"th",45),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td",30),t.YNc(12,k,2,1,"a",46),t.qZA()()),2&i){const e=s.$implicit,l=s.index;t.xp6(2),t.Oqu(l+1),t.xp6(2),t.Oqu(e.severity),t.xp6(2),t.Oqu(e.range),t.xp6(2),t.Oqu((e.cwe||t.DdM(6,z)).join(",")),t.xp6(2),t.Oqu(e.title),t.xp6(2),t.Q6J("ngIf",e.url)}}function et(i,s){if(1&i&&(t.TgZ(0,"tr")(1,"td",36)(2,"table",37)(3,"thead")(4,"tr",38)(5,"th",39),t._uU(6,"#"),t.qZA(),t.TgZ(7,"th",40),t._uU(8,"Severity"),t.qZA(),t.TgZ(9,"th",41),t._uU(10,"Range"),t.qZA(),t.TgZ(11,"th",41),t._uU(12,"CWE"),t.qZA(),t.TgZ(13,"th",42),t._uU(14,"Title"),t.qZA(),t._UZ(15,"th",43),t.qZA()(),t.TgZ(16,"tbody"),t.YNc(17,tt,13,7,"tr",44),t.qZA()()()()),2&i){const e=t.oxw().$implicit;t.xp6(17),t.Q6J("ngForOf",e.via)}}function it(i,s){if(1&i&&(t.TgZ(0,"tr",28)(1,"td"),t.YNc(2,$,1,2,"button",29),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td",30),t.YNc(6,j,1,0,"i",31),t.qZA(),t.TgZ(7,"td"),t._uU(8),t.qZA(),t.TgZ(9,"td"),t._uU(10),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.TgZ(13,"td"),t.YNc(14,X,4,3,"span",32),t.qZA()(),t.YNc(15,et,18,1,"tr",32)),2&i){const e=s.$implicit,l=s.rowIndex;t.Q6J("pSelectableRow",e),t.xp6(2),t.Q6J("ngIf",null==e.via?null:e.via.length),t.xp6(2),t.Oqu(l+1),t.xp6(2),t.Q6J("ngIf",e.isDirect),t.xp6(2),t.Oqu(e.severity),t.xp6(2),t.Oqu(e.range),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Q6J("ngIf",e.fixAvailable),t.xp6(1),t.Q6J("ngIf",e.expanded)}}function nt(i,s){1&i&&t._UZ(0,"p-progressSpinner",49)}let x=(()=>{class i{generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;dataProviderService;cd;showCheckbox=!1;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];metadata;rowsMap={};showAll=!1;EUserType=S.d;gridKey=v.iH._id;EAPICategory=q.R;selectedRows=[];vulnerabilityCategories;model={vulnerabilitiesType:null};constructor(e,l,n,o,p,st,rt,ot,pt,dt,ct,ut,gt,mt){this.generalS=e,this.notificationS=l,this.navigationCS=n,this.authCS=o,this.constantsS=p,this.eventCenterS=st,this.router=rt,this.userS=ot,this.instanceS=pt,this.ns=dt,this.cs=ct,this.confirmationService=ut,this.dataProviderService=gt,this.cd=mt}ngOnInit(){var e=this;return(0,r.Z)(function*(){e.vulnerabilityCategories=e.dataProviderService.getVulnerabilityCategories(),e.model.vulnerabilitiesType=e.vulnerabilityCategories[0],e.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0),yield e.loadGridData(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var l=(0,r.Z)(function*(n){(n.action===Z.F.SAVED||n.action===Z.F.UPDATED)&&(yield e.loadGridData())});return function(n){return l.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Vulnerabilities Report")})()}typeChanged(){var e=this;return(0,r.Z)(function*(){yield e.loadGridData()})()}loadGridData(){var e=this;return(0,r.Z)(function*(){e.loading.grid=!0;try{const l=yield e.instanceS.getVulnerabilities({type:e.model.vulnerabilitiesType.name});if(l){e.selectedRows=[];const n=l.data;e.rows=n.list||[];for(const o of e.rows)o._id=e.generalS.getRandomString(8);e.metadata=n.metadata,e.rowsMap=U.keyBy(e.rows,v.iH._id)}}catch(l){e.ns.showErrorFromResponse(l.error||l,"Unable to load vulnerabilities.")}e.loading.grid=!1,e.cd.detectChanges()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0)}resetThisUrl(){var e=this;return(0,r.Z)(function*(){e.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0),yield e.navigationCS.setQueryParam(d.p.am_vulnerability,null)})()}itemSelected(){var e=this;return(0,r.Z)(function*(){yield e.resetThisUrl(),setTimeout(e.fillData.bind(e))})()}fillData(){var e=this;return(0,r.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(d.p.am_vulnerability,""),void e.eventCenterS.vulnerabilities.selectedVulnerability.next(null);const l=e.selectedRows[0];l?(yield e.navigationCS.setQueryParam(d.p.am_vulnerability,l._id),e.eventCenterS.vulnerabilities.selectedVulnerability.next(l)):yield e.resetThisUrl()})()}print(){window.print()}expand(){for(const e of this.rows)e.via?.length&&(e.expanded=!0)}compress(){for(const e of this.rows)e.via?.length&&(e.expanded=!1)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||i)(t.Y36(V.b),t.Y36(h.W),t.Y36(I.S),t.Y36(O.D),t.Y36(T.L),t.Y36(L.u),t.Y36(m.F0),t.Y36(J.K),t.Y36(Y.E),t.Y36(h.W),t.Y36(T.L),t.Y36(y.YP),t.Y36(D.B),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-vulnerability-list"]],inputs:{showCheckbox:"showCheckbox"},decls:16,vars:14,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/vulnerability.svg","alt","Vulnerabilities",1,"fa-fw","mr-1"],["optionLabel","name","filterBy","name","appendTo","body","styleClass","p-input-filled width-300 p-input-small-dropdown ml-4",3,"options","ngModel","filter","onChange"],["class","float-right cursor-pointer ml-3 d-print-none",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","p-2",4,"ngIf"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 336px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"float-right","cursor-pointer","ml-3","d-print-none",3,"click"],["pTooltip","Collapse all rows","tooltipPosition","left",1,"fas","fa-compress-alt","fa-fw"],["pTooltip","Expand all rows","tooltipPosition","left",1,"fas","fa-expand-alt","fa-fw"],["pTooltip","Print report","tooltipPosition","left",1,"fas","fa-print","fa-fw"],[1,"p-2"],[1,"row"],[1,"col-6"],[1,"table","table-bordered","table-sm","mb-0"],["colspan","2",1,"text-center","bg-dark"],[1,"text-right",2,"width","50%"],[3,"ngClass"],[1,"text-right"],[2,"width","45px"],[2,"width","55px"],[2,"width","70px"],[2,"width","90px"],[2,"width","170px"],[3,"pSelectableRow"],["type","button","pButton","","pRipple","","class","p-button-text p-button-rounded p-button-plain mr-2",3,"pRowToggler","icon","click",4,"ngIf"],[1,"text-center"],["pTooltip","Direct dependency","class","far fa-solid fa-dot-circle fa-fw align-middle text-success text-v-small pr-1",4,"ngIf"],[4,"ngIf"],["type","button","pButton","","pRipple","",1,"p-button-text","p-button-rounded","p-button-plain","mr-2",3,"pRowToggler","icon","click"],["pTooltip","Direct dependency",1,"far","fa-solid","fa-dot-circle","fa-fw","align-middle","text-success","text-v-small","pr-1"],["tooltipPosition","left",3,"pTooltip"],["colspan","7",1,"pl-5"],[1,"table","table-bordered","table-hover","table-sm"],[1,"bg-dark"],["scope","col",1,"text-center",2,"width","50px"],["scope","col",2,"width","90px"],["scope","col",2,"width","170px"],["scope","col"],["scope","col",2,"width","70px"],[4,"ngFor","ngForOf"],["scope","row",1,"text-center","px-0"],["class","btn btn-xsm-custom d-print-none","target","_blank","pTooltip","View details","tooltipPosition","left",3,"href",4,"ngIf"],["target","_blank","pTooltip","View details","tooltipPosition","left",1,"btn","btn-xsm-custom","d-print-none",3,"href"],[1,"fas","fa-external-link-alt","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,n){1&l&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Vulnerabilities"),t.qZA(),t.TgZ(5,"span")(6,"p-dropdown",3),t.NdJ("onChange",function(p){return n.model.vulnerabilitiesType=p.value,n.typeChanged()}),t.qZA()(),t.YNc(7,E,2,0,"span",4),t.YNc(8,F,2,0,"span",4),t.YNc(9,M,2,0,"span",4),t.qZA(),t.TgZ(10,"div",5),t.YNc(11,H,72,18,"div",6),t.TgZ(12,"p-table",7),t.NdJ("selectionChange",function(p){return n.selectedRows=p})("selectionChange",function(){return n.itemSelected()}),t.YNc(13,B,13,0,"ng-template",8),t.YNc(14,it,16,9,"ng-template",9),t.qZA(),t.YNc(15,nt,1,0,"p-progressSpinner",10),t.qZA()()),2&l&&(t.xp6(6),t.Q6J("options",n.vulnerabilityCategories)("ngModel",n.model.vulnerabilitiesType)("filter",!0),t.xp6(1),t.Q6J("ngIf",n.rows.length),t.xp6(1),t.Q6J("ngIf",n.rows.length),t.xp6(1),t.Q6J("ngIf",n.rows.length),t.xp6(2),t.Q6J("ngIf",null==n.metadata||null==n.metadata.vulnerabilities?null:n.metadata.vulnerabilities.total),t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.xp6(3),t.Q6J("ngIf",n.loading.grid))},dependencies:[b.JJ,b.On,c.mk,c.sg,c.O5,u.iA,y.jx,u.Ei,u.jB,P.G,Q.Hq,N.u,R.Lt,f.H],encapsulation:2,changeDetection:0})}return i})();const at=[{path:"layout",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(l){return new(l||i)};static \u0275cmp=t.Xpm({type:i,selectors:[["app-vulnerability-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(l,n){1&l&&(t.TgZ(0,"div",0),t._UZ(1,"app-vulnerability-list"),t.qZA())},dependencies:[x],encapsulation:2})}return i})(),canActivate:[A.P]}];let lt=(()=>{class i{static \u0275fac=function(l){return new(l||i)};static \u0275mod=t.oAB({type:i});static \u0275inj=t.cJS({imports:[m.Bz.forChild(at),C.u,f.T]})}return i})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2295],{2295:(ne,g,n)=>{n.r(g),n.d(g,{DevAccM:()=>se});var D=n(7664),P=n(4056),e=n(4946),c=n(5861),d=n(3157),m=n(328),f=n(6212),x=n(6990),C=n(921),u=n(1162),U=n(3835),Z=n(7240),_=n(9961),M=n(2189),y=n(204),S=n(5852),N=n(2915),T=n(5219),w=n(6814),A=n(5431),b=n(7680),Y=n(3259),i=n(95),O=n(553),R=n(2660);function k(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Add Developer User"),e.qZA())}function J(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," View Developer User"),e.qZA())}function Q(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," Edit Developer User"),e.qZA())}function V(o,l){1&o&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",27),e.qZA()())}function G(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function q(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function W(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",29),e.YNc(2,G,2,0,"span",4),e.YNc(3,q,2,0,"span",4),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function K(o,l){1&o&&e._UZ(0,"p-progressSpinner",30)}let F=(()=>{class o{fb;ns;userS;generalS;constantsCS;authCS;cd;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];constructor(t,a,s,r,p,h,v){this.fb=t,this.ns=a,this.userS=s,this.generalS=r,this.constantsCS=p,this.authCS=h,this.cd=v}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(s){if(s){if(t.form.enable(),s.action===d.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===d.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else s.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([i.kI.required,i.kI.minLength(4),i.kI.maxLength(40)]),t.form.get("password").updateValueAndValidity());t.cd.detectChanges()}});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[i.kI.required]],email:[null,[i.kI.required,i.kI.email]],apiPath:[null,[i.kI.required,i.kI.minLength(3),i.kI.maxLength(45),i.kI.pattern("[a-zA-Z0-9_]*$")]],password:[null,[]]})}showModal(){$("#idAMDevUsersForm").modal("show")}hideModal(){$("#idAMDevUsersForm").modal("hide")}save(){var t=this;return(0,c.Z)(function*(){const a=t.form.getRawValue();a.user=t.authCS.getUserId(),a.userType=C.d.DEVELOPER,a.password=t.generalS.getEncryptedString(a.password,O.N.crypto.passCommunication);try{let s;t.loading.form=!0,t.data.mode===m.D.ADD?s=yield t.userS.post(a).toPromise():t.data.mode===m.D.EDIT&&(t.data.formData._id&&(t.form.get("password").value||delete a.password),s=yield t.userS.put(t.data.formData._id,a,{select:u.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsCS.user.addSuccess:t.constantsCS.user.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?d.F.SAVED:d.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save dev user.")}t.cd.detectChanges()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||o)(e.Y36(i.qu),e.Y36(_.W),e.Y36(U.K),e.Y36(Z.b),e.Y36(y.s),e.Y36(S.D),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-dev-user-form"]],inputs:{data:"data"},decls:39,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMDevUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","email","name","email","spellcheck","false","type","text","placeholder","Please provide email",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[1,"form-group","row",2,"margin-bottom","0 !important"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide API path",1,"form-control","text-lowercase","form-control-sm"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,k,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Q,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Email"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,V,5,0,"div",15),e.TgZ(23,"div",16)(24,"label",11),e._uU(25,"API Path"),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",17),e.qZA()(),e.TgZ(28,"div",10),e._UZ(29,"label",11),e.TgZ(30,"div",12)(31,"label",18),e._uU(32,"[a-z,_] (Ex: user_path)"),e.qZA()()()()(),e.TgZ(33,"div",19)(34,"button",20),e._UZ(35,"i",21),e._uU(36," Close"),e.qZA(),e.YNc(37,W,4,3,"button",22),e.qZA(),e.YNc(38,K,1,0,"p-progressSpinner",23),e.qZA()()()),2&a&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(15),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[i._Y,i.Fj,i.JJ,i.JL,i.sg,i.u,w.O5,R.y,b.G],encapsulation:2,changeDetection:0})}return o})();const L=["devUserFormC"];function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",16),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",17),e.qZA()}}function B(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",19),e.qZA()}}function z(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Email"),e.qZA()())}function j(o,l){if(1&o&&(e.TgZ(0,"tr",20)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&o){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.email)}}function X(o,l){1&o&&e._UZ(0,"p-progressSpinner",21)}let E=(()=>{class o{userS;generalS;notificationS;navigationCS;constantsCS;authCS;eventCenterS;confirmationService;router;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;devUserFormC;constructor(t,a,s,r,p,h,v,ae,oe){this.userS=t,this.generalS=a,this.notificationS=s,this.navigationCS=r,this.constantsCS=p,this.authCS=h,this.eventCenterS=v,this.confirmationService=ae,this.router=oe}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===d.F.SAVED||t.action===d.F.UPDATED)&&(this.devUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Developer Users")}loadGridData(){var t=this;this.loading.grid=!0;const a={find:{active:!0,userType:C.d.DEVELOPER,user:this.authCS.getUserId()},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete a.find.active,this.subscriptions.push(this.userS.query(a).subscribe(function(){var s=(0,c.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=x.keyBy(t.rows,u.iH._id));const p=t.navigationCS.getQueryParam(f.p.user);t.rowsMap[p]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[p]]),yield t.fillData()),t.loading.grid=!1});return function(r){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.devUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_VIEW_MODE}),this.devUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE}),this.devUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var a;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const a=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,a.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(a,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(f.p.user,null)})()}devUserSelected(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then()})()}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.user,""),void t.eventCenterS.user.selectedUsers.next([]);const a=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;a._id?(yield t.navigationCS.setQueryParam(f.p.user,a._id),t.eventCenterS.user.selectedUsers.next([a])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickDevUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(a){return new(a||o)(e.Y36(U.K),e.Y36(Z.b),e.Y36(_.W),e.Y36(M.S),e.Y36(y.s),e.Y36(S.D),e.Y36(N.u),e.Y36(T.YP),e.Y36(D.F0))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-dev-users"]],viewQuery:function(a,s){if(1&a&&e.Gf(L,5),2&a){let r;e.iGM(r=e.CRH())&&(s.devUserFormC=r.first)}},decls:18,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/dev.svg","alt","Dev Accounts",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/dev-accounts/dev-accounts.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["devUserFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Developer Users"),e.qZA(),e.TgZ(5,"a",3),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return s.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,H,2,0,"span",7),e.YNc(10,B,2,0,"span",8),e.qZA(),e.TgZ(11,"div",9)(12,"p-table",10),e.NdJ("selectionChange",function(p){return s.selectedRows=p})("selectionChange",function(){return s.devUserSelected()})("dblclick",function(){return s.dblClickDevUsers()}),e.YNc(13,z,5,0,"ng-template",11),e.YNc(14,j,5,3,"ng-template",12),e.qZA(),e.YNc(15,X,1,0,"p-progressSpinner",13),e.qZA()(),e._UZ(16,"app-w-dev-user-form",14,15)),2&a&&(e.xp6(9),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[w.O5,A.iA,T.jx,A.Ei,b.G,Y.u,F],encapsulation:2})}return o})();const te=[{path:"",component:(()=>{class o{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=e.Xpm({type:o,selectors:[["app-dev-acc-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-w-dev-users"),e.qZA())},dependencies:[E],encapsulation:2})}return o})(),canActivate:[n(3726).P]}];let se=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[D.Bz.forChild(te),P.u]})}return o})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2473],{2473:(De,P,n)=>{n.r(P),n.d(P,{ApiUserM:()=>Te});var Y=n(7664),G=n(4056),J=n(3726),e=n(4946),_=n(5219),k=n(5043),l=n(5861),p=n(3157),d=n(328),U=n(6212),S=n(6990),f=n(1162),C=n(5312),A=n(7240),Z=n(9961),O=n(2189),w=n(5852),y=n(7414),b=n(2915),T=n(6814),g=n(5431),x=n(7680),D=n(3259),m=n(95),Q=n(7672),F=n(553),L=n(9394),q=n(3429),V=n(115),K=n(2660),H=n(3965),W=n(8057);function B(r,i){1&r&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Add API User"),e.qZA())}function j(r,i){1&r&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," View API User"),e.qZA())}function z(r,i){1&r&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," Edit API User"),e.qZA())}function X(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"a",30),e.NdJ("click",function(){e.CHM(t);const s=e.oxw(2);return e.KtG(s.openSecret())}),e._UZ(1,"i",31),e._uU(2," Open Secret "),e.qZA()}}function ee(r,i){if(1&r&&(e.TgZ(0,"div")(1,"div",10)(2,"label",11),e._uU(3,"Password Path"),e.qZA(),e.TgZ(4,"div",12),e._UZ(5,"p-dropdown",27),e.qZA(),e.TgZ(6,"div",28),e.YNc(7,X,3,0,"a",29),e.qZA()()()),2&r){const t=e.oxw();e.xp6(5),e.Q6J("options",t.connectionStringSecrets)("filter",!0),e.xp6(2),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW)}}function te(r,i){1&r&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",32),e.qZA()())}function se(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Swagger Token"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",33),e.qZA(),e.TgZ(5,"div",34)(6,"button",35),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.generateRandomStringForSwaggerURLPart())}),e._UZ(7,"i",36),e.qZA()()()}}function ae(r,i){if(1&r&&(e.TgZ(0,"div",10),e._UZ(1,"label",11),e.TgZ(2,"div",12)(3,"a",37),e._uU(4,"View Swagger JSON"),e.qZA()()()),2&r){const t=e.oxw();e.xp6(3),e.cQ8("href","",t.environment.BE_HOST_PORT+t.EApiPaths.API+t.EApiPaths.SITES+t.EModelApiPaths.INSTANCE,"/",t.authCS.gUser.apiPath,"/get-swagger-docs/",t.form.getRawValue().swaggerURLRandomPart,"",e.LSH)}}function re(r,i){1&r&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function ne(r,i){1&r&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function ie(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"button",38),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",39),e.YNc(2,re,2,0,"span",4),e.YNc(3,ne,2,0,"span",4),e.qZA()}if(2&r){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function oe(r,i){1&r&&e._UZ(0,"p-progressSpinner",40)}let I=(()=>{class r{fb;ns;apiUserS;generalS;instanceS;eventCenterS;secretS;constantsS;authCS;data;loading={form:!1};EFormMode=d.D;form;subscriptions=[];environment=F.N;connectionStringSecrets=[];constructor(t,a,s,o,c,u,h,v,xe){this.fb=t,this.ns=a,this.apiUserS=s,this.generalS=o,this.instanceS=c,this.eventCenterS=u,this.secretS=h,this.constantsS=v,this.authCS=xe}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,l.Z)(function*(s){if(s)if(t.form.enable(),yield t.loadConnectionStringFromSecret(),s.action===p.F.OPEN_FORM_IN_EDIT_MODE){const o=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(o.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===p.F.OPEN_FORM_IN_VIEW_MODE){const o=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(o.data),t.form.disable()}else s.action===p.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("enablePasswordPath").setValue(!0))});return function(s){return a.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var a=(0,l.Z)(function*(s){s&&s.action===p.F.UPDATED&&(t.eventCenterS.headerC.secManFormC.hideModal(),yield t.loadConnectionStringFromSecret())});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]],username:[null,[m.kI.required]],password:[null,[]],enablePasswordPath:[!1,[]],apiUserPasswordPath:[null,[]],swaggerURLRandomPart:[null,[]],enableSwaggerDocs:[!1,[]]})}showModal(){$("#idApiUsersForm").modal("show")}hideModal(){$("#idApiUsersForm").modal("hide")}openSecret(){var t=this;return(0,l.Z)(function*(){t.eventCenterS.headerC.dataSecretForm.formData=yield t.getDefaultSecret(),t.eventCenterS.headerC.dataSecretForm.mode=d.D.EDIT,t.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:p.F.OPEN_FORM_IN_EDIT_MODE}),t.eventCenterS.headerC.secManFormC.showModal()})()}loadConnectionStringFromSecret(){var t=this;return(0,l.Z)(function*(){try{const a=(yield t.instanceS.getConnectionStringSecret().toPromise())?.data;t.connectionStringSecrets=a}catch(a){t.ns.showErrorFromResponse(a.error||a,"Unable to load connection string.")}})()}getDefaultSecret(){var t=this;return(0,l.Z)(function*(){const a={find:{user:t.authCS.getUserId(),active:!0,isDefault:!0}};return(yield t.secretS.query(a).toPromise()).data?.[0]})()}save(){var t=this;return(0,l.Z)(function*(){const a=t.form.getRawValue();a.user=t.authCS.getUserId();try{let s;if(t.loading.form=!0,t.data.mode===d.D.ADD){if(!a.password&&!a.apiUserPasswordPath)return t.loading.form=!1,t.ns.showError(t.constantsS.apiUser.passwordError);t.processDataBeforeSaveOrUpdate(a),s=yield t.apiUserS.post(a).toPromise()}else t.data.mode===d.D.EDIT&&(a.password||delete a.password,t.processDataBeforeSaveOrUpdate(a),s=yield t.apiUserS.put(t.data.formData._id,a,{select:f.iH._id}).toPromise());t.ns.showSuccess(t.data.mode===d.D.ADD?t.constantsS.apiUser.addSuccess:t.constantsS.apiUser.editSuccess),t.data.eventChannel.emit({action:t.data.mode===d.D.ADD?p.F.SAVED:p.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save user info.")}})()}processDataBeforeSaveOrUpdate(t){t.password&&(t.password=this.generalS.getEncryptedString(t.password,F.N.crypto.passCommunication))}generateRandomStringForSwaggerURLPart(){this.form.patchValue({swaggerURLRandomPart:this.generalS.getRandomStringWithCapitals(32)})}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EApiPaths=Q.k$;EModelApiPaths=L.k4;static \u0275fac=function(a){return new(a||r)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(C.q),e.Y36(A.b),e.Y36(q.E),e.Y36(b.u),e.Y36(V.e),e.Y36(y.L),e.Y36(w.D))};static \u0275cmp=e.Xpm({type:r,selectors:[["app-w-api-user-form"]],inputs:{data:"data"},decls:42,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idApiUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","username","name","username","spellcheck","false","type","text","placeholder","Please provide username",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","enablePasswordPath","label","Enable Password From Secret Path",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","enableSwaggerDocs","label","Enable Swagger Docs",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","apiUserPasswordPath","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["formControlName","swaggerURLRandomPart","name","swaggerURLRandomPart","spellcheck","false","type","text","placeholder","Please generate random URL",1,"form-control","form-control-sm"],[1,"col-2","pl-0"],["pTooltip","Generate random swagger token","type","button",1,"btn","btn-sm","btn-outline-info",3,"click"],[1,"fas","fa-star-of-life","text-info","fa-fw"],["target","_blank",3,"href"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,B,3,0,"span",4),e.YNc(5,j,3,0,"span",4),e.YNc(6,z,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Username"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.TgZ(22,"div",10),e._UZ(23,"label",11),e.TgZ(24,"div",12)(25,"label",15),e._UZ(26,"p-checkbox",16),e.qZA()()(),e.YNc(27,ee,8,3,"div",4),e.YNc(28,te,5,0,"div",17),e.TgZ(29,"div",10),e._UZ(30,"label",11),e.TgZ(31,"div",12)(32,"label",15),e._UZ(33,"p-checkbox",18),e.qZA()()(),e.YNc(34,se,8,0,"div",17),e.YNc(35,ae,5,3,"div",17),e.qZA()(),e.TgZ(36,"div",19)(37,"button",20),e._UZ(38,"i",21),e._uU(39," Close"),e.qZA(),e.YNc(40,ie,4,3,"button",22),e.qZA(),e.YNc(41,oe,1,0,"p-progressSpinner",23),e.qZA()()()),2&a&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(15),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",!0===s.form.get("enablePasswordPath").value),e.xp6(1),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW&&!s.form.get("enablePasswordPath").value),e.xp6(5),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs&&s.form.getRawValue().swaggerURLRandomPart),e.xp6(5),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,T.O5,K.y,x.G,D.u,H.Lt,W.XZ],encapsulation:2})}return r})();const le=["apiUserFormC"];function ce(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",18),e.qZA()}}function pe(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function de(r,i){1&r&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Username"),e.qZA()())}function me(r,i){if(1&r&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&r){const t=i.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.username)}}function ue(r,i){1&r&&e._UZ(0,"p-progressSpinner",22)}let E=(()=>{class r{apiUserS;generalS;notificationS;navigationCS;authCS;constantsS;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=f.iH._id;apiUserFormC;constructor(t,a,s,o,c,u,h,v){this.apiUserS=t,this.generalS=a,this.notificationS=s,this.navigationCS=o,this.authCS=c,this.constantsS=u,this.confirmationService=h,this.eventCenterS=v}ngOnInit(){this.eventCenterS.apiUser.selectedApiUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===p.F.SAVED||t.action===p.F.UPDATED)&&(this.apiUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - API Users")}loadGridData(){var t=this;this.loading.grid=!0;const a={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,username:1,active:1},sort:{name:1}};this.showAll&&delete a.find.active,this.subscriptions.push(this.apiUserS.query(a).subscribe(function(){var s=(0,l.Z)(function*(o){if(o.success&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=S.keyBy(t.rows,f.iH._id),t.rows[0]?._id)){const c=(yield t.apiUserS.getById(t.rows[0]._id).toPromise()).data;c._id&&(yield t.navigationCS.setQueryParam(U.p.api_user,c._id),t.eventCenterS.apiUser.selectedApiUsers.next([c]),t.selectedRows=[c],yield t.fillData())}t.generalS.setNewTitle("API Maker - API Users"),t.loading.grid=!1});return function(o){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.D.ADD,this.data.eventChannel.emit({action:p.F.OPEN_FORM_IN_ADD_MODE}),this.apiUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.VIEW,this.data.eventChannel.emit({action:p.F.OPEN_FORM_IN_VIEW_MODE}),this.apiUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.EDIT,this.data.eventChannel.emit({action:p.F.OPEN_FORM_IN_EDIT_MODE}),this.apiUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,l.Z)(function*(){var a;t.confirmationService.confirm({message:t.constantsS.apiUser.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,l.Z)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const a=yield t.apiUserS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,a.success?(t.notificationS.showSuccess(t.constantsS.apiUser.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(a,t.constantsS.apiUser.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.apiUser.selectedApiUsers.next([])}resetDependents(){var t=this;return(0,l.Z)(function*(){t.eventCenterS.apiUser.selectedApiUsers.next([]),yield t.navigationCS.setQueryParam(U.p.api_user,null)})()}apiUserSelected(){var t=this;return(0,l.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,l.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(U.p.api_user,""),void t.eventCenterS.apiUser.selectedApiUsers.next([]);const a=(yield t.apiUserS.getById(t.selectedRows[0]._id).toPromise()).data;a._id?(yield t.navigationCS.setQueryParam(U.p.api_user,a._id),t.eventCenterS.apiUser.selectedApiUsers.next([a])):t.resetDependents().then()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(a){return new(a||r)(e.Y36(C.q),e.Y36(A.b),e.Y36(Z.W),e.Y36(O.S),e.Y36(w.D),e.Y36(y.L),e.Y36(_.YP),e.Y36(b.u))};static \u0275cmp=e.Xpm({type:r,selectors:[["app-w-api-users"]],viewQuery:function(a,s){if(1&a&&e.Gf(le,5),2&a){let o;e.iGM(o=e.CRH())&&(s.apiUserFormC=o.first)}},decls:19,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-user.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-user-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["apiUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," API Users"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return s.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ce,2,0,"span",8),e.YNc(11,pe,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(c){return s.selectedRows=c})("dblclick",function(){return s.dblClickUsers()})("selectionChange",function(){return s.apiUserSelected()}),e.YNc(14,de,5,0,"ng-template",12),e.YNc(15,me,5,3,"ng-template",13),e.qZA(),e.YNc(16,ue,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-w-api-user-form",15,16)),2&a&&(e.xp6(10),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[T.O5,g.iA,_.jx,g.Ei,x.G,D.u,I],encapsulation:2})}return r})();var fe=n(3620),ge=n(8883),he=n(5561);function ve(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.saveUserPermissions())}),e._UZ(1,"i",11),e._uU(2," Save"),e.qZA()}}function _e(r,i){1&r&&(e.TgZ(0,"tr"),e._UZ(1,"th",15),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()())}function Ue(r,i){if(1&r&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",18),e.qZA()),2&r){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Se(r,i){if(1&r&&(e.TgZ(0,"tr",16),e.YNc(1,Ue,2,2,"td",17),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&r){const t=i.$implicit,a=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function Ce(r,i){if(1&r){const t=e.EpF();e.TgZ(0,"p-table",12),e.NdJ("selectionChange",function(s){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRows=s)})("selectionChange",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.apiGroupSelected())}),e.YNc(1,_e,4,0,"ng-template",13),e.YNc(2,Se,4,3,"ng-template",14),e.qZA()}if(2&r){const t=e.oxw();e.Q6J("selectionMode","multiple")("metaKeySelection",!1)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function Ae(r,i){1&r&&e._UZ(0,"p-progressSpinner",19)}let N=(()=>{class r{groupS;generalS;notificationS;navigationS;authCS;apiUserS;constantsS;eventCenterS;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={eventChannel:new e.vpe};rows=[];rowsMap={};selectedRows=[];gridKey=f.IF.name;constructor(t,a,s,o,c,u,h,v){this.groupS=t,this.generalS=a,this.notificationS=s,this.navigationS=o,this.authCS=c,this.apiUserS=u,this.constantsS=h,this.eventCenterS=v}ngOnInit(){var t=this;this.eventCenterS.apiUser.selectedGroups.next([]),this.subscriptions.push(this.eventCenterS.apiUser.selectedApiUsers.pipe((0,fe.b)(10)).subscribe(function(){var a=(0,l.Z)(function*(s){s.length?yield t.loadGridData():t.resetList()});return function(s){return a.apply(this,arguments)}}()))}loadGridData(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1},sort:{name:1}},s=yield t.groupS.query(a).toPromise();if(s.success){t.selectedRows=[],t.rows=s.data,t.rowsMap=S.keyBy(t.rows,"name");const o=t.eventCenterS.apiUser.selectedApiUsers.value[0].groupNames||[],c=[];for(const u of o)t.rowsMap[u]&&c.push(t.rowsMap[u]);t.selectedRows=c,t.eventCenterS.apiUser.selectedGroups.next(S.map(t.selectedRows,"_id"))}t.loading.grid=!1})()}resetList(){var t=this;return(0,l.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows.length=0,t.eventCenterS.apiUser.selectedGroups.next([])})()}apiGroupSelected(){var t=this;return(0,l.Z)(function*(){t.eventCenterS.apiUser.selectedGroups.next(S.map(t.selectedRows,t.gridKey))})()}saveUserPermissions(){var t=this;return(0,l.Z)(function*(){const a=JSON.parse(JSON.stringify(t.eventCenterS.apiUser.selectedApiUsers.value[0]));a.user=t.authCS.getUserId(),a.groupNames=t.eventCenterS.apiUser.selectedGroups.value||[],t.loading.grid=!0;const s=yield t.apiUserS.put(a._id,a,{select:f.iH._id}).toPromise();s&&s.success&&t.notificationS.showSuccess("User updated successfully."),t.loading.grid=!1})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||r)(e.Y36(ge.e),e.Y36(A.b),e.Y36(Z.W),e.Y36(he.X),e.Y36(w.D),e.Y36(C.q),e.Y36(y.L),e.Y36(b.u))};static \u0275cmp=e.Xpm({type:r,selectors:[["app-w-api-group-list"]],inputs:{showCheckbox:"showCheckbox"},decls:12,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,ve,3,0,"span",6),e.qZA(),e.TgZ(9,"div",7),e.YNc(10,Ce,3,6,"p-table",8),e.YNc(11,Ae,1,0,"p-progressSpinner",9),e.qZA()()),2&a&&(e.xp6(8),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(2),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(1),e.Q6J("ngIf",s.loading.grid))},dependencies:[T.O5,g.iA,_.jx,g.Ei,g.UA,x.G,D.u],encapsulation:2})}return r})();function Ze(r,i){1&r&&(e.TgZ(0,"div",3),e._UZ(1,"app-w-api-users"),e.qZA())}function we(r,i){1&r&&(e.TgZ(0,"div",4),e._UZ(1,"app-w-api-group-list"),e.qZA())}const ye=function(){return{height:"calc(100% - 100px);"}},M=function(){return[50,50]};const be=[{path:"layout",component:(()=>{class r{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=e.Xpm({type:r,selectors:[["app-api-user-layout"]],decls:4,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body border-0 shadow-sm mb-5","orientation","horizontal",3,"panelSizes","minSizes"],["pTemplate",""],[1,"col","flex","align-items-center","justify-content-center","pl-0","pr-1"],[1,"col","flex","align-items-center","justify-content-center","pl-1","pr-0"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"p-splitter",1),e.YNc(2,Ze,2,0,"ng-template",2),e.YNc(3,we,2,0,"ng-template",2),e.qZA()()),2&a&&(e.xp6(1),e.Akn(e.DdM(4,ye)),e.Q6J("panelSizes",e.DdM(5,M))("minSizes",e.DdM(6,M)))},dependencies:[_.jx,k.q,E,N],encapsulation:2})}return r})(),canActivate:[J.P]}];let Te=(()=>{class r{static \u0275fac=function(a){return new(a||r)};static \u0275mod=e.oAB({type:r});static \u0275inj=e.cJS({imports:[Y.Bz.forChild(be),G.u]})}return r})()}}]);
|