@sava-info-systems/api-maker-with-extensions 1.6.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/.env +1 -0
  2. package/README.md +1 -1
  3. package/dist/1025.js +1 -1
  4. package/dist/1097.js +1 -0
  5. package/dist/148.js +1 -1
  6. package/dist/1558.js +1 -1
  7. package/dist/1678.js +1 -1
  8. package/dist/1928.js +1 -1
  9. package/dist/2295.js +1 -1
  10. package/dist/2473.js +1 -1
  11. package/dist/2714.js +1 -1
  12. package/dist/2735.js +1 -0
  13. package/dist/3139.js +1 -1
  14. package/dist/4181.js +1 -1
  15. package/dist/4186.js +1 -1
  16. package/dist/4211.js +1 -1
  17. package/dist/485.js +1 -1
  18. package/dist/4895.js +1 -1
  19. package/dist/5249.js +1 -0
  20. package/dist/5334.js +1 -1
  21. package/dist/5421.js +1 -1
  22. package/dist/5679.js +1 -1
  23. package/dist/5765.js +1 -0
  24. package/dist/6236.js +1 -1
  25. package/dist/6393.js +1 -1
  26. package/dist/6401.js +1 -1
  27. package/dist/7368.js +1 -1
  28. package/dist/7436.js +1 -1
  29. package/dist/7470.js +1 -1
  30. package/dist/7975.js +1 -1
  31. package/dist/7977.js +1 -0
  32. package/dist/7987.js +1 -1
  33. package/dist/8125.js +1 -1
  34. package/dist/8266.js +1 -1
  35. package/dist/8296.js +1 -1
  36. package/dist/885.js +1 -1
  37. package/dist/9243.js +1 -1
  38. package/dist/9939.js +1 -1
  39. package/dist/assets/images/icons/api-group.svg +10 -9
  40. package/dist/assets/images/icons/api-user.svg +9 -6
  41. package/dist/assets/images/icons/comparator.svg +13 -4
  42. package/dist/assets/images/icons/custom.svg +5 -8
  43. package/dist/assets/images/icons/database.svg +28 -11
  44. package/dist/assets/images/icons/db-m.svg +9 -27
  45. package/dist/assets/images/icons/dev.svg +10 -6
  46. package/dist/assets/images/icons/diagram.svg +27 -6
  47. package/dist/assets/images/icons/event.svg +16 -0
  48. package/dist/assets/images/icons/film-movies-icon.svg +3 -13
  49. package/dist/assets/images/icons/finder.svg +9 -6
  50. package/dist/assets/images/icons/i18n.svg +10 -8
  51. package/dist/assets/images/icons/increment.svg +4 -3
  52. package/dist/assets/images/icons/license.svg +6 -0
  53. package/dist/assets/images/icons/log-profile.svg +20 -6
  54. package/dist/assets/images/icons/log.svg +14 -6
  55. package/dist/assets/images/icons/masters.svg +14 -0
  56. package/dist/assets/images/icons/native-process-logs.svg +13 -0
  57. package/dist/assets/images/icons/nodes.svg +4 -2
  58. package/dist/assets/images/icons/notes.svg +11 -18
  59. package/dist/assets/images/icons/process_initializers.svg +19 -12
  60. package/dist/assets/images/icons/redis.svg +17 -6
  61. package/dist/assets/images/icons/sandbox.svg +10 -3
  62. package/dist/assets/images/icons/schedulers.svg +7 -11
  63. package/dist/assets/images/icons/secret.svg +12 -6
  64. package/dist/assets/images/icons/systems.svg +7 -8
  65. package/dist/assets/images/icons/testing.svg +11 -3
  66. package/dist/assets/images/icons/third-party.svg +16 -6
  67. package/dist/assets/images/icons/typescript.svg +7 -6
  68. package/dist/assets/images/icons/ui-maker.svg +11 -0
  69. package/dist/assets/images/icons/utility.svg +18 -6
  70. package/dist/assets/images/icons/vulnerability.svg +19 -11
  71. package/dist/assets/images/icons/web.svg +3 -9
  72. package/dist/assets/schema-types/InterfaceProps.ts +32 -0
  73. package/dist/assets/schema-types/types.ts +1444 -136
  74. package/dist/assets/styles/out/styles.css +1 -1
  75. package/dist/assets/styles/out/styles.css.map +1 -1
  76. package/dist/assets/styles/styles.scss +9 -3
  77. package/dist/common.js +1 -1
  78. package/dist/main.js +1 -1
  79. package/dist/primeicons.eot +0 -0
  80. package/dist/primeicons.svg +62 -9
  81. package/dist/primeicons.ttf +0 -0
  82. package/dist/primeicons.woff +0 -0
  83. package/dist/primeicons.woff2 +0 -0
  84. package/dist/styles.css +1 -1
  85. package/license.txt +2 -1
  86. package/local.env +1 -0
  87. package/main.js +1 -1
  88. package/package.json +7 -4
  89. package/sandbox/assets/schema-types/types.js +257 -18
  90. package/sandbox/package.json +1 -0
  91. package/sandbox/sandbox.js +1 -1
  92. package/src/assets/schema-types/types.ts +1444 -136
  93. package/src/public/dist-db-masters/3rdpartylicenses.txt +1 -1
  94. package/src/public/dist-db-masters/browser/assets/data/mime_types.json +819 -0
  95. package/src/public/dist-db-masters/browser/assets/iframe_test.html +34 -1
  96. package/src/public/dist-db-masters/browser/assets/themes/arya-blue/theme.css +117 -5
  97. package/src/public/dist-db-masters/browser/assets/themes/arya-green/theme.css +117 -5
  98. package/src/public/dist-db-masters/browser/assets/themes/arya-orange/theme.css +117 -5
  99. package/src/public/dist-db-masters/browser/assets/themes/arya-purple/theme.css +117 -5
  100. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-amber/theme.css +174 -2
  101. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-blue/theme.css +174 -2
  102. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-cyan/theme.css +174 -2
  103. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-green/theme.css +174 -2
  104. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-indigo/theme.css +174 -2
  105. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-lime/theme.css +174 -2
  106. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-noir/theme.css +174 -2
  107. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-pink/theme.css +174 -2
  108. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-purple/theme.css +174 -2
  109. package/src/public/dist-db-masters/browser/assets/themes/aura-dark-teal/theme.css +174 -2
  110. package/src/public/dist-db-masters/browser/assets/themes/aura-light-amber/theme.css +174 -2
  111. package/src/public/dist-db-masters/browser/assets/themes/aura-light-blue/theme.css +174 -2
  112. package/src/public/dist-db-masters/browser/assets/themes/aura-light-cyan/theme.css +174 -2
  113. package/src/public/dist-db-masters/browser/assets/themes/aura-light-green/theme.css +174 -2
  114. package/src/public/dist-db-masters/browser/assets/themes/aura-light-indigo/theme.css +174 -2
  115. package/src/public/dist-db-masters/browser/assets/themes/aura-light-lime/theme.css +174 -2
  116. package/src/public/dist-db-masters/browser/assets/themes/aura-light-noir/theme.css +174 -2
  117. package/src/public/dist-db-masters/browser/assets/themes/aura-light-pink/theme.css +174 -2
  118. package/src/public/dist-db-masters/browser/assets/themes/aura-light-purple/theme.css +174 -2
  119. package/src/public/dist-db-masters/browser/assets/themes/aura-light-teal/theme.css +174 -2
  120. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-dark-blue/theme.css +166 -5
  121. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-dark-purple/theme.css +166 -5
  122. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-light-blue/theme.css +166 -5
  123. package/src/public/dist-db-masters/browser/assets/themes/bootstrap4-light-purple/theme.css +166 -5
  124. package/src/public/dist-db-masters/browser/assets/themes/fluent-light/theme.css +117 -5
  125. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-blue/theme.css +173 -1
  126. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-indigo/theme.css +173 -1
  127. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-purple/theme.css +173 -1
  128. package/src/public/dist-db-masters/browser/assets/themes/lara-dark-teal/theme.css +173 -1
  129. package/src/public/dist-db-masters/browser/assets/themes/lara-light-blue/theme.css +222 -1
  130. package/src/public/dist-db-masters/browser/assets/themes/lara-light-indigo/theme.css +222 -1
  131. package/src/public/dist-db-masters/browser/assets/themes/lara-light-purple/theme.css +222 -1
  132. package/src/public/dist-db-masters/browser/assets/themes/lara-light-teal/theme.css +222 -1
  133. package/src/public/dist-db-masters/browser/assets/themes/luna-amber/theme.css +117 -5
  134. package/src/public/dist-db-masters/browser/assets/themes/luna-blue/theme.css +117 -5
  135. package/src/public/dist-db-masters/browser/assets/themes/luna-green/theme.css +117 -5
  136. package/src/public/dist-db-masters/browser/assets/themes/luna-pink/theme.css +117 -5
  137. package/src/public/dist-db-masters/browser/assets/themes/md-dark-deeppurple/theme.css +187 -4
  138. package/src/public/dist-db-masters/browser/assets/themes/md-dark-indigo/theme.css +187 -4
  139. package/src/public/dist-db-masters/browser/assets/themes/md-light-deeppurple/theme.css +187 -4
  140. package/src/public/dist-db-masters/browser/assets/themes/md-light-indigo/theme.css +187 -4
  141. package/src/public/dist-db-masters/browser/assets/themes/mdc-dark-deeppurple/theme.css +187 -4
  142. package/src/public/dist-db-masters/browser/assets/themes/mdc-dark-indigo/theme.css +187 -4
  143. package/src/public/dist-db-masters/browser/assets/themes/mdc-light-deeppurple/theme.css +187 -4
  144. package/src/public/dist-db-masters/browser/assets/themes/mdc-light-indigo/theme.css +187 -4
  145. package/src/public/dist-db-masters/browser/assets/themes/mira/theme.css +117 -5
  146. package/src/public/dist-db-masters/browser/assets/themes/nano/theme.css +117 -5
  147. package/src/public/dist-db-masters/browser/assets/themes/nova/theme.css +117 -5
  148. package/src/public/dist-db-masters/browser/assets/themes/nova-accent/theme.css +117 -5
  149. package/src/public/dist-db-masters/browser/assets/themes/nova-alt/theme.css +117 -5
  150. package/src/public/dist-db-masters/browser/assets/themes/rhea/theme.css +117 -5
  151. package/src/public/dist-db-masters/browser/assets/themes/saga-blue/theme.css +117 -5
  152. package/src/public/dist-db-masters/browser/assets/themes/saga-green/theme.css +117 -5
  153. package/src/public/dist-db-masters/browser/assets/themes/saga-orange/theme.css +117 -5
  154. package/src/public/dist-db-masters/browser/assets/themes/saga-purple/theme.css +117 -5
  155. package/src/public/dist-db-masters/browser/assets/themes/soho-dark/theme.css +117 -5
  156. package/src/public/dist-db-masters/browser/assets/themes/soho-light/theme.css +117 -5
  157. package/src/public/dist-db-masters/browser/assets/themes/tailwind-light/theme.css +117 -5
  158. package/src/public/dist-db-masters/browser/assets/themes/vela-blue/theme.css +117 -5
  159. package/src/public/dist-db-masters/browser/assets/themes/vela-green/theme.css +117 -5
  160. package/src/public/dist-db-masters/browser/assets/themes/vela-orange/theme.css +117 -5
  161. package/src/public/dist-db-masters/browser/assets/themes/vela-purple/theme.css +117 -5
  162. package/src/public/dist-db-masters/browser/assets/themes/viva-dark/theme.css +117 -5
  163. package/src/public/dist-db-masters/browser/assets/themes/viva-light/theme.css +117 -5
  164. package/src/public/dist-db-masters/browser/index.html +2 -0
  165. package/src/public/dist-db-masters/browser/main.js +58 -62
  166. package/src/public/dist-db-masters/browser/polyfills.js +2 -2
  167. package/dist/1464.js +0 -1
  168. package/dist/1840.js +0 -1
  169. package/dist/2443.js +0 -1
  170. package/dist/9208.js +0 -1
  171. package/dist/assets/images/icons/event.png +0 -0
  172. package/dist/assets/images/icons/license.png +0 -0
  173. package/dist/assets/images/icons/masters.png +0 -0
