@sava-info-systems/api-maker-with-extensions 1.8.3 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/1097.js +1 -1
  2. package/dist/1558.js +1 -1
  3. package/dist/1678.js +1 -1
  4. package/dist/2473.js +1 -1
  5. package/dist/4186.js +1 -1
  6. package/dist/5249.js +1 -1
  7. package/dist/5334.js +1 -1
  8. package/dist/5765.js +1 -1
  9. package/dist/8125.js +1 -1
  10. package/dist/9575.js +1 -0
  11. package/dist/9939.js +1 -1
  12. package/dist/assets/images/icons/swagger-logo.svg +9 -0
  13. package/dist/assets/schema-types/InterfaceProps.ts +2 -0
  14. package/dist/assets/schema-types/store-types.ts +2 -1
  15. package/dist/assets/schema-types/types.ts +129 -8
  16. package/dist/assets/swagger/favicon-16x16.png +0 -0
  17. package/dist/assets/swagger/favicon-32x32.png +0 -0
  18. package/dist/assets/swagger/index.css +16 -0
  19. package/dist/assets/swagger/index.html +23 -0
  20. package/dist/assets/swagger/oauth2-redirect.html +79 -0
  21. package/dist/assets/swagger/swagger-initializer.js +20 -0
  22. package/dist/assets/swagger/swagger-ui-bundle.js +2 -0
  23. package/dist/assets/swagger/swagger-ui-es-bundle-core.js +3 -0
  24. package/dist/assets/swagger/swagger-ui-es-bundle.js +2 -0
  25. package/dist/assets/swagger/swagger-ui-standalone-preset.js +2 -0
  26. package/dist/assets/swagger/swagger-ui.css +3 -0
  27. package/dist/assets/swagger/swagger-ui.js +2 -0
  28. package/dist/common.js +1 -1
  29. package/dist/index.html +4 -1
  30. package/dist/main.js +1 -1
  31. package/main.js +1 -1
  32. package/package.json +7 -5
  33. package/sandbox/assets/schema-types/types.js +11 -0
  34. package/sandbox/sandbox.js +1 -1
  35. package/src/assets/schema-types/store-types.ts +2 -1
  36. package/src/assets/schema-types/types.ts +129 -8
  37. package/src/public/dist-db-masters/browser/main.js +47 -47
  38. package/src/public/index.hbs +2 -2
  39. package/src/tools/install_utils/SetEnvInFrontend.js +3 -1
