@sava-info-systems/api-maker-with-extensions 2.1.2 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{1025.95948d3d2668bb14.js → 1025.a0db9347453600d0.js} +1 -1
- package/dist/{1097.ea0e6db47339f73f.js → 1097.d0d6fd13031aa1f0.js} +1 -1
- package/dist/{1928.5c81326985ca5f64.js → 1928.2b376f7cf66ed038.js} +1 -1
- package/dist/{2714.9880836f6b8b78a7.js → 2714.0d6939336a02dd0a.js} +1 -1
- package/dist/2735.86437a8639a0c1bb.js +1 -0
- package/dist/292.c7c794ff29abbe37.js +1 -0
- package/dist/{4110.c8b37cab34b21d0d.js → 4110.d108e786ecbdfd1b.js} +1 -1
- package/dist/{4186.3bd4de588fe7617d.js → 4186.ac3e8af0efeeac14.js} +1 -1
- package/dist/{4211.188f84c688ab656f.js → 4211.1bfe72ce0b7b2f76.js} +1 -1
- package/dist/4575.6ad36e53bd72fb6f.js +1 -0
- package/dist/485.b546656b466cb8a4.js +1 -0
- package/dist/{6236.5b62431db131ce4d.js → 6236.6c0fc469f0c96549.js} +1 -1
- package/dist/6393.173ecdfc3b022973.js +1 -0
- package/dist/{7368.102769b19d40d3e0.js → 7368.9ebf62d518f8ad7a.js} +1 -1
- package/dist/7470.b1ce7eedb9cedb2d.js +1 -0
- package/dist/{7975.6f386123f5c64f78.js → 7975.578a00ebd1160a1e.js} +1 -1
- package/dist/{7987.d15aacc264588b12.js → 7987.5958ad5b81873058.js} +1 -1
- package/dist/{8125.35fe2368910566d5.js → 8125.b2f908096882ed45.js} +1 -1
- package/dist/{8296.e4e3f60f70779a30.js → 8296.a387c28f5702c5e8.js} +1 -1
- package/dist/{885.c5fd870ec02f004d.js → 885.be44d92efca1aaf6.js} +1 -1
- package/dist/assets/public/monaco-editor/index.html +61 -0
- package/dist/assets/public/monaco-editor/index.js +1 -0
- package/dist/assets/schema-types/InterfaceProps.ts +2 -0
- package/dist/assets/schema-types/types.ts +28 -27
- package/dist/index.html +1 -28
- package/dist/main.d3c81428418939dc.js +1 -0
- package/dist/{runtime.94df8f20f115da3f.js → runtime.2f0f434d4763c970.js} +1 -1
- package/main.js +1 -1
- package/package.json +11 -11
- package/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +28 -27
- package/src/public/dist-db-masters/browser/index.html +1 -1
- package/src/public/dist-db-masters/browser/main-6YSY4AYM.js +139 -0
- package/src/tools/local-client.js +1 -1
- package/dist/2735.a66ecf607b9654e0.js +0 -1
- package/dist/292.885b93c9e38b775a.js +0 -1
- package/dist/4575.584a2fd6d6505e7a.js +0 -1
- package/dist/485.ec283c2f8b792308.js +0 -1
- package/dist/6393.bff610fd50c307e8.js +0 -1
- package/dist/7470.1bdcf8e01acb62bd.js +0 -1
- package/dist/assets/monaco-assets/configurations/cpp.json +0 -34
- package/dist/assets/monaco-assets/configurations/csharp.json +0 -32
- package/dist/assets/monaco-assets/configurations/dart.json +0 -29
- package/dist/assets/monaco-assets/configurations/go.json +0 -37
- package/dist/assets/monaco-assets/configurations/java.json +0 -33
- package/dist/assets/monaco-assets/configurations/javascript.json +0 -140
- package/dist/assets/monaco-assets/configurations/json.json +0 -22
- package/dist/assets/monaco-assets/configurations/python.json +0 -56
- package/dist/assets/monaco-assets/configurations/ruby.json +0 -31
- package/dist/assets/monaco-assets/configurations/rust.json +0 -34
- package/dist/assets/monaco-assets/configurations/swift.json +0 -27
- package/dist/assets/monaco-assets/configurations/typescript.json +0 -140
- package/dist/assets/monaco-assets/configurations/xml.json +0 -39
- package/dist/assets/monaco-assets/configurations/yaml.json +0 -35
- package/dist/assets/monaco-assets/grammars/cpp.tmLanguage.json +0 -16309
- package/dist/assets/monaco-assets/grammars/csharp.tmLanguage.json +0 -4984
- package/dist/assets/monaco-assets/grammars/dart.tmLanguage.json +0 -521
- package/dist/assets/monaco-assets/grammars/go.tmLanguage.json +0 -1017
- package/dist/assets/monaco-assets/grammars/java.tmLanguage.json +0 -1855
- package/dist/assets/monaco-assets/grammars/javascript.tmLanguage.json +0 -5914
- package/dist/assets/monaco-assets/grammars/json.tmLanguage.json +0 -213
- package/dist/assets/monaco-assets/grammars/magicpython.tmLanguage.json +0 -4213
- package/dist/assets/monaco-assets/grammars/ruby.tmLanguage.json +0 -2775
- package/dist/assets/monaco-assets/grammars/rust.tmLanguage.json +0 -1170
- package/dist/assets/monaco-assets/grammars/swift.tmLanguage.json +0 -3303
- package/dist/assets/monaco-assets/grammars/typescript.tmLanguage.json +0 -5665
- package/dist/assets/monaco-assets/grammars/xml.tmLanguage.json +0 -387
- package/dist/assets/monaco-assets/grammars/yaml.tmLanguage.json +0 -621
- package/dist/assets/monaco-assets/onig.wasm +0 -0
- package/dist/main.40b9c805b1ee0fc1.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4110],{4110:(ye,g,o)=>{o.r(g),o.d(g,{RedisDashboardM:()=>he});var E=o(17017),N=o(77664),l=o(15861),e=o(94946),b=o(6990),d=o(33157),p=o(90328),w=o(96925),h=o(20553),v=o(62304),y=o(77240),D=o(99961),T=o(95852),C=o(27414),x=o(85219),S=o(53429),m=o(96814),R=o(756),K=o(91396),Z=o(97680),F=o(55043),I=o(33259),c=o(60095),M=o(91601),A=o(32660),O=o(25025);const k=["monacoEditorModalC"];function U(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," Add New Key"),e.qZA())}function J(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," View New Key"),e.qZA())}function Y(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2," Edit New Key"),e.qZA())}function G(n,i){1&n&&(e.TgZ(0,"label",31),e._uU(1,"Key Name"),e.qZA())}function V(n,i){1&n&&(e.TgZ(0,"div",32),e._UZ(1,"input",33),e.qZA())}function P(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw();return e.KtG(r.editorGenerated(a))}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Q(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function L(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function B(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",38),e.YNc(2,H,2,0,"span",4),e.YNc(3,L,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function q(n,i){1&n&&e._UZ(0,"p-progressSpinner",39)}const W=function(n){return{"col-3":n}},j=function(n,i){return{"col-3":n,"col-6":i}};let z=(()=>{class n{fb;ns;monacoS;instanceS;constantsS;authCS;generalCS;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=h.N.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,s,a,r,f,u,_){this.fb=t,this.ns=s,this.monacoS=a,this.instanceS=r,this.constantsS=f,this.authCS=u,this.generalCS=_}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,l.Z)(function*(a){a&&(t.form.enable(),a.action===d.F.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=a,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):a.action===d.F.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):a.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.kI.required]],ttl:[null,[c.kI.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.Z)(function*(){const s=t.form.getRawValue();s.redisCodeStr=t.editorRedis.getValue();try{let a;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===p.D.ADD)a=yield t.instanceS.saveRedisKeys(s),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?d.F.SAVED:d.F.UPDATED});else if(t.data.mode===p.D.EDIT){const r={keyName:t.actualKeyData.data.keyName,redisCodeStr:t.actualKeyData.data.redisCodeStr,ttl:t.form.get("ttl").value};yield t.instanceS.updateRedisKeys(r),t.ns.showSuccess(t.constantsS.redis.editSuccess),t.data.eventChannel.emit({action:d.F.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save redis key."),t.lastError=a.error}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorRedis=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null),s.monacoS.addSaveCodeKeyBinding(t,a=>{s.form.valid&&s.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(c.qu),e.Y36(D.W),e.Y36(v.b),e.Y36(S.E),e.Y36(C.L),e.Y36(T.D),e.Y36(y.b))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(s,a){if(1&s&&e.Gf(k,5),2&s){let r;e.iGM(r=e.CRH())&&(a.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:20,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idNewKeyForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","mt-1","mr-1",2,"font-size","22px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],["class","col-2 col-form-label col-form-label-sm text-right",4,"ngIf"],["class","col-6",4,"ngIf"],[1,"col-form-label","col-form-label-sm","text-right",3,"ngClass"],[3,"ngClass"],["formControlName","ttl","name","ttl","spellcheck","false","type","number","placeholder","Please provide value",1,"form-control","form-control-sm"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"col-2","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","keyName","name","keyName","spellcheck","false","type","text","placeholder","Please provide key name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,U,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6)(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"a",9),e._UZ(12,"img",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"form",12)(15,"div",13),e.YNc(16,G,2,0,"label",14),e.YNc(17,V,2,0,"div",15),e.TgZ(18,"label",16),e._uU(19,"TTL"),e.qZA(),e.TgZ(20,"div",17),e._UZ(21,"input",18),e.qZA()(),e.YNc(22,P,2,2,"div",19),e.qZA()(),e.TgZ(23,"div",20),e.YNc(24,Q,2,0,"a",21),e.TgZ(25,"button",22),e._UZ(26,"i",23),e._uU(27," Close"),e.qZA(),e.YNc(28,B,4,3,"button",24),e.qZA(),e.YNc(29,q,1,0,"p-progressSpinner",25),e.qZA()()(),e._UZ(30,"app-monaco-editor-modal",26,27)),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(8),e.Q6J("formGroup",a.form),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngClass",e.VKq(15,W,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngClass",e.WLB(17,j,a.data.mode===a.EFormMode.ADD,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(2),e.Q6J("ngIf",a.lastError),e.xp6(4),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form),e.xp6(1),e.Q6J("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",a.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c._Y,c.Fj,c.wV,c.JJ,c.JL,c.sg,c.u,m.mk,m.O5,A.y,R.O,Z.G,O.A],encapsulation:2})}return n})();const X=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.TgZ(0,"span",7)(1,"h4",8),e._uU(2),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.keyDelete())}),e._UZ(1,"i",29),e.qZA()}}function ae(n,i){if(1&n&&(e.TgZ(0,"div",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.label)}}function se(n,i){1&n&&e._UZ(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span"),e._UZ(3,"img",13),e._uU(4," Redis Dashboard"),e.qZA(),e.TgZ(5,"span")(6,"div",14)(7,"a",15),e._UZ(8,"img",16),e.qZA()(),e.TgZ(9,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.add())}),e._UZ(10,"i",18),e.qZA(),e.TgZ(11,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.loadRedisDataList())}),e._UZ(12,"i",20),e.qZA(),e.YNc(13,te,2,0,"span",21),e.TgZ(14,"span",22),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.flushAll())}),e._UZ(15,"i",23),e.qZA()()(),e.TgZ(16,"div",24)(17,"p-tree",25),e.NdJ("selectionChange",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.selectedKeys=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.selectedKeysChange())}),e.YNc(18,ae,2,1,"ng-template",26),e.qZA(),e.YNc(19,se,1,0,"p-progressSpinner",27),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(13),e.Q6J("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.xp6(4),e.Q6J("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.update())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"Update"),e.qZA()()}}function ie(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.updateTTL())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"UpdateTTL"),e.qZA()()}}function re(n,i){if(1&n&&(e.TgZ(0,"span",41)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw(4);e.xp6(2),e.Oqu(t.ttlValue)}}function le(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span",32),e._UZ(3,"i",33),e._uU(4," Redis "),e.qZA(),e.TgZ(5,"span",34),e._uU(6),e.qZA(),e.YNc(7,oe,4,0,"span",35),e.YNc(8,ie,4,0,"span",35),e.YNc(9,re,3,1,"span",36),e.qZA(),e.TgZ(10,"div",37)(11,"app-monaco-editor",38),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.editorGenerated(a))}),e.qZA()()()}if(2&n){const t=e.oxw(3);e.xp6(6),e.Oqu(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.xp6(2),e.Q6J("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function pe(n,i){1&n&&(e.TgZ(0,"p-splitter",9),e.YNc(1,ne,20,6,"ng-template",10),e.YNc(2,le,12,6,"ng-template",10),e.qZA()),2&n&&(e.Akn(e.DdM(3,de)),e.Q6J("panelSizes",e.DdM(4,ce)))}function me(n,i){if(1&n&&(e.TgZ(0,"div",3)(1,"div",4),e.YNc(2,ee,3,1,"span",5),e.YNc(3,pe,3,5,"p-splitter",6),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalRedisSetupDoneByRoot)}}let fe=(()=>{class n{monacoS;generalS;ns;authCS;constantsS;cd;confirmationService;instanceS;isDependentOnGroup=!0;selectByKey="_id";treeNodes=[];subscriptions=[];selectedKeys;allTreeItemsMap={};editor;editorOptionsSchema={readOnly:!1,language:"json",contextmenu:!0};loading={grid:!1};selectedItem;autoCompleteData=[];BE_HOST_PORT=h.N.BE_HOST_PORT;redisNewKeyFormC;data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,s,a,r,f,u,_,ve){this.monacoS=t,this.generalS=s,this.ns=a,this.authCS=r,this.constantsS=f,this.cd=u,this.confirmationService=_,this.instanceS=ve}ngOnInit(){this.getExternalRedisSetupFromPackageJson(),this.loadRedisDataList(),this.startTTLReduceInterval(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{t&&(t.action===d.F.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.F.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of s)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const a={};t.generalS.getMapOfAllItems(a,s),t.parsedData=s,t.treeNodes=t.parsedData,t.allTreeItemsMap=a,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.Z)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const s=t.selectedKeys[0];if(s.children?.length)t.editor.setValue("");else{const a=yield t.instanceS.getRedisValue(s.key).toPromise();a?.data?.value&&(t.editor.setValue("string"==typeof a?.data?.value?a.data.value:JSON.stringify(a?.data?.value,null,4)),a?.data?.ttl>0&&(t.ttlValue=a.data.ttl))}}else t.editor.setValue("")})()}startTTLReduceInterval(){this.intervalRef=setInterval(()=>{this.ttlValue>0&&this.ttlValue--},1e3)}stopTTLReduceInterval(){clearInterval(this.intervalRef)}update(){var t=this;return(0,l.Z)(function*(){try{t.loading.grid=!0;const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(s),t.data.mode=p.D.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.Z)(function*(){try{const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=p.D.EDIT,t.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE,data:s}),t.redisNewKeyFormC.showModal()}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update TTL.")}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editor=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.redisKeyPermanentDelete(b.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;try{const s=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===s.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.flushAllData()}),function(){return s.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=w.Yp;undefined=void 0;static \u0275fac=function(s){return new(s||n)(e.Y36(v.b),e.Y36(y.b),e.Y36(D.W),e.Y36(T.D),e.Y36(C.L),e.Y36(e.sBO),e.Y36(x.YP),e.Y36(S.E))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(s,a){if(1&s&&e.Gf(X,5),2&s){let r;e.iGM(r=e.CRH())&&(a.redisNewKeyFormC=r.first)}},inputs:{isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"]},decls:3,vars:2,consts:[["class","pt-1 pl-1 pr-1",4,"ngIf"],[3,"data"],["redisNewKeyFormC",""],[1,"pt-1","pl-1","pr-1"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],["class","text-center",4,"ngIf"],[3,"panelSizes","style",4,"ngIf"],[1,"text-center"],[1,"mt-5","pt-5"],[3,"panelSizes"],["pTemplate",""],[1,"card","shadow-sm","h-100","w-100"],[1,"card-header"],["src","../../../../assets/images/icons/redis.png","alt","Redis",1,"fa-fw"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New Key",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Refresh",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["pTooltip","Flush redis database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-warning"],[1,"card-body","p-0"],["selectionMode","multiple","scrollHeight","calc(100vh - 128px)",1,"w-full",3,"value","selection","filter","metaKeySelection","selectionChange"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw"],[1,"w-100","prevent-text-selection","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"align-top"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"ml-2","d-inline-block",2,"color","#57be1e","max-width","700px"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right text-info cursor-pointer ml-3",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 84px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],[1,"float-right","text-info","cursor-pointer","ml-3"]],template:function(s,a){1&s&&(e.YNc(0,me,4,2,"div",0),e._UZ(1,"app-redis-new-key-form",1,2)),2&s&&(e.Q6J("ngIf",void 0!==a.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("data",a.data))},dependencies:[m.O5,R.O,x.jx,K.mp,Z.G,F.q,I.u,z]})}return n})();var ue=o(1678),_e=o(44950);const ge=[{path:"",component:fe}];let he=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[N.Bz.forChild(ge),E.u,ue.DashboardM,_e.A]})}return n})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4110],{4110:(ye,g,o)=>{o.r(g),o.d(g,{RedisDashboardM:()=>he});var E=o(17017),N=o(77664),l=o(15861),e=o(94946),b=o(6990),d=o(33157),p=o(90328),w=o(96925),h=o(20553),v=o(45809),y=o(77240),D=o(99961),T=o(95852),C=o(27414),x=o(85219),S=o(53429),m=o(96814),R=o(756),K=o(91396),Z=o(97680),F=o(55043),I=o(33259),c=o(60095),M=o(91601),A=o(32660),O=o(25025);const k=["monacoEditorModalC"];function U(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",28),e._uU(2," Add New Key"),e.qZA())}function J(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",29),e._uU(2," View New Key"),e.qZA())}function Y(n,i){1&n&&(e.TgZ(0,"span"),e._UZ(1,"i",30),e._uU(2," Edit New Key"),e.qZA())}function G(n,i){1&n&&(e.TgZ(0,"label",31),e._uU(1,"Key Name"),e.qZA())}function V(n,i){1&n&&(e.TgZ(0,"div",32),e._UZ(1,"input",33),e.qZA())}function P(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw();return e.KtG(r.editorGenerated(a))}),e.qZA()()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("editorOptions",t.editorOptionsRedis)}}function Q(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.viewError())}),e._uU(1,"View error"),e.qZA()}}function H(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function L(n,i){1&n&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function q(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const a=e.oxw();return e.KtG(a.save())}),e._UZ(1,"i",38),e.YNc(2,H,2,0,"span",4),e.YNc(3,L,2,0,"span",4),e.qZA()}if(2&n){const t=e.oxw();e.Q6J("disabled",!(null!=t.form.get("keyName").value&&t.form.get("keyName").value.toString().trim())),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function B(n,i){1&n&&e._UZ(0,"p-progressSpinner",39)}const W=function(n){return{"col-3":n}},j=function(n,i){return{"col-3":n,"col-6":i}};let z=(()=>{class n{fb;ns;monacoS;instanceS;constantsS;authCS;generalCS;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];editorRedis;editorOptionsRedis={readOnly:!1,language:"json",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};BE_HOST_PORT=h.N.BE_HOST_PORT;viewDockerfileModelC;actualKeyData;constructor(t,s,a,r,f,u,_){this.fb=t,this.ns=s,this.monacoS=a,this.instanceS=r,this.constantsS=f,this.authCS=u,this.generalCS=_}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var s=(0,l.Z)(function*(a){a&&(t.form.enable(),a.action===d.F.OPEN_FORM_IN_EDIT_MODE?(t.actualKeyData=a,t.form.reset(),t.form.get("ttl").setValue(t.actualKeyData.data.ttl),t.form.get("keyName").setValue(t.actualKeyData.data.keyName)):a.action===d.F.OPEN_FORM_IN_VIEW_MODE?(t.form.reset(),t.form.disable()):a.action===d.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.generalCS.setValueInEditor(t,"editorRedis","{}")))});return function(a){return s.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({keyName:[null,[c.kI.required]],ttl:[null,[c.kI.required]]})}showModal(){this.lastError=void 0,$("#idNewKeyForm").modal("show")}hideModal(){$("#idNewKeyForm").modal("hide")}save(){var t=this;return(0,l.Z)(function*(){const s=t.form.getRawValue();s.redisCodeStr=t.editorRedis.getValue();try{let a;if(t.loading.form=!0,t.lastError=void 0,t.data.mode===p.D.ADD)a=yield t.instanceS.saveRedisKeys(s),t.ns.showSuccess(t.constantsS.redis.addSuccess),t.data.eventChannel.emit({action:t.data.mode===p.D.ADD?d.F.SAVED:d.F.UPDATED});else if(t.data.mode===p.D.EDIT){const r={keyName:t.actualKeyData.data.keyName,redisCodeStr:t.actualKeyData.data.redisCodeStr,ttl:t.form.get("ttl").value};yield t.instanceS.updateRedisKeys(r),t.ns.showSuccess(t.constantsS.redis.editSuccess),t.data.eventChannel.emit({action:d.F.UPDATED,data:t.form.get("ttl").value})}t.loading.form=!1}catch(a){t.loading.form=!1,t.ns.showErrorFromResponse(a.error||a,"Unable to save redis key."),t.lastError=a.error}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editorRedis=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null),s.monacoS.addSaveCodeKeyBinding(t,a=>{s.form.valid&&s.save()})})()}viewError(){this.viewDockerfileModelC.showModal(this.generalCS.stringify(this.lastError),M.d.json)}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}static \u0275fac=function(s){return new(s||n)(e.Y36(c.qu),e.Y36(D.W),e.Y36(v.b),e.Y36(S.E),e.Y36(C.L),e.Y36(T.D),e.Y36(y.b))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-new-key-form"]],viewQuery:function(s,a){if(1&s&&e.Gf(k,5),2&s){let r;e.iGM(r=e.CRH())&&(a.viewDockerfileModelC=r.first)}},inputs:{data:"data"},decls:32,vars:20,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idNewKeyForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","mt-1","mr-1",2,"font-size","22px"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],["class","col-2 col-form-label col-form-label-sm text-right",4,"ngIf"],["class","col-6",4,"ngIf"],[1,"col-form-label","col-form-label-sm","text-right",3,"ngClass"],[3,"ngClass"],["formControlName","ttl","name","ttl","spellcheck","false","type","number","placeholder","Please provide value",1,"form-control","form-control-sm"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"col-2","col-form-label","col-form-label-sm","text-right"],[1,"col-6"],["formControlName","keyName","name","keyName","spellcheck","false","type","text","placeholder","Please provide key name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,a){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,U,3,0,"span",4),e.YNc(5,J,3,0,"span",4),e.YNc(6,Y,3,0,"span",4),e.TgZ(7,"div",5)(8,"button",6)(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"a",9),e._UZ(12,"img",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"form",12)(15,"div",13),e.YNc(16,G,2,0,"label",14),e.YNc(17,V,2,0,"div",15),e.TgZ(18,"label",16),e._uU(19,"TTL"),e.qZA(),e.TgZ(20,"div",17),e._UZ(21,"input",18),e.qZA()(),e.YNc(22,P,2,2,"div",19),e.qZA()(),e.TgZ(23,"div",20),e.YNc(24,Q,2,0,"a",21),e.TgZ(25,"button",22),e._UZ(26,"i",23),e._uU(27," Close"),e.qZA(),e.YNc(28,q,4,3,"button",24),e.qZA(),e.YNc(29,B,1,0,"p-progressSpinner",25),e.qZA()()(),e._UZ(30,"app-monaco-editor-modal",26,27)),2&s&&(e.xp6(4),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT),e.xp6(8),e.Q6J("formGroup",a.form),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(1),e.Q6J("ngClass",e.VKq(15,W,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngClass",e.WLB(17,j,a.data.mode===a.EFormMode.ADD,a.data.mode===a.EFormMode.EDIT)),e.xp6(2),e.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),e.xp6(2),e.Q6J("ngIf",a.lastError),e.xp6(4),e.Q6J("ngIf",a.data.mode!==a.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",a.loading.form),e.xp6(1),e.Q6J("modalId","idMonacoEditorModalInRedisDashboard")("editorOptionsMonacoEditorModal",a.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[c._Y,c.Fj,c.wV,c.JJ,c.JL,c.sg,c.u,m.mk,m.O5,A.y,R.O,Z.G,O.A],encapsulation:2})}return n})();const X=["redisNewKeyFormC"];function ee(n,i){if(1&n&&(e.TgZ(0,"span",7)(1,"h4",8),e._uU(2),e.qZA()()),2&n){const t=e.oxw(2);e.xp6(2),e.Oqu(t.constantsS.redis.setupExternalRedis)}}function te(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.keyDelete())}),e._UZ(1,"i",29),e.qZA()}}function ae(n,i){if(1&n&&(e.TgZ(0,"div",30),e._uU(1),e.qZA()),2&n){const t=i.$implicit;e.xp6(1),e.Oqu(t.label)}}function se(n,i){1&n&&e._UZ(0,"p-progressSpinner",31)}function ne(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span"),e._UZ(3,"img",13),e._uU(4," Redis Dashboard"),e.qZA(),e.TgZ(5,"span")(6,"div",14)(7,"a",15),e._UZ(8,"img",16),e.qZA()(),e.TgZ(9,"span",17),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.add())}),e._UZ(10,"i",18),e.qZA(),e.TgZ(11,"span",19),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.loadRedisDataList())}),e._UZ(12,"i",20),e.qZA(),e.YNc(13,te,2,0,"span",21),e.TgZ(14,"span",22),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.flushAll())}),e._UZ(15,"i",23),e.qZA()()(),e.TgZ(16,"div",24)(17,"p-tree",25),e.NdJ("selectionChange",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.selectedKeys=a)})("selectionChange",function(){e.CHM(t);const a=e.oxw(3);return e.KtG(a.selectedKeysChange())}),e.YNc(18,ae,2,1,"ng-template",26),e.qZA(),e.YNc(19,se,1,0,"p-progressSpinner",27),e.qZA()()}if(2&n){const t=e.oxw(3);e.xp6(13),e.Q6J("ngIf",null==t.selectedKeys?null:t.selectedKeys.length),e.xp6(4),e.Q6J("value",t.parsedData)("selection",t.selectedKeys)("filter",!0)("metaKeySelection",!0),e.xp6(2),e.Q6J("ngIf",t.loading.grid)}}function oe(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.update())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"Update"),e.qZA()()}}function ie(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"span",39),e.NdJ("click",function(){e.CHM(t);const a=e.oxw(4);return e.KtG(a.updateTTL())}),e._UZ(1,"i",40),e.TgZ(2,"span"),e._uU(3,"UpdateTTL"),e.qZA()()}}function re(n,i){if(1&n&&(e.TgZ(0,"span",41)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw(4);e.xp6(2),e.Oqu(t.ttlValue)}}function le(n,i){if(1&n){const t=e.EpF();e.TgZ(0,"div",11)(1,"div",12)(2,"span",32),e._UZ(3,"i",33),e._uU(4," Redis "),e.qZA(),e.TgZ(5,"span",34),e._uU(6),e.qZA(),e.YNc(7,oe,4,0,"span",35),e.YNc(8,ie,4,0,"span",35),e.YNc(9,re,3,1,"span",36),e.qZA(),e.TgZ(10,"div",37)(11,"app-monaco-editor",38),e.NdJ("editorGenerated",function(a){e.CHM(t);const r=e.oxw(3);return e.KtG(r.editorGenerated(a))}),e.qZA()()()}if(2&n){const t=e.oxw(3);e.xp6(6),e.Oqu(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key),e.xp6(1),e.Q6J("ngIf",(null==t.selectedKeys||null==t.selectedKeys[0]?null:t.selectedKeys[0].key)&&t.ttlValue>0),e.xp6(2),e.Q6J("isSchemaEditor",!1)("editorOptions",t.editorOptionsSchema)}}const de=function(){return{height:"100%"}},ce=function(){return[30,70]};function pe(n,i){1&n&&(e.TgZ(0,"p-splitter",9),e.YNc(1,ne,20,6,"ng-template",10),e.YNc(2,le,12,6,"ng-template",10),e.qZA()),2&n&&(e.Akn(e.DdM(3,de)),e.Q6J("panelSizes",e.DdM(4,ce)))}function me(n,i){if(1&n&&(e.TgZ(0,"div",3)(1,"div",4),e.YNc(2,ee,3,1,"span",5),e.YNc(3,pe,3,5,"p-splitter",6),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngIf",!t.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalRedisSetupDoneByRoot)}}let fe=(()=>{class n{monacoS;generalS;ns;authCS;constantsS;cd;confirmationService;instanceS;isDependentOnGroup=!0;treeNodes=[];subscriptions=[];selectedKeys;allTreeItemsMap={};editor;editorOptionsSchema={readOnly:!1,language:"json",contextmenu:!0};loading={grid:!1};selectedItem;BE_HOST_PORT=h.N.BE_HOST_PORT;redisNewKeyFormC;data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};virtual={itemHeight:28};parsedData;ttlValue;intervalRef;constructor(t,s,a,r,f,u,_,ve){this.monacoS=t,this.generalS=s,this.ns=a,this.authCS=r,this.constantsS=f,this.cd=u,this.confirmationService=_,this.instanceS=ve}ngOnInit(){this.getExternalRedisSetupFromPackageJson(),this.loadRedisDataList(),this.startTTLReduceInterval(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{t&&(t.action===d.F.SAVED?(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList()):t.action===d.F.UPDATED&&(this.redisNewKeyFormC.hideModal(),this.loadRedisDataList(),this.ttlValue=t.data))})),this.generalS.setNewTitle("API Maker - Redis Dashboard")}loadRedisDataList(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=(yield t.instanceS.getRedisKeysTree().toPromise()).data;for(const r of s)t.generalS.convertKTreeItemToPrimeNGTreeItem(r);const a={};t.generalS.getMapOfAllItems(a,s),t.parsedData=s,t.treeNodes=t.parsedData,t.allTreeItemsMap=a,t.loading.grid=!1,t.cd.detectChanges()})()}selectedKeysChange(){var t=this;return(0,l.Z)(function*(){if(t.ttlValue="",1===t.selectedKeys.length){const s=t.selectedKeys[0];if(s.children?.length)t.editor.setValue("");else{const a=yield t.instanceS.getRedisValue(s.key).toPromise();a?.data?.value&&(t.editor.setValue("string"==typeof a?.data?.value?a.data.value:JSON.stringify(a?.data?.value,null,4)),a?.data?.ttl>0&&(t.ttlValue=a.data.ttl))}}else t.editor.setValue("")})()}startTTLReduceInterval(){this.intervalRef=setInterval(()=>{this.ttlValue>0&&this.ttlValue--},1e3)}stopTTLReduceInterval(){clearInterval(this.intervalRef)}update(){var t=this;return(0,l.Z)(function*(){try{t.loading.grid=!0;const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};yield t.instanceS.updateRedisKeys(s),t.data.mode=p.D.EDIT,t.ns.showSuccess(t.constantsS.redis.editSuccess),t.loading.grid=!1}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update.")}})()}updateTTL(){var t=this;return(0,l.Z)(function*(){try{const s={keyName:t.selectedKeys[0].key,redisCodeStr:t.editor.getValue(),ttl:t.ttlValue};t.data.formData=void 0,t.data.mode=p.D.EDIT,t.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_EDIT_MODE,data:s}),t.redisNewKeyFormC.showModal()}catch(s){t.loading.grid=!1,t.ns.showErrorFromResponse(s.error||s,"Unable to update TTL.")}})()}editorGenerated(t){var s=this;return(0,l.Z)(function*(){s.editor=t,yield s.monacoS.loadSchemaEditorSettings(s.BE_HOST_PORT,s.authCS.getUserId(),null)})()}add(){this.data.formData=void 0,this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:d.F.OPEN_FORM_IN_ADD_MODE}),this.redisNewKeyFormC.showModal()}keyDelete(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.redisKeyPermanentDelete(b.map(t.selectedKeys,"key")).toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess(t.constantsS.redis.removePermanent),t.loadRedisDataList(),t.editor.setValue(""),t.selectedKeys=[],t.ttlValue=""):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}isExternalRedisSetupDoneByRoot;getExternalRedisSetupFromPackageJson(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;try{const s=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading.grid=!1,t.isExternalRedisSetupDoneByRoot=!0===s.isRedisSetupDone}catch{t.isExternalRedisSetupDoneByRoot=!1}})()}flushAll(){var t=this;return(0,l.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.redis.flushAllConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,l.Z)(function*(){yield t.flushAllData()}),function(){return s.apply(this,arguments)})})})()}flushAllData(){var t=this;return(0,l.Z)(function*(){t.loading.grid=!0;const s=yield t.instanceS.resetCache().toPromise();t.loading.grid=!1,s.success?(t.ns.showSuccess("Flush operation completed."),t.loadRedisDataList(),t.selectedItem=!1,t.editor.setValue("")):t.ns.showErrorFromResponse(s,t.constantsS.redis.removePermanentError)})()}ngOnDestroy(){this.stopTTLReduceInterval(),this.generalS.unsubscribe(this.subscriptions)}ERequestMethod=w.Yp;undefined=void 0;static \u0275fac=function(s){return new(s||n)(e.Y36(v.b),e.Y36(y.b),e.Y36(D.W),e.Y36(T.D),e.Y36(C.L),e.Y36(e.sBO),e.Y36(x.YP),e.Y36(S.E))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-redis-dashboard"]],viewQuery:function(s,a){if(1&s&&e.Gf(X,5),2&s){let r;e.iGM(r=e.CRH())&&(a.redisNewKeyFormC=r.first)}},inputs:{isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"]},decls:3,vars:2,consts:[["class","pt-1 pl-1 pr-1",4,"ngIf"],[3,"data"],["redisNewKeyFormC",""],[1,"pt-1","pl-1","pr-1"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],["class","text-center",4,"ngIf"],[3,"panelSizes","style",4,"ngIf"],[1,"text-center"],[1,"mt-5","pt-5"],[3,"panelSizes"],["pTemplate",""],[1,"card","shadow-sm","h-100","w-100"],[1,"card-header"],["src","../../../../assets/images/icons/redis.png","alt","Redis",1,"fa-fw"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/dashboard/redis-dashboard.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New Key",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["pTooltip","Refresh",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-sync-alt","text-info","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Delete",3,"click",4,"ngIf"],["pTooltip","Flush redis database",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-warning"],[1,"card-body","p-0"],["selectionMode","multiple","scrollHeight","calc(100vh - 128px)",1,"w-full",3,"value","selection","filter","metaKeySelection","selectionChange"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["pTooltip","Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","text-danger","fa-fw"],[1,"w-100","prevent-text-selection","cursor-pointer"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"],[1,"align-top"],[1,"fas","fa-cog","text-danger","fa-fw","mr-1"],[1,"ml-2","d-inline-block",2,"color","#57be1e","max-width","700px"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right text-info cursor-pointer ml-3",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 84px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],[1,"float-right","text-info","cursor-pointer","ml-3"]],template:function(s,a){1&s&&(e.YNc(0,me,4,2,"div",0),e._UZ(1,"app-redis-new-key-form",1,2)),2&s&&(e.Q6J("ngIf",void 0!==a.isExternalRedisSetupDoneByRoot),e.xp6(1),e.Q6J("data",a.data))},dependencies:[m.O5,R.O,x.jx,K.mp,Z.G,F.q,I.u,z]})}return n})();var ue=o(1678),_e=o(44950);const ge=[{path:"",component:fe}];let he=(()=>{class n{static \u0275fac=function(s){return new(s||n)};static \u0275mod=e.oAB({type:n});static \u0275inj=e.cJS({imports:[N.Bz.forChild(ge),E.u,ue.DashboardM,_e.A]})}return n})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4186],{84186:(_t,D,o)=>{o.r(D),o.d(D,{SystemApiM:()=>m});var u=o(77664),t=o(17017),f=o(94946),C=o(79329);let h=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(y){return new(y||s)};static \u0275cmp=f.Xpm({type:s,selectors:[["app-system-api-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(y,L){1&y&&(f.TgZ(0,"div",0),f._UZ(1,"app-system-api-w",1),f.qZA()),2&y&&(f.xp6(1),f.Q6J("showCheckbox",!1))},dependencies:[C.X],encapsulation:2})}return s})();var S=o(63726),M=(o(43219),o(44950));const T=[{path:"layout",component:h,canActivate:[S.P]}];let m=(()=>{class s{static \u0275fac=function(y){return new(y||s)};static \u0275mod=f.oAB({type:s});static \u0275inj=f.cJS({imports:[u.Bz.forChild(T),t.u,M.A]})}return s})()},43219:(_t,D,o)=>{o.d(D,{S:()=>nt});var u=o(15861),t=o(33157),f=o(90328),C=o(27672),h=o(59361),S=o(51162),R=o(20553),M=o(45085),T=o(91601),Z=o(3531),m=o(39989),s=o(94946),F=o(99961),P=o(56457),y=o(77240),L=o(62304),U=o(53429),K=o(27414),G=o(95852),B=o(96814),Y=o(32660),W=o(5860),w=o(756),J=o(97680),x=o(33259),Q=o(25025);const H=["monacoEditorModalC"],k=["insertCodeModalC"];function j(g,v){1&g&&(s.TgZ(0,"span"),s._UZ(1,"i",26),s._uU(2," Add System API Setting"),s.qZA())}function V(g,v){1&g&&(s.TgZ(0,"span"),s._UZ(1,"i",27),s._uU(2," View System API Setting"),s.qZA())}function X(g,v){1&g&&(s.TgZ(0,"span"),s._UZ(1,"i",28),s._uU(2," Edit System API Setting"),s.qZA())}function z(g,v){if(1&g){const a=s.EpF();s.TgZ(0,"a",29),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.viewError())}),s._uU(1,"View error"),s.qZA()}}function q(g,v){1&g&&(s.TgZ(0,"span"),s._uU(1,"Save"),s.qZA())}function tt(g,v){1&g&&(s.TgZ(0,"span"),s._uU(1,"Update"),s.qZA())}function et(g,v){if(1&g){const a=s.EpF();s.TgZ(0,"button",30),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.save())}),s._UZ(1,"i",31),s.YNc(2,q,2,0,"span",4),s.YNc(3,tt,2,0,"span",4),s.qZA()}if(2&g){const a=s.oxw();s.xp6(2),s.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function st(g,v){1&g&&s._UZ(0,"p-progressSpinner",32)}let nt=(()=>{class g{ns;systemApiSettingsS;generalS;monacoS;instanceS;constantsS;authCS;generalCS;EAPIAccessType=C.di;data;loading={form:!1};EFormMode=f.D;subscriptions=[];editorSysApiCode;editorOptionsSysApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=R.N.BE_HOST_PORT;viewDockerfileModelC;DOCS_HOST_PORT=R.N.DOCS_HOST_PORT;insertCodeModalC;constructor(a,l,r,E,b,it,ot,at){this.ns=a,this.systemApiSettingsS=l,this.generalS=r,this.monacoS=E,this.instanceS=b,this.constantsS=it,this.authCS=ot,this.generalCS=at}ngOnInit(){var a=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var l=(0,u.Z)(function*(r){r&&(r.action===t.F.OPEN_FORM_IN_EDIT_MODE||r.action===t.F.OPEN_FORM_IN_VIEW_MODE?a.editorSysApiCode&&(a.data.formData.sysApiSettingCode?a.generalCS.setValueInEditor(a,"editorSysApiCode",a.data.formData.sysApiSettingCode):a.loadSysApiCode()):r.action===t.F.OPEN_FORM_IN_ADD_MODE&&a.loadSysApiCode())});return function(r){return l.apply(this,arguments)}}()))}loadSysApiCode(){var a=this;return(0,u.Z)(function*(){const l=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,M.R.SYSTEM_APIS).toPromise();a.generalCS.setValueInEditor(a,"editorSysApiCode",l.data)})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=h.H.Settings,this.insertCodeModalC.showModal(Z.b.SystemApiFormC)}editorGenerated(a){var l=this;return(0,u.Z)(function*(){l.editorSysApiCode=a,yield l.monacoS.loadSchemaEditorSettings(l.BE_HOST_PORT,l.authCS.getUserId(),null),l.monacoS.addSaveCodeKeyBinding(a,r=>{l.data.mode!==f.D.VIEW&&l.save()}),l.monacoS.addInsertCodeKeyBinding(a,r=>{l.generalCS.messageReceivedFor=h.H.All,l.data.mode!==f.D.VIEW&&l.insertCodeModalC.showModal(Z.b.SystemApiFormC)}),l.subscriptions.push(l.generalS.messageReceived.subscribe(r=>{r.type&&r.type===m.g.TEXT_COPIED&&(l.monacoS.insertAtCursor(a,r.selectedText),l.insertCodeModalC.hideModal())}))})()}showModal(){this.lastError=void 0,$("#idSystemApiForm").modal("show")}hideModal(){$("#idSystemApiForm").modal("hide")}save(){var a=this;return(0,u.Z)(function*(){const l={};l.user=a.authCS.getUserId(),l.sysApiSettingCode=a.editorSysApiCode.getValue(),l.apiId=a.data.formData.apiId;try{let r;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorSysApiCode,a.monacoDecorations),a.data.mode!==f.D.ADD&&a.data.formData._id?a.data.mode===f.D.EDIT&&(r=yield a.systemApiSettingsS.replace(a.data.formData._id,l,{select:S.iH._id}).toPromise()):r=yield a.systemApiSettingsS.post(l).toPromise(),a.ns.showSuccess(a.data.mode===f.D.ADD?a.constantsS.systemApi.addSuccess:a.constantsS.systemApi.editSuccess),a.data.eventChannel.emit({action:a.data.mode===f.D.ADD?t.F.SAVED:t.F.UPDATED}),a.loading.form=!1}catch(r){a.loading.form=!1,a.ns.showErrorFromResponse(r.error||r,"Unable to save system API."),a.lastError=r.error,a.tab=a.tab||{},a.tab.axiosResponse={data:r.error},a.monacoS.highlightErrorInMonacoEditor(a.editorSysApiCode,a.tab,"MainSandbox.ts",a.monacoDecorations)}})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),T.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||g)(s.Y36(F.W),s.Y36(P.J),s.Y36(y.b),s.Y36(L.b),s.Y36(U.E),s.Y36(K.L),s.Y36(G.D),s.Y36(y.b))};static \u0275cmp=s.Xpm({type:g,selectors:[["app-w-system-api-form"]],viewQuery:function(l,r){if(1&l&&(s.Gf(H,5),s.Gf(k,5)),2&l){let E;s.iGM(E=s.CRH())&&(r.viewDockerfileModelC=E.first),s.iGM(E=s.CRH())&&(r.insertCodeModalC=E.first)}},inputs:{data:"data"},decls:29,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSystemApiForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/docs/settings/systemApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"overflow-hidden",2,"height","calc(100vh - 158px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,r){1&l&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),s.YNc(4,j,3,0,"span",4),s.YNc(5,V,3,0,"span",4),s.YNc(6,X,3,0,"span",4),s.TgZ(7,"div",5)(8,"button",6)(9,"span",7),s._UZ(10,"i",8),s.qZA()(),s.TgZ(11,"span",9),s.NdJ("click",function(){return r.showInsertCodeModel()}),s._UZ(12,"i",10),s.qZA(),s.TgZ(13,"a",11),s._UZ(14,"img",12),s.qZA()()(),s.TgZ(15,"div",13)(16,"div",14)(17,"app-monaco-editor",15),s.NdJ("editorGenerated",function(b){return r.editorGenerated(b)}),s.qZA()()(),s.TgZ(18,"div",16),s.YNc(19,z,2,0,"a",17),s.TgZ(20,"button",18),s._UZ(21,"i",19),s._uU(22," Close"),s.qZA(),s.YNc(23,et,4,2,"button",20),s.qZA(),s.YNc(24,st,1,0,"p-progressSpinner",21),s.qZA()()(),s._UZ(25,"app-monaco-editor-modal",22,23)(27,"app-insert-code-modal",24,25)),2&l&&(s.xp6(4),s.Q6J("ngIf",r.data.mode===r.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.EDIT),s.xp6(11),s.Q6J("isSchemaEditor",!0)("editorOptions",r.editorOptionsSysApi),s.xp6(2),s.Q6J("ngIf",r.lastError),s.xp6(4),s.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.loading.form),s.xp6(1),s.Q6J("modalId","idMonacoEditorModalInSysApi")("editorOptionsMonacoEditorModal",r.editorOptionsMonacoEditorModal)("modalTitle","Error info"),s.xp6(2),s.Q6J("frameId","idInsertCodeSystemAPI")("modalId","idInsertCodeSystemAPIForm")("docsHostPort",r.DOCS_HOST_PORT))},dependencies:[B.O5,Y.y,W.P,w.O,J.G,x.u,Q.A],encapsulation:2})}return g})()},79329:(_t,D,o)=>{o.d(D,{X:()=>Et});var u=o(15861),t=o(94946),f=o(33157),C=o(90328),h=o(56212),S=o(6990),M=o(45085),T=o(51162),Z=o(96925),m=o(19394),s=o(60921),F=o(56457),P=o(53429),y=o(77240),L=o(99961),U=o(85219),K=o(92189),G=o(95852),B=o(27414),Y=o(32915),W=o(77664),w=o(60095),J=o(96814),x=o(95431),Q=o(97680),H=o(33259),k=o(38057),j=o(43219);const V=["systemApiFormC"];function X(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",13)(1,"p-checkbox",14),t.NdJ("ngModelChange",function(_){t.CHM(e);const d=t.oxw();return t.KtG(d.eventCenterS.group.apisRegex.allSystemApis=_)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allSystemApis)("binary",!0)}}function z(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",15)(1,"p-checkbox",14),t.NdJ("ngModelChange",function(_){t.CHM(e);const d=t.oxw();return t.KtG(d.eventCenterS.filterInLog.apisRegex.allSystemApis=_)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allSystemApis)("binary",!0)}}function q(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",16),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allSystemApisPermitted)}}function tt(i,p){1&i&&(t.TgZ(0,"th",25),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function et(i,p){1&i&&t._UZ(0,"th",26)}function st(i,p){1&i&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function nt(i,p){1&i&&t._UZ(0,"th")}function g(i,p){1&i&&t._UZ(0,"th",27)}function v(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,tt,2,0,"th",22),t.YNc(2,et,1,0,"th",23),t.TgZ(3,"th"),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th"),t._uU(6,"URL"),t.qZA(),t.YNc(7,st,2,0,"th",9),t.YNc(8,nt,1,0,"th",9),t.YNc(9,g,1,0,"th",24),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(5),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",e.isLPM),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable)}}function a(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",30),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function l(i,p){if(1&i&&(t.TgZ(0,"td",31)(1,"span"),t._uU(2),t.qZA()()),2&i){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function r(i,p){1&i&&(t.TgZ(0,"span",35),t._uU(1,"AM-User"),t.qZA())}function E(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"No-Access"),t.qZA())}function b(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Public"),t.qZA())}function it(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"DB-User"),t.qZA())}function ot(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"AWS"),t.qZA())}function at(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"Azure"),t.qZA())}function rt(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"Google"),t.qZA())}function lt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,r,2,0,"span",32),t.YNc(2,E,2,0,"span",33),t.YNc(3,b,2,0,"span",34),t.YNc(4,it,2,0,"span",33),t.YNc(5,ot,2,0,"span",33),t.YNc(6,at,2,0,"span",33),t.YNc(7,rt,2,0,"span",33),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.hasAmAuth),t.xp6(1),t.Q6J("ngIf",e.noAccess),t.xp6(1),t.Q6J("ngIf",e.isPublic),t.xp6(1),t.Q6J("ngIf",e.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",e.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",e.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",e.hasGoogleAuth)}}function pt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"label",38)(2,"p-checkbox",39),t.NdJ("ngModelChange",function(_){t.CHM(e);const d=t.oxw(2).$implicit;return t.KtG(d.saveResponseInLog=_)})("click",function(_){t.CHM(e);const d=t.oxw(4);return t.KtG(d.generalS.stopPropagation(_))}),t.qZA()()()}if(2&i){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function dt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,pt,3,2,"div",9),t.qZA()),2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("ngIf",n.selectedRows.indexOf(e)>=0)}}function ct(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",45),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.add(_))}),t._UZ(1,"i",46),t.qZA()}}function mt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",47),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.edit(_))}),t._UZ(1,"i",48),t.qZA()}}function gt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",49),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.removePermanentDialog(_))}),t._UZ(1,"i",50),t.qZA()}}const ft=function(){return["/api-info/api-testing/testing"]},ut=function(i,p,e){return{at_category:i,at_user:p,at_api:e}};function At(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"td")(1,"div")(2,"a",40),t.NdJ("click",function(_){t.CHM(e);const d=t.oxw().$implicit,O=t.oxw(2);return _.stopPropagation(),t.KtG(O.selectedRows=[d])}),t._UZ(3,"i",41),t.qZA(),t.YNc(4,ct,2,0,"button",42),t.YNc(5,mt,2,0,"button",43),t.YNc(6,gt,2,0,"button",44),t.qZA()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(5,ft))("queryParams",t.kEZ(6,ut,n.EAPICategory.SYSTEM_APIS,n.authCS.getUserId(),e.id)),t.xp6(2),t.Q6J("ngIf",!e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings)}}function St(i,p){if(1&i&&(t.TgZ(0,"tr",28),t.YNc(1,a,2,2,"td",9),t.YNc(2,l,3,1,"td",29),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.YNc(7,lt,8,7,"td",9),t.YNc(8,dt,2,1,"td",9),t.YNc(9,At,7,10,"td",9),t.qZA()),2&i){const e=p.$implicit,n=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",n.showCheckbox),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Oqu(e.url),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",n.isLPM),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable)}}function yt(i,p){1&i&&t._UZ(0,"p-progressSpinner",51)}function ht(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",17)(1,"p-table",18),t.NdJ("selectionChange",function(_){t.CHM(e);const d=t.oxw();return t.KtG(d.selectedRows=_)})("selectionChange",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.apiSelected())})("dblclick",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.dblClickSystemAPIs())}),t.YNc(2,v,10,5,"ng-template",19),t.YNc(3,St,10,8,"ng-template",20),t.qZA(),t.YNc(4,yt,1,0,"p-progressSpinner",21),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 Et=(()=>{class i{systemApiSettingsS;instanceS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;showCheckbox=!0;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;typeIsGroup;loading={grid:!1};subscriptions=[];rows=[];rowsMap={};rowsMapName={};data={mode:C.D.ADD,eventChannel:new t.vpe,formData:void 0};selectedRows=[];gridKey=T.iH._id;EUserType=s.d;EAPICategory=M.R;systemApiFormC;constructor(e,n,_,d,O,I,A,c,N,Ct,vt){this.systemApiSettingsS=e,this.instanceS=n,this.generalS=_,this.notificationS=d,this.confirmationService=O,this.navigationCS=I,this.authCS=A,this.constantsS=c,this.eventCenterS=N,this.cd=Ct,this.router=vt}ngOnInit(){var e=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(n=>{(n.action===f.F.SAVED||n.action===f.F.UPDATED)&&(this.systemApiFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var n=(0,u.Z)(function*(_){_.length&&(yield e.loadGridData())});return function(_){return n.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(n=>{n&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - System APIs")}loadGridData(){var e=this;if(this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length)return void this.resetGridAndUrl();this.loading.grid=!0;let n=this.instanceS.systemAPIList.bind(this.instanceS);"SCANNING_PERIODS"===this.typeIsGroup&&(n=this.instanceS.systemAPIListWithGH.bind(this.instanceS)),this.subscriptions.push(n().subscribe(function(){var _=(0,u.Z)(function*(d){if(d.success){const I=d.data,A=[];if("SCANNING_PERIODS"===e.typeIsGroup)for(const c of I)(c.id===m.pj.CALL_EXTERNAL_API||c.id===m.pj.EXECUTE_PLAIN_QUERY||c.id===m.pj.GET_REDIS_KEY||c.id===m.pj.SET_REDIS_KEY||c.id===m.pj.REMOVE_REDIS_KEY||c.id===m.pj.RESET_REDIS_CACHE_DB||c.id===m.pj.RESET_REDIS_CACHE_CUSTOM_APIS||c.id===m.pj.RESET_REDIS_CACHE_SYSTEM_APIS||c.id===m.pj.RESET_REDIS_CACHE_TP_APIS||c.id===m.pj.GET_TABLE_META||c.id===m.pj.EMIT_EVENT||c.id===m.pj.EMIT_EVENT_WS||c.id===m.pj.IS_VALID_DATA_FOR_TABLE||c.id===m.pj.IS_VALID_DATA_FOR_CUSTOM_API||c.id===m.pj.IS_VALID_DATA_FOR_THIRD_PARTY_API||c.id===m.pj.MULTI_TENANT_INSTANCE_UPDATED||c.id===m.pj.IS_VALID_CONNECTION_STRING||c.id===m.pj.ENCRYPT_DATA||c.id===m.pj.DECRYPT_DATA)&&A.push(c);else A.push(...I);e.selectedRows=[],e.rows=A,e.rowsMap=S.keyBy(e.rows,T.iH._id),e.rowsMapName=S.keyBy(e.rows,T.qD.id)}else e.resetGridAndUrl();const O=e.navigationCS.getQueryParam(h.p.system_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.systemApiIds.value.join(","):e.eventCenterS.group.systemApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.systemApiNames.join(","):"");if(O){const I=O.split(","),A=S.intersection(S.keys(e.rowsMap),I),c=[];for(const N of A)e.rowsMap[N]&&c.push(e.rowsMap[N]);e.selectedRows=c,e.eventCenterS.group.systemApiIds.next(A),e.eventCenterS.group.systemApis.next(e.selectedRows),e.eventCenterS.filterInLog.systemApiIds.next(A)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?.length){const I=e.eventCenterS.group.selectedGroups.value[0];for(const A of I?.queryParams?.systemApiNames)e.rowsMapName[A]&&(e.rowsMapName[A].saveResponseInLog=I.systemApisLog?.[A]?.saveResponseInLog||!1);e.setResDataInEventCenter()}e.loading.grid=!1,e.cd.detectChanges()});return function(d){return _.apply(this,arguments)}}()))}view(){var e=this;return(0,u.Z)(function*(){const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id},e.data.mode=C.D.VIEW,e.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_VIEW_MODE}),e.systemApiFormC.showModal()})()}add(e){var n=this;return(0,u.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=C.D.ADD,n.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE}),n.systemApiFormC.showModal()})()}edit(e){var n=this;return(0,u.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=C.D.EDIT,n.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),n.systemApiFormC.showModal()})()}getSystemApiSetting(){var e=this;return(0,u.Z)(function*(){try{return((yield e.systemApiSettingsS.query({find:{user:e.authCS.getUserId(),apiId:e.selectedRows[0]._id}}).toPromise()).data||[])[0]||{apiId:e.selectedRows?.[0]?._id}}catch{return{apiId:e.selectedRows?.[0]?._id}}})()}resetDependents(){var e=this;return(0,u.Z)(function*(){yield e.navigationCS.setQueryParam(h.p.system_api,null)})()}apiSelected(){var e=this;return(0,u.Z)(function*(){yield e.resetDependents(),yield e.fillData(),e.selectedRows?.[0]?e.generalS.setNewTitle(e.selectedRows[0].name,M.R.SYSTEM_APIS):e.generalS.setNewTitle("API Maker - System APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var e=this;return(0,u.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(h.p.system_api,null),e.eventCenterS.group.systemApis.next([]),e.eventCenterS.group.systemApiIds.next([]),e.eventCenterS.filterInLog.systemApiIds.next([]),void e.eventCenterS.filterInLog.systemApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable)e.eventCenterS.group.systemApiIds.next(S.map(e.selectedRows,"_id")),e.eventCenterS.group.systemApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.systemApiIds.next(S.map(e.selectedRows,"_id")),e.eventCenterS.filterInLog.systemApis.next(e.selectedRows));else{yield e.navigationCS.setQueryParam(h.p.system_api,e.selectedRows[0]._id);const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id}}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.systemApis.next(this.selectedRows),this.eventCenterS.group.selectedSystemApis.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.systemApis.next(this.selectedRows)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}removePermanentDialog(e){var n=this;return(0,u.Z)(function*(){var _;n.selectedRows=[e],n.confirmationService.confirm({message:n.confirmMessage(),header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(_=(0,u.Z)(function*(){yield n.removePermanent(e)}),function(){return _.apply(this,arguments)})}),n.cd.detectChanges()})()}removePermanent(e){var n=this;return(0,u.Z)(function*(){n.loading.grid=!0;const _=yield n.systemApiSettingsS.permanentDelete(e.systemApiSettings).toPromise();n.loading.grid=!1,_?(n.notificationS.showSuccess(n.constantsS.systemApi.removePermanent),n.resetGridAndUrl(),n.loadGridData(),yield n.getSystemApiSetting(),n.cd.detectChanges()):n.notificationS.showErrorFromResponse(_,n.constantsS.systemApi.removePermanentError)})()}dblClickSystemAPIs(){if(this.isDependentOnGroup||this.isLPM)return;const e=this.selectedRows[0];this.selectedRows.length&&e.systemApiSettings?this.edit(e):this.selectedRows.length&&!e.systemApiSettings&&this.add(e)}confirmMessage(){return'<p class="dialog-text">Do you want to <b class="text-danger">permanently remove System API settings</b>?</p>'}ERequestMethod=Z.Yp;static \u0275fac=function(n){return new(n||i)(t.Y36(F.J),t.Y36(P.E),t.Y36(y.b),t.Y36(L.W),t.Y36(U.YP),t.Y36(K.S),t.Y36(G.D),t.Y36(B.L),t.Y36(Y.u),t.Y36(t.sBO),t.Y36(W.F0))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-system-api-w"]],viewQuery:function(n,_){if(1&n&&t.Gf(V,5),2&n){let d;t.iGM(d=t.CRH())&&(_.systemApiFormC=d.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection",typeIsGroup:"typeIsGroup"},decls:15,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/systems.svg","alt","System API",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/examples/sys/system/system.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All System APIs",4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All System APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[3,"data"],["systemApiFormC",""],["tooltipPosition","left","pTooltip","All System APIs",1,"float-right","cursor-pointer"],[3,"ngModel","binary","ngModelChange"],["pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped system-api-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],["style","width: 140px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","140px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:",1,"btn","btn-xsm-custom","mr-1",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["class","btn btn-xsm-custom mr-1","pTooltip","Add System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom mr-1","pTooltip","Edit System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom","pTooltip","Permanent Delete System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["pTooltip","Add System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","cursor-pointer"],["pTooltip","Edit System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,_){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," System APIs"),t.qZA(),t.TgZ(5,"div",3)(6,"a",4),t._UZ(7,"img",5),t.qZA()(),t.YNc(8,X,2,2,"span",6),t.YNc(9,z,2,2,"span",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,q,3,1,"div",9),t.YNc(12,ht,5,7,"div",10),t.qZA()(),t._UZ(13,"app-w-system-api-form",11,12)),2&n&&(t.xp6(8),t.Q6J("ngIf",_.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",_.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis),t.xp6(1),t.Q6J("ngIf",!(_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis)),t.xp6(1),t.Q6J("data",_.data))},dependencies:[W.rH,w.JJ,w.On,J.O5,x.iA,U.jx,x.Ei,x.UA,x.Mo,Q.G,H.u,k.XZ,j.S],encapsulation:2})}return i})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[4186],{84186:(_t,D,o)=>{o.r(D),o.d(D,{SystemApiM:()=>m});var u=o(77664),t=o(17017),f=o(94946),C=o(79329);let h=(()=>{class s{constructor(){}ngOnInit(){}static \u0275fac=function(y){return new(y||s)};static \u0275cmp=f.Xpm({type:s,selectors:[["app-system-api-layout"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(y,L){1&y&&(f.TgZ(0,"div",0),f._UZ(1,"app-system-api-w",1),f.qZA()),2&y&&(f.xp6(1),f.Q6J("showCheckbox",!1))},dependencies:[C.X],encapsulation:2})}return s})();var S=o(63726),M=(o(43219),o(44950));const T=[{path:"layout",component:h,canActivate:[S.P]}];let m=(()=>{class s{static \u0275fac=function(y){return new(y||s)};static \u0275mod=f.oAB({type:s});static \u0275inj=f.cJS({imports:[u.Bz.forChild(T),t.u,M.A]})}return s})()},43219:(_t,D,o)=>{o.d(D,{S:()=>nt});var u=o(15861),t=o(33157),f=o(90328),C=o(27672),h=o(59361),S=o(51162),R=o(20553),M=o(45085),T=o(91601),Z=o(3531),m=o(39989),s=o(94946),F=o(99961),P=o(56457),y=o(77240),L=o(45809),U=o(53429),K=o(27414),G=o(95852),B=o(96814),Y=o(32660),W=o(5860),w=o(756),J=o(97680),x=o(33259),Q=o(25025);const H=["monacoEditorModalC"],k=["insertCodeModalC"];function j(g,v){1&g&&(s.TgZ(0,"span"),s._UZ(1,"i",26),s._uU(2," Add System API Setting"),s.qZA())}function V(g,v){1&g&&(s.TgZ(0,"span"),s._UZ(1,"i",27),s._uU(2," View System API Setting"),s.qZA())}function X(g,v){1&g&&(s.TgZ(0,"span"),s._UZ(1,"i",28),s._uU(2," Edit System API Setting"),s.qZA())}function z(g,v){if(1&g){const a=s.EpF();s.TgZ(0,"a",29),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.viewError())}),s._uU(1,"View error"),s.qZA()}}function q(g,v){1&g&&(s.TgZ(0,"span"),s._uU(1,"Save"),s.qZA())}function tt(g,v){1&g&&(s.TgZ(0,"span"),s._uU(1,"Update"),s.qZA())}function et(g,v){if(1&g){const a=s.EpF();s.TgZ(0,"button",30),s.NdJ("click",function(){s.CHM(a);const r=s.oxw();return s.KtG(r.save())}),s._UZ(1,"i",31),s.YNc(2,q,2,0,"span",4),s.YNc(3,tt,2,0,"span",4),s.qZA()}if(2&g){const a=s.oxw();s.xp6(2),s.Q6J("ngIf",a.data.mode===a.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",a.data.mode===a.EFormMode.EDIT)}}function st(g,v){1&g&&s._UZ(0,"p-progressSpinner",32)}let nt=(()=>{class g{ns;systemApiSettingsS;generalS;monacoS;instanceS;constantsS;authCS;generalCS;EAPIAccessType=C.di;data;loading={form:!1};EFormMode=f.D;subscriptions=[];editorSysApiCode;editorOptionsSysApi={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};monacoDecorations=[];tab;BE_HOST_PORT=R.N.BE_HOST_PORT;viewDockerfileModelC;DOCS_HOST_PORT=R.N.DOCS_HOST_PORT;insertCodeModalC;constructor(a,l,r,E,b,it,ot,at){this.ns=a,this.systemApiSettingsS=l,this.generalS=r,this.monacoS=E,this.instanceS=b,this.constantsS=it,this.authCS=ot,this.generalCS=at}ngOnInit(){var a=this;this.subscriptions.push(this.data.eventChannel.subscribe(function(){var l=(0,u.Z)(function*(r){r&&(r.action===t.F.OPEN_FORM_IN_EDIT_MODE||r.action===t.F.OPEN_FORM_IN_VIEW_MODE?a.editorSysApiCode&&(a.data.formData.sysApiSettingCode?a.generalCS.setValueInEditor(a,"editorSysApiCode",a.data.formData.sysApiSettingCode):a.loadSysApiCode()):r.action===t.F.OPEN_FORM_IN_ADD_MODE&&a.loadSysApiCode())});return function(r){return l.apply(this,arguments)}}()))}loadSysApiCode(){var a=this;return(0,u.Z)(function*(){const l=yield a.instanceS.getDefaultContent(a.BE_HOST_PORT,M.R.SYSTEM_APIS).toPromise();a.generalCS.setValueInEditor(a,"editorSysApiCode",l.data)})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=h.H.Settings,this.insertCodeModalC.showModal(Z.b.SystemApiFormC)}editorGenerated(a){var l=this;return(0,u.Z)(function*(){l.editorSysApiCode=a,yield l.monacoS.loadSchemaEditorSettings(l.BE_HOST_PORT,l.authCS.getUserId(),null),l.monacoS.addSaveCodeKeyBinding(a,r=>{l.data.mode!==f.D.VIEW&&l.save()}),l.monacoS.addInsertCodeKeyBinding(a,r=>{l.generalCS.messageReceivedFor=h.H.All,l.data.mode!==f.D.VIEW&&l.insertCodeModalC.showModal(Z.b.SystemApiFormC)}),l.subscriptions.push(l.generalS.messageReceived.subscribe(r=>{r.type&&r.type===m.g.TEXT_COPIED&&(l.monacoS.insertAtCursor(a,r.selectedText),l.insertCodeModalC.hideModal())}))})()}showModal(){this.lastError=void 0,$("#idSystemApiForm").modal("show")}hideModal(){$("#idSystemApiForm").modal("hide")}save(){var a=this;return(0,u.Z)(function*(){const l={};l.user=a.authCS.getUserId(),l.sysApiSettingCode=a.editorSysApiCode.getValue(),l.apiId=a.data.formData.apiId;try{let r;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorSysApiCode,a.monacoDecorations),a.data.mode!==f.D.ADD&&a.data.formData._id?a.data.mode===f.D.EDIT&&(r=yield a.systemApiSettingsS.replace(a.data.formData._id,l,{select:S.iH._id}).toPromise()):r=yield a.systemApiSettingsS.post(l).toPromise(),a.ns.showSuccess(a.data.mode===f.D.ADD?a.constantsS.systemApi.addSuccess:a.constantsS.systemApi.editSuccess),a.data.eventChannel.emit({action:a.data.mode===f.D.ADD?t.F.SAVED:t.F.UPDATED}),a.loading.form=!1}catch(r){a.loading.form=!1,a.ns.showErrorFromResponse(r.error||r,"Unable to save system API."),a.lastError=r.error,a.tab=a.tab||{},a.tab.axiosResponse={data:r.error},a.monacoS.highlightErrorInMonacoEditor(a.editorSysApiCode,a.tab,"MainSandbox.ts",a.monacoDecorations)}})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),T.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(l){return new(l||g)(s.Y36(F.W),s.Y36(P.J),s.Y36(y.b),s.Y36(L.b),s.Y36(U.E),s.Y36(K.L),s.Y36(G.D),s.Y36(y.b))};static \u0275cmp=s.Xpm({type:g,selectors:[["app-w-system-api-form"]],viewQuery:function(l,r){if(1&l&&(s.Gf(H,5),s.Gf(k,5)),2&l){let E;s.iGM(E=s.CRH())&&(r.viewDockerfileModelC=E.first),s.iGM(E=s.CRH())&&(r.insertCodeModalC=E.first)}},inputs:{data:"data"},decls:29,vars:14,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idSystemApiForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/docs/settings/systemApiSettings.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-2","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],[1,"overflow-hidden",2,"height","calc(100vh - 158px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(l,r){1&l&&(s.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),s.YNc(4,j,3,0,"span",4),s.YNc(5,V,3,0,"span",4),s.YNc(6,X,3,0,"span",4),s.TgZ(7,"div",5)(8,"button",6)(9,"span",7),s._UZ(10,"i",8),s.qZA()(),s.TgZ(11,"span",9),s.NdJ("click",function(){return r.showInsertCodeModel()}),s._UZ(12,"i",10),s.qZA(),s.TgZ(13,"a",11),s._UZ(14,"img",12),s.qZA()()(),s.TgZ(15,"div",13)(16,"div",14)(17,"app-monaco-editor",15),s.NdJ("editorGenerated",function(b){return r.editorGenerated(b)}),s.qZA()()(),s.TgZ(18,"div",16),s.YNc(19,z,2,0,"a",17),s.TgZ(20,"button",18),s._UZ(21,"i",19),s._uU(22," Close"),s.qZA(),s.YNc(23,et,4,2,"button",20),s.qZA(),s.YNc(24,st,1,0,"p-progressSpinner",21),s.qZA()()(),s._UZ(25,"app-monaco-editor-modal",22,23)(27,"app-insert-code-modal",24,25)),2&l&&(s.xp6(4),s.Q6J("ngIf",r.data.mode===r.EFormMode.ADD),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.data.mode===r.EFormMode.EDIT),s.xp6(11),s.Q6J("isSchemaEditor",!0)("editorOptions",r.editorOptionsSysApi),s.xp6(2),s.Q6J("ngIf",r.lastError),s.xp6(4),s.Q6J("ngIf",r.data.mode!==r.EFormMode.VIEW),s.xp6(1),s.Q6J("ngIf",r.loading.form),s.xp6(1),s.Q6J("modalId","idMonacoEditorModalInSysApi")("editorOptionsMonacoEditorModal",r.editorOptionsMonacoEditorModal)("modalTitle","Error info"),s.xp6(2),s.Q6J("frameId","idInsertCodeSystemAPI")("modalId","idInsertCodeSystemAPIForm")("docsHostPort",r.DOCS_HOST_PORT))},dependencies:[B.O5,Y.y,W.P,w.O,J.G,x.u,Q.A],encapsulation:2})}return g})()},79329:(_t,D,o)=>{o.d(D,{X:()=>Et});var u=o(15861),t=o(94946),f=o(33157),C=o(90328),h=o(56212),S=o(6990),M=o(45085),T=o(51162),Z=o(96925),m=o(19394),s=o(60921),F=o(56457),P=o(53429),y=o(77240),L=o(99961),U=o(85219),K=o(92189),G=o(95852),B=o(27414),Y=o(32915),W=o(77664),w=o(60095),J=o(96814),x=o(95431),Q=o(97680),H=o(33259),k=o(38057),j=o(43219);const V=["systemApiFormC"];function X(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",13)(1,"p-checkbox",14),t.NdJ("ngModelChange",function(_){t.CHM(e);const d=t.oxw();return t.KtG(d.eventCenterS.group.apisRegex.allSystemApis=_)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.eventCenterS.group.apisRegex.allSystemApis)("binary",!0)}}function z(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"span",15)(1,"p-checkbox",14),t.NdJ("ngModelChange",function(_){t.CHM(e);const d=t.oxw();return t.KtG(d.eventCenterS.filterInLog.apisRegex.allSystemApis=_)}),t.qZA()()}if(2&i){const e=t.oxw();t.xp6(1),t.Q6J("ngModel",e.eventCenterS.filterInLog.apisRegex.allSystemApis)("binary",!0)}}function q(i,p){if(1&i&&(t.TgZ(0,"div")(1,"div",16),t._uU(2),t.qZA()()),2&i){const e=t.oxw();t.xp6(2),t.Oqu(e.constantsS.group.allSystemApisPermitted)}}function tt(i,p){1&i&&(t.TgZ(0,"th",25),t._UZ(1,"p-tableHeaderCheckbox"),t.qZA())}function et(i,p){1&i&&t._UZ(0,"th",26)}function st(i,p){1&i&&(t.TgZ(0,"th"),t._uU(1,"Authorization"),t.qZA())}function nt(i,p){1&i&&t._UZ(0,"th")}function g(i,p){1&i&&t._UZ(0,"th",27)}function v(i,p){if(1&i&&(t.TgZ(0,"tr"),t.YNc(1,tt,2,0,"th",22),t.YNc(2,et,1,0,"th",23),t.TgZ(3,"th"),t._uU(4,"Name"),t.qZA(),t.TgZ(5,"th"),t._uU(6,"URL"),t.qZA(),t.YNc(7,st,2,0,"th",9),t.YNc(8,nt,1,0,"th",9),t.YNc(9,g,1,0,"th",24),t.qZA()),2&i){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",e.showCheckbox),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(5),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",e.isLPM),t.xp6(1),t.Q6J("ngIf",!e.isDependentOnGroup&&!e.isLPM&&!e.isFilterLogTable)}}function a(i,p){if(1&i&&(t.TgZ(0,"td"),t._UZ(1,"p-tableCheckbox",30),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("value",e)("pSelectableRow",e)}}function l(i,p){if(1&i&&(t.TgZ(0,"td",31)(1,"span"),t._uU(2),t.qZA()()),2&i){const e=t.oxw().rowIndex;t.xp6(2),t.Oqu(e+1)}}function r(i,p){1&i&&(t.TgZ(0,"span",35),t._uU(1,"AM-User"),t.qZA())}function E(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"No-Access"),t.qZA())}function b(i,p){1&i&&(t.TgZ(0,"span",37),t._uU(1,"Public"),t.qZA())}function it(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"DB-User"),t.qZA())}function ot(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"AWS"),t.qZA())}function at(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"Azure"),t.qZA())}function rt(i,p){1&i&&(t.TgZ(0,"span",36),t._uU(1,"Google"),t.qZA())}function lt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,r,2,0,"span",32),t.YNc(2,E,2,0,"span",33),t.YNc(3,b,2,0,"span",34),t.YNc(4,it,2,0,"span",33),t.YNc(5,ot,2,0,"span",33),t.YNc(6,at,2,0,"span",33),t.YNc(7,rt,2,0,"span",33),t.qZA()),2&i){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngIf",e.hasAmAuth),t.xp6(1),t.Q6J("ngIf",e.noAccess),t.xp6(1),t.Q6J("ngIf",e.isPublic),t.xp6(1),t.Q6J("ngIf",e.hasAmDBAuth),t.xp6(1),t.Q6J("ngIf",e.hasAwsAuth),t.xp6(1),t.Q6J("ngIf",e.hasAzureAuth),t.xp6(1),t.Q6J("ngIf",e.hasGoogleAuth)}}function pt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div")(1,"label",38)(2,"p-checkbox",39),t.NdJ("ngModelChange",function(_){t.CHM(e);const d=t.oxw(2).$implicit;return t.KtG(d.saveResponseInLog=_)})("click",function(_){t.CHM(e);const d=t.oxw(4);return t.KtG(d.generalS.stopPropagation(_))}),t.qZA()()()}if(2&i){const e=t.oxw(2).$implicit;t.xp6(2),t.Q6J("ngModel",e.saveResponseInLog)("binary",!0)}}function dt(i,p){if(1&i&&(t.TgZ(0,"td"),t.YNc(1,pt,3,2,"div",9),t.qZA()),2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(1),t.Q6J("ngIf",n.selectedRows.indexOf(e)>=0)}}function ct(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",45),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.add(_))}),t._UZ(1,"i",46),t.qZA()}}function mt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",47),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.edit(_))}),t._UZ(1,"i",48),t.qZA()}}function gt(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"button",49),t.NdJ("click",function(){t.CHM(e);const _=t.oxw(2).$implicit,d=t.oxw(2);return t.KtG(d.removePermanentDialog(_))}),t._UZ(1,"i",50),t.qZA()}}const ft=function(){return["/api-info/api-testing/testing"]},ut=function(i,p,e){return{at_category:i,at_user:p,at_api:e}};function At(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"td")(1,"div")(2,"a",40),t.NdJ("click",function(_){t.CHM(e);const d=t.oxw().$implicit,O=t.oxw(2);return _.stopPropagation(),t.KtG(O.selectedRows=[d])}),t._UZ(3,"i",41),t.qZA(),t.YNc(4,ct,2,0,"button",42),t.YNc(5,mt,2,0,"button",43),t.YNc(6,gt,2,0,"button",44),t.qZA()()}if(2&i){const e=t.oxw().$implicit,n=t.oxw(2);t.xp6(2),t.Q6J("routerLink",t.DdM(5,ft))("queryParams",t.kEZ(6,ut,n.EAPICategory.SYSTEM_APIS,n.authCS.getUserId(),e.id)),t.xp6(2),t.Q6J("ngIf",!e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings),t.xp6(1),t.Q6J("ngIf",e.systemApiSettings)}}function St(i,p){if(1&i&&(t.TgZ(0,"tr",28),t.YNc(1,a,2,2,"td",9),t.YNc(2,l,3,1,"td",29),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.YNc(7,lt,8,7,"td",9),t.YNc(8,dt,2,1,"td",9),t.YNc(9,At,7,10,"td",9),t.qZA()),2&i){const e=p.$implicit,n=t.oxw(2);t.Q6J("pSelectableRow",e),t.xp6(1),t.Q6J("ngIf",n.showCheckbox),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(2),t.Oqu(e.name),t.xp6(2),t.Oqu(e.url),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable),t.xp6(1),t.Q6J("ngIf",n.isLPM),t.xp6(1),t.Q6J("ngIf",!n.isDependentOnGroup&&!n.isLPM&&!n.isFilterLogTable)}}function yt(i,p){1&i&&t._UZ(0,"p-progressSpinner",51)}function ht(i,p){if(1&i){const e=t.EpF();t.TgZ(0,"div",17)(1,"p-table",18),t.NdJ("selectionChange",function(_){t.CHM(e);const d=t.oxw();return t.KtG(d.selectedRows=_)})("selectionChange",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.apiSelected())})("dblclick",function(){t.CHM(e);const _=t.oxw();return t.KtG(_.dblClickSystemAPIs())}),t.YNc(2,v,10,5,"ng-template",19),t.YNc(3,St,10,8,"ng-template",20),t.qZA(),t.YNc(4,yt,1,0,"p-progressSpinner",21),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 Et=(()=>{class i{systemApiSettingsS;instanceS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;showCheckbox=!0;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;typeIsGroup;loading={grid:!1};subscriptions=[];rows=[];rowsMap={};rowsMapName={};data={mode:C.D.ADD,eventChannel:new t.vpe,formData:void 0};selectedRows=[];gridKey=T.iH._id;EUserType=s.d;EAPICategory=M.R;systemApiFormC;constructor(e,n,_,d,O,I,A,c,N,Ct,vt){this.systemApiSettingsS=e,this.instanceS=n,this.generalS=_,this.notificationS=d,this.confirmationService=O,this.navigationCS=I,this.authCS=A,this.constantsS=c,this.eventCenterS=N,this.cd=Ct,this.router=vt}ngOnInit(){var e=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(n=>{(n.action===f.F.SAVED||n.action===f.F.UPDATED)&&(this.systemApiFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var n=(0,u.Z)(function*(_){_.length&&(yield e.loadGridData())});return function(_){return n.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(n=>{n&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - System APIs")}loadGridData(){var e=this;if(this.isDependentOnGroup&&0===this.eventCenterS.group.selectedGroups.value.length)return void this.resetGridAndUrl();this.loading.grid=!0;let n=this.instanceS.systemAPIList.bind(this.instanceS);"SCANNING_PERIODS"===this.typeIsGroup&&(n=this.instanceS.systemAPIListWithGH.bind(this.instanceS)),this.subscriptions.push(n().subscribe(function(){var _=(0,u.Z)(function*(d){if(d.success){const I=d.data,A=[];if("SCANNING_PERIODS"===e.typeIsGroup)for(const c of I)(c.id===m.pj.CALL_EXTERNAL_API||c.id===m.pj.EXECUTE_PLAIN_QUERY||c.id===m.pj.GET_REDIS_KEY||c.id===m.pj.SET_REDIS_KEY||c.id===m.pj.REMOVE_REDIS_KEY||c.id===m.pj.RESET_REDIS_CACHE_DB||c.id===m.pj.RESET_REDIS_CACHE_CUSTOM_APIS||c.id===m.pj.RESET_REDIS_CACHE_SYSTEM_APIS||c.id===m.pj.RESET_REDIS_CACHE_TP_APIS||c.id===m.pj.GET_TABLE_META||c.id===m.pj.EMIT_EVENT||c.id===m.pj.EMIT_EVENT_WS||c.id===m.pj.IS_VALID_DATA_FOR_TABLE||c.id===m.pj.IS_VALID_DATA_FOR_CUSTOM_API||c.id===m.pj.IS_VALID_DATA_FOR_THIRD_PARTY_API||c.id===m.pj.MULTI_TENANT_INSTANCE_UPDATED||c.id===m.pj.IS_VALID_CONNECTION_STRING||c.id===m.pj.ENCRYPT_DATA||c.id===m.pj.DECRYPT_DATA)&&A.push(c);else A.push(...I);e.selectedRows=[],e.rows=A,e.rowsMap=S.keyBy(e.rows,T.iH._id),e.rowsMapName=S.keyBy(e.rows,T.qD.id)}else e.resetGridAndUrl();const O=e.navigationCS.getQueryParam(h.p.system_api)||(e.isFilterLogTable?e.eventCenterS.filterInLog.systemApiIds.value.join(","):e.eventCenterS.group.systemApiIds.value.join(","))||(e.isDependentOnGroup&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?e.eventCenterS.group.selectedGroups.value[0].queryParams.systemApiNames.join(","):"");if(O){const I=O.split(","),A=S.intersection(S.keys(e.rowsMap),I),c=[];for(const N of A)e.rowsMap[N]&&c.push(e.rowsMap[N]);e.selectedRows=c,e.eventCenterS.group.systemApiIds.next(A),e.eventCenterS.group.systemApis.next(e.selectedRows),e.eventCenterS.filterInLog.systemApiIds.next(A)}if(e.isLPM&&e.eventCenterS.group.selectedGroups.value[0]?.queryParams?.systemApiNames?.length){const I=e.eventCenterS.group.selectedGroups.value[0];for(const A of I?.queryParams?.systemApiNames)e.rowsMapName[A]&&(e.rowsMapName[A].saveResponseInLog=I.systemApisLog?.[A]?.saveResponseInLog||!1);e.setResDataInEventCenter()}e.loading.grid=!1,e.cd.detectChanges()});return function(d){return _.apply(this,arguments)}}()))}view(){var e=this;return(0,u.Z)(function*(){const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id},e.data.mode=C.D.VIEW,e.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_VIEW_MODE}),e.systemApiFormC.showModal()})()}add(e){var n=this;return(0,u.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=C.D.ADD,n.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE}),n.systemApiFormC.showModal()})()}edit(e){var n=this;return(0,u.Z)(function*(){n.selectedRows=[e];const _=yield n.getSystemApiSetting();n.data.formData=_._id?_:{apiId:e.id,hideEnableCachingCheckbox:e.hideEnableCachingCheckbox},n.data.mode=C.D.EDIT,n.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),n.systemApiFormC.showModal()})()}getSystemApiSetting(){var e=this;return(0,u.Z)(function*(){try{return((yield e.systemApiSettingsS.query({find:{user:e.authCS.getUserId(),apiId:e.selectedRows[0]._id}}).toPromise()).data||[])[0]||{apiId:e.selectedRows?.[0]?._id}}catch{return{apiId:e.selectedRows?.[0]?._id}}})()}resetDependents(){var e=this;return(0,u.Z)(function*(){yield e.navigationCS.setQueryParam(h.p.system_api,null)})()}apiSelected(){var e=this;return(0,u.Z)(function*(){yield e.resetDependents(),yield e.fillData(),e.selectedRows?.[0]?e.generalS.setNewTitle(e.selectedRows[0].name,M.R.SYSTEM_APIS):e.generalS.setNewTitle("API Maker - System APIs")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var e=this;return(0,u.Z)(function*(){if(!e.selectedRows.length)return yield e.navigationCS.setQueryParam(h.p.system_api,null),e.eventCenterS.group.systemApis.next([]),e.eventCenterS.group.systemApiIds.next([]),e.eventCenterS.filterInLog.systemApiIds.next([]),void e.eventCenterS.filterInLog.systemApis.next([]);if(e.isDependentOnGroup||e.isFilterLogTable)e.eventCenterS.group.systemApiIds.next(S.map(e.selectedRows,"_id")),e.eventCenterS.group.systemApis.next(e.selectedRows),e.isFilterLogTable&&(e.eventCenterS.filterInLog.systemApiIds.next(S.map(e.selectedRows,"_id")),e.eventCenterS.filterInLog.systemApis.next(e.selectedRows));else{yield e.navigationCS.setQueryParam(h.p.system_api,e.selectedRows[0]._id);const n=yield e.getSystemApiSetting();e.data.formData=n._id?n:{apiId:e.selectedRows[0]._id}}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.systemApis.next(this.selectedRows),this.eventCenterS.group.selectedSystemApis.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.systemApis.next(this.selectedRows)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}removePermanentDialog(e){var n=this;return(0,u.Z)(function*(){var _;n.selectedRows=[e],n.confirmationService.confirm({message:n.confirmMessage(),header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(_=(0,u.Z)(function*(){yield n.removePermanent(e)}),function(){return _.apply(this,arguments)})}),n.cd.detectChanges()})()}removePermanent(e){var n=this;return(0,u.Z)(function*(){n.loading.grid=!0;const _=yield n.systemApiSettingsS.permanentDelete(e.systemApiSettings).toPromise();n.loading.grid=!1,_?(n.notificationS.showSuccess(n.constantsS.systemApi.removePermanent),n.resetGridAndUrl(),n.loadGridData(),yield n.getSystemApiSetting(),n.cd.detectChanges()):n.notificationS.showErrorFromResponse(_,n.constantsS.systemApi.removePermanentError)})()}dblClickSystemAPIs(){if(this.isDependentOnGroup||this.isLPM)return;const e=this.selectedRows[0];this.selectedRows.length&&e.systemApiSettings?this.edit(e):this.selectedRows.length&&!e.systemApiSettings&&this.add(e)}confirmMessage(){return'<p class="dialog-text">Do you want to <b class="text-danger">permanently remove System API settings</b>?</p>'}ERequestMethod=Z.Yp;static \u0275fac=function(n){return new(n||i)(t.Y36(F.J),t.Y36(P.E),t.Y36(y.b),t.Y36(L.W),t.Y36(U.YP),t.Y36(K.S),t.Y36(G.D),t.Y36(B.L),t.Y36(Y.u),t.Y36(t.sBO),t.Y36(W.F0))};static \u0275cmp=t.Xpm({type:i,selectors:[["app-system-api-w"]],viewQuery:function(n,_){if(1&n&&t.Gf(V,5),2&n){let d;t.iGM(d=t.CRH())&&(_.systemApiFormC=d.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection",typeIsGroup:"typeIsGroup"},decls:15,vars:5,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/systems.svg","alt","System API",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/examples/sys/system/system.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All System APIs",4,"ngIf"],["class","float-right cursor-pointer","pTooltip","All System APIs",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],["class","h-100",4,"ngIf"],[3,"data"],["systemApiFormC",""],["tooltipPosition","left","pTooltip","All System APIs",1,"float-right","cursor-pointer"],[3,"ngModel","binary","ngModelChange"],["pTooltip","All System APIs",1,"float-right","cursor-pointer"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped system-api-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],["style","width: 140px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","140px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],["class","d-inline-block small font-weight-bold font-monospaced ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-success ml-2",4,"ngIf"],["class","d-inline-block small font-weight-bold font-monospaced text-warning ml-2",4,"ngIf"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-success","ml-2"],[1,"d-inline-block","small","font-weight-bold","font-monospaced","text-warning","ml-2"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:",1,"btn","btn-xsm-custom","mr-1",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["class","btn btn-xsm-custom mr-1","pTooltip","Add System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom mr-1","pTooltip","Edit System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["class","btn btn-xsm-custom","pTooltip","Permanent Delete System API Setting","tooltipPosition","left",3,"click",4,"ngIf"],["pTooltip","Add System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-plus","text-success","fa-fw","cursor-pointer"],["pTooltip","Edit System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom","mr-1",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw","cursor-pointer"],["pTooltip","Permanent Delete System API Setting","tooltipPosition","left",1,"btn","btn-xsm-custom",3,"click"],[1,"far","fa-trash-alt","fa-fw","cursor-pointer","text-danger"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(n,_){1&n&&(t.TgZ(0,"div",0)(1,"div",1)(2,"span"),t._UZ(3,"img",2),t._uU(4," System APIs"),t.qZA(),t.TgZ(5,"div",3)(6,"a",4),t._UZ(7,"img",5),t.qZA()(),t.YNc(8,X,2,2,"span",6),t.YNc(9,z,2,2,"span",7),t.qZA(),t.TgZ(10,"div",8),t.YNc(11,q,3,1,"div",9),t.YNc(12,ht,5,7,"div",10),t.qZA()(),t._UZ(13,"app-w-system-api-form",11,12)),2&n&&(t.xp6(8),t.Q6J("ngIf",_.isDependentOnGroup),t.xp6(1),t.Q6J("ngIf",_.isFilterLogTable),t.xp6(2),t.Q6J("ngIf",_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis),t.xp6(1),t.Q6J("ngIf",!(_.eventCenterS.group.apisRegex.allSystemApis||_.eventCenterS.filterInLog.apisRegex.allSystemApis)),t.xp6(1),t.Q6J("data",_.data))},dependencies:[W.rH,w.JJ,w.On,J.O5,x.iA,U.jx,x.Ei,x.UA,x.Mo,Q.G,H.u,k.XZ,j.S],encapsulation:2})}return i})()}}]);
|