@sava-info-systems/api-maker-with-extensions 1.10.0 → 1.12.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 (65) hide show
  1. package/dist/1025.js +1 -1
  2. package/dist/1097.js +1 -1
  3. package/dist/148.js +1 -1
  4. package/dist/1558.js +1 -1
  5. package/dist/1678.js +1 -1
  6. package/dist/1754.js +1 -1
  7. package/dist/1928.js +1 -1
  8. package/dist/1957.js +1 -1
  9. package/dist/2140.js +1 -1
  10. package/dist/2295.js +1 -1
  11. package/dist/2473.js +1 -1
  12. package/dist/2714.js +1 -1
  13. package/dist/2735.js +1 -1
  14. package/dist/2908.js +1 -1
  15. package/dist/3081.js +1 -0
  16. package/dist/3139.js +1 -1
  17. package/dist/3450.js +1 -1
  18. package/dist/4110.js +1 -1
  19. package/dist/4181.js +1 -1
  20. package/dist/4186.js +1 -1
  21. package/dist/4211.js +1 -1
  22. package/dist/4575.js +1 -1
  23. package/dist/4842.js +1 -1
  24. package/dist/485.js +1 -1
  25. package/dist/4895.js +1 -1
  26. package/dist/5249.js +1 -1
  27. package/dist/5334.js +1 -1
  28. package/dist/5421.js +1 -1
  29. package/dist/5679.js +1 -1
  30. package/dist/5761.js +1 -1
  31. package/dist/5765.js +1 -1
  32. package/dist/6236.js +1 -1
  33. package/dist/6393.js +1 -1
  34. package/dist/6401.js +1 -1
  35. package/dist/7368.js +1 -1
  36. package/dist/7436.js +1 -1
  37. package/dist/7470.js +1 -1
  38. package/dist/7649.js +1 -1
  39. package/dist/7975.js +1 -1
  40. package/dist/7977.js +1 -1
  41. package/dist/7987.js +1 -1
  42. package/dist/8125.js +1 -1
  43. package/dist/8266.js +1 -1
  44. package/dist/8296.js +1 -1
  45. package/dist/8841.js +1 -1
  46. package/dist/885.js +1 -1
  47. package/dist/891.js +1 -1
  48. package/dist/913.js +1 -1
  49. package/dist/9243.js +1 -1
  50. package/dist/9575.js +1 -1
  51. package/dist/9939.js +1 -1
  52. package/dist/assets/images/icons/api-maker-deployment.svg +5 -0
  53. package/dist/assets/schema-types/InterfaceProps.ts +3 -1
  54. package/dist/assets/schema-types/types.ts +664 -15
  55. package/dist/assets/styles/out/styles.css +1 -1
  56. package/dist/assets/styles/out/styles.css.map +1 -1
  57. package/dist/assets/styles/styles.scss +22 -0
  58. package/dist/common.js +1 -1
  59. package/dist/main.js +1 -1
  60. package/main.js +1 -1
  61. package/package.json +4 -4
  62. package/sandbox/assets/schema-types/types.js +79 -0
  63. package/sandbox/sandbox.js +1 -1
  64. package/src/assets/schema-types/types.ts +664 -15
  65. package/src/public/dist-db-masters/browser/main.js +70 -68