package/dist/1678.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1678,6925,8374,8682,1617],{7747:(U,E,o)=>{o.d(E,{o:()=>H});var d=o(5861),t=o(95),u=o(3157),g=o(328),v=o(6990),x=o(7848),h=o(1162),n=o(4946),M=o(9961),A=o(3429),O=o(7240),s=o(5852),w=o(1429),R=o(2915),b=o(115),F=o(7414),N=o(6814),L=o(2660),y=o(7680),P=o(3965);function K(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",29),n._uU(2," Add Instance"),n.qZA())}function Z(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",30),n._uU(2," View Instance"),n.qZA())}function B(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",31),n._uU(2," Edit Instance"),n.qZA())}function J(f,C){if(1&f&&(n.TgZ(0,"div")(1,"div",10)(2,"label",11),n._uU(3,"Username"),n.qZA(),n.TgZ(4,"div",12),n._UZ(5,"p-dropdown",32),n.qZA()(),n.TgZ(6,"div",10)(7,"label",11),n._uU(8,"Password"),n.qZA(),n.TgZ(9,"div",12),n._UZ(10,"p-dropdown",33),n.qZA()(),n.TgZ(11,"div",10)(12,"label",11),n._uU(13,"Privilege"),n.qZA(),n.TgZ(14,"div",12),n._UZ(15,"p-dropdown",34),n.qZA()()()),2&f){const a=n.oxw();n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.privileges)("filter",!0)}}function W(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"a",35),n.NdJ("click",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.openSecret())}),n._UZ(1,"i",36),n._uU(2," Open Secret "),n.qZA()}}function Y(f,C){1&f&&n._UZ(0,"i",37)}function G(f,C){1&f&&n._UZ(0,"i",38)}function Q(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Save Instance"),n.qZA())}function k(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Update Instance"),n.qZA())}function V(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"button",39),n.NdJ("click",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.save())}),n._UZ(1,"i",40),n.YNc(2,Q,2,0,"span",4),n.YNc(3,k,2,0,"span",4),n.qZA()}if(2&f){const a=n.oxw();n.Q6J("disabled",a.form.invalid||a.loading.form),n.xp6(2),n.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function z(f,C){1&f&&n._UZ(0,"p-progressSpinner",41)}let H=(()=>{class f{fb;ns;instanceS;generalS;authCS;dataProviderS;eventCenterS;secretS;constantsS;data;loading={form:!1};EFormMode=g.D;EInstanceType=x.d;IInstanceProps=h.Il;form;subscriptions=[];instanceTypes=[];privileges=[];connectionStringSecrets=[];instanceTested;isFromMarkTested;constructor(a,_,l,m,D,S,j,X,q){this.fb=a,this.ns=_,this.instanceS=l,this.generalS=m,this.authCS=D,this.dataProviderS=S,this.eventCenterS=j,this.secretS=X,this.constantsS=q}ngOnInit(){var a=this;return(0,d.Z)(function*(){a.instanceTypes=a.dataProviderS.getInstanceTypes(),a.privileges=a.dataProviderS.getListOfOraclePrivilege(),a.createForm(),a.subscriptions.push(a.data.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(l){if(l)if(a.form.enable(),yield a.loadConnectionStringFromSecret(),l.action===u.F.OPEN_FORM_IN_EDIT_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.instanceTested=!1,a.isFromMarkTested=!1}else if(l.action===u.F.OPEN_FORM_IN_VIEW_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.form.disable(),a.instanceTested=!1,a.isFromMarkTested=!1}else l.action===u.F.OPEN_FORM_IN_ADD_MODE&&(a.form.reset(),a.setDefaultValuesInForm(),a.instanceTested=!1,a.isFromMarkTested=!1)});return function(l){return _.apply(this,arguments)}}())),a.subscriptions.push(a.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(l){l&&l.action===u.F.UPDATED&&(a.eventCenterS.headerC.secManFormC.hideModal(),yield a.loadConnectionStringFromSecret())});return function(l){return _.apply(this,arguments)}}()))})()}showModal(){$("#idInstancesForm").modal("show")}hideModal(){$("#idInstancesForm").modal("hide")}createForm(){this.form=this.fb.group({type:[null,[t.kI.required]],name:[null,[t.kI.required]],connectionString:[null,[t.kI.required]],username:[null,[]],password:[null,[]],privilege:[null,[]],maxPoolConnections:[null,[t.kI.required]]}),this.manageValidations()}manageValidations(){this.form.valueChanges.subscribe(()=>{this.instanceTested=!1,this.isFromMarkTested=!1});const a=this.form.get(h.Il.type),_=this.form.get(h.Il.username),l=this.form.get(h.Il.password),m=this.form.get(h.Il.privilege);a.valueChanges.subscribe(function(){var D=(0,d.Z)(function*(S){S&&(S===x.d.ORACLE_DB?(_.setValidators([t.kI.required]),l.setValidators([t.kI.required]),m.setValidators([t.kI.required])):(_.setValidators([]),l.setValidators([]),m.setValidators([])),_.updateValueAndValidity(),l.updateValueAndValidity(),m.updateValueAndValidity())});return function(S){return D.apply(this,arguments)}}())}setDefaultValuesInForm(){this.loading.form=!1,this.form.get(h.Il.type).setValue(this.instanceTypes[0].value),this.form.get(h.Il.maxPoolConnections).setValue(1e4),this.form.get(h.Il.connectionString).setValue(this.connectionStringSecrets[0])}testInstance(a){var _=this;return(0,d.Z)(function*(){_.loading.form=!0;const l=m=>{_.instanceTested=!1,_.isFromMarkTested=!1,_.ns.showError(v.get(m,"errors[0].message","Unable to connect to the instance.")),_.loading.form=!1};try{const m=_.form.value;m.user=_.authCS.gUser._id,m.isFromSaveInstance=a,_.data.mode===g.D.EDIT&&(m._id=_.data.formData._id);const D=yield _.instanceS.testInstance(m).toPromise();D.success&&D.data?_.instanceTested=!0:l(D),_.loading.form=!1}catch(m){l(m.error)}})()}markInstanceTested(){this.instanceTested=!0,this.isFromMarkTested=!0}save(){var a=this;return(0,d.Z)(function*(){if(!a.isFromMarkTested&&(yield a.testInstance(!0),!a.instanceTested))return;const _=a.form.getRawValue();_.user=a.authCS.getUserId(),_.type===x.d.MONGO_DB&&(_.maxPoolConnections=1e4);try{let l;if(a.loading.form=!0,a.data.mode===g.D.ADD)l=yield a.instanceS.post(_).toPromise();else if(a.data.mode===g.D.EDIT){const m=v.merge({},a.data.formData,_);l=yield a.instanceS.put(a.data.formData._id,m,{select:h.iH._id}).toPromise()}a.ns.showSuccess(`Instance ${a.data.mode===g.D.ADD?"added":"edited"} successfully.`),a.data.eventChannel.emit({action:a.data.mode===g.D.ADD?u.F.SAVED:u.F.UPDATED}),a.loading.form=!1}catch(l){a.loading.form=!1,a.ns.showErrorFromResponse(l.error||l,"Unable to save instance.")}})()}loadConnectionStringFromSecret(){var a=this;return(0,d.Z)(function*(){try{const _=(yield a.instanceS.getConnectionStringSecret().toPromise())?.data;a.connectionStringSecrets=_}catch(_){a.ns.showErrorFromResponse(_.error||_,"Unable to load connection string.")}})()}openSecret(){var a=this;return(0,d.Z)(function*(){a.eventCenterS.headerC.dataSecretForm.formData=yield a.getDefaultSecret(),a.eventCenterS.headerC.dataSecretForm.mode=g.D.EDIT,a.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),a.eventCenterS.headerC.secManFormC.showModal()})()}getDefaultSecret(){var a=this;return(0,d.Z)(function*(){const _={find:{user:a.authCS.getUserId(),active:!0,isDefault:!0}};return(yield a.secretS.query(_).toPromise()).data?.[0]})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(_){return new(_||f)(n.Y36(t.qu),n.Y36(M.W),n.Y36(A.E),n.Y36(O.b),n.Y36(s.D),n.Y36(w.B),n.Y36(R.u),n.Y36(b.e),n.Y36(F.L))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-w-instances-form"]],inputs:{data:"data"},decls:48,vars:17,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idInstancesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",2,"z-index","1049"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],[1,"card","flex","justify-content-center"],["formControlName","type","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide instance name",1,"form-control","form-control-sm"],["formControlName","connectionString","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],[1,"form-group","row",3,"hidden"],["formControlName","maxPoolConnections","min","1","name","maxPoolConnections","spellcheck","false","type","number",1,"form-control","form-control-sm"],[1,"modal-footer","d-block"],["type","button",1,"btn","btn-sm","btn-secondary","float-left",3,"disabled","click"],["class","fas fa-check fa-fw text-success",4,"ngIf"],["class","fas fa-question fa-fw text-warning",4,"ngIf"],["class","btn btn-primary btn-sm float-right ml-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary","float-right",3,"disabled"],[1,"fas","fa-times","text-danger","fa-fw"],["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","username","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","password","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","privilege","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],[1,"fas","fa-check","fa-fw","text-success"],[1,"fas","fa-question","fa-fw","text-warning"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","ml-2",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(_,l){1&_&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,K,3,0,"span",4),n.YNc(5,Z,3,0,"span",4),n.YNc(6,B,3,0,"span",4),n.TgZ(7,"button",5)(8,"span",6),n._UZ(9,"i",7),n.qZA()()(),n.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),n._uU(14,"Database Type"),n.qZA(),n.TgZ(15,"div",12)(16,"div",13),n._UZ(17,"p-dropdown",14),n.qZA()()(),n.TgZ(18,"div",10)(19,"label",11),n._uU(20,"Instance Name"),n.qZA(),n.TgZ(21,"div",12),n._UZ(22,"input",15),n.qZA()(),n.YNc(23,J,16,6,"div",4),n.TgZ(24,"div")(25,"div",10)(26,"label",11),n._uU(27,"Connection String"),n.qZA(),n.TgZ(28,"div",12),n._UZ(29,"p-dropdown",16),n.qZA(),n.TgZ(30,"div",17),n.YNc(31,W,3,0,"a",18),n.qZA()()(),n.TgZ(32,"div",19)(33,"label",11),n._uU(34,"Max Pool Connections"),n.qZA(),n.TgZ(35,"div",12),n._UZ(36,"input",20),n.qZA()()()(),n.TgZ(37,"div",21)(38,"div")(39,"button",22),n.NdJ("click",function(){return l.testInstance()}),n.YNc(40,Y,1,0,"i",23),n.YNc(41,G,1,0,"i",24),n._uU(42," Test Instance "),n.qZA(),n.YNc(43,V,4,3,"button",25),n.TgZ(44,"button",26),n._UZ(45,"i",27),n._uU(46," Close"),n.qZA()()(),n.YNc(47,z,1,0,"p-progressSpinner",28),n.qZA()()()),2&_&&(n.xp6(4),n.Q6J("ngIf",l.data.mode===l.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",l.data.mode===l.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",l.data.mode===l.EFormMode.EDIT),n.xp6(5),n.Q6J("formGroup",l.form),n.xp6(6),n.Q6J("options",l.instanceTypes)("filter",!0),n.xp6(6),n.Q6J("ngIf",l.form.get("type").value===l.EInstanceType.ORACLE_DB),n.xp6(6),n.Q6J("options",l.connectionStringSecrets)("filter",!0),n.xp6(2),n.Q6J("ngIf",l.data.mode!==l.EFormMode.VIEW),n.xp6(1),n.Q6J("hidden",l.form.get("type").value===l.EInstanceType.MONGO_DB),n.xp6(7),n.Q6J("disabled",l.form.invalid||l.loading.form),n.xp6(1),n.Q6J("ngIf",l.instanceTested),n.xp6(1),n.Q6J("ngIf",!l.instanceTested),n.xp6(2),n.Q6J("ngIf",l.data.mode!==l.EFormMode.VIEW),n.xp6(1),n.Q6J("disabled",l.loading.form),n.xp6(3),n.Q6J("ngIf",l.loading.form))},dependencies:[t._Y,t.Fj,t.wV,t.JJ,t.JL,t.qQ,t.sg,t.u,N.O5,L.y,y.G,P.Lt],encapsulation:2})}return f})()},3885:(U,E,o)=>{o.d(E,{f:()=>ct});var d=o(5861),t=o(4946),u=o(3157),g=o(328),v=o(6212),T=o(6990),h=o(1162),n=o(6925),M=o(7848),A=o(3429),O=o(3366),s=o(7240),w=o(9961),R=o(2189),b=o(5852),F=o(7414),N=o(7664),L=o(2915),y=o(5219),P=o(95),K=o(6814),Z=o(5431),B=o(7680),J=o(3259),W=o(5609),Y=o(8057),G=o(7747);const Q=["instancesFormC"];function k(i,p){if(1&i){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 V(i,p){if(1&i){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(i,p){if(1&i){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.active())}),t._UZ(1,"i",25),t.qZA()}}function H(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",26),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.inactiveDialog())}),t._UZ(1,"i",27),t.qZA()}}function f(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",28),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.removePermanentDialog())}),t._UZ(1,"i",29),t.qZA()}}function C(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span")(1,"a",9),t._UZ(2,"img",10),t.qZA(),t.TgZ(3,"span",11)(4,"p-inputSwitch",12),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.showAll=r)})("onChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.showAllChanges())}),t.qZA()(),t.TgZ(5,"span",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.add())}),t._UZ(6,"i",14),t.qZA(),t.YNc(7,k,2,0,"span",15),t.YNc(8,V,2,0,"span",16),t.YNc(9,z,2,0,"span",17),t.YNc(10,H,2,0,"span",18),t.YNc(11,f,2,0,"span",19),t.qZA()}if(2&i){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.showAll),t.xp6(3),t.Q6J("ngIf",e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!1===e.selectedRows[0].active),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!0===e.selectedRows[0].active),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!1===e.selectedRows[0].active)}}function a(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.eventCenterS.group.apisRegex.allInstances=r)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allInstances)("binary",!0)}}function _(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.eventCenterS.filterInLog.apisRegex.allInstances=r)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allInstances)("binary",!0)}}function l(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",33),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allInstancesPermitted)}}function m(i,p){1&i&&(t.TgZ(0,"th",43),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function D(i,p){1&i&&t._UZ(0,"th",41)}function S(i,p){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Pre"),t.qZA())}function j(i,p){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Post"),t.qZA())}function X(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,m,2,0,"th",39),t.YNc(2,D,1,0,"th",40),t._UZ(3,"th",41),t.TgZ(4,"th"),t._uU(5,"Instance Name"),t.qZA(),t.YNc(6,S,2,0,"th",42),t.YNc(7,j,2,0,"th",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",e.showAll),t.xp6(4),t.Q6J("ngIf",e.showHooksCount),t.xp6(1),t.Q6J("ngIf",e.showHooksCount)}}function q(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",49),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function tt(i,p){1&i&&t._UZ(0,"i",52)}function et(i,p){1&i&&t._UZ(0,"i",53)}function nt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,tt,1,0,"i",50),t.YNc(2,et,1,0,"i",51),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.active),t.xp6(1),t.Q6J("ngIf",!e.active)}}function st(i,p){if(1&i&&(t.TgZ(0,"td",54),t._uU(1),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.preHookCount||"")}}function at(i,p){if(1&i&&(t.TgZ(0,"td",54),t._uU(1),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.postHookCount||"")}}function ot(i,p){if(1&i&&(t.TgZ(0,"tr",45),t.YNc(1,q,2,2,"td",3),t.YNc(2,nt,3,2,"td",3),t.TgZ(3,"td"),t._UZ(4,"img",46),t.qZA(),t.TgZ(5,"td",47),t._uU(6),t.qZA(),t.YNc(7,st,2,1,"td",48),t.YNc(8,at,2,1,"td",48),t.qZA()),2&i){const e=p.$implicit,c=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",c.showCheckbox),t.xp6(1),t.Q6J("ngIf",c.showAll),t.xp6(2),t.Akn("MONGO_DB"==e.type?"width:0.5rem":"width:1rem"),t.s9C("src",c.getInstanceIconUrl(e.type),t.LSH),t.s9C("alt",e.type),t.xp6(2),t.Oqu(e.name),t.xp6(1),t.Q6J("ngIf",c.showHooksCount),t.xp6(1),t.Q6J("ngIf",c.showHooksCount)}}function it(i,p){1&i&&t._UZ(0,"p-progressSpinner",55)}function rt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",34)(1,"p-table",35),t.NdJ("selectionChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.selectedRows=r)})("selectionChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.instanceSelected())})("dblclick",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.dblClickInstance())}),t.YNc(2,X,8,4,"ng-template",36),t.YNc(3,ot,9,10,"ng-template",37),t.qZA(),t.YNc(4,it,1,0,"p-progressSpinner",38),t.qZA()}if(2&i){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 ct=(()=>{class i{instanceS;instanceHooksS;generalS;notificationS;navigationCS;authCS;constantsS;router;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;instancesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;gridKey=h.iH._id;selectedRows=[];instanceIdsSkipSubscription=!1;EInstanceType=M.d;constructor(e,c,r,I,lt,_t,dt,ft,mt,pt,ut){this.instanceS=e,this.instanceHooksS=c,this.generalS=r,this.notificationS=I,this.navigationCS=lt,this.authCS=_t,this.constantsS=dt,this.router=ft,this.cd=mt,this.eventCenterS=pt,this.confirmationService=ut}ngOnInit(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.instance.selectedInstances.next([]),!e.isDependentOnGroup&&!e.isFilterLogTable&&(yield e.loadGridData()),e.isDependentOnGroup&&e.subscriptions.push(e.eventCenterS.group.selectedGroups.subscribe(function(){var c=(0,d.Z)(function*(r){r.length&&(yield e.loadGridData())});return function(r){return c.apply(this,arguments)}}())),e.isFilterLogTable&&e.subscriptions.push(e.eventCenterS.filterInLog.refreshGrid.subscribe((0,d.Z)(function*(){e.instanceIdsSkipSubscription||e.loadGridData()}))),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var c=(0,d.Z)(function*(r){(r.action===u.F.SAVED||r.action===u.F.UPDATED)&&(e.instancesFormC.hideModal(),e.loadGridData())});return function(r){return c.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Instances")})()}loadGridData(){var e=this;return(0,d.Z)(function*(){if(e.resetGridAndUrl(),e.isDependentOnGroup&&(!e.eventCenterS.group.selectedGroups.value||!e.eventCenterS.group.selectedGroups.value.length))return;e.loading.grid=!0;const c={find:{user:e.authCS.getUserId(),active:!0},select:{name:1,label:1,active:1,type:1},sort:{name:1}};e.showAll&&delete c.find.active;try{const r=yield e.instanceS.query(c).toPromise();r.success?(e.selectedRows=[],e.rows=r.data,e.rowsMap=T.keyBy(e.rows,h.iH._id)):e.resetGridAndUrl(),e.showHooksCount&&(yield e.instanceS.setHooksCountInInstanceArr(e.rows));const I=e.navigationCS.getQueryParam(v.p.instance);I&&(e.selectedRows=e.getObjectsFromIdArray(I.split(",")),e.eventCenterS.instance.selectedInstances.next(e.selectedRows)),e.isDependentOnGroup&&(e.selectedRows=e.getObjectsFromIdArray(e.eventCenterS.group.instanceIds.value)),e.isFilterLogTable&&(e.selectedRows=e.getObjectsFromIdArray(e.eventCenterS.filterInLog.instanceIds.value))}catch(r){console.log(r)}e.loading.grid=!1,e.cd.detectChanges()})()}getObjectsFromIdArray(e){const c=[];for(const r of e)this.rowsMap[r]&&c.push(this.rowsMap[r]);return c}resetGridAndUrl(){var e=this;return(0,d.Z)(function*(){e.rows=[],e.rowsMap={},e.selectedRows=[],e.eventCenterS.instance.selectedInstances.next([])})()}showAllChanges(){var e=this;return(0,d.Z)(function*(){yield e.resetSelectedRows(),yield e.loadGridData()})()}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE}),this.instancesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_VIEW_MODE}),this.instancesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.instancesFormC.showModal()}clone(){var e=this;return(0,d.Z)(function*(){try{if(!e.selectedRows[0])return;const c=(yield e.instanceS.getById(e.selectedRows[0]._id).toPromise()).data;delete c._id,c.name=`${c.name}-clone`,(yield e.instanceS.post(c).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.instance.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.instance.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.instance.cloneError)}})()}inactiveDialog(){var e=this;return(0,d.Z)(function*(){var c;e.confirmationService.confirm({message:e.constantsS.instance.inactiveConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield e.inactive()}),function(){return c.apply(this,arguments)})})})()}removePermanentDialog(){var e=this;return(0,d.Z)(function*(){var c;e.confirmationService.confirm({message:e.constantsS.instance.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield e.removePermanent()}),function(){return c.apply(this,arguments)})})})()}active(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const c=yield e.instanceS.makeActive(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,c.success?(e.notificationS.showSuccess(e.constantsS.instance.active),e.loadGridData()):e.notificationS.showErrorFromResponse(c,e.constantsS.instance.activeError)})()}inactive(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;try{yield e.instanceS.softDelete(e.selectedRows[0]._id).toPromise(),e.notificationS.showSuccess(e.constantsS.instance.inactive),yield e.resetSelectedRows(),e.loadGridData()}catch(c){const r=c?.error?.errors?.[0]?.message;e.notificationS.showError(r||e.constantsS.instance.inactiveError)}e.loading.grid=!1})()}removePermanent(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const c=yield e.instanceS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,c.success?(e.notificationS.showSuccess(e.constantsS.instance.removePermanent),yield e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(c,e.constantsS.instance.removePermanentError)})()}resetSelectedRows(){var e=this;return(0,d.Z)(function*(){e.selectedRows.length=0,e.eventCenterS.instance.selectedInstances.next([]),yield e.navigationCS.setQueryParam(v.p.instance,null)})()}instanceSelected(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.instance.selectedInstances.next(e.selectedRows),e.isDependentOnGroup||e.isFilterLogTable?e.setInstanceIds():(yield e.navigationCS.setQueryParam(v.p.instance,T.map(e.selectedRows,"_id").join(",")||null),yield e.generalS.resetUrlParams([v.p.database,v.p.collection,v.p.collection_api]))})()}dblClickInstance(){this.selectedRows.length&&!this.isDependentOnGroup&&!this.isFilterLogTable&&this.edit()}setInstanceIds(){this.instanceIdsSkipSubscription=!0,this.eventCenterS.filterInLog.instanceIds.next(T.map(this.selectedRows,"_id")),this.eventCenterS.group.instanceIds.next(T.map(this.selectedRows,"_id")),this.instanceIdsSkipSubscription=!1}getInstanceIconUrl(e){return e===M.d.SQL_SERVER_DB?"./assets/images/svg/Microsoft_SQL_Server_DB_No_Logo.svg":e===M.d.ORACLE_DB?"./assets/images/svg/Oracle_DB_No_Logo.svg":`./assets/images/svg/${e}.svg`}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=n.Yp;static \u0275fac=function(c){return new(c||i)(t.Y36(A.E),t.Y36(O.Q),t.Y36(s.b),t.Y36(w.W),t.Y36(R.S),t.Y36(b.D),t.Y36(F.L),t.Y36(N.F0),t.Y36(t.sBO),t.Y36(L.u),t.Y36(y.YP))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-w-instances"]],viewQuery:function(c,r){if(1&c&&t.Gf(Q,5),2&c){let I;t.iGM(I=t.CRH())&&(r.instancesFormC=I.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:13,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Instances",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["instancesFormC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"float-right","position-relative"],["styleClass","ml-3 mt-2px","tooltipPosition","right","pTooltip","Show All",3,"ngModel","ngModelChange","onChange"],["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","Make Active",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Inactive",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Make Active",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-check","text-success","fa-fw"],["pTooltip","Make Inactive",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","align-middle","text-danger"],["pTooltip","All Instances",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 instance-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: 40px;",4,"ngIf"],[2,"width","40px"],["class","text-center","style","width: 40px;",4,"ngIf"],[2,"width","45px"],[1,"text-center",2,"width","40px"],[3,"pSelectableRow"],[3,"src","alt"],[1,"word-break-all"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"text-center"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(c,r){1&c&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Instances"),t.qZA(),t.YNc(5,C,12,6,"span",3),t.YNc(6,a,3,2,"span",4),t.YNc(7,_,3,2,"span",4),t.qZA(),t.TgZ(8,"div",5),t.YNc(9,l,3,1,"div",3),t.YNc(10,rt,5,7,"div",6),t.qZA()(),t._UZ(11,"app-w-instances-form",7,8)),2&c&&(t.xp6(5),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.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances),t.xp6(1),t.Q6J("ngIf",!(r.eventCenterS.group.apisRegex.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances)),t.xp6(1),t.Q6J("data",r.data))},dependencies:[P.JJ,P.On,K.O5,Z.iA,y.jx,Z.Ei,Z.UA,Z.Mo,B.G,J.u,W.Ql,Y.XZ,G.o]})}return i})()},1678:(U,E,o)=>{o.r(E),o.d(E,{DashboardM:()=>h});var d=o(7664),t=o(8176),v=(o(3885),o(7747),o(4946));const T=[{path:"root",loadChildren:()=>o.e(891).then(o.bind(o,891)).then(n=>n.DashRootM)},{path:"redis-dashboard",loadChildren:()=>o.e(4110).then(o.bind(o,4110)).then(n=>n.RedisDashboardM)},{path:"summary-dashboard",loadChildren:()=>Promise.all([o.e(8592),o.e(7977)]).then(o.bind(o,7977)).then(n=>n.DashSummaryM)},{path:"developer",loadChildren:()=>o.e(3450).then(o.bind(o,3450)).then(n=>n.DashDevM)},{path:"welcome",loadChildren:()=>o.e(5334).then(o.bind(o,5334)).then(n=>n.AmWelcomeM)},{path:"ext-licenses",loadChildren:()=>o.e(7436).then(o.bind(o,7436)).then(n=>n.ExtLicensesM)}];let h=(()=>{class n{static \u0275fac=function(O){return new(O||n)};static \u0275mod=v.oAB({type:n});static \u0275inj=v.cJS({imports:[d.Bz.forChild(T),t.u]})}return n})()},6925:(U,E,o)=>{o.d(E,{Eg:()=>T,Yp:()=>u,ZF:()=>x,vT:()=>t});var t=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(t||{}),u=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(u||{}),T=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s}(T||{}),x=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(x||{})}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1678,6925,8374,8682,1617],{7747:(U,E,o)=>{o.d(E,{o:()=>H});var d=o(5861),t=o(95),u=o(3157),g=o(328),v=o(6990),x=o(7848),h=o(1162),n=o(4946),M=o(9961),A=o(3429),O=o(7240),s=o(5852),w=o(1429),R=o(2915),b=o(115),F=o(7414),N=o(6814),L=o(2660),y=o(7680),P=o(3965);function K(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",29),n._uU(2," Add Instance"),n.qZA())}function Z(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",30),n._uU(2," View Instance"),n.qZA())}function B(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",31),n._uU(2," Edit Instance"),n.qZA())}function J(f,C){if(1&f&&(n.TgZ(0,"div")(1,"div",10)(2,"label",11),n._uU(3,"Username"),n.qZA(),n.TgZ(4,"div",12),n._UZ(5,"p-dropdown",32),n.qZA()(),n.TgZ(6,"div",10)(7,"label",11),n._uU(8,"Password"),n.qZA(),n.TgZ(9,"div",12),n._UZ(10,"p-dropdown",33),n.qZA()(),n.TgZ(11,"div",10)(12,"label",11),n._uU(13,"Privilege"),n.qZA(),n.TgZ(14,"div",12),n._UZ(15,"p-dropdown",34),n.qZA()()()),2&f){const a=n.oxw();n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.privileges)("filter",!0)}}function W(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"a",35),n.NdJ("click",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.openSecret())}),n._UZ(1,"i",36),n._uU(2," Open Secret "),n.qZA()}}function Y(f,C){1&f&&n._UZ(0,"i",37)}function G(f,C){1&f&&n._UZ(0,"i",38)}function Q(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Save Instance"),n.qZA())}function k(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Update Instance"),n.qZA())}function V(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"button",39),n.NdJ("click",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.save())}),n._UZ(1,"i",40),n.YNc(2,Q,2,0,"span",4),n.YNc(3,k,2,0,"span",4),n.qZA()}if(2&f){const a=n.oxw();n.Q6J("disabled",a.form.invalid||a.loading.form),n.xp6(2),n.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function z(f,C){1&f&&n._UZ(0,"p-progressSpinner",41)}let H=(()=>{class f{fb;ns;instanceS;generalS;authCS;dataProviderS;eventCenterS;secretS;constantsS;data;loading={form:!1};EFormMode=g.D;EInstanceType=x.d;IInstanceProps=h.Il;form;subscriptions=[];instanceTypes=[];privileges=[];connectionStringSecrets=[];instanceTested;isFromMarkTested;constructor(a,_,l,m,D,S,j,X,q){this.fb=a,this.ns=_,this.instanceS=l,this.generalS=m,this.authCS=D,this.dataProviderS=S,this.eventCenterS=j,this.secretS=X,this.constantsS=q}ngOnInit(){var a=this;return(0,d.Z)(function*(){a.instanceTypes=a.dataProviderS.getInstanceTypes(),a.privileges=a.dataProviderS.getListOfOraclePrivilege(),a.createForm(),a.subscriptions.push(a.data.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(l){if(l)if(a.form.enable(),yield a.loadConnectionStringFromSecret(),l.action===u.F.OPEN_FORM_IN_EDIT_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.instanceTested=!1,a.isFromMarkTested=!1}else if(l.action===u.F.OPEN_FORM_IN_VIEW_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.form.disable(),a.instanceTested=!1,a.isFromMarkTested=!1}else l.action===u.F.OPEN_FORM_IN_ADD_MODE&&(a.form.reset(),a.setDefaultValuesInForm(),a.instanceTested=!1,a.isFromMarkTested=!1)});return function(l){return _.apply(this,arguments)}}())),a.subscriptions.push(a.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(l){l&&l.action===u.F.UPDATED&&(a.eventCenterS.headerC.secManFormC.hideModal(),yield a.loadConnectionStringFromSecret())});return function(l){return _.apply(this,arguments)}}()))})()}showModal(){$("#idInstancesForm").modal("show")}hideModal(){$("#idInstancesForm").modal("hide")}createForm(){this.form=this.fb.group({type:[null,[t.kI.required]],name:[null,[t.kI.required]],connectionString:[null,[t.kI.required]],username:[null,[]],password:[null,[]],privilege:[null,[]],maxPoolConnections:[null,[t.kI.required]]}),this.manageValidations()}manageValidations(){this.form.valueChanges.subscribe(()=>{this.instanceTested=!1,this.isFromMarkTested=!1});const a=this.form.get(h.Il.type),_=this.form.get(h.Il.username),l=this.form.get(h.Il.password),m=this.form.get(h.Il.privilege);a.valueChanges.subscribe(function(){var D=(0,d.Z)(function*(S){S&&(S===x.d.ORACLE_DB?(_.setValidators([t.kI.required]),l.setValidators([t.kI.required]),m.setValidators([t.kI.required])):(_.setValidators([]),l.setValidators([]),m.setValidators([])),_.updateValueAndValidity(),l.updateValueAndValidity(),m.updateValueAndValidity())});return function(S){return D.apply(this,arguments)}}())}setDefaultValuesInForm(){this.loading.form=!1,this.form.get(h.Il.type).setValue(this.instanceTypes[0].value),this.form.get(h.Il.maxPoolConnections).setValue(1e4),this.form.get(h.Il.connectionString).setValue(this.connectionStringSecrets[0])}testInstance(a){var _=this;return(0,d.Z)(function*(){_.loading.form=!0;const l=m=>{_.instanceTested=!1,_.isFromMarkTested=!1,_.ns.showError(v.get(m,"errors[0].message","Unable to connect to the instance.")),_.loading.form=!1};try{const m=_.form.value;m.user=_.authCS.gUser._id,m.isFromSaveInstance=a,_.data.mode===g.D.EDIT&&(m._id=_.data.formData._id);const D=yield _.instanceS.testInstance(m).toPromise();D.success&&D.data?_.instanceTested=!0:l(D),_.loading.form=!1}catch(m){l(m.error)}})()}markInstanceTested(){this.instanceTested=!0,this.isFromMarkTested=!0}save(){var a=this;return(0,d.Z)(function*(){if(!a.isFromMarkTested&&(yield a.testInstance(!0),!a.instanceTested))return;const _=a.form.getRawValue();_.user=a.authCS.getUserId(),_.type===x.d.MONGO_DB&&(_.maxPoolConnections=1e4);try{let l;if(a.loading.form=!0,a.data.mode===g.D.ADD)l=yield a.instanceS.post(_).toPromise();else if(a.data.mode===g.D.EDIT){const m=v.merge({},a.data.formData,_);l=yield a.instanceS.put(a.data.formData._id,m,{select:h.iH._id}).toPromise()}a.ns.showSuccess(`Instance ${a.data.mode===g.D.ADD?"added":"edited"} successfully.`),a.data.eventChannel.emit({action:a.data.mode===g.D.ADD?u.F.SAVED:u.F.UPDATED}),a.loading.form=!1}catch(l){a.loading.form=!1,a.ns.showErrorFromResponse(l.error||l,"Unable to save instance.")}})()}loadConnectionStringFromSecret(){var a=this;return(0,d.Z)(function*(){try{const _=(yield a.instanceS.getConnectionStringSecret().toPromise())?.data;a.connectionStringSecrets=_}catch(_){a.ns.showErrorFromResponse(_.error||_,"Unable to load connection string.")}})()}openSecret(){var a=this;return(0,d.Z)(function*(){a.eventCenterS.headerC.dataSecretForm.formData=yield a.getDefaultSecret(),a.eventCenterS.headerC.dataSecretForm.mode=g.D.EDIT,a.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),a.eventCenterS.headerC.secManFormC.showModal()})()}getDefaultSecret(){var a=this;return(0,d.Z)(function*(){const _={find:{user:a.authCS.getUserId(),active:!0,isDefault:!0}};return(yield a.secretS.query(_).toPromise()).data?.[0]})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(_){return new(_||f)(n.Y36(t.qu),n.Y36(M.W),n.Y36(A.E),n.Y36(O.b),n.Y36(s.D),n.Y36(w.B),n.Y36(R.u),n.Y36(b.e),n.Y36(F.L))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-w-instances-form"]],inputs:{data:"data"},decls:48,vars:17,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idInstancesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",2,"z-index","1049"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],[1,"card","flex","justify-content-center"],["formControlName","type","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide instance name",1,"form-control","form-control-sm"],["formControlName","connectionString","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],[1,"form-group","row",3,"hidden"],["formControlName","maxPoolConnections","min","1","name","maxPoolConnections","spellcheck","false","type","number",1,"form-control","form-control-sm"],[1,"modal-footer","d-block"],["type","button",1,"btn","btn-sm","btn-secondary","float-left",3,"disabled","click"],["class","fas fa-check fa-fw text-success",4,"ngIf"],["class","fas fa-question fa-fw text-warning",4,"ngIf"],["class","btn btn-primary btn-sm float-right ml-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary","float-right",3,"disabled"],[1,"fas","fa-times","text-danger","fa-fw"],["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","username","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","password","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","privilege","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],[1,"fas","fa-check","fa-fw","text-success"],[1,"fas","fa-question","fa-fw","text-warning"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","ml-2",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(_,l){1&_&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,K,3,0,"span",4),n.YNc(5,Z,3,0,"span",4),n.YNc(6,B,3,0,"span",4),n.TgZ(7,"button",5)(8,"span",6),n._UZ(9,"i",7),n.qZA()()(),n.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),n._uU(14,"Database Type"),n.qZA(),n.TgZ(15,"div",12)(16,"div",13),n._UZ(17,"p-dropdown",14),n.qZA()()(),n.TgZ(18,"div",10)(19,"label",11),n._uU(20,"Instance Name"),n.qZA(),n.TgZ(21,"div",12),n._UZ(22,"input",15),n.qZA()(),n.YNc(23,J,16,6,"div",4),n.TgZ(24,"div")(25,"div",10)(26,"label",11),n._uU(27,"Connection String"),n.qZA(),n.TgZ(28,"div",12),n._UZ(29,"p-dropdown",16),n.qZA(),n.TgZ(30,"div",17),n.YNc(31,W,3,0,"a",18),n.qZA()()(),n.TgZ(32,"div",19)(33,"label",11),n._uU(34,"Max Pool Connections"),n.qZA(),n.TgZ(35,"div",12),n._UZ(36,"input",20),n.qZA()()()(),n.TgZ(37,"div",21)(38,"div")(39,"button",22),n.NdJ("click",function(){return l.testInstance()}),n.YNc(40,Y,1,0,"i",23),n.YNc(41,G,1,0,"i",24),n._uU(42," Test Instance "),n.qZA(),n.YNc(43,V,4,3,"button",25),n.TgZ(44,"button",26),n._UZ(45,"i",27),n._uU(46," Close"),n.qZA()()(),n.YNc(47,z,1,0,"p-progressSpinner",28),n.qZA()()()),2&_&&(n.xp6(4),n.Q6J("ngIf",l.data.mode===l.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",l.data.mode===l.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",l.data.mode===l.EFormMode.EDIT),n.xp6(5),n.Q6J("formGroup",l.form),n.xp6(6),n.Q6J("options",l.instanceTypes)("filter",!0),n.xp6(6),n.Q6J("ngIf",l.form.get("type").value===l.EInstanceType.ORACLE_DB),n.xp6(6),n.Q6J("options",l.connectionStringSecrets)("filter",!0),n.xp6(2),n.Q6J("ngIf",l.data.mode!==l.EFormMode.VIEW),n.xp6(1),n.Q6J("hidden",l.form.get("type").value===l.EInstanceType.MONGO_DB),n.xp6(7),n.Q6J("disabled",l.form.invalid||l.loading.form),n.xp6(1),n.Q6J("ngIf",l.instanceTested),n.xp6(1),n.Q6J("ngIf",!l.instanceTested),n.xp6(2),n.Q6J("ngIf",l.data.mode!==l.EFormMode.VIEW),n.xp6(1),n.Q6J("disabled",l.loading.form),n.xp6(3),n.Q6J("ngIf",l.loading.form))},dependencies:[t._Y,t.Fj,t.wV,t.JJ,t.JL,t.qQ,t.sg,t.u,N.O5,L.y,y.G,P.Lt],encapsulation:2})}return f})()},3885:(U,E,o)=>{o.d(E,{f:()=>ct});var d=o(5861),t=o(4946),u=o(3157),g=o(328),v=o(6212),T=o(6990),h=o(1162),n=o(6925),M=o(7848),A=o(3429),O=o(3366),s=o(7240),w=o(9961),R=o(2189),b=o(5852),F=o(7414),N=o(7664),L=o(2915),y=o(5219),P=o(95),K=o(6814),Z=o(5431),B=o(7680),J=o(3259),W=o(5609),Y=o(8057),G=o(7747);const Q=["instancesFormC"];function k(i,p){if(1&i){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 V(i,p){if(1&i){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(i,p){if(1&i){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.active())}),t._UZ(1,"i",25),t.qZA()}}function H(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",26),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.inactiveDialog())}),t._UZ(1,"i",27),t.qZA()}}function f(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",28),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.removePermanentDialog())}),t._UZ(1,"i",29),t.qZA()}}function C(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span")(1,"a",9),t._UZ(2,"img",10),t.qZA(),t.TgZ(3,"span",11)(4,"p-inputSwitch",12),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.showAll=r)})("onChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.showAllChanges())}),t.qZA()(),t.TgZ(5,"span",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.add())}),t._UZ(6,"i",14),t.qZA(),t.YNc(7,k,2,0,"span",15),t.YNc(8,V,2,0,"span",16),t.YNc(9,z,2,0,"span",17),t.YNc(10,H,2,0,"span",18),t.YNc(11,f,2,0,"span",19),t.qZA()}if(2&i){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.showAll),t.xp6(3),t.Q6J("ngIf",e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!1===e.selectedRows[0].active),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!0===e.selectedRows[0].active),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!1===e.selectedRows[0].active)}}function a(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.eventCenterS.group.apisRegex.allInstances=r)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allInstances)("binary",!0)}}function _(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.eventCenterS.filterInLog.apisRegex.allInstances=r)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allInstances)("binary",!0)}}function l(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",33),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allInstancesPermitted)}}function m(i,p){1&i&&(t.TgZ(0,"th",43),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function D(i,p){1&i&&t._UZ(0,"th",41)}function S(i,p){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Pre"),t.qZA())}function j(i,p){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Post"),t.qZA())}function X(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,m,2,0,"th",39),t.YNc(2,D,1,0,"th",40),t._UZ(3,"th",41),t.TgZ(4,"th"),t._uU(5,"Instance Name"),t.qZA(),t.YNc(6,S,2,0,"th",42),t.YNc(7,j,2,0,"th",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",e.showAll),t.xp6(4),t.Q6J("ngIf",e.showHooksCount),t.xp6(1),t.Q6J("ngIf",e.showHooksCount)}}function q(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",49),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function tt(i,p){1&i&&t._UZ(0,"i",52)}function et(i,p){1&i&&t._UZ(0,"i",53)}function nt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,tt,1,0,"i",50),t.YNc(2,et,1,0,"i",51),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.active),t.xp6(1),t.Q6J("ngIf",!e.active)}}function st(i,p){if(1&i&&(t.TgZ(0,"td",54),t._uU(1),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.preHookCount||"")}}function at(i,p){if(1&i&&(t.TgZ(0,"td",54),t._uU(1),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.postHookCount||"")}}function ot(i,p){if(1&i&&(t.TgZ(0,"tr",45),t.YNc(1,q,2,2,"td",3),t.YNc(2,nt,3,2,"td",3),t.TgZ(3,"td"),t._UZ(4,"img",46),t.qZA(),t.TgZ(5,"td",47),t._uU(6),t.qZA(),t.YNc(7,st,2,1,"td",48),t.YNc(8,at,2,1,"td",48),t.qZA()),2&i){const e=p.$implicit,c=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",c.showCheckbox),t.xp6(1),t.Q6J("ngIf",c.showAll),t.xp6(2),t.Akn("MONGO_DB"==e.type?"width:0.5rem":"width:1rem"),t.s9C("src",c.getInstanceIconUrl(e.type),t.LSH),t.s9C("alt",e.type),t.xp6(2),t.Oqu(e.name),t.xp6(1),t.Q6J("ngIf",c.showHooksCount),t.xp6(1),t.Q6J("ngIf",c.showHooksCount)}}function it(i,p){1&i&&t._UZ(0,"p-progressSpinner",55)}function rt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",34)(1,"p-table",35),t.NdJ("selectionChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.selectedRows=r)})("selectionChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.instanceSelected())})("dblclick",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.dblClickInstance())}),t.YNc(2,X,8,4,"ng-template",36),t.YNc(3,ot,9,10,"ng-template",37),t.qZA(),t.YNc(4,it,1,0,"p-progressSpinner",38),t.qZA()}if(2&i){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 ct=(()=>{class i{instanceS;instanceHooksS;generalS;notificationS;navigationCS;authCS;constantsS;router;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;instancesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;gridKey=h.iH._id;selectedRows=[];instanceIdsSkipSubscription=!1;EInstanceType=M.d;constructor(e,c,r,I,lt,_t,dt,ft,mt,pt,ut){this.instanceS=e,this.instanceHooksS=c,this.generalS=r,this.notificationS=I,this.navigationCS=lt,this.authCS=_t,this.constantsS=dt,this.router=ft,this.cd=mt,this.eventCenterS=pt,this.confirmationService=ut}ngOnInit(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.instance.selectedInstances.next([]),!e.isDependentOnGroup&&!e.isFilterLogTable&&(yield e.loadGridData()),e.isDependentOnGroup&&e.subscriptions.push(e.eventCenterS.group.selectedGroups.subscribe(function(){var c=(0,d.Z)(function*(r){r.length&&(yield e.loadGridData())});return function(r){return c.apply(this,arguments)}}())),e.isFilterLogTable&&e.subscriptions.push(e.eventCenterS.filterInLog.refreshGrid.subscribe((0,d.Z)(function*(){e.instanceIdsSkipSubscription||e.loadGridData()}))),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var c=(0,d.Z)(function*(r){(r.action===u.F.SAVED||r.action===u.F.UPDATED)&&(e.instancesFormC.hideModal(),e.loadGridData())});return function(r){return c.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Instances")})()}loadGridData(){var e=this;return(0,d.Z)(function*(){if(e.resetGridAndUrl(),e.isDependentOnGroup&&(!e.eventCenterS.group.selectedGroups.value||!e.eventCenterS.group.selectedGroups.value.length))return;e.loading.grid=!0;const c={find:{user:e.authCS.getUserId(),active:!0},select:{name:1,label:1,active:1,type:1},sort:{name:1}};e.showAll&&delete c.find.active;try{const r=yield e.instanceS.query(c).toPromise();r.success?(e.selectedRows=[],e.rows=r.data,e.rowsMap=T.keyBy(e.rows,h.iH._id)):e.resetGridAndUrl(),e.showHooksCount&&(yield e.instanceS.setHooksCountInInstanceArr(e.rows));const I=e.navigationCS.getQueryParam(v.p.instance);I&&(e.selectedRows=e.getObjectsFromIdArray(I.split(",")),e.eventCenterS.instance.selectedInstances.next(e.selectedRows)),e.isDependentOnGroup&&(e.selectedRows=e.getObjectsFromIdArray(e.eventCenterS.group.instanceIds.value)),e.isFilterLogTable&&(e.selectedRows=e.getObjectsFromIdArray(e.eventCenterS.filterInLog.instanceIds.value))}catch(r){console.log(r)}e.loading.grid=!1,e.cd.detectChanges()})()}getObjectsFromIdArray(e){const c=[];for(const r of e)this.rowsMap[r]&&c.push(this.rowsMap[r]);return c}resetGridAndUrl(){var e=this;return(0,d.Z)(function*(){e.rows=[],e.rowsMap={},e.selectedRows=[],e.eventCenterS.instance.selectedInstances.next([])})()}showAllChanges(){var e=this;return(0,d.Z)(function*(){yield e.resetSelectedRows(),yield e.loadGridData()})()}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE}),this.instancesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_VIEW_MODE}),this.instancesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.instancesFormC.showModal()}clone(){var e=this;return(0,d.Z)(function*(){try{if(!e.selectedRows[0])return;const c=(yield e.instanceS.getById(e.selectedRows[0]._id).toPromise()).data;delete c._id,c.name=`${c.name}-clone`,(yield e.instanceS.post(c).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.instance.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.instance.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.instance.cloneError)}})()}inactiveDialog(){var e=this;return(0,d.Z)(function*(){var c;e.confirmationService.confirm({message:e.constantsS.instance.inactiveConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield e.inactive()}),function(){return c.apply(this,arguments)})})})()}removePermanentDialog(){var e=this;return(0,d.Z)(function*(){var c;e.confirmationService.confirm({message:e.constantsS.instance.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield e.removePermanent()}),function(){return c.apply(this,arguments)})})})()}active(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const c=yield e.instanceS.makeActive(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,c.success?(e.notificationS.showSuccess(e.constantsS.instance.active),e.loadGridData()):e.notificationS.showErrorFromResponse(c,e.constantsS.instance.activeError)})()}inactive(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;try{yield e.instanceS.softDelete(e.selectedRows[0]._id).toPromise(),e.notificationS.showSuccess(e.constantsS.instance.inactive),yield e.resetSelectedRows(),e.loadGridData()}catch(c){const r=c?.error?.errors?.[0]?.message;e.notificationS.showError(r||e.constantsS.instance.inactiveError)}e.loading.grid=!1})()}removePermanent(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const c=yield e.instanceS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,c.success?(e.notificationS.showSuccess(e.constantsS.instance.removePermanent),yield e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(c,e.constantsS.instance.removePermanentError)})()}resetSelectedRows(){var e=this;return(0,d.Z)(function*(){e.selectedRows.length=0,e.eventCenterS.instance.selectedInstances.next([]),yield e.navigationCS.setQueryParam(v.p.instance,null)})()}instanceSelected(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.instance.selectedInstances.next(e.selectedRows),e.isDependentOnGroup||e.isFilterLogTable?e.setInstanceIds():(yield e.navigationCS.setQueryParam(v.p.instance,T.map(e.selectedRows,"_id").join(",")||null),yield e.generalS.resetUrlParams([v.p.database,v.p.collection,v.p.collection_api]))})()}dblClickInstance(){this.selectedRows.length&&!this.isDependentOnGroup&&!this.isFilterLogTable&&this.edit()}setInstanceIds(){this.instanceIdsSkipSubscription=!0,this.eventCenterS.filterInLog.instanceIds.next(T.map(this.selectedRows,"_id")),this.eventCenterS.group.instanceIds.next(T.map(this.selectedRows,"_id")),this.instanceIdsSkipSubscription=!1}getInstanceIconUrl(e){return e===M.d.SQL_SERVER_DB?"./assets/images/svg/Microsoft_SQL_Server_DB_No_Logo.svg":e===M.d.ORACLE_DB?"./assets/images/svg/Oracle_DB_No_Logo.svg":`./assets/images/svg/${e}.svg`}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=n.Yp;static \u0275fac=function(c){return new(c||i)(t.Y36(A.E),t.Y36(O.Q),t.Y36(s.b),t.Y36(w.W),t.Y36(R.S),t.Y36(b.D),t.Y36(F.L),t.Y36(N.F0),t.Y36(t.sBO),t.Y36(L.u),t.Y36(y.YP))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-w-instances"]],viewQuery:function(c,r){if(1&c&&t.Gf(Q,5),2&c){let I;t.iGM(I=t.CRH())&&(r.instancesFormC=I.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:13,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Instances",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["instancesFormC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"float-right","position-relative"],["styleClass","ml-3 mt-2px","tooltipPosition","right","pTooltip","Show All",3,"ngModel","ngModelChange","onChange"],["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","Make Active",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Inactive",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Make Active",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-check","text-success","fa-fw"],["pTooltip","Make Inactive",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","align-middle","text-danger"],["pTooltip","All Instances",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 instance-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: 40px;",4,"ngIf"],[2,"width","40px"],["class","text-center","style","width: 40px;",4,"ngIf"],[2,"width","45px"],[1,"text-center",2,"width","40px"],[3,"pSelectableRow"],[3,"src","alt"],[1,"word-break-all"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"text-center"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(c,r){1&c&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Instances"),t.qZA(),t.YNc(5,C,12,6,"span",3),t.YNc(6,a,3,2,"span",4),t.YNc(7,_,3,2,"span",4),t.qZA(),t.TgZ(8,"div",5),t.YNc(9,l,3,1,"div",3),t.YNc(10,rt,5,7,"div",6),t.qZA()(),t._UZ(11,"app-w-instances-form",7,8)),2&c&&(t.xp6(5),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.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances),t.xp6(1),t.Q6J("ngIf",!(r.eventCenterS.group.apisRegex.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances)),t.xp6(1),t.Q6J("data",r.data))},dependencies:[P.JJ,P.On,K.O5,Z.iA,y.jx,Z.Ei,Z.UA,Z.Mo,B.G,J.u,W.Ql,Y.XZ,G.o]})}return i})()},1678:(U,E,o)=>{o.r(E),o.d(E,{DashboardM:()=>h});var d=o(7664),t=o(8176),v=(o(3885),o(7747),o(4946));const T=[{path:"root",loadChildren:()=>o.e(891).then(o.bind(o,891)).then(n=>n.DashRootM)},{path:"redis-dashboard",loadChildren:()=>o.e(4110).then(o.bind(o,4110)).then(n=>n.RedisDashboardM)},{path:"summary-dashboard",loadChildren:()=>Promise.all([o.e(9575),o.e(7977)]).then(o.bind(o,7977)).then(n=>n.DashSummaryM)},{path:"developer",loadChildren:()=>o.e(3450).then(o.bind(o,3450)).then(n=>n.DashDevM)},{path:"welcome",loadChildren:()=>o.e(5334).then(o.bind(o,5334)).then(n=>n.AmWelcomeM)},{path:"ext-licenses",loadChildren:()=>o.e(7436).then(o.bind(o,7436)).then(n=>n.ExtLicensesM)}];let h=(()=>{class n{static \u0275fac=function(O){return new(O||n)};static \u0275mod=v.oAB({type:n});static \u0275inj=v.cJS({imports:[d.Bz.forChild(T),t.u]})}return n})()},6925:(U,E,o)=>{o.d(E,{Eg:()=>T,Yp:()=>u,ZF:()=>x,vT:()=>t});var t=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(t||{}),u=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(u||{}),T=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s}(T||{}),x=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(x||{})}}]);
package/dist/2473.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2473],{2473:(_e,D,r)=>{r.r(D),r.d(D,{ApiUserM:()=>ve});var P=r(7664),G=r(8176),Y=r(3726),e=r(4946),h=r(5219),R=r(5043),p=r(5861),c=r(3157),m=r(328),v=r(6212),_=r(6990),f=r(1162),U=r(5312),C=r(7240),S=r(9961),J=r(2189),A=r(5852),y=r(7414),x=r(2915),Z=r(6814),g=r(5431),w=r(7680),I=r(3259),d=r(95),O=r(553),k=r(2660);function Q(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e._uU(2," Add API User"),e.qZA())}function q(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",22),e._uU(2," View API User"),e.qZA())}function L(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Edit API User"),e.qZA())}function K(a,o){1&a&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",24),e.qZA()())}function V(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function W(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function H(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"button",25),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",26),e.YNc(2,V,2,0,"span",4),e.YNc(3,W,2,0,"span",4),e.qZA()}if(2&a){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 B(a,o){1&a&&e._UZ(0,"p-progressSpinner",27)}let F=(()=>{class a{fb;ns;apiUserS;generalS;constantsS;authCS;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];constructor(t,i,s,n,l,u){this.fb=t,this.ns=i,this.apiUserS=s,this.generalS=n,this.constantsS=l,this.authCS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var i=(0,p.Z)(function*(s){if(s)if(t.form.enable(),s.action===c.F.OPEN_FORM_IN_EDIT_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===c.F.OPEN_FORM_IN_VIEW_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.disable()}else s.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([d.kI.required]),t.form.get("password").updateValueAndValidity())});return function(s){return i.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[d.kI.required]],username:[null,[d.kI.required]],password:[null,[]]})}showModal(){$("#idApiUsersForm").modal("show")}hideModal(){$("#idApiUsersForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const i=t.form.getRawValue();i.user=t.authCS.getUserId();try{let s;if(t.loading.form=!0,t.data.mode===m.D.ADD){if(!i.password)return t.loading.form=!1,t.ns.showError(t.constantsS.apiUser.passwordError);t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.post(i).toPromise()}else t.data.mode===m.D.EDIT&&(t.form.get("password").value||delete i.password,t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.put(t.data.formData._id,i,{select:f.iH._id}).toPromise());t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsS.apiUser.addSuccess:t.constantsS.apiUser.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save user info.")}})()}processDataBeforeSaveOrUpdate(t){t.password&&(t.password=this.generalS.getEncryptedString(t.password,O.N.crypto.passCommunication))}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(e.Y36(d.qu),e.Y36(S.W),e.Y36(U.q),e.Y36(C.b),e.Y36(y.L),e.Y36(A.D))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-user-form"]],inputs:{data:"data"},decls:29,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idApiUsersForm","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","username","name","username","spellcheck","false","type","text","placeholder","Please provide username",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[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(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Q,3,0,"span",4),e.YNc(5,q,3,0,"span",4),e.YNc(6,L,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Username"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,K,5,0,"div",15),e.qZA()(),e.TgZ(23,"div",16)(24,"button",17),e._UZ(25,"i",18),e._uU(26," Close"),e.qZA(),e.YNc(27,H,4,3,"button",19),e.qZA(),e.YNc(28,B,1,0,"p-progressSpinner",20),e.qZA()()()),2&i&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(5),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[d._Y,d.Fj,d.JJ,d.JL,d.sg,d.u,Z.O5,k.y,w.G],encapsulation:2})}return a})();const j=["apiUserFormC"];function z(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",18),e.qZA()}}function X(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function ee(a,o){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Username"),e.qZA()())}function te(a,o){if(1&a&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&a){const t=o.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.username)}}function se(a,o){1&a&&e._UZ(0,"p-progressSpinner",22)}let E=(()=>{class a{apiUserS;generalS;notificationS;navigationCS;authCS;constantsS;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=f.iH._id;apiUserFormC;constructor(t,i,s,n,l,u,T,b){this.apiUserS=t,this.generalS=i,this.notificationS=s,this.navigationCS=n,this.authCS=l,this.constantsS=u,this.confirmationService=T,this.eventCenterS=b}ngOnInit(){this.eventCenterS.apiUser.selectedApiUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.apiUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - API Users")}loadGridData(){var t=this;this.loading.grid=!0;const i={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,username:1,active:1},sort:{name:1}};this.showAll&&delete i.find.active,this.subscriptions.push(this.apiUserS.query(i).subscribe(function(){var s=(0,p.Z)(function*(n){if(n.success&&(t.selectedRows=[],t.rows=n.data,t.rowsMap=_.keyBy(t.rows,f.iH._id),t.rows[0]?._id)){const l=(yield t.apiUserS.getById(t.rows[0]._id).toPromise()).data;l._id&&(yield t.navigationCS.setQueryParam(v.p.api_user,l._id),t.eventCenterS.apiUser.selectedApiUsers.next([l]),t.selectedRows=[l],yield t.fillData())}t.generalS.setNewTitle("API Maker - API Users"),t.loading.grid=!1});return function(n){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.apiUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.apiUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.apiUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var i;t.confirmationService.confirm({message:t.constantsS.apiUser.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i=yield t.apiUserS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,i.success?(t.notificationS.showSuccess(t.constantsS.apiUser.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(i,t.constantsS.apiUser.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.apiUser.selectedApiUsers.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedApiUsers.next([]),yield t.navigationCS.setQueryParam(v.p.api_user,null)})()}apiUserSelected(){var t=this;return(0,p.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(v.p.api_user,""),void t.eventCenterS.apiUser.selectedApiUsers.next([]);const i=(yield t.apiUserS.getById(t.selectedRows[0]._id).toPromise()).data;i._id?(yield t.navigationCS.setQueryParam(v.p.api_user,i._id),t.eventCenterS.apiUser.selectedApiUsers.next([i])):t.resetDependents().then()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(i){return new(i||a)(e.Y36(U.q),e.Y36(C.b),e.Y36(S.W),e.Y36(J.S),e.Y36(A.D),e.Y36(y.L),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-users"]],viewQuery:function(i,s){if(1&i&&e.Gf(j,5),2&i){let n;e.iGM(n=e.CRH())&&(s.apiUserFormC=n.first)}},decls:19,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-user.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-user-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["apiUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," API Users"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return s.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,z,2,0,"span",8),e.YNc(11,X,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return s.selectedRows=l})("dblclick",function(){return s.dblClickUsers()})("selectionChange",function(){return s.apiUserSelected()}),e.YNc(14,ee,5,0,"ng-template",12),e.YNc(15,te,5,3,"ng-template",13),e.qZA(),e.YNc(16,se,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-w-api-user-form",15,16)),2&i&&(e.xp6(10),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,w.G,I.u,F],encapsulation:2})}return a})();var ae=r(1426),ie=r(8883),re=r(5561);function ne(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.saveUserPermissions())}),e._UZ(1,"i",11),e._uU(2," Save"),e.qZA()}}function oe(a,o){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",15),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()())}function le(a,o){if(1&a&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",18),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function pe(a,o){if(1&a&&(e.TgZ(0,"tr",16),e.YNc(1,le,2,2,"td",17),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&a){const t=o.$implicit,i=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",i.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function ce(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"p-table",12),e.NdJ("selectionChange",function(s){e.CHM(t);const n=e.oxw();return e.KtG(n.selectedRows=s)})("selectionChange",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.apiGroupSelected())}),e.YNc(1,oe,4,0,"ng-template",13),e.YNc(2,pe,4,3,"ng-template",14),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("selectionMode","multiple")("metaKeySelection",!1)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function de(a,o){1&a&&e._UZ(0,"p-progressSpinner",19)}let M=(()=>{class a{groupS;generalS;notificationS;navigationS;authCS;apiUserS;constantsS;eventCenterS;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={eventChannel:new e.vpe};rows=[];rowsMap={};selectedRows=[];gridKey=f.IF.name;constructor(t,i,s,n,l,u,T,b){this.groupS=t,this.generalS=i,this.notificationS=s,this.navigationS=n,this.authCS=l,this.apiUserS=u,this.constantsS=T,this.eventCenterS=b}ngOnInit(){var t=this;this.eventCenterS.apiUser.selectedGroups.next([]),this.subscriptions.push(this.eventCenterS.apiUser.selectedApiUsers.pipe((0,ae.b)(10)).subscribe(function(){var i=(0,p.Z)(function*(s){s.length?yield t.loadGridData():t.resetList()});return function(s){return i.apply(this,arguments)}}()))}loadGridData(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i={find:{user:t.authCS.getUserId(),active:!0},select:{name:1},sort:{name:1}},s=yield t.groupS.query(i).toPromise();if(s.success){t.selectedRows=[],t.rows=s.data,t.rowsMap=_.keyBy(t.rows,"name");const n=t.eventCenterS.apiUser.selectedApiUsers.value[0].groupNames||[],l=[];for(const u of n)t.rowsMap[u]&&l.push(t.rowsMap[u]);t.selectedRows=l,t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,"_id"))}t.loading.grid=!1})()}resetList(){var t=this;return(0,p.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows.length=0,t.eventCenterS.apiUser.selectedGroups.next([])})()}apiGroupSelected(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,t.gridKey))})()}saveUserPermissions(){var t=this;return(0,p.Z)(function*(){const i=JSON.parse(JSON.stringify(t.eventCenterS.apiUser.selectedApiUsers.value[0]));i.user=t.authCS.getUserId(),i.groupNames=t.eventCenterS.apiUser.selectedGroups.value||[],t.loading.grid=!0;const s=yield t.apiUserS.put(i._id,i,{select:f.iH._id}).toPromise();s&&s.success&&t.notificationS.showSuccess("User updated successfully."),t.loading.grid=!1})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(e.Y36(ie.e),e.Y36(C.b),e.Y36(S.W),e.Y36(re.X),e.Y36(A.D),e.Y36(U.q),e.Y36(y.L),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-group-list"]],inputs:{showCheckbox:"showCheckbox"},decls:12,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,ne,3,0,"span",6),e.qZA(),e.TgZ(9,"div",7),e.YNc(10,ce,3,6,"p-table",8),e.YNc(11,de,1,0,"p-progressSpinner",9),e.qZA()()),2&i&&(e.xp6(8),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(2),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(1),e.Q6J("ngIf",s.loading.grid))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,g.UA,w.G,I.u],encapsulation:2})}return a})();function me(a,o){1&a&&(e.TgZ(0,"div",3),e._UZ(1,"app-w-api-users"),e.qZA())}function ue(a,o){1&a&&(e.TgZ(0,"div",4),e._UZ(1,"app-w-api-group-list"),e.qZA())}const fe=function(){return{height:"calc(100% - 100px);"}},ge=function(){return[50,50]};const he=[{path:"layout",component:(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=e.Xpm({type:a,selectors:[["app-api-user-layout"]],decls:4,vars:5,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body border-0 shadow-sm mb-5","orientation","horizontal",3,"panelSizes"],["pTemplate",""],[1,"col","flex","align-items-center","justify-content-center","pl-0","pr-1"],[1,"col","flex","align-items-center","justify-content-center","pl-1","pr-0"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"p-splitter",1),e.YNc(2,me,2,0,"ng-template",2),e.YNc(3,ue,2,0,"ng-template",2),e.qZA()()),2&i&&(e.xp6(1),e.Akn(e.DdM(3,fe)),e.Q6J("panelSizes",e.DdM(4,ge)))},dependencies:[h.jx,R.q,E,M],encapsulation:2})}return a})(),canActivate:[Y.P]}];let ve=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[P.Bz.forChild(he),G.u]})}return a})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2473],{2473:(we,x,r)=>{r.r(x),r.d(x,{ApiUserM:()=>Ce});var G=r(7664),Y=r(8176),J=r(3726),e=r(4946),h=r(5219),k=r(5043),p=r(5861),c=r(3157),m=r(328),v=r(6212),_=r(6990),f=r(1162),U=r(5312),S=r(7240),A=r(9961),O=r(2189),C=r(5852),w=r(7414),I=r(2915),Z=r(6814),g=r(5431),y=r(7680),b=r(3259),d=r(95),Q=r(7672),F=r(553),L=r(9394),q=r(2660),V=r(8057);function K(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add API User"),e.qZA())}function H(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View API User"),e.qZA())}function W(a,o){1&a&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit API User"),e.qZA())}function B(a,o){1&a&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",26),e.qZA()())}function z(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Swagger Token"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",27),e.qZA(),e.TgZ(5,"div",28)(6,"button",29),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.generateRandomStringForSwaggerURLPart())}),e._UZ(7,"i",30),e.qZA()()()}}function j(a,o){if(1&a&&(e.TgZ(0,"div",10),e._UZ(1,"label",11),e.TgZ(2,"div",12)(3,"a",31),e._uU(4,"View Swagger JSON"),e.qZA()()()),2&a){const t=e.oxw();e.xp6(3),e.cQ8("href","",t.environment.BE_HOST_PORT+t.EApiPaths.API+t.EApiPaths.SITES+t.EModelApiPaths.INSTANCE,"/",t.authCS.gUser.apiPath,"/get-swagger-docs/",t.form.getRawValue().swaggerURLRandomPart,"",e.LSH)}}function X(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function ee(a,o){1&a&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function te(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"button",32),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",33),e.YNc(2,X,2,0,"span",4),e.YNc(3,ee,2,0,"span",4),e.qZA()}if(2&a){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 se(a,o){1&a&&e._UZ(0,"p-progressSpinner",34)}let P=(()=>{class a{fb;ns;apiUserS;generalS;constantsS;authCS;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];environment=F.N;constructor(t,i,s,n,l,u){this.fb=t,this.ns=i,this.apiUserS=s,this.generalS=n,this.constantsS=l,this.authCS=u}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var i=(0,p.Z)(function*(s){if(s)if(t.form.enable(),s.action===c.F.OPEN_FORM_IN_EDIT_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===c.F.OPEN_FORM_IN_VIEW_MODE){const n=yield t.apiUserS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(n.data),t.form.disable()}else s.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([d.kI.required]),t.form.get("password").updateValueAndValidity())});return function(s){return i.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[d.kI.required]],username:[null,[d.kI.required]],password:[null,[]],swaggerURLRandomPart:[null,[]],enableSwaggerDocs:[!1,[]]})}showModal(){$("#idApiUsersForm").modal("show")}hideModal(){$("#idApiUsersForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const i=t.form.getRawValue();i.user=t.authCS.getUserId();try{let s;if(t.loading.form=!0,t.data.mode===m.D.ADD){if(!i.password)return t.loading.form=!1,t.ns.showError(t.constantsS.apiUser.passwordError);t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.post(i).toPromise()}else t.data.mode===m.D.EDIT&&(t.form.get("password").value||delete i.password,t.processDataBeforeSaveOrUpdate(i),s=yield t.apiUserS.put(t.data.formData._id,i,{select:f.iH._id}).toPromise());t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsS.apiUser.addSuccess:t.constantsS.apiUser.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save user info.")}})()}processDataBeforeSaveOrUpdate(t){t.password&&(t.password=this.generalS.getEncryptedString(t.password,F.N.crypto.passCommunication))}generateRandomStringForSwaggerURLPart(){this.form.patchValue({swaggerURLRandomPart:this.generalS.getRandomStringWithCapitals(32)})}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EApiPaths=Q.k$;EModelApiPaths=L.k4;static \u0275fac=function(i){return new(i||a)(e.Y36(d.qu),e.Y36(A.W),e.Y36(U.q),e.Y36(S.b),e.Y36(w.L),e.Y36(C.D))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-user-form"]],inputs:{data:"data"},decls:36,vars:10,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idApiUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","username","name","username","spellcheck","false","type","text","placeholder","Please provide username",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[1,"align-middle","mb-0","pt-1"],["formControlName","enableSwaggerDocs","label","Enable Swagger Docs",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["formControlName","swaggerURLRandomPart","name","swaggerURLRandomPart","spellcheck","false","type","text","placeholder","Please generate random URL",1,"form-control","form-control-sm"],[1,"col-2","pl-0"],["pTooltip","Generate random swagger token","type","button",1,"btn","btn-sm","btn-outline-info",3,"click"],[1,"fas","fa-star-of-life","text-info","fa-fw"],["target","_blank",3,"href"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,K,3,0,"span",4),e.YNc(5,H,3,0,"span",4),e.YNc(6,W,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Username"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,B,5,0,"div",15),e.TgZ(23,"div",10),e._UZ(24,"label",11),e.TgZ(25,"div",12)(26,"label",16),e._UZ(27,"p-checkbox",17),e.qZA()()(),e.YNc(28,z,8,0,"div",15),e.YNc(29,j,5,3,"div",15),e.qZA()(),e.TgZ(30,"div",18)(31,"button",19),e._UZ(32,"i",20),e._uU(33," Close"),e.qZA(),e.YNc(34,te,4,3,"button",21),e.qZA(),e.YNc(35,se,1,0,"p-progressSpinner",22),e.qZA()()()),2&i&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(5),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs),e.xp6(1),e.Q6J("ngIf",s.form.getRawValue().enableSwaggerDocs&&s.form.getRawValue().swaggerURLRandomPart),e.xp6(5),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[d._Y,d.Fj,d.JJ,d.JL,d.sg,d.u,Z.O5,q.y,y.G,b.u,V.XZ],encapsulation:2})}return a})();const ae=["apiUserFormC"];function ie(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",18),e.qZA()}}function re(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function ne(a,o){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Username"),e.qZA()())}function oe(a,o){if(1&a&&(e.TgZ(0,"tr",21)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&a){const t=o.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.username)}}function le(a,o){1&a&&e._UZ(0,"p-progressSpinner",22)}let E=(()=>{class a{apiUserS;generalS;notificationS;navigationCS;authCS;constantsS;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=f.iH._id;apiUserFormC;constructor(t,i,s,n,l,u,T,D){this.apiUserS=t,this.generalS=i,this.notificationS=s,this.navigationCS=n,this.authCS=l,this.constantsS=u,this.confirmationService=T,this.eventCenterS=D}ngOnInit(){this.eventCenterS.apiUser.selectedApiUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.apiUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - API Users")}loadGridData(){var t=this;this.loading.grid=!0;const i={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,username:1,active:1},sort:{name:1}};this.showAll&&delete i.find.active,this.subscriptions.push(this.apiUserS.query(i).subscribe(function(){var s=(0,p.Z)(function*(n){if(n.success&&(t.selectedRows=[],t.rows=n.data,t.rowsMap=_.keyBy(t.rows,f.iH._id),t.rows[0]?._id)){const l=(yield t.apiUserS.getById(t.rows[0]._id).toPromise()).data;l._id&&(yield t.navigationCS.setQueryParam(v.p.api_user,l._id),t.eventCenterS.apiUser.selectedApiUsers.next([l]),t.selectedRows=[l],yield t.fillData())}t.generalS.setNewTitle("API Maker - API Users"),t.loading.grid=!1});return function(n){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.apiUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.apiUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.apiUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var i;t.confirmationService.confirm({message:t.constantsS.apiUser.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i=yield t.apiUserS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,i.success?(t.notificationS.showSuccess(t.constantsS.apiUser.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(i,t.constantsS.apiUser.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.apiUser.selectedApiUsers.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedApiUsers.next([]),yield t.navigationCS.setQueryParam(v.p.api_user,null)})()}apiUserSelected(){var t=this;return(0,p.Z)(function*(){yield t.resetDependents(),yield t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(v.p.api_user,""),void t.eventCenterS.apiUser.selectedApiUsers.next([]);const i=(yield t.apiUserS.getById(t.selectedRows[0]._id).toPromise()).data;i._id?(yield t.navigationCS.setQueryParam(v.p.api_user,i._id),t.eventCenterS.apiUser.selectedApiUsers.next([i])):t.resetDependents().then()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(i){return new(i||a)(e.Y36(U.q),e.Y36(S.b),e.Y36(A.W),e.Y36(O.S),e.Y36(C.D),e.Y36(w.L),e.Y36(h.YP),e.Y36(I.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-users"]],viewQuery:function(i,s){if(1&i&&e.Gf(ae,5),2&i){let n;e.iGM(n=e.CRH())&&(s.apiUserFormC=n.first)}},decls:19,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-user.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-user-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["apiUserFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," API Users"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return s.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ie,2,0,"span",8),e.YNc(11,re,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return s.selectedRows=l})("dblclick",function(){return s.dblClickUsers()})("selectionChange",function(){return s.apiUserSelected()}),e.YNc(14,ne,5,0,"ng-template",12),e.YNc(15,oe,5,3,"ng-template",13),e.qZA(),e.YNc(16,le,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-w-api-user-form",15,16)),2&i&&(e.xp6(10),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,y.G,b.u,P],encapsulation:2})}return a})();var pe=r(1426),ce=r(8883),de=r(5561);function me(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"span",10),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.saveUserPermissions())}),e._UZ(1,"i",11),e._uU(2," Save"),e.qZA()}}function ue(a,o){1&a&&(e.TgZ(0,"tr"),e._UZ(1,"th",15),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()())}function fe(a,o){if(1&a&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",18),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ge(a,o){if(1&a&&(e.TgZ(0,"tr",16),e.YNc(1,fe,2,2,"td",17),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&a){const t=o.$implicit,i=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",i.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function he(a,o){if(1&a){const t=e.EpF();e.TgZ(0,"p-table",12),e.NdJ("selectionChange",function(s){e.CHM(t);const n=e.oxw();return e.KtG(n.selectedRows=s)})("selectionChange",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.apiGroupSelected())}),e.YNc(1,ue,4,0,"ng-template",13),e.YNc(2,ge,4,3,"ng-template",14),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("selectionMode","multiple")("metaKeySelection",!1)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows)}}function ve(a,o){1&a&&e._UZ(0,"p-progressSpinner",19)}let N=(()=>{class a{groupS;generalS;notificationS;navigationS;authCS;apiUserS;constantsS;eventCenterS;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={eventChannel:new e.vpe};rows=[];rowsMap={};selectedRows=[];gridKey=f.IF.name;constructor(t,i,s,n,l,u,T,D){this.groupS=t,this.generalS=i,this.notificationS=s,this.navigationS=n,this.authCS=l,this.apiUserS=u,this.constantsS=T,this.eventCenterS=D}ngOnInit(){var t=this;this.eventCenterS.apiUser.selectedGroups.next([]),this.subscriptions.push(this.eventCenterS.apiUser.selectedApiUsers.pipe((0,pe.b)(10)).subscribe(function(){var i=(0,p.Z)(function*(s){s.length?yield t.loadGridData():t.resetList()});return function(s){return i.apply(this,arguments)}}()))}loadGridData(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const i={find:{user:t.authCS.getUserId(),active:!0},select:{name:1},sort:{name:1}},s=yield t.groupS.query(i).toPromise();if(s.success){t.selectedRows=[],t.rows=s.data,t.rowsMap=_.keyBy(t.rows,"name");const n=t.eventCenterS.apiUser.selectedApiUsers.value[0].groupNames||[],l=[];for(const u of n)t.rowsMap[u]&&l.push(t.rowsMap[u]);t.selectedRows=l,t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,"_id"))}t.loading.grid=!1})()}resetList(){var t=this;return(0,p.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows.length=0,t.eventCenterS.apiUser.selectedGroups.next([])})()}apiGroupSelected(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.apiUser.selectedGroups.next(_.map(t.selectedRows,t.gridKey))})()}saveUserPermissions(){var t=this;return(0,p.Z)(function*(){const i=JSON.parse(JSON.stringify(t.eventCenterS.apiUser.selectedApiUsers.value[0]));i.user=t.authCS.getUserId(),i.groupNames=t.eventCenterS.apiUser.selectedGroups.value||[],t.loading.grid=!0;const s=yield t.apiUserS.put(i._id,i,{select:f.iH._id}).toPromise();s&&s.success&&t.notificationS.showSuccess("User updated successfully."),t.loading.grid=!1})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(e.Y36(ce.e),e.Y36(S.b),e.Y36(A.W),e.Y36(de.X),e.Y36(C.D),e.Y36(U.q),e.Y36(w.L),e.Y36(I.u))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-w-api-group-list"]],inputs:{showCheckbox:"showCheckbox"},decls:12,vars:3,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/api-group.svg","alt","API Group Permissions",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-security/api-group-permission.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["styleClass","p-datatable-striped","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[2,"width","40px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Groups"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,me,3,0,"span",6),e.qZA(),e.TgZ(9,"div",7),e.YNc(10,he,3,6,"p-table",8),e.YNc(11,ve,1,0,"p-progressSpinner",9),e.qZA()()),2&i&&(e.xp6(8),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(2),e.Q6J("ngIf",s.eventCenterS.apiUser.selectedApiUsers.value.length),e.xp6(1),e.Q6J("ngIf",s.loading.grid))},dependencies:[Z.O5,g.iA,h.jx,g.Ei,g.UA,y.G,b.u],encapsulation:2})}return a})();function _e(a,o){1&a&&(e.TgZ(0,"div",3),e._UZ(1,"app-w-api-users"),e.qZA())}function Ue(a,o){1&a&&(e.TgZ(0,"div",4),e._UZ(1,"app-w-api-group-list"),e.qZA())}const Se=function(){return{height:"calc(100% - 100px);"}},R=function(){return[50,50]};const Ae=[{path:"layout",component:(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=e.Xpm({type:a,selectors:[["app-api-user-layout"]],decls:4,vars:7,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body border-0 shadow-sm mb-5","orientation","horizontal",3,"panelSizes","minSizes"],["pTemplate",""],[1,"col","flex","align-items-center","justify-content-center","pl-0","pr-1"],[1,"col","flex","align-items-center","justify-content-center","pl-1","pr-0"]],template:function(i,s){1&i&&(e.TgZ(0,"div",0)(1,"p-splitter",1),e.YNc(2,_e,2,0,"ng-template",2),e.YNc(3,Ue,2,0,"ng-template",2),e.qZA()()),2&i&&(e.xp6(1),e.Akn(e.DdM(4,Se)),e.Q6J("panelSizes",e.DdM(5,R))("minSizes",e.DdM(6,R)))},dependencies:[h.jx,k.q,E,N],encapsulation:2})}return a})(),canActivate:[J.P]}];let Ce=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[G.Bz.forChild(Ae),Y.u]})}return a})()}}]);
package/dist/4186.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4186],{4186:(at,M,o)=>{o.r(M),o.d(M,{SystemApiM:()=>O});var g=o(7664),t=o(8176),m=o(4946),S=o(9329);let A=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||s)};static \u0275cmp=m.Xpm({type:s,selectors:[["app-system-api-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(u,b){1&u&&(m.TgZ(0,"div",0),m._UZ(1,"app-system-api-w",1),m.qZA()),2&u&&(m.xp6(1),m.Q6J("showCheckbox",!1))},dependencies:[S.X],encapsulation:2})}return s})();var f=o(3726),I=(o(3219),o(4950));const E=[{path:"layout",component:A,canActivate:[f.P]}];let O=(()=>{class s{static \u0275fac=function(u){return new(u||s)};static \u0275mod=m.oAB({type:s});static \u0275inj=m.cJS({imports:[g.Bz.forChild(E),t.u,I.A]})}return s})()},3219:(at,M,o)=>{o.d(M,{S:()=>st});var g=o(5861),t=o(3157),m=o(328),S=o(7672),A=o(9361),f=o(1162),P=o(553),I=o(5085),E=o(1601),x=o(3531),O=o(9989),s=o(4946),W=o(9961),D=o(6457),u=o(7240),b=o(2304),F=o(3429),K=o(7414),N=o(5852),B=o(6814),Z=o(2660),U=o(5860),G=o(756),T=o(7680),J=o(3259),Y=o(5025);const Q=["monacoEditorModalC"],k=["insertCodeModalC"];function H(d,h){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",26),s._uU(2," Add System API Setting"),s.qZA())}function V(d,h){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",27),s._uU(2," View System API Setting"),s.qZA())}function j(d,h){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",28),s._uU(2," Edit System API Setting"),s.qZA())}function X(d,h){if(1&d){const a=s.EpF();s.TgZ(0,"a",29),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.viewError())}),s._uU(1,"View error"),s.qZA()}}function z(d,h){1&d&&(s.TgZ(0,"span"),s._uU(1,"Save"),s.qZA())}function q(d,h){1&d&&(s.TgZ(0,"span"),s._uU(1,"Update"),s.qZA())}function tt(d,h){if(1&d){const a=s.EpF();s.TgZ(0,"button",30),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.save())}),s._UZ(1,"i",31),s.YNc(2,z,2,0,"span",4),s.YNc(3,q,2,0,"span",4),s.qZA()}if(2&d){const a=s.oxw();s.xp6(2),s.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function et(d,h){1&d&&s._UZ(0,"p-progressSpinner",32)}let st=(()=>{class d{ns;systemApiSettingsS;generalS;monacoS;instanceS;constantsS;authCS;generalCS;EAPIAccessType=S.di;data;loading={form:!1};EFormMode=m.D;subscriptions=[];editorSysApiCode;editorOptionsSysApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=P.N.BE_HOST_PORT;viewDockerfileModelC;DOCS_HOST_PORT=P.N.DOCS_HOST_PORT;insertCodeModalC;constructor(a,l,r,y,R,nt,it,ot){this.ns=a,this.systemApiSettingsS=l,this.generalS=r,this.monacoS=y,this.instanceS=R,this.constantsS=nt,this.authCS=it,this.generalCS=ot}ngOnInit(){var a=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var l=(0,g.Z)(function*(r){r&&(r.action===t.F.OPEN_FORM_IN_EDIT_MODE||r.action===t.F.OPEN_FORM_IN_VIEW_MODE?a.editorSysApiCode&&(a.data.formData.sysApiSettingCode?a.generalCS.setValueInEditor(a,"editorSysApiCode",a.data.formData.sysApiSettingCode):a.loadSysApiCode()):r.action===t.F.OPEN_FORM_IN_ADD_MODE&&a.loadSysApiCode())});return function(r){return l.apply(this,arguments)}}()))}loadSysApiCode(){var a=this;return(0,g.Z)(function*(){const l=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,I.R.SYSTEM_APIS).toPromise();a.generalCS.setValueInEditor(a,"editorSysApiCode",l.data)})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=A.H.Settings,this.insertCodeModalC.showModal(x.b.SystemApiFormC)}editorGenerated(a){var l=this;return(0,g.Z)(function*(){l.editorSysApiCode=a,yield l.monacoS.loadSchemaEditorSettings(l.BE_HOST_PORT,l.authCS.getUserId(),null),l.monacoS.addSaveCodeKeyBinding(a,r=>{l.data.mode!==m.D.VIEW&&l.save()}),l.monacoS.addInsertCodeKeyBinding(a,r=>{l.generalCS.messageReceivedFor=A.H.All,l.data.mode!==m.D.VIEW&&l.insertCodeModalC.showModal(x.b.SystemApiFormC)}),l.subscriptions.push(l.generalS.messageReceived.subscribe(r=>{r.type&&r.type===O.g.TEXT_COPIED&&(l.monacoS.insertAtCursor(a,r.selectedText),l.insertCodeModalC.hideModal())}))})()}showModal(){this.lastError=void 0,$("#idSystemApiForm").modal("show")}hideModal(){$("#idSystemApiForm").modal("hide")}save(){var a=this;return(0,g.Z)(function*(){const l={};l.user=a.authCS.getUserId(),l.sysApiSettingCode=a.editorSysApiCode.getValue(),l.apiId=a.data.formData.apiId;try{let r;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorSysApiCode,a.monacoDecorations),a.data.mode!==m.D.ADD&&a.data.formData._id?a.data.mode===m.D.EDIT&&(r=yield a.systemApiSettingsS.replace(a.data.formData._id,l,{select:f.iH._id}).toPromise()):r=yield a.systemApiSettingsS.post(l).toPromise(),a.ns.showSuccess(a.data.mode===m.D.ADD?a.constantsS.systemApi.addSuccess:a.constantsS.systemApi.editSuccess),a.data.eventChannel.emit({action:a.data.mode===m.D.ADD?t.F.SAVED:t.F.UPDATED}),a.loading.form=!1}catch(r){a.loading.form=!1,a.ns.showErrorFromResponse(r.error||r,"Unable to save system API."),a.lastError=r.error,a.tab=a.tab||{},a.tab.axiosResponse={data:r.error},a.monacoS.highlightErrorInMonacoEditor(a.editorSysApiCode,a.tab,"MainSandbox.ts",a.monacoDecorations)}})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),E.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||d)(s.Y36(W.W),s.Y36(D.J),s.Y36(u.b),s.Y36(b.b),s.Y36(F.E),s.Y36(K.L),s.Y36(N.D),s.Y36(u.b))};static \u0275cmp=s.Xpm({type:d,selectors:[["app-w-system-api-form"]],viewQuery:function(l,r){if(1&l&&(s.Gf(Q,5),s.Gf(k,5)),2&l){let y;s.iGM(y=s.CRH())&&(r.viewDockerfileModelC=y.first),s.iGM(y=s.CRH())&&(r.insertCodeModalC=y.first)}},inputs:{data:"data"},decls:29,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSystemApiForm","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"],["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/settings/systemApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"overflow-hidden",2,"height","calc(100vh - 158px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["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"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,r){1&l&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),s.YNc(4,H,3,0,"span",4),s.YNc(5,V,3,0,"span",4),s.YNc(6,j,3,0,"span",4),s.TgZ(7,"div",5)(8,"button",6)(9,"span",7),s._UZ(10,"i",8),s.qZA()(),s.TgZ(11,"span",9),s.NdJ("click",function(){return r.showInsertCodeModel()}),s._UZ(12,"i",10),s.qZA(),s.TgZ(13,"a",11),s._UZ(14,"img",12),s.qZA()()(),s.TgZ(15,"div",13)(16,"div",14)(17,"app-monaco-editor",15),s.NdJ("editorGenerated",function(R){return r.editorGenerated(R)}),s.qZA()()(),s.TgZ(18,"div",16),s.YNc(19,X,2,0,"a",17),s.TgZ(20,"button",18),s._UZ(21,"i",19),s._uU(22," Close"),s.qZA(),s.YNc(23,tt,4,2,"button",20),s.qZA(),s.YNc(24,et,1,0,"p-progressSpinner",21),s.qZA()()(),s._UZ(25,"app-monaco-editor-modal",22,23)(27,"app-insert-code-modal",24,25)),2&l&&(s.xp6(4),s.Q6J("ngIf",r.data.mode===r.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.EDIT),s.xp6(11),s.Q6J("isSchemaEditor",!0)("editorOptions",r.editorOptionsSysApi),s.xp6(2),s.Q6J("ngIf",r.lastError),s.xp6(4),s.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.loading.form),s.xp6(1),s.Q6J("modalId","idMonacoEditorModalInSysApi")("editorOptionsMonacoEditorModal",r.editorOptionsMonacoEditorModal)("modalTitle","Error info"),s.xp6(2),s.Q6J("frameId","idInsertCodeSystemAPI")("modalId","idInsertCodeSystemAPIForm")("docsHostPort",r.DOCS_HOST_PORT))},dependencies:[B.O5,Z.y,U.P,G.O,T.G,J.u,Y.A],encapsulation:2})}return d})()},9329:(at,M,o)=>{o.d(M,{X:()=>St});var g=o(5861),t=o(4946),m=o(3157),S=o(328),A=o(6212),f=o(6990),I=o(5085),E=o(1162),x=o(6925),O=o(921),s=o(6457),W=o(3429),D=o(7240),u=o(9961),b=o(5219),F=o(2189),K=o(5852),N=o(7414),B=o(2915),Z=o(7664),U=o(95),G=o(6814),T=o(5431),J=o(7680),Y=o(3259),Q=o(8057),k=o(3219);const H=["systemApiFormC"];function V(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",13)(1,"label",14)(2,"p-checkbox",15),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.eventCenterS.group.apisRegex.allSystemApis=_)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allSystemApis)("binary",!0)}}function j(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",16)(1,"label",14)(2,"p-checkbox",15),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.eventCenterS.filterInLog.apisRegex.allSystemApis=_)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allSystemApis)("binary",!0)}}function X(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",17),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allSystemApisPermitted)}}function z(i,p){1&i&&(t.TgZ(0,"th",26),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function q(i,p){1&i&&t._UZ(0,"th",27)}function tt(i,p){1&i&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function et(i,p){1&i&&t._UZ(0,"th")}function st(i,p){1&i&&t._UZ(0,"th",28)}function d(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,z,2,0,"th",23),t.YNc(2,q,1,0,"th",24),t.TgZ(3,"th"),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th"),t._uU(6,"URL"),t.qZA(),t.YNc(7,tt,2,0,"th",9),t.YNc(8,et,1,0,"th",9),t.YNc(9,st,1,0,"th",25),t.qZA()),2&i){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(5),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 h(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",31),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function a(i,p){if(1&i&&(t.TgZ(0,"td",32)(1,"span"),t._uU(2),t.qZA()()),2&i){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function l(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"AM-User"),t.qZA())}function r(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"No-Access"),t.qZA())}function y(i,p){1&i&&(t.TgZ(0,"span",38),t._uU(1,"Public"),t.qZA())}function R(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"DB-User"),t.qZA())}function nt(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"AWS"),t.qZA())}function it(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Azure"),t.qZA())}function ot(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Google"),t.qZA())}function _t(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,l,2,0,"span",33),t.YNc(2,r,2,0,"span",34),t.YNc(3,y,2,0,"span",35),t.YNc(4,R,2,0,"span",34),t.YNc(5,nt,2,0,"span",34),t.YNc(6,it,2,0,"span",34),t.YNc(7,ot,2,0,"span",34),t.qZA()),2&i){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 rt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"label",39)(2,"p-checkbox",40),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw(2).$implicit;return t.KtG(c.saveResponseInLog=_)})("click",function(_){t.CHM(e);const c=t.oxw(4);return t.KtG(c.generalS.stopPropagation(_))}),t.qZA()()()}if(2&i){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function lt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,rt,3,2,"div",9),t.qZA()),2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("ngIf",n.selectedRows.indexOf(e)>=0)}}function pt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",46),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.add(_))}),t._UZ(1,"i",47),t.qZA()}}function ct(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",48),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.edit(_))}),t._UZ(1,"i",49),t.qZA()}}function dt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",50),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.removePermanentDialog(_))}),t._UZ(1,"i",51),t.qZA()}}const mt=function(){return["/api-info/api-testing/testing"]},gt=function(i,p,e){return{at_category:i,at_user:p,at_api:e}};function ft(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"td")(1,"div")(2,"a",41),t.NdJ("click",function(_){t.CHM(e);const c=t.oxw().$implicit,v=t.oxw(2);return _.stopPropagation(),t.KtG(v.selectedRows=[c])}),t._UZ(3,"i",42),t.qZA(),t.YNc(4,pt,2,0,"button",43),t.YNc(5,ct,2,0,"button",44),t.YNc(6,dt,2,0,"button",45),t.qZA()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(5,mt))("queryParams",t.kEZ(6,gt,n.EAPICategory.SYSTEM_APIS,n.authCS.getUserId(),e.id)),t.xp6(2),t.Q6J("ngIf",!e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings)}}function ut(i,p){if(1&i&&(t.TgZ(0,"tr",29),t.YNc(1,h,2,2,"td",9),t.YNc(2,a,3,1,"td",30),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.YNc(7,_t,8,7,"td",9),t.YNc(8,lt,2,1,"td",9),t.YNc(9,ft,7,10,"td",9),t.qZA()),2&i){const e=p.$implicit,n=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",n.showCheckbox),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Oqu(e.url),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",n.isLPM),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable)}}function At(i,p){1&i&&t._UZ(0,"p-progressSpinner",52)}function yt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",18)(1,"p-table",19),t.NdJ("selectionChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.selectedRows=_)})("selectionChange",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.apiSelected())})("dblclick",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.dblClickSystemAPIs())}),t.YNc(2,d,10,5,"ng-template",20),t.YNc(3,ut,10,8,"ng-template",21),t.qZA(),t.YNc(4,At,1,0,"p-progressSpinner",22),t.qZA()}if(2&i){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 St=(()=>{class i{systemApiSettingsS;instanceS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;showCheckbox=!0;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];rows=[];rowsMap={};rowsMapName={};data={mode:S.D.ADD,eventChannel:new t.vpe,formData:void 0};selectedRows=[];gridKey=E.iH._id;EUserType=O.dN;EAPICategory=I.R;systemApiFormC;constructor(e,n,_,c,v,C,w,L,ht,Ct,vt){this.systemApiSettingsS=e,this.instanceS=n,this.generalS=_,this.notificationS=c,this.confirmationService=v,this.navigationCS=C,this.authCS=w,this.constantsS=L,this.eventCenterS=ht,this.cd=Ct,this.router=vt}ngOnInit(){var e=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(n=>{(n.action===m.F.SAVED||n.action===m.F.UPDATED)&&(this.systemApiFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var n=(0,g.Z)(function*(_){_.length&&(yield e.loadGridData())});return function(_){return n.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(n=>{n&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - System APIs")}loadGridData(){var e=this;this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length?this.resetGridAndUrl():(this.loading.grid=!0,this.subscriptions.push(this.instanceS.systemAPIList().subscribe(function(){var n=(0,g.Z)(function*(_){_.success?(e.selectedRows=[],e.rows=_.data||[],e.rowsMap=f.keyBy(e.rows,E.iH._id),e.rowsMapName=f.keyBy(e.rows,E.qD.id)):e.resetGridAndUrl();const c=e.navigationCS.getQueryParam(A.p.system_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.systemApiIds.value.join(","):e.eventCenterS.group.systemApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.systemApiNames.join(","):"");if(c){const v=c.split(","),C=f.intersection(f.keys(e.rowsMap),v),w=[];for(const L of C)e.rowsMap[L]&&w.push(e.rowsMap[L]);e.selectedRows=w,e.eventCenterS.group.systemApiIds.next(C),e.eventCenterS.group.systemApis.next(e.selectedRows),e.eventCenterS.filterInLog.systemApiIds.next(C)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?.length){const v=e.eventCenterS.group.selectedGroups.value[0];for(const C of v?.queryParams?.systemApiNames)e.rowsMapName[C]&&(e.rowsMapName[C].saveResponseInLog=v.systemApisLog?.[C]?.saveResponseInLog||!1);e.setResDataInEventCenter()}e.loading.grid=!1,e.cd.detectChanges()});return function(_){return n.apply(this,arguments)}}())))}view(){var e=this;return(0,g.Z)(function*(){const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id},e.data.mode=S.D.VIEW,e.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_VIEW_MODE}),e.systemApiFormC.showModal()})()}add(e){var n=this;return(0,g.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=S.D.ADD,n.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE}),n.systemApiFormC.showModal()})()}edit(e){var n=this;return(0,g.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=S.D.EDIT,n.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),n.systemApiFormC.showModal()})()}getSystemApiSetting(){var e=this;return(0,g.Z)(function*(){try{return((yield e.systemApiSettingsS.query({find:{user:e.authCS.getUserId(),apiId:e.selectedRows[0]._id}}).toPromise()).data||[])[0]||{apiId:e.selectedRows[0]._id}}catch{return{apiId:e.selectedRows[0]._id}}})()}resetDependents(){var e=this;return(0,g.Z)(function*(){yield e.navigationCS.setQueryParam(A.p.system_api,null)})()}apiSelected(){var e=this;return(0,g.Z)(function*(){yield e.resetDependents(),yield e.fillData(),e.selectedRows?.[0]?e.generalS.setNewTitle(e.selectedRows[0].name,I.R.SYSTEM_APIS):e.generalS.setNewTitle("API Maker - System APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var e=this;return(0,g.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(A.p.system_api,null),e.eventCenterS.group.systemApis.next([]),e.eventCenterS.group.systemApiIds.next([]),e.eventCenterS.filterInLog.systemApiIds.next([]),void e.eventCenterS.filterInLog.systemApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable)e.eventCenterS.group.systemApiIds.next(f.map(e.selectedRows,"_id")),e.eventCenterS.group.systemApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.systemApiIds.next(f.map(e.selectedRows,"_id")),e.eventCenterS.filterInLog.systemApis.next(e.selectedRows));else{yield e.navigationCS.setQueryParam(A.p.system_api,e.selectedRows[0]._id);const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id}}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.systemApis.next(this.selectedRows),this.eventCenterS.group.selectedSystemApis.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.systemApis.next(this.selectedRows)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}removePermanentDialog(e){var n=this;return(0,g.Z)(function*(){var _;n.selectedRows=[e],n.confirmationService.confirm({message:n.confirmMessage(),header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(_=(0,g.Z)(function*(){yield n.removePermanent(e)}),function(){return _.apply(this,arguments)})}),n.cd.detectChanges()})()}removePermanent(e){var n=this;return(0,g.Z)(function*(){n.loading.grid=!0;const _=yield n.systemApiSettingsS.permanentDelete(e.systemApiSettings).toPromise();n.loading.grid=!1,_?(n.notificationS.showSuccess(n.constantsS.systemApi.removePermanent),n.resetGridAndUrl(),n.loadGridData(),yield n.getSystemApiSetting(),n.cd.detectChanges()):n.notificationS.showErrorFromResponse(_,n.constantsS.systemApi.removePermanentError)})()}dblClickSystemAPIs(){if(this.isDependentOnGroup||this.isLPM)return;const e=this.selectedRows[0];this.selectedRows.length&&e.systemApiSettings?this.edit(e):this.selectedRows.length&&!e.systemApiSettings&&this.add(e)}confirmMessage(){return'<p class="dialog-text">Do you want to <b class="text-danger">permanently remove System API settings</b>?</p>'}ERequestMethod=x.Yp;static \u0275fac=function(n){return new(n||i)(t.Y36(s.J),t.Y36(W.E),t.Y36(D.b),t.Y36(u.W),t.Y36(b.YP),t.Y36(F.S),t.Y36(K.D),t.Y36(N.L),t.Y36(B.u),t.Y36(t.sBO),t.Y36(Z.F0))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-system-api-w"]],viewQuery:function(n,_){if(1&n&&t.Gf(H,5),2&n){let c;t.iGM(c=t.CRH())&&(_.systemApiFormC=c.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:15,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/systems.svg","alt","System API",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/examples/sys/system/system.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All System APIs",4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All System APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[3,"data"],["systemApiFormC",""],["tooltipPosition","left","pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],["pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped system-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"],["style","width: 140px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","140px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["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-1",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["class","btn btn-xsm-custom mr-1","pTooltip","Add System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom mr-1","pTooltip","Edit System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom","pTooltip","Permanent Delete System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["pTooltip","Add System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","cursor-pointer"],["pTooltip","Edit System API Setting","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 System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,_){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," System APIs"),t.qZA(),t.TgZ(5,"div",3)(6,"a",4),t._UZ(7,"img",5),t.qZA()(),t.YNc(8,V,3,2,"span",6),t.YNc(9,j,3,2,"span",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,X,3,1,"div",9),t.YNc(12,yt,5,7,"div",10),t.qZA()(),t._UZ(13,"app-w-system-api-form",11,12)),2&n&&(t.xp6(8),t.Q6J("ngIf",_.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",_.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis),t.xp6(1),t.Q6J("ngIf",!(_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis)),t.xp6(1),t.Q6J("data",_.data))},dependencies:[Z.rH,U.JJ,U.On,G.O5,T.iA,b.jx,T.Ei,T.UA,T.Mo,J.G,Y.u,Q.XZ,k.S],encapsulation:2})}return i})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4186],{4186:(at,M,o)=>{o.r(M),o.d(M,{SystemApiM:()=>O});var g=o(7664),t=o(8176),m=o(4946),S=o(9329);let A=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||s)};static \u0275cmp=m.Xpm({type:s,selectors:[["app-system-api-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(u,b){1&u&&(m.TgZ(0,"div",0),m._UZ(1,"app-system-api-w",1),m.qZA()),2&u&&(m.xp6(1),m.Q6J("showCheckbox",!1))},dependencies:[S.X],encapsulation:2})}return s})();var f=o(3726),I=(o(3219),o(4950));const E=[{path:"layout",component:A,canActivate:[f.P]}];let O=(()=>{class s{static \u0275fac=function(u){return new(u||s)};static \u0275mod=m.oAB({type:s});static \u0275inj=m.cJS({imports:[g.Bz.forChild(E),t.u,I.A]})}return s})()},3219:(at,M,o)=>{o.d(M,{S:()=>st});var g=o(5861),t=o(3157),m=o(328),S=o(7672),A=o(9361),f=o(1162),P=o(553),I=o(5085),E=o(1601),x=o(3531),O=o(9989),s=o(4946),W=o(9961),D=o(6457),u=o(7240),b=o(2304),F=o(3429),K=o(7414),N=o(5852),B=o(6814),Z=o(2660),U=o(5860),G=o(756),T=o(7680),J=o(3259),Y=o(5025);const Q=["monacoEditorModalC"],k=["insertCodeModalC"];function H(d,h){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",26),s._uU(2," Add System API Setting"),s.qZA())}function V(d,h){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",27),s._uU(2," View System API Setting"),s.qZA())}function j(d,h){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",28),s._uU(2," Edit System API Setting"),s.qZA())}function X(d,h){if(1&d){const a=s.EpF();s.TgZ(0,"a",29),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.viewError())}),s._uU(1,"View error"),s.qZA()}}function z(d,h){1&d&&(s.TgZ(0,"span"),s._uU(1,"Save"),s.qZA())}function q(d,h){1&d&&(s.TgZ(0,"span"),s._uU(1,"Update"),s.qZA())}function tt(d,h){if(1&d){const a=s.EpF();s.TgZ(0,"button",30),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.save())}),s._UZ(1,"i",31),s.YNc(2,z,2,0,"span",4),s.YNc(3,q,2,0,"span",4),s.qZA()}if(2&d){const a=s.oxw();s.xp6(2),s.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function et(d,h){1&d&&s._UZ(0,"p-progressSpinner",32)}let st=(()=>{class d{ns;systemApiSettingsS;generalS;monacoS;instanceS;constantsS;authCS;generalCS;EAPIAccessType=S.di;data;loading={form:!1};EFormMode=m.D;subscriptions=[];editorSysApiCode;editorOptionsSysApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=P.N.BE_HOST_PORT;viewDockerfileModelC;DOCS_HOST_PORT=P.N.DOCS_HOST_PORT;insertCodeModalC;constructor(a,l,r,y,R,nt,it,ot){this.ns=a,this.systemApiSettingsS=l,this.generalS=r,this.monacoS=y,this.instanceS=R,this.constantsS=nt,this.authCS=it,this.generalCS=ot}ngOnInit(){var a=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var l=(0,g.Z)(function*(r){r&&(r.action===t.F.OPEN_FORM_IN_EDIT_MODE||r.action===t.F.OPEN_FORM_IN_VIEW_MODE?a.editorSysApiCode&&(a.data.formData.sysApiSettingCode?a.generalCS.setValueInEditor(a,"editorSysApiCode",a.data.formData.sysApiSettingCode):a.loadSysApiCode()):r.action===t.F.OPEN_FORM_IN_ADD_MODE&&a.loadSysApiCode())});return function(r){return l.apply(this,arguments)}}()))}loadSysApiCode(){var a=this;return(0,g.Z)(function*(){const l=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,I.R.SYSTEM_APIS).toPromise();a.generalCS.setValueInEditor(a,"editorSysApiCode",l.data)})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=A.H.Settings,this.insertCodeModalC.showModal(x.b.SystemApiFormC)}editorGenerated(a){var l=this;return(0,g.Z)(function*(){l.editorSysApiCode=a,yield l.monacoS.loadSchemaEditorSettings(l.BE_HOST_PORT,l.authCS.getUserId(),null),l.monacoS.addSaveCodeKeyBinding(a,r=>{l.data.mode!==m.D.VIEW&&l.save()}),l.monacoS.addInsertCodeKeyBinding(a,r=>{l.generalCS.messageReceivedFor=A.H.All,l.data.mode!==m.D.VIEW&&l.insertCodeModalC.showModal(x.b.SystemApiFormC)}),l.subscriptions.push(l.generalS.messageReceived.subscribe(r=>{r.type&&r.type===O.g.TEXT_COPIED&&(l.monacoS.insertAtCursor(a,r.selectedText),l.insertCodeModalC.hideModal())}))})()}showModal(){this.lastError=void 0,$("#idSystemApiForm").modal("show")}hideModal(){$("#idSystemApiForm").modal("hide")}save(){var a=this;return(0,g.Z)(function*(){const l={};l.user=a.authCS.getUserId(),l.sysApiSettingCode=a.editorSysApiCode.getValue(),l.apiId=a.data.formData.apiId;try{let r;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorSysApiCode,a.monacoDecorations),a.data.mode!==m.D.ADD&&a.data.formData._id?a.data.mode===m.D.EDIT&&(r=yield a.systemApiSettingsS.replace(a.data.formData._id,l,{select:f.iH._id}).toPromise()):r=yield a.systemApiSettingsS.post(l).toPromise(),a.ns.showSuccess(a.data.mode===m.D.ADD?a.constantsS.systemApi.addSuccess:a.constantsS.systemApi.editSuccess),a.data.eventChannel.emit({action:a.data.mode===m.D.ADD?t.F.SAVED:t.F.UPDATED}),a.loading.form=!1}catch(r){a.loading.form=!1,a.ns.showErrorFromResponse(r.error||r,"Unable to save system API."),a.lastError=r.error,a.tab=a.tab||{},a.tab.axiosResponse={data:r.error},a.monacoS.highlightErrorInMonacoEditor(a.editorSysApiCode,a.tab,"MainSandbox.ts",a.monacoDecorations)}})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),E.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||d)(s.Y36(W.W),s.Y36(D.J),s.Y36(u.b),s.Y36(b.b),s.Y36(F.E),s.Y36(K.L),s.Y36(N.D),s.Y36(u.b))};static \u0275cmp=s.Xpm({type:d,selectors:[["app-w-system-api-form"]],viewQuery:function(l,r){if(1&l&&(s.Gf(Q,5),s.Gf(k,5)),2&l){let y;s.iGM(y=s.CRH())&&(r.viewDockerfileModelC=y.first),s.iGM(y=s.CRH())&&(r.insertCodeModalC=y.first)}},inputs:{data:"data"},decls:29,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSystemApiForm","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"],["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/settings/systemApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"overflow-hidden",2,"height","calc(100vh - 158px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["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"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[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"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,r){1&l&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),s.YNc(4,H,3,0,"span",4),s.YNc(5,V,3,0,"span",4),s.YNc(6,j,3,0,"span",4),s.TgZ(7,"div",5)(8,"button",6)(9,"span",7),s._UZ(10,"i",8),s.qZA()(),s.TgZ(11,"span",9),s.NdJ("click",function(){return r.showInsertCodeModel()}),s._UZ(12,"i",10),s.qZA(),s.TgZ(13,"a",11),s._UZ(14,"img",12),s.qZA()()(),s.TgZ(15,"div",13)(16,"div",14)(17,"app-monaco-editor",15),s.NdJ("editorGenerated",function(R){return r.editorGenerated(R)}),s.qZA()()(),s.TgZ(18,"div",16),s.YNc(19,X,2,0,"a",17),s.TgZ(20,"button",18),s._UZ(21,"i",19),s._uU(22," Close"),s.qZA(),s.YNc(23,tt,4,2,"button",20),s.qZA(),s.YNc(24,et,1,0,"p-progressSpinner",21),s.qZA()()(),s._UZ(25,"app-monaco-editor-modal",22,23)(27,"app-insert-code-modal",24,25)),2&l&&(s.xp6(4),s.Q6J("ngIf",r.data.mode===r.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.EDIT),s.xp6(11),s.Q6J("isSchemaEditor",!0)("editorOptions",r.editorOptionsSysApi),s.xp6(2),s.Q6J("ngIf",r.lastError),s.xp6(4),s.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.loading.form),s.xp6(1),s.Q6J("modalId","idMonacoEditorModalInSysApi")("editorOptionsMonacoEditorModal",r.editorOptionsMonacoEditorModal)("modalTitle","Error info"),s.xp6(2),s.Q6J("frameId","idInsertCodeSystemAPI")("modalId","idInsertCodeSystemAPIForm")("docsHostPort",r.DOCS_HOST_PORT))},dependencies:[B.O5,Z.y,U.P,G.O,T.G,J.u,Y.A],encapsulation:2})}return d})()},9329:(at,M,o)=>{o.d(M,{X:()=>St});var g=o(5861),t=o(4946),m=o(3157),S=o(328),A=o(6212),f=o(6990),I=o(5085),E=o(1162),x=o(6925),O=o(921),s=o(6457),W=o(3429),D=o(7240),u=o(9961),b=o(5219),F=o(2189),K=o(5852),N=o(7414),B=o(2915),Z=o(7664),U=o(95),G=o(6814),T=o(5431),J=o(7680),Y=o(3259),Q=o(8057),k=o(3219);const H=["systemApiFormC"];function V(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",13)(1,"label",14)(2,"p-checkbox",15),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.eventCenterS.group.apisRegex.allSystemApis=_)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allSystemApis)("binary",!0)}}function j(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",16)(1,"label",14)(2,"p-checkbox",15),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.eventCenterS.filterInLog.apisRegex.allSystemApis=_)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allSystemApis)("binary",!0)}}function X(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",17),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allSystemApisPermitted)}}function z(i,p){1&i&&(t.TgZ(0,"th",26),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function q(i,p){1&i&&t._UZ(0,"th",27)}function tt(i,p){1&i&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function et(i,p){1&i&&t._UZ(0,"th")}function st(i,p){1&i&&t._UZ(0,"th",28)}function d(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,z,2,0,"th",23),t.YNc(2,q,1,0,"th",24),t.TgZ(3,"th"),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th"),t._uU(6,"URL"),t.qZA(),t.YNc(7,tt,2,0,"th",9),t.YNc(8,et,1,0,"th",9),t.YNc(9,st,1,0,"th",25),t.qZA()),2&i){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(5),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 h(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",31),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function a(i,p){if(1&i&&(t.TgZ(0,"td",32)(1,"span"),t._uU(2),t.qZA()()),2&i){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function l(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"AM-User"),t.qZA())}function r(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"No-Access"),t.qZA())}function y(i,p){1&i&&(t.TgZ(0,"span",38),t._uU(1,"Public"),t.qZA())}function R(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"DB-User"),t.qZA())}function nt(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"AWS"),t.qZA())}function it(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Azure"),t.qZA())}function ot(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Google"),t.qZA())}function _t(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,l,2,0,"span",33),t.YNc(2,r,2,0,"span",34),t.YNc(3,y,2,0,"span",35),t.YNc(4,R,2,0,"span",34),t.YNc(5,nt,2,0,"span",34),t.YNc(6,it,2,0,"span",34),t.YNc(7,ot,2,0,"span",34),t.qZA()),2&i){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 rt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"label",39)(2,"p-checkbox",40),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw(2).$implicit;return t.KtG(c.saveResponseInLog=_)})("click",function(_){t.CHM(e);const c=t.oxw(4);return t.KtG(c.generalS.stopPropagation(_))}),t.qZA()()()}if(2&i){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function lt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,rt,3,2,"div",9),t.qZA()),2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("ngIf",n.selectedRows.indexOf(e)>=0)}}function pt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",46),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.add(_))}),t._UZ(1,"i",47),t.qZA()}}function ct(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",48),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.edit(_))}),t._UZ(1,"i",49),t.qZA()}}function dt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",50),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.removePermanentDialog(_))}),t._UZ(1,"i",51),t.qZA()}}const mt=function(){return["/api-info/api-testing/testing"]},gt=function(i,p,e){return{at_category:i,at_user:p,at_api:e}};function ft(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"td")(1,"div")(2,"a",41),t.NdJ("click",function(_){t.CHM(e);const c=t.oxw().$implicit,v=t.oxw(2);return _.stopPropagation(),t.KtG(v.selectedRows=[c])}),t._UZ(3,"i",42),t.qZA(),t.YNc(4,pt,2,0,"button",43),t.YNc(5,ct,2,0,"button",44),t.YNc(6,dt,2,0,"button",45),t.qZA()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(5,mt))("queryParams",t.kEZ(6,gt,n.EAPICategory.SYSTEM_APIS,n.authCS.getUserId(),e.id)),t.xp6(2),t.Q6J("ngIf",!e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings)}}function ut(i,p){if(1&i&&(t.TgZ(0,"tr",29),t.YNc(1,h,2,2,"td",9),t.YNc(2,a,3,1,"td",30),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.YNc(7,_t,8,7,"td",9),t.YNc(8,lt,2,1,"td",9),t.YNc(9,ft,7,10,"td",9),t.qZA()),2&i){const e=p.$implicit,n=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",n.showCheckbox),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Oqu(e.url),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",n.isLPM),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable)}}function At(i,p){1&i&&t._UZ(0,"p-progressSpinner",52)}function yt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",18)(1,"p-table",19),t.NdJ("selectionChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.selectedRows=_)})("selectionChange",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.apiSelected())})("dblclick",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.dblClickSystemAPIs())}),t.YNc(2,d,10,5,"ng-template",20),t.YNc(3,ut,10,8,"ng-template",21),t.qZA(),t.YNc(4,At,1,0,"p-progressSpinner",22),t.qZA()}if(2&i){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 St=(()=>{class i{systemApiSettingsS;instanceS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;showCheckbox=!0;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];rows=[];rowsMap={};rowsMapName={};data={mode:S.D.ADD,eventChannel:new t.vpe,formData:void 0};selectedRows=[];gridKey=E.iH._id;EUserType=O.dN;EAPICategory=I.R;systemApiFormC;constructor(e,n,_,c,v,C,w,L,ht,Ct,vt){this.systemApiSettingsS=e,this.instanceS=n,this.generalS=_,this.notificationS=c,this.confirmationService=v,this.navigationCS=C,this.authCS=w,this.constantsS=L,this.eventCenterS=ht,this.cd=Ct,this.router=vt}ngOnInit(){var e=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(n=>{(n.action===m.F.SAVED||n.action===m.F.UPDATED)&&(this.systemApiFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var n=(0,g.Z)(function*(_){_.length&&(yield e.loadGridData())});return function(_){return n.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(n=>{n&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - System APIs")}loadGridData(){var e=this;this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length?this.resetGridAndUrl():(this.loading.grid=!0,this.subscriptions.push(this.instanceS.systemAPIList().subscribe(function(){var n=(0,g.Z)(function*(_){_.success?(e.selectedRows=[],e.rows=_.data||[],e.rowsMap=f.keyBy(e.rows,E.iH._id),e.rowsMapName=f.keyBy(e.rows,E.qD.id)):e.resetGridAndUrl();const c=e.navigationCS.getQueryParam(A.p.system_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.systemApiIds.value.join(","):e.eventCenterS.group.systemApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.systemApiNames.join(","):"");if(c){const v=c.split(","),C=f.intersection(f.keys(e.rowsMap),v),w=[];for(const L of C)e.rowsMap[L]&&w.push(e.rowsMap[L]);e.selectedRows=w,e.eventCenterS.group.systemApiIds.next(C),e.eventCenterS.group.systemApis.next(e.selectedRows),e.eventCenterS.filterInLog.systemApiIds.next(C)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?.length){const v=e.eventCenterS.group.selectedGroups.value[0];for(const C of v?.queryParams?.systemApiNames)e.rowsMapName[C]&&(e.rowsMapName[C].saveResponseInLog=v.systemApisLog?.[C]?.saveResponseInLog||!1);e.setResDataInEventCenter()}e.loading.grid=!1,e.cd.detectChanges()});return function(_){return n.apply(this,arguments)}}())))}view(){var e=this;return(0,g.Z)(function*(){const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id},e.data.mode=S.D.VIEW,e.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_VIEW_MODE}),e.systemApiFormC.showModal()})()}add(e){var n=this;return(0,g.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=S.D.ADD,n.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE}),n.systemApiFormC.showModal()})()}edit(e){var n=this;return(0,g.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=S.D.EDIT,n.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),n.systemApiFormC.showModal()})()}getSystemApiSetting(){var e=this;return(0,g.Z)(function*(){try{return((yield e.systemApiSettingsS.query({find:{user:e.authCS.getUserId(),apiId:e.selectedRows[0]._id}}).toPromise()).data||[])[0]||{apiId:e.selectedRows?.[0]?._id}}catch{return{apiId:e.selectedRows?.[0]?._id}}})()}resetDependents(){var e=this;return(0,g.Z)(function*(){yield e.navigationCS.setQueryParam(A.p.system_api,null)})()}apiSelected(){var e=this;return(0,g.Z)(function*(){yield e.resetDependents(),yield e.fillData(),e.selectedRows?.[0]?e.generalS.setNewTitle(e.selectedRows[0].name,I.R.SYSTEM_APIS):e.generalS.setNewTitle("API Maker - System APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var e=this;return(0,g.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(A.p.system_api,null),e.eventCenterS.group.systemApis.next([]),e.eventCenterS.group.systemApiIds.next([]),e.eventCenterS.filterInLog.systemApiIds.next([]),void e.eventCenterS.filterInLog.systemApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable)e.eventCenterS.group.systemApiIds.next(f.map(e.selectedRows,"_id")),e.eventCenterS.group.systemApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.systemApiIds.next(f.map(e.selectedRows,"_id")),e.eventCenterS.filterInLog.systemApis.next(e.selectedRows));else{yield e.navigationCS.setQueryParam(A.p.system_api,e.selectedRows[0]._id);const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id}}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.systemApis.next(this.selectedRows),this.eventCenterS.group.selectedSystemApis.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.systemApis.next(this.selectedRows)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}removePermanentDialog(e){var n=this;return(0,g.Z)(function*(){var _;n.selectedRows=[e],n.confirmationService.confirm({message:n.confirmMessage(),header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(_=(0,g.Z)(function*(){yield n.removePermanent(e)}),function(){return _.apply(this,arguments)})}),n.cd.detectChanges()})()}removePermanent(e){var n=this;return(0,g.Z)(function*(){n.loading.grid=!0;const _=yield n.systemApiSettingsS.permanentDelete(e.systemApiSettings).toPromise();n.loading.grid=!1,_?(n.notificationS.showSuccess(n.constantsS.systemApi.removePermanent),n.resetGridAndUrl(),n.loadGridData(),yield n.getSystemApiSetting(),n.cd.detectChanges()):n.notificationS.showErrorFromResponse(_,n.constantsS.systemApi.removePermanentError)})()}dblClickSystemAPIs(){if(this.isDependentOnGroup||this.isLPM)return;const e=this.selectedRows[0];this.selectedRows.length&&e.systemApiSettings?this.edit(e):this.selectedRows.length&&!e.systemApiSettings&&this.add(e)}confirmMessage(){return'<p class="dialog-text">Do you want to <b class="text-danger">permanently remove System API settings</b>?</p>'}ERequestMethod=x.Yp;static \u0275fac=function(n){return new(n||i)(t.Y36(s.J),t.Y36(W.E),t.Y36(D.b),t.Y36(u.W),t.Y36(b.YP),t.Y36(F.S),t.Y36(K.D),t.Y36(N.L),t.Y36(B.u),t.Y36(t.sBO),t.Y36(Z.F0))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-system-api-w"]],viewQuery:function(n,_){if(1&n&&t.Gf(H,5),2&n){let c;t.iGM(c=t.CRH())&&(_.systemApiFormC=c.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:15,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/systems.svg","alt","System API",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/examples/sys/system/system.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All System APIs",4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All System APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[3,"data"],["systemApiFormC",""],["tooltipPosition","left","pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],["pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped system-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"],["style","width: 140px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","140px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["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-1",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["class","btn btn-xsm-custom mr-1","pTooltip","Add System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom mr-1","pTooltip","Edit System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom","pTooltip","Permanent Delete System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["pTooltip","Add System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","cursor-pointer"],["pTooltip","Edit System API Setting","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 System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,_){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," System APIs"),t.qZA(),t.TgZ(5,"div",3)(6,"a",4),t._UZ(7,"img",5),t.qZA()(),t.YNc(8,V,3,2,"span",6),t.YNc(9,j,3,2,"span",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,X,3,1,"div",9),t.YNc(12,yt,5,7,"div",10),t.qZA()(),t._UZ(13,"app-w-system-api-form",11,12)),2&n&&(t.xp6(8),t.Q6J("ngIf",_.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",_.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis),t.xp6(1),t.Q6J("ngIf",!(_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis)),t.xp6(1),t.Q6J("data",_.data))},dependencies:[Z.rH,U.JJ,U.On,G.O5,T.iA,b.jx,T.Ei,T.UA,T.Mo,J.G,Y.u,Q.XZ,k.S],encapsulation:2})}return i})()}}]);