package/dist/148.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(8176),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(9208),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(8176),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(5765),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
package/dist/1558.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{1558:(A,M,i)=>{i.r(M),i.d(M,{SchedulerManM:()=>T});var c=i(7664),e=i(8176),o=i(4946),h=i(6607);let m=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(p){return new(p||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(p,P){1&p&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=i(3726),D=i(885);const g=[{path:"scheduler-layout",component:m,canActivate:[d.P]}];let T=(()=>{class _{static \u0275fac=function(p){return new(p||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,D.R]})}return _})()},6607:(A,M,i)=>{i.d(M,{V:()=>ce});var c=i(5861),e=i(4946),o=i(3157),h=i(328),m=i(6212),d=i(6990),g=i(1162),I=i(5085),T=i(921),_=i(1042),O=i(7240),S=i(9961),p=i(5219),P=i(2189),y=i(5852),Z=i(7414),L=i(2915),w=i(7664),R=i(95),W=i(6814),C=i(5431),U=i(7680),N=i(3259),K=i(8057),b=i(8479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.clone())}),e._UZ(1,"i",20),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,B,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function j(n,r){1&n&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function V(n,r){1&n&&e._UZ(0,"th")}function $(n,r){1&n&&e._UZ(0,"th",36)}function q(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,j,2,0,"th",32),e._UZ(2,"th",33)(3,"th",34),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,V,1,0,"th",6),e.YNc(7,$,1,0,"th",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(5),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isMultiSelect)}}function X(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",41),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function z(n,r){1&n&&e._UZ(0,"i",42)}function ee(n,r){1&n&&e._UZ(0,"i",43)}function te(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",44)(2,"p-checkbox",45),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=a)})("click",function(a){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(a))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ne(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,te,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const se=function(){return["/api-info/api-testing/testing"]},ae=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function ie(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",38)(2,"a",46),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",47),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,se))("queryParams",e.WLB(3,ae,s.authCS.getUserId(),t._id))}}function re(n,r){if(1&n&&(e.TgZ(0,"tr",37),e.YNc(1,X,2,2,"td",6),e.TgZ(2,"td",38)(3,"span"),e._uU(4),e.qZA()(),e.TgZ(5,"td"),e.YNc(6,z,1,0,"i",39),e.YNc(7,ee,1,0,"i",40),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.YNc(10,ne,2,1,"td",6),e.YNc(11,ie,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=r.rowIndex,a=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.isMultiSelect),e.xp6(3),e.Oqu(s+1),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",a.isLPM),e.xp6(1),e.Q6J("ngIf",!a.isMultiSelect)}}function le(n,r){1&n&&e._UZ(0,"p-progressSpinner",48)}function oe(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.selectionChange())})("dblclick",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.dblClickSchedulerList())}),e.YNc(2,q,8,3,"ng-template",29),e.YNc(3,re,12,8,"ng-template",30),e.qZA(),e.YNc(4,le,1,0,"p-progressSpinner",31),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let ce=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=T.dN;schedulerManFormC;constructor(t,s,a,l,x,f,u,v,E,_e){this.schedulerS=t,this.generalS=s,this.notificationS=a,this.confirmationService=l,this.navigationCS=x,this.authCS=f,this.constantsS=u,this.eventCenterS=v,this.cd=E,this.router=_e}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(a){a.length&&t.loadGridData()});return function(a){return s.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var a=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(m.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const f=x.split(","),u=d.intersection(d.keys(t.rowsMap),f),v=[];for(const E of u)t.rowsMap[E]&&v.push(t.rowsMap[E]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(u),t.eventCenterS.filterInLog.schedulersIds.next(u)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const f=t.eventCenterS.group.selectedGroups.value[0];for(const u of f?.queryParams?.schedulerNames)t.rowsMapName[u]&&(t.rowsMapName[u].saveResponseInLog=f.schedulersLog?.[u]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(m.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,I.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(m.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(m.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(O.b),e.Y36(S.W),e.Y36(p.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,a){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(a.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Schedulers",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 schedulers-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: 40px;",4,"ngIf"],[2,"width","80px"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","60px"],[3,"pSelectableRow"],[1,"text-center"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[3,"value","pSelectableRow"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["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"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,Q,6,3,"span",6),e.YNc(9,Y,3,2,"span",7),e.YNc(10,k,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,oe,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!a.isReadOnly),e.xp6(1),e.Q6J("ngIf",a.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",a.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",a.data))},dependencies:[w.rH,R.JJ,R.On,W.O5,C.iA,p.jx,C.Ei,C.UA,C.Mo,U.G,N.u,K.XZ,b.o],encapsulation:2})}return n})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{1558:(R,M,i)=>{i.r(M),i.d(M,{SchedulerManM:()=>E});var c=i(7664),e=i(8176),o=i(4946),h=i(6607);let f=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(u,P){1&u&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=i(3726),D=i(885);const g=[{path:"scheduler-layout",component:f,canActivate:[d.P]}];let E=(()=>{class _{static \u0275fac=function(u){return new(u||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,D.R]})}return _})()},6607:(R,M,i)=>{i.d(M,{V:()=>de});var c=i(5861),e=i(4946),o=i(3157),h=i(328),f=i(6212),d=i(6990),g=i(1162),I=i(5085),E=i(921),_=i(1042),A=i(7240),S=i(9961),u=i(5219),P=i(2189),y=i(5852),Z=i(7414),L=i(2915),w=i(7664),O=i(95),W=i(6814),C=i(5431),U=i(7680),N=i(3259),b=i(8057),K=i(8479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.clone())}),e._UZ(1,"i",20),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(2);return e.KtG(a.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,Q,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=a)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function j(n,r){1&n&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function V(n,r){1&n&&e._UZ(0,"th",36)}function $(n,r){1&n&&e._UZ(0,"th")}function q(n,r){1&n&&e._UZ(0,"th",37)}function X(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,j,2,0,"th",32),e.YNc(2,V,1,0,"th",33),e._UZ(3,"th",34),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,$,1,0,"th",6),e.YNc(7,q,1,0,"th",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable),e.xp6(4),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable)}}function z(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",42),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ee(n,r){if(1&n&&(e.TgZ(0,"td",43)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw().rowIndex;e.xp6(2),e.Oqu(t+1)}}function te(n,r){1&n&&e._UZ(0,"i",44)}function ne(n,r){1&n&&e._UZ(0,"i",45)}function se(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",46)(2,"p-checkbox",47),e.NdJ("ngModelChange",function(a){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=a)})("click",function(a){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(a))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ae(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,se,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const ie=function(){return["/api-info/api-testing/testing"]},re=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function le(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",43)(2,"a",48),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",49),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,ie))("queryParams",e.WLB(3,re,s.authCS.getUserId(),t._id))}}function oe(n,r){if(1&n&&(e.TgZ(0,"tr",38),e.YNc(1,z,2,2,"td",6),e.YNc(2,ee,3,1,"td",39),e.TgZ(3,"td"),e.YNc(4,te,1,0,"i",40),e.YNc(5,ne,1,0,"i",41),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.YNc(8,ae,2,1,"td",6),e.YNc(9,le,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",s.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(2),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",s.isLPM),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function ce(n,r){1&n&&e._UZ(0,"p-progressSpinner",50)}function _e(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(a){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.selectionChange())})("dblclick",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.dblClickSchedulerList())}),e.YNc(2,X,8,4,"ng-template",29),e.YNc(3,oe,10,8,"ng-template",30),e.qZA(),e.YNc(4,ce,1,0,"p-progressSpinner",31),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let de=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=E.dN;schedulerManFormC;constructor(t,s,a,l,x,m,p,v,T,pe){this.schedulerS=t,this.generalS=s,this.notificationS=a,this.confirmationService=l,this.navigationCS=x,this.authCS=m,this.constantsS=p,this.eventCenterS=v,this.cd=T,this.router=pe}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(a){a.length&&t.loadGridData()});return function(a){return s.apply(this,arguments)}}())),this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var a=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(f.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const m=x.split(","),p=d.intersection(d.keys(t.rowsMap),m),v=[];for(const T of p)t.rowsMap[T]&&v.push(t.rowsMap[T]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(p),t.eventCenterS.filterInLog.schedulersIds.next(p)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const m=t.eventCenterS.group.selectedGroups.value[0];for(const p of m?.queryParams?.schedulerNames)t.rowsMapName[p]&&(t.rowsMapName[p].saveResponseInLog=m.schedulersLog?.[p]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return a.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(f.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,I.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(f.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(A.b),e.Y36(S.W),e.Y36(u.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,a){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(a.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Schedulers",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 schedulers-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: 40px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["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"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,B,6,3,"span",6),e.YNc(9,Y,3,2,"span",7),e.YNc(10,k,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,_e,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!a.isReadOnly),e.xp6(1),e.Q6J("ngIf",a.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",a.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(a.eventCenterS.group.apisRegex.allSchedulers||a.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",a.data))},dependencies:[w.rH,O.JJ,O.On,W.O5,C.iA,u.jx,C.Ei,C.UA,C.Mo,U.G,N.u,b.XZ,K.o],encapsulation:2})}return n})()}}]);
package/dist/1678.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1678,6925,8374,8682,1617],{7747:(U,E,i)=>{i.d(E,{o:()=>j});var d=i(5861),e=i(95),u=i(3157),g=i(328),v=i(6990),M=i(7848),h=i(1162),n=i(4946),O=i(9961),A=i(3429),x=i(7240),s=i(5852),R=i(1429),b=i(2915),w=i(115),F=i(7414),N=i(6814),P=i(2660),y=i(7680),L=i(3965);function Z(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",29),n._uU(2," Add Instance"),n.qZA())}function K(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",30),n._uU(2," View Instance"),n.qZA())}function B(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",31),n._uU(2," Edit Instance"),n.qZA())}function J(f,C){if(1&f&&(n.TgZ(0,"div")(1,"div",10)(2,"label",11),n._uU(3,"Username"),n.qZA(),n.TgZ(4,"div",12),n._UZ(5,"p-dropdown",32),n.qZA()(),n.TgZ(6,"div",10)(7,"label",11),n._uU(8,"Password"),n.qZA(),n.TgZ(9,"div",12),n._UZ(10,"p-dropdown",33),n.qZA()(),n.TgZ(11,"div",10)(12,"label",11),n._uU(13,"Privilege"),n.qZA(),n.TgZ(14,"div",12),n._UZ(15,"p-dropdown",34),n.qZA()()()),2&f){const a=n.oxw();n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.privileges)("filter",!0)}}function W(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"a",35),n.NdJ("click",function(){n.CHM(a);const r=n.oxw();return n.KtG(r.openSecret())}),n._UZ(1,"i",36),n._uU(2," Open Secret "),n.qZA()}}function G(f,C){1&f&&n._UZ(0,"i",37)}function Y(f,C){1&f&&n._UZ(0,"i",38)}function Q(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Save Instance"),n.qZA())}function k(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Update Instance"),n.qZA())}function V(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"button",39),n.NdJ("click",function(){n.CHM(a);const r=n.oxw();return n.KtG(r.save())}),n._UZ(1,"i",40),n.YNc(2,Q,2,0,"span",4),n.YNc(3,k,2,0,"span",4),n.qZA()}if(2&f){const a=n.oxw();n.Q6J("disabled",a.form.invalid||a.loading.form),n.xp6(2),n.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function z(f,C){1&f&&n._UZ(0,"p-progressSpinner",41)}let j=(()=>{class f{fb;ns;instanceS;generalS;authCS;dataProviderS;eventCenterS;secretS;constantsS;data;loading={form:!1};EFormMode=g.D;EInstanceType=M.d;IInstanceProps=h.Il;form;subscriptions=[];instanceTypes=[];privileges=[];connectionStringSecrets=[];instanceTested;isFromMarkTested;constructor(a,_,r,m,D,S,X,H,q){this.fb=a,this.ns=_,this.instanceS=r,this.generalS=m,this.authCS=D,this.dataProviderS=S,this.eventCenterS=X,this.secretS=H,this.constantsS=q}ngOnInit(){var a=this;return(0,d.Z)(function*(){a.instanceTypes=a.dataProviderS.getInstanceTypes(),a.privileges=a.dataProviderS.getListOfOraclePrivilege(),a.createForm(),a.subscriptions.push(a.data.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(r){if(r)if(a.form.enable(),yield a.loadConnectionStringFromSecret(),r.action===u.F.OPEN_FORM_IN_EDIT_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.instanceTested=!1,a.isFromMarkTested=!1}else if(r.action===u.F.OPEN_FORM_IN_VIEW_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.form.disable(),a.instanceTested=!1,a.isFromMarkTested=!1}else r.action===u.F.OPEN_FORM_IN_ADD_MODE&&(a.form.reset(),a.setDefaultValuesInForm(),a.instanceTested=!1,a.isFromMarkTested=!1)});return function(r){return _.apply(this,arguments)}}())),a.subscriptions.push(a.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(r){r&&r.action===u.F.UPDATED&&(a.eventCenterS.headerC.secManFormC.hideModal(),yield a.loadConnectionStringFromSecret())});return function(r){return _.apply(this,arguments)}}()))})()}showModal(){$("#idInstancesForm").modal("show")}hideModal(){$("#idInstancesForm").modal("hide")}createForm(){this.form=this.fb.group({type:[null,[e.kI.required]],name:[null,[e.kI.required]],connectionString:[null,[e.kI.required]],username:[null,[]],password:[null,[]],privilege:[null,[]],maxPoolConnections:[null,[e.kI.required]]}),this.manageValidations()}manageValidations(){this.form.valueChanges.subscribe(()=>{this.instanceTested=!1,this.isFromMarkTested=!1});const a=this.form.get(h.Il.type),_=this.form.get(h.Il.username),r=this.form.get(h.Il.password),m=this.form.get(h.Il.privilege);a.valueChanges.subscribe(function(){var D=(0,d.Z)(function*(S){S&&(S===M.d.ORACLE_DB?(_.setValidators([e.kI.required]),r.setValidators([e.kI.required]),m.setValidators([e.kI.required])):(_.setValidators([]),r.setValidators([]),m.setValidators([])),_.updateValueAndValidity(),r.updateValueAndValidity(),m.updateValueAndValidity())});return function(S){return D.apply(this,arguments)}}())}setDefaultValuesInForm(){this.loading.form=!1,this.form.get(h.Il.type).setValue(this.instanceTypes[0].value),this.form.get(h.Il.maxPoolConnections).setValue(1e4),this.form.get(h.Il.connectionString).setValue(this.connectionStringSecrets[0])}testInstance(a){var _=this;return(0,d.Z)(function*(){_.loading.form=!0;const r=m=>{_.instanceTested=!1,_.isFromMarkTested=!1,_.ns.showError(v.get(m,"errors[0].message","Unable to connect to the instance.")),_.loading.form=!1};try{const m=_.form.value;m.user=_.authCS.gUser._id,m.isFromSaveInstance=a,_.data.mode===g.D.EDIT&&(m._id=_.data.formData._id);const D=yield _.instanceS.testInstance(m).toPromise();D.success&&D.data?_.instanceTested=!0:r(D),_.loading.form=!1}catch(m){r(m.error)}})()}markInstanceTested(){this.instanceTested=!0,this.isFromMarkTested=!0}save(){var a=this;return(0,d.Z)(function*(){if(!a.isFromMarkTested&&(yield a.testInstance(!0),!a.instanceTested))return;const _=a.form.getRawValue();_.user=a.authCS.getUserId(),_.type===M.d.MONGO_DB&&(_.maxPoolConnections=1e4);try{let r;if(a.loading.form=!0,a.data.mode===g.D.ADD)r=yield a.instanceS.post(_).toPromise();else if(a.data.mode===g.D.EDIT){const m=v.merge({},a.data.formData,_);r=yield a.instanceS.put(a.data.formData._id,m,{select:h.iH._id}).toPromise()}a.ns.showSuccess(`Instance ${a.data.mode===g.D.ADD?"added":"edited"} successfully.`),a.data.eventChannel.emit({action:a.data.mode===g.D.ADD?u.F.SAVED:u.F.UPDATED}),a.loading.form=!1}catch(r){a.loading.form=!1,a.ns.showErrorFromResponse(r.error||r,"Unable to save instance.")}})()}loadConnectionStringFromSecret(){var a=this;return(0,d.Z)(function*(){try{const _=(yield a.instanceS.getConnectionStringSecret().toPromise())?.data;a.connectionStringSecrets=_}catch(_){a.ns.showErrorFromResponse(_.error||_,"Unable to load connection string.")}})()}openSecret(){var a=this;return(0,d.Z)(function*(){a.eventCenterS.headerC.dataSecretForm.formData=yield a.getDefaultSecret(),a.eventCenterS.headerC.dataSecretForm.mode=g.D.EDIT,a.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),a.eventCenterS.headerC.secManFormC.showModal()})()}getDefaultSecret(){var a=this;return(0,d.Z)(function*(){const _={find:{user:a.authCS.getUserId(),active:!0,isDefault:!0}};return(yield a.secretS.query(_).toPromise()).data?.[0]})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(_){return new(_||f)(n.Y36(e.qu),n.Y36(O.W),n.Y36(A.E),n.Y36(x.b),n.Y36(s.D),n.Y36(R.B),n.Y36(b.u),n.Y36(w.e),n.Y36(F.L))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-w-instances-form"]],inputs:{data:"data"},decls:48,vars:17,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idInstancesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",2,"z-index","1049"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],[1,"card","flex","justify-content-center"],["formControlName","type","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide instance name",1,"form-control","form-control-sm"],["formControlName","connectionString","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],[1,"form-group","row",3,"hidden"],["formControlName","maxPoolConnections","min","1","name","maxPoolConnections","spellcheck","false","type","number",1,"form-control","form-control-sm"],[1,"modal-footer","d-block"],["type","button",1,"btn","btn-sm","btn-secondary","float-left",3,"disabled","click"],["class","fas fa-check fa-fw text-success",4,"ngIf"],["class","fas fa-question fa-fw text-warning",4,"ngIf"],["class","btn btn-primary btn-sm float-right ml-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary","float-right",3,"disabled"],[1,"fas","fa-times","text-danger","fa-fw"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","username","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","password","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","privilege","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],[1,"fas","fa-check","fa-fw","text-success"],[1,"fas","fa-question","fa-fw","text-warning"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","ml-2",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(_,r){1&_&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,Z,3,0,"span",4),n.YNc(5,K,3,0,"span",4),n.YNc(6,B,3,0,"span",4),n.TgZ(7,"button",5)(8,"span",6),n._UZ(9,"i",7),n.qZA()()(),n.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),n._uU(14,"Database Type"),n.qZA(),n.TgZ(15,"div",12)(16,"div",13),n._UZ(17,"p-dropdown",14),n.qZA()()(),n.TgZ(18,"div",10)(19,"label",11),n._uU(20,"Instance Name"),n.qZA(),n.TgZ(21,"div",12),n._UZ(22,"input",15),n.qZA()(),n.YNc(23,J,16,6,"div",4),n.TgZ(24,"div")(25,"div",10)(26,"label",11),n._uU(27,"Connection String"),n.qZA(),n.TgZ(28,"div",12),n._UZ(29,"p-dropdown",16),n.qZA(),n.TgZ(30,"div",17),n.YNc(31,W,3,0,"a",18),n.qZA()()(),n.TgZ(32,"div",19)(33,"label",11),n._uU(34,"Max Pool Connections"),n.qZA(),n.TgZ(35,"div",12),n._UZ(36,"input",20),n.qZA()()()(),n.TgZ(37,"div",21)(38,"div")(39,"button",22),n.NdJ("click",function(){return r.testInstance()}),n.YNc(40,G,1,0,"i",23),n.YNc(41,Y,1,0,"i",24),n._uU(42," Test Instance "),n.qZA(),n.YNc(43,V,4,3,"button",25),n.TgZ(44,"button",26),n._UZ(45,"i",27),n._uU(46," Close"),n.qZA()()(),n.YNc(47,z,1,0,"p-progressSpinner",28),n.qZA()()()),2&_&&(n.xp6(4),n.Q6J("ngIf",r.data.mode===r.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",r.data.mode===r.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",r.data.mode===r.EFormMode.EDIT),n.xp6(5),n.Q6J("formGroup",r.form),n.xp6(6),n.Q6J("options",r.instanceTypes)("filter",!0),n.xp6(6),n.Q6J("ngIf",r.form.get("type").value===r.EInstanceType.ORACLE_DB),n.xp6(6),n.Q6J("options",r.connectionStringSecrets)("filter",!0),n.xp6(2),n.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),n.xp6(1),n.Q6J("hidden",r.form.get("type").value===r.EInstanceType.MONGO_DB),n.xp6(7),n.Q6J("disabled",r.form.invalid||r.loading.form),n.xp6(1),n.Q6J("ngIf",r.instanceTested),n.xp6(1),n.Q6J("ngIf",!r.instanceTested),n.xp6(2),n.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),n.xp6(1),n.Q6J("disabled",r.loading.form),n.xp6(3),n.Q6J("ngIf",r.loading.form))},dependencies:[e._Y,e.Fj,e.wV,e.JJ,e.JL,e.qQ,e.sg,e.u,N.O5,P.y,y.G,L.Lt],encapsulation:2})}return f})()},3885:(U,E,i)=>{i.d(E,{f:()=>se});var d=i(5861),e=i(4946),u=i(3157),g=i(328),v=i(6212),T=i(6990),h=i(1162),n=i(6925),O=i(7848),A=i(3429),x=i(7240),s=i(9961),R=i(2189),b=i(5852),w=i(7414),F=i(7664),N=i(2915),P=i(5219),y=i(95),L=i(6814),Z=i(5431),K=i(7680),B=i(3259),J=i(5609),W=i(8057),G=i(7747);const Y=["instancesFormC"];function Q(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.edit())}),e._UZ(1,"i",21),e.qZA()}}function k(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.clone())}),e._UZ(1,"i",23),e.qZA()}}function V(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.active())}),e._UZ(1,"i",25),e.qZA()}}function z(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",26),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.inactiveDialog())}),e._UZ(1,"i",27),e.qZA()}}function j(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(2);return e.KtG(o.removePermanentDialog())}),e._UZ(1,"i",29),e.qZA()}}function f(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span")(1,"a",9),e._UZ(2,"img",10),e.qZA(),e.TgZ(3,"span",11)(4,"p-inputSwitch",12),e.NdJ("ngModelChange",function(o){e.CHM(t);const I=e.oxw();return e.KtG(I.showAll=o)})("onChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.showAllChanges())}),e.qZA()(),e.TgZ(5,"span",13),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.add())}),e._UZ(6,"i",14),e.qZA(),e.YNc(7,Q,2,0,"span",15),e.YNc(8,k,2,0,"span",16),e.YNc(9,V,2,0,"span",17),e.YNc(10,z,2,0,"span",18),e.YNc(11,j,2,0,"span",19),e.qZA()}if(2&l){const t=e.oxw();e.xp6(4),e.Q6J("ngModel",t.showAll),e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length&&!1===t.selectedRows[0].active),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length&&!0===t.selectedRows[0].active),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length&&!1===t.selectedRows[0].active)}}function C(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),e.NdJ("ngModelChange",function(o){e.CHM(t);const I=e.oxw();return e.KtG(I.eventCenterS.group.apisRegex.allInstances=o)}),e.qZA()()()}if(2&l){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allInstances)("binary",!0)}}function a(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),e.NdJ("ngModelChange",function(o){e.CHM(t);const I=e.oxw();return e.KtG(I.eventCenterS.filterInLog.apisRegex.allInstances=o)}),e.qZA()()()}if(2&l){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allInstances)("binary",!0)}}function _(l,p){if(1&l&&(e.TgZ(0,"div")(1,"div",33),e._uU(2),e.qZA()()),2&l){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allInstancesPermitted)}}function r(l,p){1&l&&(e.TgZ(0,"th",42),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function m(l,p){1&l&&e._UZ(0,"th",41)}function D(l,p){if(1&l&&(e.TgZ(0,"tr"),e.YNc(1,r,2,0,"th",39),e.YNc(2,m,1,0,"th",40),e._UZ(3,"th",41),e.TgZ(4,"th"),e._uU(5,"Instance Name"),e.qZA()()),2&l){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.showCheckbox),e.xp6(1),e.Q6J("ngIf",t.showAll)}}function S(l,p){if(1&l&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",45),e.qZA()),2&l){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function X(l,p){1&l&&e._UZ(0,"i",48)}function H(l,p){1&l&&e._UZ(0,"i",49)}function q(l,p){if(1&l&&(e.TgZ(0,"td"),e.YNc(1,X,1,0,"i",46),e.YNc(2,H,1,0,"i",47),e.qZA()),2&l){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngIf",t.active),e.xp6(1),e.Q6J("ngIf",!t.active)}}function ee(l,p){if(1&l&&(e.TgZ(0,"tr",43),e.YNc(1,S,2,2,"td",3),e.YNc(2,q,3,2,"td",3),e.TgZ(3,"td"),e._UZ(4,"img",44),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA()()),2&l){const t=p.$implicit,c=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",c.showCheckbox),e.xp6(1),e.Q6J("ngIf",c.showAll),e.xp6(2),e.Akn("MONGO_DB"==t.type?"width:0.5rem":"width:1rem"),e.s9C("src",c.getInstanceIconUrl(t.type),e.LSH),e.s9C("alt",t.type),e.xp6(2),e.Oqu(t.name)}}function te(l,p){1&l&&e._UZ(0,"p-progressSpinner",50)}function ne(l,p){if(1&l){const t=e.EpF();e.TgZ(0,"div",34)(1,"p-table",35),e.NdJ("selectionChange",function(o){e.CHM(t);const I=e.oxw();return e.KtG(I.selectedRows=o)})("selectionChange",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.instanceSelected())})("dblclick",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.dblClickInstance())}),e.YNc(2,D,6,2,"ng-template",36),e.YNc(3,ee,7,8,"ng-template",37),e.qZA(),e.YNc(4,te,1,0,"p-progressSpinner",38),e.qZA()}if(2&l){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let se=(()=>{class l{instanceS;generalS;notificationS;navigationCS;authCS;constantsS;router;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;instancesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;gridKey=h.iH._id;selectedRows=[];instanceIdsSkipSubscription=!1;EInstanceType=O.d;constructor(t,c,o,I,ae,ie,oe,re,ce,le){this.instanceS=t,this.generalS=c,this.notificationS=o,this.navigationCS=I,this.authCS=ae,this.constantsS=ie,this.router=oe,this.cd=re,this.eventCenterS=ce,this.confirmationService=le}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.instance.selectedInstances.next([]),!t.isDependentOnGroup&&!t.isFilterLogTable&&(yield t.loadGridData()),t.isDependentOnGroup&&t.subscriptions.push(t.eventCenterS.group.selectedGroups.subscribe(function(){var c=(0,d.Z)(function*(o){o.length&&(yield t.loadGridData())});return function(o){return c.apply(this,arguments)}}())),t.isFilterLogTable&&t.subscriptions.push(t.eventCenterS.filterInLog.refreshGrid.subscribe((0,d.Z)(function*(){t.instanceIdsSkipSubscription||t.loadGridData()}))),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var c=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.instancesFormC.hideModal(),t.loadGridData())});return function(o){return c.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - Instances")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){if(t.resetGridAndUrl(),t.isDependentOnGroup&&(!t.eventCenterS.group.selectedGroups.value||!t.eventCenterS.group.selectedGroups.value.length))return;t.loading.grid=!0;const c={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,label:1,active:1,type:1}};t.showAll&&delete c.find.active,t.subscriptions.push(t.instanceS.query(c).subscribe(o=>{o.success?(t.selectedRows=[],t.rows=o.data,t.rowsMap=T.keyBy(t.rows,h.iH._id)):t.resetGridAndUrl();const I=t.navigationCS.getQueryParam(v.p.instance);I&&(t.selectedRows=t.getObjectsFromIdArray(I.split(",")),t.eventCenterS.instance.selectedInstances.next(t.selectedRows)),t.isDependentOnGroup&&(t.selectedRows=t.getObjectsFromIdArray(t.eventCenterS.group.instanceIds.value)),t.isFilterLogTable&&(t.selectedRows=t.getObjectsFromIdArray(t.eventCenterS.filterInLog.instanceIds.value)),t.loading.grid=!1,t.cd.detectChanges()}))})()}getObjectsFromIdArray(t){const c=[];for(const o of t)this.rowsMap[o]&&c.push(this.rowsMap[o]);return c}resetGridAndUrl(){var t=this;return(0,d.Z)(function*(){t.rows=[],t.rowsMap={},t.selectedRows=[],t.eventCenterS.instance.selectedInstances.next([])})()}showAllChanges(){var t=this;return(0,d.Z)(function*(){yield t.resetSelectedRows(),yield t.loadGridData()})()}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE}),this.instancesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_VIEW_MODE}),this.instancesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.instancesFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0])return;const c=(yield t.instanceS.getById(t.selectedRows[0]._id).toPromise()).data;delete c._id,c.name=`${c.name}-clone`,(yield t.instanceS.post(c).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.instance.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.instance.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.instance.cloneError)}})()}inactiveDialog(){var t=this;return(0,d.Z)(function*(){var c;t.confirmationService.confirm({message:t.constantsS.instance.inactiveConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield t.inactive()}),function(){return c.apply(this,arguments)})})})()}removePermanentDialog(){var t=this;return(0,d.Z)(function*(){var c;t.confirmationService.confirm({message:t.constantsS.instance.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield t.removePermanent()}),function(){return c.apply(this,arguments)})})})()}active(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const c=yield t.instanceS.makeActive(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,c.success?(t.notificationS.showSuccess(t.constantsS.instance.active),t.loadGridData()):t.notificationS.showErrorFromResponse(c,t.constantsS.instance.activeError)})()}inactive(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;try{yield t.instanceS.softDelete(t.selectedRows[0]._id).toPromise(),t.notificationS.showSuccess(t.constantsS.instance.inactive),yield t.resetSelectedRows(),t.loadGridData()}catch(c){const o=c?.error?.errors?.[0]?.message;t.notificationS.showError(o||t.constantsS.instance.inactiveError)}t.loading.grid=!1})()}removePermanent(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const c=yield t.instanceS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,c.success?(t.notificationS.showSuccess(t.constantsS.instance.removePermanent),yield t.resetSelectedRows(),t.loadGridData()):t.notificationS.showErrorFromResponse(c,t.constantsS.instance.removePermanentError)})()}resetSelectedRows(){var t=this;return(0,d.Z)(function*(){t.selectedRows.length=0,t.eventCenterS.instance.selectedInstances.next([]),yield t.navigationCS.setQueryParam(v.p.instance,null)})()}instanceSelected(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.instance.selectedInstances.next(t.selectedRows),t.isDependentOnGroup||t.isFilterLogTable?t.setInstanceIds():(yield t.navigationCS.setQueryParam(v.p.instance,T.map(t.selectedRows,"_id").join(",")||null),yield t.generalS.resetUrlParams([v.p.database,v.p.collection,v.p.collection_api]))})()}dblClickInstance(){this.selectedRows.length&&!this.isDependentOnGroup&&!this.isFilterLogTable&&this.edit()}setInstanceIds(){this.instanceIdsSkipSubscription=!0,this.eventCenterS.filterInLog.instanceIds.next(T.map(this.selectedRows,"_id")),this.eventCenterS.group.instanceIds.next(T.map(this.selectedRows,"_id")),this.instanceIdsSkipSubscription=!1}getInstanceIconUrl(t){return t===O.d.SQL_SERVER_DB?"./assets/images/svg/Microsoft_SQL_Server_DB_No_Logo.svg":t===O.d.ORACLE_DB?"./assets/images/svg/Oracle_DB_No_Logo.svg":`./assets/images/svg/${t}.svg`}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=n.Yp;static \u0275fac=function(c){return new(c||l)(e.Y36(A.E),e.Y36(x.b),e.Y36(s.W),e.Y36(R.S),e.Y36(b.D),e.Y36(w.L),e.Y36(F.F0),e.Y36(e.sBO),e.Y36(N.u),e.Y36(P.YP))};static \u0275cmp=e.Xpm({type:l,selectors:[["app-w-instances"]],viewQuery:function(c,o){if(1&c&&e.Gf(Y,5),2&c){let I;e.iGM(I=e.CRH())&&(o.instancesFormC=I.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:13,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Instances",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["instancesFormC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"float-right","position-relative"],["styleClass","ml-3 mt-2px","tooltipPosition","right","pTooltip","Show All",3,"ngModel","ngModelChange","onChange"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Active",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Inactive",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Make Active",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-check","text-success","fa-fw"],["pTooltip","Make Inactive",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","align-middle","text-danger"],["pTooltip","All Instances",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped instance-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 40px;",4,"ngIf"],[2,"width","40px"],[2,"width","45px"],[3,"pSelectableRow"],[3,"src","alt"],[3,"value","pSelectableRow"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(c,o){1&c&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Instances"),e.qZA(),e.YNc(5,f,12,6,"span",3),e.YNc(6,C,3,2,"span",4),e.YNc(7,a,3,2,"span",4),e.qZA(),e.TgZ(8,"div",5),e.YNc(9,_,3,1,"div",3),e.YNc(10,ne,5,7,"div",6),e.qZA()(),e._UZ(11,"app-w-instances-form",7,8)),2&c&&(e.xp6(5),e.Q6J("ngIf",!o.isReadOnly),e.xp6(1),e.Q6J("ngIf",o.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",o.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",o.eventCenterS.group.apisRegex.allInstances||o.eventCenterS.filterInLog.apisRegex.allInstances),e.xp6(1),e.Q6J("ngIf",!(o.eventCenterS.group.apisRegex.allInstances||o.eventCenterS.filterInLog.apisRegex.allInstances)),e.xp6(1),e.Q6J("data",o.data))},dependencies:[y.JJ,y.On,L.O5,Z.iA,P.jx,Z.Ei,Z.UA,Z.Mo,K.G,B.u,J.Ql,W.XZ,G.o]})}return l})()},1678:(U,E,i)=>{i.r(E),i.d(E,{DashboardM:()=>h});var d=i(7664),e=i(8176),v=(i(3885),i(7747),i(4946));const T=[{path:"root",loadChildren:()=>i.e(891).then(i.bind(i,891)).then(n=>n.DashRootM)},{path:"redis-dashboard",loadChildren:()=>i.e(4110).then(i.bind(i,4110)).then(n=>n.RedisDashboardM)},{path:"summary-dashboard",loadChildren:()=>Promise.all([i.e(8592),i.e(1464)]).then(i.bind(i,1464)).then(n=>n.DashSummaryM)},{path:"developer",loadChildren:()=>i.e(3450).then(i.bind(i,3450)).then(n=>n.DashDevM)},{path:"welcome",loadChildren:()=>i.e(5334).then(i.bind(i,5334)).then(n=>n.AmWelcomeM)},{path:"ext-licenses",loadChildren:()=>i.e(7436).then(i.bind(i,7436)).then(n=>n.ExtLicensesM)}];let h=(()=>{class n{static \u0275fac=function(x){return new(x||n)};static \u0275mod=v.oAB({type:n});static \u0275inj=v.cJS({imports:[d.Bz.forChild(T),e.u]})}return n})()},6925:(U,E,i)=>{i.d(E,{Eg:()=>T,Yp:()=>u,ZF:()=>M,vT:()=>e});var e=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(e||{}),u=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(u||{}),T=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s}(T||{}),M=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(M||{})}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1678,6925,8374,8682,1617],{7747:(U,E,o)=>{o.d(E,{o:()=>H});var d=o(5861),t=o(95),u=o(3157),g=o(328),v=o(6990),x=o(7848),h=o(1162),n=o(4946),M=o(9961),A=o(3429),O=o(7240),s=o(5852),w=o(1429),R=o(2915),b=o(115),F=o(7414),N=o(6814),L=o(2660),P=o(7680),y=o(3965);function K(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",29),n._uU(2," Add Instance"),n.qZA())}function Z(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",30),n._uU(2," View Instance"),n.qZA())}function B(f,C){1&f&&(n.TgZ(0,"span"),n._UZ(1,"i",31),n._uU(2," Edit Instance"),n.qZA())}function J(f,C){if(1&f&&(n.TgZ(0,"div")(1,"div",10)(2,"label",11),n._uU(3,"Username"),n.qZA(),n.TgZ(4,"div",12),n._UZ(5,"p-dropdown",32),n.qZA()(),n.TgZ(6,"div",10)(7,"label",11),n._uU(8,"Password"),n.qZA(),n.TgZ(9,"div",12),n._UZ(10,"p-dropdown",33),n.qZA()(),n.TgZ(11,"div",10)(12,"label",11),n._uU(13,"Privilege"),n.qZA(),n.TgZ(14,"div",12),n._UZ(15,"p-dropdown",34),n.qZA()()()),2&f){const a=n.oxw();n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.connectionStringSecrets)("filter",!0),n.xp6(5),n.Q6J("options",a.privileges)("filter",!0)}}function W(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"a",35),n.NdJ("click",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.openSecret())}),n._UZ(1,"i",36),n._uU(2," Open Secret "),n.qZA()}}function Y(f,C){1&f&&n._UZ(0,"i",37)}function G(f,C){1&f&&n._UZ(0,"i",38)}function Q(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Save Instance"),n.qZA())}function k(f,C){1&f&&(n.TgZ(0,"span"),n._uU(1,"Update Instance"),n.qZA())}function V(f,C){if(1&f){const a=n.EpF();n.TgZ(0,"button",39),n.NdJ("click",function(){n.CHM(a);const l=n.oxw();return n.KtG(l.save())}),n._UZ(1,"i",40),n.YNc(2,Q,2,0,"span",4),n.YNc(3,k,2,0,"span",4),n.qZA()}if(2&f){const a=n.oxw();n.Q6J("disabled",a.form.invalid||a.loading.form),n.xp6(2),n.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function z(f,C){1&f&&n._UZ(0,"p-progressSpinner",41)}let H=(()=>{class f{fb;ns;instanceS;generalS;authCS;dataProviderS;eventCenterS;secretS;constantsS;data;loading={form:!1};EFormMode=g.D;EInstanceType=x.d;IInstanceProps=h.Il;form;subscriptions=[];instanceTypes=[];privileges=[];connectionStringSecrets=[];instanceTested;isFromMarkTested;constructor(a,_,l,m,D,S,j,X,q){this.fb=a,this.ns=_,this.instanceS=l,this.generalS=m,this.authCS=D,this.dataProviderS=S,this.eventCenterS=j,this.secretS=X,this.constantsS=q}ngOnInit(){var a=this;return(0,d.Z)(function*(){a.instanceTypes=a.dataProviderS.getInstanceTypes(),a.privileges=a.dataProviderS.getListOfOraclePrivilege(),a.createForm(),a.subscriptions.push(a.data.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(l){if(l)if(a.form.enable(),yield a.loadConnectionStringFromSecret(),l.action===u.F.OPEN_FORM_IN_EDIT_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.instanceTested=!1,a.isFromMarkTested=!1}else if(l.action===u.F.OPEN_FORM_IN_VIEW_MODE){const m=yield a.instanceS.getById(a.data.formData._id).toPromise();a.form.reset(),a.form.patchValue(m.data),a.form.disable(),a.instanceTested=!1,a.isFromMarkTested=!1}else l.action===u.F.OPEN_FORM_IN_ADD_MODE&&(a.form.reset(),a.setDefaultValuesInForm(),a.instanceTested=!1,a.isFromMarkTested=!1)});return function(l){return _.apply(this,arguments)}}())),a.subscriptions.push(a.eventCenterS.headerC.dataSecretForm.eventChannel.subscribe(function(){var _=(0,d.Z)(function*(l){l&&l.action===u.F.UPDATED&&(a.eventCenterS.headerC.secManFormC.hideModal(),yield a.loadConnectionStringFromSecret())});return function(l){return _.apply(this,arguments)}}()))})()}showModal(){$("#idInstancesForm").modal("show")}hideModal(){$("#idInstancesForm").modal("hide")}createForm(){this.form=this.fb.group({type:[null,[t.kI.required]],name:[null,[t.kI.required]],connectionString:[null,[t.kI.required]],username:[null,[]],password:[null,[]],privilege:[null,[]],maxPoolConnections:[null,[t.kI.required]]}),this.manageValidations()}manageValidations(){this.form.valueChanges.subscribe(()=>{this.instanceTested=!1,this.isFromMarkTested=!1});const a=this.form.get(h.Il.type),_=this.form.get(h.Il.username),l=this.form.get(h.Il.password),m=this.form.get(h.Il.privilege);a.valueChanges.subscribe(function(){var D=(0,d.Z)(function*(S){S&&(S===x.d.ORACLE_DB?(_.setValidators([t.kI.required]),l.setValidators([t.kI.required]),m.setValidators([t.kI.required])):(_.setValidators([]),l.setValidators([]),m.setValidators([])),_.updateValueAndValidity(),l.updateValueAndValidity(),m.updateValueAndValidity())});return function(S){return D.apply(this,arguments)}}())}setDefaultValuesInForm(){this.loading.form=!1,this.form.get(h.Il.type).setValue(this.instanceTypes[0].value),this.form.get(h.Il.maxPoolConnections).setValue(1e4),this.form.get(h.Il.connectionString).setValue(this.connectionStringSecrets[0])}testInstance(a){var _=this;return(0,d.Z)(function*(){_.loading.form=!0;const l=m=>{_.instanceTested=!1,_.isFromMarkTested=!1,_.ns.showError(v.get(m,"errors[0].message","Unable to connect to the instance.")),_.loading.form=!1};try{const m=_.form.value;m.user=_.authCS.gUser._id,m.isFromSaveInstance=a,_.data.mode===g.D.EDIT&&(m._id=_.data.formData._id);const D=yield _.instanceS.testInstance(m).toPromise();D.success&&D.data?_.instanceTested=!0:l(D),_.loading.form=!1}catch(m){l(m.error)}})()}markInstanceTested(){this.instanceTested=!0,this.isFromMarkTested=!0}save(){var a=this;return(0,d.Z)(function*(){if(!a.isFromMarkTested&&(yield a.testInstance(!0),!a.instanceTested))return;const _=a.form.getRawValue();_.user=a.authCS.getUserId(),_.type===x.d.MONGO_DB&&(_.maxPoolConnections=1e4);try{let l;if(a.loading.form=!0,a.data.mode===g.D.ADD)l=yield a.instanceS.post(_).toPromise();else if(a.data.mode===g.D.EDIT){const m=v.merge({},a.data.formData,_);l=yield a.instanceS.put(a.data.formData._id,m,{select:h.iH._id}).toPromise()}a.ns.showSuccess(`Instance ${a.data.mode===g.D.ADD?"added":"edited"} successfully.`),a.data.eventChannel.emit({action:a.data.mode===g.D.ADD?u.F.SAVED:u.F.UPDATED}),a.loading.form=!1}catch(l){a.loading.form=!1,a.ns.showErrorFromResponse(l.error||l,"Unable to save instance.")}})()}loadConnectionStringFromSecret(){var a=this;return(0,d.Z)(function*(){try{const _=(yield a.instanceS.getConnectionStringSecret().toPromise())?.data;a.connectionStringSecrets=_}catch(_){a.ns.showErrorFromResponse(_.error||_,"Unable to load connection string.")}})()}openSecret(){var a=this;return(0,d.Z)(function*(){a.eventCenterS.headerC.dataSecretForm.formData=yield a.getDefaultSecret(),a.eventCenterS.headerC.dataSecretForm.mode=g.D.EDIT,a.eventCenterS.headerC.dataSecretForm.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),a.eventCenterS.headerC.secManFormC.showModal()})()}getDefaultSecret(){var a=this;return(0,d.Z)(function*(){const _={find:{user:a.authCS.getUserId(),active:!0,isDefault:!0}};return(yield a.secretS.query(_).toPromise()).data?.[0]})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(_){return new(_||f)(n.Y36(t.qu),n.Y36(M.W),n.Y36(A.E),n.Y36(O.b),n.Y36(s.D),n.Y36(w.B),n.Y36(R.u),n.Y36(b.e),n.Y36(F.L))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-w-instances-form"]],inputs:{data:"data"},decls:48,vars:17,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idInstancesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal",2,"z-index","1049"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],[1,"card","flex","justify-content-center"],["formControlName","type","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide instance name",1,"form-control","form-control-sm"],["formControlName","connectionString","optionValue","value","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],[1,"col-2","p-0"],["class","d-block mt-2 text-info","href","javascript:","sava-no-dbl-click","",3,"click",4,"ngIf"],[1,"form-group","row",3,"hidden"],["formControlName","maxPoolConnections","min","1","name","maxPoolConnections","spellcheck","false","type","number",1,"form-control","form-control-sm"],[1,"modal-footer","d-block"],["type","button",1,"btn","btn-sm","btn-secondary","float-left",3,"disabled","click"],["class","fas fa-check fa-fw text-success",4,"ngIf"],["class","fas fa-question fa-fw text-warning",4,"ngIf"],["class","btn btn-primary btn-sm float-right ml-2","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary","float-right",3,"disabled"],[1,"fas","fa-times","text-danger","fa-fw"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["formControlName","username","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","password","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["formControlName","privilege","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter"],["href","javascript:","sava-no-dbl-click","",1,"d-block","mt-2","text-info",3,"click"],[1,"fas","fa-key","text-danger","fa-fw","mr-1"],[1,"fas","fa-check","fa-fw","text-success"],[1,"fas","fa-question","fa-fw","text-warning"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm","float-right","ml-2",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(_,l){1&_&&(n.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),n.YNc(4,K,3,0,"span",4),n.YNc(5,Z,3,0,"span",4),n.YNc(6,B,3,0,"span",4),n.TgZ(7,"button",5)(8,"span",6),n._UZ(9,"i",7),n.qZA()()(),n.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"label",11),n._uU(14,"Database Type"),n.qZA(),n.TgZ(15,"div",12)(16,"div",13),n._UZ(17,"p-dropdown",14),n.qZA()()(),n.TgZ(18,"div",10)(19,"label",11),n._uU(20,"Instance Name"),n.qZA(),n.TgZ(21,"div",12),n._UZ(22,"input",15),n.qZA()(),n.YNc(23,J,16,6,"div",4),n.TgZ(24,"div")(25,"div",10)(26,"label",11),n._uU(27,"Connection String"),n.qZA(),n.TgZ(28,"div",12),n._UZ(29,"p-dropdown",16),n.qZA(),n.TgZ(30,"div",17),n.YNc(31,W,3,0,"a",18),n.qZA()()(),n.TgZ(32,"div",19)(33,"label",11),n._uU(34,"Max Pool Connections"),n.qZA(),n.TgZ(35,"div",12),n._UZ(36,"input",20),n.qZA()()()(),n.TgZ(37,"div",21)(38,"div")(39,"button",22),n.NdJ("click",function(){return l.testInstance()}),n.YNc(40,Y,1,0,"i",23),n.YNc(41,G,1,0,"i",24),n._uU(42," Test Instance "),n.qZA(),n.YNc(43,V,4,3,"button",25),n.TgZ(44,"button",26),n._UZ(45,"i",27),n._uU(46," Close"),n.qZA()()(),n.YNc(47,z,1,0,"p-progressSpinner",28),n.qZA()()()),2&_&&(n.xp6(4),n.Q6J("ngIf",l.data.mode===l.EFormMode.ADD),n.xp6(1),n.Q6J("ngIf",l.data.mode===l.EFormMode.VIEW),n.xp6(1),n.Q6J("ngIf",l.data.mode===l.EFormMode.EDIT),n.xp6(5),n.Q6J("formGroup",l.form),n.xp6(6),n.Q6J("options",l.instanceTypes)("filter",!0),n.xp6(6),n.Q6J("ngIf",l.form.get("type").value===l.EInstanceType.ORACLE_DB),n.xp6(6),n.Q6J("options",l.connectionStringSecrets)("filter",!0),n.xp6(2),n.Q6J("ngIf",l.data.mode!==l.EFormMode.VIEW),n.xp6(1),n.Q6J("hidden",l.form.get("type").value===l.EInstanceType.MONGO_DB),n.xp6(7),n.Q6J("disabled",l.form.invalid||l.loading.form),n.xp6(1),n.Q6J("ngIf",l.instanceTested),n.xp6(1),n.Q6J("ngIf",!l.instanceTested),n.xp6(2),n.Q6J("ngIf",l.data.mode!==l.EFormMode.VIEW),n.xp6(1),n.Q6J("disabled",l.loading.form),n.xp6(3),n.Q6J("ngIf",l.loading.form))},dependencies:[t._Y,t.Fj,t.wV,t.JJ,t.JL,t.qQ,t.sg,t.u,N.O5,L.y,P.G,y.Lt],encapsulation:2})}return f})()},3885:(U,E,o)=>{o.d(E,{f:()=>ct});var d=o(5861),t=o(4946),u=o(3157),g=o(328),v=o(6212),T=o(6990),h=o(1162),n=o(6925),M=o(7848),A=o(3429),O=o(3366),s=o(7240),w=o(9961),R=o(2189),b=o(5852),F=o(7414),N=o(7664),L=o(2915),P=o(5219),y=o(95),K=o(6814),Z=o(5431),B=o(7680),J=o(3259),W=o(5609),Y=o(8057),G=o(7747);const Q=["instancesFormC"];function k(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",20),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.edit())}),t._UZ(1,"i",21),t.qZA()}}function V(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",22),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.clone())}),t._UZ(1,"i",23),t.qZA()}}function z(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",24),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.active())}),t._UZ(1,"i",25),t.qZA()}}function H(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",26),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.inactiveDialog())}),t._UZ(1,"i",27),t.qZA()}}function f(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",28),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.removePermanentDialog())}),t._UZ(1,"i",29),t.qZA()}}function C(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span")(1,"a",9),t._UZ(2,"img",10),t.qZA(),t.TgZ(3,"span",11)(4,"p-inputSwitch",12),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.showAll=r)})("onChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.showAllChanges())}),t.qZA()(),t.TgZ(5,"span",13),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.add())}),t._UZ(6,"i",14),t.qZA(),t.YNc(7,k,2,0,"span",15),t.YNc(8,V,2,0,"span",16),t.YNc(9,z,2,0,"span",17),t.YNc(10,H,2,0,"span",18),t.YNc(11,f,2,0,"span",19),t.qZA()}if(2&i){const e=t.oxw();t.xp6(4),t.Q6J("ngModel",e.showAll),t.xp6(3),t.Q6J("ngIf",e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!1===e.selectedRows[0].active),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!0===e.selectedRows[0].active),t.xp6(1),t.Q6J("ngIf",e.selectedRows.length&&!1===e.selectedRows[0].active)}}function a(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.eventCenterS.group.apisRegex.allInstances=r)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allInstances)("binary",!0)}}function _(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",30)(1,"label",31)(2,"p-checkbox",32),t.NdJ("ngModelChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.eventCenterS.filterInLog.apisRegex.allInstances=r)}),t.qZA()()()}if(2&i){const e=t.oxw();t.xp6(2),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allInstances)("binary",!0)}}function l(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",33),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allInstancesPermitted)}}function m(i,p){1&i&&(t.TgZ(0,"th",43),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function D(i,p){1&i&&t._UZ(0,"th",41)}function S(i,p){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Pre"),t.qZA())}function j(i,p){1&i&&(t.TgZ(0,"th",44),t._uU(1,"Post"),t.qZA())}function X(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,m,2,0,"th",39),t.YNc(2,D,1,0,"th",40),t._UZ(3,"th",41),t.TgZ(4,"th"),t._uU(5,"Instance Name"),t.qZA(),t.YNc(6,S,2,0,"th",42),t.YNc(7,j,2,0,"th",42),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",e.showAll),t.xp6(4),t.Q6J("ngIf",e.showHooksCount),t.xp6(1),t.Q6J("ngIf",e.showHooksCount)}}function q(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",49),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function tt(i,p){1&i&&t._UZ(0,"i",52)}function et(i,p){1&i&&t._UZ(0,"i",53)}function nt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,tt,1,0,"i",50),t.YNc(2,et,1,0,"i",51),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.active),t.xp6(1),t.Q6J("ngIf",!e.active)}}function st(i,p){if(1&i&&(t.TgZ(0,"td",54),t._uU(1),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.preHookCount||"")}}function at(i,p){if(1&i&&(t.TgZ(0,"td",54),t._uU(1),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Oqu(e.postHookCount||"")}}function ot(i,p){if(1&i&&(t.TgZ(0,"tr",45),t.YNc(1,q,2,2,"td",3),t.YNc(2,nt,3,2,"td",3),t.TgZ(3,"td"),t._UZ(4,"img",46),t.qZA(),t.TgZ(5,"td",47),t._uU(6),t.qZA(),t.YNc(7,st,2,1,"td",48),t.YNc(8,at,2,1,"td",48),t.qZA()),2&i){const e=p.$implicit,c=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",c.showCheckbox),t.xp6(1),t.Q6J("ngIf",c.showAll),t.xp6(2),t.Akn("MONGO_DB"==e.type?"width:0.5rem":"width:1rem"),t.s9C("src",c.getInstanceIconUrl(e.type),t.LSH),t.s9C("alt",e.type),t.xp6(2),t.Oqu(e.name),t.xp6(1),t.Q6J("ngIf",c.showHooksCount),t.xp6(1),t.Q6J("ngIf",c.showHooksCount)}}function it(i,p){1&i&&t._UZ(0,"p-progressSpinner",55)}function rt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",34)(1,"p-table",35),t.NdJ("selectionChange",function(r){t.CHM(e);const I=t.oxw();return t.KtG(I.selectedRows=r)})("selectionChange",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.instanceSelected())})("dblclick",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.dblClickInstance())}),t.YNc(2,X,8,4,"ng-template",36),t.YNc(3,ot,9,10,"ng-template",37),t.qZA(),t.YNc(4,it,1,0,"p-progressSpinner",38),t.qZA()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("selectionMode","multiple")("metaKeySelection",e.metaKeySelection)("selection",e.selectedRows)("dataKey",e.gridKey)("scrollable",!0)("value",e.rows),t.xp6(3),t.Q6J("ngIf",e.loading.grid)}}let ct=(()=>{class i{instanceS;instanceHooksS;generalS;notificationS;navigationCS;authCS;constantsS;router;cd;eventCenterS;confirmationService;isReadOnly=!1;showCheckbox=!0;showHooksCount=!1;isDependentOnGroup=!1;isFilterLogTable=!1;metaKeySelection=!0;instancesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new t.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;gridKey=h.iH._id;selectedRows=[];instanceIdsSkipSubscription=!1;EInstanceType=M.d;constructor(e,c,r,I,lt,_t,dt,ft,mt,pt,ut){this.instanceS=e,this.instanceHooksS=c,this.generalS=r,this.notificationS=I,this.navigationCS=lt,this.authCS=_t,this.constantsS=dt,this.router=ft,this.cd=mt,this.eventCenterS=pt,this.confirmationService=ut}ngOnInit(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.instance.selectedInstances.next([]),!e.isDependentOnGroup&&!e.isFilterLogTable&&(yield e.loadGridData()),e.isDependentOnGroup&&e.subscriptions.push(e.eventCenterS.group.selectedGroups.subscribe(function(){var c=(0,d.Z)(function*(r){r.length&&(yield e.loadGridData())});return function(r){return c.apply(this,arguments)}}())),e.isFilterLogTable&&e.subscriptions.push(e.eventCenterS.filterInLog.refreshGrid.subscribe((0,d.Z)(function*(){e.instanceIdsSkipSubscription||e.loadGridData()}))),e.subscriptions.push(e.data.eventChannel.subscribe(function(){var c=(0,d.Z)(function*(r){(r.action===u.F.SAVED||r.action===u.F.UPDATED)&&(e.instancesFormC.hideModal(),e.loadGridData())});return function(r){return c.apply(this,arguments)}}())),e.generalS.setNewTitle("API Maker - Instances")})()}loadGridData(){var e=this;return(0,d.Z)(function*(){if(e.resetGridAndUrl(),e.isDependentOnGroup&&(!e.eventCenterS.group.selectedGroups.value||!e.eventCenterS.group.selectedGroups.value.length))return;e.loading.grid=!0;const c={find:{user:e.authCS.getUserId(),active:!0},select:{name:1,label:1,active:1,type:1},sort:{name:1}};e.showAll&&delete c.find.active;try{const r=yield e.instanceS.query(c).toPromise();r.success?(e.selectedRows=[],e.rows=r.data,e.rowsMap=T.keyBy(e.rows,h.iH._id)):e.resetGridAndUrl(),e.showHooksCount&&(yield e.instanceS.setHooksCountInInstanceArr(e.rows));const I=e.navigationCS.getQueryParam(v.p.instance);I&&(e.selectedRows=e.getObjectsFromIdArray(I.split(",")),e.eventCenterS.instance.selectedInstances.next(e.selectedRows)),e.isDependentOnGroup&&(e.selectedRows=e.getObjectsFromIdArray(e.eventCenterS.group.instanceIds.value)),e.isFilterLogTable&&(e.selectedRows=e.getObjectsFromIdArray(e.eventCenterS.filterInLog.instanceIds.value))}catch(r){console.log(r)}e.loading.grid=!1,e.cd.detectChanges()})()}getObjectsFromIdArray(e){const c=[];for(const r of e)this.rowsMap[r]&&c.push(this.rowsMap[r]);return c}resetGridAndUrl(){var e=this;return(0,d.Z)(function*(){e.rows=[],e.rowsMap={},e.selectedRows=[],e.eventCenterS.instance.selectedInstances.next([])})()}showAllChanges(){var e=this;return(0,d.Z)(function*(){yield e.resetSelectedRows(),yield e.loadGridData()})()}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE}),this.instancesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_VIEW_MODE}),this.instancesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.instancesFormC.showModal()}clone(){var e=this;return(0,d.Z)(function*(){try{if(!e.selectedRows[0])return;const c=(yield e.instanceS.getById(e.selectedRows[0]._id).toPromise()).data;delete c._id,c.name=`${c.name}-clone`,(yield e.instanceS.post(c).toPromise()).success?(e.notificationS.showSuccess(e.constantsS.instance.cloneSuccess),e.loadGridData()):e.notificationS.showSuccess(e.constantsS.instance.cloneSuccess)}catch{e.notificationS.showError(e.constantsS.instance.cloneError)}})()}inactiveDialog(){var e=this;return(0,d.Z)(function*(){var c;e.confirmationService.confirm({message:e.constantsS.instance.inactiveConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield e.inactive()}),function(){return c.apply(this,arguments)})})})()}removePermanentDialog(){var e=this;return(0,d.Z)(function*(){var c;e.confirmationService.confirm({message:e.constantsS.instance.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(c=(0,d.Z)(function*(){yield e.removePermanent()}),function(){return c.apply(this,arguments)})})})()}active(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const c=yield e.instanceS.makeActive(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,c.success?(e.notificationS.showSuccess(e.constantsS.instance.active),e.loadGridData()):e.notificationS.showErrorFromResponse(c,e.constantsS.instance.activeError)})()}inactive(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;try{yield e.instanceS.softDelete(e.selectedRows[0]._id).toPromise(),e.notificationS.showSuccess(e.constantsS.instance.inactive),yield e.resetSelectedRows(),e.loadGridData()}catch(c){const r=c?.error?.errors?.[0]?.message;e.notificationS.showError(r||e.constantsS.instance.inactiveError)}e.loading.grid=!1})()}removePermanent(){var e=this;return(0,d.Z)(function*(){e.loading.grid=!0;const c=yield e.instanceS.permanentDelete(e.selectedRows[0]._id).toPromise();e.loading.grid=!1,c.success?(e.notificationS.showSuccess(e.constantsS.instance.removePermanent),yield e.resetSelectedRows(),e.loadGridData()):e.notificationS.showErrorFromResponse(c,e.constantsS.instance.removePermanentError)})()}resetSelectedRows(){var e=this;return(0,d.Z)(function*(){e.selectedRows.length=0,e.eventCenterS.instance.selectedInstances.next([]),yield e.navigationCS.setQueryParam(v.p.instance,null)})()}instanceSelected(){var e=this;return(0,d.Z)(function*(){e.eventCenterS.instance.selectedInstances.next(e.selectedRows),e.isDependentOnGroup||e.isFilterLogTable?e.setInstanceIds():(yield e.navigationCS.setQueryParam(v.p.instance,T.map(e.selectedRows,"_id").join(",")||null),yield e.generalS.resetUrlParams([v.p.database,v.p.collection,v.p.collection_api]))})()}dblClickInstance(){this.selectedRows.length&&!this.isDependentOnGroup&&!this.isFilterLogTable&&this.edit()}setInstanceIds(){this.instanceIdsSkipSubscription=!0,this.eventCenterS.filterInLog.instanceIds.next(T.map(this.selectedRows,"_id")),this.eventCenterS.group.instanceIds.next(T.map(this.selectedRows,"_id")),this.instanceIdsSkipSubscription=!1}getInstanceIconUrl(e){return e===M.d.SQL_SERVER_DB?"./assets/images/svg/Microsoft_SQL_Server_DB_No_Logo.svg":e===M.d.ORACLE_DB?"./assets/images/svg/Oracle_DB_No_Logo.svg":`./assets/images/svg/${e}.svg`}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=n.Yp;static \u0275fac=function(c){return new(c||i)(t.Y36(A.E),t.Y36(O.Q),t.Y36(s.b),t.Y36(w.W),t.Y36(R.S),t.Y36(b.D),t.Y36(F.L),t.Y36(N.F0),t.Y36(t.sBO),t.Y36(L.u),t.Y36(P.YP))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-w-instances"]],viewQuery:function(c,r){if(1&c&&t.Gf(Q,5),2&c){let I;t.iGM(I=t.CRH())&&(r.instancesFormC=I.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",showHooksCount:"showHooksCount",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isFilterLogTable:["IsFilterLogTable","isFilterLogTable"],metaKeySelection:"metaKeySelection"},decls:13,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-link","text-yellow","fa-fw","mr-1"],[4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All Instances",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["instancesFormC",""],["href","https://docs.apimaker.dev/v1/docs/pages/instance-database-collection-apis-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3",2,"font-size","25px"],[1,"float-right","position-relative"],["styleClass","ml-3 mt-2px","tooltipPosition","right","pTooltip","Show All",3,"ngModel","ngModelChange","onChange"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Active",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Make Inactive",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanently Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Make Active",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-check","text-success","fa-fw"],["pTooltip","Make Inactive",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw"],["pTooltip","Permanently Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","align-middle","text-danger"],["pTooltip","All Instances",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped instance-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 40px;",4,"ngIf"],[2,"width","40px"],["class","text-center","style","width: 40px;",4,"ngIf"],[2,"width","45px"],[1,"text-center",2,"width","40px"],[3,"pSelectableRow"],[3,"src","alt"],[1,"word-break-all"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],[1,"text-center"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(c,r){1&c&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Instances"),t.qZA(),t.YNc(5,C,12,6,"span",3),t.YNc(6,a,3,2,"span",4),t.YNc(7,_,3,2,"span",4),t.qZA(),t.TgZ(8,"div",5),t.YNc(9,l,3,1,"div",3),t.YNc(10,rt,5,7,"div",6),t.qZA()(),t._UZ(11,"app-w-instances-form",7,8)),2&c&&(t.xp6(5),t.Q6J("ngIf",!r.isReadOnly),t.xp6(1),t.Q6J("ngIf",r.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",r.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",r.eventCenterS.group.apisRegex.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances),t.xp6(1),t.Q6J("ngIf",!(r.eventCenterS.group.apisRegex.allInstances||r.eventCenterS.filterInLog.apisRegex.allInstances)),t.xp6(1),t.Q6J("data",r.data))},dependencies:[y.JJ,y.On,K.O5,Z.iA,P.jx,Z.Ei,Z.UA,Z.Mo,B.G,J.u,W.Ql,Y.XZ,G.o]})}return i})()},1678:(U,E,o)=>{o.r(E),o.d(E,{DashboardM:()=>h});var d=o(7664),t=o(8176),v=(o(3885),o(7747),o(4946));const T=[{path:"root",loadChildren:()=>o.e(891).then(o.bind(o,891)).then(n=>n.DashRootM)},{path:"redis-dashboard",loadChildren:()=>o.e(4110).then(o.bind(o,4110)).then(n=>n.RedisDashboardM)},{path:"summary-dashboard",loadChildren:()=>Promise.all([o.e(8592),o.e(7977)]).then(o.bind(o,7977)).then(n=>n.DashSummaryM)},{path:"developer",loadChildren:()=>o.e(3450).then(o.bind(o,3450)).then(n=>n.DashDevM)},{path:"welcome",loadChildren:()=>o.e(5334).then(o.bind(o,5334)).then(n=>n.AmWelcomeM)},{path:"ext-licenses",loadChildren:()=>o.e(7436).then(o.bind(o,7436)).then(n=>n.ExtLicensesM)}];let h=(()=>{class n{static \u0275fac=function(O){return new(O||n)};static \u0275mod=v.oAB({type:n});static \u0275inj=v.cJS({imports:[d.Bz.forChild(T),t.u]})}return n})()},6925:(U,E,o)=>{o.d(E,{Eg:()=>T,Yp:()=>u,ZF:()=>x,vT:()=>t});var t=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(t||{}),u=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(u||{}),T=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s}(T||{}),x=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(x||{})}}]);
package/dist/1928.js CHANGED
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1928],{1928:(gt,d,o)=>{o.r(d),o.d(d,{TpApiM:()=>it});var T=o(7664),h=o(8176),A=o(3726),t=o(4946),c=o(5219),I=o(5043),C=o(8651),r=o(5861),x=o(7672),l=o(1162),E=o(553),m=o(5085),_=o(9394),y=o(1601),P=o(8883),O=o(5561),g=o(9961),M=o(5852),Z=o(2915),N=o(2304),F=o(3429),G=o(7414),D=o(7240),B=o(1252),Y=o(2559),J=o(6814),H=o(756),R=o(7680),f=o(4844),L=o(3259),U=o(5025);const V=["monacoEditorModalC"];function b(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",12),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",13),t.qZA()}}function Q(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",14),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",15),t.qZA()}}function w(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"a",16),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw(2);return t.KtG(s.editorGeneratedBasicInfo(n))}),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(2),t.Q6J("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function j(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",28)(1,"button",29),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.save())}),t._UZ(2,"i",30),t._uU(3," Add Third Party API Settings "),t.qZA()()}}function z(a,p){1&a&&t._UZ(0,"p-progressSpinner",31)}function W(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.NdJ("activeIndexChange",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.activeIndex=n)})("activeIndexChange",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.tabSelected())}),t.TgZ(3,"p-tabPanel",20),t.YNc(4,K,3,2,"div",21),t.qZA(),t.TgZ(5,"p-tabPanel",22),t.YNc(6,j,4,0,"div",23),t.TgZ(7,"div",24)(8,"app-monaco-editor",25),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.editorGenerated(n))}),t.qZA()()()()(),t.YNc(9,z,1,0,"p-progressSpinner",26),t.qZA()}if(2&a){const e=t.oxw();t.xp6(2),t.Q6J("activeIndex",e.activeIndex),t.xp6(2),t.Q6J("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.xp6(2),t.Q6J("ngIf",!e.tpApiSetting._id),t.xp6(2),t.Q6J("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.xp6(1),t.Q6J("ngIf",e.loading.form)}}let S=(()=>{class a{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=x.di;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=E.N.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,ot,at,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=ot,this.instanceS=at,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.Z)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName&&(i.treeItemApiId=e._id,i.tpInstallApi=(yield i.tpInstalledApisS.getById(e._id).toPromise()).data,i.cd.detectChanges()),i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.Z)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.Z)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.iH._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||_.pj.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.iH._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab={axiosResponse:{data:s.error}},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.Z)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.Z)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(t.Y36(P.e),t.Y36(O.X),t.Y36(g.W),t.Y36(M.D),t.Y36(Z.u),t.Y36(N.b),t.Y36(F.E),t.Y36(G.L),t.Y36(D.b),t.Y36(B.G),t.Y36(Y.d),t.Y36(g.W),t.Y36(c.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.Gf(V,5),2&i){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Third Party API Settings"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,b,2,0,"span",5),t.YNc(8,Q,2,0,"span",6),t.YNc(9,w,2,0,"a",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,W,10,7,"div",9),t.qZA()(),t._UZ(12,"app-monaco-editor-modal",10,11)),2&i&&(t.xp6(7),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.xp6(1),t.Q6J("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.xp6(1),t.Q6J("ngIf",n.lastError),t.xp6(2),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[J.O5,H.O,R.G,f.xf,f.x4,L.u,U.A],encapsulation:2})}return a})();function X(a,p){1&a&&t._UZ(0,"app-w-supported-tp-api",3),2&a&&t.Q6J("IsDependentOnGroup",!1)("isLPM",!1)}function $(a,p){1&a&&t._UZ(0,"app-w-tp-api-form",4)}const u=function(){return[40,60]};let v=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,X,1,2,"ng-template",2),t.YNc(3,$,1,0,"ng-template",2),t.qZA()()),2&i&&(t.xp6(1),t.Q6J("panelSizes",t.DdM(2,u))("minSizes",t.DdM(3,u)))},dependencies:[c.jx,I.q,C.A,S],encapsulation:2})}return a})();var k=o(6401),q=o(7705),tt=o(4950);const et=[{path:"tp-layout",component:v,canActivate:[A.P]}];let it=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[T.Bz.forChild(et),h.u,k.GroupM,q.L,tt.A]})}return a})()}}]);
1
+ "use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1928],{1928:(gt,d,o)=>{o.r(d),o.d(d,{TpApiM:()=>it});var T=o(7664),h=o(8176),A=o(3726),t=o(4946),c=o(5219),I=o(5043),C=o(8651),r=o(5861),x=o(7672),l=o(1162),E=o(553),m=o(5085),_=o(9394),y=o(1601),P=o(8883),O=o(5561),g=o(9961),M=o(5852),Z=o(2915),N=o(2304),F=o(3429),G=o(7414),D=o(7240),B=o(1252),Y=o(2559),J=o(6814),H=o(756),b=o(7680),f=o(4844),R=o(3259),L=o(5025);const U=["monacoEditorModalC"];function V(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",12),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.save())}),t._UZ(1,"i",13),t.qZA()}}function Q(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"span",14),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.removePermanentDialog())}),t._UZ(1,"i",15),t.qZA()}}function w(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"a",16),t.NdJ("click",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.viewError())}),t._uU(1,"View error"),t.qZA()}}function K(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div")(1,"div",24)(2,"app-monaco-editor",27),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw(2);return t.KtG(s.editorGeneratedBasicInfo(n))}),t.qZA()()()}if(2&a){const e=t.oxw(2);t.xp6(2),t.Q6J("isSchemaEditor",!0)("editorOptions",e.editorOptionsBasicInfo)}}function j(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",28)(1,"button",29),t.NdJ("click",function(){t.CHM(e);const n=t.oxw(2);return t.KtG(n.save())}),t._UZ(2,"i",30),t._uU(3," Add Third Party API Settings "),t.qZA()()}}function z(a,p){1&a&&t._UZ(0,"p-progressSpinner",31)}function W(a,p){if(1&a){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",18)(2,"p-tabView",19),t.NdJ("activeIndexChange",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.activeIndex=n)})("activeIndexChange",function(){t.CHM(e);const n=t.oxw();return t.KtG(n.tabSelected())}),t.TgZ(3,"p-tabPanel",20),t.YNc(4,K,3,2,"div",21),t.qZA(),t.TgZ(5,"p-tabPanel",22),t.YNc(6,j,4,0,"div",23),t.TgZ(7,"div",24)(8,"app-monaco-editor",25),t.NdJ("editorGenerated",function(n){t.CHM(e);const s=t.oxw();return t.KtG(s.editorGenerated(n))}),t.qZA()()()()(),t.YNc(9,z,1,0,"p-progressSpinner",26),t.qZA()}if(2&a){const e=t.oxw();t.xp6(2),t.Q6J("activeIndex",e.activeIndex),t.xp6(2),t.Q6J("ngIf",null==e.data.selectedTreeItem?null:e.data.selectedTreeItem.apiName),t.xp6(2),t.Q6J("ngIf",!e.tpApiSetting._id),t.xp6(2),t.Q6J("hidden",!e.tpApiSetting._id)("isSchemaEditor",!0)("editorOptions",e.editorOptionsTpApiSetting),t.xp6(1),t.Q6J("ngIf",e.loading.form)}}let S=(()=>{class a{groupS;navigationS;ns;authCS;eventCenterS;monacoS;instanceS;constantsS;generalCS;tpApiSettingsS;tpInstalledApisS;notificationS;confirmationService;cd;loading={form:!1};subscriptions=[];data={};EAPIAccessType=x.di;editorTpApiSettingCode;editorOptionsTpApiSetting={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=E.N.BE_HOST_PORT;tpApiSetting={};saveMode;editorTpApiSettingBasicInfo;editorOptionsBasicInfo={readOnly:!1,language:"typescript",contextmenu:!0};tpInstallApi={};selectedTabTitle="Basic Info";treeItemApiId;activeIndex=0;viewDockerfileModelC;constructor(e,i,n,s,nt,ot,at,st,rt,pt,dt,ct,lt,mt){this.groupS=e,this.navigationS=i,this.ns=n,this.authCS=s,this.eventCenterS=nt,this.monacoS=ot,this.instanceS=at,this.constantsS=st,this.generalCS=rt,this.tpApiSettingsS=pt,this.tpInstalledApisS=dt,this.notificationS=ct,this.confirmationService=lt,this.cd=mt}ngOnInit(){this.monacoS.loadSchemaEditorSettings(this.BE_HOST_PORT,this.authCS.getUserId(),null).then(),this.subscriptions.push(this.eventCenterS.tpApiSettings.apiSelected.subscribe(e=>{e&&(this.saveMode=e.apiName?"TABLE":"COLLECTION",this.setDataInForm(this.data.selectedTreeItem=e),this.cd.detectChanges())}))}editorGenerated(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingCode=e,yield i.monacoS.loadSchemaEditorSettings(i.BE_HOST_PORT,i.authCS.getUserId(),null),i.monacoS.addSaveCodeKeyBinding(e,n=>{i.tpApiSetting._id&&i.save()})})()}setDataInForm(e){var i=this;return(0,r.Z)(function*(){i.loading.form=!0,i.lastError=void 0;const n=i.authCS.getUserId();i.tpApiSetting=(yield i.tpApiSettingsS.getApiSettings(n,e.bundleName,e.apiVersion,e.apiName))||{},e.apiName&&(i.treeItemApiId=e._id,i.tpInstallApi=(yield i.tpInstalledApisS.getById(e._id).toPromise()).data,i.cd.detectChanges()),i.setDataInFormCommonCode(),i.loading.form=!1})()}setDataInFormCommonCode(){var e=this;return(0,r.Z)(function*(){if(e.tpApiSetting._id)e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",e.tpApiSetting.thirdPartyApiSettingsCode);else if(!e.tpApiSetting._id)if("COLLECTION"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_VERSION_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}else if("TABLE"===e.saveMode){const i=yield e.instanceS.getDefaultContent(e.BE_HOST_PORT,m.R.THIRD_PARTY_API_SETTINGS_JSON).toPromise();e.generalCS.setValueInEditor(e,"editorTpApiSettingCode",i.data)}e.tpInstallApi?.apiJsonStr&&e.generalCS.setValueInEditor(e,"editorTpApiSettingBasicInfo",e.tpInstallApi?.apiJsonStr),e.cd.detectChanges()})()}save(){var e=this;return(0,r.Z)(function*(){if("Basic Info"===e.selectedTabTitle)try{const i={};i.apiJsonStr=e.editorTpApiSettingBasicInfo.getValue(),yield e.tpInstalledApisS.put(e.treeItemApiId,i,{select:l.iH._id}).toPromise(),e.notificationS.showSuccess("Basic Info saved successfully."),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())}catch(i){e.notificationS.showErrorMessageFromErrorObject(i)}else{let i={};const n=e.eventCenterS.tpApiSettings.apiSelected.value;if(!n||!n.bundleName||!n.apiVersion)return;i.bundleName=n.bundleName,i.apiVersion=n.apiVersion,i.apiName=n.apiName||_.pj.__THIRD_PARTY_API_SETTINGS__,i.user=e.authCS.getUserId(),i.thirdPartyApiSettingsCode=e.editorTpApiSettingCode.getValue(),i=Object.assign({},e.tpApiSetting||{},i);try{let s;e.loading.form=!0,e.lastError=void 0,e.monacoS.clearEditorDecorations(e.editorTpApiSettingCode,e.monacoDecorations),e.tpApiSetting._id?e.tpApiSetting._id&&(s=yield e.tpApiSettingsS.replace(e.tpApiSetting._id,i,{select:l.iH._id}).toPromise()):(s=yield e.tpApiSettingsS.post(i).toPromise(),e.tpApiSetting=s.data),e.ns.showSuccess(e.constantsS.tpApiSettings.addOrUpdateSuccess),e.eventCenterS.filterInLog.refreshGrid.next(Math.random()),e.loading.form=!1}catch(s){e.loading.form=!1,e.ns.showErrorFromResponse(s.error||s,"Unable to save third party API."),e.lastError=s.error,e.tab=e.tab||{},e.tab.axiosResponse={data:s.error},e.monacoS.highlightErrorInMonacoEditor(e.editorTpApiSettingCode,e.tab,"MainSandbox.ts",e.monacoDecorations)}}})()}removePermanentDialog(){var e=this;return(0,r.Z)(function*(){var i;e.confirmationService.confirm({message:e.constantsS.tpApiSettings.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(i=(0,r.Z)(function*(){yield e.removePermanent()}),function(){return i.apply(this,arguments)})})})()}removePermanent(){var e=this;return(0,r.Z)(function*(){e.loading.form=!0;const i=yield e.tpApiSettingsS.permanentDelete(e.tpApiSetting._id).toPromise();e.loading.form=!1,i?(e.ns.showSuccess(e.constantsS.tpApiSettings.removePermanent),e.tpApiSetting={},e.cd.detectChanges(),e.eventCenterS.filterInLog.refreshGrid.next(Math.random())):e.ns.showErrorFromResponse(i,e.constantsS.tpApiSettings.removePermanentError)})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),y.d.json)}tabSelected(){0===this.activeIndex?this.selectedTabTitle="Basic Info":1===this.activeIndex&&(this.selectedTabTitle="API Settings")}editorGeneratedBasicInfo(e){var i=this;return(0,r.Z)(function*(){i.editorTpApiSettingBasicInfo=e,i.monacoS.addSaveCodeKeyBinding(e,n=>{"Basic Info"===i.selectedTabTitle&&i.save()})})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(i){return new(i||a)(t.Y36(P.e),t.Y36(O.X),t.Y36(g.W),t.Y36(M.D),t.Y36(Z.u),t.Y36(N.b),t.Y36(F.E),t.Y36(G.L),t.Y36(D.b),t.Y36(B.G),t.Y36(Y.d),t.Y36(g.W),t.Y36(c.YP),t.Y36(t.sBO))};static \u0275cmp=t.Xpm({type:a,selectors:[["app-w-tp-api-form"]],viewQuery:function(i,n){if(1&i&&t.Gf(U,5),2&i){let s;t.iGM(s=t.CRH())&&(n.viewDockerfileModelC=s.first)}},decls:14,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],[1,"fas","fa-cog","fa-fw","text-danger","mr-1"],["href","https://docs.apimaker.dev/v1/docs/settings/thirdPartyApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["class","float-right cursor-pointer ml-3","pTooltip","Save",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Delete API Settings",3,"click",4,"ngIf"],["href","javascript:;","class","text-danger float-right",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","position-relative border-top h-100",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],["pTooltip","Save",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","fa-fw","text-success"],["pTooltip","Delete API Settings",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["href","javascript:;",1,"text-danger","float-right",3,"click"],[1,"position-relative","border-top","h-100"],[1,"modal-body","overflow-auto"],[3,"activeIndex","activeIndexChange"],["header","Basic Info"],[4,"ngIf"],["header","API Settings"],["class","p-1 text-center",4,"ngIf"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 124px)"],[3,"hidden","isSchemaEditor","editorOptions","editorGenerated"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"p-1","text-center"],["type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","align-middle","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"i",2),t._uU(4," Third Party API Settings"),t.qZA(),t.TgZ(5,"a",3),t._UZ(6,"img",4),t.qZA(),t.YNc(7,V,2,0,"span",5),t.YNc(8,Q,2,0,"span",6),t.YNc(9,w,2,0,"a",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,W,10,7,"div",9),t.qZA()(),t._UZ(12,"app-monaco-editor-modal",10,11)),2&i&&(t.xp6(7),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&(null==n.data.selectedTreeItem?null:n.data.selectedTreeItem.apiName)),t.xp6(1),t.Q6J("ngIf","API Settings"===n.selectedTabTitle&&n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion&&n.tpApiSetting._id),t.xp6(1),t.Q6J("ngIf",n.lastError),t.xp6(2),t.Q6J("ngIf",n.data.selectedTreeItem&&n.data.selectedTreeItem.bundleName&&n.data.selectedTreeItem.apiVersion),t.xp6(1),t.Q6J("modalId","idMonacoEditorModalInTpAPISettings")("editorOptionsMonacoEditorModal",n.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[J.O5,H.O,b.G,f.xf,f.x4,R.u,L.A],encapsulation:2})}return a})();function X(a,p){1&a&&t._UZ(0,"app-w-supported-tp-api",3),2&a&&t.Q6J("IsDependentOnGroup",!1)("isLPM",!1)}function $(a,p){1&a&&t._UZ(0,"app-w-tp-api-form",4)}const u=function(){return[40,60]};let v=(()=>{class a{constructor(){}ngOnInit(){}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=t.Xpm({type:a,selectors:[["app-tp-api-layout"]],decls:4,vars:4,consts:[[1,"pt-1","pl-1","pr-1"],["styleClass","full-body",3,"panelSizes","minSizes"],["pTemplate",""],[1,"w-100",3,"IsDependentOnGroup","isLPM"],[1,"w-100"]],template:function(i,n){1&i&&(t.TgZ(0,"div",0)(1,"p-splitter",1),t.YNc(2,X,1,2,"ng-template",2),t.YNc(3,$,1,0,"ng-template",2),t.qZA()()),2&i&&(t.xp6(1),t.Q6J("panelSizes",t.DdM(2,u))("minSizes",t.DdM(3,u)))},dependencies:[c.jx,I.q,C.A,S],encapsulation:2})}return a})();var k=o(6401),q=o(7705),tt=o(4950);const et=[{path:"tp-layout",component:v,canActivate:[A.P]}];let it=(()=>{class a{static \u0275fac=function(i){return new(i||a)};static \u0275mod=t.oAB({type:a});static \u0275inj=t.cJS({imports:[T.Bz.forChild(et),h.u,k.GroupM,q.L,tt.A]})}return a})()}}]);