@sava-info-systems/api-maker-with-extensions 1.19.3 → 1.19.4

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 (116) hide show
  1. package/dist/1025.ad3d7fe2972421a7.js +1 -0
  2. package/dist/1097.f7edc9a254293cbe.js +1 -0
  3. package/dist/148.3d1172921fc38628.js +1 -0
  4. package/dist/1558.d77067ef3989dc57.js +1 -0
  5. package/dist/{1351.48e08341fba9b889.js → 1617.cd35a3a268fd8f90.js} +1 -1
  6. package/dist/1678.2c6fe869dc9df280.js +1 -0
  7. package/dist/1754.616b92791d39dab1.js +1 -0
  8. package/dist/1928.a299b3986d670379.js +1 -0
  9. package/dist/1957.cafa315c70f23efe.js +1 -0
  10. package/dist/2140.82e389d21656cd83.js +1 -0
  11. package/dist/2295.b066a00a7c4c4d9c.js +1 -0
  12. package/dist/238.6207cf874f0ff82a.js +1 -0
  13. package/dist/2473.6a522dcf87dfb922.js +1 -0
  14. package/dist/2714.1ed8bfd73f5693eb.js +1 -0
  15. package/dist/{3611.9577d58af5f1f4aa.js → 2735.880b4c038ef3207e.js} +1 -1
  16. package/dist/2908.c7cbde300e1840a4.js +1 -0
  17. package/dist/3081.e470a8aeed4a7745.js +1 -0
  18. package/dist/3139.7a6ebcaa6a5f38f6.js +1 -0
  19. package/dist/3450.68d8d179c9496764.js +1 -0
  20. package/dist/4110.1747a68dfaacbbd8.js +1 -0
  21. package/dist/4186.601304798e909236.js +1 -0
  22. package/dist/4211.b7a72c8db8263edf.js +1 -0
  23. package/dist/4575.987834c6e73af961.js +1 -0
  24. package/dist/4842.f89ded9e1e9f1110.js +1 -0
  25. package/dist/485.b333cf63f954b75c.js +1 -0
  26. package/dist/4895.95e42b567a89ce84.js +1 -0
  27. package/dist/5249.52aa732ef6a173c5.js +1 -0
  28. package/dist/5334.8ed5b236a6948681.js +1 -0
  29. package/dist/5421.e729ed3585afa9af.js +1 -0
  30. package/dist/5679.53292305f1448567.js +1 -0
  31. package/dist/5761.c363fe26244e8787.js +1 -0
  32. package/dist/5765.e70cd773673bfe27.js +1 -0
  33. package/dist/6236.b81e95926f7fcd60.js +1 -0
  34. package/dist/6393.1323e8b7d2cdae70.js +1 -0
  35. package/dist/6401.02e5b3cb94d0322a.js +1 -0
  36. package/dist/{8970.8eece52bbc1c316c.js → 6925.d59cabb0e343d24c.js} +1 -1
  37. package/dist/7368.4c04430d3efc5947.js +1 -0
  38. package/dist/{2442.adbc5b49349bb569.js → 7436.7e4876b9e90efde6.js} +1 -1
  39. package/dist/7470.9195bddaee5202e0.js +1 -0
  40. package/dist/7649.870e05f3aa978078.js +1 -0
  41. package/dist/7975.dbe6e674c50ab553.js +1 -0
  42. package/dist/7977.35ebfb6f4c9503b4.js +1 -0
  43. package/dist/7987.37367b65a76d5083.js +1 -0
  44. package/dist/8125.58e1a7a385797896.js +1 -0
  45. package/dist/8266.d665463de8b8d75a.js +1 -0
  46. package/dist/8296.32f107844a1381b6.js +1 -0
  47. package/dist/{3732.b5ac36f1448e215c.js → 8374.11d430ef2432bfba.js} +1 -1
  48. package/dist/{6589.b9c83295e466e464.js → 8682.5bde1163690a18dc.js} +1 -1
  49. package/dist/8841.6cb824dd9d5ad8f8.js +1 -0
  50. package/dist/885.e3d53b62c51f8311.js +1 -0
  51. package/dist/{9785.35cc7f0c3778344e.js → 891.333c6913b8246e3c.js} +1 -1
  52. package/dist/913.7d41933171ab9fbe.js +1 -0
  53. package/dist/9243.c223cdbc4cd84cb8.js +1 -0
  54. package/dist/9575.0a35a4da70f9e6e5.js +1 -0
  55. package/dist/9939.218315684234eb18.js +1 -0
  56. package/dist/common.442040891fd4ef29.js +1 -0
  57. package/dist/index.html +1 -1
  58. package/dist/main.9630ecd9c9613e82.js +1 -0
  59. package/dist/polyfills.93062920aa87d580.js +1 -0
  60. package/dist/runtime.21919a870e05d69b.js +1 -0
  61. package/main.js +1 -1
  62. package/package.json +4 -4
  63. package/sandbox/sandbox.js +1 -1
  64. package/src/tools/local-client.js +1 -1
  65. package/dist/1417.5caf023140e7c67f.js +0 -1
  66. package/dist/1468.d42293f7d802a787.js +0 -1
  67. package/dist/1959.a22fe393419f10c5.js +0 -1
  68. package/dist/2162.3c94f3d66c6312d5.js +0 -1
  69. package/dist/2818.71176f4848a9419f.js +0 -1
  70. package/dist/3488.ada60be2dbcd9845.js +0 -1
  71. package/dist/3545.b5585792e9fe1447.js +0 -1
  72. package/dist/3605.3c6cdf2a08c47301.js +0 -1
  73. package/dist/3621.412300a009ea6346.js +0 -1
  74. package/dist/379.d3e61f3350a595dc.js +0 -1
  75. package/dist/3929.9ac933e926943db2.js +0 -1
  76. package/dist/4092.71b0eccc0cb429f0.js +0 -1
  77. package/dist/4124.a8329e77343e7087.js +0 -1
  78. package/dist/4316.542be541e58dff84.js +0 -1
  79. package/dist/4344.d8f42d425eaec852.js +0 -1
  80. package/dist/4689.e827720779e0cf34.js +0 -1
  81. package/dist/4709.262c34f60b50ebc9.js +0 -1
  82. package/dist/4774.a4368f3ce2e778da.js +0 -1
  83. package/dist/4880.70ca405524206be7.js +0 -1
  84. package/dist/5011.ed9a6465223f760d.js +0 -1
  85. package/dist/5090.c8bf74c35b0a5d26.js +0 -1
  86. package/dist/5140.581ccd2699e2a8a8.js +0 -1
  87. package/dist/5362.912e053f78479e90.js +0 -1
  88. package/dist/5442.186b40719e7c1da9.js +0 -1
  89. package/dist/5455.a1d0d507419e3c59.js +0 -1
  90. package/dist/5729.f0ee236ba6579a94.js +0 -1
  91. package/dist/5826.44efead20568788a.js +0 -1
  92. package/dist/6053.67f38f7b35484475.js +0 -1
  93. package/dist/6220.b6c29e6e3e717880.js +0 -1
  94. package/dist/6415.a48241737e134178.js +0 -1
  95. package/dist/6679.c5073d3a60b67e2e.js +0 -1
  96. package/dist/6828.36c6805f2b3c6f38.js +0 -1
  97. package/dist/6866.4dd76a41246a20be.js +0 -1
  98. package/dist/6882.fe03a3df377ca119.js +0 -1
  99. package/dist/7014.5db4db60cc21782e.js +0 -1
  100. package/dist/7152.dab3cc50472f703f.js +0 -1
  101. package/dist/7367.ba1e63db0f9b97f4.js +0 -1
  102. package/dist/7374.ebfe1004d1773912.js +0 -1
  103. package/dist/7597.177f15771dcdea42.js +0 -1
  104. package/dist/7759.2b4ed39a62323abd.js +0 -1
  105. package/dist/807.dba59148bbbbe7fb.js +0 -1
  106. package/dist/8219.2c97945d465ab185.js +0 -1
  107. package/dist/8447.8caa67c3eb5d2b55.js +0 -1
  108. package/dist/9036.876c1f0c1ce4e82b.js +0 -1
  109. package/dist/9347.4e7d02eee86c5778.js +0 -1
  110. package/dist/9429.9299aa0abda3dc76.js +0 -1
  111. package/dist/9882.a94c746b42e5fc0e.js +0 -1
  112. package/dist/9957.47ed0e74bdfeddd5.js +0 -1
  113. package/dist/common.d4eb1616e93e21e1.js +0 -1
  114. package/dist/main.1da32156380b46d5.js +0 -1
  115. package/dist/polyfills.9cbb1c8222a6b6c3.js +0 -1
  116. package/dist/runtime.212fca73d6a42b3a.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4110],{4110:(ye,g,o)=>{o.r(g),o.d(g,{RedisDashboardM:()=>he});var E=o(7017),N=o(7664),l=o(5861),e=o(4946),b=o(6990),d=o(3157),p=o(328),w=o(6925),h=o(553),v=o(2304),y=o(7240),D=o(9961),T=o(5852),C=o(7414),x=o(5219),S=o(3429),m=o(6814),R=o(756),K=o(1396),Z=o(7680),F=o(5043),I=o(3259),c=o(95),M=o(1601),A=o(2660),O=o(5025);const k=["monacoEditorModalC"];function U(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," Add New Key"),e.qZA())}function J(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," View New Key"),e.qZA())}function Y(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2," Edit New Key"),e.qZA())}function G(n,i){1&n&&(e.TgZ(0,"label",31),e._uU(1,"Key Name"),e.qZA())}function V(n,i){1&n&&(e.TgZ(0,"div",32),e._UZ(1,"input",33),e.qZA())}function P(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw();return e.KtG(r.editorGenerated(a))}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Q(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function L(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function B(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",38),e.YNc(2,H,2,0,"span",4),e.YNc(3,L,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),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 q(n,i){1&n&&e._UZ(0,"p-progressSpinner",39)}const W=function(n){return{"col-3":n}},j=function(n,i){return{"col-3":n,"col-6":i}};let z=(()=>{class n{fb;ns;monacoS;instanceS;constantsS;authCS;generalCS;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=h.N.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,s,a,r,f,u,_){this.fb=t,this.ns=s,this.monacoS=a,this.instanceS=r,this.constantsS=f,this.authCS=u,this.generalCS=_}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,l.Z)(function*(a){a&&(t.form.enable(),a.action===d.F.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=a,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):a.action===d.F.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):a.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.kI.required]],ttl:[null,[c.kI.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.Z)(function*(){const s=t.form.getRawValue();s.redisCodeStr=t.editorRedis.getValue();try{let a;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===p.D.ADD)a=yield t.instanceS.saveRedisKeys(s),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?d.F.SAVED:d.F.UPDATED});else if(t.data.mode===p.D.EDIT){const r={keyName:t.actualKeyData.data.keyName,redisCodeStr:t.actualKeyData.data.redisCodeStr,ttl:t.form.get("ttl").value};yield t.instanceS.updateRedisKeys(r),t.ns.showSuccess(t.constantsS.redis.editSuccess),t.data.eventChannel.emit({action:d.F.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save redis key."),t.lastError=a.error}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorRedis=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null),s.monacoS.addSaveCodeKeyBinding(t,a=>{s.form.valid&&s.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(c.qu),e.Y36(D.W),e.Y36(v.b),e.Y36(S.E),e.Y36(C.L),e.Y36(T.D),e.Y36(y.b))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(s,a){if(1&s&&e.Gf(k,5),2&s){let r;e.iGM(r=e.CRH())&&(a.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:20,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idNewKeyForm","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"],[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/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","mt-1","mr-1",2,"font-size","22px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],["class","col-2 col-form-label col-form-label-sm text-right",4,"ngIf"],["class","col-6",4,"ngIf"],[1,"col-form-label","col-form-label-sm","text-right",3,"ngClass"],[3,"ngClass"],["formControlName","ttl","name","ttl","spellcheck","false","type","number","placeholder","Please provide value",1,"form-control","form-control-sm"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[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"],[1,"col-2","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","keyName","name","keyName","spellcheck","false","type","text","placeholder","Please provide key name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,U,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6)(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"a",9),e._UZ(12,"img",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"form",12)(15,"div",13),e.YNc(16,G,2,0,"label",14),e.YNc(17,V,2,0,"div",15),e.TgZ(18,"label",16),e._uU(19,"TTL"),e.qZA(),e.TgZ(20,"div",17),e._UZ(21,"input",18),e.qZA()(),e.YNc(22,P,2,2,"div",19),e.qZA()(),e.TgZ(23,"div",20),e.YNc(24,Q,2,0,"a",21),e.TgZ(25,"button",22),e._UZ(26,"i",23),e._uU(27," Close"),e.qZA(),e.YNc(28,B,4,3,"button",24),e.qZA(),e.YNc(29,q,1,0,"p-progressSpinner",25),e.qZA()()(),e._UZ(30,"app-monaco-editor-modal",26,27)),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(8),e.Q6J("formGroup",a.form),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngClass",e.VKq(15,W,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngClass",e.WLB(17,j,a.data.mode===a.EFormMode.ADD,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(2),e.Q6J("ngIf",a.lastError),e.xp6(4),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form),e.xp6(1),e.Q6J("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",a.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c._Y,c.Fj,c.wV,c.JJ,c.JL,c.sg,c.u,m.mk,m.O5,A.y,R.O,Z.G,O.A],encapsulation:2})}return n})();const X=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.TgZ(0,"span",7)(1,"h4",8),e._uU(2),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.keyDelete())}),e._UZ(1,"i",29),e.qZA()}}function ae(n,i){if(1&n&&(e.TgZ(0,"div",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.label)}}function se(n,i){1&n&&e._UZ(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span"),e._UZ(3,"img",13),e._uU(4," Redis Dashboard"),e.qZA(),e.TgZ(5,"span")(6,"div",14)(7,"a",15),e._UZ(8,"img",16),e.qZA()(),e.TgZ(9,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.add())}),e._UZ(10,"i",18),e.qZA(),e.TgZ(11,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.loadRedisDataList())}),e._UZ(12,"i",20),e.qZA(),e.YNc(13,te,2,0,"span",21),e.TgZ(14,"span",22),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.flushAll())}),e._UZ(15,"i",23),e.qZA()()(),e.TgZ(16,"div",24)(17,"p-tree",25),e.NdJ("selectionChange",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.selectedKeys=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.selectedKeysChange())}),e.YNc(18,ae,2,1,"ng-template",26),e.qZA(),e.YNc(19,se,1,0,"p-progressSpinner",27),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(13),e.Q6J("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.xp6(4),e.Q6J("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.update())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"Update"),e.qZA()()}}function ie(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.updateTTL())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"UpdateTTL"),e.qZA()()}}function re(n,i){if(1&n&&(e.TgZ(0,"span",41)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw(4);e.xp6(2),e.Oqu(t.ttlValue)}}function le(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span",32),e._UZ(3,"i",33),e._uU(4," Redis "),e.qZA(),e.TgZ(5,"span",34),e._uU(6),e.qZA(),e.YNc(7,oe,4,0,"span",35),e.YNc(8,ie,4,0,"span",35),e.YNc(9,re,3,1,"span",36),e.qZA(),e.TgZ(10,"div",37)(11,"app-monaco-editor",38),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.editorGenerated(a))}),e.qZA()()()}if(2&n){const t=e.oxw(3);e.xp6(6),e.Oqu(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.xp6(2),e.Q6J("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function pe(n,i){1&n&&(e.TgZ(0,"p-splitter",9),e.YNc(1,ne,20,6,"ng-template",10),e.YNc(2,le,12,6,"ng-template",10),e.qZA()),2&n&&(e.Akn(e.DdM(3,de)),e.Q6J("panelSizes",e.DdM(4,ce)))}function me(n,i){if(1&n&&(e.TgZ(0,"div",3)(1,"div",4),e.YNc(2,ee,3,1,"span",5),e.YNc(3,pe,3,5,"p-splitter",6),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalRedisSetupDoneByRoot)}}let fe=(()=>{class n{monacoS;generalS;ns;authCS;constantsS;cd;confirmationService;instanceS;isDependentOnGroup=!0;selectByKey="_id";treeNodes=[];subscriptions=[];selectedKeys;allTreeItemsMap={};editor;editorOptionsSchema={readOnly:!1,language:"json",contextmenu:!0};loading={grid:!1};selectedItem;autoCompleteData=[];BE_HOST_PORT=h.N.BE_HOST_PORT;redisNewKeyFormC;data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,s,a,r,f,u,_,ve){this.monacoS=t,this.generalS=s,this.ns=a,this.authCS=r,this.constantsS=f,this.cd=u,this.confirmationService=_,this.instanceS=ve}ngOnInit(){this.getExternalRedisSetupFromPackageJson(),this.loadRedisDataList(),this.startTTLReduceInterval(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{t&&(t.action===d.F.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.F.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of s)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const a={};t.generalS.getMapOfAllItems(a,s),t.parsedData=s,t.treeNodes=t.parsedData,t.allTreeItemsMap=a,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.Z)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const s=t.selectedKeys[0];if(s.children?.length)t.editor.setValue("");else{const a=yield t.instanceS.getRedisValue(s.key).toPromise();a?.data?.value&&(t.editor.setValue("string"==typeof a?.data?.value?a.data.value:JSON.stringify(a?.data?.value,null,4)),a?.data?.ttl>0&&(t.ttlValue=a.data.ttl))}}else t.editor.setValue("")})()}startTTLReduceInterval(){this.intervalRef=setInterval(()=>{this.ttlValue>0&&this.ttlValue--},1e3)}stopTTLReduceInterval(){clearInterval(this.intervalRef)}update(){var t=this;return(0,l.Z)(function*(){try{t.loading.grid=!0;const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(s),t.data.mode=p.D.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.Z)(function*(){try{const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=p.D.EDIT,t.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE,data:s}),t.redisNewKeyFormC.showModal()}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update TTL.")}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editor=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.redisKeyPermanentDelete(b.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;try{const s=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===s.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.flushAllData()}),function(){return s.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=w.Yp;undefined=void 0;static \u0275fac=function(s){return new(s||n)(e.Y36(v.b),e.Y36(y.b),e.Y36(D.W),e.Y36(T.D),e.Y36(C.L),e.Y36(e.sBO),e.Y36(x.YP),e.Y36(S.E))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(s,a){if(1&s&&e.Gf(X,5),2&s){let r;e.iGM(r=e.CRH())&&(a.redisNewKeyFormC=r.first)}},inputs:{isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"]},decls:3,vars:2,consts:[["class","pt-1 pl-1 pr-1",4,"ngIf"],[3,"data"],["redisNewKeyFormC",""],[1,"pt-1","pl-1","pr-1"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],["class","text-center",4,"ngIf"],[3,"panelSizes","style",4,"ngIf"],[1,"text-center"],[1,"mt-5","pt-5"],[3,"panelSizes"],["pTemplate",""],[1,"card","shadow-sm","h-100","w-100"],[1,"card-header"],["src","../../../../assets/images/icons/redis.png","alt","Redis",1,"fa-fw"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.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 Key",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Refresh",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["pTooltip","Flush redis database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-warning"],[1,"card-body","p-0"],["selectionMode","multiple","scrollHeight","calc(100vh - 128px)",1,"w-full",3,"value","selection","filter","metaKeySelection","selectionChange"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw"],[1,"w-100","prevent-text-selection","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"align-top"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"ml-2","d-inline-block",2,"color","#57be1e","max-width","700px"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right text-info cursor-pointer ml-3",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 84px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],[1,"float-right","text-info","cursor-pointer","ml-3"]],template:function(s,a){1&s&&(e.YNc(0,me,4,2,"div",0),e._UZ(1,"app-redis-new-key-form",1,2)),2&s&&(e.Q6J("ngIf",void 0!==a.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("data",a.data))},dependencies:[m.O5,R.O,x.jx,K.mp,Z.G,F.q,I.u,z]})}return n})();var ue=o(1678),_e=o(4950);const ge=[{path:"",component:fe}];let he=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[N.Bz.forChild(ge),E.u,ue.DashboardM,_e.A]})}return n})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4186],{4186:(at,M,o)=>{o.r(M),o.d(M,{SystemApiM:()=>O});var g=o(7664),t=o(7017),m=o(4946),h=o(9329);let A=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||s)};static \u0275cmp=m.Xpm({type:s,selectors:[["app-system-api-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(u,b){1&u&&(m.TgZ(0,"div",0),m._UZ(1,"app-system-api-w",1),m.qZA()),2&u&&(m.xp6(1),m.Q6J("showCheckbox",!1))},dependencies:[h.X],encapsulation:2})}return s})();var f=o(3726),I=(o(3219),o(4950));const E=[{path:"layout",component:A,canActivate:[f.P]}];let O=(()=>{class s{static \u0275fac=function(u){return new(u||s)};static \u0275mod=m.oAB({type:s});static \u0275inj=m.cJS({imports:[g.Bz.forChild(E),t.u,I.A]})}return s})()},3219:(at,M,o)=>{o.d(M,{S:()=>st});var g=o(5861),t=o(3157),m=o(328),h=o(7672),A=o(9361),f=o(1162),P=o(553),I=o(5085),E=o(1601),x=o(3531),O=o(9989),s=o(4946),W=o(9961),D=o(6457),u=o(7240),b=o(2304),F=o(3429),K=o(7414),N=o(5852),B=o(6814),Z=o(2660),U=o(5860),G=o(756),T=o(7680),J=o(3259),Y=o(5025);const Q=["monacoEditorModalC"],k=["insertCodeModalC"];function H(d,S){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",26),s._uU(2," Add System API Setting"),s.qZA())}function V(d,S){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",27),s._uU(2," View System API Setting"),s.qZA())}function j(d,S){1&d&&(s.TgZ(0,"span"),s._UZ(1,"i",28),s._uU(2," Edit System API Setting"),s.qZA())}function X(d,S){if(1&d){const a=s.EpF();s.TgZ(0,"a",29),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.viewError())}),s._uU(1,"View error"),s.qZA()}}function z(d,S){1&d&&(s.TgZ(0,"span"),s._uU(1,"Save"),s.qZA())}function q(d,S){1&d&&(s.TgZ(0,"span"),s._uU(1,"Update"),s.qZA())}function tt(d,S){if(1&d){const a=s.EpF();s.TgZ(0,"button",30),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.save())}),s._UZ(1,"i",31),s.YNc(2,z,2,0,"span",4),s.YNc(3,q,2,0,"span",4),s.qZA()}if(2&d){const a=s.oxw();s.xp6(2),s.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function et(d,S){1&d&&s._UZ(0,"p-progressSpinner",32)}let st=(()=>{class d{ns;systemApiSettingsS;generalS;monacoS;instanceS;constantsS;authCS;generalCS;EAPIAccessType=h.di;data;loading={form:!1};EFormMode=m.D;subscriptions=[];editorSysApiCode;editorOptionsSysApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=P.N.BE_HOST_PORT;viewDockerfileModelC;DOCS_HOST_PORT=P.N.DOCS_HOST_PORT;insertCodeModalC;constructor(a,l,r,y,R,nt,it,ot){this.ns=a,this.systemApiSettingsS=l,this.generalS=r,this.monacoS=y,this.instanceS=R,this.constantsS=nt,this.authCS=it,this.generalCS=ot}ngOnInit(){var a=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var l=(0,g.Z)(function*(r){r&&(r.action===t.F.OPEN_FORM_IN_EDIT_MODE||r.action===t.F.OPEN_FORM_IN_VIEW_MODE?a.editorSysApiCode&&(a.data.formData.sysApiSettingCode?a.generalCS.setValueInEditor(a,"editorSysApiCode",a.data.formData.sysApiSettingCode):a.loadSysApiCode()):r.action===t.F.OPEN_FORM_IN_ADD_MODE&&a.loadSysApiCode())});return function(r){return l.apply(this,arguments)}}()))}loadSysApiCode(){var a=this;return(0,g.Z)(function*(){const l=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,I.R.SYSTEM_APIS).toPromise();a.generalCS.setValueInEditor(a,"editorSysApiCode",l.data)})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=A.H.Settings,this.insertCodeModalC.showModal(x.b.SystemApiFormC)}editorGenerated(a){var l=this;return(0,g.Z)(function*(){l.editorSysApiCode=a,yield l.monacoS.loadSchemaEditorSettings(l.BE_HOST_PORT,l.authCS.getUserId(),null),l.monacoS.addSaveCodeKeyBinding(a,r=>{l.data.mode!==m.D.VIEW&&l.save()}),l.monacoS.addInsertCodeKeyBinding(a,r=>{l.generalCS.messageReceivedFor=A.H.All,l.data.mode!==m.D.VIEW&&l.insertCodeModalC.showModal(x.b.SystemApiFormC)}),l.subscriptions.push(l.generalS.messageReceived.subscribe(r=>{r.type&&r.type===O.g.TEXT_COPIED&&(l.monacoS.insertAtCursor(a,r.selectedText),l.insertCodeModalC.hideModal())}))})()}showModal(){this.lastError=void 0,$("#idSystemApiForm").modal("show")}hideModal(){$("#idSystemApiForm").modal("hide")}save(){var a=this;return(0,g.Z)(function*(){const l={};l.user=a.authCS.getUserId(),l.sysApiSettingCode=a.editorSysApiCode.getValue(),l.apiId=a.data.formData.apiId;try{let r;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorSysApiCode,a.monacoDecorations),a.data.mode!==m.D.ADD&&a.data.formData._id?a.data.mode===m.D.EDIT&&(r=yield a.systemApiSettingsS.replace(a.data.formData._id,l,{select:f.iH._id}).toPromise()):r=yield a.systemApiSettingsS.post(l).toPromise(),a.ns.showSuccess(a.data.mode===m.D.ADD?a.constantsS.systemApi.addSuccess:a.constantsS.systemApi.editSuccess),a.data.eventChannel.emit({action:a.data.mode===m.D.ADD?t.F.SAVED:t.F.UPDATED}),a.loading.form=!1}catch(r){a.loading.form=!1,a.ns.showErrorFromResponse(r.error||r,"Unable to save system API."),a.lastError=r.error,a.tab=a.tab||{},a.tab.axiosResponse={data:r.error},a.monacoS.highlightErrorInMonacoEditor(a.editorSysApiCode,a.tab,"MainSandbox.ts",a.monacoDecorations)}})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),E.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||d)(s.Y36(W.W),s.Y36(D.J),s.Y36(u.b),s.Y36(b.b),s.Y36(F.E),s.Y36(K.L),s.Y36(N.D),s.Y36(u.b))};static \u0275cmp=s.Xpm({type:d,selectors:[["app-w-system-api-form"]],viewQuery:function(l,r){if(1&l&&(s.Gf(Q,5),s.Gf(k,5)),2&l){let y;s.iGM(y=s.CRH())&&(r.viewDockerfileModelC=y.first),s.iGM(y=s.CRH())&&(r.insertCodeModalC=y.first)}},inputs:{data:"data"},decls:29,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSystemApiForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/docs/settings/systemApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"overflow-hidden",2,"height","calc(100vh - 158px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,r){1&l&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),s.YNc(4,H,3,0,"span",4),s.YNc(5,V,3,0,"span",4),s.YNc(6,j,3,0,"span",4),s.TgZ(7,"div",5)(8,"button",6)(9,"span",7),s._UZ(10,"i",8),s.qZA()(),s.TgZ(11,"span",9),s.NdJ("click",function(){return r.showInsertCodeModel()}),s._UZ(12,"i",10),s.qZA(),s.TgZ(13,"a",11),s._UZ(14,"img",12),s.qZA()()(),s.TgZ(15,"div",13)(16,"div",14)(17,"app-monaco-editor",15),s.NdJ("editorGenerated",function(R){return r.editorGenerated(R)}),s.qZA()()(),s.TgZ(18,"div",16),s.YNc(19,X,2,0,"a",17),s.TgZ(20,"button",18),s._UZ(21,"i",19),s._uU(22," Close"),s.qZA(),s.YNc(23,tt,4,2,"button",20),s.qZA(),s.YNc(24,et,1,0,"p-progressSpinner",21),s.qZA()()(),s._UZ(25,"app-monaco-editor-modal",22,23)(27,"app-insert-code-modal",24,25)),2&l&&(s.xp6(4),s.Q6J("ngIf",r.data.mode===r.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.EDIT),s.xp6(11),s.Q6J("isSchemaEditor",!0)("editorOptions",r.editorOptionsSysApi),s.xp6(2),s.Q6J("ngIf",r.lastError),s.xp6(4),s.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.loading.form),s.xp6(1),s.Q6J("modalId","idMonacoEditorModalInSysApi")("editorOptionsMonacoEditorModal",r.editorOptionsMonacoEditorModal)("modalTitle","Error info"),s.xp6(2),s.Q6J("frameId","idInsertCodeSystemAPI")("modalId","idInsertCodeSystemAPIForm")("docsHostPort",r.DOCS_HOST_PORT))},dependencies:[B.O5,Z.y,U.P,G.O,T.G,J.u,Y.A],encapsulation:2})}return d})()},9329:(at,M,o)=>{o.d(M,{X:()=>ht});var g=o(5861),t=o(4946),m=o(3157),h=o(328),A=o(6212),f=o(6990),I=o(5085),E=o(1162),x=o(6925),O=o(921),s=o(6457),W=o(3429),D=o(7240),u=o(9961),b=o(5219),F=o(2189),K=o(5852),N=o(7414),B=o(2915),Z=o(7664),U=o(95),G=o(6814),T=o(5431),J=o(7680),Y=o(3259),Q=o(8057),k=o(3219);const H=["systemApiFormC"];function V(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",13)(1,"label",14)(2,"p-checkbox",15),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.eventCenterS.group.apisRegex.allSystemApis=_)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allSystemApis)("binary",!0)}}function j(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",16)(1,"label",14)(2,"p-checkbox",15),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.eventCenterS.filterInLog.apisRegex.allSystemApis=_)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allSystemApis)("binary",!0)}}function X(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",17),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allSystemApisPermitted)}}function z(i,p){1&i&&(t.TgZ(0,"th",26),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function q(i,p){1&i&&t._UZ(0,"th",27)}function tt(i,p){1&i&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function et(i,p){1&i&&t._UZ(0,"th")}function st(i,p){1&i&&t._UZ(0,"th",28)}function d(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,z,2,0,"th",23),t.YNc(2,q,1,0,"th",24),t.TgZ(3,"th"),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th"),t._uU(6,"URL"),t.qZA(),t.YNc(7,tt,2,0,"th",9),t.YNc(8,et,1,0,"th",9),t.YNc(9,st,1,0,"th",25),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(5),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",e.isLPM),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable)}}function S(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",31),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function a(i,p){if(1&i&&(t.TgZ(0,"td",32)(1,"span"),t._uU(2),t.qZA()()),2&i){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function l(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"AM-User"),t.qZA())}function r(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"No-Access"),t.qZA())}function y(i,p){1&i&&(t.TgZ(0,"span",38),t._uU(1,"Public"),t.qZA())}function R(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"DB-User"),t.qZA())}function nt(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"AWS"),t.qZA())}function it(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Azure"),t.qZA())}function ot(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Google"),t.qZA())}function _t(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,l,2,0,"span",33),t.YNc(2,r,2,0,"span",34),t.YNc(3,y,2,0,"span",35),t.YNc(4,R,2,0,"span",34),t.YNc(5,nt,2,0,"span",34),t.YNc(6,it,2,0,"span",34),t.YNc(7,ot,2,0,"span",34),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.hasAmAuth),t.xp6(1),t.Q6J("ngIf",e.noAccess),t.xp6(1),t.Q6J("ngIf",e.isPublic),t.xp6(1),t.Q6J("ngIf",e.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",e.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",e.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",e.hasGoogleAuth)}}function rt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"label",39)(2,"p-checkbox",40),t.NdJ("ngModelChange",function(_){t.CHM(e);const c=t.oxw(2).$implicit;return t.KtG(c.saveResponseInLog=_)})("click",function(_){t.CHM(e);const c=t.oxw(4);return t.KtG(c.generalS.stopPropagation(_))}),t.qZA()()()}if(2&i){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function lt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,rt,3,2,"div",9),t.qZA()),2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("ngIf",n.selectedRows.indexOf(e)>=0)}}function pt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",46),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.add(_))}),t._UZ(1,"i",47),t.qZA()}}function ct(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",48),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.edit(_))}),t._UZ(1,"i",49),t.qZA()}}function dt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",50),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,c=t.oxw(2);return t.KtG(c.removePermanentDialog(_))}),t._UZ(1,"i",51),t.qZA()}}const mt=function(){return["/api-info/api-testing/testing"]},gt=function(i,p,e){return{at_category:i,at_user:p,at_api:e}};function ft(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"td")(1,"div")(2,"a",41),t.NdJ("click",function(_){t.CHM(e);const c=t.oxw().$implicit,v=t.oxw(2);return _.stopPropagation(),t.KtG(v.selectedRows=[c])}),t._UZ(3,"i",42),t.qZA(),t.YNc(4,pt,2,0,"button",43),t.YNc(5,ct,2,0,"button",44),t.YNc(6,dt,2,0,"button",45),t.qZA()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(5,mt))("queryParams",t.kEZ(6,gt,n.EAPICategory.SYSTEM_APIS,n.authCS.getUserId(),e.id)),t.xp6(2),t.Q6J("ngIf",!e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings)}}function ut(i,p){if(1&i&&(t.TgZ(0,"tr",29),t.YNc(1,S,2,2,"td",9),t.YNc(2,a,3,1,"td",30),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.YNc(7,_t,8,7,"td",9),t.YNc(8,lt,2,1,"td",9),t.YNc(9,ft,7,10,"td",9),t.qZA()),2&i){const e=p.$implicit,n=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",n.showCheckbox),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Oqu(e.url),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",n.isLPM),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable)}}function At(i,p){1&i&&t._UZ(0,"p-progressSpinner",52)}function yt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",18)(1,"p-table",19),t.NdJ("selectionChange",function(_){t.CHM(e);const c=t.oxw();return t.KtG(c.selectedRows=_)})("selectionChange",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.apiSelected())})("dblclick",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.dblClickSystemAPIs())}),t.YNc(2,d,10,5,"ng-template",20),t.YNc(3,ut,10,8,"ng-template",21),t.qZA(),t.YNc(4,At,1,0,"p-progressSpinner",22),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",e.metaKeySelection)("selection",e.selectedRows)("dataKey",e.gridKey)("scrollable",!0)("value",e.rows),t.xp6(3),t.Q6J("ngIf",e.loading.grid)}}let ht=(()=>{class i{systemApiSettingsS;instanceS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;showCheckbox=!0;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];rows=[];rowsMap={};rowsMapName={};data={mode:h.D.ADD,eventChannel:new t.vpe,formData:void 0};selectedRows=[];gridKey=E.iH._id;EUserType=O.d;EAPICategory=I.R;systemApiFormC;constructor(e,n,_,c,v,C,w,L,St,Ct,vt){this.systemApiSettingsS=e,this.instanceS=n,this.generalS=_,this.notificationS=c,this.confirmationService=v,this.navigationCS=C,this.authCS=w,this.constantsS=L,this.eventCenterS=St,this.cd=Ct,this.router=vt}ngOnInit(){var e=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(n=>{(n.action===m.F.SAVED||n.action===m.F.UPDATED)&&(this.systemApiFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var n=(0,g.Z)(function*(_){_.length&&(yield e.loadGridData())});return function(_){return n.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(n=>{n&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - System APIs")}loadGridData(){var e=this;this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length?this.resetGridAndUrl():(this.loading.grid=!0,this.subscriptions.push(this.instanceS.systemAPIList().subscribe(function(){var n=(0,g.Z)(function*(_){_.success?(e.selectedRows=[],e.rows=_.data||[],e.rowsMap=f.keyBy(e.rows,E.iH._id),e.rowsMapName=f.keyBy(e.rows,E.qD.id)):e.resetGridAndUrl();const c=e.navigationCS.getQueryParam(A.p.system_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.systemApiIds.value.join(","):e.eventCenterS.group.systemApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.systemApiNames.join(","):"");if(c){const v=c.split(","),C=f.intersection(f.keys(e.rowsMap),v),w=[];for(const L of C)e.rowsMap[L]&&w.push(e.rowsMap[L]);e.selectedRows=w,e.eventCenterS.group.systemApiIds.next(C),e.eventCenterS.group.systemApis.next(e.selectedRows),e.eventCenterS.filterInLog.systemApiIds.next(C)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?.length){const v=e.eventCenterS.group.selectedGroups.value[0];for(const C of v?.queryParams?.systemApiNames)e.rowsMapName[C]&&(e.rowsMapName[C].saveResponseInLog=v.systemApisLog?.[C]?.saveResponseInLog||!1);e.setResDataInEventCenter()}e.loading.grid=!1,e.cd.detectChanges()});return function(_){return n.apply(this,arguments)}}())))}view(){var e=this;return(0,g.Z)(function*(){const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id},e.data.mode=h.D.VIEW,e.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_VIEW_MODE}),e.systemApiFormC.showModal()})()}add(e){var n=this;return(0,g.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=h.D.ADD,n.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_ADD_MODE}),n.systemApiFormC.showModal()})()}edit(e){var n=this;return(0,g.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=h.D.EDIT,n.data.eventChannel.emit({action:m.F.OPEN_FORM_IN_EDIT_MODE}),n.systemApiFormC.showModal()})()}getSystemApiSetting(){var e=this;return(0,g.Z)(function*(){try{return((yield e.systemApiSettingsS.query({find:{user:e.authCS.getUserId(),apiId:e.selectedRows[0]._id}}).toPromise()).data||[])[0]||{apiId:e.selectedRows?.[0]?._id}}catch{return{apiId:e.selectedRows?.[0]?._id}}})()}resetDependents(){var e=this;return(0,g.Z)(function*(){yield e.navigationCS.setQueryParam(A.p.system_api,null)})()}apiSelected(){var e=this;return(0,g.Z)(function*(){yield e.resetDependents(),yield e.fillData(),e.selectedRows?.[0]?e.generalS.setNewTitle(e.selectedRows[0].name,I.R.SYSTEM_APIS):e.generalS.setNewTitle("API Maker - System APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var e=this;return(0,g.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(A.p.system_api,null),e.eventCenterS.group.systemApis.next([]),e.eventCenterS.group.systemApiIds.next([]),e.eventCenterS.filterInLog.systemApiIds.next([]),void e.eventCenterS.filterInLog.systemApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable)e.eventCenterS.group.systemApiIds.next(f.map(e.selectedRows,"_id")),e.eventCenterS.group.systemApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.systemApiIds.next(f.map(e.selectedRows,"_id")),e.eventCenterS.filterInLog.systemApis.next(e.selectedRows));else{yield e.navigationCS.setQueryParam(A.p.system_api,e.selectedRows[0]._id);const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id}}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.systemApis.next(this.selectedRows),this.eventCenterS.group.selectedSystemApis.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.systemApis.next(this.selectedRows)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}removePermanentDialog(e){var n=this;return(0,g.Z)(function*(){var _;n.selectedRows=[e],n.confirmationService.confirm({message:n.confirmMessage(),header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(_=(0,g.Z)(function*(){yield n.removePermanent(e)}),function(){return _.apply(this,arguments)})}),n.cd.detectChanges()})()}removePermanent(e){var n=this;return(0,g.Z)(function*(){n.loading.grid=!0;const _=yield n.systemApiSettingsS.permanentDelete(e.systemApiSettings).toPromise();n.loading.grid=!1,_?(n.notificationS.showSuccess(n.constantsS.systemApi.removePermanent),n.resetGridAndUrl(),n.loadGridData(),yield n.getSystemApiSetting(),n.cd.detectChanges()):n.notificationS.showErrorFromResponse(_,n.constantsS.systemApi.removePermanentError)})()}dblClickSystemAPIs(){if(this.isDependentOnGroup||this.isLPM)return;const e=this.selectedRows[0];this.selectedRows.length&&e.systemApiSettings?this.edit(e):this.selectedRows.length&&!e.systemApiSettings&&this.add(e)}confirmMessage(){return'<p class="dialog-text">Do you want to <b class="text-danger">permanently remove System API settings</b>?</p>'}ERequestMethod=x.Yp;static \u0275fac=function(n){return new(n||i)(t.Y36(s.J),t.Y36(W.E),t.Y36(D.b),t.Y36(u.W),t.Y36(b.YP),t.Y36(F.S),t.Y36(K.D),t.Y36(N.L),t.Y36(B.u),t.Y36(t.sBO),t.Y36(Z.F0))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-system-api-w"]],viewQuery:function(n,_){if(1&n&&t.Gf(H,5),2&n){let c;t.iGM(c=t.CRH())&&(_.systemApiFormC=c.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:15,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/systems.svg","alt","System API",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/examples/sys/system/system.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All System APIs",4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All System APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[3,"data"],["systemApiFormC",""],["tooltipPosition","left","pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],["pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped system-api-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],["style","width: 140px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","140px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:",1,"btn","btn-xsm-custom","mr-1",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["class","btn btn-xsm-custom mr-1","pTooltip","Add System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom mr-1","pTooltip","Edit System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom","pTooltip","Permanent Delete System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["pTooltip","Add System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","cursor-pointer"],["pTooltip","Edit System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,_){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," System APIs"),t.qZA(),t.TgZ(5,"div",3)(6,"a",4),t._UZ(7,"img",5),t.qZA()(),t.YNc(8,V,3,2,"span",6),t.YNc(9,j,3,2,"span",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,X,3,1,"div",9),t.YNc(12,yt,5,7,"div",10),t.qZA()(),t._UZ(13,"app-w-system-api-form",11,12)),2&n&&(t.xp6(8),t.Q6J("ngIf",_.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",_.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis),t.xp6(1),t.Q6J("ngIf",!(_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis)),t.xp6(1),t.Q6J("data",_.data))},dependencies:[Z.rH,U.JJ,U.On,G.O5,T.iA,b.jx,T.Ei,T.UA,T.Mo,J.G,Y.u,Q.XZ,k.S],encapsulation:2})}return i})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4211],{241:(fe,W,o)=>{o.d(W,{$:()=>U});var b=o(5861),e=o(328),T=o(95),w=o(3157),a=o(4946),y=o(9961),B=o(3429),Q=o(7240),H=o(2915),Y=o(6814),V=o(2660),n=o(7680);function q(F,P){1&F&&(a.TgZ(0,"span"),a._UZ(1,"i",19),a._uU(2," Add Collection"),a.qZA())}function t(F,P){1&F&&(a.TgZ(0,"span"),a._UZ(1,"i",20),a._uU(2," View Collection"),a.qZA())}function L(F,P){1&F&&(a.TgZ(0,"span"),a._UZ(1,"i",21),a._uU(2," Edit Collection"),a.qZA())}function X(F,P){1&F&&(a.TgZ(0,"span"),a._uU(1,"Save Collection"),a.qZA())}function k(F,P){1&F&&(a.TgZ(0,"span"),a._uU(1,"Update Collection"),a.qZA())}function j(F,P){if(1&F){const h=a.EpF();a.TgZ(0,"button",22),a.NdJ("click",function(){a.CHM(h);const u=a.oxw();return a.KtG(u.save())}),a._UZ(1,"i",23),a.YNc(2,X,2,0,"span",4),a.YNc(3,k,2,0,"span",4),a.qZA()}if(2&F){const h=a.oxw();a.Q6J("disabled",h.form.invalid),a.xp6(2),a.Q6J("ngIf",h.data.mode===h.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",h.data.mode===h.EFormMode.EDIT)}}function z(F,P){1&F&&a._UZ(0,"p-progressSpinner",24)}let U=(()=>{class F{fb;ns;instanceS;generalS;eventCenterS;data;loading={form:!1};EFormMode=e.D;form;subscriptions=[];constructor(h,v,u,x,M){this.fb=h,this.ns=v,this.instanceS=u,this.generalS=x,this.eventCenterS=M}ngOnInit(){var h=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var v=(0,b.Z)(function*(u){u&&(h.form.enable(),u.action===w.F.OPEN_FORM_IN_EDIT_MODE?(h.form.reset(),h.form.patchValue(h.data.formData)):u.action===w.F.OPEN_FORM_IN_VIEW_MODE?(h.form.reset(),h.form.patchValue(h.data.formData),h.form.disable()):u.action===w.F.OPEN_FORM_IN_ADD_MODE&&h.form.reset())});return function(u){return v.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[T.kI.required]]})}showModal(){$("#idCollectionsForm").modal("show")}hideModal(){$("#idCollectionsForm").modal("hide")}save(){var h=this;return(0,b.Z)(function*(){const v=h.form.getRawValue();try{h.loading.form=!0;const u=h.eventCenterS.instance.selectedInstances.value[0],x=h.eventCenterS.database.selectedDatabases.value[0].db;let M;if(h.data.mode===e.D.ADD)M=yield h.instanceS.createCollection(u,x,v).toPromise();else if(h.data.mode===e.D.EDIT){const K={oldName:h.data.formData.name,newName:v.name};M=yield h.instanceS.renameCollection(u,x,K).toPromise()}h.ns.showSuccess(`Collection ${h.data.mode===e.D.ADD?"added":"renamed"} successfully.`),h.data.eventChannel.emit({action:h.data.mode===e.D.ADD?w.F.SAVED:w.F.UPDATED}),h.loading.form=!1}catch(u){console.log(u),h.loading.form=!1,h.ns.showErrorFromResponse(u.error||u,"Unable to save.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(v){return new(v||F)(a.Y36(T.qu),a.Y36(y.W),a.Y36(B.E),a.Y36(Q.b),a.Y36(H.u))};static \u0275cmp=a.Xpm({type:F,selectors:[["app-w-collections-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idCollectionsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(v,u){1&v&&(a.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),a.YNc(4,q,3,0,"span",4),a.YNc(5,t,3,0,"span",4),a.YNc(6,L,3,0,"span",4),a.TgZ(7,"button",5)(8,"span",6),a._UZ(9,"i",7),a.qZA()()(),a.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),a._uU(14,"Name"),a.qZA(),a.TgZ(15,"div",12),a._UZ(16,"input",13),a.qZA()()()(),a.TgZ(17,"div",14)(18,"button",15),a._UZ(19,"i",16),a._uU(20," Close"),a.qZA(),a.YNc(21,j,4,3,"button",17),a.qZA(),a.YNc(22,z,1,0,"p-progressSpinner",18),a.qZA()()()),2&v&&(a.xp6(4),a.Q6J("ngIf",u.data.mode===u.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",u.data.mode===u.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",u.data.mode===u.EFormMode.EDIT),a.xp6(5),a.Q6J("formGroup",u.form),a.xp6(10),a.Q6J("ngIf",u.data.mode!==u.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",u.loading.form))},dependencies:[T._Y,T.Fj,T.JJ,T.JL,T.sg,T.u,Y.O5,V.y,n.G],encapsulation:2})}return F})()},6937:(fe,W,o)=>{o.d(W,{n:()=>O});var b=o(5861),e=o(4946),T=o(3157),w=o(328),a=o(6212),y=o(6990),Q=o(3620),H=o(7848),Y=o(1162),V=o(3429),n=o(7240),q=o(9961),t=o(2189),L=o(7414),X=o(2915),k=o(5219),j=o(95),z=o(6814),U=o(5431),F=o(7680),P=o(3259),h=o(8057),v=o(241);const u=["collectionsFormC"];function x(p,E){1&p&&(e.TgZ(0,"th",13),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function M(p,E){1&p&&(e.TgZ(0,"th",14),e._uU(1,"Pre"),e.qZA())}function J(p,E){1&p&&(e.TgZ(0,"th",14),e._uU(1,"Post"),e.qZA())}function K(p,E){1&p&&e._UZ(0,"th",15)}function te(p,E){1&p&&e._UZ(0,"th",15)}function ne(p,E){1&p&&e._UZ(0,"th",15)}function ae(p,E){1&p&&e._UZ(0,"th",16)}function le(p,E){1&p&&e._UZ(0,"th",16)}function re(p,E){if(1&p&&(e.TgZ(0,"tr"),e.YNc(1,x,2,0,"th",9),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA(),e.YNc(4,M,2,0,"th",10),e.YNc(5,J,2,0,"th",10),e.YNc(6,K,1,0,"th",11),e.YNc(7,te,1,0,"th",11),e.YNc(8,ne,1,0,"th",11),e.YNc(9,ae,1,0,"th",12),e.YNc(10,le,1,0,"th",12),e.qZA()),2&p){const l=e.oxw(3);e.xp6(1),e.Q6J("ngIf",l.showCheckbox),e.xp6(3),e.Q6J("ngIf",l.showHooksCount),e.xp6(1),e.Q6J("ngIf",l.showHooksCount),e.xp6(1),e.Q6J("ngIf",!l.isDependentOnGroup&&!l.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!l.isDependentOnGroup&&!l.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!l.isDependentOnGroup&&!l.isFilterLogTable&&l.isVisibleTableChange),e.xp6(1),e.Q6J("ngIf",l.isDependentOnGroup||l.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",l.isDependentOnGroup||l.isFilterLogTable)}}function ce(p,E){if(1&p&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",22),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("value",l)("pSelectableRow",l)}}function ge(p,E){if(1&p&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Oqu(l.name)}}function de(p,E){if(1&p&&(e.TgZ(0,"span",23),e._UZ(1,"i",24),e._uU(2),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(2),e.hij(" ",l.name,"")}}function ue(p,E){if(1&p&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Oqu(l.preHookCount||"")}}function _e(p,E){if(1&p&&(e.TgZ(0,"td",25),e._uU(1),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Oqu(l.postHookCount||"")}}function he(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"i",27),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(5);return e.KtG(A.menuSchemaClicked())}),e.qZA()}}function pe(p,E){if(1&p&&(e.TgZ(0,"td"),e.YNc(1,he,1,0,"i",26),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",l.schemaIsGenerated)}}function me(p,E){1&p&&e._UZ(0,"i",29)}function Ce(p,E){if(1&p&&(e.TgZ(0,"td"),e.YNc(1,me,1,0,"i",28),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",l.collectionSettingIsCreated)}}function ve(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"i",31),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(5);return e.KtG(A.showComparison())}),e.qZA()}}function Se(p,E){if(1&p&&(e.TgZ(0,"td"),e.YNc(1,ve,1,0,"i",30),e.qZA()),2&p){const l=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",l.isChangeHappenedInTable)}}function De(p,E){if(1&p&&(e.TgZ(0,"td")(1,"span",32),e._uU(2),e.qZA()()),2&p){const l=e.oxw().$implicit;e.xp6(2),e.Oqu(l.instanceName.toString().substring(0,3).toUpperCase())}}function be(p,E){if(1&p&&(e.TgZ(0,"td")(1,"span",32),e._uU(2),e.qZA()()),2&p){const l=e.oxw().$implicit;e.xp6(2),e.Oqu(l.databaseName.toString().substring(0,3).toUpperCase())}}function xe(p,E){if(1&p&&(e.TgZ(0,"tr",17),e.YNc(1,ce,2,2,"td",18),e.TgZ(2,"td",19),e.YNc(3,ge,2,1,"span",18),e.YNc(4,de,3,1,"span",20),e.qZA(),e.YNc(5,ue,2,1,"td",21),e.YNc(6,_e,2,1,"td",21),e.YNc(7,pe,2,1,"td",18),e.YNc(8,Ce,2,1,"td",18),e.YNc(9,Se,2,1,"td",18),e.YNc(10,De,3,1,"td",18),e.YNc(11,be,3,1,"td",18),e.qZA()),2&p){const l=E.$implicit,D=e.oxw(3);e.Q6J("pSelectableRow",l),e.xp6(1),e.Q6J("ngIf",D.showCheckbox),e.xp6(2),e.Q6J("ngIf",!l.isCollectionDeleted),e.xp6(1),e.Q6J("ngIf",l.isCollectionDeleted),e.xp6(1),e.Q6J("ngIf",D.showHooksCount),e.xp6(1),e.Q6J("ngIf",D.showHooksCount),e.xp6(1),e.Q6J("ngIf",!D.isDependentOnGroup&&!D.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!D.isDependentOnGroup&&!D.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!D.isDependentOnGroup&&!D.isFilterLogTable&&D.isVisibleTableChange),e.xp6(1),e.Q6J("ngIf",D.isDependentOnGroup||D.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",D.isDependentOnGroup||D.isFilterLogTable)}}function Ie(p,E){1&p&&e._UZ(0,"p-progressSpinner",33)}function Te(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"div",4)(1,"p-table",5),e.NdJ("selectionChange",function(A){e.CHM(l);const G=e.oxw(2);return e.KtG(G.selectedRows=A)})("selectionChange",function(){e.CHM(l);const A=e.oxw(2);return e.KtG(A.collectionSelected())})("dblclick",function(){e.CHM(l);const A=e.oxw(2);return e.KtG(A.dblClickCollections())}),e.YNc(2,re,11,8,"ng-template",6),e.YNc(3,xe,12,11,"ng-template",7),e.qZA(),e.YNc(4,Ie,1,0,"p-progressSpinner",8),e.qZA()}if(2&p){const l=e.oxw(2);e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",l.metaKeySelection)("selection",l.selectedRows)("dataKey",l.gridKey)("scrollable",!0)("value",l.rows),e.xp6(3),e.Q6J("ngIf",l.loading.grid)}}function Ee(p,E){if(1&p&&e.YNc(0,Te,5,7,"div",3),2&p){const l=e.oxw();e.Q6J("ngIf",!(l.eventCenterS.group.apisRegex.allInstances||l.eventCenterS.filterInLog.apisRegex.allInstances||l.eventCenterS.group.apisRegex.allDatabases||l.eventCenterS.group.apisRegex.allCollections))}}function Ae(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",46),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.menuSchemaClicked())}),e._UZ(1,"img",47),e.qZA()}}function C(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",48),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.add())}),e._UZ(1,"i",49),e.qZA()}}function R(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",50),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.edit())}),e._UZ(1,"i",51),e.qZA()}}function c(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",52),e.NdJ("click",function(){e.CHM(l);const A=e.oxw(3);return e.KtG(A.removePermanentDialog())}),e._UZ(1,"i",53),e.qZA()}}function S(p,E){if(1&p&&(e.TgZ(0,"span")(1,"a",40),e._UZ(2,"img",41),e.qZA(),e.YNc(3,Ae,2,0,"span",42),e.YNc(4,C,2,0,"span",43),e.YNc(5,R,2,0,"span",44),e.YNc(6,c,2,0,"span",45),e.qZA()),2&p){const l=e.oxw(2);e.xp6(3),e.Q6J("ngIf",l.selectedRows.length),e.xp6(1),e.Q6J("ngIf",l.eventCenterS.instance.selectedInstances.value.length&&l.eventCenterS.database.selectedDatabases.value.length&&l.addCollectionFromApiMaker),e.xp6(1),e.Q6J("ngIf",l.selectedRows.length&&l.instanceType===l.EInstanceType.MONGO_DB),e.xp6(1),e.Q6J("ngIf",l.selectedRows.length&&l.instanceType===l.EInstanceType.MONGO_DB)}}function d(p,E){if(1&p){const l=e.EpF();e.TgZ(0,"span",54)(1,"label",55)(2,"p-checkbox",56),e.NdJ("ngModelChange",function(A){e.CHM(l);const G=e.oxw(2);return e.KtG(G.eventCenterS.group.apisRegex.allCollections=A)}),e.qZA()()()}if(2&p){const l=e.oxw(2);e.xp6(2),e.Q6J("ngModel",l.eventCenterS.group.apisRegex.allCollections)("binary",!0)}}function I(p,E){if(1&p&&(e.TgZ(0,"div")(1,"div",57),e._uU(2),e.qZA()()),2&p){const l=e.oxw(2);e.xp6(2),e.Oqu(l.constantsS.group.allCollectionsPermitted)}}function i(p,E){1&p&&e.GkF(0)}function m(p,E){if(1&p&&(e.TgZ(0,"div",34)(1,"div",35)(2,"span"),e._UZ(3,"i",36),e._uU(4," Collections"),e.qZA(),e.YNc(5,S,7,4,"span",18),e.YNc(6,d,3,2,"span",37),e.qZA(),e.TgZ(7,"div",38),e.YNc(8,I,3,1,"div",18),e.YNc(9,i,1,0,"ng-container",39),e.qZA()()),2&p){const l=e.oxw(),D=e.MAs(1);e.xp6(5),e.Q6J("ngIf",!l.isReadOnly),e.xp6(1),e.Q6J("ngIf",l.isDependentOnGroup),e.xp6(2),e.Q6J("ngIf",l.eventCenterS.group.apisRegex.allInstances||l.eventCenterS.filterInLog.apisRegex.allInstances||l.eventCenterS.group.apisRegex.allDatabases||l.eventCenterS.group.apisRegex.allCollections),e.xp6(1),e.Q6J("ngTemplateOutlet",D)}}function g(p,E){if(1&p&&e._UZ(0,"app-w-collections-form",58,59),2&p){const l=e.oxw();e.Q6J("data",l.data)}}let O=(()=>{class p{instanceS;generalS;notificationS;navigationCS;constantsS;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;IsBulkSchemaGenerator=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};instanceType;EInstanceType=H.d;selectedRows=[];gridKey=Y.iH._id;addCollectionFromApiMaker=!1;isVisibleTableChange=!1;collectionsFormC;constructor(l,D,A,G,ee,se,oe,ie){this.instanceS=l,this.generalS=D,this.notificationS=A,this.navigationCS=G,this.constantsS=ee,this.cd=se,this.eventCenterS=oe,this.confirmationService=ie}ngOnInit(){var l=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var D=(0,b.Z)(function*(A){(A.action===T.F.SAVED||A.action===T.F.UPDATED)&&(l.collectionsFormC.hideModal(),yield l.loadGridData())});return function(A){return D.apply(this,arguments)}}())),this.eventCenterS.collection.selectedCollections.next([]),this.subscriptions.push(this.eventCenterS.database.selectedDatabases.pipe((0,Q.b)(300)).subscribe(function(){var D=(0,b.Z)(function*(A){yield l.loadGridData()});return function(A){return D.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.instance.selectedInstances.pipe((0,Q.b)(300)).subscribe(function(){var D=(0,b.Z)(function*(A){const G=A[0];l.instanceType=G?G.type:void 0,l.addCollectionFromApiMaker=!1,"MONGO_DB"===l.instanceType&&(l.addCollectionFromApiMaker=!0)});return function(A){return D.apply(this,arguments)}}()))}resetGridAndUrl(){var l=this;return(0,b.Z)(function*(){l.rows=[],l.selectedRows=[],l.rowsMap={},l.eventCenterS.collection.selectedCollections.next([])})()}loadGridData(){var l=this;return(0,b.Z)(function*(){const D=l.eventCenterS.database.selectedDatabases.value;D&&0!==D.length&&D[0]?(l.loading.grid=!0,l.isVisibleTableChange=!1,l.resetGridAndUrl(),l.subscriptions.push(l.instanceS.getCollections(D).subscribe(function(){var A=(0,b.Z)(function*(G){if(G.success){l.selectedRows=[],l.rows=y.flatten(G.data||[]),l.rowsMap=y.keyBy(l.rows,Y.iH._id),l.showHooksCount&&(yield l.instanceS.setHooksCountInCollectionArr(D[0].instanceName,D[0].db,l.rows));for(const se of l.rows)if(se.isChangeHappenedInTable){l.isVisibleTableChange=!0;break}}else l.resetGridAndUrl();const ee=l.navigationCS.getQueryParam(a.p.collection)||(l.isFilterLogTable?l.eventCenterS.filterInLog.collectionIds.value.join(","):l.eventCenterS.group.collectionNames.value.join(","));if(ee){const se=ee.split(","),oe=y.intersection(y.keys(l.rowsMap),se),ie=[];for(const Pe of oe)l.rowsMap[Pe]&&ie.push(l.rowsMap[Pe]);l.selectedRows=ie,l.eventCenterS.collection.selectedCollections.next(ie),l.isDependentOnGroup&&l.eventCenterS.group.collectionNames.next(oe),l.isFilterLogTable&&(l.eventCenterS.filterInLog.collectionIds.next(oe),l.eventCenterS.filterInLog.collectionNames.next(y.map(l.selectedRows,"name")))}l.loading.grid=!1,l.cd.detectChanges()});return function(G){return A.apply(this,arguments)}}()))):l.resetGridAndUrl()})()}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),this.collectionsFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=w.D.VIEW,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_VIEW_MODE}),this.collectionsFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=w.D.EDIT,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_EDIT_MODE}),this.collectionsFormC.showModal()}removePermanentDialog(){var l=this;return(0,b.Z)(function*(){var D;l.confirmationService.confirm({message:l.constantsS.collection.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(D=(0,b.Z)(function*(){yield l.removePermanent()}),function(){return D.apply(this,arguments)})})})()}removePermanent(){var l=this;return(0,b.Z)(function*(){const D=l.eventCenterS.instance.selectedInstances.value[0],A=l.eventCenterS.database.selectedDatabases.value[0].db,G=l.selectedRows[0].name;l.loading.grid=!0;try{const ee=yield l.instanceS.dropCollection(D,A,G).toPromise();l.loading.grid=!1,ee.success?(l.notificationS.showSuccess(l.constantsS.collection.removePermanent),l.selectedRows.length=0,l.loadGridData()):l.notificationS.showErrorFromResponse(ee,l.constantsS.collection.removePermanentError)}catch(ee){l.notificationS.showErrorMessageFromErrorObject(ee),l.loading.grid=!1}})()}collectionSelected(){var l=this;return(0,b.Z)(function*(){l.eventCenterS.collection.selectedCollections.next(l.selectedRows),l.IsBulkSchemaGenerator||(l.isDependentOnGroup||l.isFilterLogTable?(l.isDependentOnGroup&&l.eventCenterS.group.collectionNames.next(y.map(l.selectedRows,"_id")),l.isFilterLogTable&&(l.eventCenterS.filterInLog.collectionIds.next(y.map(l.selectedRows,"_id")),l.eventCenterS.filterInLog.collectionNames.next(y.map(l.selectedRows,"name")))):(yield l.navigationCS.setQueryParam(a.p.collection,y.map(l.selectedRows,"_id").join(",")||null),yield l.navigationCS.setQueryParam(a.p.collection_api,null)))})()}menuSchemaClicked(){setTimeout(()=>{this.eventCenterS.apiCell.eventChannelSchema.emit({action:T.F.OPEN_FORM_IN_DECIDE_MODE})},100)}showComparison(){setTimeout(()=>{this.eventCenterS.apiCell.eventChannelSchema.emit({action:T.F.OPEN_FORM_IN_DECIDE_MODE,isOpen:"compareMode"})},100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickCollections(){this.selectedRows.length&&this.eventCenterS.apiCell.eventChannelSchema.emit({action:T.F.OPEN_FORM_IN_DECIDE_MODE})}static \u0275fac=function(D){return new(D||p)(e.Y36(V.E),e.Y36(n.b),e.Y36(q.W),e.Y36(t.S),e.Y36(L.L),e.Y36(e.sBO),e.Y36(X.u),e.Y36(k.YP))};static \u0275cmp=e.Xpm({type:p,selectors:[["app-w-collections"]],viewQuery:function(D,A){if(1&D&&e.Gf(u,5),2&D){let G;e.iGM(G=e.CRH())&&(A.collectionsFormC=G.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],IsBulkSchemaGenerator:"IsBulkSchemaGenerator",isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:4,vars:2,consts:[["modalGrid",""],["class","card shadow-sm h-100",4,"ngIf"],[3,"data",4,"ngIf"],["class","h-100",4,"ngIf"],[1,"h-100"],["styleClass","p-datatable-striped collection-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 40px;",4,"ngIf"],["style","width: 42px;",4,"ngIf"],["style","width: 50px;",4,"ngIf"],[2,"width","45px"],[2,"width","40px"],[2,"width","42px"],[2,"width","50px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"word-break-all"],["tooltipPosition","left","pTooltip","Table/Collection is not prsent but schema is present.","class","text-muted italic",4,"ngIf"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],["tooltipPosition","left","pTooltip","Table/Collection is not prsent but schema is present.",1,"text-muted","italic"],[1,"fas","fa-feather-alt","fa-fw"],[1,"text-center"],["tooltipPosition","left","pTooltip","Schema is generated.","class","fas fa-receipt text-warning fa-fw cursor-pointer",3,"click",4,"ngIf"],["tooltipPosition","left","pTooltip","Schema is generated.",1,"fas","fa-receipt","text-warning","fa-fw","cursor-pointer",3,"click"],["tooltipPosition","left","pTooltip","Collection settings are there.","class","fas fa-cog text-danger fa-fw cursor-pointer",4,"ngIf"],["tooltipPosition","left","pTooltip","Collection settings are there.",1,"fas","fa-cog","text-danger","fa-fw","cursor-pointer"],["class","fas fa-retweet fa-fw align-middle text-warning cursor-pointer",3,"click",4,"ngIf"],[1,"fas","fa-retweet","fa-fw","align-middle","text-warning","cursor-pointer",3,"click"],[1,"text-monospace","small"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-border-all","text-success","fa-fw","mr-1"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Collections",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngTemplateOutlet"],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html#collections","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Add/Edit Schema",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Add New",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["tooltipPosition","left","pTooltip","Add/Edit Schema",1,"float-right","cursor-pointer","ml-3",3,"click"],["src","/assets/images/icons/bulkschema.svg",2,"width","18px","margin-left","1px","margin-bottom","3px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Collections",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[3,"data"],["collectionsFormC",""]],template:function(D,A){1&D&&(e.YNc(0,Ee,1,1,"ng-template",null,0,e.W1O),e.YNc(2,m,10,4,"div",1),e.YNc(3,g,2,1,"app-w-collections-form",2)),2&D&&(e.xp6(2),e.Q6J("ngIf",!A.IsBulkSchemaGenerator),e.xp6(1),e.Q6J("ngIf",!A.IsBulkSchemaGenerator))},dependencies:[j.JJ,j.On,z.O5,z.tP,U.iA,k.jx,U.Ei,U.UA,U.Mo,F.G,P.u,h.XZ,v.$]})}return p})()},740:(fe,W,o)=>{o.d(W,{c:()=>S});var b=o(5861),e=o(3157),T=o(328),w=o(6990),a=function(d){return d.double="double",d.string="string",d.object="object",d.array="array",d.binData="binData",d.undefined="undefined",d.objectId="objectId",d.bool="bool",d.date="date",d.null="null",d.regex="regex",d.dbPointer="dbPointer",d.javascript="javascript",d.symbol="symbol",d.javascriptWithScope="javascriptWithScope",d.int="int",d.timestamp="timestamp",d.long="long",d.decimal="decimal",d.minKey="minKey",d.maxKey="maxKey",d}(a||{}),y=o(9361),B=o(1162),Q=o(553),H=o(1601),Y=o(3531),V=o(9989),n=o(4946),q=o(95),t=o(9961),L=o(9530),X=o(3429),k=o(7240),j=o(5852),z=o(2915),U=o(6162),F=o(2304),P=o(7414),h=o(5219),v=o(6814),u=o(2660),x=o(5860),M=o(756),J=o(7680),K=o(4844),te=o(3259),ne=o(5025);const ae=["editorSchemaNative"],le=["monacoEditorModalC"],re=["insertCodeModalC"];function ce(d,I){if(1&d&&(n.TgZ(0,"span",37),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances||null==i.eventCenterS.instance.selectedInstances.value[0]?null:i.eventCenterS.instance.selectedInstances.value[0].name)}}function ge(d,I){if(1&d&&(n.TgZ(0,"span",38),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases||null==i.eventCenterS.database.selectedDatabases.value[0]?null:i.eventCenterS.database.selectedDatabases.value[0].db)}}function de(d,I){if(1&d&&(n.TgZ(0,"span",39),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections||null==i.eventCenterS.collection.selectedCollections.value[0]?null:i.eventCenterS.collection.selectedCollections.value[0].name)}}function ue(d,I){if(1&d&&(n.TgZ(0,"span"),n._UZ(1,"i",32),n.TgZ(2,"span"),n._uU(3," Add Schema "),n.qZA(),n.YNc(4,ce,2,1,"span",33),n.TgZ(5,"span",34),n._uU(6," \u25b8 "),n.qZA(),n.YNc(7,ge,2,1,"span",35),n.TgZ(8,"span",34),n._uU(9," \u25b8 "),n.qZA(),n.YNc(10,de,2,1,"span",36),n.qZA()),2&d){const i=n.oxw();n.xp6(4),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances?null:i.eventCenterS.instance.selectedInstances.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases?null:i.eventCenterS.database.selectedDatabases.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections?null:i.eventCenterS.collection.selectedCollections.value)}}function _e(d,I){1&d&&(n.TgZ(0,"span"),n._UZ(1,"i",40),n._uU(2," View Schema"),n.qZA())}function he(d,I){if(1&d&&(n.TgZ(0,"span",37),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances||null==i.eventCenterS.instance.selectedInstances.value[0]?null:i.eventCenterS.instance.selectedInstances.value[0].name)}}function pe(d,I){if(1&d&&(n.TgZ(0,"span",38),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases||null==i.eventCenterS.database.selectedDatabases.value[0]?null:i.eventCenterS.database.selectedDatabases.value[0].db)}}function me(d,I){if(1&d&&(n.TgZ(0,"span",39),n._uU(1),n.qZA()),2&d){const i=n.oxw(2);n.xp6(1),n.Oqu(null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections||null==i.eventCenterS.collection.selectedCollections.value[0]?null:i.eventCenterS.collection.selectedCollections.value[0].name)}}function Ce(d,I){if(1&d&&(n.TgZ(0,"span"),n._UZ(1,"i",41),n.TgZ(2,"span"),n._uU(3," Edit Schema "),n.qZA(),n.YNc(4,he,2,1,"span",33),n.TgZ(5,"span",34),n._uU(6," \u25b8 "),n.qZA(),n.YNc(7,pe,2,1,"span",35),n.TgZ(8,"span",34),n._uU(9," \u25b8 "),n.qZA(),n.YNc(10,me,2,1,"span",36),n.qZA()),2&d){const i=n.oxw();n.xp6(4),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.instance||null==i.eventCenterS.instance.selectedInstances?null:i.eventCenterS.instance.selectedInstances.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.database||null==i.eventCenterS.database.selectedDatabases?null:i.eventCenterS.database.selectedDatabases.value),n.xp6(3),n.Q6J("ngIf",null==i.eventCenterS||null==i.eventCenterS.collection||null==i.eventCenterS.collection.selectedCollections?null:i.eventCenterS.collection.selectedCollections.value)}}function ve(d,I){1&d&&n._UZ(0,"p-progressSpinner",44)}function Se(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"div",15)(1,"app-monaco-editor",42,43),n.NdJ("editorGenerated",function(g){n.CHM(i);const O=n.oxw();return n.KtG(O.editorGenerated(g))}),n.qZA(),n.YNc(3,ve,1,0,"p-progressSpinner",17),n.qZA()}if(2&d){const i=n.oxw();n.xp6(1),n.Q6J("isSchemaEditor",!0)("editorOptions",i.editorOptionsSchema),n.xp6(2),n.Q6J("ngIf",i.loading.form)}}function De(d,I){1&d&&n._UZ(0,"p-progressSpinner",44)}function be(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"i",45),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.removePermanentDialog())}),n.qZA()}}function xe(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"i",46),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.syncSchema())}),n.qZA()}}function Ie(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"i",47),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.resetSchemaSyncEditor())}),n.qZA()}}function Te(d,I){1&d&&(n.TgZ(0,"span"),n._uU(1,"Save Schema"),n.qZA())}function Ee(d,I){1&d&&(n.TgZ(0,"span"),n._uU(1,"Update & Close"),n.qZA())}function Ae(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"button",48),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.save(!0))}),n._UZ(1,"i",49),n.YNc(2,Te,2,0,"span",4),n.YNc(3,Ee,2,0,"span",4),n.qZA()}if(2&d){const i=n.oxw();n.Q6J("disabled",i.isDiffEditorEnable),n.xp6(2),n.Q6J("ngIf",i.mode===i.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",i.mode===i.EFormMode.EDIT)}}function C(d,I){1&d&&(n.TgZ(0,"span"),n._uU(1,"Update"),n.qZA())}function R(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"button",50),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.save(!1))}),n._UZ(1,"i",49),n.YNc(2,C,2,0,"span",4),n.qZA()}if(2&d){const i=n.oxw();n.Q6J("disabled",i.isDiffEditorEnable),n.xp6(2),n.Q6J("ngIf",i.mode===i.EFormMode.EDIT)}}function c(d,I){if(1&d){const i=n.EpF();n.TgZ(0,"a",51),n.NdJ("click",function(){n.CHM(i);const g=n.oxw();return n.KtG(g.viewError())}),n._uU(1),n.qZA()}if(2&d){const i=n.oxw();n.xp6(1),n.hij("View ",i.modalTitle," ")}}let S=(()=>{class d{fb;ns;schemaS;instanceS;generalS;authCS;eventCenterS;validationS;monacoS;constantsS;cd;notificationS;confirmationService;generalCS;mode=T.D.ADD;loading={form:!1};EFormMode=T.D;subscriptions=[];analysisData={fields:[]};analysisDataDiff={fields:[]};schemaData={properties:{}};bsonTypes=[];editorOptionsAnalysis={readOnly:!0,language:"json",contextmenu:!1};editorOptionsSchema={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};editorSchemaNative;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;isFirstTimeEditorSchemaGenerated=!0;editorSchema;editorAnalysis;isDiffEditorEnable=!1;BE_HOST_PORT=Q.N.BE_HOST_PORT;codeVersions;modalTitle;constructor(i,m,g,O,p,E,l,D,A,G,ee,se,oe,ie){this.fb=i,this.ns=m,this.schemaS=g,this.instanceS=O,this.generalS=p,this.authCS=E,this.eventCenterS=l,this.validationS=D,this.monacoS=A,this.constantsS=G,this.cd=ee,this.notificationS=se,this.confirmationService=oe,this.generalCS=ie}ngOnInit(){var i=this;this.subscriptions.push(this.eventCenterS.apiCell.eventChannelSchema.subscribe(function(){var m=(0,b.Z)(function*(g){if(g)if(g.action===e.F.OPEN_FORM_IN_DECIDE_MODE){i.loading.form=!0;const O=yield i.schemaS.getCurrentSchema();i.eventCenterS.apiCell.eventChannelSchema.emit(O?{action:e.F.OPEN_FORM_IN_EDIT_MODE,data:O}:{action:e.F.OPEN_FORM_IN_ADD_MODE}),setTimeout((0,b.Z)(function*(){"compareMode"===g.isOpen&&(yield i.syncSchema())}),500),i.loading.form=!1}else g.action===e.F.OPEN_FORM_IN_EDIT_MODE?(i.mode=T.D.EDIT,i.schemaData=g.data,i.showModal(),i.patchForm(i.schemaData)):g.action===e.F.OPEN_FORM_IN_VIEW_MODE?(i.mode=T.D.VIEW,i.showModal()):g.action===e.F.OPEN_FORM_IN_ADD_MODE&&(i.mode=T.D.ADD,i.loading.form=!0,i.resetForm(),i.showModal(),i.analysisData=yield i.loadAnalysisData(),setTimeout(()=>{i.generalCS.setValueInEditor(i,"editorSchema",i.analysisData.fieldsString),i.generalCS.setValueInEditor(i,"editorAnalysis",i.generalS.stringify(i.analysisData.fields))},500),i.loading.form=!1)});return function(g){return m.apply(this,arguments)}}()));for(const m of w.keys(a))this.bsonTypes.push(m)}insertCodeModalC;showInsertCodeModel(){this.generalCS.messageReceivedFor=y.H.Schema,this.insertCodeModalC.showModal(Y.b.CreateSchemaFormC)}editorGenerated(i){var m=this;return(0,b.Z)(function*(){m.editorSchema=i,m.isFirstTimeEditorSchemaGenerated&&(yield m.monacoS.loadSchemaEditorSettings(m.BE_HOST_PORT,m.authCS.getUserId(),null)),m.isFirstTimeEditorSchemaGenerated=!1,m.monacoS.addSaveCodeKeyBinding(i,g=>{m.isDiffEditorEnable||m.save(!1)}),m.monacoS.addInsertCodeKeyBinding(i,g=>{m.generalCS.messageReceivedFor=y.H.Schema,m.insertCodeModalC.showModal(Y.b.CreateSchemaFormC)}),m.subscriptions.push(m.generalS.messageReceived.subscribe(g=>{g.type&&g.type===V.g.TEXT_COPIED&&g.componentName===Y.b.CreateSchemaFormC&&(m.monacoS.insertAtCursor(i,g.selectedText),m.insertCodeModalC.hideModal())}))})()}resetForm(){this.schemaData={properties:{}},this.editorSchema&&this.editorSchema.setValue(""),this.editorAnalysis&&this.editorAnalysis.setValue("")}patchForm(i){setTimeout(()=>{this.editorSchema&&this.editorSchema.setValue(i.propertiesCode),this.editorAnalysis&&this.editorAnalysis.setValue("")},500)}loadAnalysisData(){var i=this;return(0,b.Z)(function*(){const m=i.eventCenterS.instance.selectedInstances.value,g=i.eventCenterS.database.selectedDatabases.value,O=i.eventCenterS.collection.selectedCollections.value;try{const p=yield i.instanceS.getSchema(m[0],g[0].db,O[0].name).toPromise();for(const E of p.warnings||[])i.notificationS.showWarning(E.message);return p.data}catch{return{fields:[]}}})()}validateAndSetBeforeSave(){var i=this;return(0,b.Z)(function*(){i.schemaData.instanceName=i.eventCenterS.instance.selectedInstances.value[0].name,i.schemaData.collectionName=i.schemaData.collectionName=i.eventCenterS.collection.selectedCollections.value[0].name,i.schemaData.databaseName=i.eventCenterS.database.selectedDatabases.value[0].db,i.schemaData.propertiesCode=i.editorSchema.getValue(),i.schemaData.user=i.authCS.getUserId()})()}save(i){var m=this;return(0,b.Z)(function*(){try{if(!m.validateAndSetBeforeSave())return;let O;m.loading.form=!0,m.lastError=void 0,m.monacoS.clearEditorDecorations(m.editorSchema,m.monacoDecorations),m.mode===T.D.ADD?O=yield m.schemaS.post(m.schemaData).toPromise():m.mode===T.D.EDIT&&(O=yield m.schemaS.put(m.schemaData._id,m.schemaData,{select:B.iH._id}).toPromise()),m.ns.showSuccess(`Schema ${m.mode===T.D.ADD?"added":"updated"} successfully.`),O.warnings?.length?(m.lastError=O.warnings,m.modalTitle="Warnings"):i&&m.hideModal(),m.eventCenterS.apiCell.eventChannelSchema.emit({action:m.mode===T.D.ADD?e.F.SAVED:e.F.UPDATED}),m.eventCenterS.schemaSaved.next(!0),m.eventCenterS.database.selectedDatabases.next([...m.eventCenterS.database.selectedDatabases.value]),m.loading.form=!1}catch(g){const O=g?.error?.errors||[];O.length&&m.notificationS.showError(O[0].message),m.loading.form=!1,m.lastError=g.error,m.modalTitle="Error info",m.tab=m.tab||{},m.tab.axiosResponse={data:g.error},m.monacoS.highlightErrorInMonacoEditor(m.editorSchema,m.tab,"MainSandbox.ts",m.monacoDecorations)}})()}removePermanentDialog(){var i=this;return(0,b.Z)(function*(){var m;i.confirmationService.confirm({message:i.constantsS.schema.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(m=(0,b.Z)(function*(){yield i.removePermanent()}),function(){return m.apply(this,arguments)})})})()}removePermanent(){var i=this;return(0,b.Z)(function*(){i.loading.form=!0;const m=yield i.schemaS.permanentDelete(i.schemaData._id).toPromise();i.loading.form=!1,m.success?(i.notificationS.showSuccess(i.constantsS.schema.removePermanent),i.hideModal(),i.eventCenterS.schemaSaved.next(!0)):i.notificationS.showErrorFromResponse(m,i.constantsS.schema.removePermanentError)})()}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{this.editorSchemaNative.createEditor(),this.isDiffEditorEnable=!1,$("#idCreateSchemaForm").modal("show")},100)}hideModal(){$("#idCreateSchemaForm").modal("hide")}syncSchema(){var i=this;return(0,b.Z)(function*(){i.loading.form=!0,i.isDiffEditorEnable=!0,i.analysisDataDiff=yield i.loadAnalysisData(),yield i.editorSchemaNative.initDiffEditor(i.editorSchema.getValue(),i.analysisDataDiff.fieldsString,"typescript",!0,!0),i.loading.form=!1})()}resetSchemaSyncEditor(){var i=this;return(0,b.Z)(function*(){i.isDiffEditorEnable=!1;const m=i.editorSchemaNative.editorDiff.getModel().original.getValue();i.editorSchemaNative.createEditor(m)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),H.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(m){return new(m||d)(n.Y36(q.qu),n.Y36(t.W),n.Y36(L.$),n.Y36(X.E),n.Y36(k.b),n.Y36(j.D),n.Y36(z.u),n.Y36(U.m),n.Y36(F.b),n.Y36(P.L),n.Y36(n.sBO),n.Y36(t.W),n.Y36(h.YP),n.Y36(k.b))};static \u0275cmp=n.Xpm({type:d,selectors:[["app-create-schema-form"]],viewQuery:function(m,g){if(1&m&&(n.Gf(ae,5),n.Gf(le,5),n.Gf(re,5)),2&m){let O;n.iGM(O=n.CRH())&&(g.editorSchemaNative=O.first),n.iGM(O=n.CRH())&&(g.viewDockerfileModelC=O.first),n.iGM(O=n.CRH())&&(g.insertCodeModalC=O.first)}},decls:36,vars:19,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idCreateSchemaForm","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",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1","text-info",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body"],[3,"header"],["class","overflow-hidden","style","height: calc(100vh - 183px);",4,"ngIf"],["header","Data Analysis"],[1,"overflow-hidden",2,"height","calc(100vh - 183px)"],[3,"editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"modal-footer"],[1,"w-100"],["class","far fa-trash-alt fa-fw text-danger cursor-pointer align-bottom",3,"click",4,"ngIf"],["class","fas fa-sync fa-fw text-info cursor-pointer align-bottom ml-2",3,"click",4,"ngIf"],["class","fas fa-redo fa-fw text-info cursor-pointer fa-flip-horizontal align-bottom ml-2",3,"click",4,"ngIf"],["class","btn btn-primary btn-sm float-right","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-primary btn-sm float-right mr-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["type","button",1,"btn","btn-sm","btn-secondary","float-right","mr-2",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["href","javascript:;","class","text-danger float-right mr-1",3,"click",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["class","text-warning pl-5","pTooltip","Instance",4,"ngIf"],[1,"ml-2"],["class","text-light ml-2","pTooltip","Database",4,"ngIf"],["class","text-success ml-2","pTooltip","Collection",4,"ngIf"],["pTooltip","Instance",1,"text-warning","pl-5"],["pTooltip","Database",1,"text-light","ml-2"],["pTooltip","Collection",1,"text-success","ml-2"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["editorSchemaNative",""],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"far","fa-trash-alt","fa-fw","text-danger","cursor-pointer","align-bottom",3,"click"],[1,"fas","fa-sync","fa-fw","text-info","cursor-pointer","align-bottom","ml-2",3,"click"],[1,"fas","fa-redo","fa-fw","text-info","cursor-pointer","fa-flip-horizontal","align-bottom","ml-2",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","mr-2",3,"disabled","click"],["href","javascript:;",1,"text-danger","float-right","mr-1",3,"click"]],template:function(m,g){1&m&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,ue,11,3,"span",4),n.YNc(5,_e,3,0,"span",4),n.YNc(6,Ce,11,3,"span",4),n.TgZ(7,"div",5)(8,"button",6),n.NdJ("click",function(){return g.hideModal()}),n.TgZ(9,"span",7),n._UZ(10,"i",8),n.qZA()(),n.TgZ(11,"span",9),n.NdJ("click",function(){return g.showInsertCodeModel()}),n._UZ(12,"i",10),n.qZA()()(),n.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),n.YNc(16,Se,4,3,"div",13),n.qZA(),n.TgZ(17,"p-tabPanel",14)(18,"div",15)(19,"app-monaco-editor",16),n.NdJ("editorGenerated",function(p){return g.editorAnalysis=p}),n.qZA(),n.YNc(20,De,1,0,"p-progressSpinner",17),n.qZA()()()(),n.TgZ(21,"div",18)(22,"div",19),n.YNc(23,be,1,0,"i",20),n.YNc(24,xe,1,0,"i",21),n.YNc(25,Ie,1,0,"i",22),n.YNc(26,Ae,4,3,"button",23),n.YNc(27,R,3,2,"button",24),n.TgZ(28,"button",25),n.NdJ("click",function(){return g.hideModal()}),n._UZ(29,"i",26),n._uU(30," Close"),n.qZA(),n.YNc(31,c,2,1,"a",27),n.qZA()()()()(),n._UZ(32,"app-monaco-editor-modal",28,29)(34,"app-insert-code-modal",30,31)),2&m&&(n.xp6(4),n.Q6J("ngIf",g.mode===g.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT),n.xp6(9),n.MGl("header","",g.mode===g.EFormMode.ADD?"Create":"Update"," Schema"),n.xp6(1),n.Q6J("ngIf",g.shouldLoadMonacoEditor),n.xp6(3),n.Q6J("editorOptions",g.editorOptionsAnalysis),n.xp6(1),n.Q6J("ngIf",g.loading.form),n.xp6(3),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT&&!g.isDiffEditorEnable),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT&&g.isDiffEditorEnable),n.xp6(1),n.Q6J("ngIf",g.mode!==g.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",g.mode===g.EFormMode.EDIT),n.xp6(4),n.Q6J("ngIf",g.lastError),n.xp6(1),n.Q6J("modalId","idMonacoEditorModalInSchema")("editorOptionsMonacoEditorModal",g.editorOptionsMonacoEditorModal)("modalTitle",g.modalTitle),n.xp6(2),n.Q6J("frameId","IdInsertCodeSchema")("modalId","IdInsertCodeSchemaModal")("docsHostPort","https://docs.apimaker.dev/v1/examples/sys/schema/schema.html"))},dependencies:[v.O5,u.y,x.P,M.O,J.G,K.xf,K.x4,te.u,ne.A],encapsulation:2})}return d})()},2571:(fe,W,o)=>{o.d(W,{d:()=>P});var b=o(5861),e=o(6990),w=o(1162),a=o(4946),y=o(95),B=o(9961),Q=o(3429),H=o(5852),Y=o(7240),V=o(9530),n=o(2915),q=o(6814),t=o(2660),L=o(5431),X=o(5219),k=o(7680);function j(h,v){1&h&&(a.TgZ(0,"tr")(1,"th",18),a._UZ(2,"p-tableHeaderCheckbox"),a.qZA(),a.TgZ(3,"th"),a._uU(4,"Collection/Table name"),a.qZA()())}function z(h,v){if(1&h&&(a.TgZ(0,"tr",19)(1,"td"),a._UZ(2,"p-tableCheckbox",20),a.qZA(),a.TgZ(3,"td"),a._uU(4),a.qZA()()),2&h){const u=v.$implicit;a.Q6J("pSelectableRow",u),a.xp6(2),a.Q6J("value",u)("pSelectableRow",u),a.xp6(2),a.Oqu(u.name)}}function U(h,v){1&h&&a._UZ(0,"p-progressSpinner",21)}function F(h,v){1&h&&a._UZ(0,"p-progressSpinner",21)}let P=(()=>{class h{fb;ns;instanceS;authCS;generalS;schemaS;cd;eventCenterS;subscriptions=[];loading={grid:!1};rows=[];rowsMap={};selectedRows=[];gridKey=w.iH._id;constructor(u,x,M,J,K,te,ne,ae){this.fb=u,this.ns=x,this.instanceS=M,this.authCS=J,this.generalS=K,this.schemaS=te,this.cd=ne,this.eventCenterS=ae}ngOnInit(){}loadGridData(){var u=this;return(0,b.Z)(function*(){const x=u.eventCenterS.database.selectedDatabases.value;u.loading.grid=!0,u.subscriptions.push(u.instanceS.getCollections(x).subscribe(M=>{if(M.success){u.selectedRows=[];const J=e.filter(e.flatten(M.data||[]),{schemaIsGenerated:!1});u.rows=e.flatten(J||[]),u.rowsMap=e.keyBy(u.rows,w.iH._id)}u.loading.grid=!1,u.cd.detectChanges()}))})()}showSchemaModal(){var u=this;return(0,b.Z)(function*(){$("#idBulkSchemaCreationModal").modal("show"),yield u.loadGridData()})()}hideSchemaModal(){$("#idBulkSchemaCreationModal").modal("hide")}generateSchemas(){var u=this;return(0,b.Z)(function*(){try{const x=u.selectedRows;u.loading.grid=!0;for(const M of x)try{const J=yield u.instanceS.getSchemaByInstanceName(M.instanceName,M.databaseName,M.name).toPromise(),K={instanceName:M.instanceName,collectionName:M.name,databaseName:M.databaseName,propertiesCode:J.data.fieldsString,user:u.authCS.getUserId()};(yield u.schemaS.post(K).toPromise()).success&&u.ns.showSuccess(`'${M.name}' schema created successfully.`)}catch{u.ns.showError(`'${M.name}' schema creation failed.`)}u.eventCenterS.database.selectedDatabases.next([...u.eventCenterS.database.selectedDatabases.value]),u.hideSchemaModal(),u.loading.grid=!1}catch(x){const M=x?.error?.errors||[];M.length&&u.ns.showError(M[0].message),u.loading.grid=!1}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(x){return new(x||h)(a.Y36(y.qu),a.Y36(B.W),a.Y36(Q.E),a.Y36(H.D),a.Y36(Y.b),a.Y36(V.$),a.Y36(a.sBO),a.Y36(n.u))};static \u0275cmp=a.Xpm({type:h,selectors:[["app-w-bulk-schema-generator"]],decls:24,vars:8,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idBulkSchemaCreationModal","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog"],[1,"modal-content"],[1,"modal-header"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 152px)",3,"selectionMode","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],[2,"width","45px"],[3,"pSelectableRow"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(x,M){1&x&&(a.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"span"),a._UZ(5,"i",4),a._uU(6," Bulk Schemas Create"),a.qZA(),a.TgZ(7,"button",5)(8,"span",6),a._UZ(9,"i",7),a.qZA()()(),a.TgZ(10,"div",8)(11,"p-table",9),a.NdJ("selectionChange",function(K){return M.selectedRows=K}),a.YNc(12,j,5,0,"ng-template",10),a.YNc(13,z,5,4,"ng-template",11),a.qZA(),a.YNc(14,U,1,0,"p-progressSpinner",12),a.qZA(),a.TgZ(15,"div",13)(16,"button",14),a._UZ(17,"i",15),a._uU(18," Close"),a.qZA(),a.TgZ(19,"button",16),a.NdJ("click",function(){return M.generateSchemas()}),a._UZ(20,"i",17),a.TgZ(21,"span"),a._uU(22,"Generate Schemas"),a.qZA()()(),a.YNc(23,F,1,0,"p-progressSpinner",12),a.qZA()()()),2&x&&(a.xp6(11),a.Q6J("selectionMode","multiple")("selection",M.selectedRows)("dataKey",M.gridKey)("scrollable",!0)("value",M.rows),a.xp6(3),a.Q6J("ngIf",M.loading.grid),a.xp6(5),a.Q6J("disabled",!M.selectedRows.length),a.xp6(4),a.Q6J("ngIf",M.loading.grid))},dependencies:[q.O5,t.y,L.iA,X.jx,L.Ei,L.UA,L.Mo,k.G]})}return h})()},5597:(fe,W,o)=>{o.d(W,{H:()=>F});var b=o(5861),e=o(328),T=o(95),w=o(3157),a=o(4946),y=o(9961),B=o(3429),Q=o(7240),H=o(5852),Y=o(2915),V=o(6814),n=o(2660),q=o(7680);function t(P,h){1&P&&(a.TgZ(0,"span"),a._UZ(1,"i",19),a._uU(2," Add Database"),a.qZA())}function L(P,h){1&P&&(a.TgZ(0,"span"),a._UZ(1,"i",20),a._uU(2," View Database"),a.qZA())}function X(P,h){1&P&&(a.TgZ(0,"span"),a._UZ(1,"i",21),a._uU(2," Edit Database"),a.qZA())}function k(P,h){1&P&&(a.TgZ(0,"span"),a._uU(1,"Save Database"),a.qZA())}function j(P,h){1&P&&(a.TgZ(0,"span"),a._uU(1,"Update Database"),a.qZA())}function z(P,h){if(1&P){const v=a.EpF();a.TgZ(0,"button",22),a.NdJ("click",function(){a.CHM(v);const x=a.oxw();return a.KtG(x.save())}),a._UZ(1,"i",23),a.YNc(2,k,2,0,"span",4),a.YNc(3,j,2,0,"span",4),a.qZA()}if(2&P){const v=a.oxw();a.Q6J("disabled",v.form.invalid),a.xp6(2),a.Q6J("ngIf",v.data.mode===v.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",v.data.mode===v.EFormMode.EDIT)}}function U(P,h){1&P&&a._UZ(0,"p-progressSpinner",24)}let F=(()=>{class P{fb;ns;instanceS;generalS;authCS;eventCenter;data;loading={form:!1};EFormMode=e.D;form;subscriptions=[];constructor(v,u,x,M,J,K){this.fb=v,this.ns=u,this.instanceS=x,this.generalS=M,this.authCS=J,this.eventCenter=K}ngOnInit(){var v=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var u=(0,b.Z)(function*(x){x&&(v.form.enable(),x.action===w.F.OPEN_FORM_IN_EDIT_MODE?(v.form.reset(),v.form.patchValue({name:v.data.formData.db})):x.action===w.F.OPEN_FORM_IN_VIEW_MODE?(v.form.reset(),v.form.patchValue({name:v.data.formData.db}),v.form.disable()):x.action===w.F.OPEN_FORM_IN_ADD_MODE&&v.form.reset())});return function(x){return u.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[T.kI.required]]})}showModal(){$("#idDatabasesForm").modal("show")}hideModal(){$("#idDatabasesForm").modal("hide")}save(){var v=this;return(0,b.Z)(function*(){const u=v.form.getRawValue();try{v.loading.form=!0;const x=v.eventCenter.instance.selectedInstances.value[0];let M;v.data.mode===e.D.ADD&&(M=yield v.instanceS.createDatabase(x,u).toPromise()),v.ns.showSuccess(`Database ${v.data.mode===e.D.ADD?"created":"renamed"} successfully.`),v.data.eventChannel.emit({action:v.data.mode===e.D.ADD?w.F.SAVED:w.F.UPDATED}),v.loading.form=!1}catch(x){v.loading.form=!1,v.ns.showErrorFromResponse(x.error||x,"Unable to save database.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(u){return new(u||P)(a.Y36(T.qu),a.Y36(y.W),a.Y36(B.E),a.Y36(Q.b),a.Y36(H.D),a.Y36(Y.u))};static \u0275cmp=a.Xpm({type:P,selectors:[["app-w-databases-form"]],inputs:{data:"data"},decls:23,vars:6,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDatabasesForm","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"],["maxlength","50","formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide database name",1,"form-control","form-control-sm"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(u,x){1&u&&(a.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),a.YNc(4,t,3,0,"span",4),a.YNc(5,L,3,0,"span",4),a.YNc(6,X,3,0,"span",4),a.TgZ(7,"button",5)(8,"span",6),a._UZ(9,"i",7),a.qZA()()(),a.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),a._uU(14,"Name"),a.qZA(),a.TgZ(15,"div",12),a._UZ(16,"input",13),a.qZA()()()(),a.TgZ(17,"div",14)(18,"button",15),a._UZ(19,"i",16),a._uU(20," Close"),a.qZA(),a.YNc(21,z,4,3,"button",17),a.qZA(),a.YNc(22,U,1,0,"p-progressSpinner",18),a.qZA()()()),2&u&&(a.xp6(4),a.Q6J("ngIf",x.data.mode===x.EFormMode.ADD),a.xp6(1),a.Q6J("ngIf",x.data.mode===x.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",x.data.mode===x.EFormMode.EDIT),a.xp6(5),a.Q6J("formGroup",x.form),a.xp6(10),a.Q6J("ngIf",x.data.mode!==x.EFormMode.VIEW),a.xp6(1),a.Q6J("ngIf",x.loading.form))},dependencies:[T._Y,T.Fj,T.JJ,T.JL,T.nD,T.sg,T.u,V.O5,n.y,q.G],encapsulation:2})}return P})()},559:(fe,W,o)=>{o.d(W,{O:()=>Ae});var b=o(5861),e=o(4946),T=o(3157),w=o(328),a=o(6212),y=o(6990),Q=o(3620),H=o(7848),Y=o(1162),V=o(3429),n=o(7240),q=o(9961),t=o(5219),L=o(2189),X=o(7414),k=o(2915),j=o(95),z=o(6814),U=o(5431),F=o(7680),P=o(3259),h=o(8057),v=o(5597),u=o(2571);const x=["databasesFormC"],M=["bulkSchemaGeneratorC"];function J(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",15),e.NdJ("click",function(){e.CHM(c);const d=e.oxw(2);return e.KtG(d.add())}),e._UZ(1,"i",16),e.qZA()}}function K(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(c);const d=e.oxw(2);return e.KtG(d.bulkSchemaCreation())}),e._UZ(1,"img",18),e.qZA()}}function te(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(c);const d=e.oxw(2);return e.KtG(d.removePermanentDialog())}),e._UZ(1,"i",20),e.qZA()}}function ne(C,R){if(1&C&&(e.TgZ(0,"span")(1,"a",10),e._UZ(2,"img",11),e.qZA(),e.YNc(3,J,2,0,"span",12),e.YNc(4,K,2,0,"span",13),e.YNc(5,te,2,0,"span",14),e.qZA()),2&C){const c=e.oxw();e.xp6(3),e.Q6J("ngIf",c.eventCenterS.instance.selectedInstances.value.length>0&&c.instanceType===c.EInstanceType.MONGO_DB),e.xp6(1),e.Q6J("ngIf",c.selectedRows.length),e.xp6(1),e.Q6J("ngIf",c.selectedRows.length)}}function ae(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"span",21)(1,"label",22)(2,"p-checkbox",23),e.NdJ("ngModelChange",function(d){e.CHM(c);const I=e.oxw();return e.KtG(I.eventCenterS.group.apisRegex.allDatabases=d)}),e.qZA()()()}if(2&C){const c=e.oxw();e.xp6(2),e.Q6J("ngModel",c.eventCenterS.group.apisRegex.allDatabases)("binary",!0)}}function le(C,R){if(1&C&&(e.TgZ(0,"div")(1,"div",24),e._uU(2),e.qZA()()),2&C){const c=e.oxw();e.xp6(2),e.Oqu(c.constantsS.group.allDatabasesPermitted)}}function re(C,R){1&C&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ce(C,R){1&C&&(e.TgZ(0,"th",35),e._uU(1,"Pre"),e.qZA())}function ge(C,R){1&C&&(e.TgZ(0,"th",35),e._uU(1,"Post"),e.qZA())}function de(C,R){1&C&&(e.TgZ(0,"th"),e._uU(1,"Size"),e.qZA())}function ue(C,R){1&C&&e._UZ(0,"th",36)}function _e(C,R){1&C&&e._UZ(0,"th",37)}function he(C,R){if(1&C&&(e.TgZ(0,"tr"),e.YNc(1,re,2,0,"th",30),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA(),e.YNc(4,ce,2,0,"th",31),e.YNc(5,ge,2,0,"th",31),e.YNc(6,de,2,0,"th",3),e.YNc(7,ue,1,0,"th",32),e.YNc(8,_e,1,0,"th",33),e.qZA()),2&C){const c=e.oxw(2);e.xp6(1),e.Q6J("ngIf",c.showCheckbox),e.xp6(3),e.Q6J("ngIf",c.showHooksCount),e.xp6(1),e.Q6J("ngIf",c.showHooksCount),e.xp6(1),e.Q6J("ngIf",!c.isDependentOnGroup&&!c.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!c.isDependentOnGroup&&!c.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",c.isDependentOnGroup||c.isFilterLogTable)}}function pe(C,R){if(1&C&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",43),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Q6J("value",c)("pSelectableRow",c)}}function me(C,R){if(1&C&&(e.TgZ(0,"span",44),e._UZ(1,"i",45),e.qZA()),2&C){const c=e.oxw().$implicit;e.Q6J("pTooltip","Original name is : "+c.originalDBNameBeforeMask)}}function Ce(C,R){if(1&C&&(e.TgZ(0,"td",46),e._uU(1),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Oqu(c.preHookCount||"")}}function ve(C,R){if(1&C&&(e.TgZ(0,"td",46),e._uU(1),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Oqu(c.postHookCount||"")}}function Se(C,R){if(1&C&&(e.TgZ(0,"td",47),e._uU(1),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Oqu(c.sizeUser)}}function De(C,R){1&C&&e._UZ(0,"i",49)}function be(C,R){if(1&C&&(e.TgZ(0,"td"),e.YNc(1,De,1,0,"i",48),e.qZA()),2&C){const c=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",c.databaseSettingIsCreated)}}function xe(C,R){if(1&C&&(e.TgZ(0,"td")(1,"span",50),e._uU(2),e.qZA()()),2&C){const c=e.oxw().$implicit;e.xp6(2),e.Oqu(c.instanceName.toString().substring(0,3).toUpperCase())}}function Ie(C,R){if(1&C&&(e.TgZ(0,"tr",38),e.YNc(1,pe,2,2,"td",3),e.TgZ(2,"td",39)(3,"span"),e._uU(4),e.qZA(),e.YNc(5,me,2,1,"span",40),e.qZA(),e.YNc(6,Ce,2,1,"td",41),e.YNc(7,ve,2,1,"td",41),e.YNc(8,Se,2,1,"td",42),e.YNc(9,be,2,1,"td",3),e.YNc(10,xe,3,1,"td",3),e.qZA()),2&C){const c=R.$implicit,S=e.oxw(2);e.Q6J("pSelectableRow",c),e.xp6(1),e.Q6J("ngIf",S.showCheckbox),e.xp6(3),e.Oqu(c.db),e.xp6(1),e.Q6J("ngIf",c.isMaskedName),e.xp6(1),e.Q6J("ngIf",S.showHooksCount),e.xp6(1),e.Q6J("ngIf",S.showHooksCount),e.xp6(1),e.Q6J("ngIf",!S.isDependentOnGroup&&!S.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",!S.isDependentOnGroup&&!S.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",S.isDependentOnGroup||S.isFilterLogTable)}}function Te(C,R){1&C&&e._UZ(0,"p-progressSpinner",51)}function Ee(C,R){if(1&C){const c=e.EpF();e.TgZ(0,"div",25)(1,"p-table",26),e.NdJ("selectionChange",function(d){e.CHM(c);const I=e.oxw();return e.KtG(I.selectedRows=d)})("selectionChange",function(){e.CHM(c);const d=e.oxw();return e.KtG(d.databaseSelected())}),e.YNc(2,he,9,6,"ng-template",27),e.YNc(3,Ie,11,9,"ng-template",28),e.qZA(),e.YNc(4,Te,1,0,"p-progressSpinner",29),e.qZA()}if(2&C){const c=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",c.metaKeySelection)("selection",c.selectedRows)("dataKey",c.gridKey)("scrollable",!0)("value",c.rows),e.xp6(3),e.Q6J("ngIf",c.loading.grid)}}let Ae=(()=>{class C{instanceS;generalS;notificationS;confirmationService;navigationCS;constantsS;cd;eventCenterS;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};instanceType;EInstanceType=H.d;selectedRows=[];gridKey=Y.iH._id;databasesFormC;bulkSchemaGeneratorC;constructor(c,S,d,I,i,m,g,O){this.instanceS=c,this.generalS=S,this.notificationS=d,this.confirmationService=I,this.navigationCS=i,this.constantsS=m,this.cd=g,this.eventCenterS=O}ngOnInit(){var c=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var S=(0,b.Z)(function*(d){(d.action===T.F.SAVED||d.action===T.F.UPDATED)&&(c.databasesFormC.hideModal(),yield c.loadGridData())});return function(d){return S.apply(this,arguments)}}())),this.eventCenterS.database.selectedDatabases.next([]),this.subscriptions.push(this.isFilterLogTable?this.eventCenterS.filterInLog.instanceIds.pipe((0,Q.b)(300)).subscribe(function(){var S=(0,b.Z)(function*(d){yield c.loadGridData()});return function(d){return S.apply(this,arguments)}}()):this.isDependentOnGroup?this.eventCenterS.group.instanceIds.pipe((0,Q.b)(300)).subscribe(function(){var S=(0,b.Z)(function*(d){yield c.loadGridData()});return function(d){return S.apply(this,arguments)}}()):this.eventCenterS.instance.selectedInstances.pipe((0,Q.b)(300)).subscribe(function(){var S=(0,b.Z)(function*(d){const I=d[0];c.instanceType=I?I.type:void 0,yield c.resetGridAndUrl(),yield c.loadGridData()});return function(d){return S.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.schemaSaved.subscribe(function(){var S=(0,b.Z)(function*(d){d&&(yield c.loadGridData())});return function(d){return S.apply(this,arguments)}}()))}loadGridData(){var c=this;return(0,b.Z)(function*(){let S=[];if(c.isDependentOnGroup){if(S=c.eventCenterS.group.instanceIds.value,!S.length)return void c.resetGridAndUrl()}else if(c.isFilterLogTable){if(S=c.eventCenterS.filterInLog.instanceIds.value,!S.length)return void c.resetGridAndUrl()}else if(S=c.eventCenterS.instance.selectedInstances.value,!S||0===S.length||!S[0].active)return void c.resetGridAndUrl();c.loading.grid=!0,c.subscriptions.push(c.instanceS.getDatabases(S).subscribe(function(){var d=(0,b.Z)(function*(I){if(I.success){c.selectedRows=[],c.rows=y.flatten(I.data||[]);for(const i of c.rows)i.sizeUser="number"==typeof i.storageSize?c.generalS.bytesToSize(i.storageSize):i.storageSize;c.rowsMap=y.keyBy(c.rows,Y.iH._id)}else c.resetGridAndUrl();if(c.showHooksCount&&(yield c.instanceS.setHooksCountInDatabaseArr(S[0].name,c.rows)),c.isDependentOnGroup||c.isFilterLogTable){let g;c.isDependentOnGroup?g=c.eventCenterS.group.databaseNames.value:c.isFilterLogTable&&(g=c.eventCenterS.filterInLog.databaseIds.value);const O=y.intersection(y.keys(c.rowsMap),g),p=[];for(const E of O)c.rowsMap[E]&&p.push(c.rowsMap[E]);c.selectedRows=p,c.eventCenterS.database.selectedDatabases.next(p),c.setDatabaseIds(p)}else{const i=c.navigationCS.getQueryParam(a.p.database);if(i){const m=i.split(","),g=y.intersection(y.keys(c.rowsMap),m),O=[];for(const p of g)c.rowsMap[p]&&O.push(c.rowsMap[p]);c.selectedRows=O,c.eventCenterS.database.selectedDatabases.next(O),c.setDatabaseIds(O)}}c.loading.grid=!1,c.cd.detectChanges()});return function(I){return d.apply(this,arguments)}}(),d=>{c.loading.grid=!1,c.notificationS.showErrorMessageFromErrorObject(d),c.resetGridAndUrl()}))})()}resetGridAndUrl(){var c=this;return(0,b.Z)(function*(){c.rows=[],c.selectedRows=[],c.rowsMap={},c.eventCenterS.database.selectedDatabases.next([]),c.eventCenterS.group.databaseNames.next([])})()}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),this.databasesFormC.showModal()}bulkSchemaCreation(){var c=this;return(0,b.Z)(function*(){c.data.formData=void 0,c.data.mode=w.D.ADD,c.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_ADD_MODE}),yield c.bulkSchemaGeneratorC.showSchemaModal()})()}view(){this.data.formData=this.selectedRows[0],this.data.mode=w.D.VIEW,this.data.eventChannel.emit({action:T.F.OPEN_FORM_IN_VIEW_MODE}),this.databasesFormC.showModal()}removePermanentDialog(){var c=this;return(0,b.Z)(function*(){let S=c.constantsS.database.removePermanentConfirm;var d;S=S.replace("'$$'",c.selectedRows[0].db),c.confirmationService.confirm({message:S,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,b.Z)(function*(){yield c.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var c=this;return(0,b.Z)(function*(){const S=c.eventCenterS.instance.selectedInstances.value[0],d=c.selectedRows[0].db;c.loading.grid=!0;try{const I=yield c.instanceS.dropDatabase(S,d).toPromise();c.loading.grid=!1,I.success?(c.notificationS.showSuccess(c.constantsS.database.removePermanent),c.selectedRows.length=0,c.loadGridData()):c.notificationS.showErrorFromResponse(I,c.constantsS.database.removePermanentError)}catch(I){c.notificationS.showErrorMessageFromErrorObject(I),c.loading.grid=!1}})()}databaseSelected(){var c=this;return(0,b.Z)(function*(){c.eventCenterS.database.selectedDatabases.next(c.selectedRows),c.isDependentOnGroup||c.isFilterLogTable?c.setDatabaseIds(c.selectedRows):(yield c.navigationCS.setQueryParam(a.p.database,y.map(c.selectedRows,"_id").join(",")||null),yield c.generalS.resetUrlParams([a.p.collection,a.p.collection_api]))})()}setDatabaseIds(c){const S=y.map(c=c||[],"_id");this.eventCenterS.group.databaseNames.next(S),this.eventCenterS.filterInLog.databaseIds.next(S),this.eventCenterS.filterInLog.databaseNames.next(y.map(c,"db"))}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(S){return new(S||C)(e.Y36(V.E),e.Y36(n.b),e.Y36(q.W),e.Y36(t.YP),e.Y36(L.S),e.Y36(X.L),e.Y36(e.sBO),e.Y36(k.u))};static \u0275cmp=e.Xpm({type:C,selectors:[["app-w-databases"]],viewQuery:function(S,d){if(1&S&&(e.Gf(x,5),e.Gf(M,5)),2&S){let I;e.iGM(I=e.CRH())&&(d.databasesFormC=I.first),e.iGM(I=e.CRH())&&(d.bulkSchemaGeneratorC=I.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:14,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-database","text-warning","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Databases",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["databasesFormC",""],["bulkSchemaGeneratorC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html#databases","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Add New Database",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Bulk Schema Creation",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Add New Database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Bulk Schema Creation",1,"float-right","cursor-pointer","ml-3",3,"click"],["src","/assets/images/icons/bulkschema.svg",2,"width","18px","margin-left","1px","margin-bottom","3px"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["pTooltip","All Databases",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped database-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["class","text-center","style","width: 40px;",4,"ngIf"],["style","width: 42px;",4,"ngIf"],["style","width: 50px;",4,"ngIf"],[2,"width","45px"],[1,"text-center",2,"width","40px"],[2,"width","42px"],[2,"width","50px"],[3,"pSelectableRow"],[1,"word-break-all"],["class","pl-2",3,"pTooltip",4,"ngIf"],["class","text-center",4,"ngIf"],["class","nowrap",4,"ngIf"],[3,"value","pSelectableRow"],[1,"pl-2",3,"pTooltip"],[1,"fas","fa-theater-masks","fa-fw","text-info"],[1,"text-center"],[1,"nowrap"],["pTooltip","Database settings are there.","class","fas fa-cog text-danger fa-fw cursor-pointer",4,"ngIf"],["pTooltip","Database settings are there.",1,"fas","fa-cog","text-danger","fa-fw","cursor-pointer"],[1,"text-monospace","small"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(S,d){1&S&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Databases"),e.qZA(),e.YNc(5,ne,6,3,"span",3),e.YNc(6,ae,3,2,"span",4),e.qZA(),e.TgZ(7,"div",5),e.YNc(8,le,3,1,"div",3),e.YNc(9,Ee,5,7,"div",6),e.qZA()(),e._UZ(10,"app-w-databases-form",7,8)(12,"app-w-bulk-schema-generator",null,9)),2&S&&(e.xp6(5),e.Q6J("ngIf",!d.isReadOnly),e.xp6(1),e.Q6J("ngIf",d.isDependentOnGroup),e.xp6(2),e.Q6J("ngIf",d.eventCenterS.group.apisRegex.allInstances||d.eventCenterS.filterInLog.apisRegex.allInstances||d.eventCenterS.group.apisRegex.allDatabases),e.xp6(1),e.Q6J("ngIf",!(d.eventCenterS.group.apisRegex.allInstances||d.eventCenterS.filterInLog.apisRegex.allInstances||d.eventCenterS.group.apisRegex.allDatabases)),e.xp6(1),e.Q6J("data",d.data))},dependencies:[j.JJ,j.On,z.O5,U.iA,t.jx,U.Ei,U.UA,U.Mo,F.G,P.u,h.XZ,v.H,u.d]})}return C})()},4211:(fe,W,o)=>{o.r(W),o.d(W,{DbCellM:()=>lt});var b=o(7664),e=o(7017),T=o(3726),w=o(1678),a=o(9184),y=o(559),Q=(o(5597),o(6937)),Y=(o(241),o(740)),V=o(6162),n=o(2452),q=o(553),t=o(4946),L=o(2915),X=o(5860),k=o(5219),j=o(5043),z=o(3885),U=o(5861),F=o(3620),P=o(7672),h=o(9361),v=o(1162),u=o(5085),x=o(9394),M=o(1601),J=o(3531),K=o(9989),te=o(8883),ne=o(5561),ae=o(9961),le=o(3429),re=o(5852),ce=o(7414),ge=o(2304),de=o(7240),ue=o(5394),_e=o(6814),he=o(756),pe=o(7680),me=o(3259),Ce=o(5025);const ve=["monacoEditorModalC"];function Se(_,Z){1&_&&(t.TgZ(0,"a",14),t._UZ(1,"img",15),t.qZA())}function De(_,Z){1&_&&(t.TgZ(0,"a",16),t._UZ(1,"img",15),t.qZA())}function be(_,Z){1&_&&(t.TgZ(0,"a",17),t._UZ(1,"img",15),t.qZA())}function xe(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"span",18),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.save())}),t._UZ(1,"i",19),t.qZA()}}function Ie(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"span",20),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.removePermanentDialog(f.mode))}),t._UZ(1,"i",21),t.qZA()}}function Te(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"span",22),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.showInsertCodeModel())}),t._UZ(1,"i",23),t.qZA()}}function Ee(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"a",24),t.NdJ("click",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.viewError())}),t._uU(1,"View error"),t.qZA()}}function Ae(_,Z){1&_&&(t.TgZ(0,"span"),t._uU(1,"Add API Settings"),t.qZA())}function C(_,Z){1&_&&(t.TgZ(0,"span"),t._uU(1,"Add Collection Settings"),t.qZA())}function R(_,Z){1&_&&(t.TgZ(0,"span"),t._uU(1,"Add Database Settings"),t.qZA())}function c(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"div",30)(1,"button",31),t.NdJ("click",function(){t.CHM(s);const f=t.oxw(2);return t.KtG(f.save())}),t._UZ(2,"i",32),t.YNc(3,Ae,2,0,"span",33),t.YNc(4,C,2,0,"span",33),t.YNc(5,R,2,0,"span",33),t.qZA()()}if(2&_){const s=t.oxw(2);t.xp6(3),t.Q6J("ngIf",s.mode===s.EInstanceApiWidgetMode.API),t.xp6(1),t.Q6J("ngIf",s.mode===s.EInstanceApiWidgetMode.Collection),t.xp6(1),t.Q6J("ngIf",s.mode===s.EInstanceApiWidgetMode.Database)}}function S(_,Z){1&_&&t._UZ(0,"p-progressSpinner",34)}function d(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"div",25),t.YNc(1,c,6,3,"div",26),t.TgZ(2,"div",27)(3,"app-monaco-editor",28),t.NdJ("editorGenerated",function(f){t.CHM(s);const N=t.oxw();return t.KtG(N.editorGenerated(f))}),t.qZA()(),t.YNc(4,S,1,0,"p-progressSpinner",29),t.qZA()}if(2&_){const s=t.oxw();t.xp6(1),t.Q6J("ngIf",!s.insApiSetting._id),t.xp6(1),t.Q6J("hidden",!s.insApiSetting._id),t.xp6(1),t.Q6J("hidden",!s.insApiSetting._id)("isSchemaEditor",!0)("editorOptions",s.editorOptionsInsApiSettingApi),t.xp6(1),t.Q6J("ngIf",s.loading.form)}}let I=(()=>{class _{groupS;navigationS;ns;instanceS;authCS;eventCenterS;constantsS;monacoS;generalCS;instanceApiSettingsS;confirmationService;cd;mode=n.a.API;insertCodeModalC;loading={form:!1};subscriptions=[];data={};EInstanceApiWidgetMode=n.a;EAPIAccessType=P.di;editorInsApiSettingApiCode;editorOptionsInsApiSettingApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insApiSetting={};BE_HOST_PORT=q.N.BE_HOST_PORT;monacoDecorations=[];tab;modalId;viewDockerfileModelC;constructor(s,r,f,N,Ze,Oe,ye,rt,ct,dt,_t,pt){this.groupS=s,this.navigationS=r,this.ns=f,this.instanceS=N,this.authCS=Ze,this.eventCenterS=Oe,this.constantsS=ye,this.monacoS=rt,this.generalCS=ct,this.instanceApiSettingsS=dt,this.confirmationService=_t,this.cd=pt}ngOnInit(){var s=this;this.mode===n.a.API?(this.subscriptions.push(this.eventCenterS.colApi.selectedApi.pipe((0,F.b)(300)).subscribe(function(){var r=(0,U.Z)(function*(f){if(!f)return s.data.selectedItem=void 0;s.data.selectedItem=f,yield s.setDataInForm(s.data.selectedItem),s.cd.detectChanges()});return function(f){return r.apply(this,arguments)}}())),this.modalId="idMonacoEditorModalInInsApiSettings"):this.mode===n.a.Collection?(this.subscriptions.push(this.eventCenterS.collection.selectedCollections.pipe((0,F.b)(300)).subscribe(function(){var r=(0,U.Z)(function*(f){if(!f||0===f.length)return s.data.selectedItem=void 0;s.data.selectedItem=f[0],s.lastError=void 0,yield s.setDataInForm(s.data.selectedItem),s.cd.detectChanges()});return function(f){return r.apply(this,arguments)}}())),this.modalId="idMonacoEditorModalInColSettings"):this.mode===n.a.Database&&(this.subscriptions.push(this.eventCenterS.database.selectedDatabases.pipe((0,F.b)(300)).subscribe(function(){var r=(0,U.Z)(function*(f){if(!f||0===f.length)return s.data.selectedItem=void 0;s.data.selectedItem=f[0],s.lastError=void 0,yield s.setDataInForm(s.data.selectedItem),s.cd.detectChanges()});return function(f){return r.apply(this,arguments)}}())),this.modalId="idMonacoEditorModalInDatabaseSettings")}setDataInForm(s){var r=this;return(0,U.Z)(function*(){r.loading.form=!0,r.lastError=void 0,r.insApiSetting=(yield r.instanceApiSettingsS.getSettings(s,r.mode))||{},(r.mode===n.a.API||r.mode===n.a.Collection||r.mode===n.a.Database)&&r.setDataInFormCommon(),r.loading.form=!1})()}setDataInFormCommon(){var s=this;return(0,U.Z)(function*(){if(s.insApiSetting._id)s.generalCS.setValueInEditor(s,"editorInsApiSettingApiCode",s.insApiSetting.instanceApiSettingCode);else if(!s.insApiSetting._id)if(s.mode===n.a.API){const r=yield s.instanceS.getDefaultContent(s.BE_HOST_PORT,u.R.INSTANCE_API_SETTINGS_JSON).toPromise();s.generalCS.setValueInEditor(s,"editorInsApiSettingApiCode",r.data)}else if(s.mode===n.a.Collection||s.mode===n.a.Database){let r;s.mode===n.a.Database?r=yield s.instanceS.getDefaultContent(s.BE_HOST_PORT,u.R.DATABASE_SETTINGS_JSON).toPromise():s.mode===n.a.Collection&&(r=yield s.instanceS.getDefaultContent(s.BE_HOST_PORT,u.R.COLLECTION_SETTINGS_JSON).toPromise()),s.generalCS.setValueInEditor(s,"editorInsApiSettingApiCode",r.data)}s.cd.detectChanges()})()}editorGenerated(s){var r=this;return(0,U.Z)(function*(){r.editorInsApiSettingApiCode=s,yield r.monacoS.loadSchemaEditorSettings(r.BE_HOST_PORT,r.authCS.getUserId(),null),r.monacoS.addSaveCodeKeyBinding(s,f=>{r.insApiSetting._id&&r.save()}),r.monacoS.addInsertCodeKeyBinding(s,f=>{r.defineEditor(),r.insertCodeModalC.showModal(J.b.InstanceApiSettingsC)}),r.subscriptions.push(r.generalCS.messageReceived.subscribe(f=>{f.type&&f.type===K.g.TEXT_COPIED&&f.componentName===J.b.InstanceApiSettingsC&&(r.generalCS.messageReceivedFor===h.H.DatabaseSettings&&r.mode===n.a.Database||r.generalCS.messageReceivedFor===h.H.CollectionSettings&&r.mode===n.a.Collection||r.generalCS.messageReceivedFor===h.H.APISettings&&r.mode===n.a.API)&&(r.monacoS.insertAtCursor(s,f.selectedText),r.insertCodeModalC.hideModal())}))})()}defineEditor(){this.mode===n.a.Database?this.generalCS.messageReceivedFor=h.H.DatabaseSettings:this.mode===n.a.Collection?this.generalCS.messageReceivedFor=h.H.CollectionSettings:this.mode===n.a.API&&(this.generalCS.messageReceivedFor=h.H.APISettings)}showInsertCodeModel(){this.defineEditor(),this.insertCodeModalC.showModal(J.b.InstanceApiSettingsC)}save(){var s=this;return(0,U.Z)(function*(){let f,r={};if(s.data.selectedItem){if(s.mode===n.a.API||s.mode===n.a.Collection?f=s.data.selectedItem.databaseName:s.mode===n.a.Database&&(f=s.data.selectedItem.db),r.instanceName=s.data.selectedItem.instanceName,r.databaseName=f,s.mode===n.a.API){const N=s.data.selectedItem;r.collectionName=N.collectionName,r.apiId=N.id,r.instanceApiSettingCode=s.editorInsApiSettingApiCode.getValue()}else s.mode===n.a.Collection?(r.collectionName=s.data.selectedItem.name,r.apiId=x.pj.__COLLECTION_SETTINGS__,r.instanceApiSettingCode=s.editorInsApiSettingApiCode.getValue()):s.mode===n.a.Database&&(r.collectionName=x.pj.__DATABASE_SETTINGS__,r.apiId=x.pj.__DATABASE_SETTINGS__,r.instanceApiSettingCode=s.editorInsApiSettingApiCode.getValue());r.user=s.authCS.getUserId(),r=Object.assign({},s.insApiSetting||{},r);try{let N;s.loading.form=!0,s.lastError=void 0,s.monacoS.clearEditorDecorations(s.editorInsApiSettingApiCode,s.monacoDecorations),s.insApiSetting._id?s.insApiSetting._id&&(N=yield s.instanceApiSettingsS.replace(s.insApiSetting._id,r,{select:v.iH._id}).toPromise()):(N=yield s.instanceApiSettingsS.post(r).toPromise(),s.insApiSetting=N.data),s.ns.showSuccess(s.constantsS.tpApiSettings.addOrUpdateSuccess);const Oe=s.eventCenterS.database.selectedDatabases.value[0],ye=s.eventCenterS.instance.selectedInstances.value[0];s.mode===n.a.API?s.eventCenterS.collection.selectedCollections.next([s.eventCenterS.collection.selectedCollections.value[0]]):s.mode===n.a.Collection?s.eventCenterS.database.selectedDatabases.next([Oe]):s.mode===n.a.Database&&s.eventCenterS.instance.selectedInstances.next([ye]),s.loading.form=!1}catch(N){s.loading.form=!1,s.ns.showErrorFromResponse(N.error||N,"Unable to save instance."),s.lastError=N.error,s.tab=s.tab||{},s.tab.axiosResponse={data:N.error},s.monacoS.highlightErrorInMonacoEditor(s.editorInsApiSettingApiCode,s.tab,"MainSandbox.ts",s.monacoDecorations)}}})()}confirmMessage="";removePermanentDialog(s){var r=this;return(0,U.Z)(function*(){s===n.a.API?(r.confirmMessage=r.constantsS.instanceApiSettings.removePermanentConfirm,r.removePermanentDialogCommonCode(s)):s===n.a.Collection?(r.confirmMessage=r.constantsS.instanceCollectionSettings.removePermanentConfirm,r.removePermanentDialogCommonCode(s)):s===n.a.Database&&(r.confirmMessage=r.constantsS.instanceDatabaseSettings.removePermanentConfirm,r.removePermanentDialogCommonCode(s))})()}removePermanentDialogCommonCode(s){var f,r=this;this.confirmationService.confirm({message:this.confirmMessage,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(f=(0,U.Z)(function*(){yield r.removePermanent(s)}),function(){return f.apply(this,arguments)})})}removePermanent(s){var r=this;return(0,U.Z)(function*(){r.loading.form=!0;const f=yield r.instanceApiSettingsS.permanentDelete(r.insApiSetting._id).toPromise();r.loading.form=!1,s===n.a.API?f?(r.ns.showSuccess(r.constantsS.instanceApiSettings.removePermanent),r.eventCenterS.collection.selectedCollections.next([r.eventCenterS.collection.selectedCollections.value[0]]),r.resetObj()):r.ns.showErrorFromResponse(f,r.constantsS.instanceApiSettings.removePermanentError):s===n.a.Collection?f?(r.ns.showSuccess(r.constantsS.instanceCollectionSettings.removePermanent),r.eventCenterS.database.selectedDatabases.next([r.eventCenterS.database.selectedDatabases.value[0]]),r.resetObj()):r.ns.showErrorFromResponse(f,r.constantsS.instanceCollectionSettings.removePermanentError):s===n.a.Database&&(f?(r.ns.showSuccess(r.constantsS.instanceDatabaseSettings.removePermanent),r.eventCenterS.instance.selectedInstances.next([r.eventCenterS.instance.selectedInstances.value[0]]),r.resetObj()):r.ns.showErrorFromResponse(f,r.constantsS.instanceDatabaseSettings.removePermanentError))})()}resetObj(){this.insApiSetting={},this.cd.detectChanges()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(r){return new(r||_)(t.Y36(te.e),t.Y36(ne.X),t.Y36(ae.W),t.Y36(le.E),t.Y36(re.D),t.Y36(L.u),t.Y36(ce.L),t.Y36(ge.b),t.Y36(de.b),t.Y36(ue.f),t.Y36(k.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:_,selectors:[["app-w-instance-api-settings"]],viewQuery:function(r,f){if(1&r&&t.Gf(ve,5),2&r){let N;t.iGM(N=t.CRH())&&(f.viewDockerfileModelC=N.first)}},inputs:{mode:"mode",insertCodeModalC:"insertCodeModalC"},decls:16,vars:12,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/apiSettings.html","target","_blank",4,"ngIf"],["href","https://docs.apimaker.dev/v1/docs/settings/collectionSettings.html","target","_blank",4,"ngIf"],["href","https://docs.apimaker.dev/v1/docs/settings/databaseSettings.html","target","_blank",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Insert Code",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",""],["href","https://docs.apimaker.dev/v1/docs/settings/apiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],["href","https://docs.apimaker.dev/v1/docs/settings/collectionSettings.html","target","_blank"],["href","https://docs.apimaker.dev/v1/docs/settings/databaseSettings.html","target","_blank"],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["pTooltip","Insert Code",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(50vh - 68px)",3,"hidden"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[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"],[4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,f){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4),t.qZA(),t.YNc(5,Se,2,0,"a",3),t.YNc(6,De,2,0,"a",4),t.YNc(7,be,2,0,"a",5),t.YNc(8,xe,2,0,"span",6),t.YNc(9,Ie,2,0,"span",7),t.YNc(10,Te,2,0,"span",8),t.YNc(11,Ee,2,0,"a",9),t.qZA(),t.TgZ(12,"div",10),t.YNc(13,d,5,6,"div",11),t.qZA()(),t._UZ(14,"app-monaco-editor-modal",12,13)),2&r&&(t.xp6(4),t.hij(" ",f.mode," Settings"),t.xp6(1),t.Q6J("ngIf",f.mode===f.EInstanceApiWidgetMode.API),t.xp6(1),t.Q6J("ngIf",f.mode===f.EInstanceApiWidgetMode.Collection),t.xp6(1),t.Q6J("ngIf",f.mode===f.EInstanceApiWidgetMode.Database),t.xp6(1),t.Q6J("ngIf",f.data.selectedItem),t.xp6(1),t.Q6J("ngIf",f.data.selectedItem&&f.insApiSetting._id),t.xp6(1),t.Q6J("ngIf",f.data.selectedItem&&f.insApiSetting._id),t.xp6(1),t.Q6J("ngIf",f.lastError&&f.data.selectedItem),t.xp6(2),t.Q6J("ngIf",f.data.selectedItem),t.xp6(1),t.Q6J("modalId",f.modalId)("editorOptionsMonacoEditorModal",f.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[_e.O5,he.O,pe.G,me.u,Ce.A]})}return _})();var i=o(328),m=o(6212),g=o(6990),O=o(921),p=o(2189),E=o(5431);function l(_,Z){if(1&_&&(t.TgZ(0,"div")(1,"div",8),t._uU(2),t.qZA()()),2&_){const s=t.oxw();t.xp6(2),t.Oqu(s.constantsS.group.allCollectionsPermitted)}}function D(_,Z){1&_&&(t.TgZ(0,"th",19),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function A(_,Z){if(1&_&&(t.TgZ(0,"tr"),t.YNc(1,D,2,0,"th",14),t.TgZ(2,"th",15),t._uU(3,"Category"),t.qZA(),t.TgZ(4,"th"),t._uU(5,"Name"),t.qZA(),t.TgZ(6,"th",16),t._uU(7,"Pre"),t.qZA(),t.TgZ(8,"th",16),t._uU(9,"Post"),t.qZA(),t.TgZ(10,"th"),t._uU(11,"Authorization"),t.qZA(),t._UZ(12,"th",17)(13,"th",18),t.qZA()),2&_){const s=t.oxw(2);t.xp6(1),t.Q6J("ngIf",s.showCheckbox)}}function G(_,Z){if(1&_&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",31),t.qZA()),2&_){const s=t.oxw().$implicit;t.xp6(1),t.Q6J("value",s)("pSelectableRow",s)}}function ee(_,Z){if(1&_&&(t.TgZ(0,"td",28),t._uU(1),t.qZA()),2&_){const s=t.oxw().$implicit;t.xp6(1),t.Oqu(s.preHookCount||"")}}function se(_,Z){if(1&_&&(t.TgZ(0,"td",28),t._uU(1),t.qZA()),2&_){const s=t.oxw().$implicit;t.xp6(1),t.Oqu(s.postHookCount||"")}}function oe(_,Z){1&_&&(t.TgZ(0,"span",32),t._uU(1,"AM-User"),t.qZA())}function ie(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"No-Access"),t.qZA())}function Pe(_,Z){1&_&&(t.TgZ(0,"span",34),t._uU(1,"Public"),t.qZA())}function Ne(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"DB-User"),t.qZA())}function Re(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"AWS"),t.qZA())}function Ye(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"Azure"),t.qZA())}function Je(_,Z){1&_&&(t.TgZ(0,"span",33),t._uU(1,"Google"),t.qZA())}function Ge(_,Z){1&_&&t._UZ(0,"i",35)}const Qe=function(){return["/api-info/api-testing/testing"]},Le=function(_,Z,s,r,f){return{at_category:"INSTANCES",at_instance:_,at_user:Z,at_database:s,at_collection:r,at_api:f}};function Ke(_,Z){if(1&_&&(t.TgZ(0,"tr",20),t.YNc(1,G,2,2,"td",6),t.TgZ(2,"td",21),t._uU(3),t.qZA(),t.TgZ(4,"td"),t._uU(5),t.qZA(),t.YNc(6,ee,2,1,"td",22),t.YNc(7,se,2,1,"td",22),t.TgZ(8,"td",23),t.YNc(9,oe,2,0,"span",24),t.YNc(10,ie,2,0,"span",25),t.YNc(11,Pe,2,0,"span",26),t.YNc(12,Ne,2,0,"span",25),t.YNc(13,Re,2,0,"span",25),t.YNc(14,Ye,2,0,"span",25),t.YNc(15,Je,2,0,"span",25),t.qZA(),t.TgZ(16,"td"),t.YNc(17,Ge,1,0,"i",27),t.qZA(),t.TgZ(18,"td")(19,"div",28)(20,"a",29),t.NdJ("click",function(r){return r.stopPropagation()}),t._UZ(21,"i",30),t.qZA()()()()),2&_){const s=Z.$implicit,r=t.oxw(2);t.Q6J("pSelectableRow",s),t.xp6(1),t.Q6J("ngIf",r.showCheckbox),t.xp6(2),t.Oqu(s.category),t.xp6(2),t.Oqu(s.nameForApiListUI),t.xp6(1),t.Q6J("ngIf",r.showHooksCount),t.xp6(1),t.Q6J("ngIf",r.showHooksCount),t.xp6(2),t.Q6J("ngIf",s.hasAmAuth),t.xp6(1),t.Q6J("ngIf",s.noAccess),t.xp6(1),t.Q6J("ngIf",s.isPublic),t.xp6(1),t.Q6J("ngIf",s.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",s.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",s.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",s.hasGoogleAuth),t.xp6(2),t.Q6J("ngIf",s.instanceApiSettings),t.xp6(3),t.Q6J("routerLink",t.DdM(16,Qe))("queryParams",t.qbA(17,Le,r.eventCenterS.instance.selectedInstances.value[0]._id,r.authCS.getUserId(),r.eventCenterS.database.selectedDatabases.value[0]._id,r.eventCenterS.collection.selectedCollections.value[0]._id,s._id))}}function ke(_,Z){1&_&&t._UZ(0,"p-progressSpinner",36)}function We(_,Z){if(1&_){const s=t.EpF();t.TgZ(0,"div",9)(1,"p-table",10),t.NdJ("selectionChange",function(f){t.CHM(s);const N=t.oxw();return t.KtG(N.selectedRows=f)})("selectionChange",function(){t.CHM(s);const f=t.oxw();return t.KtG(f.apiSelected())}),t.YNc(2,A,14,1,"ng-template",11),t.YNc(3,Ke,22,23,"ng-template",12),t.qZA(),t.YNc(4,ke,1,0,"p-progressSpinner",13),t.qZA()}if(2&_){const s=t.oxw();t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",s.selectedRows)("dataKey",s.gridKey)("scrollable",!0)("value",s.rows),t.xp6(3),t.Q6J("ngIf",s.loading.grid)}}let we=(()=>{class _{instanceS;generalS;navigationCS;authCS;constantsS;eventCenterS;router;showCheckbox=!0;showHooksCount=!1;loading={grid:!1};subscriptions=[];data={mode:i.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=v.iH._id;EUserType=O.d;constructor(s,r,f,N,Ze,Oe,ye){this.instanceS=s,this.generalS=r,this.navigationCS=f,this.authCS=N,this.constantsS=Ze,this.eventCenterS=Oe,this.router=ye}ngOnInit(){var s=this;this.subscriptions.push(this.eventCenterS.collection.selectedCollections.subscribe(function(){var r=(0,U.Z)(function*(f){if(!f[0])return s.resetGridAndUrl();yield s.loadGridData(f[0])});return function(f){return r.apply(this,arguments)}}()))}loadGridData(s){var r=this;return(0,U.Z)(function*(){r.loading.grid=!0;try{yield r.resetGridAndUrl(),r.selectedRows=[],r.rows=(yield r.instanceS.instanceAPIList([s])).data||[],r.rowsMap=g.keyBy(r.rows,v.iH._id),r.showHooksCount&&(yield r.instanceS.setHooksCountInCollectionApisArr(s.instanceName,s.databaseName,s.name,r.rows));const f=r.navigationCS.getQueryParam(m.p.collection_api),N=r.rowsMap[f];N&&(r.selectedRows=[N],r.eventCenterS.colApi.selectedApi.next(N)),r.loading.grid=!1}catch(f){console.log(f),r.loading.grid=!1}})()}resetDependents(){var s=this;return(0,U.Z)(function*(){s.eventCenterS.colApi.selectedApi.next(void 0),yield s.navigationCS.setQueryParam(m.p.collection_api,null)})()}apiSelected(){var s=this;return(0,U.Z)(function*(){yield s.resetDependents(),yield s.fillData()})()}resetGridAndUrl(){var s=this;return(0,U.Z)(function*(){s.rows=[],s.selectedRows=[],s.rowsMap={},s.eventCenterS.colApi.selectedApi.next(void 0)})()}fillData(){var s=this;return(0,U.Z)(function*(){if(!s.selectedRows.length)return yield s.navigationCS.setQueryParam(m.p.collection_api,null),void s.eventCenterS.colApi.selectedApi.next(null);const r=s.selectedRows[0];r&&(s.eventCenterS.colApi.selectedApi.next(r),yield s.navigationCS.setQueryParam(m.p.collection_api,r._id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(r){return new(r||_)(t.Y36(le.E),t.Y36(de.b),t.Y36(p.S),t.Y36(re.D),t.Y36(ce.L),t.Y36(L.u),t.Y36(b.F0))};static \u0275cmp=t.Xpm({type:_,selectors:[["app-col-api-w"]],inputs:{showCheckbox:"showCheckbox",showHooksCount:"showHooksCount"},decls:10,vars:2,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-code","text-info","fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html#apis","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped","scrollHeight","calc(50vh - 66px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],[1,"pl-0","text-right",2,"width","85px"],[2,"width","40px"],[2,"width","42px"],[2,"width","58px"],[2,"width","45px"],[3,"pSelectableRow"],[1,"text-monospaced","small","pl-0","text-right","text-muted"],["class","text-center",4,"ngIf"],[1,"px-1"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],["tooltipPosition","left","pTooltip","API Settings","class","fas fa-cog text-danger fa-fw cursor-pointer",4,"ngIf"],[1,"text-center"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],[3,"value","pSelectableRow"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],["tooltipPosition","left","pTooltip","API Settings",1,"fas","fa-cog","text-danger","fa-fw","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,f){1&r&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Collection APIs"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA()(),t.TgZ(7,"div",5),t.YNc(8,l,3,1,"div",6),t.YNc(9,We,5,7,"div",7),t.qZA()()),2&r&&(t.xp6(8),t.Q6J("ngIf",f.eventCenterS.group.apisRegex.allCollections),t.xp6(1),t.Q6J("ngIf",!f.eventCenterS.group.apisRegex.allCollections))},dependencies:[b.rH,_e.O5,E.iA,k.jx,E.Ei,E.UA,E.Mo,pe.G,me.u]})}return _})();const Be=["insertCodeModalC"];function He(_,Z){1&_&&t._UZ(0,"app-w-instances",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function Ve(_,Z){1&_&&t._UZ(0,"app-w-databases",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function je(_,Z){if(1&_&&t._UZ(0,"app-w-instance-api-settings",7),2&_){const s=t.oxw(2),r=t.MAs(8);t.Q6J("insertCodeModalC",r)("mode",s.EInstanceApiWidgetMode.Database)}}const Me=function(){return[50,50]};function $e(_,Z){1&_&&(t.TgZ(0,"p-splitter",6),t.YNc(1,Ve,1,2,"ng-template",2),t.YNc(2,je,1,2,"ng-template",2),t.qZA()),2&_&&t.Q6J("panelSizes",t.DdM(2,Me))("minSizes",t.DdM(3,Me))}function qe(_,Z){1&_&&t._UZ(0,"app-w-collections",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function ze(_,Z){if(1&_&&t._UZ(0,"app-w-instance-api-settings",7),2&_){const s=t.oxw(2),r=t.MAs(8);t.Q6J("insertCodeModalC",r)("mode",s.EInstanceApiWidgetMode.Collection)}}function Xe(_,Z){1&_&&(t.TgZ(0,"p-splitter",6),t.YNc(1,qe,1,2,"ng-template",2),t.YNc(2,ze,1,2,"ng-template",2),t.qZA()),2&_&&t.Q6J("panelSizes",t.DdM(2,Me))("minSizes",t.DdM(3,Me))}function et(_,Z){1&_&&t._UZ(0,"app-col-api-w",5),2&_&&t.Q6J("showHooksCount",!0)("showCheckbox",!1)}function tt(_,Z){if(1&_&&t._UZ(0,"app-w-instance-api-settings",8),2&_){const s=t.oxw(2),r=t.MAs(8);t.Q6J("insertCodeModalC",r)("mode",s.EInstanceApiWidgetMode.API)}}function nt(_,Z){1&_&&(t.TgZ(0,"p-splitter",6),t.YNc(1,et,1,2,"ng-template",2),t.YNc(2,tt,1,2,"ng-template",2),t.qZA()),2&_&&t.Q6J("panelSizes",t.DdM(2,Me))("minSizes",t.DdM(3,Me))}const at=function(){return{height:"calc(100vh - 62px)",width:"140rem"}},Ue=function(){return[35,50,50,65]};let Fe=(()=>{class _{eventCenterS;EInstanceApiWidgetMode=n.a;DOCS_HOST_PORT=q.N.DOCS_HOST_PORT;insertCodeModalC;constructor(s){this.eventCenterS=s}ngOnInit(){this.eventCenterS.group.apisRegex={},this.eventCenterS.instance.selectedInstances.next([]),this.eventCenterS.database.selectedDatabases.next([]),this.eventCenterS.collection.selectedCollections.next([])}static \u0275fac=function(r){return new(r||_)(t.Y36(L.u))};static \u0275cmp=t.Xpm({type:_,selectors:[["app-db-cell-layout"]],viewQuery:function(r,f){if(1&r&&t.Gf(Be,5),2&r){let N;t.iGM(N=t.CRH())&&(f.insertCodeModalC=N.first)}},decls:9,vars:10,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"],[3,"panelSizes","minSizes"],["pTemplate",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"w-100",3,"showHooksCount","showCheckbox"],["layout","vertical",3,"panelSizes","minSizes"],[1,"w-100",3,"insertCodeModalC","mode"],[1,"w-100",2,"width","45.8%",3,"insertCodeModalC","mode"]],template:function(r,f){1&r&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,He,1,2,"ng-template",2),t.YNc(3,$e,3,4,"ng-template",2),t.YNc(4,Xe,3,4,"ng-template",2),t.YNc(5,nt,3,4,"ng-template",2),t.qZA()(),t._UZ(6,"app-create-schema-form")(7,"app-insert-code-modal",3,4)),2&r&&(t.xp6(1),t.Akn(t.DdM(7,at)),t.Q6J("panelSizes",t.DdM(8,Ue))("minSizes",t.DdM(9,Ue)),t.xp6(6),t.Q6J("frameId","IdInsertCode")("modalId","IdInsertCodeApiList")("docsHostPort",f.DOCS_HOST_PORT))},dependencies:[X.P,k.jx,j.q,z.f,I,we,y.O,Q.n,Y.c],encapsulation:2})}return _})();o(2571);var ot=o(4950);const it=[{path:"layout",component:Fe,canActivate:[T.P]}];let lt=(()=>{class _{static \u0275fac=function(r){return new(r||_)};static \u0275mod=t.oAB({type:_});static \u0275inj=t.cJS({providers:[V.m],imports:[b.Bz.forChild(it),e.u,w.DashboardM,a.ApiInfoM,ot.A]})}return _})()},6162:(fe,W,o)=>{o.d(W,{m:()=>T});var b=o(4946),e=o(2915);let T=(()=>{class w{es;constructor(y){this.es=y}extractNameAndSetForLogTable(y,B,Q,H){const Y=[];for(const V of y)Y.push(B[V][H]);this.es.filterInLog[Q].next(Y)}static \u0275fac=function(B){return new(B||w)(b.LFG(e.u))};static \u0275prov=b.Yz7({token:w,factory:w.\u0275fac,providedIn:"root"})}return w})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4575],{4575:(B,u,i)=>{i.r(u),i.d(u,{DeploymentSettingsM:()=>G});var S=i(7664),T=i(7017),Z=i(1490),g=i(5861),r=i(95),s=i(553),t=i(4946),C=i(2304),f=i(5852),U=i(9394),y=i(6178),R=i(9862);let _=(()=>{class n extends y.g{http;authCS;constructor(e,o){super(e,U.k4.ROOT_USER_SETTINGS),this.http=e,this.authCS=o}saveRootUserSettings(e){return this.http.put(s.N.BE_HOST_PORT_SITES+`${this.modelPath}/set-root-user-settings`,e).toPromise()}getRootUserSettings(){return this.http.get(s.N.BE_HOST_PORT_SITES+`${this.modelPath}/get-root-user-settings`)}verifyRootUserSettings(e){return this.http.post(s.N.BE_HOST_PORT_SITES+`${this.modelPath}/verify-root-user-settings`,e).toPromise()}static \u0275fac=function(o){return new(o||n)(t.LFG(R.eN),t.LFG(f.D))};static \u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var D=i(7240),b=i(3429),h=i(9961),x=i(6814),A=i(2660),I=i(756),J=i(7680),L=i(3259),O=i(6218),N=i(4323);function P(n,p){1&n&&t._UZ(0,"i",51)}function w(n,p){if(1&n&&t._UZ(0,"i",52),2&n){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.logDatabaseConnectionMessage)}}function E(n,p){1&n&&t._UZ(0,"i",51)}function q(n,p){if(1&n&&t._UZ(0,"i",53),2&n){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.externalRedisSettingsJsonMessage)}}function k(n,p){if(1&n){const e=t.EpF();t.TgZ(0,"a",54),t.NdJ("click",function(){t.CHM(e);const a=t.oxw();return t.KtG(a.installAndDetectD2Lib())}),t._UZ(1,"i",55),t._uU(2," Auto Install "),t.qZA()}}function W(n,p){1&n&&t._UZ(0,"i",51)}function Y(n,p){if(1&n&&(t.TgZ(0,"span",56),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Oqu(e.validationResp.d2DiagramLibVersion)}}function M(n,p){if(1&n&&t._UZ(0,"i",52),2&n){const e=t.oxw();t.Q6J("pTooltip",null==e.validationResp?null:e.validationResp.d2DiagramLibPathMessage)}}function j(n,p){if(1&n&&(t.TgZ(0,"div",57)(1,"div",58),t._UZ(2,"div",59),t.ALo(3,"safeHtml"),t.qZA()()),2&n){const e=t.oxw();t.xp6(2),t.Q6J("innerHTML",t.lcZ(3,1,e.d2InstallError),t.oJD)}}function V(n,p){1&n&&t._UZ(0,"p-progressSpinner",60)}const Q=[{path:"",component:(()=>{class n{fb;monacoS;authCS;rootUserSettings;generalS;instanceS;ns;cd;notificationS;form;formData;loading={form:!1};BE_HOST_PORT=s.N.BE_HOST_PORT;sampleConnectionString="mongodb://username:password@127.0.0.1:27017/databaseName?authSource=admin&replicaSet=rs0&directConnection=true";sampleJson='{\n "nodes": [\n {\n "port": 6390,\n "host": "127.0.0.1",\n "pass": ""\n }\n ],\n "otherRedisClusterOptions": null,\n "redisValueExpireInSeconds": 7200,\n "maxCharsResToCache": 1000000\n}';editorRootSetting;editorOptionsRootSetting={readOnly:!1,language:"json",contextmenu:!0};d2InstallError;validationResp;constructor(e,o,a,l,c,d,m,F,H){this.fb=e,this.monacoS=o,this.authCS=a,this.rootUserSettings=l,this.generalS=c,this.instanceS=d,this.ns=m,this.cd=F,this.notificationS=H}ngOnInit(){var e=this;return(0,g.Z)(function*(){e.createForm(),yield e.loadData()})()}createForm(){this.form=this.fb.group({logDatabaseConnectionString:["",[]],externalRedisSettingsJsonString:["",[]],universalLoginCaptcha:["",[]],logRemoveSchedulerInterval:["0 0 0 * * *",[]],passJWTOfAPIUsers:["",[]],jwtTokenExpiresInSeconds:[259200,[r.kI.min(60),r.kI.max(10368e4)]],maxLogsCount:[1e4,[]],d2DiagramLibPath:[1e4,[]]})}loadData(){var e=this;return(0,g.Z)(function*(){try{e.loading.form=!0;const o=(yield e.rootUserSettings.getRootUserSettings().toPromise()).data;if(e.form.reset(),e.form.patchValue(o),o?.logDatabaseConnectionString){const a=e.generalS.getDecryptedString(o.logDatabaseConnectionString,s.N.crypto.passCommunication);e.form.get("logDatabaseConnectionString").setValue(a)}if(o?.passJWTOfAPIUsers){const a=e.generalS.getDecryptedString(o.passJWTOfAPIUsers,s.N.crypto.passCommunication);e.form.get("passJWTOfAPIUsers").setValue(a)}if(o?.externalRedisSettingsJsonString){const a=e.generalS.getDecryptedString(o.externalRedisSettingsJsonString,s.N.crypto.passCommunication);e.editorRootSetting.setValue(a)}if(o?.universalLoginCaptcha){const a=e.generalS.getDecryptedString(o.universalLoginCaptcha,s.N.crypto.passCommunication);e.form.get("universalLoginCaptcha").setValue(a)}e.loading.form=!1}catch(o){e.loading.form=!1,e.ns.showErrorFromResponse(o.error||o,"Unable to load data.")}})()}update(){var e=this;return(0,g.Z)(function*(){try{e.loading.form=!0,e.formData=e.form.getRawValue(),e.form.get("logDatabaseConnectionString").value&&(e.formData.logDatabaseConnectionString=e.generalS.getEncryptedString(e.form.get("logDatabaseConnectionString").value,s.N.crypto.passCommunication)),e.form.get("passJWTOfAPIUsers").value&&(e.formData.passJWTOfAPIUsers=e.generalS.getEncryptedString(e.form.get("passJWTOfAPIUsers").value,s.N.crypto.passCommunication)),e.editorRootSetting.getValue()&&(e.formData.externalRedisSettingsJsonString=e.generalS.getEncryptedString(e.editorRootSetting.getValue(),s.N.crypto.passCommunication)),e.form.get("universalLoginCaptcha").value&&(e.formData.universalLoginCaptcha=e.generalS.getEncryptedString(e.form.get("universalLoginCaptcha").value,s.N.crypto.passCommunication)),yield e.verifyRootUser(e.formData),!e.validationResp.logDatabaseConnectionMessage&&!e.validationResp.externalRedisSettingsJsonMessage&&(yield e.rootUserSettings.saveRootUserSettings(e.formData),e.loading.form=!1,e.ns.showSuccess("Settings verified and saved successfully.")),e.loading.form=!1}catch(o){e.loading.form=!1,e.ns.showErrorFromResponse(o.error||o,"Unable to update.")}})()}verifyRootUser(e){var o=this;return(0,g.Z)(function*(){const a=yield o.rootUserSettings.verifyRootUserSettings(e);o.validationResp=a.data,setTimeout(()=>{o.cd.detectChanges()},1e3)})()}copyToClipboard(e){var o=this;return(0,g.Z)(function*(){"json"===e?yield navigator.clipboard.writeText(o.sampleJson):yield navigator.clipboard.writeText(o.sampleConnectionString),o.notificationS.showSuccess("Copied to clipboard.")})()}editorGenerated(e){var o=this;return(0,g.Z)(function*(){o.loading.form=!0,o.editorRootSetting=e,yield o.monacoS.loadSchemaEditorSettings(o.BE_HOST_PORT,o.authCS.getUserId(),null),o.monacoS.addSaveCodeKeyBinding(e,a=>{o.form.valid&&o.update()}),o.loading.form=!1})()}installAndDetectD2Lib(){var e=this;return(0,g.Z)(function*(){e.loading.form=!0;try{const a=(yield e.instanceS.installAndDetectD2Lib()).data,l=a[0].d2InstallOutput?.data?.d2LibPath;if(l)e.form.patchValue({d2DiagramLibPath:l}),e.ns.showSuccess("D2 library installed successfully.");else{const c=a[0].d2InstallOutput?.errors?.[0]?.message;e.ns.showError(c),e.d2InstallError=c}}catch(o){e.ns.showErrorFromResponse(o.error||o,"Unable to install d2 diagram library.")}e.loading.form=!1,e.cd.detectChanges()})()}generateRandomValue(e){const o=this.generalS.getRandomStringWithCapitals(5),a=this.generalS.getRandomStringWithCapitals(5),l=this.generalS.getRandomStringWithCapitals(5),c=this.generalS.getRandomStringWithCapitals(5),d=this.generalS.getRandomStringWithCapitals(5),m=this.generalS.getRandomStringWithCapitals(5);this.form.get(e).setValue(`${o}_${a}_${l}_${c}_${d}_${m}`)}static \u0275fac=function(o){return new(o||n)(t.Y36(r.qu),t.Y36(C.b),t.Y36(f.D),t.Y36(_),t.Y36(D.b),t.Y36(b.E),t.Y36(h.W),t.Y36(t.sBO),t.Y36(h.W))};static \u0275cmp=t.Xpm({type:n,selectors:[["app-dep-set-layout"]],decls:142,vars:22,consts:[[1,"pt-1","pr-1","pl-1","full-body","overflow-auto"],[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"card-body","p-0","overflow-hidden"],[1,"pl-3","overflow-auto","h-100"],[1,"pb-5",3,"formGroup"],[1,"form-group","row","mt-3","mb-0","ml-0","mr-0"],[1,"text-left","mb-0"],["class","fas fa-check-circle text-success pt-1 ml-2",4,"ngIf"],["class","fas fa-times-circle text-danger pt-1 ml-2 hover",3,"pTooltip",4,"ngIf"],[1,"form-group","row","ml-0","mr-0"],[1,"col-7","pl-0","pr-0"],["rows","5","formControlName","logDatabaseConnectionString","spellcheck","false","placeholder","Please provide log database connection string","pInputTextarea","",1,"form-control","form-control-sm","font-monospaced",3,"autoResize"],[1,"text-danger","small","col-12","pl-0","pr-0"],[1,"col-4","border","ml-3","pt-3"],["pTooltip","Copy to clipboard",1,"fas","fa-copy","text-warning","fa-fw","cursor-pointer","line-height-1-3","mr-2","float-right",3,"click"],[1,"form-group","row","mt-5","mb-0","ml-0","mr-0"],[1,"small","text-muted"],[1,"form-group","row","mb-3","ml-0","mr-0"],["formControlName","logRemoveSchedulerInterval","name","logRemoveSchedulerInterval","spellcheck","false","type","text","placeholder","For daily : 0 0 0 * * *",1,"form-control","form-control-sm","font-monospaced","col-7"],["formControlName","maxLogsCount","name","maxLogsCount","spellcheck","false","type","number","placeholder","10000",1,"form-control","form-control-sm","font-monospaced","col-7"],["class","fas fa-times-circle text-danger pt-1 ml-2",3,"pTooltip",4,"ngIf"],[1,"pr-0","pl-0",2,"height","277px"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"col-4","border","ml-3"],["title","Copy to clipboard",1,"fas","fa-copy","text-warning","fa-fw","cursor-pointer","line-height-1-3","mr-2","pt-3","float-right",3,"click"],[1,"mb-0","mt-0"],[1,"fw-bold"],[1,"json-key"],[1,"json-val"],[1,"json-num-val"],["formControlName","universalLoginCaptcha","name","universalLoginCaptcha","spellcheck","false","type","text","placeholder","Please provide universal login captcha",1,"form-control","form-control-sm","font-monospaced","col-7"],[1,"text-left","col-7","p-0","mb-0"],["href","https://docs.apimaker.dev/v1/docs/blog/install-d2.html","target","_blank",1,"float-right","small","text-warning"],[1,"fas","fa-link","fa-fw"],["class","float-right small text-info mr-3","href","javascript:",3,"click",4,"ngIf"],["class","ml-1",4,"ngIf"],["formControlName","d2DiagramLibPath","name","d2DiagramLibPath","spellcheck","false","type","text","placeholder","Please provide D2 diagram library path. ex : /usr/local/bin/d2",1,"form-control","form-control-sm","font-monospaced","col-7"],["class","row",4,"ngIf"],["href","javascript:",1,"float-right","small","text-info",3,"click"],[1,"fas","fa-random","fa-fw"],[1,"form-group","row","ml-0","mr-0","mb-0"],["maxlength","32","formControlName","passJWTOfAPIUsers","name","passJWTOfAPIUsers","spellcheck","false","type","text","placeholder","",1,"form-control","form-control-sm","font-monospaced","col-7"],[1,"row","mb-3","ml-0","mr-0"],["formControlName","jwtTokenExpiresInSeconds","name","jwtTokenExpiresInSeconds","spellcheck","false","type","number","placeholder","",1,"form-control","form-control-sm","font-monospaced","col-7"],[1,"form-group","row","mb-3","ml-0","mr-0","mt-5"],[1,"float-left","ml-1","mt-3"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary",3,"click"],[1,"fas","fa-save","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-check-circle","text-success","pt-1","ml-2"],[1,"fas","fa-times-circle","text-danger","pt-1","ml-2","hover",3,"pTooltip"],[1,"fas","fa-times-circle","text-danger","pt-1","ml-2",3,"pTooltip"],["href","javascript:",1,"float-right","small","text-info","mr-3",3,"click"],[1,"fas","fa-cloud-download-alt","fa-fw"],[1,"ml-1"],[1,"row"],[1,"col-7"],[1,"text-right",3,"innerHTML"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,a){1&o&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"span"),t._UZ(4,"i",3),t._uU(5," Settings"),t.qZA()(),t.TgZ(6,"div",4)(7,"div",5)(8,"form",6)(9,"div",7)(10,"label",8),t._uU(11,"Log Database Connection String"),t.qZA(),t.YNc(12,P,1,0,"i",9),t.YNc(13,w,1,1,"i",10),t.qZA(),t.TgZ(14,"div",11)(15,"div",12),t._UZ(16,"textarea",13),t.TgZ(17,"div",14),t._uU(18),t.qZA()(),t.TgZ(19,"div",15)(20,"p")(21,"i",16),t.NdJ("click",function(){return a.copyToClipboard()}),t.qZA()(),t.TgZ(22,"p"),t._uU(23),t.qZA()()(),t.TgZ(24,"div",17)(25,"label",8),t._uU(26,"Log Remove Scheduler Run CRON "),t.TgZ(27,"span",18),t._uU(28,"(Clean logs daily ex : 0 0 0 * * *)"),t.qZA()()(),t.TgZ(29,"div",19),t._UZ(30,"input",20),t.TgZ(31,"div",14),t._uU(32),t.qZA()(),t.TgZ(33,"div",17)(34,"label",8),t._uU(35,"Max logs save count "),t.TgZ(36,"span",18),t._uU(37,"(ex: 10000, it will keep recent 10000 logs)"),t.qZA()()(),t.TgZ(38,"div",19),t._UZ(39,"input",21),t.qZA(),t.TgZ(40,"div",17)(41,"label",8),t._uU(42,"Redis Connection JSON"),t.qZA(),t.YNc(43,E,1,0,"i",9),t.YNc(44,q,1,1,"i",22),t.qZA(),t.TgZ(45,"div",19)(46,"div",12)(47,"div",23)(48,"app-monaco-editor",24),t.NdJ("editorGenerated",function(c){return a.editorGenerated(c)}),t.qZA()(),t.TgZ(49,"div",14),t._uU(50),t.qZA()(),t.TgZ(51,"div",25)(52,"span")(53,"i",26),t.NdJ("click",function(){return a.copyToClipboard("json")}),t.qZA()(),t.TgZ(54,"pre",27)(55,"code",28),t._uU(56),t.TgZ(57,"span",29),t._uU(58,'"nodes"'),t.qZA(),t._uU(59),t.TgZ(60,"span",29),t._uU(61,'"port"'),t.qZA(),t._uU(62,": "),t.TgZ(63,"span",30),t._uU(64,"6390"),t.qZA(),t._uU(65,",\n "),t.TgZ(66,"span",29),t._uU(67,'"host"'),t.qZA(),t._uU(68,": "),t.TgZ(69,"span",30),t._uU(70,'"127.0.0.1"'),t.qZA(),t._uU(71,",\n "),t.TgZ(72,"span",29),t._uU(73,'"pass"'),t.qZA(),t._uU(74,": "),t.TgZ(75,"span",30),t._uU(76,'""'),t.qZA(),t._uU(77),t.TgZ(78,"span",29),t._uU(79,'"otherRedisClusterOptions"'),t.qZA(),t._uU(80,": "),t.TgZ(81,"span",30),t._uU(82,"null"),t.qZA(),t._uU(83,",\n "),t.TgZ(84,"span",29),t._uU(85,'"redisValueExpireInSeconds"'),t.qZA(),t._uU(86,": "),t.TgZ(87,"span",31),t._uU(88,"7200"),t.qZA(),t._uU(89,",\n "),t.TgZ(90,"span",29),t._uU(91,'"maxCharsResToCache"'),t.qZA(),t._uU(92,": "),t.TgZ(93,"span",31),t._uU(94,"1000000"),t.qZA(),t._uU(95),t.qZA(),t._uU(96,"\n"),t.qZA()()(),t.TgZ(97,"div",17)(98,"label",8),t._uU(99,"Universal Login Captcha"),t.qZA()(),t.TgZ(100,"div",19),t._UZ(101,"input",32),t.qZA(),t.TgZ(102,"div",17)(103,"label",33),t._uU(104," D2 Diagram Library Path "),t.TgZ(105,"a",34),t._UZ(106,"i",35),t._uU(107," Install Guide "),t.qZA(),t.YNc(108,k,3,0,"a",36),t.YNc(109,W,1,0,"i",9),t.YNc(110,Y,2,1,"span",37),t.YNc(111,M,1,1,"i",10),t.qZA()(),t.TgZ(112,"div",19),t._UZ(113,"input",38),t.qZA(),t.YNc(114,j,4,3,"div",39),t.TgZ(115,"div",17)(116,"label",33),t._uU(117," JWT Password "),t.TgZ(118,"span",18),t._uU(119,"(It will be used for generating JWT tokens)"),t.qZA(),t.TgZ(120,"a",40),t.NdJ("click",function(){return a.generateRandomValue("passJWTOfAPIUsers")}),t._UZ(121,"i",41),t._uU(122," Generate "),t.qZA()()(),t.TgZ(123,"div",42),t._UZ(124,"input",43),t.qZA(),t.TgZ(125,"div",44)(126,"span",18),t._uU(127,"If you change this value, all the users of your applications will be logged out."),t.qZA()(),t.TgZ(128,"div",17)(129,"label",33),t._uU(130," JWT Tokens Expires In Seconds "),t.TgZ(131,"span",18),t._uU(132,"(259200 = 3 Days | 72 Hours)"),t.qZA()()(),t.TgZ(133,"div",19),t._UZ(134,"input",45),t.qZA(),t.TgZ(135,"div",46)(136,"div",47)(137,"button",48),t.NdJ("click",function(){return a.update()}),t._UZ(138,"i",49),t.TgZ(139,"span"),t._uU(140,"Update"),t.qZA()()()()()()(),t.YNc(141,V,1,0,"p-progressSpinner",50),t.qZA()()),2&o&&(t.xp6(8),t.Q6J("formGroup",a.form),t.xp6(4),t.Q6J("ngIf",a.validationResp&&(null==a.formData?null:a.formData.logDatabaseConnectionString)&&!(null!=a.validationResp&&a.validationResp.logDatabaseConnectionMessage)),t.xp6(1),t.Q6J("ngIf",null==a.validationResp?null:a.validationResp.logDatabaseConnectionMessage),t.xp6(3),t.Q6J("autoResize",!0),t.xp6(2),t.Oqu(null==a.validationResp?null:a.validationResp.logDatabaseConnectionMessage),t.xp6(5),t.Oqu(a.sampleConnectionString),t.xp6(9),t.Oqu(null==a.validationResp?null:a.validationResp.logRemoveSchedulerIntervalMessage),t.xp6(11),t.Q6J("ngIf",a.validationResp&&(null==a.formData?null:a.formData.externalRedisSettingsJsonString)&&!(null!=a.validationResp&&a.validationResp.externalRedisSettingsJsonMessage)),t.xp6(1),t.Q6J("ngIf",null==a.validationResp?null:a.validationResp.externalRedisSettingsJsonMessage),t.xp6(4),t.Q6J("isSchemaEditor",!1)("editorOptions",a.editorOptionsRootSetting),t.xp6(2),t.Oqu(null==a.validationResp?null:a.validationResp.externalRedisSettingsJsonMessage),t.xp6(6),t.hij("\n","{","\n "),t.xp6(3),t.hij(": [\n ","{","\n "),t.xp6(18),t.hij("\n ","}","\n ],\n "),t.xp6(18),t.hij("\n","}","\n"),t.xp6(13),t.Q6J("ngIf","Linux"===a.authCS.backendSettings.osType),t.xp6(1),t.Q6J("ngIf",null==a.validationResp?null:a.validationResp.d2DiagramLibVersion),t.xp6(1),t.Q6J("ngIf",null==a.validationResp?null:a.validationResp.d2DiagramLibVersion),t.xp6(1),t.Q6J("ngIf",null==a.validationResp?null:a.validationResp.d2DiagramLibPathMessage),t.xp6(3),t.Q6J("ngIf",a.d2InstallError),t.xp6(27),t.Q6J("ngIf",a.loading.form))},dependencies:[r._Y,r.Fj,r.wV,r.JJ,r.JL,r.nD,r.sg,r.u,x.O5,A.y,I.O,J.G,L.u,O.g,N.z],encapsulation:2})}return n})(),canActivate:[Z.g]}];let G=(()=>{class n{static \u0275fac=function(o){return new(o||n)};static \u0275mod=t.oAB({type:n});static \u0275inj=t.cJS({imports:[S.Bz.forChild(Q),T.u]})}return n})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4842],{4842:(z,p,i)=>{i.r(p),i.d(p,{AuthM:()=>M});var d=i(7664),c=i(5861),a=i(95),f=i(921),g=i(553),e=i(4946),v=i(3835),Z=i(7240),T=i(9961),I=i(5852),C=i(5561),_=i(4977),S=i(5405),y=i(6814),L=i(2660),A=i(7680);function x(n,s){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",21),e._uU(2," Login"),e.qZA())}function O(n,s){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",22),e._uU(2," Register"),e.qZA())}function N(n,s){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Forgot Password"),e.qZA())}const u=function(){return{mode:"LOGIN"}};function k(n,s){1&n&&(e.TgZ(0,"a",24),e._UZ(1,"i",25),e._uU(2," Login"),e.qZA()),2&n&&e.Q6J("routerLink","/login")("state",e.DdM(2,u))}function R(n,s){1&n&&(e.TgZ(0,"a",24),e._UZ(1,"i",25),e._uU(2," Login"),e.qZA()),2&n&&e.Q6J("routerLink","/login")("state",e.DdM(2,u))}function U(n,s){1&n&&(e.TgZ(0,"div",14)(1,"label",26),e._uU(2,"Name"),e.qZA(),e.TgZ(3,"div",16),e._UZ(4,"input",27),e.qZA()())}function w(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"label",28),e._uU(2,"Password"),e.qZA(),e.TgZ(3,"div",16)(4,"input",29),e.NdJ("keyup.enter",function(){e.CHM(t);const o=e.oxw();return e.KtG("LOGIN"===o.mode?o.save():"")}),e.qZA()()()}}function G(n,s){1&n&&(e.TgZ(0,"div",14)(1,"label",28),e._uU(2,"API Path"),e.qZA(),e.TgZ(3,"div",16),e._UZ(4,"input",30),e.qZA()())}function P(n,s){1&n&&(e.TgZ(0,"div",14),e._UZ(1,"label",28),e.TgZ(2,"div",16),e._UZ(3,"div",31),e.qZA()())}function b(n,s){if(1&n){const t=e.EpF();e.TgZ(0,"div",14)(1,"label",28),e._uU(2,"Captcha"),e.qZA(),e.TgZ(3,"div",16)(4,"div",32)(5,"input",33),e.NdJ("keyup.enter",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save())}),e.qZA(),e.TgZ(6,"span",34),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.loadCaptcha())}),e._UZ(7,"i",35),e.qZA()()()()}}function E(n,s){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",36),e._uU(2," Login"),e.qZA())}function J(n,s){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",37),e._uU(2," Register"),e.qZA())}function Y(n,s){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",38),e._uU(2," Recover"),e.qZA())}function F(n,s){1&n&&e._UZ(0,"p-progressSpinner",39)}let m=(()=>{class n{fb;userS;generalS;ns;route;router;authCS;navigationS;tpStoreApiVersionS;eventCenterCS;form;subscriptions=[];mode="LOGIN";loading={form:!1};version="";constructor(t,r,o,l,q,V,K,W,H,j){this.fb=t,this.userS=r,this.generalS=o,this.ns=l,this.route=q,this.router=V,this.authCS=K,this.navigationS=W,this.tpStoreApiVersionS=H,this.eventCenterCS=j,this.version=g.N.VERSION,this.version.length>13&&(this.version="")}ngOnInit(){this.createForm(),this.subscriptions.push(this.route.data.subscribe(t=>{this.mode=t.mode,this.loadCaptcha(),"REGISTER"===this.mode?(this.form.get("name").setValidators([a.kI.required,a.kI.minLength(3)]),this.form.get("apiPath").setValidators([a.kI.required,a.kI.minLength(3),a.kI.maxLength(25),a.kI.pattern("[a-zA-Z0-9_]*$")]),this.form.get("password").setValidators([a.kI.required,a.kI.minLength(4),a.kI.maxLength(40)])):"LOGIN"===this.mode&&this.form.get("password").setValidators([a.kI.required,a.kI.minLength(4),a.kI.maxLength(40)])}))}latestCaptchaKey;loadCaptcha(){var t=this;return(0,c.Z)(function*(){try{const r=yield t.userS.getCaptcha();$("#idSvg").html(r.data),setTimeout(()=>{$("#idSvg svg").attr("height","50px").removeAttr("width")},100),t.latestCaptchaKey=r.key}catch(r){t.ns.showErrorFromResponse(r.error||r,"Unable to load captcha.")}})()}createForm(){this.form=this.fb.group({name:["",[]],email:["",[a.kI.required,a.kI.email]],password:["",[]],apiPath:["",[]],captcha:["",[a.kI.required]],captchaKey:["",[]]})}save(){var t=this;return(0,c.Z)(function*(){"LOGIN"===t.mode?yield t.login():"REGISTER"===t.mode?yield t.register():"FORGOT_PASSWORD"===t.mode&&(yield t.forgotPassword())})()}login(){var t=this;return(0,c.Z)(function*(){const r=t.form.getRawValue();if(r.captcha){if(t.form.invalid)return t.ns.showError("Please fill all required fields");try{t.loading.form=!0;const o=yield t.userS.login(r.email,r.password,t.latestCaptchaKey,r.captcha);if(o){if(o.hasOwnProperty("message"))return t.loading.form=!1,t.ns.showError("You have entered an invalid Captcha.");t.ns.showSuccess("Login Success."),t.authCS.setAccessToken(o.accessToken),t.authCS.setRefreshToken(o.refreshToken);const l=yield t.userS.getUserInfo(o._id);l.userType===f.d.DEVELOPER&&(l.user=yield t.userS.getUserInfo(l.user)),t.authCS.setUserToLocalStorage(l,g.N.crypto.passCommunication),yield t.userS.loadSettings(t.tpStoreApiVersionS,t.eventCenterCS),t.navigationS.gotoDashboard()}else t.ns.showError("Invalid Credentials.");t.loading.form=!1}catch(o){t.loading.form=!1,t.ns.showErrorFromResponse(o.error||o,"Unable to login."),yield t.loadCaptcha()}}})()}register(){var t=this;return(0,c.Z)(function*(){const r=t.form.getRawValue();try{t.loading.form=!0,r.userType=f.d.ADMIN,(yield t.userS.register(r))&&(t.ns.showSuccess("Registration Success."),yield t.login()),t.loading.form=!1,t.form.reset()}catch(o){t.loading.form=!1,t.ns.showErrorFromResponse(o.error||o,"Unable to register.")}})()}forgotPassword(){return(0,c.Z)(function*(){console.log("Forgot Password.")})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(r){return new(r||n)(e.Y36(a.qu),e.Y36(v.K),e.Y36(Z.b),e.Y36(T.W),e.Y36(d.gz),e.Y36(d.F0),e.Y36(I.D),e.Y36(C.X),e.Y36(_.f),e.Y36(S.M))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-login"]],decls:33,vars:17,consts:[[1,"login-form"],[1,"row","justify-content-center","mt-4","row"],[1,"col-12","col-lg-5","col-sm-10","shadow-lg","p-0","rounded"],[1,"card",2,"background-color","#14141478"],[1,"card-header"],[4,"ngIf"],["class","float-right",3,"routerLink","state",4,"ngIf"],[1,"float-right"],[1,"card-body"],[1,"row"],[1,"col-12","text-center"],["src","assets/images/logo/logo.svg","alt","API maker logo",1,"m-4","mt-3",2,"padding-bottom","10px"],[3,"formGroup"],["class","form-group row",4,"ngIf"],[1,"form-group","row"],["for","email",1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6","pr-0"],["formControlName","email","id","email","name","email_address","spellcheck","false","type","email","placeholder","Please provide email",1,"form-control","form-control-sm",3,"keyup.enter"],[1,"col-8","offset-4",2,"padding-bottom","25px"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-user-lock","text-info","fa-fw"],[1,"fas","fa-plus","text-success"],[1,"fas","fa-lock","text-warning","fa-fw"],[1,"float-right",3,"routerLink","state"],[1,"fas","fa-user-lock","text-info"],["for","name",1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","id","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","password","name","password","type","password","placeholder","Please provide password",1,"form-control","form-control-sm",3,"keyup.enter"],["formControlName","apiPath","name","apiPath","spellcheck","false","type","text","placeholder","Please provide API Path",1,"form-control","text-lowercase","form-control-sm"],["id","idSvg",2,"border-radius","5px","background","white","text-align","center"],[1,"input-group","input-group-sm","mb-3"],["formControlName","captcha","name","captcha","type","text","placeholder","Please provide captcha",1,"form-control","form-control-sm",3,"keyup.enter"],[1,"input-group-text","pl-3","pr-3","pt-0","pb-0","bg-dark","text-white","cursor-pointer",2,"border","1px solid #555555",3,"click"],[1,"fas","fa-redo","fa-fw","text-success"],[1,"fas","fa-sign-in-alt","text-success","fa-fw"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"fas","fa-retweet","text-danger","fa-fw"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(r,o){1&r&&(e.TgZ(0,"main",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4),e.YNc(5,x,3,0,"span",5),e.YNc(6,O,3,0,"span",5),e.YNc(7,N,3,0,"span",5),e.YNc(8,k,3,3,"a",6),e.YNc(9,R,3,3,"a",6),e.TgZ(10,"span",7),e._uU(11),e.qZA()(),e.TgZ(12,"div",8)(13,"div",9)(14,"div",10),e._UZ(15,"img",11),e.qZA()(),e.TgZ(16,"form",12),e.YNc(17,U,5,0,"div",13),e.TgZ(18,"div",14)(19,"label",15),e._uU(20,"E-Mail Address"),e.qZA(),e.TgZ(21,"div",16)(22,"input",17),e.NdJ("keyup.enter",function(){return"LOGIN"===o.mode?o.save():""}),e.qZA()()(),e.YNc(23,w,5,0,"div",13),e.YNc(24,G,5,0,"div",13),e.YNc(25,P,4,0,"div",13),e.YNc(26,b,8,0,"div",13),e.TgZ(27,"div",18)(28,"button",19),e.NdJ("click",function(){return o.save()}),e.YNc(29,E,3,0,"span",5),e.YNc(30,J,3,0,"span",5),e.YNc(31,Y,3,0,"span",5),e.qZA()()(),e.YNc(32,F,1,0,"p-progressSpinner",20),e.qZA()()()()()),2&r&&(e.xp6(5),e.Q6J("ngIf","LOGIN"===o.mode),e.xp6(1),e.Q6J("ngIf","REGISTER"===o.mode),e.xp6(1),e.Q6J("ngIf","FORGOT_PASSWORD"===o.mode),e.xp6(1),e.Q6J("ngIf","REGISTER"===o.mode),e.xp6(1),e.Q6J("ngIf","FORGOT_PASSWORD"===o.mode),e.xp6(2),e.Oqu(o.version),e.xp6(5),e.Q6J("formGroup",o.form),e.xp6(1),e.Q6J("ngIf","REGISTER"===o.mode),e.xp6(6),e.Q6J("ngIf","LOGIN"===o.mode||"REGISTER"===o.mode),e.xp6(1),e.Q6J("ngIf","REGISTER"===o.mode),e.xp6(1),e.Q6J("ngIf","LOGIN"===o.mode),e.xp6(1),e.Q6J("ngIf","LOGIN"===o.mode),e.xp6(2),e.Q6J("disabled",o.form.invalid),e.xp6(1),e.Q6J("ngIf","LOGIN"===o.mode),e.xp6(1),e.Q6J("ngIf","REGISTER"===o.mode),e.xp6(1),e.Q6J("ngIf","FORGOT_PASSWORD"===o.mode),e.xp6(1),e.Q6J("ngIf",o.loading.form))},dependencies:[d.rH,a._Y,a.Fj,a.JJ,a.JL,a.sg,a.u,y.O5,L.y,A.G],styles:[".my-form[_ngcontent-%COMP%]{padding-top:1.5rem;padding-bottom:1.5rem}.my-form[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}.login-form[_ngcontent-%COMP%]{padding-top:1.5rem;padding-bottom:1.5rem}.login-form[_ngcontent-%COMP%] .row[_ngcontent-%COMP%]{margin-left:0;margin-right:0}"]})}return n})();var Q=i(7017),h=i(7501);const D=[{path:"",component:m,canActivate:[h.O],data:{mode:"LOGIN"}},{path:"login",component:m,canActivate:[h.O],data:{mode:"LOGIN"}},{path:"forgot-password",component:m,canActivate:[],data:{mode:"FORGOT_PASSWORD"}},{path:"register",component:m,canActivate:[],data:{mode:"REGISTER"}}];let M=(()=>{class n{static \u0275fac=function(r){return new(r||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[d.Bz.forChild(D),Q.u]})}return n})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[485],{485:(U,c,n)=>{n.r(c),n.d(c,{TsGenInterfacesM:()=>N});var g=n(7664),h=n(7017),u=n(3726),l=n(5861),v=n(1162),p=n(553),e=n(4946),T=n(3429),y=n(2304),S=n(9862),G=n(7240),I=n(6814),C=n(756),m=n(5431),Z=n(5219),O=n(7680),w=n(3259);function R(a,d){1&a&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA()())}function A(a,d){if(1&a&&(e.TgZ(0,"tr",19)(1,"td"),e._uU(2),e.qZA()()),2&a){const t=d.$implicit;e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name)}}function L(a,d){1&a&&e._UZ(0,"p-progressSpinner",20)}const P=[{path:"main",component:(()=>{class a{cd;instanceS;monacoS;http;generalS;projectType="AM";BE_HOST_PORT=p.N.BE_HOST_PORT;DOCS_HOST_PORT=p.N.DOCS_HOST_PORT;loading={grid:!1};editorGeneratedInterfaces;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};gridKey=v.iH._id;rows=[];selectedRow=null;constructor(t,s,i,o,r){this.cd=t,this.instanceS=s,this.monacoS=i,this.http=o,this.generalS=r}ngOnInit(){this.rows.push({_id:"db-interfaces.ts",name:"db-interfaces.ts"},{_id:"types.ts",name:"types.ts"}),setTimeout(()=>{this.selectedRow=this.rows[0],this.itemSelected().then()},100)}itemSelected(){var t=this;return(0,l.Z)(function*(){if(!t.selectedRow)return void t.editorGeneratedInterfaces.setValue("");let s;t.loading.grid=!0,"db-interfaces.ts"===t.selectedRow._id?s=(yield t.instanceS.getGeneratedInterfaceCode(t.selectedRow)).data["file:///node_modules/@types/db-interfaces.d.ts"]:"types.ts"===t.selectedRow._id&&(s=yield t.getP("/assets/schema-types/types.ts"),s=t.cleanTagLines(s)),t.editorGeneratedInterfaces.setValue(s),t.monacoS.formatDocument(t.editorGeneratedInterfaces),setTimeout(()=>{t.loading.grid=!1},500)})()}cleanTagLines(t){const s=t.split("\n"),i=[];for(const o of s)o.endsWith(" : start")||o.endsWith(" : end")||i.push(o);return i.join("\n")}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorGeneratedInterfaces=t})()}getP(t){return this.http.get(t,{responseType:"text"}).toPromise()}downloadTSGeneratedInterfaces(){var t=this;return(0,l.Z)(function*(){t.generalS.downloadFile(t.editorGeneratedInterfaces.getValue(),t.selectedRow.name)})()}static \u0275fac=function(s){return new(s||a)(e.Y36(e.sBO),e.Y36(T.E),e.Y36(y.b),e.Y36(S.eN),e.Y36(G.b))};static \u0275cmp=e.Xpm({type:a,selectors:[["app-ts-gen-interfaces-layout"]],decls:26,vars:9,consts:[["id","idUtilityClassesFormPanel",1,"pt-1","pl-1","pr-1","overflow-auto"],[1,"row","m-0","full-body"],[1,"p-0","col-3"],[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/typescript.svg","alt","System Generated Interfaces",1,"fa-fw","mr-1",2,"vertical-align","text-bottom"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/features/ts-generated-interfaces.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped utility-classes-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange"],["pTemplate","header"],["pTemplate","body"],[1,"p-0","col-9"],["src","/assets/images/icons/typescript.svg",1,"fa-fw","mr-1",2,"vertical-align","text-bottom"],["tooltipPosition","left","pTooltip","Download",1,"fas","fa-file-download","text-success","fa-fw","float-right","cursor-pointer","line-height-1-3","mr-2",3,"click"],[1,"overflow-hidden",2,"height","calc(100vh - 90px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,i){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"div",4)(5,"span"),e._UZ(6,"img",5),e._uU(7," Interfaces"),e.qZA(),e.TgZ(8,"div",6)(9,"a",7),e._UZ(10,"img",8),e.qZA()()(),e.TgZ(11,"div",9)(12,"p-table",10),e.NdJ("selectionChange",function(r){return i.selectedRow=r})("selectionChange",function(){return i.itemSelected()}),e.YNc(13,R,3,0,"ng-template",11),e.YNc(14,A,3,2,"ng-template",12),e.qZA()()()(),e.TgZ(15,"div",13)(16,"div",3)(17,"div",4)(18,"span"),e._UZ(19,"img",14),e._uU(20," Code"),e.qZA(),e.TgZ(21,"i",15),e.NdJ("click",function(){return i.downloadTSGeneratedInterfaces()}),e.qZA()(),e.TgZ(22,"div",9)(23,"div",16)(24,"app-monaco-editor",17),e.NdJ("editorGenerated",function(r){return i.editorGenerated(r)}),e.qZA()()()(),e.YNc(25,L,1,0,"p-progressSpinner",18),e.qZA()()()),2&s&&(e.xp6(12),e.Q6J("selectionMode","single")("metaKeySelection",!0)("selection",i.selectedRow)("dataKey",i.gridKey)("scrollable",!0)("value",i.rows),e.xp6(12),e.Q6J("isSchemaEditor",!0)("editorOptions",i.editorOptions),e.xp6(1),e.Q6J("ngIf",i.loading.grid))},dependencies:[I.O5,C.O,m.iA,Z.jx,m.Ei,O.G,w.u]})}return a})(),canActivate:[u.P]}];let N=(()=>{class a{static \u0275fac=function(s){return new(s||a)};static \u0275mod=e.oAB({type:a});static \u0275inj=e.cJS({imports:[g.Bz.forChild(P),h.u]})}return a})()}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4895],{4895:(m,s,n)=>{n.r(s),n.d(s,{PermissionsM:()=>a});var o=n(7664),h=n(7017),l=n(4946);const d=[{path:"group",loadChildren:()=>Promise.all([n.e(1678),n.e(4211),n.e(7987),n.e(1025),n.e(5765),n.e(4186),n.e(9243),n.e(6401),n.e(8592)]).then(n.bind(n,6401)).then(t=>t.GroupM)},{path:"api-user",loadChildren:()=>n.e(2473).then(n.bind(n,2473)).then(t=>t.ApiUserM)},{path:"vulnerabilities",loadChildren:()=>n.e(1754).then(n.bind(n,1754)).then(t=>t.VulnerabilityM)}];let a=(()=>{class t{static \u0275fac=function(M){return new(M||t)};static \u0275mod=l.oAB({type:t});static \u0275inj=l.cJS({imports:[o.Bz.forChild(d),h.u]})}return t})()}}]);