@sava-info-systems/api-maker-with-extensions 1.19.3 → 1.19.5
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/1025.ad3d7fe2972421a7.js +1 -0
- package/dist/1097.f7edc9a254293cbe.js +1 -0
- package/dist/148.3d1172921fc38628.js +1 -0
- package/dist/1558.d77067ef3989dc57.js +1 -0
- package/dist/{1351.48e08341fba9b889.js → 1617.cd35a3a268fd8f90.js} +1 -1
- package/dist/1678.2c6fe869dc9df280.js +1 -0
- package/dist/1754.616b92791d39dab1.js +1 -0
- package/dist/1928.a299b3986d670379.js +1 -0
- package/dist/1957.cafa315c70f23efe.js +1 -0
- package/dist/2140.82e389d21656cd83.js +1 -0
- package/dist/2295.b066a00a7c4c4d9c.js +1 -0
- package/dist/238.6207cf874f0ff82a.js +1 -0
- package/dist/2473.6a522dcf87dfb922.js +1 -0
- package/dist/2714.1ed8bfd73f5693eb.js +1 -0
- package/dist/{3611.9577d58af5f1f4aa.js → 2735.880b4c038ef3207e.js} +1 -1
- package/dist/2908.c7cbde300e1840a4.js +1 -0
- package/dist/3081.e470a8aeed4a7745.js +1 -0
- package/dist/3139.7a6ebcaa6a5f38f6.js +1 -0
- package/dist/3450.68d8d179c9496764.js +1 -0
- package/dist/4110.1747a68dfaacbbd8.js +1 -0
- package/dist/4186.601304798e909236.js +1 -0
- package/dist/4211.b7a72c8db8263edf.js +1 -0
- package/dist/4575.987834c6e73af961.js +1 -0
- package/dist/4842.f89ded9e1e9f1110.js +1 -0
- package/dist/485.b333cf63f954b75c.js +1 -0
- package/dist/4895.95e42b567a89ce84.js +1 -0
- package/dist/5249.52aa732ef6a173c5.js +1 -0
- package/dist/5334.8ed5b236a6948681.js +1 -0
- package/dist/5421.e729ed3585afa9af.js +1 -0
- package/dist/5679.53292305f1448567.js +1 -0
- package/dist/5761.c363fe26244e8787.js +1 -0
- package/dist/5765.e70cd773673bfe27.js +1 -0
- package/dist/6236.b81e95926f7fcd60.js +1 -0
- package/dist/6393.1323e8b7d2cdae70.js +1 -0
- package/dist/6401.02e5b3cb94d0322a.js +1 -0
- package/dist/{8970.8eece52bbc1c316c.js → 6925.d59cabb0e343d24c.js} +1 -1
- package/dist/7368.4c04430d3efc5947.js +1 -0
- package/dist/{2442.adbc5b49349bb569.js → 7436.7e4876b9e90efde6.js} +1 -1
- package/dist/7470.9195bddaee5202e0.js +1 -0
- package/dist/7649.870e05f3aa978078.js +1 -0
- package/dist/7975.dbe6e674c50ab553.js +1 -0
- package/dist/7977.35ebfb6f4c9503b4.js +1 -0
- package/dist/7987.37367b65a76d5083.js +1 -0
- package/dist/8125.58e1a7a385797896.js +1 -0
- package/dist/8266.d665463de8b8d75a.js +1 -0
- package/dist/8296.32f107844a1381b6.js +1 -0
- package/dist/{3732.b5ac36f1448e215c.js → 8374.11d430ef2432bfba.js} +1 -1
- package/dist/{6589.b9c83295e466e464.js → 8682.5bde1163690a18dc.js} +1 -1
- package/dist/8841.6cb824dd9d5ad8f8.js +1 -0
- package/dist/885.e3d53b62c51f8311.js +1 -0
- package/dist/{9785.35cc7f0c3778344e.js → 891.333c6913b8246e3c.js} +1 -1
- package/dist/913.7d41933171ab9fbe.js +1 -0
- package/dist/9243.c223cdbc4cd84cb8.js +1 -0
- package/dist/9575.0a35a4da70f9e6e5.js +1 -0
- package/dist/9939.218315684234eb18.js +1 -0
- package/dist/common.442040891fd4ef29.js +1 -0
- package/dist/index.html +1 -1
- package/dist/main.9630ecd9c9613e82.js +1 -0
- package/dist/polyfills.93062920aa87d580.js +1 -0
- package/dist/runtime.21919a870e05d69b.js +1 -0
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/sandbox.js +1 -1
- package/src/tools/local-client.js +1 -1
- package/dist/1417.5caf023140e7c67f.js +0 -1
- package/dist/1468.d42293f7d802a787.js +0 -1
- package/dist/1959.a22fe393419f10c5.js +0 -1
- package/dist/2162.3c94f3d66c6312d5.js +0 -1
- package/dist/2818.71176f4848a9419f.js +0 -1
- package/dist/3488.ada60be2dbcd9845.js +0 -1
- package/dist/3545.b5585792e9fe1447.js +0 -1
- package/dist/3605.3c6cdf2a08c47301.js +0 -1
- package/dist/3621.412300a009ea6346.js +0 -1
- package/dist/379.d3e61f3350a595dc.js +0 -1
- package/dist/3929.9ac933e926943db2.js +0 -1
- package/dist/4092.71b0eccc0cb429f0.js +0 -1
- package/dist/4124.a8329e77343e7087.js +0 -1
- package/dist/4316.542be541e58dff84.js +0 -1
- package/dist/4344.d8f42d425eaec852.js +0 -1
- package/dist/4689.e827720779e0cf34.js +0 -1
- package/dist/4709.262c34f60b50ebc9.js +0 -1
- package/dist/4774.a4368f3ce2e778da.js +0 -1
- package/dist/4880.70ca405524206be7.js +0 -1
- package/dist/5011.ed9a6465223f760d.js +0 -1
- package/dist/5090.c8bf74c35b0a5d26.js +0 -1
- package/dist/5140.581ccd2699e2a8a8.js +0 -1
- package/dist/5362.912e053f78479e90.js +0 -1
- package/dist/5442.186b40719e7c1da9.js +0 -1
- package/dist/5455.a1d0d507419e3c59.js +0 -1
- package/dist/5729.f0ee236ba6579a94.js +0 -1
- package/dist/5826.44efead20568788a.js +0 -1
- package/dist/6053.67f38f7b35484475.js +0 -1
- package/dist/6220.b6c29e6e3e717880.js +0 -1
- package/dist/6415.a48241737e134178.js +0 -1
- package/dist/6679.c5073d3a60b67e2e.js +0 -1
- package/dist/6828.36c6805f2b3c6f38.js +0 -1
- package/dist/6866.4dd76a41246a20be.js +0 -1
- package/dist/6882.fe03a3df377ca119.js +0 -1
- package/dist/7014.5db4db60cc21782e.js +0 -1
- package/dist/7152.dab3cc50472f703f.js +0 -1
- package/dist/7367.ba1e63db0f9b97f4.js +0 -1
- package/dist/7374.ebfe1004d1773912.js +0 -1
- package/dist/7597.177f15771dcdea42.js +0 -1
- package/dist/7759.2b4ed39a62323abd.js +0 -1
- package/dist/807.dba59148bbbbe7fb.js +0 -1
- package/dist/8219.2c97945d465ab185.js +0 -1
- package/dist/8447.8caa67c3eb5d2b55.js +0 -1
- package/dist/9036.876c1f0c1ce4e82b.js +0 -1
- package/dist/9347.4e7d02eee86c5778.js +0 -1
- package/dist/9429.9299aa0abda3dc76.js +0 -1
- package/dist/9882.a94c746b42e5fc0e.js +0 -1
- package/dist/9957.47ed0e74bdfeddd5.js +0 -1
- package/dist/common.d4eb1616e93e21e1.js +0 -1
- package/dist/main.1da32156380b46d5.js +0 -1
- package/dist/polyfills.9cbb1c8222a6b6c3.js +0 -1
- package/dist/runtime.212fca73d6a42b3a.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[5765],{7595:(wt,I,l)=>{l.d(I,{G:()=>c});var d=l(5861),t=l(4946),i=l(3157),f=l(328),C=l(6212),g=l(6990),S=l(5085),E=l(1162),It=l(6925),St=l(553),L=l(9394),w=l(921),J=l(7629),y=l(7240),u=l(9961),Z=l(2189),P=l(5852),v=l(7414),D=l(2915),O=l(7664),Q=l(9862),R=l(5219),G=l(95),U=l(6814),Y=l(7797),T=l(5431),k=l(7680),K=l(3259),B=l(8057),q=l(1137);const W=["funManFormC"],H=["cloneApiModalC"];function j(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"span",20),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.edit())}),t._UZ(1,"i",21),t.qZA()}}function $(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"span",22),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.clone())}),t._UZ(1,"i",23),t.qZA()}}function z(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"span",24),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.removePermanentDialog())}),t._UZ(1,"i",25),t.qZA()}}function V(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"span")(1,"span",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.navigateToTreeView())}),t._UZ(2,"i",14),t.qZA(),t.TgZ(3,"span",15),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.add())}),t._UZ(4,"i",16),t.qZA(),t.YNc(5,j,2,0,"span",17),t.YNc(6,$,2,0,"span",18),t.YNc(7,z,2,0,"span",19),t.qZA()}if(2&n){const e=t.oxw();t.xp6(5),t.Q6J("ngIf",1===e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",1===e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",1===e.selectedRows.length)}}function X(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"span",26)(1,"label",27)(2,"p-checkbox",28),t.NdJ("ngModelChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.eventCenterS.group.apisRegex.allCustomApis=r)}),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allCustomApis)("binary",!0)}}function tt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"span",26)(1,"label",27)(2,"p-checkbox",28),t.NdJ("ngModelChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.eventCenterS.filterInLog.apisRegex.allCustomApis=r)}),t.qZA()()()}if(2&n){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allCustomApis)("binary",!0)}}function et(n,o){if(1&n&&(t.TgZ(0,"div")(1,"div",29),t._uU(2),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allCustomApisPermitted)}}function nt(n,o){1&n&&(t.TgZ(0,"th",39),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function it(n,o){1&n&&t._UZ(0,"th",37)}function st(n,o){1&n&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function ot(n,o){1&n&&t._UZ(0,"th")}function at(n,o){1&n&&t._UZ(0,"th",40)}function rt(n,o){if(1&n&&(t.TgZ(0,"tr"),t.YNc(1,nt,2,0,"th",35),t.YNc(2,it,1,0,"th",36),t._UZ(3,"th",37),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th"),t._uU(7,"Path"),t.qZA(),t.YNc(8,st,2,0,"th",5),t.YNc(9,ot,1,0,"th",5),t.YNc(10,at,1,0,"th",38),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(6),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",e.isLPM),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable)}}function lt(n,o){if(1&n&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",46),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function ct(n,o){if(1&n&&(t.TgZ(0,"td",47)(1,"span"),t._uU(2),t.qZA()()),2&n){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function pt(n,o){1&n&&t._UZ(0,"i",48)}function dt(n,o){1&n&&t._UZ(0,"i",49)}function _t(n,o){1&n&&(t.TgZ(0,"span",53),t._uU(1,"AM-User"),t.qZA())}function ut(n,o){1&n&&(t.TgZ(0,"span",54),t._uU(1,"No-Access"),t.qZA())}function mt(n,o){1&n&&(t.TgZ(0,"span",55),t._uU(1,"Public"),t.qZA())}function ft(n,o){1&n&&(t.TgZ(0,"span",54),t._uU(1,"DB-User"),t.qZA())}function gt(n,o){1&n&&(t.TgZ(0,"span",54),t._uU(1,"AWS"),t.qZA())}function ht(n,o){1&n&&(t.TgZ(0,"span",54),t._uU(1,"Azure"),t.qZA())}function Ct(n,o){1&n&&(t.TgZ(0,"span",54),t._uU(1,"Google"),t.qZA())}function vt(n,o){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,_t,2,0,"span",50),t.YNc(2,ut,2,0,"span",51),t.YNc(3,mt,2,0,"span",52),t.YNc(4,ft,2,0,"span",51),t.YNc(5,gt,2,0,"span",51),t.YNc(6,ht,2,0,"span",51),t.YNc(7,Ct,2,0,"span",51),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.hasAmAuth),t.xp6(1),t.Q6J("ngIf",e.noAccess),t.xp6(1),t.Q6J("ngIf",e.isPublic),t.xp6(1),t.Q6J("ngIf",e.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",e.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",e.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",e.hasGoogleAuth)}}function Tt(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div")(1,"label",56)(2,"p-checkbox",57),t.NdJ("ngModelChange",function(r){t.CHM(e);const p=t.oxw(2).$implicit;return t.KtG(p.saveResponseInLog=r)})("ngModelChange",function(){t.CHM(e);const r=t.oxw(4);return t.KtG(r.saveResponseInLogCheckData())})("click",function(r){t.CHM(e);const p=t.oxw(4);return t.KtG(p.generalS.stopPropagation(r))}),t.qZA()()()}if(2&n){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function N(n,o){if(1&n&&(t.TgZ(0,"td"),t.YNc(1,Tt,3,2,"div",5),t.qZA()),2&n){const e=t.oxw().$implicit,s=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(null==s.selectedRows?null:s.selectedRows.indexOf(e))>=0)}}const At=function(){return["/api-info/api-testing/testing"]},b=function(n,o,e){return{at_category:n,at_user:o,at_api:e}};function F(n,o){if(1&n&&(t.TgZ(0,"td")(1,"div",47)(2,"a",58),t.NdJ("click",function(s){return s.stopPropagation()}),t._UZ(3,"i",59),t.qZA()()()),2&n){const e=t.oxw().$implicit,s=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(2,At))("queryParams",t.kEZ(3,b,s.EAPICategory.CUSTOM_APIS,s.authCS.getUserId(),e._id))}}const xt=function(n,o,e,s){return{get:n,put:o,post:e,delete:s}};function Et(n,o){if(1&n&&(t.TgZ(0,"tr",41),t.YNc(1,lt,2,2,"td",5),t.YNc(2,ct,3,1,"td",42),t.TgZ(3,"td")(4,"span",43),t._uU(5),t.qZA()(),t.TgZ(6,"td")(7,"span"),t._uU(8),t.qZA(),t.YNc(9,pt,1,0,"i",44),t.YNc(10,dt,1,0,"i",45),t.qZA(),t.TgZ(11,"td"),t._uU(12),t.qZA(),t.YNc(13,vt,8,7,"td",5),t.YNc(14,N,2,1,"td",5),t.YNc(15,F,4,7,"td",5),t.qZA()),2&n){const e=o.$implicit,s=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",s.showCheckbox),t.xp6(1),t.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),t.xp6(2),t.Q6J("ngClass",t.l5B(12,xt,e.requestMethod===s.ERequestMethod.GET,e.requestMethod===s.ERequestMethod.PUT,e.requestMethod===s.ERequestMethod.POST,e.requestMethod===s.ERequestMethod.DELETE)),t.xp6(1),t.Oqu(e.requestMethod),t.xp6(3),t.Oqu(e.name),t.xp6(1),t.Q6J("ngIf",e.runOnNativeProcess),t.xp6(1),t.Q6J("ngIf",e.enableCaching),t.xp6(2),t.Oqu(e.path),t.xp6(1),t.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",s.isLPM),t.xp6(1),t.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function Mt(n,o){1&n&&t._UZ(0,"p-progressSpinner",60)}function a(n,o){if(1&n){const e=t.EpF();t.TgZ(0,"div",30)(1,"p-table",31),t.NdJ("selectionChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.selectedRows=r)})("selectionChange",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.functionSelected(r))})("dblclick",function(r){t.CHM(e);const p=t.oxw();return t.KtG(p.dblClickCustomAPIsGrid(r))}),t.YNc(2,rt,11,5,"ng-template",32),t.YNc(3,Et,16,17,"ng-template",33),t.qZA(),t.YNc(4,Mt,1,0,"p-progressSpinner",34),t.qZA()}if(2&n){const e=t.oxw();t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",e.metaKeySelection)("selection",e.selectedRows)("dataKey",e.gridKey)("scrollable",!0)("value",e.rows),t.xp6(3),t.Q6J("ngIf",e.loading.grid)}}let c=(()=>{class n{functionS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;cd;router;http;confirmationService;showCheckbox=!0;isReadOnly=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:f.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=E.iH._id;EUserType=w.d;BE_HOST_PORT=St.N.BE_HOST_PORT;EAPICategory=S.R;ERequestMethod=It.Yp;FunManFormC;cloneApiModalC;constructor(e,s,r,p,A,_,m,x,M,h,yt){this.functionS=e,this.generalS=s,this.notificationS=r,this.navigationCS=p,this.authCS=A,this.constantsS=_,this.eventCenterS=m,this.cd=x,this.router=M,this.http=h,this.confirmationService=yt}ngOnInit(){var e=this;this.eventCenterS.functions.selectedFunctions.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{this.FunManFormC.hideModal(),this.loadGridData()})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,d.Z)(function*(r){r.length&&(yield e.loadGridData())});return function(r){return s.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.isLPM&&this.subscriptions.push(this.eventCenterS.filterInLog.functionIds.subscribe((0,d.Z)(function*(){e.loadGridData()}))),this.generalS.setNewTitle("API Maker - Custom APIs")}navigateToTreeView(){var e=this;return(0,d.Z)(function*(){yield e.router.navigate(["api-info","custom-api","functions-tree"])})()}loadGridData(){var e=this;if(this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length)return void this.resetGridAndUrl();this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,path:1,active:1,requestMethod:1,runOnNativeProcess:1,enableCaching:1,apiAccessType:1},sort:{path:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.functionS.query(s,"getAuthData=true").subscribe(function(){var r=(0,d.Z)(function*(p){p.success?(e.selectedRows=[],e.rows=p.data||[],e.rowsMap=g.keyBy(e.rows,E.iH._id),e.rowsMapName=g.keyBy(e.rows,E.eb.name)):e.resetGridAndUrl();const A=e.navigationCS.getQueryParam(C.p.custom_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.functionIds.value.join(","):e.eventCenterS.group.customApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0].queryParams.customApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.customApiNames.join(","):"");if(A){const _=A.split(","),m=g.intersection(g.keys(e.rowsMap),_),x=[];for(const h of m)e.rowsMap[h]&&x.push(e.rowsMap[h]);const M=[];for(const h of m)e.rowsMap[h]&&M.push(e.rowsMap[h]);e.selectedRows=M,e.eventCenterS.functions.selectedFunctions.next(x)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.customApiNames?.length){const _=e.eventCenterS.group.selectedGroups.value[0];for(const m of _?.queryParams?.customApiNames)e.rowsMapName[m]&&(e.rowsMapName[m].saveResponseInLog=_.functionsLog?.[m]?.saveResponseInLog||!1);e.setResDataInEventCenter()}if(e.isDependentOnGroup){e.selectedRows=[];for(const _ of e.eventCenterS.group.customApiIds.value)e.rowsMap[_]&&e.selectedRows.push(e.rowsMap[_])}if(e.isFilterLogTable){e.selectedRows=[];for(const _ of e.eventCenterS.filterInLog.functionIds.value)e.rowsMap[_]&&e.selectedRows.push(e.rowsMap[_])}e.loading.grid=!1,e.cd.detectChanges()});return function(p){return r.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=f.D.ADD,this.data.eventChannel.emit({action:i.F.OPEN_FORM_IN_ADD_MODE}),this.FunManFormC.showModal()}view(){this.data.formData=this.rowsMap[this.getSelectedRowId()],this.data.mode=f.D.VIEW,this.data.eventChannel.emit({action:i.F.OPEN_FORM_IN_VIEW_MODE}),this.FunManFormC.showModal()}edit(){this.data.formData=this.rowsMap[this.getSelectedRowId()],this.data.mode=f.D.EDIT,this.data.eventChannel.emit({action:i.F.OPEN_FORM_IN_EDIT_MODE}),this.FunManFormC.showModal()}removePermanentDialog(){var s,e=this;this.confirmationService.confirm({message:this.constantsS.functions.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,d.Z)(function*(){yield e.removePermanent()}),function(){return s.apply(this,arguments)})})}removePermanent(){var e=this;return(0,d.Z)(function*(){if(e.getSelectedRowId()){e.loading.grid=!0;try{const s=`${e.getSelectedRowGuid()}:${e.authCS.gUser._id}`,r=yield e.functionS.permanentDelete(s).toPromise();r.success?(e.notificationS.showSuccess(e.constantsS.functions.removePermanent),e.resetGridAndUrl(),e.loadGridData()):e.notificationS.showErrorFromResponse(r,e.constantsS.functions.removePermanentError)}catch{e.notificationS.showError(e.constantsS.functions.removePermanentError)}e.loading.grid=!1}})()}resetDependents(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.functions.selectedFunctions.next([]),yield e.navigationCS.setQueryParam(C.p.custom_api,null)})()}functionSelected(e){var s=this;return(0,d.Z)(function*(){s.selectedRows=e,s.resetDependents().then();for(const r of s.rows)-1===s.selectedRows.indexOf(r)&&(r.saveResponseInLog=!1);s.fillData().then(),s.getSelectedRowId()?s.generalS.setNewTitle(s.rowsMap[s.getSelectedRowId()].name,S.R.CUSTOM_APIS):s.generalS.setNewTitle("API Maker - Custom APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.eventCenterS.functions.selectedFunctions.next([])}fillData(){var e=this;return(0,d.Z)(function*(){if(!e.selectedRows||Array.isArray(e.selectedRows)&&!e.selectedRows.length)return yield e.navigationCS.setQueryParam(C.p.custom_api,""),e.eventCenterS.group.customApis.next([]),e.eventCenterS.functions.selectedFunctions.next([]),e.eventCenterS.group.customApiIds.next([]),void e.eventCenterS.group.customApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable){const s=g.map(e.selectedRows,"_id");e.eventCenterS.group.customApiIds.next(s),e.eventCenterS.group.customApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.functionIds.next(s),e.eventCenterS.filterInLog.functions.next(e.selectedRows))}else{const s=e.getSelectedRowId(),r=(yield e.functionS.getById(s).toPromise()).data;r._id?(yield e.navigationCS.setQueryParam(C.p.custom_api,r._id),e.eventCenterS.functions.selectedFunctions.next([r])):e.resetDependents().then()}})()}getSelectedRowId(){return this.selectedRows[0]?._id}getSelectedRowGuid(){return this.selectedRows[0]?.guid}dblClickCustomAPIsGrid(e){setTimeout(()=>{this.edit()},10)}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.customApis.next(this.selectedRows),this.eventCenterS.group.selectedFunctions.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.functions.next(this.selectedRows)}saveResponseInLogCheckData(){this.setResDataInEventCenter()}clone(){var e=this;return(0,d.Z)(function*(){yield e.cloneApiModalC.showModal(e.getSelectedRowId(),null,function(){var s=(0,d.Z)(function*(r){r&&(yield e.loadGridData()),e.cd.detectChanges()});return function(r){return s.apply(this,arguments)}}())})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=L.k4;static \u0275fac=function(s){return new(s||n)(t.Y36(J.d),t.Y36(y.b),t.Y36(u.W),t.Y36(Z.S),t.Y36(P.D),t.Y36(v.L),t.Y36(D.u),t.Y36(t.sBO),t.Y36(O.F0),t.Y36(Q.eN),t.Y36(R.YP))};static \u0275cmp=t.Xpm({type:n,selectors:[["app-custom-api-grid"]],viewQuery:function(s,r){if(1&s&&(t.Gf(W,5),t.Gf(H,5)),2&s){let p;t.iGM(p=t.CRH())&&(r.FunManFormC=p.first),t.iGM(p=t.CRH())&&(r.cloneApiModalC=p.first)}},inputs:{showCheckbox:"showCheckbox",isReadOnly:["IsReadOnly","isReadOnly"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:17,vars:9,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/custom.svg","alt","Custom API",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Custom APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["funManFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],[1,"float-right","cursor-pointer","ml-3",3,"click"],["tooltipPosition","left","pTooltip","Tree View","tooltipPosition","left",1,"fas","fa-sitemap","text-yellow","fa-fw","fa-rotate-270"],["tooltipPosition","left","pTooltip","Add New","tooltipPosition","left",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Custom APIs",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","80px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["pTooltip","Running on native process","class","fas fa-radiation ml-2 text-danger",4,"ngIf"],["pTooltip","Caching enabled","class","fas fa-fighter-jet ml-2 text-warning",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["pTooltip","Running on native process",1,"fas","fa-radiation","ml-2","text-danger"],["pTooltip","Caching enabled",1,"fas","fa-fighter-jet","ml-2","text-warning"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,r){1&s&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Custom APIs"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,V,8,3,"span",5),t.YNc(8,X,3,2,"span",6),t.YNc(9,tt,3,2,"span",6),t.qZA(),t.TgZ(10,"div",7),t.YNc(11,et,3,1,"div",5),t.YNc(12,a,5,7,"div",8),t.qZA()(),t._UZ(13,"app-w-fun-man-form",9,10)(15,"app-clone-api-modal",11,12)),2&s&&(t.xp6(7),t.Q6J("ngIf",!r.isReadOnly),t.xp6(1),t.Q6J("ngIf",r.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",r.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",r.eventCenterS.group.apisRegex.allCustomApis||r.eventCenterS.filterInLog.apisRegex.allCustomApis),t.xp6(1),t.Q6J("ngIf",!(r.eventCenterS.group.apisRegex.allCustomApis||r.eventCenterS.filterInLog.apisRegex.allCustomApis)),t.xp6(1),t.Q6J("data",r.data),t.xp6(2),t.Q6J("modalId","idCloneCustomAPIGrid")("hostAndPort",r.BE_HOST_PORT)("modelApiPaths",r.EModelApiPaths.CUSTOM_APIS))},dependencies:[O.rH,G.JJ,G.On,U.mk,U.O5,Y.s,T.iA,R.jx,T.Ei,T.UA,T.Mo,k.G,K.u,B.XZ,q.u],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return n})()},5765:(wt,I,l)=>{l.r(I),l.d(I,{FunctionManM:()=>Mt});var d=l(7664),t=l(6814),i=l(4946),f=l(5219);let L=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=i.oAB({type:a});static \u0275inj=i.cJS({imports:[t.ez,f.m8,f.m8]})}return a})();var w=l(3726),J=l(7017),y=l(7595),u=l(5861),Z=l(3157),P=l(328),v=l(6212),D=l(5085),O=l(1162),Q=l(6925),R=l(553),G=l(9394),U=l(921),Y=l(7629),T=l(7240),k=l(9961),K=l(2189),B=l(5852),q=l(7414),W=l(2915),H=l(9862),j=l(7797),$=l(1396),z=l(7680),V=l(3259),X=l(1137);const tt=["funManFormC"],et=["cloneApiModalC"];function nt(a,c){if(1&a){const n=i.EpF();i.TgZ(0,"span",21),i.NdJ("click",function(){i.CHM(n);const e=i.oxw();return i.KtG(e.edit())}),i._UZ(1,"i",22),i.qZA()}}function it(a,c){if(1&a){const n=i.EpF();i.TgZ(0,"span",23),i.NdJ("click",function(){i.CHM(n);const e=i.oxw();return i.KtG(e.clone())}),i._UZ(1,"i",24),i.qZA()}}function st(a,c){if(1&a){const n=i.EpF();i.TgZ(0,"span",25),i.NdJ("click",function(){i.CHM(n);const e=i.oxw();return i.KtG(e.removePermanentDialog())}),i._UZ(1,"i",26),i.qZA()}}function ot(a,c){if(1&a&&(i.TgZ(0,"div"),i._uU(1),i.qZA()),2&a){const n=i.oxw().$implicit;i.xp6(1),i.Oqu(n.label)}}function at(a,c){1&a&&i._UZ(0,"i",40)}function rt(a,c){1&a&&i._UZ(0,"i",41)}function lt(a,c){1&a&&(i.TgZ(0,"span",42),i._uU(1,"AM-User"),i.qZA())}function ct(a,c){1&a&&(i.TgZ(0,"span",43),i._uU(1,"No-Access"),i.qZA())}function pt(a,c){1&a&&(i.TgZ(0,"span",44),i._uU(1,"Public"),i.qZA())}function dt(a,c){1&a&&(i.TgZ(0,"span",43),i._uU(1,"DB-User"),i.qZA())}function _t(a,c){1&a&&(i.TgZ(0,"span",43),i._uU(1,"AWS"),i.qZA())}function ut(a,c){1&a&&(i.TgZ(0,"span",43),i._uU(1,"Azure"),i.qZA())}function mt(a,c){1&a&&(i.TgZ(0,"span",43),i._uU(1,"Google"),i.qZA())}const ft=function(a,c,n,o){return{get:a,put:c,post:n,delete:o}},gt=function(){return["/api-info/api-testing/testing"]},ht=function(a,c,n){return{at_category:a,at_user:c,at_api:n}};function Ct(a,c){if(1&a&&(i.TgZ(0,"div")(1,"div")(2,"table",29)(3,"tr")(4,"td",30)(5,"span",31),i._uU(6),i.qZA(),i.TgZ(7,"span")(8,"span"),i._uU(9),i.qZA(),i.YNc(10,at,1,0,"i",32),i.YNc(11,rt,1,0,"i",33),i.qZA()(),i.TgZ(12,"td",30),i._uU(13),i.qZA(),i.TgZ(14,"td"),i.YNc(15,lt,2,0,"span",34),i.YNc(16,ct,2,0,"span",35),i.YNc(17,pt,2,0,"span",36),i.YNc(18,dt,2,0,"span",35),i.YNc(19,_t,2,0,"span",35),i.YNc(20,ut,2,0,"span",35),i.YNc(21,mt,2,0,"span",35),i.qZA(),i.TgZ(22,"td",37)(23,"a",38),i.NdJ("click",function(o){return o.stopPropagation()}),i._UZ(24,"i",39),i.qZA()()()()()()),2&a){const n=i.oxw().$implicit,o=i.oxw();i.xp6(5),i.Q6J("ngClass",i.l5B(15,ft,n.data.requestMethod===o.ERequestMethod.GET,n.data.requestMethod===o.ERequestMethod.PUT,n.data.requestMethod===o.ERequestMethod.POST,n.data.requestMethod===o.ERequestMethod.DELETE)),i.xp6(1),i.Oqu(n.data.requestMethod),i.xp6(3),i.Oqu(n.data.name),i.xp6(1),i.Q6J("ngIf",n.data.runOnNativeProcess),i.xp6(1),i.Q6J("ngIf",n.data.enableCaching),i.xp6(2),i.Oqu(n.data.path),i.xp6(2),i.Q6J("ngIf",n.data.hasAmAuth),i.xp6(1),i.Q6J("ngIf",n.data.noAccess),i.xp6(1),i.Q6J("ngIf",n.data.isPublic),i.xp6(1),i.Q6J("ngIf",n.data.hasAmDBAuth),i.xp6(1),i.Q6J("ngIf",n.data.hasAwsAuth),i.xp6(1),i.Q6J("ngIf",n.data.hasAzureAuth),i.xp6(1),i.Q6J("ngIf",n.data.hasGoogleAuth),i.xp6(2),i.Q6J("routerLink",i.DdM(20,gt))("queryParams",i.kEZ(21,ht,o.EAPICategory.CUSTOM_APIS,o.authCS.getUserId(),n.data._id))}}function vt(a,c){if(1&a&&(i.TgZ(0,"div",27),i.YNc(1,ot,2,1,"div",28),i.YNc(2,Ct,25,25,"div",28),i.qZA()),2&a){const n=c.$implicit;i.xp6(1),i.Q6J("ngIf",null==n.children?null:n.children.length),i.xp6(1),i.Q6J("ngIf",!(null!=n.children&&n.children.length))}}function Tt(a,c){1&a&&i._UZ(0,"p-progressSpinner",45)}let N=(()=>{class a{functionS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;cd;router;http;confirmationService;loading={grid:!1};subscriptions=[];data={mode:P.D.ADD,eventChannel:new i.vpe,formData:void 0};gridKey=O.iH._id;EUserType=U.d;BE_HOST_PORT=R.N.BE_HOST_PORT;EAPICategory=D.R;EQueryParam=v.p;leafSelected=!1;selectedRows=void 0;treeNodes=[];allTreeItemsMap={};FunManFormC;cloneApiModalC;constructor(n,o,e,s,r,p,A,_,m,x,M){this.functionS=n,this.generalS=o,this.notificationS=e,this.navigationCS=s,this.authCS=r,this.constantsS=p,this.eventCenterS=A,this.cd=_,this.router=m,this.http=x,this.confirmationService=M}ngOnInit(){this.loadTreeData(),this.subscriptions.push(this.data.eventChannel.subscribe(n=>{this.FunManFormC.hideModal(),this.loadTreeData()})),this.generalS.setNewTitle("API Maker - Custom APIs")}navigateToGridView(){var n=this;return(0,u.Z)(function*(){yield n.router.navigate(["api-info","custom-api","functions"])})()}loadTreeData(){var n=this;return(0,u.Z)(function*(){const o=(yield n.functionS.getCustomAPITree().toPromise()).data;for(const s of o)n.generalS.convertKTreeItemToPrimeNGTreeItem(s);const e={};n.generalS.getMapOfAllItems(e,o);for(const s of Object.keys(e)){const r=n.allTreeItemsMap[s];r&&(e[s].expanded=r.expanded)}n.treeNodes=o,n.allTreeItemsMap=e,n.loading.grid=!1,n.cd.detectChanges()})()}add(){this.data.formData=void 0,this.data.mode=P.D.ADD,this.data.eventChannel.emit({action:Z.F.OPEN_FORM_IN_ADD_MODE}),this.FunManFormC.showModal()}edit(){this.leafSelected&&(this.data.formData=this.selectedRows[0].data,this.data.mode=P.D.EDIT,this.data.eventChannel.emit({action:Z.F.OPEN_FORM_IN_EDIT_MODE}),this.FunManFormC.showModal())}removePermanentDialog(){var o,n=this;this.leafSelected&&this.confirmationService.confirm({message:this.constantsS.functions.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,u.Z)(function*(){yield n.removePermanent()}),function(){return o.apply(this,arguments)})})}removePermanent(){var n=this;return(0,u.Z)(function*(){if(n.getSelectedRowId()){n.loading.grid=!0;try{const o=`${n.getSelectedRowGuid()}:${n.authCS.gUser._id}`,e=yield n.functionS.permanentDelete(o).toPromise();e.success?(n.notificationS.showSuccess(n.constantsS.functions.removePermanent),n.resetGridAndUrl(),yield n.loadTreeData(),n.leafSelected=!1):n.notificationS.showErrorFromResponse(e,n.constantsS.functions.removePermanentError)}catch{n.notificationS.showError(n.constantsS.functions.removePermanentError)}n.loading.grid=!1}})()}resetDependents(){var n=this;return(0,u.Z)(function*(){yield n.navigationCS.setQueryParam(v.p.custom_api,null)})()}functionSelected(){var n=this;return(0,u.Z)(function*(){n.resetDependents(),n.fillData(),n.getSelectedRowId()?n.generalS.setNewTitle(n.selectedRows[0].data.name,D.R.CUSTOM_APIS):n.generalS.setNewTitle("API Maker - Custom APIs"),n.leafSelected=!(!n.getSelectedRowId()||n.selectedRows[0].children?.length)})()}resetGridAndUrl(){this.selectedRows=void 0}fillData(){var n=this;return(0,u.Z)(function*(){if(!n.selectedRows)return void(yield n.navigationCS.setQueryParam(v.p.custom_api,""));const o=n.getSelectedRowId();o?yield n.navigationCS.setQueryParam(v.p.custom_api,o):n.resetDependents()})()}getSelectedRowId(){return this.selectedRows?.[0]?.data?._id}getSelectedRowGuid(){return this.selectedRows?.[0]?.data?.guid}dblClickCustomAPIsGrid(){setTimeout(()=>{this.edit()},10)}clone(){var n=this;return(0,u.Z)(function*(){yield n.cloneApiModalC.showModal(n.getSelectedRowId(),null,function(){var o=(0,u.Z)(function*(e){e&&(yield n.loadTreeData()),n.cd.detectChanges()});return function(e){return o.apply(this,arguments)}}())})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=Q.Yp;EModelApiPaths=G.k4;static \u0275fac=function(o){return new(o||a)(i.Y36(Y.d),i.Y36(T.b),i.Y36(k.W),i.Y36(K.S),i.Y36(B.D),i.Y36(q.L),i.Y36(W.u),i.Y36(i.sBO),i.Y36(d.F0),i.Y36(H.eN),i.Y36(f.YP))};static \u0275cmp=i.Xpm({type:a,selectors:[["app-custom-api-tree"]],viewQuery:function(o,e){if(1&o&&(i.Gf(tt,5),i.Gf(et,5)),2&o){let s;i.iGM(s=i.CRH())&&(e.FunManFormC=s.first),i.iGM(s=i.CRH())&&(e.cloneApiModalC=s.first)}},decls:24,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/custom.svg","alt","Custom API",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/apis-all/custom-apis/user-created-custom-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["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"],[1,"h-100"],["scrollHeight","calc(100vh - 82px)","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["funManFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],["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-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[1,"w-100","prevent-text-selection","cursor-pointer"],[4,"ngIf"],[1,"w-100"],[2,"width","40%"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["pTooltip","Running on native process","class","fas fa-radiation ml-2 text-danger",4,"ngIf"],["pTooltip","Caching enabled","class","fas fa-fighter-jet ml-2 text-warning",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[2,"text-align","right"],["href","javascript:",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["pTooltip","Running on native process",1,"fas","fa-radiation","ml-2","text-danger"],["pTooltip","Caching enabled",1,"fas","fa-fighter-jet","ml-2","text-warning"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,e){1&o&&(i.TgZ(0,"div",0)(1,"div",1)(2,"span"),i._UZ(3,"img",2),i._uU(4," Custom APIs"),i.qZA(),i.TgZ(5,"a",3),i._UZ(6,"img",4),i.qZA(),i.TgZ(7,"span")(8,"span",5),i.NdJ("click",function(){return e.navigateToGridView()}),i._UZ(9,"i",6),i.qZA(),i.TgZ(10,"span",7),i.NdJ("click",function(){return e.add()}),i._UZ(11,"i",8),i.qZA(),i.YNc(12,nt,2,0,"span",9),i.YNc(13,it,2,0,"span",10),i.YNc(14,st,2,0,"span",11),i.qZA()(),i.TgZ(15,"div",12)(16,"div",13)(17,"p-tree",14),i.NdJ("selectionChange",function(r){return e.selectedRows=r})("dblclick",function(){return e.dblClickCustomAPIsGrid()})("selectionChange",function(){return e.functionSelected()}),i.YNc(18,vt,3,2,"ng-template",15),i.qZA(),i.YNc(19,Tt,1,0,"p-progressSpinner",16),i.qZA()()(),i._UZ(20,"app-w-fun-man-form",17,18)(22,"app-clone-api-modal",19,20)),2&o&&(i.xp6(12),i.Q6J("ngIf",e.leafSelected),i.xp6(1),i.Q6J("ngIf",e.leafSelected),i.xp6(1),i.Q6J("ngIf",e.leafSelected),i.xp6(3),i.Q6J("value",e.treeNodes)("selection",e.selectedRows),i.xp6(2),i.Q6J("ngIf",e.loading.grid),i.xp6(1),i.Q6J("data",e.data),i.xp6(2),i.Q6J("modalId","idCloneCustomAPITree")("hostAndPort",e.BE_HOST_PORT)("modelApiPaths",e.EModelApiPaths.CUSTOM_APIS))},dependencies:[d.rH,t.mk,t.O5,j.s,f.jx,$.mp,z.G,V.u,X.u],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return a})();var At=l(7987);const xt=[{path:"",redirectTo:"functions-tree",pathMatch:"full"},{path:"functions-tree",component:(()=>{class a{route;constructor(n){this.route=n}ngOnInit(){}static \u0275fac=function(o){return new(o||a)(i.Y36(d.gz))};static \u0275cmp=i.Xpm({type:a,selectors:[["app-fun-man-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,e){1&o&&(i.TgZ(0,"div",0),i._UZ(1,"app-custom-api-tree"),i.qZA())},dependencies:[N],encapsulation:2})}return a})(),canActivate:[w.P]},{path:"functions",component:(()=>{class a{route;mode="tree";constructor(n){this.route=n}ngOnInit(){this.route.queryParams.subscribe(n=>{n.mode&&(this.mode=n.mode)})}static \u0275fac=function(o){return new(o||a)(i.Y36(d.gz))};static \u0275cmp=i.Xpm({type:a,selectors:[["app-fun-man-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(o,e){1&o&&(i.TgZ(0,"div",0),i._UZ(1,"app-custom-api-grid",1),i.qZA()),2&o&&(i.xp6(1),i.Q6J("showCheckbox",!1))},dependencies:[y.G],encapsulation:2})}return a})(),canActivate:[w.P]}];let Mt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=i.oAB({type:a});static \u0275inj=i.cJS({imports:[d.Bz.forChild(xt),J.u,At.X,L]})}return a})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6236],{4491:(C,u,s)=>{s.d(u,{g:()=>q});var m=s(5861),r=s(95),c=s(3157),l=s(328),E=s(9361),I=s(1162),p=s(553),D=s(5085),g=s(1601),f=s(3531),h=s(9989),e=s(4946),v=s(9961),M=s(7240),O=s(7414),T=s(2694),A=s(5852),S=s(2304),U=s(3429),Z=s(2915),F=s(3835),z=s(6814),b=s(2660),R=s(5860),y=s(756),x=s(7680),P=s(4844),L=s(3259),B=s(5025);const W=["insertCodeModalC"],K=["monacoEditorModalC"];function N(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Add Process Initializer"),e.qZA())}function J(i,_){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," View Process Initializer"),e.qZA())}function Y(i,_){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," Edit Process Initializer "),e.TgZ(3,"span",30),e._uU(4),e.qZA()()),2&i){const o=e.oxw();e.xp6(4),e.Oqu(o.form.get("name").value)}}function w(i,_){1&i&&(e.TgZ(0,"span",39),e._uU(1,"You can not change name later, it can be used in script."),e.qZA())}function V(i,_){if(1&i&&(e.TgZ(0,"div")(1,"form",31)(2,"div",32)(3,"label",33),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",34),e._UZ(6,"input",35),e.YNc(7,w,2,0,"span",36),e.qZA()(),e.TgZ(8,"div",32)(9,"label",33),e._uU(10,"Order"),e.qZA(),e.TgZ(11,"div",34),e._UZ(12,"input",37),e.qZA()(),e.TgZ(13,"div",32)(14,"label",33),e._uU(15,"Timeout in minutes"),e.qZA(),e.TgZ(16,"div",34),e._UZ(17,"input",38),e.qZA()()()()),2&i){const o=e.oxw();e.xp6(1),e.Q6J("formGroup",o.form),e.xp6(6),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD)}}function Q(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"div",40)(1,"app-monaco-editor",41),e.NdJ("editorGenerated",function(t){e.CHM(o);const n=e.oxw();return e.KtG(n.editorGenerated(t))}),e.qZA()()}if(2&i){const o=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",o.editorOptionsProcessInitializer)}}function G(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"a",42),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function k(i,_){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function j(i,_){if(1&i){const o=e.EpF();e.TgZ(0,"button",43),e.NdJ("click",function(){e.CHM(o);const t=e.oxw();return e.KtG(t.save())}),e._UZ(1,"i",44),e.YNc(2,H,2,0,"span",4),e.YNc(3,k,2,0,"span",4),e.qZA()}if(2&i){const o=e.oxw();e.Q6J("disabled",o.form.invalid),e.xp6(2),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT)}}function X(i,_){1&i&&e._UZ(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=l.D;form;subscriptions=[];formData;IEventData=c.F;id;BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.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,n,d,ee,oe,te,se,ae,ie,ne){this.fb=o,this.ns=a,this.generalS=t,this.constantsS=n,this.processInitializersS=d,this.authCS=ee,this.monacoS=oe,this.instanceS=te,this.eventCenterS=se,this.generalCS=ae,this.userS=ie,this.cd=ne}ngOnInit(){var o=this;return(0,m.Z)(function*(){o.createForm(),o.subscriptions.push(o.data.eventChannel.subscribe(function(){var a=(0,m.Z)(function*(t){if(t)if(o.form.enable(),t.action===c.F.OPEN_FORM_IN_EDIT_MODE)yield o.editViewLoadData(),o.form.get("name").disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_VIEW_MODE)yield o.editViewLoadData(),o.form.disable(),o.cd.detectChanges();else if(t.action===c.F.OPEN_FORM_IN_ADD_MODE){o.form.reset(),o.form.patchValue(t.data||{});const n=yield o.instanceS.getDefaultContent(o.BE_HOST_PORT,D.R.PROCESS_INITIALIZER).toPromise();o.editorOptionsProcessInitializer={readOnly:!1},o.generalCS.setValueInEditor(o,"editorPI",n.data),o.cd.detectChanges()}});return function(t){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var o=this;return(0,m.Z)(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,[r.kI.required]],order:[null,[r.kI.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.Z)(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 n=Object.assign({},t,a);n.user=o.authCS.getUserId(),n.processInitializerCode=o.editorPI.getValue();try{let d;o.loading.form=!0,o.lastError=void 0,o.monacoS.clearEditorDecorations(o.editorPI,o.monacoDecorations),o.data.mode===l.D.ADD?d=yield o.processInitializersS.post(n).toPromise():o.data.mode===l.D.EDIT&&(d=yield o.processInitializersS.put(n._id,n,{select:I.iH._id}).toPromise()),o.ns.showSuccess(o.data.mode===l.D.ADD?o.constantsS.processInitializer.addSuccess:o.constantsS.processInitializer.editSuccess),o.data.eventChannel.emit({action:o.data.mode===l.D.ADD?c.F.SAVED:c.F.UPDATED,data:d}),o.eventCenterS.processInitializersSavedAndUpdate.next(!0),o.loading.form=!1}catch(d){o.loading.form=!1,o.ns.showErrorFromResponse(d.error||d,"Unable to save process initializer."),o.lastError=d.error,o.tab=o.tab||{},o.tab.axiosResponse={data:d.error},o.monacoS.highlightErrorInMonacoEditor(o.editorPI,o.tab,"MainSandbox.ts",o.monacoDecorations)}o.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=E.H.All,this.insertCodeModalC.showModal(f.b.ProcessInitializersFormC).then()}editorGenerated(o){var a=this;return(0,m.Z)(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=E.H.All,a.data.mode!==l.D.VIEW&&a.insertCodeModalC.showModal(f.b.ProcessInitializersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(t=>{t.type&&t.type===h.g.TEXT_COPIED&&t.componentName===f.b.ProcessInitializersFormC&&(a.monacoS.insertAtCursor(o,t.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),g.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.processInitializersSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(r.qu),e.Y36(v.W),e.Y36(M.b),e.Y36(O.L),e.Y36(T.e),e.Y36(A.D),e.Y36(S.b),e.Y36(U.E),e.Y36(Z.u),e.Y36(M.b),e.Y36(F.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-process-initializers-form"]],viewQuery:function(a,t){if(1&a&&(e.Gf(W,5),e.Gf(K,5)),2&a){let n;e.iGM(n=e.CRH())&&(t.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(t.viewDockerfileModelC=n.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.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,N,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return t.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return t.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14),e.YNc(18,V,18,2,"div",4),e.qZA(),e.TgZ(19,"p-tabPanel",15),e.YNc(20,Q,2,2,"div",16),e.qZA()()(),e.TgZ(21,"div",17),e.YNc(22,G,2,0,"a",18),e.TgZ(23,"button",19),e.NdJ("click",function(){return t.hideModal()}),e._UZ(24,"i",20),e._uU(25," Close"),e.qZA(),e.YNc(26,j,4,3,"button",21),e.qZA(),e.YNc(27,X,1,0,"p-progressSpinner",22),e.qZA()()(),e._UZ(28,"app-insert-code-modal",23,24)(30,"app-monaco-editor-modal",25,26)),2&a&&(e.xp6(4),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT),e.xp6(12),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",t.lastError),e.xp6(4),e.Q6J("ngIf",t.data.mode!==t.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",t.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",t.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysProcessInitializer")("editorOptionsMonacoEditorModal",t.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.sg,r.u,z.O5,b.y,R.P,y.O,x.G,P.xf,P.x4,L.u,B.A],encapsulation:2,changeDetection:0})}return i})()},6236:(C,u,s)=>{s.d(u,{e:()=>I});var m=s(7017),c=(s(4491),s(4950)),l=s(4946);let I=(()=>{class p{static \u0275fac=function(f){return new(f||p)};static \u0275mod=l.oAB({type:p});static \u0275inj=l.cJS({imports:[m.u,c.A]})}return p})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6393],{6393:(ae,v,r)=>{r.r(v),r.d(v,{AdminUserM:()=>te});var b=r(7664),E=r(7017),e=r(4946),m=r(5861),c=r(3157),p=r(328),f=r(6212),M=r(6990),u=r(921),h=r(1162),U=r(3835),C=r(7240),A=r(9961),Z=r(5219),x=r(2189),y=r(204),P=r(2915),S=r(6814),_=r(5431),D=r(7680),N=r(3259),o=r(95),T=r(553),O=r(5852),R=r(2660);function Y(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",22),e._uU(2," Add User"),e.qZA())}function k(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," View User"),e.qZA())}function J(n,l){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Edit User"),e.qZA())}function Q(n,l){1&n&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",25),e.qZA()())}function V(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function q(n,l){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function G(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",27),e.YNc(2,V,2,0,"span",4),e.YNc(3,q,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function W(n,l){1&n&&e._UZ(0,"p-progressSpinner",28)}let w=(()=>{class n{fb;ns;userS;generalS;constantsCS;authCS;data;loading={form:!1};EFormMode=p.D;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,m.Z)(function*(a){if(a)if(t.form.enable(),a.action===c.F.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===c.F.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===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([o.kI.required,o.kI.minLength(4),o.kI.maxLength(40)]),t.form.get("password").updateValueAndValidity())});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[o.kI.required]],email:[null,[o.kI.required,o.kI.email]],apiPath:[null,[o.kI.required,o.kI.minLength(3),o.kI.maxLength(25),o.kI.pattern("[a-z0-9]*")]],password:[null,[]]})}showModal(){$("#idAMUsersForm").modal("show")}hideModal(){$("#idAMUsersForm").modal("hide")}save(){var t=this;return(0,m.Z)(function*(){const s=t.form.getRawValue();s.user=t.authCS.getUserId(),s.userType=u.d.ADMIN;try{let a;t.loading.form=!0,t.data.mode===p.D.ADD?(s.password=t.generalS.getEncryptedString(s.password,T.N.crypto.passCommunication),a=yield t.userS.post(s).toPromise(),t.ns.showSuccess(t.constantsCS.user.addSuccess)):t.data.mode===p.D.EDIT&&(t.data.formData._id&&(s.userType=t.data.formData.userType,t.form.get("password").value?s.password=t.generalS.getEncryptedString(s.password,T.N.crypto.passCommunication):delete s.password),a=yield t.userS.put(t.data.formData._id,s,{select:h.iH._id}).toPromise(),t.ns.showSuccess(t.constantsCS.user.editSuccess)),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?c.F.SAVED:c.F.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.Y36(o.qu),e.Y36(A.W),e.Y36(U.K),e.Y36(C.b),e.Y36(y.s),e.Y36(O.D))};static \u0275cmp=e.Xpm({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.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Y,3,0,"span",4),e.YNc(5,k,3,0,"span",4),e.YNc(6,J,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Email"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,Q,5,0,"div",15),e.TgZ(23,"div",10)(24,"label",11),e._uU(25,"API Path"),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",16),e.qZA()()()(),e.TgZ(28,"div",17)(29,"button",18),e._UZ(30,"i",19),e._uU(31," Close"),e.qZA(),e.YNc(32,G,4,3,"button",20),e.qZA(),e.YNc(33,W,1,0,"p-progressSpinner",21),e.qZA()()()),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",a.form),e.xp6(11),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(10),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form))},dependencies:[o._Y,o.Fj,o.JJ,o.JL,o.sg,o.u,S.O5,R.y,D.G],encapsulation:2})}return n})();const K=["adminUserFormC"];function H(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"span",14),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.edit())}),e._UZ(1,"i",15),e.qZA()}}function L(n,l){if(1&n){const t=e.EpF();e.TgZ(0,"span",16),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",17),e.qZA()}}function B(n,l){1&n&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Email"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"API Path"),e.qZA()())}function j(n,l){if(1&n&&(e.TgZ(0,"tr",18)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA()()),2&n){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.email),e.xp6(2),e.Oqu(t.apiPath)}}function X(n,l){1&n&&e._UZ(0,"p-progressSpinner",19)}let I=(()=>{class n{userS;generalS;notificationS;confirmationService;navigationCS;constantsCS;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=h.iH._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===c.F.SAVED||t.action===c.F.UPDATED)&&(this.adminUserFormC.hideModal(),this.loadGridData())}))}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{active:!0,userType:{$in:[u.d.ROOT,u.d.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,m.Z)(function*(i){i.success&&(t.selectedRows=[],t.rows=i.data,t.rowsMap=M.keyBy(t.rows,h.iH._id));const d=t.navigationCS.getQueryParam(f.p.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=p.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.adminUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=p.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.adminUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.adminUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,m.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,m.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,m.Z)(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,m.Z)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(f.p.user,null)})()}adminUserSelected(t){var s=this;return(0,m.Z)(function*(){s.selectedRows=t,s.resetDependents(),s.fillData()})()}fillData(){var t=this;return(0,m.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.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(f.p.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.Y36(U.K),e.Y36(C.b),e.Y36(A.W),e.Y36(Z.YP),e.Y36(x.S),e.Y36(y.s),e.Y36(P.u))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-w-admin-users"]],viewQuery:function(s,a){if(1&s&&e.Gf(K,5),2&s){let i;e.iGM(i=e.CRH())&&(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.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Users"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return a.add()}),e._UZ(6,"i",4),e.qZA(),e.YNc(7,H,2,0,"span",5),e.YNc(8,L,2,0,"span",6),e.qZA(),e.TgZ(9,"div",7)(10,"p-table",8),e.NdJ("selectionChange",function(d){return a.selectedRows=d})("dblclick",function(){return a.dblClickUsers()})("selectionChange",function(d){return a.adminUserSelected(d)}),e.YNc(11,B,7,0,"ng-template",9),e.YNc(12,j,7,4,"ng-template",10),e.qZA(),e.YNc(13,X,1,0,"p-progressSpinner",11),e.qZA()(),e._UZ(14,"app-w-admin-user-form",12,13)),2&s&&(e.xp6(7),e.Q6J("ngIf",a.selectedRows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.xp6(3),e.Q6J("ngIf",a.loading.grid),e.xp6(1),e.Q6J("data",a.data))},dependencies:[S.O5,_.iA,Z.jx,_.Ei,D.G,N.u,w],encapsulation:2})}return n})();const ee=[{path:"",component:(()=>{class n{constructor(){}ngOnInit(){}static \u0275fac=function(s){return new(s||n)};static \u0275cmp=e.Xpm({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.TgZ(0,"div",0),e._UZ(1,"app-w-admin-users",1),e.qZA())},dependencies:[I],encapsulation:2})}return n})(),canActivate:[r(1490).g]}];let te=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[b.Bz.forChild(ee),E.u]})}return n})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6401],{6401:($e,F,i)=>{i.r(F),i.d(F,{GroupM:()=>Ve});var q=i(7664),B=i(7017),K=i(3726),L=i(1025),Z=i(5085),e=i(4946),I=i(2915),w=i(5219),H=i(5043),V=i(3885),j=i(559),z=i(6937),X=i(740),ee=i(7595),te=i(9329),ne=i(356),se=i(3824),ae=i(8651),oe=i(2726),d=i(5861),C=i(3157),y=i(328),g=i(6212),c=i(6990),m=i(1162),R=i(8883),D=i(3429),ie=i(7629),re=i(2559),le=i(262),A=i(7240),E=i(9961),O=i(2189),N=i(5852),P=i(7414),pe=i(3065),M=i(6814),U=i(5431),T=i(7680),J=i(3259),h=i(95),ce=i(2660);function de(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",19),e._uU(2," Add Group"),e.qZA())}function ue(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",20),e._uU(2," View Group"),e.qZA())}function ge(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e._uU(2," Edit Group"),e.qZA())}function me(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save Group"),e.qZA())}function he(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update Group"),e.qZA())}function fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",23),e.YNc(2,me,2,0,"span",4),e.YNc(3,he,2,0,"span",4),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ve(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}let k=(()=>{class o{fb;ns;groupS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=y.D;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,d.Z)(function*(n){if(n)if(t.form.enable(),n.action===C.F.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.F.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.F.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.kI.required]]})}showModal(){$("#idGroupsForm").modal("show")}hideModal(){$("#idGroupsForm").modal("hide")}save(){var t=this;return(0,d.Z)(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.D.ADD?r=yield t.groupS.post(a).toPromise():t.data.mode===y.D.EDIT&&(r=yield t.groupS.put(t.data.formData._id,a,{select:m.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===y.D.ADD?t.constantsS.group.addSuccess:t.constantsS.group.editSuccess),t.data.eventChannel.emit({action:t.data.mode===y.D.ADD?C.F.SAVED:C.F.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.Y36(h.qu),e.Y36(E.W),e.Y36(R.e),e.Y36(A.b),e.Y36(N.D),e.Y36(P.L))};static \u0275cmp=e.Xpm({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.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,de,3,0,"span",4),e.YNc(5,ue,3,0,"span",4),e.YNc(6,ge,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()()()(),e.TgZ(17,"div",14)(18,"button",15),e._UZ(19,"i",16),e._uU(20," Close"),e.qZA(),e.YNc(21,fe,4,3,"button",17),e.qZA(),e.YNc(22,ve,1,0,"p-progressSpinner",18),e.qZA()()()),2&s&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(10),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[h._Y,h.Fj,h.JJ,h.JL,h.sg,h.u,M.O5,ce.y,T.G],encapsulation:2})}return o})();const Ce=["groupsFormC"];function Se(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function ye(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function _e(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function be(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24),e.qZA())}function Ie(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw();return e.KtG(r.saveGroupPermissions(n,a))}),e.qZA()}}function we(o,l){if(1&o&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ie,1,0,"i",26),e.qZA()()),2&o){const t=l.$implicit,s=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",s.selectedRows.indexOf(t)>-1)}}function Ae(o,l){1&o&&e._UZ(0,"p-progressSpinner",28)}let Y=(()=>{class o{groupS;instanceS;functionS;tpInstalledApisS;webSocketEventsS;generalS;notificationS;navigationCS;authCS;constantsS;apiS;eventCenterS;confirmationService;loading={grid:!1};subscriptions=[];data={mode:y.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=m.iH._id;groupsFormC;constructor(t,s,n,a,r,u,_,p,f,S,v,b,x){this.groupS=t,this.instanceS=s,this.functionS=n,this.tpInstalledApisS=a,this.webSocketEventsS=r,this.generalS=u,this.notificationS=_,this.navigationCS=p,this.authCS=f,this.constantsS=S,this.apiS=v,this.eventCenterS=b,this.confirmationService=x}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===C.F.SAVED||t.action===C.F.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,d.Z)(function*(a){a.success&&(t.selectedRows=[],t.rows=a.data,t.rowsMap=c.keyBy(t.rows,m.iH._id));const r=t.navigationCS.getQueryParam(g.p.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.D.ADD,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_ADD_MODE}),this.groupsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.VIEW,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_VIEW_MODE}),this.groupsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=y.D.EDIT,this.data.eventChannel.emit({action:C.F.OPEN_FORM_IN_EDIT_MODE}),this.groupsFormC.showModal()}clone(){var t=this;return(0,d.Z)(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,d.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.group.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,d.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,d.Z)(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,d.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([g.p.group,g.p.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,d.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,d.Z)(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,Z.R.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(g.p.group,t.selectedRows[0]._id)),s?.queryParams||t.resetDependents()})()}saveGroupPermissions(t,s){var n=this;return(0,d.Z)(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=c.uniq(n.eventCenterS.group.databaseNames.value),a.queryParams.collectionNames=c.uniq(n.eventCenterS.group.collectionNames.value),a.queryParams.supportedApiNames=c.uniq(n.eventCenterS.group.supportedApiIds.value),a.queryParams.fields=c.uniq(n.eventCenterS.group.fields.value),a.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),a.queryParams.systemApiNames=c.uniq(n.eventCenterS.group.systemApiIds.value),a.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,Z.R.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:m.iH._id}).toPromise();r&&r.success&&n.notificationS.showSuccess(n.constantsS.group.editSuccess)})()}getPermissionMap(t,s){const n=s.slice(1),a=c.groupBy(t,m.W$.instanceName);for(const r in a){const u=a[r]=c.groupBy(a[r],m.W$.databaseName);for(const _ in u){const p=u[_]=c.groupBy(u[_],m.W$.collectionName);for(const f in p)if(1===s.length){const S={};for(const v of p[f])S[v[s[0]]]=!0;p[f]=S}else{const S={};for(const v of p[f])S[v[s[0]]]=c.pick(v,n);p[f]=S}}}return a}getPermissionMapThirdPartyAPIs(t){const s=c.groupBy(t,m.W$.apiBundleName);for(const n in s){if("undefined"===n){delete s[n];continue}const a=s[n]=c.groupBy(s[n],m.W$.apiVersionName);for(const r in a){if("undefined"===r){delete a[r];continue}const u=a[r]=c.groupBy(a[r],m.W$.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.Y36(R.e),e.Y36(D.E),e.Y36(ie.d),e.Y36(re.d),e.Y36(le.a),e.Y36(A.b),e.Y36(E.W),e.Y36(O.S),e.Y36(N.D),e.Y36(P.L),e.Y36(pe.k),e.Y36(I.u),e.Y36(w.YP))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-groups"]],viewQuery:function(s,n){if(1&s&&e.Gf(Ce,5),2&s){let a;e.iGM(a=e.CRH())&&(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.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,Se,2,0,"span",8),e.YNc(11,ye,2,0,"span",9),e.YNc(12,_e,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(r){return n.selectedRows=r})("selectionChange",function(){return n.groupSelected()})("dblclick",function(){return n.dblClickGroups()}),e.YNc(15,be,4,0,"ng-template",13),e.YNc(16,we,5,3,"ng-template",14),e.qZA(),e.YNc(17,Ae,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-groups-form",16,17)),2&s&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[M.O5,U.iA,w.jx,U.Ei,T.G,J.u,k]})}return o})();var Me=i(3620),Te=i(1396),Ze=i(8057);function De(o,l){if(1&o&&(e.TgZ(0,"div")(1,"div",10),e._uU(2),e.qZA()()),2&o){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allFieldsPermitted)}}function Ne(o,l){if(1&o&&(e.TgZ(0,"span",18),e._uU(1),e.qZA()),2&o){const t=e.oxw().$implicit;e.xp6(1),e.AsE(" [",t.instanceName.substr(0,3).toUpperCase(),"] [",t.databaseName.substr(0,3).toUpperCase(),"] ")}}function Pe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",19)(1,"label",20)(2,"p-checkbox",21),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowRead=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()(),e.TgZ(3,"label",22)(4,"p-checkbox",23),e.NdJ("ngModelChange",function(n){e.CHM(t);const a=e.oxw().$implicit;return e.KtG(a.allowWrite=n)})("click",function(n){e.CHM(t);const a=e.oxw().$implicit,r=e.oxw(2);return r.generalS.stopPropagation(n),e.KtG(r.removeDataItemFromSelectedRows(a))}),e.qZA()()()}if(2&o){const t=e.oxw().$implicit;e.xp6(2),e.Q6J("ngModel",t.allowRead)("binary",!0),e.xp6(2),e.Q6J("ngModel",t.allowWrite)("binary",!0)}}function xe(o,l){if(1&o&&(e.TgZ(0,"div",15),e._uU(1),e.YNc(2,Ne,2,2,"span",16),e.YNc(3,Pe,5,4,"span",17),e.qZA()),2&o){const t=l.$implicit,s=e.oxw(2);e.xp6(1),e.hij(" ",t.label||t.name," "),e.xp6(1),e.Q6J("ngIf",t.level1),e.xp6(1),e.Q6J("ngIf",!t.level1&&(!t.children||0===t.children.length)&&s.selectedRows.indexOf(t)>=0)}}function Ge(o,l){1&o&&e._UZ(0,"p-progressSpinner",24)}function Fe(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"div",11)(1,"p-tree",12),e.NdJ("selectionChange",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.selectedRows=n)})("selectionChange",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.checkedChange())})("onNodeSelect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeSelected(n))})("onNodeUnselect",function(n){e.CHM(t);const a=e.oxw();return e.KtG(a.nodeUnSelected(n))}),e.YNc(2,xe,4,3,"ng-template",13),e.qZA(),e.YNc(3,Ge,1,0,"p-progressSpinner",14),e.qZA()}if(2&o){const t=e.oxw();e.xp6(1),e.Q6J("value",t.propertiesListData)("selection",t.selectedRows)("metaKeySelection",!1),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}let Q=(()=>{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,Me.b)(300)).subscribe(function(){var s=(0,d.Z)(function*(n){yield t.loadSchemas()});return function(n){return s.apply(this,arguments)}}()))}loadSchemas(){var t=this;return(0,d.Z)(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 p of a){const f=[];if(p.propertyItems){const b=[];for(const x of p.propertyItems){const G=t.generalS.convertKTreeItemToPrimeNGTreeItem(x);t.setReadWriteRecursively(n,G),b.push(G),f.push(G)}u.push(b)}const S=p.instanceName+":"+p.databaseName+":"+p.collectionName,v={label:`${p.collectionName}`,children:f,_id:S,level1:!0,instanceName:p.instanceName,databaseName:p.databaseName,collectionName:p.collectionName};r.push(v),t.allTreeItemsMap[S]=v;for(const b of v?.children||[])b.parent=v}t.propertiesListData=r;for(const p of u)t.generateIdMap(p,t.allTreeItemsMap);if(t.eventCenterS.group.fields.value.join(",")){const p=c.intersection(c.keys(t.allTreeItemsMap),t.eventCenterS.group.fields.value);t.selectedRows=[];for(const f of p)t.allTreeItemsMap[f]&&t.selectedRows.push(t.allTreeItemsMap[f]);t.generalS.setDataInSelectedRowsFromIdArr(p,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,d.Z)(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(c.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.Y36(D.E),e.Y36(I.u),e.Y36(P.L),e.Y36(A.b))};static \u0275cmp=e.Xpm({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.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Schema Fields"),e.qZA(),e.TgZ(5,"span",3)(6,"label",4)(7,"p-checkbox",5),e.NdJ("ngModelChange",function(r){return n.eventCenterS.group.apisRegex.allFields=r}),e.qZA()()()(),e.TgZ(8,"div",6)(9,"div",7),e.YNc(10,De,3,1,"div",8),e.YNc(11,Fe,4,4,"div",9),e.qZA()()()),2&s&&(e.xp6(7),e.Q6J("ngModel",n.eventCenterS.group.apisRegex.allFields)("binary",!0),e.xp6(3),e.Q6J("ngIf",n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields),e.xp6(1),e.Q6J("ngIf",!(n.eventCenterS.group.apisRegex.allInstances||n.eventCenterS.group.apisRegex.allDatabases||n.eventCenterS.group.apisRegex.allCollections||n.eventCenterS.group.apisRegex.allFields)))},dependencies:[h.JJ,h.On,M.O5,w.jx,Te.mp,T.G,J.u,Ze.XZ],encapsulation:2})}return o})();function Re(o,l){1&o&&(e.TgZ(0,"div",21),e._UZ(1,"app-w-instances",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function Ee(o,l){1&o&&(e.TgZ(0,"div",22),e._UZ(1,"app-w-databases",10),e.qZA()),2&o&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const Oe=function(){return[50,50]};let W=(()=>{class o{eventCenterS;EAPICategory=Z.R;constructor(t){this.eventCenterS=t}ngOnInit(){}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}static \u0275fac=function(s){return new(s||o)(e.Y36(I.u))};static \u0275cmp=e.Xpm({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.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e._UZ(4,"app-w-groups"),e.qZA()(),e.TgZ(5,"div",4)(6,"div",3),e._UZ(7,"app-w-api-categories",5),e.qZA()(),e.TgZ(8,"div",6)(9,"p-splitter",7),e.YNc(10,Re,2,3,"ng-template",8),e.YNc(11,Ee,2,3,"ng-template",8),e.qZA()(),e.TgZ(12,"div",9)(13,"div",3),e._UZ(14,"app-w-collections",10),e.qZA()(),e.TgZ(15,"div",11)(16,"div",3),e._UZ(17,"app-w-supported-api",12),e.qZA()(),e.TgZ(18,"div",13)(19,"div",3),e._UZ(20,"app-w-schema-fields"),e.qZA()(),e.TgZ(21,"div",14)(22,"div",3),e._UZ(23,"app-w-supported-tp-api",15),e.qZA()(),e.TgZ(24,"div",16)(25,"div",3),e._UZ(26,"app-custom-api-grid",17),e.qZA()(),e.TgZ(27,"div",18)(28,"div",3),e._UZ(29,"app-system-api-w",17),e.qZA()(),e.TgZ(30,"div",19)(31,"div",3),e._UZ(32,"app-web-socket-events-grid",20),e.qZA()()()(),e._UZ(33,"app-create-schema-form")),2&s&&(e.xp6(5),e.Udp("display",n.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","GROUP"),e.xp6(1),e.Udp("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.xp6(1),e.Q6J("panelSizes",e.DdM(41,Oe)),e.xp6(3),e.Udp("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.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("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.xp6(2),e.Q6J("isLPM",!1)("isDependentOnGroup",!0)("treeViewId","treeViewFromGroupLayout"),e.xp6(1),e.Udp("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.xp6(3),e.Udp("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.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("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.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("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.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!1),e.xp6(1),e.Udp("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.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!1))},dependencies:[w.jx,H.q,V.f,j.O,z.n,X.c,ee.G,te.X,ne.T,se.d,ae.A,oe.x,Y,Q],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(3965);var Ye=i(1678),Qe=i(5765),We=i(4211),qe=i(4186),Be=i(2777),Ke=i(7705),Le=i(1434);const He=[{path:"group-layout",component:W,canActivate:[K.P]}];let Ve=(()=>{class o{static \u0275fac=function(s){return new(s||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[q.Bz.forChild(He),B.u,Ye.DashboardM,We.DbCellM,Qe.FunctionManM,qe.SystemApiM,Le.B,Be.u,Ke.L,L.WebSocketEventsM]})}return o})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[6925,8374,8682,1617],{6925:(l,o,c)=>{c.d(o,{Eg:()=>i,Yp:()=>a,ZF:()=>_,vT:()=>t});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}(_||{})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7368],{7368:(xe,S,s)=>{s.r(S),s.d(S,{SandboxSettingsM:()=>fe});var O=s(7664),D=s(3726),y=s(7017),M=s(5249),r=s(5861),e=s(4946),u=s(6990),v=s(3157),c=s(328),k=s(1162),h=s(553),I=s(4371),x=s(5852),b=s(3835),w=s(5405),Z=s(9961),p=s(5219),T=s(7414),U=s(2304),N=s(4977),P=s(3429),E=s(1344),J=s(7240),g=s(95),_=s(6814),R=s(8147),G=s(1861),q=s(756),f=s(5431),K=s(7680),C=s(4844),A=s(3259),Y=s(2660);function F(a,l){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th",28),e._uU(4,"Action"),e.qZA()())}function H(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",31)(1,"button",32),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw();return e.KtG(d.editAllowedOrigin(n,o))}),e._UZ(2,"i",33),e.qZA(),e.TgZ(3,"button",34),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw();return e.KtG(d.removeAllowedOrigin(n,o))}),e._UZ(4,"i",35),e.qZA()()}}function L(a,l){if(1&a&&(e.TgZ(0,"tr",29)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,H,5,0,"div",30),e.qZA()()),2&a){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function Q(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",37),e.TgZ(2,"span"),e._uU(3,"Save"),e.qZA()()}}let V=(()=>{class a{authCS;userS;eventCenterCS;notificationS;cs;confirmationService;modalId="idAllowedOriginModal";subscriptions=[];allowedOriginsGridData=[];saveSettings=new e.vpe;gridKeyAllowedOrigins="name";allowedOriginModel={domainName:"",domainNameBak:""};exampleOrigin=location.origin;allowedOriginData={mode:c.D.ADD};EFormMode=c.D;selectedRowsUI=[];constructor(t,i,n,o,d,m){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=o,this.cs=d,this.confirmationService=m}ngOnInit(){}save(){var t=this;return(0,r.Z)(function*(){if(t.allowedOriginData.mode===c.D.ADD)t.allowedOriginsGridData.push({name:t.allowedOriginModel.domainName});else{const i=t.allowedOriginsGridData.findIndex(n=>n.name===t.allowedOriginModel.domainNameBak);t.allowedOriginsGridData[i].name=t.allowedOriginModel.domainName}t.allowedOriginsGridData=u.uniqBy(t.allowedOriginsGridData,"name"),t.saveSettings.emit(),t.hideAllowedOriginModal()})()}showAllowedOriginModal(){$("#idAllowedOriginModal").modal("show")}hideAllowedOriginModal(){$("#idAllowedOriginModal").modal("hide")}addAllowedOrigin(){var t=this;return(0,r.Z)(function*(){t.allowedOriginModel.domainNameBak=t.allowedOriginModel.domainName="",t.allowedOriginData.mode=c.D.ADD,t.showAllowedOriginModal()})()}editAllowedOrigin(t,i){var n=this;return(0,r.Z)(function*(){n.allowedOriginModel.domainNameBak=n.allowedOriginModel.domainName=i.name,n.allowedOriginData.mode=c.D.EDIT,n.showAllowedOriginModal()})()}doubleClick(){this.editAllowedOrigin(null,this.selectedRowsUI[0]).then()}removeAllowedOrigin(t,i){var n=this;return(0,r.Z)(function*(){var o;n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentAllowedOriginConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.Z)(function*(){yield n.removeAO(t,i)}),function(){return o.apply(this,arguments)})})})()}removeAO(t,i){var n=this;return(0,r.Z)(function*(){const o=n.allowedOriginsGridData.findIndex(d=>d.name===i.name);n.allowedOriginsGridData.splice(o,1),n.saveSettings.emit()})()}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||a)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(T.L),e.Y36(p.YP))};static \u0275cmp=e.Xpm({type:a,selectors:[["allowed-origin-c"]],inputs:{allowedOriginsGridData:["allowedOrigins","allowedOriginsGridData"]},outputs:{saveSettings:"saveSettings"},decls:37,vars:10,consts:[[1,"card","shadow-sm","mt-2","mr-1","mb-5",2,"height","384px"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],["pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-0","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","350px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["aria-hidden","true","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",3,"id"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["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","mt-3","mb-0"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","name","spellcheck","false","type","text","placeholder","Please provide domain name",1,"form-control","form-control-sm",3,"ngModel","blur","ngModelChange"],[1,"form-group","row"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],[2,"width","100px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[1,"text-center"],["pTooltip","Edit","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"]],template:function(i,n){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Allowed Origins"),e.qZA(),e.TgZ(5,"span",3),e.NdJ("click",function(){return n.addAllowedOrigin()}),e._UZ(6,"i",4),e.qZA()(),e.TgZ(7,"div",5)(8,"p-table",6),e.NdJ("selectionChange",function(d){return n.selectedRowsUI=d})("dblclick",function(){return n.doubleClick()}),e.YNc(9,F,5,0,"ng-template",7),e.YNc(10,L,5,3,"ng-template",8),e.qZA()()(),e.TgZ(11,"div",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"span"),e._UZ(16,"i",13),e._uU(17," Allowed Origins"),e.qZA(),e.TgZ(18,"button",14)(19,"span",15),e._UZ(20,"i",16),e.qZA()()(),e.TgZ(21,"div",17)(22,"div",18)(23,"label",19),e._uU(24,"Domain name"),e.qZA(),e.TgZ(25,"div",20)(26,"input",21),e.NdJ("blur",function(){return n.allowedOriginModel.domainName=n.allowedOriginModel.domainName.toLowerCase()})("ngModelChange",function(d){return n.allowedOriginModel.domainName=d}),e.qZA()()(),e.TgZ(27,"div",22),e._UZ(28,"label",19),e.TgZ(29,"div",20)(30,"label",23),e._uU(31),e.qZA()()()(),e.TgZ(32,"div",24)(33,"button",25),e._UZ(34,"i",26),e._uU(35," Close"),e.qZA(),e.YNc(36,Q,4,0,"button",27),e.qZA()()()()),2&i&&(e.xp6(8),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRowsUI)("dataKey",n.gridKeyAllowedOrigins)("scrollable",!0)("value",n.allowedOriginsGridData),e.xp6(3),e.s9C("id",n.modalId),e.xp6(15),e.Q6J("ngModel",n.allowedOriginModel.domainName),e.xp6(5),e.hij("(Ex: ",n.exampleOrigin,")"),e.xp6(5),e.Q6J("ngIf",n.allowedOriginData.mode!==n.EFormMode.VIEW))},dependencies:[g.Fj,g.JJ,g.On,_.O5,Y.y,f.iA,p.jx,f.Ei,A.u],encapsulation:2})}return a})();const B=["addNpmLibC"],j=["allowedOriginC"],W=["SandboxSettingsPkgVersionsModalC"];function z(a,l){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",49)(2,"th",50),e.TgZ(3,"th",51),e._uU(4,"Version"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.TgZ(7,"th",52),e._uU(8,"Sub Dependencies"),e.qZA(),e.TgZ(9,"th",53),e._uU(10,"Third Party API"),e.qZA(),e.TgZ(11,"th",54),e._uU(12,"Default"),e.qZA(),e.TgZ(13,"th",55),e._uU(14,"Action"),e.qZA()())}function X(a,l){1&a&&e._UZ(0,"i",64)}function ee(a,l){1&a&&e._UZ(0,"i",65)}function te(a,l){if(1&a&&(e.TgZ(0,"div",67),e._uU(1),e.qZA()),2&a){const t=l.$implicit;e.xp6(1),e.AsE("",t.name," @",t.version,"")}}function ne(a,l){if(1&a&&(e.TgZ(0,"div"),e.YNc(1,te,2,2,"div",66),e.qZA()),2&a){const t=l.$implicit;e.xp6(1),e.Q6J("ngForOf",t.dependencies)}}function ie(a,l){1&a&&e._UZ(0,"i",68)}function ae(a,l){1&a&&e._UZ(0,"i",68)}function oe(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",61)(1,"button",69),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.editData(n,o))}),e._UZ(2,"i",70),e.qZA(),e.TgZ(3,"button",71),e.NdJ("click",function(n){e.CHM(t);const o=e.oxw().$implicit,d=e.oxw(2);return e.KtG(d.removePermanentDialog(n,o))}),e._UZ(4,"i",72),e.qZA()()}}function se(a,l){if(1&a&&(e.TgZ(0,"tr",56)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,X,1,0,"i",57),e.YNc(5,ee,1,0,"i",58),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",59),e.YNc(12,ne,2,1,"div",60),e.qZA()(),e.TgZ(13,"td",61),e.YNc(14,ie,1,0,"i",62),e.qZA(),e.TgZ(15,"td",61),e.YNc(16,ae,1,0,"i",62),e.qZA(),e.TgZ(17,"td"),e.YNc(18,oe,5,0,"div",63),e.qZA()()),2&a){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(3),e.Q6J("ngForOf",t.subDependencies),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",!t.isReadOnly)}}function le(a,l){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",49),e.TgZ(2,"th",51),e._uU(3,"Version"),e.qZA(),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th",73),e._uU(7,"Third Party API"),e.qZA(),e.TgZ(8,"th",51),e._uU(9,"Default"),e.qZA()())}function de(a,l){1&a&&e._UZ(0,"i",68)}function re(a,l){1&a&&e._UZ(0,"i",68)}function ce(a,l){if(1&a&&(e.TgZ(0,"tr",56)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e.YNc(8,de,1,0,"i",62),e.qZA(),e.TgZ(9,"td"),e.YNc(10,re,1,0,"i",62),e.qZA()()),2&a){const t=l.$implicit,i=l.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.version),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isThirdPartyApi),e.xp6(2),e.Q6J("ngIf",t.isDefault)}}function ge(a,l){1&a&&e._UZ(0,"p-progressSpinner",74)}function me(a,l){if(1&a){const t=e.EpF();e.TgZ(0,"div",5)(1,"div",6)(2,"button",7),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.loadGridData())}),e._UZ(3,"i",8),e._uU(4," Refresh "),e.qZA(),e.TgZ(5,"button",9),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e._UZ(6,"i",10),e._uU(7," Save "),e.qZA()(),e.TgZ(8,"div",11)(9,"div",12)(10,"span"),e._UZ(11,"i",13),e._uU(12," Settings"),e.qZA()(),e.TgZ(13,"div",14)(14,"div",15)(15,"div",16)(16,"label",17),e._uU(17,"Sandbox Count"),e.qZA(),e.TgZ(18,"input",18),e.NdJ("ngModelChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.settings.sandbox.sandboxCountOverrideAdmin=n)}),e.qZA(),e.TgZ(19,"div",19)(20,"span",20)(21,"span"),e._uU(22,"1 CPU core will have one process and one process will have these many sandbox."),e.qZA(),e._UZ(23,"br"),e.TgZ(24,"span"),e._uU(25,"Ideally it should be 1-2."),e.qZA()()()(),e.TgZ(26,"div",21)(27,"label",17),e._uU(28,"Automatic Sandbox Restart In Seconds"),e.qZA(),e.TgZ(29,"input",22),e.NdJ("ngModelChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.settings.sandbox.automaticSandboxRestartInSeconds=n)}),e.qZA(),e.TgZ(30,"div",19)(31,"span",20)(32,"span",23),e._uU(33,"All sandbox will be restarted automatically after these many seconds across all servers, without failing any request."),e.qZA(),e._UZ(34,"br"),e.qZA()()()()()(),e.TgZ(35,"div",11)(36,"div",12)(37,"span"),e._UZ(38,"i",24),e._uU(39," Sandbox Dependencies"),e.qZA(),e.TgZ(40,"div",25)(41,"a",26),e._UZ(42,"img",27),e.qZA()(),e.TgZ(43,"span",28),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showLibraryModel())}),e._UZ(44,"i",29),e.qZA()(),e.TgZ(45,"div",30)(46,"p-tabView",31)(47,"p-tabPanel",32)(48,"p-table",33),e.NdJ("selectionChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRowsUI=n)})("dblclick",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.summaryTableDoubleClick())}),e.YNc(49,z,15,0,"ng-template",34),e.YNc(50,se,19,10,"ng-template",35),e.qZA()(),e.TgZ(51,"p-tabPanel",36)(52,"p-table",37),e.NdJ("selectionChange",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.selectedRowsPackageJson=n)}),e.YNc(53,le,10,0,"ng-template",34),e.YNc(54,ce,11,6,"ng-template",35),e.qZA()()(),e.YNc(55,ge,1,0,"p-progressSpinner",38),e.qZA()(),e.TgZ(56,"div",11)(57,"div",12)(58,"span"),e._UZ(59,"i",39),e._uU(60," Docker File"),e.qZA(),e.TgZ(61,"span",40),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.resetDockerfileToDefault())}),e._UZ(62,"i",41),e.qZA(),e.TgZ(63,"span",42),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.showDockerImageBuildLogs())}),e._UZ(64,"i",43),e.qZA()(),e.TgZ(65,"div",44)(66,"app-monaco-editor",45),e.NdJ("editorGenerated",function(n){e.CHM(t);const o=e.oxw();return e.KtG(o.editorGenerated(n))}),e.qZA()()(),e.TgZ(67,"allowed-origin-c",46,47),e.NdJ("saveSettings",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.saveSettings(n.EFormMode.EDIT))}),e.qZA(),e.TgZ(69,"div",48),e._uU(70,"\xa0"),e.qZA()()}if(2&a){const t=e.oxw();e.xp6(18),e.Q6J("ngModel",t.settings.sandbox.sandboxCountOverrideAdmin),e.xp6(11),e.Q6J("ngModel",t.settings.sandbox.automaticSandboxRestartInSeconds),e.xp6(19),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsUI)("dataKey",t.gridKey)("scrollable",!0)("value",t.packageSummary),e.xp6(4),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",t.selectedRowsPackageJson)("dataKey",t.gridKey)("scrollable",!0)("value",t.finalPackageJson),e.xp6(3),e.Q6J("ngIf",t.loading.form),e.xp6(11),e.Q6J("editorOptions",t.editorOptionsDocker),e.xp6(1),e.Q6J("allowedOrigins",t.settings.allowedOrigins)}}const pe=[{path:"main",component:(()=>{class a{authCS;userS;eventCenterCS;notificationS;confirmationService;cs;monacoS;tpStoreApiVersionS;instanceS;feStoreCS;generalCS;STORE_BE_HOST_PORT=h.N.STORE_BE_HOST_PORT;BE_HOST_PORT=h.N.BE_HOST_PORT;subscriptions=[];data={mode:c.D.ADD,eventChannel:new e.vpe,formData:void 0};packageSummary=[];selectedRowsUI=[];gridKey="rowId";counter;EFormMode=c.D;finalPackageJson=[];selectedRowsPackageJson=[];showAll=!1;loading={form:!1};settings;tpNpmPackageAndVersion={};tpApiVersionIdMap;tpApiBundleIdMap;editorDocker;editorOptionsDocker={readOnly:!1,language:"dockerfile",contextmenu:!0};addNpmLibC;allowedOriginC;SandboxSettingsPkgVersionsModalC;constructor(t,i,n,o,d,m,ue,_e,Se,ve,he){this.authCS=t,this.userS=i,this.eventCenterCS=n,this.notificationS=o,this.confirmationService=d,this.cs=m,this.monacoS=ue,this.tpStoreApiVersionS=_e,this.instanceS=Se,this.feStoreCS=ve,this.generalCS=he}ngOnInit(){var t=this;return(0,r.Z)(function*(){t.subscriptions.push(t.eventCenterCS.sandboxDep.subscribe(i=>{if(t.data.mode===c.D.ADD){for(const n of t.packageSummary)if(n.name===i.name&&n.isDefault)return void t.notificationS.showError("You can not override default package.");t.packageSummary.unshift(i),t.rowIdSet(),t.notificationS.showSuccess(t.cs.amUserSandboxDepSetting.addSuccess),t.addNpmLibC.hideModal()}})),yield t.loadGridData(),t.generalCS.setNewTitle("API Maker - Sandbox Settings")})()}loadGridData(){var t=this;return(0,r.Z)(function*(){const i=yield t.userS.getAdminSettings(t.authCS.getUserId()).toPromise();t.settings=i.data||{},t.packageSummary=t.settings.sandbox.dependenciesUI.nodeJS,t.finalPackageJson=t.settings.sandbox.dependencies.nodeJS;const n=t.settings.allowedOrigins||[];t.settings.sandbox&&(t.settings.sandbox.automaticSandboxRestartInSeconds=t.settings.sandbox.automaticSandboxRestartInSeconds||null),n.sort(),t.settings.allowedOrigins=u.map(n,o=>({name:o})),t.rowIdSet();for(const o of t.finalPackageJson)o.rowId=(t.counter++).toString();t.generalCS.setValueInEditor(t,"editorDocker",t.settings.dockerFile||"")})()}editorGenerated(t){var i=this;return(0,r.Z)(function*(){i.editorDocker=t,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(t,n=>{i.saveSettings()})})()}rowIdSet(){this.counter=1;for(const t of this.packageSummary)t.rowId=(this.counter++).toString()}showLibraryModel(){this.data.formData=void 0,this.data.mode=c.D.ADD,this.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_ADD_MODE}),this.addNpmLibC.showModal()}saveSettings(t){var i=this;return(0,r.Z)(function*(){try{const n=i.authCS.getUserId();if(i?.settings?.sandbox?.sandboxCountOverrideAdmin>5)return void i.notificationS.showError("More than 5 sandbox are not allowed.");const o={settings:{sandbox:{sandboxCountOverrideAdmin:i.settings.sandbox.sandboxCountOverrideAdmin,automaticSandboxRestartInSeconds:i.settings.sandbox.automaticSandboxRestartInSeconds||null,dependencies:{nodeJS:i.packageSummary.filter(m=>!m.isReadOnly&&!m.isThirdPartyApi&&!m.isDefault)}},dockerFile:i.editorDocker.getValue(),allowedOrigins:u.map(i.allowedOriginC.allowedOriginsGridData,"name").sort()}};(yield i.userS.put(n,o,{select:k.iH._id}).toPromise())&&(t===c.D.EDIT?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.editSuccess):"DELETE"===t?i.notificationS.showSuccess(i.cs.amUserSandboxDepSetting.removePermanent):t||i.notificationS.showSuccess("Success")),i.loadGridData().then()}catch(n){i.loading.form=!1,i.notificationS.showErrorFromResponse(n.error||n,"Unable to save settings.")}})()}removePermanentDialog(t,i){var n=this;return(0,r.Z)(function*(){var o;t.stopPropagation(),t.preventDefault(),n.confirmationService.confirm({message:n.cs.amUserSandboxDepSetting.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,r.Z)(function*(){yield n.removePermanent(i)}),function(){return o.apply(this,arguments)})})})()}removePermanent(t){var i=this;return(0,r.Z)(function*(){i.packageSummary.splice(i.packageSummary.indexOf(t),1),i.saveSettings("DELETE").then()})()}loadDependenciesAndSchemas(){var t=this;return(0,r.Z)(function*(){const{tpNpmPackageAndVersion:i,tpApiBundleIdMap:n,tpApiVersionIdMap:o}=(yield t.instanceS.getInstalledPackagesAndSchemas().toPromise()).data;t.tpNpmPackageAndVersion=i,t.tpApiBundleIdMap=n,t.tpApiVersionIdMap=o})()}commonPackageAddRemoveTasks(){var t=this;return(0,r.Z)(function*(){yield t.loadDependenciesAndSchemas()})()}editData(t,i){var n=this;return(0,r.Z)(function*(){t?.stopPropagation(),t?.preventDefault(),n.data.formData=i,n.data.mode=c.D.EDIT,n.data.eventChannel.emit({action:v.F.OPEN_FORM_IN_EDIT_MODE}),yield n.SandboxSettingsPkgVersionsModalC.showPkgVersions(i.name)})()}hideNpmLibModel(){this.addNpmLibC.hideModal()}resetDockerfileToDefault(){var t=this;return(0,r.Z)(function*(){try{const i=yield t.feStoreCS.geDefaultDockerfile(t.BE_HOST_PORT);t.editorDocker.setValue(i.data)}catch(i){t.notificationS.showErrorFromResponse(i.error||i,"Unable to reset docker file.")}})()}showDockerImageBuildLogs(){var t=this;return(0,r.Z)(function*(){const i=t.eventCenterCS.headerC,n=i.systemLogsModelC.systemLogsListC.filterOptions.find(o=>o.value===I.g.DOCKER_IMAGE_BUILD_LOGS);i.showSystemLogsModal(n)})()}summaryTableDoubleClick(){var t=this;setTimeout((0,r.Z)(function*(){if(t.selectedRowsUI[0]){let i;for(const n of t.packageSummary)n[t.gridKey]===t.selectedRowsUI[0].rowId&&(i=n);i&&!i.isReadOnly&&(yield t.editData(null,i))}}),100)}ngOnDestroy(){for(const t of this.subscriptions)t.unsubscribe()}static \u0275fac=function(i){return new(i||a)(e.Y36(x.D),e.Y36(b.K),e.Y36(w.M),e.Y36(Z.W),e.Y36(p.YP),e.Y36(T.L),e.Y36(U.b),e.Y36(N.f),e.Y36(P.E),e.Y36(E.e),e.Y36(J.b))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-sandbox-settings-c"]],viewQuery:function(i,n){if(1&i&&(e.Gf(B,5),e.Gf(j,5),e.Gf(W,5)),2&i){let o;e.iGM(o=e.CRH())&&(n.addNpmLibC=o.first),e.iGM(o=e.CRH())&&(n.allowedOriginC=o.first),e.iGM(o=e.CRH())&&(n.SandboxSettingsPkgVersionsModalC=o.first)}},decls:6,vars:9,consts:[["class","pt-1 pl-5 pr-5 full-body overflow-auto",4,"ngIf"],[3,"data","pkgVersionModal","modalId","hostAndPort"],["addNpmLibC",""],[3,"modalId","hostAndPort","data","dependencies","saveUpdateSandboxDep","hideLibraryModelEventEmitter","installed"],["pkgVersionsModalC","","SandboxSettingsPkgVersionsModalC",""],[1,"pt-1","pl-5","pr-5","full-body","overflow-auto"],[1,"cursor-pointer","text-right","mr-1"],[1,"btn","btn-primary","btn-sm","mt-1","mr-1",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw","cursor-pointer"],[1,"btn","btn-success","btn-sm","mt-1",3,"click"],[1,"fas","fa-save","fa-fw","cursor-pointer"],[1,"card","shadow-sm","mt-2","mr-1"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"card-body","p-3","overflow-hidden"],[1,"container"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["name","Setting","type","number","placeholder","Please provide value",1,"col-2","form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"col-6","pr-0"],[1,"small","text-info"],[1,"row","mt-3"],["name","automaticSandboxRestartInSeconds","type","number","placeholder","Automatic sandbox restart in seconds",1,"col-2","form-control","form-control-sm",3,"ngModel","ngModelChange"],[1,"mt-2","d-inline-block"],[1,"fas","fa-box","text-warning","fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/settings/sandboxSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"card-body","p-2","overflow-hidden"],[1,"w-100"],["header","Summary"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["header","Final package.json"],["styleClass","p-datatable-striped","scrollHeight","400px",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fab","fa-docker","fa-fw","mr-1","text-info"],["tooltipPosition","left","pTooltip","Reset dockerfile to default",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-undo","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","View logs of docker image build",1,"float-right","cursor-pointer","ml-2",3,"click"],[1,"fas","fa-water","text-info","fa-fw"],[1,"card-body","p-1","overflow-hidden",2,"height","400px"],[3,"editorOptions","editorGenerated"],[3,"allowedOrigins","saveSettings"],["allowedOriginC",""],[1,"mb-5"],[2,"width","55px"],[2,"width","40px"],[2,"width","100px"],[2,"width","200px"],[1,"text-center",2,"width","150px"],[1,"text-center",2,"width","100px"],[1,"text-center",2,"width","130px"],[3,"pSelectableRow"],["class","fas fa-circle fa-fw text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw text-muted text-v-small",4,"ngIf"],[1,"small"],[4,"ngFor","ngForOf"],[1,"text-center"],["class","fas fa-check fa-fw text-success pt-1",4,"ngIf"],["class","text-center",4,"ngIf"],[1,"fas","fa-circle","fa-fw","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","text-muted","text-v-small"],["class","pl-3",4,"ngFor","ngForOf"],[1,"pl-3"],[1,"fas","fa-check","fa-fw","text-success","pt-1"],["pTooltip","Edit","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete","tooltipPosition","left",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],[2,"width","150px"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){if(1&i&&(e.YNc(0,me,71,17,"div",0),e._UZ(1,"find-npm-package",1,2),e.TgZ(3,"app-sandbox-settings-pkg-versions-modal",3,4),e.NdJ("saveUpdateSandboxDep",function(d){return n.saveSettings(d)})("hideLibraryModelEventEmitter",function(){return n.hideNpmLibModel()})("installed",function(){return n.commonPackageAddRemoveTasks()}),e.qZA()),2&i){const o=e.MAs(4);e.Q6J("ngIf",n.settings),e.xp6(1),e.Q6J("data",n.data)("pkgVersionModal",o)("modalId","idAddNpmSandboxSettings")("hostAndPort",n.STORE_BE_HOST_PORT),e.xp6(2),e.Q6J("modalId","idAddNpmSandboxSettingsEdit")("hostAndPort",n.STORE_BE_HOST_PORT)("data",n.data)("dependencies",n.tpNpmPackageAndVersion)}},dependencies:[g.Fj,g.wV,g.JJ,g.On,_.sg,_.O5,R.K,G.S,q.O,f.iA,p.jx,f.Ei,K.G,C.xf,C.x4,A.u,V],encapsulation:2})}return a})(),canActivate:[D.P]}];let fe=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[O.Bz.forChild(pe),y.u,M.ApiTestingM]})}return a})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2442],{2442:(ne,f,o)=>{o.r(f),o.d(f,{ExtLicensesM:()=>q});var v=o(7060),C=o(1570),I=o(1709),y=o(2173),c=o(467),m=o(1325),p=o(6645),S=o(5632),e=o(540),x=o(7237),L=o(3860),U=o(6129),k=o(6268),P=o(6708),b=o(4752),u=o(5779),F=o(1987),A=o(3966),l=o(4341),h=o(177),R=o(3478),g=o(7645),T=o(7515),j=o(8542);function w(i,r){1&i&&(e.j41(0,"span",5),e.nrm(1,"i",31),e.k0s())}function G(i,r){1&i&&(e.j41(0,"tr")(1,"th",32),e.EFF(2,"#"),e.k0s(),e.j41(3,"th",32),e.EFF(4,"\xa0"),e.k0s(),e.j41(5,"th",33),e.EFF(6,"License Key"),e.k0s(),e.j41(7,"th",34),e.EFF(8,"Server Info"),e.k0s(),e.j41(9,"th",35),e.EFF(10,"Action Required"),e.k0s(),e.j41(11,"th",36),e.EFF(12,"Actions"),e.k0s()())}function D(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",47),e.k0s())}function K(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",48),e.k0s())}function N(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",49),e.k0s())}function M(i,r){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s(),e.j41(3,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.hideLicenseKey(n))}),e.nrm(4,"i",51),e.k0s()()}if(2&i){const t=e.XpG().$implicit;e.R7$(2),e.JRh(t.licenseKey)}}function B(i,r){if(1&i){const t=e.RV6();e.j41(0,"div")(1,"span"),e.EFF(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.k0s(),e.j41(3,"a",50),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.showLicenseKey(n))}),e.nrm(4,"i",52),e.k0s()()}}function X(i,r){1&i&&(e.j41(0,"span"),e.nrm(1,"i",53),e.EFF(2," All good"),e.k0s())}function O(i,r){if(1&i&&(e.j41(0,"div")(1,"span"),e.EFF(2),e.k0s()()),2&i){const t=r.$implicit;e.R7$(2),e.SpI("\u274c ",t.message,"")}}function V(i,r){if(1&i&&(e.j41(0,"div"),e.DNE(1,O,3,1,"div",54),e.k0s()),2&i){const t=e.XpG().$implicit;e.R7$(1),e.Y8G("ngForOf",t.licenseError)}}function Y(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",55),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.resetMacAddress(n))}),e.nrm(1,"i",56),e.k0s()}}function H(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",57),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.showDialogToGetNewLicenseKey(n))}),e.nrm(1,"i",58),e.k0s()}}function J(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",59),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.reduceUsage__click(n,"REDUCE_CPU_USAGE"))}),e.nrm(1,"i",60),e.k0s()}}function W(i,r){if(1&i){const t=e.RV6();e.j41(0,"a",61),e.bIt("click",function(){e.eBV(t);const n=e.XpG().$implicit,a=e.XpG();return e.Njj(a.reduceUsage__click(n,"REDUCE_UI_PAGES_USAGE"))}),e.nrm(1,"i",62),e.k0s()}}function Z(i,r){if(1&i&&(e.j41(0,"tr",37)(1,"td",38),e.EFF(2),e.k0s(),e.j41(3,"td",38),e.DNE(4,D,2,0,"span",39),e.DNE(5,K,2,0,"span",39),e.DNE(6,N,2,0,"span",39),e.k0s(),e.j41(7,"td",40),e.DNE(8,M,5,1,"div",39),e.DNE(9,B,5,0,"div",39),e.k0s(),e.j41(10,"td")(11,"span"),e.EFF(12),e.k0s(),e.nrm(13,"br"),e.j41(14,"a",41),e.EFF(15),e.k0s()(),e.j41(16,"td",42),e.DNE(17,X,3,0,"span",39),e.DNE(18,V,2,1,"div",39),e.k0s(),e.j41(19,"td",38),e.DNE(20,Y,2,0,"a",43),e.DNE(21,H,2,0,"a",44),e.DNE(22,J,2,0,"a",45),e.DNE(23,W,2,0,"a",46),e.k0s()()),2&i){const t=r.$implicit,s=r.rowIndex;e.Y8G("pSelectableRow",t),e.R7$(2),e.JRh(s+1),e.R7$(2),e.Y8G("ngIf","PENDING"===t.licenseCheckStatus),e.R7$(1),e.Y8G("ngIf","VALID"===t.licenseCheckStatus),e.R7$(1),e.Y8G("ngIf","INVALID"===t.licenseCheckStatus),e.R7$(2),e.Y8G("ngIf",t.showLicenseKey),e.R7$(1),e.Y8G("ngIf",!t.showLicenseKey),e.R7$(3),e.JRh(t.hostName),e.R7$(2),e.FS9("href",t.beHostPort,e.B4B),e.R7$(1),e.JRh(t.beHostPort),e.R7$(2),e.Y8G("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.R7$(1),e.Y8G("ngIf",t.licenseError.length),e.R7$(2),e.Y8G("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0),e.R7$(1),e.Y8G("ngIf",t.licenseActions.indexOf("REDUCE_UI_PAGES_USAGE")>=0)}}function z(i,r){1&i&&e.nrm(0,"p-progressSpinner",63)}const Q=[{path:"",component:(()=>{class i{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=m.l;EAPICategory=S.O;gridKey=p.GX._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,n,a,d,E,ee,te,se){this.authCS=t,this.authS=s,this.generalCS=n,this.instanceS=a,this.ns=d,this.navigationS=E,this.confirmationService=ee,this.constantsS=te,this.eventCenterS=se}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==m.l.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,c.A)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,n=_.groupBy(s,p.qb.hostName);for(const a in n)t.serverList.push(n[a][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,c.A)(function*(){var n;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,c.A)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(a){console.log(a),s.ns.showErrorFromResponse(a.error||a,"Unable to reset MAC address of license.")}}),function(){return n.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,c.A)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to reset MAC address of license.")}})()}reduceUsage__click(t,s){var n=this;let a="";var d;"REDUCE_CPU_USAGE"===s?a=this.constantsS.license.setCPUCoreConfirm:"REDUCE_UI_PAGES_USAGE"===s&&(a=this.constantsS.license.setUIPageCountConfirm),this.confirmationService.confirm({message:a,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,c.A)(function*(){"REDUCE_CPU_USAGE"===s?yield n.hitReduceAPICallForCPU(t):"REDUCE_UI_PAGES_USAGE"===s&&(yield n.hitReduceAPICallForDBMasters(t))}),function(){return d.apply(this,arguments)})})}hitReduceAPICallForCPU(t){var s=this;return(0,c.A)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsCPU)?.licensePermitsCPU;if(!n)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set CPU core of license.")}})()}hitReduceAPICallForDBMasters(t){var s=this;return(0,c.A)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsDBMasterCount)?.licensePermitsDBMasterCount;if(!n)return void s.ns.showError("Unable to find UI Pages count issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"UI_PAGES_COUNT",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,dbMasterCount:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("UI Pages count set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set UI Pages count of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,c.A)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||i)(e.rXU(x.l),e.rXU(L.Y),e.rXU(U.f),e.rXU(k.J),e.rXU(P.m),e.rXU(b.O),e.rXU(u.td),e.rXU(F.X),e.rXU(A.d))};static \u0275cmp=e.VBU({type:i,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.svg","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","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-plus","text-success","fa-fw","mr-1"],["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"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[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,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fab","fa-html5","text-success","fa-fw","pt-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)(4,"span"),e.nrm(5,"img",4),e.EFF(6," Server List "),e.k0s(),e.j41(7,"div",5),e.DNE(8,w,2,0,"span",6),e.k0s()(),e.j41(9,"div",7)(10,"p-table",8),e.DNE(11,G,13,0,"ng-template",9),e.DNE(12,Z,24,16,"ng-template",10),e.k0s(),e.DNE(13,z,1,0,"p-progressSpinner",11),e.k0s()()()(),e.j41(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e.nrm(19,"i",16),e.EFF(20," Set License Key"),e.k0s(),e.j41(21,"button",17)(22,"span",18),e.nrm(23,"i",19),e.k0s()()(),e.j41(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e.EFF(28,"Name"),e.k0s(),e.j41(29,"div",24)(30,"input",25),e.bIt("ngModelChange",function(d){return n.newLicenseKey=d}),e.k0s()()()()(),e.j41(31,"div",26)(32,"button",27),e.nrm(33,"i",28),e.EFF(34," Close "),e.k0s(),e.j41(35,"button",29),e.bIt("click",function(){return n.setLicenseKeyAPICall(n.setLicenseKeyForObj)}),e.nrm(36,"i",30),e.j41(37,"span"),e.EFF(38,"Set Key"),e.k0s()()()()()()),2&s&&(e.R7$(8),e.Y8G("ngIf",n.showValidationInProgress),e.R7$(2),e.Y8G("selectionMode","multiple")("dataKey",n.gridKey)("scrollable",!0)("value",n.serverList),e.R7$(3),e.Y8G("ngIf",n.loading.grid),e.R7$(17),e.Y8G("ngModel",n.newLicenseKey))},dependencies:[l.qT,l.me,l.BC,l.cb,l.vS,l.cV,h.Sq,h.bT,R.U,g.XI,u.Ei,g.d5,T.p,j.m],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return i})(),canActivate:[y.Z]}];let q=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=e.$C({type:i});static \u0275inj=e.G2t({imports:[v.iI.forChild(Q),I.u,C.P]})}return i})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[7436],{7436:(ne,f,o)=>{o.r(f),o.d(f,{ExtLicensesM:()=>z});var v=o(7664),C=o(7213),Z=o(7017),y=o(3726),r=o(5861),p=o(921),u=o(1162),U=o(5085),e=o(4946),E=o(5852),S=o(4795),I=o(7240),A=o(3429),T=o(9961),L=o(5561),m=o(5219),P=o(7414),w=o(2915),l=o(95),g=o(6814),b=o(2660),h=o(5431),K=o(7680),M=o(3259);function N(i,c){1&i&&(e.TgZ(0,"span",5),e._UZ(1,"i",31),e.qZA())}function k(i,c){1&i&&(e.TgZ(0,"tr")(1,"th",32),e._uU(2,"#"),e.qZA(),e.TgZ(3,"th",32),e._uU(4,"\xa0"),e.qZA(),e.TgZ(5,"th",33),e._uU(6,"License Key"),e.qZA(),e.TgZ(7,"th",34),e._uU(8,"Server Info"),e.qZA(),e.TgZ(9,"th",35),e._uU(10,"Action Required"),e.qZA(),e.TgZ(11,"th",36),e._uU(12,"Actions"),e.qZA()())}function D(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e.qZA())}function F(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",48),e.qZA())}function q(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",49),e.qZA())}function J(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"a",50),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.hideLicenseKey(n))}),e._UZ(4,"i",51),e.qZA()()}if(2&i){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.licenseKey)}}function Y(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"div")(1,"span"),e._uU(2,"\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7\xb7"),e.qZA(),e.TgZ(3,"a",50),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.showLicenseKey(n))}),e._UZ(4,"i",52),e.qZA()()}}function O(i,c){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",53),e._uU(2," All good"),e.qZA())}function R(i,c){if(1&i&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&i){const t=c.$implicit;e.xp6(2),e.hij("\u274c ",t.message,"")}}function G(i,c){if(1&i&&(e.TgZ(0,"div"),e.YNc(1,R,3,1,"div",54),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.licenseError)}}function B(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",55),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.resetMacAddress(n))}),e._UZ(1,"i",56),e.qZA()}}function Q(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",57),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.showDialogToGetNewLicenseKey(n))}),e._UZ(1,"i",58),e.qZA()}}function H(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",59),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.reduceUsage__click(n,"REDUCE_CPU_USAGE"))}),e._UZ(1,"i",60),e.qZA()}}function V(i,c){if(1&i){const t=e.EpF();e.TgZ(0,"a",61),e.NdJ("click",function(){e.CHM(t);const n=e.oxw().$implicit,a=e.oxw();return e.KtG(a.reduceUsage__click(n,"REDUCE_UI_PAGES_USAGE"))}),e._UZ(1,"i",62),e.qZA()}}function j(i,c){if(1&i&&(e.TgZ(0,"tr",37)(1,"td",38),e._uU(2),e.qZA(),e.TgZ(3,"td",38),e.YNc(4,D,2,0,"span",39),e.YNc(5,F,2,0,"span",39),e.YNc(6,q,2,0,"span",39),e.qZA(),e.TgZ(7,"td",40),e.YNc(8,J,5,1,"div",39),e.YNc(9,Y,5,0,"div",39),e.qZA(),e.TgZ(10,"td")(11,"span"),e._uU(12),e.qZA(),e._UZ(13,"br"),e.TgZ(14,"a",41),e._uU(15),e.qZA()(),e.TgZ(16,"td",42),e.YNc(17,O,3,0,"span",39),e.YNc(18,G,2,1,"div",39),e.qZA(),e.TgZ(19,"td",38),e.YNc(20,B,2,0,"a",43),e.YNc(21,Q,2,0,"a",44),e.YNc(22,H,2,0,"a",45),e.YNc(23,V,2,0,"a",46),e.qZA()()),2&i){const t=c.$implicit,s=c.rowIndex;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(s+1),e.xp6(2),e.Q6J("ngIf","PENDING"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","VALID"===t.licenseCheckStatus),e.xp6(1),e.Q6J("ngIf","INVALID"===t.licenseCheckStatus),e.xp6(2),e.Q6J("ngIf",t.showLicenseKey),e.xp6(1),e.Q6J("ngIf",!t.showLicenseKey),e.xp6(3),e.Oqu(t.hostName),e.xp6(2),e.s9C("href",t.beHostPort,e.LSH),e.xp6(1),e.Oqu(t.beHostPort),e.xp6(2),e.Q6J("ngIf","VALID"===t.licenseCheckStatus&&0===t.licenseError.length),e.xp6(1),e.Q6J("ngIf",t.licenseError.length),e.xp6(2),e.Q6J("ngIf",t.licenseActions.indexOf("RESET_MAC")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("LICENSE_NOT_FOUND")>=0||t.licenseActions.indexOf("EXPIRED")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_CPU_USAGE")>=0),e.xp6(1),e.Q6J("ngIf",t.licenseActions.indexOf("REDUCE_UI_PAGES_USAGE")>=0)}}function W(i,c){1&i&&e._UZ(0,"p-progressSpinner",63)}const X=[{path:"",component:(()=>{class i{authCS;authS;generalCS;instanceS;ns;navigationS;confirmationService;constantsS;eventCenterS;EUserType=p.d;EAPICategory=U.R;gridKey=u.iH._id;loading={grid:!1};serverList=[];newLicenseKey="";setLicenseKeyForObj;showValidationInProgress;constructor(t,s,n,a,d,x,ee,te,se){this.authCS=t,this.authS=s,this.generalCS=n,this.instanceS=a,this.ns=d,this.navigationS=x,this.confirmationService=ee,this.constantsS=te,this.eventCenterS=se}ngOnInit(){return this.authS.backendSettings.extensions?this.authCS.gUser?.userType!==p.d.ADMIN?this.navigationS.gotoDashboard():(this.generalCS.setNewTitle("AM - Extensions Licenses"),void this.loadData().then()):this.navigationS.gotoDashboard()}loadData(){var t=this;return(0,r.Z)(function*(){t.loading.grid=!0;try{t.serverList=[];const s=(yield t.instanceS.getFullSystemInfo().toPromise()).data,n=_.groupBy(s,u.GR.hostName);for(const a in n)t.serverList.push(n[a][0])}catch(s){console.log(s),t.ns.showErrorFromResponse(s.error||s,"Unable to load server information.")}t.loading.grid=!1})()}resetMacAddress(t){var s=this;return(0,r.Z)(function*(){var n;s.confirmationService.confirm({message:s.constantsS.license.resetMacAddressConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(n=(0,r.Z)(function*(){try{yield s.instanceS.resetMacAddressOfLicense({key:t.licenseKey}).toPromise(),s.ns.showSuccess("MAC address reset successfully."),s.setUIAfterFix(1e4)}catch(a){console.log(a),s.ns.showErrorFromResponse(a.error||a,"Unable to reset MAC address of license.")}}),function(){return n.apply(this,arguments)})})})()}showLicenseKey(t){t.showLicenseKey=!0}hideLicenseKey(t){t.showLicenseKey=!1}showModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("show")}hideModalSetLicenseKey(){$("#idSetLicenseKeyModal").modal("hide")}showDialogToGetNewLicenseKey(t){this.setLicenseKeyForObj=t,this.newLicenseKey=t.licenseKey,this.showModalSetLicenseKey()}setLicenseKeyAPICall(t){var s=this;return(0,r.Z)(function*(){try{yield s.instanceS.setLicenseKeyOnServer({updateMode:"LICENSE_KEY",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,licenseKey:s.newLicenseKey,serverName:t.hostName}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("License key set successfully."),s.setUIAfterFix(6e3)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to reset MAC address of license.")}})()}reduceUsage__click(t,s){var n=this;let a="";var d;"REDUCE_CPU_USAGE"===s?a=this.constantsS.license.setCPUCoreConfirm:"REDUCE_UI_PAGES_USAGE"===s&&(a=this.constantsS.license.setUIPageCountConfirm),this.confirmationService.confirm({message:a,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,r.Z)(function*(){"REDUCE_CPU_USAGE"===s?yield n.hitReduceAPICallForCPU(t):"REDUCE_UI_PAGES_USAGE"===s&&(yield n.hitReduceAPICallForDBMasters(t))}),function(){return d.apply(this,arguments)})})}hitReduceAPICallForCPU(t){var s=this;return(0,r.Z)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsCPU)?.licensePermitsCPU;if(!n)return void s.ns.showError("Unable to find CPU core issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"CPU_CORE",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,cpuCore:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("CPU core set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set CPU core of license.")}})()}hitReduceAPICallForDBMasters(t){var s=this;return(0,r.Z)(function*(){try{const n=(t.licenseError||[]).find(a=>a.licensePermitsDBMasterCount)?.licensePermitsDBMasterCount;if(!n)return void s.ns.showError("Unable to find UI Pages count issue in license error.");yield s.instanceS.setLicenseKeyOnServer({updateMode:"UI_PAGES_COUNT",uniqueServerId:t.uniqueServerId,uniqueProcessId:t.uniqueProcessId,workerId:t.workerId,serverName:t.hostName,dbMasterCount:n}).toPromise(),s.hideModalSetLicenseKey(),s.ns.showSuccess("UI Pages count set successfully."),s.setUIAfterFix(1e4)}catch(n){console.log(n),s.ns.showErrorFromResponse(n.error||n,"Unable to set UI Pages count of license.")}})()}setUIAfterFix(t){var s=this;this.loadData().then(),this.showValidationInProgress=!0,setTimeout((0,r.Z)(function*(){yield s.loadData(),s.showValidationInProgress=!1,yield s.eventCenterS.headerC.setLicenseHasIssues(s.serverList)}),t)}static \u0275fac=function(s){return new(s||i)(e.Y36(E.D),e.Y36(S.e),e.Y36(I.b),e.Y36(A.E),e.Y36(T.W),e.Y36(L.X),e.Y36(m.YP),e.Y36(P.L),e.Y36(w.u))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ext-licenses"]],decls:39,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],[1,"full-body","overflow-hidden"],[1,"card"],[1,"card-header"],["src","/assets/images/icons/license.svg","alt","Extension license icon",1,"fa-fw","mr-1",2,"vertical-align","text-top"],[1,"float-right"],["class","float-right",4,"ngIf"],[1,"card-body","p-0","overflow-auto","text-center",2,"height","calc(100vh - 88px)"],["styleClass","p-datatable-striped custom-api-grid-height","scrollHeight","flex",3,"selectionMode","dataKey","scrollable","value"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSetLicenseKeyModal","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-plus","text-success","fa-fw","mr-1"],["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"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["name","licenseKey","spellcheck","false","type","text","autocomplete","off",1,"form-control","form-control-sm","font-monospaced",3,"ngModel","ngModelChange"],[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,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["tooltipPosition","left","pTooltip","Validation in progress.",1,"fas","fa-sync-alt","text-success","fa-fw","fa-spin"],[1,"text-center","bg-table-header",2,"width","30px"],[1,"bg-table-header",2,"width","300px"],[1,"bg-table-header",2,"width","240px"],[1,"bg-table-header"],[1,"text-center","bg-table-header",2,"width","125px"],[3,"pSelectableRow"],[1,"text-center"],[4,"ngIf"],[1,"small","font-monospaced"],["target","_blank",1,"ml-2","small","text-muted",3,"href"],[1,""],["class","btn btn-xsm-custom ml-1","pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set license key","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["class","btn btn-xsm-custom ml-1","pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",3,"click",4,"ngIf"],["pTooltip","License validation will happen in future.",1,"fas","fa-circle","text-warning"],["pTooltip","Valid license",1,"fas","fa-circle","text-success"],["pTooltip","Invalid license",1,"fas","fa-circle","text-danger"],["href","javascript:",1,"btn","btn-xsm-custom","ml-2",3,"click"],[1,"fas","fa-eye-slash","fa-fw","pt-1"],[1,"fas","fa-eye","fa-fw","pt-1"],[1,"fas","fa-check","fa-fw","text-success"],[4,"ngFor","ngForOf"],["pTooltip","Reset registered mac address.","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-history","text-info","fa-fw","pt-1"],["pTooltip","Set license key","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-wrench","text-success","fa-fw","pt-1"],["pTooltip","Set CPU core usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fas","fa-microchip","text-success","fa-fw","pt-1"],["pTooltip","Set UI Pages usage from license","tooltipPosition","left","href","javascript:",1,"btn","btn-xsm-custom","ml-1",3,"click"],[1,"fab","fa-html5","text-success","fa-fw","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,n){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),e._UZ(5,"img",4),e._uU(6," Server List "),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,N,2,0,"span",6),e.qZA()(),e.TgZ(9,"div",7)(10,"p-table",8),e.YNc(11,k,13,0,"ng-template",9),e.YNc(12,j,24,16,"ng-template",10),e.qZA(),e.YNc(13,W,1,0,"p-progressSpinner",11),e.qZA()()()(),e.TgZ(14,"div",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"span"),e._UZ(19,"i",16),e._uU(20," Set License Key"),e.qZA(),e.TgZ(21,"button",17)(22,"span",18),e._UZ(23,"i",19),e.qZA()()(),e.TgZ(24,"div",20)(25,"form",21)(26,"div",22)(27,"label",23),e._uU(28,"Name"),e.qZA(),e.TgZ(29,"div",24)(30,"input",25),e.NdJ("ngModelChange",function(d){return n.newLicenseKey=d}),e.qZA()()()()(),e.TgZ(31,"div",26)(32,"button",27),e._UZ(33,"i",28),e._uU(34," Close "),e.qZA(),e.TgZ(35,"button",29),e.NdJ("click",function(){return n.setLicenseKeyAPICall(n.setLicenseKeyForObj)}),e._UZ(36,"i",30),e.TgZ(37,"span"),e._uU(38,"Set Key"),e.qZA()()()()()()),2&s&&(e.xp6(8),e.Q6J("ngIf",n.showValidationInProgress),e.xp6(2),e.Q6J("selectionMode","multiple")("dataKey",n.gridKey)("scrollable",!0)("value",n.serverList),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(17),e.Q6J("ngModel",n.newLicenseKey))},dependencies:[l._Y,l.Fj,l.JJ,l.JL,l.On,l.F,g.sg,g.O5,b.y,h.iA,m.jx,h.Ei,K.G,M.u],styles:[".bg-table-header[_ngcontent-%COMP%]{background-color:#272727}"]})}return i})(),canActivate:[y.P]}];let z=(()=>{class i{static \u0275fac=function(s){return new(s||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[v.Bz.forChild(X),Z.u,C.S]})}return i})()}}]);
|