package/dist/1928.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1928],{1928:(gt,d,o)=>{o.r(d),o.d(d,{TpApiM:()=>it});var T=o(7664),h=o(8176),A=o(3726),t=o(4946),c=o(5219),I=o(5043),C=o(8651),r=o(5861),x=o(7672),l=o(1162),E=o(553),m=o(5085),_=o(9394),y=o(1601),P=o(8883),O=o(5561),g=o(9961),M=o(5852),Z=o(2915),N=o(2304),F=o(3429),G=o(7414),D=o(7240),B=o(1252),Y=o(2559),J=o(6814),H=o(756),b=o(7680),f=o(4844),R=o(3259),L=o(5025);const U=["monacoEditorModalC"];function V(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",12),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",13),t.qZA()}}function Q(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",14),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",15),t.qZA()}}function w(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"a",16),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw(2);return t.KtG(s.editorGeneratedBasicInfo(n))}),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(2),t.Q6J("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function j(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",28)(1,"button",29),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.save())}),t._UZ(2,"i",30),t._uU(3," Add Third Party API Settings "),t.qZA()()}}function z(a,p){1&a&&t._UZ(0,"p-progressSpinner",31)}function W(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.NdJ("activeIndexChange",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.activeIndex=n)})("activeIndexChange",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.tabSelected())}),t.TgZ(3,"p-tabPanel",20),t.YNc(4,K,3,2,"div",21),t.qZA(),t.TgZ(5,"p-tabPanel",22),t.YNc(6,j,4,0,"div",23),t.TgZ(7,"div",24)(8,"app-monaco-editor",25),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.editorGenerated(n))}),t.qZA()()()()(),t.YNc(9,z,1,0,"p-progressSpinner",26),t.qZA()}if(2&a){const e=t.oxw();t.xp6(2),t.Q6J("activeIndex",e.activeIndex),t.xp6(2),t.Q6J("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.xp6(2),t.Q6J("ngIf",!e.tpApiSetting._id),t.xp6(2),t.Q6J("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.xp6(1),t.Q6J("ngIf",e.loading.form)}}let S=(()=>{class a{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=x.di;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=E.N.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,ot,at,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=ot,this.instanceS=at,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.Z)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName&&(i.treeItemApiId=e._id,i.tpInstallApi=(yield i.tpInstalledApisS.getById(e._id).toPromise()).data,i.cd.detectChanges()),i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.Z)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.Z)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.iH._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||_.pj.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.iH._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab=e.tab||{},e.tab.axiosResponse={data:s.error},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.Z)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.Z)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(t.Y36(P.e),t.Y36(O.X),t.Y36(g.W),t.Y36(M.D),t.Y36(Z.u),t.Y36(N.b),t.Y36(F.E),t.Y36(G.L),t.Y36(D.b),t.Y36(B.G),t.Y36(Y.d),t.Y36(g.W),t.Y36(c.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.Gf(U,5),2&i){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Third Party API Settings"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,V,2,0,"span",5),t.YNc(8,Q,2,0,"span",6),t.YNc(9,w,2,0,"a",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,W,10,7,"div",9),t.qZA()(),t._UZ(12,"app-monaco-editor-modal",10,11)),2&i&&(t.xp6(7),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.xp6(1),t.Q6J("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.xp6(1),t.Q6J("ngIf",n.lastError),t.xp6(2),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[J.O5,H.O,b.G,f.xf,f.x4,R.u,L.A],encapsulation:2})}return a})();function X(a,p){1&a&&t._UZ(0,"app-w-supported-tp-api",3),2&a&&t.Q6J("IsDependentOnGroup",!1)("isLPM",!1)}function $(a,p){1&a&&t._UZ(0,"app-w-tp-api-form",4)}const u=function(){return[40,60]};let v=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,X,1,2,"ng-template",2),t.YNc(3,$,1,0,"ng-template",2),t.qZA()()),2&i&&(t.xp6(1),t.Q6J("panelSizes",t.DdM(2,u))("minSizes",t.DdM(3,u)))},dependencies:[c.jx,I.q,C.A,S],encapsulation:2})}return a})();var k=o(6401),q=o(7705),tt=o(4950);const et=[{path:"tp-layout",component:v,canActivate:[A.P]}];let it=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[T.Bz.forChild(et),h.u,k.GroupM,q.L,tt.A]})}return a})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1928],{1928:(gt,d,o)=>{o.r(d),o.d(d,{TpApiM:()=>it});var T=o(7664),h=o(7359),A=o(3726),t=o(4946),c=o(5219),I=o(5043),C=o(8651),r=o(5861),x=o(7672),l=o(1162),E=o(553),m=o(5085),_=o(9394),y=o(1601),P=o(8883),O=o(5561),g=o(9961),M=o(5852),Z=o(2915),N=o(2304),F=o(3429),G=o(7414),D=o(7240),B=o(1252),Y=o(2559),J=o(6814),H=o(756),b=o(7680),f=o(4844),R=o(3259),L=o(5025);const U=["monacoEditorModalC"];function V(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",12),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",13),t.qZA()}}function Q(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",14),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",15),t.qZA()}}function w(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"a",16),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw(2);return t.KtG(s.editorGeneratedBasicInfo(n))}),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(2),t.Q6J("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function j(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",28)(1,"button",29),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.save())}),t._UZ(2,"i",30),t._uU(3," Add Third Party API Settings "),t.qZA()()}}function z(a,p){1&a&&t._UZ(0,"p-progressSpinner",31)}function W(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.NdJ("activeIndexChange",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.activeIndex=n)})("activeIndexChange",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.tabSelected())}),t.TgZ(3,"p-tabPanel",20),t.YNc(4,K,3,2,"div",21),t.qZA(),t.TgZ(5,"p-tabPanel",22),t.YNc(6,j,4,0,"div",23),t.TgZ(7,"div",24)(8,"app-monaco-editor",25),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.editorGenerated(n))}),t.qZA()()()()(),t.YNc(9,z,1,0,"p-progressSpinner",26),t.qZA()}if(2&a){const e=t.oxw();t.xp6(2),t.Q6J("activeIndex",e.activeIndex),t.xp6(2),t.Q6J("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.xp6(2),t.Q6J("ngIf",!e.tpApiSetting._id),t.xp6(2),t.Q6J("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.xp6(1),t.Q6J("ngIf",e.loading.form)}}let S=(()=>{class a{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=x.di;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=E.N.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,ot,at,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=ot,this.instanceS=at,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.Z)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName&&(i.treeItemApiId=e._id,i.tpInstallApi=(yield i.tpInstalledApisS.getById(e._id).toPromise()).data,i.cd.detectChanges()),i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.Z)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.Z)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.iH._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||_.pj.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.iH._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab=e.tab||{},e.tab.axiosResponse={data:s.error},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.Z)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.Z)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(t.Y36(P.e),t.Y36(O.X),t.Y36(g.W),t.Y36(M.D),t.Y36(Z.u),t.Y36(N.b),t.Y36(F.E),t.Y36(G.L),t.Y36(D.b),t.Y36(B.G),t.Y36(Y.d),t.Y36(g.W),t.Y36(c.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.Gf(U,5),2&i){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Third Party API Settings"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,V,2,0,"span",5),t.YNc(8,Q,2,0,"span",6),t.YNc(9,w,2,0,"a",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,W,10,7,"div",9),t.qZA()(),t._UZ(12,"app-monaco-editor-modal",10,11)),2&i&&(t.xp6(7),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.xp6(1),t.Q6J("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.xp6(1),t.Q6J("ngIf",n.lastError),t.xp6(2),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[J.O5,H.O,b.G,f.xf,f.x4,R.u,L.A],encapsulation:2})}return a})();function X(a,p){1&a&&t._UZ(0,"app-w-supported-tp-api",3),2&a&&t.Q6J("IsDependentOnGroup",!1)("isLPM",!1)}function $(a,p){1&a&&t._UZ(0,"app-w-tp-api-form",4)}const u=function(){return[40,60]};let v=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,X,1,2,"ng-template",2),t.YNc(3,$,1,0,"ng-template",2),t.qZA()()),2&i&&(t.xp6(1),t.Q6J("panelSizes",t.DdM(2,u))("minSizes",t.DdM(3,u)))},dependencies:[c.jx,I.q,C.A,S],encapsulation:2})}return a})();var k=o(6401),q=o(7705),tt=o(4950);const et=[{path:"tp-layout",component:v,canActivate:[A.P]}];let it=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[T.Bz.forChild(et),h.u,k.GroupM,q.L,tt.A]})}return a})()}}]);
package/dist/1957.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1957],{1957:(y,i,e)=>{e.r(i),e.d(i,{NotesM:()=>m});var d=e(7664),p=e(8176),l=e(3726),t=e(4946),h=e(553),C=e(5405),v=e(6750),f=e(621);const u=["notesGridId"];const g=[{path:"main",component:(()=>{class n{eventCenterCS;detectChanges=new t.vpe;notesListC;loading={form:!1,response:!1};BE_HOST_PORT=h.N.BE_HOST_PORT;constructor(a){this.eventCenterCS=a}ngOnInit(){this.eventCenterCS.hideShowNotesIcon=!0}ngOnDestroy(){this.eventCenterCS.hideShowNotesIcon=!1}static \u0275fac=function(o){return new(o||n)(t.Y36(C.M))};static \u0275cmp=t.Xpm({type:n,selectors:[["app-notes-layout"]],viewQuery:function(o,s){if(1&o&&t.Gf(u,7),2&o){let r;t.iGM(r=t.CRH())&&(s.notesListC=r.first)}},inputs:{detectChanges:"detectChanges"},decls:7,vars:10,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[1,"row","m-0",2,"height","calc(100vh - 52px)"],[1,"col-3","p-0"],[1,"w-100",3,"projectType","hostAndPort"],["notesGridId",""],[1,"col-9","p-0"],[1,"w-100",3,"data","loading","projectType","hostAndPort","isPageHeight","detectChanges"]],template:function(o,s){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"app-notes-list",3,4),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"app-notes-form",6),t.qZA()()()),2&o&&(t.xp6(3),t.Q6J("projectType","AM")("hostAndPort",s.BE_HOST_PORT),t.xp6(2),t.Udp("display",s.eventCenterCS.addEditNotes?"block":"none"),t.xp6(1),t.Q6J("data",s.notesListC.data)("loading",s.loading)("projectType","AM")("hostAndPort",s.BE_HOST_PORT)("isPageHeight",!0)("detectChanges",s.detectChanges))},dependencies:[v.o,f.X],encapsulation:2})}return n})(),canActivate:[l.P]}];let m=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=t.oAB({type:n});static \u0275inj=t.cJS({imports:[d.Bz.forChild(g),p.u]})}return n})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1957],{1957:(y,i,e)=>{e.r(i),e.d(i,{NotesM:()=>m});var d=e(7664),p=e(7359),l=e(3726),t=e(4946),h=e(553),C=e(5405),v=e(6750),f=e(621);const u=["notesGridId"];const g=[{path:"main",component:(()=>{class n{eventCenterCS;detectChanges=new t.vpe;notesListC;loading={form:!1,response:!1};BE_HOST_PORT=h.N.BE_HOST_PORT;constructor(a){this.eventCenterCS=a}ngOnInit(){this.eventCenterCS.hideShowNotesIcon=!0}ngOnDestroy(){this.eventCenterCS.hideShowNotesIcon=!1}static \u0275fac=function(o){return new(o||n)(t.Y36(C.M))};static \u0275cmp=t.Xpm({type:n,selectors:[["app-notes-layout"]],viewQuery:function(o,s){if(1&o&&t.Gf(u,7),2&o){let r;t.iGM(r=t.CRH())&&(s.notesListC=r.first)}},inputs:{detectChanges:"detectChanges"},decls:7,vars:10,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[1,"row","m-0",2,"height","calc(100vh - 52px)"],[1,"col-3","p-0"],[1,"w-100",3,"projectType","hostAndPort"],["notesGridId",""],[1,"col-9","p-0"],[1,"w-100",3,"data","loading","projectType","hostAndPort","isPageHeight","detectChanges"]],template:function(o,s){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._UZ(3,"app-notes-list",3,4),t.qZA(),t.TgZ(5,"div",5),t._UZ(6,"app-notes-form",6),t.qZA()()()),2&o&&(t.xp6(3),t.Q6J("projectType","AM")("hostAndPort",s.BE_HOST_PORT),t.xp6(2),t.Udp("display",s.eventCenterCS.addEditNotes?"block":"none"),t.xp6(1),t.Q6J("data",s.notesListC.data)("loading",s.loading)("projectType","AM")("hostAndPort",s.BE_HOST_PORT)("isPageHeight",!0)("detectChanges",s.detectChanges))},dependencies:[v.o,f.X],encapsulation:2})}return n})(),canActivate:[l.P]}];let m=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=t.oAB({type:n});static \u0275inj=t.cJS({imports:[d.Bz.forChild(g),p.u]})}return n})()}}]);
package/dist/2140.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2140],{2140:(l,i,n)=>{n.r(i),n.d(i,{MonitoringM:()=>m});var r=n(7664),s=n(8176),e=n(3726),o=n(4946);const u=[{path:"main",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-monitoring-c"]],decls:2,vars:0,template:function(a,f){1&a&&(o.TgZ(0,"h1"),o._uU(1,"Monitoring"),o.qZA())},encapsulation:2})}return t})(),canActivate:[e.P]}];let m=(()=>{class t{static \u0275fac=function(a){return new(a||t)};static \u0275mod=o.oAB({type:t});static \u0275inj=o.cJS({imports:[r.Bz.forChild(u),s.u]})}return t})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2140],{2140:(l,i,n)=>{n.r(i),n.d(i,{MonitoringM:()=>m});var r=n(7664),s=n(7359),e=n(3726),o=n(4946);const u=[{path:"main",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-monitoring-c"]],decls:2,vars:0,template:function(a,f){1&a&&(o.TgZ(0,"h1"),o._uU(1,"Monitoring"),o.qZA())},encapsulation:2})}return t})(),canActivate:[e.P]}];let m=(()=>{class t{static \u0275fac=function(a){return new(a||t)};static \u0275mod=o.oAB({type:t});static \u0275inj=o.cJS({imports:[r.Bz.forChild(u),s.u]})}return t})()}}]);
package/dist/2295.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2295],{2295:(ne,g,n)=>{n.r(g),n.d(g,{DevAccM:()=>se});var D=n(7664),P=n(8176),e=n(4946),c=n(5861),d=n(3157),m=n(328),f=n(6212),x=n(6990),C=n(921),u=n(1162),U=n(3835),Z=n(7240),_=n(9961),M=n(2189),y=n(204),S=n(5852),N=n(2915),T=n(5219),w=n(6814),A=n(5431),b=n(7680),Y=n(3259),i=n(95),O=n(553),R=n(2660);function k(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Add Developer User"),e.qZA())}function J(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," View Developer User"),e.qZA())}function Q(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," Edit Developer User"),e.qZA())}function V(o,l){1&o&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",27),e.qZA()())}function G(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function q(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function W(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",29),e.YNc(2,G,2,0,"span",4),e.YNc(3,q,2,0,"span",4),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function K(o,l){1&o&&e._UZ(0,"p-progressSpinner",30)}let F=(()=>{class o{fb;ns;userS;generalS;constantsCS;authCS;cd;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];constructor(t,a,s,r,p,h,v){this.fb=t,this.ns=a,this.userS=s,this.generalS=r,this.constantsCS=p,this.authCS=h,this.cd=v}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(s){if(s){if(t.form.enable(),s.action===d.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===d.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else s.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([i.kI.required,i.kI.minLength(4),i.kI.maxLength(40)]),t.form.get("password").updateValueAndValidity());t.cd.detectChanges()}});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[i.kI.required]],email:[null,[i.kI.required,i.kI.email]],apiPath:[null,[i.kI.required,i.kI.minLength(3),i.kI.maxLength(45),i.kI.pattern("[a-zA-Z0-9_]*$")]],password:[null,[]]})}showModal(){$("#idAMDevUsersForm").modal("show")}hideModal(){$("#idAMDevUsersForm").modal("hide")}save(){var t=this;return(0,c.Z)(function*(){const a=t.form.getRawValue();a.user=t.authCS.getUserId(),a.userType=C.dN.DEVELOPER,a.password=t.generalS.getEncryptedString(a.password,O.N.crypto.passCommunication);try{let s;t.loading.form=!0,t.data.mode===m.D.ADD?s=yield t.userS.post(a).toPromise():t.data.mode===m.D.EDIT&&(t.data.formData._id&&(t.form.get("password").value||delete a.password),s=yield t.userS.put(t.data.formData._id,a,{select:u.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsCS.user.addSuccess:t.constantsCS.user.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?d.F.SAVED:d.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save dev user.")}t.cd.detectChanges()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||o)(e.Y36(i.qu),e.Y36(_.W),e.Y36(U.K),e.Y36(Z.b),e.Y36(y.s),e.Y36(S.D),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-dev-user-form"]],inputs:{data:"data"},decls:39,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMDevUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","email","name","email","spellcheck","false","type","text","placeholder","Please provide email",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[1,"form-group","row",2,"margin-bottom","0 !important"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide API path",1,"form-control","text-lowercase","form-control-sm"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,k,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Q,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Email"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,V,5,0,"div",15),e.TgZ(23,"div",16)(24,"label",11),e._uU(25,"API Path"),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",17),e.qZA()(),e.TgZ(28,"div",10),e._UZ(29,"label",11),e.TgZ(30,"div",12)(31,"label",18),e._uU(32,"[a-z,_] (Ex: user_path)"),e.qZA()()()()(),e.TgZ(33,"div",19)(34,"button",20),e._UZ(35,"i",21),e._uU(36," Close"),e.qZA(),e.YNc(37,W,4,3,"button",22),e.qZA(),e.YNc(38,K,1,0,"p-progressSpinner",23),e.qZA()()()),2&a&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(15),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[i._Y,i.Fj,i.JJ,i.JL,i.sg,i.u,w.O5,R.y,b.G],encapsulation:2,changeDetection:0})}return o})();const L=["devUserFormC"];function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",16),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",17),e.qZA()}}function B(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",19),e.qZA()}}function z(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Email"),e.qZA()())}function j(o,l){if(1&o&&(e.TgZ(0,"tr",20)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&o){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.email)}}function X(o,l){1&o&&e._UZ(0,"p-progressSpinner",21)}let E=(()=>{class o{userS;generalS;notificationS;navigationCS;constantsCS;authCS;eventCenterS;confirmationService;router;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;devUserFormC;constructor(t,a,s,r,p,h,v,ae,oe){this.userS=t,this.generalS=a,this.notificationS=s,this.navigationCS=r,this.constantsCS=p,this.authCS=h,this.eventCenterS=v,this.confirmationService=ae,this.router=oe}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===d.F.SAVED||t.action===d.F.UPDATED)&&(this.devUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Developer Users")}loadGridData(){var t=this;this.loading.grid=!0;const a={find:{active:!0,userType:C.dN.DEVELOPER,user:this.authCS.getUserId()},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete a.find.active,this.subscriptions.push(this.userS.query(a).subscribe(function(){var s=(0,c.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=x.keyBy(t.rows,u.iH._id));const p=t.navigationCS.getQueryParam(f.p.user);t.rowsMap[p]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[p]]),yield t.fillData()),t.loading.grid=!1});return function(r){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.devUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_VIEW_MODE}),this.devUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE}),this.devUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var a;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const a=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,a.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(a,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(f.p.user,null)})()}devUserSelected(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then()})()}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.user,""),void t.eventCenterS.user.selectedUsers.next([]);const a=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;a._id?(yield t.navigationCS.setQueryParam(f.p.user,a._id),t.eventCenterS.user.selectedUsers.next([a])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickDevUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(a){return new(a||o)(e.Y36(U.K),e.Y36(Z.b),e.Y36(_.W),e.Y36(M.S),e.Y36(y.s),e.Y36(S.D),e.Y36(N.u),e.Y36(T.YP),e.Y36(D.F0))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-dev-users"]],viewQuery:function(a,s){if(1&a&&e.Gf(L,5),2&a){let r;e.iGM(r=e.CRH())&&(s.devUserFormC=r.first)}},decls:18,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/dev.svg","alt","Dev Accounts",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/dev-accounts/dev-accounts.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["devUserFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Developer Users"),e.qZA(),e.TgZ(5,"a",3),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return s.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,H,2,0,"span",7),e.YNc(10,B,2,0,"span",8),e.qZA(),e.TgZ(11,"div",9)(12,"p-table",10),e.NdJ("selectionChange",function(p){return s.selectedRows=p})("selectionChange",function(){return s.devUserSelected()})("dblclick",function(){return s.dblClickDevUsers()}),e.YNc(13,z,5,0,"ng-template",11),e.YNc(14,j,5,3,"ng-template",12),e.qZA(),e.YNc(15,X,1,0,"p-progressSpinner",13),e.qZA()(),e._UZ(16,"app-w-dev-user-form",14,15)),2&a&&(e.xp6(9),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[w.O5,A.iA,T.jx,A.Ei,b.G,Y.u,F],encapsulation:2})}return o})();const te=[{path:"",component:(()=>{class o{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=e.Xpm({type:o,selectors:[["app-dev-acc-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-w-dev-users"),e.qZA())},dependencies:[E],encapsulation:2})}return o})(),canActivate:[n(3726).P]}];let se=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[D.Bz.forChild(te),P.u]})}return o})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2295],{2295:(ne,g,n)=>{n.r(g),n.d(g,{DevAccM:()=>se});var D=n(7664),P=n(7359),e=n(4946),c=n(5861),d=n(3157),m=n(328),f=n(6212),x=n(6990),C=n(921),u=n(1162),U=n(3835),Z=n(7240),_=n(9961),M=n(2189),y=n(204),S=n(5852),N=n(2915),T=n(5219),w=n(6814),A=n(5431),b=n(7680),Y=n(3259),i=n(95),O=n(553),R=n(2660);function k(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," Add Developer User"),e.qZA())}function J(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," View Developer User"),e.qZA())}function Q(o,l){1&o&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," Edit Developer User"),e.qZA())}function V(o,l){1&o&&(e.TgZ(0,"div",10)(1,"label",11),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",12),e._UZ(4,"input",27),e.qZA()())}function G(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Save User"),e.qZA())}function q(o,l){1&o&&(e.TgZ(0,"span"),e._uU(1,"Update User"),e.qZA())}function W(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"button",28),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.save())}),e._UZ(1,"i",29),e.YNc(2,G,2,0,"span",4),e.YNc(3,q,2,0,"span",4),e.qZA()}if(2&o){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function K(o,l){1&o&&e._UZ(0,"p-progressSpinner",30)}let F=(()=>{class o{fb;ns;userS;generalS;constantsCS;authCS;cd;data;loading={form:!1};EFormMode=m.D;form;subscriptions=[];constructor(t,a,s,r,p,h,v){this.fb=t,this.ns=a,this.userS=s,this.generalS=r,this.constantsCS=p,this.authCS=h,this.cd=v}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var a=(0,c.Z)(function*(s){if(s){if(t.form.enable(),s.action===d.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.get("password").setValidators([]),t.form.get("password").updateValueAndValidity()}else if(s.action===d.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.userS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else s.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.form.get("password").setValidators([i.kI.required,i.kI.minLength(4),i.kI.maxLength(40)]),t.form.get("password").updateValueAndValidity());t.cd.detectChanges()}});return function(s){return a.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[i.kI.required]],email:[null,[i.kI.required,i.kI.email]],apiPath:[null,[i.kI.required,i.kI.minLength(3),i.kI.maxLength(45),i.kI.pattern("[a-zA-Z0-9_]*$")]],password:[null,[]]})}showModal(){$("#idAMDevUsersForm").modal("show")}hideModal(){$("#idAMDevUsersForm").modal("hide")}save(){var t=this;return(0,c.Z)(function*(){const a=t.form.getRawValue();a.user=t.authCS.getUserId(),a.userType=C.dN.DEVELOPER,a.password=t.generalS.getEncryptedString(a.password,O.N.crypto.passCommunication);try{let s;t.loading.form=!0,t.data.mode===m.D.ADD?s=yield t.userS.post(a).toPromise():t.data.mode===m.D.EDIT&&(t.data.formData._id&&(t.form.get("password").value||delete a.password),s=yield t.userS.put(t.data.formData._id,a,{select:u.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===m.D.ADD?t.constantsCS.user.addSuccess:t.constantsCS.user.editSuccess),t.data.eventChannel.emit({action:t.data.mode===m.D.ADD?d.F.SAVED:d.F.UPDATED}),t.loading.form=!1}catch(s){t.loading.form=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to save dev user.")}t.cd.detectChanges()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||o)(e.Y36(i.qu),e.Y36(_.W),e.Y36(U.K),e.Y36(Z.b),e.Y36(y.s),e.Y36(S.D),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-dev-user-form"]],inputs:{data:"data"},decls:39,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idAMDevUsersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["formControlName","email","name","email","spellcheck","false","type","text","placeholder","Please provide email",1,"form-control","form-control-sm"],["class","form-group row",4,"ngIf"],[1,"form-group","row",2,"margin-bottom","0 !important"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide API path",1,"form-control","text-lowercase","form-control-sm"],[1,"col-form-label","col-form-label-sm","text-info","font-monospaced"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","password","name","password","spellcheck","false","type","password","placeholder","Please provide password",1,"form-control","form-control-sm"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,k,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Q,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),e._uU(14,"Name"),e.qZA(),e.TgZ(15,"div",12),e._UZ(16,"input",13),e.qZA()(),e.TgZ(17,"div",10)(18,"label",11),e._uU(19,"Email"),e.qZA(),e.TgZ(20,"div",12),e._UZ(21,"input",14),e.qZA()(),e.YNc(22,V,5,0,"div",15),e.TgZ(23,"div",16)(24,"label",11),e._uU(25,"API Path"),e.qZA(),e.TgZ(26,"div",12),e._UZ(27,"input",17),e.qZA()(),e.TgZ(28,"div",10),e._UZ(29,"label",11),e.TgZ(30,"div",12)(31,"label",18),e._uU(32,"[a-z,_] (Ex: user_path)"),e.qZA()()()()(),e.TgZ(33,"div",19)(34,"button",20),e._UZ(35,"i",21),e._uU(36," Close"),e.qZA(),e.YNc(37,W,4,3,"button",22),e.qZA(),e.YNc(38,K,1,0,"p-progressSpinner",23),e.qZA()()()),2&a&&(e.xp6(4),e.Q6J("ngIf",s.data.mode===s.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.data.mode===s.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",s.form),e.xp6(11),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(15),e.Q6J("ngIf",s.data.mode!==s.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",s.loading.form))},dependencies:[i._Y,i.Fj,i.JJ,i.JL,i.sg,i.u,w.O5,R.y,b.G],encapsulation:2,changeDetection:0})}return o})();const L=["devUserFormC"];function H(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",16),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.edit())}),e._UZ(1,"i",17),e.qZA()}}function B(o,l){if(1&o){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const s=e.oxw();return e.KtG(s.removePermanentDialog())}),e._UZ(1,"i",19),e.qZA()}}function z(o,l){1&o&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"th"),e._uU(4,"Email"),e.qZA()())}function j(o,l){if(1&o&&(e.TgZ(0,"tr",20)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA()()),2&o){const t=l.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Oqu(t.email)}}function X(o,l){1&o&&e._UZ(0,"p-progressSpinner",21)}let E=(()=>{class o{userS;generalS;notificationS;navigationCS;constantsCS;authCS;eventCenterS;confirmationService;router;loading={grid:!1};subscriptions=[];data={mode:m.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;devUserFormC;constructor(t,a,s,r,p,h,v,ae,oe){this.userS=t,this.generalS=a,this.notificationS=s,this.navigationCS=r,this.constantsCS=p,this.authCS=h,this.eventCenterS=v,this.confirmationService=ae,this.router=oe}ngOnInit(){this.eventCenterS.user.selectedUsers.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===d.F.SAVED||t.action===d.F.UPDATED)&&(this.devUserFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Developer Users")}loadGridData(){var t=this;this.loading.grid=!0;const a={find:{active:!0,userType:C.dN.DEVELOPER,user:this.authCS.getUserId()},select:{name:1,email:1,apiPath:1,active:1,userType:1},sort:{name:1}};this.showAll&&delete a.find.active,this.subscriptions.push(this.userS.query(a).subscribe(function(){var s=(0,c.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=x.keyBy(t.rows,u.iH._id));const p=t.navigationCS.getQueryParam(f.p.user);t.rowsMap[p]&&(t.eventCenterS.user.selectedUsers.next([t.rowsMap[p]]),yield t.fillData()),t.loading.grid=!1});return function(r){return s.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=m.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.devUserFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.VIEW,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_VIEW_MODE}),this.devUserFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=m.D.EDIT,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE}),this.devUserFormC.showModal()}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var a;t.confirmationService.confirm({message:t.constantsCS.user.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return a.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const a=yield t.userS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,a.success?(t.notificationS.showSuccess(t.constantsCS.user.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(a,t.constantsCS.user.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.user.selectedUsers.next([])}resetDependents(){var t=this;return(0,c.Z)(function*(){t.eventCenterS.user.selectedUsers.next([]),yield t.navigationCS.setQueryParam(f.p.user,null)})()}devUserSelected(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then()})()}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.user,""),void t.eventCenterS.user.selectedUsers.next([]);const a=(yield t.userS.getById(t.selectedRows[0]._id).toPromise()).data;a._id?(yield t.navigationCS.setQueryParam(f.p.user,a._id),t.eventCenterS.user.selectedUsers.next([a])):t.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickDevUsers(){this.selectedRows.length&&this.edit()}static \u0275fac=function(a){return new(a||o)(e.Y36(U.K),e.Y36(Z.b),e.Y36(_.W),e.Y36(M.S),e.Y36(y.s),e.Y36(S.D),e.Y36(N.u),e.Y36(T.YP),e.Y36(D.F0))};static \u0275cmp=e.Xpm({type:o,selectors:[["app-w-dev-users"]],viewQuery:function(a,s){if(1&a&&e.Gf(L,5),2&a){let r;e.iGM(r=e.CRH())&&(s.devUserFormC=r.first)}},decls:18,vars:10,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/dev.svg","alt","Dev Accounts",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/dev-accounts/dev-accounts.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 100px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["devUserFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Developer Users"),e.qZA(),e.TgZ(5,"a",3),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return s.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,H,2,0,"span",7),e.YNc(10,B,2,0,"span",8),e.qZA(),e.TgZ(11,"div",9)(12,"p-table",10),e.NdJ("selectionChange",function(p){return s.selectedRows=p})("selectionChange",function(){return s.devUserSelected()})("dblclick",function(){return s.dblClickDevUsers()}),e.YNc(13,z,5,0,"ng-template",11),e.YNc(14,j,5,3,"ng-template",12),e.qZA(),e.YNc(15,X,1,0,"p-progressSpinner",13),e.qZA()(),e._UZ(16,"app-w-dev-user-form",14,15)),2&a&&(e.xp6(9),e.Q6J("ngIf",s.selectedRows.length),e.xp6(1),e.Q6J("ngIf",s.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),e.xp6(3),e.Q6J("ngIf",s.loading.grid),e.xp6(1),e.Q6J("data",s.data))},dependencies:[w.O5,A.iA,T.jx,A.Ei,b.G,Y.u,F],encapsulation:2})}return o})();const te=[{path:"",component:(()=>{class o{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||o)};static \u0275cmp=e.Xpm({type:o,selectors:[["app-dev-acc-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(a,s){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-w-dev-users"),e.qZA())},dependencies:[E],encapsulation:2})}return o})(),canActivate:[n(3726).P]}];let se=(()=>{class o{static \u0275fac=function(a){return new(a||o)};static \u0275mod=e.oAB({type:o});static \u0275inj=e.cJS({imports:[D.Bz.forChild(te),P.u]})}return o})()}}]);
package/dist/2473.js CHANGED
@@ -1 +1 @@
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})()}}]);
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(7359),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(3620),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/2714.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2714],{5050:(mt,v,i)=>{i.r(v),i.d(v,{I18nM:()=>lt});var b=i(7664),N=i(8176),t=i(4946),l=i(5861),c=i(3157),d=i(328),p=i(6212),x=i(6990),u=i(1162),I=i(7240),C=i(9961),A=i(2189),_=i(5852),S=i(6233),y=i(7414),D=i(5219),P=i(2915),Z=i(6814),E=i(5431),T=i(7680),O=i(3259),f=i(95),U=i(553),R=i(1601),Y=i(2304),J=i(2660),Q=i(756),W=i(5025);const k=["monacoEditorModalC"];function G(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",28),t._uU(2," Add Internationalization"),t.qZA())}function V(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",29),t._uU(2," View Internationalization"),t.qZA())}function H(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",30),t._uU(2," Edit Internationalization"),t.qZA())}function B(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function z(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function j(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",33),t.YNc(2,K,2,0,"span",4),t.YNc(3,z,2,0,"span",4),t.qZA()}if(2&a){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function L(a,r){1&a&&t._UZ(0,"p-progressSpinner",34)}let w=(()=>{class a{fb;ns;generalCS;constantsS;authCS;i18nS;monacoS;data;loading={form:!1};EFormMode=d.D;form;subscriptions=[];editorI18N;editorOptionsI18N={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=U.N.BE_HOST_PORT;monacoDecorations=[];tab;viewDockerfileModelC;constructor(e,o,n,s,m,h,g){this.fb=e,this.ns=o,this.generalCS=n,this.constantsS=s,this.authCS=m,this.i18nS=h,this.monacoS=g}ngOnInit(){var e=this;return(0,l.Z)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var o=(0,l.Z)(function*(n){if(n)if(e.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||"")}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||""),e.form.disable()}else if(n.action===c.F.OPEN_FORM_IN_ADD_MODE){e.form.reset();const s=(yield e.i18nS.getSampleI18nText().toPromise()).data;s&&e.generalCS.setValueInEditor(e,"editorI18N",s)}});return function(n){return o.apply(this,arguments)}}()))})()}createForm(){this.form=this.fb.group({name:[null,[f.kI.required]]})}showModal(){this.lastError=void 0,$("#idI18NForm").modal("show")}hideModal(){$("#idI18NForm").modal("hide")}save(){var e=this;return(0,l.Z)(function*(){const o=e.form.getRawValue();o.user=e.authCS.getUserId(),o.keysCode=e.editorI18N.getValue();try{let n;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorI18N,e.monacoDecorations),e.data.mode===d.D.ADD?n=yield e.i18nS.post(o).toPromise():e.data.mode===d.D.EDIT&&(n=yield e.i18nS.put(e.data.formData._id,o,{select:u.iH._id}).toPromise()),e.ns.showSuccess(e.data.mode===d.D.ADD?e.constantsS.i18n.addSuccess:e.constantsS.i18n.editSuccess),e.data.eventChannel.emit({action:e.data.mode===d.D.ADD?c.F.SAVED:c.F.UPDATED}),e.loading.form=!1}catch(n){e.loading.form=!1,e.ns.showErrorFromResponse(n.error||n,"Unable to save internationalization."),e.lastError=n.error,e.tab=e.tab||{},e.tab.axiosResponse={data:n.error},e.monacoS.highlightErrorInMonacoEditor(e.editorI18N,e.tab,"MainSandbox.ts",e.monacoDecorations)}})()}editorGenerated(e){var o=this;return(0,l.Z)(function*(){o.editorI18N=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),R.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||a)(t.Y36(f.qu),t.Y36(C.W),t.Y36(I.b),t.Y36(y.L),t.Y36(_.D),t.Y36(S.q),t.Y36(Y.b))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-form"]],viewQuery:function(o,n){if(1&o&&t.Gf(k,5),2&o){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:33,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idI18NForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[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"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","placeholder","Please provide name","type","text",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 220px)"],[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,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,G,3,0,"span",4),t.YNc(5,V,3,0,"span",4),t.YNc(6,H,3,0,"span",4),t.TgZ(7,"div",5)(8,"button",6)(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"a",9),t._UZ(12,"img",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t._uU(19,"Name"),t.qZA(),t.TgZ(20,"div",14),t._UZ(21,"input",17),t.qZA()()()(),t.TgZ(22,"div",18)(23,"app-monaco-editor",19),t.NdJ("editorGenerated",function(m){return n.editorGenerated(m)}),t.qZA()()()(),t.TgZ(24,"div",20),t.YNc(25,B,2,0,"a",21),t.TgZ(26,"button",22),t._UZ(27,"i",23),t._uU(28," Close"),t.qZA(),t.YNc(29,j,4,3,"button",24),t.qZA(),t.YNc(30,L,1,0,"p-progressSpinner",25),t.qZA()()(),t._UZ(31,"app-monaco-editor-modal",26,27)),2&o&&(t.xp6(4),t.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),t.xp6(8),t.Q6J("formGroup",n.form),t.xp6(9),t.Q6J("isSchemaEditor",!0)("editorOptions",n.editorOptionsI18N),t.xp6(2),t.Q6J("ngIf",n.lastError),t.xp6(4),t.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.loading.form),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInI18n")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f._Y,f.Fj,f.JJ,f.JL,f.sg,f.u,Z.O5,J.y,Q.O,T.G,W.A],encapsulation:2})}return a})();const q=["i18nFormC"];function X(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",17),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.edit())}),t._UZ(1,"i",18),t.qZA()}}function tt(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",19),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.clone())}),t._UZ(1,"i",20),t.qZA()}}function et(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",21),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",22),t.qZA()}}function nt(a,r){1&a&&(t.TgZ(0,"tr")(1,"th"),t._uU(2,"Name"),t.qZA()())}function ot(a,r){if(1&a&&(t.TgZ(0,"tr",23)(1,"td"),t._uU(2),t.qZA()()),2&a){const e=r.$implicit;t.Q6J("pSelectableRow",e),t.xp6(2),t.Oqu(e.name)}}function at(a,r){1&a&&t._UZ(0,"p-progressSpinner",24)}let F=(()=>{class a{generalS;notificationS;navigationCS;authCS;i18nS;constantsS;cd;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;i18nFormC;constructor(e,o,n,s,m,h,g,ct,dt){this.generalS=e,this.notificationS=o,this.navigationCS=n,this.authCS=s,this.i18nS=m,this.constantsS=h,this.cd=g,this.confirmationService=ct,this.eventCenterS=dt}ngOnInit(){this.eventCenterS.i18n.selectedI18n.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(e=>{(e.action===c.F.SAVED||e.action===c.F.UPDATED)&&(this.i18nFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Internationalization")}loadGridData(){var e=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.i18nS.query(o).subscribe(function(){var n=(0,l.Z)(function*(s){s.success&&(e.selectedRows=[],e.rows=s.data,e.rowsMap=x.keyBy(e.rows,u.iH._id));const m=e.navigationCS.getQueryParam(p.p.am_i18n);e.rowsMap[m]&&(yield e.fillData()),e.loading.grid=!1,e.cd.detectChanges()});return function(s){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.i18nFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.i18nFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.i18nFormC.showModal()}clone(){var e=this;return(0,l.Z)(function*(){try{if(!e.selectedRows[0])return;const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.i18nS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var e=this;return(0,l.Z)(function*(){var o;e.confirmationService.confirm({message:e.constantsS.i18n.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,l.Z)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,l.Z)(function*(){e.loading.grid=!0;const o=yield e.i18nS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,o.success?(e.notificationS.showSuccess(e.constantsS.i18n.removePermanent),e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(o,e.constantsS.i18n.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.i18n.selectedI18n.next([])}resetDependents(){var e=this;return(0,l.Z)(function*(){e.eventCenterS.i18n.selectedI18n.next([]),yield e.navigationCS.setQueryParam(p.p.am_i18n,null)})()}i18NSelected(){var e=this;return(0,l.Z)(function*(){e.resetDependents().then(),e.fillData().then()})()}fillData(){var e=this;return(0,l.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.p.am_i18n,""),void e.eventCenterS.i18n.selectedI18n.next([]);const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;o._id?(yield e.navigationCS.setQueryParam(p.p.am_i18n,o._id),e.eventCenterS.i18n.selectedI18n.next([o])):e.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickI18N(){this.selectedRows.length&&this.edit()}static \u0275fac=function(o){return new(o||a)(t.Y36(I.b),t.Y36(C.W),t.Y36(A.S),t.Y36(_.D),t.Y36(S.q),t.Y36(y.L),t.Y36(t.sBO),t.Y36(D.YP),t.Y36(P.u))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-w"]],viewQuery:function(o,n){if(1&o&&t.Gf(q,5),2&o){let s;t.iGM(s=t.CRH())&&(n.i18nFormC=s.first)}},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/i18n.svg","alt","Internationalization",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 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"],["i18nFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Internationalization"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.TgZ(7,"span",5),t.NdJ("click",function(){return n.add()}),t._UZ(8,"i",6),t.qZA(),t.YNc(9,X,2,0,"span",7),t.YNc(10,tt,2,0,"span",8),t.YNc(11,et,2,0,"span",9),t.qZA(),t.TgZ(12,"div",10)(13,"p-table",11),t.NdJ("selectionChange",function(m){return n.selectedRows=m})("selectionChange",function(){return n.i18NSelected()})("dblclick",function(){return n.dblClickI18N()}),t.YNc(14,nt,3,0,"ng-template",12),t.YNc(15,ot,3,2,"ng-template",13),t.qZA(),t.YNc(16,at,1,0,"p-progressSpinner",14),t.qZA()(),t._UZ(17,"app-i18n-form",15,16)),2&o&&(t.xp6(9),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(2),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.xp6(3),t.Q6J("ngIf",n.loading.grid),t.xp6(1),t.Q6J("data",n.data))},dependencies:[Z.O5,E.iA,D.jx,E.Ei,T.G,O.u,w],encapsulation:2})}return a})(),M=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-I18N-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0),t._UZ(1,"app-i18n-w"),t.qZA())},dependencies:[F],encapsulation:2})}return a})();var it=i(3726),st=i(4950);const rt=[{path:"main",component:M,canActivate:[it.P]}];let lt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[b.Bz.forChild(rt),N.u,st.A]})}return a})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2714],{5050:(mt,v,i)=>{i.r(v),i.d(v,{I18nM:()=>lt});var b=i(7664),N=i(7359),t=i(4946),l=i(5861),c=i(3157),d=i(328),p=i(6212),x=i(6990),u=i(1162),I=i(7240),C=i(9961),A=i(2189),_=i(5852),S=i(6233),y=i(7414),D=i(5219),P=i(2915),Z=i(6814),E=i(5431),T=i(7680),O=i(3259),f=i(95),U=i(553),R=i(1601),Y=i(2304),J=i(2660),Q=i(756),W=i(5025);const k=["monacoEditorModalC"];function G(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",28),t._uU(2," Add Internationalization"),t.qZA())}function V(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",29),t._uU(2," View Internationalization"),t.qZA())}function H(a,r){1&a&&(t.TgZ(0,"span"),t._UZ(1,"i",30),t._uU(2," Edit Internationalization"),t.qZA())}function B(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"a",31),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Save"),t.qZA())}function z(a,r){1&a&&(t.TgZ(0,"span"),t._uU(1,"Update"),t.qZA())}function j(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"button",32),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",33),t.YNc(2,K,2,0,"span",4),t.YNc(3,z,2,0,"span",4),t.qZA()}if(2&a){const e=t.oxw();t.Q6J("disabled",e.form.invalid),t.xp6(2),t.Q6J("ngIf",e.data.mode===e.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",e.data.mode===e.EFormMode.EDIT)}}function L(a,r){1&a&&t._UZ(0,"p-progressSpinner",34)}let w=(()=>{class a{fb;ns;generalCS;constantsS;authCS;i18nS;monacoS;data;loading={form:!1};EFormMode=d.D;form;subscriptions=[];editorI18N;editorOptionsI18N={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=U.N.BE_HOST_PORT;monacoDecorations=[];tab;viewDockerfileModelC;constructor(e,o,n,s,m,h,g){this.fb=e,this.ns=o,this.generalCS=n,this.constantsS=s,this.authCS=m,this.i18nS=h,this.monacoS=g}ngOnInit(){var e=this;return(0,l.Z)(function*(){e.createForm(),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var o=(0,l.Z)(function*(n){if(n)if(e.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||"")}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const s=yield e.i18nS.getById(e.data.formData._id).toPromise();e.form.reset(),e.form.patchValue(s.data),e.generalCS.setValueInEditor(e,"editorI18N",s.data.keysCode||""),e.form.disable()}else if(n.action===c.F.OPEN_FORM_IN_ADD_MODE){e.form.reset();const s=(yield e.i18nS.getSampleI18nText().toPromise()).data;s&&e.generalCS.setValueInEditor(e,"editorI18N",s)}});return function(n){return o.apply(this,arguments)}}()))})()}createForm(){this.form=this.fb.group({name:[null,[f.kI.required]]})}showModal(){this.lastError=void 0,$("#idI18NForm").modal("show")}hideModal(){$("#idI18NForm").modal("hide")}save(){var e=this;return(0,l.Z)(function*(){const o=e.form.getRawValue();o.user=e.authCS.getUserId(),o.keysCode=e.editorI18N.getValue();try{let n;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorI18N,e.monacoDecorations),e.data.mode===d.D.ADD?n=yield e.i18nS.post(o).toPromise():e.data.mode===d.D.EDIT&&(n=yield e.i18nS.put(e.data.formData._id,o,{select:u.iH._id}).toPromise()),e.ns.showSuccess(e.data.mode===d.D.ADD?e.constantsS.i18n.addSuccess:e.constantsS.i18n.editSuccess),e.data.eventChannel.emit({action:e.data.mode===d.D.ADD?c.F.SAVED:c.F.UPDATED}),e.loading.form=!1}catch(n){e.loading.form=!1,e.ns.showErrorFromResponse(n.error||n,"Unable to save internationalization."),e.lastError=n.error,e.tab=e.tab||{},e.tab.axiosResponse={data:n.error},e.monacoS.highlightErrorInMonacoEditor(e.editorI18N,e.tab,"MainSandbox.ts",e.monacoDecorations)}})()}editorGenerated(e){var o=this;return(0,l.Z)(function*(){o.editorI18N=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,n=>{o.form.valid&&o.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),R.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||a)(t.Y36(f.qu),t.Y36(C.W),t.Y36(I.b),t.Y36(y.L),t.Y36(_.D),t.Y36(S.q),t.Y36(Y.b))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-form"]],viewQuery:function(o,n){if(1&o&&t.Gf(k,5),2&o){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:33,vars:12,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idI18NForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[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"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n1",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","placeholder","Please provide name","type","text",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 220px)"],[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,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),t.YNc(4,G,3,0,"span",4),t.YNc(5,V,3,0,"span",4),t.YNc(6,H,3,0,"span",4),t.TgZ(7,"div",5)(8,"button",6)(9,"span",7),t._UZ(10,"i",8),t.qZA()(),t.TgZ(11,"a",9),t._UZ(12,"img",10),t.qZA()()(),t.TgZ(13,"div",11)(14,"form",12)(15,"div",13)(16,"div",14)(17,"div",15)(18,"label",16),t._uU(19,"Name"),t.qZA(),t.TgZ(20,"div",14),t._UZ(21,"input",17),t.qZA()()()(),t.TgZ(22,"div",18)(23,"app-monaco-editor",19),t.NdJ("editorGenerated",function(m){return n.editorGenerated(m)}),t.qZA()()()(),t.TgZ(24,"div",20),t.YNc(25,B,2,0,"a",21),t.TgZ(26,"button",22),t._UZ(27,"i",23),t._uU(28," Close"),t.qZA(),t.YNc(29,j,4,3,"button",24),t.qZA(),t.YNc(30,L,1,0,"p-progressSpinner",25),t.qZA()()(),t._UZ(31,"app-monaco-editor-modal",26,27)),2&o&&(t.xp6(4),t.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),t.xp6(8),t.Q6J("formGroup",n.form),t.xp6(9),t.Q6J("isSchemaEditor",!0)("editorOptions",n.editorOptionsI18N),t.xp6(2),t.Q6J("ngIf",n.lastError),t.xp6(4),t.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),t.xp6(1),t.Q6J("ngIf",n.loading.form),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInI18n")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[f._Y,f.Fj,f.JJ,f.JL,f.sg,f.u,Z.O5,J.y,Q.O,T.G,W.A],encapsulation:2})}return a})();const q=["i18nFormC"];function X(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",17),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.edit())}),t._UZ(1,"i",18),t.qZA()}}function tt(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",19),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.clone())}),t._UZ(1,"i",20),t.qZA()}}function et(a,r){if(1&a){const e=t.EpF();t.TgZ(0,"span",21),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",22),t.qZA()}}function nt(a,r){1&a&&(t.TgZ(0,"tr")(1,"th"),t._uU(2,"Name"),t.qZA()())}function ot(a,r){if(1&a&&(t.TgZ(0,"tr",23)(1,"td"),t._uU(2),t.qZA()()),2&a){const e=r.$implicit;t.Q6J("pSelectableRow",e),t.xp6(2),t.Oqu(e.name)}}function at(a,r){1&a&&t._UZ(0,"p-progressSpinner",24)}let F=(()=>{class a{generalS;notificationS;navigationCS;authCS;i18nS;constantsS;cd;confirmationService;eventCenterS;loading={grid:!1};subscriptions=[];data={mode:d.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=u.iH._id;i18nFormC;constructor(e,o,n,s,m,h,g,ct,dt){this.generalS=e,this.notificationS=o,this.navigationCS=n,this.authCS=s,this.i18nS=m,this.constantsS=h,this.cd=g,this.confirmationService=ct,this.eventCenterS=dt}ngOnInit(){this.eventCenterS.i18n.selectedI18n.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(e=>{(e.action===c.F.SAVED||e.action===c.F.UPDATED)&&(this.i18nFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Internationalization")}loadGridData(){var e=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.i18nS.query(o).subscribe(function(){var n=(0,l.Z)(function*(s){s.success&&(e.selectedRows=[],e.rows=s.data,e.rowsMap=x.keyBy(e.rows,u.iH._id));const m=e.navigationCS.getQueryParam(p.p.am_i18n);e.rowsMap[m]&&(yield e.fillData()),e.loading.grid=!1,e.cd.detectChanges()});return function(s){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=d.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.i18nFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.i18nFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=d.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.i18nFormC.showModal()}clone(){var e=this;return(0,l.Z)(function*(){try{if(!e.selectedRows[0])return;const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield e.i18nS.post(o).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.logProfile.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var e=this;return(0,l.Z)(function*(){var o;e.confirmationService.confirm({message:e.constantsS.i18n.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,l.Z)(function*(){yield e.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,l.Z)(function*(){e.loading.grid=!0;const o=yield e.i18nS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,o.success?(e.notificationS.showSuccess(e.constantsS.i18n.removePermanent),e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(o,e.constantsS.i18n.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.i18n.selectedI18n.next([])}resetDependents(){var e=this;return(0,l.Z)(function*(){e.eventCenterS.i18n.selectedI18n.next([]),yield e.navigationCS.setQueryParam(p.p.am_i18n,null)})()}i18NSelected(){var e=this;return(0,l.Z)(function*(){e.resetDependents().then(),e.fillData().then()})()}fillData(){var e=this;return(0,l.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(p.p.am_i18n,""),void e.eventCenterS.i18n.selectedI18n.next([]);const o=(yield e.i18nS.getById(e.selectedRows[0]._id).toPromise()).data;o._id?(yield e.navigationCS.setQueryParam(p.p.am_i18n,o._id),e.eventCenterS.i18n.selectedI18n.next([o])):e.resetDependents()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickI18N(){this.selectedRows.length&&this.edit()}static \u0275fac=function(o){return new(o||a)(t.Y36(I.b),t.Y36(C.W),t.Y36(A.S),t.Y36(_.D),t.Y36(S.q),t.Y36(y.L),t.Y36(t.sBO),t.Y36(D.YP),t.Y36(P.u))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-i18n-w"]],viewQuery:function(o,n){if(1&o&&t.Gf(q,5),2&o){let s;t.iGM(s=t.CRH())&&(n.i18nFormC=s.first)}},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/i18n.svg","alt","Internationalization",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/i18/i18.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 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"],["i18nFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," Internationalization"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.TgZ(7,"span",5),t.NdJ("click",function(){return n.add()}),t._UZ(8,"i",6),t.qZA(),t.YNc(9,X,2,0,"span",7),t.YNc(10,tt,2,0,"span",8),t.YNc(11,et,2,0,"span",9),t.qZA(),t.TgZ(12,"div",10)(13,"p-table",11),t.NdJ("selectionChange",function(m){return n.selectedRows=m})("selectionChange",function(){return n.i18NSelected()})("dblclick",function(){return n.dblClickI18N()}),t.YNc(14,nt,3,0,"ng-template",12),t.YNc(15,ot,3,2,"ng-template",13),t.qZA(),t.YNc(16,at,1,0,"p-progressSpinner",14),t.qZA()(),t._UZ(17,"app-i18n-form",15,16)),2&o&&(t.xp6(9),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(1),t.Q6J("ngIf",n.selectedRows.length),t.xp6(2),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),t.xp6(3),t.Q6J("ngIf",n.loading.grid),t.xp6(1),t.Q6J("data",n.data))},dependencies:[Z.O5,E.iA,D.jx,E.Ei,T.G,O.u,w],encapsulation:2})}return a})(),M=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(o){return new(o||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-I18N-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(o,n){1&o&&(t.TgZ(0,"div",0),t._UZ(1,"app-i18n-w"),t.qZA())},dependencies:[F],encapsulation:2})}return a})();var it=i(3726),st=i(4950);const rt=[{path:"main",component:M,canActivate:[it.P]}];let lt=(()=>{class a{static \u0275fac=function(o){return new(o||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[b.Bz.forChild(rt),N.u,st.A]})}return a})()}}]);
package/dist/2735.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2735],{2735:(P,d,o)=>{o.r(d),o.d(d,{NativeProcessLogsM:()=>T});var g=o(7664),p=o(8176),v=o(3726),a=o(5861),e=o(4946),f=o(3429),m=o(9961),c=o(95),u=o(6814),h=o(2660),S=o(756),L=o(7680),O=o(3259),C=o(3965);function b(s,Z){1&s&&e._UZ(0,"p-progressSpinner",15)}const N=[{path:"",component:(()=>{class s{instanceS;ns;servers=[];selectedServer=null;loading={grid:!1};editor;editorOptionsLogs={readOnly:!1,language:"plaintext",contextmenu:!1};constructor(t,r){this.instanceS=t,this.ns=r}ngOnInit(){var t=this;return(0,a.Z)(function*(){yield t.loadAllServers(),t.selectedServer=t.servers[0]._id})()}clearAllLogs(){var t=this;return(0,a.Z)(function*(){try{yield t.instanceS.clearServerLogs(null).toPromise(),t.getLogsOfOneServer().then(),t.ns.showSuccess("All native process log files are cleared from all servers.")}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to clear server logs.")}})()}clearLogsOfOneServer(){var t=this;return(0,a.Z)(function*(){try{yield t.instanceS.clearServerLogs(t.selectedServer).toPromise(),t.getLogsOfOneServer().then(),t.ns.showSuccess(`Native process log file is cleared from ${t.selectedServer}.`)}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to clear server logs.")}})()}getLogsOfOneServer(){var t=this;return(0,a.Z)(function*(){t.loading.grid=!0;try{const r=(yield t.instanceS.getAllNativeProcessLogs(t.selectedServer).toPromise()).data;t.editor.setValue(r[0].nativeProcessLogsText)}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load logs.")}t.loading.grid=!1})()}loadAllServers(){var t=this;return(0,a.Z)(function*(){t.loading.grid=!0,t.servers=[];try{t.servers=(yield t.instanceS.getAllConnectedServers().toPromise()).data}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load server list.")}t.loading.grid=!1})()}editorGenerated(t){this.editor=t}static \u0275fac=function(r){return new(r||s)(e.Y36(f.E),e.Y36(m.W))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-native-process-logs"]],decls:18,vars:8,consts:[["id","about",1,"p-2"],[1,"row","m-0"],[1,"col-4","p-0"],["optionLabel","name","optionValue","_id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","ngModelChange"],["pTooltip","Clear native process logs of this server.","sava-no-dbl-click","","type","button",1,"btn","btn-sm","ml-2",3,"disabled","click"],[1,"far","fa-trash-alt","text-warning","fa-fw"],["pTooltip","Reload logs.","sava-no-dbl-click","","type","button",1,"btn","btn-sm","ml-2",3,"disabled","click"],[1,"fas","fa-sync-alt","text-success","fa-fw"],[1,"col-4","text-right","p-0"],["pTooltip","Clear native process logs of all server.","sava-no-dbl-click","","type","button",1,"btn","btn-outline-light","btn-sm",3,"disabled","click"],[1,"far","fa-trash-alt","text-warning","fa-fw","mr-1"],[1,"pl-2","pr-2","pb-2","pt-0"],[1,"card-body","p-0","overflow-hidden",2,"height","calc(100vh - 115px)"],[3,"editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,n){1&r&&(e.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"p-dropdown",3),e.NdJ("ngModelChange",function(l){return n.selectedServer=l})("ngModelChange",function(){return n.getLogsOfOneServer()}),e.qZA()(),e.TgZ(4,"div",2)(5,"button",4),e.NdJ("click",function(){return n.clearLogsOfOneServer()}),e._UZ(6,"i",5),e.qZA(),e.TgZ(7,"button",6),e.NdJ("click",function(){return n.getLogsOfOneServer()}),e._UZ(8,"i",7),e.qZA()(),e.TgZ(9,"div",8)(10,"button",9),e.NdJ("click",function(){return n.clearAllLogs()}),e._UZ(11,"i",10),e.TgZ(12,"span"),e._uU(13,"Clear All Server Logs"),e.qZA()()()()(),e.TgZ(14,"section",11)(15,"div",12)(16,"app-monaco-editor",13),e.NdJ("editorGenerated",function(l){return n.editorGenerated(l)}),e.qZA()(),e.YNc(17,b,1,0,"p-progressSpinner",14),e.qZA()),2&r&&(e.xp6(3),e.Q6J("options",n.servers)("ngModel",n.selectedServer)("filter",!0),e.xp6(2),e.Q6J("disabled",n.loading.grid),e.xp6(2),e.Q6J("disabled",n.loading.grid),e.xp6(3),e.Q6J("disabled",n.loading.grid),e.xp6(6),e.Q6J("editorOptions",n.editorOptionsLogs),e.xp6(1),e.Q6J("ngIf",n.loading.grid))},dependencies:[c.JJ,c.On,u.O5,h.y,S.O,L.G,O.u,C.Lt],styles:["table[_ngcontent-%COMP%]{background-color:#3f3f3f}td[_ngcontent-%COMP%]{border-color:#4b4a4a!important;padding:10px}"]})}return s})(),canActivate:[v.P]}];let T=(()=>{class s{static \u0275fac=function(r){return new(r||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[g.Bz.forChild(N),p.u]})}return s})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2735],{2735:(P,d,o)=>{o.r(d),o.d(d,{NativeProcessLogsM:()=>T});var g=o(7664),p=o(7359),v=o(3726),a=o(5861),e=o(4946),f=o(3429),m=o(9961),c=o(95),u=o(6814),h=o(2660),S=o(756),L=o(7680),O=o(3259),C=o(3965);function b(s,Z){1&s&&e._UZ(0,"p-progressSpinner",15)}const N=[{path:"",component:(()=>{class s{instanceS;ns;servers=[];selectedServer=null;loading={grid:!1};editor;editorOptionsLogs={readOnly:!1,language:"plaintext",contextmenu:!1};constructor(t,r){this.instanceS=t,this.ns=r}ngOnInit(){var t=this;return(0,a.Z)(function*(){yield t.loadAllServers(),t.selectedServer=t.servers[0]._id})()}clearAllLogs(){var t=this;return(0,a.Z)(function*(){try{yield t.instanceS.clearServerLogs(null).toPromise(),t.getLogsOfOneServer().then(),t.ns.showSuccess("All native process log files are cleared from all servers.")}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to clear server logs.")}})()}clearLogsOfOneServer(){var t=this;return(0,a.Z)(function*(){try{yield t.instanceS.clearServerLogs(t.selectedServer).toPromise(),t.getLogsOfOneServer().then(),t.ns.showSuccess(`Native process log file is cleared from ${t.selectedServer}.`)}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to clear server logs.")}})()}getLogsOfOneServer(){var t=this;return(0,a.Z)(function*(){t.loading.grid=!0;try{const r=(yield t.instanceS.getAllNativeProcessLogs(t.selectedServer).toPromise()).data;t.editor.setValue(r[0].nativeProcessLogsText)}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load logs.")}t.loading.grid=!1})()}loadAllServers(){var t=this;return(0,a.Z)(function*(){t.loading.grid=!0,t.servers=[];try{t.servers=(yield t.instanceS.getAllConnectedServers().toPromise()).data}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load server list.")}t.loading.grid=!1})()}editorGenerated(t){this.editor=t}static \u0275fac=function(r){return new(r||s)(e.Y36(f.E),e.Y36(m.W))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-native-process-logs"]],decls:18,vars:8,consts:[["id","about",1,"p-2"],[1,"row","m-0"],[1,"col-4","p-0"],["optionLabel","name","optionValue","_id","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","ngModelChange"],["pTooltip","Clear native process logs of this server.","sava-no-dbl-click","","type","button",1,"btn","btn-sm","ml-2",3,"disabled","click"],[1,"far","fa-trash-alt","text-warning","fa-fw"],["pTooltip","Reload logs.","sava-no-dbl-click","","type","button",1,"btn","btn-sm","ml-2",3,"disabled","click"],[1,"fas","fa-sync-alt","text-success","fa-fw"],[1,"col-4","text-right","p-0"],["pTooltip","Clear native process logs of all server.","sava-no-dbl-click","","type","button",1,"btn","btn-outline-light","btn-sm",3,"disabled","click"],[1,"far","fa-trash-alt","text-warning","fa-fw","mr-1"],[1,"pl-2","pr-2","pb-2","pt-0"],[1,"card-body","p-0","overflow-hidden",2,"height","calc(100vh - 115px)"],[3,"editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,n){1&r&&(e.TgZ(0,"section",0)(1,"div",1)(2,"div",2)(3,"p-dropdown",3),e.NdJ("ngModelChange",function(l){return n.selectedServer=l})("ngModelChange",function(){return n.getLogsOfOneServer()}),e.qZA()(),e.TgZ(4,"div",2)(5,"button",4),e.NdJ("click",function(){return n.clearLogsOfOneServer()}),e._UZ(6,"i",5),e.qZA(),e.TgZ(7,"button",6),e.NdJ("click",function(){return n.getLogsOfOneServer()}),e._UZ(8,"i",7),e.qZA()(),e.TgZ(9,"div",8)(10,"button",9),e.NdJ("click",function(){return n.clearAllLogs()}),e._UZ(11,"i",10),e.TgZ(12,"span"),e._uU(13,"Clear All Server Logs"),e.qZA()()()()(),e.TgZ(14,"section",11)(15,"div",12)(16,"app-monaco-editor",13),e.NdJ("editorGenerated",function(l){return n.editorGenerated(l)}),e.qZA()(),e.YNc(17,b,1,0,"p-progressSpinner",14),e.qZA()),2&r&&(e.xp6(3),e.Q6J("options",n.servers)("ngModel",n.selectedServer)("filter",!0),e.xp6(2),e.Q6J("disabled",n.loading.grid),e.xp6(2),e.Q6J("disabled",n.loading.grid),e.xp6(3),e.Q6J("disabled",n.loading.grid),e.xp6(6),e.Q6J("editorOptions",n.editorOptionsLogs),e.xp6(1),e.Q6J("ngIf",n.loading.grid))},dependencies:[c.JJ,c.On,u.O5,h.y,S.O,L.G,O.u,C.Lt],styles:["table[_ngcontent-%COMP%]{background-color:#3f3f3f}td[_ngcontent-%COMP%]{border-color:#4b4a4a!important;padding:10px}"]})}return s})(),canActivate:[v.P]}];let T=(()=>{class s{static \u0275fac=function(r){return new(r||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[g.Bz.forChild(N),p.u]})}return s})()}}]);
package/dist/2908.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2908],{2908:(u,s,t)=>{t.r(s),t.d(s,{RootSettingsM:()=>d});var a=t(7664),l=t(8176),o=t(4946);const e=[{path:"deployment-settings",loadChildren:()=>t.e(4575).then(t.bind(t,4575)).then(n=>n.DeploymentSettingsM)}];let d=(()=>{class n{static \u0275fac=function(h){return new(h||n)};static \u0275mod=o.oAB({type:n});static \u0275inj=o.cJS({imports:[a.Bz.forChild(e),l.u]})}return n})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[2908],{2908:(u,s,t)=>{t.r(s),t.d(s,{RootSettingsM:()=>d});var a=t(7664),l=t(7359),o=t(4946);const e=[{path:"deployment-settings",loadChildren:()=>t.e(4575).then(t.bind(t,4575)).then(n=>n.DeploymentSettingsM)}];let d=(()=>{class n{static \u0275fac=function(h){return new(h||n)};static \u0275mod=o.oAB({type:n});static \u0275inj=o.cJS({imports:[a.Bz.forChild(e),l.u]})}return n})()}}]);