@sava-info-systems/api-maker-with-extensions 1.18.1 → 1.19.0
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/{1351.c372d4232c6551fb.js → 1351.48e08341fba9b889.js} +1 -1
- package/dist/{1417.336e9ca469a92f03.js → 1417.5caf023140e7c67f.js} +1 -1
- package/dist/1468.d42293f7d802a787.js +1 -0
- package/dist/1959.a22fe393419f10c5.js +1 -0
- package/dist/{2162.bb1f670dabb5c84a.js → 2162.3c94f3d66c6312d5.js} +1 -1
- package/dist/{2442.18887167a25c7dee.js → 2442.adbc5b49349bb569.js} +1 -1
- package/dist/{2818.dd50a60acfbaad6b.js → 2818.71176f4848a9419f.js} +1 -1
- package/dist/3488.ada60be2dbcd9845.js +1 -0
- package/dist/{3545.d415d4baf2d79163.js → 3545.b5585792e9fe1447.js} +1 -1
- package/dist/{3605.e398ec79072f4bf2.js → 3605.3c6cdf2a08c47301.js} +1 -1
- package/dist/{3611.59468f2dba2cd6df.js → 3611.9577d58af5f1f4aa.js} +1 -1
- package/dist/{3621.43633d73990c0546.js → 3621.412300a009ea6346.js} +1 -1
- package/dist/{3732.d698a74f1f0e24e6.js → 3732.b5ac36f1448e215c.js} +1 -1
- package/dist/{379.0d35e4e001b196b4.js → 379.d3e61f3350a595dc.js} +1 -1
- package/dist/{3929.a017182a7e24cf7f.js → 3929.9ac933e926943db2.js} +1 -1
- package/dist/{4092.b7a59976bb87bf26.js → 4092.71b0eccc0cb429f0.js} +1 -1
- package/dist/{4124.1dab3feb76c9c039.js → 4124.a8329e77343e7087.js} +1 -1
- package/dist/{4316.3745e74e3d9c2865.js → 4316.542be541e58dff84.js} +1 -1
- package/dist/4344.d8f42d425eaec852.js +1 -0
- package/dist/{4689.4f5958fddadc577e.js → 4689.e827720779e0cf34.js} +1 -1
- package/dist/{4709.bd58a5ca8c74f29c.js → 4709.262c34f60b50ebc9.js} +1 -1
- package/dist/{4774.088c1fbbb2988ee5.js → 4774.a4368f3ce2e778da.js} +1 -1
- package/dist/{4880.968e1ffff2f417d9.js → 4880.70ca405524206be7.js} +1 -1
- package/dist/{5011.f661999b271a98de.js → 5011.ed9a6465223f760d.js} +1 -1
- package/dist/{5090.fb3787137ba94607.js → 5090.c8bf74c35b0a5d26.js} +1 -1
- package/dist/{5140.05120f243608b828.js → 5140.581ccd2699e2a8a8.js} +1 -1
- package/dist/{5362.4514e2ffb27ce0ac.js → 5362.912e053f78479e90.js} +1 -1
- package/dist/{5442.454ac3ebe7c10659.js → 5442.186b40719e7c1da9.js} +1 -1
- package/dist/{5455.c1f4f3493ea016d4.js → 5455.a1d0d507419e3c59.js} +1 -1
- package/dist/5729.f0ee236ba6579a94.js +1 -0
- package/dist/{5826.650d402e8a957ea3.js → 5826.44efead20568788a.js} +1 -1
- package/dist/{6053.fa624fe98db9a213.js → 6053.67f38f7b35484475.js} +1 -1
- package/dist/6220.b6c29e6e3e717880.js +1 -0
- package/dist/{6415.6b8243526609c494.js → 6415.a48241737e134178.js} +1 -1
- package/dist/{6589.1003b792dd929437.js → 6589.b9c83295e466e464.js} +1 -1
- package/dist/{6679.e71f655f0e7e3e6c.js → 6679.c5073d3a60b67e2e.js} +1 -1
- package/dist/{6828.e0cfd2be83bbc047.js → 6828.36c6805f2b3c6f38.js} +1 -1
- package/dist/{6866.2b7ff38ea0ea8d8f.js → 6866.4dd76a41246a20be.js} +1 -1
- package/dist/{6882.c12e0aff75132b05.js → 6882.fe03a3df377ca119.js} +1 -1
- package/dist/{7014.8aa576d25335a412.js → 7014.5db4db60cc21782e.js} +1 -1
- package/dist/7152.dab3cc50472f703f.js +1 -0
- package/dist/{7367.bd5d43e22b265555.js → 7367.ba1e63db0f9b97f4.js} +1 -1
- package/dist/{7374.b0ad763987f68749.js → 7374.ebfe1004d1773912.js} +1 -1
- package/dist/{7597.9fe66d68836d18f4.js → 7597.177f15771dcdea42.js} +1 -1
- package/dist/7759.2b4ed39a62323abd.js +1 -0
- package/dist/{807.2ba5cc740aa4efa0.js → 807.dba59148bbbbe7fb.js} +1 -1
- package/dist/{8219.46ff63825141f651.js → 8219.2c97945d465ab185.js} +1 -1
- package/dist/{8447.17357e24b9438857.js → 8447.87b3cf73f79cd889.js} +1 -1
- package/dist/{8970.3abda875c6d7de4f.js → 8970.8eece52bbc1c316c.js} +1 -1
- package/dist/9036.876c1f0c1ce4e82b.js +1 -0
- package/dist/{9347.cb017d6396c7f64e.js → 9347.4e7d02eee86c5778.js} +1 -1
- package/dist/{9429.3ce31b960b639d09.js → 9429.9299aa0abda3dc76.js} +1 -1
- package/dist/{9785.edd131cfe4b5abdb.js → 9785.35cc7f0c3778344e.js} +1 -1
- package/dist/{9882.1e4cda6c65811bb5.js → 9882.a94c746b42e5fc0e.js} +1 -1
- package/dist/{9957.baf57c960e56a490.js → 9957.47ed0e74bdfeddd5.js} +1 -1
- package/dist/assets/schema-types/store-types.ts +1 -0
- package/dist/assets/schema-types/types.ts +1 -0
- package/dist/assets/styles/out/colors-dark.css +1 -1
- package/dist/assets/styles/out/styles.css +1 -1
- package/dist/assets/styles/styles.scss +2 -0
- package/dist/{common.2e05fdf2a25495d6.js → common.d4eb1616e93e21e1.js} +1 -1
- package/dist/index.html +1 -1
- package/dist/main.ffc8631f3e17b1c3.js +1 -0
- package/dist/runtime.f7e0fa10d087fa0b.js +1 -0
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/Dockerfile +1 -0
- package/sandbox/assets/schema-types/store-types.js +1 -0
- package/sandbox/package.json +2 -1
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/store-types.ts +1 -0
- package/src/assets/schema-types/types.ts +1 -0
- package/src/tools/local-client.js +1 -1215
- package/dist/1468.7643522cc3e89857.js +0 -1
- package/dist/1959.59ee99be25f59755.js +0 -1
- package/dist/3488.7052042211d08d07.js +0 -1
- package/dist/4344.b6f194f896eb2205.js +0 -1
- package/dist/5729.9b201708284e16bc.js +0 -1
- package/dist/6220.7d7df941537ed662.js +0 -1
- package/dist/7152.4f047369765b7ac5.js +0 -1
- package/dist/7759.6c363b1156e3658a.js +0 -1
- package/dist/9036.18609df03a18bbdb.js +0 -1
- package/dist/main.b85e625cdc44b214.js +0 -1
- package/dist/runtime.f9839e08ff0d235d.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6415],{6415:(ze,T,i)=>{i.r(T),i.d(T,{GroupM:()=>Je});var K=i(7060),W=i(7431),L=i(2173),Q=i(4344),M=i(5632),e=i(540),I=i(3966),G=i(5779),J=i(572),z=i(4218),H=i(6204),Z=i(6976),q=i(1726),ee=i(2290),te=i(4525),ne=i(3199),se=i(3183),ae=i(3173),oe=i(2199),p=i(467),C=i(8727),y=i(5046),m=i(7326),d=i(7376),g=i(6645),k=i(4774),A=i(6268),ie=i(123),re=i(6170),le=i(3851),w=i(6129),j=i(6708),O=i(7337),N=i(7237),F=i(1987),ce=i(7454),R=i(177),X=i(7645),D=i(7515),B=i(8542),h=i(4341),de=i(3478);function pe(o,l){1&o&&(e.j41(0,"span"),e.nrm(1,"i",19),e.EFF(2," Add Group"),e.k0s())}function ue(o,l){1&o&&(e.j41(0,"span"),e.nrm(1,"i",20),e.EFF(2," View Group"),e.k0s())}function me(o,l){1&o&&(e.j41(0,"span"),e.nrm(1,"i",21),e.EFF(2," Edit Group"),e.k0s())}function ge(o,l){1&o&&(e.j41(0,"span"),e.EFF(1,"Save Group"),e.k0s())}function he(o,l){1&o&&(e.j41(0,"span"),e.EFF(1,"Update Group"),e.k0s())}function fe(o,l){if(1&o){const t=e.RV6();e.j41(0,"button",22),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.save())}),e.nrm(1,"i",23),e.DNE(2,ge,2,0,"span",4),e.DNE(3,he,2,0,"span",4),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("disabled",t.form.invalid),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ve(o,l){1&o&&e.nrm(0,"p-progressSpinner",24)}let U=(()=>{class o{fb;ns;groupS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=y.X;form;subscriptions=[];constructor(t,s,n,a,r,u){this.fb=t,this.ns=s,this.groupS=n,this.generalS=a,this.authCS=r,this.constantsS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,p.A)(function*(n){if(n)if(t.form.enable(),n.action===C.K.OPEN_FORM_IN_EDIT_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data)}else if(n.action===C.K.OPEN_FORM_IN_VIEW_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.form.disable()}else n.action===C.K.OPEN_FORM_IN_ADD_MODE&&t.form.reset()});return function(n){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[h.k0.required]]})}showModal(){$("#idGroupsForm").modal("show")}hideModal(){$("#idGroupsForm").modal("hide")}save(){var t=this;return(0,p.A)(function*(){const s=t.form.getRawValue();let n;n=t.data.formData&&t.data.formData._id?(yield t.groupS.getById(t.data.formData._id).toPromise()).data:{};const a=Object.assign({},n,s);a.user=t.authCS.getUserId();try{let r;t.loading.form=!0,t.data.mode===y.X.ADD?r=yield t.groupS.post(a).toPromise():t.data.mode===y.X.EDIT&&(r=yield t.groupS.put(t.data.formData._id,a,{select:g.GX._id}).toPromise()),t.ns.showSuccess(t.data.mode===y.X.ADD?t.constantsS.group.addSuccess:t.constantsS.group.editSuccess),t.data.eventChannel.emit({action:t.data.mode===y.X.ADD?C.K.SAVED:C.K.UPDATED}),t.loading.form=!1}catch(r){t.loading.form=!1,t.ns.showErrorFromResponse(r.error||r,"Unable to save group.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.rXU(h.ok),e.rXU(j.m),e.rXU(k.L),e.rXU(w.f),e.rXU(N.l),e.rXU(F.X))};static \u0275cmp=e.VBU({type:o,selectors:[["app-w-groups-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idGroupsForm","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"],[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"],["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(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,pe,3,0,"span",4),e.DNE(5,ue,3,0,"span",4),e.DNE(6,me,3,0,"span",4),e.j41(7,"button",5)(8,"span",6),e.nrm(9,"i",7),e.k0s()()(),e.j41(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e.EFF(14,"Name"),e.k0s(),e.j41(15,"div",12),e.nrm(16,"input",13),e.k0s()()()(),e.j41(17,"div",14)(18,"button",15),e.nrm(19,"i",16),e.EFF(20," Close"),e.k0s(),e.DNE(21,fe,4,3,"button",17),e.k0s(),e.DNE(22,ve,1,0,"p-progressSpinner",18),e.k0s()()()),2&s&&(e.R7$(4),e.Y8G("ngIf",n.data.mode===n.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",n.data.mode===n.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",n.data.mode===n.EFormMode.EDIT),e.R7$(5),e.Y8G("formGroup",n.form),e.R7$(10),e.Y8G("ngIf",n.data.mode!==n.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",n.loading.form))},dependencies:[h.qT,h.me,h.BC,h.cb,h.j4,h.JD,R.bT,de.U,D.p],encapsulation:2})}return o})();const Ce=["groupsFormC"];function Se(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",18),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.edit())}),e.nrm(1,"i",19),e.k0s()}}function ye(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",20),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.clone())}),e.nrm(1,"i",21),e.k0s()}}function _e(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",22),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.removePermanentDialog())}),e.nrm(1,"i",23),e.k0s()}}function be(o,l){1&o&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Name"),e.k0s(),e.nrm(3,"th",24),e.k0s())}function Ie(o,l){if(1&o){const t=e.RV6();e.j41(0,"i",27),e.bIt("click",function(n){e.eBV(t);const a=e.XpG().$implicit,r=e.XpG();return e.Njj(r.saveGroupPermissions(n,a))}),e.k0s()}}function Ge(o,l){if(1&o&&(e.j41(0,"tr",25)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.DNE(4,Ie,1,0,"i",26),e.k0s()()),2&o){const t=l.$implicit,s=e.XpG();e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t.name),e.R7$(2),e.Y8G("ngIf",s.selectedRows.indexOf(t)>-1)}}function we(o,l){1&o&&e.nrm(0,"p-progressSpinner",28)}let x=(()=>{class o{groupS;instanceS;functionS;tpInstalledApisS;webSocketEventsS;generalS;notificationS;navigationCS;authCS;constantsS;apiS;eventCenterS;confirmationService;loading={grid:!1};subscriptions=[];data={mode:y.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=g.GX._id;groupsFormC;constructor(t,s,n,a,r,u,_,c,f,S,v,b,P){this.groupS=t,this.instanceS=s,this.functionS=n,this.tpInstalledApisS=a,this.webSocketEventsS=r,this.generalS=u,this.notificationS=_,this.navigationCS=c,this.authCS=f,this.constantsS=S,this.apiS=v,this.eventCenterS=b,this.confirmationService=P}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===C.K.SAVED||t.action===C.K.UPDATED)&&(this.groupsFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Groups")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.groupS.query(s).subscribe(function(){var n=(0,p.A)(function*(a){a.success&&(t.selectedRows=[],t.rows=a.data,t.rowsMap=d.keyBy(t.rows,g.GX._id));const r=t.navigationCS.getQueryParam(m.F.group);t.rowsMap[r]&&(t.selectedRows.length=0,t.selectedRows.push(t.rowsMap[r]),yield t.fillData()),t.generalS.setNewTitle("API Maker - Groups"),t.loading.grid=!1});return function(a){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=y.X.ADD,this.data.eventChannel.emit({action:C.K.OPEN_FORM_IN_ADD_MODE}),this.groupsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=y.X.VIEW,this.data.eventChannel.emit({action:C.K.OPEN_FORM_IN_VIEW_MODE}),this.groupsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=y.X.EDIT,this.data.eventChannel.emit({action:C.K.OPEN_FORM_IN_EDIT_MODE}),this.groupsFormC.showModal()}clone(){var t=this;return(0,p.A)(function*(){try{if(!t.selectedRows[0])return;const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,delete s.queryParamsMap,s.name=`${s.name}-clone`,(yield t.groupS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.group.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.group.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.group.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.A)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.group.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,p.A)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.A)(function*(){t.loading.grid=!0;const s=yield t.groupS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.group.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.group.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.A)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([m.F.group,m.F.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.fields.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.systemApiIds.next([]),t.eventCenterS.group.webSocketIds.next([]),t.eventCenterS.group.apisRegex={}})()}groupSelected(){var t=this;return(0,p.A)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,p.A)(function*(){if(!t.selectedRows.length)return void(yield t.resetDependents());const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;s&&s.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(s.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(s.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(s.queryParams.supportedApiNames||[]),t.eventCenterS.group.fields.next(s.queryParams.fields||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(s.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.thirdPartyApiNames,t.tpInstalledApisS,M.O.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(s.queryParams.webSocketEventNames))),s&&(t.eventCenterS.group.selectedGroups.next([s]),t.eventCenterS.group.apisRegex=s.apisRegex,yield t.navigationCS.setQueryParam(m.F.group,t.selectedRows[0]._id)),s?.queryParams||t.resetDependents()})()}saveGroupPermissions(t,s){var n=this;return(0,p.A)(function*(){t.stopImmediatePropagation();const a=JSON.parse(JSON.stringify(s));a.fields=n.getPermissionMap(n.eventCenterS.group.schemaFields.value,["path","allowRead","allowWrite"]),a.apisRegex=n.eventCenterS.group.apisRegex,a.queryParams={},a.user=n.authCS.getUserId(),a.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),a.queryParams.databaseNames=d.uniq(n.eventCenterS.group.databaseNames.value),a.queryParams.collectionNames=d.uniq(n.eventCenterS.group.collectionNames.value),a.queryParams.supportedApiNames=d.uniq(n.eventCenterS.group.supportedApiIds.value),a.queryParams.fields=d.uniq(n.eventCenterS.group.fields.value),a.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),a.queryParams.systemApiNames=d.uniq(n.eventCenterS.group.systemApiIds.value),a.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,M.O.THIRD_PARTY_APIS),a.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);const r=yield n.groupS.put(a._id,a,{select:g.GX._id}).toPromise();r&&r.success&&n.notificationS.showSuccess(n.constantsS.group.editSuccess)})()}getPermissionMap(t,s){const n=s.slice(1),a=d.groupBy(t,g.gg.instanceName);for(const r in a){const u=a[r]=d.groupBy(a[r],g.gg.databaseName);for(const _ in u){const c=u[_]=d.groupBy(u[_],g.gg.collectionName);for(const f in c)if(1===s.length){const S={};for(const v of c[f])S[v[s[0]]]=!0;c[f]=S}else{const S={};for(const v of c[f])S[v[s[0]]]=d.pick(v,n);c[f]=S}}}return a}getPermissionMapThirdPartyAPIs(t){const s=d.groupBy(t,g.gg.apiBundleName);for(const n in s){if("undefined"===n){delete s[n];continue}const a=s[n]=d.groupBy(s[n],g.gg.apiVersionName);for(const r in a){if("undefined"===r){delete a[r];continue}const u=a[r]=d.groupBy(a[r],g.gg.apiName);for(const _ in u)"undefined"!==_?u[_]=!0:delete u[_]}}return s}getPermissionMapFunctionsAndWSEventAndSysApis(t){const s={};for(const n of t||[])s[n._id]=!0;return s}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickGroups(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||o)(e.rXU(k.L),e.rXU(A.J),e.rXU(ie.a),e.rXU(re.h),e.rXU(le.g),e.rXU(w.f),e.rXU(j.m),e.rXU(O.$),e.rXU(N.l),e.rXU(F.X),e.rXU(ce.a),e.rXU(I.d),e.rXU(G.td))};static \u0275cmp=e.VBU({type:o,selectors:[["app-w-groups"]],viewQuery:function(s,n){if(1&s&&e.GBs(Ce,5),2&s){let a;e.mGM(a=e.lsd())&&(n.groupsFormC=a.first)}},decls:20,vars:11,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"],["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"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-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"],[3,"data"],["groupsFormC",""],["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"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-save text-success fa-fw cursor-pointer","pTooltip","Save group settings",3,"click",4,"ngIf"],["pTooltip","Save group settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," Groups"),e.k0s(),e.j41(5,"div",3)(6,"a",4),e.nrm(7,"img",5),e.k0s()(),e.j41(8,"span",6),e.bIt("click",function(){return n.add()}),e.nrm(9,"i",7),e.k0s(),e.DNE(10,Se,2,0,"span",8),e.DNE(11,ye,2,0,"span",9),e.DNE(12,_e,2,0,"span",10),e.k0s(),e.j41(13,"div",11)(14,"p-table",12),e.bIt("selectionChange",function(r){return n.selectedRows=r})("selectionChange",function(){return n.groupSelected()})("dblclick",function(){return n.dblClickGroups()}),e.DNE(15,be,4,0,"ng-template",13),e.DNE(16,Ge,5,3,"ng-template",14),e.k0s(),e.DNE(17,we,1,0,"p-progressSpinner",15),e.k0s()(),e.nrm(18,"app-w-groups-form",16,17)),2&s&&(e.R7$(10),e.Y8G("ngIf",n.selectedRows.length),e.R7$(1),e.Y8G("ngIf",n.selectedRows.length),e.R7$(1),e.Y8G("ngIf",n.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.R7$(3),e.Y8G("ngIf",n.loading.grid),e.R7$(1),e.Y8G("data",n.data))},dependencies:[R.bT,X.XI,G.Ei,X.d5,D.p,B.m,U]})}return o})();var Re=i(152),De=i(9861),Me=i(5430);function Ae(o,l){if(1&o&&(e.j41(0,"div")(1,"div",10),e.EFF(2),e.k0s()()),2&o){const t=e.XpG();e.R7$(2),e.JRh(t.constantsS.group.allFieldsPermitted)}}function Ne(o,l){if(1&o&&(e.j41(0,"span",18),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.R7$(1),e.Lme(" [",t.instanceName.substr(0,3).toUpperCase(),"] [",t.databaseName.substr(0,3).toUpperCase(),"] ")}}function Fe(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",19)(1,"label",20)(2,"p-checkbox",21),e.bIt("ngModelChange",function(n){e.eBV(t);const a=e.XpG().$implicit;return e.Njj(a.allowRead=n)})("click",function(n){e.eBV(t);const a=e.XpG().$implicit,r=e.XpG(2);return r.generalS.stopPropagation(n),e.Njj(r.removeDataItemFromSelectedRows(a))}),e.k0s()(),e.j41(3,"label",22)(4,"p-checkbox",23),e.bIt("ngModelChange",function(n){e.eBV(t);const a=e.XpG().$implicit;return e.Njj(a.allowWrite=n)})("click",function(n){e.eBV(t);const a=e.XpG().$implicit,r=e.XpG(2);return r.generalS.stopPropagation(n),e.Njj(r.removeDataItemFromSelectedRows(a))}),e.k0s()()()}if(2&o){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("ngModel",t.allowRead)("binary",!0),e.R7$(2),e.Y8G("ngModel",t.allowWrite)("binary",!0)}}function Pe(o,l){if(1&o&&(e.j41(0,"div",15),e.EFF(1),e.DNE(2,Ne,2,2,"span",16),e.DNE(3,Fe,5,4,"span",17),e.k0s()),2&o){const t=l.$implicit,s=e.XpG(2);e.R7$(1),e.SpI(" ",t.label||t.name," "),e.R7$(1),e.Y8G("ngIf",t.level1),e.R7$(1),e.Y8G("ngIf",!t.level1&&(!t.children||0===t.children.length)&&s.selectedRows.indexOf(t)>=0)}}function Ee(o,l){1&o&&e.nrm(0,"p-progressSpinner",24)}function Te(o,l){if(1&o){const t=e.RV6();e.j41(0,"div",11)(1,"p-tree",12),e.bIt("selectionChange",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.selectedRows=n)})("selectionChange",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.checkedChange())})("onNodeSelect",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.nodeSelected(n))})("onNodeUnselect",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.nodeUnSelected(n))}),e.DNE(2,Pe,4,3,"ng-template",13),e.k0s(),e.DNE(3,Ee,1,0,"p-progressSpinner",14),e.k0s()}if(2&o){const t=e.XpG();e.R7$(1),e.Y8G("value",t.propertiesListData)("selection",t.selectedRows)("metaKeySelection",!1),e.R7$(2),e.Y8G("ngIf",t.loading.grid)}}let V=(()=>{class o{instanceS;eventCenterS;constantsS;generalS;loading={grid:!1};subscriptions=[];propertiesListData=[];allTreeItemsMap={};selectedRows=[];checkedKeysMap={};key="_id";constructor(t,s,n,a){this.instanceS=t,this.eventCenterS=s,this.constantsS=n,this.generalS=a}ngOnInit(){var t=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,Re.B)(300)).subscribe(function(){var s=(0,p.A)(function*(n){yield t.loadSchemas()});return function(n){return s.apply(this,arguments)}}()))}loadSchemas(){var t=this;return(0,p.A)(function*(){const s=t.eventCenterS.collection.selectedCollections.value;if(!s.length)return void(yield t.resetGridAndUrl());t.loading.grid=!0;const n=t.eventCenterS.group.selectedGroups.value[0];yield t.resetGridAndUrl(),t.allTreeItemsMap={};const a=(yield t.instanceS.getSchemas(s).toPromise()).data,r=[],u=[];for(const c of a){const f=[];if(c.propertyItems){const b=[];for(const P of c.propertyItems){const E=t.generalS.convertKTreeItemToPrimeNGTreeItem(P);t.setReadWriteRecursively(n,E),b.push(E),f.push(E)}u.push(b)}const S=c.instanceName+":"+c.databaseName+":"+c.collectionName,v={label:`${c.collectionName}`,children:f,_id:S,level1:!0,instanceName:c.instanceName,databaseName:c.databaseName,collectionName:c.collectionName};r.push(v),t.allTreeItemsMap[S]=v;for(const b of v?.children||[])b.parent=v}t.propertiesListData=r;for(const c of u)t.generateIdMap(c,t.allTreeItemsMap);if(t.eventCenterS.group.fields.value.join(",")){const c=d.intersection(d.keys(t.allTreeItemsMap),t.eventCenterS.group.fields.value);t.selectedRows=[];for(const f of c)t.allTreeItemsMap[f]&&t.selectedRows.push(t.allTreeItemsMap[f]);t.generalS.setDataInSelectedRowsFromIdArr(c,t.selectedRows,t.allTreeItemsMap),t.setDataInEventCenter()}t.loading.grid=!1})()}setReadWriteRecursively(t,s){const n=t?.fields?.[s.instanceName]?.[s.databaseName]?.[s.collectionName];if(!n)return;const a=n[s.path];if(a?(s.allowRead=a.allowRead,s.allowWrite=a.allowWrite):s.allowRead=s.allowWrite=!1,s.children&&s.children.length)for(const r of s.children)this.setReadWriteRecursively(t,r)}resetGridAndUrl(){var t=this;return(0,p.A)(function*(){t.propertiesListData=[],t.allTreeItemsMap={},t.selectedRows=[],t.checkedKeysMap={},t.eventCenterS.group.schemaFields.next([])})()}checkedChange(){this.setDataInEventCenter()}nodeSelected(t){t.node.allowRead=!0}nodeUnSelected(t){const s=t.node;s.allowRead=!1,s.allowWrite=!1}removeDataItemFromSelectedRows(t){if(!t.allowRead&&!t.allowWrite){const s=this.selectedRows.indexOf(t);s>=0&&this.selectedRows.splice(s,1)}}calculateCheckedKeysMap(){this.checkedKeysMap={};for(const t of this.selectedRows)this.checkedKeysMap[t._id]=t}setDataInEventCenter(){this.calculateCheckedKeysMap(),this.eventCenterS.group.fields.next(d.map(this.selectedRows,"_id"));const t=[];for(const s of this.selectedRows)this.allTreeItemsMap[s._id]&&t.push(s);this.eventCenterS.group.schemaFields.next(t)}generateIdMap(t,s){if(Array.isArray(t))for(const n of t)this.generateIdMap(n,s);else s[t._id]=t,t.children&&this.generateIdMap(t.children,s)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.rXU(A.J),e.rXU(I.d),e.rXU(F.X),e.rXU(w.f))};static \u0275cmp=e.VBU({type:o,selectors:[["app-w-schema-fields"]],decls:12,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-indent","text-success","fa-fw","mr-1"],["pTooltip","All Fields",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"card-body","p-0","h-100","overflow-hidden"],[1,"position-relative","border-top","h-100"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["scrollHeight","flex","selectionMode","checkbox",1,"w-full",3,"value","selection","metaKeySelection","selectionChange","onNodeSelect","onNodeUnselect"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"w-100","prevent-text-selection","cursor-pointer"],["class","text-monospace font-weight-bold font-italic float-right mr-1","style","font-size: xx-small;",4,"ngIf"],["class","float-right small mr-2",4,"ngIf"],[1,"text-monospace","font-weight-bold","font-italic","float-right","mr-1",2,"font-size","xx-small"],[1,"float-right","small","mr-2"],[1,"align-middle","mb-0","mr-2"],["label","R",3,"ngModel","binary","ngModelChange","click"],[1,"align-middle","mb-0"],["label","W",3,"ngModel","binary","ngModelChange","click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"i",2),e.EFF(4," Schema Fields"),e.k0s(),e.j41(5,"span",3)(6,"label",4)(7,"p-checkbox",5),e.bIt("ngModelChange",function(r){return n.eventCenterS.group.apisRegex.allFields=r}),e.k0s()()()(),e.j41(8,"div",6)(9,"div",7),e.DNE(10,Ae,3,1,"div",8),e.DNE(11,Te,4,4,"div",9),e.k0s()()()),2&s&&(e.R7$(7),e.Y8G("ngModel",n.eventCenterS.group.apisRegex.allFields)("binary",!0),e.R7$(3),e.Y8G("ngIf",n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields),e.R7$(1),e.Y8G("ngIf",!(n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields)))},dependencies:[h.BC,h.vS,R.bT,G.Ei,De.PH,D.p,B.m,Me.Sc],encapsulation:2})}return o})();function ke(o,l){1&o&&(e.j41(0,"div",21),e.nrm(1,"app-w-instances",10),e.k0s()),2&o&&(e.R7$(1),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function je(o,l){1&o&&(e.j41(0,"div",22),e.nrm(1,"app-w-databases",10),e.k0s()),2&o&&(e.R7$(1),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const Oe=function(){return[50,50]};let Y=(()=>{class o{eventCenterS;EAPICategory=M.O;constructor(t){this.eventCenterS=t}ngOnInit(){}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}static \u0275fac=function(s){return new(s||o)(e.rXU(I.d))};static \u0275cmp=e.VBU({type:o,selectors:[["app-group-layout"]],decls:34,vars:42,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-groups"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-schema-fields"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.nrm(4,"app-w-groups"),e.k0s()(),e.j41(5,"div",4)(6,"div",3),e.nrm(7,"app-w-api-categories",5),e.k0s()(),e.j41(8,"div",6)(9,"p-splitter",7),e.DNE(10,ke,2,3,"ng-template",8),e.DNE(11,je,2,3,"ng-template",8),e.k0s()(),e.j41(12,"div",9)(13,"div",3),e.nrm(14,"app-w-collections",10),e.k0s()(),e.j41(15,"div",11)(16,"div",3),e.nrm(17,"app-w-supported-api",12),e.k0s()(),e.j41(18,"div",13)(19,"div",3),e.nrm(20,"app-w-schema-fields"),e.k0s()(),e.j41(21,"div",14)(22,"div",3),e.nrm(23,"app-w-supported-tp-api",15),e.k0s()(),e.j41(24,"div",16)(25,"div",3),e.nrm(26,"app-custom-api-grid",17),e.k0s()(),e.j41(27,"div",18)(28,"div",3),e.nrm(29,"app-system-api-w",17),e.k0s()(),e.j41(30,"div",19)(31,"div",3),e.nrm(32,"app-web-socket-events-grid",20),e.k0s()()()(),e.nrm(33,"app-create-schema-form")),2&s&&(e.R7$(5),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.R7$(2),e.Y8G("typeIsGroup","GROUP"),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(1),e.Y8G("panelSizes",e.lJ4(41,Oe)),e.R7$(3),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(2),e.Y8G("isLPM",!1)("isDependentOnGroup",!0)("treeViewId","treeViewFromGroupLayout"),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(3),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.R7$(2),e.Y8G("IsDependentOnGroup",!0)("isLPM",!1),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.CUSTOM_APIS?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.SYSTEM_APIS?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!1))},dependencies:[G.Ei,J.O,z._,H.o,Z.l,q.X,ee.d,te.i,ne.c,se.u,ae.e,oe.o,x,V],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-groups[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%], .w-schema-fields[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return o})();i(8150);var Ue=i(2818),xe=i(9036),Ve=i(807),Ye=i(5826),Ke=i(5493),We=i(863),Le=i(8389);const Qe=[{path:"group-layout",component:Y,canActivate:[L.Z]}];let Je=(()=>{class o{static \u0275fac=function(s){return new(s||o)};static \u0275mod=e.$C({type:o});static \u0275inj=e.G2t({imports:[K.iI.forChild(Qe),W.u,Ue.DashboardM,Ve.DbCellM,xe.FunctionManM,Ye.SystemApiM,Le.Q,Ke.I,We.e,Q.WebSocketEventsM]})}return o})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6415],{6415:(ze,T,i)=>{i.r(T),i.d(T,{GroupM:()=>Je});var K=i(7060),W=i(1709),L=i(2173),Q=i(4344),M=i(5632),e=i(540),I=i(3966),G=i(5779),J=i(572),z=i(4218),H=i(6204),Z=i(6976),q=i(1726),ee=i(2290),te=i(4525),ne=i(3199),se=i(3183),ae=i(3173),oe=i(2199),p=i(467),C=i(8727),y=i(5046),m=i(7326),d=i(7376),g=i(6645),k=i(4774),A=i(6268),ie=i(123),re=i(6170),le=i(3851),w=i(6129),j=i(6708),O=i(7337),N=i(7237),F=i(1987),ce=i(7454),R=i(177),X=i(7645),D=i(7515),B=i(8542),h=i(4341),de=i(3478);function pe(o,l){1&o&&(e.j41(0,"span"),e.nrm(1,"i",19),e.EFF(2," Add Group"),e.k0s())}function ue(o,l){1&o&&(e.j41(0,"span"),e.nrm(1,"i",20),e.EFF(2," View Group"),e.k0s())}function me(o,l){1&o&&(e.j41(0,"span"),e.nrm(1,"i",21),e.EFF(2," Edit Group"),e.k0s())}function ge(o,l){1&o&&(e.j41(0,"span"),e.EFF(1,"Save Group"),e.k0s())}function he(o,l){1&o&&(e.j41(0,"span"),e.EFF(1,"Update Group"),e.k0s())}function fe(o,l){if(1&o){const t=e.RV6();e.j41(0,"button",22),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.save())}),e.nrm(1,"i",23),e.DNE(2,ge,2,0,"span",4),e.DNE(3,he,2,0,"span",4),e.k0s()}if(2&o){const t=e.XpG();e.Y8G("disabled",t.form.invalid),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ve(o,l){1&o&&e.nrm(0,"p-progressSpinner",24)}let U=(()=>{class o{fb;ns;groupS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=y.X;form;subscriptions=[];constructor(t,s,n,a,r,u){this.fb=t,this.ns=s,this.groupS=n,this.generalS=a,this.authCS=r,this.constantsS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,p.A)(function*(n){if(n)if(t.form.enable(),n.action===C.K.OPEN_FORM_IN_EDIT_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data)}else if(n.action===C.K.OPEN_FORM_IN_VIEW_MODE){const a=yield t.groupS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.form.disable()}else n.action===C.K.OPEN_FORM_IN_ADD_MODE&&t.form.reset()});return function(n){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[h.k0.required]]})}showModal(){$("#idGroupsForm").modal("show")}hideModal(){$("#idGroupsForm").modal("hide")}save(){var t=this;return(0,p.A)(function*(){const s=t.form.getRawValue();let n;n=t.data.formData&&t.data.formData._id?(yield t.groupS.getById(t.data.formData._id).toPromise()).data:{};const a=Object.assign({},n,s);a.user=t.authCS.getUserId();try{let r;t.loading.form=!0,t.data.mode===y.X.ADD?r=yield t.groupS.post(a).toPromise():t.data.mode===y.X.EDIT&&(r=yield t.groupS.put(t.data.formData._id,a,{select:g.GX._id}).toPromise()),t.ns.showSuccess(t.data.mode===y.X.ADD?t.constantsS.group.addSuccess:t.constantsS.group.editSuccess),t.data.eventChannel.emit({action:t.data.mode===y.X.ADD?C.K.SAVED:C.K.UPDATED}),t.loading.form=!1}catch(r){t.loading.form=!1,t.ns.showErrorFromResponse(r.error||r,"Unable to save group.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.rXU(h.ok),e.rXU(j.m),e.rXU(k.L),e.rXU(w.f),e.rXU(N.l),e.rXU(F.X))};static \u0275cmp=e.VBU({type:o,selectors:[["app-w-groups-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idGroupsForm","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"],[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"],["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(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,pe,3,0,"span",4),e.DNE(5,ue,3,0,"span",4),e.DNE(6,me,3,0,"span",4),e.j41(7,"button",5)(8,"span",6),e.nrm(9,"i",7),e.k0s()()(),e.j41(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e.EFF(14,"Name"),e.k0s(),e.j41(15,"div",12),e.nrm(16,"input",13),e.k0s()()()(),e.j41(17,"div",14)(18,"button",15),e.nrm(19,"i",16),e.EFF(20," Close"),e.k0s(),e.DNE(21,fe,4,3,"button",17),e.k0s(),e.DNE(22,ve,1,0,"p-progressSpinner",18),e.k0s()()()),2&s&&(e.R7$(4),e.Y8G("ngIf",n.data.mode===n.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",n.data.mode===n.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",n.data.mode===n.EFormMode.EDIT),e.R7$(5),e.Y8G("formGroup",n.form),e.R7$(10),e.Y8G("ngIf",n.data.mode!==n.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",n.loading.form))},dependencies:[h.qT,h.me,h.BC,h.cb,h.j4,h.JD,R.bT,de.U,D.p],encapsulation:2})}return o})();const Ce=["groupsFormC"];function Se(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",18),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.edit())}),e.nrm(1,"i",19),e.k0s()}}function ye(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",20),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.clone())}),e.nrm(1,"i",21),e.k0s()}}function _e(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",22),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.removePermanentDialog())}),e.nrm(1,"i",23),e.k0s()}}function be(o,l){1&o&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Name"),e.k0s(),e.nrm(3,"th",24),e.k0s())}function Ie(o,l){if(1&o){const t=e.RV6();e.j41(0,"i",27),e.bIt("click",function(n){e.eBV(t);const a=e.XpG().$implicit,r=e.XpG();return e.Njj(r.saveGroupPermissions(n,a))}),e.k0s()}}function Ge(o,l){if(1&o&&(e.j41(0,"tr",25)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.DNE(4,Ie,1,0,"i",26),e.k0s()()),2&o){const t=l.$implicit,s=e.XpG();e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t.name),e.R7$(2),e.Y8G("ngIf",s.selectedRows.indexOf(t)>-1)}}function we(o,l){1&o&&e.nrm(0,"p-progressSpinner",28)}let x=(()=>{class o{groupS;instanceS;functionS;tpInstalledApisS;webSocketEventsS;generalS;notificationS;navigationCS;authCS;constantsS;apiS;eventCenterS;confirmationService;loading={grid:!1};subscriptions=[];data={mode:y.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=g.GX._id;groupsFormC;constructor(t,s,n,a,r,u,_,c,f,S,v,b,P){this.groupS=t,this.instanceS=s,this.functionS=n,this.tpInstalledApisS=a,this.webSocketEventsS=r,this.generalS=u,this.notificationS=_,this.navigationCS=c,this.authCS=f,this.constantsS=S,this.apiS=v,this.eventCenterS=b,this.confirmationService=P}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===C.K.SAVED||t.action===C.K.UPDATED)&&(this.groupsFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Groups")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.groupS.query(s).subscribe(function(){var n=(0,p.A)(function*(a){a.success&&(t.selectedRows=[],t.rows=a.data,t.rowsMap=d.keyBy(t.rows,g.GX._id));const r=t.navigationCS.getQueryParam(m.F.group);t.rowsMap[r]&&(t.selectedRows.length=0,t.selectedRows.push(t.rowsMap[r]),yield t.fillData()),t.generalS.setNewTitle("API Maker - Groups"),t.loading.grid=!1});return function(a){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=y.X.ADD,this.data.eventChannel.emit({action:C.K.OPEN_FORM_IN_ADD_MODE}),this.groupsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=y.X.VIEW,this.data.eventChannel.emit({action:C.K.OPEN_FORM_IN_VIEW_MODE}),this.groupsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=y.X.EDIT,this.data.eventChannel.emit({action:C.K.OPEN_FORM_IN_EDIT_MODE}),this.groupsFormC.showModal()}clone(){var t=this;return(0,p.A)(function*(){try{if(!t.selectedRows[0])return;const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,delete s.queryParamsMap,s.name=`${s.name}-clone`,(yield t.groupS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.group.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.group.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.group.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.A)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.group.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,p.A)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.A)(function*(){t.loading.grid=!0;const s=yield t.groupS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.group.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.group.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.A)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([m.F.group,m.F.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.fields.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.systemApiIds.next([]),t.eventCenterS.group.webSocketIds.next([]),t.eventCenterS.group.apisRegex={}})()}groupSelected(){var t=this;return(0,p.A)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,p.A)(function*(){if(!t.selectedRows.length)return void(yield t.resetDependents());const s=(yield t.groupS.getById(t.selectedRows[0]._id).toPromise()).data;s&&s.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(s.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(s.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(s.queryParams.supportedApiNames||[]),t.eventCenterS.group.fields.next(s.queryParams.fields||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(s.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(s.queryParams.thirdPartyApiNames,t.tpInstalledApisS,M.O.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(s.queryParams.webSocketEventNames))),s&&(t.eventCenterS.group.selectedGroups.next([s]),t.eventCenterS.group.apisRegex=s.apisRegex,yield t.navigationCS.setQueryParam(m.F.group,t.selectedRows[0]._id)),s?.queryParams||t.resetDependents()})()}saveGroupPermissions(t,s){var n=this;return(0,p.A)(function*(){t.stopImmediatePropagation();const a=JSON.parse(JSON.stringify(s));a.fields=n.getPermissionMap(n.eventCenterS.group.schemaFields.value,["path","allowRead","allowWrite"]),a.apisRegex=n.eventCenterS.group.apisRegex,a.queryParams={},a.user=n.authCS.getUserId(),a.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),a.queryParams.databaseNames=d.uniq(n.eventCenterS.group.databaseNames.value),a.queryParams.collectionNames=d.uniq(n.eventCenterS.group.collectionNames.value),a.queryParams.supportedApiNames=d.uniq(n.eventCenterS.group.supportedApiIds.value),a.queryParams.fields=d.uniq(n.eventCenterS.group.fields.value),a.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),a.queryParams.systemApiNames=d.uniq(n.eventCenterS.group.systemApiIds.value),a.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,M.O.THIRD_PARTY_APIS),a.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);const r=yield n.groupS.put(a._id,a,{select:g.GX._id}).toPromise();r&&r.success&&n.notificationS.showSuccess(n.constantsS.group.editSuccess)})()}getPermissionMap(t,s){const n=s.slice(1),a=d.groupBy(t,g.gg.instanceName);for(const r in a){const u=a[r]=d.groupBy(a[r],g.gg.databaseName);for(const _ in u){const c=u[_]=d.groupBy(u[_],g.gg.collectionName);for(const f in c)if(1===s.length){const S={};for(const v of c[f])S[v[s[0]]]=!0;c[f]=S}else{const S={};for(const v of c[f])S[v[s[0]]]=d.pick(v,n);c[f]=S}}}return a}getPermissionMapThirdPartyAPIs(t){const s=d.groupBy(t,g.gg.apiBundleName);for(const n in s){if("undefined"===n){delete s[n];continue}const a=s[n]=d.groupBy(s[n],g.gg.apiVersionName);for(const r in a){if("undefined"===r){delete a[r];continue}const u=a[r]=d.groupBy(a[r],g.gg.apiName);for(const _ in u)"undefined"!==_?u[_]=!0:delete u[_]}}return s}getPermissionMapFunctionsAndWSEventAndSysApis(t){const s={};for(const n of t||[])s[n._id]=!0;return s}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickGroups(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||o)(e.rXU(k.L),e.rXU(A.J),e.rXU(ie.a),e.rXU(re.h),e.rXU(le.g),e.rXU(w.f),e.rXU(j.m),e.rXU(O.$),e.rXU(N.l),e.rXU(F.X),e.rXU(ce.a),e.rXU(I.d),e.rXU(G.td))};static \u0275cmp=e.VBU({type:o,selectors:[["app-w-groups"]],viewQuery:function(s,n){if(1&s&&e.GBs(Ce,5),2&s){let a;e.mGM(a=e.lsd())&&(n.groupsFormC=a.first)}},decls:20,vars:11,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"],["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"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-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"],[3,"data"],["groupsFormC",""],["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"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-save text-success fa-fw cursor-pointer","pTooltip","Save group settings",3,"click",4,"ngIf"],["pTooltip","Save group settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"img",2),e.EFF(4," Groups"),e.k0s(),e.j41(5,"div",3)(6,"a",4),e.nrm(7,"img",5),e.k0s()(),e.j41(8,"span",6),e.bIt("click",function(){return n.add()}),e.nrm(9,"i",7),e.k0s(),e.DNE(10,Se,2,0,"span",8),e.DNE(11,ye,2,0,"span",9),e.DNE(12,_e,2,0,"span",10),e.k0s(),e.j41(13,"div",11)(14,"p-table",12),e.bIt("selectionChange",function(r){return n.selectedRows=r})("selectionChange",function(){return n.groupSelected()})("dblclick",function(){return n.dblClickGroups()}),e.DNE(15,be,4,0,"ng-template",13),e.DNE(16,Ge,5,3,"ng-template",14),e.k0s(),e.DNE(17,we,1,0,"p-progressSpinner",15),e.k0s()(),e.nrm(18,"app-w-groups-form",16,17)),2&s&&(e.R7$(10),e.Y8G("ngIf",n.selectedRows.length),e.R7$(1),e.Y8G("ngIf",n.selectedRows.length),e.R7$(1),e.Y8G("ngIf",n.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.R7$(3),e.Y8G("ngIf",n.loading.grid),e.R7$(1),e.Y8G("data",n.data))},dependencies:[R.bT,X.XI,G.Ei,X.d5,D.p,B.m,U]})}return o})();var Re=i(152),De=i(9861),Me=i(5430);function Ae(o,l){if(1&o&&(e.j41(0,"div")(1,"div",10),e.EFF(2),e.k0s()()),2&o){const t=e.XpG();e.R7$(2),e.JRh(t.constantsS.group.allFieldsPermitted)}}function Ne(o,l){if(1&o&&(e.j41(0,"span",18),e.EFF(1),e.k0s()),2&o){const t=e.XpG().$implicit;e.R7$(1),e.Lme(" [",t.instanceName.substr(0,3).toUpperCase(),"] [",t.databaseName.substr(0,3).toUpperCase(),"] ")}}function Fe(o,l){if(1&o){const t=e.RV6();e.j41(0,"span",19)(1,"label",20)(2,"p-checkbox",21),e.bIt("ngModelChange",function(n){e.eBV(t);const a=e.XpG().$implicit;return e.Njj(a.allowRead=n)})("click",function(n){e.eBV(t);const a=e.XpG().$implicit,r=e.XpG(2);return r.generalS.stopPropagation(n),e.Njj(r.removeDataItemFromSelectedRows(a))}),e.k0s()(),e.j41(3,"label",22)(4,"p-checkbox",23),e.bIt("ngModelChange",function(n){e.eBV(t);const a=e.XpG().$implicit;return e.Njj(a.allowWrite=n)})("click",function(n){e.eBV(t);const a=e.XpG().$implicit,r=e.XpG(2);return r.generalS.stopPropagation(n),e.Njj(r.removeDataItemFromSelectedRows(a))}),e.k0s()()()}if(2&o){const t=e.XpG().$implicit;e.R7$(2),e.Y8G("ngModel",t.allowRead)("binary",!0),e.R7$(2),e.Y8G("ngModel",t.allowWrite)("binary",!0)}}function Pe(o,l){if(1&o&&(e.j41(0,"div",15),e.EFF(1),e.DNE(2,Ne,2,2,"span",16),e.DNE(3,Fe,5,4,"span",17),e.k0s()),2&o){const t=l.$implicit,s=e.XpG(2);e.R7$(1),e.SpI(" ",t.label||t.name," "),e.R7$(1),e.Y8G("ngIf",t.level1),e.R7$(1),e.Y8G("ngIf",!t.level1&&(!t.children||0===t.children.length)&&s.selectedRows.indexOf(t)>=0)}}function Ee(o,l){1&o&&e.nrm(0,"p-progressSpinner",24)}function Te(o,l){if(1&o){const t=e.RV6();e.j41(0,"div",11)(1,"p-tree",12),e.bIt("selectionChange",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.selectedRows=n)})("selectionChange",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.checkedChange())})("onNodeSelect",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.nodeSelected(n))})("onNodeUnselect",function(n){e.eBV(t);const a=e.XpG();return e.Njj(a.nodeUnSelected(n))}),e.DNE(2,Pe,4,3,"ng-template",13),e.k0s(),e.DNE(3,Ee,1,0,"p-progressSpinner",14),e.k0s()}if(2&o){const t=e.XpG();e.R7$(1),e.Y8G("value",t.propertiesListData)("selection",t.selectedRows)("metaKeySelection",!1),e.R7$(2),e.Y8G("ngIf",t.loading.grid)}}let V=(()=>{class o{instanceS;eventCenterS;constantsS;generalS;loading={grid:!1};subscriptions=[];propertiesListData=[];allTreeItemsMap={};selectedRows=[];checkedKeysMap={};key="_id";constructor(t,s,n,a){this.instanceS=t,this.eventCenterS=s,this.constantsS=n,this.generalS=a}ngOnInit(){var t=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,Re.B)(300)).subscribe(function(){var s=(0,p.A)(function*(n){yield t.loadSchemas()});return function(n){return s.apply(this,arguments)}}()))}loadSchemas(){var t=this;return(0,p.A)(function*(){const s=t.eventCenterS.collection.selectedCollections.value;if(!s.length)return void(yield t.resetGridAndUrl());t.loading.grid=!0;const n=t.eventCenterS.group.selectedGroups.value[0];yield t.resetGridAndUrl(),t.allTreeItemsMap={};const a=(yield t.instanceS.getSchemas(s).toPromise()).data,r=[],u=[];for(const c of a){const f=[];if(c.propertyItems){const b=[];for(const P of c.propertyItems){const E=t.generalS.convertKTreeItemToPrimeNGTreeItem(P);t.setReadWriteRecursively(n,E),b.push(E),f.push(E)}u.push(b)}const S=c.instanceName+":"+c.databaseName+":"+c.collectionName,v={label:`${c.collectionName}`,children:f,_id:S,level1:!0,instanceName:c.instanceName,databaseName:c.databaseName,collectionName:c.collectionName};r.push(v),t.allTreeItemsMap[S]=v;for(const b of v?.children||[])b.parent=v}t.propertiesListData=r;for(const c of u)t.generateIdMap(c,t.allTreeItemsMap);if(t.eventCenterS.group.fields.value.join(",")){const c=d.intersection(d.keys(t.allTreeItemsMap),t.eventCenterS.group.fields.value);t.selectedRows=[];for(const f of c)t.allTreeItemsMap[f]&&t.selectedRows.push(t.allTreeItemsMap[f]);t.generalS.setDataInSelectedRowsFromIdArr(c,t.selectedRows,t.allTreeItemsMap),t.setDataInEventCenter()}t.loading.grid=!1})()}setReadWriteRecursively(t,s){const n=t?.fields?.[s.instanceName]?.[s.databaseName]?.[s.collectionName];if(!n)return;const a=n[s.path];if(a?(s.allowRead=a.allowRead,s.allowWrite=a.allowWrite):s.allowRead=s.allowWrite=!1,s.children&&s.children.length)for(const r of s.children)this.setReadWriteRecursively(t,r)}resetGridAndUrl(){var t=this;return(0,p.A)(function*(){t.propertiesListData=[],t.allTreeItemsMap={},t.selectedRows=[],t.checkedKeysMap={},t.eventCenterS.group.schemaFields.next([])})()}checkedChange(){this.setDataInEventCenter()}nodeSelected(t){t.node.allowRead=!0}nodeUnSelected(t){const s=t.node;s.allowRead=!1,s.allowWrite=!1}removeDataItemFromSelectedRows(t){if(!t.allowRead&&!t.allowWrite){const s=this.selectedRows.indexOf(t);s>=0&&this.selectedRows.splice(s,1)}}calculateCheckedKeysMap(){this.checkedKeysMap={};for(const t of this.selectedRows)this.checkedKeysMap[t._id]=t}setDataInEventCenter(){this.calculateCheckedKeysMap(),this.eventCenterS.group.fields.next(d.map(this.selectedRows,"_id"));const t=[];for(const s of this.selectedRows)this.allTreeItemsMap[s._id]&&t.push(s);this.eventCenterS.group.schemaFields.next(t)}generateIdMap(t,s){if(Array.isArray(t))for(const n of t)this.generateIdMap(n,s);else s[t._id]=t,t.children&&this.generateIdMap(t.children,s)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||o)(e.rXU(A.J),e.rXU(I.d),e.rXU(F.X),e.rXU(w.f))};static \u0275cmp=e.VBU({type:o,selectors:[["app-w-schema-fields"]],decls:12,vars:4,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-indent","text-success","fa-fw","mr-1"],["pTooltip","All Fields",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"card-body","p-0","h-100","overflow-hidden"],[1,"position-relative","border-top","h-100"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["scrollHeight","flex","selectionMode","checkbox",1,"w-full",3,"value","selection","metaKeySelection","selectionChange","onNodeSelect","onNodeUnselect"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"w-100","prevent-text-selection","cursor-pointer"],["class","text-monospace font-weight-bold font-italic float-right mr-1","style","font-size: xx-small;",4,"ngIf"],["class","float-right small mr-2",4,"ngIf"],[1,"text-monospace","font-weight-bold","font-italic","float-right","mr-1",2,"font-size","xx-small"],[1,"float-right","small","mr-2"],[1,"align-middle","mb-0","mr-2"],["label","R",3,"ngModel","binary","ngModelChange","click"],[1,"align-middle","mb-0"],["label","W",3,"ngModel","binary","ngModelChange","click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"i",2),e.EFF(4," Schema Fields"),e.k0s(),e.j41(5,"span",3)(6,"label",4)(7,"p-checkbox",5),e.bIt("ngModelChange",function(r){return n.eventCenterS.group.apisRegex.allFields=r}),e.k0s()()()(),e.j41(8,"div",6)(9,"div",7),e.DNE(10,Ae,3,1,"div",8),e.DNE(11,Te,4,4,"div",9),e.k0s()()()),2&s&&(e.R7$(7),e.Y8G("ngModel",n.eventCenterS.group.apisRegex.allFields)("binary",!0),e.R7$(3),e.Y8G("ngIf",n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields),e.R7$(1),e.Y8G("ngIf",!(n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields)))},dependencies:[h.BC,h.vS,R.bT,G.Ei,De.PH,D.p,B.m,Me.Sc],encapsulation:2})}return o})();function ke(o,l){1&o&&(e.j41(0,"div",21),e.nrm(1,"app-w-instances",10),e.k0s()),2&o&&(e.R7$(1),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function je(o,l){1&o&&(e.j41(0,"div",22),e.nrm(1,"app-w-databases",10),e.k0s()),2&o&&(e.R7$(1),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const Oe=function(){return[50,50]};let Y=(()=>{class o{eventCenterS;EAPICategory=M.O;constructor(t){this.eventCenterS=t}ngOnInit(){}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}static \u0275fac=function(s){return new(s||o)(e.rXU(I.d))};static \u0275cmp=e.VBU({type:o,selectors:[["app-group-layout"]],decls:34,vars:42,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-groups"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-schema-fields"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"]],template:function(s,n){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.nrm(4,"app-w-groups"),e.k0s()(),e.j41(5,"div",4)(6,"div",3),e.nrm(7,"app-w-api-categories",5),e.k0s()(),e.j41(8,"div",6)(9,"p-splitter",7),e.DNE(10,ke,2,3,"ng-template",8),e.DNE(11,je,2,3,"ng-template",8),e.k0s()(),e.j41(12,"div",9)(13,"div",3),e.nrm(14,"app-w-collections",10),e.k0s()(),e.j41(15,"div",11)(16,"div",3),e.nrm(17,"app-w-supported-api",12),e.k0s()(),e.j41(18,"div",13)(19,"div",3),e.nrm(20,"app-w-schema-fields"),e.k0s()(),e.j41(21,"div",14)(22,"div",3),e.nrm(23,"app-w-supported-tp-api",15),e.k0s()(),e.j41(24,"div",16)(25,"div",3),e.nrm(26,"app-custom-api-grid",17),e.k0s()(),e.j41(27,"div",18)(28,"div",3),e.nrm(29,"app-system-api-w",17),e.k0s()(),e.j41(30,"div",19)(31,"div",3),e.nrm(32,"app-web-socket-events-grid",20),e.k0s()()()(),e.nrm(33,"app-create-schema-form")),2&s&&(e.R7$(5),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.R7$(2),e.Y8G("typeIsGroup","GROUP"),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(1),e.Y8G("panelSizes",e.lJ4(41,Oe)),e.R7$(3),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(2),e.Y8G("isLPM",!1)("isDependentOnGroup",!0)("treeViewId","treeViewFromGroupLayout"),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.INSTANCES?"block":"none"),e.R7$(3),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.R7$(2),e.Y8G("IsDependentOnGroup",!0)("isLPM",!1),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.CUSTOM_APIS?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.SYSTEM_APIS?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.R7$(1),e.xc7("display",n.eventCenterS.group.selectedGroups.value.length&&(null==n.eventCenterS.apiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory||null==n.eventCenterS.apiCategory.selectedApiCategory.value||null==n.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:n.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===n.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.R7$(2),e.Y8G("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!1))},dependencies:[G.Ei,J.O,z._,H.o,Z.l,q.X,ee.d,te.i,ne.c,se.u,ae.e,oe.o,x,V],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-groups[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%], .w-schema-fields[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return o})();i(8150);var Ue=i(2818),xe=i(9036),Ve=i(807),Ye=i(5826),Ke=i(5493),We=i(863),Le=i(8389);const Qe=[{path:"group-layout",component:Y,canActivate:[L.Z]}];let Je=(()=>{class o{static \u0275fac=function(s){return new(s||o)};static \u0275mod=e.$C({type:o});static \u0275inj=e.G2t({imports:[K.iI.forChild(Qe),W.u,Ue.DashboardM,Ve.DbCellM,xe.FunctionManM,Ye.SystemApiM,Le.Q,Ke.I,We.e,Q.WebSocketEventsM]})}return o})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6589,8970,1351,3732],{6589:(l,o,c)=>{c.d(o,{Zm:()=>t,kK:()=>_,mO:()=>a,v$:()=>i});var t=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(t||{}),a=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(a||{}),i=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n.AM_WS_Client_ID="x-am-ws-client-id",n}(i||{}),_=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(_||{})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6589,8970,1351,3732],{6589:(l,o,c)=>{c.d(o,{Zm:()=>t,kK:()=>_,mO:()=>a,v$:()=>i});var t=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(t||{}),a=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(a||{}),i=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n.AM_WS_Client_ID="x-am-ws-client-id",n.RUN_IN_DEBUGGER="x-am-run-in-debugger",n}(i||{}),_=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(_||{})}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6679],{6679:(ht,m,a)=>{a.r(m),a.d(m,{VulnerabilityM:()=>st});var f=a(7060),h=a(563),j=a(7431),k=a(2173),t=a(540),r=a(467),T=a(7376),g=a(8727),x=a(5046),p=a(7326),v=a(6645),V=a(5632),S=a(1325),$=a(6129),b=a(6708),w=a(7337),I=a(7237),y=a(1987),G=a(3966),D=a(2396),_=a(6268),F=a(5779),X=a(5938),R=a(4341),c=a(177),u=a(7645),L=a(7515),U=a(1141),P=a(8542),J=a(8150);function Y(i,l){if(1&i){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.compress())}),t.nrm(1,"i",12),t.k0s()}}function N(i,l){if(1&i){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.expand())}),t.nrm(1,"i",13),t.k0s()}}function A(i,l){if(1&i){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.print())}),t.nrm(1,"i",14),t.k0s()}}const B=function(i){return{"text-danger font-weight-bold":i}},M=function(i){return{"text-warning font-weight-bold":i}};function O(i,l){if(1&i&&(t.j41(0,"div",15)(1,"div",16)(2,"div",17)(3,"table",18)(4,"tr")(5,"th",19),t.EFF(6,"Vulnerability Summary"),t.k0s()(),t.j41(7,"tr")(8,"td",20),t.EFF(9,"Critical"),t.k0s(),t.j41(10,"td",21),t.EFF(11),t.k0s()(),t.j41(12,"tr")(13,"td",22),t.EFF(14,"High"),t.k0s(),t.j41(15,"td",21),t.EFF(16),t.k0s()(),t.j41(17,"tr")(18,"td",22),t.EFF(19,"Moderate"),t.k0s(),t.j41(20,"td"),t.EFF(21),t.k0s()(),t.j41(22,"tr")(23,"td",22),t.EFF(24,"Info"),t.k0s(),t.j41(25,"td"),t.EFF(26),t.k0s()(),t.j41(27,"tr")(28,"td",22),t.EFF(29,"Low"),t.k0s(),t.j41(30,"td"),t.EFF(31),t.k0s()(),t.j41(32,"tr")(33,"td",22),t.EFF(34,"Total"),t.k0s(),t.j41(35,"td"),t.EFF(36),t.k0s()()()(),t.j41(37,"div",17)(38,"table",18)(39,"tr")(40,"th",19),t.EFF(41,"Dependency Summary"),t.k0s()(),t.j41(42,"tr")(43,"td",20),t.EFF(44,"Prod"),t.k0s(),t.j41(45,"td"),t.EFF(46),t.k0s()(),t.j41(47,"tr")(48,"td",22),t.EFF(49,"Dev"),t.k0s(),t.j41(50,"td"),t.EFF(51),t.k0s()(),t.j41(52,"tr")(53,"td",22),t.EFF(54,"Optional"),t.k0s(),t.j41(55,"td"),t.EFF(56),t.k0s()(),t.j41(57,"tr")(58,"td",22),t.EFF(59,"Peer"),t.k0s(),t.j41(60,"td"),t.EFF(61),t.k0s()(),t.j41(62,"tr")(63,"td",22),t.EFF(64,"Peer Optional"),t.k0s(),t.j41(65,"td"),t.EFF(66),t.k0s()(),t.j41(67,"tr")(68,"td",22),t.EFF(69,"Total"),t.k0s(),t.j41(70,"td"),t.EFF(71),t.k0s()()()()()()),2&i){const e=t.XpG();t.R7$(10),t.Y8G("ngClass",t.eq3(14,B,e.metadata.vulnerabilities.critical)),t.R7$(1),t.SpI(" ",e.metadata.vulnerabilities.critical||""," "),t.R7$(4),t.Y8G("ngClass",t.eq3(16,M,e.metadata.vulnerabilities.high)),t.R7$(1),t.SpI(" ",e.metadata.vulnerabilities.high||""," "),t.R7$(5),t.JRh(e.metadata.vulnerabilities.moderate||""),t.R7$(5),t.JRh(e.metadata.vulnerabilities.info||""),t.R7$(5),t.JRh(e.metadata.vulnerabilities.low||""),t.R7$(5),t.JRh(e.metadata.vulnerabilities.total||""),t.R7$(10),t.JRh(e.metadata.dependencies.prod||""),t.R7$(5),t.JRh(e.metadata.dependencies.dev||""),t.R7$(5),t.JRh(e.metadata.dependencies.optional||""),t.R7$(5),t.JRh(e.metadata.dependencies.peer||""),t.R7$(5),t.JRh(e.metadata.dependencies.peerOptional||""),t.R7$(5),t.JRh(e.metadata.dependencies.total||"")}}function K(i,l){1&i&&(t.j41(0,"tr"),t.nrm(1,"th",23)(2,"th",24),t.j41(3,"th",25),t.EFF(4,"Direct"),t.k0s(),t.j41(5,"th",26),t.EFF(6,"Severity"),t.k0s(),t.j41(7,"th",27),t.EFF(8,"Version"),t.k0s(),t.j41(9,"th"),t.EFF(10,"Package Name"),t.k0s(),t.j41(11,"th",27),t.EFF(12,"Fix"),t.k0s()())}function Q(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",33),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit;return t.Njj(n.expanded=!n.expanded)}),t.k0s()}if(2&i){const e=t.XpG().$implicit;t.Y8G("pRowToggler",e)("icon",e.expanded?"pi pi-chevron-down":"pi pi-chevron-right")}}function W(i,l){1&i&&t.nrm(0,"i",34)}function H(i,l){if(1&i&&(t.j41(0,"span")(1,"span",35),t.EFF(2),t.k0s(),t.j41(3,"span"),t.EFF(4," \u2192 "),t.k0s()()),2&i){const e=t.XpG(2).$implicit;t.R7$(1),t.Y8G("pTooltip",e.currentVersion+" = Current version"),t.R7$(1),t.JRh(e.currentVersion)}}function Z(i,l){if(1&i&&(t.j41(0,"span"),t.DNE(1,H,5,2,"span",32),t.j41(2,"span",35),t.EFF(3),t.k0s()()),2&i){const e=t.XpG().$implicit;t.R7$(1),t.Y8G("ngIf",e.currentVersion),t.R7$(1),t.Y8G("pTooltip",e.fixAvailable.version+" = Update to version"),t.R7$(1),t.JRh(e.fixAvailable.version)}}function z(i,l){if(1&i&&(t.j41(0,"a",47),t.nrm(1,"i",48),t.k0s()),2&i){const e=t.XpG().$implicit;t.Y8G("href",e.url,t.B4B)}}const q=function(){return[]};function tt(i,l){if(1&i&&(t.j41(0,"tr")(1,"th",45),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td",30),t.DNE(12,z,2,1,"a",46),t.k0s()()),2&i){const e=l.$implicit,s=l.index;t.R7$(2),t.JRh(s+1),t.R7$(2),t.JRh(e.severity),t.R7$(2),t.JRh(e.range),t.R7$(2),t.JRh((e.cwe||t.lJ4(6,q)).join(",")),t.R7$(2),t.JRh(e.title),t.R7$(2),t.Y8G("ngIf",e.url)}}function et(i,l){if(1&i&&(t.j41(0,"tr")(1,"td",36)(2,"table",37)(3,"thead")(4,"tr",38)(5,"th",39),t.EFF(6,"#"),t.k0s(),t.j41(7,"th",40),t.EFF(8,"Severity"),t.k0s(),t.j41(9,"th",41),t.EFF(10,"Range"),t.k0s(),t.j41(11,"th",41),t.EFF(12,"CWE"),t.k0s(),t.j41(13,"th",42),t.EFF(14,"Title"),t.k0s(),t.nrm(15,"th",43),t.k0s()(),t.j41(16,"tbody"),t.DNE(17,tt,13,7,"tr",44),t.k0s()()()()),2&i){const e=t.XpG().$implicit;t.R7$(17),t.Y8G("ngForOf",e.via)}}function it(i,l){if(1&i&&(t.j41(0,"tr",28)(1,"td"),t.DNE(2,Q,1,2,"button",29),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td",30),t.DNE(6,W,1,0,"i",31),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td"),t.EFF(12),t.k0s(),t.j41(13,"td"),t.DNE(14,Z,4,3,"span",32),t.k0s()(),t.DNE(15,et,18,1,"tr",32)),2&i){const e=l.$implicit,s=l.rowIndex;t.Y8G("pSelectableRow",e),t.R7$(2),t.Y8G("ngIf",null==e.via?null:e.via.length),t.R7$(2),t.JRh(s+1),t.R7$(2),t.Y8G("ngIf",e.isDirect),t.R7$(2),t.JRh(e.severity),t.R7$(2),t.JRh(e.range),t.R7$(2),t.JRh(e.name),t.R7$(2),t.Y8G("ngIf",e.fixAvailable),t.R7$(1),t.Y8G("ngIf",e.expanded)}}function nt(i,l){1&i&&t.nrm(0,"p-progressSpinner",49)}let C=(()=>{class i{generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;dataProviderService;cd;showCheckbox=!1;loading={grid:!1};subscriptions=[];data={mode:x.X.ADD,eventChannel:new t.bkB,formData:void 0};rows=[];metadata;rowsMap={};showAll=!1;EUserType=S.l;gridKey=v.GX._id;EAPICategory=V.O;selectedRows=[];vulnerabilityCategories;model={vulnerabilitiesType:null};constructor(e,s,n,o,d,lt,rt,ot,dt,pt,ct,ut,mt,ft){this.generalS=e,this.notificationS=s,this.navigationCS=n,this.authCS=o,this.constantsS=d,this.eventCenterS=lt,this.router=rt,this.userS=ot,this.instanceS=dt,this.ns=pt,this.cs=ct,this.confirmationService=ut,this.dataProviderService=mt,this.cd=ft}ngOnInit(){var e=this;return(0,r.A)(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 s=(0,r.A)(function*(n){(n.action===g.K.SAVED||n.action===g.K.UPDATED)&&(yield e.loadGridData())});return function(n){return s.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Vulnerabilities Report")})()}typeChanged(){var e=this;return(0,r.A)(function*(){yield e.loadGridData()})()}loadGridData(){var e=this;return(0,r.A)(function*(){e.loading.grid=!0;try{const s=yield e.instanceS.getVulnerabilities({type:e.model.vulnerabilitiesType.name});if(s){e.selectedRows=[];const n=s.data;e.rows=n.list||[];for(const o of e.rows)o._id=e.generalS.getRandomString(8);e.metadata=n.metadata,e.rowsMap=T.keyBy(e.rows,v.GX._id)}}catch(s){e.ns.showErrorFromResponse(s.error||s,"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.A)(function*(){e.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0),yield e.navigationCS.setQueryParam(p.F.am_vulnerability,null)})()}itemSelected(){var e=this;return(0,r.A)(function*(){yield e.resetThisUrl(),setTimeout(e.fillData.bind(e))})()}fillData(){var e=this;return(0,r.A)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.F.am_vulnerability,""),void e.eventCenterS.vulnerabilities.selectedVulnerability.next(null);const s=e.selectedRows[0];s?(yield e.navigationCS.setQueryParam(p.F.am_vulnerability,s._id),e.eventCenterS.vulnerabilities.selectedVulnerability.next(s)):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(s){return new(s||i)(t.rXU($.f),t.rXU(b.m),t.rXU(w.$),t.rXU(I.l),t.rXU(y.X),t.rXU(G.d),t.rXU(f.Ix),t.rXU(D.N),t.rXU(_.J),t.rXU(b.m),t.rXU(y.X),t.rXU(F.td),t.rXU(X.n),t.rXU(t.gRc))};static \u0275cmp=t.VBU({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(s,n){1&s&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"img",2),t.EFF(4," Vulnerabilities"),t.k0s(),t.j41(5,"span")(6,"p-dropdown",3),t.bIt("onChange",function(d){return n.model.vulnerabilitiesType=d.value,n.typeChanged()}),t.k0s()(),t.DNE(7,Y,2,0,"span",4),t.DNE(8,N,2,0,"span",4),t.DNE(9,A,2,0,"span",4),t.k0s(),t.j41(10,"div",5),t.DNE(11,O,72,18,"div",6),t.j41(12,"p-table",7),t.bIt("selectionChange",function(d){return n.selectedRows=d})("selectionChange",function(){return n.itemSelected()}),t.DNE(13,K,13,0,"ng-template",8),t.DNE(14,it,16,9,"ng-template",9),t.k0s(),t.DNE(15,nt,1,0,"p-progressSpinner",10),t.k0s()()),2&s&&(t.R7$(6),t.Y8G("options",n.vulnerabilityCategories)("ngModel",n.model.vulnerabilitiesType)("filter",!0),t.R7$(1),t.Y8G("ngIf",n.rows.length),t.R7$(1),t.Y8G("ngIf",n.rows.length),t.R7$(1),t.Y8G("ngIf",n.rows.length),t.R7$(2),t.Y8G("ngIf",null==n.metadata||null==n.metadata.vulnerabilities?null:n.metadata.vulnerabilities.total),t.R7$(1),t.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.R7$(3),t.Y8G("ngIf",n.loading.grid))},dependencies:[R.BC,R.vS,c.YU,c.Sq,c.bT,u.XI,F.Ei,u.d5,u.FP,L.p,U._f,P.m,J.ms,h.n],encapsulation:2,changeDetection:0})}return i})();const at=[{path:"layout",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=t.VBU({type:i,selectors:[["app-vulnerability-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(s,n){1&s&&(t.j41(0,"div",0),t.nrm(1,"app-vulnerability-list"),t.k0s())},dependencies:[C],encapsulation:2})}return i})(),canActivate:[k.Z]}];let st=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=t.$C({type:i});static \u0275inj=t.G2t({imports:[f.iI.forChild(at),j.u,h.Z]})}return i})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6679],{6679:(ht,m,a)=>{a.r(m),a.d(m,{VulnerabilityM:()=>st});var f=a(7060),h=a(563),j=a(1709),k=a(2173),t=a(540),r=a(467),T=a(7376),g=a(8727),x=a(5046),p=a(7326),v=a(6645),V=a(5632),S=a(1325),$=a(6129),b=a(6708),w=a(7337),I=a(7237),y=a(1987),G=a(3966),D=a(2396),_=a(6268),F=a(5779),X=a(5938),R=a(4341),c=a(177),u=a(7645),L=a(7515),U=a(1141),P=a(8542),J=a(8150);function Y(i,l){if(1&i){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.compress())}),t.nrm(1,"i",12),t.k0s()}}function N(i,l){if(1&i){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.expand())}),t.nrm(1,"i",13),t.k0s()}}function A(i,l){if(1&i){const e=t.RV6();t.j41(0,"span",11),t.bIt("click",function(){t.eBV(e);const n=t.XpG();return t.Njj(n.print())}),t.nrm(1,"i",14),t.k0s()}}const B=function(i){return{"text-danger font-weight-bold":i}},M=function(i){return{"text-warning font-weight-bold":i}};function O(i,l){if(1&i&&(t.j41(0,"div",15)(1,"div",16)(2,"div",17)(3,"table",18)(4,"tr")(5,"th",19),t.EFF(6,"Vulnerability Summary"),t.k0s()(),t.j41(7,"tr")(8,"td",20),t.EFF(9,"Critical"),t.k0s(),t.j41(10,"td",21),t.EFF(11),t.k0s()(),t.j41(12,"tr")(13,"td",22),t.EFF(14,"High"),t.k0s(),t.j41(15,"td",21),t.EFF(16),t.k0s()(),t.j41(17,"tr")(18,"td",22),t.EFF(19,"Moderate"),t.k0s(),t.j41(20,"td"),t.EFF(21),t.k0s()(),t.j41(22,"tr")(23,"td",22),t.EFF(24,"Info"),t.k0s(),t.j41(25,"td"),t.EFF(26),t.k0s()(),t.j41(27,"tr")(28,"td",22),t.EFF(29,"Low"),t.k0s(),t.j41(30,"td"),t.EFF(31),t.k0s()(),t.j41(32,"tr")(33,"td",22),t.EFF(34,"Total"),t.k0s(),t.j41(35,"td"),t.EFF(36),t.k0s()()()(),t.j41(37,"div",17)(38,"table",18)(39,"tr")(40,"th",19),t.EFF(41,"Dependency Summary"),t.k0s()(),t.j41(42,"tr")(43,"td",20),t.EFF(44,"Prod"),t.k0s(),t.j41(45,"td"),t.EFF(46),t.k0s()(),t.j41(47,"tr")(48,"td",22),t.EFF(49,"Dev"),t.k0s(),t.j41(50,"td"),t.EFF(51),t.k0s()(),t.j41(52,"tr")(53,"td",22),t.EFF(54,"Optional"),t.k0s(),t.j41(55,"td"),t.EFF(56),t.k0s()(),t.j41(57,"tr")(58,"td",22),t.EFF(59,"Peer"),t.k0s(),t.j41(60,"td"),t.EFF(61),t.k0s()(),t.j41(62,"tr")(63,"td",22),t.EFF(64,"Peer Optional"),t.k0s(),t.j41(65,"td"),t.EFF(66),t.k0s()(),t.j41(67,"tr")(68,"td",22),t.EFF(69,"Total"),t.k0s(),t.j41(70,"td"),t.EFF(71),t.k0s()()()()()()),2&i){const e=t.XpG();t.R7$(10),t.Y8G("ngClass",t.eq3(14,B,e.metadata.vulnerabilities.critical)),t.R7$(1),t.SpI(" ",e.metadata.vulnerabilities.critical||""," "),t.R7$(4),t.Y8G("ngClass",t.eq3(16,M,e.metadata.vulnerabilities.high)),t.R7$(1),t.SpI(" ",e.metadata.vulnerabilities.high||""," "),t.R7$(5),t.JRh(e.metadata.vulnerabilities.moderate||""),t.R7$(5),t.JRh(e.metadata.vulnerabilities.info||""),t.R7$(5),t.JRh(e.metadata.vulnerabilities.low||""),t.R7$(5),t.JRh(e.metadata.vulnerabilities.total||""),t.R7$(10),t.JRh(e.metadata.dependencies.prod||""),t.R7$(5),t.JRh(e.metadata.dependencies.dev||""),t.R7$(5),t.JRh(e.metadata.dependencies.optional||""),t.R7$(5),t.JRh(e.metadata.dependencies.peer||""),t.R7$(5),t.JRh(e.metadata.dependencies.peerOptional||""),t.R7$(5),t.JRh(e.metadata.dependencies.total||"")}}function K(i,l){1&i&&(t.j41(0,"tr"),t.nrm(1,"th",23)(2,"th",24),t.j41(3,"th",25),t.EFF(4,"Direct"),t.k0s(),t.j41(5,"th",26),t.EFF(6,"Severity"),t.k0s(),t.j41(7,"th",27),t.EFF(8,"Version"),t.k0s(),t.j41(9,"th"),t.EFF(10,"Package Name"),t.k0s(),t.j41(11,"th",27),t.EFF(12,"Fix"),t.k0s()())}function Q(i,l){if(1&i){const e=t.RV6();t.j41(0,"button",33),t.bIt("click",function(){t.eBV(e);const n=t.XpG().$implicit;return t.Njj(n.expanded=!n.expanded)}),t.k0s()}if(2&i){const e=t.XpG().$implicit;t.Y8G("pRowToggler",e)("icon",e.expanded?"pi pi-chevron-down":"pi pi-chevron-right")}}function W(i,l){1&i&&t.nrm(0,"i",34)}function H(i,l){if(1&i&&(t.j41(0,"span")(1,"span",35),t.EFF(2),t.k0s(),t.j41(3,"span"),t.EFF(4," \u2192 "),t.k0s()()),2&i){const e=t.XpG(2).$implicit;t.R7$(1),t.Y8G("pTooltip",e.currentVersion+" = Current version"),t.R7$(1),t.JRh(e.currentVersion)}}function Z(i,l){if(1&i&&(t.j41(0,"span"),t.DNE(1,H,5,2,"span",32),t.j41(2,"span",35),t.EFF(3),t.k0s()()),2&i){const e=t.XpG().$implicit;t.R7$(1),t.Y8G("ngIf",e.currentVersion),t.R7$(1),t.Y8G("pTooltip",e.fixAvailable.version+" = Update to version"),t.R7$(1),t.JRh(e.fixAvailable.version)}}function z(i,l){if(1&i&&(t.j41(0,"a",47),t.nrm(1,"i",48),t.k0s()),2&i){const e=t.XpG().$implicit;t.Y8G("href",e.url,t.B4B)}}const q=function(){return[]};function tt(i,l){if(1&i&&(t.j41(0,"tr")(1,"th",45),t.EFF(2),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td"),t.EFF(6),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td",30),t.DNE(12,z,2,1,"a",46),t.k0s()()),2&i){const e=l.$implicit,s=l.index;t.R7$(2),t.JRh(s+1),t.R7$(2),t.JRh(e.severity),t.R7$(2),t.JRh(e.range),t.R7$(2),t.JRh((e.cwe||t.lJ4(6,q)).join(",")),t.R7$(2),t.JRh(e.title),t.R7$(2),t.Y8G("ngIf",e.url)}}function et(i,l){if(1&i&&(t.j41(0,"tr")(1,"td",36)(2,"table",37)(3,"thead")(4,"tr",38)(5,"th",39),t.EFF(6,"#"),t.k0s(),t.j41(7,"th",40),t.EFF(8,"Severity"),t.k0s(),t.j41(9,"th",41),t.EFF(10,"Range"),t.k0s(),t.j41(11,"th",41),t.EFF(12,"CWE"),t.k0s(),t.j41(13,"th",42),t.EFF(14,"Title"),t.k0s(),t.nrm(15,"th",43),t.k0s()(),t.j41(16,"tbody"),t.DNE(17,tt,13,7,"tr",44),t.k0s()()()()),2&i){const e=t.XpG().$implicit;t.R7$(17),t.Y8G("ngForOf",e.via)}}function it(i,l){if(1&i&&(t.j41(0,"tr",28)(1,"td"),t.DNE(2,Q,1,2,"button",29),t.k0s(),t.j41(3,"td"),t.EFF(4),t.k0s(),t.j41(5,"td",30),t.DNE(6,W,1,0,"i",31),t.k0s(),t.j41(7,"td"),t.EFF(8),t.k0s(),t.j41(9,"td"),t.EFF(10),t.k0s(),t.j41(11,"td"),t.EFF(12),t.k0s(),t.j41(13,"td"),t.DNE(14,Z,4,3,"span",32),t.k0s()(),t.DNE(15,et,18,1,"tr",32)),2&i){const e=l.$implicit,s=l.rowIndex;t.Y8G("pSelectableRow",e),t.R7$(2),t.Y8G("ngIf",null==e.via?null:e.via.length),t.R7$(2),t.JRh(s+1),t.R7$(2),t.Y8G("ngIf",e.isDirect),t.R7$(2),t.JRh(e.severity),t.R7$(2),t.JRh(e.range),t.R7$(2),t.JRh(e.name),t.R7$(2),t.Y8G("ngIf",e.fixAvailable),t.R7$(1),t.Y8G("ngIf",e.expanded)}}function nt(i,l){1&i&&t.nrm(0,"p-progressSpinner",49)}let C=(()=>{class i{generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;dataProviderService;cd;showCheckbox=!1;loading={grid:!1};subscriptions=[];data={mode:x.X.ADD,eventChannel:new t.bkB,formData:void 0};rows=[];metadata;rowsMap={};showAll=!1;EUserType=S.l;gridKey=v.GX._id;EAPICategory=V.O;selectedRows=[];vulnerabilityCategories;model={vulnerabilitiesType:null};constructor(e,s,n,o,d,lt,rt,ot,dt,pt,ct,ut,mt,ft){this.generalS=e,this.notificationS=s,this.navigationCS=n,this.authCS=o,this.constantsS=d,this.eventCenterS=lt,this.router=rt,this.userS=ot,this.instanceS=dt,this.ns=pt,this.cs=ct,this.confirmationService=ut,this.dataProviderService=mt,this.cd=ft}ngOnInit(){var e=this;return(0,r.A)(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 s=(0,r.A)(function*(n){(n.action===g.K.SAVED||n.action===g.K.UPDATED)&&(yield e.loadGridData())});return function(n){return s.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Vulnerabilities Report")})()}typeChanged(){var e=this;return(0,r.A)(function*(){yield e.loadGridData()})()}loadGridData(){var e=this;return(0,r.A)(function*(){e.loading.grid=!0;try{const s=yield e.instanceS.getVulnerabilities({type:e.model.vulnerabilitiesType.name});if(s){e.selectedRows=[];const n=s.data;e.rows=n.list||[];for(const o of e.rows)o._id=e.generalS.getRandomString(8);e.metadata=n.metadata,e.rowsMap=T.keyBy(e.rows,v.GX._id)}}catch(s){e.ns.showErrorFromResponse(s.error||s,"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.A)(function*(){e.eventCenterS.vulnerabilities.selectedVulnerability.next(void 0),yield e.navigationCS.setQueryParam(p.F.am_vulnerability,null)})()}itemSelected(){var e=this;return(0,r.A)(function*(){yield e.resetThisUrl(),setTimeout(e.fillData.bind(e))})()}fillData(){var e=this;return(0,r.A)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.F.am_vulnerability,""),void e.eventCenterS.vulnerabilities.selectedVulnerability.next(null);const s=e.selectedRows[0];s?(yield e.navigationCS.setQueryParam(p.F.am_vulnerability,s._id),e.eventCenterS.vulnerabilities.selectedVulnerability.next(s)):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(s){return new(s||i)(t.rXU($.f),t.rXU(b.m),t.rXU(w.$),t.rXU(I.l),t.rXU(y.X),t.rXU(G.d),t.rXU(f.Ix),t.rXU(D.N),t.rXU(_.J),t.rXU(b.m),t.rXU(y.X),t.rXU(F.td),t.rXU(X.n),t.rXU(t.gRc))};static \u0275cmp=t.VBU({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(s,n){1&s&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"img",2),t.EFF(4," Vulnerabilities"),t.k0s(),t.j41(5,"span")(6,"p-dropdown",3),t.bIt("onChange",function(d){return n.model.vulnerabilitiesType=d.value,n.typeChanged()}),t.k0s()(),t.DNE(7,Y,2,0,"span",4),t.DNE(8,N,2,0,"span",4),t.DNE(9,A,2,0,"span",4),t.k0s(),t.j41(10,"div",5),t.DNE(11,O,72,18,"div",6),t.j41(12,"p-table",7),t.bIt("selectionChange",function(d){return n.selectedRows=d})("selectionChange",function(){return n.itemSelected()}),t.DNE(13,K,13,0,"ng-template",8),t.DNE(14,it,16,9,"ng-template",9),t.k0s(),t.DNE(15,nt,1,0,"p-progressSpinner",10),t.k0s()()),2&s&&(t.R7$(6),t.Y8G("options",n.vulnerabilityCategories)("ngModel",n.model.vulnerabilitiesType)("filter",!0),t.R7$(1),t.Y8G("ngIf",n.rows.length),t.R7$(1),t.Y8G("ngIf",n.rows.length),t.R7$(1),t.Y8G("ngIf",n.rows.length),t.R7$(2),t.Y8G("ngIf",null==n.metadata||null==n.metadata.vulnerabilities?null:n.metadata.vulnerabilities.total),t.R7$(1),t.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.R7$(3),t.Y8G("ngIf",n.loading.grid))},dependencies:[R.BC,R.vS,c.YU,c.Sq,c.bT,u.XI,F.Ei,u.d5,u.FP,L.p,U._f,P.m,J.ms,h.n],encapsulation:2,changeDetection:0})}return i})();const at=[{path:"layout",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||i)};static \u0275cmp=t.VBU({type:i,selectors:[["app-vulnerability-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(s,n){1&s&&(t.j41(0,"div",0),t.nrm(1,"app-vulnerability-list"),t.k0s())},dependencies:[C],encapsulation:2})}return i})(),canActivate:[k.Z]}];let st=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=t.$C({type:i});static \u0275inj=t.G2t({imports:[f.iI.forChild(at),j.u,h.Z]})}return i})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6828],{6828:(A,d,a)=>{a.r(d),a.d(d,{CodeComparatorModelM:()=>y});var m=a(7060),c=a(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6828],{6828:(A,d,a)=>{a.r(d),a.d(d,{CodeComparatorModelM:()=>y});var m=a(7060),c=a(1709),s=a(467),t=a(540),p=a(177),l=a(6914),f=a(7515);const C=["editorSchemaNative"];function u(e,G){1&e&&t.nrm(0,"p-progressSpinner",7)}const g=[{path:"",component:(()=>{class e{cd;loading={form:!1};editorOptionsAnalysis={readOnly:!1,language:"typescript",contextmenu:!1};rows=[];rowsMap={};editorSchemaNative;editorAnalysis;constructor(o){this.cd=o}ngOnInit(){var o=this;return(0,s.A)(function*(){setTimeout((0,s.A)(function*(){yield o.compareData()}),500)})()}compareData(){var o=this;return(0,s.A)(function*(){o.loading.form=!0,o.editorSchemaNative.initDiffEditor("","","typescript",!0,!1),o.loading.form=!1,o.cd.detectChanges()})()}static \u0275fac=function(r){return new(r||e)(t.rXU(t.gRc))};static \u0275cmp=t.VBU({type:e,selectors:[["app-code-comparator-model"]],viewQuery:function(r,n){if(1&r&&t.GBs(C,5),2&r){let i;t.mGM(i=t.lsd())&&(n.editorSchemaNative=i.first)}},decls:9,vars:2,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/comparator.svg","alt","Code Comparator",1,"fa-fw","mr-1"],[1,"full-body","p-0","overflow-hidden"],[3,"editorOptions","editorGenerated"],["editorSchemaNative",""],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,n){1&r&&(t.j41(0,"div",0)(1,"div",1)(2,"span"),t.nrm(3,"img",2),t.EFF(4," Code Comparator"),t.k0s()(),t.j41(5,"div",3)(6,"app-monaco-editor",4,5),t.bIt("editorGenerated",function(M){return n.editorAnalysis=M}),t.k0s(),t.DNE(8,u,1,0,"p-progressSpinner",6),t.k0s()()),2&r&&(t.R7$(6),t.Y8G("editorOptions",n.editorOptionsAnalysis),t.R7$(2),t.Y8G("ngIf",n.loading.form))},dependencies:[p.bT,l.A,f.p],encapsulation:2})}return e})(),canActivate:[a(2173).Z]}];let y=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=t.$C({type:e});static \u0275inj=t.G2t({imports:[m.iI.forChild(g),c.u]})}return e})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6866],{6866:(ae,v,r)=>{r.r(v),r.d(v,{AdminUserM:()=>te});var R=r(7060),T=r(7431),e=r(540),c=r(467),m=r(8727),f=r(5046),p=r(7326),M=r(7376),u=r(1325),h=r(6645),C=r(2396),F=r(6129),y=r(6708),U=r(5779),_=r(7337),E=r(9992),P=r(3966),D=r(177),S=r(7645),w=r(7515),N=r(8542),o=r(4341),b=r(5312),j=r(7237),G=r(3478);function X(n,l){1&n&&(e.j41(0,"span"),e.nrm(1,"i",22),e.EFF(2," Add User"),e.k0s())}function V(n,l){1&n&&(e.j41(0,"span"),e.nrm(1,"i",23),e.EFF(2," View User"),e.k0s())}function O(n,l){1&n&&(e.j41(0,"span"),e.nrm(1,"i",24),e.EFF(2," Edit User"),e.k0s())}function x(n,l){1&n&&(e.j41(0,"div",10)(1,"label",11),e.EFF(2,"Password"),e.k0s(),e.j41(3,"div",12),e.nrm(4,"input",25),e.k0s()())}function K(n,l){1&n&&(e.j41(0,"span"),e.EFF(1,"Save User"),e.k0s())}function Y(n,l){1&n&&(e.j41(0,"span"),e.EFF(1,"Update User"),e.k0s())}function B(n,l){if(1&n){const t=e.RV6();e.j41(0,"button",26),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.save())}),e.nrm(1,"i",27),e.DNE(2,K,2,0,"span",4),e.DNE(3,Y,2,0,"span",4),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("disabled",t.form.invalid),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function W(n,l){1&n&&e.nrm(0,"p-progressSpinner",28)}let A=(()=>{class n{fb;ns;userS;generalS;constantsCS;authCS;data;loading={form:!1};EFormMode=f.X;form;subscriptions=[];constructor(t,s,a,i,d,g){this.fb=t,this.ns=s,this.userS=a,this.generalS=i,this.constantsCS=d,this.authCS=g}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,c.A)(function*(a){if(a)if(t.form.enable(),a.action===m.K.OPEN_FORM_IN_EDIT_MODE){const i=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(i.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(a.action===m.K.OPEN_FORM_IN_VIEW_MODE){const i=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(i.data),t.form.disable()}else a.action===m.K.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([o.k0.required,o.k0.minLength(4),o.k0.maxLength(40)]),t.form.get("password").updateValueAndValidity())});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[o.k0.required]],email:[null,[o.k0.required,o.k0.email]],apiPath:[null,[o.k0.required,o.k0.minLength(3),o.k0.maxLength(25),o.k0.pattern("[a-z0-9]*")]],password:[null,[]]})}showModal(){$("#idAMUsersForm").modal("show")}hideModal(){$("#idAMUsersForm").modal("hide")}save(){var t=this;return(0,c.A)(function*(){const s=t.form.getRawValue();s.user=t.authCS.getUserId(),s.userType=u.l.ADMIN;try{let a;t.loading.form=!0,t.data.mode===f.X.ADD?(s.password=t.generalS.getEncryptedString(s.password,b.c.crypto.passCommunication),a=yield t.userS.post(s).toPromise(),t.ns.showSuccess(t.constantsCS.user.addSuccess)):t.data.mode===f.X.EDIT&&(t.data.formData._id&&(s.userType=t.data.formData.userType,t.form.get("password").value?s.password=t.generalS.getEncryptedString(s.password,b.c.crypto.passCommunication):delete s.password),a=yield t.userS.put(t.data.formData._id,s,{select:h.GX._id}).toPromise(),t.ns.showSuccess(t.constantsCS.user.editSuccess)),t.data.eventChannel.emit({action:t.data.mode===f.X.ADD?m.K.SAVED:m.K.UPDATED}),t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save user info.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.rXU(o.ok),e.rXU(y.m),e.rXU(C.N),e.rXU(F.f),e.rXU(E.s),e.rXU(j.l))};static \u0275cmp=e.VBU({type:n,selectors:[["app-w-admin-user-form"]],inputs:{data:"data"},decls:34,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMUsersForm","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"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide api path",1,"form-control","text-lowercase","form-control-sm"],[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(s,a){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,X,3,0,"span",4),e.DNE(5,V,3,0,"span",4),e.DNE(6,O,3,0,"span",4),e.j41(7,"button",5)(8,"span",6),e.nrm(9,"i",7),e.k0s()()(),e.j41(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e.EFF(14,"Name"),e.k0s(),e.j41(15,"div",12),e.nrm(16,"input",13),e.k0s()(),e.j41(17,"div",10)(18,"label",11),e.EFF(19,"Email"),e.k0s(),e.j41(20,"div",12),e.nrm(21,"input",14),e.k0s()(),e.DNE(22,x,5,0,"div",15),e.j41(23,"div",10)(24,"label",11),e.EFF(25,"API Path"),e.k0s(),e.j41(26,"div",12),e.nrm(27,"input",16),e.k0s()()()(),e.j41(28,"div",17)(29,"button",18),e.nrm(30,"i",19),e.EFF(31," Close"),e.k0s(),e.DNE(32,B,4,3,"button",20),e.k0s(),e.DNE(33,W,1,0,"p-progressSpinner",21),e.k0s()()()),2&s&&(e.R7$(4),e.Y8G("ngIf",a.data.mode===a.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",a.data.mode===a.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",a.data.mode===a.EFormMode.EDIT),e.R7$(5),e.Y8G("formGroup",a.form),e.R7$(11),e.Y8G("ngIf",a.data.mode!==a.EFormMode.VIEW),e.R7$(10),e.Y8G("ngIf",a.data.mode!==a.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",a.loading.form))},dependencies:[o.qT,o.me,o.BC,o.cb,o.j4,o.JD,D.bT,G.U,w.p],encapsulation:2})}return n})();const L=["adminUserFormC"];function Q(n,l){if(1&n){const t=e.RV6();e.j41(0,"span",14),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.edit())}),e.nrm(1,"i",15),e.k0s()}}function J(n,l){if(1&n){const t=e.RV6();e.j41(0,"span",16),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.removePermanentDialog())}),e.nrm(1,"i",17),e.k0s()}}function z(n,l){1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Name"),e.k0s(),e.j41(3,"th"),e.EFF(4,"Email"),e.k0s(),e.j41(5,"th"),e.EFF(6,"API Path"),e.k0s()())}function H(n,l){if(1&n&&(e.j41(0,"tr",18)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s()()),2&n){const t=l.$implicit;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t.name),e.R7$(2),e.JRh(t.email),e.R7$(2),e.JRh(t.apiPath)}}function Z(n,l){1&n&&e.nrm(0,"p-progressSpinner",19)}let k=(()=>{class n{userS;generalS;notificationS;confirmationService;navigationCS;constantsCS;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:f.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=h.GX._id;adminUserFormC;constructor(t,s,a,i,d,g,se){this.userS=t,this.generalS=s,this.notificationS=a,this.confirmationService=i,this.navigationCS=d,this.constantsCS=g,this.eventCenterS=se}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===m.K.SAVED||t.action===m.K.UPDATED)&&(this.adminUserFormC.hideModal(),this.loadGridData())}))}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{active:!0,userType:{$in:[u.l.ROOT,u.l.ADMIN]}},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.userS.query(s).subscribe(function(){var a=(0,c.A)(function*(i){i.success&&(t.selectedRows=[],t.rows=i.data,t.rowsMap=M.keyBy(t.rows,h.GX._id));const d=t.navigationCS.getQueryParam(p.F.user);t.rowsMap[d]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[d]]),t.selectedRows=[t.rowsMap[d]],yield t.fillData()),t.loading.grid=!1});return function(i){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=f.X.ADD,this.data.eventChannel.emit({action:m.K.OPEN_FORM_IN_ADD_MODE}),this.adminUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=f.X.VIEW,this.data.eventChannel.emit({action:m.K.OPEN_FORM_IN_VIEW_MODE}),this.adminUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=f.X.EDIT,this.data.eventChannel.emit({action:m.K.OPEN_FORM_IN_EDIT_MODE}),this.adminUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,c.A)(function*(){var s;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.A)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.A)(function*(){t.loading.grid=!0;const s=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,c.A)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(p.F.user,null)})()}adminUserSelected(t){var s=this;return(0,c.A)(function*(){s.selectedRows=t,s.resetDependents(),s.fillData()})()}fillData(){var t=this;return(0,c.A)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(p.F.user,""),void t.eventCenterS.user.selectedUsers.next([]);const s=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?(yield t.navigationCS.setQueryParam(p.F.user,s._id),t.eventCenterS.user.selectedUsers.next([s])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.rXU(C.N),e.rXU(F.f),e.rXU(y.m),e.rXU(U.td),e.rXU(_.$),e.rXU(E.s),e.rXU(P.d))};static \u0275cmp=e.VBU({type:n,selectors:[["app-w-admin-users"]],viewQuery:function(s,a){if(1&s&&e.GBs(L,5),2&s){let i;e.mGM(i=e.lsd())&&(a.adminUserFormC=i.first)}},decls:16,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-users","text-info","fa-fw","mr-1"],["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","Make Inactive",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 94px)",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"],["adminUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Make Inactive",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(s,a){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"i",2),e.EFF(4," Users"),e.k0s(),e.j41(5,"span",3),e.bIt("click",function(){return a.add()}),e.nrm(6,"i",4),e.k0s(),e.DNE(7,Q,2,0,"span",5),e.DNE(8,J,2,0,"span",6),e.k0s(),e.j41(9,"div",7)(10,"p-table",8),e.bIt("selectionChange",function(d){return a.selectedRows=d})("dblclick",function(){return a.dblClickUsers()})("selectionChange",function(d){return a.adminUserSelected(d)}),e.DNE(11,z,7,0,"ng-template",9),e.DNE(12,H,7,4,"ng-template",10),e.k0s(),e.DNE(13,Z,1,0,"p-progressSpinner",11),e.k0s()(),e.nrm(14,"app-w-admin-user-form",12,13)),2&s&&(e.R7$(7),e.Y8G("ngIf",a.selectedRows.length),e.R7$(1),e.Y8G("ngIf",a.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.R7$(3),e.Y8G("ngIf",a.loading.grid),e.R7$(1),e.Y8G("data",a.data))},dependencies:[D.bT,S.XI,U.Ei,S.d5,w.p,N.m,A],encapsulation:2})}return n})();const ee=[{path:"",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-admin-user-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"],[1,"w-100"]],template:function(s,a){1&s&&(e.j41(0,"div",0),e.nrm(1,"app-w-admin-users",1),e.k0s())},dependencies:[k],encapsulation:2})}return n})(),canActivate:[r(7358).k]}];let te=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[R.iI.forChild(ee),T.u]})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6866],{6866:(ae,v,r)=>{r.r(v),r.d(v,{AdminUserM:()=>te});var R=r(7060),T=r(1709),e=r(540),c=r(467),m=r(8727),f=r(5046),p=r(7326),M=r(7376),u=r(1325),h=r(6645),C=r(2396),F=r(6129),y=r(6708),U=r(5779),_=r(7337),E=r(9992),P=r(3966),D=r(177),S=r(7645),w=r(7515),N=r(8542),o=r(4341),b=r(5312),j=r(7237),G=r(3478);function X(n,l){1&n&&(e.j41(0,"span"),e.nrm(1,"i",22),e.EFF(2," Add User"),e.k0s())}function V(n,l){1&n&&(e.j41(0,"span"),e.nrm(1,"i",23),e.EFF(2," View User"),e.k0s())}function O(n,l){1&n&&(e.j41(0,"span"),e.nrm(1,"i",24),e.EFF(2," Edit User"),e.k0s())}function x(n,l){1&n&&(e.j41(0,"div",10)(1,"label",11),e.EFF(2,"Password"),e.k0s(),e.j41(3,"div",12),e.nrm(4,"input",25),e.k0s()())}function K(n,l){1&n&&(e.j41(0,"span"),e.EFF(1,"Save User"),e.k0s())}function Y(n,l){1&n&&(e.j41(0,"span"),e.EFF(1,"Update User"),e.k0s())}function B(n,l){if(1&n){const t=e.RV6();e.j41(0,"button",26),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.save())}),e.nrm(1,"i",27),e.DNE(2,K,2,0,"span",4),e.DNE(3,Y,2,0,"span",4),e.k0s()}if(2&n){const t=e.XpG();e.Y8G("disabled",t.form.invalid),e.R7$(2),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT)}}function W(n,l){1&n&&e.nrm(0,"p-progressSpinner",28)}let A=(()=>{class n{fb;ns;userS;generalS;constantsCS;authCS;data;loading={form:!1};EFormMode=f.X;form;subscriptions=[];constructor(t,s,a,i,d,g){this.fb=t,this.ns=s,this.userS=a,this.generalS=i,this.constantsCS=d,this.authCS=g}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,c.A)(function*(a){if(a)if(t.form.enable(),a.action===m.K.OPEN_FORM_IN_EDIT_MODE){const i=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(i.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(a.action===m.K.OPEN_FORM_IN_VIEW_MODE){const i=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(i.data),t.form.disable()}else a.action===m.K.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([o.k0.required,o.k0.minLength(4),o.k0.maxLength(40)]),t.form.get("password").updateValueAndValidity())});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[o.k0.required]],email:[null,[o.k0.required,o.k0.email]],apiPath:[null,[o.k0.required,o.k0.minLength(3),o.k0.maxLength(25),o.k0.pattern("[a-z0-9]*")]],password:[null,[]]})}showModal(){$("#idAMUsersForm").modal("show")}hideModal(){$("#idAMUsersForm").modal("hide")}save(){var t=this;return(0,c.A)(function*(){const s=t.form.getRawValue();s.user=t.authCS.getUserId(),s.userType=u.l.ADMIN;try{let a;t.loading.form=!0,t.data.mode===f.X.ADD?(s.password=t.generalS.getEncryptedString(s.password,b.c.crypto.passCommunication),a=yield t.userS.post(s).toPromise(),t.ns.showSuccess(t.constantsCS.user.addSuccess)):t.data.mode===f.X.EDIT&&(t.data.formData._id&&(s.userType=t.data.formData.userType,t.form.get("password").value?s.password=t.generalS.getEncryptedString(s.password,b.c.crypto.passCommunication):delete s.password),a=yield t.userS.put(t.data.formData._id,s,{select:h.GX._id}).toPromise(),t.ns.showSuccess(t.constantsCS.user.editSuccess)),t.data.eventChannel.emit({action:t.data.mode===f.X.ADD?m.K.SAVED:m.K.UPDATED}),t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save user info.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.rXU(o.ok),e.rXU(y.m),e.rXU(C.N),e.rXU(F.f),e.rXU(E.s),e.rXU(j.l))};static \u0275cmp=e.VBU({type:n,selectors:[["app-w-admin-user-form"]],inputs:{data:"data"},decls:34,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMUsersForm","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"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide api path",1,"form-control","text-lowercase","form-control-sm"],[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(s,a){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,X,3,0,"span",4),e.DNE(5,V,3,0,"span",4),e.DNE(6,O,3,0,"span",4),e.j41(7,"button",5)(8,"span",6),e.nrm(9,"i",7),e.k0s()()(),e.j41(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e.EFF(14,"Name"),e.k0s(),e.j41(15,"div",12),e.nrm(16,"input",13),e.k0s()(),e.j41(17,"div",10)(18,"label",11),e.EFF(19,"Email"),e.k0s(),e.j41(20,"div",12),e.nrm(21,"input",14),e.k0s()(),e.DNE(22,x,5,0,"div",15),e.j41(23,"div",10)(24,"label",11),e.EFF(25,"API Path"),e.k0s(),e.j41(26,"div",12),e.nrm(27,"input",16),e.k0s()()()(),e.j41(28,"div",17)(29,"button",18),e.nrm(30,"i",19),e.EFF(31," Close"),e.k0s(),e.DNE(32,B,4,3,"button",20),e.k0s(),e.DNE(33,W,1,0,"p-progressSpinner",21),e.k0s()()()),2&s&&(e.R7$(4),e.Y8G("ngIf",a.data.mode===a.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",a.data.mode===a.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",a.data.mode===a.EFormMode.EDIT),e.R7$(5),e.Y8G("formGroup",a.form),e.R7$(11),e.Y8G("ngIf",a.data.mode!==a.EFormMode.VIEW),e.R7$(10),e.Y8G("ngIf",a.data.mode!==a.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",a.loading.form))},dependencies:[o.qT,o.me,o.BC,o.cb,o.j4,o.JD,D.bT,G.U,w.p],encapsulation:2})}return n})();const L=["adminUserFormC"];function Q(n,l){if(1&n){const t=e.RV6();e.j41(0,"span",14),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.edit())}),e.nrm(1,"i",15),e.k0s()}}function J(n,l){if(1&n){const t=e.RV6();e.j41(0,"span",16),e.bIt("click",function(){e.eBV(t);const a=e.XpG();return e.Njj(a.removePermanentDialog())}),e.nrm(1,"i",17),e.k0s()}}function z(n,l){1&n&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Name"),e.k0s(),e.j41(3,"th"),e.EFF(4,"Email"),e.k0s(),e.j41(5,"th"),e.EFF(6,"API Path"),e.k0s()())}function H(n,l){if(1&n&&(e.j41(0,"tr",18)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s()()),2&n){const t=l.$implicit;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t.name),e.R7$(2),e.JRh(t.email),e.R7$(2),e.JRh(t.apiPath)}}function Z(n,l){1&n&&e.nrm(0,"p-progressSpinner",19)}let k=(()=>{class n{userS;generalS;notificationS;confirmationService;navigationCS;constantsCS;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:f.X.ADD,eventChannel:new e.bkB,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=h.GX._id;adminUserFormC;constructor(t,s,a,i,d,g,se){this.userS=t,this.generalS=s,this.notificationS=a,this.confirmationService=i,this.navigationCS=d,this.constantsCS=g,this.eventCenterS=se}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===m.K.SAVED||t.action===m.K.UPDATED)&&(this.adminUserFormC.hideModal(),this.loadGridData())}))}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{active:!0,userType:{$in:[u.l.ROOT,u.l.ADMIN]}},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.userS.query(s).subscribe(function(){var a=(0,c.A)(function*(i){i.success&&(t.selectedRows=[],t.rows=i.data,t.rowsMap=M.keyBy(t.rows,h.GX._id));const d=t.navigationCS.getQueryParam(p.F.user);t.rowsMap[d]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[d]]),t.selectedRows=[t.rowsMap[d]],yield t.fillData()),t.loading.grid=!1});return function(i){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=f.X.ADD,this.data.eventChannel.emit({action:m.K.OPEN_FORM_IN_ADD_MODE}),this.adminUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=f.X.VIEW,this.data.eventChannel.emit({action:m.K.OPEN_FORM_IN_VIEW_MODE}),this.adminUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=f.X.EDIT,this.data.eventChannel.emit({action:m.K.OPEN_FORM_IN_EDIT_MODE}),this.adminUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,c.A)(function*(){var s;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.A)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.A)(function*(){t.loading.grid=!0;const s=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,c.A)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(p.F.user,null)})()}adminUserSelected(t){var s=this;return(0,c.A)(function*(){s.selectedRows=t,s.resetDependents(),s.fillData()})()}fillData(){var t=this;return(0,c.A)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(p.F.user,""),void t.eventCenterS.user.selectedUsers.next([]);const s=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?(yield t.navigationCS.setQueryParam(p.F.user,s._id),t.eventCenterS.user.selectedUsers.next([s])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.rXU(C.N),e.rXU(F.f),e.rXU(y.m),e.rXU(U.td),e.rXU(_.$),e.rXU(E.s),e.rXU(P.d))};static \u0275cmp=e.VBU({type:n,selectors:[["app-w-admin-users"]],viewQuery:function(s,a){if(1&s&&e.GBs(L,5),2&s){let i;e.mGM(i=e.lsd())&&(a.adminUserFormC=i.first)}},decls:16,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-users","text-info","fa-fw","mr-1"],["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","Make Inactive",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 94px)",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"],["adminUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Make Inactive",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(s,a){1&s&&(e.j41(0,"div",0)(1,"div",1)(2,"span"),e.nrm(3,"i",2),e.EFF(4," Users"),e.k0s(),e.j41(5,"span",3),e.bIt("click",function(){return a.add()}),e.nrm(6,"i",4),e.k0s(),e.DNE(7,Q,2,0,"span",5),e.DNE(8,J,2,0,"span",6),e.k0s(),e.j41(9,"div",7)(10,"p-table",8),e.bIt("selectionChange",function(d){return a.selectedRows=d})("dblclick",function(){return a.dblClickUsers()})("selectionChange",function(d){return a.adminUserSelected(d)}),e.DNE(11,z,7,0,"ng-template",9),e.DNE(12,H,7,4,"ng-template",10),e.k0s(),e.DNE(13,Z,1,0,"p-progressSpinner",11),e.k0s()(),e.nrm(14,"app-w-admin-user-form",12,13)),2&s&&(e.R7$(7),e.Y8G("ngIf",a.selectedRows.length),e.R7$(1),e.Y8G("ngIf",a.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.R7$(3),e.Y8G("ngIf",a.loading.grid),e.R7$(1),e.Y8G("data",a.data))},dependencies:[D.bT,S.XI,U.Ei,S.d5,w.p,N.m,A],encapsulation:2})}return n})();const ee=[{path:"",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=e.VBU({type:n,selectors:[["app-admin-user-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"],[1,"w-100"]],template:function(s,a){1&s&&(e.j41(0,"div",0),e.nrm(1,"app-w-admin-users",1),e.k0s())},dependencies:[k],encapsulation:2})}return n})(),canActivate:[r(7358).k]}];let te=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.$C({type:n});static \u0275inj=e.G2t({imports:[R.iI.forChild(ee),T.u]})}return n})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6882],{6882:(m,o,n)=>{n.r(o),n.d(o,{UtilityM:()=>M});var l=n(7060),d=n(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6882],{6882:(m,o,n)=>{n.r(o),n.d(o,{UtilityM:()=>M});var l=n(7060),d=n(1709),h=n(540);const s=[{path:"monitoring",loadChildren:()=>n.e(9347).then(n.bind(n,9347)).then(t=>t.MonitoringM)},{path:"log-table",loadChildren:()=>Promise.all([n.e(2818),n.e(807),n.e(3488),n.e(4344),n.e(9036),n.e(5826),n.e(1468),n.e(3621),n.e(5455),n.e(7759),n.e(7152),n.e(4774),n.e(7597),n.e(1959),n.e(2076),n.e(5729)]).then(n.bind(n,5729)).then(t=>t.LogTableM)},{path:"sandbox-settings",loadChildren:()=>Promise.all([n.e(2818),n.e(807),n.e(3488),n.e(1468),n.e(3621),n.e(7759),n.e(7152),n.e(4774),n.e(2076),n.e(379)]).then(n.bind(n,379)).then(t=>t.SandboxSettingsM)},{path:"app-store",loadChildren:()=>n.e(3545).then(n.bind(n,3545)).then(t=>t.AppStoreM)},{path:"notes",loadChildren:()=>n.e(7014).then(n.bind(n,7014)).then(t=>t.NotesM)},{path:"utility-classes",loadChildren:()=>n.e(9957).then(n.bind(n,9957)).then(t=>t.UtilityClassesM)},{path:"internationalization",loadChildren:()=>n.e(4124).then(n.bind(n,4124)).then(t=>t.I18nM)},{path:"log-profile",loadChildren:()=>Promise.all([n.e(2818),n.e(807),n.e(3488),n.e(4344),n.e(9036),n.e(5826),n.e(1468),n.e(5455),n.e(7597),n.e(1959),n.e(2076),n.e(6053)]).then(n.bind(n,6053)).then(t=>t.LogProfileM)},{path:"native-process-logs",loadChildren:()=>n.e(3611).then(n.bind(n,3611)).then(t=>t.NativeProcessLogsM)},{path:"system-migration",loadChildren:()=>Promise.all([n.e(7759),n.e(5011)]).then(n.bind(n,5011)).then(t=>t.DatabasesMigrationM)},{path:"code-finder",loadChildren:()=>n.e(3621).then(n.bind(n,3621)).then(t=>t.CodeFinderM)},{path:"auto-increment",loadChildren:()=>n.e(7367).then(n.bind(n,7367)).then(t=>t.AutoIncrementM)},{path:"ts-gen-interfaces",loadChildren:()=>n.e(4709).then(n.bind(n,4709)).then(t=>t.TsGenInterfacesM)},{path:"deploy-api-maker",loadChildren:()=>n.e(7374).then(n.bind(n,7374)).then(t=>t.DeployApiMakerM)},{path:"code-comparator-model",loadChildren:()=>n.e(6828).then(n.bind(n,6828)).then(t=>t.CodeComparatorModelM)}];let M=(()=>{class t{static \u0275fac=function(C){return new(C||t)};static \u0275mod=h.$C({type:t});static \u0275inj=h.G2t({imports:[l.iI.forChild(s),d.u]})}return t})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7014],{7014:(y,i,e)=>{e.r(i),e.d(i,{NotesM:()=>g});var d=e(7060),l=e(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7014],{7014:(y,i,e)=>{e.r(i),e.d(i,{NotesM:()=>g});var d=e(7060),l=e(1709),p=e(2173),t=e(540),h=e(5312),C=e(334),v=e(3826),u=e(4806);const m=["notesGridId"];const f=[{path:"main",component:(()=>{class n{eventCenterCS;detectChanges=new t.bkB;notesListC;loading={form:!1,response:!1};BE_HOST_PORT=h.c.BE_HOST_PORT;constructor(a){this.eventCenterCS=a}ngOnInit(){this.eventCenterCS.hideShowNotesIcon=!0}ngOnDestroy(){this.eventCenterCS.hideShowNotesIcon=!1}static \u0275fac=function(s){return new(s||n)(t.rXU(C.u))};static \u0275cmp=t.VBU({type:n,selectors:[["app-notes-layout"]],viewQuery:function(s,o){if(1&s&&t.GBs(m,7),2&s){let c;t.mGM(c=t.lsd())&&(o.notesListC=c.first)}},inputs:{detectChanges:"detectChanges"},decls:7,vars:10,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[1,"row","m-0",2,"height","calc(100vh - 52px)"],[1,"col-3","p-0"],[1,"w-100",3,"projectType","hostAndPort"],["notesGridId",""],[1,"col-9","p-0"],[1,"w-100",3,"data","loading","projectType","hostAndPort","isPageHeight","detectChanges"]],template:function(s,o){1&s&&(t.j41(0,"div",0)(1,"div",1)(2,"div",2),t.nrm(3,"app-notes-list",3,4),t.k0s(),t.j41(5,"div",5),t.nrm(6,"app-notes-form",6),t.k0s()()()),2&s&&(t.R7$(3),t.Y8G("projectType","AM")("hostAndPort",o.BE_HOST_PORT),t.R7$(2),t.xc7("display",o.eventCenterCS.addEditNotes?"block":"none"),t.R7$(1),t.Y8G("data",o.notesListC.data)("loading",o.loading)("projectType","AM")("hostAndPort",o.BE_HOST_PORT)("isPageHeight",!0)("detectChanges",o.detectChanges))},dependencies:[v.v,u.h],encapsulation:2})}return n})(),canActivate:[p.Z]}];let g=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=t.$C({type:n});static \u0275inj=t.G2t({imports:[d.iI.forChild(f),l.u]})}return n})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7152],{846:(C,E,s)=>{s.d(E,{s:()=>q});var m=s(467),n=s(4341),c=s(8727),_=s(5046),u=s(4388),I=s(6645),f=s(5312),h=s(5632),M=s(9239),p=s(8677),v=s(2133),e=s(540),O=s(6708),P=s(6129),g=s(1987),T=s(9818),R=s(7237),S=s(3864),F=s(6268),A=s(3966),b=s(2396),z=s(177),U=s(3478),y=s(4098),B=s(6914),L=s(7515),D=s(4945),K=s(8542),j=s(4466);const W=["insertCodeModalC"],G=["monacoEditorModalC"];function k(i,d){1&i&&(e.j41(0,"span"),e.nrm(1,"i",27),e.EFF(2," Add Process Initializer"),e.k0s())}function N(i,d){1&i&&(e.j41(0,"span"),e.nrm(1,"i",28),e.EFF(2," View Process Initializer"),e.k0s())}function X(i,d){if(1&i&&(e.j41(0,"span"),e.nrm(1,"i",29),e.EFF(2," Edit Process Initializer "),e.j41(3,"span",30),e.EFF(4),e.k0s()()),2&i){const o=e.XpG();e.R7$(4),e.JRh(o.form.get("name").value)}}function V(i,d){1&i&&(e.j41(0,"span",39),e.EFF(1,"You can not change name later, it can be used in script."),e.k0s())}function x(i,d){if(1&i&&(e.j41(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e.EFF(4,"Name"),e.k0s(),e.j41(5,"div",34),e.nrm(6,"input",35),e.DNE(7,V,2,0,"span",36),e.k0s()(),e.j41(8,"div",32)(9,"label",33),e.EFF(10,"Order"),e.k0s(),e.j41(11,"div",34),e.nrm(12,"input",37),e.k0s()(),e.j41(13,"div",32)(14,"label",33),e.EFF(15,"Timeout in minutes"),e.k0s(),e.j41(16,"div",34),e.nrm(17,"input",38),e.k0s()()()()),2&i){const o=e.XpG();e.R7$(1),e.Y8G("formGroup",o.form),e.R7$(6),e.Y8G("ngIf",o.data.mode===o.EFormMode.ADD)}}function Y(i,d){if(1&i){const o=e.RV6();e.j41(0,"div",40)(1,"app-monaco-editor",41),e.bIt("editorGenerated",function(t){e.eBV(o);const r=e.XpG();return e.Njj(r.editorGenerated(t))}),e.k0s()()}if(2&i){const o=e.XpG();e.R7$(1),e.Y8G("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function w(i,d){if(1&i){const o=e.RV6();e.j41(0,"a",42),e.bIt("click",function(){e.eBV(o);const t=e.XpG();return e.Njj(t.viewError())}),e.EFF(1,"View error"),e.k0s()}}function H(i,d){1&i&&(e.j41(0,"span"),e.EFF(1,"Save"),e.k0s())}function J(i,d){1&i&&(e.j41(0,"span"),e.EFF(1,"Update"),e.k0s())}function Q(i,d){if(1&i){const o=e.RV6();e.j41(0,"button",43),e.bIt("click",function(){e.eBV(o);const t=e.XpG();return e.Njj(t.save())}),e.nrm(1,"i",44),e.DNE(2,H,2,0,"span",4),e.DNE(3,J,2,0,"span",4),e.k0s()}if(2&i){const o=e.XpG();e.Y8G("disabled",o.form.invalid),e.R7$(2),e.Y8G("ngIf",o.data.mode===o.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",o.data.mode===o.EFormMode.EDIT)}}function Z(i,d){1&i&&e.nrm(0,"p-progressSpinner",45)}let q=(()=>{class i{fb;ns;generalS;constantsS;processInitializersS;authCS;monacoS;instanceS;eventCenterS;generalCS;userS;cd;data;loading={form:!1};EFormMode=_.X;form;subscriptions=[];formData;IEventData=c.K;id;BE_HOST_PORT=f.c.BE_HOST_PORT;DOCS_HOST_PORT=f.c.DOCS_HOST_PORT;instances=[];editorPI;editorOptionsProcessInitializer={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(o,a,t,r,l,ee,oe,te,se,ae,ie,re){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=r,this.processInitializersS=l,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=re}ngOnInit(){var o=this;return(0,m.A)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.A)(function*(t){if(t)if(o.form.enable(),t.action===c.K.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.K.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.K.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const r=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,h.O.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",r.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.A)(function*(){const a=yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}});o.form.reset(),o.form.patchValue(a),o.generalCS.setValueInEditor(o,"editorPI",a?.processInitializerCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[n.k0.required]],order:[null,[n.k0.required]],processInitializerTimeoutInMinutes:[null,[]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idProcessInitializerForm").modal("show")},100)}hideModal(){$("#idProcessInitializerForm").modal("hide")}save(){var o=this;return(0,m.A)(function*(){const a=o.form.getRawValue();let t;t=o.data.formData&&o.data.formData._id?yield o.processInitializersS.queryOne({find:{guid:o.data.formData.guid,user:o.authCS.gUser._id}}):{};const r=Object.assign({},t,a);r.user=o.authCS.getUserId(),r.processInitializerCode=o.editorPI.getValue();try{let l;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===_.X.ADD?l=yield o.processInitializersS.post(r).toPromise():o.data.mode===_.X.EDIT&&(l=yield o.processInitializersS.put(r._id,r,{select:I.GX._id}).toPromise()),o.ns.showSuccess(o.data.mode===_.X.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===_.X.ADD?c.K.SAVED:c.K.UPDATED,data:l}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(l){o.loading.form=!1,o.ns.showErrorFromResponse(l.error||l,"Unable to save process initializer."),o.lastError=l.error,o.tab=o.tab||{},o.tab.axiosResponse={data:l.error},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=u.r.All,this.insertCodeModalC.showModal(p.Z.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.A)(function*(){a.editorPI=o,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(o,t=>{a.form.valid&&a.save()}),a.monacoS.addInsertCodeKeyBinding(o,t=>{a.generalCS.messageReceivedFor=u.r.All,a.data.mode!==_.X.VIEW&&a.insertCodeModalC.showModal(p.Z.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===v.R.TEXT_COPIED&&t.componentName===p.Z.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),M.L.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.rXU(n.ok),e.rXU(O.m),e.rXU(P.f),e.rXU(g.X),e.rXU(T.o),e.rXU(R.l),e.rXU(S.e),e.rXU(F.J),e.rXU(A.d),e.rXU(P.f),e.rXU(b.N),e.rXU(e.gRc))};static \u0275cmp=e.VBU({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.GBs(W,5),e.GBs(G,5)),2&a){let r;e.mGM(r=e.lsd())&&(t.insertCodeModalC=r.first),e.mGM(r=e.lsd())&&(t.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idProcessInitializerForm","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"],["href","https://docs.apimaker.dev/v1/docs/features/process-initializers.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"],["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"],["class","mt-1px small",4,"ngIf"],["formControlName","order","name","order","spellcheck","false","type","number","placeholder","Please provide order",1,"form-control","form-control-sm"],["formControlName","processInitializerTimeoutInMinutes","name","processInitializerTimeoutInMinutes","spellcheck","false","type","number","placeholder","10",1,"form-control","form-control-sm"],[1,"mt-1px","small"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","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,t){1&a&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.DNE(4,k,3,0,"span",4),e.DNE(5,N,3,0,"span",4),e.DNE(6,X,5,1,"span",4),e.j41(7,"div",5)(8,"button",6),e.bIt("click",function(){return t.hideModal()}),e.j41(9,"span",7),e.nrm(10,"i",8),e.k0s()(),e.j41(11,"span",9),e.bIt("click",function(){return t.showInsertCodeModel()}),e.nrm(12,"i",10),e.k0s(),e.j41(13,"a",11),e.nrm(14,"img",12),e.k0s()()(),e.j41(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.DNE(18,x,18,2,"div",4),e.k0s(),e.j41(19,"p-tabPanel",15),e.DNE(20,Y,2,2,"div",16),e.k0s()()(),e.j41(21,"div",17),e.DNE(22,w,2,0,"a",18),e.j41(23,"button",19),e.bIt("click",function(){return t.hideModal()}),e.nrm(24,"i",20),e.EFF(25," Close"),e.k0s(),e.DNE(26,Q,4,3,"button",21),e.k0s(),e.DNE(27,Z,1,0,"p-progressSpinner",22),e.k0s()()(),e.nrm(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.R7$(4),e.Y8G("ngIf",t.data.mode===t.EFormMode.ADD),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",t.data.mode===t.EFormMode.EDIT),e.R7$(12),e.Y8G("ngIf",t.shouldLoadMonacoEditor),e.R7$(2),e.Y8G("ngIf",t.shouldLoadMonacoEditor),e.R7$(2),e.Y8G("ngIf",t.lastError),e.R7$(4),e.Y8G("ngIf",t.data.mode!==t.EFormMode.VIEW),e.R7$(1),e.Y8G("ngIf",t.loading.form),e.R7$(1),e.Y8G("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.R7$(2),e.Y8G("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[n.qT,n.me,n.Q0,n.BC,n.cb,n.j4,n.JD,z.bT,U.U,y.V,B.A,L.p,D.JQ,D.Kp,K.m,j.J],encapsulation:2,changeDetection:0})}return i})()},7152:(C,E,s)=>{s.d(E,{s:()=>I});var m=s(1709),c=(s(846),s(2508)),_=s(540);let I=(()=>{class f{static \u0275fac=function(p){return new(p||f)};static \u0275mod=_.$C({type:f});static \u0275inj=_.G2t({imports:[m.u,c.v]})}return f})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7367],{7367:(V,d,s)=>{s.r(d),s.d(d,{AutoIncrementM:()=>M});var g=s(7060),h=s(
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7367],{7367:(V,d,s)=>{s.r(d),s.d(d,{AutoIncrementM:()=>M});var g=s(7060),h=s(1709),v=s(2173),r=s(467),I=s(6645),b=s(7376),e=s(540),F=s(6708),p=s(5779),k=s(1987),C=s(6268),y=s(6129),l=s(4341),E=s(177),R=s(3478),u=s(7645),j=s(7515),S=s(8542);function A(a,i){if(1&a){const t=e.RV6();e.j41(0,"span",36),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.edit())}),e.nrm(1,"i",37),e.k0s()}}function w(a,i){if(1&a){const t=e.RV6();e.j41(0,"span",38),e.bIt("click",function(){e.eBV(t);const n=e.XpG();return e.Njj(n.removePermanentDialog())}),e.nrm(1,"i",39),e.k0s()}}function D(a,i){1&a&&(e.j41(0,"tr")(1,"th"),e.EFF(2,"Instance"),e.k0s(),e.j41(3,"th"),e.EFF(4,"Database"),e.k0s(),e.j41(5,"th"),e.EFF(6,"Collection"),e.k0s(),e.j41(7,"th"),e.EFF(8,"Field Path"),e.k0s(),e.j41(9,"th"),e.EFF(10,"Last Generated Value"),e.k0s()())}function T(a,i){if(1&a&&(e.j41(0,"tr",40)(1,"td"),e.EFF(2),e.k0s(),e.j41(3,"td"),e.EFF(4),e.k0s(),e.j41(5,"td"),e.EFF(6),e.k0s(),e.j41(7,"td"),e.EFF(8),e.k0s(),e.j41(9,"td"),e.EFF(10),e.k0s()()),2&a){const t=i.$implicit;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(t.instance),e.R7$(2),e.JRh(t.database),e.R7$(2),e.JRh(t.collection),e.R7$(2),e.JRh(t.field),e.R7$(2),e.JRh(t.value)}}function P(a,i){1&a&&e.nrm(0,"p-progressSpinner",41)}function G(a,i){1&a&&e.nrm(0,"p-progressSpinner",41)}const L=[{path:"main",component:(()=>{class a{ns;confirmationService;constantsS;instanceS;cd;generalS;loading={grid:!1,form:!1};rows=[];rowsMap={};gridKey=I.qb.id;idCounter=0;val;selectedRows=[];constructor(t,o,n,c,m,x){this.ns=t,this.confirmationService=o,this.constantsS=n,this.instanceS=c,this.cd=m,this.generalS=x}ngOnInit(){this.loadGridData(),this.generalS.setNewTitle("API Maker - Auto Increments")}loadGridData(){var t=this;return(0,r.A)(function*(){t.loading.grid=!0,t.selectedRows=[];const o=yield t.instanceS.getAllAutoIncrement().toPromise();t.rows=o.data,t.idCounter=0;for(const n of t.rows)n.id=t.idCounter++;t.rowsMap=b.keyBy(t.rows,t.gridKey),t.loading.grid=!1,t.cd.detectChanges()})()}edit(){var t=this;return(0,r.A)(function*(){t.selectedRows.length&&($("#idEditIncrement").modal("show"),t.val=t.selectedRows[0].value)})()}removePermanentDialog(){var t=this;return(0,r.A)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.autoIncrement.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.A)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,r.A)(function*(){t.loading.grid=!0;const o=t.selectedRows[0],n=yield t.instanceS.deleteAutoIncrement(o).toPromise();t.loading.grid=!1,n.success?(t.ns.showSuccess(t.constantsS.autoIncrement.removePermanent),yield t.loadGridData()):t.ns.showErrorFromResponse(n,t.constantsS.autoIncrement.removePermanentError)})()}update(){var t=this;return(0,r.A)(function*(){if(!t.val)return t.ns.showWarning("Please Provide Value");if(t.val<1)return t.ns.showWarning("Please Provide Positive Value");const o=t.selectedRows[0];o.value=t.val;try{t.loading.grid=!0,(yield t.instanceS.updateAutoIncrementKey(o).toPromise())&&(t.ns.showSuccess(t.constantsS.autoIncrement.editSuccess),yield t.loadGridData(),$("#idEditIncrement").modal("hide"),t.val=null),t.loading.grid=!1}catch(n){t.loading.grid=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to update.")}t.cd.detectChanges()})()}static \u0275fac=function(o){return new(o||a)(e.rXU(F.m),e.rXU(p.td),e.rXU(k.X),e.rXU(C.J),e.rXU(e.gRc),e.rXU(y.f))};static \u0275cmp=e.VBU({type:a,selectors:[["app-auto-increment-list"]],decls:59,vars:13,consts:[[1,"pt-1","pl-1","pr-1"],[1,"card","shadow-sm",2,"height","calc(100vh - 50px)"],[1,"card-header"],["src","/assets/images/icons/increment.svg","alt","Auto Increments",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/features/auto-increment.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["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 - 94px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idEditIncrement","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body"],[1,"form-group","row","pt-4"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["min","1","name","val","spellcheck","false","type","number","placeholder","Value",1,"form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"mt-2",2,"line-height","1"],[1,"text-info","small","font-monospaced"],[1,"text-warning","small","font-monospaced"],[1,"small","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["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"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","align-middle"],["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(o,n){1&o&&(e.j41(0,"div",0)(1,"div",1)(2,"div",2)(3,"span"),e.nrm(4,"img",3),e.EFF(5," Auto Increments"),e.k0s(),e.j41(6,"a",4),e.nrm(7,"img",5),e.k0s(),e.DNE(8,A,2,0,"span",6),e.DNE(9,w,2,0,"span",7),e.k0s(),e.j41(10,"div",8)(11,"p-table",9),e.bIt("selectionChange",function(m){return n.selectedRows=m})("dblclick",function(){return n.edit()}),e.DNE(12,D,11,0,"ng-template",10),e.DNE(13,T,11,6,"ng-template",11),e.k0s(),e.DNE(14,P,1,0,"p-progressSpinner",12),e.k0s()()(),e.j41(15,"div",13)(16,"div",14)(17,"div",15)(18,"div",16)(19,"span"),e.nrm(20,"i",17),e.EFF(21," Edit Auto Increment"),e.k0s(),e.j41(22,"div",18)(23,"button",19)(24,"span",20),e.nrm(25,"i",21),e.k0s()(),e.j41(26,"a",4),e.nrm(27,"img",5),e.k0s()()(),e.j41(28,"div",22)(29,"div",23)(30,"label",24),e.EFF(31,"Value"),e.k0s(),e.j41(32,"div",25)(33,"input",26),e.bIt("ngModelChange",function(m){return n.val=m}),e.k0s(),e.j41(34,"div",27)(35,"span",28),e.EFF(36,"Next value will be maximum from below"),e.k0s(),e.nrm(37,"br"),e.j41(38,"span",29),e.EFF(39),e.k0s(),e.nrm(40,"br"),e.j41(41,"span",30),e.EFF(42,"or"),e.k0s(),e.nrm(43,"br"),e.j41(44,"span",29),e.EFF(45,"\u{1f449} Max DB value + (step from schema || 1)"),e.k0s(),e.nrm(46,"br"),e.j41(47,"span",30),e.EFF(48,"System will get max db value, when there is no entry available in this table."),e.k0s(),e.nrm(49,"br"),e.k0s()()()(),e.j41(50,"div",31)(51,"button",32),e.nrm(52,"i",33),e.EFF(53," Close"),e.k0s(),e.j41(54,"button",34),e.bIt("click",function(){return n.update()}),e.nrm(55,"i",35),e.j41(56,"span"),e.EFF(57,"Update"),e.k0s()()(),e.DNE(58,G,1,0,"p-progressSpinner",12),e.k0s()()()),2&o&&(e.R7$(8),e.Y8G("ngIf",n.selectedRows.length),e.R7$(1),e.Y8G("ngIf",n.selectedRows.length),e.R7$(2),e.Y8G("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.R7$(3),e.Y8G("ngIf",n.loading.grid),e.R7$(19),e.Y8G("ngModel",n.val),e.R7$(6),e.SpI("\u{1f449} ",n.val," + (step from schema || 1)"),e.R7$(15),e.Y8G("disabled",!n.val),e.R7$(4),e.Y8G("ngIf",n.loading.form))},dependencies:[l.me,l.Q0,l.BC,l.VZ,l.vS,E.bT,R.U,u.XI,p.Ei,u.d5,j.p,S.m],encapsulation:2,changeDetection:0})}return a})(),canActivate:[v.Z]}];let M=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=e.$C({type:a});static \u0275inj=e.G2t({imports:[g.iI.forChild(L),h.u]})}return a})()}}]);
|